Date: 2019-12-26 00:48:41 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 15216 rows and 75 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] 15216 75
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:skmeans | 2 | 1.000 | 0.968 | 0.988 | ** | |
MAD:skmeans | 2 | 1.000 | 0.965 | 0.986 | ** | |
MAD:NMF | 2 | 0.998 | 0.957 | 0.981 | ** | |
ATC:NMF | 3 | 0.981 | 0.917 | 0.970 | ** | |
ATC:hclust | 5 | 0.961 | 0.898 | 0.950 | ** | |
SD:skmeans | 2 | 0.944 | 0.941 | 0.977 | * | |
ATC:pam | 6 | 0.932 | 0.902 | 0.959 | * | 2 |
ATC:skmeans | 4 | 0.916 | 0.912 | 0.957 | * | 3 |
MAD:pam | 2 | 0.891 | 0.937 | 0.971 | ||
CV:pam | 2 | 0.883 | 0.918 | 0.963 | ||
CV:NMF | 2 | 0.813 | 0.904 | 0.958 | ||
SD:pam | 2 | 0.788 | 0.922 | 0.961 | ||
SD:NMF | 2 | 0.765 | 0.876 | 0.947 | ||
CV:hclust | 2 | 0.653 | 0.796 | 0.907 | ||
CV:kmeans | 2 | 0.639 | 0.864 | 0.912 | ||
SD:mclust | 3 | 0.619 | 0.815 | 0.881 | ||
SD:hclust | 6 | 0.619 | 0.700 | 0.834 | ||
MAD:hclust | 2 | 0.576 | 0.844 | 0.927 | ||
ATC:kmeans | 2 | 0.550 | 0.890 | 0.939 | ||
MAD:kmeans | 2 | 0.533 | 0.884 | 0.909 | ||
ATC:mclust | 3 | 0.530 | 0.793 | 0.890 | ||
MAD:mclust | 2 | 0.462 | 0.780 | 0.871 | ||
CV:mclust | 2 | 0.412 | 0.783 | 0.868 | ||
SD:kmeans | 2 | 0.384 | 0.688 | 0.762 |
**: 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.765 0.876 0.947 0.491 0.498 0.498
#> CV:NMF 2 0.813 0.904 0.958 0.493 0.501 0.501
#> MAD:NMF 2 0.998 0.957 0.981 0.499 0.504 0.504
#> ATC:NMF 2 0.707 0.846 0.934 0.424 0.604 0.604
#> SD:skmeans 2 0.944 0.941 0.977 0.505 0.498 0.498
#> CV:skmeans 2 1.000 0.968 0.988 0.505 0.494 0.494
#> MAD:skmeans 2 1.000 0.965 0.986 0.504 0.498 0.498
#> ATC:skmeans 2 0.536 0.779 0.901 0.497 0.498 0.498
#> SD:mclust 2 0.444 0.693 0.811 0.428 0.504 0.504
#> CV:mclust 2 0.412 0.783 0.868 0.449 0.501 0.501
#> MAD:mclust 2 0.462 0.780 0.871 0.448 0.493 0.493
#> ATC:mclust 2 0.289 0.614 0.772 0.367 0.514 0.514
#> SD:kmeans 2 0.384 0.688 0.762 0.458 0.498 0.498
#> CV:kmeans 2 0.639 0.864 0.912 0.479 0.498 0.498
#> MAD:kmeans 2 0.533 0.884 0.909 0.482 0.504 0.504
#> ATC:kmeans 2 0.550 0.890 0.939 0.457 0.559 0.559
#> SD:pam 2 0.788 0.922 0.961 0.481 0.504 0.504
#> CV:pam 2 0.883 0.918 0.963 0.484 0.508 0.508
#> MAD:pam 2 0.891 0.937 0.971 0.486 0.504 0.504
#> ATC:pam 2 0.972 0.942 0.974 0.409 0.580 0.580
#> SD:hclust 2 0.330 0.567 0.807 0.452 0.494 0.494
#> CV:hclust 2 0.653 0.796 0.907 0.448 0.514 0.514
#> MAD:hclust 2 0.576 0.844 0.927 0.480 0.526 0.526
#> ATC:hclust 2 0.412 0.835 0.874 0.469 0.494 0.494
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 0.627 0.781 0.891 0.250 0.659 0.442
#> CV:NMF 3 0.509 0.704 0.837 0.289 0.667 0.449
#> MAD:NMF 3 0.568 0.716 0.868 0.265 0.657 0.434
#> ATC:NMF 3 0.981 0.917 0.970 0.283 0.792 0.674
#> SD:skmeans 3 0.737 0.887 0.914 0.308 0.765 0.559
#> CV:skmeans 3 0.506 0.654 0.779 0.276 0.861 0.723
#> MAD:skmeans 3 0.717 0.841 0.896 0.303 0.788 0.595
#> ATC:skmeans 3 0.907 0.931 0.967 0.338 0.737 0.520
#> SD:mclust 3 0.619 0.815 0.881 0.490 0.762 0.559
#> CV:mclust 3 0.347 0.643 0.714 0.369 0.743 0.551
#> MAD:mclust 3 0.412 0.605 0.804 0.356 0.854 0.712
#> ATC:mclust 3 0.530 0.793 0.890 0.610 0.621 0.433
#> SD:kmeans 3 0.454 0.656 0.806 0.359 0.785 0.597
#> CV:kmeans 3 0.451 0.644 0.797 0.265 0.972 0.944
#> MAD:kmeans 3 0.476 0.638 0.777 0.301 0.872 0.748
#> ATC:kmeans 3 0.607 0.723 0.839 0.359 0.615 0.398
#> SD:pam 3 0.821 0.889 0.944 0.189 0.931 0.863
#> CV:pam 3 0.771 0.775 0.885 0.163 0.910 0.826
#> MAD:pam 3 0.845 0.897 0.932 0.162 0.931 0.863
#> ATC:pam 3 0.707 0.898 0.927 0.449 0.692 0.518
#> SD:hclust 3 0.342 0.515 0.664 0.146 0.658 0.462
#> CV:hclust 3 0.560 0.707 0.826 0.180 1.000 1.000
#> MAD:hclust 3 0.635 0.724 0.886 0.206 0.888 0.786
#> ATC:hclust 3 0.771 0.822 0.907 0.268 0.935 0.869
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.477 0.656 0.800 0.1437 0.831 0.610
#> CV:NMF 4 0.411 0.465 0.675 0.1443 0.722 0.403
#> MAD:NMF 4 0.496 0.570 0.776 0.1341 0.792 0.517
#> ATC:NMF 4 0.621 0.794 0.882 0.2282 0.816 0.620
#> SD:skmeans 4 0.672 0.827 0.870 0.1212 0.862 0.621
#> CV:skmeans 4 0.529 0.516 0.703 0.1483 0.814 0.545
#> MAD:skmeans 4 0.643 0.783 0.834 0.1249 0.859 0.618
#> ATC:skmeans 4 0.916 0.912 0.957 0.1061 0.892 0.694
#> SD:mclust 4 0.535 0.737 0.814 0.0932 0.867 0.651
#> CV:mclust 4 0.467 0.612 0.738 0.1346 0.880 0.709
#> MAD:mclust 4 0.608 0.700 0.806 0.1593 0.777 0.486
#> ATC:mclust 4 0.610 0.691 0.812 0.2186 0.627 0.314
#> SD:kmeans 4 0.535 0.666 0.766 0.1284 0.942 0.841
#> CV:kmeans 4 0.399 0.548 0.644 0.1180 0.885 0.760
#> MAD:kmeans 4 0.497 0.613 0.743 0.1190 0.908 0.770
#> ATC:kmeans 4 0.693 0.695 0.838 0.1488 0.944 0.835
#> SD:pam 4 0.836 0.897 0.927 0.1312 0.950 0.884
#> CV:pam 4 0.719 0.813 0.899 0.1025 0.935 0.853
#> MAD:pam 4 0.773 0.906 0.911 0.1496 0.950 0.884
#> ATC:pam 4 0.865 0.848 0.939 0.1231 0.928 0.820
#> SD:hclust 4 0.606 0.690 0.848 0.2283 0.800 0.576
#> CV:hclust 4 0.712 0.690 0.817 0.1870 0.877 0.761
#> MAD:hclust 4 0.590 0.673 0.841 0.0964 0.921 0.818
#> ATC:hclust 4 0.848 0.823 0.910 0.1300 0.937 0.852
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.499 0.496 0.694 0.0922 0.836 0.539
#> CV:NMF 5 0.494 0.397 0.630 0.0809 0.793 0.408
#> MAD:NMF 5 0.530 0.531 0.722 0.0793 0.870 0.600
#> ATC:NMF 5 0.562 0.575 0.683 0.0938 0.858 0.590
#> SD:skmeans 5 0.642 0.606 0.754 0.0669 0.988 0.955
#> CV:skmeans 5 0.541 0.382 0.616 0.0699 0.897 0.638
#> MAD:skmeans 5 0.640 0.644 0.738 0.0661 0.977 0.914
#> ATC:skmeans 5 0.840 0.824 0.872 0.0495 0.922 0.730
#> SD:mclust 5 0.542 0.559 0.741 0.0898 0.901 0.680
#> CV:mclust 5 0.520 0.577 0.694 0.0826 0.920 0.767
#> MAD:mclust 5 0.613 0.558 0.700 0.0843 0.916 0.717
#> ATC:mclust 5 0.701 0.745 0.847 0.0349 0.991 0.968
#> SD:kmeans 5 0.544 0.557 0.696 0.0760 0.994 0.981
#> CV:kmeans 5 0.434 0.276 0.641 0.0832 0.863 0.677
#> MAD:kmeans 5 0.511 0.518 0.687 0.0751 0.923 0.774
#> ATC:kmeans 5 0.741 0.566 0.728 0.0715 0.944 0.832
#> SD:pam 5 0.716 0.828 0.904 0.1592 0.866 0.651
#> CV:pam 5 0.632 0.614 0.835 0.1039 0.959 0.894
#> MAD:pam 5 0.845 0.875 0.936 0.1532 0.849 0.615
#> ATC:pam 5 0.779 0.823 0.861 0.0827 0.919 0.784
#> SD:hclust 5 0.578 0.651 0.816 0.0802 0.939 0.818
#> CV:hclust 5 0.757 0.715 0.815 0.0528 0.959 0.895
#> MAD:hclust 5 0.592 0.588 0.786 0.1170 0.915 0.773
#> ATC:hclust 5 0.961 0.898 0.950 0.1096 0.874 0.655
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.533 0.406 0.635 0.0591 0.856 0.494
#> CV:NMF 6 0.557 0.460 0.598 0.0457 0.914 0.636
#> MAD:NMF 6 0.555 0.420 0.620 0.0583 0.859 0.488
#> ATC:NMF 6 0.576 0.282 0.592 0.0609 0.805 0.419
#> SD:skmeans 6 0.664 0.472 0.654 0.0440 0.876 0.532
#> CV:skmeans 6 0.552 0.399 0.606 0.0442 0.925 0.686
#> MAD:skmeans 6 0.653 0.501 0.641 0.0438 0.898 0.618
#> ATC:skmeans 6 0.824 0.829 0.865 0.0380 0.951 0.800
#> SD:mclust 6 0.632 0.594 0.732 0.0571 0.894 0.583
#> CV:mclust 6 0.567 0.494 0.646 0.0679 0.842 0.480
#> MAD:mclust 6 0.614 0.590 0.692 0.0545 0.901 0.613
#> ATC:mclust 6 0.595 0.598 0.736 0.0600 0.874 0.560
#> SD:kmeans 6 0.562 0.320 0.645 0.0490 0.945 0.825
#> CV:kmeans 6 0.458 0.309 0.582 0.0538 0.943 0.842
#> MAD:kmeans 6 0.549 0.420 0.631 0.0527 0.916 0.729
#> ATC:kmeans 6 0.710 0.593 0.751 0.0480 0.888 0.663
#> SD:pam 6 0.773 0.797 0.878 0.0540 0.944 0.783
#> CV:pam 6 0.575 0.663 0.819 0.0681 0.931 0.807
#> MAD:pam 6 0.799 0.785 0.880 0.0593 0.947 0.795
#> ATC:pam 6 0.932 0.902 0.959 0.1169 0.874 0.616
#> SD:hclust 6 0.619 0.700 0.834 0.0287 0.956 0.869
#> CV:hclust 6 0.636 0.699 0.788 0.0586 0.895 0.725
#> MAD:hclust 6 0.627 0.562 0.780 0.0385 0.974 0.917
#> ATC:hclust 6 0.926 0.884 0.925 0.0253 0.997 0.988
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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.330 0.567 0.807 0.4520 0.494 0.494
#> 3 3 0.342 0.515 0.664 0.1461 0.658 0.462
#> 4 4 0.606 0.690 0.848 0.2283 0.800 0.576
#> 5 5 0.578 0.651 0.816 0.0802 0.939 0.818
#> 6 6 0.619 0.700 0.834 0.0287 0.956 0.869
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
#> SRR1818631 2 0.9954 0.17121 0.460 0.540
#> SRR1818632 2 0.9954 0.17121 0.460 0.540
#> SRR1818679 2 0.9963 0.34408 0.464 0.536
#> SRR1818680 2 0.9963 0.34408 0.464 0.536
#> SRR1818677 1 0.6973 0.57441 0.812 0.188
#> SRR1818678 1 0.6973 0.57441 0.812 0.188
#> SRR1818675 2 0.0000 0.56150 0.000 1.000
#> SRR1818676 2 0.0000 0.56150 0.000 1.000
#> SRR1818673 2 0.9896 0.41185 0.440 0.560
#> SRR1818674 2 0.9896 0.41185 0.440 0.560
#> SRR1818671 2 0.9323 0.54174 0.348 0.652
#> SRR1818672 2 0.9323 0.54174 0.348 0.652
#> SRR1818661 2 0.9944 0.17766 0.456 0.544
#> SRR1818662 2 0.9944 0.17766 0.456 0.544
#> SRR1818655 1 0.0000 0.86357 1.000 0.000
#> SRR1818656 1 0.0000 0.86357 1.000 0.000
#> SRR1818653 2 0.9954 0.17121 0.460 0.540
#> SRR1818654 2 0.9954 0.17121 0.460 0.540
#> SRR1818651 1 0.0000 0.86357 1.000 0.000
#> SRR1818652 1 0.0000 0.86357 1.000 0.000
#> SRR1818657 1 0.0000 0.86357 1.000 0.000
#> SRR1818658 1 0.0000 0.86357 1.000 0.000
#> SRR1818649 1 0.0376 0.86012 0.996 0.004
#> SRR1818650 1 0.0376 0.86012 0.996 0.004
#> SRR1818659 1 0.0000 0.86357 1.000 0.000
#> SRR1818647 2 0.0000 0.56150 0.000 1.000
#> SRR1818648 2 0.0000 0.56150 0.000 1.000
#> SRR1818645 2 0.9323 0.54174 0.348 0.652
#> SRR1818646 2 0.9323 0.54174 0.348 0.652
#> SRR1818639 1 0.0000 0.86357 1.000 0.000
#> SRR1818640 1 0.0000 0.86357 1.000 0.000
#> SRR1818637 2 0.0000 0.56150 0.000 1.000
#> SRR1818638 2 0.0000 0.56150 0.000 1.000
#> SRR1818635 2 0.9896 0.41185 0.440 0.560
#> SRR1818636 2 0.9896 0.41185 0.440 0.560
#> SRR1818643 1 0.5629 0.67384 0.868 0.132
#> SRR1818644 1 0.5629 0.67384 0.868 0.132
#> SRR1818641 1 0.9993 -0.28753 0.516 0.484
#> SRR1818642 1 0.9993 -0.28753 0.516 0.484
#> SRR1818633 1 0.9795 0.00454 0.584 0.416
#> SRR1818634 1 0.9795 0.00454 0.584 0.416
#> SRR1818665 1 0.0000 0.86357 1.000 0.000
#> SRR1818666 1 0.0000 0.86357 1.000 0.000
#> SRR1818667 2 0.9323 0.54174 0.348 0.652
#> SRR1818668 2 0.9323 0.54174 0.348 0.652
#> SRR1818669 1 0.0000 0.86357 1.000 0.000
#> SRR1818670 1 0.0000 0.86357 1.000 0.000
#> SRR1818663 1 0.0000 0.86357 1.000 0.000
#> SRR1818664 1 0.0000 0.86357 1.000 0.000
#> SRR1818629 2 0.9323 0.54174 0.348 0.652
#> SRR1818630 2 0.9323 0.54174 0.348 0.652
#> SRR1818627 1 0.0000 0.86357 1.000 0.000
#> SRR1818628 1 0.0000 0.86357 1.000 0.000
#> SRR1818621 2 0.9954 0.17121 0.460 0.540
#> SRR1818622 2 0.9954 0.17121 0.460 0.540
#> SRR1818625 1 0.0000 0.86357 1.000 0.000
#> SRR1818626 1 0.0000 0.86357 1.000 0.000
#> SRR1818623 2 0.9000 0.36151 0.316 0.684
#> SRR1818624 2 0.9000 0.36151 0.316 0.684
#> SRR1818619 1 0.0000 0.86357 1.000 0.000
#> SRR1818620 1 0.0000 0.86357 1.000 0.000
#> SRR1818617 1 0.0000 0.86357 1.000 0.000
#> SRR1818618 1 0.0000 0.86357 1.000 0.000
#> SRR1818615 2 0.9323 0.54174 0.348 0.652
#> SRR1818616 2 0.9323 0.54174 0.348 0.652
#> SRR1818609 2 0.0000 0.56150 0.000 1.000
#> SRR1818610 2 0.0000 0.56150 0.000 1.000
#> SRR1818607 2 0.9323 0.54174 0.348 0.652
#> SRR1818608 2 0.9323 0.54174 0.348 0.652
#> SRR1818613 1 0.0000 0.86357 1.000 0.000
#> SRR1818614 1 0.0000 0.86357 1.000 0.000
#> SRR1818611 1 0.0376 0.86012 0.996 0.004
#> SRR1818612 1 0.0376 0.86012 0.996 0.004
#> SRR1818605 1 0.9850 0.04927 0.572 0.428
#> SRR1818606 1 0.9850 0.04927 0.572 0.428
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.5178 0.1060 0.744 0.000 0.256
#> SRR1818632 1 0.5178 0.1060 0.744 0.000 0.256
#> SRR1818679 2 0.5643 0.5952 0.220 0.760 0.020
#> SRR1818680 2 0.5643 0.5952 0.220 0.760 0.020
#> SRR1818677 2 0.6286 -0.3324 0.464 0.536 0.000
#> SRR1818678 2 0.6286 -0.3324 0.464 0.536 0.000
#> SRR1818675 3 0.9223 0.6453 0.200 0.272 0.528
#> SRR1818676 3 0.9223 0.6453 0.200 0.272 0.528
#> SRR1818673 2 0.2796 0.6814 0.092 0.908 0.000
#> SRR1818674 2 0.2796 0.6814 0.092 0.908 0.000
#> SRR1818671 2 0.0592 0.6820 0.000 0.988 0.012
#> SRR1818672 2 0.0592 0.6820 0.000 0.988 0.012
#> SRR1818661 1 0.6442 -0.2474 0.564 0.004 0.432
#> SRR1818662 1 0.6442 -0.2474 0.564 0.004 0.432
#> SRR1818655 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818656 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818653 1 0.5216 0.0996 0.740 0.000 0.260
#> SRR1818654 1 0.5216 0.0996 0.740 0.000 0.260
#> SRR1818651 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818652 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818657 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818658 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818649 1 0.5905 0.7399 0.648 0.352 0.000
#> SRR1818650 1 0.5905 0.7399 0.648 0.352 0.000
#> SRR1818659 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818647 2 0.6154 -0.4364 0.000 0.592 0.408
#> SRR1818648 2 0.6154 -0.4364 0.000 0.592 0.408
#> SRR1818645 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818646 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818639 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818640 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818637 3 0.6225 0.5859 0.000 0.432 0.568
#> SRR1818638 3 0.6225 0.5859 0.000 0.432 0.568
#> SRR1818635 2 0.2796 0.6814 0.092 0.908 0.000
#> SRR1818636 2 0.2796 0.6814 0.092 0.908 0.000
#> SRR1818643 1 0.6302 0.5000 0.520 0.480 0.000
#> SRR1818644 1 0.6302 0.5000 0.520 0.480 0.000
#> SRR1818641 2 0.4121 0.6167 0.168 0.832 0.000
#> SRR1818642 2 0.4121 0.6167 0.168 0.832 0.000
#> SRR1818633 2 0.5733 0.3244 0.324 0.676 0.000
#> SRR1818634 2 0.5733 0.3244 0.324 0.676 0.000
#> SRR1818665 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818666 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818667 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818668 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818669 1 0.5835 0.7389 0.660 0.340 0.000
#> SRR1818670 1 0.5835 0.7389 0.660 0.340 0.000
#> SRR1818663 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818664 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818629 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818630 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818627 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818628 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818621 1 0.5216 0.0996 0.740 0.000 0.260
#> SRR1818622 1 0.5216 0.0996 0.740 0.000 0.260
#> SRR1818625 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818626 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818623 3 0.9746 0.5756 0.240 0.328 0.432
#> SRR1818624 3 0.9746 0.5756 0.240 0.328 0.432
#> SRR1818619 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818620 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818617 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818618 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818615 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818616 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818609 2 0.6154 -0.4364 0.000 0.592 0.408
#> SRR1818610 2 0.6154 -0.4364 0.000 0.592 0.408
#> SRR1818607 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818608 2 0.0000 0.6902 0.000 1.000 0.000
#> SRR1818613 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818614 1 0.5882 0.7449 0.652 0.348 0.000
#> SRR1818611 1 0.5905 0.7399 0.648 0.352 0.000
#> SRR1818612 1 0.5905 0.7399 0.648 0.352 0.000
#> SRR1818605 1 0.7676 0.3249 0.672 0.112 0.216
#> SRR1818606 1 0.7676 0.3249 0.672 0.112 0.216
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.4936 0.674 0.372 0.004 0.624 0.000
#> SRR1818632 3 0.4936 0.674 0.372 0.004 0.624 0.000
#> SRR1818679 2 0.6056 0.585 0.248 0.660 0.092 0.000
#> SRR1818680 2 0.6056 0.585 0.248 0.660 0.092 0.000
#> SRR1818677 1 0.3486 0.672 0.812 0.188 0.000 0.000
#> SRR1818678 1 0.3486 0.672 0.812 0.188 0.000 0.000
#> SRR1818675 4 0.4713 0.278 0.000 0.000 0.360 0.640
#> SRR1818676 4 0.4713 0.278 0.000 0.000 0.360 0.640
#> SRR1818673 2 0.3356 0.708 0.176 0.824 0.000 0.000
#> SRR1818674 2 0.3356 0.708 0.176 0.824 0.000 0.000
#> SRR1818671 2 0.0657 0.740 0.004 0.984 0.000 0.012
#> SRR1818672 2 0.0657 0.740 0.004 0.984 0.000 0.012
#> SRR1818661 3 0.1557 0.321 0.056 0.000 0.944 0.000
#> SRR1818662 3 0.1557 0.321 0.056 0.000 0.944 0.000
#> SRR1818655 1 0.1716 0.879 0.936 0.000 0.064 0.000
#> SRR1818656 1 0.1716 0.879 0.936 0.000 0.064 0.000
#> SRR1818653 3 0.4730 0.681 0.364 0.000 0.636 0.000
#> SRR1818654 3 0.4730 0.681 0.364 0.000 0.636 0.000
#> SRR1818651 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818658 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818649 1 0.0188 0.928 0.996 0.004 0.000 0.000
#> SRR1818650 1 0.0188 0.928 0.996 0.004 0.000 0.000
#> SRR1818659 1 0.0921 0.910 0.972 0.000 0.028 0.000
#> SRR1818647 4 0.4961 0.482 0.000 0.448 0.000 0.552
#> SRR1818648 4 0.4961 0.482 0.000 0.448 0.000 0.552
#> SRR1818645 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818646 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818639 1 0.0817 0.914 0.976 0.000 0.024 0.000
#> SRR1818640 1 0.0817 0.914 0.976 0.000 0.024 0.000
#> SRR1818637 4 0.0000 0.508 0.000 0.000 0.000 1.000
#> SRR1818638 4 0.0000 0.508 0.000 0.000 0.000 1.000
#> SRR1818635 2 0.3356 0.708 0.176 0.824 0.000 0.000
#> SRR1818636 2 0.3356 0.708 0.176 0.824 0.000 0.000
#> SRR1818643 1 0.5859 0.392 0.652 0.284 0.064 0.000
#> SRR1818644 1 0.5859 0.392 0.652 0.284 0.064 0.000
#> SRR1818641 2 0.4706 0.640 0.248 0.732 0.020 0.000
#> SRR1818642 2 0.4706 0.640 0.248 0.732 0.020 0.000
#> SRR1818633 2 0.6140 0.274 0.452 0.500 0.048 0.000
#> SRR1818634 2 0.6140 0.274 0.452 0.500 0.048 0.000
#> SRR1818665 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818666 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818667 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818668 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818669 1 0.1109 0.904 0.968 0.004 0.028 0.000
#> SRR1818670 1 0.1109 0.904 0.968 0.004 0.028 0.000
#> SRR1818663 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818629 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818630 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818627 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818628 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818621 3 0.4730 0.681 0.364 0.000 0.636 0.000
#> SRR1818622 3 0.4730 0.681 0.364 0.000 0.636 0.000
#> SRR1818625 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818626 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818623 3 0.7756 -0.430 0.000 0.252 0.428 0.320
#> SRR1818624 3 0.7756 -0.430 0.000 0.252 0.428 0.320
#> SRR1818619 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818620 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818617 1 0.1716 0.879 0.936 0.000 0.064 0.000
#> SRR1818618 1 0.1716 0.879 0.936 0.000 0.064 0.000
#> SRR1818615 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818616 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818609 4 0.4961 0.482 0.000 0.448 0.000 0.552
#> SRR1818610 4 0.4961 0.482 0.000 0.448 0.000 0.552
#> SRR1818607 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818608 2 0.0188 0.751 0.004 0.996 0.000 0.000
#> SRR1818613 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.930 1.000 0.000 0.000 0.000
#> SRR1818611 1 0.0188 0.928 0.996 0.004 0.000 0.000
#> SRR1818612 1 0.0188 0.928 0.996 0.004 0.000 0.000
#> SRR1818605 3 0.4996 0.394 0.484 0.000 0.516 0.000
#> SRR1818606 3 0.4996 0.394 0.484 0.000 0.516 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.8137 0.3937 0.196 0.000 0.368 0.124 0.312
#> SRR1818632 3 0.8137 0.3937 0.196 0.000 0.368 0.124 0.312
#> SRR1818679 2 0.6125 0.6231 0.224 0.660 0.044 0.032 0.040
#> SRR1818680 2 0.6125 0.6231 0.224 0.660 0.044 0.032 0.040
#> SRR1818677 1 0.3003 0.6898 0.812 0.188 0.000 0.000 0.000
#> SRR1818678 1 0.3003 0.6898 0.812 0.188 0.000 0.000 0.000
#> SRR1818675 5 0.6211 0.6147 0.000 0.000 0.248 0.204 0.548
#> SRR1818676 5 0.6211 0.6147 0.000 0.000 0.248 0.204 0.548
#> SRR1818673 2 0.3010 0.7582 0.172 0.824 0.000 0.004 0.000
#> SRR1818674 2 0.3010 0.7582 0.172 0.824 0.000 0.004 0.000
#> SRR1818671 2 0.0404 0.8238 0.000 0.988 0.000 0.012 0.000
#> SRR1818672 2 0.0404 0.8238 0.000 0.988 0.000 0.012 0.000
#> SRR1818661 4 0.6731 -0.0681 0.004 0.000 0.232 0.452 0.312
#> SRR1818662 4 0.6731 -0.0681 0.004 0.000 0.232 0.452 0.312
#> SRR1818655 1 0.3096 0.7750 0.868 0.000 0.084 0.040 0.008
#> SRR1818656 1 0.3096 0.7750 0.868 0.000 0.084 0.040 0.008
#> SRR1818653 3 0.1544 0.5386 0.068 0.000 0.932 0.000 0.000
#> SRR1818654 3 0.1544 0.5386 0.068 0.000 0.932 0.000 0.000
#> SRR1818651 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818658 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818649 1 0.0324 0.8507 0.992 0.004 0.004 0.000 0.000
#> SRR1818650 1 0.0324 0.8507 0.992 0.004 0.004 0.000 0.000
#> SRR1818659 1 0.3816 0.5030 0.696 0.000 0.304 0.000 0.000
#> SRR1818647 4 0.6448 0.3452 0.000 0.272 0.000 0.500 0.228
#> SRR1818648 4 0.6448 0.3452 0.000 0.272 0.000 0.500 0.228
#> SRR1818645 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818646 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818639 1 0.2329 0.7729 0.876 0.000 0.124 0.000 0.000
#> SRR1818640 1 0.2329 0.7729 0.876 0.000 0.124 0.000 0.000
#> SRR1818637 5 0.3913 0.5850 0.000 0.000 0.000 0.324 0.676
#> SRR1818638 5 0.3913 0.5850 0.000 0.000 0.000 0.324 0.676
#> SRR1818635 2 0.3010 0.7582 0.172 0.824 0.000 0.004 0.000
#> SRR1818636 2 0.3010 0.7582 0.172 0.824 0.000 0.004 0.000
#> SRR1818643 1 0.6523 0.3650 0.580 0.288 0.084 0.040 0.008
#> SRR1818644 1 0.6523 0.3650 0.580 0.288 0.084 0.040 0.008
#> SRR1818641 2 0.4543 0.6831 0.224 0.732 0.024 0.020 0.000
#> SRR1818642 2 0.4543 0.6831 0.224 0.732 0.024 0.020 0.000
#> SRR1818633 1 0.6839 0.0255 0.440 0.328 0.008 0.224 0.000
#> SRR1818634 1 0.6839 0.0255 0.440 0.328 0.008 0.224 0.000
#> SRR1818665 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818666 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818667 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818668 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818669 1 0.3583 0.6282 0.792 0.000 0.192 0.012 0.004
#> SRR1818670 1 0.3583 0.6282 0.792 0.000 0.192 0.012 0.004
#> SRR1818663 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818629 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818630 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818627 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818628 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818621 3 0.1544 0.5386 0.068 0.000 0.932 0.000 0.000
#> SRR1818622 3 0.1544 0.5386 0.068 0.000 0.932 0.000 0.000
#> SRR1818625 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818626 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818623 4 0.1831 0.1978 0.000 0.076 0.004 0.920 0.000
#> SRR1818624 4 0.1831 0.1978 0.000 0.076 0.004 0.920 0.000
#> SRR1818619 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818620 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818617 1 0.3096 0.7750 0.868 0.000 0.084 0.040 0.008
#> SRR1818618 1 0.3096 0.7750 0.868 0.000 0.084 0.040 0.008
#> SRR1818615 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818616 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818609 4 0.6448 0.3452 0.000 0.272 0.000 0.500 0.228
#> SRR1818610 4 0.6448 0.3452 0.000 0.272 0.000 0.500 0.228
#> SRR1818607 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818608 2 0.0000 0.8338 0.000 1.000 0.000 0.000 0.000
#> SRR1818613 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.8526 1.000 0.000 0.000 0.000 0.000
#> SRR1818611 1 0.0324 0.8507 0.992 0.004 0.004 0.000 0.000
#> SRR1818612 1 0.0324 0.8507 0.992 0.004 0.004 0.000 0.000
#> SRR1818605 3 0.6596 0.2865 0.416 0.000 0.460 0.080 0.044
#> SRR1818606 3 0.6596 0.2865 0.416 0.000 0.460 0.080 0.044
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.5220 0.6432 0.140 0.000 0.708 0.012 0.044 0.096
#> SRR1818632 3 0.5220 0.6432 0.140 0.000 0.708 0.012 0.044 0.096
#> SRR1818679 2 0.5672 0.5833 0.200 0.656 0.060 0.016 0.000 0.068
#> SRR1818680 2 0.5672 0.5833 0.200 0.656 0.060 0.016 0.000 0.068
#> SRR1818677 1 0.2882 0.7170 0.812 0.180 0.000 0.000 0.000 0.008
#> SRR1818678 1 0.2882 0.7170 0.812 0.180 0.000 0.000 0.000 0.008
#> SRR1818675 4 0.6352 0.4493 0.000 0.000 0.108 0.568 0.208 0.116
#> SRR1818676 4 0.6352 0.4493 0.000 0.000 0.108 0.568 0.208 0.116
#> SRR1818673 2 0.3037 0.7220 0.160 0.820 0.000 0.004 0.000 0.016
#> SRR1818674 2 0.3037 0.7220 0.160 0.820 0.000 0.004 0.000 0.016
#> SRR1818671 2 0.1265 0.7756 0.000 0.948 0.000 0.008 0.000 0.044
#> SRR1818672 2 0.1265 0.7756 0.000 0.948 0.000 0.008 0.000 0.044
#> SRR1818661 3 0.2450 0.5984 0.000 0.000 0.868 0.116 0.016 0.000
#> SRR1818662 3 0.2450 0.5984 0.000 0.000 0.868 0.116 0.016 0.000
#> SRR1818655 1 0.2742 0.7704 0.852 0.000 0.012 0.000 0.008 0.128
#> SRR1818656 1 0.2742 0.7704 0.852 0.000 0.012 0.000 0.008 0.128
#> SRR1818653 5 0.0260 1.0000 0.008 0.000 0.000 0.000 0.992 0.000
#> SRR1818654 5 0.0260 1.0000 0.008 0.000 0.000 0.000 0.992 0.000
#> SRR1818651 1 0.0146 0.8295 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1818652 1 0.0146 0.8295 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1818657 1 0.0405 0.8288 0.988 0.000 0.000 0.004 0.000 0.008
#> SRR1818658 1 0.0405 0.8288 0.988 0.000 0.000 0.004 0.000 0.008
#> SRR1818649 1 0.0291 0.8293 0.992 0.004 0.000 0.000 0.000 0.004
#> SRR1818650 1 0.0291 0.8293 0.992 0.004 0.000 0.000 0.000 0.004
#> SRR1818659 1 0.3659 0.5074 0.636 0.000 0.000 0.000 0.364 0.000
#> SRR1818647 6 0.3431 1.0000 0.000 0.228 0.000 0.016 0.000 0.756
#> SRR1818648 6 0.3431 1.0000 0.000 0.228 0.000 0.016 0.000 0.756
#> SRR1818645 2 0.0000 0.7925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818646 2 0.0000 0.7925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818639 1 0.2664 0.7385 0.816 0.000 0.000 0.000 0.184 0.000
#> SRR1818640 1 0.2664 0.7385 0.816 0.000 0.000 0.000 0.184 0.000
#> SRR1818637 4 0.2491 0.5241 0.000 0.000 0.000 0.836 0.000 0.164
#> SRR1818638 4 0.2491 0.5241 0.000 0.000 0.000 0.836 0.000 0.164
#> SRR1818635 2 0.3037 0.7220 0.160 0.820 0.000 0.004 0.000 0.016
#> SRR1818636 2 0.3037 0.7220 0.160 0.820 0.000 0.004 0.000 0.016
#> SRR1818643 1 0.5981 0.3796 0.552 0.288 0.012 0.004 0.008 0.136
#> SRR1818644 1 0.5981 0.3796 0.552 0.288 0.012 0.004 0.008 0.136
#> SRR1818641 2 0.4230 0.6482 0.200 0.728 0.000 0.004 0.000 0.068
#> SRR1818642 2 0.4230 0.6482 0.200 0.728 0.000 0.004 0.000 0.068
#> SRR1818633 1 0.6903 0.0124 0.424 0.328 0.012 0.044 0.000 0.192
#> SRR1818634 1 0.6903 0.0124 0.424 0.328 0.012 0.044 0.000 0.192
#> SRR1818665 1 0.0260 0.8294 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR1818666 1 0.0260 0.8294 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR1818667 2 0.0937 0.7871 0.000 0.960 0.000 0.000 0.000 0.040
#> SRR1818668 2 0.0937 0.7871 0.000 0.960 0.000 0.000 0.000 0.040
#> SRR1818669 1 0.4865 0.5884 0.732 0.000 0.124 0.004 0.044 0.096
#> SRR1818670 1 0.4865 0.5884 0.732 0.000 0.124 0.004 0.044 0.096
#> SRR1818663 1 0.0000 0.8289 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 0.8289 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818629 2 0.0937 0.7871 0.000 0.960 0.000 0.000 0.000 0.040
#> SRR1818630 2 0.0937 0.7871 0.000 0.960 0.000 0.000 0.000 0.040
#> SRR1818627 1 0.0260 0.8294 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR1818628 1 0.0260 0.8294 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR1818621 5 0.0260 1.0000 0.008 0.000 0.000 0.000 0.992 0.000
#> SRR1818622 5 0.0260 1.0000 0.008 0.000 0.000 0.000 0.992 0.000
#> SRR1818625 1 0.0000 0.8289 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818626 1 0.0000 0.8289 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818623 4 0.6999 0.1429 0.000 0.064 0.272 0.384 0.000 0.280
#> SRR1818624 4 0.6999 0.1429 0.000 0.064 0.272 0.384 0.000 0.280
#> SRR1818619 1 0.0405 0.8288 0.988 0.000 0.000 0.004 0.000 0.008
#> SRR1818620 1 0.0405 0.8288 0.988 0.000 0.000 0.004 0.000 0.008
#> SRR1818617 1 0.2742 0.7704 0.852 0.000 0.012 0.000 0.008 0.128
#> SRR1818618 1 0.2742 0.7704 0.852 0.000 0.012 0.000 0.008 0.128
#> SRR1818615 2 0.0790 0.7900 0.000 0.968 0.000 0.000 0.000 0.032
#> SRR1818616 2 0.0790 0.7900 0.000 0.968 0.000 0.000 0.000 0.032
#> SRR1818609 6 0.3431 1.0000 0.000 0.228 0.000 0.016 0.000 0.756
#> SRR1818610 6 0.3431 1.0000 0.000 0.228 0.000 0.016 0.000 0.756
#> SRR1818607 2 0.0000 0.7925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818608 2 0.0000 0.7925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818613 1 0.0146 0.8295 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1818614 1 0.0146 0.8295 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1818611 1 0.0291 0.8293 0.992 0.004 0.000 0.000 0.000 0.004
#> SRR1818612 1 0.0291 0.8293 0.992 0.004 0.000 0.000 0.000 0.004
#> SRR1818605 1 0.7341 -0.0364 0.396 0.000 0.064 0.044 0.364 0.132
#> SRR1818606 1 0.7341 -0.0364 0.396 0.000 0.064 0.044 0.364 0.132
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 15216 rows and 75 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.384 0.688 0.762 0.458 0.498 0.498
#> 3 3 0.454 0.656 0.806 0.359 0.785 0.597
#> 4 4 0.535 0.666 0.766 0.128 0.942 0.841
#> 5 5 0.544 0.557 0.696 0.076 0.994 0.981
#> 6 6 0.562 0.320 0.645 0.049 0.945 0.825
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1818631 1 0.9580 0.469 0.620 0.380
#> SRR1818632 1 0.9580 0.469 0.620 0.380
#> SRR1818679 1 0.9850 0.057 0.572 0.428
#> SRR1818680 1 0.9850 0.057 0.572 0.428
#> SRR1818677 2 0.9850 0.669 0.428 0.572
#> SRR1818678 2 0.9850 0.669 0.428 0.572
#> SRR1818675 2 0.9358 0.107 0.352 0.648
#> SRR1818676 2 0.9358 0.107 0.352 0.648
#> SRR1818673 2 0.9732 0.691 0.404 0.596
#> SRR1818674 2 0.9732 0.691 0.404 0.596
#> SRR1818671 2 0.8267 0.715 0.260 0.740
#> SRR1818672 2 0.8267 0.715 0.260 0.740
#> SRR1818661 1 0.9963 0.335 0.536 0.464
#> SRR1818662 1 0.9963 0.335 0.536 0.464
#> SRR1818655 1 0.0376 0.857 0.996 0.004
#> SRR1818656 1 0.0376 0.857 0.996 0.004
#> SRR1818653 1 0.2948 0.828 0.948 0.052
#> SRR1818654 1 0.2948 0.828 0.948 0.052
#> SRR1818651 1 0.0938 0.855 0.988 0.012
#> SRR1818652 1 0.0938 0.855 0.988 0.012
#> SRR1818657 1 0.0376 0.857 0.996 0.004
#> SRR1818658 1 0.0376 0.857 0.996 0.004
#> SRR1818649 1 0.0000 0.857 1.000 0.000
#> SRR1818650 1 0.0000 0.857 1.000 0.000
#> SRR1818659 1 0.0000 0.857 1.000 0.000
#> SRR1818647 2 0.0000 0.634 0.000 1.000
#> SRR1818648 2 0.0000 0.634 0.000 1.000
#> SRR1818645 2 0.9358 0.714 0.352 0.648
#> SRR1818646 2 0.9358 0.714 0.352 0.648
#> SRR1818639 1 0.0376 0.857 0.996 0.004
#> SRR1818640 1 0.0376 0.857 0.996 0.004
#> SRR1818637 2 0.0376 0.637 0.004 0.996
#> SRR1818638 2 0.0376 0.637 0.004 0.996
#> SRR1818635 2 0.9896 0.660 0.440 0.560
#> SRR1818636 2 0.9896 0.660 0.440 0.560
#> SRR1818643 2 0.9944 0.639 0.456 0.544
#> SRR1818644 2 0.9944 0.639 0.456 0.544
#> SRR1818641 2 0.9944 0.639 0.456 0.544
#> SRR1818642 2 0.9944 0.639 0.456 0.544
#> SRR1818633 1 0.8909 0.331 0.692 0.308
#> SRR1818634 1 0.8909 0.331 0.692 0.308
#> SRR1818665 1 0.0000 0.857 1.000 0.000
#> SRR1818666 1 0.0000 0.857 1.000 0.000
#> SRR1818667 2 0.5737 0.693 0.136 0.864
#> SRR1818668 2 0.5737 0.693 0.136 0.864
#> SRR1818669 1 0.0000 0.857 1.000 0.000
#> SRR1818670 1 0.0000 0.857 1.000 0.000
#> SRR1818663 1 0.0000 0.857 1.000 0.000
#> SRR1818664 1 0.0000 0.857 1.000 0.000
#> SRR1818629 2 0.9710 0.694 0.400 0.600
#> SRR1818630 2 0.9710 0.694 0.400 0.600
#> SRR1818627 1 0.0672 0.856 0.992 0.008
#> SRR1818628 1 0.0672 0.856 0.992 0.008
#> SRR1818621 1 0.8861 0.559 0.696 0.304
#> SRR1818622 1 0.8861 0.559 0.696 0.304
#> SRR1818625 1 0.0000 0.857 1.000 0.000
#> SRR1818626 1 0.0000 0.857 1.000 0.000
#> SRR1818623 2 0.0376 0.637 0.004 0.996
#> SRR1818624 2 0.0376 0.637 0.004 0.996
#> SRR1818619 1 0.0376 0.857 0.996 0.004
#> SRR1818620 1 0.0376 0.857 0.996 0.004
#> SRR1818617 2 0.9896 0.655 0.440 0.560
#> SRR1818618 2 0.9896 0.655 0.440 0.560
#> SRR1818615 2 0.6712 0.704 0.176 0.824
#> SRR1818616 2 0.6712 0.704 0.176 0.824
#> SRR1818609 2 0.1184 0.643 0.016 0.984
#> SRR1818610 2 0.1184 0.643 0.016 0.984
#> SRR1818607 2 0.9358 0.714 0.352 0.648
#> SRR1818608 2 0.9358 0.714 0.352 0.648
#> SRR1818613 1 0.0938 0.855 0.988 0.012
#> SRR1818614 1 0.0938 0.855 0.988 0.012
#> SRR1818611 1 0.0000 0.857 1.000 0.000
#> SRR1818612 1 0.0000 0.857 1.000 0.000
#> SRR1818605 1 0.4161 0.798 0.916 0.084
#> SRR1818606 1 0.4161 0.798 0.916 0.084
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.5982 0.4975 0.328 0.004 0.668
#> SRR1818632 3 0.5982 0.4975 0.328 0.004 0.668
#> SRR1818679 3 0.9953 0.2694 0.344 0.288 0.368
#> SRR1818680 3 0.9953 0.2694 0.344 0.288 0.368
#> SRR1818677 2 0.5778 0.7068 0.200 0.768 0.032
#> SRR1818678 2 0.5778 0.7068 0.200 0.768 0.032
#> SRR1818675 3 0.4370 0.5716 0.076 0.056 0.868
#> SRR1818676 3 0.4370 0.5716 0.076 0.056 0.868
#> SRR1818673 2 0.4228 0.7303 0.148 0.844 0.008
#> SRR1818674 2 0.4228 0.7303 0.148 0.844 0.008
#> SRR1818671 2 0.3921 0.6629 0.016 0.872 0.112
#> SRR1818672 2 0.3921 0.6629 0.016 0.872 0.112
#> SRR1818661 3 0.5201 0.5666 0.236 0.004 0.760
#> SRR1818662 3 0.5201 0.5666 0.236 0.004 0.760
#> SRR1818655 1 0.3120 0.8674 0.908 0.012 0.080
#> SRR1818656 1 0.3120 0.8674 0.908 0.012 0.080
#> SRR1818653 1 0.5656 0.6310 0.728 0.008 0.264
#> SRR1818654 1 0.5656 0.6310 0.728 0.008 0.264
#> SRR1818651 1 0.1860 0.8865 0.948 0.000 0.052
#> SRR1818652 1 0.1860 0.8865 0.948 0.000 0.052
#> SRR1818657 1 0.0892 0.8989 0.980 0.000 0.020
#> SRR1818658 1 0.0892 0.8989 0.980 0.000 0.020
#> SRR1818649 1 0.3791 0.8378 0.892 0.060 0.048
#> SRR1818650 1 0.3791 0.8378 0.892 0.060 0.048
#> SRR1818659 1 0.2680 0.8776 0.924 0.008 0.068
#> SRR1818647 3 0.6045 0.2431 0.000 0.380 0.620
#> SRR1818648 3 0.6045 0.2431 0.000 0.380 0.620
#> SRR1818645 2 0.2918 0.7145 0.044 0.924 0.032
#> SRR1818646 2 0.2918 0.7145 0.044 0.924 0.032
#> SRR1818639 1 0.2866 0.8709 0.916 0.008 0.076
#> SRR1818640 1 0.2866 0.8709 0.916 0.008 0.076
#> SRR1818637 2 0.6295 0.0372 0.000 0.528 0.472
#> SRR1818638 2 0.6295 0.0372 0.000 0.528 0.472
#> SRR1818635 2 0.4861 0.7184 0.192 0.800 0.008
#> SRR1818636 2 0.4861 0.7184 0.192 0.800 0.008
#> SRR1818643 2 0.5414 0.7047 0.212 0.772 0.016
#> SRR1818644 2 0.5414 0.7047 0.212 0.772 0.016
#> SRR1818641 2 0.5643 0.6949 0.220 0.760 0.020
#> SRR1818642 2 0.5643 0.6949 0.220 0.760 0.020
#> SRR1818633 2 0.8932 0.1751 0.420 0.456 0.124
#> SRR1818634 2 0.8932 0.1751 0.420 0.456 0.124
#> SRR1818665 1 0.0983 0.8988 0.980 0.004 0.016
#> SRR1818666 1 0.0983 0.8988 0.980 0.004 0.016
#> SRR1818667 2 0.4233 0.6173 0.004 0.836 0.160
#> SRR1818668 2 0.4233 0.6173 0.004 0.836 0.160
#> SRR1818669 1 0.1129 0.8988 0.976 0.004 0.020
#> SRR1818670 1 0.1129 0.8988 0.976 0.004 0.020
#> SRR1818663 1 0.1015 0.8971 0.980 0.008 0.012
#> SRR1818664 1 0.1015 0.8971 0.980 0.008 0.012
#> SRR1818629 2 0.3987 0.7318 0.108 0.872 0.020
#> SRR1818630 2 0.3987 0.7318 0.108 0.872 0.020
#> SRR1818627 1 0.1753 0.8923 0.952 0.000 0.048
#> SRR1818628 1 0.1753 0.8923 0.952 0.000 0.048
#> SRR1818621 3 0.6641 0.1774 0.448 0.008 0.544
#> SRR1818622 3 0.6641 0.1774 0.448 0.008 0.544
#> SRR1818625 1 0.1585 0.8934 0.964 0.008 0.028
#> SRR1818626 1 0.1585 0.8934 0.964 0.008 0.028
#> SRR1818623 3 0.6180 0.1806 0.000 0.416 0.584
#> SRR1818624 3 0.6180 0.1806 0.000 0.416 0.584
#> SRR1818619 1 0.1643 0.8932 0.956 0.000 0.044
#> SRR1818620 1 0.1643 0.8932 0.956 0.000 0.044
#> SRR1818617 2 0.5597 0.7011 0.216 0.764 0.020
#> SRR1818618 2 0.5597 0.7011 0.216 0.764 0.020
#> SRR1818615 2 0.3129 0.6747 0.008 0.904 0.088
#> SRR1818616 2 0.3129 0.6747 0.008 0.904 0.088
#> SRR1818609 2 0.5560 0.4376 0.000 0.700 0.300
#> SRR1818610 2 0.5560 0.4376 0.000 0.700 0.300
#> SRR1818607 2 0.2918 0.7145 0.044 0.924 0.032
#> SRR1818608 2 0.2918 0.7145 0.044 0.924 0.032
#> SRR1818613 1 0.1860 0.8865 0.948 0.000 0.052
#> SRR1818614 1 0.1860 0.8865 0.948 0.000 0.052
#> SRR1818611 1 0.3692 0.8423 0.896 0.056 0.048
#> SRR1818612 1 0.3692 0.8423 0.896 0.056 0.048
#> SRR1818605 1 0.5896 0.5196 0.700 0.008 0.292
#> SRR1818606 1 0.5896 0.5196 0.700 0.008 0.292
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.569 0.615 0.184 0.000 0.712 0.104
#> SRR1818632 3 0.569 0.615 0.184 0.000 0.712 0.104
#> SRR1818679 3 0.918 0.251 0.184 0.316 0.400 0.100
#> SRR1818680 3 0.918 0.251 0.184 0.316 0.400 0.100
#> SRR1818677 2 0.558 0.688 0.048 0.772 0.068 0.112
#> SRR1818678 2 0.558 0.688 0.048 0.772 0.068 0.112
#> SRR1818675 3 0.609 0.315 0.036 0.012 0.604 0.348
#> SRR1818676 3 0.609 0.315 0.036 0.012 0.604 0.348
#> SRR1818673 2 0.273 0.733 0.028 0.916 0.020 0.036
#> SRR1818674 2 0.273 0.733 0.028 0.916 0.020 0.036
#> SRR1818671 2 0.472 0.494 0.000 0.672 0.004 0.324
#> SRR1818672 2 0.472 0.494 0.000 0.672 0.004 0.324
#> SRR1818661 3 0.509 0.579 0.096 0.000 0.764 0.140
#> SRR1818662 3 0.509 0.579 0.096 0.000 0.764 0.140
#> SRR1818655 1 0.482 0.791 0.808 0.020 0.068 0.104
#> SRR1818656 1 0.482 0.791 0.808 0.020 0.068 0.104
#> SRR1818653 1 0.660 0.487 0.600 0.004 0.300 0.096
#> SRR1818654 1 0.660 0.487 0.600 0.004 0.300 0.096
#> SRR1818651 1 0.260 0.842 0.912 0.004 0.064 0.020
#> SRR1818652 1 0.260 0.842 0.912 0.004 0.064 0.020
#> SRR1818657 1 0.257 0.844 0.916 0.004 0.052 0.028
#> SRR1818658 1 0.257 0.844 0.916 0.004 0.052 0.028
#> SRR1818649 1 0.495 0.765 0.812 0.076 0.064 0.048
#> SRR1818650 1 0.495 0.765 0.812 0.076 0.064 0.048
#> SRR1818659 1 0.405 0.817 0.852 0.016 0.060 0.072
#> SRR1818647 4 0.686 0.685 0.000 0.144 0.276 0.580
#> SRR1818648 4 0.686 0.685 0.000 0.144 0.276 0.580
#> SRR1818645 2 0.307 0.700 0.004 0.868 0.004 0.124
#> SRR1818646 2 0.307 0.700 0.004 0.868 0.004 0.124
#> SRR1818639 1 0.490 0.783 0.800 0.016 0.072 0.112
#> SRR1818640 1 0.490 0.783 0.800 0.016 0.072 0.112
#> SRR1818637 4 0.608 0.754 0.000 0.216 0.112 0.672
#> SRR1818638 4 0.608 0.754 0.000 0.216 0.112 0.672
#> SRR1818635 2 0.292 0.732 0.032 0.908 0.020 0.040
#> SRR1818636 2 0.292 0.732 0.032 0.908 0.020 0.040
#> SRR1818643 2 0.322 0.728 0.040 0.896 0.028 0.036
#> SRR1818644 2 0.322 0.728 0.040 0.896 0.028 0.036
#> SRR1818641 2 0.377 0.718 0.048 0.872 0.036 0.044
#> SRR1818642 2 0.377 0.718 0.048 0.872 0.036 0.044
#> SRR1818633 2 0.904 0.154 0.284 0.448 0.152 0.116
#> SRR1818634 2 0.904 0.154 0.284 0.448 0.152 0.116
#> SRR1818665 1 0.148 0.852 0.960 0.004 0.016 0.020
#> SRR1818666 1 0.148 0.852 0.960 0.004 0.016 0.020
#> SRR1818667 2 0.535 0.323 0.000 0.596 0.016 0.388
#> SRR1818668 2 0.535 0.323 0.000 0.596 0.016 0.388
#> SRR1818669 1 0.222 0.851 0.932 0.008 0.044 0.016
#> SRR1818670 1 0.222 0.851 0.932 0.008 0.044 0.016
#> SRR1818663 1 0.134 0.850 0.964 0.008 0.004 0.024
#> SRR1818664 1 0.134 0.850 0.964 0.008 0.004 0.024
#> SRR1818629 2 0.297 0.731 0.020 0.896 0.008 0.076
#> SRR1818630 2 0.297 0.731 0.020 0.896 0.008 0.076
#> SRR1818627 1 0.244 0.847 0.916 0.000 0.060 0.024
#> SRR1818628 1 0.244 0.847 0.916 0.000 0.060 0.024
#> SRR1818621 3 0.589 0.553 0.252 0.004 0.676 0.068
#> SRR1818622 3 0.589 0.553 0.252 0.004 0.676 0.068
#> SRR1818625 1 0.174 0.849 0.952 0.008 0.016 0.024
#> SRR1818626 1 0.174 0.849 0.952 0.008 0.016 0.024
#> SRR1818623 4 0.664 0.662 0.000 0.128 0.268 0.604
#> SRR1818624 4 0.664 0.662 0.000 0.128 0.268 0.604
#> SRR1818619 1 0.358 0.824 0.876 0.016 0.060 0.048
#> SRR1818620 1 0.358 0.824 0.876 0.016 0.060 0.048
#> SRR1818617 2 0.574 0.670 0.068 0.764 0.056 0.112
#> SRR1818618 2 0.574 0.670 0.068 0.764 0.056 0.112
#> SRR1818615 2 0.472 0.499 0.000 0.692 0.008 0.300
#> SRR1818616 2 0.472 0.499 0.000 0.692 0.008 0.300
#> SRR1818609 4 0.557 0.587 0.000 0.344 0.032 0.624
#> SRR1818610 4 0.557 0.587 0.000 0.344 0.032 0.624
#> SRR1818607 2 0.307 0.700 0.004 0.868 0.004 0.124
#> SRR1818608 2 0.307 0.700 0.004 0.868 0.004 0.124
#> SRR1818613 1 0.230 0.843 0.920 0.000 0.064 0.016
#> SRR1818614 1 0.230 0.843 0.920 0.000 0.064 0.016
#> SRR1818611 1 0.481 0.776 0.820 0.072 0.060 0.048
#> SRR1818612 1 0.481 0.776 0.820 0.072 0.060 0.048
#> SRR1818605 1 0.520 0.488 0.668 0.004 0.312 0.016
#> SRR1818606 1 0.520 0.488 0.668 0.004 0.312 0.016
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.647 0.480 0.136 0.000 0.636 0.152 0.076
#> SRR1818632 3 0.647 0.480 0.136 0.000 0.636 0.152 0.076
#> SRR1818679 5 0.925 1.000 0.136 0.180 0.300 0.068 0.316
#> SRR1818680 5 0.925 1.000 0.136 0.180 0.300 0.068 0.316
#> SRR1818677 2 0.594 0.410 0.036 0.620 0.024 0.024 0.296
#> SRR1818678 2 0.594 0.410 0.036 0.620 0.024 0.024 0.296
#> SRR1818675 3 0.659 0.337 0.016 0.012 0.464 0.416 0.092
#> SRR1818676 3 0.659 0.337 0.016 0.012 0.464 0.416 0.092
#> SRR1818673 2 0.328 0.613 0.008 0.836 0.004 0.008 0.144
#> SRR1818674 2 0.328 0.613 0.008 0.836 0.004 0.008 0.144
#> SRR1818671 2 0.540 0.447 0.000 0.644 0.000 0.248 0.108
#> SRR1818672 2 0.540 0.447 0.000 0.644 0.000 0.248 0.108
#> SRR1818661 3 0.478 0.582 0.056 0.000 0.728 0.204 0.012
#> SRR1818662 3 0.478 0.582 0.056 0.000 0.728 0.204 0.012
#> SRR1818655 1 0.529 0.619 0.692 0.000 0.108 0.008 0.192
#> SRR1818656 1 0.529 0.619 0.692 0.000 0.108 0.008 0.192
#> SRR1818653 1 0.670 0.345 0.456 0.000 0.348 0.008 0.188
#> SRR1818654 1 0.670 0.345 0.456 0.000 0.348 0.008 0.188
#> SRR1818651 1 0.394 0.704 0.812 0.000 0.116 0.008 0.064
#> SRR1818652 1 0.394 0.704 0.812 0.000 0.116 0.008 0.064
#> SRR1818657 1 0.459 0.694 0.780 0.004 0.080 0.016 0.120
#> SRR1818658 1 0.459 0.694 0.780 0.004 0.080 0.016 0.120
#> SRR1818649 1 0.577 0.530 0.660 0.056 0.040 0.004 0.240
#> SRR1818650 1 0.577 0.530 0.660 0.056 0.040 0.004 0.240
#> SRR1818659 1 0.425 0.695 0.792 0.000 0.104 0.008 0.096
#> SRR1818647 4 0.501 0.661 0.000 0.076 0.132 0.752 0.040
#> SRR1818648 4 0.501 0.661 0.000 0.076 0.132 0.752 0.040
#> SRR1818645 2 0.311 0.629 0.000 0.856 0.000 0.100 0.044
#> SRR1818646 2 0.311 0.629 0.000 0.856 0.000 0.100 0.044
#> SRR1818639 1 0.509 0.619 0.696 0.000 0.124 0.000 0.180
#> SRR1818640 1 0.509 0.619 0.696 0.000 0.124 0.000 0.180
#> SRR1818637 4 0.406 0.729 0.000 0.120 0.032 0.812 0.036
#> SRR1818638 4 0.406 0.729 0.000 0.120 0.032 0.812 0.036
#> SRR1818635 2 0.372 0.603 0.024 0.816 0.004 0.008 0.148
#> SRR1818636 2 0.372 0.603 0.024 0.816 0.004 0.008 0.148
#> SRR1818643 2 0.391 0.579 0.016 0.772 0.000 0.008 0.204
#> SRR1818644 2 0.391 0.579 0.016 0.772 0.000 0.008 0.204
#> SRR1818641 2 0.391 0.573 0.024 0.760 0.000 0.000 0.216
#> SRR1818642 2 0.391 0.573 0.024 0.760 0.000 0.000 0.216
#> SRR1818633 2 0.919 -0.394 0.240 0.316 0.124 0.056 0.264
#> SRR1818634 2 0.919 -0.394 0.240 0.316 0.124 0.056 0.264
#> SRR1818665 1 0.260 0.725 0.896 0.000 0.040 0.004 0.060
#> SRR1818666 1 0.260 0.725 0.896 0.000 0.040 0.004 0.060
#> SRR1818667 2 0.616 0.243 0.000 0.544 0.012 0.336 0.108
#> SRR1818668 2 0.616 0.243 0.000 0.544 0.012 0.336 0.108
#> SRR1818669 1 0.342 0.721 0.856 0.000 0.060 0.016 0.068
#> SRR1818670 1 0.342 0.721 0.856 0.000 0.060 0.016 0.068
#> SRR1818663 1 0.221 0.725 0.912 0.004 0.016 0.000 0.068
#> SRR1818664 1 0.221 0.725 0.912 0.004 0.016 0.000 0.068
#> SRR1818629 2 0.298 0.636 0.004 0.876 0.008 0.024 0.088
#> SRR1818630 2 0.298 0.636 0.004 0.876 0.008 0.024 0.088
#> SRR1818627 1 0.440 0.702 0.780 0.000 0.104 0.008 0.108
#> SRR1818628 1 0.440 0.702 0.780 0.000 0.104 0.008 0.108
#> SRR1818621 3 0.528 0.346 0.148 0.000 0.712 0.016 0.124
#> SRR1818622 3 0.528 0.346 0.148 0.000 0.712 0.016 0.124
#> SRR1818625 1 0.251 0.722 0.892 0.004 0.016 0.000 0.088
#> SRR1818626 1 0.251 0.722 0.892 0.004 0.016 0.000 0.088
#> SRR1818623 4 0.618 0.614 0.000 0.096 0.156 0.664 0.084
#> SRR1818624 4 0.618 0.614 0.000 0.096 0.156 0.664 0.084
#> SRR1818619 1 0.542 0.638 0.700 0.004 0.092 0.016 0.188
#> SRR1818620 1 0.542 0.638 0.700 0.004 0.092 0.016 0.188
#> SRR1818617 2 0.639 0.392 0.068 0.596 0.020 0.028 0.288
#> SRR1818618 2 0.639 0.392 0.068 0.596 0.020 0.028 0.288
#> SRR1818615 2 0.533 0.448 0.000 0.648 0.004 0.268 0.080
#> SRR1818616 2 0.533 0.448 0.000 0.648 0.004 0.268 0.080
#> SRR1818609 4 0.453 0.623 0.000 0.260 0.000 0.700 0.040
#> SRR1818610 4 0.453 0.623 0.000 0.260 0.000 0.700 0.040
#> SRR1818607 2 0.311 0.629 0.000 0.856 0.000 0.100 0.044
#> SRR1818608 2 0.311 0.629 0.000 0.856 0.000 0.100 0.044
#> SRR1818613 1 0.397 0.701 0.808 0.000 0.124 0.008 0.060
#> SRR1818614 1 0.397 0.701 0.808 0.000 0.124 0.008 0.060
#> SRR1818611 1 0.543 0.584 0.696 0.056 0.032 0.004 0.212
#> SRR1818612 1 0.543 0.584 0.696 0.056 0.032 0.004 0.212
#> SRR1818605 1 0.626 0.322 0.552 0.004 0.316 0.008 0.120
#> SRR1818606 1 0.626 0.322 0.552 0.004 0.316 0.008 0.120
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.475 0.5256 0.100 0.000 0.764 0.028 0.048 0.060
#> SRR1818632 3 0.475 0.5256 0.100 0.000 0.764 0.028 0.048 0.060
#> SRR1818679 3 0.899 -0.0836 0.092 0.224 0.300 0.036 0.100 0.248
#> SRR1818680 3 0.899 -0.0836 0.092 0.224 0.300 0.036 0.100 0.248
#> SRR1818677 2 0.734 0.1671 0.020 0.448 0.012 0.056 0.172 0.292
#> SRR1818678 2 0.734 0.1671 0.020 0.448 0.012 0.056 0.172 0.292
#> SRR1818675 3 0.578 0.3489 0.008 0.008 0.592 0.296 0.036 0.060
#> SRR1818676 3 0.578 0.3489 0.008 0.008 0.592 0.296 0.036 0.060
#> SRR1818673 2 0.185 0.5272 0.008 0.936 0.004 0.020 0.020 0.012
#> SRR1818674 2 0.185 0.5272 0.008 0.936 0.004 0.020 0.020 0.012
#> SRR1818671 2 0.624 0.2021 0.000 0.364 0.000 0.328 0.004 0.304
#> SRR1818672 2 0.624 0.2021 0.000 0.364 0.000 0.328 0.004 0.304
#> SRR1818661 3 0.376 0.5488 0.020 0.004 0.824 0.088 0.056 0.008
#> SRR1818662 3 0.376 0.5488 0.020 0.004 0.824 0.088 0.056 0.008
#> SRR1818655 1 0.509 -0.2106 0.520 0.012 0.008 0.008 0.432 0.020
#> SRR1818656 1 0.509 -0.2106 0.520 0.012 0.008 0.008 0.432 0.020
#> SRR1818653 1 0.612 -1.0000 0.420 0.000 0.132 0.000 0.420 0.028
#> SRR1818654 5 0.612 0.0000 0.420 0.000 0.132 0.000 0.420 0.028
#> SRR1818651 1 0.462 0.2167 0.728 0.004 0.060 0.008 0.188 0.012
#> SRR1818652 1 0.462 0.2167 0.728 0.004 0.060 0.008 0.188 0.012
#> SRR1818657 1 0.475 0.3951 0.724 0.000 0.028 0.000 0.116 0.132
#> SRR1818658 1 0.475 0.3951 0.724 0.000 0.028 0.000 0.116 0.132
#> SRR1818649 1 0.637 0.3112 0.612 0.072 0.016 0.004 0.164 0.132
#> SRR1818650 1 0.637 0.3112 0.612 0.072 0.016 0.004 0.164 0.132
#> SRR1818659 1 0.450 0.1129 0.704 0.000 0.020 0.008 0.240 0.028
#> SRR1818647 4 0.476 0.5522 0.000 0.040 0.196 0.720 0.020 0.024
#> SRR1818648 4 0.476 0.5522 0.000 0.040 0.196 0.720 0.020 0.024
#> SRR1818645 2 0.517 0.5158 0.000 0.612 0.000 0.148 0.000 0.240
#> SRR1818646 2 0.517 0.5158 0.000 0.612 0.000 0.148 0.000 0.240
#> SRR1818639 1 0.479 -0.2393 0.524 0.012 0.012 0.000 0.440 0.012
#> SRR1818640 1 0.479 -0.2393 0.524 0.012 0.012 0.000 0.440 0.012
#> SRR1818637 4 0.437 0.6355 0.000 0.044 0.056 0.796 0.036 0.068
#> SRR1818638 4 0.437 0.6355 0.000 0.044 0.056 0.796 0.036 0.068
#> SRR1818635 2 0.196 0.5236 0.012 0.932 0.004 0.016 0.020 0.016
#> SRR1818636 2 0.196 0.5236 0.012 0.932 0.004 0.016 0.020 0.016
#> SRR1818643 2 0.340 0.4729 0.008 0.852 0.016 0.012 0.036 0.076
#> SRR1818644 2 0.340 0.4729 0.008 0.852 0.016 0.012 0.036 0.076
#> SRR1818641 2 0.269 0.4770 0.008 0.880 0.000 0.008 0.024 0.080
#> SRR1818642 2 0.269 0.4770 0.008 0.880 0.000 0.008 0.024 0.080
#> SRR1818633 6 0.914 1.0000 0.164 0.256 0.076 0.060 0.128 0.316
#> SRR1818634 6 0.914 1.0000 0.164 0.256 0.076 0.060 0.128 0.316
#> SRR1818665 1 0.349 0.4347 0.828 0.000 0.012 0.008 0.044 0.108
#> SRR1818666 1 0.349 0.4347 0.828 0.000 0.012 0.008 0.044 0.108
#> SRR1818667 4 0.689 0.1106 0.000 0.320 0.012 0.432 0.044 0.192
#> SRR1818668 4 0.689 0.1106 0.000 0.320 0.012 0.432 0.044 0.192
#> SRR1818669 1 0.434 0.4255 0.772 0.000 0.072 0.000 0.052 0.104
#> SRR1818670 1 0.434 0.4255 0.772 0.000 0.072 0.000 0.052 0.104
#> SRR1818663 1 0.205 0.4570 0.912 0.000 0.004 0.000 0.056 0.028
#> SRR1818664 1 0.205 0.4570 0.912 0.000 0.004 0.000 0.056 0.028
#> SRR1818629 2 0.531 0.4255 0.000 0.676 0.012 0.088 0.028 0.196
#> SRR1818630 2 0.531 0.4255 0.000 0.676 0.012 0.088 0.028 0.196
#> SRR1818627 1 0.457 0.4055 0.756 0.000 0.032 0.012 0.060 0.140
#> SRR1818628 1 0.457 0.4055 0.756 0.000 0.032 0.012 0.060 0.140
#> SRR1818621 3 0.637 0.2061 0.124 0.000 0.512 0.008 0.312 0.044
#> SRR1818622 3 0.637 0.2061 0.124 0.000 0.512 0.008 0.312 0.044
#> SRR1818625 1 0.242 0.4591 0.888 0.000 0.004 0.000 0.076 0.032
#> SRR1818626 1 0.242 0.4591 0.888 0.000 0.004 0.000 0.076 0.032
#> SRR1818623 4 0.605 0.5428 0.000 0.052 0.172 0.632 0.020 0.124
#> SRR1818624 4 0.605 0.5428 0.000 0.052 0.172 0.632 0.020 0.124
#> SRR1818619 1 0.615 0.2893 0.588 0.004 0.040 0.004 0.160 0.204
#> SRR1818620 1 0.615 0.2893 0.588 0.004 0.040 0.004 0.160 0.204
#> SRR1818617 2 0.767 -0.0783 0.048 0.444 0.012 0.048 0.212 0.236
#> SRR1818618 2 0.767 -0.0783 0.048 0.444 0.012 0.048 0.212 0.236
#> SRR1818615 2 0.594 0.2786 0.000 0.496 0.000 0.348 0.020 0.136
#> SRR1818616 2 0.594 0.2786 0.000 0.496 0.000 0.348 0.020 0.136
#> SRR1818609 4 0.322 0.6309 0.000 0.092 0.004 0.844 0.008 0.052
#> SRR1818610 4 0.322 0.6309 0.000 0.092 0.004 0.844 0.008 0.052
#> SRR1818607 2 0.517 0.5158 0.000 0.612 0.000 0.148 0.000 0.240
#> SRR1818608 2 0.517 0.5158 0.000 0.612 0.000 0.148 0.000 0.240
#> SRR1818613 1 0.449 0.2459 0.744 0.004 0.060 0.008 0.172 0.012
#> SRR1818614 1 0.449 0.2459 0.744 0.004 0.060 0.008 0.172 0.012
#> SRR1818611 1 0.605 0.3211 0.640 0.068 0.012 0.004 0.168 0.108
#> SRR1818612 1 0.605 0.3211 0.640 0.068 0.012 0.004 0.168 0.108
#> SRR1818605 1 0.643 -0.1067 0.552 0.000 0.208 0.000 0.156 0.084
#> SRR1818606 1 0.643 -0.1067 0.552 0.000 0.208 0.000 0.156 0.084
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 15216 rows and 75 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.944 0.941 0.977 0.5046 0.498 0.498
#> 3 3 0.737 0.887 0.914 0.3082 0.765 0.559
#> 4 4 0.672 0.827 0.870 0.1212 0.862 0.621
#> 5 5 0.642 0.606 0.754 0.0669 0.988 0.955
#> 6 6 0.664 0.472 0.654 0.0440 0.876 0.532
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
#> SRR1818631 1 0.000 0.965 1.000 0.000
#> SRR1818632 1 0.000 0.965 1.000 0.000
#> SRR1818679 1 0.999 0.114 0.516 0.484
#> SRR1818680 1 0.999 0.114 0.516 0.484
#> SRR1818677 2 0.000 0.988 0.000 1.000
#> SRR1818678 2 0.000 0.988 0.000 1.000
#> SRR1818675 1 0.730 0.741 0.796 0.204
#> SRR1818676 1 0.730 0.741 0.796 0.204
#> SRR1818673 2 0.000 0.988 0.000 1.000
#> SRR1818674 2 0.000 0.988 0.000 1.000
#> SRR1818671 2 0.000 0.988 0.000 1.000
#> SRR1818672 2 0.000 0.988 0.000 1.000
#> SRR1818661 1 0.000 0.965 1.000 0.000
#> SRR1818662 1 0.000 0.965 1.000 0.000
#> SRR1818655 1 0.000 0.965 1.000 0.000
#> SRR1818656 1 0.000 0.965 1.000 0.000
#> SRR1818653 1 0.000 0.965 1.000 0.000
#> SRR1818654 1 0.000 0.965 1.000 0.000
#> SRR1818651 1 0.000 0.965 1.000 0.000
#> SRR1818652 1 0.000 0.965 1.000 0.000
#> SRR1818657 1 0.000 0.965 1.000 0.000
#> SRR1818658 1 0.000 0.965 1.000 0.000
#> SRR1818649 1 0.000 0.965 1.000 0.000
#> SRR1818650 1 0.000 0.965 1.000 0.000
#> SRR1818659 1 0.000 0.965 1.000 0.000
#> SRR1818647 2 0.000 0.988 0.000 1.000
#> SRR1818648 2 0.000 0.988 0.000 1.000
#> SRR1818645 2 0.000 0.988 0.000 1.000
#> SRR1818646 2 0.000 0.988 0.000 1.000
#> SRR1818639 1 0.000 0.965 1.000 0.000
#> SRR1818640 1 0.000 0.965 1.000 0.000
#> SRR1818637 2 0.000 0.988 0.000 1.000
#> SRR1818638 2 0.000 0.988 0.000 1.000
#> SRR1818635 2 0.000 0.988 0.000 1.000
#> SRR1818636 2 0.000 0.988 0.000 1.000
#> SRR1818643 2 0.000 0.988 0.000 1.000
#> SRR1818644 2 0.000 0.988 0.000 1.000
#> SRR1818641 2 0.000 0.988 0.000 1.000
#> SRR1818642 2 0.000 0.988 0.000 1.000
#> SRR1818633 2 0.680 0.776 0.180 0.820
#> SRR1818634 2 0.680 0.776 0.180 0.820
#> SRR1818665 1 0.000 0.965 1.000 0.000
#> SRR1818666 1 0.000 0.965 1.000 0.000
#> SRR1818667 2 0.000 0.988 0.000 1.000
#> SRR1818668 2 0.000 0.988 0.000 1.000
#> SRR1818669 1 0.000 0.965 1.000 0.000
#> SRR1818670 1 0.000 0.965 1.000 0.000
#> SRR1818663 1 0.000 0.965 1.000 0.000
#> SRR1818664 1 0.000 0.965 1.000 0.000
#> SRR1818629 2 0.000 0.988 0.000 1.000
#> SRR1818630 2 0.000 0.988 0.000 1.000
#> SRR1818627 1 0.000 0.965 1.000 0.000
#> SRR1818628 1 0.000 0.965 1.000 0.000
#> SRR1818621 1 0.000 0.965 1.000 0.000
#> SRR1818622 1 0.000 0.965 1.000 0.000
#> SRR1818625 1 0.000 0.965 1.000 0.000
#> SRR1818626 1 0.000 0.965 1.000 0.000
#> SRR1818623 2 0.000 0.988 0.000 1.000
#> SRR1818624 2 0.000 0.988 0.000 1.000
#> SRR1818619 1 0.000 0.965 1.000 0.000
#> SRR1818620 1 0.000 0.965 1.000 0.000
#> SRR1818617 2 0.000 0.988 0.000 1.000
#> SRR1818618 2 0.000 0.988 0.000 1.000
#> SRR1818615 2 0.000 0.988 0.000 1.000
#> SRR1818616 2 0.000 0.988 0.000 1.000
#> SRR1818609 2 0.000 0.988 0.000 1.000
#> SRR1818610 2 0.000 0.988 0.000 1.000
#> SRR1818607 2 0.000 0.988 0.000 1.000
#> SRR1818608 2 0.000 0.988 0.000 1.000
#> SRR1818613 1 0.000 0.965 1.000 0.000
#> SRR1818614 1 0.000 0.965 1.000 0.000
#> SRR1818611 1 0.000 0.965 1.000 0.000
#> SRR1818612 1 0.000 0.965 1.000 0.000
#> SRR1818605 1 0.000 0.965 1.000 0.000
#> SRR1818606 1 0.000 0.965 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.3340 0.795 0.120 0.000 0.880
#> SRR1818632 3 0.3340 0.795 0.120 0.000 0.880
#> SRR1818679 3 0.4235 0.788 0.000 0.176 0.824
#> SRR1818680 3 0.4235 0.788 0.000 0.176 0.824
#> SRR1818677 2 0.0592 0.964 0.000 0.988 0.012
#> SRR1818678 2 0.0592 0.964 0.000 0.988 0.012
#> SRR1818675 3 0.0592 0.817 0.000 0.012 0.988
#> SRR1818676 3 0.0592 0.817 0.000 0.012 0.988
#> SRR1818673 2 0.0592 0.960 0.000 0.988 0.012
#> SRR1818674 2 0.0592 0.960 0.000 0.988 0.012
#> SRR1818671 2 0.2261 0.950 0.000 0.932 0.068
#> SRR1818672 2 0.2261 0.950 0.000 0.932 0.068
#> SRR1818661 3 0.2711 0.798 0.088 0.000 0.912
#> SRR1818662 3 0.2711 0.798 0.088 0.000 0.912
#> SRR1818655 1 0.3116 0.926 0.892 0.000 0.108
#> SRR1818656 1 0.3116 0.926 0.892 0.000 0.108
#> SRR1818653 1 0.4750 0.818 0.784 0.000 0.216
#> SRR1818654 1 0.4750 0.818 0.784 0.000 0.216
#> SRR1818651 1 0.3192 0.924 0.888 0.000 0.112
#> SRR1818652 1 0.3192 0.924 0.888 0.000 0.112
#> SRR1818657 1 0.0000 0.938 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.938 1.000 0.000 0.000
#> SRR1818649 1 0.1170 0.924 0.976 0.016 0.008
#> SRR1818650 1 0.1170 0.924 0.976 0.016 0.008
#> SRR1818659 1 0.3116 0.926 0.892 0.000 0.108
#> SRR1818647 3 0.3941 0.780 0.000 0.156 0.844
#> SRR1818648 3 0.3941 0.780 0.000 0.156 0.844
#> SRR1818645 2 0.0237 0.964 0.000 0.996 0.004
#> SRR1818646 2 0.0237 0.964 0.000 0.996 0.004
#> SRR1818639 1 0.3116 0.926 0.892 0.000 0.108
#> SRR1818640 1 0.3116 0.926 0.892 0.000 0.108
#> SRR1818637 3 0.5650 0.582 0.000 0.312 0.688
#> SRR1818638 3 0.5650 0.582 0.000 0.312 0.688
#> SRR1818635 2 0.0592 0.960 0.000 0.988 0.012
#> SRR1818636 2 0.0592 0.960 0.000 0.988 0.012
#> SRR1818643 2 0.0747 0.962 0.000 0.984 0.016
#> SRR1818644 2 0.0747 0.962 0.000 0.984 0.016
#> SRR1818641 2 0.0592 0.960 0.000 0.988 0.012
#> SRR1818642 2 0.0592 0.960 0.000 0.988 0.012
#> SRR1818633 3 0.7720 0.674 0.120 0.208 0.672
#> SRR1818634 3 0.7720 0.674 0.120 0.208 0.672
#> SRR1818665 1 0.1529 0.942 0.960 0.000 0.040
#> SRR1818666 1 0.1529 0.942 0.960 0.000 0.040
#> SRR1818667 2 0.2625 0.941 0.000 0.916 0.084
#> SRR1818668 2 0.2625 0.941 0.000 0.916 0.084
#> SRR1818669 1 0.1411 0.942 0.964 0.000 0.036
#> SRR1818670 1 0.1411 0.942 0.964 0.000 0.036
#> SRR1818663 1 0.0000 0.938 1.000 0.000 0.000
#> SRR1818664 1 0.0000 0.938 1.000 0.000 0.000
#> SRR1818629 2 0.2165 0.955 0.000 0.936 0.064
#> SRR1818630 2 0.2165 0.955 0.000 0.936 0.064
#> SRR1818627 1 0.1860 0.941 0.948 0.000 0.052
#> SRR1818628 1 0.1860 0.941 0.948 0.000 0.052
#> SRR1818621 3 0.2711 0.798 0.088 0.000 0.912
#> SRR1818622 3 0.2711 0.798 0.088 0.000 0.912
#> SRR1818625 1 0.0000 0.938 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.938 1.000 0.000 0.000
#> SRR1818623 3 0.3816 0.785 0.000 0.148 0.852
#> SRR1818624 3 0.3816 0.785 0.000 0.148 0.852
#> SRR1818619 1 0.0000 0.938 1.000 0.000 0.000
#> SRR1818620 1 0.0000 0.938 1.000 0.000 0.000
#> SRR1818617 2 0.1411 0.961 0.000 0.964 0.036
#> SRR1818618 2 0.1411 0.961 0.000 0.964 0.036
#> SRR1818615 2 0.1860 0.956 0.000 0.948 0.052
#> SRR1818616 2 0.1860 0.956 0.000 0.948 0.052
#> SRR1818609 2 0.2878 0.931 0.000 0.904 0.096
#> SRR1818610 2 0.2878 0.931 0.000 0.904 0.096
#> SRR1818607 2 0.0237 0.964 0.000 0.996 0.004
#> SRR1818608 2 0.0237 0.964 0.000 0.996 0.004
#> SRR1818613 1 0.3192 0.924 0.888 0.000 0.112
#> SRR1818614 1 0.3192 0.924 0.888 0.000 0.112
#> SRR1818611 1 0.1015 0.927 0.980 0.012 0.008
#> SRR1818612 1 0.1015 0.927 0.980 0.012 0.008
#> SRR1818605 3 0.5397 0.594 0.280 0.000 0.720
#> SRR1818606 3 0.5397 0.594 0.280 0.000 0.720
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.3464 0.849 0.076 0.000 0.868 0.056
#> SRR1818632 3 0.3464 0.849 0.076 0.000 0.868 0.056
#> SRR1818679 3 0.5546 0.759 0.008 0.128 0.748 0.116
#> SRR1818680 3 0.5546 0.759 0.008 0.128 0.748 0.116
#> SRR1818677 2 0.4193 0.789 0.000 0.732 0.000 0.268
#> SRR1818678 2 0.4193 0.789 0.000 0.732 0.000 0.268
#> SRR1818675 3 0.4134 0.708 0.000 0.000 0.740 0.260
#> SRR1818676 3 0.4134 0.708 0.000 0.000 0.740 0.260
#> SRR1818673 2 0.0469 0.853 0.000 0.988 0.000 0.012
#> SRR1818674 2 0.0469 0.853 0.000 0.988 0.000 0.012
#> SRR1818671 4 0.3764 0.705 0.000 0.216 0.000 0.784
#> SRR1818672 4 0.3764 0.705 0.000 0.216 0.000 0.784
#> SRR1818661 3 0.1716 0.856 0.000 0.000 0.936 0.064
#> SRR1818662 3 0.1716 0.856 0.000 0.000 0.936 0.064
#> SRR1818655 1 0.3569 0.861 0.804 0.000 0.196 0.000
#> SRR1818656 1 0.3569 0.861 0.804 0.000 0.196 0.000
#> SRR1818653 3 0.2999 0.750 0.132 0.000 0.864 0.004
#> SRR1818654 3 0.2999 0.750 0.132 0.000 0.864 0.004
#> SRR1818651 1 0.4277 0.796 0.720 0.000 0.280 0.000
#> SRR1818652 1 0.4277 0.796 0.720 0.000 0.280 0.000
#> SRR1818657 1 0.1706 0.890 0.948 0.000 0.036 0.016
#> SRR1818658 1 0.1706 0.890 0.948 0.000 0.036 0.016
#> SRR1818649 1 0.1917 0.866 0.944 0.036 0.008 0.012
#> SRR1818650 1 0.1917 0.866 0.944 0.036 0.008 0.012
#> SRR1818659 1 0.3528 0.862 0.808 0.000 0.192 0.000
#> SRR1818647 4 0.3099 0.806 0.000 0.020 0.104 0.876
#> SRR1818648 4 0.3099 0.806 0.000 0.020 0.104 0.876
#> SRR1818645 2 0.3486 0.847 0.000 0.812 0.000 0.188
#> SRR1818646 2 0.3486 0.847 0.000 0.812 0.000 0.188
#> SRR1818639 1 0.3569 0.861 0.804 0.000 0.196 0.000
#> SRR1818640 1 0.3569 0.861 0.804 0.000 0.196 0.000
#> SRR1818637 4 0.1042 0.840 0.000 0.020 0.008 0.972
#> SRR1818638 4 0.1042 0.840 0.000 0.020 0.008 0.972
#> SRR1818635 2 0.0469 0.853 0.000 0.988 0.000 0.012
#> SRR1818636 2 0.0469 0.853 0.000 0.988 0.000 0.012
#> SRR1818643 2 0.0592 0.854 0.000 0.984 0.000 0.016
#> SRR1818644 2 0.0592 0.854 0.000 0.984 0.000 0.016
#> SRR1818641 2 0.0000 0.848 0.000 1.000 0.000 0.000
#> SRR1818642 2 0.0000 0.848 0.000 1.000 0.000 0.000
#> SRR1818633 4 0.7199 0.685 0.108 0.096 0.128 0.668
#> SRR1818634 4 0.7199 0.685 0.108 0.096 0.128 0.668
#> SRR1818665 1 0.2197 0.893 0.916 0.000 0.080 0.004
#> SRR1818666 1 0.2197 0.893 0.916 0.000 0.080 0.004
#> SRR1818667 4 0.1792 0.837 0.000 0.068 0.000 0.932
#> SRR1818668 4 0.1792 0.837 0.000 0.068 0.000 0.932
#> SRR1818669 1 0.2216 0.893 0.908 0.000 0.092 0.000
#> SRR1818670 1 0.2216 0.893 0.908 0.000 0.092 0.000
#> SRR1818663 1 0.0469 0.889 0.988 0.000 0.012 0.000
#> SRR1818664 1 0.0469 0.889 0.988 0.000 0.012 0.000
#> SRR1818629 2 0.4134 0.763 0.000 0.740 0.000 0.260
#> SRR1818630 2 0.4134 0.763 0.000 0.740 0.000 0.260
#> SRR1818627 1 0.3088 0.879 0.864 0.000 0.128 0.008
#> SRR1818628 1 0.3088 0.879 0.864 0.000 0.128 0.008
#> SRR1818621 3 0.0672 0.849 0.008 0.000 0.984 0.008
#> SRR1818622 3 0.0672 0.849 0.008 0.000 0.984 0.008
#> SRR1818625 1 0.0469 0.889 0.988 0.000 0.012 0.000
#> SRR1818626 1 0.0469 0.889 0.988 0.000 0.012 0.000
#> SRR1818623 4 0.2799 0.791 0.000 0.008 0.108 0.884
#> SRR1818624 4 0.2799 0.791 0.000 0.008 0.108 0.884
#> SRR1818619 1 0.1610 0.889 0.952 0.000 0.032 0.016
#> SRR1818620 1 0.1610 0.889 0.952 0.000 0.032 0.016
#> SRR1818617 2 0.4122 0.810 0.000 0.760 0.004 0.236
#> SRR1818618 2 0.4122 0.810 0.000 0.760 0.004 0.236
#> SRR1818615 4 0.3726 0.739 0.000 0.212 0.000 0.788
#> SRR1818616 4 0.3726 0.739 0.000 0.212 0.000 0.788
#> SRR1818609 4 0.1792 0.840 0.000 0.068 0.000 0.932
#> SRR1818610 4 0.1792 0.840 0.000 0.068 0.000 0.932
#> SRR1818607 2 0.3486 0.847 0.000 0.812 0.000 0.188
#> SRR1818608 2 0.3486 0.847 0.000 0.812 0.000 0.188
#> SRR1818613 1 0.4277 0.796 0.720 0.000 0.280 0.000
#> SRR1818614 1 0.4277 0.796 0.720 0.000 0.280 0.000
#> SRR1818611 1 0.1771 0.868 0.948 0.036 0.004 0.012
#> SRR1818612 1 0.1771 0.868 0.948 0.036 0.004 0.012
#> SRR1818605 3 0.2081 0.850 0.084 0.000 0.916 0.000
#> SRR1818606 3 0.2081 0.850 0.084 0.000 0.916 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.3186 0.786 0.056 0.000 0.872 0.052 0.020
#> SRR1818632 3 0.3186 0.786 0.056 0.000 0.872 0.052 0.020
#> SRR1818679 3 0.5059 0.717 0.000 0.084 0.760 0.072 0.084
#> SRR1818680 3 0.5059 0.717 0.000 0.084 0.760 0.072 0.084
#> SRR1818677 2 0.6603 -0.510 0.004 0.440 0.000 0.184 0.372
#> SRR1818678 2 0.6603 -0.510 0.004 0.440 0.000 0.184 0.372
#> SRR1818675 3 0.3550 0.671 0.000 0.000 0.760 0.236 0.004
#> SRR1818676 3 0.3550 0.671 0.000 0.000 0.760 0.236 0.004
#> SRR1818673 2 0.0579 0.595 0.000 0.984 0.000 0.008 0.008
#> SRR1818674 2 0.0579 0.595 0.000 0.984 0.000 0.008 0.008
#> SRR1818671 4 0.5728 0.257 0.000 0.200 0.000 0.624 0.176
#> SRR1818672 4 0.5728 0.257 0.000 0.200 0.000 0.624 0.176
#> SRR1818661 3 0.1830 0.800 0.012 0.000 0.932 0.052 0.004
#> SRR1818662 3 0.1830 0.800 0.012 0.000 0.932 0.052 0.004
#> SRR1818655 1 0.5845 0.658 0.608 0.004 0.132 0.000 0.256
#> SRR1818656 1 0.5845 0.658 0.608 0.004 0.132 0.000 0.256
#> SRR1818653 3 0.5525 0.579 0.124 0.000 0.636 0.000 0.240
#> SRR1818654 3 0.5525 0.579 0.124 0.000 0.636 0.000 0.240
#> SRR1818651 1 0.5791 0.619 0.616 0.000 0.196 0.000 0.188
#> SRR1818652 1 0.5791 0.619 0.616 0.000 0.196 0.000 0.188
#> SRR1818657 1 0.3916 0.687 0.732 0.000 0.012 0.000 0.256
#> SRR1818658 1 0.3916 0.687 0.732 0.000 0.012 0.000 0.256
#> SRR1818649 1 0.4895 0.661 0.672 0.032 0.012 0.000 0.284
#> SRR1818650 1 0.4895 0.661 0.672 0.032 0.012 0.000 0.284
#> SRR1818659 1 0.4968 0.702 0.712 0.000 0.152 0.000 0.136
#> SRR1818647 4 0.2179 0.715 0.000 0.000 0.112 0.888 0.000
#> SRR1818648 4 0.2179 0.715 0.000 0.000 0.112 0.888 0.000
#> SRR1818645 2 0.5447 0.222 0.000 0.660 0.000 0.172 0.168
#> SRR1818646 2 0.5447 0.222 0.000 0.660 0.000 0.172 0.168
#> SRR1818639 1 0.5876 0.655 0.608 0.004 0.140 0.000 0.248
#> SRR1818640 1 0.5876 0.655 0.608 0.004 0.140 0.000 0.248
#> SRR1818637 4 0.0451 0.750 0.000 0.000 0.008 0.988 0.004
#> SRR1818638 4 0.0451 0.750 0.000 0.000 0.008 0.988 0.004
#> SRR1818635 2 0.0579 0.595 0.000 0.984 0.000 0.008 0.008
#> SRR1818636 2 0.0579 0.595 0.000 0.984 0.000 0.008 0.008
#> SRR1818643 2 0.0404 0.589 0.000 0.988 0.000 0.000 0.012
#> SRR1818644 2 0.0404 0.589 0.000 0.988 0.000 0.000 0.012
#> SRR1818641 2 0.0703 0.581 0.000 0.976 0.000 0.000 0.024
#> SRR1818642 2 0.0703 0.581 0.000 0.976 0.000 0.000 0.024
#> SRR1818633 4 0.8673 0.315 0.056 0.112 0.156 0.444 0.232
#> SRR1818634 4 0.8673 0.315 0.056 0.112 0.156 0.444 0.232
#> SRR1818665 1 0.3639 0.726 0.812 0.000 0.044 0.000 0.144
#> SRR1818666 1 0.3639 0.726 0.812 0.000 0.044 0.000 0.144
#> SRR1818667 4 0.1818 0.734 0.000 0.044 0.000 0.932 0.024
#> SRR1818668 4 0.1818 0.734 0.000 0.044 0.000 0.932 0.024
#> SRR1818669 1 0.3169 0.746 0.856 0.000 0.084 0.000 0.060
#> SRR1818670 1 0.3169 0.746 0.856 0.000 0.084 0.000 0.060
#> SRR1818663 1 0.2249 0.742 0.896 0.000 0.008 0.000 0.096
#> SRR1818664 1 0.2249 0.742 0.896 0.000 0.008 0.000 0.096
#> SRR1818629 2 0.5309 0.257 0.000 0.676 0.000 0.164 0.160
#> SRR1818630 2 0.5309 0.257 0.000 0.676 0.000 0.164 0.160
#> SRR1818627 1 0.4624 0.701 0.740 0.000 0.096 0.000 0.164
#> SRR1818628 1 0.4624 0.701 0.740 0.000 0.096 0.000 0.164
#> SRR1818621 3 0.2953 0.772 0.012 0.000 0.844 0.000 0.144
#> SRR1818622 3 0.2953 0.772 0.012 0.000 0.844 0.000 0.144
#> SRR1818625 1 0.2249 0.742 0.896 0.000 0.008 0.000 0.096
#> SRR1818626 1 0.2249 0.742 0.896 0.000 0.008 0.000 0.096
#> SRR1818623 4 0.2069 0.734 0.000 0.000 0.076 0.912 0.012
#> SRR1818624 4 0.2069 0.734 0.000 0.000 0.076 0.912 0.012
#> SRR1818619 1 0.4109 0.663 0.700 0.000 0.012 0.000 0.288
#> SRR1818620 1 0.4109 0.663 0.700 0.000 0.012 0.000 0.288
#> SRR1818617 5 0.6499 1.000 0.000 0.396 0.000 0.188 0.416
#> SRR1818618 5 0.6499 1.000 0.000 0.396 0.000 0.188 0.416
#> SRR1818615 4 0.3882 0.573 0.000 0.224 0.000 0.756 0.020
#> SRR1818616 4 0.3882 0.573 0.000 0.224 0.000 0.756 0.020
#> SRR1818609 4 0.0865 0.749 0.000 0.024 0.000 0.972 0.004
#> SRR1818610 4 0.0865 0.749 0.000 0.024 0.000 0.972 0.004
#> SRR1818607 2 0.5447 0.222 0.000 0.660 0.000 0.172 0.168
#> SRR1818608 2 0.5447 0.222 0.000 0.660 0.000 0.172 0.168
#> SRR1818613 1 0.5791 0.619 0.616 0.000 0.196 0.000 0.188
#> SRR1818614 1 0.5791 0.619 0.616 0.000 0.196 0.000 0.188
#> SRR1818611 1 0.4895 0.661 0.672 0.032 0.012 0.000 0.284
#> SRR1818612 1 0.4895 0.661 0.672 0.032 0.012 0.000 0.284
#> SRR1818605 3 0.3825 0.777 0.060 0.000 0.804 0.000 0.136
#> SRR1818606 3 0.3825 0.777 0.060 0.000 0.804 0.000 0.136
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.2707 0.7738 0.028 0.000 0.892 0.012 0.032 0.036
#> SRR1818632 3 0.2707 0.7738 0.028 0.000 0.892 0.012 0.032 0.036
#> SRR1818679 3 0.3832 0.7316 0.000 0.056 0.824 0.032 0.016 0.072
#> SRR1818680 3 0.3832 0.7316 0.000 0.056 0.824 0.032 0.016 0.072
#> SRR1818677 6 0.8060 -0.1376 0.000 0.264 0.040 0.116 0.256 0.324
#> SRR1818678 6 0.8060 -0.1376 0.000 0.264 0.040 0.116 0.256 0.324
#> SRR1818675 3 0.3620 0.6605 0.000 0.000 0.736 0.248 0.008 0.008
#> SRR1818676 3 0.3620 0.6605 0.000 0.000 0.736 0.248 0.008 0.008
#> SRR1818673 2 0.1078 0.7531 0.000 0.964 0.000 0.012 0.008 0.016
#> SRR1818674 2 0.1078 0.7531 0.000 0.964 0.000 0.012 0.008 0.016
#> SRR1818671 4 0.6881 0.3113 0.000 0.200 0.008 0.516 0.092 0.184
#> SRR1818672 4 0.6881 0.3113 0.000 0.200 0.008 0.516 0.092 0.184
#> SRR1818661 3 0.2383 0.7790 0.000 0.000 0.880 0.024 0.096 0.000
#> SRR1818662 3 0.2383 0.7790 0.000 0.000 0.880 0.024 0.096 0.000
#> SRR1818655 5 0.5517 0.3806 0.380 0.000 0.012 0.000 0.512 0.096
#> SRR1818656 5 0.5517 0.3806 0.380 0.000 0.012 0.000 0.512 0.096
#> SRR1818653 5 0.4863 -0.1939 0.040 0.000 0.440 0.000 0.512 0.008
#> SRR1818654 5 0.4863 -0.1939 0.040 0.000 0.440 0.000 0.512 0.008
#> SRR1818651 5 0.5636 0.3907 0.364 0.000 0.044 0.000 0.532 0.060
#> SRR1818652 5 0.5636 0.3907 0.364 0.000 0.044 0.000 0.532 0.060
#> SRR1818657 6 0.5887 -0.2038 0.408 0.000 0.016 0.000 0.128 0.448
#> SRR1818658 6 0.5887 -0.2038 0.408 0.000 0.016 0.000 0.128 0.448
#> SRR1818649 1 0.5249 0.4472 0.708 0.012 0.032 0.004 0.140 0.104
#> SRR1818650 1 0.5249 0.4472 0.708 0.012 0.032 0.004 0.140 0.104
#> SRR1818659 1 0.5092 -0.2046 0.560 0.000 0.028 0.000 0.376 0.036
#> SRR1818647 4 0.2051 0.7673 0.000 0.000 0.096 0.896 0.004 0.004
#> SRR1818648 4 0.2051 0.7673 0.000 0.000 0.096 0.896 0.004 0.004
#> SRR1818645 2 0.6232 0.6048 0.000 0.584 0.000 0.112 0.104 0.200
#> SRR1818646 2 0.6232 0.6048 0.000 0.584 0.000 0.112 0.104 0.200
#> SRR1818639 5 0.5291 0.4071 0.372 0.000 0.016 0.000 0.544 0.068
#> SRR1818640 5 0.5291 0.4071 0.372 0.000 0.016 0.000 0.544 0.068
#> SRR1818637 4 0.0922 0.7961 0.000 0.000 0.024 0.968 0.004 0.004
#> SRR1818638 4 0.0922 0.7961 0.000 0.000 0.024 0.968 0.004 0.004
#> SRR1818635 2 0.1078 0.7531 0.000 0.964 0.000 0.012 0.008 0.016
#> SRR1818636 2 0.1078 0.7531 0.000 0.964 0.000 0.012 0.008 0.016
#> SRR1818643 2 0.1621 0.7456 0.000 0.944 0.012 0.008 0.020 0.016
#> SRR1818644 2 0.1621 0.7456 0.000 0.944 0.012 0.008 0.020 0.016
#> SRR1818641 2 0.1458 0.7408 0.000 0.948 0.016 0.000 0.016 0.020
#> SRR1818642 2 0.1458 0.7408 0.000 0.948 0.016 0.000 0.016 0.020
#> SRR1818633 6 0.8145 -0.1047 0.024 0.076 0.144 0.328 0.056 0.372
#> SRR1818634 6 0.8145 -0.1047 0.024 0.076 0.144 0.328 0.056 0.372
#> SRR1818665 1 0.6126 0.3616 0.528 0.000 0.028 0.000 0.180 0.264
#> SRR1818666 1 0.6126 0.3616 0.528 0.000 0.028 0.000 0.180 0.264
#> SRR1818667 4 0.2738 0.7806 0.000 0.028 0.012 0.888 0.020 0.052
#> SRR1818668 4 0.2738 0.7806 0.000 0.028 0.012 0.888 0.020 0.052
#> SRR1818669 1 0.5801 0.3441 0.624 0.000 0.068 0.000 0.200 0.108
#> SRR1818670 1 0.5801 0.3441 0.624 0.000 0.068 0.000 0.200 0.108
#> SRR1818663 1 0.0146 0.5423 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR1818664 1 0.0146 0.5423 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR1818629 2 0.6295 0.5766 0.000 0.592 0.008 0.140 0.072 0.188
#> SRR1818630 2 0.6295 0.5766 0.000 0.592 0.008 0.140 0.072 0.188
#> SRR1818627 1 0.6715 0.3313 0.480 0.000 0.076 0.000 0.168 0.276
#> SRR1818628 1 0.6715 0.3313 0.480 0.000 0.076 0.000 0.168 0.276
#> SRR1818621 3 0.3489 0.6610 0.000 0.000 0.708 0.000 0.288 0.004
#> SRR1818622 3 0.3489 0.6610 0.000 0.000 0.708 0.000 0.288 0.004
#> SRR1818625 1 0.0000 0.5427 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818626 1 0.0000 0.5427 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818623 4 0.2425 0.7629 0.000 0.000 0.100 0.880 0.008 0.012
#> SRR1818624 4 0.2425 0.7629 0.000 0.000 0.100 0.880 0.008 0.012
#> SRR1818619 6 0.5793 -0.1222 0.368 0.000 0.020 0.000 0.112 0.500
#> SRR1818620 6 0.5793 -0.1222 0.368 0.000 0.020 0.000 0.112 0.500
#> SRR1818617 6 0.7537 0.0242 0.008 0.228 0.008 0.096 0.248 0.412
#> SRR1818618 6 0.7537 0.0242 0.008 0.228 0.008 0.096 0.248 0.412
#> SRR1818615 4 0.4025 0.6524 0.000 0.208 0.008 0.748 0.008 0.028
#> SRR1818616 4 0.4025 0.6524 0.000 0.208 0.008 0.748 0.008 0.028
#> SRR1818609 4 0.0881 0.7980 0.000 0.012 0.000 0.972 0.008 0.008
#> SRR1818610 4 0.0881 0.7980 0.000 0.012 0.000 0.972 0.008 0.008
#> SRR1818607 2 0.6232 0.6048 0.000 0.584 0.000 0.112 0.104 0.200
#> SRR1818608 2 0.6232 0.6048 0.000 0.584 0.000 0.112 0.104 0.200
#> SRR1818613 5 0.5636 0.3907 0.364 0.000 0.044 0.000 0.532 0.060
#> SRR1818614 5 0.5636 0.3907 0.364 0.000 0.044 0.000 0.532 0.060
#> SRR1818611 1 0.5249 0.4472 0.708 0.012 0.032 0.004 0.140 0.104
#> SRR1818612 1 0.5249 0.4472 0.708 0.012 0.032 0.004 0.140 0.104
#> SRR1818605 3 0.4525 0.7010 0.076 0.004 0.728 0.000 0.180 0.012
#> SRR1818606 3 0.4525 0.7010 0.076 0.004 0.728 0.000 0.180 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["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 15216 rows and 75 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 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.788 0.922 0.961 0.481 0.504 0.504
#> 3 3 0.821 0.889 0.944 0.189 0.931 0.863
#> 4 4 0.836 0.897 0.927 0.131 0.950 0.884
#> 5 5 0.716 0.828 0.904 0.159 0.866 0.651
#> 6 6 0.773 0.797 0.878 0.054 0.944 0.783
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
#> SRR1818631 1 0.000 0.992 1.000 0.000
#> SRR1818632 1 0.000 0.992 1.000 0.000
#> SRR1818679 1 0.662 0.762 0.828 0.172
#> SRR1818680 1 0.494 0.861 0.892 0.108
#> SRR1818677 2 0.000 0.913 0.000 1.000
#> SRR1818678 2 0.000 0.913 0.000 1.000
#> SRR1818675 1 0.000 0.992 1.000 0.000
#> SRR1818676 1 0.000 0.992 1.000 0.000
#> SRR1818673 2 0.000 0.913 0.000 1.000
#> SRR1818674 2 0.000 0.913 0.000 1.000
#> SRR1818671 2 0.000 0.913 0.000 1.000
#> SRR1818672 2 0.000 0.913 0.000 1.000
#> SRR1818661 1 0.000 0.992 1.000 0.000
#> SRR1818662 1 0.000 0.992 1.000 0.000
#> SRR1818655 1 0.000 0.992 1.000 0.000
#> SRR1818656 1 0.000 0.992 1.000 0.000
#> SRR1818653 1 0.000 0.992 1.000 0.000
#> SRR1818654 1 0.000 0.992 1.000 0.000
#> SRR1818651 1 0.000 0.992 1.000 0.000
#> SRR1818652 1 0.000 0.992 1.000 0.000
#> SRR1818657 1 0.000 0.992 1.000 0.000
#> SRR1818658 1 0.000 0.992 1.000 0.000
#> SRR1818649 1 0.000 0.992 1.000 0.000
#> SRR1818650 1 0.000 0.992 1.000 0.000
#> SRR1818659 1 0.000 0.992 1.000 0.000
#> SRR1818647 2 0.506 0.851 0.112 0.888
#> SRR1818648 2 0.494 0.854 0.108 0.892
#> SRR1818645 2 0.000 0.913 0.000 1.000
#> SRR1818646 2 0.000 0.913 0.000 1.000
#> SRR1818639 1 0.000 0.992 1.000 0.000
#> SRR1818640 1 0.000 0.992 1.000 0.000
#> SRR1818637 2 0.000 0.913 0.000 1.000
#> SRR1818638 2 0.000 0.913 0.000 1.000
#> SRR1818635 2 0.760 0.753 0.220 0.780
#> SRR1818636 2 0.722 0.774 0.200 0.800
#> SRR1818643 2 0.833 0.693 0.264 0.736
#> SRR1818644 2 0.855 0.671 0.280 0.720
#> SRR1818641 2 0.895 0.630 0.312 0.688
#> SRR1818642 2 0.904 0.617 0.320 0.680
#> SRR1818633 1 0.000 0.992 1.000 0.000
#> SRR1818634 1 0.000 0.992 1.000 0.000
#> SRR1818665 1 0.000 0.992 1.000 0.000
#> SRR1818666 1 0.000 0.992 1.000 0.000
#> SRR1818667 2 0.000 0.913 0.000 1.000
#> SRR1818668 2 0.000 0.913 0.000 1.000
#> SRR1818669 1 0.000 0.992 1.000 0.000
#> SRR1818670 1 0.000 0.992 1.000 0.000
#> SRR1818663 1 0.000 0.992 1.000 0.000
#> SRR1818664 1 0.000 0.992 1.000 0.000
#> SRR1818629 2 0.000 0.913 0.000 1.000
#> SRR1818630 2 0.000 0.913 0.000 1.000
#> SRR1818627 1 0.000 0.992 1.000 0.000
#> SRR1818628 1 0.000 0.992 1.000 0.000
#> SRR1818621 1 0.000 0.992 1.000 0.000
#> SRR1818622 1 0.000 0.992 1.000 0.000
#> SRR1818625 1 0.000 0.992 1.000 0.000
#> SRR1818626 1 0.000 0.992 1.000 0.000
#> SRR1818623 2 0.973 0.446 0.404 0.596
#> SRR1818624 2 0.973 0.446 0.404 0.596
#> SRR1818619 1 0.000 0.992 1.000 0.000
#> SRR1818620 1 0.000 0.992 1.000 0.000
#> SRR1818617 2 0.000 0.913 0.000 1.000
#> SRR1818618 2 0.000 0.913 0.000 1.000
#> SRR1818615 2 0.000 0.913 0.000 1.000
#> SRR1818616 2 0.000 0.913 0.000 1.000
#> SRR1818609 2 0.000 0.913 0.000 1.000
#> SRR1818610 2 0.000 0.913 0.000 1.000
#> SRR1818607 2 0.000 0.913 0.000 1.000
#> SRR1818608 2 0.000 0.913 0.000 1.000
#> SRR1818613 1 0.000 0.992 1.000 0.000
#> SRR1818614 1 0.000 0.992 1.000 0.000
#> SRR1818611 1 0.000 0.992 1.000 0.000
#> SRR1818612 1 0.000 0.992 1.000 0.000
#> SRR1818605 1 0.000 0.992 1.000 0.000
#> SRR1818606 1 0.000 0.992 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.5397 0.634 0.720 0.000 0.280
#> SRR1818632 1 0.5363 0.641 0.724 0.000 0.276
#> SRR1818679 1 0.4326 0.791 0.844 0.144 0.012
#> SRR1818680 1 0.3129 0.864 0.904 0.088 0.008
#> SRR1818677 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818678 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818675 1 0.4654 0.753 0.792 0.000 0.208
#> SRR1818676 1 0.4654 0.753 0.792 0.000 0.208
#> SRR1818673 2 0.0000 0.887 0.000 1.000 0.000
#> SRR1818674 2 0.0000 0.887 0.000 1.000 0.000
#> SRR1818671 2 0.0892 0.888 0.000 0.980 0.020
#> SRR1818672 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818661 1 0.5397 0.634 0.720 0.000 0.280
#> SRR1818662 1 0.5397 0.634 0.720 0.000 0.280
#> SRR1818655 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818656 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818653 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818654 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818651 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818652 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818657 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818649 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818650 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818659 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818647 3 0.0000 0.986 0.000 0.000 1.000
#> SRR1818648 3 0.0000 0.986 0.000 0.000 1.000
#> SRR1818645 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818646 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818639 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818640 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818637 3 0.0000 0.986 0.000 0.000 1.000
#> SRR1818638 3 0.0000 0.986 0.000 0.000 1.000
#> SRR1818635 2 0.4796 0.694 0.220 0.780 0.000
#> SRR1818636 2 0.4555 0.714 0.200 0.800 0.000
#> SRR1818643 2 0.5327 0.617 0.272 0.728 0.000
#> SRR1818644 2 0.5560 0.582 0.300 0.700 0.000
#> SRR1818641 2 0.5706 0.571 0.320 0.680 0.000
#> SRR1818642 2 0.5733 0.565 0.324 0.676 0.000
#> SRR1818633 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818634 1 0.0237 0.951 0.996 0.004 0.000
#> SRR1818665 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818666 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818667 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818668 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818669 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818670 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818663 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818664 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818629 2 0.0000 0.887 0.000 1.000 0.000
#> SRR1818630 2 0.0000 0.887 0.000 1.000 0.000
#> SRR1818627 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818628 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818621 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818622 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818625 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818623 3 0.0424 0.985 0.000 0.008 0.992
#> SRR1818624 3 0.0592 0.983 0.000 0.012 0.988
#> SRR1818619 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818620 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818617 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818618 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818615 2 0.0000 0.887 0.000 1.000 0.000
#> SRR1818616 2 0.0000 0.887 0.000 1.000 0.000
#> SRR1818609 3 0.1529 0.969 0.000 0.040 0.960
#> SRR1818610 3 0.1529 0.969 0.000 0.040 0.960
#> SRR1818607 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818608 2 0.0747 0.890 0.000 0.984 0.016
#> SRR1818613 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818614 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818611 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818612 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818605 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1818606 1 0.0000 0.955 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 1 0.4277 0.646 0.720 0.000 0.000 0.280
#> SRR1818632 1 0.4250 0.653 0.724 0.000 0.000 0.276
#> SRR1818679 1 0.4044 0.810 0.820 0.152 0.024 0.004
#> SRR1818680 1 0.3158 0.867 0.880 0.096 0.020 0.004
#> SRR1818677 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818678 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818675 1 0.3942 0.735 0.764 0.000 0.000 0.236
#> SRR1818676 1 0.3942 0.735 0.764 0.000 0.000 0.236
#> SRR1818673 3 0.2216 0.948 0.000 0.092 0.908 0.000
#> SRR1818674 3 0.2216 0.948 0.000 0.092 0.908 0.000
#> SRR1818671 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818672 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818661 1 0.4277 0.646 0.720 0.000 0.000 0.280
#> SRR1818662 1 0.4277 0.646 0.720 0.000 0.000 0.280
#> SRR1818655 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818656 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818653 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818654 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818651 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818658 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818649 1 0.3448 0.854 0.828 0.000 0.168 0.004
#> SRR1818650 1 0.3208 0.872 0.848 0.000 0.148 0.004
#> SRR1818659 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818647 4 0.0188 0.980 0.000 0.004 0.000 0.996
#> SRR1818648 4 0.0188 0.980 0.000 0.004 0.000 0.996
#> SRR1818645 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818646 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818639 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818640 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818637 4 0.0188 0.980 0.000 0.004 0.000 0.996
#> SRR1818638 4 0.0188 0.980 0.000 0.004 0.000 0.996
#> SRR1818635 3 0.2011 0.947 0.000 0.080 0.920 0.000
#> SRR1818636 3 0.2011 0.947 0.000 0.080 0.920 0.000
#> SRR1818643 3 0.3245 0.928 0.028 0.100 0.872 0.000
#> SRR1818644 3 0.3333 0.918 0.040 0.088 0.872 0.000
#> SRR1818641 3 0.3528 0.873 0.000 0.192 0.808 0.000
#> SRR1818642 3 0.3528 0.873 0.000 0.192 0.808 0.000
#> SRR1818633 1 0.1576 0.913 0.948 0.000 0.048 0.004
#> SRR1818634 1 0.1902 0.911 0.932 0.000 0.064 0.004
#> SRR1818665 1 0.1902 0.909 0.932 0.000 0.064 0.004
#> SRR1818666 1 0.1978 0.908 0.928 0.000 0.068 0.004
#> SRR1818667 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818668 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818669 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818670 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818663 1 0.2401 0.901 0.904 0.000 0.092 0.004
#> SRR1818664 1 0.2401 0.901 0.904 0.000 0.092 0.004
#> SRR1818629 3 0.1940 0.942 0.000 0.076 0.924 0.000
#> SRR1818630 3 0.2149 0.948 0.000 0.088 0.912 0.000
#> SRR1818627 1 0.0336 0.921 0.992 0.000 0.008 0.000
#> SRR1818628 1 0.0469 0.921 0.988 0.000 0.012 0.000
#> SRR1818621 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818622 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818625 1 0.3831 0.826 0.792 0.000 0.204 0.004
#> SRR1818626 1 0.3306 0.868 0.840 0.000 0.156 0.004
#> SRR1818623 4 0.0707 0.978 0.000 0.020 0.000 0.980
#> SRR1818624 4 0.0817 0.976 0.000 0.024 0.000 0.976
#> SRR1818619 1 0.2401 0.901 0.904 0.000 0.092 0.004
#> SRR1818620 1 0.2401 0.901 0.904 0.000 0.092 0.004
#> SRR1818617 2 0.0592 0.937 0.000 0.984 0.016 0.000
#> SRR1818618 2 0.0592 0.937 0.000 0.984 0.016 0.000
#> SRR1818615 2 0.4103 0.649 0.000 0.744 0.256 0.000
#> SRR1818616 2 0.4250 0.612 0.000 0.724 0.276 0.000
#> SRR1818609 4 0.1302 0.961 0.000 0.044 0.000 0.956
#> SRR1818610 4 0.1302 0.961 0.000 0.044 0.000 0.956
#> SRR1818607 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818608 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818613 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.922 1.000 0.000 0.000 0.000
#> SRR1818611 1 0.2401 0.901 0.904 0.000 0.092 0.004
#> SRR1818612 1 0.2401 0.901 0.904 0.000 0.092 0.004
#> SRR1818605 1 0.0895 0.920 0.976 0.000 0.020 0.004
#> SRR1818606 1 0.0657 0.921 0.984 0.000 0.012 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.4955 0.583 0.072 0.000 0.680 0.248 0.000
#> SRR1818632 3 0.4877 0.598 0.072 0.000 0.692 0.236 0.000
#> SRR1818679 3 0.4361 0.690 0.124 0.108 0.768 0.000 0.000
#> SRR1818680 3 0.3840 0.740 0.116 0.076 0.808 0.000 0.000
#> SRR1818677 2 0.1121 0.841 0.044 0.956 0.000 0.000 0.000
#> SRR1818678 2 0.1270 0.837 0.052 0.948 0.000 0.000 0.000
#> SRR1818675 3 0.3143 0.726 0.000 0.000 0.796 0.204 0.000
#> SRR1818676 3 0.3143 0.726 0.000 0.000 0.796 0.204 0.000
#> SRR1818673 5 0.0000 0.947 0.000 0.000 0.000 0.000 1.000
#> SRR1818674 5 0.0000 0.947 0.000 0.000 0.000 0.000 1.000
#> SRR1818671 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> SRR1818672 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> SRR1818661 3 0.4955 0.583 0.072 0.000 0.680 0.248 0.000
#> SRR1818662 3 0.4955 0.583 0.072 0.000 0.680 0.248 0.000
#> SRR1818655 3 0.0290 0.882 0.008 0.000 0.992 0.000 0.000
#> SRR1818656 3 0.0510 0.880 0.016 0.000 0.984 0.000 0.000
#> SRR1818653 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818654 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818651 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818652 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818657 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818658 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818649 1 0.4074 0.561 0.636 0.000 0.364 0.000 0.000
#> SRR1818650 1 0.3913 0.646 0.676 0.000 0.324 0.000 0.000
#> SRR1818659 3 0.1197 0.860 0.048 0.000 0.952 0.000 0.000
#> SRR1818647 4 0.0000 0.995 0.000 0.000 0.000 1.000 0.000
#> SRR1818648 4 0.0000 0.995 0.000 0.000 0.000 1.000 0.000
#> SRR1818645 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> SRR1818646 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> SRR1818639 3 0.0404 0.881 0.012 0.000 0.988 0.000 0.000
#> SRR1818640 3 0.0510 0.879 0.016 0.000 0.984 0.000 0.000
#> SRR1818637 4 0.0000 0.995 0.000 0.000 0.000 1.000 0.000
#> SRR1818638 4 0.0000 0.995 0.000 0.000 0.000 1.000 0.000
#> SRR1818635 5 0.0000 0.947 0.000 0.000 0.000 0.000 1.000
#> SRR1818636 5 0.0000 0.947 0.000 0.000 0.000 0.000 1.000
#> SRR1818643 5 0.1697 0.924 0.000 0.060 0.008 0.000 0.932
#> SRR1818644 5 0.2054 0.916 0.000 0.052 0.028 0.000 0.920
#> SRR1818641 5 0.2516 0.860 0.000 0.140 0.000 0.000 0.860
#> SRR1818642 5 0.2516 0.860 0.000 0.140 0.000 0.000 0.860
#> SRR1818633 3 0.2773 0.745 0.164 0.000 0.836 0.000 0.000
#> SRR1818634 3 0.2852 0.739 0.172 0.000 0.828 0.000 0.000
#> SRR1818665 1 0.3480 0.824 0.752 0.000 0.248 0.000 0.000
#> SRR1818666 1 0.3274 0.847 0.780 0.000 0.220 0.000 0.000
#> SRR1818667 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> SRR1818668 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> SRR1818669 3 0.0162 0.883 0.004 0.000 0.996 0.000 0.000
#> SRR1818670 3 0.0162 0.883 0.004 0.000 0.996 0.000 0.000
#> SRR1818663 1 0.2561 0.876 0.856 0.000 0.144 0.000 0.000
#> SRR1818664 1 0.2561 0.876 0.856 0.000 0.144 0.000 0.000
#> SRR1818629 5 0.0000 0.947 0.000 0.000 0.000 0.000 1.000
#> SRR1818630 5 0.0162 0.946 0.000 0.004 0.000 0.000 0.996
#> SRR1818627 3 0.0794 0.873 0.028 0.000 0.972 0.000 0.000
#> SRR1818628 3 0.0794 0.873 0.028 0.000 0.972 0.000 0.000
#> SRR1818621 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818622 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818625 1 0.2561 0.876 0.856 0.000 0.144 0.000 0.000
#> SRR1818626 1 0.2561 0.876 0.856 0.000 0.144 0.000 0.000
#> SRR1818623 4 0.0290 0.992 0.000 0.008 0.000 0.992 0.000
#> SRR1818624 4 0.0404 0.988 0.000 0.012 0.000 0.988 0.000
#> SRR1818619 1 0.3305 0.855 0.776 0.000 0.224 0.000 0.000
#> SRR1818620 1 0.3074 0.866 0.804 0.000 0.196 0.000 0.000
#> SRR1818617 2 0.4297 0.192 0.472 0.528 0.000 0.000 0.000
#> SRR1818618 2 0.4256 0.283 0.436 0.564 0.000 0.000 0.000
#> SRR1818615 2 0.3857 0.542 0.000 0.688 0.000 0.000 0.312
#> SRR1818616 2 0.3966 0.500 0.000 0.664 0.000 0.000 0.336
#> SRR1818609 4 0.0162 0.994 0.000 0.004 0.000 0.996 0.000
#> SRR1818610 4 0.0162 0.994 0.000 0.004 0.000 0.996 0.000
#> SRR1818607 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> SRR1818608 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> SRR1818613 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818614 3 0.0000 0.883 0.000 0.000 1.000 0.000 0.000
#> SRR1818611 1 0.1608 0.815 0.928 0.000 0.072 0.000 0.000
#> SRR1818612 1 0.1608 0.815 0.928 0.000 0.072 0.000 0.000
#> SRR1818605 3 0.2074 0.823 0.104 0.000 0.896 0.000 0.000
#> SRR1818606 3 0.1908 0.831 0.092 0.000 0.908 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.4037 0.988 0.380 0.000 0.608 0.012 0.000 0.000
#> SRR1818632 3 0.3955 0.989 0.384 0.000 0.608 0.008 0.000 0.000
#> SRR1818679 1 0.3468 0.578 0.712 0.000 0.284 0.000 0.000 0.004
#> SRR1818680 1 0.3309 0.586 0.720 0.000 0.280 0.000 0.000 0.000
#> SRR1818677 5 0.2219 0.822 0.000 0.000 0.136 0.000 0.864 0.000
#> SRR1818678 5 0.2562 0.794 0.000 0.000 0.172 0.000 0.828 0.000
#> SRR1818675 1 0.3865 0.631 0.752 0.000 0.056 0.192 0.000 0.000
#> SRR1818676 1 0.3865 0.631 0.752 0.000 0.056 0.192 0.000 0.000
#> SRR1818673 2 0.0000 0.948 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818674 2 0.0000 0.948 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818671 5 0.0000 0.905 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818672 5 0.0146 0.904 0.000 0.000 0.000 0.004 0.996 0.000
#> SRR1818661 3 0.4057 0.991 0.388 0.000 0.600 0.012 0.000 0.000
#> SRR1818662 3 0.4057 0.991 0.388 0.000 0.600 0.012 0.000 0.000
#> SRR1818655 1 0.1500 0.825 0.936 0.000 0.012 0.000 0.000 0.052
#> SRR1818656 1 0.1225 0.835 0.952 0.000 0.012 0.000 0.000 0.036
#> SRR1818653 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818654 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818651 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818657 1 0.0260 0.843 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR1818658 1 0.0260 0.843 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR1818649 6 0.5979 0.297 0.308 0.000 0.252 0.000 0.000 0.440
#> SRR1818650 6 0.5803 0.405 0.248 0.000 0.252 0.000 0.000 0.500
#> SRR1818659 1 0.4500 0.536 0.676 0.000 0.076 0.000 0.000 0.248
#> SRR1818647 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818648 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818645 5 0.0000 0.905 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818646 5 0.0000 0.905 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818639 1 0.0508 0.842 0.984 0.000 0.004 0.000 0.000 0.012
#> SRR1818640 1 0.0603 0.840 0.980 0.000 0.004 0.000 0.000 0.016
#> SRR1818637 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818638 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818635 2 0.0000 0.948 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818636 2 0.0000 0.948 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818643 2 0.1462 0.927 0.008 0.936 0.000 0.000 0.056 0.000
#> SRR1818644 2 0.1780 0.918 0.028 0.924 0.000 0.000 0.048 0.000
#> SRR1818641 2 0.2260 0.861 0.000 0.860 0.000 0.000 0.140 0.000
#> SRR1818642 2 0.2260 0.861 0.000 0.860 0.000 0.000 0.140 0.000
#> SRR1818633 1 0.2489 0.776 0.860 0.000 0.012 0.000 0.000 0.128
#> SRR1818634 1 0.3010 0.749 0.828 0.004 0.020 0.000 0.000 0.148
#> SRR1818665 6 0.2278 0.678 0.004 0.000 0.128 0.000 0.000 0.868
#> SRR1818666 6 0.2135 0.680 0.000 0.000 0.128 0.000 0.000 0.872
#> SRR1818667 5 0.0146 0.904 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR1818668 5 0.0146 0.904 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR1818669 1 0.0692 0.844 0.976 0.000 0.004 0.000 0.000 0.020
#> SRR1818670 1 0.0790 0.842 0.968 0.000 0.000 0.000 0.000 0.032
#> SRR1818663 6 0.0000 0.718 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818664 6 0.0000 0.718 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818629 2 0.0000 0.948 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818630 2 0.0146 0.946 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1818627 1 0.2901 0.732 0.840 0.000 0.128 0.000 0.000 0.032
#> SRR1818628 1 0.2667 0.747 0.852 0.000 0.128 0.000 0.000 0.020
#> SRR1818621 1 0.1007 0.815 0.956 0.000 0.044 0.000 0.000 0.000
#> SRR1818622 1 0.1204 0.803 0.944 0.000 0.056 0.000 0.000 0.000
#> SRR1818625 6 0.0000 0.718 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818626 6 0.0000 0.718 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818623 4 0.0806 0.977 0.000 0.000 0.020 0.972 0.008 0.000
#> SRR1818624 4 0.0909 0.974 0.000 0.000 0.020 0.968 0.012 0.000
#> SRR1818619 6 0.3766 0.493 0.256 0.000 0.024 0.000 0.000 0.720
#> SRR1818620 6 0.3398 0.505 0.252 0.000 0.008 0.000 0.000 0.740
#> SRR1818617 6 0.4152 0.305 0.000 0.000 0.012 0.000 0.440 0.548
#> SRR1818618 6 0.4183 0.205 0.000 0.000 0.012 0.000 0.480 0.508
#> SRR1818615 5 0.3464 0.609 0.000 0.312 0.000 0.000 0.688 0.000
#> SRR1818616 5 0.3563 0.567 0.000 0.336 0.000 0.000 0.664 0.000
#> SRR1818609 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818610 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818607 5 0.0000 0.905 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818608 5 0.0000 0.905 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818613 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818611 6 0.3151 0.662 0.000 0.000 0.252 0.000 0.000 0.748
#> SRR1818612 6 0.3151 0.662 0.000 0.000 0.252 0.000 0.000 0.748
#> SRR1818605 1 0.2631 0.737 0.820 0.000 0.000 0.000 0.000 0.180
#> SRR1818606 1 0.1957 0.802 0.888 0.000 0.000 0.000 0.000 0.112
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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.444 0.693 0.811 0.4282 0.504 0.504
#> 3 3 0.619 0.815 0.881 0.4904 0.762 0.559
#> 4 4 0.535 0.737 0.814 0.0932 0.867 0.651
#> 5 5 0.542 0.559 0.741 0.0898 0.901 0.680
#> 6 6 0.632 0.594 0.732 0.0571 0.894 0.583
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
#> SRR1818631 1 0.141 0.638 0.980 0.020
#> SRR1818632 1 0.141 0.638 0.980 0.020
#> SRR1818679 1 0.955 -0.510 0.624 0.376
#> SRR1818680 1 0.958 -0.522 0.620 0.380
#> SRR1818677 2 0.973 0.983 0.404 0.596
#> SRR1818678 2 0.973 0.983 0.404 0.596
#> SRR1818675 1 0.963 -0.537 0.612 0.388
#> SRR1818676 1 0.983 -0.644 0.576 0.424
#> SRR1818673 2 0.987 0.963 0.432 0.568
#> SRR1818674 2 0.987 0.963 0.432 0.568
#> SRR1818671 2 0.973 0.983 0.404 0.596
#> SRR1818672 2 0.973 0.983 0.404 0.596
#> SRR1818661 1 0.141 0.638 0.980 0.020
#> SRR1818662 1 0.141 0.638 0.980 0.020
#> SRR1818655 1 0.000 0.649 1.000 0.000
#> SRR1818656 1 0.000 0.649 1.000 0.000
#> SRR1818653 1 0.141 0.638 0.980 0.020
#> SRR1818654 1 0.141 0.638 0.980 0.020
#> SRR1818651 1 0.814 0.672 0.748 0.252
#> SRR1818652 1 0.814 0.672 0.748 0.252
#> SRR1818657 1 0.971 0.629 0.600 0.400
#> SRR1818658 1 0.971 0.629 0.600 0.400
#> SRR1818649 1 0.388 0.658 0.924 0.076
#> SRR1818650 1 0.416 0.660 0.916 0.084
#> SRR1818659 1 0.118 0.656 0.984 0.016
#> SRR1818647 2 0.987 0.959 0.432 0.568
#> SRR1818648 2 0.987 0.959 0.432 0.568
#> SRR1818645 2 0.973 0.983 0.404 0.596
#> SRR1818646 2 0.973 0.983 0.404 0.596
#> SRR1818639 1 0.118 0.656 0.984 0.016
#> SRR1818640 1 0.118 0.656 0.984 0.016
#> SRR1818637 2 0.987 0.959 0.432 0.568
#> SRR1818638 2 0.987 0.959 0.432 0.568
#> SRR1818635 2 0.987 0.963 0.432 0.568
#> SRR1818636 2 0.987 0.963 0.432 0.568
#> SRR1818643 2 0.973 0.983 0.404 0.596
#> SRR1818644 2 0.973 0.983 0.404 0.596
#> SRR1818641 2 0.973 0.983 0.404 0.596
#> SRR1818642 2 0.973 0.983 0.404 0.596
#> SRR1818633 1 0.952 -0.479 0.628 0.372
#> SRR1818634 1 0.952 -0.479 0.628 0.372
#> SRR1818665 1 0.971 0.629 0.600 0.400
#> SRR1818666 1 0.971 0.629 0.600 0.400
#> SRR1818667 2 0.975 0.981 0.408 0.592
#> SRR1818668 2 0.975 0.981 0.408 0.592
#> SRR1818669 1 0.141 0.658 0.980 0.020
#> SRR1818670 1 0.141 0.658 0.980 0.020
#> SRR1818663 1 0.971 0.629 0.600 0.400
#> SRR1818664 1 0.971 0.629 0.600 0.400
#> SRR1818629 2 0.973 0.983 0.404 0.596
#> SRR1818630 2 0.973 0.983 0.404 0.596
#> SRR1818627 1 0.839 0.670 0.732 0.268
#> SRR1818628 1 0.821 0.672 0.744 0.256
#> SRR1818621 1 0.141 0.638 0.980 0.020
#> SRR1818622 1 0.141 0.638 0.980 0.020
#> SRR1818625 1 0.971 0.629 0.600 0.400
#> SRR1818626 1 0.971 0.629 0.600 0.400
#> SRR1818623 2 0.987 0.959 0.432 0.568
#> SRR1818624 2 0.987 0.959 0.432 0.568
#> SRR1818619 1 0.224 0.621 0.964 0.036
#> SRR1818620 1 0.260 0.609 0.956 0.044
#> SRR1818617 2 0.973 0.983 0.404 0.596
#> SRR1818618 2 0.973 0.983 0.404 0.596
#> SRR1818615 2 0.973 0.983 0.404 0.596
#> SRR1818616 2 0.973 0.983 0.404 0.596
#> SRR1818609 2 0.973 0.983 0.404 0.596
#> SRR1818610 2 0.973 0.983 0.404 0.596
#> SRR1818607 2 0.973 0.983 0.404 0.596
#> SRR1818608 2 0.973 0.983 0.404 0.596
#> SRR1818613 1 0.921 0.653 0.664 0.336
#> SRR1818614 1 0.921 0.653 0.664 0.336
#> SRR1818611 1 0.949 0.643 0.632 0.368
#> SRR1818612 1 0.943 0.646 0.640 0.360
#> SRR1818605 1 0.680 0.672 0.820 0.180
#> SRR1818606 1 0.697 0.672 0.812 0.188
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.6051 0.7127 0.292 0.012 0.696
#> SRR1818632 3 0.6051 0.7127 0.292 0.012 0.696
#> SRR1818679 3 0.8726 0.6604 0.212 0.196 0.592
#> SRR1818680 3 0.9120 0.5950 0.256 0.200 0.544
#> SRR1818677 2 0.1015 0.9500 0.008 0.980 0.012
#> SRR1818678 2 0.1015 0.9500 0.008 0.980 0.012
#> SRR1818675 3 0.2918 0.7893 0.044 0.032 0.924
#> SRR1818676 3 0.2806 0.7883 0.040 0.032 0.928
#> SRR1818673 2 0.0829 0.9525 0.004 0.984 0.012
#> SRR1818674 2 0.0829 0.9525 0.004 0.984 0.012
#> SRR1818671 2 0.2448 0.9077 0.000 0.924 0.076
#> SRR1818672 2 0.2537 0.9042 0.000 0.920 0.080
#> SRR1818661 3 0.6224 0.7112 0.296 0.016 0.688
#> SRR1818662 3 0.6224 0.7112 0.296 0.016 0.688
#> SRR1818655 1 0.2486 0.8369 0.932 0.008 0.060
#> SRR1818656 1 0.2486 0.8369 0.932 0.008 0.060
#> SRR1818653 1 0.6540 0.0639 0.584 0.008 0.408
#> SRR1818654 1 0.6498 0.1137 0.596 0.008 0.396
#> SRR1818651 1 0.1711 0.8706 0.960 0.032 0.008
#> SRR1818652 1 0.2173 0.8740 0.944 0.048 0.008
#> SRR1818657 1 0.2261 0.8758 0.932 0.068 0.000
#> SRR1818658 1 0.2537 0.8740 0.920 0.080 0.000
#> SRR1818649 1 0.3983 0.8343 0.852 0.144 0.004
#> SRR1818650 1 0.3983 0.8343 0.852 0.144 0.004
#> SRR1818659 1 0.2339 0.8435 0.940 0.012 0.048
#> SRR1818647 3 0.2564 0.7829 0.028 0.036 0.936
#> SRR1818648 3 0.2564 0.7829 0.028 0.036 0.936
#> SRR1818645 2 0.0000 0.9515 0.000 1.000 0.000
#> SRR1818646 2 0.0000 0.9515 0.000 1.000 0.000
#> SRR1818639 1 0.2486 0.8369 0.932 0.008 0.060
#> SRR1818640 1 0.2486 0.8369 0.932 0.008 0.060
#> SRR1818637 3 0.1964 0.7668 0.000 0.056 0.944
#> SRR1818638 3 0.1964 0.7668 0.000 0.056 0.944
#> SRR1818635 2 0.0829 0.9525 0.004 0.984 0.012
#> SRR1818636 2 0.0829 0.9525 0.004 0.984 0.012
#> SRR1818643 2 0.0000 0.9515 0.000 1.000 0.000
#> SRR1818644 2 0.0000 0.9515 0.000 1.000 0.000
#> SRR1818641 2 0.0475 0.9523 0.004 0.992 0.004
#> SRR1818642 2 0.0475 0.9523 0.004 0.992 0.004
#> SRR1818633 3 0.8494 0.6620 0.236 0.156 0.608
#> SRR1818634 3 0.8576 0.6545 0.240 0.160 0.600
#> SRR1818665 1 0.2537 0.8735 0.920 0.080 0.000
#> SRR1818666 1 0.2625 0.8726 0.916 0.084 0.000
#> SRR1818667 2 0.6045 0.3919 0.000 0.620 0.380
#> SRR1818668 2 0.5859 0.4939 0.000 0.656 0.344
#> SRR1818669 1 0.1529 0.8751 0.960 0.040 0.000
#> SRR1818670 1 0.1529 0.8751 0.960 0.040 0.000
#> SRR1818663 1 0.2711 0.8707 0.912 0.088 0.000
#> SRR1818664 1 0.2625 0.8724 0.916 0.084 0.000
#> SRR1818629 2 0.0829 0.9525 0.004 0.984 0.012
#> SRR1818630 2 0.0829 0.9525 0.004 0.984 0.012
#> SRR1818627 1 0.1751 0.8713 0.960 0.028 0.012
#> SRR1818628 1 0.1751 0.8730 0.960 0.028 0.012
#> SRR1818621 3 0.6313 0.6941 0.308 0.016 0.676
#> SRR1818622 3 0.6313 0.6941 0.308 0.016 0.676
#> SRR1818625 1 0.3983 0.8343 0.852 0.144 0.004
#> SRR1818626 1 0.3983 0.8343 0.852 0.144 0.004
#> SRR1818623 3 0.2318 0.7830 0.028 0.028 0.944
#> SRR1818624 3 0.2318 0.7830 0.028 0.028 0.944
#> SRR1818619 1 0.3983 0.8343 0.852 0.144 0.004
#> SRR1818620 1 0.3983 0.8343 0.852 0.144 0.004
#> SRR1818617 2 0.0237 0.9524 0.000 0.996 0.004
#> SRR1818618 2 0.0237 0.9524 0.000 0.996 0.004
#> SRR1818615 2 0.0747 0.9502 0.000 0.984 0.016
#> SRR1818616 2 0.0747 0.9502 0.000 0.984 0.016
#> SRR1818609 3 0.4702 0.6931 0.000 0.212 0.788
#> SRR1818610 3 0.4702 0.6931 0.000 0.212 0.788
#> SRR1818607 2 0.0000 0.9515 0.000 1.000 0.000
#> SRR1818608 2 0.0000 0.9515 0.000 1.000 0.000
#> SRR1818613 1 0.1620 0.8621 0.964 0.012 0.024
#> SRR1818614 1 0.1620 0.8621 0.964 0.012 0.024
#> SRR1818611 1 0.3983 0.8343 0.852 0.144 0.004
#> SRR1818612 1 0.3983 0.8343 0.852 0.144 0.004
#> SRR1818605 1 0.1529 0.8479 0.960 0.000 0.040
#> SRR1818606 1 0.1411 0.8491 0.964 0.000 0.036
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.4488 0.7417 0.096 0.008 0.820 0.076
#> SRR1818632 3 0.4488 0.7417 0.096 0.008 0.820 0.076
#> SRR1818679 1 0.6009 0.5067 0.648 0.008 0.292 0.052
#> SRR1818680 1 0.6053 0.4916 0.640 0.008 0.300 0.052
#> SRR1818677 2 0.1985 0.8796 0.040 0.940 0.016 0.004
#> SRR1818678 2 0.2099 0.8785 0.040 0.936 0.020 0.004
#> SRR1818675 3 0.5262 0.7625 0.128 0.008 0.768 0.096
#> SRR1818676 3 0.5262 0.7625 0.128 0.008 0.768 0.096
#> SRR1818673 2 0.2810 0.8645 0.008 0.896 0.088 0.008
#> SRR1818674 2 0.2810 0.8645 0.008 0.896 0.088 0.008
#> SRR1818671 2 0.4049 0.7586 0.008 0.780 0.212 0.000
#> SRR1818672 2 0.4086 0.7535 0.008 0.776 0.216 0.000
#> SRR1818661 3 0.3647 0.7461 0.096 0.004 0.860 0.040
#> SRR1818662 3 0.3647 0.7461 0.096 0.004 0.860 0.040
#> SRR1818655 4 0.3674 0.9684 0.116 0.036 0.000 0.848
#> SRR1818656 4 0.3674 0.9684 0.116 0.036 0.000 0.848
#> SRR1818653 3 0.7075 0.3968 0.080 0.020 0.540 0.360
#> SRR1818654 3 0.7118 0.3914 0.084 0.020 0.540 0.356
#> SRR1818651 1 0.3302 0.7806 0.876 0.096 0.020 0.008
#> SRR1818652 1 0.3409 0.7799 0.872 0.096 0.024 0.008
#> SRR1818657 1 0.2918 0.7812 0.876 0.116 0.000 0.008
#> SRR1818658 1 0.2918 0.7812 0.876 0.116 0.000 0.008
#> SRR1818649 1 0.3606 0.7775 0.840 0.140 0.020 0.000
#> SRR1818650 1 0.3606 0.7775 0.840 0.140 0.020 0.000
#> SRR1818659 4 0.5815 0.8634 0.148 0.044 0.060 0.748
#> SRR1818647 3 0.3069 0.7514 0.088 0.012 0.888 0.012
#> SRR1818648 3 0.3069 0.7514 0.088 0.012 0.888 0.012
#> SRR1818645 2 0.0336 0.8934 0.000 0.992 0.008 0.000
#> SRR1818646 2 0.0336 0.8934 0.000 0.992 0.008 0.000
#> SRR1818639 4 0.3674 0.9684 0.116 0.036 0.000 0.848
#> SRR1818640 4 0.3674 0.9684 0.116 0.036 0.000 0.848
#> SRR1818637 3 0.2401 0.7425 0.000 0.004 0.904 0.092
#> SRR1818638 3 0.2401 0.7425 0.000 0.004 0.904 0.092
#> SRR1818635 2 0.2302 0.8821 0.008 0.924 0.060 0.008
#> SRR1818636 2 0.2302 0.8821 0.008 0.924 0.060 0.008
#> SRR1818643 2 0.0657 0.8920 0.004 0.984 0.000 0.012
#> SRR1818644 2 0.0657 0.8920 0.004 0.984 0.000 0.012
#> SRR1818641 2 0.0672 0.8933 0.008 0.984 0.000 0.008
#> SRR1818642 2 0.0524 0.8931 0.004 0.988 0.000 0.008
#> SRR1818633 1 0.5937 0.5266 0.660 0.008 0.280 0.052
#> SRR1818634 1 0.5937 0.5266 0.660 0.008 0.280 0.052
#> SRR1818665 1 0.2704 0.7809 0.876 0.124 0.000 0.000
#> SRR1818666 1 0.2760 0.7797 0.872 0.128 0.000 0.000
#> SRR1818667 2 0.5918 0.0791 0.012 0.496 0.476 0.016
#> SRR1818668 2 0.5906 0.1552 0.012 0.516 0.456 0.016
#> SRR1818669 1 0.4380 0.6903 0.800 0.032 0.164 0.004
#> SRR1818670 1 0.4380 0.6903 0.800 0.032 0.164 0.004
#> SRR1818663 1 0.2704 0.7808 0.876 0.124 0.000 0.000
#> SRR1818664 1 0.2704 0.7808 0.876 0.124 0.000 0.000
#> SRR1818629 2 0.1284 0.8939 0.012 0.964 0.024 0.000
#> SRR1818630 2 0.1471 0.8941 0.012 0.960 0.024 0.004
#> SRR1818627 1 0.4419 0.7554 0.824 0.096 0.072 0.008
#> SRR1818628 1 0.4043 0.7690 0.844 0.096 0.052 0.008
#> SRR1818621 3 0.5745 0.6535 0.056 0.000 0.656 0.288
#> SRR1818622 3 0.5745 0.6535 0.056 0.000 0.656 0.288
#> SRR1818625 1 0.2868 0.7782 0.864 0.136 0.000 0.000
#> SRR1818626 1 0.2868 0.7782 0.864 0.136 0.000 0.000
#> SRR1818623 3 0.2610 0.7538 0.088 0.000 0.900 0.012
#> SRR1818624 3 0.2610 0.7538 0.088 0.000 0.900 0.012
#> SRR1818619 1 0.4214 0.6685 0.780 0.016 0.204 0.000
#> SRR1818620 1 0.4214 0.6685 0.780 0.016 0.204 0.000
#> SRR1818617 2 0.0469 0.8922 0.012 0.988 0.000 0.000
#> SRR1818618 2 0.0469 0.8922 0.012 0.988 0.000 0.000
#> SRR1818615 2 0.2665 0.8645 0.008 0.900 0.088 0.004
#> SRR1818616 2 0.2665 0.8645 0.008 0.900 0.088 0.004
#> SRR1818609 3 0.5244 0.2268 0.008 0.372 0.616 0.004
#> SRR1818610 3 0.5214 0.2529 0.008 0.364 0.624 0.004
#> SRR1818607 2 0.0524 0.8938 0.004 0.988 0.008 0.000
#> SRR1818608 2 0.0524 0.8938 0.004 0.988 0.008 0.000
#> SRR1818613 1 0.4687 0.7734 0.808 0.096 0.088 0.008
#> SRR1818614 1 0.4687 0.7734 0.808 0.096 0.088 0.008
#> SRR1818611 1 0.5148 0.6303 0.736 0.056 0.000 0.208
#> SRR1818612 1 0.5148 0.6303 0.736 0.056 0.000 0.208
#> SRR1818605 1 0.6840 0.5371 0.572 0.096 0.324 0.008
#> SRR1818606 1 0.6840 0.5371 0.572 0.096 0.324 0.008
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.3538 0.68935 0.024 0.008 0.856 0.084 0.028
#> SRR1818632 3 0.3538 0.68935 0.024 0.008 0.856 0.084 0.028
#> SRR1818679 1 0.6534 0.00434 0.492 0.020 0.060 0.404 0.024
#> SRR1818680 1 0.6663 -0.01087 0.484 0.024 0.064 0.404 0.024
#> SRR1818677 2 0.5370 0.68241 0.080 0.744 0.128 0.024 0.024
#> SRR1818678 2 0.5484 0.67394 0.096 0.740 0.112 0.028 0.024
#> SRR1818675 3 0.4314 0.70145 0.092 0.000 0.780 0.124 0.004
#> SRR1818676 3 0.4314 0.70145 0.092 0.000 0.780 0.124 0.004
#> SRR1818673 4 0.5168 -0.23916 0.008 0.416 0.004 0.552 0.020
#> SRR1818674 4 0.5161 -0.22949 0.008 0.412 0.004 0.556 0.020
#> SRR1818671 2 0.6121 0.65855 0.012 0.644 0.176 0.156 0.012
#> SRR1818672 2 0.6121 0.65855 0.012 0.644 0.176 0.156 0.012
#> SRR1818661 3 0.5314 0.63397 0.044 0.000 0.648 0.288 0.020
#> SRR1818662 3 0.5314 0.63397 0.044 0.000 0.648 0.288 0.020
#> SRR1818655 5 0.1205 0.78651 0.004 0.040 0.000 0.000 0.956
#> SRR1818656 5 0.1205 0.78651 0.004 0.040 0.000 0.000 0.956
#> SRR1818653 5 0.5221 0.38843 0.036 0.008 0.372 0.000 0.584
#> SRR1818654 5 0.5221 0.38843 0.036 0.008 0.372 0.000 0.584
#> SRR1818651 1 0.3713 0.66507 0.824 0.004 0.132 0.008 0.032
#> SRR1818652 1 0.3591 0.66602 0.828 0.004 0.132 0.004 0.032
#> SRR1818657 1 0.0613 0.76890 0.984 0.008 0.000 0.004 0.004
#> SRR1818658 1 0.0960 0.76851 0.972 0.016 0.000 0.004 0.008
#> SRR1818649 1 0.3982 0.69419 0.812 0.116 0.000 0.060 0.012
#> SRR1818650 1 0.3982 0.69419 0.812 0.116 0.000 0.060 0.012
#> SRR1818659 5 0.4264 0.60707 0.020 0.044 0.148 0.000 0.788
#> SRR1818647 3 0.5348 0.68485 0.088 0.004 0.688 0.212 0.008
#> SRR1818648 3 0.5318 0.68596 0.088 0.004 0.692 0.208 0.008
#> SRR1818645 2 0.1808 0.73899 0.020 0.936 0.000 0.040 0.004
#> SRR1818646 2 0.1808 0.73899 0.020 0.936 0.000 0.040 0.004
#> SRR1818639 5 0.1282 0.78596 0.004 0.044 0.000 0.000 0.952
#> SRR1818640 5 0.1282 0.78596 0.004 0.044 0.000 0.000 0.952
#> SRR1818637 3 0.2953 0.61068 0.000 0.028 0.868 0.100 0.004
#> SRR1818638 3 0.2953 0.61068 0.000 0.028 0.868 0.100 0.004
#> SRR1818635 2 0.5452 0.44873 0.028 0.536 0.000 0.416 0.020
#> SRR1818636 2 0.5446 0.45664 0.028 0.540 0.000 0.412 0.020
#> SRR1818643 2 0.2465 0.72733 0.028 0.912 0.004 0.012 0.044
#> SRR1818644 2 0.2465 0.72733 0.028 0.912 0.004 0.012 0.044
#> SRR1818641 2 0.2246 0.73307 0.028 0.924 0.004 0.016 0.028
#> SRR1818642 2 0.2246 0.73307 0.028 0.924 0.004 0.016 0.028
#> SRR1818633 4 0.5252 0.34729 0.336 0.008 0.036 0.616 0.004
#> SRR1818634 4 0.5180 0.34805 0.336 0.008 0.032 0.620 0.004
#> SRR1818665 1 0.1386 0.76820 0.952 0.016 0.000 0.032 0.000
#> SRR1818666 1 0.1386 0.76820 0.952 0.016 0.000 0.032 0.000
#> SRR1818667 2 0.6821 0.57269 0.012 0.568 0.236 0.160 0.024
#> SRR1818668 2 0.6799 0.57866 0.012 0.572 0.232 0.160 0.024
#> SRR1818669 4 0.6282 0.22992 0.364 0.096 0.000 0.520 0.020
#> SRR1818670 4 0.6282 0.22992 0.364 0.096 0.000 0.520 0.020
#> SRR1818663 1 0.1386 0.76820 0.952 0.016 0.000 0.032 0.000
#> SRR1818664 1 0.1485 0.76857 0.948 0.020 0.000 0.032 0.000
#> SRR1818629 2 0.5935 0.68937 0.020 0.688 0.088 0.176 0.028
#> SRR1818630 2 0.5901 0.69159 0.020 0.692 0.088 0.172 0.028
#> SRR1818627 1 0.3491 0.67908 0.836 0.000 0.124 0.028 0.012
#> SRR1818628 1 0.3443 0.68382 0.840 0.000 0.120 0.028 0.012
#> SRR1818621 3 0.5109 0.14069 0.028 0.000 0.580 0.008 0.384
#> SRR1818622 3 0.5109 0.14069 0.028 0.000 0.580 0.008 0.384
#> SRR1818625 1 0.2629 0.72427 0.880 0.104 0.000 0.004 0.012
#> SRR1818626 1 0.2629 0.72427 0.880 0.104 0.000 0.004 0.012
#> SRR1818623 3 0.5897 0.51649 0.088 0.000 0.496 0.412 0.004
#> SRR1818624 3 0.5881 0.53329 0.088 0.000 0.508 0.400 0.004
#> SRR1818619 4 0.4999 0.25449 0.420 0.008 0.012 0.556 0.004
#> SRR1818620 4 0.4999 0.25449 0.420 0.008 0.012 0.556 0.004
#> SRR1818617 2 0.2342 0.72419 0.040 0.916 0.000 0.020 0.024
#> SRR1818618 2 0.2244 0.72583 0.040 0.920 0.000 0.016 0.024
#> SRR1818615 2 0.5987 0.64704 0.000 0.648 0.160 0.168 0.024
#> SRR1818616 2 0.5987 0.64704 0.000 0.648 0.160 0.168 0.024
#> SRR1818609 4 0.7530 -0.18017 0.004 0.340 0.276 0.352 0.028
#> SRR1818610 4 0.7530 -0.18017 0.004 0.340 0.276 0.352 0.028
#> SRR1818607 2 0.2300 0.73766 0.024 0.920 0.004 0.040 0.012
#> SRR1818608 2 0.2300 0.73766 0.024 0.920 0.004 0.040 0.012
#> SRR1818613 1 0.1267 0.76696 0.960 0.000 0.004 0.012 0.024
#> SRR1818614 1 0.1267 0.76696 0.960 0.000 0.004 0.012 0.024
#> SRR1818611 1 0.6365 0.38318 0.540 0.152 0.004 0.004 0.300
#> SRR1818612 1 0.6365 0.38318 0.540 0.152 0.004 0.004 0.300
#> SRR1818605 1 0.3117 0.72104 0.876 0.004 0.076 0.024 0.020
#> SRR1818606 1 0.3209 0.71965 0.872 0.004 0.076 0.024 0.024
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.2601 0.6371 0.024 0.004 0.888 0.000 0.016 0.068
#> SRR1818632 3 0.2601 0.6371 0.024 0.004 0.888 0.000 0.016 0.068
#> SRR1818679 6 0.5122 0.7004 0.288 0.004 0.080 0.000 0.008 0.620
#> SRR1818680 6 0.5122 0.7004 0.288 0.004 0.080 0.000 0.008 0.620
#> SRR1818677 2 0.4110 0.5352 0.100 0.800 0.012 0.040 0.000 0.048
#> SRR1818678 2 0.4194 0.5352 0.100 0.796 0.016 0.036 0.000 0.052
#> SRR1818675 3 0.6179 0.4951 0.184 0.000 0.584 0.052 0.004 0.176
#> SRR1818676 3 0.6179 0.4951 0.184 0.000 0.584 0.052 0.004 0.176
#> SRR1818673 2 0.5752 0.4175 0.000 0.524 0.000 0.184 0.004 0.288
#> SRR1818674 2 0.5752 0.4175 0.000 0.524 0.000 0.184 0.004 0.288
#> SRR1818671 4 0.4355 0.7651 0.000 0.248 0.008 0.704 0.008 0.032
#> SRR1818672 4 0.4355 0.7651 0.000 0.248 0.008 0.704 0.008 0.032
#> SRR1818661 3 0.4433 0.6090 0.108 0.000 0.776 0.020 0.024 0.072
#> SRR1818662 3 0.4433 0.6090 0.108 0.000 0.776 0.020 0.024 0.072
#> SRR1818655 5 0.1493 0.7264 0.004 0.056 0.000 0.000 0.936 0.004
#> SRR1818656 5 0.1493 0.7264 0.004 0.056 0.000 0.000 0.936 0.004
#> SRR1818653 5 0.5808 0.6002 0.000 0.052 0.184 0.144 0.620 0.000
#> SRR1818654 5 0.5808 0.6002 0.000 0.052 0.184 0.144 0.620 0.000
#> SRR1818651 1 0.2792 0.8015 0.888 0.044 0.024 0.000 0.024 0.020
#> SRR1818652 1 0.2792 0.8015 0.888 0.044 0.024 0.000 0.024 0.020
#> SRR1818657 1 0.2030 0.8241 0.908 0.064 0.000 0.000 0.000 0.028
#> SRR1818658 1 0.2030 0.8227 0.908 0.064 0.000 0.000 0.000 0.028
#> SRR1818649 1 0.4014 0.6798 0.756 0.096 0.000 0.000 0.000 0.148
#> SRR1818650 1 0.3977 0.6850 0.760 0.096 0.000 0.000 0.000 0.144
#> SRR1818659 5 0.3687 0.6690 0.044 0.060 0.064 0.000 0.828 0.004
#> SRR1818647 3 0.6262 0.3569 0.004 0.000 0.480 0.196 0.016 0.304
#> SRR1818648 3 0.6241 0.3597 0.004 0.000 0.484 0.192 0.016 0.304
#> SRR1818645 2 0.4105 0.0714 0.004 0.640 0.000 0.344 0.004 0.008
#> SRR1818646 2 0.4105 0.0714 0.004 0.640 0.000 0.344 0.004 0.008
#> SRR1818639 5 0.1349 0.7270 0.000 0.056 0.000 0.000 0.940 0.004
#> SRR1818640 5 0.1349 0.7270 0.000 0.056 0.000 0.000 0.940 0.004
#> SRR1818637 3 0.5883 0.4208 0.000 0.016 0.548 0.340 0.048 0.048
#> SRR1818638 3 0.5883 0.4208 0.000 0.016 0.548 0.340 0.048 0.048
#> SRR1818635 2 0.5748 0.4370 0.000 0.548 0.000 0.184 0.008 0.260
#> SRR1818636 2 0.5731 0.4394 0.000 0.552 0.000 0.184 0.008 0.256
#> SRR1818643 2 0.1194 0.6032 0.004 0.956 0.000 0.032 0.008 0.000
#> SRR1818644 2 0.0748 0.6047 0.004 0.976 0.000 0.016 0.004 0.000
#> SRR1818641 2 0.1757 0.6074 0.012 0.928 0.000 0.052 0.000 0.008
#> SRR1818642 2 0.1757 0.6074 0.012 0.928 0.000 0.052 0.000 0.008
#> SRR1818633 6 0.4151 0.7317 0.228 0.004 0.040 0.004 0.000 0.724
#> SRR1818634 6 0.4151 0.7317 0.228 0.004 0.040 0.004 0.000 0.724
#> SRR1818665 1 0.1636 0.8319 0.936 0.036 0.000 0.004 0.000 0.024
#> SRR1818666 1 0.1636 0.8319 0.936 0.036 0.000 0.004 0.000 0.024
#> SRR1818667 4 0.5743 0.7405 0.000 0.236 0.100 0.616 0.004 0.044
#> SRR1818668 4 0.5743 0.7405 0.000 0.236 0.100 0.616 0.004 0.044
#> SRR1818669 6 0.4963 0.6989 0.292 0.052 0.016 0.004 0.000 0.636
#> SRR1818670 6 0.4963 0.6989 0.292 0.052 0.016 0.004 0.000 0.636
#> SRR1818663 1 0.1636 0.8324 0.936 0.036 0.000 0.004 0.000 0.024
#> SRR1818664 1 0.1636 0.8324 0.936 0.036 0.000 0.004 0.000 0.024
#> SRR1818629 2 0.5654 0.4641 0.008 0.612 0.012 0.204 0.000 0.164
#> SRR1818630 2 0.5550 0.4664 0.004 0.616 0.012 0.204 0.000 0.164
#> SRR1818627 1 0.2650 0.7731 0.884 0.012 0.076 0.000 0.008 0.020
#> SRR1818628 1 0.2479 0.7846 0.896 0.012 0.064 0.000 0.008 0.020
#> SRR1818621 5 0.6369 0.4586 0.000 0.044 0.324 0.152 0.480 0.000
#> SRR1818622 5 0.6369 0.4586 0.000 0.044 0.324 0.152 0.480 0.000
#> SRR1818625 1 0.2301 0.8061 0.884 0.096 0.000 0.000 0.000 0.020
#> SRR1818626 1 0.2301 0.8061 0.884 0.096 0.000 0.000 0.000 0.020
#> SRR1818623 6 0.5761 -0.2513 0.004 0.000 0.416 0.148 0.000 0.432
#> SRR1818624 6 0.5761 -0.2537 0.004 0.000 0.416 0.148 0.000 0.432
#> SRR1818619 6 0.3555 0.7380 0.280 0.000 0.008 0.000 0.000 0.712
#> SRR1818620 6 0.3650 0.7380 0.280 0.000 0.012 0.000 0.000 0.708
#> SRR1818617 2 0.0551 0.6060 0.008 0.984 0.000 0.004 0.004 0.000
#> SRR1818618 2 0.0551 0.6060 0.008 0.984 0.000 0.004 0.004 0.000
#> SRR1818615 4 0.4427 0.7611 0.000 0.256 0.028 0.692 0.000 0.024
#> SRR1818616 4 0.4427 0.7611 0.000 0.256 0.028 0.692 0.000 0.024
#> SRR1818609 4 0.4508 0.7485 0.000 0.108 0.068 0.760 0.000 0.064
#> SRR1818610 4 0.4593 0.7495 0.000 0.108 0.064 0.760 0.004 0.064
#> SRR1818607 2 0.4329 0.0503 0.004 0.624 0.000 0.352 0.012 0.008
#> SRR1818608 2 0.4329 0.0503 0.004 0.624 0.000 0.352 0.012 0.008
#> SRR1818613 1 0.0862 0.8189 0.972 0.008 0.000 0.004 0.000 0.016
#> SRR1818614 1 0.0862 0.8189 0.972 0.008 0.000 0.004 0.000 0.016
#> SRR1818611 1 0.6298 0.3093 0.496 0.180 0.000 0.004 0.296 0.024
#> SRR1818612 1 0.6298 0.3093 0.496 0.180 0.000 0.004 0.296 0.024
#> SRR1818605 1 0.2352 0.7844 0.900 0.000 0.052 0.004 0.004 0.040
#> SRR1818606 1 0.2282 0.7851 0.904 0.000 0.052 0.004 0.004 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["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 15216 rows and 75 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.765 0.876 0.947 0.4905 0.498 0.498
#> 3 3 0.627 0.781 0.891 0.2497 0.659 0.442
#> 4 4 0.477 0.656 0.800 0.1437 0.831 0.610
#> 5 5 0.499 0.496 0.694 0.0922 0.836 0.539
#> 6 6 0.533 0.406 0.635 0.0591 0.856 0.494
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
#> SRR1818631 1 0.000 0.969 1.000 0.000
#> SRR1818632 1 0.000 0.969 1.000 0.000
#> SRR1818679 1 0.738 0.703 0.792 0.208
#> SRR1818680 1 0.738 0.703 0.792 0.208
#> SRR1818677 2 0.494 0.844 0.108 0.892
#> SRR1818678 2 0.343 0.875 0.064 0.936
#> SRR1818675 2 0.990 0.285 0.440 0.560
#> SRR1818676 2 0.973 0.382 0.404 0.596
#> SRR1818673 2 0.000 0.906 0.000 1.000
#> SRR1818674 2 0.000 0.906 0.000 1.000
#> SRR1818671 2 0.000 0.906 0.000 1.000
#> SRR1818672 2 0.000 0.906 0.000 1.000
#> SRR1818661 1 0.000 0.969 1.000 0.000
#> SRR1818662 1 0.000 0.969 1.000 0.000
#> SRR1818655 1 0.000 0.969 1.000 0.000
#> SRR1818656 1 0.000 0.969 1.000 0.000
#> SRR1818653 1 0.000 0.969 1.000 0.000
#> SRR1818654 1 0.000 0.969 1.000 0.000
#> SRR1818651 1 0.000 0.969 1.000 0.000
#> SRR1818652 1 0.000 0.969 1.000 0.000
#> SRR1818657 1 0.000 0.969 1.000 0.000
#> SRR1818658 1 0.000 0.969 1.000 0.000
#> SRR1818649 1 0.000 0.969 1.000 0.000
#> SRR1818650 1 0.000 0.969 1.000 0.000
#> SRR1818659 1 0.000 0.969 1.000 0.000
#> SRR1818647 2 0.000 0.906 0.000 1.000
#> SRR1818648 2 0.000 0.906 0.000 1.000
#> SRR1818645 2 0.000 0.906 0.000 1.000
#> SRR1818646 2 0.000 0.906 0.000 1.000
#> SRR1818639 1 0.000 0.969 1.000 0.000
#> SRR1818640 1 0.000 0.969 1.000 0.000
#> SRR1818637 2 0.000 0.906 0.000 1.000
#> SRR1818638 2 0.000 0.906 0.000 1.000
#> SRR1818635 2 0.327 0.878 0.060 0.940
#> SRR1818636 2 0.327 0.878 0.060 0.940
#> SRR1818643 2 0.936 0.525 0.352 0.648
#> SRR1818644 2 0.943 0.510 0.360 0.640
#> SRR1818641 2 0.975 0.403 0.408 0.592
#> SRR1818642 2 0.978 0.393 0.412 0.588
#> SRR1818633 1 0.913 0.451 0.672 0.328
#> SRR1818634 1 0.913 0.451 0.672 0.328
#> SRR1818665 1 0.000 0.969 1.000 0.000
#> SRR1818666 1 0.000 0.969 1.000 0.000
#> SRR1818667 2 0.000 0.906 0.000 1.000
#> SRR1818668 2 0.000 0.906 0.000 1.000
#> SRR1818669 1 0.000 0.969 1.000 0.000
#> SRR1818670 1 0.000 0.969 1.000 0.000
#> SRR1818663 1 0.000 0.969 1.000 0.000
#> SRR1818664 1 0.000 0.969 1.000 0.000
#> SRR1818629 2 0.000 0.906 0.000 1.000
#> SRR1818630 2 0.000 0.906 0.000 1.000
#> SRR1818627 1 0.000 0.969 1.000 0.000
#> SRR1818628 1 0.000 0.969 1.000 0.000
#> SRR1818621 1 0.000 0.969 1.000 0.000
#> SRR1818622 1 0.000 0.969 1.000 0.000
#> SRR1818625 1 0.000 0.969 1.000 0.000
#> SRR1818626 1 0.000 0.969 1.000 0.000
#> SRR1818623 2 0.000 0.906 0.000 1.000
#> SRR1818624 2 0.000 0.906 0.000 1.000
#> SRR1818619 1 0.000 0.969 1.000 0.000
#> SRR1818620 1 0.000 0.969 1.000 0.000
#> SRR1818617 2 0.563 0.823 0.132 0.868
#> SRR1818618 2 0.584 0.816 0.140 0.860
#> SRR1818615 2 0.000 0.906 0.000 1.000
#> SRR1818616 2 0.000 0.906 0.000 1.000
#> SRR1818609 2 0.000 0.906 0.000 1.000
#> SRR1818610 2 0.000 0.906 0.000 1.000
#> SRR1818607 2 0.000 0.906 0.000 1.000
#> SRR1818608 2 0.000 0.906 0.000 1.000
#> SRR1818613 1 0.000 0.969 1.000 0.000
#> SRR1818614 1 0.000 0.969 1.000 0.000
#> SRR1818611 1 0.000 0.969 1.000 0.000
#> SRR1818612 1 0.000 0.969 1.000 0.000
#> SRR1818605 1 0.000 0.969 1.000 0.000
#> SRR1818606 1 0.000 0.969 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.1860 0.811 0.052 0.000 0.948
#> SRR1818632 3 0.1860 0.811 0.052 0.000 0.948
#> SRR1818679 3 0.8694 0.479 0.268 0.152 0.580
#> SRR1818680 3 0.9235 0.184 0.384 0.156 0.460
#> SRR1818677 1 0.5465 0.678 0.712 0.288 0.000
#> SRR1818678 1 0.5733 0.627 0.676 0.324 0.000
#> SRR1818675 3 0.0000 0.789 0.000 0.000 1.000
#> SRR1818676 3 0.0000 0.789 0.000 0.000 1.000
#> SRR1818673 2 0.5988 0.303 0.368 0.632 0.000
#> SRR1818674 2 0.5926 0.339 0.356 0.644 0.000
#> SRR1818671 2 0.0000 0.901 0.000 1.000 0.000
#> SRR1818672 2 0.0000 0.901 0.000 1.000 0.000
#> SRR1818661 3 0.0592 0.798 0.012 0.000 0.988
#> SRR1818662 3 0.0592 0.798 0.012 0.000 0.988
#> SRR1818655 1 0.1031 0.864 0.976 0.000 0.024
#> SRR1818656 1 0.1643 0.857 0.956 0.000 0.044
#> SRR1818653 3 0.6095 0.418 0.392 0.000 0.608
#> SRR1818654 3 0.6252 0.274 0.444 0.000 0.556
#> SRR1818651 1 0.2878 0.824 0.904 0.000 0.096
#> SRR1818652 1 0.2625 0.832 0.916 0.000 0.084
#> SRR1818657 1 0.0592 0.867 0.988 0.000 0.012
#> SRR1818658 1 0.0424 0.868 0.992 0.000 0.008
#> SRR1818649 1 0.1643 0.861 0.956 0.044 0.000
#> SRR1818650 1 0.1643 0.861 0.956 0.044 0.000
#> SRR1818659 1 0.0237 0.869 0.996 0.000 0.004
#> SRR1818647 2 0.4654 0.761 0.000 0.792 0.208
#> SRR1818648 2 0.5098 0.710 0.000 0.752 0.248
#> SRR1818645 2 0.0000 0.901 0.000 1.000 0.000
#> SRR1818646 2 0.0000 0.901 0.000 1.000 0.000
#> SRR1818639 1 0.1860 0.852 0.948 0.000 0.052
#> SRR1818640 1 0.1753 0.854 0.952 0.000 0.048
#> SRR1818637 2 0.2261 0.879 0.000 0.932 0.068
#> SRR1818638 2 0.2261 0.879 0.000 0.932 0.068
#> SRR1818635 1 0.4452 0.777 0.808 0.192 0.000
#> SRR1818636 1 0.4504 0.774 0.804 0.196 0.000
#> SRR1818643 1 0.4842 0.752 0.776 0.224 0.000
#> SRR1818644 1 0.4750 0.759 0.784 0.216 0.000
#> SRR1818641 1 0.2261 0.852 0.932 0.068 0.000
#> SRR1818642 1 0.2165 0.853 0.936 0.064 0.000
#> SRR1818633 1 0.5137 0.798 0.832 0.104 0.064
#> SRR1818634 1 0.5153 0.798 0.832 0.100 0.068
#> SRR1818665 1 0.0237 0.869 0.996 0.000 0.004
#> SRR1818666 1 0.0237 0.869 0.996 0.000 0.004
#> SRR1818667 2 0.1860 0.886 0.000 0.948 0.052
#> SRR1818668 2 0.1860 0.886 0.000 0.948 0.052
#> SRR1818669 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1818670 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1818663 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1818664 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1818629 2 0.1643 0.868 0.044 0.956 0.000
#> SRR1818630 2 0.1411 0.876 0.036 0.964 0.000
#> SRR1818627 1 0.6008 0.389 0.628 0.000 0.372
#> SRR1818628 1 0.5948 0.415 0.640 0.000 0.360
#> SRR1818621 3 0.1860 0.811 0.052 0.000 0.948
#> SRR1818622 3 0.1860 0.811 0.052 0.000 0.948
#> SRR1818625 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1818623 2 0.2625 0.873 0.000 0.916 0.084
#> SRR1818624 2 0.2796 0.868 0.000 0.908 0.092
#> SRR1818619 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1818620 1 0.0237 0.869 0.996 0.000 0.004
#> SRR1818617 1 0.5138 0.720 0.748 0.252 0.000
#> SRR1818618 1 0.5178 0.716 0.744 0.256 0.000
#> SRR1818615 2 0.0000 0.901 0.000 1.000 0.000
#> SRR1818616 2 0.0000 0.901 0.000 1.000 0.000
#> SRR1818609 2 0.0592 0.900 0.000 0.988 0.012
#> SRR1818610 2 0.0592 0.900 0.000 0.988 0.012
#> SRR1818607 2 0.0000 0.901 0.000 1.000 0.000
#> SRR1818608 2 0.0000 0.901 0.000 1.000 0.000
#> SRR1818613 1 0.4750 0.689 0.784 0.000 0.216
#> SRR1818614 1 0.4750 0.689 0.784 0.000 0.216
#> SRR1818611 1 0.1643 0.861 0.956 0.044 0.000
#> SRR1818612 1 0.1753 0.859 0.952 0.048 0.000
#> SRR1818605 3 0.3879 0.784 0.152 0.000 0.848
#> SRR1818606 3 0.3941 0.784 0.156 0.000 0.844
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.2670 0.746 0.072 0.000 0.904 0.024
#> SRR1818632 3 0.2670 0.746 0.072 0.000 0.904 0.024
#> SRR1818679 3 0.2311 0.759 0.076 0.004 0.916 0.004
#> SRR1818680 3 0.2876 0.749 0.092 0.008 0.892 0.008
#> SRR1818677 1 0.7148 0.609 0.624 0.248 0.072 0.056
#> SRR1818678 1 0.7243 0.581 0.608 0.260 0.088 0.044
#> SRR1818675 3 0.3710 0.699 0.000 0.004 0.804 0.192
#> SRR1818676 3 0.3668 0.702 0.000 0.004 0.808 0.188
#> SRR1818673 1 0.5028 0.496 0.596 0.400 0.000 0.004
#> SRR1818674 1 0.5050 0.481 0.588 0.408 0.000 0.004
#> SRR1818671 2 0.1389 0.842 0.000 0.952 0.048 0.000
#> SRR1818672 2 0.1389 0.842 0.000 0.952 0.048 0.000
#> SRR1818661 3 0.2480 0.732 0.008 0.000 0.904 0.088
#> SRR1818662 3 0.2546 0.730 0.008 0.000 0.900 0.092
#> SRR1818655 1 0.4985 0.220 0.532 0.000 0.000 0.468
#> SRR1818656 1 0.4998 0.154 0.512 0.000 0.000 0.488
#> SRR1818653 4 0.2610 0.751 0.088 0.000 0.012 0.900
#> SRR1818654 4 0.2610 0.751 0.088 0.000 0.012 0.900
#> SRR1818651 1 0.4103 0.613 0.744 0.000 0.000 0.256
#> SRR1818652 1 0.3942 0.630 0.764 0.000 0.000 0.236
#> SRR1818657 1 0.1677 0.727 0.948 0.000 0.040 0.012
#> SRR1818658 1 0.1677 0.727 0.948 0.000 0.040 0.012
#> SRR1818649 1 0.1394 0.728 0.964 0.008 0.016 0.012
#> SRR1818650 1 0.1271 0.727 0.968 0.008 0.012 0.012
#> SRR1818659 4 0.3266 0.741 0.168 0.000 0.000 0.832
#> SRR1818647 3 0.4464 0.649 0.000 0.208 0.768 0.024
#> SRR1818648 3 0.4307 0.666 0.000 0.192 0.784 0.024
#> SRR1818645 2 0.0804 0.841 0.012 0.980 0.000 0.008
#> SRR1818646 2 0.0804 0.841 0.012 0.980 0.000 0.008
#> SRR1818639 4 0.4072 0.636 0.252 0.000 0.000 0.748
#> SRR1818640 4 0.4072 0.629 0.252 0.000 0.000 0.748
#> SRR1818637 2 0.4487 0.769 0.000 0.808 0.100 0.092
#> SRR1818638 2 0.4487 0.769 0.000 0.808 0.100 0.092
#> SRR1818635 1 0.4400 0.670 0.744 0.248 0.004 0.004
#> SRR1818636 1 0.4122 0.675 0.760 0.236 0.000 0.004
#> SRR1818643 1 0.6466 0.579 0.588 0.320 0.000 0.092
#> SRR1818644 1 0.6430 0.589 0.596 0.312 0.000 0.092
#> SRR1818641 1 0.5170 0.669 0.724 0.228 0.000 0.048
#> SRR1818642 1 0.5203 0.667 0.720 0.232 0.000 0.048
#> SRR1818633 3 0.7613 0.414 0.332 0.144 0.508 0.016
#> SRR1818634 3 0.7613 0.409 0.332 0.144 0.508 0.016
#> SRR1818665 1 0.1474 0.721 0.948 0.000 0.000 0.052
#> SRR1818666 1 0.1474 0.721 0.948 0.000 0.000 0.052
#> SRR1818667 2 0.3903 0.801 0.000 0.844 0.076 0.080
#> SRR1818668 2 0.3970 0.798 0.000 0.840 0.076 0.084
#> SRR1818669 1 0.1576 0.724 0.948 0.000 0.048 0.004
#> SRR1818670 1 0.1489 0.725 0.952 0.000 0.044 0.004
#> SRR1818663 1 0.1557 0.718 0.944 0.000 0.000 0.056
#> SRR1818664 1 0.1637 0.717 0.940 0.000 0.000 0.060
#> SRR1818629 2 0.4936 0.124 0.372 0.624 0.000 0.004
#> SRR1818630 2 0.4855 0.199 0.352 0.644 0.000 0.004
#> SRR1818627 1 0.5569 0.548 0.660 0.000 0.296 0.044
#> SRR1818628 1 0.5549 0.562 0.672 0.000 0.280 0.048
#> SRR1818621 4 0.3647 0.675 0.016 0.000 0.152 0.832
#> SRR1818622 4 0.3625 0.667 0.012 0.000 0.160 0.828
#> SRR1818625 1 0.1022 0.725 0.968 0.000 0.000 0.032
#> SRR1818626 1 0.1022 0.725 0.968 0.000 0.000 0.032
#> SRR1818623 3 0.2450 0.761 0.000 0.072 0.912 0.016
#> SRR1818624 3 0.2329 0.762 0.000 0.072 0.916 0.012
#> SRR1818619 1 0.4639 0.633 0.752 0.008 0.228 0.012
#> SRR1818620 1 0.4458 0.652 0.772 0.008 0.208 0.012
#> SRR1818617 1 0.5913 0.547 0.600 0.352 0.000 0.048
#> SRR1818618 1 0.6054 0.543 0.592 0.352 0.000 0.056
#> SRR1818615 2 0.0376 0.842 0.004 0.992 0.000 0.004
#> SRR1818616 2 0.0376 0.842 0.004 0.992 0.000 0.004
#> SRR1818609 2 0.2908 0.827 0.000 0.896 0.064 0.040
#> SRR1818610 2 0.2908 0.827 0.000 0.896 0.064 0.040
#> SRR1818607 2 0.0804 0.841 0.012 0.980 0.000 0.008
#> SRR1818608 2 0.0804 0.841 0.012 0.980 0.000 0.008
#> SRR1818613 1 0.5700 0.577 0.716 0.000 0.120 0.164
#> SRR1818614 1 0.5624 0.578 0.720 0.000 0.108 0.172
#> SRR1818611 1 0.3606 0.664 0.840 0.020 0.000 0.140
#> SRR1818612 1 0.3554 0.666 0.844 0.020 0.000 0.136
#> SRR1818605 4 0.7506 0.255 0.184 0.000 0.376 0.440
#> SRR1818606 4 0.7222 0.444 0.172 0.000 0.300 0.528
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.1347 0.6618 0.020 0.008 0.960 0.004 0.008
#> SRR1818632 3 0.1347 0.6618 0.020 0.008 0.960 0.004 0.008
#> SRR1818679 3 0.5071 0.3760 0.304 0.028 0.652 0.012 0.004
#> SRR1818680 3 0.5090 0.3693 0.308 0.028 0.648 0.012 0.004
#> SRR1818677 2 0.4530 0.5521 0.108 0.800 0.036 0.044 0.012
#> SRR1818678 2 0.4938 0.5423 0.096 0.780 0.056 0.056 0.012
#> SRR1818675 3 0.6677 0.5115 0.016 0.008 0.532 0.308 0.136
#> SRR1818676 3 0.6642 0.5134 0.016 0.008 0.536 0.308 0.132
#> SRR1818673 1 0.6232 0.1392 0.464 0.408 0.000 0.124 0.004
#> SRR1818674 1 0.6296 0.1256 0.456 0.408 0.000 0.132 0.004
#> SRR1818671 4 0.4030 0.6253 0.000 0.352 0.000 0.648 0.000
#> SRR1818672 4 0.4030 0.6230 0.000 0.352 0.000 0.648 0.000
#> SRR1818661 3 0.1605 0.6613 0.000 0.004 0.944 0.012 0.040
#> SRR1818662 3 0.1605 0.6613 0.000 0.004 0.944 0.012 0.040
#> SRR1818655 2 0.6633 -0.2927 0.220 0.392 0.000 0.000 0.388
#> SRR1818656 5 0.6557 0.2199 0.204 0.368 0.000 0.000 0.428
#> SRR1818653 5 0.1153 0.6693 0.008 0.024 0.004 0.000 0.964
#> SRR1818654 5 0.1243 0.6698 0.008 0.028 0.004 0.000 0.960
#> SRR1818651 1 0.4930 0.5683 0.696 0.084 0.000 0.000 0.220
#> SRR1818652 1 0.4810 0.5865 0.712 0.084 0.000 0.000 0.204
#> SRR1818657 1 0.5173 -0.0395 0.500 0.460 0.040 0.000 0.000
#> SRR1818658 1 0.4979 -0.0659 0.492 0.480 0.028 0.000 0.000
#> SRR1818649 1 0.3504 0.6746 0.840 0.064 0.092 0.000 0.004
#> SRR1818650 1 0.3629 0.6721 0.832 0.072 0.092 0.000 0.004
#> SRR1818659 5 0.3527 0.5769 0.192 0.016 0.000 0.000 0.792
#> SRR1818647 3 0.5330 0.4707 0.000 0.064 0.620 0.312 0.004
#> SRR1818648 3 0.5330 0.4724 0.000 0.064 0.620 0.312 0.004
#> SRR1818645 2 0.3300 0.4639 0.004 0.792 0.000 0.204 0.000
#> SRR1818646 2 0.3231 0.4759 0.004 0.800 0.000 0.196 0.000
#> SRR1818639 5 0.5603 0.2882 0.072 0.452 0.000 0.000 0.476
#> SRR1818640 5 0.5650 0.2770 0.076 0.456 0.000 0.000 0.468
#> SRR1818637 4 0.0613 0.6874 0.000 0.004 0.008 0.984 0.004
#> SRR1818638 4 0.0613 0.6874 0.000 0.004 0.008 0.984 0.004
#> SRR1818635 1 0.5108 0.3970 0.612 0.348 0.004 0.032 0.004
#> SRR1818636 1 0.4969 0.4063 0.616 0.352 0.004 0.024 0.004
#> SRR1818643 1 0.6229 0.2180 0.504 0.376 0.004 0.112 0.004
#> SRR1818644 1 0.6183 0.2279 0.512 0.372 0.004 0.108 0.004
#> SRR1818641 2 0.5484 0.0541 0.392 0.540 0.000 0.068 0.000
#> SRR1818642 2 0.5470 0.1192 0.364 0.564 0.000 0.072 0.000
#> SRR1818633 3 0.6829 0.2543 0.180 0.372 0.436 0.008 0.004
#> SRR1818634 3 0.6910 0.2698 0.180 0.360 0.444 0.012 0.004
#> SRR1818665 1 0.1864 0.6813 0.924 0.068 0.004 0.000 0.004
#> SRR1818666 1 0.1864 0.6813 0.924 0.068 0.004 0.000 0.004
#> SRR1818667 4 0.2646 0.7558 0.000 0.124 0.004 0.868 0.004
#> SRR1818668 4 0.2597 0.7563 0.000 0.120 0.004 0.872 0.004
#> SRR1818669 1 0.3159 0.6802 0.856 0.056 0.088 0.000 0.000
#> SRR1818670 1 0.3159 0.6802 0.856 0.056 0.088 0.000 0.000
#> SRR1818663 1 0.1300 0.6903 0.956 0.028 0.000 0.000 0.016
#> SRR1818664 1 0.1300 0.6903 0.956 0.028 0.000 0.000 0.016
#> SRR1818629 2 0.4946 0.2983 0.056 0.680 0.000 0.260 0.004
#> SRR1818630 2 0.4872 0.3244 0.056 0.692 0.000 0.248 0.004
#> SRR1818627 1 0.4919 0.6405 0.780 0.048 0.112 0.040 0.020
#> SRR1818628 1 0.4778 0.6451 0.792 0.056 0.096 0.036 0.020
#> SRR1818621 5 0.1059 0.6520 0.008 0.000 0.020 0.004 0.968
#> SRR1818622 5 0.1059 0.6520 0.008 0.000 0.020 0.004 0.968
#> SRR1818625 1 0.0865 0.6892 0.972 0.024 0.004 0.000 0.000
#> SRR1818626 1 0.0865 0.6892 0.972 0.024 0.004 0.000 0.000
#> SRR1818623 3 0.3647 0.6232 0.004 0.000 0.764 0.228 0.004
#> SRR1818624 3 0.3616 0.6260 0.004 0.000 0.768 0.224 0.004
#> SRR1818619 2 0.6572 0.1257 0.388 0.432 0.176 0.004 0.000
#> SRR1818620 2 0.6487 0.1065 0.404 0.432 0.160 0.004 0.000
#> SRR1818617 2 0.4168 0.5672 0.132 0.796 0.000 0.060 0.012
#> SRR1818618 2 0.4268 0.5686 0.132 0.792 0.000 0.060 0.016
#> SRR1818615 4 0.4632 0.6199 0.012 0.376 0.000 0.608 0.004
#> SRR1818616 4 0.4644 0.6141 0.012 0.380 0.000 0.604 0.004
#> SRR1818609 4 0.2806 0.7550 0.000 0.152 0.000 0.844 0.004
#> SRR1818610 4 0.2719 0.7549 0.000 0.144 0.000 0.852 0.004
#> SRR1818607 2 0.3266 0.4720 0.004 0.796 0.000 0.200 0.000
#> SRR1818608 2 0.3160 0.4852 0.004 0.808 0.000 0.188 0.000
#> SRR1818613 1 0.4779 0.6443 0.748 0.008 0.120 0.000 0.124
#> SRR1818614 1 0.4684 0.6463 0.760 0.012 0.096 0.000 0.132
#> SRR1818611 1 0.4123 0.6464 0.788 0.104 0.000 0.000 0.108
#> SRR1818612 1 0.3970 0.6538 0.800 0.104 0.000 0.000 0.096
#> SRR1818605 1 0.5642 0.5416 0.696 0.024 0.156 0.004 0.120
#> SRR1818606 1 0.5736 0.5411 0.688 0.024 0.144 0.004 0.140
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.3628 0.5130 0.060 0.000 0.832 0.072 0.008 0.028
#> SRR1818632 3 0.3686 0.5122 0.064 0.000 0.828 0.072 0.008 0.028
#> SRR1818679 3 0.7396 0.2070 0.292 0.140 0.448 0.080 0.000 0.040
#> SRR1818680 3 0.7504 0.1851 0.300 0.140 0.432 0.084 0.000 0.044
#> SRR1818677 6 0.3451 0.4829 0.028 0.132 0.016 0.004 0.000 0.820
#> SRR1818678 6 0.3753 0.4823 0.028 0.120 0.032 0.008 0.000 0.812
#> SRR1818675 4 0.5763 0.3491 0.032 0.004 0.208 0.616 0.140 0.000
#> SRR1818676 4 0.5738 0.3490 0.032 0.004 0.204 0.620 0.140 0.000
#> SRR1818673 2 0.4438 0.3514 0.324 0.640 0.000 0.020 0.000 0.016
#> SRR1818674 2 0.4358 0.3543 0.324 0.644 0.000 0.016 0.000 0.016
#> SRR1818671 2 0.5716 -0.2055 0.000 0.500 0.008 0.356 0.000 0.136
#> SRR1818672 2 0.5692 -0.1889 0.000 0.512 0.008 0.344 0.000 0.136
#> SRR1818661 3 0.1860 0.5176 0.004 0.000 0.928 0.028 0.036 0.004
#> SRR1818662 3 0.1642 0.5180 0.000 0.000 0.936 0.028 0.032 0.004
#> SRR1818655 6 0.5123 0.4237 0.088 0.004 0.000 0.004 0.292 0.612
#> SRR1818656 6 0.5141 0.3884 0.080 0.004 0.000 0.004 0.320 0.592
#> SRR1818653 5 0.1732 0.8855 0.000 0.004 0.000 0.004 0.920 0.072
#> SRR1818654 5 0.1674 0.8899 0.000 0.004 0.000 0.004 0.924 0.068
#> SRR1818651 1 0.6111 0.2794 0.448 0.000 0.000 0.008 0.328 0.216
#> SRR1818652 1 0.5942 0.3429 0.484 0.000 0.000 0.004 0.296 0.216
#> SRR1818657 6 0.5318 0.3935 0.252 0.000 0.000 0.160 0.000 0.588
#> SRR1818658 6 0.5279 0.4067 0.244 0.000 0.000 0.160 0.000 0.596
#> SRR1818649 1 0.4942 0.6302 0.760 0.044 0.048 0.036 0.008 0.104
#> SRR1818650 1 0.5067 0.6260 0.748 0.040 0.052 0.036 0.008 0.116
#> SRR1818659 5 0.3316 0.7635 0.136 0.000 0.000 0.000 0.812 0.052
#> SRR1818647 3 0.6235 0.2195 0.000 0.188 0.552 0.220 0.004 0.036
#> SRR1818648 3 0.6232 0.2255 0.000 0.172 0.548 0.240 0.004 0.036
#> SRR1818645 2 0.4513 0.3024 0.000 0.532 0.004 0.024 0.000 0.440
#> SRR1818646 2 0.4517 0.2973 0.000 0.528 0.004 0.024 0.000 0.444
#> SRR1818639 6 0.4453 0.3924 0.044 0.000 0.000 0.000 0.332 0.624
#> SRR1818640 6 0.4378 0.3986 0.040 0.000 0.000 0.000 0.328 0.632
#> SRR1818637 4 0.4167 0.6855 0.000 0.332 0.008 0.648 0.008 0.004
#> SRR1818638 4 0.4167 0.6855 0.000 0.332 0.008 0.648 0.008 0.004
#> SRR1818635 1 0.4695 -0.0193 0.504 0.460 0.000 0.008 0.000 0.028
#> SRR1818636 1 0.4756 -0.0127 0.504 0.456 0.000 0.008 0.000 0.032
#> SRR1818643 2 0.5197 0.1726 0.432 0.508 0.000 0.016 0.008 0.036
#> SRR1818644 2 0.5120 0.1659 0.436 0.508 0.000 0.012 0.008 0.036
#> SRR1818641 2 0.4908 0.4821 0.208 0.664 0.000 0.004 0.000 0.124
#> SRR1818642 2 0.4910 0.4899 0.192 0.668 0.000 0.004 0.000 0.136
#> SRR1818633 3 0.7888 0.0983 0.060 0.048 0.368 0.216 0.008 0.300
#> SRR1818634 3 0.7817 0.1529 0.056 0.048 0.396 0.224 0.008 0.268
#> SRR1818665 1 0.5241 0.5145 0.656 0.004 0.004 0.164 0.004 0.168
#> SRR1818666 1 0.5164 0.5090 0.652 0.004 0.004 0.164 0.000 0.176
#> SRR1818667 4 0.4348 0.6093 0.000 0.416 0.000 0.560 0.000 0.024
#> SRR1818668 4 0.4192 0.6233 0.000 0.412 0.000 0.572 0.000 0.016
#> SRR1818669 1 0.5425 0.5875 0.704 0.008 0.088 0.076 0.004 0.120
#> SRR1818670 1 0.5597 0.5847 0.692 0.012 0.088 0.076 0.004 0.128
#> SRR1818663 1 0.1983 0.6487 0.916 0.000 0.000 0.012 0.012 0.060
#> SRR1818664 1 0.1882 0.6488 0.920 0.000 0.000 0.008 0.012 0.060
#> SRR1818629 6 0.7325 0.1573 0.044 0.292 0.024 0.288 0.000 0.352
#> SRR1818630 6 0.7222 0.1667 0.036 0.284 0.024 0.292 0.000 0.364
#> SRR1818627 1 0.5921 0.4766 0.600 0.004 0.028 0.256 0.012 0.100
#> SRR1818628 1 0.5983 0.4588 0.584 0.004 0.024 0.268 0.012 0.108
#> SRR1818621 5 0.0436 0.8977 0.004 0.000 0.004 0.004 0.988 0.000
#> SRR1818622 5 0.0436 0.8977 0.004 0.000 0.004 0.004 0.988 0.000
#> SRR1818625 1 0.2338 0.6480 0.900 0.004 0.000 0.016 0.012 0.068
#> SRR1818626 1 0.2620 0.6466 0.884 0.004 0.000 0.024 0.012 0.076
#> SRR1818623 3 0.4678 0.2910 0.000 0.020 0.624 0.328 0.000 0.028
#> SRR1818624 3 0.4578 0.3029 0.000 0.020 0.636 0.320 0.000 0.024
#> SRR1818619 6 0.6302 0.4053 0.200 0.000 0.048 0.212 0.000 0.540
#> SRR1818620 6 0.6331 0.3936 0.220 0.000 0.044 0.208 0.000 0.528
#> SRR1818617 6 0.3234 0.5597 0.040 0.072 0.000 0.024 0.008 0.856
#> SRR1818618 6 0.3343 0.5604 0.040 0.072 0.000 0.020 0.016 0.852
#> SRR1818615 2 0.1340 0.3295 0.008 0.948 0.000 0.040 0.000 0.004
#> SRR1818616 2 0.1370 0.3374 0.012 0.948 0.000 0.036 0.000 0.004
#> SRR1818609 2 0.4770 -0.3370 0.000 0.572 0.008 0.380 0.000 0.040
#> SRR1818610 2 0.4795 -0.3607 0.000 0.560 0.008 0.392 0.000 0.040
#> SRR1818607 2 0.4389 0.2949 0.000 0.528 0.000 0.024 0.000 0.448
#> SRR1818608 2 0.4318 0.2969 0.000 0.532 0.000 0.020 0.000 0.448
#> SRR1818613 1 0.6799 0.5428 0.588 0.000 0.120 0.048 0.092 0.152
#> SRR1818614 1 0.6897 0.5333 0.576 0.000 0.124 0.044 0.104 0.152
#> SRR1818611 1 0.6627 0.4922 0.564 0.056 0.000 0.056 0.076 0.248
#> SRR1818612 1 0.6407 0.5195 0.592 0.056 0.000 0.056 0.064 0.232
#> SRR1818605 1 0.5201 0.5092 0.724 0.032 0.052 0.016 0.156 0.020
#> SRR1818606 1 0.5405 0.4833 0.696 0.036 0.052 0.012 0.184 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["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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.653 0.796 0.907 0.4481 0.514 0.514
#> 3 3 0.560 0.707 0.826 0.1804 1.000 1.000
#> 4 4 0.712 0.690 0.817 0.1870 0.877 0.761
#> 5 5 0.757 0.715 0.815 0.0528 0.959 0.895
#> 6 6 0.636 0.699 0.788 0.0586 0.895 0.725
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
#> SRR1818631 1 0.0000 0.936 1.000 0.000
#> SRR1818632 1 0.0000 0.936 1.000 0.000
#> SRR1818679 1 0.9998 -0.291 0.508 0.492
#> SRR1818680 1 0.9998 -0.291 0.508 0.492
#> SRR1818677 1 0.0000 0.936 1.000 0.000
#> SRR1818678 1 0.0000 0.936 1.000 0.000
#> SRR1818675 2 0.0000 0.812 0.000 1.000
#> SRR1818676 2 0.0000 0.812 0.000 1.000
#> SRR1818673 2 0.9522 0.620 0.372 0.628
#> SRR1818674 2 0.9522 0.620 0.372 0.628
#> SRR1818671 2 0.1843 0.817 0.028 0.972
#> SRR1818672 2 0.1843 0.817 0.028 0.972
#> SRR1818661 2 0.3879 0.814 0.076 0.924
#> SRR1818662 2 0.3879 0.814 0.076 0.924
#> SRR1818655 1 0.0376 0.933 0.996 0.004
#> SRR1818656 1 0.0376 0.933 0.996 0.004
#> SRR1818653 1 0.4298 0.833 0.912 0.088
#> SRR1818654 1 0.4298 0.833 0.912 0.088
#> SRR1818651 1 0.0000 0.936 1.000 0.000
#> SRR1818652 1 0.0000 0.936 1.000 0.000
#> SRR1818657 1 0.0000 0.936 1.000 0.000
#> SRR1818658 1 0.0000 0.936 1.000 0.000
#> SRR1818649 1 0.0000 0.936 1.000 0.000
#> SRR1818650 1 0.0000 0.936 1.000 0.000
#> SRR1818659 1 0.0000 0.936 1.000 0.000
#> SRR1818647 2 0.0376 0.814 0.004 0.996
#> SRR1818648 2 0.0376 0.814 0.004 0.996
#> SRR1818645 2 0.8499 0.742 0.276 0.724
#> SRR1818646 2 0.8499 0.742 0.276 0.724
#> SRR1818639 1 0.0000 0.936 1.000 0.000
#> SRR1818640 1 0.0000 0.936 1.000 0.000
#> SRR1818637 2 0.0000 0.812 0.000 1.000
#> SRR1818638 2 0.0000 0.812 0.000 1.000
#> SRR1818635 2 0.9522 0.620 0.372 0.628
#> SRR1818636 2 0.9522 0.620 0.372 0.628
#> SRR1818643 1 0.0376 0.933 0.996 0.004
#> SRR1818644 1 0.0376 0.933 0.996 0.004
#> SRR1818641 1 0.9998 -0.291 0.508 0.492
#> SRR1818642 1 0.9998 -0.291 0.508 0.492
#> SRR1818633 2 0.2043 0.817 0.032 0.968
#> SRR1818634 2 0.2043 0.817 0.032 0.968
#> SRR1818665 1 0.0000 0.936 1.000 0.000
#> SRR1818666 1 0.0000 0.936 1.000 0.000
#> SRR1818667 2 0.8144 0.760 0.252 0.748
#> SRR1818668 2 0.8144 0.760 0.252 0.748
#> SRR1818669 1 0.0000 0.936 1.000 0.000
#> SRR1818670 1 0.0000 0.936 1.000 0.000
#> SRR1818663 1 0.0000 0.936 1.000 0.000
#> SRR1818664 1 0.0000 0.936 1.000 0.000
#> SRR1818629 2 0.8144 0.760 0.252 0.748
#> SRR1818630 2 0.8144 0.760 0.252 0.748
#> SRR1818627 1 0.0000 0.936 1.000 0.000
#> SRR1818628 1 0.0000 0.936 1.000 0.000
#> SRR1818621 1 0.0000 0.936 1.000 0.000
#> SRR1818622 1 0.0000 0.936 1.000 0.000
#> SRR1818625 1 0.0000 0.936 1.000 0.000
#> SRR1818626 1 0.0000 0.936 1.000 0.000
#> SRR1818623 2 0.3584 0.817 0.068 0.932
#> SRR1818624 2 0.3584 0.817 0.068 0.932
#> SRR1818619 1 0.0000 0.936 1.000 0.000
#> SRR1818620 1 0.0000 0.936 1.000 0.000
#> SRR1818617 1 0.0376 0.933 0.996 0.004
#> SRR1818618 1 0.0376 0.933 0.996 0.004
#> SRR1818615 2 0.9580 0.598 0.380 0.620
#> SRR1818616 2 0.9580 0.598 0.380 0.620
#> SRR1818609 2 0.0376 0.814 0.004 0.996
#> SRR1818610 2 0.0376 0.814 0.004 0.996
#> SRR1818607 2 0.8499 0.742 0.276 0.724
#> SRR1818608 2 0.8499 0.742 0.276 0.724
#> SRR1818613 1 0.0000 0.936 1.000 0.000
#> SRR1818614 1 0.0000 0.936 1.000 0.000
#> SRR1818611 1 0.0000 0.936 1.000 0.000
#> SRR1818612 1 0.0000 0.936 1.000 0.000
#> SRR1818605 1 0.0376 0.933 0.996 0.004
#> SRR1818606 1 0.0376 0.933 0.996 0.004
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.0892 0.876 0.980 0.000 NA
#> SRR1818632 1 0.0892 0.876 0.980 0.000 NA
#> SRR1818679 1 0.9938 -0.375 0.368 0.352 NA
#> SRR1818680 1 0.9938 -0.375 0.368 0.352 NA
#> SRR1818677 1 0.0592 0.879 0.988 0.000 NA
#> SRR1818678 1 0.0592 0.879 0.988 0.000 NA
#> SRR1818675 2 0.5948 0.600 0.000 0.640 NA
#> SRR1818676 2 0.5948 0.600 0.000 0.640 NA
#> SRR1818673 2 0.8554 0.559 0.324 0.560 NA
#> SRR1818674 2 0.8554 0.559 0.324 0.560 NA
#> SRR1818671 2 0.2682 0.739 0.004 0.920 NA
#> SRR1818672 2 0.2682 0.739 0.004 0.920 NA
#> SRR1818661 2 0.4931 0.727 0.032 0.828 NA
#> SRR1818662 2 0.4931 0.727 0.032 0.828 NA
#> SRR1818655 1 0.1585 0.873 0.964 0.008 NA
#> SRR1818656 1 0.1585 0.873 0.964 0.008 NA
#> SRR1818653 1 0.5092 0.733 0.804 0.020 NA
#> SRR1818654 1 0.5092 0.733 0.804 0.020 NA
#> SRR1818651 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818652 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818657 1 0.0747 0.879 0.984 0.000 NA
#> SRR1818658 1 0.0747 0.879 0.984 0.000 NA
#> SRR1818649 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818650 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818659 1 0.5926 0.524 0.644 0.000 NA
#> SRR1818647 2 0.1399 0.739 0.004 0.968 NA
#> SRR1818648 2 0.1399 0.739 0.004 0.968 NA
#> SRR1818645 2 0.7983 0.655 0.256 0.636 NA
#> SRR1818646 2 0.7983 0.655 0.256 0.636 NA
#> SRR1818639 1 0.0592 0.879 0.988 0.000 NA
#> SRR1818640 1 0.0592 0.879 0.988 0.000 NA
#> SRR1818637 2 0.5948 0.600 0.000 0.640 NA
#> SRR1818638 2 0.5948 0.600 0.000 0.640 NA
#> SRR1818635 2 0.8554 0.559 0.324 0.560 NA
#> SRR1818636 2 0.8554 0.559 0.324 0.560 NA
#> SRR1818643 1 0.1315 0.875 0.972 0.008 NA
#> SRR1818644 1 0.1315 0.875 0.972 0.008 NA
#> SRR1818641 1 0.9938 -0.375 0.368 0.352 NA
#> SRR1818642 1 0.9938 -0.375 0.368 0.352 NA
#> SRR1818633 2 0.2866 0.739 0.008 0.916 NA
#> SRR1818634 2 0.2866 0.739 0.008 0.916 NA
#> SRR1818665 1 0.0424 0.879 0.992 0.000 NA
#> SRR1818666 1 0.0424 0.879 0.992 0.000 NA
#> SRR1818667 2 0.7804 0.679 0.216 0.664 NA
#> SRR1818668 2 0.7804 0.679 0.216 0.664 NA
#> SRR1818669 1 0.0892 0.876 0.980 0.000 NA
#> SRR1818670 1 0.0892 0.876 0.980 0.000 NA
#> SRR1818663 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818664 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818629 2 0.7804 0.679 0.216 0.664 NA
#> SRR1818630 2 0.7804 0.679 0.216 0.664 NA
#> SRR1818627 1 0.0424 0.879 0.992 0.000 NA
#> SRR1818628 1 0.0424 0.879 0.992 0.000 NA
#> SRR1818621 1 0.5948 0.520 0.640 0.000 NA
#> SRR1818622 1 0.5948 0.520 0.640 0.000 NA
#> SRR1818625 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818626 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818623 2 0.4683 0.730 0.024 0.836 NA
#> SRR1818624 2 0.4683 0.730 0.024 0.836 NA
#> SRR1818619 1 0.0747 0.879 0.984 0.000 NA
#> SRR1818620 1 0.0747 0.879 0.984 0.000 NA
#> SRR1818617 1 0.1585 0.873 0.964 0.008 NA
#> SRR1818618 1 0.1585 0.873 0.964 0.008 NA
#> SRR1818615 2 0.8918 0.567 0.296 0.548 NA
#> SRR1818616 2 0.8918 0.567 0.296 0.548 NA
#> SRR1818609 2 0.1399 0.739 0.004 0.968 NA
#> SRR1818610 2 0.1399 0.739 0.004 0.968 NA
#> SRR1818607 2 0.7983 0.655 0.256 0.636 NA
#> SRR1818608 2 0.7983 0.655 0.256 0.636 NA
#> SRR1818613 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818614 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818611 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818612 1 0.1031 0.878 0.976 0.000 NA
#> SRR1818605 1 0.1315 0.875 0.972 0.008 NA
#> SRR1818606 1 0.1315 0.875 0.972 0.008 NA
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 1 0.0524 0.898 0.988 0.000 0.008 0.004
#> SRR1818632 1 0.0524 0.898 0.988 0.000 0.008 0.004
#> SRR1818679 3 0.6393 1.000 0.064 0.456 0.480 0.000
#> SRR1818680 3 0.6393 1.000 0.064 0.456 0.480 0.000
#> SRR1818677 1 0.0188 0.900 0.996 0.000 0.000 0.004
#> SRR1818678 1 0.0188 0.900 0.996 0.000 0.000 0.004
#> SRR1818675 4 0.0817 0.754 0.000 0.024 0.000 0.976
#> SRR1818676 4 0.0817 0.754 0.000 0.024 0.000 0.976
#> SRR1818673 2 0.4997 0.300 0.232 0.736 0.024 0.008
#> SRR1818674 2 0.4997 0.300 0.232 0.736 0.024 0.008
#> SRR1818671 2 0.6637 0.359 0.000 0.540 0.092 0.368
#> SRR1818672 2 0.6637 0.359 0.000 0.540 0.092 0.368
#> SRR1818661 4 0.7330 0.703 0.028 0.100 0.308 0.564
#> SRR1818662 4 0.7330 0.703 0.028 0.100 0.308 0.564
#> SRR1818655 1 0.2443 0.887 0.916 0.060 0.024 0.000
#> SRR1818656 1 0.2443 0.887 0.916 0.060 0.024 0.000
#> SRR1818653 1 0.6976 0.148 0.516 0.384 0.092 0.008
#> SRR1818654 1 0.6976 0.148 0.516 0.384 0.092 0.008
#> SRR1818651 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818652 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818657 1 0.0376 0.900 0.992 0.000 0.004 0.004
#> SRR1818658 1 0.0376 0.900 0.992 0.000 0.004 0.004
#> SRR1818649 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818650 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818659 1 0.5500 0.344 0.520 0.000 0.464 0.016
#> SRR1818647 2 0.5548 0.411 0.000 0.588 0.024 0.388
#> SRR1818648 2 0.5548 0.411 0.000 0.588 0.024 0.388
#> SRR1818645 2 0.3349 0.448 0.004 0.880 0.064 0.052
#> SRR1818646 2 0.3349 0.448 0.004 0.880 0.064 0.052
#> SRR1818639 1 0.0188 0.900 0.996 0.000 0.000 0.004
#> SRR1818640 1 0.0188 0.900 0.996 0.000 0.000 0.004
#> SRR1818637 4 0.0817 0.754 0.000 0.024 0.000 0.976
#> SRR1818638 4 0.0817 0.754 0.000 0.024 0.000 0.976
#> SRR1818635 2 0.4997 0.300 0.232 0.736 0.024 0.008
#> SRR1818636 2 0.4997 0.300 0.232 0.736 0.024 0.008
#> SRR1818643 1 0.1443 0.895 0.960 0.008 0.028 0.004
#> SRR1818644 1 0.1443 0.895 0.960 0.008 0.028 0.004
#> SRR1818641 3 0.6393 1.000 0.064 0.456 0.480 0.000
#> SRR1818642 3 0.6393 1.000 0.064 0.456 0.480 0.000
#> SRR1818633 2 0.6808 0.357 0.004 0.536 0.092 0.368
#> SRR1818634 2 0.6808 0.357 0.004 0.536 0.092 0.368
#> SRR1818665 1 0.0000 0.900 1.000 0.000 0.000 0.000
#> SRR1818666 1 0.0000 0.900 1.000 0.000 0.000 0.000
#> SRR1818667 2 0.4407 0.419 0.004 0.820 0.100 0.076
#> SRR1818668 2 0.4407 0.419 0.004 0.820 0.100 0.076
#> SRR1818669 1 0.0524 0.898 0.988 0.000 0.008 0.004
#> SRR1818670 1 0.0524 0.898 0.988 0.000 0.008 0.004
#> SRR1818663 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818664 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818629 2 0.4407 0.419 0.004 0.820 0.100 0.076
#> SRR1818630 2 0.4407 0.419 0.004 0.820 0.100 0.076
#> SRR1818627 1 0.0000 0.900 1.000 0.000 0.000 0.000
#> SRR1818628 1 0.0000 0.900 1.000 0.000 0.000 0.000
#> SRR1818621 1 0.5503 0.338 0.516 0.000 0.468 0.016
#> SRR1818622 1 0.5503 0.338 0.516 0.000 0.468 0.016
#> SRR1818625 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818626 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818623 4 0.7245 0.704 0.020 0.108 0.308 0.564
#> SRR1818624 4 0.7245 0.704 0.020 0.108 0.308 0.564
#> SRR1818619 1 0.0376 0.900 0.992 0.000 0.004 0.004
#> SRR1818620 1 0.0376 0.900 0.992 0.000 0.004 0.004
#> SRR1818617 1 0.2443 0.887 0.916 0.060 0.024 0.000
#> SRR1818618 1 0.2443 0.887 0.916 0.060 0.024 0.000
#> SRR1818615 2 0.2744 0.324 0.024 0.912 0.052 0.012
#> SRR1818616 2 0.2744 0.324 0.024 0.912 0.052 0.012
#> SRR1818609 2 0.5548 0.411 0.000 0.588 0.024 0.388
#> SRR1818610 2 0.5548 0.411 0.000 0.588 0.024 0.388
#> SRR1818607 2 0.3349 0.448 0.004 0.880 0.064 0.052
#> SRR1818608 2 0.3349 0.448 0.004 0.880 0.064 0.052
#> SRR1818613 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818614 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818611 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818612 1 0.1902 0.893 0.932 0.064 0.004 0.000
#> SRR1818605 1 0.1443 0.895 0.960 0.008 0.028 0.004
#> SRR1818606 1 0.1443 0.895 0.960 0.008 0.028 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 1 0.0693 0.869 0.980 0.000 0.008 0.000 0.012
#> SRR1818632 1 0.0693 0.869 0.980 0.000 0.008 0.000 0.012
#> SRR1818679 5 0.5588 1.000 0.012 0.376 0.052 0.000 0.560
#> SRR1818680 5 0.5588 1.000 0.012 0.376 0.052 0.000 0.560
#> SRR1818677 1 0.0290 0.873 0.992 0.000 0.000 0.000 0.008
#> SRR1818678 1 0.0290 0.873 0.992 0.000 0.000 0.000 0.008
#> SRR1818675 4 0.0290 0.787 0.000 0.000 0.000 0.992 0.008
#> SRR1818676 4 0.0290 0.787 0.000 0.000 0.000 0.992 0.008
#> SRR1818673 2 0.5058 0.379 0.216 0.704 0.012 0.000 0.068
#> SRR1818674 2 0.5058 0.379 0.216 0.704 0.012 0.000 0.068
#> SRR1818671 2 0.5947 0.509 0.000 0.484 0.092 0.004 0.420
#> SRR1818672 2 0.5947 0.509 0.000 0.484 0.092 0.004 0.420
#> SRR1818661 4 0.5265 0.773 0.008 0.012 0.400 0.564 0.016
#> SRR1818662 4 0.5265 0.773 0.008 0.012 0.400 0.564 0.016
#> SRR1818655 1 0.2522 0.845 0.904 0.028 0.012 0.000 0.056
#> SRR1818656 1 0.2522 0.845 0.904 0.028 0.012 0.000 0.056
#> SRR1818653 1 0.7208 -0.323 0.468 0.348 0.080 0.000 0.104
#> SRR1818654 1 0.7208 -0.323 0.468 0.348 0.080 0.000 0.104
#> SRR1818651 1 0.2193 0.860 0.920 0.028 0.008 0.000 0.044
#> SRR1818652 1 0.2193 0.860 0.920 0.028 0.008 0.000 0.044
#> SRR1818657 1 0.0566 0.873 0.984 0.000 0.004 0.000 0.012
#> SRR1818658 1 0.0566 0.873 0.984 0.000 0.004 0.000 0.012
#> SRR1818649 1 0.1907 0.863 0.928 0.028 0.000 0.000 0.044
#> SRR1818650 1 0.1907 0.863 0.928 0.028 0.000 0.000 0.044
#> SRR1818659 3 0.4182 0.992 0.400 0.000 0.600 0.000 0.000
#> SRR1818647 2 0.4886 0.559 0.000 0.596 0.000 0.032 0.372
#> SRR1818648 2 0.4886 0.559 0.000 0.596 0.000 0.032 0.372
#> SRR1818645 2 0.1872 0.455 0.000 0.928 0.020 0.000 0.052
#> SRR1818646 2 0.1872 0.455 0.000 0.928 0.020 0.000 0.052
#> SRR1818639 1 0.0290 0.873 0.992 0.000 0.000 0.000 0.008
#> SRR1818640 1 0.0290 0.873 0.992 0.000 0.000 0.000 0.008
#> SRR1818637 4 0.0290 0.787 0.000 0.000 0.000 0.992 0.008
#> SRR1818638 4 0.0290 0.787 0.000 0.000 0.000 0.992 0.008
#> SRR1818635 2 0.5058 0.379 0.216 0.704 0.012 0.000 0.068
#> SRR1818636 2 0.5058 0.379 0.216 0.704 0.012 0.000 0.068
#> SRR1818643 1 0.1659 0.853 0.948 0.004 0.016 0.008 0.024
#> SRR1818644 1 0.1659 0.853 0.948 0.004 0.016 0.008 0.024
#> SRR1818641 5 0.5588 1.000 0.012 0.376 0.052 0.000 0.560
#> SRR1818642 5 0.5588 1.000 0.012 0.376 0.052 0.000 0.560
#> SRR1818633 2 0.6091 0.508 0.004 0.480 0.092 0.004 0.420
#> SRR1818634 2 0.6091 0.508 0.004 0.480 0.092 0.004 0.420
#> SRR1818665 1 0.0324 0.874 0.992 0.000 0.004 0.000 0.004
#> SRR1818666 1 0.0324 0.874 0.992 0.000 0.004 0.000 0.004
#> SRR1818667 2 0.2890 0.406 0.000 0.836 0.004 0.000 0.160
#> SRR1818668 2 0.2890 0.406 0.000 0.836 0.004 0.000 0.160
#> SRR1818669 1 0.0693 0.869 0.980 0.000 0.008 0.000 0.012
#> SRR1818670 1 0.0693 0.869 0.980 0.000 0.008 0.000 0.012
#> SRR1818663 1 0.1907 0.863 0.928 0.028 0.000 0.000 0.044
#> SRR1818664 1 0.1907 0.863 0.928 0.028 0.000 0.000 0.044
#> SRR1818629 2 0.2890 0.406 0.000 0.836 0.004 0.000 0.160
#> SRR1818630 2 0.2890 0.406 0.000 0.836 0.004 0.000 0.160
#> SRR1818627 1 0.0324 0.874 0.992 0.000 0.004 0.000 0.004
#> SRR1818628 1 0.0324 0.874 0.992 0.000 0.004 0.000 0.004
#> SRR1818621 3 0.4171 0.996 0.396 0.000 0.604 0.000 0.000
#> SRR1818622 3 0.4171 0.996 0.396 0.000 0.604 0.000 0.000
#> SRR1818625 1 0.1907 0.863 0.928 0.028 0.000 0.000 0.044
#> SRR1818626 1 0.1907 0.863 0.928 0.028 0.000 0.000 0.044
#> SRR1818623 4 0.5425 0.773 0.008 0.020 0.392 0.564 0.016
#> SRR1818624 4 0.5425 0.773 0.008 0.020 0.392 0.564 0.016
#> SRR1818619 1 0.0566 0.873 0.984 0.000 0.004 0.000 0.012
#> SRR1818620 1 0.0566 0.873 0.984 0.000 0.004 0.000 0.012
#> SRR1818617 1 0.2522 0.845 0.904 0.028 0.012 0.000 0.056
#> SRR1818618 1 0.2522 0.845 0.904 0.028 0.012 0.000 0.056
#> SRR1818615 2 0.2470 0.368 0.012 0.884 0.000 0.000 0.104
#> SRR1818616 2 0.2470 0.368 0.012 0.884 0.000 0.000 0.104
#> SRR1818609 2 0.4886 0.559 0.000 0.596 0.000 0.032 0.372
#> SRR1818610 2 0.4886 0.559 0.000 0.596 0.000 0.032 0.372
#> SRR1818607 2 0.1872 0.455 0.000 0.928 0.020 0.000 0.052
#> SRR1818608 2 0.1872 0.455 0.000 0.928 0.020 0.000 0.052
#> SRR1818613 1 0.2193 0.860 0.920 0.028 0.008 0.000 0.044
#> SRR1818614 1 0.2193 0.860 0.920 0.028 0.008 0.000 0.044
#> SRR1818611 1 0.1907 0.863 0.928 0.028 0.000 0.000 0.044
#> SRR1818612 1 0.1907 0.863 0.928 0.028 0.000 0.000 0.044
#> SRR1818605 1 0.1659 0.853 0.948 0.004 0.016 0.008 0.024
#> SRR1818606 1 0.1659 0.853 0.948 0.004 0.016 0.008 0.024
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 1 0.363 0.694 0.776 0.000 0.000 0.008 0.028 0.188
#> SRR1818632 1 0.363 0.694 0.776 0.000 0.000 0.008 0.028 0.188
#> SRR1818679 2 0.649 0.357 0.012 0.516 0.000 0.236 0.208 0.028
#> SRR1818680 2 0.649 0.357 0.012 0.516 0.000 0.236 0.208 0.028
#> SRR1818677 1 0.167 0.860 0.928 0.000 0.000 0.008 0.004 0.060
#> SRR1818678 1 0.167 0.860 0.928 0.000 0.000 0.008 0.004 0.060
#> SRR1818675 3 0.000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818676 3 0.000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818673 2 0.570 0.200 0.220 0.632 0.000 0.104 0.012 0.032
#> SRR1818674 2 0.570 0.200 0.220 0.632 0.000 0.104 0.012 0.032
#> SRR1818671 4 0.329 0.818 0.000 0.276 0.000 0.724 0.000 0.000
#> SRR1818672 4 0.329 0.818 0.000 0.276 0.000 0.724 0.000 0.000
#> SRR1818661 6 0.377 0.986 0.004 0.004 0.268 0.000 0.008 0.716
#> SRR1818662 6 0.377 0.986 0.004 0.004 0.268 0.000 0.008 0.716
#> SRR1818655 1 0.257 0.858 0.892 0.040 0.000 0.000 0.036 0.032
#> SRR1818656 1 0.257 0.858 0.892 0.040 0.000 0.000 0.036 0.032
#> SRR1818653 2 0.740 -0.312 0.308 0.376 0.000 0.028 0.236 0.052
#> SRR1818654 2 0.740 -0.312 0.308 0.376 0.000 0.028 0.236 0.052
#> SRR1818651 1 0.181 0.876 0.928 0.044 0.000 0.000 0.008 0.020
#> SRR1818652 1 0.181 0.876 0.928 0.044 0.000 0.000 0.008 0.020
#> SRR1818657 1 0.220 0.855 0.904 0.004 0.000 0.008 0.012 0.072
#> SRR1818658 1 0.220 0.855 0.904 0.004 0.000 0.008 0.012 0.072
#> SRR1818649 1 0.155 0.878 0.936 0.044 0.000 0.000 0.000 0.020
#> SRR1818650 1 0.155 0.878 0.936 0.044 0.000 0.000 0.000 0.020
#> SRR1818659 5 0.302 0.992 0.232 0.000 0.000 0.000 0.768 0.000
#> SRR1818647 4 0.445 0.806 0.000 0.428 0.016 0.548 0.000 0.008
#> SRR1818648 4 0.445 0.806 0.000 0.428 0.016 0.548 0.000 0.008
#> SRR1818645 2 0.385 0.281 0.000 0.776 0.000 0.160 0.056 0.008
#> SRR1818646 2 0.385 0.281 0.000 0.776 0.000 0.160 0.056 0.008
#> SRR1818639 1 0.167 0.860 0.928 0.000 0.000 0.008 0.004 0.060
#> SRR1818640 1 0.167 0.860 0.928 0.000 0.000 0.008 0.004 0.060
#> SRR1818637 3 0.000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818638 3 0.000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818635 2 0.570 0.200 0.220 0.632 0.000 0.104 0.012 0.032
#> SRR1818636 2 0.570 0.200 0.220 0.632 0.000 0.104 0.012 0.032
#> SRR1818643 1 0.228 0.850 0.904 0.004 0.000 0.004 0.036 0.052
#> SRR1818644 1 0.228 0.850 0.904 0.004 0.000 0.004 0.036 0.052
#> SRR1818641 2 0.649 0.357 0.012 0.516 0.000 0.236 0.208 0.028
#> SRR1818642 2 0.649 0.357 0.012 0.516 0.000 0.236 0.208 0.028
#> SRR1818633 4 0.340 0.815 0.004 0.272 0.000 0.724 0.000 0.000
#> SRR1818634 4 0.340 0.815 0.004 0.272 0.000 0.724 0.000 0.000
#> SRR1818665 1 0.151 0.872 0.944 0.000 0.000 0.008 0.028 0.020
#> SRR1818666 1 0.151 0.872 0.944 0.000 0.000 0.008 0.028 0.020
#> SRR1818667 2 0.270 0.277 0.000 0.844 0.000 0.144 0.004 0.008
#> SRR1818668 2 0.270 0.277 0.000 0.844 0.000 0.144 0.004 0.008
#> SRR1818669 1 0.363 0.694 0.776 0.000 0.000 0.008 0.028 0.188
#> SRR1818670 1 0.363 0.694 0.776 0.000 0.000 0.008 0.028 0.188
#> SRR1818663 1 0.155 0.878 0.936 0.044 0.000 0.000 0.000 0.020
#> SRR1818664 1 0.155 0.878 0.936 0.044 0.000 0.000 0.000 0.020
#> SRR1818629 2 0.270 0.277 0.000 0.844 0.000 0.144 0.004 0.008
#> SRR1818630 2 0.270 0.277 0.000 0.844 0.000 0.144 0.004 0.008
#> SRR1818627 1 0.151 0.872 0.944 0.000 0.000 0.008 0.028 0.020
#> SRR1818628 1 0.151 0.872 0.944 0.000 0.000 0.008 0.028 0.020
#> SRR1818621 5 0.314 0.996 0.228 0.000 0.000 0.000 0.768 0.004
#> SRR1818622 5 0.314 0.996 0.228 0.000 0.000 0.000 0.768 0.004
#> SRR1818625 1 0.155 0.878 0.936 0.044 0.000 0.000 0.000 0.020
#> SRR1818626 1 0.155 0.878 0.936 0.044 0.000 0.000 0.000 0.020
#> SRR1818623 6 0.377 0.986 0.004 0.004 0.268 0.008 0.000 0.716
#> SRR1818624 6 0.377 0.986 0.004 0.004 0.268 0.008 0.000 0.716
#> SRR1818619 1 0.220 0.855 0.904 0.004 0.000 0.008 0.012 0.072
#> SRR1818620 1 0.220 0.855 0.904 0.004 0.000 0.008 0.012 0.072
#> SRR1818617 1 0.257 0.858 0.892 0.040 0.000 0.000 0.036 0.032
#> SRR1818618 1 0.257 0.858 0.892 0.040 0.000 0.000 0.036 0.032
#> SRR1818615 2 0.348 0.329 0.012 0.816 0.000 0.124 0.000 0.048
#> SRR1818616 2 0.348 0.329 0.012 0.816 0.000 0.124 0.000 0.048
#> SRR1818609 4 0.445 0.806 0.000 0.428 0.016 0.548 0.000 0.008
#> SRR1818610 4 0.445 0.806 0.000 0.428 0.016 0.548 0.000 0.008
#> SRR1818607 2 0.385 0.281 0.000 0.776 0.000 0.160 0.056 0.008
#> SRR1818608 2 0.385 0.281 0.000 0.776 0.000 0.160 0.056 0.008
#> SRR1818613 1 0.181 0.876 0.928 0.044 0.000 0.000 0.008 0.020
#> SRR1818614 1 0.181 0.876 0.928 0.044 0.000 0.000 0.008 0.020
#> SRR1818611 1 0.155 0.878 0.936 0.044 0.000 0.000 0.000 0.020
#> SRR1818612 1 0.155 0.878 0.936 0.044 0.000 0.000 0.000 0.020
#> SRR1818605 1 0.228 0.850 0.904 0.004 0.000 0.004 0.036 0.052
#> SRR1818606 1 0.228 0.850 0.904 0.004 0.000 0.004 0.036 0.052
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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.639 0.864 0.912 0.4794 0.498 0.498
#> 3 3 0.451 0.644 0.797 0.2647 0.972 0.944
#> 4 4 0.399 0.548 0.644 0.1180 0.885 0.760
#> 5 5 0.434 0.276 0.641 0.0832 0.863 0.677
#> 6 6 0.458 0.309 0.582 0.0538 0.943 0.842
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
#> SRR1818631 1 0.2043 0.931 0.968 0.032
#> SRR1818632 1 0.2043 0.931 0.968 0.032
#> SRR1818679 2 0.7453 0.829 0.212 0.788
#> SRR1818680 2 0.7453 0.829 0.212 0.788
#> SRR1818677 2 0.9954 0.408 0.460 0.540
#> SRR1818678 2 0.9954 0.408 0.460 0.540
#> SRR1818675 1 0.8443 0.677 0.728 0.272
#> SRR1818676 1 0.8443 0.677 0.728 0.272
#> SRR1818673 2 0.7376 0.831 0.208 0.792
#> SRR1818674 2 0.7376 0.831 0.208 0.792
#> SRR1818671 2 0.3114 0.875 0.056 0.944
#> SRR1818672 2 0.3114 0.875 0.056 0.944
#> SRR1818661 1 0.5178 0.862 0.884 0.116
#> SRR1818662 1 0.5178 0.862 0.884 0.116
#> SRR1818655 1 0.0938 0.950 0.988 0.012
#> SRR1818656 1 0.0938 0.950 0.988 0.012
#> SRR1818653 1 0.0000 0.951 1.000 0.000
#> SRR1818654 1 0.0000 0.951 1.000 0.000
#> SRR1818651 1 0.0000 0.951 1.000 0.000
#> SRR1818652 1 0.0000 0.951 1.000 0.000
#> SRR1818657 1 0.0376 0.951 0.996 0.004
#> SRR1818658 1 0.0376 0.951 0.996 0.004
#> SRR1818649 1 0.0938 0.950 0.988 0.012
#> SRR1818650 1 0.0938 0.950 0.988 0.012
#> SRR1818659 1 0.0938 0.951 0.988 0.012
#> SRR1818647 2 0.1184 0.862 0.016 0.984
#> SRR1818648 2 0.1184 0.862 0.016 0.984
#> SRR1818645 2 0.4161 0.877 0.084 0.916
#> SRR1818646 2 0.4161 0.877 0.084 0.916
#> SRR1818639 1 0.0376 0.951 0.996 0.004
#> SRR1818640 1 0.0376 0.951 0.996 0.004
#> SRR1818637 2 0.1414 0.860 0.020 0.980
#> SRR1818638 2 0.1414 0.860 0.020 0.980
#> SRR1818635 2 0.7453 0.829 0.212 0.788
#> SRR1818636 2 0.7453 0.829 0.212 0.788
#> SRR1818643 2 0.9896 0.457 0.440 0.560
#> SRR1818644 2 0.9896 0.457 0.440 0.560
#> SRR1818641 2 0.7453 0.829 0.212 0.788
#> SRR1818642 2 0.7453 0.829 0.212 0.788
#> SRR1818633 1 0.8713 0.572 0.708 0.292
#> SRR1818634 1 0.8713 0.572 0.708 0.292
#> SRR1818665 1 0.0938 0.950 0.988 0.012
#> SRR1818666 1 0.0938 0.950 0.988 0.012
#> SRR1818667 2 0.2236 0.872 0.036 0.964
#> SRR1818668 2 0.2236 0.872 0.036 0.964
#> SRR1818669 1 0.0938 0.950 0.988 0.012
#> SRR1818670 1 0.0938 0.950 0.988 0.012
#> SRR1818663 1 0.0672 0.951 0.992 0.008
#> SRR1818664 1 0.0672 0.951 0.992 0.008
#> SRR1818629 2 0.4022 0.877 0.080 0.920
#> SRR1818630 2 0.4022 0.877 0.080 0.920
#> SRR1818627 1 0.0672 0.951 0.992 0.008
#> SRR1818628 1 0.0672 0.951 0.992 0.008
#> SRR1818621 1 0.3733 0.901 0.928 0.072
#> SRR1818622 1 0.3733 0.901 0.928 0.072
#> SRR1818625 1 0.0672 0.951 0.992 0.008
#> SRR1818626 1 0.0672 0.951 0.992 0.008
#> SRR1818623 2 0.1414 0.860 0.020 0.980
#> SRR1818624 2 0.1414 0.860 0.020 0.980
#> SRR1818619 1 0.0376 0.951 0.996 0.004
#> SRR1818620 1 0.0376 0.951 0.996 0.004
#> SRR1818617 2 0.6623 0.850 0.172 0.828
#> SRR1818618 2 0.6623 0.850 0.172 0.828
#> SRR1818615 2 0.2948 0.875 0.052 0.948
#> SRR1818616 2 0.2948 0.875 0.052 0.948
#> SRR1818609 2 0.1184 0.862 0.016 0.984
#> SRR1818610 2 0.1184 0.862 0.016 0.984
#> SRR1818607 2 0.4161 0.877 0.084 0.916
#> SRR1818608 2 0.4161 0.877 0.084 0.916
#> SRR1818613 1 0.0000 0.951 1.000 0.000
#> SRR1818614 1 0.0000 0.951 1.000 0.000
#> SRR1818611 1 0.0938 0.950 0.988 0.012
#> SRR1818612 1 0.0938 0.950 0.988 0.012
#> SRR1818605 1 0.1633 0.938 0.976 0.024
#> SRR1818606 1 0.1633 0.938 0.976 0.024
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.544 0.578 0.736 0.004 0.260
#> SRR1818632 1 0.544 0.578 0.736 0.004 0.260
#> SRR1818679 2 0.738 0.635 0.080 0.676 0.244
#> SRR1818680 2 0.738 0.635 0.080 0.676 0.244
#> SRR1818677 2 0.937 0.101 0.344 0.476 0.180
#> SRR1818678 2 0.937 0.101 0.344 0.476 0.180
#> SRR1818675 3 0.857 1.000 0.372 0.104 0.524
#> SRR1818676 3 0.857 1.000 0.372 0.104 0.524
#> SRR1818673 2 0.580 0.700 0.088 0.800 0.112
#> SRR1818674 2 0.580 0.700 0.088 0.800 0.112
#> SRR1818671 2 0.447 0.701 0.004 0.820 0.176
#> SRR1818672 2 0.447 0.701 0.004 0.820 0.176
#> SRR1818661 1 0.657 0.221 0.636 0.016 0.348
#> SRR1818662 1 0.657 0.221 0.636 0.016 0.348
#> SRR1818655 1 0.421 0.720 0.856 0.016 0.128
#> SRR1818656 1 0.421 0.720 0.856 0.016 0.128
#> SRR1818653 1 0.463 0.676 0.808 0.004 0.188
#> SRR1818654 1 0.463 0.676 0.808 0.004 0.188
#> SRR1818651 1 0.188 0.765 0.952 0.004 0.044
#> SRR1818652 1 0.188 0.765 0.952 0.004 0.044
#> SRR1818657 1 0.287 0.756 0.916 0.008 0.076
#> SRR1818658 1 0.287 0.756 0.916 0.008 0.076
#> SRR1818649 1 0.427 0.727 0.860 0.024 0.116
#> SRR1818650 1 0.427 0.727 0.860 0.024 0.116
#> SRR1818659 1 0.327 0.767 0.892 0.004 0.104
#> SRR1818647 2 0.540 0.610 0.000 0.720 0.280
#> SRR1818648 2 0.540 0.610 0.000 0.720 0.280
#> SRR1818645 2 0.253 0.743 0.020 0.936 0.044
#> SRR1818646 2 0.253 0.743 0.020 0.936 0.044
#> SRR1818639 1 0.263 0.764 0.916 0.000 0.084
#> SRR1818640 1 0.263 0.764 0.916 0.000 0.084
#> SRR1818637 2 0.613 0.495 0.000 0.600 0.400
#> SRR1818638 2 0.613 0.495 0.000 0.600 0.400
#> SRR1818635 2 0.580 0.700 0.088 0.800 0.112
#> SRR1818636 2 0.580 0.700 0.088 0.800 0.112
#> SRR1818643 2 0.849 0.402 0.248 0.604 0.148
#> SRR1818644 2 0.849 0.402 0.248 0.604 0.148
#> SRR1818641 2 0.646 0.682 0.080 0.756 0.164
#> SRR1818642 2 0.646 0.682 0.080 0.756 0.164
#> SRR1818633 1 0.860 -0.166 0.564 0.312 0.124
#> SRR1818634 1 0.860 -0.166 0.564 0.312 0.124
#> SRR1818665 1 0.375 0.745 0.872 0.008 0.120
#> SRR1818666 1 0.375 0.745 0.872 0.008 0.120
#> SRR1818667 2 0.343 0.725 0.004 0.884 0.112
#> SRR1818668 2 0.343 0.725 0.004 0.884 0.112
#> SRR1818669 1 0.383 0.745 0.868 0.008 0.124
#> SRR1818670 1 0.383 0.745 0.868 0.008 0.124
#> SRR1818663 1 0.228 0.767 0.940 0.008 0.052
#> SRR1818664 1 0.228 0.767 0.940 0.008 0.052
#> SRR1818629 2 0.355 0.742 0.024 0.896 0.080
#> SRR1818630 2 0.355 0.742 0.024 0.896 0.080
#> SRR1818627 1 0.403 0.731 0.856 0.008 0.136
#> SRR1818628 1 0.403 0.731 0.856 0.008 0.136
#> SRR1818621 1 0.584 0.440 0.688 0.004 0.308
#> SRR1818622 1 0.584 0.440 0.688 0.004 0.308
#> SRR1818625 1 0.228 0.767 0.940 0.008 0.052
#> SRR1818626 1 0.228 0.767 0.940 0.008 0.052
#> SRR1818623 2 0.568 0.600 0.000 0.684 0.316
#> SRR1818624 2 0.568 0.600 0.000 0.684 0.316
#> SRR1818619 1 0.321 0.752 0.904 0.012 0.084
#> SRR1818620 1 0.321 0.752 0.904 0.012 0.084
#> SRR1818617 2 0.635 0.687 0.080 0.764 0.156
#> SRR1818618 2 0.635 0.687 0.080 0.764 0.156
#> SRR1818615 2 0.259 0.736 0.004 0.924 0.072
#> SRR1818616 2 0.259 0.736 0.004 0.924 0.072
#> SRR1818609 2 0.525 0.625 0.000 0.736 0.264
#> SRR1818610 2 0.525 0.625 0.000 0.736 0.264
#> SRR1818607 2 0.253 0.743 0.020 0.936 0.044
#> SRR1818608 2 0.253 0.743 0.020 0.936 0.044
#> SRR1818613 1 0.188 0.765 0.952 0.004 0.044
#> SRR1818614 1 0.188 0.765 0.952 0.004 0.044
#> SRR1818611 1 0.427 0.727 0.860 0.024 0.116
#> SRR1818612 1 0.427 0.727 0.860 0.024 0.116
#> SRR1818605 1 0.452 0.658 0.816 0.004 0.180
#> SRR1818606 1 0.452 0.658 0.816 0.004 0.180
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 1 0.647 0.670 0.612 0.076 NA 0.008
#> SRR1818632 1 0.647 0.670 0.612 0.076 NA 0.008
#> SRR1818679 2 0.636 0.494 0.048 0.716 NA 0.148
#> SRR1818680 2 0.636 0.494 0.048 0.716 NA 0.148
#> SRR1818677 2 0.882 0.249 0.372 0.404 NA 0.100
#> SRR1818678 2 0.882 0.249 0.372 0.404 NA 0.100
#> SRR1818675 4 0.828 0.122 0.228 0.020 NA 0.412
#> SRR1818676 4 0.828 0.122 0.228 0.020 NA 0.412
#> SRR1818673 2 0.741 0.525 0.092 0.608 NA 0.244
#> SRR1818674 2 0.741 0.525 0.092 0.608 NA 0.244
#> SRR1818671 4 0.543 0.454 0.000 0.252 NA 0.696
#> SRR1818672 4 0.543 0.454 0.000 0.252 NA 0.696
#> SRR1818661 1 0.682 0.537 0.468 0.004 NA 0.084
#> SRR1818662 1 0.682 0.537 0.468 0.004 NA 0.084
#> SRR1818655 1 0.581 0.697 0.708 0.160 NA 0.000
#> SRR1818656 1 0.581 0.697 0.708 0.160 NA 0.000
#> SRR1818653 1 0.567 0.700 0.620 0.028 NA 0.004
#> SRR1818654 1 0.567 0.700 0.620 0.028 NA 0.004
#> SRR1818651 1 0.177 0.777 0.944 0.012 NA 0.000
#> SRR1818652 1 0.177 0.777 0.944 0.012 NA 0.000
#> SRR1818657 1 0.390 0.761 0.832 0.036 NA 0.000
#> SRR1818658 1 0.390 0.761 0.832 0.036 NA 0.000
#> SRR1818649 1 0.527 0.681 0.740 0.184 NA 0.000
#> SRR1818650 1 0.527 0.681 0.740 0.184 NA 0.000
#> SRR1818659 1 0.350 0.774 0.852 0.024 NA 0.000
#> SRR1818647 4 0.400 0.535 0.000 0.104 NA 0.836
#> SRR1818648 4 0.400 0.535 0.000 0.104 NA 0.836
#> SRR1818645 2 0.609 0.258 0.016 0.568 NA 0.392
#> SRR1818646 2 0.609 0.258 0.016 0.568 NA 0.392
#> SRR1818639 1 0.360 0.773 0.848 0.028 NA 0.000
#> SRR1818640 1 0.360 0.773 0.848 0.028 NA 0.000
#> SRR1818637 4 0.350 0.497 0.000 0.020 NA 0.848
#> SRR1818638 4 0.350 0.497 0.000 0.020 NA 0.848
#> SRR1818635 2 0.747 0.528 0.100 0.608 NA 0.236
#> SRR1818636 2 0.747 0.528 0.100 0.608 NA 0.236
#> SRR1818643 2 0.892 0.422 0.264 0.468 NA 0.168
#> SRR1818644 2 0.892 0.422 0.264 0.468 NA 0.168
#> SRR1818641 2 0.577 0.527 0.060 0.752 NA 0.144
#> SRR1818642 2 0.577 0.527 0.060 0.752 NA 0.144
#> SRR1818633 1 0.927 0.143 0.440 0.160 NA 0.252
#> SRR1818634 1 0.927 0.143 0.440 0.160 NA 0.252
#> SRR1818665 1 0.464 0.733 0.776 0.044 NA 0.000
#> SRR1818666 1 0.464 0.733 0.776 0.044 NA 0.000
#> SRR1818667 4 0.595 0.371 0.000 0.328 NA 0.616
#> SRR1818668 4 0.595 0.371 0.000 0.328 NA 0.616
#> SRR1818669 1 0.423 0.759 0.820 0.060 NA 0.000
#> SRR1818670 1 0.423 0.759 0.820 0.060 NA 0.000
#> SRR1818663 1 0.193 0.774 0.940 0.036 NA 0.000
#> SRR1818664 1 0.193 0.774 0.940 0.036 NA 0.000
#> SRR1818629 4 0.630 0.138 0.012 0.424 NA 0.528
#> SRR1818630 4 0.630 0.138 0.012 0.424 NA 0.528
#> SRR1818627 1 0.483 0.727 0.752 0.040 NA 0.000
#> SRR1818628 1 0.483 0.727 0.752 0.040 NA 0.000
#> SRR1818621 1 0.610 0.599 0.504 0.012 NA 0.024
#> SRR1818622 1 0.610 0.599 0.504 0.012 NA 0.024
#> SRR1818625 1 0.193 0.774 0.940 0.036 NA 0.000
#> SRR1818626 1 0.193 0.774 0.940 0.036 NA 0.000
#> SRR1818623 4 0.585 0.495 0.000 0.160 NA 0.704
#> SRR1818624 4 0.585 0.495 0.000 0.160 NA 0.704
#> SRR1818619 1 0.432 0.757 0.812 0.040 NA 0.004
#> SRR1818620 1 0.432 0.757 0.812 0.040 NA 0.004
#> SRR1818617 2 0.811 0.469 0.100 0.560 NA 0.244
#> SRR1818618 2 0.811 0.469 0.100 0.560 NA 0.244
#> SRR1818615 4 0.584 0.242 0.000 0.400 NA 0.564
#> SRR1818616 4 0.584 0.242 0.000 0.400 NA 0.564
#> SRR1818609 4 0.410 0.532 0.000 0.128 NA 0.824
#> SRR1818610 4 0.410 0.532 0.000 0.128 NA 0.824
#> SRR1818607 2 0.609 0.258 0.016 0.568 NA 0.392
#> SRR1818608 2 0.609 0.258 0.016 0.568 NA 0.392
#> SRR1818613 1 0.177 0.777 0.944 0.012 NA 0.000
#> SRR1818614 1 0.177 0.777 0.944 0.012 NA 0.000
#> SRR1818611 1 0.516 0.687 0.748 0.180 NA 0.000
#> SRR1818612 1 0.516 0.687 0.748 0.180 NA 0.000
#> SRR1818605 1 0.492 0.737 0.732 0.024 NA 0.004
#> SRR1818606 1 0.492 0.737 0.732 0.024 NA 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 1 0.636 -0.1227 0.552 0.000 0.308 0.020 0.120
#> SRR1818632 1 0.636 -0.1227 0.552 0.000 0.308 0.020 0.120
#> SRR1818679 5 0.530 1.0000 0.016 0.436 0.004 0.016 0.528
#> SRR1818680 5 0.530 1.0000 0.016 0.436 0.004 0.016 0.528
#> SRR1818677 2 0.864 -0.1544 0.292 0.324 0.080 0.032 0.272
#> SRR1818678 2 0.864 -0.1544 0.292 0.324 0.080 0.032 0.272
#> SRR1818675 4 0.766 0.0688 0.176 0.028 0.300 0.464 0.032
#> SRR1818676 4 0.766 0.0688 0.176 0.028 0.300 0.464 0.032
#> SRR1818673 2 0.397 0.2055 0.028 0.820 0.020 0.008 0.124
#> SRR1818674 2 0.397 0.2055 0.028 0.820 0.020 0.008 0.124
#> SRR1818671 2 0.578 -0.0879 0.000 0.508 0.012 0.420 0.060
#> SRR1818672 2 0.578 -0.0879 0.000 0.508 0.012 0.420 0.060
#> SRR1818661 3 0.635 0.7917 0.412 0.000 0.468 0.104 0.016
#> SRR1818662 3 0.635 0.7917 0.412 0.000 0.468 0.104 0.016
#> SRR1818655 1 0.688 0.3011 0.608 0.048 0.168 0.016 0.160
#> SRR1818656 1 0.688 0.3011 0.608 0.048 0.168 0.016 0.160
#> SRR1818653 1 0.572 -0.3318 0.536 0.000 0.396 0.016 0.052
#> SRR1818654 1 0.572 -0.3318 0.536 0.000 0.396 0.016 0.052
#> SRR1818651 1 0.161 0.4704 0.944 0.004 0.040 0.000 0.012
#> SRR1818652 1 0.161 0.4704 0.944 0.004 0.040 0.000 0.012
#> SRR1818657 1 0.459 0.4519 0.772 0.000 0.148 0.032 0.048
#> SRR1818658 1 0.459 0.4519 0.772 0.000 0.148 0.032 0.048
#> SRR1818649 1 0.659 0.3563 0.648 0.092 0.056 0.024 0.180
#> SRR1818650 1 0.659 0.3563 0.648 0.092 0.056 0.024 0.180
#> SRR1818659 1 0.405 0.4166 0.792 0.004 0.164 0.008 0.032
#> SRR1818647 4 0.542 0.5430 0.000 0.324 0.012 0.612 0.052
#> SRR1818648 4 0.542 0.5430 0.000 0.324 0.012 0.612 0.052
#> SRR1818645 2 0.534 0.2366 0.000 0.704 0.016 0.164 0.116
#> SRR1818646 2 0.534 0.2366 0.000 0.704 0.016 0.164 0.116
#> SRR1818639 1 0.508 0.3190 0.716 0.004 0.180 0.004 0.096
#> SRR1818640 1 0.508 0.3190 0.716 0.004 0.180 0.004 0.096
#> SRR1818637 4 0.486 0.5635 0.000 0.140 0.088 0.752 0.020
#> SRR1818638 4 0.486 0.5635 0.000 0.140 0.088 0.752 0.020
#> SRR1818635 2 0.397 0.2055 0.028 0.820 0.020 0.008 0.124
#> SRR1818636 2 0.397 0.2055 0.028 0.820 0.020 0.008 0.124
#> SRR1818643 2 0.686 0.1157 0.196 0.620 0.060 0.024 0.100
#> SRR1818644 2 0.686 0.1157 0.196 0.620 0.060 0.024 0.100
#> SRR1818641 2 0.489 -0.8368 0.016 0.504 0.000 0.004 0.476
#> SRR1818642 2 0.489 -0.8368 0.016 0.504 0.000 0.004 0.476
#> SRR1818633 1 0.922 -0.1575 0.344 0.272 0.164 0.156 0.064
#> SRR1818634 1 0.922 -0.1575 0.344 0.272 0.164 0.156 0.064
#> SRR1818665 1 0.556 0.4151 0.716 0.008 0.156 0.036 0.084
#> SRR1818666 1 0.556 0.4151 0.716 0.008 0.156 0.036 0.084
#> SRR1818667 2 0.688 0.2520 0.000 0.564 0.056 0.228 0.152
#> SRR1818668 2 0.688 0.2520 0.000 0.564 0.056 0.228 0.152
#> SRR1818669 1 0.518 0.3414 0.720 0.000 0.152 0.016 0.112
#> SRR1818670 1 0.518 0.3414 0.720 0.000 0.152 0.016 0.112
#> SRR1818663 1 0.326 0.5005 0.876 0.020 0.044 0.008 0.052
#> SRR1818664 1 0.326 0.5005 0.876 0.020 0.044 0.008 0.052
#> SRR1818629 2 0.586 0.2904 0.000 0.692 0.068 0.100 0.140
#> SRR1818630 2 0.586 0.2904 0.000 0.692 0.068 0.100 0.140
#> SRR1818627 1 0.566 0.4053 0.704 0.008 0.172 0.036 0.080
#> SRR1818628 1 0.566 0.4053 0.704 0.008 0.172 0.036 0.080
#> SRR1818621 3 0.549 0.7746 0.448 0.000 0.504 0.028 0.020
#> SRR1818622 3 0.549 0.7746 0.448 0.000 0.504 0.028 0.020
#> SRR1818625 1 0.326 0.5005 0.876 0.020 0.044 0.008 0.052
#> SRR1818626 1 0.326 0.5005 0.876 0.020 0.044 0.008 0.052
#> SRR1818623 4 0.645 0.4362 0.000 0.300 0.052 0.568 0.080
#> SRR1818624 4 0.645 0.4362 0.000 0.300 0.052 0.568 0.080
#> SRR1818619 1 0.498 0.4358 0.740 0.000 0.168 0.032 0.060
#> SRR1818620 1 0.498 0.4358 0.740 0.000 0.168 0.032 0.060
#> SRR1818617 2 0.766 0.0635 0.056 0.564 0.072 0.104 0.204
#> SRR1818618 2 0.766 0.0635 0.056 0.564 0.072 0.104 0.204
#> SRR1818615 2 0.460 0.3218 0.000 0.760 0.020 0.168 0.052
#> SRR1818616 2 0.460 0.3218 0.000 0.760 0.020 0.168 0.052
#> SRR1818609 4 0.532 0.5241 0.000 0.340 0.008 0.604 0.048
#> SRR1818610 4 0.532 0.5241 0.000 0.340 0.008 0.604 0.048
#> SRR1818607 2 0.534 0.2366 0.000 0.704 0.016 0.164 0.116
#> SRR1818608 2 0.534 0.2366 0.000 0.704 0.016 0.164 0.116
#> SRR1818613 1 0.161 0.4704 0.944 0.004 0.040 0.000 0.012
#> SRR1818614 1 0.161 0.4704 0.944 0.004 0.040 0.000 0.012
#> SRR1818611 1 0.659 0.3563 0.648 0.092 0.056 0.024 0.180
#> SRR1818612 1 0.659 0.3563 0.648 0.092 0.056 0.024 0.180
#> SRR1818605 1 0.537 -0.1055 0.668 0.016 0.268 0.016 0.032
#> SRR1818606 1 0.537 -0.1055 0.668 0.016 0.268 0.016 0.032
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 1 0.708 -0.1729 0.428 0.000 0.088 0.032 0.364 NA
#> SRR1818632 1 0.708 -0.1729 0.428 0.000 0.088 0.032 0.364 NA
#> SRR1818679 3 0.509 0.8786 0.012 0.312 0.624 0.028 0.020 NA
#> SRR1818680 3 0.509 0.8786 0.012 0.312 0.624 0.028 0.020 NA
#> SRR1818677 1 0.887 -0.0277 0.296 0.204 0.256 0.024 0.156 NA
#> SRR1818678 1 0.887 -0.0277 0.296 0.204 0.256 0.024 0.156 NA
#> SRR1818675 4 0.653 0.2382 0.112 0.024 0.020 0.632 0.136 NA
#> SRR1818676 4 0.653 0.2382 0.112 0.024 0.020 0.632 0.136 NA
#> SRR1818673 2 0.692 0.2474 0.056 0.620 0.144 0.048 0.056 NA
#> SRR1818674 2 0.692 0.2474 0.056 0.620 0.144 0.048 0.056 NA
#> SRR1818671 2 0.679 0.1218 0.000 0.560 0.072 0.204 0.032 NA
#> SRR1818672 2 0.679 0.1218 0.000 0.560 0.072 0.204 0.032 NA
#> SRR1818661 5 0.625 0.7438 0.292 0.004 0.012 0.112 0.548 NA
#> SRR1818662 5 0.625 0.7438 0.292 0.004 0.012 0.112 0.548 NA
#> SRR1818655 1 0.728 0.2058 0.520 0.020 0.208 0.012 0.136 NA
#> SRR1818656 1 0.728 0.2058 0.520 0.020 0.208 0.012 0.136 NA
#> SRR1818653 1 0.624 -0.2119 0.496 0.000 0.068 0.016 0.368 NA
#> SRR1818654 1 0.624 -0.2119 0.496 0.000 0.068 0.016 0.368 NA
#> SRR1818651 1 0.194 0.3842 0.916 0.000 0.012 0.000 0.064 NA
#> SRR1818652 1 0.194 0.3842 0.916 0.000 0.012 0.000 0.064 NA
#> SRR1818657 1 0.513 0.3726 0.684 0.004 0.012 0.024 0.056 NA
#> SRR1818658 1 0.513 0.3726 0.684 0.004 0.012 0.024 0.056 NA
#> SRR1818649 1 0.726 0.2992 0.572 0.052 0.108 0.016 0.132 NA
#> SRR1818650 1 0.726 0.2992 0.572 0.052 0.108 0.016 0.132 NA
#> SRR1818659 1 0.485 0.3549 0.716 0.000 0.020 0.004 0.120 NA
#> SRR1818647 4 0.674 0.5540 0.000 0.344 0.036 0.432 0.012 NA
#> SRR1818648 4 0.674 0.5540 0.000 0.344 0.036 0.432 0.012 NA
#> SRR1818645 2 0.523 0.2152 0.008 0.724 0.148 0.052 0.028 NA
#> SRR1818646 2 0.523 0.2152 0.008 0.724 0.148 0.052 0.028 NA
#> SRR1818639 1 0.546 0.2650 0.684 0.004 0.080 0.008 0.172 NA
#> SRR1818640 1 0.546 0.2650 0.684 0.004 0.080 0.008 0.172 NA
#> SRR1818637 4 0.288 0.5711 0.000 0.180 0.008 0.812 0.000 NA
#> SRR1818638 4 0.288 0.5711 0.000 0.180 0.008 0.812 0.000 NA
#> SRR1818635 2 0.697 0.2438 0.060 0.616 0.144 0.048 0.056 NA
#> SRR1818636 2 0.697 0.2438 0.060 0.616 0.144 0.048 0.056 NA
#> SRR1818643 2 0.876 0.1550 0.188 0.428 0.108 0.076 0.120 NA
#> SRR1818644 2 0.876 0.1550 0.188 0.428 0.108 0.076 0.120 NA
#> SRR1818641 3 0.466 0.8701 0.012 0.388 0.580 0.008 0.008 NA
#> SRR1818642 3 0.466 0.8701 0.012 0.388 0.580 0.008 0.008 NA
#> SRR1818633 1 0.893 -0.0990 0.300 0.244 0.072 0.032 0.124 NA
#> SRR1818634 1 0.893 -0.0990 0.300 0.244 0.072 0.032 0.124 NA
#> SRR1818665 1 0.472 0.3185 0.564 0.000 0.008 0.008 0.020 NA
#> SRR1818666 1 0.472 0.3185 0.564 0.000 0.008 0.008 0.020 NA
#> SRR1818667 2 0.618 0.3012 0.000 0.616 0.104 0.200 0.024 NA
#> SRR1818668 2 0.618 0.3012 0.000 0.616 0.104 0.200 0.024 NA
#> SRR1818669 1 0.604 0.2365 0.624 0.000 0.080 0.016 0.204 NA
#> SRR1818670 1 0.604 0.2365 0.624 0.000 0.080 0.016 0.204 NA
#> SRR1818663 1 0.368 0.4261 0.816 0.004 0.024 0.012 0.016 NA
#> SRR1818664 1 0.368 0.4261 0.816 0.004 0.024 0.012 0.016 NA
#> SRR1818629 2 0.577 0.3637 0.008 0.700 0.088 0.076 0.032 NA
#> SRR1818630 2 0.577 0.3637 0.008 0.700 0.088 0.076 0.032 NA
#> SRR1818627 1 0.510 0.2979 0.544 0.000 0.012 0.012 0.032 NA
#> SRR1818628 1 0.510 0.2979 0.544 0.000 0.012 0.012 0.032 NA
#> SRR1818621 5 0.598 0.7161 0.348 0.000 0.024 0.036 0.536 NA
#> SRR1818622 5 0.598 0.7161 0.348 0.000 0.024 0.036 0.536 NA
#> SRR1818625 1 0.368 0.4261 0.816 0.004 0.024 0.012 0.016 NA
#> SRR1818626 1 0.368 0.4261 0.816 0.004 0.024 0.012 0.016 NA
#> SRR1818623 4 0.722 0.4442 0.000 0.288 0.080 0.484 0.060 NA
#> SRR1818624 4 0.722 0.4442 0.000 0.288 0.080 0.484 0.060 NA
#> SRR1818619 1 0.545 0.3620 0.664 0.008 0.020 0.024 0.056 NA
#> SRR1818620 1 0.545 0.3620 0.664 0.008 0.020 0.024 0.056 NA
#> SRR1818617 2 0.827 0.0375 0.068 0.416 0.276 0.040 0.068 NA
#> SRR1818618 2 0.827 0.0375 0.068 0.416 0.276 0.040 0.068 NA
#> SRR1818615 2 0.340 0.3718 0.000 0.844 0.036 0.088 0.016 NA
#> SRR1818616 2 0.340 0.3718 0.000 0.844 0.036 0.088 0.016 NA
#> SRR1818609 4 0.670 0.5328 0.000 0.364 0.028 0.408 0.012 NA
#> SRR1818610 4 0.670 0.5328 0.000 0.364 0.028 0.408 0.012 NA
#> SRR1818607 2 0.523 0.2152 0.008 0.724 0.148 0.052 0.028 NA
#> SRR1818608 2 0.523 0.2152 0.008 0.724 0.148 0.052 0.028 NA
#> SRR1818613 1 0.194 0.3842 0.916 0.000 0.012 0.000 0.064 NA
#> SRR1818614 1 0.194 0.3842 0.916 0.000 0.012 0.000 0.064 NA
#> SRR1818611 1 0.720 0.3035 0.580 0.052 0.108 0.016 0.128 NA
#> SRR1818612 1 0.720 0.3035 0.580 0.052 0.108 0.016 0.128 NA
#> SRR1818605 1 0.604 -0.1663 0.572 0.004 0.020 0.052 0.304 NA
#> SRR1818606 1 0.604 -0.1663 0.572 0.004 0.020 0.052 0.304 NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.968 0.988 0.5051 0.494 0.494
#> 3 3 0.506 0.654 0.779 0.2761 0.861 0.723
#> 4 4 0.529 0.516 0.703 0.1483 0.814 0.545
#> 5 5 0.541 0.382 0.616 0.0699 0.897 0.638
#> 6 6 0.552 0.399 0.606 0.0442 0.925 0.686
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
#> SRR1818631 1 0.00 0.998 1.000 0.000
#> SRR1818632 1 0.00 0.998 1.000 0.000
#> SRR1818679 2 0.00 0.976 0.000 1.000
#> SRR1818680 2 0.00 0.976 0.000 1.000
#> SRR1818677 2 0.00 0.976 0.000 1.000
#> SRR1818678 2 0.00 0.976 0.000 1.000
#> SRR1818675 1 0.26 0.954 0.956 0.044
#> SRR1818676 1 0.26 0.954 0.956 0.044
#> SRR1818673 2 0.00 0.976 0.000 1.000
#> SRR1818674 2 0.00 0.976 0.000 1.000
#> SRR1818671 2 0.00 0.976 0.000 1.000
#> SRR1818672 2 0.00 0.976 0.000 1.000
#> SRR1818661 1 0.00 0.998 1.000 0.000
#> SRR1818662 1 0.00 0.998 1.000 0.000
#> SRR1818655 1 0.00 0.998 1.000 0.000
#> SRR1818656 1 0.00 0.998 1.000 0.000
#> SRR1818653 1 0.00 0.998 1.000 0.000
#> SRR1818654 1 0.00 0.998 1.000 0.000
#> SRR1818651 1 0.00 0.998 1.000 0.000
#> SRR1818652 1 0.00 0.998 1.000 0.000
#> SRR1818657 1 0.00 0.998 1.000 0.000
#> SRR1818658 1 0.00 0.998 1.000 0.000
#> SRR1818649 1 0.00 0.998 1.000 0.000
#> SRR1818650 1 0.00 0.998 1.000 0.000
#> SRR1818659 1 0.00 0.998 1.000 0.000
#> SRR1818647 2 0.00 0.976 0.000 1.000
#> SRR1818648 2 0.00 0.976 0.000 1.000
#> SRR1818645 2 0.00 0.976 0.000 1.000
#> SRR1818646 2 0.00 0.976 0.000 1.000
#> SRR1818639 1 0.00 0.998 1.000 0.000
#> SRR1818640 1 0.00 0.998 1.000 0.000
#> SRR1818637 2 0.00 0.976 0.000 1.000
#> SRR1818638 2 0.00 0.976 0.000 1.000
#> SRR1818635 2 0.00 0.976 0.000 1.000
#> SRR1818636 2 0.00 0.976 0.000 1.000
#> SRR1818643 2 0.00 0.976 0.000 1.000
#> SRR1818644 2 0.00 0.976 0.000 1.000
#> SRR1818641 2 0.00 0.976 0.000 1.000
#> SRR1818642 2 0.00 0.976 0.000 1.000
#> SRR1818633 2 0.98 0.308 0.416 0.584
#> SRR1818634 2 0.98 0.308 0.416 0.584
#> SRR1818665 1 0.00 0.998 1.000 0.000
#> SRR1818666 1 0.00 0.998 1.000 0.000
#> SRR1818667 2 0.00 0.976 0.000 1.000
#> SRR1818668 2 0.00 0.976 0.000 1.000
#> SRR1818669 1 0.00 0.998 1.000 0.000
#> SRR1818670 1 0.00 0.998 1.000 0.000
#> SRR1818663 1 0.00 0.998 1.000 0.000
#> SRR1818664 1 0.00 0.998 1.000 0.000
#> SRR1818629 2 0.00 0.976 0.000 1.000
#> SRR1818630 2 0.00 0.976 0.000 1.000
#> SRR1818627 1 0.00 0.998 1.000 0.000
#> SRR1818628 1 0.00 0.998 1.000 0.000
#> SRR1818621 1 0.00 0.998 1.000 0.000
#> SRR1818622 1 0.00 0.998 1.000 0.000
#> SRR1818625 1 0.00 0.998 1.000 0.000
#> SRR1818626 1 0.00 0.998 1.000 0.000
#> SRR1818623 2 0.00 0.976 0.000 1.000
#> SRR1818624 2 0.00 0.976 0.000 1.000
#> SRR1818619 1 0.00 0.998 1.000 0.000
#> SRR1818620 1 0.00 0.998 1.000 0.000
#> SRR1818617 2 0.00 0.976 0.000 1.000
#> SRR1818618 2 0.00 0.976 0.000 1.000
#> SRR1818615 2 0.00 0.976 0.000 1.000
#> SRR1818616 2 0.00 0.976 0.000 1.000
#> SRR1818609 2 0.00 0.976 0.000 1.000
#> SRR1818610 2 0.00 0.976 0.000 1.000
#> SRR1818607 2 0.00 0.976 0.000 1.000
#> SRR1818608 2 0.00 0.976 0.000 1.000
#> SRR1818613 1 0.00 0.998 1.000 0.000
#> SRR1818614 1 0.00 0.998 1.000 0.000
#> SRR1818611 1 0.00 0.998 1.000 0.000
#> SRR1818612 1 0.00 0.998 1.000 0.000
#> SRR1818605 1 0.00 0.998 1.000 0.000
#> SRR1818606 1 0.00 0.998 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.5529 0.726 0.704 0.000 0.296
#> SRR1818632 1 0.5529 0.726 0.704 0.000 0.296
#> SRR1818679 2 0.0892 0.698 0.000 0.980 0.020
#> SRR1818680 2 0.0747 0.699 0.000 0.984 0.016
#> SRR1818677 2 0.6775 0.468 0.144 0.744 0.112
#> SRR1818678 2 0.6892 0.457 0.152 0.736 0.112
#> SRR1818675 3 0.3043 0.435 0.084 0.008 0.908
#> SRR1818676 3 0.3043 0.435 0.084 0.008 0.908
#> SRR1818673 2 0.1643 0.706 0.000 0.956 0.044
#> SRR1818674 2 0.1643 0.706 0.000 0.956 0.044
#> SRR1818671 3 0.6307 0.289 0.000 0.488 0.512
#> SRR1818672 3 0.6307 0.289 0.000 0.488 0.512
#> SRR1818661 1 0.6291 0.516 0.532 0.000 0.468
#> SRR1818662 1 0.6291 0.516 0.532 0.000 0.468
#> SRR1818655 1 0.4868 0.798 0.844 0.100 0.056
#> SRR1818656 1 0.4790 0.801 0.848 0.096 0.056
#> SRR1818653 1 0.4750 0.799 0.784 0.000 0.216
#> SRR1818654 1 0.4750 0.799 0.784 0.000 0.216
#> SRR1818651 1 0.1860 0.861 0.948 0.000 0.052
#> SRR1818652 1 0.1860 0.861 0.948 0.000 0.052
#> SRR1818657 1 0.3482 0.843 0.872 0.000 0.128
#> SRR1818658 1 0.3482 0.843 0.872 0.000 0.128
#> SRR1818649 1 0.3998 0.824 0.884 0.056 0.060
#> SRR1818650 1 0.3998 0.824 0.884 0.056 0.060
#> SRR1818659 1 0.2537 0.860 0.920 0.000 0.080
#> SRR1818647 3 0.5968 0.590 0.000 0.364 0.636
#> SRR1818648 3 0.5968 0.590 0.000 0.364 0.636
#> SRR1818645 2 0.2878 0.687 0.000 0.904 0.096
#> SRR1818646 2 0.2878 0.687 0.000 0.904 0.096
#> SRR1818639 1 0.1399 0.852 0.968 0.004 0.028
#> SRR1818640 1 0.1399 0.852 0.968 0.004 0.028
#> SRR1818637 3 0.5905 0.598 0.000 0.352 0.648
#> SRR1818638 3 0.5905 0.598 0.000 0.352 0.648
#> SRR1818635 2 0.1643 0.706 0.000 0.956 0.044
#> SRR1818636 2 0.1643 0.706 0.000 0.956 0.044
#> SRR1818643 2 0.6180 0.422 0.008 0.660 0.332
#> SRR1818644 2 0.6205 0.411 0.008 0.656 0.336
#> SRR1818641 2 0.0424 0.701 0.000 0.992 0.008
#> SRR1818642 2 0.0424 0.701 0.000 0.992 0.008
#> SRR1818633 3 0.6906 0.368 0.192 0.084 0.724
#> SRR1818634 3 0.6935 0.371 0.188 0.088 0.724
#> SRR1818665 1 0.4002 0.838 0.840 0.000 0.160
#> SRR1818666 1 0.4002 0.838 0.840 0.000 0.160
#> SRR1818667 2 0.6095 0.131 0.000 0.608 0.392
#> SRR1818668 2 0.6095 0.131 0.000 0.608 0.392
#> SRR1818669 1 0.0892 0.855 0.980 0.000 0.020
#> SRR1818670 1 0.0892 0.855 0.980 0.000 0.020
#> SRR1818663 1 0.2066 0.858 0.940 0.000 0.060
#> SRR1818664 1 0.2066 0.858 0.940 0.000 0.060
#> SRR1818629 2 0.6026 0.193 0.000 0.624 0.376
#> SRR1818630 2 0.6045 0.179 0.000 0.620 0.380
#> SRR1818627 1 0.4235 0.834 0.824 0.000 0.176
#> SRR1818628 1 0.4235 0.834 0.824 0.000 0.176
#> SRR1818621 1 0.5859 0.699 0.656 0.000 0.344
#> SRR1818622 1 0.5859 0.699 0.656 0.000 0.344
#> SRR1818625 1 0.2066 0.858 0.940 0.000 0.060
#> SRR1818626 1 0.2066 0.858 0.940 0.000 0.060
#> SRR1818623 3 0.5926 0.596 0.000 0.356 0.644
#> SRR1818624 3 0.5926 0.596 0.000 0.356 0.644
#> SRR1818619 1 0.3482 0.843 0.872 0.000 0.128
#> SRR1818620 1 0.3482 0.843 0.872 0.000 0.128
#> SRR1818617 2 0.4346 0.617 0.000 0.816 0.184
#> SRR1818618 2 0.4784 0.598 0.004 0.796 0.200
#> SRR1818615 2 0.5785 0.323 0.000 0.668 0.332
#> SRR1818616 2 0.5785 0.323 0.000 0.668 0.332
#> SRR1818609 3 0.6215 0.476 0.000 0.428 0.572
#> SRR1818610 3 0.6215 0.476 0.000 0.428 0.572
#> SRR1818607 2 0.2878 0.687 0.000 0.904 0.096
#> SRR1818608 2 0.2878 0.687 0.000 0.904 0.096
#> SRR1818613 1 0.1753 0.861 0.952 0.000 0.048
#> SRR1818614 1 0.1753 0.861 0.952 0.000 0.048
#> SRR1818611 1 0.3998 0.824 0.884 0.056 0.060
#> SRR1818612 1 0.3998 0.824 0.884 0.056 0.060
#> SRR1818605 1 0.5785 0.735 0.668 0.000 0.332
#> SRR1818606 1 0.5785 0.735 0.668 0.000 0.332
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.4839 0.5572 0.256 0.004 0.724 0.016
#> SRR1818632 3 0.4869 0.5507 0.260 0.004 0.720 0.016
#> SRR1818679 2 0.2708 0.6858 0.004 0.904 0.016 0.076
#> SRR1818680 2 0.2778 0.6862 0.004 0.900 0.016 0.080
#> SRR1818677 2 0.7852 0.4891 0.084 0.604 0.132 0.180
#> SRR1818678 2 0.7596 0.5085 0.080 0.624 0.112 0.184
#> SRR1818675 3 0.7073 0.0729 0.048 0.036 0.468 0.448
#> SRR1818676 3 0.7074 0.0604 0.048 0.036 0.464 0.452
#> SRR1818673 2 0.4643 0.6766 0.012 0.788 0.028 0.172
#> SRR1818674 2 0.4643 0.6766 0.012 0.788 0.028 0.172
#> SRR1818671 4 0.1118 0.7160 0.000 0.036 0.000 0.964
#> SRR1818672 4 0.1302 0.7134 0.000 0.044 0.000 0.956
#> SRR1818661 3 0.5590 0.6439 0.200 0.012 0.728 0.060
#> SRR1818662 3 0.5590 0.6439 0.200 0.012 0.728 0.060
#> SRR1818655 1 0.7042 0.2883 0.488 0.124 0.388 0.000
#> SRR1818656 1 0.6946 0.3031 0.504 0.116 0.380 0.000
#> SRR1818653 3 0.4899 0.5586 0.300 0.008 0.688 0.004
#> SRR1818654 3 0.4850 0.5621 0.292 0.008 0.696 0.004
#> SRR1818651 1 0.4877 0.3907 0.664 0.008 0.328 0.000
#> SRR1818652 1 0.4814 0.4095 0.676 0.008 0.316 0.000
#> SRR1818657 1 0.5195 0.5399 0.692 0.032 0.276 0.000
#> SRR1818658 1 0.5195 0.5399 0.692 0.032 0.276 0.000
#> SRR1818649 1 0.5648 0.4730 0.684 0.064 0.252 0.000
#> SRR1818650 1 0.5716 0.4690 0.680 0.068 0.252 0.000
#> SRR1818659 1 0.3790 0.5696 0.820 0.016 0.164 0.000
#> SRR1818647 4 0.0927 0.7175 0.000 0.008 0.016 0.976
#> SRR1818648 4 0.0672 0.7192 0.000 0.008 0.008 0.984
#> SRR1818645 2 0.4746 0.5024 0.000 0.632 0.000 0.368
#> SRR1818646 2 0.4746 0.5024 0.000 0.632 0.000 0.368
#> SRR1818639 1 0.5847 0.3069 0.560 0.036 0.404 0.000
#> SRR1818640 1 0.5784 0.2908 0.556 0.032 0.412 0.000
#> SRR1818637 4 0.1388 0.7076 0.000 0.012 0.028 0.960
#> SRR1818638 4 0.1388 0.7076 0.000 0.012 0.028 0.960
#> SRR1818635 2 0.4643 0.6766 0.012 0.788 0.028 0.172
#> SRR1818636 2 0.4715 0.6760 0.016 0.788 0.028 0.168
#> SRR1818643 2 0.8006 0.4348 0.060 0.556 0.132 0.252
#> SRR1818644 2 0.7787 0.4515 0.052 0.572 0.124 0.252
#> SRR1818641 2 0.2528 0.6910 0.004 0.908 0.008 0.080
#> SRR1818642 2 0.2597 0.6910 0.004 0.904 0.008 0.084
#> SRR1818633 4 0.8116 0.1688 0.156 0.040 0.300 0.504
#> SRR1818634 4 0.8019 0.1426 0.144 0.036 0.324 0.496
#> SRR1818665 1 0.5231 0.5073 0.676 0.028 0.296 0.000
#> SRR1818666 1 0.5207 0.5095 0.680 0.028 0.292 0.000
#> SRR1818667 4 0.4155 0.5745 0.000 0.240 0.004 0.756
#> SRR1818668 4 0.4313 0.5552 0.000 0.260 0.004 0.736
#> SRR1818669 1 0.4837 0.4968 0.648 0.004 0.348 0.000
#> SRR1818670 1 0.4973 0.4913 0.644 0.008 0.348 0.000
#> SRR1818663 1 0.0592 0.5959 0.984 0.016 0.000 0.000
#> SRR1818664 1 0.0592 0.5959 0.984 0.016 0.000 0.000
#> SRR1818629 4 0.4722 0.4913 0.000 0.300 0.008 0.692
#> SRR1818630 4 0.4697 0.4986 0.000 0.296 0.008 0.696
#> SRR1818627 1 0.5384 0.4805 0.648 0.028 0.324 0.000
#> SRR1818628 1 0.5364 0.4840 0.652 0.028 0.320 0.000
#> SRR1818621 3 0.4927 0.6323 0.264 0.000 0.712 0.024
#> SRR1818622 3 0.4927 0.6323 0.264 0.000 0.712 0.024
#> SRR1818625 1 0.0592 0.5959 0.984 0.016 0.000 0.000
#> SRR1818626 1 0.0592 0.5959 0.984 0.016 0.000 0.000
#> SRR1818623 4 0.2313 0.6992 0.000 0.044 0.032 0.924
#> SRR1818624 4 0.2313 0.6992 0.000 0.044 0.032 0.924
#> SRR1818619 1 0.5256 0.5381 0.692 0.036 0.272 0.000
#> SRR1818620 1 0.5256 0.5381 0.692 0.036 0.272 0.000
#> SRR1818617 2 0.6721 0.2310 0.004 0.476 0.076 0.444
#> SRR1818618 4 0.6825 -0.2477 0.004 0.448 0.084 0.464
#> SRR1818615 4 0.4594 0.5016 0.000 0.280 0.008 0.712
#> SRR1818616 4 0.4673 0.4784 0.000 0.292 0.008 0.700
#> SRR1818609 4 0.0895 0.7201 0.000 0.020 0.004 0.976
#> SRR1818610 4 0.0895 0.7201 0.000 0.020 0.004 0.976
#> SRR1818607 2 0.4730 0.5056 0.000 0.636 0.000 0.364
#> SRR1818608 2 0.4730 0.5056 0.000 0.636 0.000 0.364
#> SRR1818613 1 0.4792 0.4222 0.680 0.008 0.312 0.000
#> SRR1818614 1 0.4792 0.4222 0.680 0.008 0.312 0.000
#> SRR1818611 1 0.5579 0.4741 0.688 0.060 0.252 0.000
#> SRR1818612 1 0.5579 0.4741 0.688 0.060 0.252 0.000
#> SRR1818605 3 0.5982 0.5435 0.392 0.024 0.572 0.012
#> SRR1818606 3 0.5970 0.5483 0.388 0.024 0.576 0.012
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 5 0.692 -0.3032 0.240 0.008 0.344 0.000 0.408
#> SRR1818632 5 0.693 -0.3096 0.244 0.008 0.344 0.000 0.404
#> SRR1818679 2 0.575 0.5849 0.008 0.644 0.268 0.056 0.024
#> SRR1818680 2 0.575 0.5849 0.008 0.644 0.268 0.056 0.024
#> SRR1818677 2 0.936 0.3620 0.104 0.312 0.288 0.100 0.196
#> SRR1818678 2 0.938 0.3806 0.092 0.316 0.280 0.116 0.196
#> SRR1818675 4 0.754 -0.2389 0.116 0.004 0.396 0.400 0.084
#> SRR1818676 3 0.765 0.1432 0.132 0.004 0.408 0.372 0.084
#> SRR1818673 2 0.311 0.5452 0.000 0.860 0.000 0.080 0.060
#> SRR1818674 2 0.311 0.5452 0.000 0.860 0.000 0.080 0.060
#> SRR1818671 4 0.230 0.6553 0.004 0.020 0.068 0.908 0.000
#> SRR1818672 4 0.230 0.6553 0.004 0.020 0.068 0.908 0.000
#> SRR1818661 3 0.655 0.6624 0.096 0.004 0.544 0.032 0.324
#> SRR1818662 3 0.653 0.6596 0.092 0.004 0.540 0.032 0.332
#> SRR1818655 5 0.772 0.3010 0.244 0.088 0.208 0.000 0.460
#> SRR1818656 5 0.767 0.2910 0.264 0.084 0.192 0.000 0.460
#> SRR1818653 5 0.660 -0.3927 0.188 0.004 0.356 0.000 0.452
#> SRR1818654 5 0.655 -0.4029 0.176 0.004 0.364 0.000 0.456
#> SRR1818651 5 0.622 0.1260 0.396 0.004 0.124 0.000 0.476
#> SRR1818652 5 0.622 0.1279 0.392 0.004 0.124 0.000 0.480
#> SRR1818657 1 0.125 0.5916 0.956 0.000 0.008 0.000 0.036
#> SRR1818658 1 0.125 0.5916 0.956 0.000 0.008 0.000 0.036
#> SRR1818649 5 0.514 0.2821 0.188 0.064 0.028 0.000 0.720
#> SRR1818650 5 0.522 0.2784 0.188 0.064 0.032 0.000 0.716
#> SRR1818659 1 0.532 0.3840 0.636 0.000 0.088 0.000 0.276
#> SRR1818647 4 0.140 0.6636 0.000 0.028 0.020 0.952 0.000
#> SRR1818648 4 0.140 0.6636 0.000 0.028 0.020 0.952 0.000
#> SRR1818645 2 0.674 0.3945 0.000 0.456 0.244 0.296 0.004
#> SRR1818646 2 0.674 0.3945 0.000 0.456 0.244 0.296 0.004
#> SRR1818639 5 0.641 0.3424 0.296 0.016 0.140 0.000 0.548
#> SRR1818640 5 0.643 0.3395 0.284 0.016 0.148 0.000 0.552
#> SRR1818637 4 0.152 0.6569 0.000 0.004 0.048 0.944 0.004
#> SRR1818638 4 0.152 0.6569 0.000 0.004 0.048 0.944 0.004
#> SRR1818635 2 0.311 0.5452 0.000 0.860 0.000 0.080 0.060
#> SRR1818636 2 0.311 0.5452 0.000 0.860 0.000 0.080 0.060
#> SRR1818643 2 0.711 0.3695 0.012 0.580 0.216 0.120 0.072
#> SRR1818644 2 0.703 0.3748 0.012 0.588 0.212 0.120 0.068
#> SRR1818641 2 0.522 0.5915 0.000 0.680 0.248 0.052 0.020
#> SRR1818642 2 0.522 0.5915 0.000 0.680 0.248 0.052 0.020
#> SRR1818633 4 0.801 0.1227 0.288 0.012 0.280 0.368 0.052
#> SRR1818634 4 0.802 0.1641 0.280 0.016 0.272 0.384 0.048
#> SRR1818665 1 0.297 0.5958 0.868 0.000 0.052 0.000 0.080
#> SRR1818666 1 0.297 0.5958 0.868 0.000 0.052 0.000 0.080
#> SRR1818667 4 0.568 0.4894 0.000 0.216 0.140 0.640 0.004
#> SRR1818668 4 0.576 0.4772 0.000 0.228 0.140 0.628 0.004
#> SRR1818669 1 0.587 -0.0541 0.476 0.004 0.084 0.000 0.436
#> SRR1818670 1 0.583 -0.0217 0.484 0.004 0.080 0.000 0.432
#> SRR1818663 1 0.514 0.3820 0.528 0.008 0.024 0.000 0.440
#> SRR1818664 1 0.514 0.3723 0.520 0.008 0.024 0.000 0.448
#> SRR1818629 4 0.616 0.4250 0.008 0.300 0.116 0.572 0.004
#> SRR1818630 4 0.618 0.4260 0.008 0.296 0.120 0.572 0.004
#> SRR1818627 1 0.348 0.5699 0.836 0.000 0.080 0.000 0.084
#> SRR1818628 1 0.336 0.5701 0.844 0.000 0.076 0.000 0.080
#> SRR1818621 3 0.610 0.6245 0.096 0.000 0.472 0.008 0.424
#> SRR1818622 3 0.610 0.6245 0.096 0.000 0.472 0.008 0.424
#> SRR1818625 1 0.521 0.3772 0.524 0.008 0.028 0.000 0.440
#> SRR1818626 1 0.514 0.3723 0.520 0.008 0.024 0.000 0.448
#> SRR1818623 4 0.288 0.6397 0.000 0.032 0.080 0.880 0.008
#> SRR1818624 4 0.288 0.6397 0.000 0.032 0.080 0.880 0.008
#> SRR1818619 1 0.157 0.5781 0.944 0.000 0.020 0.000 0.036
#> SRR1818620 1 0.147 0.5812 0.948 0.000 0.016 0.000 0.036
#> SRR1818617 2 0.841 0.2127 0.008 0.328 0.248 0.308 0.108
#> SRR1818618 4 0.848 -0.2405 0.012 0.308 0.240 0.332 0.108
#> SRR1818615 4 0.552 0.4082 0.000 0.308 0.092 0.600 0.000
#> SRR1818616 4 0.558 0.3930 0.000 0.312 0.096 0.592 0.000
#> SRR1818609 4 0.104 0.6641 0.000 0.032 0.004 0.964 0.000
#> SRR1818610 4 0.104 0.6641 0.000 0.032 0.004 0.964 0.000
#> SRR1818607 2 0.675 0.3937 0.000 0.452 0.248 0.296 0.004
#> SRR1818608 2 0.676 0.3986 0.000 0.452 0.252 0.292 0.004
#> SRR1818613 5 0.620 0.0973 0.412 0.004 0.120 0.000 0.464
#> SRR1818614 5 0.620 0.1065 0.408 0.004 0.120 0.000 0.468
#> SRR1818611 5 0.514 0.2820 0.188 0.064 0.028 0.000 0.720
#> SRR1818612 5 0.508 0.2831 0.188 0.060 0.028 0.000 0.724
#> SRR1818605 3 0.683 0.5878 0.124 0.036 0.476 0.000 0.364
#> SRR1818606 3 0.675 0.5874 0.120 0.032 0.472 0.000 0.376
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 5 0.6704 0.4365 0.180 0.024 0.084 0.004 0.584 0.124
#> SRR1818632 5 0.6759 0.4304 0.188 0.020 0.088 0.004 0.572 0.128
#> SRR1818679 2 0.2207 0.4111 0.008 0.920 0.032 0.020 0.008 0.012
#> SRR1818680 2 0.2264 0.4072 0.008 0.916 0.040 0.016 0.008 0.012
#> SRR1818677 2 0.8645 0.1968 0.052 0.396 0.228 0.056 0.100 0.168
#> SRR1818678 2 0.8689 0.2000 0.056 0.400 0.208 0.068 0.084 0.184
#> SRR1818675 4 0.7037 0.1658 0.092 0.000 0.116 0.448 0.328 0.016
#> SRR1818676 4 0.6999 0.1798 0.092 0.000 0.112 0.456 0.324 0.016
#> SRR1818673 2 0.5763 -0.2587 0.000 0.460 0.428 0.032 0.000 0.080
#> SRR1818674 2 0.5763 -0.2587 0.000 0.460 0.428 0.032 0.000 0.080
#> SRR1818671 4 0.4750 0.5889 0.000 0.032 0.116 0.760 0.040 0.052
#> SRR1818672 4 0.4673 0.5908 0.000 0.036 0.108 0.768 0.040 0.048
#> SRR1818661 5 0.3247 0.5040 0.044 0.000 0.028 0.056 0.860 0.012
#> SRR1818662 5 0.3298 0.5051 0.052 0.000 0.024 0.056 0.856 0.012
#> SRR1818655 6 0.8680 0.2907 0.132 0.156 0.164 0.000 0.228 0.320
#> SRR1818656 6 0.8631 0.2977 0.132 0.152 0.160 0.000 0.220 0.336
#> SRR1818653 5 0.5166 0.4595 0.120 0.000 0.044 0.000 0.692 0.144
#> SRR1818654 5 0.5222 0.4502 0.116 0.000 0.048 0.000 0.688 0.148
#> SRR1818651 5 0.7160 0.3001 0.316 0.000 0.088 0.000 0.368 0.228
#> SRR1818652 5 0.7173 0.3065 0.308 0.000 0.088 0.000 0.368 0.236
#> SRR1818657 1 0.2078 0.5905 0.916 0.000 0.040 0.000 0.012 0.032
#> SRR1818658 1 0.2002 0.5922 0.920 0.000 0.040 0.000 0.012 0.028
#> SRR1818649 6 0.3651 0.6853 0.064 0.016 0.008 0.000 0.088 0.824
#> SRR1818650 6 0.3502 0.6861 0.060 0.012 0.008 0.000 0.088 0.832
#> SRR1818659 1 0.5716 0.4223 0.592 0.004 0.012 0.000 0.192 0.200
#> SRR1818647 4 0.1180 0.6283 0.000 0.008 0.024 0.960 0.004 0.004
#> SRR1818648 4 0.1096 0.6292 0.000 0.008 0.020 0.964 0.004 0.004
#> SRR1818645 2 0.5616 0.4003 0.000 0.620 0.128 0.224 0.004 0.024
#> SRR1818646 2 0.5625 0.3969 0.000 0.616 0.124 0.232 0.004 0.024
#> SRR1818639 5 0.7537 0.1674 0.164 0.028 0.108 0.000 0.436 0.264
#> SRR1818640 5 0.7494 0.1461 0.160 0.024 0.108 0.000 0.428 0.280
#> SRR1818637 4 0.2434 0.6127 0.000 0.004 0.044 0.900 0.040 0.012
#> SRR1818638 4 0.2547 0.6120 0.000 0.008 0.044 0.896 0.040 0.012
#> SRR1818635 2 0.5763 -0.2587 0.000 0.460 0.428 0.032 0.000 0.080
#> SRR1818636 2 0.5763 -0.2587 0.000 0.460 0.428 0.032 0.000 0.080
#> SRR1818643 3 0.7109 0.9800 0.016 0.184 0.568 0.036 0.100 0.096
#> SRR1818644 3 0.7140 0.9799 0.016 0.192 0.564 0.040 0.096 0.092
#> SRR1818641 2 0.0943 0.4098 0.004 0.972 0.012 0.004 0.004 0.004
#> SRR1818642 2 0.0955 0.4125 0.004 0.972 0.008 0.008 0.004 0.004
#> SRR1818633 4 0.9124 0.1775 0.204 0.024 0.188 0.304 0.168 0.112
#> SRR1818634 4 0.9090 0.1798 0.200 0.020 0.176 0.308 0.176 0.120
#> SRR1818665 1 0.3462 0.6034 0.840 0.004 0.032 0.000 0.048 0.076
#> SRR1818666 1 0.3462 0.6034 0.840 0.004 0.032 0.000 0.048 0.076
#> SRR1818667 4 0.6527 0.4640 0.000 0.216 0.204 0.532 0.020 0.028
#> SRR1818668 4 0.6681 0.4419 0.000 0.232 0.220 0.500 0.020 0.028
#> SRR1818669 1 0.7455 -0.1214 0.344 0.012 0.080 0.000 0.292 0.272
#> SRR1818670 1 0.7429 -0.0836 0.364 0.012 0.080 0.000 0.280 0.264
#> SRR1818663 1 0.5645 0.3516 0.496 0.000 0.040 0.000 0.060 0.404
#> SRR1818664 1 0.5645 0.3516 0.496 0.000 0.040 0.000 0.060 0.404
#> SRR1818629 4 0.7053 0.3145 0.000 0.260 0.288 0.400 0.020 0.032
#> SRR1818630 4 0.6933 0.3535 0.000 0.244 0.280 0.428 0.020 0.028
#> SRR1818627 1 0.3698 0.5951 0.824 0.004 0.032 0.000 0.060 0.080
#> SRR1818628 1 0.3639 0.5975 0.828 0.004 0.032 0.000 0.056 0.080
#> SRR1818621 5 0.3318 0.5200 0.048 0.000 0.008 0.008 0.840 0.096
#> SRR1818622 5 0.3318 0.5200 0.048 0.000 0.008 0.008 0.840 0.096
#> SRR1818625 1 0.5700 0.3304 0.484 0.000 0.040 0.000 0.064 0.412
#> SRR1818626 1 0.5645 0.3516 0.496 0.000 0.040 0.000 0.060 0.404
#> SRR1818623 4 0.3258 0.6133 0.000 0.020 0.040 0.860 0.060 0.020
#> SRR1818624 4 0.3184 0.6139 0.000 0.016 0.036 0.864 0.060 0.024
#> SRR1818619 1 0.2357 0.5847 0.904 0.004 0.048 0.000 0.012 0.032
#> SRR1818620 1 0.2430 0.5837 0.900 0.004 0.048 0.000 0.012 0.036
#> SRR1818617 2 0.8157 0.2195 0.008 0.392 0.232 0.136 0.040 0.192
#> SRR1818618 2 0.8413 0.1964 0.008 0.352 0.232 0.168 0.048 0.192
#> SRR1818615 4 0.6389 0.3826 0.000 0.212 0.284 0.480 0.012 0.012
#> SRR1818616 4 0.6561 0.3506 0.000 0.232 0.288 0.452 0.016 0.012
#> SRR1818609 4 0.0951 0.6298 0.000 0.008 0.020 0.968 0.000 0.004
#> SRR1818610 4 0.0951 0.6298 0.000 0.008 0.020 0.968 0.000 0.004
#> SRR1818607 2 0.5603 0.3998 0.000 0.620 0.124 0.228 0.004 0.024
#> SRR1818608 2 0.5580 0.4018 0.000 0.624 0.124 0.224 0.004 0.024
#> SRR1818613 5 0.7140 0.2522 0.340 0.000 0.084 0.000 0.348 0.228
#> SRR1818614 5 0.7139 0.2636 0.336 0.000 0.084 0.000 0.352 0.228
#> SRR1818611 6 0.3492 0.6861 0.056 0.012 0.008 0.000 0.092 0.832
#> SRR1818612 6 0.3492 0.6861 0.056 0.012 0.008 0.000 0.092 0.832
#> SRR1818605 5 0.6027 0.4355 0.104 0.000 0.180 0.000 0.612 0.104
#> SRR1818606 5 0.6024 0.4310 0.112 0.000 0.180 0.000 0.612 0.096
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 15216 rows and 75 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 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.883 0.918 0.963 0.4841 0.508 0.508
#> 3 3 0.771 0.775 0.885 0.1630 0.910 0.826
#> 4 4 0.719 0.813 0.899 0.1025 0.935 0.853
#> 5 5 0.632 0.614 0.835 0.1039 0.959 0.894
#> 6 6 0.575 0.663 0.819 0.0681 0.931 0.807
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
#> SRR1818631 1 0.0000 0.9791 1.000 0.000
#> SRR1818632 1 0.0000 0.9791 1.000 0.000
#> SRR1818679 2 0.1843 0.9257 0.028 0.972
#> SRR1818680 2 0.0376 0.9337 0.004 0.996
#> SRR1818677 1 0.0938 0.9693 0.988 0.012
#> SRR1818678 1 0.4939 0.8696 0.892 0.108
#> SRR1818675 1 0.0000 0.9791 1.000 0.000
#> SRR1818676 1 0.0000 0.9791 1.000 0.000
#> SRR1818673 2 0.2948 0.9134 0.052 0.948
#> SRR1818674 2 0.4022 0.8930 0.080 0.920
#> SRR1818671 2 0.0000 0.9342 0.000 1.000
#> SRR1818672 2 0.0000 0.9342 0.000 1.000
#> SRR1818661 1 0.0000 0.9791 1.000 0.000
#> SRR1818662 1 0.0000 0.9791 1.000 0.000
#> SRR1818655 1 0.3431 0.9214 0.936 0.064
#> SRR1818656 1 0.3431 0.9214 0.936 0.064
#> SRR1818653 1 0.0000 0.9791 1.000 0.000
#> SRR1818654 1 0.0000 0.9791 1.000 0.000
#> SRR1818651 1 0.0000 0.9791 1.000 0.000
#> SRR1818652 1 0.0000 0.9791 1.000 0.000
#> SRR1818657 1 0.0000 0.9791 1.000 0.000
#> SRR1818658 1 0.0000 0.9791 1.000 0.000
#> SRR1818649 1 0.0000 0.9791 1.000 0.000
#> SRR1818650 1 0.0376 0.9759 0.996 0.004
#> SRR1818659 1 0.0000 0.9791 1.000 0.000
#> SRR1818647 2 0.0672 0.9329 0.008 0.992
#> SRR1818648 2 0.0672 0.9325 0.008 0.992
#> SRR1818645 2 0.0000 0.9342 0.000 1.000
#> SRR1818646 2 0.0000 0.9342 0.000 1.000
#> SRR1818639 1 0.0000 0.9791 1.000 0.000
#> SRR1818640 1 0.0000 0.9791 1.000 0.000
#> SRR1818637 2 0.0000 0.9342 0.000 1.000
#> SRR1818638 2 0.0000 0.9342 0.000 1.000
#> SRR1818635 2 0.8909 0.5982 0.308 0.692
#> SRR1818636 2 0.8955 0.5915 0.312 0.688
#> SRR1818643 1 0.9850 0.1512 0.572 0.428
#> SRR1818644 2 1.0000 0.0926 0.496 0.504
#> SRR1818641 2 0.0376 0.9336 0.004 0.996
#> SRR1818642 2 0.0000 0.9342 0.000 1.000
#> SRR1818633 1 0.2423 0.9443 0.960 0.040
#> SRR1818634 1 0.4815 0.8766 0.896 0.104
#> SRR1818665 1 0.0000 0.9791 1.000 0.000
#> SRR1818666 1 0.0000 0.9791 1.000 0.000
#> SRR1818667 2 0.0000 0.9342 0.000 1.000
#> SRR1818668 2 0.0000 0.9342 0.000 1.000
#> SRR1818669 1 0.0000 0.9791 1.000 0.000
#> SRR1818670 1 0.0000 0.9791 1.000 0.000
#> SRR1818663 1 0.0000 0.9791 1.000 0.000
#> SRR1818664 1 0.0000 0.9791 1.000 0.000
#> SRR1818629 2 0.2043 0.9239 0.032 0.968
#> SRR1818630 2 0.2948 0.9139 0.052 0.948
#> SRR1818627 1 0.0000 0.9791 1.000 0.000
#> SRR1818628 1 0.0000 0.9791 1.000 0.000
#> SRR1818621 1 0.0000 0.9791 1.000 0.000
#> SRR1818622 1 0.0000 0.9791 1.000 0.000
#> SRR1818625 1 0.0000 0.9791 1.000 0.000
#> SRR1818626 1 0.0000 0.9791 1.000 0.000
#> SRR1818623 2 0.7139 0.7678 0.196 0.804
#> SRR1818624 2 0.4298 0.8837 0.088 0.912
#> SRR1818619 1 0.0000 0.9791 1.000 0.000
#> SRR1818620 1 0.0000 0.9791 1.000 0.000
#> SRR1818617 2 0.3274 0.9089 0.060 0.940
#> SRR1818618 2 0.6973 0.7811 0.188 0.812
#> SRR1818615 2 0.0000 0.9342 0.000 1.000
#> SRR1818616 2 0.0000 0.9342 0.000 1.000
#> SRR1818609 2 0.0000 0.9342 0.000 1.000
#> SRR1818610 2 0.0000 0.9342 0.000 1.000
#> SRR1818607 2 0.0000 0.9342 0.000 1.000
#> SRR1818608 2 0.0000 0.9342 0.000 1.000
#> SRR1818613 1 0.0000 0.9791 1.000 0.000
#> SRR1818614 1 0.0000 0.9791 1.000 0.000
#> SRR1818611 1 0.0000 0.9791 1.000 0.000
#> SRR1818612 1 0.0000 0.9791 1.000 0.000
#> SRR1818605 1 0.0000 0.9791 1.000 0.000
#> SRR1818606 1 0.0000 0.9791 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.0237 0.981 0.996 0.000 0.004
#> SRR1818632 1 0.0237 0.981 0.996 0.000 0.004
#> SRR1818679 2 0.5508 0.620 0.028 0.784 0.188
#> SRR1818680 2 0.3272 0.617 0.004 0.892 0.104
#> SRR1818677 1 0.0747 0.972 0.984 0.016 0.000
#> SRR1818678 1 0.3791 0.883 0.892 0.060 0.048
#> SRR1818675 1 0.2261 0.933 0.932 0.000 0.068
#> SRR1818676 1 0.2261 0.933 0.932 0.000 0.068
#> SRR1818673 2 0.1411 0.582 0.036 0.964 0.000
#> SRR1818674 2 0.1860 0.573 0.052 0.948 0.000
#> SRR1818671 3 0.6244 -0.115 0.000 0.440 0.560
#> SRR1818672 2 0.6267 0.337 0.000 0.548 0.452
#> SRR1818661 1 0.2066 0.937 0.940 0.000 0.060
#> SRR1818662 1 0.2066 0.937 0.940 0.000 0.060
#> SRR1818655 1 0.2569 0.930 0.936 0.032 0.032
#> SRR1818656 1 0.2569 0.930 0.936 0.032 0.032
#> SRR1818653 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818654 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818651 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818652 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818657 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818649 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818650 1 0.0237 0.981 0.996 0.004 0.000
#> SRR1818659 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818647 3 0.3816 0.755 0.000 0.148 0.852
#> SRR1818648 3 0.4452 0.727 0.000 0.192 0.808
#> SRR1818645 2 0.5733 0.559 0.000 0.676 0.324
#> SRR1818646 2 0.5678 0.564 0.000 0.684 0.316
#> SRR1818639 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818640 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818637 3 0.0237 0.748 0.000 0.004 0.996
#> SRR1818638 3 0.0237 0.748 0.000 0.004 0.996
#> SRR1818635 2 0.5098 0.391 0.248 0.752 0.000
#> SRR1818636 2 0.5178 0.382 0.256 0.744 0.000
#> SRR1818643 2 0.5733 0.309 0.324 0.676 0.000
#> SRR1818644 2 0.5431 0.351 0.284 0.716 0.000
#> SRR1818641 2 0.2796 0.617 0.000 0.908 0.092
#> SRR1818642 2 0.5016 0.600 0.000 0.760 0.240
#> SRR1818633 1 0.1877 0.949 0.956 0.012 0.032
#> SRR1818634 1 0.3481 0.896 0.904 0.052 0.044
#> SRR1818665 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818666 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818667 2 0.6126 0.470 0.000 0.600 0.400
#> SRR1818668 2 0.6126 0.467 0.000 0.600 0.400
#> SRR1818669 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818670 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818663 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818664 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818629 2 0.5269 0.610 0.016 0.784 0.200
#> SRR1818630 2 0.4636 0.613 0.044 0.852 0.104
#> SRR1818627 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818628 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818621 1 0.0237 0.981 0.996 0.000 0.004
#> SRR1818622 1 0.0237 0.981 0.996 0.000 0.004
#> SRR1818625 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818623 2 0.7145 -0.191 0.024 0.536 0.440
#> SRR1818624 3 0.6950 0.332 0.020 0.408 0.572
#> SRR1818619 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818620 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818617 2 0.7425 0.518 0.052 0.620 0.328
#> SRR1818618 2 0.8882 0.374 0.144 0.540 0.316
#> SRR1818615 2 0.0747 0.591 0.000 0.984 0.016
#> SRR1818616 2 0.1289 0.600 0.000 0.968 0.032
#> SRR1818609 3 0.3941 0.750 0.000 0.156 0.844
#> SRR1818610 3 0.2537 0.752 0.000 0.080 0.920
#> SRR1818607 2 0.5733 0.559 0.000 0.676 0.324
#> SRR1818608 2 0.5733 0.559 0.000 0.676 0.324
#> SRR1818613 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818614 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818611 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818612 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818605 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1818606 1 0.0000 0.983 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 1 0.0592 0.9537 0.984 0.000 0.000 0.016
#> SRR1818632 1 0.0592 0.9537 0.984 0.000 0.000 0.016
#> SRR1818679 2 0.5337 0.0754 0.012 0.564 0.424 0.000
#> SRR1818680 3 0.4632 0.5839 0.004 0.308 0.688 0.000
#> SRR1818677 1 0.0657 0.9525 0.984 0.004 0.012 0.000
#> SRR1818678 1 0.2867 0.8684 0.884 0.104 0.012 0.000
#> SRR1818675 1 0.2401 0.9028 0.904 0.000 0.004 0.092
#> SRR1818676 1 0.2266 0.9070 0.912 0.000 0.004 0.084
#> SRR1818673 3 0.2760 0.7280 0.000 0.128 0.872 0.000
#> SRR1818674 3 0.2760 0.7280 0.000 0.128 0.872 0.000
#> SRR1818671 2 0.2882 0.7810 0.000 0.892 0.024 0.084
#> SRR1818672 2 0.2675 0.7932 0.000 0.908 0.048 0.044
#> SRR1818661 1 0.0921 0.9500 0.972 0.000 0.000 0.028
#> SRR1818662 1 0.0921 0.9500 0.972 0.000 0.000 0.028
#> SRR1818655 1 0.1004 0.9461 0.972 0.024 0.004 0.000
#> SRR1818656 1 0.1004 0.9461 0.972 0.024 0.004 0.000
#> SRR1818653 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818654 1 0.0188 0.9553 0.996 0.000 0.000 0.004
#> SRR1818651 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818658 1 0.1637 0.9402 0.940 0.000 0.060 0.000
#> SRR1818649 1 0.2011 0.9308 0.920 0.000 0.080 0.000
#> SRR1818650 1 0.2589 0.9109 0.884 0.000 0.116 0.000
#> SRR1818659 1 0.2704 0.9046 0.876 0.000 0.124 0.000
#> SRR1818647 4 0.1824 0.8234 0.000 0.060 0.004 0.936
#> SRR1818648 4 0.2048 0.8224 0.000 0.064 0.008 0.928
#> SRR1818645 2 0.0000 0.8153 0.000 1.000 0.000 0.000
#> SRR1818646 2 0.0000 0.8153 0.000 1.000 0.000 0.000
#> SRR1818639 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818640 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818637 4 0.0592 0.8156 0.000 0.016 0.000 0.984
#> SRR1818638 4 0.0592 0.8156 0.000 0.016 0.000 0.984
#> SRR1818635 3 0.2805 0.7019 0.100 0.012 0.888 0.000
#> SRR1818636 3 0.2918 0.6942 0.116 0.008 0.876 0.000
#> SRR1818643 3 0.4164 0.5237 0.264 0.000 0.736 0.000
#> SRR1818644 3 0.3725 0.6394 0.180 0.008 0.812 0.000
#> SRR1818641 3 0.3837 0.6768 0.000 0.224 0.776 0.000
#> SRR1818642 2 0.4356 0.4936 0.000 0.708 0.292 0.000
#> SRR1818633 1 0.0817 0.9479 0.976 0.024 0.000 0.000
#> SRR1818634 1 0.1847 0.9267 0.940 0.052 0.004 0.004
#> SRR1818665 1 0.2760 0.9019 0.872 0.000 0.128 0.000
#> SRR1818666 1 0.2760 0.9019 0.872 0.000 0.128 0.000
#> SRR1818667 2 0.2021 0.7981 0.000 0.932 0.056 0.012
#> SRR1818668 2 0.0188 0.8145 0.000 0.996 0.004 0.000
#> SRR1818669 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818670 1 0.0336 0.9557 0.992 0.000 0.008 0.000
#> SRR1818663 1 0.2530 0.9127 0.888 0.000 0.112 0.000
#> SRR1818664 1 0.2530 0.9127 0.888 0.000 0.112 0.000
#> SRR1818629 3 0.5168 0.0997 0.004 0.492 0.504 0.000
#> SRR1818630 3 0.5827 0.3830 0.036 0.396 0.568 0.000
#> SRR1818627 1 0.2408 0.9193 0.896 0.000 0.104 0.000
#> SRR1818628 1 0.2149 0.9281 0.912 0.000 0.088 0.000
#> SRR1818621 1 0.0592 0.9537 0.984 0.000 0.000 0.016
#> SRR1818622 1 0.0592 0.9537 0.984 0.000 0.000 0.016
#> SRR1818625 1 0.2530 0.9127 0.888 0.000 0.112 0.000
#> SRR1818626 1 0.2530 0.9127 0.888 0.000 0.112 0.000
#> SRR1818623 4 0.6027 0.0682 0.004 0.032 0.472 0.492
#> SRR1818624 4 0.5311 0.4519 0.000 0.024 0.328 0.648
#> SRR1818619 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818620 1 0.0921 0.9515 0.972 0.000 0.028 0.000
#> SRR1818617 2 0.5052 0.5693 0.036 0.720 0.244 0.000
#> SRR1818618 2 0.6787 0.4318 0.124 0.632 0.232 0.012
#> SRR1818615 3 0.3311 0.7210 0.000 0.172 0.828 0.000
#> SRR1818616 3 0.3610 0.7074 0.000 0.200 0.800 0.000
#> SRR1818609 4 0.2473 0.8171 0.000 0.080 0.012 0.908
#> SRR1818610 4 0.2281 0.8084 0.000 0.096 0.000 0.904
#> SRR1818607 2 0.0000 0.8153 0.000 1.000 0.000 0.000
#> SRR1818608 2 0.0000 0.8153 0.000 1.000 0.000 0.000
#> SRR1818613 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818611 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818612 1 0.0188 0.9557 0.996 0.000 0.004 0.000
#> SRR1818605 1 0.0000 0.9556 1.000 0.000 0.000 0.000
#> SRR1818606 1 0.0188 0.9554 0.996 0.000 0.000 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 1 0.2112 0.76772 0.908 0.000 0.004 0.004 0.084
#> SRR1818632 1 0.1365 0.79324 0.952 0.000 0.004 0.004 0.040
#> SRR1818679 2 0.5759 0.12739 0.008 0.476 0.452 0.000 0.064
#> SRR1818680 3 0.3421 0.60126 0.000 0.204 0.788 0.000 0.008
#> SRR1818677 1 0.0807 0.79976 0.976 0.000 0.012 0.000 0.012
#> SRR1818678 1 0.2217 0.77066 0.920 0.044 0.012 0.000 0.024
#> SRR1818675 1 0.5190 -0.01842 0.496 0.000 0.004 0.032 0.468
#> SRR1818676 1 0.4971 0.00755 0.512 0.000 0.000 0.028 0.460
#> SRR1818673 3 0.0162 0.76179 0.000 0.004 0.996 0.000 0.000
#> SRR1818674 3 0.0162 0.76179 0.000 0.004 0.996 0.000 0.000
#> SRR1818671 2 0.2674 0.74604 0.000 0.888 0.020 0.084 0.008
#> SRR1818672 2 0.2376 0.75615 0.000 0.904 0.052 0.044 0.000
#> SRR1818661 1 0.2833 0.71608 0.852 0.000 0.004 0.004 0.140
#> SRR1818662 1 0.2833 0.71608 0.852 0.000 0.004 0.004 0.140
#> SRR1818655 1 0.1914 0.76620 0.924 0.016 0.000 0.000 0.060
#> SRR1818656 1 0.1845 0.76767 0.928 0.016 0.000 0.000 0.056
#> SRR1818653 1 0.0794 0.80025 0.972 0.000 0.000 0.000 0.028
#> SRR1818654 1 0.1410 0.78565 0.940 0.000 0.000 0.000 0.060
#> SRR1818651 1 0.0000 0.79849 1.000 0.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.79849 1.000 0.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 0.79849 1.000 0.000 0.000 0.000 0.000
#> SRR1818658 1 0.2230 0.72467 0.884 0.000 0.000 0.000 0.116
#> SRR1818649 1 0.2929 0.67134 0.820 0.000 0.000 0.000 0.180
#> SRR1818650 1 0.3741 0.52387 0.732 0.000 0.004 0.000 0.264
#> SRR1818659 1 0.3857 0.36612 0.688 0.000 0.000 0.000 0.312
#> SRR1818647 4 0.0609 0.84667 0.000 0.020 0.000 0.980 0.000
#> SRR1818648 4 0.0794 0.84457 0.000 0.028 0.000 0.972 0.000
#> SRR1818645 2 0.0000 0.76973 0.000 1.000 0.000 0.000 0.000
#> SRR1818646 2 0.0000 0.76973 0.000 1.000 0.000 0.000 0.000
#> SRR1818639 1 0.0000 0.79849 1.000 0.000 0.000 0.000 0.000
#> SRR1818640 1 0.0000 0.79849 1.000 0.000 0.000 0.000 0.000
#> SRR1818637 4 0.2970 0.80489 0.000 0.004 0.000 0.828 0.168
#> SRR1818638 4 0.2970 0.80489 0.000 0.004 0.000 0.828 0.168
#> SRR1818635 3 0.0162 0.76200 0.004 0.000 0.996 0.000 0.000
#> SRR1818636 3 0.0162 0.76200 0.004 0.000 0.996 0.000 0.000
#> SRR1818643 3 0.4114 0.24131 0.376 0.000 0.624 0.000 0.000
#> SRR1818644 3 0.3210 0.56892 0.212 0.000 0.788 0.000 0.000
#> SRR1818641 3 0.3608 0.66638 0.000 0.112 0.824 0.000 0.064
#> SRR1818642 2 0.5204 0.34817 0.000 0.580 0.368 0.000 0.052
#> SRR1818633 1 0.1597 0.78174 0.940 0.012 0.000 0.000 0.048
#> SRR1818634 1 0.3194 0.70343 0.832 0.020 0.000 0.000 0.148
#> SRR1818665 5 0.4297 0.22704 0.472 0.000 0.000 0.000 0.528
#> SRR1818666 5 0.4297 0.22704 0.472 0.000 0.000 0.000 0.528
#> SRR1818667 2 0.3372 0.74151 0.000 0.840 0.036 0.004 0.120
#> SRR1818668 2 0.1478 0.76325 0.000 0.936 0.000 0.000 0.064
#> SRR1818669 1 0.0000 0.79849 1.000 0.000 0.000 0.000 0.000
#> SRR1818670 1 0.0404 0.79847 0.988 0.000 0.000 0.000 0.012
#> SRR1818663 1 0.3336 0.57770 0.772 0.000 0.000 0.000 0.228
#> SRR1818664 1 0.3336 0.57770 0.772 0.000 0.000 0.000 0.228
#> SRR1818629 2 0.6285 0.16386 0.008 0.444 0.432 0.000 0.116
#> SRR1818630 3 0.7442 -0.03543 0.084 0.340 0.448 0.000 0.128
#> SRR1818627 1 0.4291 -0.29838 0.536 0.000 0.000 0.000 0.464
#> SRR1818628 1 0.4291 -0.30003 0.536 0.000 0.000 0.000 0.464
#> SRR1818621 1 0.2833 0.71608 0.852 0.000 0.004 0.004 0.140
#> SRR1818622 1 0.2833 0.71608 0.852 0.000 0.004 0.004 0.140
#> SRR1818625 1 0.3366 0.57294 0.768 0.000 0.000 0.000 0.232
#> SRR1818626 1 0.3336 0.57770 0.772 0.000 0.000 0.000 0.228
#> SRR1818623 5 0.7279 -0.53812 0.000 0.020 0.324 0.296 0.360
#> SRR1818624 4 0.7130 0.29308 0.000 0.016 0.248 0.376 0.360
#> SRR1818619 1 0.0703 0.79583 0.976 0.000 0.000 0.000 0.024
#> SRR1818620 1 0.1270 0.78312 0.948 0.000 0.000 0.000 0.052
#> SRR1818617 2 0.6193 0.59777 0.092 0.668 0.132 0.000 0.108
#> SRR1818618 2 0.7225 0.44373 0.164 0.560 0.164 0.000 0.112
#> SRR1818615 3 0.1671 0.73890 0.000 0.076 0.924 0.000 0.000
#> SRR1818616 3 0.1732 0.73632 0.000 0.080 0.920 0.000 0.000
#> SRR1818609 4 0.0898 0.84540 0.000 0.020 0.008 0.972 0.000
#> SRR1818610 4 0.0880 0.84277 0.000 0.032 0.000 0.968 0.000
#> SRR1818607 2 0.0000 0.76973 0.000 1.000 0.000 0.000 0.000
#> SRR1818608 2 0.0000 0.76973 0.000 1.000 0.000 0.000 0.000
#> SRR1818613 1 0.0000 0.79849 1.000 0.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.79849 1.000 0.000 0.000 0.000 0.000
#> SRR1818611 1 0.0963 0.79438 0.964 0.000 0.000 0.000 0.036
#> SRR1818612 1 0.1197 0.79135 0.952 0.000 0.000 0.000 0.048
#> SRR1818605 1 0.0963 0.79913 0.964 0.000 0.000 0.000 0.036
#> SRR1818606 1 0.2074 0.75766 0.896 0.000 0.000 0.000 0.104
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 1 0.3531 0.5472 0.672 0.000 0.000 0.000 0.000 0.328
#> SRR1818632 1 0.2912 0.6808 0.784 0.000 0.000 0.000 0.000 0.216
#> SRR1818679 3 0.6206 -0.0806 0.000 0.416 0.420 0.000 0.036 0.128
#> SRR1818680 3 0.3773 0.6067 0.000 0.192 0.768 0.000 0.020 0.020
#> SRR1818677 1 0.0881 0.7976 0.972 0.000 0.012 0.000 0.008 0.008
#> SRR1818678 1 0.2508 0.7688 0.900 0.048 0.012 0.000 0.024 0.016
#> SRR1818675 6 0.5322 0.4881 0.188 0.000 0.000 0.000 0.216 0.596
#> SRR1818676 6 0.5680 0.3963 0.252 0.000 0.000 0.000 0.220 0.528
#> SRR1818673 3 0.0000 0.7238 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818674 3 0.0000 0.7238 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818671 2 0.2878 0.7282 0.000 0.860 0.024 0.100 0.000 0.016
#> SRR1818672 2 0.2376 0.7310 0.000 0.888 0.068 0.044 0.000 0.000
#> SRR1818661 1 0.3782 0.4115 0.588 0.000 0.000 0.000 0.000 0.412
#> SRR1818662 1 0.3782 0.4115 0.588 0.000 0.000 0.000 0.000 0.412
#> SRR1818655 1 0.2581 0.7150 0.860 0.000 0.000 0.000 0.020 0.120
#> SRR1818656 1 0.2581 0.7150 0.860 0.000 0.000 0.000 0.020 0.120
#> SRR1818653 1 0.0858 0.8001 0.968 0.000 0.000 0.000 0.004 0.028
#> SRR1818654 1 0.1765 0.7739 0.904 0.000 0.000 0.000 0.000 0.096
#> SRR1818651 1 0.0000 0.7990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.7990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 0.7990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818658 1 0.1765 0.7683 0.904 0.000 0.000 0.000 0.096 0.000
#> SRR1818649 1 0.3830 0.6371 0.744 0.000 0.000 0.000 0.212 0.044
#> SRR1818650 1 0.4294 0.5397 0.672 0.000 0.000 0.000 0.280 0.048
#> SRR1818659 1 0.3584 0.4708 0.688 0.000 0.000 0.000 0.308 0.004
#> SRR1818647 4 0.0000 0.8707 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818648 4 0.0000 0.8707 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818645 2 0.0000 0.7521 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818646 2 0.0000 0.7521 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818639 1 0.0000 0.7990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818640 1 0.0000 0.7990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818637 4 0.4392 0.6879 0.000 0.000 0.000 0.680 0.064 0.256
#> SRR1818638 4 0.4392 0.6879 0.000 0.000 0.000 0.680 0.064 0.256
#> SRR1818635 3 0.0000 0.7238 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818636 3 0.0000 0.7238 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818643 3 0.3592 0.2462 0.344 0.000 0.656 0.000 0.000 0.000
#> SRR1818644 3 0.2762 0.5136 0.196 0.000 0.804 0.000 0.000 0.000
#> SRR1818641 3 0.4576 0.6115 0.000 0.092 0.748 0.000 0.040 0.120
#> SRR1818642 2 0.6036 0.2130 0.000 0.516 0.332 0.000 0.040 0.112
#> SRR1818633 1 0.2009 0.7656 0.908 0.000 0.000 0.000 0.024 0.068
#> SRR1818634 1 0.3572 0.6560 0.764 0.000 0.000 0.000 0.032 0.204
#> SRR1818665 5 0.2941 0.9244 0.220 0.000 0.000 0.000 0.780 0.000
#> SRR1818666 5 0.2941 0.9244 0.220 0.000 0.000 0.000 0.780 0.000
#> SRR1818667 2 0.4582 0.6680 0.000 0.672 0.024 0.000 0.032 0.272
#> SRR1818668 2 0.2896 0.7221 0.000 0.824 0.000 0.000 0.016 0.160
#> SRR1818669 1 0.0000 0.7990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818670 1 0.0363 0.7995 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818663 1 0.2915 0.6958 0.808 0.000 0.000 0.000 0.184 0.008
#> SRR1818664 1 0.2915 0.6958 0.808 0.000 0.000 0.000 0.184 0.008
#> SRR1818629 2 0.6667 0.2328 0.000 0.384 0.316 0.000 0.032 0.268
#> SRR1818630 3 0.6948 -0.0516 0.024 0.312 0.412 0.000 0.024 0.228
#> SRR1818627 5 0.3288 0.9096 0.276 0.000 0.000 0.000 0.724 0.000
#> SRR1818628 5 0.3244 0.9208 0.268 0.000 0.000 0.000 0.732 0.000
#> SRR1818621 1 0.3782 0.4115 0.588 0.000 0.000 0.000 0.000 0.412
#> SRR1818622 1 0.4018 0.3984 0.580 0.000 0.000 0.000 0.008 0.412
#> SRR1818625 1 0.2948 0.6935 0.804 0.000 0.000 0.000 0.188 0.008
#> SRR1818626 1 0.2915 0.6958 0.808 0.000 0.000 0.000 0.184 0.008
#> SRR1818623 6 0.3023 0.5642 0.000 0.000 0.232 0.000 0.000 0.768
#> SRR1818624 6 0.3348 0.5762 0.000 0.000 0.216 0.016 0.000 0.768
#> SRR1818619 1 0.0632 0.7962 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR1818620 1 0.0713 0.7976 0.972 0.000 0.000 0.000 0.028 0.000
#> SRR1818617 2 0.6957 0.5470 0.080 0.580 0.116 0.000 0.076 0.148
#> SRR1818618 2 0.8198 0.3646 0.136 0.432 0.152 0.000 0.124 0.156
#> SRR1818615 3 0.1501 0.7177 0.000 0.076 0.924 0.000 0.000 0.000
#> SRR1818616 3 0.1610 0.7147 0.000 0.084 0.916 0.000 0.000 0.000
#> SRR1818609 4 0.0000 0.8707 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818610 4 0.0000 0.8707 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818607 2 0.0000 0.7521 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818608 2 0.0000 0.7521 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818613 1 0.0000 0.7990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.7990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818611 1 0.2679 0.7229 0.864 0.000 0.000 0.000 0.096 0.040
#> SRR1818612 1 0.2842 0.7172 0.852 0.000 0.000 0.000 0.104 0.044
#> SRR1818605 1 0.1327 0.7918 0.936 0.000 0.000 0.000 0.000 0.064
#> SRR1818606 1 0.2491 0.7265 0.836 0.000 0.000 0.000 0.000 0.164
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 15216 rows and 75 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.412 0.783 0.868 0.4488 0.501 0.501
#> 3 3 0.347 0.643 0.714 0.3691 0.743 0.551
#> 4 4 0.467 0.612 0.738 0.1346 0.880 0.709
#> 5 5 0.520 0.577 0.694 0.0826 0.920 0.767
#> 6 6 0.567 0.494 0.646 0.0679 0.842 0.480
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
#> SRR1818631 1 0.9833 0.380 0.576 0.424
#> SRR1818632 1 0.9635 0.485 0.612 0.388
#> SRR1818679 2 0.0672 0.857 0.008 0.992
#> SRR1818680 2 0.0672 0.857 0.008 0.992
#> SRR1818677 2 0.2043 0.863 0.032 0.968
#> SRR1818678 2 0.1633 0.863 0.024 0.976
#> SRR1818675 2 0.6148 0.825 0.152 0.848
#> SRR1818676 2 0.6148 0.825 0.152 0.848
#> SRR1818673 2 0.4022 0.891 0.080 0.920
#> SRR1818674 2 0.4022 0.891 0.080 0.920
#> SRR1818671 2 0.3879 0.891 0.076 0.924
#> SRR1818672 2 0.3879 0.891 0.076 0.924
#> SRR1818661 2 0.9833 0.225 0.424 0.576
#> SRR1818662 2 0.9833 0.225 0.424 0.576
#> SRR1818655 1 0.6973 0.814 0.812 0.188
#> SRR1818656 1 0.6712 0.826 0.824 0.176
#> SRR1818653 1 0.9393 0.563 0.644 0.356
#> SRR1818654 1 0.9286 0.588 0.656 0.344
#> SRR1818651 1 0.2236 0.849 0.964 0.036
#> SRR1818652 1 0.2236 0.849 0.964 0.036
#> SRR1818657 1 0.1184 0.839 0.984 0.016
#> SRR1818658 1 0.0938 0.837 0.988 0.012
#> SRR1818649 1 0.5946 0.844 0.856 0.144
#> SRR1818650 1 0.5946 0.844 0.856 0.144
#> SRR1818659 1 0.2603 0.852 0.956 0.044
#> SRR1818647 2 0.3879 0.891 0.076 0.924
#> SRR1818648 2 0.3879 0.891 0.076 0.924
#> SRR1818645 2 0.1184 0.849 0.016 0.984
#> SRR1818646 2 0.1184 0.849 0.016 0.984
#> SRR1818639 1 0.5408 0.853 0.876 0.124
#> SRR1818640 1 0.5629 0.851 0.868 0.132
#> SRR1818637 2 0.3879 0.891 0.076 0.924
#> SRR1818638 2 0.3879 0.891 0.076 0.924
#> SRR1818635 2 0.4022 0.891 0.080 0.920
#> SRR1818636 2 0.4022 0.891 0.080 0.920
#> SRR1818643 2 0.5737 0.846 0.136 0.864
#> SRR1818644 2 0.5408 0.857 0.124 0.876
#> SRR1818641 2 0.0672 0.856 0.008 0.992
#> SRR1818642 2 0.0672 0.856 0.008 0.992
#> SRR1818633 2 0.9286 0.482 0.344 0.656
#> SRR1818634 2 0.9286 0.481 0.344 0.656
#> SRR1818665 1 0.4431 0.850 0.908 0.092
#> SRR1818666 1 0.4431 0.850 0.908 0.092
#> SRR1818667 2 0.3879 0.891 0.076 0.924
#> SRR1818668 2 0.3879 0.891 0.076 0.924
#> SRR1818669 1 0.4690 0.854 0.900 0.100
#> SRR1818670 1 0.4562 0.854 0.904 0.096
#> SRR1818663 1 0.1184 0.840 0.984 0.016
#> SRR1818664 1 0.1184 0.840 0.984 0.016
#> SRR1818629 2 0.4022 0.891 0.080 0.920
#> SRR1818630 2 0.4022 0.891 0.080 0.920
#> SRR1818627 1 0.9522 0.516 0.628 0.372
#> SRR1818628 1 0.9954 0.246 0.540 0.460
#> SRR1818621 2 0.9833 0.225 0.424 0.576
#> SRR1818622 2 0.9833 0.225 0.424 0.576
#> SRR1818625 1 0.1184 0.840 0.984 0.016
#> SRR1818626 1 0.1184 0.840 0.984 0.016
#> SRR1818623 2 0.3879 0.891 0.076 0.924
#> SRR1818624 2 0.3879 0.891 0.076 0.924
#> SRR1818619 1 0.4815 0.852 0.896 0.104
#> SRR1818620 1 0.5178 0.846 0.884 0.116
#> SRR1818617 2 0.0938 0.854 0.012 0.988
#> SRR1818618 2 0.0672 0.856 0.008 0.992
#> SRR1818615 2 0.3879 0.891 0.076 0.924
#> SRR1818616 2 0.4022 0.891 0.080 0.920
#> SRR1818609 2 0.3879 0.891 0.076 0.924
#> SRR1818610 2 0.3879 0.891 0.076 0.924
#> SRR1818607 2 0.1184 0.855 0.016 0.984
#> SRR1818608 2 0.1184 0.855 0.016 0.984
#> SRR1818613 1 0.2603 0.851 0.956 0.044
#> SRR1818614 1 0.2603 0.852 0.956 0.044
#> SRR1818611 1 0.5629 0.850 0.868 0.132
#> SRR1818612 1 0.5629 0.850 0.868 0.132
#> SRR1818605 1 0.7219 0.770 0.800 0.200
#> SRR1818606 1 0.7219 0.770 0.800 0.200
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.8444 0.607 0.612 0.236 0.152
#> SRR1818632 1 0.8336 0.619 0.624 0.224 0.152
#> SRR1818679 2 0.2845 0.863 0.068 0.920 0.012
#> SRR1818680 2 0.2845 0.863 0.068 0.920 0.012
#> SRR1818677 2 0.4526 0.813 0.104 0.856 0.040
#> SRR1818678 2 0.4256 0.828 0.096 0.868 0.036
#> SRR1818675 3 0.9004 0.463 0.136 0.376 0.488
#> SRR1818676 3 0.9004 0.463 0.136 0.376 0.488
#> SRR1818673 3 0.6737 0.677 0.016 0.384 0.600
#> SRR1818674 3 0.6737 0.677 0.016 0.384 0.600
#> SRR1818671 3 0.6608 0.726 0.008 0.432 0.560
#> SRR1818672 3 0.6608 0.726 0.008 0.432 0.560
#> SRR1818661 1 0.9510 0.472 0.492 0.264 0.244
#> SRR1818662 1 0.9510 0.472 0.492 0.264 0.244
#> SRR1818655 1 0.8890 0.510 0.544 0.308 0.148
#> SRR1818656 1 0.8825 0.521 0.556 0.296 0.148
#> SRR1818653 1 0.7584 0.692 0.676 0.104 0.220
#> SRR1818654 1 0.7584 0.690 0.676 0.104 0.220
#> SRR1818651 1 0.1491 0.756 0.968 0.016 0.016
#> SRR1818652 1 0.1636 0.757 0.964 0.020 0.016
#> SRR1818657 1 0.1751 0.753 0.960 0.012 0.028
#> SRR1818658 1 0.1620 0.754 0.964 0.012 0.024
#> SRR1818649 1 0.8650 0.530 0.572 0.292 0.136
#> SRR1818650 1 0.8597 0.532 0.576 0.292 0.132
#> SRR1818659 1 0.1636 0.756 0.964 0.020 0.016
#> SRR1818647 3 0.6498 0.728 0.008 0.396 0.596
#> SRR1818648 3 0.6498 0.728 0.008 0.396 0.596
#> SRR1818645 2 0.2651 0.864 0.060 0.928 0.012
#> SRR1818646 2 0.2651 0.864 0.060 0.928 0.012
#> SRR1818639 1 0.5667 0.733 0.800 0.060 0.140
#> SRR1818640 1 0.5823 0.731 0.792 0.064 0.144
#> SRR1818637 3 0.5785 0.687 0.000 0.332 0.668
#> SRR1818638 3 0.5785 0.687 0.000 0.332 0.668
#> SRR1818635 3 0.6985 0.672 0.024 0.384 0.592
#> SRR1818636 3 0.7099 0.669 0.028 0.384 0.588
#> SRR1818643 3 0.8995 0.405 0.136 0.372 0.492
#> SRR1818644 3 0.8995 0.410 0.136 0.372 0.492
#> SRR1818641 2 0.2584 0.868 0.064 0.928 0.008
#> SRR1818642 2 0.2584 0.868 0.064 0.928 0.008
#> SRR1818633 1 0.9999 -0.280 0.340 0.328 0.332
#> SRR1818634 1 0.9987 -0.262 0.348 0.308 0.344
#> SRR1818665 1 0.4058 0.752 0.880 0.044 0.076
#> SRR1818666 1 0.3590 0.752 0.896 0.028 0.076
#> SRR1818667 3 0.6513 0.698 0.004 0.476 0.520
#> SRR1818668 3 0.6509 0.702 0.004 0.472 0.524
#> SRR1818669 1 0.4413 0.741 0.852 0.024 0.124
#> SRR1818670 1 0.4662 0.740 0.844 0.032 0.124
#> SRR1818663 1 0.0848 0.753 0.984 0.008 0.008
#> SRR1818664 1 0.0848 0.753 0.984 0.008 0.008
#> SRR1818629 3 0.7905 0.619 0.064 0.376 0.560
#> SRR1818630 3 0.7824 0.626 0.060 0.376 0.564
#> SRR1818627 1 0.7126 0.673 0.720 0.164 0.116
#> SRR1818628 1 0.7447 0.656 0.696 0.184 0.120
#> SRR1818621 1 0.9532 0.464 0.488 0.268 0.244
#> SRR1818622 1 0.9532 0.464 0.488 0.268 0.244
#> SRR1818625 1 0.2280 0.746 0.940 0.052 0.008
#> SRR1818626 1 0.2173 0.747 0.944 0.048 0.008
#> SRR1818623 3 0.6286 0.635 0.000 0.464 0.536
#> SRR1818624 3 0.6286 0.635 0.000 0.464 0.536
#> SRR1818619 1 0.7245 0.647 0.712 0.120 0.168
#> SRR1818620 1 0.7552 0.625 0.692 0.140 0.168
#> SRR1818617 2 0.4035 0.841 0.080 0.880 0.040
#> SRR1818618 2 0.4357 0.831 0.080 0.868 0.052
#> SRR1818615 2 0.6682 -0.692 0.008 0.504 0.488
#> SRR1818616 3 0.6664 0.648 0.008 0.464 0.528
#> SRR1818609 3 0.6565 0.729 0.008 0.416 0.576
#> SRR1818610 3 0.6587 0.727 0.008 0.424 0.568
#> SRR1818607 2 0.2804 0.862 0.060 0.924 0.016
#> SRR1818608 2 0.2804 0.862 0.060 0.924 0.016
#> SRR1818613 1 0.1170 0.756 0.976 0.008 0.016
#> SRR1818614 1 0.1182 0.757 0.976 0.012 0.012
#> SRR1818611 1 0.8546 0.542 0.584 0.284 0.132
#> SRR1818612 1 0.8546 0.542 0.584 0.284 0.132
#> SRR1818605 1 0.3310 0.747 0.908 0.028 0.064
#> SRR1818606 1 0.3310 0.748 0.908 0.028 0.064
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 1 0.557 0.6237 0.740 0.024 0.188 0.048
#> SRR1818632 1 0.553 0.6293 0.744 0.024 0.184 0.048
#> SRR1818679 2 0.313 0.8855 0.008 0.892 0.032 0.068
#> SRR1818680 2 0.313 0.8855 0.008 0.892 0.032 0.068
#> SRR1818677 2 0.539 0.7879 0.084 0.780 0.032 0.104
#> SRR1818678 2 0.528 0.8029 0.072 0.788 0.036 0.104
#> SRR1818675 3 0.659 0.0234 0.016 0.044 0.472 0.468
#> SRR1818676 3 0.659 0.0234 0.016 0.044 0.472 0.468
#> SRR1818673 4 0.715 0.5831 0.020 0.184 0.176 0.620
#> SRR1818674 4 0.715 0.5831 0.020 0.184 0.176 0.620
#> SRR1818671 4 0.243 0.6033 0.008 0.060 0.012 0.920
#> SRR1818672 4 0.243 0.6033 0.008 0.060 0.012 0.920
#> SRR1818661 3 0.622 0.6697 0.276 0.016 0.652 0.056
#> SRR1818662 3 0.619 0.6706 0.272 0.016 0.656 0.056
#> SRR1818655 1 0.658 0.4817 0.568 0.348 0.080 0.004
#> SRR1818656 1 0.651 0.4899 0.576 0.344 0.076 0.004
#> SRR1818653 1 0.506 0.7004 0.784 0.060 0.140 0.016
#> SRR1818654 1 0.506 0.7004 0.784 0.060 0.140 0.016
#> SRR1818651 1 0.108 0.7577 0.972 0.004 0.020 0.004
#> SRR1818652 1 0.119 0.7583 0.968 0.004 0.024 0.004
#> SRR1818657 1 0.179 0.7506 0.948 0.008 0.036 0.008
#> SRR1818658 1 0.179 0.7506 0.948 0.008 0.036 0.008
#> SRR1818649 1 0.643 0.5033 0.592 0.336 0.064 0.008
#> SRR1818650 1 0.641 0.5090 0.596 0.332 0.064 0.008
#> SRR1818659 1 0.151 0.7629 0.956 0.028 0.016 0.000
#> SRR1818647 4 0.298 0.5608 0.004 0.032 0.068 0.896
#> SRR1818648 4 0.291 0.5636 0.004 0.032 0.064 0.900
#> SRR1818645 2 0.255 0.8914 0.000 0.900 0.008 0.092
#> SRR1818646 2 0.255 0.8914 0.000 0.900 0.008 0.092
#> SRR1818639 1 0.406 0.7280 0.840 0.096 0.060 0.004
#> SRR1818640 1 0.421 0.7246 0.832 0.092 0.072 0.004
#> SRR1818637 4 0.549 0.3566 0.000 0.060 0.240 0.700
#> SRR1818638 4 0.549 0.3566 0.000 0.060 0.240 0.700
#> SRR1818635 4 0.716 0.5851 0.020 0.180 0.180 0.620
#> SRR1818636 4 0.716 0.5851 0.020 0.180 0.180 0.620
#> SRR1818643 4 0.835 0.4695 0.168 0.092 0.184 0.556
#> SRR1818644 4 0.838 0.4751 0.164 0.100 0.180 0.556
#> SRR1818641 2 0.264 0.8906 0.000 0.904 0.020 0.076
#> SRR1818642 2 0.264 0.8906 0.000 0.904 0.020 0.076
#> SRR1818633 4 0.865 0.0920 0.368 0.124 0.084 0.424
#> SRR1818634 4 0.865 0.0920 0.368 0.124 0.084 0.424
#> SRR1818665 1 0.366 0.7240 0.868 0.012 0.080 0.040
#> SRR1818666 1 0.383 0.7194 0.860 0.012 0.080 0.048
#> SRR1818667 4 0.510 0.5748 0.004 0.184 0.056 0.756
#> SRR1818668 4 0.521 0.5767 0.004 0.196 0.056 0.744
#> SRR1818669 1 0.379 0.7376 0.860 0.056 0.076 0.008
#> SRR1818670 1 0.379 0.7376 0.860 0.056 0.076 0.008
#> SRR1818663 1 0.151 0.7556 0.960 0.008 0.020 0.012
#> SRR1818664 1 0.162 0.7553 0.956 0.008 0.024 0.012
#> SRR1818629 4 0.710 0.5761 0.020 0.200 0.156 0.624
#> SRR1818630 4 0.710 0.5761 0.020 0.200 0.156 0.624
#> SRR1818627 1 0.734 0.4112 0.612 0.028 0.184 0.176
#> SRR1818628 1 0.738 0.4054 0.608 0.028 0.184 0.180
#> SRR1818621 3 0.636 0.6607 0.288 0.016 0.636 0.060
#> SRR1818622 3 0.636 0.6607 0.288 0.016 0.636 0.060
#> SRR1818625 1 0.117 0.7592 0.968 0.012 0.020 0.000
#> SRR1818626 1 0.106 0.7595 0.972 0.012 0.016 0.000
#> SRR1818623 4 0.603 0.2747 0.000 0.076 0.280 0.644
#> SRR1818624 4 0.603 0.2747 0.000 0.076 0.280 0.644
#> SRR1818619 1 0.704 0.3270 0.600 0.020 0.104 0.276
#> SRR1818620 1 0.701 0.3201 0.600 0.020 0.100 0.280
#> SRR1818617 2 0.584 0.7712 0.020 0.740 0.120 0.120
#> SRR1818618 2 0.578 0.7690 0.016 0.740 0.112 0.132
#> SRR1818615 4 0.645 0.5303 0.000 0.260 0.116 0.624
#> SRR1818616 4 0.679 0.5205 0.004 0.264 0.128 0.604
#> SRR1818609 4 0.222 0.5859 0.000 0.040 0.032 0.928
#> SRR1818610 4 0.222 0.5859 0.000 0.040 0.032 0.928
#> SRR1818607 2 0.255 0.8914 0.000 0.900 0.008 0.092
#> SRR1818608 2 0.240 0.8909 0.000 0.904 0.004 0.092
#> SRR1818613 1 0.160 0.7611 0.956 0.020 0.020 0.004
#> SRR1818614 1 0.123 0.7584 0.968 0.008 0.020 0.004
#> SRR1818611 1 0.628 0.5298 0.616 0.316 0.060 0.008
#> SRR1818612 1 0.636 0.5230 0.608 0.320 0.064 0.008
#> SRR1818605 1 0.333 0.7346 0.884 0.008 0.060 0.048
#> SRR1818606 1 0.342 0.7335 0.880 0.008 0.060 0.052
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 1 0.6688 0.3368 0.548 0.016 0.324 0.036 0.076
#> SRR1818632 1 0.6795 0.3361 0.548 0.020 0.316 0.036 0.080
#> SRR1818679 2 0.2486 0.8443 0.032 0.912 0.008 0.040 0.008
#> SRR1818680 2 0.2486 0.8443 0.032 0.912 0.008 0.040 0.008
#> SRR1818677 2 0.6292 0.7203 0.084 0.696 0.036 0.068 0.116
#> SRR1818678 2 0.6292 0.7167 0.084 0.696 0.036 0.068 0.116
#> SRR1818675 3 0.6645 0.3098 0.020 0.000 0.516 0.312 0.152
#> SRR1818676 3 0.6645 0.3098 0.020 0.000 0.516 0.312 0.152
#> SRR1818673 5 0.5929 0.7623 0.004 0.104 0.000 0.344 0.548
#> SRR1818674 5 0.5929 0.7623 0.004 0.104 0.000 0.344 0.548
#> SRR1818671 4 0.2853 0.6627 0.004 0.040 0.000 0.880 0.076
#> SRR1818672 4 0.2853 0.6626 0.004 0.040 0.000 0.880 0.076
#> SRR1818661 3 0.4134 0.7280 0.148 0.004 0.792 0.052 0.004
#> SRR1818662 3 0.4092 0.7280 0.144 0.004 0.796 0.052 0.004
#> SRR1818655 1 0.7826 0.3928 0.452 0.256 0.108 0.000 0.184
#> SRR1818656 1 0.7781 0.4079 0.464 0.244 0.108 0.000 0.184
#> SRR1818653 1 0.6154 0.4903 0.604 0.016 0.236 0.000 0.144
#> SRR1818654 1 0.6177 0.4876 0.600 0.016 0.240 0.000 0.144
#> SRR1818651 1 0.2204 0.6455 0.920 0.016 0.016 0.000 0.048
#> SRR1818652 1 0.2537 0.6463 0.904 0.016 0.024 0.000 0.056
#> SRR1818657 1 0.2074 0.6379 0.920 0.004 0.016 0.000 0.060
#> SRR1818658 1 0.2301 0.6378 0.912 0.004 0.016 0.004 0.064
#> SRR1818649 1 0.7721 0.4123 0.464 0.240 0.092 0.000 0.204
#> SRR1818650 1 0.7663 0.4192 0.472 0.236 0.088 0.000 0.204
#> SRR1818659 1 0.3340 0.6509 0.864 0.064 0.024 0.000 0.048
#> SRR1818647 4 0.1179 0.7108 0.000 0.004 0.016 0.964 0.016
#> SRR1818648 4 0.1179 0.7108 0.000 0.004 0.016 0.964 0.016
#> SRR1818645 2 0.1386 0.8474 0.000 0.952 0.000 0.016 0.032
#> SRR1818646 2 0.1549 0.8454 0.000 0.944 0.000 0.016 0.040
#> SRR1818639 1 0.5519 0.5849 0.700 0.028 0.112 0.000 0.160
#> SRR1818640 1 0.5351 0.5862 0.708 0.020 0.112 0.000 0.160
#> SRR1818637 4 0.4412 0.6118 0.000 0.008 0.188 0.756 0.048
#> SRR1818638 4 0.4412 0.6118 0.000 0.008 0.188 0.756 0.048
#> SRR1818635 5 0.5905 0.7648 0.004 0.104 0.000 0.336 0.556
#> SRR1818636 5 0.5905 0.7648 0.004 0.104 0.000 0.336 0.556
#> SRR1818643 5 0.7181 0.5439 0.180 0.060 0.004 0.208 0.548
#> SRR1818644 5 0.7181 0.5490 0.180 0.060 0.004 0.208 0.548
#> SRR1818641 2 0.1095 0.8497 0.008 0.968 0.012 0.012 0.000
#> SRR1818642 2 0.1095 0.8497 0.008 0.968 0.012 0.012 0.000
#> SRR1818633 1 0.8192 -0.1160 0.384 0.052 0.028 0.220 0.316
#> SRR1818634 1 0.8192 -0.1160 0.384 0.052 0.028 0.220 0.316
#> SRR1818665 1 0.4389 0.5874 0.784 0.004 0.056 0.012 0.144
#> SRR1818666 1 0.4431 0.5840 0.780 0.004 0.056 0.012 0.148
#> SRR1818667 4 0.5408 0.5990 0.004 0.100 0.036 0.728 0.132
#> SRR1818668 4 0.5587 0.5757 0.004 0.108 0.036 0.712 0.140
#> SRR1818669 1 0.4886 0.6034 0.764 0.040 0.080 0.000 0.116
#> SRR1818670 1 0.5022 0.6016 0.752 0.040 0.080 0.000 0.128
#> SRR1818663 1 0.1808 0.6451 0.936 0.008 0.012 0.000 0.044
#> SRR1818664 1 0.1913 0.6448 0.932 0.008 0.016 0.000 0.044
#> SRR1818629 5 0.6050 0.6753 0.000 0.104 0.004 0.404 0.488
#> SRR1818630 5 0.6011 0.6782 0.000 0.100 0.004 0.404 0.492
#> SRR1818627 1 0.7545 0.2066 0.456 0.004 0.184 0.056 0.300
#> SRR1818628 1 0.7624 0.1658 0.432 0.004 0.208 0.052 0.304
#> SRR1818621 3 0.4708 0.6817 0.192 0.012 0.744 0.048 0.004
#> SRR1818622 3 0.4674 0.6867 0.188 0.012 0.748 0.048 0.004
#> SRR1818625 1 0.2426 0.6475 0.908 0.008 0.016 0.004 0.064
#> SRR1818626 1 0.2359 0.6475 0.912 0.008 0.016 0.004 0.060
#> SRR1818623 4 0.4444 0.6412 0.000 0.008 0.184 0.756 0.052
#> SRR1818624 4 0.4444 0.6412 0.000 0.008 0.184 0.756 0.052
#> SRR1818619 1 0.6514 0.3694 0.560 0.004 0.060 0.060 0.316
#> SRR1818620 1 0.6321 0.3736 0.564 0.000 0.052 0.064 0.320
#> SRR1818617 2 0.6125 0.6860 0.032 0.648 0.016 0.072 0.232
#> SRR1818618 2 0.6055 0.6838 0.032 0.648 0.012 0.072 0.236
#> SRR1818615 4 0.5649 0.0301 0.000 0.108 0.000 0.596 0.296
#> SRR1818616 4 0.5724 -0.0274 0.000 0.112 0.000 0.584 0.304
#> SRR1818609 4 0.0898 0.7071 0.000 0.008 0.000 0.972 0.020
#> SRR1818610 4 0.0992 0.7059 0.000 0.008 0.000 0.968 0.024
#> SRR1818607 2 0.1211 0.8502 0.000 0.960 0.000 0.016 0.024
#> SRR1818608 2 0.1117 0.8512 0.000 0.964 0.000 0.016 0.020
#> SRR1818613 1 0.2418 0.6439 0.912 0.020 0.024 0.000 0.044
#> SRR1818614 1 0.2409 0.6427 0.912 0.016 0.028 0.000 0.044
#> SRR1818611 1 0.7631 0.4355 0.480 0.220 0.088 0.000 0.212
#> SRR1818612 1 0.7611 0.4368 0.484 0.216 0.088 0.000 0.212
#> SRR1818605 1 0.4083 0.6172 0.804 0.008 0.052 0.004 0.132
#> SRR1818606 1 0.4150 0.6157 0.800 0.008 0.056 0.004 0.132
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.665 0.148633 0.260 0.032 0.388 0.000 0.320 0.000
#> SRR1818632 3 0.667 0.134617 0.264 0.032 0.380 0.000 0.324 0.000
#> SRR1818679 2 0.328 0.807017 0.008 0.856 0.036 0.004 0.076 0.020
#> SRR1818680 2 0.328 0.807017 0.008 0.856 0.036 0.004 0.076 0.020
#> SRR1818677 2 0.613 0.667461 0.032 0.612 0.040 0.016 0.252 0.048
#> SRR1818678 2 0.603 0.675287 0.032 0.620 0.040 0.012 0.248 0.048
#> SRR1818675 3 0.695 0.202060 0.132 0.000 0.452 0.292 0.000 0.124
#> SRR1818676 3 0.695 0.202060 0.132 0.000 0.452 0.292 0.000 0.124
#> SRR1818673 6 0.107 0.652253 0.000 0.020 0.000 0.008 0.008 0.964
#> SRR1818674 6 0.107 0.652253 0.000 0.020 0.000 0.008 0.008 0.964
#> SRR1818671 4 0.440 0.666953 0.004 0.040 0.012 0.708 0.000 0.236
#> SRR1818672 4 0.440 0.666953 0.004 0.040 0.012 0.708 0.000 0.236
#> SRR1818661 3 0.280 0.616648 0.060 0.004 0.880 0.020 0.036 0.000
#> SRR1818662 3 0.281 0.616256 0.056 0.004 0.880 0.020 0.040 0.000
#> SRR1818655 5 0.350 0.564089 0.024 0.160 0.016 0.000 0.800 0.000
#> SRR1818656 5 0.337 0.563319 0.020 0.164 0.012 0.000 0.804 0.000
#> SRR1818653 5 0.572 0.311255 0.236 0.004 0.192 0.004 0.564 0.000
#> SRR1818654 5 0.577 0.309337 0.236 0.004 0.200 0.004 0.556 0.000
#> SRR1818651 1 0.428 0.424388 0.572 0.008 0.004 0.000 0.412 0.004
#> SRR1818652 1 0.403 0.423659 0.572 0.008 0.000 0.000 0.420 0.000
#> SRR1818657 1 0.458 0.464318 0.552 0.004 0.012 0.000 0.420 0.012
#> SRR1818658 1 0.450 0.458844 0.552 0.004 0.008 0.000 0.424 0.012
#> SRR1818649 5 0.240 0.581200 0.016 0.112 0.000 0.000 0.872 0.000
#> SRR1818650 5 0.270 0.581891 0.020 0.108 0.008 0.000 0.864 0.000
#> SRR1818659 1 0.473 0.410600 0.500 0.008 0.012 0.000 0.468 0.012
#> SRR1818647 4 0.225 0.718898 0.012 0.012 0.004 0.904 0.000 0.068
#> SRR1818648 4 0.230 0.719305 0.012 0.012 0.004 0.900 0.000 0.072
#> SRR1818645 2 0.133 0.820059 0.000 0.952 0.000 0.012 0.008 0.028
#> SRR1818646 2 0.133 0.820059 0.000 0.952 0.000 0.012 0.008 0.028
#> SRR1818639 5 0.542 0.360862 0.280 0.044 0.064 0.000 0.612 0.000
#> SRR1818640 5 0.542 0.372979 0.272 0.040 0.072 0.000 0.616 0.000
#> SRR1818637 4 0.426 0.587177 0.012 0.012 0.204 0.740 0.000 0.032
#> SRR1818638 4 0.426 0.587177 0.012 0.012 0.204 0.740 0.000 0.032
#> SRR1818635 6 0.121 0.653057 0.004 0.020 0.000 0.008 0.008 0.960
#> SRR1818636 6 0.121 0.653057 0.004 0.020 0.000 0.008 0.008 0.960
#> SRR1818643 6 0.565 0.573924 0.216 0.036 0.016 0.020 0.048 0.664
#> SRR1818644 6 0.581 0.576673 0.212 0.044 0.016 0.020 0.052 0.656
#> SRR1818641 2 0.246 0.800514 0.008 0.908 0.016 0.008 0.036 0.024
#> SRR1818642 2 0.225 0.803390 0.008 0.916 0.012 0.004 0.036 0.024
#> SRR1818633 6 0.751 0.213301 0.324 0.052 0.020 0.032 0.140 0.432
#> SRR1818634 6 0.751 0.213301 0.324 0.052 0.020 0.032 0.140 0.432
#> SRR1818665 1 0.572 0.469064 0.604 0.004 0.056 0.020 0.288 0.028
#> SRR1818666 1 0.562 0.463371 0.596 0.004 0.048 0.020 0.308 0.024
#> SRR1818667 4 0.668 0.526794 0.004 0.100 0.076 0.500 0.008 0.312
#> SRR1818668 4 0.667 0.533629 0.004 0.100 0.076 0.504 0.008 0.308
#> SRR1818669 5 0.414 0.441132 0.160 0.028 0.032 0.000 0.772 0.008
#> SRR1818670 5 0.407 0.458596 0.152 0.032 0.028 0.000 0.780 0.008
#> SRR1818663 1 0.431 0.421415 0.520 0.000 0.004 0.000 0.464 0.012
#> SRR1818664 1 0.431 0.407750 0.508 0.000 0.004 0.000 0.476 0.012
#> SRR1818629 6 0.386 0.626569 0.016 0.068 0.020 0.048 0.016 0.832
#> SRR1818630 6 0.393 0.622708 0.016 0.064 0.020 0.056 0.016 0.828
#> SRR1818627 1 0.664 0.035148 0.552 0.000 0.256 0.036 0.060 0.096
#> SRR1818628 1 0.669 0.036556 0.548 0.000 0.256 0.036 0.064 0.096
#> SRR1818621 3 0.413 0.601320 0.104 0.004 0.784 0.020 0.088 0.000
#> SRR1818622 3 0.399 0.609139 0.100 0.004 0.796 0.020 0.080 0.000
#> SRR1818625 5 0.423 -0.377883 0.440 0.000 0.000 0.000 0.544 0.016
#> SRR1818626 5 0.422 -0.364000 0.432 0.000 0.000 0.000 0.552 0.016
#> SRR1818623 4 0.605 0.643988 0.016 0.040 0.160 0.640 0.008 0.136
#> SRR1818624 4 0.605 0.643988 0.016 0.040 0.160 0.640 0.008 0.136
#> SRR1818619 1 0.733 0.376580 0.448 0.008 0.096 0.008 0.276 0.164
#> SRR1818620 1 0.725 0.375537 0.444 0.008 0.080 0.008 0.292 0.168
#> SRR1818617 2 0.614 0.692223 0.024 0.620 0.024 0.012 0.208 0.112
#> SRR1818618 2 0.613 0.696033 0.024 0.624 0.024 0.012 0.200 0.116
#> SRR1818615 6 0.586 0.000344 0.000 0.132 0.008 0.332 0.008 0.520
#> SRR1818616 6 0.575 0.057000 0.000 0.120 0.008 0.324 0.008 0.540
#> SRR1818609 4 0.337 0.708847 0.008 0.020 0.000 0.796 0.000 0.176
#> SRR1818610 4 0.345 0.708413 0.008 0.024 0.000 0.792 0.000 0.176
#> SRR1818607 2 0.133 0.820059 0.000 0.952 0.000 0.012 0.008 0.028
#> SRR1818608 2 0.133 0.820059 0.000 0.952 0.000 0.012 0.008 0.028
#> SRR1818613 1 0.433 0.440480 0.596 0.008 0.008 0.000 0.384 0.004
#> SRR1818614 1 0.458 0.429165 0.584 0.008 0.020 0.000 0.384 0.004
#> SRR1818611 5 0.236 0.581050 0.016 0.108 0.000 0.000 0.876 0.000
#> SRR1818612 5 0.240 0.582017 0.020 0.104 0.000 0.000 0.876 0.000
#> SRR1818605 1 0.491 0.445377 0.680 0.000 0.028 0.012 0.244 0.036
#> SRR1818606 1 0.491 0.445377 0.680 0.000 0.028 0.012 0.244 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["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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.813 0.904 0.958 0.4929 0.501 0.501
#> 3 3 0.509 0.704 0.837 0.2886 0.667 0.449
#> 4 4 0.411 0.465 0.675 0.1443 0.722 0.403
#> 5 5 0.494 0.397 0.630 0.0809 0.793 0.408
#> 6 6 0.557 0.460 0.598 0.0457 0.914 0.636
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
#> SRR1818631 1 0.0000 0.9711 1.000 0.000
#> SRR1818632 1 0.0000 0.9711 1.000 0.000
#> SRR1818679 1 0.9983 -0.0376 0.524 0.476
#> SRR1818680 2 0.9635 0.4410 0.388 0.612
#> SRR1818677 1 0.1633 0.9484 0.976 0.024
#> SRR1818678 1 0.2778 0.9237 0.952 0.048
#> SRR1818675 2 0.3584 0.8902 0.068 0.932
#> SRR1818676 2 0.7453 0.7424 0.212 0.788
#> SRR1818673 2 0.0672 0.9294 0.008 0.992
#> SRR1818674 2 0.0000 0.9327 0.000 1.000
#> SRR1818671 2 0.0000 0.9327 0.000 1.000
#> SRR1818672 2 0.0000 0.9327 0.000 1.000
#> SRR1818661 1 0.0000 0.9711 1.000 0.000
#> SRR1818662 1 0.0000 0.9711 1.000 0.000
#> SRR1818655 1 0.0000 0.9711 1.000 0.000
#> SRR1818656 1 0.0000 0.9711 1.000 0.000
#> SRR1818653 1 0.0000 0.9711 1.000 0.000
#> SRR1818654 1 0.0000 0.9711 1.000 0.000
#> SRR1818651 1 0.0000 0.9711 1.000 0.000
#> SRR1818652 1 0.0000 0.9711 1.000 0.000
#> SRR1818657 1 0.0000 0.9711 1.000 0.000
#> SRR1818658 1 0.0000 0.9711 1.000 0.000
#> SRR1818649 1 0.0000 0.9711 1.000 0.000
#> SRR1818650 1 0.0000 0.9711 1.000 0.000
#> SRR1818659 1 0.0000 0.9711 1.000 0.000
#> SRR1818647 2 0.0000 0.9327 0.000 1.000
#> SRR1818648 2 0.0000 0.9327 0.000 1.000
#> SRR1818645 2 0.0000 0.9327 0.000 1.000
#> SRR1818646 2 0.0000 0.9327 0.000 1.000
#> SRR1818639 1 0.0000 0.9711 1.000 0.000
#> SRR1818640 1 0.0000 0.9711 1.000 0.000
#> SRR1818637 2 0.0000 0.9327 0.000 1.000
#> SRR1818638 2 0.0000 0.9327 0.000 1.000
#> SRR1818635 2 0.6973 0.7887 0.188 0.812
#> SRR1818636 2 0.7745 0.7388 0.228 0.772
#> SRR1818643 2 0.9129 0.5782 0.328 0.672
#> SRR1818644 2 0.8713 0.6440 0.292 0.708
#> SRR1818641 2 0.5946 0.8340 0.144 0.856
#> SRR1818642 2 0.5946 0.8339 0.144 0.856
#> SRR1818633 1 0.6712 0.7614 0.824 0.176
#> SRR1818634 1 0.9427 0.4057 0.640 0.360
#> SRR1818665 1 0.0000 0.9711 1.000 0.000
#> SRR1818666 1 0.0000 0.9711 1.000 0.000
#> SRR1818667 2 0.0000 0.9327 0.000 1.000
#> SRR1818668 2 0.0000 0.9327 0.000 1.000
#> SRR1818669 1 0.0000 0.9711 1.000 0.000
#> SRR1818670 1 0.0000 0.9711 1.000 0.000
#> SRR1818663 1 0.0000 0.9711 1.000 0.000
#> SRR1818664 1 0.0000 0.9711 1.000 0.000
#> SRR1818629 2 0.0000 0.9327 0.000 1.000
#> SRR1818630 2 0.0000 0.9327 0.000 1.000
#> SRR1818627 1 0.0000 0.9711 1.000 0.000
#> SRR1818628 1 0.0000 0.9711 1.000 0.000
#> SRR1818621 1 0.0000 0.9711 1.000 0.000
#> SRR1818622 1 0.0000 0.9711 1.000 0.000
#> SRR1818625 1 0.0000 0.9711 1.000 0.000
#> SRR1818626 1 0.0000 0.9711 1.000 0.000
#> SRR1818623 2 0.0000 0.9327 0.000 1.000
#> SRR1818624 2 0.0000 0.9327 0.000 1.000
#> SRR1818619 1 0.0000 0.9711 1.000 0.000
#> SRR1818620 1 0.0000 0.9711 1.000 0.000
#> SRR1818617 2 0.2043 0.9173 0.032 0.968
#> SRR1818618 2 0.1633 0.9217 0.024 0.976
#> SRR1818615 2 0.0000 0.9327 0.000 1.000
#> SRR1818616 2 0.0000 0.9327 0.000 1.000
#> SRR1818609 2 0.0000 0.9327 0.000 1.000
#> SRR1818610 2 0.0000 0.9327 0.000 1.000
#> SRR1818607 2 0.0000 0.9327 0.000 1.000
#> SRR1818608 2 0.0000 0.9327 0.000 1.000
#> SRR1818613 1 0.0000 0.9711 1.000 0.000
#> SRR1818614 1 0.0000 0.9711 1.000 0.000
#> SRR1818611 1 0.0000 0.9711 1.000 0.000
#> SRR1818612 1 0.0000 0.9711 1.000 0.000
#> SRR1818605 1 0.0000 0.9711 1.000 0.000
#> SRR1818606 1 0.0000 0.9711 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.4178 0.8359 0.172 0.000 0.828
#> SRR1818632 3 0.4178 0.8359 0.172 0.000 0.828
#> SRR1818679 1 0.4842 0.6999 0.776 0.224 0.000
#> SRR1818680 1 0.5098 0.6854 0.752 0.248 0.000
#> SRR1818677 1 0.2569 0.7850 0.936 0.032 0.032
#> SRR1818678 1 0.2492 0.7842 0.936 0.048 0.016
#> SRR1818675 3 0.0237 0.7047 0.000 0.004 0.996
#> SRR1818676 3 0.0237 0.7047 0.000 0.004 0.996
#> SRR1818673 1 0.5650 0.6232 0.688 0.312 0.000
#> SRR1818674 1 0.5859 0.5760 0.656 0.344 0.000
#> SRR1818671 2 0.3686 0.8403 0.000 0.860 0.140
#> SRR1818672 2 0.3619 0.8413 0.000 0.864 0.136
#> SRR1818661 3 0.2796 0.8075 0.092 0.000 0.908
#> SRR1818662 3 0.2796 0.8074 0.092 0.000 0.908
#> SRR1818655 1 0.0237 0.7857 0.996 0.000 0.004
#> SRR1818656 1 0.0237 0.7857 0.996 0.000 0.004
#> SRR1818653 1 0.6079 -0.0017 0.612 0.000 0.388
#> SRR1818654 1 0.5948 0.1038 0.640 0.000 0.360
#> SRR1818651 1 0.5098 0.5050 0.752 0.000 0.248
#> SRR1818652 1 0.2066 0.7614 0.940 0.000 0.060
#> SRR1818657 1 0.2165 0.7611 0.936 0.000 0.064
#> SRR1818658 1 0.1964 0.7652 0.944 0.000 0.056
#> SRR1818649 1 0.1289 0.7859 0.968 0.032 0.000
#> SRR1818650 1 0.1411 0.7853 0.964 0.036 0.000
#> SRR1818659 1 0.6204 -0.0752 0.576 0.000 0.424
#> SRR1818647 2 0.4605 0.8107 0.000 0.796 0.204
#> SRR1818648 2 0.4654 0.8081 0.000 0.792 0.208
#> SRR1818645 2 0.0592 0.8442 0.012 0.988 0.000
#> SRR1818646 2 0.0424 0.8457 0.008 0.992 0.000
#> SRR1818639 1 0.1031 0.7814 0.976 0.000 0.024
#> SRR1818640 1 0.0747 0.7833 0.984 0.000 0.016
#> SRR1818637 2 0.5178 0.7740 0.000 0.744 0.256
#> SRR1818638 2 0.5216 0.7703 0.000 0.740 0.260
#> SRR1818635 1 0.5431 0.6569 0.716 0.284 0.000
#> SRR1818636 1 0.5138 0.6831 0.748 0.252 0.000
#> SRR1818643 1 0.5926 0.5750 0.644 0.356 0.000
#> SRR1818644 1 0.5988 0.5517 0.632 0.368 0.000
#> SRR1818641 1 0.5016 0.6905 0.760 0.240 0.000
#> SRR1818642 1 0.4931 0.6962 0.768 0.232 0.000
#> SRR1818633 1 0.7804 0.4575 0.664 0.120 0.216
#> SRR1818634 3 0.9982 0.2825 0.332 0.308 0.360
#> SRR1818665 1 0.3686 0.6964 0.860 0.000 0.140
#> SRR1818666 1 0.2959 0.7306 0.900 0.000 0.100
#> SRR1818667 2 0.2066 0.8513 0.000 0.940 0.060
#> SRR1818668 2 0.1753 0.8516 0.000 0.952 0.048
#> SRR1818669 1 0.0747 0.7833 0.984 0.000 0.016
#> SRR1818670 1 0.0747 0.7833 0.984 0.000 0.016
#> SRR1818663 1 0.0592 0.7842 0.988 0.000 0.012
#> SRR1818664 1 0.0592 0.7842 0.988 0.000 0.012
#> SRR1818629 2 0.0000 0.8480 0.000 1.000 0.000
#> SRR1818630 2 0.0000 0.8480 0.000 1.000 0.000
#> SRR1818627 3 0.4399 0.8297 0.188 0.000 0.812
#> SRR1818628 3 0.4291 0.8332 0.180 0.000 0.820
#> SRR1818621 3 0.4121 0.8356 0.168 0.000 0.832
#> SRR1818622 3 0.4002 0.8344 0.160 0.000 0.840
#> SRR1818625 1 0.0000 0.7864 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.7864 1.000 0.000 0.000
#> SRR1818623 2 0.5968 0.6616 0.000 0.636 0.364
#> SRR1818624 2 0.5591 0.7353 0.000 0.696 0.304
#> SRR1818619 1 0.5016 0.5935 0.760 0.000 0.240
#> SRR1818620 1 0.4121 0.6854 0.832 0.000 0.168
#> SRR1818617 2 0.6252 -0.0600 0.444 0.556 0.000
#> SRR1818618 2 0.4974 0.5662 0.236 0.764 0.000
#> SRR1818615 2 0.0237 0.8470 0.004 0.996 0.000
#> SRR1818616 2 0.0237 0.8470 0.004 0.996 0.000
#> SRR1818609 2 0.3816 0.8376 0.000 0.852 0.148
#> SRR1818610 2 0.3816 0.8376 0.000 0.852 0.148
#> SRR1818607 2 0.0592 0.8442 0.012 0.988 0.000
#> SRR1818608 2 0.0592 0.8439 0.012 0.988 0.000
#> SRR1818613 3 0.6215 0.5298 0.428 0.000 0.572
#> SRR1818614 3 0.6095 0.6094 0.392 0.000 0.608
#> SRR1818611 1 0.1529 0.7844 0.960 0.040 0.000
#> SRR1818612 1 0.2625 0.7681 0.916 0.084 0.000
#> SRR1818605 3 0.5560 0.7504 0.300 0.000 0.700
#> SRR1818606 3 0.5591 0.7498 0.304 0.000 0.696
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.713 0.382 0.148 0.244 0.596 0.012
#> SRR1818632 3 0.788 0.284 0.208 0.272 0.504 0.016
#> SRR1818679 2 0.447 0.462 0.020 0.776 0.200 0.004
#> SRR1818680 2 0.421 0.484 0.016 0.804 0.172 0.008
#> SRR1818677 2 0.681 0.390 0.144 0.612 0.240 0.004
#> SRR1818678 2 0.642 0.434 0.152 0.648 0.200 0.000
#> SRR1818675 3 0.593 0.250 0.028 0.004 0.516 0.452
#> SRR1818676 3 0.592 0.264 0.028 0.004 0.524 0.444
#> SRR1818673 2 0.741 0.272 0.340 0.540 0.036 0.084
#> SRR1818674 2 0.757 0.278 0.328 0.536 0.036 0.100
#> SRR1818671 4 0.452 0.697 0.028 0.204 0.000 0.768
#> SRR1818672 4 0.481 0.688 0.028 0.236 0.000 0.736
#> SRR1818661 3 0.378 0.644 0.052 0.008 0.860 0.080
#> SRR1818662 3 0.384 0.645 0.052 0.012 0.860 0.076
#> SRR1818655 2 0.741 0.264 0.188 0.492 0.320 0.000
#> SRR1818656 2 0.761 0.259 0.252 0.476 0.272 0.000
#> SRR1818653 3 0.766 0.107 0.160 0.408 0.424 0.008
#> SRR1818654 2 0.774 -0.182 0.172 0.416 0.404 0.008
#> SRR1818651 1 0.451 0.682 0.800 0.064 0.136 0.000
#> SRR1818652 1 0.435 0.676 0.816 0.080 0.104 0.000
#> SRR1818657 1 0.297 0.691 0.896 0.076 0.020 0.008
#> SRR1818658 1 0.285 0.691 0.900 0.076 0.016 0.008
#> SRR1818649 1 0.752 0.252 0.492 0.280 0.228 0.000
#> SRR1818650 1 0.719 0.315 0.532 0.300 0.168 0.000
#> SRR1818659 1 0.376 0.668 0.828 0.020 0.152 0.000
#> SRR1818647 4 0.191 0.640 0.000 0.040 0.020 0.940
#> SRR1818648 4 0.207 0.643 0.004 0.044 0.016 0.936
#> SRR1818645 2 0.327 0.318 0.000 0.832 0.000 0.168
#> SRR1818646 2 0.361 0.252 0.000 0.800 0.000 0.200
#> SRR1818639 2 0.789 0.101 0.288 0.368 0.344 0.000
#> SRR1818640 2 0.778 0.105 0.244 0.392 0.364 0.000
#> SRR1818637 4 0.261 0.564 0.000 0.012 0.088 0.900
#> SRR1818638 4 0.268 0.560 0.000 0.012 0.092 0.896
#> SRR1818635 2 0.716 0.162 0.404 0.504 0.036 0.056
#> SRR1818636 2 0.679 0.051 0.456 0.476 0.036 0.032
#> SRR1818643 1 0.581 0.556 0.728 0.192 0.036 0.044
#> SRR1818644 1 0.569 0.559 0.736 0.188 0.036 0.040
#> SRR1818641 2 0.230 0.509 0.044 0.928 0.004 0.024
#> SRR1818642 2 0.182 0.509 0.036 0.944 0.000 0.020
#> SRR1818633 1 0.704 0.458 0.656 0.116 0.044 0.184
#> SRR1818634 1 0.833 0.199 0.516 0.132 0.072 0.280
#> SRR1818665 1 0.385 0.661 0.860 0.056 0.072 0.012
#> SRR1818666 1 0.365 0.668 0.868 0.068 0.056 0.008
#> SRR1818667 4 0.523 0.575 0.004 0.412 0.004 0.580
#> SRR1818668 4 0.531 0.588 0.004 0.392 0.008 0.596
#> SRR1818669 1 0.736 0.215 0.488 0.340 0.172 0.000
#> SRR1818670 1 0.719 0.256 0.516 0.328 0.156 0.000
#> SRR1818663 1 0.233 0.695 0.916 0.072 0.012 0.000
#> SRR1818664 1 0.254 0.692 0.904 0.084 0.012 0.000
#> SRR1818629 4 0.671 0.505 0.052 0.436 0.016 0.496
#> SRR1818630 4 0.684 0.492 0.060 0.452 0.016 0.472
#> SRR1818627 1 0.650 0.322 0.624 0.012 0.288 0.076
#> SRR1818628 1 0.695 0.253 0.592 0.024 0.304 0.080
#> SRR1818621 3 0.313 0.632 0.072 0.024 0.892 0.012
#> SRR1818622 3 0.283 0.630 0.056 0.024 0.908 0.012
#> SRR1818625 1 0.331 0.682 0.868 0.104 0.028 0.000
#> SRR1818626 1 0.324 0.683 0.872 0.100 0.028 0.000
#> SRR1818623 4 0.501 0.322 0.000 0.024 0.276 0.700
#> SRR1818624 4 0.461 0.410 0.000 0.024 0.224 0.752
#> SRR1818619 1 0.448 0.660 0.832 0.080 0.064 0.024
#> SRR1818620 1 0.403 0.677 0.852 0.080 0.052 0.016
#> SRR1818617 2 0.510 0.518 0.036 0.800 0.092 0.072
#> SRR1818618 2 0.546 0.524 0.028 0.772 0.120 0.080
#> SRR1818615 4 0.591 0.493 0.000 0.440 0.036 0.524
#> SRR1818616 4 0.592 0.483 0.000 0.448 0.036 0.516
#> SRR1818609 4 0.322 0.703 0.000 0.164 0.000 0.836
#> SRR1818610 4 0.317 0.702 0.000 0.160 0.000 0.840
#> SRR1818607 2 0.349 0.280 0.000 0.812 0.000 0.188
#> SRR1818608 2 0.344 0.295 0.000 0.816 0.000 0.184
#> SRR1818613 1 0.419 0.682 0.800 0.028 0.172 0.000
#> SRR1818614 1 0.468 0.651 0.744 0.024 0.232 0.000
#> SRR1818611 1 0.664 0.457 0.620 0.228 0.152 0.000
#> SRR1818612 1 0.704 0.378 0.568 0.256 0.176 0.000
#> SRR1818605 1 0.349 0.674 0.856 0.008 0.124 0.012
#> SRR1818606 1 0.358 0.661 0.832 0.000 0.156 0.012
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.732 0.432772 0.020 0.200 0.476 0.016 0.288
#> SRR1818632 3 0.762 0.392657 0.032 0.216 0.408 0.012 0.332
#> SRR1818679 2 0.400 0.455783 0.012 0.812 0.112 0.000 0.064
#> SRR1818680 2 0.390 0.463580 0.012 0.820 0.104 0.000 0.064
#> SRR1818677 2 0.795 -0.045618 0.068 0.444 0.240 0.012 0.236
#> SRR1818678 2 0.799 -0.009606 0.084 0.460 0.212 0.012 0.232
#> SRR1818675 4 0.693 0.326897 0.016 0.000 0.340 0.444 0.200
#> SRR1818676 4 0.701 0.308653 0.020 0.000 0.352 0.432 0.196
#> SRR1818673 1 0.616 0.392097 0.588 0.280 0.000 0.112 0.020
#> SRR1818674 1 0.624 0.372612 0.576 0.288 0.000 0.116 0.020
#> SRR1818671 4 0.496 0.523006 0.000 0.168 0.004 0.720 0.108
#> SRR1818672 4 0.529 0.501998 0.008 0.180 0.004 0.704 0.104
#> SRR1818661 3 0.373 0.490989 0.004 0.000 0.824 0.068 0.104
#> SRR1818662 3 0.379 0.484121 0.004 0.000 0.820 0.072 0.104
#> SRR1818655 2 0.773 -0.099309 0.212 0.392 0.328 0.000 0.068
#> SRR1818656 2 0.793 -0.130833 0.268 0.360 0.296 0.000 0.076
#> SRR1818653 2 0.720 -0.077664 0.036 0.396 0.392 0.000 0.176
#> SRR1818654 2 0.718 -0.087773 0.040 0.400 0.400 0.000 0.160
#> SRR1818651 1 0.435 0.510709 0.780 0.008 0.076 0.000 0.136
#> SRR1818652 1 0.383 0.530577 0.812 0.008 0.044 0.000 0.136
#> SRR1818657 5 0.487 0.544369 0.368 0.024 0.004 0.000 0.604
#> SRR1818658 5 0.496 0.566436 0.348 0.032 0.004 0.000 0.616
#> SRR1818649 1 0.591 0.475227 0.656 0.108 0.204 0.000 0.032
#> SRR1818650 1 0.570 0.495968 0.680 0.116 0.176 0.000 0.028
#> SRR1818659 1 0.666 0.111730 0.444 0.000 0.272 0.000 0.284
#> SRR1818647 4 0.254 0.646905 0.000 0.032 0.028 0.908 0.032
#> SRR1818648 4 0.207 0.642993 0.000 0.032 0.012 0.928 0.028
#> SRR1818645 2 0.215 0.556794 0.004 0.912 0.004 0.076 0.004
#> SRR1818646 2 0.260 0.542918 0.004 0.880 0.004 0.108 0.004
#> SRR1818639 3 0.836 0.320804 0.212 0.212 0.380 0.000 0.196
#> SRR1818640 3 0.838 0.308799 0.208 0.228 0.372 0.000 0.192
#> SRR1818637 4 0.415 0.618408 0.000 0.004 0.080 0.792 0.124
#> SRR1818638 4 0.419 0.617657 0.000 0.004 0.080 0.788 0.128
#> SRR1818635 1 0.572 0.463605 0.640 0.256 0.000 0.084 0.020
#> SRR1818636 1 0.547 0.483378 0.672 0.236 0.000 0.068 0.024
#> SRR1818643 1 0.480 0.515172 0.768 0.032 0.000 0.108 0.092
#> SRR1818644 1 0.459 0.536065 0.788 0.040 0.000 0.088 0.084
#> SRR1818641 2 0.120 0.544289 0.016 0.964 0.008 0.000 0.012
#> SRR1818642 2 0.140 0.544110 0.020 0.956 0.008 0.000 0.016
#> SRR1818633 5 0.659 0.561275 0.160 0.084 0.016 0.088 0.652
#> SRR1818634 5 0.668 0.494880 0.108 0.080 0.032 0.116 0.664
#> SRR1818665 5 0.486 0.472037 0.384 0.008 0.016 0.000 0.592
#> SRR1818666 5 0.496 0.476053 0.384 0.012 0.016 0.000 0.588
#> SRR1818667 2 0.568 0.148922 0.000 0.540 0.000 0.372 0.088
#> SRR1818668 2 0.594 0.136468 0.000 0.524 0.000 0.360 0.116
#> SRR1818669 5 0.843 -0.093141 0.264 0.212 0.180 0.000 0.344
#> SRR1818670 5 0.841 -0.074916 0.264 0.212 0.176 0.000 0.348
#> SRR1818663 1 0.321 0.497168 0.812 0.000 0.008 0.000 0.180
#> SRR1818664 1 0.305 0.506009 0.820 0.000 0.004 0.000 0.176
#> SRR1818629 2 0.669 0.141613 0.008 0.468 0.000 0.332 0.192
#> SRR1818630 2 0.652 0.153419 0.000 0.476 0.000 0.300 0.224
#> SRR1818627 5 0.531 0.516395 0.196 0.000 0.056 0.040 0.708
#> SRR1818628 5 0.523 0.518388 0.176 0.004 0.052 0.040 0.728
#> SRR1818621 3 0.317 0.523693 0.060 0.000 0.856 0.000 0.084
#> SRR1818622 3 0.259 0.540300 0.048 0.000 0.900 0.008 0.044
#> SRR1818625 1 0.186 0.582294 0.924 0.004 0.004 0.000 0.068
#> SRR1818626 1 0.218 0.577111 0.908 0.008 0.004 0.000 0.080
#> SRR1818623 4 0.650 0.369998 0.000 0.008 0.336 0.496 0.160
#> SRR1818624 4 0.634 0.458944 0.000 0.016 0.280 0.564 0.140
#> SRR1818619 5 0.512 0.613240 0.272 0.028 0.016 0.008 0.676
#> SRR1818620 5 0.501 0.607099 0.288 0.032 0.016 0.000 0.664
#> SRR1818617 2 0.685 0.428783 0.168 0.636 0.092 0.076 0.028
#> SRR1818618 2 0.741 0.397037 0.164 0.588 0.124 0.096 0.028
#> SRR1818615 4 0.621 -0.071477 0.048 0.444 0.000 0.464 0.044
#> SRR1818616 2 0.632 0.000358 0.052 0.464 0.000 0.436 0.048
#> SRR1818609 4 0.308 0.582938 0.004 0.124 0.000 0.852 0.020
#> SRR1818610 4 0.289 0.590474 0.004 0.116 0.000 0.864 0.016
#> SRR1818607 2 0.255 0.545918 0.004 0.884 0.004 0.104 0.004
#> SRR1818608 2 0.245 0.554260 0.004 0.896 0.004 0.088 0.008
#> SRR1818613 1 0.502 0.420036 0.708 0.004 0.096 0.000 0.192
#> SRR1818614 1 0.531 0.426927 0.688 0.004 0.160 0.000 0.148
#> SRR1818611 1 0.516 0.531618 0.728 0.072 0.168 0.000 0.032
#> SRR1818612 1 0.502 0.532982 0.732 0.092 0.160 0.000 0.016
#> SRR1818605 1 0.512 0.420606 0.696 0.000 0.080 0.008 0.216
#> SRR1818606 1 0.522 0.421217 0.692 0.000 0.092 0.008 0.208
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.8668 0.3956 0.036 0.120 0.372 0.064 0.256 0.152
#> SRR1818632 3 0.8722 0.4217 0.040 0.120 0.380 0.060 0.212 0.188
#> SRR1818679 2 0.4509 0.4437 0.004 0.744 0.168 0.000 0.044 0.040
#> SRR1818680 2 0.4546 0.4414 0.004 0.744 0.172 0.004 0.044 0.032
#> SRR1818677 3 0.8868 0.4351 0.092 0.212 0.320 0.020 0.124 0.232
#> SRR1818678 3 0.8784 0.4313 0.104 0.240 0.300 0.008 0.128 0.220
#> SRR1818675 4 0.4780 0.4596 0.020 0.000 0.068 0.744 0.140 0.028
#> SRR1818676 4 0.4780 0.4596 0.020 0.000 0.068 0.744 0.140 0.028
#> SRR1818673 1 0.5469 0.4974 0.624 0.220 0.140 0.008 0.008 0.000
#> SRR1818674 1 0.5923 0.4839 0.600 0.220 0.148 0.020 0.008 0.004
#> SRR1818671 4 0.7401 0.3518 0.000 0.128 0.308 0.344 0.000 0.220
#> SRR1818672 3 0.7427 -0.4824 0.000 0.132 0.324 0.324 0.000 0.220
#> SRR1818661 5 0.5790 0.2453 0.004 0.000 0.192 0.156 0.616 0.032
#> SRR1818662 5 0.5742 0.2367 0.004 0.000 0.200 0.152 0.616 0.028
#> SRR1818655 5 0.8234 0.1178 0.196 0.224 0.112 0.000 0.384 0.084
#> SRR1818656 5 0.8442 0.0818 0.224 0.236 0.100 0.000 0.332 0.108
#> SRR1818653 5 0.6368 0.3021 0.008 0.252 0.044 0.000 0.544 0.152
#> SRR1818654 5 0.6207 0.3270 0.008 0.248 0.052 0.000 0.572 0.120
#> SRR1818651 1 0.4793 0.5739 0.716 0.004 0.020 0.000 0.092 0.168
#> SRR1818652 1 0.3928 0.6191 0.792 0.004 0.012 0.000 0.072 0.120
#> SRR1818657 6 0.3515 0.6999 0.192 0.000 0.016 0.000 0.012 0.780
#> SRR1818658 6 0.3056 0.7118 0.184 0.000 0.004 0.000 0.008 0.804
#> SRR1818649 1 0.6324 0.4086 0.600 0.040 0.084 0.004 0.232 0.040
#> SRR1818650 1 0.6451 0.4369 0.608 0.056 0.084 0.004 0.204 0.044
#> SRR1818659 5 0.6455 0.1260 0.288 0.000 0.052 0.000 0.496 0.164
#> SRR1818647 4 0.5730 0.5712 0.004 0.036 0.364 0.540 0.008 0.048
#> SRR1818648 4 0.5892 0.5614 0.004 0.040 0.392 0.504 0.008 0.052
#> SRR1818645 2 0.2435 0.6116 0.004 0.900 0.064 0.016 0.008 0.008
#> SRR1818646 2 0.2928 0.6124 0.004 0.860 0.100 0.024 0.000 0.012
#> SRR1818639 5 0.7894 0.0825 0.164 0.060 0.140 0.000 0.448 0.188
#> SRR1818640 5 0.8053 0.0706 0.160 0.080 0.156 0.000 0.440 0.164
#> SRR1818637 4 0.0622 0.5841 0.000 0.008 0.012 0.980 0.000 0.000
#> SRR1818638 4 0.0810 0.5814 0.000 0.008 0.004 0.976 0.008 0.004
#> SRR1818635 1 0.4997 0.5723 0.700 0.164 0.116 0.004 0.008 0.008
#> SRR1818636 1 0.4957 0.5765 0.704 0.164 0.112 0.004 0.008 0.008
#> SRR1818643 1 0.5167 0.5909 0.740 0.064 0.092 0.052 0.000 0.052
#> SRR1818644 1 0.4899 0.6023 0.760 0.064 0.080 0.052 0.000 0.044
#> SRR1818641 2 0.2659 0.5883 0.012 0.892 0.052 0.000 0.020 0.024
#> SRR1818642 2 0.2688 0.5874 0.016 0.892 0.048 0.000 0.020 0.024
#> SRR1818633 6 0.4521 0.5834 0.044 0.016 0.100 0.032 0.020 0.788
#> SRR1818634 6 0.4556 0.5761 0.032 0.012 0.100 0.052 0.020 0.784
#> SRR1818665 6 0.5691 0.6306 0.252 0.020 0.064 0.008 0.024 0.632
#> SRR1818666 6 0.5543 0.6436 0.248 0.020 0.060 0.008 0.020 0.644
#> SRR1818667 2 0.6168 0.4875 0.000 0.600 0.104 0.212 0.008 0.076
#> SRR1818668 2 0.6381 0.4795 0.000 0.580 0.092 0.212 0.008 0.108
#> SRR1818669 3 0.8844 0.4224 0.184 0.140 0.272 0.000 0.180 0.224
#> SRR1818670 3 0.8828 0.4275 0.180 0.144 0.260 0.000 0.164 0.252
#> SRR1818663 1 0.3196 0.5843 0.816 0.000 0.020 0.000 0.008 0.156
#> SRR1818664 1 0.2944 0.6025 0.832 0.000 0.012 0.000 0.008 0.148
#> SRR1818629 2 0.6987 0.4029 0.000 0.480 0.156 0.092 0.008 0.264
#> SRR1818630 2 0.6715 0.3766 0.000 0.476 0.144 0.060 0.008 0.312
#> SRR1818627 6 0.6761 0.6385 0.160 0.004 0.076 0.120 0.044 0.596
#> SRR1818628 6 0.6638 0.6331 0.140 0.004 0.080 0.140 0.032 0.604
#> SRR1818621 5 0.2135 0.4130 0.024 0.000 0.004 0.044 0.916 0.012
#> SRR1818622 5 0.2208 0.4092 0.016 0.000 0.008 0.052 0.912 0.012
#> SRR1818625 1 0.1873 0.6536 0.924 0.000 0.008 0.000 0.020 0.048
#> SRR1818626 1 0.2164 0.6531 0.908 0.000 0.008 0.000 0.028 0.056
#> SRR1818623 4 0.6090 0.4232 0.000 0.004 0.240 0.576 0.136 0.044
#> SRR1818624 4 0.6027 0.4643 0.000 0.008 0.232 0.592 0.128 0.040
#> SRR1818619 6 0.3526 0.6770 0.108 0.012 0.032 0.012 0.004 0.832
#> SRR1818620 6 0.3360 0.6883 0.132 0.012 0.028 0.000 0.004 0.824
#> SRR1818617 2 0.7506 0.2028 0.084 0.500 0.188 0.008 0.180 0.040
#> SRR1818618 2 0.8185 0.0813 0.100 0.400 0.216 0.016 0.224 0.044
#> SRR1818615 2 0.6133 0.3917 0.008 0.552 0.284 0.128 0.004 0.024
#> SRR1818616 2 0.6224 0.4144 0.024 0.552 0.300 0.096 0.004 0.024
#> SRR1818609 4 0.6165 0.5042 0.004 0.092 0.420 0.440 0.000 0.044
#> SRR1818610 4 0.6165 0.5042 0.004 0.092 0.420 0.440 0.000 0.044
#> SRR1818607 2 0.2417 0.6161 0.004 0.888 0.088 0.012 0.008 0.000
#> SRR1818608 2 0.2388 0.6185 0.004 0.900 0.068 0.012 0.012 0.004
#> SRR1818613 1 0.5240 0.4929 0.656 0.004 0.016 0.000 0.112 0.212
#> SRR1818614 1 0.5538 0.4929 0.648 0.004 0.036 0.000 0.116 0.196
#> SRR1818611 1 0.5947 0.4617 0.632 0.028 0.072 0.004 0.224 0.040
#> SRR1818612 1 0.6062 0.4525 0.624 0.032 0.076 0.004 0.224 0.040
#> SRR1818605 1 0.5443 0.4836 0.668 0.000 0.044 0.004 0.108 0.176
#> SRR1818606 1 0.5706 0.4711 0.656 0.004 0.052 0.004 0.112 0.172
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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.576 0.844 0.927 0.4802 0.526 0.526
#> 3 3 0.635 0.724 0.886 0.2059 0.888 0.786
#> 4 4 0.590 0.673 0.841 0.0964 0.921 0.818
#> 5 5 0.592 0.588 0.786 0.1170 0.915 0.773
#> 6 6 0.627 0.562 0.780 0.0385 0.974 0.917
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
#> SRR1818631 1 0.4690 0.874005 0.900 0.100
#> SRR1818632 1 0.4690 0.874005 0.900 0.100
#> SRR1818679 2 0.6148 0.839579 0.152 0.848
#> SRR1818680 2 0.6148 0.839579 0.152 0.848
#> SRR1818677 1 0.7056 0.741216 0.808 0.192
#> SRR1818678 1 0.7056 0.741216 0.808 0.192
#> SRR1818675 2 0.9710 0.305510 0.400 0.600
#> SRR1818676 2 0.9710 0.305510 0.400 0.600
#> SRR1818673 2 0.4431 0.888103 0.092 0.908
#> SRR1818674 2 0.4431 0.888103 0.092 0.908
#> SRR1818671 2 0.0000 0.927927 0.000 1.000
#> SRR1818672 2 0.0000 0.927927 0.000 1.000
#> SRR1818661 1 0.4815 0.871871 0.896 0.104
#> SRR1818662 1 0.4815 0.871871 0.896 0.104
#> SRR1818655 1 0.0000 0.915079 1.000 0.000
#> SRR1818656 1 0.0000 0.915079 1.000 0.000
#> SRR1818653 1 0.4690 0.874005 0.900 0.100
#> SRR1818654 1 0.4690 0.874005 0.900 0.100
#> SRR1818651 1 0.0000 0.915079 1.000 0.000
#> SRR1818652 1 0.0000 0.915079 1.000 0.000
#> SRR1818657 1 0.0000 0.915079 1.000 0.000
#> SRR1818658 1 0.0000 0.915079 1.000 0.000
#> SRR1818649 1 0.1414 0.907622 0.980 0.020
#> SRR1818650 1 0.1414 0.907622 0.980 0.020
#> SRR1818659 1 0.0000 0.915079 1.000 0.000
#> SRR1818647 2 0.0000 0.927927 0.000 1.000
#> SRR1818648 2 0.0000 0.927927 0.000 1.000
#> SRR1818645 2 0.0376 0.927199 0.004 0.996
#> SRR1818646 2 0.0376 0.927199 0.004 0.996
#> SRR1818639 1 0.0000 0.915079 1.000 0.000
#> SRR1818640 1 0.0000 0.915079 1.000 0.000
#> SRR1818637 2 0.0000 0.927927 0.000 1.000
#> SRR1818638 2 0.0000 0.927927 0.000 1.000
#> SRR1818635 2 0.4431 0.888103 0.092 0.908
#> SRR1818636 2 0.4431 0.888103 0.092 0.908
#> SRR1818643 1 0.9998 0.000566 0.508 0.492
#> SRR1818644 1 0.9998 0.000566 0.508 0.492
#> SRR1818641 2 0.6148 0.839579 0.152 0.848
#> SRR1818642 2 0.6148 0.839579 0.152 0.848
#> SRR1818633 1 0.7453 0.757654 0.788 0.212
#> SRR1818634 1 0.7453 0.757654 0.788 0.212
#> SRR1818665 1 0.0000 0.915079 1.000 0.000
#> SRR1818666 1 0.0000 0.915079 1.000 0.000
#> SRR1818667 2 0.0000 0.927927 0.000 1.000
#> SRR1818668 2 0.0000 0.927927 0.000 1.000
#> SRR1818669 1 0.0000 0.915079 1.000 0.000
#> SRR1818670 1 0.0000 0.915079 1.000 0.000
#> SRR1818663 1 0.0000 0.915079 1.000 0.000
#> SRR1818664 1 0.0000 0.915079 1.000 0.000
#> SRR1818629 2 0.0000 0.927927 0.000 1.000
#> SRR1818630 2 0.0000 0.927927 0.000 1.000
#> SRR1818627 1 0.0000 0.915079 1.000 0.000
#> SRR1818628 1 0.0000 0.915079 1.000 0.000
#> SRR1818621 1 0.4690 0.874005 0.900 0.100
#> SRR1818622 1 0.4690 0.874005 0.900 0.100
#> SRR1818625 1 0.0000 0.915079 1.000 0.000
#> SRR1818626 1 0.0000 0.915079 1.000 0.000
#> SRR1818623 1 0.9754 0.419584 0.592 0.408
#> SRR1818624 1 0.9754 0.419584 0.592 0.408
#> SRR1818619 1 0.0000 0.915079 1.000 0.000
#> SRR1818620 1 0.0000 0.915079 1.000 0.000
#> SRR1818617 1 0.0000 0.915079 1.000 0.000
#> SRR1818618 1 0.0000 0.915079 1.000 0.000
#> SRR1818615 2 0.0000 0.927927 0.000 1.000
#> SRR1818616 2 0.0000 0.927927 0.000 1.000
#> SRR1818609 2 0.0000 0.927927 0.000 1.000
#> SRR1818610 2 0.0000 0.927927 0.000 1.000
#> SRR1818607 2 0.0376 0.927199 0.004 0.996
#> SRR1818608 2 0.0376 0.927199 0.004 0.996
#> SRR1818613 1 0.0000 0.915079 1.000 0.000
#> SRR1818614 1 0.0000 0.915079 1.000 0.000
#> SRR1818611 1 0.1414 0.907622 0.980 0.020
#> SRR1818612 1 0.1414 0.907622 0.980 0.020
#> SRR1818605 1 0.3879 0.885352 0.924 0.076
#> SRR1818606 1 0.3879 0.885352 0.924 0.076
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.5968 0.1922 0.636 0.000 0.364
#> SRR1818632 1 0.5968 0.1922 0.636 0.000 0.364
#> SRR1818679 2 0.4164 0.7821 0.144 0.848 0.008
#> SRR1818680 2 0.4164 0.7821 0.144 0.848 0.008
#> SRR1818677 1 0.4682 0.6069 0.804 0.192 0.004
#> SRR1818678 1 0.4682 0.6069 0.804 0.192 0.004
#> SRR1818675 2 0.9625 -0.0777 0.204 0.408 0.388
#> SRR1818676 2 0.9625 -0.0777 0.204 0.408 0.388
#> SRR1818673 2 0.3043 0.8433 0.084 0.908 0.008
#> SRR1818674 2 0.3043 0.8433 0.084 0.908 0.008
#> SRR1818671 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818672 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818661 3 0.3500 0.6380 0.116 0.004 0.880
#> SRR1818662 3 0.3500 0.6380 0.116 0.004 0.880
#> SRR1818655 1 0.0592 0.8579 0.988 0.000 0.012
#> SRR1818656 1 0.0592 0.8579 0.988 0.000 0.012
#> SRR1818653 3 0.6140 0.5505 0.404 0.000 0.596
#> SRR1818654 3 0.6140 0.5505 0.404 0.000 0.596
#> SRR1818651 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818652 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818657 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818649 1 0.1315 0.8452 0.972 0.020 0.008
#> SRR1818650 1 0.1315 0.8452 0.972 0.020 0.008
#> SRR1818659 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818647 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818648 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818645 2 0.0237 0.8890 0.000 0.996 0.004
#> SRR1818646 2 0.0237 0.8890 0.000 0.996 0.004
#> SRR1818639 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818640 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818637 2 0.3267 0.8159 0.000 0.884 0.116
#> SRR1818638 2 0.3267 0.8159 0.000 0.884 0.116
#> SRR1818635 2 0.3043 0.8433 0.084 0.908 0.008
#> SRR1818636 2 0.3043 0.8433 0.084 0.908 0.008
#> SRR1818643 1 0.6825 -0.0359 0.496 0.492 0.012
#> SRR1818644 1 0.6825 -0.0359 0.496 0.492 0.012
#> SRR1818641 2 0.4164 0.7821 0.144 0.848 0.008
#> SRR1818642 2 0.4164 0.7821 0.144 0.848 0.008
#> SRR1818633 1 0.6348 0.5238 0.740 0.212 0.048
#> SRR1818634 1 0.6348 0.5238 0.740 0.212 0.048
#> SRR1818665 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818666 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818667 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818668 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818669 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818670 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818663 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818664 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818629 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818630 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818627 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818628 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818621 3 0.6140 0.5505 0.404 0.000 0.596
#> SRR1818622 3 0.6140 0.5505 0.404 0.000 0.596
#> SRR1818625 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818623 3 0.7389 0.1589 0.036 0.408 0.556
#> SRR1818624 3 0.7389 0.1589 0.036 0.408 0.556
#> SRR1818619 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818620 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818617 1 0.0592 0.8579 0.988 0.000 0.012
#> SRR1818618 1 0.0592 0.8579 0.988 0.000 0.012
#> SRR1818615 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818616 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818609 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818610 2 0.0000 0.8900 0.000 1.000 0.000
#> SRR1818607 2 0.0237 0.8890 0.000 0.996 0.004
#> SRR1818608 2 0.0237 0.8890 0.000 0.996 0.004
#> SRR1818613 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818614 1 0.0000 0.8635 1.000 0.000 0.000
#> SRR1818611 1 0.1315 0.8452 0.972 0.020 0.008
#> SRR1818612 1 0.1315 0.8452 0.972 0.020 0.008
#> SRR1818605 1 0.5650 0.3739 0.688 0.000 0.312
#> SRR1818606 1 0.5650 0.3739 0.688 0.000 0.312
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 1 0.6637 0.09105 0.540 0.000 0.368 0.092
#> SRR1818632 1 0.6637 0.09105 0.540 0.000 0.368 0.092
#> SRR1818679 2 0.3581 0.76405 0.116 0.852 0.032 0.000
#> SRR1818680 2 0.3581 0.76405 0.116 0.852 0.032 0.000
#> SRR1818677 1 0.3569 0.62660 0.804 0.196 0.000 0.000
#> SRR1818678 1 0.3569 0.62660 0.804 0.196 0.000 0.000
#> SRR1818675 4 0.6699 0.49743 0.116 0.004 0.272 0.608
#> SRR1818676 4 0.6699 0.49743 0.116 0.004 0.272 0.608
#> SRR1818673 2 0.2266 0.80273 0.084 0.912 0.004 0.000
#> SRR1818674 2 0.2266 0.80273 0.084 0.912 0.004 0.000
#> SRR1818671 2 0.0188 0.82801 0.000 0.996 0.000 0.004
#> SRR1818672 2 0.0188 0.82801 0.000 0.996 0.000 0.004
#> SRR1818661 3 0.1637 0.26144 0.060 0.000 0.940 0.000
#> SRR1818662 3 0.1637 0.26144 0.060 0.000 0.940 0.000
#> SRR1818655 1 0.2197 0.80746 0.916 0.004 0.080 0.000
#> SRR1818656 1 0.2197 0.80746 0.916 0.004 0.080 0.000
#> SRR1818653 3 0.4830 0.50188 0.392 0.000 0.608 0.000
#> SRR1818654 3 0.4830 0.50188 0.392 0.000 0.608 0.000
#> SRR1818651 1 0.1389 0.84840 0.952 0.000 0.000 0.048
#> SRR1818652 1 0.1389 0.84840 0.952 0.000 0.000 0.048
#> SRR1818657 1 0.2216 0.83108 0.908 0.000 0.000 0.092
#> SRR1818658 1 0.2216 0.83108 0.908 0.000 0.000 0.092
#> SRR1818649 1 0.1151 0.83683 0.968 0.024 0.008 0.000
#> SRR1818650 1 0.1151 0.83683 0.968 0.024 0.008 0.000
#> SRR1818659 1 0.0336 0.84426 0.992 0.000 0.008 0.000
#> SRR1818647 2 0.4406 0.56014 0.000 0.700 0.000 0.300
#> SRR1818648 2 0.4406 0.56014 0.000 0.700 0.000 0.300
#> SRR1818645 2 0.0000 0.82808 0.000 1.000 0.000 0.000
#> SRR1818646 2 0.0000 0.82808 0.000 1.000 0.000 0.000
#> SRR1818639 1 0.0336 0.84426 0.992 0.000 0.008 0.000
#> SRR1818640 1 0.0336 0.84426 0.992 0.000 0.008 0.000
#> SRR1818637 4 0.2216 0.61178 0.000 0.092 0.000 0.908
#> SRR1818638 4 0.2216 0.61178 0.000 0.092 0.000 0.908
#> SRR1818635 2 0.2266 0.80273 0.084 0.912 0.004 0.000
#> SRR1818636 2 0.2266 0.80273 0.084 0.912 0.004 0.000
#> SRR1818643 2 0.6591 0.11845 0.424 0.496 0.080 0.000
#> SRR1818644 2 0.6591 0.11845 0.424 0.496 0.080 0.000
#> SRR1818641 2 0.3581 0.76405 0.116 0.852 0.032 0.000
#> SRR1818642 2 0.3581 0.76405 0.116 0.852 0.032 0.000
#> SRR1818633 1 0.7413 0.45667 0.624 0.216 0.068 0.092
#> SRR1818634 1 0.7413 0.45667 0.624 0.216 0.068 0.092
#> SRR1818665 1 0.1389 0.84840 0.952 0.000 0.000 0.048
#> SRR1818666 1 0.1389 0.84840 0.952 0.000 0.000 0.048
#> SRR1818667 2 0.0188 0.82801 0.000 0.996 0.000 0.004
#> SRR1818668 2 0.0188 0.82801 0.000 0.996 0.000 0.004
#> SRR1818669 1 0.2401 0.82993 0.904 0.000 0.004 0.092
#> SRR1818670 1 0.2401 0.82993 0.904 0.000 0.004 0.092
#> SRR1818663 1 0.0000 0.84501 1.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 0.84501 1.000 0.000 0.000 0.000
#> SRR1818629 2 0.0188 0.82801 0.000 0.996 0.000 0.004
#> SRR1818630 2 0.0188 0.82801 0.000 0.996 0.000 0.004
#> SRR1818627 1 0.1389 0.84840 0.952 0.000 0.000 0.048
#> SRR1818628 1 0.1389 0.84840 0.952 0.000 0.000 0.048
#> SRR1818621 3 0.4830 0.50188 0.392 0.000 0.608 0.000
#> SRR1818622 3 0.4830 0.50188 0.392 0.000 0.608 0.000
#> SRR1818625 1 0.0000 0.84501 1.000 0.000 0.000 0.000
#> SRR1818626 1 0.0000 0.84501 1.000 0.000 0.000 0.000
#> SRR1818623 3 0.6728 -0.00504 0.000 0.268 0.596 0.136
#> SRR1818624 3 0.6728 -0.00504 0.000 0.268 0.596 0.136
#> SRR1818619 1 0.2216 0.83108 0.908 0.000 0.000 0.092
#> SRR1818620 1 0.2216 0.83108 0.908 0.000 0.000 0.092
#> SRR1818617 1 0.2197 0.80746 0.916 0.004 0.080 0.000
#> SRR1818618 1 0.2197 0.80746 0.916 0.004 0.080 0.000
#> SRR1818615 2 0.0188 0.82801 0.000 0.996 0.000 0.004
#> SRR1818616 2 0.0188 0.82801 0.000 0.996 0.000 0.004
#> SRR1818609 2 0.4406 0.56014 0.000 0.700 0.000 0.300
#> SRR1818610 2 0.4406 0.56014 0.000 0.700 0.000 0.300
#> SRR1818607 2 0.0000 0.82808 0.000 1.000 0.000 0.000
#> SRR1818608 2 0.0000 0.82808 0.000 1.000 0.000 0.000
#> SRR1818613 1 0.1389 0.84840 0.952 0.000 0.000 0.048
#> SRR1818614 1 0.1389 0.84840 0.952 0.000 0.000 0.048
#> SRR1818611 1 0.1151 0.83683 0.968 0.024 0.008 0.000
#> SRR1818612 1 0.1151 0.83683 0.968 0.024 0.008 0.000
#> SRR1818605 1 0.6838 0.21534 0.524 0.004 0.380 0.092
#> SRR1818606 1 0.6838 0.21534 0.524 0.004 0.380 0.092
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 5 0.6448 0.3897 0.228 0.000 0.272 0.000 0.500
#> SRR1818632 5 0.6448 0.3897 0.228 0.000 0.272 0.000 0.500
#> SRR1818679 2 0.3322 0.7853 0.104 0.848 0.004 0.000 0.044
#> SRR1818680 2 0.3322 0.7853 0.104 0.848 0.004 0.000 0.044
#> SRR1818677 1 0.3562 0.5676 0.788 0.196 0.000 0.000 0.016
#> SRR1818678 1 0.3562 0.5676 0.788 0.196 0.000 0.000 0.016
#> SRR1818675 4 0.4818 -0.0677 0.000 0.000 0.020 0.520 0.460
#> SRR1818676 4 0.4818 -0.0677 0.000 0.000 0.020 0.520 0.460
#> SRR1818673 2 0.2112 0.8212 0.084 0.908 0.004 0.000 0.004
#> SRR1818674 2 0.2112 0.8212 0.084 0.908 0.004 0.000 0.004
#> SRR1818671 2 0.0162 0.8470 0.000 0.996 0.000 0.004 0.000
#> SRR1818672 2 0.0162 0.8470 0.000 0.996 0.000 0.004 0.000
#> SRR1818661 3 0.4740 0.4236 0.016 0.000 0.516 0.000 0.468
#> SRR1818662 3 0.4740 0.4236 0.016 0.000 0.516 0.000 0.468
#> SRR1818655 1 0.3231 0.6284 0.800 0.004 0.000 0.000 0.196
#> SRR1818656 1 0.3231 0.6284 0.800 0.004 0.000 0.000 0.196
#> SRR1818653 3 0.5774 0.3756 0.156 0.000 0.612 0.000 0.232
#> SRR1818654 3 0.5774 0.3756 0.156 0.000 0.612 0.000 0.232
#> SRR1818651 1 0.1608 0.7584 0.928 0.000 0.000 0.000 0.072
#> SRR1818652 1 0.1608 0.7584 0.928 0.000 0.000 0.000 0.072
#> SRR1818657 1 0.3480 0.5820 0.752 0.000 0.000 0.000 0.248
#> SRR1818658 1 0.3480 0.5820 0.752 0.000 0.000 0.000 0.248
#> SRR1818649 1 0.1059 0.7601 0.968 0.020 0.004 0.000 0.008
#> SRR1818650 1 0.1059 0.7601 0.968 0.020 0.004 0.000 0.008
#> SRR1818659 1 0.4010 0.4994 0.760 0.000 0.208 0.000 0.032
#> SRR1818647 4 0.4227 0.4492 0.000 0.420 0.000 0.580 0.000
#> SRR1818648 4 0.4227 0.4492 0.000 0.420 0.000 0.580 0.000
#> SRR1818645 2 0.0000 0.8476 0.000 1.000 0.000 0.000 0.000
#> SRR1818646 2 0.0000 0.8476 0.000 1.000 0.000 0.000 0.000
#> SRR1818639 1 0.1893 0.7391 0.928 0.000 0.024 0.000 0.048
#> SRR1818640 1 0.1893 0.7391 0.928 0.000 0.024 0.000 0.048
#> SRR1818637 4 0.3160 0.2988 0.000 0.000 0.188 0.808 0.004
#> SRR1818638 4 0.3160 0.2988 0.000 0.000 0.188 0.808 0.004
#> SRR1818635 2 0.2112 0.8212 0.084 0.908 0.004 0.000 0.004
#> SRR1818636 2 0.2112 0.8212 0.084 0.908 0.004 0.000 0.004
#> SRR1818643 2 0.6399 0.2169 0.308 0.496 0.000 0.000 0.196
#> SRR1818644 2 0.6399 0.2169 0.308 0.496 0.000 0.000 0.196
#> SRR1818641 2 0.3322 0.7853 0.104 0.848 0.004 0.000 0.044
#> SRR1818642 2 0.3322 0.7853 0.104 0.848 0.004 0.000 0.044
#> SRR1818633 1 0.8439 -0.1493 0.416 0.028 0.096 0.188 0.272
#> SRR1818634 1 0.8439 -0.1493 0.416 0.028 0.096 0.188 0.272
#> SRR1818665 1 0.1608 0.7584 0.928 0.000 0.000 0.000 0.072
#> SRR1818666 1 0.1608 0.7584 0.928 0.000 0.000 0.000 0.072
#> SRR1818667 2 0.0162 0.8470 0.000 0.996 0.000 0.004 0.000
#> SRR1818668 2 0.0162 0.8470 0.000 0.996 0.000 0.004 0.000
#> SRR1818669 1 0.5949 0.2080 0.588 0.000 0.172 0.000 0.240
#> SRR1818670 1 0.5949 0.2080 0.588 0.000 0.172 0.000 0.240
#> SRR1818663 1 0.0000 0.7637 1.000 0.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 0.7637 1.000 0.000 0.000 0.000 0.000
#> SRR1818629 2 0.0162 0.8470 0.000 0.996 0.000 0.004 0.000
#> SRR1818630 2 0.0162 0.8470 0.000 0.996 0.000 0.004 0.000
#> SRR1818627 1 0.1608 0.7584 0.928 0.000 0.000 0.000 0.072
#> SRR1818628 1 0.1608 0.7584 0.928 0.000 0.000 0.000 0.072
#> SRR1818621 3 0.5774 0.3756 0.156 0.000 0.612 0.000 0.232
#> SRR1818622 3 0.5774 0.3756 0.156 0.000 0.612 0.000 0.232
#> SRR1818625 1 0.0000 0.7637 1.000 0.000 0.000 0.000 0.000
#> SRR1818626 1 0.0000 0.7637 1.000 0.000 0.000 0.000 0.000
#> SRR1818623 3 0.7937 0.1950 0.000 0.080 0.356 0.324 0.240
#> SRR1818624 3 0.7937 0.1950 0.000 0.080 0.356 0.324 0.240
#> SRR1818619 1 0.3480 0.5820 0.752 0.000 0.000 0.000 0.248
#> SRR1818620 1 0.3480 0.5820 0.752 0.000 0.000 0.000 0.248
#> SRR1818617 1 0.3231 0.6284 0.800 0.004 0.000 0.000 0.196
#> SRR1818618 1 0.3231 0.6284 0.800 0.004 0.000 0.000 0.196
#> SRR1818615 2 0.0162 0.8470 0.000 0.996 0.000 0.004 0.000
#> SRR1818616 2 0.0162 0.8470 0.000 0.996 0.000 0.004 0.000
#> SRR1818609 4 0.4227 0.4492 0.000 0.420 0.000 0.580 0.000
#> SRR1818610 4 0.4227 0.4492 0.000 0.420 0.000 0.580 0.000
#> SRR1818607 2 0.0000 0.8476 0.000 1.000 0.000 0.000 0.000
#> SRR1818608 2 0.0000 0.8476 0.000 1.000 0.000 0.000 0.000
#> SRR1818613 1 0.1608 0.7584 0.928 0.000 0.000 0.000 0.072
#> SRR1818614 1 0.1608 0.7584 0.928 0.000 0.000 0.000 0.072
#> SRR1818611 1 0.1059 0.7601 0.968 0.020 0.004 0.000 0.008
#> SRR1818612 1 0.1059 0.7601 0.968 0.020 0.004 0.000 0.008
#> SRR1818605 5 0.4318 0.5347 0.228 0.004 0.032 0.000 0.736
#> SRR1818606 5 0.4318 0.5347 0.228 0.004 0.032 0.000 0.736
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.6090 0.494 0.224 0.000 0.404 0.000 0.004 0.368
#> SRR1818632 3 0.6090 0.494 0.224 0.000 0.404 0.000 0.004 0.368
#> SRR1818679 2 0.5239 0.672 0.092 0.580 0.008 0.320 0.000 0.000
#> SRR1818680 2 0.5239 0.672 0.092 0.580 0.008 0.320 0.000 0.000
#> SRR1818677 1 0.4010 0.520 0.764 0.020 0.040 0.176 0.000 0.000
#> SRR1818678 1 0.4010 0.520 0.764 0.020 0.040 0.176 0.000 0.000
#> SRR1818675 2 0.8305 -0.541 0.000 0.332 0.288 0.088 0.104 0.188
#> SRR1818676 2 0.8305 -0.541 0.000 0.332 0.288 0.088 0.104 0.188
#> SRR1818673 2 0.5350 0.704 0.076 0.536 0.008 0.376 0.000 0.004
#> SRR1818674 2 0.5350 0.704 0.076 0.536 0.008 0.376 0.000 0.004
#> SRR1818671 2 0.3782 0.724 0.000 0.588 0.000 0.412 0.000 0.000
#> SRR1818672 2 0.3782 0.724 0.000 0.588 0.000 0.412 0.000 0.000
#> SRR1818661 6 0.0260 0.617 0.008 0.000 0.000 0.000 0.000 0.992
#> SRR1818662 6 0.0260 0.617 0.008 0.000 0.000 0.000 0.000 0.992
#> SRR1818655 1 0.3834 0.560 0.772 0.048 0.172 0.000 0.008 0.000
#> SRR1818656 1 0.3834 0.560 0.772 0.048 0.172 0.000 0.008 0.000
#> SRR1818653 5 0.0458 1.000 0.016 0.000 0.000 0.000 0.984 0.000
#> SRR1818654 5 0.0458 1.000 0.016 0.000 0.000 0.000 0.984 0.000
#> SRR1818651 1 0.1957 0.687 0.888 0.000 0.112 0.000 0.000 0.000
#> SRR1818652 1 0.1957 0.687 0.888 0.000 0.112 0.000 0.000 0.000
#> SRR1818657 1 0.3464 0.476 0.688 0.000 0.312 0.000 0.000 0.000
#> SRR1818658 1 0.3464 0.476 0.688 0.000 0.312 0.000 0.000 0.000
#> SRR1818649 1 0.1080 0.695 0.960 0.032 0.004 0.000 0.000 0.004
#> SRR1818650 1 0.1080 0.695 0.960 0.032 0.004 0.000 0.000 0.004
#> SRR1818659 1 0.3841 0.300 0.616 0.000 0.004 0.000 0.380 0.000
#> SRR1818647 4 0.0260 0.632 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR1818648 4 0.0260 0.632 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR1818645 2 0.3747 0.726 0.000 0.604 0.000 0.396 0.000 0.000
#> SRR1818646 2 0.3747 0.726 0.000 0.604 0.000 0.396 0.000 0.000
#> SRR1818639 1 0.3555 0.565 0.776 0.000 0.040 0.000 0.184 0.000
#> SRR1818640 1 0.3555 0.565 0.776 0.000 0.040 0.000 0.184 0.000
#> SRR1818637 4 0.6565 0.113 0.000 0.332 0.272 0.376 0.016 0.004
#> SRR1818638 4 0.6565 0.113 0.000 0.332 0.272 0.376 0.016 0.004
#> SRR1818635 2 0.5350 0.704 0.076 0.536 0.008 0.376 0.000 0.004
#> SRR1818636 2 0.5350 0.704 0.076 0.536 0.008 0.376 0.000 0.004
#> SRR1818643 2 0.5772 0.195 0.272 0.540 0.180 0.000 0.008 0.000
#> SRR1818644 2 0.5772 0.195 0.272 0.540 0.180 0.000 0.008 0.000
#> SRR1818641 2 0.5239 0.672 0.092 0.580 0.008 0.320 0.000 0.000
#> SRR1818642 2 0.5239 0.672 0.092 0.580 0.008 0.320 0.000 0.000
#> SRR1818633 1 0.7366 -0.257 0.348 0.004 0.332 0.212 0.000 0.104
#> SRR1818634 1 0.7366 -0.257 0.348 0.004 0.332 0.212 0.000 0.104
#> SRR1818665 1 0.2135 0.681 0.872 0.000 0.128 0.000 0.000 0.000
#> SRR1818666 1 0.2135 0.681 0.872 0.000 0.128 0.000 0.000 0.000
#> SRR1818667 2 0.3782 0.724 0.000 0.588 0.000 0.412 0.000 0.000
#> SRR1818668 2 0.3782 0.724 0.000 0.588 0.000 0.412 0.000 0.000
#> SRR1818669 1 0.4107 0.112 0.540 0.000 0.452 0.000 0.004 0.004
#> SRR1818670 1 0.4107 0.112 0.540 0.000 0.452 0.000 0.004 0.004
#> SRR1818663 1 0.0146 0.700 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1818664 1 0.0146 0.700 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1818629 2 0.3782 0.724 0.000 0.588 0.000 0.412 0.000 0.000
#> SRR1818630 2 0.3782 0.724 0.000 0.588 0.000 0.412 0.000 0.000
#> SRR1818627 1 0.2135 0.681 0.872 0.000 0.128 0.000 0.000 0.000
#> SRR1818628 1 0.2135 0.681 0.872 0.000 0.128 0.000 0.000 0.000
#> SRR1818621 5 0.0458 1.000 0.016 0.000 0.000 0.000 0.984 0.000
#> SRR1818622 5 0.0458 1.000 0.016 0.000 0.000 0.000 0.984 0.000
#> SRR1818625 1 0.0146 0.700 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1818626 1 0.0146 0.700 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1818623 6 0.3765 0.591 0.000 0.000 0.000 0.404 0.000 0.596
#> SRR1818624 6 0.3765 0.591 0.000 0.000 0.000 0.404 0.000 0.596
#> SRR1818619 1 0.3464 0.476 0.688 0.000 0.312 0.000 0.000 0.000
#> SRR1818620 1 0.3464 0.476 0.688 0.000 0.312 0.000 0.000 0.000
#> SRR1818617 1 0.3834 0.560 0.772 0.048 0.172 0.000 0.008 0.000
#> SRR1818618 1 0.3834 0.560 0.772 0.048 0.172 0.000 0.008 0.000
#> SRR1818615 2 0.3782 0.724 0.000 0.588 0.000 0.412 0.000 0.000
#> SRR1818616 2 0.3782 0.724 0.000 0.588 0.000 0.412 0.000 0.000
#> SRR1818609 4 0.0260 0.632 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR1818610 4 0.0260 0.632 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR1818607 2 0.3747 0.726 0.000 0.604 0.000 0.396 0.000 0.000
#> SRR1818608 2 0.3747 0.726 0.000 0.604 0.000 0.396 0.000 0.000
#> SRR1818613 1 0.1957 0.687 0.888 0.000 0.112 0.000 0.000 0.000
#> SRR1818614 1 0.1957 0.687 0.888 0.000 0.112 0.000 0.000 0.000
#> SRR1818611 1 0.1080 0.695 0.960 0.032 0.004 0.000 0.000 0.004
#> SRR1818612 1 0.1080 0.695 0.960 0.032 0.004 0.000 0.000 0.004
#> SRR1818605 3 0.7760 0.547 0.200 0.048 0.444 0.000 0.108 0.200
#> SRR1818606 3 0.7760 0.547 0.200 0.048 0.444 0.000 0.108 0.200
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 15216 rows and 75 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.533 0.884 0.909 0.4822 0.504 0.504
#> 3 3 0.476 0.638 0.777 0.3015 0.872 0.748
#> 4 4 0.497 0.613 0.743 0.1190 0.908 0.770
#> 5 5 0.511 0.518 0.687 0.0751 0.923 0.774
#> 6 6 0.549 0.420 0.631 0.0527 0.916 0.729
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
#> SRR1818631 1 0.6887 0.813 0.816 0.184
#> SRR1818632 1 0.6887 0.813 0.816 0.184
#> SRR1818679 1 0.7453 0.740 0.788 0.212
#> SRR1818680 1 0.7453 0.740 0.788 0.212
#> SRR1818677 2 0.6887 0.904 0.184 0.816
#> SRR1818678 2 0.6887 0.904 0.184 0.816
#> SRR1818675 1 0.8144 0.761 0.748 0.252
#> SRR1818676 1 0.8144 0.761 0.748 0.252
#> SRR1818673 2 0.6887 0.904 0.184 0.816
#> SRR1818674 2 0.6887 0.904 0.184 0.816
#> SRR1818671 2 0.4562 0.909 0.096 0.904
#> SRR1818672 2 0.4562 0.909 0.096 0.904
#> SRR1818661 1 0.7299 0.796 0.796 0.204
#> SRR1818662 1 0.7299 0.796 0.796 0.204
#> SRR1818655 1 0.0938 0.926 0.988 0.012
#> SRR1818656 1 0.0938 0.926 0.988 0.012
#> SRR1818653 1 0.2423 0.909 0.960 0.040
#> SRR1818654 1 0.2423 0.909 0.960 0.040
#> SRR1818651 1 0.0376 0.926 0.996 0.004
#> SRR1818652 1 0.0376 0.926 0.996 0.004
#> SRR1818657 1 0.0938 0.926 0.988 0.012
#> SRR1818658 1 0.0938 0.926 0.988 0.012
#> SRR1818649 1 0.0938 0.926 0.988 0.012
#> SRR1818650 1 0.0938 0.926 0.988 0.012
#> SRR1818659 1 0.0938 0.926 0.988 0.012
#> SRR1818647 2 0.1184 0.866 0.016 0.984
#> SRR1818648 2 0.1184 0.866 0.016 0.984
#> SRR1818645 2 0.5629 0.912 0.132 0.868
#> SRR1818646 2 0.5629 0.912 0.132 0.868
#> SRR1818639 1 0.0938 0.926 0.988 0.012
#> SRR1818640 1 0.0938 0.926 0.988 0.012
#> SRR1818637 2 0.1184 0.866 0.016 0.984
#> SRR1818638 2 0.1184 0.866 0.016 0.984
#> SRR1818635 2 0.7376 0.887 0.208 0.792
#> SRR1818636 2 0.7376 0.887 0.208 0.792
#> SRR1818643 2 0.7376 0.887 0.208 0.792
#> SRR1818644 2 0.7376 0.887 0.208 0.792
#> SRR1818641 2 0.7376 0.887 0.208 0.792
#> SRR1818642 2 0.7376 0.887 0.208 0.792
#> SRR1818633 1 0.8813 0.585 0.700 0.300
#> SRR1818634 1 0.8813 0.585 0.700 0.300
#> SRR1818665 1 0.0938 0.926 0.988 0.012
#> SRR1818666 1 0.0938 0.926 0.988 0.012
#> SRR1818667 2 0.3114 0.899 0.056 0.944
#> SRR1818668 2 0.3114 0.899 0.056 0.944
#> SRR1818669 1 0.0938 0.926 0.988 0.012
#> SRR1818670 1 0.0938 0.926 0.988 0.012
#> SRR1818663 1 0.0672 0.926 0.992 0.008
#> SRR1818664 1 0.0672 0.926 0.992 0.008
#> SRR1818629 2 0.6801 0.905 0.180 0.820
#> SRR1818630 2 0.6801 0.905 0.180 0.820
#> SRR1818627 1 0.0000 0.925 1.000 0.000
#> SRR1818628 1 0.0000 0.925 1.000 0.000
#> SRR1818621 1 0.5519 0.851 0.872 0.128
#> SRR1818622 1 0.5519 0.851 0.872 0.128
#> SRR1818625 1 0.0938 0.926 0.988 0.012
#> SRR1818626 1 0.0938 0.926 0.988 0.012
#> SRR1818623 2 0.1184 0.866 0.016 0.984
#> SRR1818624 2 0.1184 0.866 0.016 0.984
#> SRR1818619 1 0.0938 0.926 0.988 0.012
#> SRR1818620 1 0.0938 0.926 0.988 0.012
#> SRR1818617 2 0.6887 0.904 0.184 0.816
#> SRR1818618 2 0.6887 0.904 0.184 0.816
#> SRR1818615 2 0.3431 0.902 0.064 0.936
#> SRR1818616 2 0.3431 0.902 0.064 0.936
#> SRR1818609 2 0.1184 0.878 0.016 0.984
#> SRR1818610 2 0.1184 0.878 0.016 0.984
#> SRR1818607 2 0.5629 0.912 0.132 0.868
#> SRR1818608 2 0.5629 0.912 0.132 0.868
#> SRR1818613 1 0.0376 0.924 0.996 0.004
#> SRR1818614 1 0.0376 0.924 0.996 0.004
#> SRR1818611 1 0.0938 0.926 0.988 0.012
#> SRR1818612 1 0.0938 0.926 0.988 0.012
#> SRR1818605 1 0.2423 0.909 0.960 0.040
#> SRR1818606 1 0.2423 0.909 0.960 0.040
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.6209 0.438 0.368 0.004 0.628
#> SRR1818632 3 0.6209 0.438 0.368 0.004 0.628
#> SRR1818679 3 0.9684 0.321 0.340 0.224 0.436
#> SRR1818680 3 0.9684 0.321 0.340 0.224 0.436
#> SRR1818677 2 0.5181 0.763 0.084 0.832 0.084
#> SRR1818678 2 0.5181 0.763 0.084 0.832 0.084
#> SRR1818675 3 0.5178 0.608 0.164 0.028 0.808
#> SRR1818676 3 0.5178 0.608 0.164 0.028 0.808
#> SRR1818673 2 0.4652 0.773 0.064 0.856 0.080
#> SRR1818674 2 0.4652 0.773 0.064 0.856 0.080
#> SRR1818671 2 0.3030 0.756 0.004 0.904 0.092
#> SRR1818672 2 0.3030 0.756 0.004 0.904 0.092
#> SRR1818661 3 0.5618 0.559 0.260 0.008 0.732
#> SRR1818662 3 0.5618 0.559 0.260 0.008 0.732
#> SRR1818655 1 0.2772 0.794 0.916 0.004 0.080
#> SRR1818656 1 0.2772 0.794 0.916 0.004 0.080
#> SRR1818653 1 0.5254 0.605 0.736 0.000 0.264
#> SRR1818654 1 0.5254 0.605 0.736 0.000 0.264
#> SRR1818651 1 0.3116 0.790 0.892 0.000 0.108
#> SRR1818652 1 0.3116 0.790 0.892 0.000 0.108
#> SRR1818657 1 0.1411 0.816 0.964 0.000 0.036
#> SRR1818658 1 0.1411 0.816 0.964 0.000 0.036
#> SRR1818649 1 0.4137 0.759 0.872 0.032 0.096
#> SRR1818650 1 0.4137 0.759 0.872 0.032 0.096
#> SRR1818659 1 0.2400 0.801 0.932 0.004 0.064
#> SRR1818647 2 0.6305 0.187 0.000 0.516 0.484
#> SRR1818648 2 0.6305 0.187 0.000 0.516 0.484
#> SRR1818645 2 0.1636 0.784 0.020 0.964 0.016
#> SRR1818646 2 0.1636 0.784 0.020 0.964 0.016
#> SRR1818639 1 0.2590 0.797 0.924 0.004 0.072
#> SRR1818640 1 0.2590 0.797 0.924 0.004 0.072
#> SRR1818637 2 0.5926 0.490 0.000 0.644 0.356
#> SRR1818638 2 0.5926 0.490 0.000 0.644 0.356
#> SRR1818635 2 0.5566 0.751 0.108 0.812 0.080
#> SRR1818636 2 0.5566 0.751 0.108 0.812 0.080
#> SRR1818643 2 0.6184 0.737 0.108 0.780 0.112
#> SRR1818644 2 0.6184 0.737 0.108 0.780 0.112
#> SRR1818641 2 0.6389 0.718 0.124 0.768 0.108
#> SRR1818642 2 0.6389 0.718 0.124 0.768 0.108
#> SRR1818633 1 0.9940 -0.290 0.388 0.308 0.304
#> SRR1818634 1 0.9940 -0.290 0.388 0.308 0.304
#> SRR1818665 1 0.0424 0.816 0.992 0.000 0.008
#> SRR1818666 1 0.0424 0.816 0.992 0.000 0.008
#> SRR1818667 2 0.4293 0.728 0.004 0.832 0.164
#> SRR1818668 2 0.4293 0.728 0.004 0.832 0.164
#> SRR1818669 1 0.1411 0.816 0.964 0.000 0.036
#> SRR1818670 1 0.1411 0.816 0.964 0.000 0.036
#> SRR1818663 1 0.0592 0.816 0.988 0.000 0.012
#> SRR1818664 1 0.0592 0.816 0.988 0.000 0.012
#> SRR1818629 2 0.3375 0.785 0.048 0.908 0.044
#> SRR1818630 2 0.3375 0.785 0.048 0.908 0.044
#> SRR1818627 1 0.1964 0.811 0.944 0.000 0.056
#> SRR1818628 1 0.1964 0.811 0.944 0.000 0.056
#> SRR1818621 1 0.6483 0.117 0.544 0.004 0.452
#> SRR1818622 1 0.6483 0.117 0.544 0.004 0.452
#> SRR1818625 1 0.1337 0.814 0.972 0.012 0.016
#> SRR1818626 1 0.1337 0.814 0.972 0.012 0.016
#> SRR1818623 3 0.6299 -0.197 0.000 0.476 0.524
#> SRR1818624 3 0.6299 -0.197 0.000 0.476 0.524
#> SRR1818619 1 0.2955 0.796 0.912 0.008 0.080
#> SRR1818620 1 0.2955 0.796 0.912 0.008 0.080
#> SRR1818617 2 0.6181 0.729 0.116 0.780 0.104
#> SRR1818618 2 0.6181 0.729 0.116 0.780 0.104
#> SRR1818615 2 0.2772 0.761 0.004 0.916 0.080
#> SRR1818616 2 0.2772 0.761 0.004 0.916 0.080
#> SRR1818609 2 0.4931 0.648 0.000 0.768 0.232
#> SRR1818610 2 0.4931 0.648 0.000 0.768 0.232
#> SRR1818607 2 0.1636 0.784 0.020 0.964 0.016
#> SRR1818608 2 0.1636 0.784 0.020 0.964 0.016
#> SRR1818613 1 0.3116 0.790 0.892 0.000 0.108
#> SRR1818614 1 0.3116 0.790 0.892 0.000 0.108
#> SRR1818611 1 0.3889 0.765 0.884 0.032 0.084
#> SRR1818612 1 0.3889 0.765 0.884 0.032 0.084
#> SRR1818605 1 0.5216 0.587 0.740 0.000 0.260
#> SRR1818606 1 0.5216 0.587 0.740 0.000 0.260
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.6139 0.631 0.244 0.000 0.656 0.100
#> SRR1818632 3 0.6139 0.631 0.244 0.000 0.656 0.100
#> SRR1818679 3 0.9215 0.341 0.268 0.244 0.400 0.088
#> SRR1818680 3 0.9215 0.341 0.268 0.244 0.400 0.088
#> SRR1818677 2 0.5169 0.678 0.024 0.788 0.072 0.116
#> SRR1818678 2 0.5169 0.678 0.024 0.788 0.072 0.116
#> SRR1818675 3 0.6083 0.434 0.056 0.000 0.584 0.360
#> SRR1818676 3 0.6083 0.434 0.056 0.000 0.584 0.360
#> SRR1818673 2 0.2634 0.736 0.020 0.920 0.028 0.032
#> SRR1818674 2 0.2634 0.736 0.020 0.920 0.028 0.032
#> SRR1818671 2 0.4655 0.409 0.000 0.684 0.004 0.312
#> SRR1818672 2 0.4655 0.409 0.000 0.684 0.004 0.312
#> SRR1818661 3 0.6133 0.591 0.124 0.000 0.672 0.204
#> SRR1818662 3 0.6133 0.591 0.124 0.000 0.672 0.204
#> SRR1818655 1 0.5601 0.673 0.756 0.020 0.132 0.092
#> SRR1818656 1 0.5601 0.673 0.756 0.020 0.132 0.092
#> SRR1818653 1 0.6396 0.334 0.564 0.000 0.360 0.076
#> SRR1818654 1 0.6396 0.334 0.564 0.000 0.360 0.076
#> SRR1818651 1 0.3047 0.740 0.872 0.000 0.116 0.012
#> SRR1818652 1 0.3047 0.740 0.872 0.000 0.116 0.012
#> SRR1818657 1 0.2578 0.762 0.912 0.000 0.052 0.036
#> SRR1818658 1 0.2578 0.762 0.912 0.000 0.052 0.036
#> SRR1818649 1 0.4897 0.714 0.808 0.044 0.108 0.040
#> SRR1818650 1 0.4897 0.714 0.808 0.044 0.108 0.040
#> SRR1818659 1 0.3670 0.736 0.860 0.008 0.100 0.032
#> SRR1818647 4 0.6275 0.790 0.000 0.256 0.104 0.640
#> SRR1818648 4 0.6275 0.790 0.000 0.256 0.104 0.640
#> SRR1818645 2 0.2714 0.695 0.000 0.884 0.004 0.112
#> SRR1818646 2 0.2714 0.695 0.000 0.884 0.004 0.112
#> SRR1818639 1 0.5573 0.661 0.748 0.012 0.148 0.092
#> SRR1818640 1 0.5573 0.661 0.748 0.012 0.148 0.092
#> SRR1818637 4 0.5491 0.762 0.000 0.260 0.052 0.688
#> SRR1818638 4 0.5491 0.762 0.000 0.260 0.052 0.688
#> SRR1818635 2 0.3133 0.732 0.028 0.900 0.036 0.036
#> SRR1818636 2 0.3133 0.732 0.028 0.900 0.036 0.036
#> SRR1818643 2 0.4081 0.713 0.032 0.856 0.060 0.052
#> SRR1818644 2 0.4081 0.713 0.032 0.856 0.060 0.052
#> SRR1818641 2 0.4303 0.707 0.032 0.844 0.052 0.072
#> SRR1818642 2 0.4303 0.707 0.032 0.844 0.052 0.072
#> SRR1818633 1 0.9606 -0.245 0.332 0.292 0.252 0.124
#> SRR1818634 1 0.9606 -0.245 0.332 0.292 0.252 0.124
#> SRR1818665 1 0.0927 0.766 0.976 0.000 0.008 0.016
#> SRR1818666 1 0.0927 0.766 0.976 0.000 0.008 0.016
#> SRR1818667 2 0.5728 0.159 0.000 0.600 0.036 0.364
#> SRR1818668 2 0.5728 0.159 0.000 0.600 0.036 0.364
#> SRR1818669 1 0.2450 0.759 0.912 0.000 0.072 0.016
#> SRR1818670 1 0.2450 0.759 0.912 0.000 0.072 0.016
#> SRR1818663 1 0.1697 0.765 0.952 0.004 0.028 0.016
#> SRR1818664 1 0.1697 0.765 0.952 0.004 0.028 0.016
#> SRR1818629 2 0.2761 0.735 0.016 0.908 0.012 0.064
#> SRR1818630 2 0.2761 0.735 0.016 0.908 0.012 0.064
#> SRR1818627 1 0.2450 0.758 0.912 0.000 0.072 0.016
#> SRR1818628 1 0.2450 0.758 0.912 0.000 0.072 0.016
#> SRR1818621 3 0.6214 0.375 0.360 0.000 0.576 0.064
#> SRR1818622 3 0.6214 0.375 0.360 0.000 0.576 0.064
#> SRR1818625 1 0.2353 0.765 0.928 0.008 0.040 0.024
#> SRR1818626 1 0.2353 0.765 0.928 0.008 0.040 0.024
#> SRR1818623 4 0.6941 0.694 0.000 0.192 0.220 0.588
#> SRR1818624 4 0.6941 0.694 0.000 0.192 0.220 0.588
#> SRR1818619 1 0.4238 0.713 0.828 0.004 0.108 0.060
#> SRR1818620 1 0.4238 0.713 0.828 0.004 0.108 0.060
#> SRR1818617 2 0.5974 0.624 0.040 0.744 0.096 0.120
#> SRR1818618 2 0.5974 0.624 0.040 0.744 0.096 0.120
#> SRR1818615 2 0.4164 0.493 0.000 0.736 0.000 0.264
#> SRR1818616 2 0.4164 0.493 0.000 0.736 0.000 0.264
#> SRR1818609 4 0.4888 0.591 0.000 0.412 0.000 0.588
#> SRR1818610 4 0.4888 0.591 0.000 0.412 0.000 0.588
#> SRR1818607 2 0.2714 0.695 0.000 0.884 0.004 0.112
#> SRR1818608 2 0.2714 0.695 0.000 0.884 0.004 0.112
#> SRR1818613 1 0.2859 0.738 0.880 0.000 0.112 0.008
#> SRR1818614 1 0.2859 0.738 0.880 0.000 0.112 0.008
#> SRR1818611 1 0.4717 0.719 0.820 0.044 0.096 0.040
#> SRR1818612 1 0.4717 0.719 0.820 0.044 0.096 0.040
#> SRR1818605 1 0.5069 0.397 0.664 0.000 0.320 0.016
#> SRR1818606 1 0.5069 0.397 0.664 0.000 0.320 0.016
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.501 0.6338 0.160 0.000 0.740 0.028 NA
#> SRR1818632 3 0.501 0.6338 0.160 0.000 0.740 0.028 NA
#> SRR1818679 3 0.871 0.2829 0.124 0.296 0.328 0.020 NA
#> SRR1818680 3 0.871 0.2829 0.124 0.296 0.328 0.020 NA
#> SRR1818677 2 0.663 0.4904 0.008 0.600 0.040 0.120 NA
#> SRR1818678 2 0.663 0.4904 0.008 0.600 0.040 0.120 NA
#> SRR1818675 3 0.632 0.5328 0.052 0.004 0.644 0.192 NA
#> SRR1818676 3 0.632 0.5328 0.052 0.004 0.644 0.192 NA
#> SRR1818673 2 0.192 0.5991 0.008 0.936 0.004 0.036 NA
#> SRR1818674 2 0.192 0.5991 0.008 0.936 0.004 0.036 NA
#> SRR1818671 4 0.589 0.1698 0.000 0.408 0.004 0.500 NA
#> SRR1818672 4 0.589 0.1698 0.000 0.408 0.004 0.500 NA
#> SRR1818661 3 0.429 0.6232 0.072 0.004 0.816 0.064 NA
#> SRR1818662 3 0.429 0.6232 0.072 0.004 0.816 0.064 NA
#> SRR1818655 1 0.484 0.6073 0.624 0.020 0.008 0.000 NA
#> SRR1818656 1 0.484 0.6073 0.624 0.020 0.008 0.000 NA
#> SRR1818653 1 0.654 0.2298 0.432 0.000 0.200 0.000 NA
#> SRR1818654 1 0.654 0.2298 0.432 0.000 0.200 0.000 NA
#> SRR1818651 1 0.370 0.7064 0.832 0.008 0.072 0.000 NA
#> SRR1818652 1 0.370 0.7064 0.832 0.008 0.072 0.000 NA
#> SRR1818657 1 0.473 0.6917 0.784 0.008 0.064 0.032 NA
#> SRR1818658 1 0.473 0.6917 0.784 0.008 0.064 0.032 NA
#> SRR1818649 1 0.628 0.6122 0.656 0.116 0.032 0.016 NA
#> SRR1818650 1 0.628 0.6122 0.656 0.116 0.032 0.016 NA
#> SRR1818659 1 0.400 0.6861 0.776 0.008 0.016 0.004 NA
#> SRR1818647 4 0.531 0.6009 0.000 0.092 0.164 0.716 NA
#> SRR1818648 4 0.531 0.6009 0.000 0.092 0.164 0.716 NA
#> SRR1818645 2 0.559 0.4004 0.000 0.628 0.008 0.276 NA
#> SRR1818646 2 0.559 0.4004 0.000 0.628 0.008 0.276 NA
#> SRR1818639 1 0.496 0.5994 0.632 0.012 0.024 0.000 NA
#> SRR1818640 1 0.496 0.5994 0.632 0.012 0.024 0.000 NA
#> SRR1818637 4 0.530 0.6270 0.000 0.112 0.080 0.740 NA
#> SRR1818638 4 0.530 0.6270 0.000 0.112 0.080 0.740 NA
#> SRR1818635 2 0.223 0.6001 0.012 0.924 0.004 0.032 NA
#> SRR1818636 2 0.223 0.6001 0.012 0.924 0.004 0.032 NA
#> SRR1818643 2 0.346 0.5862 0.016 0.868 0.024 0.032 NA
#> SRR1818644 2 0.346 0.5862 0.016 0.868 0.024 0.032 NA
#> SRR1818641 2 0.279 0.5885 0.020 0.884 0.012 0.000 NA
#> SRR1818642 2 0.279 0.5885 0.020 0.884 0.012 0.000 NA
#> SRR1818633 2 0.989 -0.1788 0.220 0.248 0.208 0.136 NA
#> SRR1818634 2 0.989 -0.1788 0.220 0.248 0.208 0.136 NA
#> SRR1818665 1 0.228 0.7245 0.920 0.000 0.028 0.024 NA
#> SRR1818666 1 0.228 0.7245 0.920 0.000 0.028 0.024 NA
#> SRR1818667 4 0.609 0.3340 0.000 0.356 0.016 0.540 NA
#> SRR1818668 4 0.609 0.3340 0.000 0.356 0.016 0.540 NA
#> SRR1818669 1 0.417 0.6990 0.816 0.004 0.080 0.020 NA
#> SRR1818670 1 0.417 0.6990 0.816 0.004 0.080 0.020 NA
#> SRR1818663 1 0.241 0.7258 0.916 0.012 0.020 0.008 NA
#> SRR1818664 1 0.241 0.7258 0.916 0.012 0.020 0.008 NA
#> SRR1818629 2 0.470 0.5195 0.004 0.744 0.004 0.180 NA
#> SRR1818630 2 0.470 0.5195 0.004 0.744 0.004 0.180 NA
#> SRR1818627 1 0.395 0.7043 0.828 0.000 0.068 0.028 NA
#> SRR1818628 1 0.395 0.7043 0.828 0.000 0.068 0.028 NA
#> SRR1818621 3 0.704 0.3928 0.236 0.000 0.460 0.020 NA
#> SRR1818622 3 0.704 0.3928 0.236 0.000 0.460 0.020 NA
#> SRR1818625 1 0.317 0.7222 0.872 0.020 0.016 0.008 NA
#> SRR1818626 1 0.317 0.7222 0.872 0.020 0.016 0.008 NA
#> SRR1818623 4 0.659 0.4216 0.000 0.056 0.296 0.560 NA
#> SRR1818624 4 0.659 0.4216 0.000 0.056 0.296 0.560 NA
#> SRR1818619 1 0.635 0.5935 0.660 0.024 0.100 0.036 NA
#> SRR1818620 1 0.635 0.5935 0.660 0.024 0.100 0.036 NA
#> SRR1818617 2 0.647 0.4844 0.040 0.604 0.016 0.072 NA
#> SRR1818618 2 0.647 0.4844 0.040 0.604 0.016 0.072 NA
#> SRR1818615 2 0.521 0.0494 0.000 0.540 0.004 0.420 NA
#> SRR1818616 2 0.521 0.0494 0.000 0.540 0.004 0.420 NA
#> SRR1818609 4 0.398 0.6119 0.000 0.188 0.016 0.780 NA
#> SRR1818610 4 0.398 0.6119 0.000 0.188 0.016 0.780 NA
#> SRR1818607 2 0.559 0.4004 0.000 0.628 0.008 0.276 NA
#> SRR1818608 2 0.559 0.4004 0.000 0.628 0.008 0.276 NA
#> SRR1818613 1 0.358 0.7065 0.840 0.008 0.072 0.000 NA
#> SRR1818614 1 0.358 0.7065 0.840 0.008 0.072 0.000 NA
#> SRR1818611 1 0.606 0.6222 0.672 0.116 0.024 0.016 NA
#> SRR1818612 1 0.606 0.6222 0.672 0.116 0.024 0.016 NA
#> SRR1818605 1 0.606 0.3532 0.584 0.004 0.296 0.008 NA
#> SRR1818606 1 0.606 0.3532 0.584 0.004 0.296 0.008 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.364 0.46192 0.124 0.000 0.816 0.020 0.008 0.032
#> SRR1818632 3 0.364 0.46192 0.124 0.000 0.816 0.020 0.008 0.032
#> SRR1818679 3 0.807 -0.00392 0.052 0.192 0.428 0.028 0.060 0.240
#> SRR1818680 3 0.807 -0.00392 0.052 0.192 0.428 0.028 0.060 0.240
#> SRR1818677 2 0.705 0.41908 0.008 0.508 0.064 0.060 0.064 0.296
#> SRR1818678 2 0.705 0.41908 0.008 0.508 0.064 0.060 0.064 0.296
#> SRR1818675 3 0.707 0.44361 0.032 0.004 0.472 0.308 0.136 0.048
#> SRR1818676 3 0.707 0.44361 0.032 0.004 0.472 0.308 0.136 0.048
#> SRR1818673 2 0.132 0.58584 0.000 0.956 0.004 0.016 0.008 0.016
#> SRR1818674 2 0.132 0.58584 0.000 0.956 0.004 0.016 0.008 0.016
#> SRR1818671 2 0.614 0.19541 0.000 0.416 0.000 0.384 0.012 0.188
#> SRR1818672 2 0.614 0.19541 0.000 0.416 0.000 0.384 0.012 0.188
#> SRR1818661 3 0.631 0.49169 0.048 0.000 0.636 0.124 0.128 0.064
#> SRR1818662 3 0.631 0.49169 0.048 0.000 0.636 0.124 0.128 0.064
#> SRR1818655 1 0.557 -0.23218 0.476 0.004 0.004 0.000 0.412 0.104
#> SRR1818656 1 0.557 -0.23218 0.476 0.004 0.004 0.000 0.412 0.104
#> SRR1818653 5 0.582 0.50685 0.300 0.000 0.128 0.000 0.548 0.024
#> SRR1818654 5 0.582 0.50685 0.300 0.000 0.128 0.000 0.548 0.024
#> SRR1818651 1 0.457 0.45187 0.736 0.000 0.076 0.004 0.164 0.020
#> SRR1818652 1 0.457 0.45187 0.736 0.000 0.076 0.004 0.164 0.020
#> SRR1818657 1 0.450 0.51686 0.760 0.000 0.056 0.000 0.076 0.108
#> SRR1818658 1 0.450 0.51686 0.760 0.000 0.056 0.000 0.076 0.108
#> SRR1818649 1 0.719 0.36925 0.548 0.072 0.060 0.012 0.088 0.220
#> SRR1818650 1 0.719 0.36925 0.548 0.072 0.060 0.012 0.088 0.220
#> SRR1818659 1 0.438 0.28035 0.676 0.000 0.012 0.000 0.280 0.032
#> SRR1818647 4 0.428 0.64943 0.000 0.060 0.084 0.796 0.024 0.036
#> SRR1818648 4 0.428 0.64943 0.000 0.060 0.084 0.796 0.024 0.036
#> SRR1818645 2 0.546 0.51352 0.000 0.592 0.000 0.216 0.004 0.188
#> SRR1818646 2 0.546 0.51352 0.000 0.592 0.000 0.216 0.004 0.188
#> SRR1818639 5 0.511 0.19222 0.464 0.004 0.000 0.004 0.472 0.056
#> SRR1818640 5 0.511 0.19222 0.464 0.004 0.000 0.004 0.472 0.056
#> SRR1818637 4 0.375 0.67798 0.000 0.068 0.012 0.828 0.060 0.032
#> SRR1818638 4 0.375 0.67798 0.000 0.068 0.012 0.828 0.060 0.032
#> SRR1818635 2 0.175 0.57732 0.004 0.940 0.008 0.016 0.008 0.024
#> SRR1818636 2 0.175 0.57732 0.004 0.940 0.008 0.016 0.008 0.024
#> SRR1818643 2 0.408 0.53002 0.000 0.812 0.028 0.032 0.068 0.060
#> SRR1818644 2 0.408 0.53002 0.000 0.812 0.028 0.032 0.068 0.060
#> SRR1818641 2 0.348 0.51911 0.004 0.820 0.008 0.008 0.024 0.136
#> SRR1818642 2 0.348 0.51911 0.004 0.820 0.008 0.008 0.024 0.136
#> SRR1818633 6 0.895 1.00000 0.188 0.152 0.112 0.080 0.072 0.396
#> SRR1818634 6 0.895 1.00000 0.188 0.152 0.112 0.080 0.072 0.396
#> SRR1818665 1 0.294 0.55289 0.876 0.000 0.028 0.008 0.056 0.032
#> SRR1818666 1 0.294 0.55289 0.876 0.000 0.028 0.008 0.056 0.032
#> SRR1818667 4 0.677 0.23386 0.000 0.280 0.024 0.512 0.056 0.128
#> SRR1818668 4 0.677 0.23386 0.000 0.280 0.024 0.512 0.056 0.128
#> SRR1818669 1 0.487 0.48175 0.712 0.000 0.184 0.004 0.060 0.040
#> SRR1818670 1 0.487 0.48175 0.712 0.000 0.184 0.004 0.060 0.040
#> SRR1818663 1 0.259 0.54484 0.872 0.000 0.000 0.000 0.044 0.084
#> SRR1818664 1 0.259 0.54484 0.872 0.000 0.000 0.000 0.044 0.084
#> SRR1818629 2 0.502 0.56928 0.000 0.708 0.008 0.092 0.028 0.164
#> SRR1818630 2 0.502 0.56928 0.000 0.708 0.008 0.092 0.028 0.164
#> SRR1818627 1 0.435 0.52791 0.784 0.000 0.088 0.008 0.068 0.052
#> SRR1818628 1 0.435 0.52791 0.784 0.000 0.088 0.008 0.068 0.052
#> SRR1818621 5 0.707 0.18831 0.144 0.000 0.352 0.016 0.416 0.072
#> SRR1818622 5 0.707 0.18831 0.144 0.000 0.352 0.016 0.416 0.072
#> SRR1818625 1 0.296 0.54321 0.848 0.000 0.004 0.000 0.040 0.108
#> SRR1818626 1 0.296 0.54321 0.848 0.000 0.004 0.000 0.040 0.108
#> SRR1818623 4 0.585 0.45145 0.000 0.024 0.228 0.616 0.020 0.112
#> SRR1818624 4 0.585 0.45145 0.000 0.024 0.228 0.616 0.020 0.112
#> SRR1818619 1 0.624 0.33081 0.588 0.004 0.128 0.000 0.076 0.204
#> SRR1818620 1 0.624 0.33081 0.588 0.004 0.128 0.000 0.076 0.204
#> SRR1818617 2 0.753 0.01005 0.028 0.384 0.020 0.060 0.132 0.376
#> SRR1818618 2 0.753 0.01005 0.028 0.384 0.020 0.060 0.132 0.376
#> SRR1818615 2 0.526 0.25521 0.000 0.520 0.004 0.404 0.008 0.064
#> SRR1818616 2 0.526 0.25521 0.000 0.520 0.004 0.404 0.008 0.064
#> SRR1818609 4 0.386 0.65581 0.000 0.144 0.000 0.788 0.020 0.048
#> SRR1818610 4 0.386 0.65581 0.000 0.144 0.000 0.788 0.020 0.048
#> SRR1818607 2 0.546 0.51352 0.000 0.592 0.000 0.216 0.004 0.188
#> SRR1818608 2 0.546 0.51352 0.000 0.592 0.000 0.216 0.004 0.188
#> SRR1818613 1 0.450 0.45884 0.744 0.000 0.076 0.004 0.156 0.020
#> SRR1818614 1 0.450 0.45884 0.744 0.000 0.076 0.004 0.156 0.020
#> SRR1818611 1 0.681 0.39046 0.580 0.068 0.036 0.012 0.092 0.212
#> SRR1818612 1 0.681 0.39046 0.580 0.068 0.036 0.012 0.092 0.212
#> SRR1818605 1 0.690 0.04567 0.476 0.008 0.256 0.000 0.196 0.064
#> SRR1818606 1 0.690 0.04567 0.476 0.008 0.256 0.000 0.196 0.064
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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.965 0.986 0.5041 0.498 0.498
#> 3 3 0.717 0.841 0.896 0.3029 0.788 0.595
#> 4 4 0.643 0.783 0.834 0.1249 0.859 0.618
#> 5 5 0.640 0.644 0.738 0.0661 0.977 0.914
#> 6 6 0.653 0.501 0.641 0.0438 0.898 0.618
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
#> SRR1818631 1 0.000 0.977 1.000 0.000
#> SRR1818632 1 0.000 0.977 1.000 0.000
#> SRR1818679 1 0.969 0.369 0.604 0.396
#> SRR1818680 1 0.969 0.369 0.604 0.396
#> SRR1818677 2 0.000 0.995 0.000 1.000
#> SRR1818678 2 0.000 0.995 0.000 1.000
#> SRR1818675 1 0.311 0.926 0.944 0.056
#> SRR1818676 1 0.311 0.926 0.944 0.056
#> SRR1818673 2 0.000 0.995 0.000 1.000
#> SRR1818674 2 0.000 0.995 0.000 1.000
#> SRR1818671 2 0.000 0.995 0.000 1.000
#> SRR1818672 2 0.000 0.995 0.000 1.000
#> SRR1818661 1 0.000 0.977 1.000 0.000
#> SRR1818662 1 0.000 0.977 1.000 0.000
#> SRR1818655 1 0.000 0.977 1.000 0.000
#> SRR1818656 1 0.000 0.977 1.000 0.000
#> SRR1818653 1 0.000 0.977 1.000 0.000
#> SRR1818654 1 0.000 0.977 1.000 0.000
#> SRR1818651 1 0.000 0.977 1.000 0.000
#> SRR1818652 1 0.000 0.977 1.000 0.000
#> SRR1818657 1 0.000 0.977 1.000 0.000
#> SRR1818658 1 0.000 0.977 1.000 0.000
#> SRR1818649 1 0.000 0.977 1.000 0.000
#> SRR1818650 1 0.000 0.977 1.000 0.000
#> SRR1818659 1 0.000 0.977 1.000 0.000
#> SRR1818647 2 0.000 0.995 0.000 1.000
#> SRR1818648 2 0.000 0.995 0.000 1.000
#> SRR1818645 2 0.000 0.995 0.000 1.000
#> SRR1818646 2 0.000 0.995 0.000 1.000
#> SRR1818639 1 0.000 0.977 1.000 0.000
#> SRR1818640 1 0.000 0.977 1.000 0.000
#> SRR1818637 2 0.000 0.995 0.000 1.000
#> SRR1818638 2 0.000 0.995 0.000 1.000
#> SRR1818635 2 0.000 0.995 0.000 1.000
#> SRR1818636 2 0.000 0.995 0.000 1.000
#> SRR1818643 2 0.000 0.995 0.000 1.000
#> SRR1818644 2 0.000 0.995 0.000 1.000
#> SRR1818641 2 0.000 0.995 0.000 1.000
#> SRR1818642 2 0.000 0.995 0.000 1.000
#> SRR1818633 2 0.430 0.905 0.088 0.912
#> SRR1818634 2 0.430 0.905 0.088 0.912
#> SRR1818665 1 0.000 0.977 1.000 0.000
#> SRR1818666 1 0.000 0.977 1.000 0.000
#> SRR1818667 2 0.000 0.995 0.000 1.000
#> SRR1818668 2 0.000 0.995 0.000 1.000
#> SRR1818669 1 0.000 0.977 1.000 0.000
#> SRR1818670 1 0.000 0.977 1.000 0.000
#> SRR1818663 1 0.000 0.977 1.000 0.000
#> SRR1818664 1 0.000 0.977 1.000 0.000
#> SRR1818629 2 0.000 0.995 0.000 1.000
#> SRR1818630 2 0.000 0.995 0.000 1.000
#> SRR1818627 1 0.000 0.977 1.000 0.000
#> SRR1818628 1 0.000 0.977 1.000 0.000
#> SRR1818621 1 0.000 0.977 1.000 0.000
#> SRR1818622 1 0.000 0.977 1.000 0.000
#> SRR1818625 1 0.000 0.977 1.000 0.000
#> SRR1818626 1 0.000 0.977 1.000 0.000
#> SRR1818623 2 0.000 0.995 0.000 1.000
#> SRR1818624 2 0.000 0.995 0.000 1.000
#> SRR1818619 1 0.000 0.977 1.000 0.000
#> SRR1818620 1 0.000 0.977 1.000 0.000
#> SRR1818617 2 0.000 0.995 0.000 1.000
#> SRR1818618 2 0.000 0.995 0.000 1.000
#> SRR1818615 2 0.000 0.995 0.000 1.000
#> SRR1818616 2 0.000 0.995 0.000 1.000
#> SRR1818609 2 0.000 0.995 0.000 1.000
#> SRR1818610 2 0.000 0.995 0.000 1.000
#> SRR1818607 2 0.000 0.995 0.000 1.000
#> SRR1818608 2 0.000 0.995 0.000 1.000
#> SRR1818613 1 0.000 0.977 1.000 0.000
#> SRR1818614 1 0.000 0.977 1.000 0.000
#> SRR1818611 1 0.000 0.977 1.000 0.000
#> SRR1818612 1 0.000 0.977 1.000 0.000
#> SRR1818605 1 0.000 0.977 1.000 0.000
#> SRR1818606 1 0.000 0.977 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.4235 0.757 0.176 0.000 0.824
#> SRR1818632 3 0.4235 0.757 0.176 0.000 0.824
#> SRR1818679 3 0.3551 0.760 0.000 0.132 0.868
#> SRR1818680 3 0.3551 0.760 0.000 0.132 0.868
#> SRR1818677 2 0.1753 0.941 0.000 0.952 0.048
#> SRR1818678 2 0.1753 0.941 0.000 0.952 0.048
#> SRR1818675 3 0.1182 0.790 0.012 0.012 0.976
#> SRR1818676 3 0.1182 0.790 0.012 0.012 0.976
#> SRR1818673 2 0.0747 0.943 0.000 0.984 0.016
#> SRR1818674 2 0.0747 0.943 0.000 0.984 0.016
#> SRR1818671 2 0.2165 0.938 0.000 0.936 0.064
#> SRR1818672 2 0.2165 0.938 0.000 0.936 0.064
#> SRR1818661 3 0.2796 0.775 0.092 0.000 0.908
#> SRR1818662 3 0.2796 0.775 0.092 0.000 0.908
#> SRR1818655 1 0.2959 0.896 0.900 0.000 0.100
#> SRR1818656 1 0.2959 0.896 0.900 0.000 0.100
#> SRR1818653 1 0.6307 0.114 0.512 0.000 0.488
#> SRR1818654 1 0.6307 0.114 0.512 0.000 0.488
#> SRR1818651 1 0.3192 0.890 0.888 0.000 0.112
#> SRR1818652 1 0.3192 0.890 0.888 0.000 0.112
#> SRR1818657 1 0.0000 0.913 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.913 1.000 0.000 0.000
#> SRR1818649 1 0.1129 0.903 0.976 0.004 0.020
#> SRR1818650 1 0.1129 0.903 0.976 0.004 0.020
#> SRR1818659 1 0.2959 0.896 0.900 0.000 0.100
#> SRR1818647 3 0.5397 0.595 0.000 0.280 0.720
#> SRR1818648 3 0.5397 0.595 0.000 0.280 0.720
#> SRR1818645 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1818646 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1818639 1 0.2959 0.896 0.900 0.000 0.100
#> SRR1818640 1 0.2959 0.896 0.900 0.000 0.100
#> SRR1818637 2 0.5327 0.693 0.000 0.728 0.272
#> SRR1818638 2 0.5327 0.693 0.000 0.728 0.272
#> SRR1818635 2 0.0747 0.943 0.000 0.984 0.016
#> SRR1818636 2 0.0747 0.943 0.000 0.984 0.016
#> SRR1818643 2 0.0892 0.943 0.000 0.980 0.020
#> SRR1818644 2 0.0892 0.943 0.000 0.980 0.020
#> SRR1818641 2 0.0747 0.943 0.000 0.984 0.016
#> SRR1818642 2 0.0747 0.943 0.000 0.984 0.016
#> SRR1818633 3 0.6250 0.771 0.104 0.120 0.776
#> SRR1818634 3 0.6250 0.771 0.104 0.120 0.776
#> SRR1818665 1 0.1031 0.916 0.976 0.000 0.024
#> SRR1818666 1 0.1031 0.916 0.976 0.000 0.024
#> SRR1818667 2 0.2878 0.921 0.000 0.904 0.096
#> SRR1818668 2 0.2878 0.921 0.000 0.904 0.096
#> SRR1818669 1 0.1411 0.914 0.964 0.000 0.036
#> SRR1818670 1 0.1411 0.914 0.964 0.000 0.036
#> SRR1818663 1 0.0237 0.912 0.996 0.000 0.004
#> SRR1818664 1 0.0237 0.912 0.996 0.000 0.004
#> SRR1818629 2 0.0892 0.947 0.000 0.980 0.020
#> SRR1818630 2 0.0892 0.947 0.000 0.980 0.020
#> SRR1818627 1 0.1289 0.916 0.968 0.000 0.032
#> SRR1818628 1 0.1289 0.916 0.968 0.000 0.032
#> SRR1818621 3 0.4235 0.719 0.176 0.000 0.824
#> SRR1818622 3 0.4235 0.719 0.176 0.000 0.824
#> SRR1818625 1 0.0237 0.912 0.996 0.000 0.004
#> SRR1818626 1 0.0237 0.912 0.996 0.000 0.004
#> SRR1818623 3 0.5016 0.652 0.000 0.240 0.760
#> SRR1818624 3 0.5016 0.652 0.000 0.240 0.760
#> SRR1818619 1 0.0892 0.907 0.980 0.000 0.020
#> SRR1818620 1 0.0892 0.907 0.980 0.000 0.020
#> SRR1818617 2 0.1964 0.941 0.000 0.944 0.056
#> SRR1818618 2 0.1964 0.941 0.000 0.944 0.056
#> SRR1818615 2 0.0747 0.947 0.000 0.984 0.016
#> SRR1818616 2 0.0747 0.947 0.000 0.984 0.016
#> SRR1818609 2 0.2796 0.923 0.000 0.908 0.092
#> SRR1818610 2 0.2796 0.923 0.000 0.908 0.092
#> SRR1818607 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1818608 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1818613 1 0.3192 0.890 0.888 0.000 0.112
#> SRR1818614 1 0.3192 0.890 0.888 0.000 0.112
#> SRR1818611 1 0.1129 0.903 0.976 0.004 0.020
#> SRR1818612 1 0.1129 0.903 0.976 0.004 0.020
#> SRR1818605 3 0.5988 0.461 0.368 0.000 0.632
#> SRR1818606 3 0.5988 0.461 0.368 0.000 0.632
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.4030 0.848 0.092 0.000 0.836 0.072
#> SRR1818632 3 0.4030 0.848 0.092 0.000 0.836 0.072
#> SRR1818679 3 0.5710 0.743 0.004 0.128 0.728 0.140
#> SRR1818680 3 0.5710 0.743 0.004 0.128 0.728 0.140
#> SRR1818677 2 0.4910 0.708 0.000 0.704 0.020 0.276
#> SRR1818678 2 0.4910 0.708 0.000 0.704 0.020 0.276
#> SRR1818675 3 0.3569 0.792 0.000 0.000 0.804 0.196
#> SRR1818676 3 0.3569 0.792 0.000 0.000 0.804 0.196
#> SRR1818673 2 0.0707 0.795 0.000 0.980 0.000 0.020
#> SRR1818674 2 0.0707 0.795 0.000 0.980 0.000 0.020
#> SRR1818671 4 0.4103 0.626 0.000 0.256 0.000 0.744
#> SRR1818672 4 0.4103 0.626 0.000 0.256 0.000 0.744
#> SRR1818661 3 0.2915 0.859 0.028 0.000 0.892 0.080
#> SRR1818662 3 0.2915 0.859 0.028 0.000 0.892 0.080
#> SRR1818655 1 0.3402 0.863 0.832 0.004 0.164 0.000
#> SRR1818656 1 0.3402 0.863 0.832 0.004 0.164 0.000
#> SRR1818653 3 0.2814 0.814 0.132 0.000 0.868 0.000
#> SRR1818654 3 0.2814 0.814 0.132 0.000 0.868 0.000
#> SRR1818651 1 0.3726 0.830 0.788 0.000 0.212 0.000
#> SRR1818652 1 0.3726 0.830 0.788 0.000 0.212 0.000
#> SRR1818657 1 0.2075 0.885 0.936 0.004 0.044 0.016
#> SRR1818658 1 0.2075 0.885 0.936 0.004 0.044 0.016
#> SRR1818649 1 0.3833 0.837 0.864 0.072 0.044 0.020
#> SRR1818650 1 0.3833 0.837 0.864 0.072 0.044 0.020
#> SRR1818659 1 0.3219 0.864 0.836 0.000 0.164 0.000
#> SRR1818647 4 0.2399 0.774 0.000 0.032 0.048 0.920
#> SRR1818648 4 0.2399 0.774 0.000 0.032 0.048 0.920
#> SRR1818645 2 0.4008 0.757 0.000 0.756 0.000 0.244
#> SRR1818646 2 0.4008 0.757 0.000 0.756 0.000 0.244
#> SRR1818639 1 0.3448 0.862 0.828 0.004 0.168 0.000
#> SRR1818640 1 0.3448 0.862 0.828 0.004 0.168 0.000
#> SRR1818637 4 0.1452 0.782 0.000 0.036 0.008 0.956
#> SRR1818638 4 0.1452 0.782 0.000 0.036 0.008 0.956
#> SRR1818635 2 0.0707 0.795 0.000 0.980 0.000 0.020
#> SRR1818636 2 0.0707 0.795 0.000 0.980 0.000 0.020
#> SRR1818643 2 0.0817 0.794 0.000 0.976 0.000 0.024
#> SRR1818644 2 0.0817 0.794 0.000 0.976 0.000 0.024
#> SRR1818641 2 0.0469 0.791 0.000 0.988 0.000 0.012
#> SRR1818642 2 0.0469 0.791 0.000 0.988 0.000 0.012
#> SRR1818633 4 0.7678 0.314 0.048 0.104 0.288 0.560
#> SRR1818634 4 0.7678 0.314 0.048 0.104 0.288 0.560
#> SRR1818665 1 0.1824 0.891 0.936 0.000 0.060 0.004
#> SRR1818666 1 0.1824 0.891 0.936 0.000 0.060 0.004
#> SRR1818667 4 0.2814 0.760 0.000 0.132 0.000 0.868
#> SRR1818668 4 0.2814 0.760 0.000 0.132 0.000 0.868
#> SRR1818669 1 0.1635 0.893 0.948 0.000 0.044 0.008
#> SRR1818670 1 0.1635 0.893 0.948 0.000 0.044 0.008
#> SRR1818663 1 0.1406 0.886 0.960 0.000 0.024 0.016
#> SRR1818664 1 0.1406 0.886 0.960 0.000 0.024 0.016
#> SRR1818629 2 0.4103 0.705 0.000 0.744 0.000 0.256
#> SRR1818630 2 0.4103 0.705 0.000 0.744 0.000 0.256
#> SRR1818627 1 0.3249 0.857 0.852 0.000 0.140 0.008
#> SRR1818628 1 0.3249 0.857 0.852 0.000 0.140 0.008
#> SRR1818621 3 0.2125 0.851 0.076 0.000 0.920 0.004
#> SRR1818622 3 0.2125 0.851 0.076 0.000 0.920 0.004
#> SRR1818625 1 0.1406 0.886 0.960 0.000 0.024 0.016
#> SRR1818626 1 0.1406 0.886 0.960 0.000 0.024 0.016
#> SRR1818623 4 0.2222 0.763 0.000 0.016 0.060 0.924
#> SRR1818624 4 0.2222 0.763 0.000 0.016 0.060 0.924
#> SRR1818619 1 0.2297 0.880 0.928 0.004 0.044 0.024
#> SRR1818620 1 0.2297 0.880 0.928 0.004 0.044 0.024
#> SRR1818617 2 0.4941 0.456 0.000 0.564 0.000 0.436
#> SRR1818618 2 0.4941 0.456 0.000 0.564 0.000 0.436
#> SRR1818615 4 0.4406 0.580 0.000 0.300 0.000 0.700
#> SRR1818616 4 0.4406 0.580 0.000 0.300 0.000 0.700
#> SRR1818609 4 0.2469 0.771 0.000 0.108 0.000 0.892
#> SRR1818610 4 0.2469 0.771 0.000 0.108 0.000 0.892
#> SRR1818607 2 0.4008 0.757 0.000 0.756 0.000 0.244
#> SRR1818608 2 0.4008 0.757 0.000 0.756 0.000 0.244
#> SRR1818613 1 0.3726 0.830 0.788 0.000 0.212 0.000
#> SRR1818614 1 0.3726 0.830 0.788 0.000 0.212 0.000
#> SRR1818611 1 0.3761 0.840 0.868 0.068 0.044 0.020
#> SRR1818612 1 0.3761 0.840 0.868 0.068 0.044 0.020
#> SRR1818605 3 0.2988 0.848 0.112 0.000 0.876 0.012
#> SRR1818606 3 0.2988 0.848 0.112 0.000 0.876 0.012
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.3033 0.8039 0.076 0.000 0.876 0.016 NA
#> SRR1818632 3 0.3033 0.8039 0.076 0.000 0.876 0.016 NA
#> SRR1818679 3 0.5421 0.7006 0.000 0.144 0.720 0.044 NA
#> SRR1818680 3 0.5421 0.7006 0.000 0.144 0.720 0.044 NA
#> SRR1818677 2 0.6850 0.4411 0.000 0.456 0.008 0.264 NA
#> SRR1818678 2 0.6850 0.4411 0.000 0.456 0.008 0.264 NA
#> SRR1818675 3 0.3500 0.7327 0.004 0.000 0.808 0.172 NA
#> SRR1818676 3 0.3500 0.7327 0.004 0.000 0.808 0.172 NA
#> SRR1818673 2 0.0798 0.7356 0.000 0.976 0.000 0.016 NA
#> SRR1818674 2 0.0798 0.7356 0.000 0.976 0.000 0.016 NA
#> SRR1818671 4 0.4998 0.5067 0.000 0.196 0.000 0.700 NA
#> SRR1818672 4 0.4998 0.5067 0.000 0.196 0.000 0.700 NA
#> SRR1818661 3 0.1690 0.8208 0.024 0.000 0.944 0.024 NA
#> SRR1818662 3 0.1690 0.8208 0.024 0.000 0.944 0.024 NA
#> SRR1818655 1 0.5860 0.6447 0.632 0.004 0.116 0.008 NA
#> SRR1818656 1 0.5860 0.6447 0.632 0.004 0.116 0.008 NA
#> SRR1818653 3 0.5108 0.6847 0.120 0.000 0.716 0.008 NA
#> SRR1818654 3 0.5108 0.6847 0.120 0.000 0.716 0.008 NA
#> SRR1818651 1 0.5572 0.6377 0.644 0.000 0.164 0.000 NA
#> SRR1818652 1 0.5572 0.6377 0.644 0.000 0.164 0.000 NA
#> SRR1818657 1 0.4581 0.6281 0.624 0.004 0.012 0.000 NA
#> SRR1818658 1 0.4581 0.6281 0.624 0.004 0.012 0.000 NA
#> SRR1818649 1 0.4675 0.6484 0.704 0.020 0.020 0.000 NA
#> SRR1818650 1 0.4675 0.6484 0.704 0.020 0.020 0.000 NA
#> SRR1818659 1 0.4454 0.6892 0.760 0.000 0.128 0.000 NA
#> SRR1818647 4 0.2177 0.7038 0.000 0.004 0.080 0.908 NA
#> SRR1818648 4 0.2177 0.7038 0.000 0.004 0.080 0.908 NA
#> SRR1818645 2 0.5506 0.6000 0.000 0.616 0.000 0.284 NA
#> SRR1818646 2 0.5506 0.6000 0.000 0.616 0.000 0.284 NA
#> SRR1818639 1 0.5982 0.6373 0.620 0.004 0.128 0.008 NA
#> SRR1818640 1 0.5982 0.6373 0.620 0.004 0.128 0.008 NA
#> SRR1818637 4 0.0740 0.7216 0.000 0.008 0.004 0.980 NA
#> SRR1818638 4 0.0740 0.7216 0.000 0.008 0.004 0.980 NA
#> SRR1818635 2 0.0798 0.7356 0.000 0.976 0.000 0.016 NA
#> SRR1818636 2 0.0798 0.7356 0.000 0.976 0.000 0.016 NA
#> SRR1818643 2 0.1485 0.7265 0.000 0.948 0.000 0.020 NA
#> SRR1818644 2 0.1485 0.7265 0.000 0.948 0.000 0.020 NA
#> SRR1818641 2 0.1041 0.7259 0.000 0.964 0.000 0.004 NA
#> SRR1818642 2 0.1041 0.7259 0.000 0.964 0.000 0.004 NA
#> SRR1818633 4 0.8590 0.2094 0.036 0.072 0.248 0.348 NA
#> SRR1818634 4 0.8590 0.2094 0.036 0.072 0.248 0.348 NA
#> SRR1818665 1 0.3771 0.7079 0.796 0.000 0.040 0.000 NA
#> SRR1818666 1 0.3771 0.7079 0.796 0.000 0.040 0.000 NA
#> SRR1818667 4 0.1918 0.7125 0.000 0.036 0.000 0.928 NA
#> SRR1818668 4 0.1918 0.7125 0.000 0.036 0.000 0.928 NA
#> SRR1818669 1 0.3281 0.7264 0.848 0.000 0.060 0.000 NA
#> SRR1818670 1 0.3281 0.7264 0.848 0.000 0.060 0.000 NA
#> SRR1818663 1 0.2127 0.7167 0.892 0.000 0.000 0.000 NA
#> SRR1818664 1 0.2127 0.7167 0.892 0.000 0.000 0.000 NA
#> SRR1818629 2 0.5570 0.5409 0.000 0.608 0.000 0.288 NA
#> SRR1818630 2 0.5570 0.5409 0.000 0.608 0.000 0.288 NA
#> SRR1818627 1 0.5116 0.6584 0.692 0.000 0.120 0.000 NA
#> SRR1818628 1 0.5116 0.6584 0.692 0.000 0.120 0.000 NA
#> SRR1818621 3 0.3255 0.7891 0.052 0.000 0.848 0.000 NA
#> SRR1818622 3 0.3255 0.7891 0.052 0.000 0.848 0.000 NA
#> SRR1818625 1 0.2127 0.7167 0.892 0.000 0.000 0.000 NA
#> SRR1818626 1 0.2127 0.7167 0.892 0.000 0.000 0.000 NA
#> SRR1818623 4 0.2561 0.6975 0.000 0.000 0.096 0.884 NA
#> SRR1818624 4 0.2561 0.6975 0.000 0.000 0.096 0.884 NA
#> SRR1818619 1 0.5033 0.5861 0.568 0.004 0.028 0.000 NA
#> SRR1818620 1 0.5033 0.5861 0.568 0.004 0.028 0.000 NA
#> SRR1818617 4 0.6766 -0.0207 0.000 0.284 0.000 0.396 NA
#> SRR1818618 4 0.6766 -0.0207 0.000 0.284 0.000 0.396 NA
#> SRR1818615 4 0.4083 0.5577 0.000 0.228 0.000 0.744 NA
#> SRR1818616 4 0.4083 0.5577 0.000 0.228 0.000 0.744 NA
#> SRR1818609 4 0.1168 0.7208 0.000 0.032 0.000 0.960 NA
#> SRR1818610 4 0.1168 0.7208 0.000 0.032 0.000 0.960 NA
#> SRR1818607 2 0.5506 0.6000 0.000 0.616 0.000 0.284 NA
#> SRR1818608 2 0.5506 0.6000 0.000 0.616 0.000 0.284 NA
#> SRR1818613 1 0.5507 0.6424 0.652 0.000 0.160 0.000 NA
#> SRR1818614 1 0.5507 0.6424 0.652 0.000 0.160 0.000 NA
#> SRR1818611 1 0.4584 0.6502 0.708 0.020 0.016 0.000 NA
#> SRR1818612 1 0.4584 0.6502 0.708 0.020 0.016 0.000 NA
#> SRR1818605 3 0.4394 0.7719 0.136 0.000 0.764 0.000 NA
#> SRR1818606 3 0.4394 0.7719 0.136 0.000 0.764 0.000 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.2801 0.6912 0.036 0.000 0.872 0.004 0.080 0.008
#> SRR1818632 3 0.2801 0.6912 0.036 0.000 0.872 0.004 0.080 0.008
#> SRR1818679 3 0.6427 0.5368 0.004 0.108 0.604 0.008 0.128 0.148
#> SRR1818680 3 0.6427 0.5368 0.004 0.108 0.604 0.008 0.128 0.148
#> SRR1818677 6 0.6659 -0.1103 0.000 0.248 0.004 0.168 0.068 0.512
#> SRR1818678 6 0.6659 -0.1103 0.000 0.248 0.004 0.168 0.068 0.512
#> SRR1818675 3 0.3800 0.6387 0.000 0.000 0.776 0.176 0.028 0.020
#> SRR1818676 3 0.3800 0.6387 0.000 0.000 0.776 0.176 0.028 0.020
#> SRR1818673 2 0.0508 0.7199 0.000 0.984 0.000 0.012 0.004 0.000
#> SRR1818674 2 0.0508 0.7199 0.000 0.984 0.000 0.012 0.004 0.000
#> SRR1818671 4 0.5335 0.5579 0.000 0.128 0.000 0.640 0.020 0.212
#> SRR1818672 4 0.5335 0.5579 0.000 0.128 0.000 0.640 0.020 0.212
#> SRR1818661 3 0.1173 0.7199 0.000 0.000 0.960 0.016 0.016 0.008
#> SRR1818662 3 0.1173 0.7199 0.000 0.000 0.960 0.016 0.016 0.008
#> SRR1818655 6 0.6752 0.0391 0.368 0.000 0.088 0.000 0.128 0.416
#> SRR1818656 6 0.6752 0.0391 0.368 0.000 0.088 0.000 0.128 0.416
#> SRR1818653 3 0.6192 0.5068 0.076 0.000 0.544 0.000 0.096 0.284
#> SRR1818654 3 0.6192 0.5068 0.076 0.000 0.544 0.000 0.096 0.284
#> SRR1818651 1 0.7326 0.3824 0.420 0.000 0.160 0.000 0.200 0.220
#> SRR1818652 1 0.7326 0.3824 0.420 0.000 0.160 0.000 0.200 0.220
#> SRR1818657 5 0.4362 0.3653 0.392 0.000 0.020 0.000 0.584 0.004
#> SRR1818658 5 0.4353 0.3738 0.388 0.000 0.020 0.000 0.588 0.004
#> SRR1818649 1 0.5341 0.4046 0.636 0.012 0.004 0.000 0.224 0.124
#> SRR1818650 1 0.5341 0.4046 0.636 0.012 0.004 0.000 0.224 0.124
#> SRR1818659 1 0.6232 0.3828 0.592 0.000 0.108 0.000 0.128 0.172
#> SRR1818647 4 0.1931 0.7992 0.000 0.008 0.068 0.916 0.004 0.004
#> SRR1818648 4 0.1931 0.7992 0.000 0.008 0.068 0.916 0.004 0.004
#> SRR1818645 2 0.5771 0.5312 0.000 0.532 0.000 0.212 0.004 0.252
#> SRR1818646 2 0.5771 0.5312 0.000 0.532 0.000 0.212 0.004 0.252
#> SRR1818639 6 0.6786 0.0410 0.360 0.000 0.096 0.000 0.124 0.420
#> SRR1818640 6 0.6786 0.0410 0.360 0.000 0.096 0.000 0.124 0.420
#> SRR1818637 4 0.0806 0.8190 0.000 0.000 0.008 0.972 0.020 0.000
#> SRR1818638 4 0.0806 0.8190 0.000 0.000 0.008 0.972 0.020 0.000
#> SRR1818635 2 0.0508 0.7199 0.000 0.984 0.000 0.012 0.004 0.000
#> SRR1818636 2 0.0508 0.7199 0.000 0.984 0.000 0.012 0.004 0.000
#> SRR1818643 2 0.2238 0.6951 0.004 0.916 0.004 0.016 0.028 0.032
#> SRR1818644 2 0.2238 0.6951 0.004 0.916 0.004 0.016 0.028 0.032
#> SRR1818641 2 0.1923 0.6918 0.000 0.916 0.000 0.004 0.016 0.064
#> SRR1818642 2 0.1923 0.6918 0.000 0.916 0.000 0.004 0.016 0.064
#> SRR1818633 5 0.9068 0.1278 0.036 0.088 0.216 0.252 0.288 0.120
#> SRR1818634 5 0.9068 0.1278 0.036 0.088 0.216 0.252 0.288 0.120
#> SRR1818665 1 0.4863 0.2538 0.620 0.000 0.028 0.000 0.320 0.032
#> SRR1818666 1 0.4863 0.2538 0.620 0.000 0.028 0.000 0.320 0.032
#> SRR1818667 4 0.2361 0.8084 0.000 0.008 0.000 0.896 0.032 0.064
#> SRR1818668 4 0.2361 0.8084 0.000 0.008 0.000 0.896 0.032 0.064
#> SRR1818669 1 0.5461 0.4444 0.640 0.000 0.080 0.000 0.228 0.052
#> SRR1818670 1 0.5461 0.4444 0.640 0.000 0.080 0.000 0.228 0.052
#> SRR1818663 1 0.0436 0.5023 0.988 0.000 0.004 0.000 0.004 0.004
#> SRR1818664 1 0.0436 0.5023 0.988 0.000 0.004 0.000 0.004 0.004
#> SRR1818629 2 0.5883 0.5155 0.000 0.560 0.000 0.240 0.020 0.180
#> SRR1818630 2 0.5883 0.5155 0.000 0.560 0.000 0.240 0.020 0.180
#> SRR1818627 1 0.5851 0.1647 0.540 0.000 0.076 0.000 0.332 0.052
#> SRR1818628 1 0.5851 0.1647 0.540 0.000 0.076 0.000 0.332 0.052
#> SRR1818621 3 0.4377 0.6851 0.028 0.000 0.744 0.000 0.056 0.172
#> SRR1818622 3 0.4377 0.6851 0.028 0.000 0.744 0.000 0.056 0.172
#> SRR1818625 1 0.0436 0.5023 0.988 0.000 0.004 0.000 0.004 0.004
#> SRR1818626 1 0.0436 0.5023 0.988 0.000 0.004 0.000 0.004 0.004
#> SRR1818623 4 0.2890 0.7611 0.000 0.000 0.108 0.856 0.016 0.020
#> SRR1818624 4 0.2890 0.7611 0.000 0.000 0.108 0.856 0.016 0.020
#> SRR1818619 5 0.4462 0.4354 0.356 0.000 0.012 0.000 0.612 0.020
#> SRR1818620 5 0.4462 0.4354 0.356 0.000 0.012 0.000 0.612 0.020
#> SRR1818617 6 0.6692 0.1304 0.004 0.128 0.000 0.264 0.092 0.512
#> SRR1818618 6 0.6692 0.1304 0.004 0.128 0.000 0.264 0.092 0.512
#> SRR1818615 4 0.4277 0.6809 0.000 0.172 0.000 0.740 0.008 0.080
#> SRR1818616 4 0.4277 0.6809 0.000 0.172 0.000 0.740 0.008 0.080
#> SRR1818609 4 0.1138 0.8222 0.000 0.012 0.000 0.960 0.004 0.024
#> SRR1818610 4 0.1138 0.8222 0.000 0.012 0.000 0.960 0.004 0.024
#> SRR1818607 2 0.5771 0.5312 0.000 0.532 0.000 0.212 0.004 0.252
#> SRR1818608 2 0.5771 0.5312 0.000 0.532 0.000 0.212 0.004 0.252
#> SRR1818613 1 0.7326 0.3824 0.420 0.000 0.160 0.000 0.200 0.220
#> SRR1818614 1 0.7326 0.3824 0.420 0.000 0.160 0.000 0.200 0.220
#> SRR1818611 1 0.5341 0.4046 0.636 0.012 0.004 0.000 0.224 0.124
#> SRR1818612 1 0.5341 0.4046 0.636 0.012 0.004 0.000 0.224 0.124
#> SRR1818605 3 0.5445 0.6728 0.124 0.004 0.688 0.000 0.080 0.104
#> SRR1818606 3 0.5445 0.6728 0.124 0.004 0.688 0.000 0.080 0.104
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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.891 0.937 0.971 0.4865 0.504 0.504
#> 3 3 0.845 0.897 0.932 0.1616 0.931 0.863
#> 4 4 0.773 0.906 0.911 0.1496 0.950 0.884
#> 5 5 0.845 0.875 0.936 0.1532 0.849 0.615
#> 6 6 0.799 0.785 0.880 0.0593 0.947 0.795
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
#> SRR1818631 1 0.000 0.993 1.000 0.000
#> SRR1818632 1 0.000 0.993 1.000 0.000
#> SRR1818679 1 0.595 0.817 0.856 0.144
#> SRR1818680 1 0.563 0.835 0.868 0.132
#> SRR1818677 2 0.000 0.937 0.000 1.000
#> SRR1818678 2 0.000 0.937 0.000 1.000
#> SRR1818675 1 0.000 0.993 1.000 0.000
#> SRR1818676 1 0.000 0.993 1.000 0.000
#> SRR1818673 2 0.000 0.937 0.000 1.000
#> SRR1818674 2 0.000 0.937 0.000 1.000
#> SRR1818671 2 0.000 0.937 0.000 1.000
#> SRR1818672 2 0.000 0.937 0.000 1.000
#> SRR1818661 1 0.000 0.993 1.000 0.000
#> SRR1818662 1 0.000 0.993 1.000 0.000
#> SRR1818655 1 0.000 0.993 1.000 0.000
#> SRR1818656 1 0.000 0.993 1.000 0.000
#> SRR1818653 1 0.000 0.993 1.000 0.000
#> SRR1818654 1 0.000 0.993 1.000 0.000
#> SRR1818651 1 0.000 0.993 1.000 0.000
#> SRR1818652 1 0.000 0.993 1.000 0.000
#> SRR1818657 1 0.000 0.993 1.000 0.000
#> SRR1818658 1 0.000 0.993 1.000 0.000
#> SRR1818649 1 0.000 0.993 1.000 0.000
#> SRR1818650 1 0.000 0.993 1.000 0.000
#> SRR1818659 1 0.000 0.993 1.000 0.000
#> SRR1818647 2 0.000 0.937 0.000 1.000
#> SRR1818648 2 0.000 0.937 0.000 1.000
#> SRR1818645 2 0.000 0.937 0.000 1.000
#> SRR1818646 2 0.000 0.937 0.000 1.000
#> SRR1818639 1 0.000 0.993 1.000 0.000
#> SRR1818640 1 0.000 0.993 1.000 0.000
#> SRR1818637 2 0.000 0.937 0.000 1.000
#> SRR1818638 2 0.000 0.937 0.000 1.000
#> SRR1818635 2 0.745 0.748 0.212 0.788
#> SRR1818636 2 0.760 0.738 0.220 0.780
#> SRR1818643 2 0.224 0.913 0.036 0.964
#> SRR1818644 2 0.278 0.905 0.048 0.952
#> SRR1818641 2 0.975 0.393 0.408 0.592
#> SRR1818642 2 0.969 0.423 0.396 0.604
#> SRR1818633 1 0.000 0.993 1.000 0.000
#> SRR1818634 1 0.000 0.993 1.000 0.000
#> SRR1818665 1 0.000 0.993 1.000 0.000
#> SRR1818666 1 0.000 0.993 1.000 0.000
#> SRR1818667 2 0.000 0.937 0.000 1.000
#> SRR1818668 2 0.000 0.937 0.000 1.000
#> SRR1818669 1 0.000 0.993 1.000 0.000
#> SRR1818670 1 0.000 0.993 1.000 0.000
#> SRR1818663 1 0.000 0.993 1.000 0.000
#> SRR1818664 1 0.000 0.993 1.000 0.000
#> SRR1818629 2 0.000 0.937 0.000 1.000
#> SRR1818630 2 0.000 0.937 0.000 1.000
#> SRR1818627 1 0.000 0.993 1.000 0.000
#> SRR1818628 1 0.000 0.993 1.000 0.000
#> SRR1818621 1 0.000 0.993 1.000 0.000
#> SRR1818622 1 0.000 0.993 1.000 0.000
#> SRR1818625 1 0.000 0.993 1.000 0.000
#> SRR1818626 1 0.000 0.993 1.000 0.000
#> SRR1818623 2 0.808 0.701 0.248 0.752
#> SRR1818624 2 0.900 0.591 0.316 0.684
#> SRR1818619 1 0.000 0.993 1.000 0.000
#> SRR1818620 1 0.000 0.993 1.000 0.000
#> SRR1818617 2 0.000 0.937 0.000 1.000
#> SRR1818618 2 0.000 0.937 0.000 1.000
#> SRR1818615 2 0.000 0.937 0.000 1.000
#> SRR1818616 2 0.000 0.937 0.000 1.000
#> SRR1818609 2 0.000 0.937 0.000 1.000
#> SRR1818610 2 0.000 0.937 0.000 1.000
#> SRR1818607 2 0.000 0.937 0.000 1.000
#> SRR1818608 2 0.000 0.937 0.000 1.000
#> SRR1818613 1 0.000 0.993 1.000 0.000
#> SRR1818614 1 0.000 0.993 1.000 0.000
#> SRR1818611 1 0.000 0.993 1.000 0.000
#> SRR1818612 1 0.000 0.993 1.000 0.000
#> SRR1818605 1 0.000 0.993 1.000 0.000
#> SRR1818606 1 0.000 0.993 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 1 0.1031 0.964 0.976 0.000 0.024
#> SRR1818632 1 0.1031 0.964 0.976 0.000 0.024
#> SRR1818679 1 0.3989 0.847 0.864 0.012 0.124
#> SRR1818680 1 0.4068 0.844 0.864 0.016 0.120
#> SRR1818677 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818678 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818675 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818676 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818673 2 0.0000 0.788 0.000 1.000 0.000
#> SRR1818674 2 0.0000 0.788 0.000 1.000 0.000
#> SRR1818671 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818672 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818661 1 0.1031 0.964 0.976 0.000 0.024
#> SRR1818662 1 0.1031 0.964 0.976 0.000 0.024
#> SRR1818655 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818656 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818653 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818654 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818651 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818652 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818657 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818649 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818650 1 0.1399 0.971 0.968 0.004 0.028
#> SRR1818659 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818647 3 0.1163 1.000 0.000 0.028 0.972
#> SRR1818648 3 0.1163 1.000 0.000 0.028 0.972
#> SRR1818645 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818646 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818639 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818640 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818637 3 0.1163 1.000 0.000 0.028 0.972
#> SRR1818638 3 0.1163 1.000 0.000 0.028 0.972
#> SRR1818635 2 0.4702 0.577 0.212 0.788 0.000
#> SRR1818636 2 0.4654 0.583 0.208 0.792 0.000
#> SRR1818643 2 0.0892 0.782 0.020 0.980 0.000
#> SRR1818644 2 0.1643 0.769 0.044 0.956 0.000
#> SRR1818641 2 0.6154 0.288 0.408 0.592 0.000
#> SRR1818642 2 0.6095 0.333 0.392 0.608 0.000
#> SRR1818633 1 0.3590 0.910 0.896 0.076 0.028
#> SRR1818634 1 0.4469 0.863 0.852 0.120 0.028
#> SRR1818665 1 0.0747 0.975 0.984 0.000 0.016
#> SRR1818666 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818667 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818668 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818669 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818670 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818663 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818664 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818629 2 0.0000 0.788 0.000 1.000 0.000
#> SRR1818630 2 0.0000 0.788 0.000 1.000 0.000
#> SRR1818627 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818628 1 0.0424 0.976 0.992 0.000 0.008
#> SRR1818621 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818622 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818625 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818626 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818623 3 0.1163 1.000 0.000 0.028 0.972
#> SRR1818624 3 0.1163 1.000 0.000 0.028 0.972
#> SRR1818619 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818620 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818617 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818618 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818615 2 0.1411 0.799 0.000 0.964 0.036
#> SRR1818616 2 0.1964 0.803 0.000 0.944 0.056
#> SRR1818609 3 0.1163 1.000 0.000 0.028 0.972
#> SRR1818610 3 0.1163 1.000 0.000 0.028 0.972
#> SRR1818607 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818608 2 0.4178 0.813 0.000 0.828 0.172
#> SRR1818613 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818614 1 0.0000 0.977 1.000 0.000 0.000
#> SRR1818611 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818612 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818605 1 0.1163 0.972 0.972 0.000 0.028
#> SRR1818606 1 0.1163 0.972 0.972 0.000 0.028
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 1 0.0817 0.904 0.976 0.000 0.000 0.024
#> SRR1818632 1 0.0817 0.904 0.976 0.000 0.000 0.024
#> SRR1818679 1 0.3652 0.857 0.856 0.092 0.000 0.052
#> SRR1818680 1 0.3525 0.854 0.860 0.100 0.000 0.040
#> SRR1818677 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818678 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818675 1 0.0469 0.909 0.988 0.000 0.000 0.012
#> SRR1818676 1 0.0469 0.909 0.988 0.000 0.000 0.012
#> SRR1818673 3 0.1716 0.983 0.000 0.064 0.936 0.000
#> SRR1818674 3 0.1716 0.983 0.000 0.064 0.936 0.000
#> SRR1818671 2 0.0469 0.944 0.000 0.988 0.000 0.012
#> SRR1818672 2 0.0469 0.944 0.000 0.988 0.000 0.012
#> SRR1818661 1 0.0817 0.904 0.976 0.000 0.000 0.024
#> SRR1818662 1 0.0817 0.904 0.976 0.000 0.000 0.024
#> SRR1818655 1 0.0188 0.912 0.996 0.000 0.004 0.000
#> SRR1818656 1 0.0188 0.912 0.996 0.000 0.004 0.000
#> SRR1818653 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818654 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818651 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818658 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818649 1 0.6818 0.642 0.600 0.000 0.232 0.168
#> SRR1818650 1 0.6542 0.702 0.636 0.000 0.196 0.168
#> SRR1818659 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818647 4 0.3266 0.998 0.000 0.168 0.000 0.832
#> SRR1818648 4 0.3266 0.998 0.000 0.168 0.000 0.832
#> SRR1818645 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818646 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818639 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818640 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818637 4 0.3266 0.998 0.000 0.168 0.000 0.832
#> SRR1818638 4 0.3266 0.998 0.000 0.168 0.000 0.832
#> SRR1818635 3 0.1302 0.969 0.000 0.044 0.956 0.000
#> SRR1818636 3 0.1557 0.980 0.000 0.056 0.944 0.000
#> SRR1818643 3 0.2111 0.962 0.024 0.044 0.932 0.000
#> SRR1818644 3 0.2227 0.946 0.036 0.036 0.928 0.000
#> SRR1818641 3 0.1902 0.981 0.004 0.064 0.932 0.000
#> SRR1818642 3 0.1716 0.981 0.000 0.064 0.936 0.000
#> SRR1818633 1 0.3695 0.867 0.828 0.000 0.016 0.156
#> SRR1818634 1 0.3910 0.864 0.820 0.000 0.024 0.156
#> SRR1818665 1 0.3245 0.884 0.880 0.000 0.064 0.056
#> SRR1818666 1 0.4010 0.869 0.836 0.000 0.064 0.100
#> SRR1818667 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818668 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818669 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818670 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818663 1 0.4758 0.840 0.780 0.000 0.064 0.156
#> SRR1818664 1 0.4758 0.840 0.780 0.000 0.064 0.156
#> SRR1818629 3 0.1716 0.983 0.000 0.064 0.936 0.000
#> SRR1818630 3 0.1716 0.983 0.000 0.064 0.936 0.000
#> SRR1818627 1 0.1022 0.907 0.968 0.000 0.032 0.000
#> SRR1818628 1 0.0804 0.911 0.980 0.000 0.008 0.012
#> SRR1818621 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818622 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818625 1 0.6883 0.618 0.584 0.000 0.260 0.156
#> SRR1818626 1 0.6240 0.741 0.668 0.000 0.176 0.156
#> SRR1818623 4 0.3266 0.998 0.000 0.168 0.000 0.832
#> SRR1818624 4 0.3266 0.998 0.000 0.168 0.000 0.832
#> SRR1818619 1 0.4663 0.845 0.788 0.000 0.064 0.148
#> SRR1818620 1 0.4758 0.840 0.780 0.000 0.064 0.156
#> SRR1818617 2 0.0817 0.932 0.000 0.976 0.024 0.000
#> SRR1818618 2 0.0707 0.933 0.000 0.980 0.020 0.000
#> SRR1818615 2 0.3610 0.731 0.000 0.800 0.200 0.000
#> SRR1818616 2 0.3726 0.720 0.000 0.788 0.212 0.000
#> SRR1818609 4 0.3402 0.995 0.000 0.164 0.004 0.832
#> SRR1818610 4 0.3402 0.995 0.000 0.164 0.004 0.832
#> SRR1818607 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818608 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR1818613 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.912 1.000 0.000 0.000 0.000
#> SRR1818611 1 0.4893 0.834 0.768 0.000 0.064 0.168
#> SRR1818612 1 0.4893 0.834 0.768 0.000 0.064 0.168
#> SRR1818605 1 0.3024 0.874 0.852 0.000 0.000 0.148
#> SRR1818606 1 0.2999 0.879 0.864 0.000 0.004 0.132
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.1211 0.920 0.016 0.000 0.960 0.024 0.000
#> SRR1818632 3 0.1211 0.920 0.016 0.000 0.960 0.024 0.000
#> SRR1818679 3 0.3758 0.801 0.096 0.088 0.816 0.000 0.000
#> SRR1818680 3 0.3702 0.802 0.084 0.096 0.820 0.000 0.000
#> SRR1818677 2 0.0162 0.946 0.004 0.996 0.000 0.000 0.000
#> SRR1818678 2 0.0162 0.946 0.004 0.996 0.000 0.000 0.000
#> SRR1818675 3 0.1478 0.906 0.000 0.000 0.936 0.064 0.000
#> SRR1818676 3 0.1608 0.900 0.000 0.000 0.928 0.072 0.000
#> SRR1818673 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818674 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818671 2 0.1410 0.911 0.000 0.940 0.000 0.060 0.000
#> SRR1818672 2 0.1043 0.926 0.000 0.960 0.000 0.040 0.000
#> SRR1818661 3 0.1211 0.920 0.016 0.000 0.960 0.024 0.000
#> SRR1818662 3 0.1211 0.920 0.016 0.000 0.960 0.024 0.000
#> SRR1818655 3 0.0794 0.927 0.028 0.000 0.972 0.000 0.000
#> SRR1818656 3 0.0963 0.922 0.036 0.000 0.964 0.000 0.000
#> SRR1818653 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818654 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818651 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818652 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818657 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818658 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818649 1 0.4256 0.141 0.564 0.000 0.436 0.000 0.000
#> SRR1818650 1 0.3586 0.603 0.736 0.000 0.264 0.000 0.000
#> SRR1818659 3 0.0880 0.924 0.032 0.000 0.968 0.000 0.000
#> SRR1818647 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000
#> SRR1818648 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000
#> SRR1818645 2 0.0000 0.947 0.000 1.000 0.000 0.000 0.000
#> SRR1818646 2 0.0000 0.947 0.000 1.000 0.000 0.000 0.000
#> SRR1818639 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818640 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818637 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000
#> SRR1818638 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000
#> SRR1818635 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818636 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818643 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818644 5 0.0162 0.994 0.000 0.000 0.004 0.000 0.996
#> SRR1818641 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818642 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818633 3 0.3534 0.672 0.256 0.000 0.744 0.000 0.000
#> SRR1818634 3 0.3452 0.693 0.244 0.000 0.756 0.000 0.000
#> SRR1818665 1 0.3143 0.730 0.796 0.000 0.204 0.000 0.000
#> SRR1818666 1 0.2605 0.776 0.852 0.000 0.148 0.000 0.000
#> SRR1818667 2 0.0000 0.947 0.000 1.000 0.000 0.000 0.000
#> SRR1818668 2 0.0000 0.947 0.000 1.000 0.000 0.000 0.000
#> SRR1818669 3 0.0162 0.935 0.004 0.000 0.996 0.000 0.000
#> SRR1818670 3 0.0162 0.935 0.004 0.000 0.996 0.000 0.000
#> SRR1818663 1 0.1608 0.805 0.928 0.000 0.072 0.000 0.000
#> SRR1818664 1 0.1608 0.805 0.928 0.000 0.072 0.000 0.000
#> SRR1818629 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818630 5 0.0000 0.999 0.000 0.000 0.000 0.000 1.000
#> SRR1818627 3 0.1544 0.895 0.068 0.000 0.932 0.000 0.000
#> SRR1818628 3 0.0880 0.925 0.032 0.000 0.968 0.000 0.000
#> SRR1818621 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818622 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818625 1 0.1809 0.801 0.928 0.000 0.060 0.000 0.012
#> SRR1818626 1 0.1764 0.803 0.928 0.000 0.064 0.000 0.008
#> SRR1818623 4 0.0290 0.992 0.000 0.008 0.000 0.992 0.000
#> SRR1818624 4 0.0162 0.995 0.000 0.004 0.000 0.996 0.000
#> SRR1818619 1 0.2179 0.800 0.888 0.000 0.112 0.000 0.000
#> SRR1818620 1 0.2074 0.801 0.896 0.000 0.104 0.000 0.000
#> SRR1818617 1 0.4273 0.211 0.552 0.448 0.000 0.000 0.000
#> SRR1818618 1 0.4283 0.190 0.544 0.456 0.000 0.000 0.000
#> SRR1818615 2 0.3109 0.767 0.000 0.800 0.000 0.000 0.200
#> SRR1818616 2 0.3305 0.733 0.000 0.776 0.000 0.000 0.224
#> SRR1818609 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000
#> SRR1818610 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000
#> SRR1818607 2 0.0000 0.947 0.000 1.000 0.000 0.000 0.000
#> SRR1818608 2 0.0000 0.947 0.000 1.000 0.000 0.000 0.000
#> SRR1818613 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818614 3 0.0000 0.935 0.000 0.000 1.000 0.000 0.000
#> SRR1818611 1 0.0510 0.770 0.984 0.000 0.016 0.000 0.000
#> SRR1818612 1 0.0609 0.773 0.980 0.000 0.020 0.000 0.000
#> SRR1818605 3 0.3074 0.774 0.196 0.000 0.804 0.000 0.000
#> SRR1818606 3 0.2966 0.789 0.184 0.000 0.816 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.3833 0.911 0.344 0.000 0.648 0.008 0.000 0.000
#> SRR1818632 3 0.3847 0.915 0.348 0.000 0.644 0.008 0.000 0.000
#> SRR1818679 1 0.3620 0.512 0.648 0.000 0.352 0.000 0.000 0.000
#> SRR1818680 1 0.3531 0.535 0.672 0.000 0.328 0.000 0.000 0.000
#> SRR1818677 5 0.0146 0.943 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR1818678 5 0.0146 0.943 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR1818675 1 0.3717 0.642 0.776 0.000 0.160 0.064 0.000 0.000
#> SRR1818676 1 0.3825 0.635 0.768 0.000 0.160 0.072 0.000 0.000
#> SRR1818673 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818674 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818671 5 0.1327 0.904 0.000 0.000 0.000 0.064 0.936 0.000
#> SRR1818672 5 0.0865 0.925 0.000 0.000 0.000 0.036 0.964 0.000
#> SRR1818661 3 0.4032 0.910 0.420 0.000 0.572 0.008 0.000 0.000
#> SRR1818662 3 0.4032 0.910 0.420 0.000 0.572 0.008 0.000 0.000
#> SRR1818655 1 0.0713 0.782 0.972 0.000 0.000 0.000 0.000 0.028
#> SRR1818656 1 0.0865 0.780 0.964 0.000 0.000 0.000 0.000 0.036
#> SRR1818653 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818654 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818651 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818658 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818649 1 0.5995 0.105 0.436 0.000 0.260 0.000 0.000 0.304
#> SRR1818650 6 0.5889 0.314 0.264 0.000 0.260 0.000 0.000 0.476
#> SRR1818659 1 0.3555 0.566 0.712 0.000 0.008 0.000 0.000 0.280
#> SRR1818647 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818648 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818645 5 0.0000 0.944 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818646 5 0.0000 0.944 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818639 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818640 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818637 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818638 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818635 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818636 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818643 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818644 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818641 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818642 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818633 1 0.3494 0.625 0.736 0.000 0.012 0.000 0.000 0.252
#> SRR1818634 1 0.3509 0.631 0.744 0.000 0.016 0.000 0.000 0.240
#> SRR1818665 6 0.2527 0.667 0.000 0.000 0.168 0.000 0.000 0.832
#> SRR1818666 6 0.2527 0.667 0.000 0.000 0.168 0.000 0.000 0.832
#> SRR1818667 5 0.0000 0.944 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818668 5 0.0000 0.944 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818669 1 0.1644 0.758 0.920 0.000 0.004 0.000 0.000 0.076
#> SRR1818670 1 0.0547 0.783 0.980 0.000 0.000 0.000 0.000 0.020
#> SRR1818663 6 0.0000 0.714 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818664 6 0.0000 0.714 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818629 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818630 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818627 1 0.2968 0.659 0.816 0.000 0.168 0.000 0.000 0.016
#> SRR1818628 1 0.2527 0.675 0.832 0.000 0.168 0.000 0.000 0.000
#> SRR1818621 1 0.1556 0.712 0.920 0.000 0.080 0.000 0.000 0.000
#> SRR1818622 1 0.1957 0.663 0.888 0.000 0.112 0.000 0.000 0.000
#> SRR1818625 6 0.0000 0.714 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818626 6 0.0000 0.714 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818623 4 0.0405 0.989 0.000 0.000 0.004 0.988 0.008 0.000
#> SRR1818624 4 0.0508 0.987 0.000 0.000 0.012 0.984 0.004 0.000
#> SRR1818619 6 0.5120 0.362 0.280 0.000 0.120 0.000 0.000 0.600
#> SRR1818620 6 0.4929 0.380 0.280 0.000 0.100 0.000 0.000 0.620
#> SRR1818617 6 0.3817 0.345 0.000 0.000 0.000 0.000 0.432 0.568
#> SRR1818618 6 0.3828 0.327 0.000 0.000 0.000 0.000 0.440 0.560
#> SRR1818615 5 0.2762 0.773 0.000 0.196 0.000 0.000 0.804 0.000
#> SRR1818616 5 0.2969 0.733 0.000 0.224 0.000 0.000 0.776 0.000
#> SRR1818609 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818610 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818607 5 0.0000 0.944 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818608 5 0.0000 0.944 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818613 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 0.785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1818611 6 0.3198 0.646 0.000 0.000 0.260 0.000 0.000 0.740
#> SRR1818612 6 0.3337 0.645 0.004 0.000 0.260 0.000 0.000 0.736
#> SRR1818605 1 0.3514 0.630 0.752 0.000 0.020 0.000 0.000 0.228
#> SRR1818606 1 0.3271 0.634 0.760 0.000 0.008 0.000 0.000 0.232
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 15216 rows and 75 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.462 0.780 0.871 0.4483 0.493 0.493
#> 3 3 0.412 0.605 0.804 0.3561 0.854 0.712
#> 4 4 0.608 0.700 0.806 0.1593 0.777 0.486
#> 5 5 0.613 0.558 0.700 0.0843 0.916 0.717
#> 6 6 0.614 0.590 0.692 0.0545 0.901 0.613
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
#> SRR1818631 1 0.9286 0.723 0.656 0.344
#> SRR1818632 1 0.9286 0.723 0.656 0.344
#> SRR1818679 2 0.8144 0.539 0.252 0.748
#> SRR1818680 2 0.8081 0.548 0.248 0.752
#> SRR1818677 2 0.0000 0.924 0.000 1.000
#> SRR1818678 2 0.0000 0.924 0.000 1.000
#> SRR1818675 2 0.9850 -0.131 0.428 0.572
#> SRR1818676 2 0.9850 -0.131 0.428 0.572
#> SRR1818673 2 0.0938 0.921 0.012 0.988
#> SRR1818674 2 0.0938 0.921 0.012 0.988
#> SRR1818671 2 0.0000 0.924 0.000 1.000
#> SRR1818672 2 0.0000 0.924 0.000 1.000
#> SRR1818661 1 0.9522 0.686 0.628 0.372
#> SRR1818662 1 0.9522 0.686 0.628 0.372
#> SRR1818655 1 0.9170 0.734 0.668 0.332
#> SRR1818656 1 0.9170 0.734 0.668 0.332
#> SRR1818653 1 0.9248 0.728 0.660 0.340
#> SRR1818654 1 0.9248 0.728 0.660 0.340
#> SRR1818651 1 0.4939 0.774 0.892 0.108
#> SRR1818652 1 0.4815 0.774 0.896 0.104
#> SRR1818657 1 0.0938 0.749 0.988 0.012
#> SRR1818658 1 0.1184 0.748 0.984 0.016
#> SRR1818649 1 0.7219 0.747 0.800 0.200
#> SRR1818650 1 0.7219 0.745 0.800 0.200
#> SRR1818659 1 0.9087 0.739 0.676 0.324
#> SRR1818647 2 0.0938 0.921 0.012 0.988
#> SRR1818648 2 0.0938 0.921 0.012 0.988
#> SRR1818645 2 0.0000 0.924 0.000 1.000
#> SRR1818646 2 0.0000 0.924 0.000 1.000
#> SRR1818639 1 0.9087 0.739 0.676 0.324
#> SRR1818640 1 0.9087 0.739 0.676 0.324
#> SRR1818637 2 0.0938 0.921 0.012 0.988
#> SRR1818638 2 0.0938 0.921 0.012 0.988
#> SRR1818635 2 0.0672 0.923 0.008 0.992
#> SRR1818636 2 0.0376 0.924 0.004 0.996
#> SRR1818643 2 0.0000 0.924 0.000 1.000
#> SRR1818644 2 0.0000 0.924 0.000 1.000
#> SRR1818641 2 0.0000 0.924 0.000 1.000
#> SRR1818642 2 0.0000 0.924 0.000 1.000
#> SRR1818633 2 0.8267 0.519 0.260 0.740
#> SRR1818634 2 0.8267 0.519 0.260 0.740
#> SRR1818665 1 0.0938 0.746 0.988 0.012
#> SRR1818666 1 0.0938 0.746 0.988 0.012
#> SRR1818667 2 0.0672 0.923 0.008 0.992
#> SRR1818668 2 0.0672 0.923 0.008 0.992
#> SRR1818669 1 0.9087 0.739 0.676 0.324
#> SRR1818670 1 0.9087 0.739 0.676 0.324
#> SRR1818663 1 0.0938 0.746 0.988 0.012
#> SRR1818664 1 0.0938 0.746 0.988 0.012
#> SRR1818629 2 0.0000 0.924 0.000 1.000
#> SRR1818630 2 0.0000 0.924 0.000 1.000
#> SRR1818627 1 0.3431 0.767 0.936 0.064
#> SRR1818628 1 0.3584 0.768 0.932 0.068
#> SRR1818621 1 0.9248 0.728 0.660 0.340
#> SRR1818622 1 0.9248 0.728 0.660 0.340
#> SRR1818625 1 0.0938 0.746 0.988 0.012
#> SRR1818626 1 0.0938 0.746 0.988 0.012
#> SRR1818623 2 0.0938 0.921 0.012 0.988
#> SRR1818624 2 0.0938 0.921 0.012 0.988
#> SRR1818619 1 0.9866 0.570 0.568 0.432
#> SRR1818620 1 0.9922 0.531 0.552 0.448
#> SRR1818617 2 0.0000 0.924 0.000 1.000
#> SRR1818618 2 0.0000 0.924 0.000 1.000
#> SRR1818615 2 0.0376 0.924 0.004 0.996
#> SRR1818616 2 0.0376 0.924 0.004 0.996
#> SRR1818609 2 0.0376 0.924 0.004 0.996
#> SRR1818610 2 0.0376 0.924 0.004 0.996
#> SRR1818607 2 0.0000 0.924 0.000 1.000
#> SRR1818608 2 0.0000 0.924 0.000 1.000
#> SRR1818613 1 0.2603 0.765 0.956 0.044
#> SRR1818614 1 0.2603 0.765 0.956 0.044
#> SRR1818611 1 0.4298 0.764 0.912 0.088
#> SRR1818612 1 0.5178 0.762 0.884 0.116
#> SRR1818605 1 0.8499 0.752 0.724 0.276
#> SRR1818606 1 0.8443 0.753 0.728 0.272
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.6647 0.4570 0.396 0.012 0.592
#> SRR1818632 3 0.6647 0.4570 0.396 0.012 0.592
#> SRR1818679 2 0.9797 0.0897 0.240 0.404 0.356
#> SRR1818680 2 0.9818 0.0976 0.248 0.408 0.344
#> SRR1818677 2 0.1289 0.8165 0.032 0.968 0.000
#> SRR1818678 2 0.1289 0.8165 0.032 0.968 0.000
#> SRR1818675 3 0.4821 0.7558 0.088 0.064 0.848
#> SRR1818676 3 0.4982 0.7509 0.096 0.064 0.840
#> SRR1818673 2 0.1774 0.8186 0.024 0.960 0.016
#> SRR1818674 2 0.1774 0.8186 0.024 0.960 0.016
#> SRR1818671 2 0.1643 0.8007 0.000 0.956 0.044
#> SRR1818672 2 0.1964 0.7954 0.000 0.944 0.056
#> SRR1818661 1 0.7353 -0.2559 0.568 0.036 0.396
#> SRR1818662 1 0.7353 -0.2559 0.568 0.036 0.396
#> SRR1818655 1 0.1765 0.6576 0.956 0.004 0.040
#> SRR1818656 1 0.1765 0.6576 0.956 0.004 0.040
#> SRR1818653 1 0.5650 0.1951 0.688 0.000 0.312
#> SRR1818654 1 0.5497 0.2504 0.708 0.000 0.292
#> SRR1818651 1 0.1129 0.6833 0.976 0.020 0.004
#> SRR1818652 1 0.1711 0.6919 0.960 0.032 0.008
#> SRR1818657 1 0.4805 0.7151 0.812 0.176 0.012
#> SRR1818658 1 0.5072 0.7107 0.792 0.196 0.012
#> SRR1818649 1 0.6566 0.4976 0.612 0.376 0.012
#> SRR1818650 1 0.6584 0.4921 0.608 0.380 0.012
#> SRR1818659 1 0.1765 0.6576 0.956 0.004 0.040
#> SRR1818647 3 0.2066 0.7673 0.000 0.060 0.940
#> SRR1818648 3 0.2066 0.7673 0.000 0.060 0.940
#> SRR1818645 2 0.0592 0.8097 0.000 0.988 0.012
#> SRR1818646 2 0.0592 0.8097 0.000 0.988 0.012
#> SRR1818639 1 0.1765 0.6576 0.956 0.004 0.040
#> SRR1818640 1 0.1765 0.6576 0.956 0.004 0.040
#> SRR1818637 3 0.2356 0.7485 0.000 0.072 0.928
#> SRR1818638 3 0.2356 0.7485 0.000 0.072 0.928
#> SRR1818635 2 0.1774 0.8186 0.024 0.960 0.016
#> SRR1818636 2 0.1774 0.8186 0.024 0.960 0.016
#> SRR1818643 2 0.1031 0.8191 0.024 0.976 0.000
#> SRR1818644 2 0.1031 0.8191 0.024 0.976 0.000
#> SRR1818641 2 0.1031 0.8191 0.024 0.976 0.000
#> SRR1818642 2 0.1031 0.8191 0.024 0.976 0.000
#> SRR1818633 2 0.9793 0.0504 0.236 0.388 0.376
#> SRR1818634 2 0.9793 0.0504 0.236 0.388 0.376
#> SRR1818665 1 0.5122 0.7090 0.788 0.200 0.012
#> SRR1818666 1 0.5122 0.7090 0.788 0.200 0.012
#> SRR1818667 2 0.5785 0.5369 0.000 0.668 0.332
#> SRR1818668 2 0.5678 0.5606 0.000 0.684 0.316
#> SRR1818669 1 0.3690 0.7231 0.884 0.100 0.016
#> SRR1818670 1 0.3690 0.7231 0.884 0.100 0.016
#> SRR1818663 1 0.5122 0.7090 0.788 0.200 0.012
#> SRR1818664 1 0.5171 0.7068 0.784 0.204 0.012
#> SRR1818629 2 0.1267 0.8194 0.024 0.972 0.004
#> SRR1818630 2 0.1267 0.8194 0.024 0.972 0.004
#> SRR1818627 1 0.3539 0.7222 0.888 0.100 0.012
#> SRR1818628 1 0.3695 0.7236 0.880 0.108 0.012
#> SRR1818621 3 0.6483 0.3511 0.452 0.004 0.544
#> SRR1818622 3 0.6476 0.3576 0.448 0.004 0.548
#> SRR1818625 1 0.6381 0.5580 0.648 0.340 0.012
#> SRR1818626 1 0.6404 0.5516 0.644 0.344 0.012
#> SRR1818623 3 0.2066 0.7673 0.000 0.060 0.940
#> SRR1818624 3 0.2066 0.7673 0.000 0.060 0.940
#> SRR1818619 1 0.9507 0.2415 0.432 0.380 0.188
#> SRR1818620 1 0.9507 0.2415 0.432 0.380 0.188
#> SRR1818617 2 0.1031 0.8191 0.024 0.976 0.000
#> SRR1818618 2 0.1031 0.8191 0.024 0.976 0.000
#> SRR1818615 2 0.3267 0.7521 0.000 0.884 0.116
#> SRR1818616 2 0.3267 0.7521 0.000 0.884 0.116
#> SRR1818609 2 0.6309 0.1697 0.000 0.500 0.500
#> SRR1818610 2 0.6309 0.1697 0.000 0.500 0.500
#> SRR1818607 2 0.0592 0.8097 0.000 0.988 0.012
#> SRR1818608 2 0.0592 0.8097 0.000 0.988 0.012
#> SRR1818613 1 0.2959 0.7220 0.900 0.100 0.000
#> SRR1818614 1 0.2878 0.7209 0.904 0.096 0.000
#> SRR1818611 1 0.6548 0.5076 0.616 0.372 0.012
#> SRR1818612 1 0.6548 0.5076 0.616 0.372 0.012
#> SRR1818605 1 0.1170 0.6799 0.976 0.016 0.008
#> SRR1818606 1 0.1170 0.6799 0.976 0.016 0.008
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 4 0.667 0.501 0.160 0.016 0.160 0.664
#> SRR1818632 4 0.667 0.501 0.160 0.016 0.160 0.664
#> SRR1818679 1 0.754 0.453 0.568 0.032 0.124 0.276
#> SRR1818680 1 0.750 0.459 0.572 0.032 0.120 0.276
#> SRR1818677 2 0.225 0.900 0.040 0.932 0.008 0.020
#> SRR1818678 2 0.221 0.901 0.040 0.932 0.004 0.024
#> SRR1818675 4 0.433 0.655 0.048 0.028 0.084 0.840
#> SRR1818676 4 0.433 0.655 0.048 0.028 0.084 0.840
#> SRR1818673 2 0.370 0.859 0.004 0.860 0.052 0.084
#> SRR1818674 2 0.370 0.859 0.004 0.860 0.052 0.084
#> SRR1818671 2 0.453 0.734 0.012 0.764 0.008 0.216
#> SRR1818672 2 0.457 0.728 0.012 0.760 0.008 0.220
#> SRR1818661 4 0.693 0.479 0.140 0.016 0.212 0.632
#> SRR1818662 4 0.693 0.479 0.140 0.016 0.212 0.632
#> SRR1818655 3 0.401 0.707 0.244 0.000 0.756 0.000
#> SRR1818656 3 0.401 0.707 0.244 0.000 0.756 0.000
#> SRR1818653 3 0.771 0.479 0.228 0.000 0.424 0.348
#> SRR1818654 3 0.771 0.479 0.228 0.000 0.424 0.348
#> SRR1818651 1 0.230 0.788 0.932 0.032 0.024 0.012
#> SRR1818652 1 0.230 0.788 0.932 0.032 0.024 0.012
#> SRR1818657 1 0.112 0.791 0.964 0.036 0.000 0.000
#> SRR1818658 1 0.112 0.791 0.964 0.036 0.000 0.000
#> SRR1818649 1 0.316 0.778 0.884 0.068 0.000 0.048
#> SRR1818650 1 0.324 0.776 0.880 0.068 0.000 0.052
#> SRR1818659 3 0.453 0.650 0.292 0.004 0.704 0.000
#> SRR1818647 4 0.184 0.676 0.028 0.016 0.008 0.948
#> SRR1818648 4 0.184 0.676 0.028 0.016 0.008 0.948
#> SRR1818645 2 0.138 0.909 0.008 0.964 0.008 0.020
#> SRR1818646 2 0.138 0.909 0.008 0.964 0.008 0.020
#> SRR1818639 3 0.401 0.707 0.244 0.000 0.756 0.000
#> SRR1818640 3 0.401 0.707 0.244 0.000 0.756 0.000
#> SRR1818637 4 0.373 0.615 0.000 0.044 0.108 0.848
#> SRR1818638 4 0.373 0.615 0.000 0.044 0.108 0.848
#> SRR1818635 2 0.369 0.860 0.004 0.860 0.048 0.088
#> SRR1818636 2 0.369 0.860 0.004 0.860 0.048 0.088
#> SRR1818643 2 0.106 0.912 0.012 0.972 0.016 0.000
#> SRR1818644 2 0.106 0.912 0.012 0.972 0.016 0.000
#> SRR1818641 2 0.152 0.915 0.016 0.960 0.016 0.008
#> SRR1818642 2 0.152 0.915 0.016 0.960 0.016 0.008
#> SRR1818633 1 0.792 0.189 0.464 0.032 0.128 0.376
#> SRR1818634 1 0.790 0.229 0.476 0.032 0.128 0.364
#> SRR1818665 1 0.121 0.791 0.960 0.040 0.000 0.000
#> SRR1818666 1 0.121 0.791 0.960 0.040 0.000 0.000
#> SRR1818667 4 0.562 0.369 0.008 0.416 0.012 0.564
#> SRR1818668 4 0.564 0.347 0.008 0.424 0.012 0.556
#> SRR1818669 1 0.418 0.725 0.824 0.032 0.008 0.136
#> SRR1818670 1 0.418 0.725 0.824 0.032 0.008 0.136
#> SRR1818663 1 0.130 0.791 0.956 0.044 0.000 0.000
#> SRR1818664 1 0.130 0.791 0.956 0.044 0.000 0.000
#> SRR1818629 2 0.168 0.909 0.004 0.948 0.004 0.044
#> SRR1818630 2 0.168 0.909 0.004 0.948 0.004 0.044
#> SRR1818627 1 0.253 0.788 0.924 0.024 0.032 0.020
#> SRR1818628 1 0.242 0.789 0.928 0.024 0.032 0.016
#> SRR1818621 3 0.675 0.218 0.092 0.000 0.464 0.444
#> SRR1818622 3 0.675 0.218 0.092 0.000 0.464 0.444
#> SRR1818625 1 0.164 0.792 0.948 0.044 0.000 0.008
#> SRR1818626 1 0.164 0.792 0.948 0.044 0.000 0.008
#> SRR1818623 4 0.172 0.674 0.028 0.008 0.012 0.952
#> SRR1818624 4 0.172 0.674 0.028 0.008 0.012 0.952
#> SRR1818619 1 0.680 0.577 0.656 0.024 0.120 0.200
#> SRR1818620 1 0.683 0.573 0.652 0.024 0.120 0.204
#> SRR1818617 2 0.125 0.911 0.016 0.968 0.004 0.012
#> SRR1818618 2 0.125 0.911 0.016 0.968 0.004 0.012
#> SRR1818615 2 0.281 0.882 0.008 0.896 0.008 0.088
#> SRR1818616 2 0.281 0.882 0.008 0.896 0.008 0.088
#> SRR1818609 4 0.519 0.512 0.008 0.328 0.008 0.656
#> SRR1818610 4 0.519 0.512 0.008 0.328 0.008 0.656
#> SRR1818607 2 0.138 0.909 0.008 0.964 0.008 0.020
#> SRR1818608 2 0.138 0.909 0.008 0.964 0.008 0.020
#> SRR1818613 1 0.261 0.786 0.920 0.024 0.016 0.040
#> SRR1818614 1 0.261 0.786 0.920 0.024 0.016 0.040
#> SRR1818611 1 0.377 0.749 0.860 0.048 0.084 0.008
#> SRR1818612 1 0.377 0.749 0.860 0.048 0.084 0.008
#> SRR1818605 1 0.523 0.641 0.756 0.024 0.032 0.188
#> SRR1818606 1 0.537 0.636 0.752 0.024 0.040 0.184
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 4 0.8377 0.6394 0.048 0.072 0.276 0.440 0.164
#> SRR1818632 4 0.8377 0.6394 0.048 0.072 0.276 0.440 0.164
#> SRR1818679 1 0.8654 -0.0585 0.344 0.136 0.212 0.016 0.292
#> SRR1818680 1 0.8633 -0.0369 0.348 0.136 0.204 0.016 0.296
#> SRR1818677 2 0.6115 0.5575 0.068 0.676 0.028 0.036 0.192
#> SRR1818678 2 0.6129 0.5623 0.064 0.676 0.028 0.040 0.192
#> SRR1818675 4 0.8103 0.6793 0.120 0.016 0.272 0.456 0.136
#> SRR1818676 4 0.8103 0.6793 0.120 0.016 0.272 0.456 0.136
#> SRR1818673 5 0.4469 0.2008 0.004 0.348 0.004 0.004 0.640
#> SRR1818674 5 0.4469 0.2008 0.004 0.348 0.004 0.004 0.640
#> SRR1818671 2 0.4841 0.5074 0.000 0.708 0.000 0.084 0.208
#> SRR1818672 2 0.4944 0.5002 0.000 0.700 0.000 0.092 0.208
#> SRR1818661 4 0.7962 0.6579 0.084 0.000 0.272 0.380 0.264
#> SRR1818662 4 0.7962 0.6579 0.084 0.000 0.272 0.380 0.264
#> SRR1818655 3 0.5865 0.7606 0.056 0.016 0.556 0.368 0.004
#> SRR1818656 3 0.5865 0.7606 0.056 0.016 0.556 0.368 0.004
#> SRR1818653 3 0.1845 0.5854 0.056 0.000 0.928 0.000 0.016
#> SRR1818654 3 0.1845 0.5854 0.056 0.000 0.928 0.000 0.016
#> SRR1818651 1 0.2848 0.7768 0.896 0.036 0.040 0.024 0.004
#> SRR1818652 1 0.2924 0.7760 0.892 0.036 0.044 0.024 0.004
#> SRR1818657 1 0.1314 0.7883 0.960 0.012 0.016 0.000 0.012
#> SRR1818658 1 0.1314 0.7883 0.960 0.012 0.016 0.000 0.012
#> SRR1818649 1 0.3360 0.7650 0.868 0.044 0.024 0.004 0.060
#> SRR1818650 1 0.3360 0.7650 0.868 0.044 0.024 0.004 0.060
#> SRR1818659 3 0.5975 0.7538 0.064 0.016 0.548 0.368 0.004
#> SRR1818647 4 0.8173 0.6357 0.008 0.080 0.240 0.352 0.320
#> SRR1818648 4 0.8173 0.6357 0.008 0.080 0.240 0.352 0.320
#> SRR1818645 2 0.0510 0.6560 0.000 0.984 0.000 0.000 0.016
#> SRR1818646 2 0.0510 0.6560 0.000 0.984 0.000 0.000 0.016
#> SRR1818639 3 0.5807 0.7600 0.052 0.016 0.560 0.368 0.004
#> SRR1818640 3 0.5807 0.7600 0.052 0.016 0.560 0.368 0.004
#> SRR1818637 4 0.6861 0.5350 0.000 0.012 0.368 0.424 0.196
#> SRR1818638 4 0.6861 0.5350 0.000 0.012 0.368 0.424 0.196
#> SRR1818635 5 0.4849 -0.0583 0.016 0.432 0.004 0.000 0.548
#> SRR1818636 5 0.4855 -0.0754 0.016 0.436 0.004 0.000 0.544
#> SRR1818643 2 0.3700 0.6371 0.008 0.784 0.004 0.004 0.200
#> SRR1818644 2 0.3700 0.6371 0.008 0.784 0.004 0.004 0.200
#> SRR1818641 2 0.4275 0.6372 0.012 0.716 0.004 0.004 0.264
#> SRR1818642 2 0.4275 0.6372 0.012 0.716 0.004 0.004 0.264
#> SRR1818633 5 0.7727 -0.1435 0.244 0.080 0.180 0.008 0.488
#> SRR1818634 5 0.7727 -0.1435 0.244 0.080 0.180 0.008 0.488
#> SRR1818665 1 0.1372 0.7883 0.956 0.024 0.016 0.000 0.004
#> SRR1818666 1 0.1372 0.7883 0.956 0.024 0.016 0.000 0.004
#> SRR1818667 2 0.6853 0.3106 0.000 0.592 0.108 0.100 0.200
#> SRR1818668 2 0.6627 0.3406 0.000 0.612 0.088 0.100 0.200
#> SRR1818669 1 0.5902 0.4851 0.568 0.032 0.040 0.004 0.356
#> SRR1818670 1 0.5914 0.4817 0.564 0.032 0.040 0.004 0.360
#> SRR1818663 1 0.1202 0.7861 0.960 0.032 0.004 0.000 0.004
#> SRR1818664 1 0.1202 0.7861 0.960 0.032 0.004 0.000 0.004
#> SRR1818629 2 0.4759 0.5589 0.004 0.652 0.004 0.020 0.320
#> SRR1818630 2 0.4741 0.5616 0.004 0.656 0.004 0.020 0.316
#> SRR1818627 1 0.3896 0.7490 0.848 0.056 0.032 0.044 0.020
#> SRR1818628 1 0.3725 0.7539 0.856 0.056 0.032 0.040 0.016
#> SRR1818621 3 0.2153 0.5296 0.044 0.000 0.916 0.040 0.000
#> SRR1818622 3 0.2153 0.5296 0.044 0.000 0.916 0.040 0.000
#> SRR1818625 1 0.1573 0.7851 0.948 0.036 0.004 0.004 0.008
#> SRR1818626 1 0.1573 0.7851 0.948 0.036 0.004 0.004 0.008
#> SRR1818623 4 0.7559 0.6574 0.008 0.028 0.240 0.372 0.352
#> SRR1818624 4 0.7569 0.6584 0.008 0.028 0.244 0.372 0.348
#> SRR1818619 1 0.6038 0.2878 0.460 0.000 0.072 0.016 0.452
#> SRR1818620 1 0.6038 0.2878 0.460 0.000 0.072 0.016 0.452
#> SRR1818617 2 0.3974 0.6342 0.016 0.752 0.004 0.000 0.228
#> SRR1818618 2 0.4030 0.6344 0.012 0.752 0.004 0.004 0.228
#> SRR1818615 2 0.4203 0.5520 0.000 0.760 0.000 0.052 0.188
#> SRR1818616 2 0.4136 0.5551 0.000 0.764 0.000 0.048 0.188
#> SRR1818609 5 0.7768 0.1082 0.000 0.356 0.108 0.140 0.396
#> SRR1818610 5 0.7797 0.0985 0.000 0.352 0.112 0.140 0.396
#> SRR1818607 2 0.0609 0.6544 0.000 0.980 0.000 0.000 0.020
#> SRR1818608 2 0.0609 0.6544 0.000 0.980 0.000 0.000 0.020
#> SRR1818613 1 0.1565 0.7779 0.952 0.020 0.016 0.004 0.008
#> SRR1818614 1 0.1565 0.7779 0.952 0.020 0.016 0.004 0.008
#> SRR1818611 1 0.5654 0.6813 0.728 0.128 0.076 0.052 0.016
#> SRR1818612 1 0.5710 0.6795 0.724 0.128 0.080 0.052 0.016
#> SRR1818605 1 0.4515 0.6864 0.792 0.048 0.120 0.004 0.036
#> SRR1818606 1 0.4515 0.6864 0.792 0.048 0.120 0.004 0.036
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.5376 0.515 0.032 0.024 0.612 0.004 0.020 0.308
#> SRR1818632 3 0.5376 0.515 0.032 0.024 0.612 0.004 0.020 0.308
#> SRR1818679 6 0.7230 0.741 0.296 0.048 0.088 0.040 0.028 0.500
#> SRR1818680 6 0.7230 0.741 0.296 0.048 0.088 0.040 0.028 0.500
#> SRR1818677 2 0.7976 0.510 0.132 0.372 0.012 0.268 0.016 0.200
#> SRR1818678 2 0.7982 0.504 0.132 0.372 0.012 0.264 0.016 0.204
#> SRR1818675 3 0.6465 0.422 0.228 0.016 0.548 0.020 0.008 0.180
#> SRR1818676 3 0.6465 0.422 0.228 0.016 0.548 0.020 0.008 0.180
#> SRR1818673 2 0.3324 0.457 0.004 0.824 0.000 0.060 0.000 0.112
#> SRR1818674 2 0.3324 0.457 0.004 0.824 0.000 0.060 0.000 0.112
#> SRR1818671 4 0.5135 0.638 0.000 0.152 0.084 0.700 0.000 0.064
#> SRR1818672 4 0.5135 0.638 0.000 0.152 0.084 0.700 0.000 0.064
#> SRR1818661 3 0.6064 0.489 0.112 0.024 0.572 0.000 0.020 0.272
#> SRR1818662 3 0.6064 0.489 0.112 0.024 0.572 0.000 0.020 0.272
#> SRR1818655 5 0.0976 0.803 0.008 0.008 0.000 0.016 0.968 0.000
#> SRR1818656 5 0.0976 0.803 0.008 0.008 0.000 0.016 0.968 0.000
#> SRR1818653 5 0.5704 0.727 0.020 0.080 0.136 0.000 0.680 0.084
#> SRR1818654 5 0.5704 0.727 0.020 0.080 0.136 0.000 0.680 0.084
#> SRR1818651 1 0.4298 0.702 0.804 0.024 0.004 0.048 0.056 0.064
#> SRR1818652 1 0.4298 0.702 0.804 0.024 0.004 0.048 0.056 0.064
#> SRR1818657 1 0.2084 0.747 0.920 0.012 0.000 0.012 0.012 0.044
#> SRR1818658 1 0.2084 0.748 0.920 0.012 0.000 0.012 0.012 0.044
#> SRR1818649 1 0.4529 0.545 0.724 0.036 0.000 0.020 0.012 0.208
#> SRR1818650 1 0.4529 0.545 0.724 0.036 0.000 0.020 0.012 0.208
#> SRR1818659 5 0.2228 0.773 0.056 0.008 0.004 0.024 0.908 0.000
#> SRR1818647 3 0.5655 0.507 0.004 0.012 0.600 0.172 0.000 0.212
#> SRR1818648 3 0.5655 0.507 0.004 0.012 0.600 0.172 0.000 0.212
#> SRR1818645 4 0.3000 0.431 0.028 0.092 0.000 0.860 0.004 0.016
#> SRR1818646 4 0.3000 0.431 0.028 0.092 0.000 0.860 0.004 0.016
#> SRR1818639 5 0.0779 0.805 0.008 0.008 0.000 0.008 0.976 0.000
#> SRR1818640 5 0.0779 0.805 0.008 0.008 0.000 0.008 0.976 0.000
#> SRR1818637 3 0.4196 0.475 0.000 0.144 0.772 0.056 0.004 0.024
#> SRR1818638 3 0.4196 0.475 0.000 0.144 0.772 0.056 0.004 0.024
#> SRR1818635 2 0.3357 0.468 0.012 0.832 0.000 0.064 0.000 0.092
#> SRR1818636 2 0.3357 0.468 0.012 0.832 0.000 0.064 0.000 0.092
#> SRR1818643 2 0.6324 0.572 0.032 0.444 0.000 0.416 0.024 0.084
#> SRR1818644 2 0.6324 0.572 0.032 0.444 0.000 0.416 0.024 0.084
#> SRR1818641 2 0.6591 0.595 0.048 0.476 0.000 0.360 0.028 0.088
#> SRR1818642 2 0.6591 0.595 0.048 0.476 0.000 0.360 0.028 0.088
#> SRR1818633 6 0.5747 0.802 0.204 0.048 0.068 0.020 0.004 0.656
#> SRR1818634 6 0.5747 0.802 0.204 0.048 0.068 0.020 0.004 0.656
#> SRR1818665 1 0.1312 0.754 0.956 0.020 0.000 0.012 0.004 0.008
#> SRR1818666 1 0.1312 0.754 0.956 0.020 0.000 0.012 0.004 0.008
#> SRR1818667 4 0.6262 0.548 0.000 0.168 0.268 0.528 0.004 0.032
#> SRR1818668 4 0.6277 0.542 0.000 0.168 0.272 0.524 0.004 0.032
#> SRR1818669 1 0.4691 -0.249 0.524 0.012 0.000 0.016 0.004 0.444
#> SRR1818670 1 0.4691 -0.249 0.524 0.012 0.000 0.016 0.004 0.444
#> SRR1818663 1 0.1350 0.755 0.952 0.020 0.000 0.000 0.008 0.020
#> SRR1818664 1 0.1350 0.755 0.952 0.020 0.000 0.000 0.008 0.020
#> SRR1818629 2 0.4250 0.526 0.020 0.744 0.004 0.204 0.020 0.008
#> SRR1818630 2 0.4279 0.529 0.020 0.740 0.004 0.208 0.020 0.008
#> SRR1818627 1 0.4093 0.686 0.812 0.024 0.020 0.016 0.028 0.100
#> SRR1818628 1 0.4139 0.685 0.808 0.024 0.020 0.016 0.028 0.104
#> SRR1818621 5 0.5907 0.697 0.012 0.084 0.176 0.000 0.644 0.084
#> SRR1818622 5 0.5907 0.697 0.012 0.084 0.176 0.000 0.644 0.084
#> SRR1818625 1 0.2139 0.746 0.920 0.024 0.000 0.020 0.008 0.028
#> SRR1818626 1 0.2139 0.746 0.920 0.024 0.000 0.020 0.008 0.028
#> SRR1818623 3 0.5033 0.563 0.000 0.028 0.676 0.084 0.000 0.212
#> SRR1818624 3 0.5058 0.562 0.000 0.028 0.672 0.084 0.000 0.216
#> SRR1818619 6 0.4750 0.774 0.296 0.020 0.024 0.004 0.004 0.652
#> SRR1818620 6 0.4675 0.771 0.296 0.020 0.020 0.004 0.004 0.656
#> SRR1818617 2 0.6971 0.585 0.052 0.428 0.012 0.380 0.016 0.112
#> SRR1818618 2 0.6923 0.585 0.048 0.432 0.012 0.380 0.016 0.112
#> SRR1818615 4 0.5678 0.614 0.000 0.244 0.108 0.612 0.004 0.032
#> SRR1818616 4 0.5678 0.614 0.000 0.244 0.108 0.612 0.004 0.032
#> SRR1818609 4 0.6746 0.439 0.000 0.128 0.292 0.488 0.004 0.088
#> SRR1818610 4 0.6746 0.439 0.000 0.128 0.292 0.488 0.004 0.088
#> SRR1818607 4 0.2537 0.453 0.024 0.088 0.000 0.880 0.000 0.008
#> SRR1818608 4 0.2537 0.453 0.024 0.088 0.000 0.880 0.000 0.008
#> SRR1818613 1 0.2678 0.729 0.892 0.008 0.004 0.024 0.016 0.056
#> SRR1818614 1 0.2949 0.727 0.880 0.016 0.004 0.028 0.016 0.056
#> SRR1818611 1 0.5525 0.584 0.708 0.052 0.000 0.064 0.120 0.056
#> SRR1818612 1 0.5525 0.584 0.708 0.052 0.000 0.064 0.120 0.056
#> SRR1818605 1 0.4239 0.587 0.780 0.012 0.040 0.016 0.008 0.144
#> SRR1818606 1 0.4239 0.587 0.780 0.012 0.040 0.016 0.008 0.144
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 15216 rows and 75 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.998 0.957 0.981 0.4989 0.504 0.504
#> 3 3 0.568 0.716 0.868 0.2652 0.657 0.434
#> 4 4 0.496 0.570 0.776 0.1341 0.792 0.517
#> 5 5 0.530 0.531 0.722 0.0793 0.870 0.600
#> 6 6 0.555 0.420 0.620 0.0583 0.859 0.488
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
#> SRR1818631 1 0.0000 0.968 1.000 0.000
#> SRR1818632 1 0.0000 0.968 1.000 0.000
#> SRR1818679 1 0.7602 0.733 0.780 0.220
#> SRR1818680 1 0.7528 0.739 0.784 0.216
#> SRR1818677 2 0.0000 0.995 0.000 1.000
#> SRR1818678 2 0.0000 0.995 0.000 1.000
#> SRR1818675 1 0.4298 0.893 0.912 0.088
#> SRR1818676 1 0.4431 0.889 0.908 0.092
#> SRR1818673 2 0.0000 0.995 0.000 1.000
#> SRR1818674 2 0.0000 0.995 0.000 1.000
#> SRR1818671 2 0.0000 0.995 0.000 1.000
#> SRR1818672 2 0.0000 0.995 0.000 1.000
#> SRR1818661 1 0.0000 0.968 1.000 0.000
#> SRR1818662 1 0.0000 0.968 1.000 0.000
#> SRR1818655 1 0.0000 0.968 1.000 0.000
#> SRR1818656 1 0.0000 0.968 1.000 0.000
#> SRR1818653 1 0.0000 0.968 1.000 0.000
#> SRR1818654 1 0.0000 0.968 1.000 0.000
#> SRR1818651 1 0.0000 0.968 1.000 0.000
#> SRR1818652 1 0.0000 0.968 1.000 0.000
#> SRR1818657 1 0.0000 0.968 1.000 0.000
#> SRR1818658 1 0.0000 0.968 1.000 0.000
#> SRR1818649 1 0.0000 0.968 1.000 0.000
#> SRR1818650 1 0.0000 0.968 1.000 0.000
#> SRR1818659 1 0.0000 0.968 1.000 0.000
#> SRR1818647 2 0.0000 0.995 0.000 1.000
#> SRR1818648 2 0.0000 0.995 0.000 1.000
#> SRR1818645 2 0.0000 0.995 0.000 1.000
#> SRR1818646 2 0.0000 0.995 0.000 1.000
#> SRR1818639 1 0.0000 0.968 1.000 0.000
#> SRR1818640 1 0.0000 0.968 1.000 0.000
#> SRR1818637 2 0.0000 0.995 0.000 1.000
#> SRR1818638 2 0.0000 0.995 0.000 1.000
#> SRR1818635 2 0.0000 0.995 0.000 1.000
#> SRR1818636 2 0.0000 0.995 0.000 1.000
#> SRR1818643 2 0.0376 0.992 0.004 0.996
#> SRR1818644 2 0.0672 0.989 0.008 0.992
#> SRR1818641 2 0.3431 0.931 0.064 0.936
#> SRR1818642 2 0.3274 0.936 0.060 0.940
#> SRR1818633 1 0.9522 0.451 0.628 0.372
#> SRR1818634 1 0.9087 0.556 0.676 0.324
#> SRR1818665 1 0.0000 0.968 1.000 0.000
#> SRR1818666 1 0.0000 0.968 1.000 0.000
#> SRR1818667 2 0.0000 0.995 0.000 1.000
#> SRR1818668 2 0.0000 0.995 0.000 1.000
#> SRR1818669 1 0.0000 0.968 1.000 0.000
#> SRR1818670 1 0.0000 0.968 1.000 0.000
#> SRR1818663 1 0.0000 0.968 1.000 0.000
#> SRR1818664 1 0.0000 0.968 1.000 0.000
#> SRR1818629 2 0.0000 0.995 0.000 1.000
#> SRR1818630 2 0.0000 0.995 0.000 1.000
#> SRR1818627 1 0.0000 0.968 1.000 0.000
#> SRR1818628 1 0.0000 0.968 1.000 0.000
#> SRR1818621 1 0.0000 0.968 1.000 0.000
#> SRR1818622 1 0.0000 0.968 1.000 0.000
#> SRR1818625 1 0.0000 0.968 1.000 0.000
#> SRR1818626 1 0.0000 0.968 1.000 0.000
#> SRR1818623 2 0.0000 0.995 0.000 1.000
#> SRR1818624 2 0.0000 0.995 0.000 1.000
#> SRR1818619 1 0.0000 0.968 1.000 0.000
#> SRR1818620 1 0.0000 0.968 1.000 0.000
#> SRR1818617 2 0.0376 0.992 0.004 0.996
#> SRR1818618 2 0.0376 0.992 0.004 0.996
#> SRR1818615 2 0.0000 0.995 0.000 1.000
#> SRR1818616 2 0.0000 0.995 0.000 1.000
#> SRR1818609 2 0.0000 0.995 0.000 1.000
#> SRR1818610 2 0.0000 0.995 0.000 1.000
#> SRR1818607 2 0.0000 0.995 0.000 1.000
#> SRR1818608 2 0.0000 0.995 0.000 1.000
#> SRR1818613 1 0.0000 0.968 1.000 0.000
#> SRR1818614 1 0.0000 0.968 1.000 0.000
#> SRR1818611 1 0.0000 0.968 1.000 0.000
#> SRR1818612 1 0.0000 0.968 1.000 0.000
#> SRR1818605 1 0.0000 0.968 1.000 0.000
#> SRR1818606 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
#> SRR1818631 3 0.1860 0.7667 0.052 0.000 0.948
#> SRR1818632 3 0.1860 0.7667 0.052 0.000 0.948
#> SRR1818679 3 0.8425 0.3040 0.364 0.096 0.540
#> SRR1818680 1 0.8569 0.1556 0.508 0.100 0.392
#> SRR1818677 1 0.6308 0.1781 0.508 0.492 0.000
#> SRR1818678 2 0.6244 0.0180 0.440 0.560 0.000
#> SRR1818675 3 0.0000 0.7498 0.000 0.000 1.000
#> SRR1818676 3 0.0000 0.7498 0.000 0.000 1.000
#> SRR1818673 2 0.4062 0.7265 0.164 0.836 0.000
#> SRR1818674 2 0.3879 0.7432 0.152 0.848 0.000
#> SRR1818671 2 0.0000 0.9042 0.000 1.000 0.000
#> SRR1818672 2 0.0000 0.9042 0.000 1.000 0.000
#> SRR1818661 3 0.0424 0.7544 0.008 0.000 0.992
#> SRR1818662 3 0.0424 0.7544 0.008 0.000 0.992
#> SRR1818655 1 0.0000 0.8369 1.000 0.000 0.000
#> SRR1818656 1 0.0237 0.8371 0.996 0.000 0.004
#> SRR1818653 3 0.5465 0.6274 0.288 0.000 0.712
#> SRR1818654 3 0.5859 0.5349 0.344 0.000 0.656
#> SRR1818651 1 0.0747 0.8339 0.984 0.000 0.016
#> SRR1818652 1 0.0424 0.8363 0.992 0.000 0.008
#> SRR1818657 1 0.0424 0.8363 0.992 0.000 0.008
#> SRR1818658 1 0.0424 0.8363 0.992 0.000 0.008
#> SRR1818649 1 0.0892 0.8320 0.980 0.020 0.000
#> SRR1818650 1 0.0892 0.8320 0.980 0.020 0.000
#> SRR1818659 1 0.0237 0.8372 0.996 0.000 0.004
#> SRR1818647 2 0.4452 0.7472 0.000 0.808 0.192
#> SRR1818648 2 0.4452 0.7472 0.000 0.808 0.192
#> SRR1818645 2 0.0000 0.9042 0.000 1.000 0.000
#> SRR1818646 2 0.0000 0.9042 0.000 1.000 0.000
#> SRR1818639 1 0.0424 0.8363 0.992 0.000 0.008
#> SRR1818640 1 0.0237 0.8372 0.996 0.000 0.004
#> SRR1818637 2 0.2878 0.8425 0.000 0.904 0.096
#> SRR1818638 2 0.2878 0.8425 0.000 0.904 0.096
#> SRR1818635 1 0.5363 0.6476 0.724 0.276 0.000
#> SRR1818636 1 0.5363 0.6476 0.724 0.276 0.000
#> SRR1818643 1 0.5098 0.6781 0.752 0.248 0.000
#> SRR1818644 1 0.5016 0.6855 0.760 0.240 0.000
#> SRR1818641 1 0.4291 0.7348 0.820 0.180 0.000
#> SRR1818642 1 0.4346 0.7318 0.816 0.184 0.000
#> SRR1818633 3 0.9346 0.4956 0.260 0.224 0.516
#> SRR1818634 3 0.9268 0.5002 0.268 0.208 0.524
#> SRR1818665 1 0.0237 0.8372 0.996 0.000 0.004
#> SRR1818666 1 0.0237 0.8372 0.996 0.000 0.004
#> SRR1818667 2 0.1860 0.8767 0.000 0.948 0.052
#> SRR1818668 2 0.1860 0.8767 0.000 0.948 0.052
#> SRR1818669 1 0.0237 0.8372 0.996 0.000 0.004
#> SRR1818670 1 0.0237 0.8372 0.996 0.000 0.004
#> SRR1818663 1 0.0237 0.8372 0.996 0.000 0.004
#> SRR1818664 1 0.0237 0.8372 0.996 0.000 0.004
#> SRR1818629 2 0.0237 0.9022 0.004 0.996 0.000
#> SRR1818630 2 0.0237 0.9022 0.004 0.996 0.000
#> SRR1818627 1 0.5948 0.4417 0.640 0.000 0.360
#> SRR1818628 1 0.5760 0.5012 0.672 0.000 0.328
#> SRR1818621 3 0.2537 0.7674 0.080 0.000 0.920
#> SRR1818622 3 0.2448 0.7676 0.076 0.000 0.924
#> SRR1818625 1 0.0000 0.8369 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.8369 1.000 0.000 0.000
#> SRR1818623 3 0.6274 0.0519 0.000 0.456 0.544
#> SRR1818624 3 0.6192 0.1619 0.000 0.420 0.580
#> SRR1818619 1 0.2261 0.8083 0.932 0.000 0.068
#> SRR1818620 1 0.2165 0.8092 0.936 0.000 0.064
#> SRR1818617 1 0.6302 0.2202 0.520 0.480 0.000
#> SRR1818618 1 0.6305 0.2090 0.516 0.484 0.000
#> SRR1818615 2 0.0000 0.9042 0.000 1.000 0.000
#> SRR1818616 2 0.0000 0.9042 0.000 1.000 0.000
#> SRR1818609 2 0.0237 0.9030 0.000 0.996 0.004
#> SRR1818610 2 0.0237 0.9030 0.000 0.996 0.004
#> SRR1818607 2 0.0000 0.9042 0.000 1.000 0.000
#> SRR1818608 2 0.0000 0.9042 0.000 1.000 0.000
#> SRR1818613 1 0.4605 0.6593 0.796 0.000 0.204
#> SRR1818614 1 0.4555 0.6663 0.800 0.000 0.200
#> SRR1818611 1 0.0892 0.8320 0.980 0.020 0.000
#> SRR1818612 1 0.1163 0.8284 0.972 0.028 0.000
#> SRR1818605 3 0.4974 0.7006 0.236 0.000 0.764
#> SRR1818606 3 0.5058 0.6945 0.244 0.000 0.756
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.1004 0.7478 0.024 0.000 0.972 0.004
#> SRR1818632 3 0.1004 0.7478 0.024 0.000 0.972 0.004
#> SRR1818679 3 0.3289 0.7122 0.120 0.012 0.864 0.004
#> SRR1818680 3 0.3662 0.6890 0.148 0.012 0.836 0.004
#> SRR1818677 1 0.7176 0.3071 0.516 0.376 0.016 0.092
#> SRR1818678 1 0.6989 0.2129 0.492 0.420 0.016 0.072
#> SRR1818675 3 0.4331 0.6300 0.000 0.000 0.712 0.288
#> SRR1818676 3 0.4356 0.6260 0.000 0.000 0.708 0.292
#> SRR1818673 1 0.5383 0.2472 0.536 0.452 0.000 0.012
#> SRR1818674 1 0.5392 0.2263 0.528 0.460 0.000 0.012
#> SRR1818671 2 0.1059 0.8239 0.000 0.972 0.016 0.012
#> SRR1818672 2 0.1059 0.8239 0.000 0.972 0.016 0.012
#> SRR1818661 3 0.1042 0.7475 0.008 0.000 0.972 0.020
#> SRR1818662 3 0.1042 0.7475 0.008 0.000 0.972 0.020
#> SRR1818655 4 0.4855 0.4647 0.400 0.000 0.000 0.600
#> SRR1818656 4 0.4697 0.5627 0.356 0.000 0.000 0.644
#> SRR1818653 4 0.3984 0.7544 0.132 0.000 0.040 0.828
#> SRR1818654 4 0.3984 0.7544 0.132 0.000 0.040 0.828
#> SRR1818651 1 0.4936 0.2399 0.652 0.000 0.008 0.340
#> SRR1818652 1 0.4401 0.3923 0.724 0.000 0.004 0.272
#> SRR1818657 1 0.1305 0.6501 0.960 0.000 0.004 0.036
#> SRR1818658 1 0.1305 0.6501 0.960 0.000 0.004 0.036
#> SRR1818649 1 0.1739 0.6535 0.952 0.008 0.024 0.016
#> SRR1818650 1 0.1486 0.6545 0.960 0.008 0.024 0.008
#> SRR1818659 4 0.4040 0.7401 0.248 0.000 0.000 0.752
#> SRR1818647 3 0.5473 0.4742 0.000 0.324 0.644 0.032
#> SRR1818648 3 0.5389 0.5055 0.000 0.308 0.660 0.032
#> SRR1818645 2 0.0779 0.8250 0.004 0.980 0.000 0.016
#> SRR1818646 2 0.0779 0.8250 0.004 0.980 0.000 0.016
#> SRR1818639 4 0.3726 0.7575 0.212 0.000 0.000 0.788
#> SRR1818640 4 0.3726 0.7575 0.212 0.000 0.000 0.788
#> SRR1818637 2 0.4050 0.7428 0.000 0.820 0.036 0.144
#> SRR1818638 2 0.4050 0.7428 0.000 0.820 0.036 0.144
#> SRR1818635 1 0.4663 0.5628 0.716 0.272 0.000 0.012
#> SRR1818636 1 0.4606 0.5710 0.724 0.264 0.000 0.012
#> SRR1818643 1 0.6718 0.3109 0.524 0.380 0.000 0.096
#> SRR1818644 1 0.6586 0.3477 0.544 0.368 0.000 0.088
#> SRR1818641 1 0.5592 0.5143 0.656 0.300 0.000 0.044
#> SRR1818642 1 0.5720 0.5160 0.652 0.296 0.000 0.052
#> SRR1818633 3 0.6800 0.5815 0.248 0.092 0.636 0.024
#> SRR1818634 3 0.6629 0.5943 0.240 0.084 0.652 0.024
#> SRR1818665 1 0.0817 0.6490 0.976 0.000 0.000 0.024
#> SRR1818666 1 0.0817 0.6490 0.976 0.000 0.000 0.024
#> SRR1818667 2 0.3501 0.7669 0.000 0.848 0.020 0.132
#> SRR1818668 2 0.3501 0.7669 0.000 0.848 0.020 0.132
#> SRR1818669 1 0.2142 0.6486 0.928 0.000 0.056 0.016
#> SRR1818670 1 0.2142 0.6486 0.928 0.000 0.056 0.016
#> SRR1818663 1 0.1022 0.6419 0.968 0.000 0.000 0.032
#> SRR1818664 1 0.1022 0.6419 0.968 0.000 0.000 0.032
#> SRR1818629 2 0.4737 0.5241 0.252 0.728 0.000 0.020
#> SRR1818630 2 0.4576 0.5613 0.232 0.748 0.000 0.020
#> SRR1818627 1 0.5387 0.3418 0.584 0.000 0.400 0.016
#> SRR1818628 1 0.5436 0.3984 0.620 0.000 0.356 0.024
#> SRR1818621 4 0.4867 0.5766 0.032 0.000 0.232 0.736
#> SRR1818622 4 0.4808 0.5692 0.028 0.000 0.236 0.736
#> SRR1818625 1 0.0469 0.6510 0.988 0.000 0.000 0.012
#> SRR1818626 1 0.0469 0.6510 0.988 0.000 0.000 0.012
#> SRR1818623 3 0.1913 0.7491 0.000 0.020 0.940 0.040
#> SRR1818624 3 0.1820 0.7495 0.000 0.020 0.944 0.036
#> SRR1818619 1 0.6025 0.4417 0.620 0.012 0.332 0.036
#> SRR1818620 1 0.5863 0.4815 0.652 0.012 0.300 0.036
#> SRR1818617 2 0.6327 -0.0665 0.444 0.496 0.000 0.060
#> SRR1818618 2 0.6319 -0.0380 0.436 0.504 0.000 0.060
#> SRR1818615 2 0.0469 0.8235 0.000 0.988 0.000 0.012
#> SRR1818616 2 0.0469 0.8235 0.000 0.988 0.000 0.012
#> SRR1818609 2 0.2142 0.8105 0.000 0.928 0.016 0.056
#> SRR1818610 2 0.2222 0.8090 0.000 0.924 0.016 0.060
#> SRR1818607 2 0.0779 0.8250 0.004 0.980 0.000 0.016
#> SRR1818608 2 0.0779 0.8250 0.004 0.980 0.000 0.016
#> SRR1818613 1 0.6978 0.1916 0.584 0.000 0.208 0.208
#> SRR1818614 1 0.7010 0.1559 0.576 0.000 0.184 0.240
#> SRR1818611 1 0.4348 0.4648 0.780 0.024 0.000 0.196
#> SRR1818612 1 0.4387 0.4582 0.776 0.024 0.000 0.200
#> SRR1818605 3 0.7805 -0.0739 0.300 0.000 0.420 0.280
#> SRR1818606 4 0.7874 0.2127 0.284 0.000 0.336 0.380
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.128 0.7011 0.020 0.000 0.960 0.016 0.004
#> SRR1818632 3 0.128 0.7011 0.020 0.000 0.960 0.016 0.004
#> SRR1818679 3 0.495 0.4321 0.280 0.012 0.672 0.036 0.000
#> SRR1818680 3 0.486 0.4241 0.284 0.008 0.672 0.036 0.000
#> SRR1818677 2 0.408 0.5615 0.044 0.840 0.024 0.052 0.040
#> SRR1818678 2 0.391 0.5599 0.036 0.848 0.024 0.056 0.036
#> SRR1818675 3 0.727 0.5307 0.024 0.016 0.496 0.284 0.180
#> SRR1818676 3 0.719 0.5437 0.024 0.016 0.508 0.284 0.168
#> SRR1818673 1 0.603 0.1046 0.464 0.440 0.000 0.088 0.008
#> SRR1818674 1 0.607 0.0956 0.460 0.440 0.000 0.092 0.008
#> SRR1818671 4 0.453 0.6281 0.000 0.424 0.004 0.568 0.004
#> SRR1818672 4 0.452 0.6327 0.000 0.420 0.004 0.572 0.004
#> SRR1818661 3 0.199 0.7015 0.000 0.004 0.928 0.028 0.040
#> SRR1818662 3 0.182 0.7021 0.000 0.004 0.936 0.024 0.036
#> SRR1818655 5 0.567 0.6393 0.136 0.244 0.000 0.000 0.620
#> SRR1818656 5 0.540 0.6653 0.124 0.220 0.000 0.000 0.656
#> SRR1818653 5 0.185 0.7247 0.036 0.020 0.008 0.000 0.936
#> SRR1818654 5 0.185 0.7247 0.036 0.020 0.008 0.000 0.936
#> SRR1818651 1 0.450 0.4711 0.664 0.024 0.000 0.000 0.312
#> SRR1818652 1 0.443 0.5248 0.700 0.032 0.000 0.000 0.268
#> SRR1818657 1 0.607 0.0367 0.504 0.424 0.020 0.024 0.028
#> SRR1818658 1 0.615 0.0108 0.492 0.432 0.020 0.028 0.028
#> SRR1818649 1 0.274 0.6810 0.900 0.036 0.044 0.004 0.016
#> SRR1818650 1 0.274 0.6810 0.900 0.036 0.044 0.004 0.016
#> SRR1818659 5 0.352 0.6008 0.232 0.000 0.000 0.004 0.764
#> SRR1818647 3 0.562 0.4809 0.000 0.072 0.592 0.328 0.008
#> SRR1818648 3 0.564 0.4839 0.000 0.076 0.596 0.320 0.008
#> SRR1818645 2 0.263 0.4874 0.000 0.860 0.004 0.136 0.000
#> SRR1818646 2 0.258 0.4918 0.000 0.864 0.004 0.132 0.000
#> SRR1818639 5 0.558 0.5370 0.080 0.368 0.000 0.000 0.552
#> SRR1818640 5 0.547 0.5479 0.072 0.364 0.000 0.000 0.564
#> SRR1818637 4 0.223 0.6735 0.000 0.092 0.004 0.900 0.004
#> SRR1818638 4 0.223 0.6735 0.000 0.092 0.004 0.900 0.004
#> SRR1818635 1 0.539 0.3307 0.580 0.364 0.000 0.048 0.008
#> SRR1818636 1 0.539 0.3307 0.580 0.364 0.000 0.048 0.008
#> SRR1818643 1 0.636 0.0741 0.448 0.440 0.000 0.088 0.024
#> SRR1818644 1 0.628 0.0785 0.452 0.444 0.000 0.080 0.024
#> SRR1818641 2 0.591 0.2610 0.296 0.588 0.000 0.108 0.008
#> SRR1818642 2 0.583 0.2760 0.288 0.600 0.000 0.104 0.008
#> SRR1818633 3 0.637 0.6181 0.104 0.132 0.668 0.088 0.008
#> SRR1818634 3 0.627 0.6213 0.108 0.128 0.676 0.080 0.008
#> SRR1818665 1 0.156 0.6805 0.948 0.020 0.000 0.004 0.028
#> SRR1818666 1 0.156 0.6805 0.948 0.020 0.000 0.004 0.028
#> SRR1818667 4 0.340 0.7323 0.000 0.236 0.000 0.764 0.000
#> SRR1818668 4 0.327 0.7337 0.000 0.220 0.000 0.780 0.000
#> SRR1818669 1 0.424 0.6602 0.816 0.032 0.108 0.016 0.028
#> SRR1818670 1 0.424 0.6598 0.816 0.036 0.108 0.016 0.024
#> SRR1818663 1 0.133 0.6797 0.956 0.008 0.000 0.004 0.032
#> SRR1818664 1 0.141 0.6795 0.952 0.008 0.000 0.004 0.036
#> SRR1818629 2 0.475 0.3345 0.044 0.692 0.000 0.260 0.004
#> SRR1818630 2 0.461 0.3049 0.036 0.700 0.000 0.260 0.004
#> SRR1818627 1 0.501 0.5916 0.736 0.016 0.192 0.036 0.020
#> SRR1818628 1 0.520 0.5984 0.736 0.016 0.176 0.040 0.032
#> SRR1818621 5 0.232 0.6875 0.024 0.000 0.044 0.016 0.916
#> SRR1818622 5 0.230 0.6831 0.020 0.000 0.048 0.016 0.916
#> SRR1818625 1 0.163 0.6823 0.944 0.036 0.000 0.004 0.016
#> SRR1818626 1 0.155 0.6820 0.948 0.032 0.000 0.004 0.016
#> SRR1818623 3 0.391 0.6652 0.000 0.016 0.744 0.240 0.000
#> SRR1818624 3 0.388 0.6690 0.000 0.016 0.748 0.236 0.000
#> SRR1818619 2 0.799 0.0991 0.328 0.372 0.240 0.032 0.028
#> SRR1818620 2 0.806 0.0944 0.332 0.376 0.224 0.040 0.028
#> SRR1818617 2 0.373 0.5633 0.100 0.836 0.000 0.028 0.036
#> SRR1818618 2 0.381 0.5631 0.100 0.832 0.000 0.032 0.036
#> SRR1818615 4 0.465 0.5927 0.004 0.428 0.000 0.560 0.008
#> SRR1818616 4 0.465 0.5927 0.004 0.428 0.000 0.560 0.008
#> SRR1818609 4 0.349 0.7343 0.000 0.208 0.004 0.784 0.004
#> SRR1818610 4 0.346 0.7343 0.000 0.204 0.004 0.788 0.004
#> SRR1818607 2 0.258 0.4919 0.000 0.864 0.004 0.132 0.000
#> SRR1818608 2 0.254 0.4962 0.000 0.868 0.004 0.128 0.000
#> SRR1818613 1 0.476 0.6001 0.744 0.000 0.088 0.008 0.160
#> SRR1818614 1 0.471 0.5979 0.744 0.000 0.076 0.008 0.172
#> SRR1818611 1 0.387 0.6277 0.804 0.048 0.000 0.004 0.144
#> SRR1818612 1 0.395 0.6290 0.804 0.048 0.000 0.008 0.140
#> SRR1818605 1 0.605 0.4664 0.640 0.004 0.212 0.020 0.124
#> SRR1818606 1 0.599 0.4797 0.648 0.004 0.204 0.020 0.124
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.4332 0.5579 0.060 0.124 0.768 0.000 0.000 0.048
#> SRR1818632 3 0.4388 0.5569 0.064 0.124 0.764 0.000 0.000 0.048
#> SRR1818679 3 0.7331 0.1791 0.312 0.212 0.392 0.020 0.000 0.064
#> SRR1818680 3 0.7390 0.1345 0.336 0.204 0.372 0.024 0.000 0.064
#> SRR1818677 6 0.4072 0.4417 0.008 0.148 0.008 0.052 0.004 0.780
#> SRR1818678 6 0.3895 0.4465 0.008 0.144 0.008 0.052 0.000 0.788
#> SRR1818675 4 0.7440 0.0757 0.020 0.088 0.172 0.468 0.244 0.008
#> SRR1818676 4 0.7474 0.0734 0.024 0.088 0.180 0.476 0.224 0.008
#> SRR1818673 2 0.5167 0.4427 0.300 0.600 0.000 0.092 0.000 0.008
#> SRR1818674 2 0.5151 0.4481 0.296 0.604 0.000 0.092 0.000 0.008
#> SRR1818671 4 0.5015 0.3195 0.000 0.352 0.004 0.572 0.000 0.072
#> SRR1818672 4 0.5071 0.3130 0.000 0.356 0.004 0.564 0.000 0.076
#> SRR1818661 3 0.1881 0.5756 0.000 0.008 0.928 0.012 0.044 0.008
#> SRR1818662 3 0.1768 0.5761 0.000 0.008 0.932 0.012 0.044 0.004
#> SRR1818655 6 0.4879 0.3023 0.064 0.000 0.000 0.000 0.392 0.544
#> SRR1818656 6 0.4882 0.2388 0.060 0.000 0.000 0.000 0.428 0.512
#> SRR1818653 5 0.1932 0.7156 0.004 0.004 0.004 0.000 0.912 0.076
#> SRR1818654 5 0.1876 0.7186 0.004 0.004 0.004 0.000 0.916 0.072
#> SRR1818651 5 0.6006 0.0742 0.396 0.020 0.000 0.000 0.448 0.136
#> SRR1818652 1 0.6130 -0.1170 0.424 0.020 0.000 0.000 0.400 0.156
#> SRR1818657 6 0.5587 0.4175 0.240 0.160 0.000 0.000 0.012 0.588
#> SRR1818658 6 0.5466 0.4225 0.240 0.156 0.000 0.000 0.008 0.596
#> SRR1818649 1 0.3985 0.6277 0.800 0.064 0.012 0.000 0.016 0.108
#> SRR1818650 1 0.4076 0.6269 0.796 0.064 0.016 0.000 0.016 0.108
#> SRR1818659 5 0.3608 0.5804 0.248 0.004 0.000 0.000 0.736 0.012
#> SRR1818647 3 0.5825 0.3237 0.000 0.120 0.580 0.272 0.012 0.016
#> SRR1818648 3 0.5910 0.3058 0.000 0.128 0.568 0.276 0.012 0.016
#> SRR1818645 2 0.5533 0.4029 0.000 0.448 0.000 0.132 0.000 0.420
#> SRR1818646 2 0.5450 0.3946 0.000 0.452 0.000 0.120 0.000 0.428
#> SRR1818639 6 0.4187 0.4025 0.016 0.004 0.000 0.000 0.356 0.624
#> SRR1818640 6 0.4254 0.4045 0.020 0.004 0.000 0.000 0.352 0.624
#> SRR1818637 4 0.0405 0.6066 0.000 0.004 0.000 0.988 0.008 0.000
#> SRR1818638 4 0.0508 0.6049 0.000 0.004 0.000 0.984 0.012 0.000
#> SRR1818635 1 0.4649 -0.0511 0.504 0.464 0.000 0.020 0.000 0.012
#> SRR1818636 1 0.4649 -0.0505 0.504 0.464 0.000 0.020 0.000 0.012
#> SRR1818643 2 0.6026 0.2764 0.400 0.472 0.000 0.084 0.004 0.040
#> SRR1818644 2 0.5954 0.2634 0.408 0.472 0.000 0.076 0.004 0.040
#> SRR1818641 2 0.6292 0.5178 0.152 0.572 0.000 0.080 0.000 0.196
#> SRR1818642 2 0.6292 0.5169 0.152 0.572 0.000 0.080 0.000 0.196
#> SRR1818633 3 0.6731 0.4013 0.048 0.220 0.540 0.012 0.008 0.172
#> SRR1818634 3 0.6629 0.4266 0.044 0.216 0.560 0.016 0.008 0.156
#> SRR1818665 1 0.4819 0.5568 0.704 0.104 0.004 0.000 0.012 0.176
#> SRR1818666 1 0.4819 0.5582 0.704 0.104 0.004 0.000 0.012 0.176
#> SRR1818667 4 0.2615 0.5860 0.000 0.136 0.000 0.852 0.004 0.008
#> SRR1818668 4 0.2462 0.5897 0.000 0.132 0.000 0.860 0.004 0.004
#> SRR1818669 1 0.6391 0.4361 0.588 0.160 0.120 0.000 0.004 0.128
#> SRR1818670 1 0.6384 0.4392 0.588 0.164 0.116 0.000 0.004 0.128
#> SRR1818663 1 0.2125 0.6411 0.908 0.004 0.004 0.000 0.016 0.068
#> SRR1818664 1 0.2011 0.6399 0.912 0.004 0.000 0.000 0.020 0.064
#> SRR1818629 2 0.6156 0.1890 0.040 0.532 0.004 0.120 0.000 0.304
#> SRR1818630 2 0.6240 0.1816 0.040 0.524 0.004 0.132 0.000 0.300
#> SRR1818627 1 0.7062 0.4755 0.584 0.180 0.052 0.040 0.036 0.108
#> SRR1818628 1 0.7214 0.4535 0.568 0.188 0.040 0.044 0.048 0.112
#> SRR1818621 5 0.1364 0.7391 0.016 0.000 0.020 0.012 0.952 0.000
#> SRR1818622 5 0.1448 0.7378 0.016 0.000 0.024 0.012 0.948 0.000
#> SRR1818625 1 0.2255 0.6427 0.892 0.016 0.000 0.000 0.004 0.088
#> SRR1818626 1 0.2306 0.6423 0.888 0.016 0.000 0.000 0.004 0.092
#> SRR1818623 3 0.4745 0.4154 0.000 0.032 0.636 0.308 0.000 0.024
#> SRR1818624 3 0.4784 0.4453 0.000 0.040 0.660 0.272 0.000 0.028
#> SRR1818619 6 0.6211 0.4209 0.160 0.188 0.072 0.000 0.000 0.580
#> SRR1818620 6 0.6216 0.4193 0.168 0.180 0.072 0.000 0.000 0.580
#> SRR1818617 6 0.4119 0.5120 0.028 0.092 0.004 0.048 0.020 0.808
#> SRR1818618 6 0.4132 0.5098 0.028 0.088 0.004 0.052 0.020 0.808
#> SRR1818615 2 0.4051 0.0618 0.000 0.560 0.000 0.432 0.000 0.008
#> SRR1818616 2 0.4051 0.0692 0.000 0.560 0.000 0.432 0.000 0.008
#> SRR1818609 4 0.4016 0.4870 0.000 0.292 0.004 0.684 0.000 0.020
#> SRR1818610 4 0.3977 0.4963 0.000 0.284 0.004 0.692 0.000 0.020
#> SRR1818607 2 0.5419 0.4016 0.000 0.460 0.000 0.116 0.000 0.424
#> SRR1818608 2 0.5328 0.3799 0.000 0.456 0.000 0.104 0.000 0.440
#> SRR1818613 1 0.6902 0.4723 0.568 0.040 0.124 0.000 0.172 0.096
#> SRR1818614 1 0.6961 0.4393 0.552 0.044 0.100 0.000 0.208 0.096
#> SRR1818611 1 0.5968 0.4982 0.612 0.068 0.000 0.000 0.168 0.152
#> SRR1818612 1 0.5916 0.5020 0.620 0.072 0.000 0.000 0.172 0.136
#> SRR1818605 1 0.5671 0.4939 0.676 0.060 0.112 0.000 0.136 0.016
#> SRR1818606 1 0.5735 0.4860 0.668 0.060 0.108 0.000 0.148 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["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 15216 rows and 75 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 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.412 0.835 0.874 0.4693 0.494 0.494
#> 3 3 0.771 0.822 0.907 0.2676 0.935 0.869
#> 4 4 0.848 0.823 0.910 0.1300 0.937 0.852
#> 5 5 0.961 0.898 0.950 0.1096 0.874 0.655
#> 6 6 0.926 0.884 0.925 0.0253 0.997 0.988
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
#> SRR1818631 2 0.000 0.913 0.000 1.000
#> SRR1818632 2 0.000 0.913 0.000 1.000
#> SRR1818679 1 0.969 0.532 0.604 0.396
#> SRR1818680 1 0.969 0.532 0.604 0.396
#> SRR1818677 2 0.482 0.951 0.104 0.896
#> SRR1818678 2 0.482 0.951 0.104 0.896
#> SRR1818675 1 0.971 0.529 0.600 0.400
#> SRR1818676 1 0.971 0.529 0.600 0.400
#> SRR1818673 2 0.482 0.951 0.104 0.896
#> SRR1818674 2 0.482 0.951 0.104 0.896
#> SRR1818671 2 0.482 0.951 0.104 0.896
#> SRR1818672 2 0.482 0.951 0.104 0.896
#> SRR1818661 2 0.000 0.913 0.000 1.000
#> SRR1818662 2 0.000 0.913 0.000 1.000
#> SRR1818655 1 0.000 0.842 1.000 0.000
#> SRR1818656 1 0.000 0.842 1.000 0.000
#> SRR1818653 1 0.925 0.613 0.660 0.340
#> SRR1818654 1 0.925 0.613 0.660 0.340
#> SRR1818651 1 0.000 0.842 1.000 0.000
#> SRR1818652 1 0.000 0.842 1.000 0.000
#> SRR1818657 1 0.000 0.842 1.000 0.000
#> SRR1818658 1 0.000 0.842 1.000 0.000
#> SRR1818649 1 0.000 0.842 1.000 0.000
#> SRR1818650 1 0.000 0.842 1.000 0.000
#> SRR1818659 1 0.000 0.842 1.000 0.000
#> SRR1818647 2 0.000 0.913 0.000 1.000
#> SRR1818648 2 0.000 0.913 0.000 1.000
#> SRR1818645 2 0.482 0.951 0.104 0.896
#> SRR1818646 2 0.482 0.951 0.104 0.896
#> SRR1818639 1 0.000 0.842 1.000 0.000
#> SRR1818640 1 0.000 0.842 1.000 0.000
#> SRR1818637 2 0.000 0.913 0.000 1.000
#> SRR1818638 2 0.000 0.913 0.000 1.000
#> SRR1818635 2 0.482 0.951 0.104 0.896
#> SRR1818636 2 0.482 0.951 0.104 0.896
#> SRR1818643 2 0.482 0.951 0.104 0.896
#> SRR1818644 2 0.482 0.951 0.104 0.896
#> SRR1818641 2 0.482 0.951 0.104 0.896
#> SRR1818642 2 0.482 0.951 0.104 0.896
#> SRR1818633 1 0.969 0.532 0.604 0.396
#> SRR1818634 1 0.969 0.532 0.604 0.396
#> SRR1818665 1 0.000 0.842 1.000 0.000
#> SRR1818666 1 0.000 0.842 1.000 0.000
#> SRR1818667 2 0.482 0.951 0.104 0.896
#> SRR1818668 2 0.482 0.951 0.104 0.896
#> SRR1818669 1 0.000 0.842 1.000 0.000
#> SRR1818670 1 0.000 0.842 1.000 0.000
#> SRR1818663 1 0.000 0.842 1.000 0.000
#> SRR1818664 1 0.000 0.842 1.000 0.000
#> SRR1818629 2 0.482 0.951 0.104 0.896
#> SRR1818630 2 0.482 0.951 0.104 0.896
#> SRR1818627 1 0.000 0.842 1.000 0.000
#> SRR1818628 1 0.000 0.842 1.000 0.000
#> SRR1818621 2 0.373 0.938 0.072 0.928
#> SRR1818622 2 0.373 0.938 0.072 0.928
#> SRR1818625 1 0.000 0.842 1.000 0.000
#> SRR1818626 1 0.000 0.842 1.000 0.000
#> SRR1818623 2 0.000 0.913 0.000 1.000
#> SRR1818624 2 0.000 0.913 0.000 1.000
#> SRR1818619 1 0.946 0.546 0.636 0.364
#> SRR1818620 1 0.946 0.546 0.636 0.364
#> SRR1818617 1 0.946 0.546 0.636 0.364
#> SRR1818618 1 0.946 0.546 0.636 0.364
#> SRR1818615 2 0.482 0.951 0.104 0.896
#> SRR1818616 2 0.482 0.951 0.104 0.896
#> SRR1818609 2 0.000 0.913 0.000 1.000
#> SRR1818610 2 0.000 0.913 0.000 1.000
#> SRR1818607 2 0.482 0.951 0.104 0.896
#> SRR1818608 2 0.482 0.951 0.104 0.896
#> SRR1818613 1 0.000 0.842 1.000 0.000
#> SRR1818614 1 0.000 0.842 1.000 0.000
#> SRR1818611 1 0.000 0.842 1.000 0.000
#> SRR1818612 1 0.000 0.842 1.000 0.000
#> SRR1818605 1 0.925 0.613 0.660 0.340
#> SRR1818606 1 0.925 0.613 0.660 0.340
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.000 0.962 0.000 0.000 1.000
#> SRR1818632 3 0.000 0.962 0.000 0.000 1.000
#> SRR1818679 1 0.788 0.489 0.592 0.072 0.336
#> SRR1818680 1 0.788 0.489 0.592 0.072 0.336
#> SRR1818677 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818678 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818675 1 0.613 0.462 0.600 0.000 0.400
#> SRR1818676 1 0.613 0.462 0.600 0.000 0.400
#> SRR1818673 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818674 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818671 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818672 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818661 3 0.000 0.962 0.000 0.000 1.000
#> SRR1818662 3 0.000 0.962 0.000 0.000 1.000
#> SRR1818655 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818656 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818653 1 0.583 0.551 0.660 0.000 0.340
#> SRR1818654 1 0.583 0.551 0.660 0.000 0.340
#> SRR1818651 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818652 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818657 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818658 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818649 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818650 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818659 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818647 2 0.236 0.914 0.000 0.928 0.072
#> SRR1818648 2 0.236 0.914 0.000 0.928 0.072
#> SRR1818645 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818646 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818639 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818640 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818637 2 0.236 0.914 0.000 0.928 0.072
#> SRR1818638 2 0.236 0.914 0.000 0.928 0.072
#> SRR1818635 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818636 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818643 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818644 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818641 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818642 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818633 1 0.888 0.485 0.576 0.216 0.208
#> SRR1818634 1 0.888 0.485 0.576 0.216 0.208
#> SRR1818665 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818666 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818667 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818668 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818669 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818670 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818663 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818664 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818629 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818630 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818627 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818628 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818621 3 0.236 0.919 0.072 0.000 0.928
#> SRR1818622 3 0.236 0.919 0.072 0.000 0.928
#> SRR1818625 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818626 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818623 2 0.236 0.914 0.000 0.928 0.072
#> SRR1818624 2 0.236 0.914 0.000 0.928 0.072
#> SRR1818619 1 0.618 0.394 0.584 0.416 0.000
#> SRR1818620 1 0.618 0.394 0.584 0.416 0.000
#> SRR1818617 1 0.623 0.350 0.564 0.436 0.000
#> SRR1818618 1 0.623 0.350 0.564 0.436 0.000
#> SRR1818615 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818616 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818609 2 0.236 0.914 0.000 0.928 0.072
#> SRR1818610 2 0.236 0.914 0.000 0.928 0.072
#> SRR1818607 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818608 2 0.129 0.970 0.032 0.968 0.000
#> SRR1818613 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818614 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818611 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818612 1 0.000 0.830 1.000 0.000 0.000
#> SRR1818605 1 0.583 0.551 0.660 0.000 0.340
#> SRR1818606 1 0.583 0.551 0.660 0.000 0.340
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.1867 0.962 0.000 0.000 0.928 0.072
#> SRR1818632 3 0.1867 0.962 0.000 0.000 0.928 0.072
#> SRR1818679 1 0.6435 0.427 0.532 0.072 0.396 0.000
#> SRR1818680 1 0.6435 0.427 0.532 0.072 0.396 0.000
#> SRR1818677 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818678 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818675 1 0.5151 0.390 0.532 0.000 0.464 0.004
#> SRR1818676 1 0.5151 0.390 0.532 0.000 0.464 0.004
#> SRR1818673 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818674 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818671 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818672 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818661 3 0.1867 0.962 0.000 0.000 0.928 0.072
#> SRR1818662 3 0.1867 0.962 0.000 0.000 0.928 0.072
#> SRR1818655 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818656 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818653 1 0.4888 0.482 0.588 0.000 0.412 0.000
#> SRR1818654 1 0.4888 0.482 0.588 0.000 0.412 0.000
#> SRR1818651 1 0.0707 0.807 0.980 0.000 0.020 0.000
#> SRR1818652 1 0.0707 0.807 0.980 0.000 0.020 0.000
#> SRR1818657 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818658 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818649 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818650 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818659 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818647 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1818648 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1818645 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818646 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818639 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818640 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818637 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1818638 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1818635 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818636 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818643 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818644 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818641 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818642 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818633 1 0.7315 0.450 0.532 0.216 0.252 0.000
#> SRR1818634 1 0.7315 0.450 0.532 0.216 0.252 0.000
#> SRR1818665 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818666 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818667 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818668 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818669 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818670 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818663 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818629 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818630 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818627 1 0.0707 0.807 0.980 0.000 0.020 0.000
#> SRR1818628 1 0.0707 0.807 0.980 0.000 0.020 0.000
#> SRR1818621 3 0.0000 0.928 0.000 0.000 1.000 0.000
#> SRR1818622 3 0.0000 0.928 0.000 0.000 1.000 0.000
#> SRR1818625 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818626 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818623 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1818624 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1818619 1 0.5581 0.342 0.532 0.448 0.020 0.000
#> SRR1818620 1 0.5581 0.342 0.532 0.448 0.020 0.000
#> SRR1818617 1 0.4985 0.313 0.532 0.468 0.000 0.000
#> SRR1818618 1 0.4985 0.313 0.532 0.468 0.000 0.000
#> SRR1818615 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818616 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818609 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1818610 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1818607 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818608 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1818613 1 0.0707 0.807 0.980 0.000 0.020 0.000
#> SRR1818614 1 0.0707 0.807 0.980 0.000 0.020 0.000
#> SRR1818611 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818612 1 0.0000 0.811 1.000 0.000 0.000 0.000
#> SRR1818605 1 0.4888 0.482 0.588 0.000 0.412 0.000
#> SRR1818606 1 0.4888 0.482 0.588 0.000 0.412 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.0000 0.812 0.000 0.000 1.000 0 0.000
#> SRR1818632 3 0.0000 0.812 0.000 0.000 1.000 0 0.000
#> SRR1818679 5 0.1608 0.678 0.000 0.072 0.000 0 0.928
#> SRR1818680 5 0.1608 0.678 0.000 0.072 0.000 0 0.928
#> SRR1818677 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818678 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818675 5 0.0794 0.634 0.000 0.000 0.028 0 0.972
#> SRR1818676 5 0.0794 0.634 0.000 0.000 0.028 0 0.972
#> SRR1818673 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818674 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818671 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818672 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818661 3 0.0000 0.812 0.000 0.000 1.000 0 0.000
#> SRR1818662 3 0.0000 0.812 0.000 0.000 1.000 0 0.000
#> SRR1818655 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818656 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818653 5 0.1341 0.648 0.056 0.000 0.000 0 0.944
#> SRR1818654 5 0.1341 0.648 0.056 0.000 0.000 0 0.944
#> SRR1818651 1 0.0609 0.982 0.980 0.000 0.000 0 0.020
#> SRR1818652 1 0.0609 0.982 0.980 0.000 0.000 0 0.020
#> SRR1818657 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818658 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818649 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818650 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818659 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818647 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR1818648 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR1818645 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818646 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818639 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818640 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818637 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR1818638 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR1818635 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818636 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818643 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818644 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818641 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818642 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818633 5 0.3242 0.658 0.000 0.216 0.000 0 0.784
#> SRR1818634 5 0.3242 0.658 0.000 0.216 0.000 0 0.784
#> SRR1818665 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818666 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818667 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818668 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818669 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818670 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818663 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818664 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818629 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818630 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818627 1 0.0609 0.982 0.980 0.000 0.000 0 0.020
#> SRR1818628 1 0.0609 0.982 0.980 0.000 0.000 0 0.020
#> SRR1818621 3 0.4294 0.523 0.000 0.000 0.532 0 0.468
#> SRR1818622 3 0.4294 0.523 0.000 0.000 0.532 0 0.468
#> SRR1818625 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818626 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818623 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR1818624 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR1818619 5 0.4273 0.457 0.000 0.448 0.000 0 0.552
#> SRR1818620 5 0.4273 0.457 0.000 0.448 0.000 0 0.552
#> SRR1818617 5 0.4294 0.414 0.000 0.468 0.000 0 0.532
#> SRR1818618 5 0.4294 0.414 0.000 0.468 0.000 0 0.532
#> SRR1818615 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818616 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818609 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR1818610 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR1818607 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818608 2 0.0000 1.000 0.000 1.000 0.000 0 0.000
#> SRR1818613 1 0.0609 0.982 0.980 0.000 0.000 0 0.020
#> SRR1818614 1 0.0609 0.982 0.980 0.000 0.000 0 0.020
#> SRR1818611 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818612 1 0.0000 0.994 1.000 0.000 0.000 0 0.000
#> SRR1818605 5 0.1341 0.648 0.056 0.000 0.000 0 0.944
#> SRR1818606 5 0.1341 0.648 0.056 0.000 0.000 0 0.944
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.0000 1.000 0.000 0.000 1.000 0 0.000 0.000
#> SRR1818632 3 0.0000 1.000 0.000 0.000 1.000 0 0.000 0.000
#> SRR1818679 6 0.1444 0.685 0.000 0.072 0.000 0 0.000 0.928
#> SRR1818680 6 0.1444 0.685 0.000 0.072 0.000 0 0.000 0.928
#> SRR1818677 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818678 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818675 6 0.0713 0.646 0.000 0.000 0.028 0 0.000 0.972
#> SRR1818676 6 0.0713 0.646 0.000 0.000 0.028 0 0.000 0.972
#> SRR1818673 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818674 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818671 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818672 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818661 3 0.0000 1.000 0.000 0.000 1.000 0 0.000 0.000
#> SRR1818662 3 0.0000 1.000 0.000 0.000 1.000 0 0.000 0.000
#> SRR1818655 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818656 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818653 6 0.1204 0.658 0.056 0.000 0.000 0 0.000 0.944
#> SRR1818654 6 0.1204 0.658 0.056 0.000 0.000 0 0.000 0.944
#> SRR1818651 1 0.0547 0.982 0.980 0.000 0.000 0 0.000 0.020
#> SRR1818652 1 0.0547 0.982 0.980 0.000 0.000 0 0.000 0.020
#> SRR1818657 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818658 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818649 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818650 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818659 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818647 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR1818648 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR1818645 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818646 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818639 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818640 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818637 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR1818638 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR1818635 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818636 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818643 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818644 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818641 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818642 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818633 6 0.3023 0.663 0.000 0.212 0.000 0 0.004 0.784
#> SRR1818634 6 0.3023 0.663 0.000 0.212 0.000 0 0.004 0.784
#> SRR1818665 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818666 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818667 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818668 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818669 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818670 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818663 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818664 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818629 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818630 2 0.0000 0.869 0.000 1.000 0.000 0 0.000 0.000
#> SRR1818627 1 0.0547 0.982 0.980 0.000 0.000 0 0.000 0.020
#> SRR1818628 1 0.0547 0.982 0.980 0.000 0.000 0 0.000 0.020
#> SRR1818621 5 0.3050 1.000 0.000 0.000 0.000 0 0.764 0.236
#> SRR1818622 5 0.3050 1.000 0.000 0.000 0.000 0 0.764 0.236
#> SRR1818625 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818626 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818623 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR1818624 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR1818619 6 0.3966 0.531 0.000 0.444 0.000 0 0.004 0.552
#> SRR1818620 6 0.3966 0.531 0.000 0.444 0.000 0 0.004 0.552
#> SRR1818617 6 0.3986 0.512 0.000 0.464 0.000 0 0.004 0.532
#> SRR1818618 6 0.3986 0.512 0.000 0.464 0.000 0 0.004 0.532
#> SRR1818615 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818616 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818609 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR1818610 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR1818607 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818608 2 0.3023 0.842 0.000 0.768 0.000 0 0.232 0.000
#> SRR1818613 1 0.0547 0.982 0.980 0.000 0.000 0 0.000 0.020
#> SRR1818614 1 0.0547 0.982 0.980 0.000 0.000 0 0.000 0.020
#> SRR1818611 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818612 1 0.0000 0.994 1.000 0.000 0.000 0 0.000 0.000
#> SRR1818605 6 0.1204 0.658 0.056 0.000 0.000 0 0.000 0.944
#> SRR1818606 6 0.1204 0.658 0.056 0.000 0.000 0 0.000 0.944
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 15216 rows and 75 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 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.550 0.890 0.939 0.4574 0.559 0.559
#> 3 3 0.607 0.723 0.839 0.3590 0.615 0.398
#> 4 4 0.693 0.695 0.838 0.1488 0.944 0.835
#> 5 5 0.741 0.566 0.728 0.0715 0.944 0.832
#> 6 6 0.710 0.593 0.751 0.0480 0.888 0.663
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
#> SRR1818631 2 0.6623 0.829 0.172 0.828
#> SRR1818632 2 0.6623 0.829 0.172 0.828
#> SRR1818679 1 0.7139 0.744 0.804 0.196
#> SRR1818680 1 0.7139 0.744 0.804 0.196
#> SRR1818677 1 0.6623 0.832 0.828 0.172
#> SRR1818678 1 0.6623 0.832 0.828 0.172
#> SRR1818675 2 0.6623 0.829 0.172 0.828
#> SRR1818676 2 0.6623 0.829 0.172 0.828
#> SRR1818673 1 0.6623 0.832 0.828 0.172
#> SRR1818674 1 0.6623 0.832 0.828 0.172
#> SRR1818671 2 0.1633 0.934 0.024 0.976
#> SRR1818672 2 0.1633 0.934 0.024 0.976
#> SRR1818661 2 0.6623 0.829 0.172 0.828
#> SRR1818662 2 0.6623 0.829 0.172 0.828
#> SRR1818655 1 0.0000 0.923 1.000 0.000
#> SRR1818656 1 0.0000 0.923 1.000 0.000
#> SRR1818653 1 0.0376 0.921 0.996 0.004
#> SRR1818654 1 0.0376 0.921 0.996 0.004
#> SRR1818651 1 0.0000 0.923 1.000 0.000
#> SRR1818652 1 0.0000 0.923 1.000 0.000
#> SRR1818657 1 0.0000 0.923 1.000 0.000
#> SRR1818658 1 0.0000 0.923 1.000 0.000
#> SRR1818649 1 0.0000 0.923 1.000 0.000
#> SRR1818650 1 0.0000 0.923 1.000 0.000
#> SRR1818659 1 0.0000 0.923 1.000 0.000
#> SRR1818647 2 0.0000 0.941 0.000 1.000
#> SRR1818648 2 0.0000 0.941 0.000 1.000
#> SRR1818645 2 0.1633 0.934 0.024 0.976
#> SRR1818646 2 0.1633 0.934 0.024 0.976
#> SRR1818639 1 0.0000 0.923 1.000 0.000
#> SRR1818640 1 0.0000 0.923 1.000 0.000
#> SRR1818637 2 0.0000 0.941 0.000 1.000
#> SRR1818638 2 0.0000 0.941 0.000 1.000
#> SRR1818635 1 0.6048 0.850 0.852 0.148
#> SRR1818636 1 0.6048 0.850 0.852 0.148
#> SRR1818643 1 0.6343 0.842 0.840 0.160
#> SRR1818644 1 0.6343 0.842 0.840 0.160
#> SRR1818641 1 0.6048 0.850 0.852 0.148
#> SRR1818642 1 0.6048 0.850 0.852 0.148
#> SRR1818633 1 0.6973 0.756 0.812 0.188
#> SRR1818634 1 0.6973 0.756 0.812 0.188
#> SRR1818665 1 0.0000 0.923 1.000 0.000
#> SRR1818666 1 0.0000 0.923 1.000 0.000
#> SRR1818667 2 0.0000 0.941 0.000 1.000
#> SRR1818668 2 0.0000 0.941 0.000 1.000
#> SRR1818669 1 0.0000 0.923 1.000 0.000
#> SRR1818670 1 0.0000 0.923 1.000 0.000
#> SRR1818663 1 0.0000 0.923 1.000 0.000
#> SRR1818664 1 0.0000 0.923 1.000 0.000
#> SRR1818629 1 0.6623 0.832 0.828 0.172
#> SRR1818630 1 0.6623 0.832 0.828 0.172
#> SRR1818627 1 0.0000 0.923 1.000 0.000
#> SRR1818628 1 0.0000 0.923 1.000 0.000
#> SRR1818621 1 0.6531 0.785 0.832 0.168
#> SRR1818622 1 0.6531 0.785 0.832 0.168
#> SRR1818625 1 0.0000 0.923 1.000 0.000
#> SRR1818626 1 0.0000 0.923 1.000 0.000
#> SRR1818623 2 0.0000 0.941 0.000 1.000
#> SRR1818624 2 0.0000 0.941 0.000 1.000
#> SRR1818619 1 0.0000 0.923 1.000 0.000
#> SRR1818620 1 0.0000 0.923 1.000 0.000
#> SRR1818617 1 0.6438 0.838 0.836 0.164
#> SRR1818618 1 0.6438 0.838 0.836 0.164
#> SRR1818615 2 0.0000 0.941 0.000 1.000
#> SRR1818616 2 0.0000 0.941 0.000 1.000
#> SRR1818609 2 0.0000 0.941 0.000 1.000
#> SRR1818610 2 0.0000 0.941 0.000 1.000
#> SRR1818607 2 0.1633 0.934 0.024 0.976
#> SRR1818608 2 0.1633 0.934 0.024 0.976
#> SRR1818613 1 0.0000 0.923 1.000 0.000
#> SRR1818614 1 0.0000 0.923 1.000 0.000
#> SRR1818611 1 0.0000 0.923 1.000 0.000
#> SRR1818612 1 0.0000 0.923 1.000 0.000
#> SRR1818605 1 0.0376 0.921 0.996 0.004
#> SRR1818606 1 0.0376 0.921 0.996 0.004
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.0237 0.657 0.000 0.004 0.996
#> SRR1818632 3 0.0237 0.657 0.000 0.004 0.996
#> SRR1818679 3 0.9550 0.251 0.352 0.200 0.448
#> SRR1818680 3 0.9550 0.251 0.352 0.200 0.448
#> SRR1818677 2 0.6008 0.748 0.332 0.664 0.004
#> SRR1818678 2 0.6008 0.748 0.332 0.664 0.004
#> SRR1818675 3 0.0237 0.657 0.000 0.004 0.996
#> SRR1818676 3 0.0237 0.657 0.000 0.004 0.996
#> SRR1818673 2 0.5706 0.748 0.320 0.680 0.000
#> SRR1818674 2 0.5706 0.748 0.320 0.680 0.000
#> SRR1818671 2 0.0000 0.621 0.000 1.000 0.000
#> SRR1818672 2 0.0000 0.621 0.000 1.000 0.000
#> SRR1818661 3 0.0237 0.657 0.000 0.004 0.996
#> SRR1818662 3 0.0237 0.657 0.000 0.004 0.996
#> SRR1818655 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818656 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818653 1 0.5016 0.640 0.760 0.000 0.240
#> SRR1818654 1 0.5016 0.640 0.760 0.000 0.240
#> SRR1818651 1 0.0237 0.951 0.996 0.000 0.004
#> SRR1818652 1 0.0237 0.951 0.996 0.000 0.004
#> SRR1818657 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818649 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818650 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818659 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818647 3 0.5216 0.612 0.000 0.260 0.740
#> SRR1818648 3 0.5216 0.612 0.000 0.260 0.740
#> SRR1818645 2 0.0000 0.621 0.000 1.000 0.000
#> SRR1818646 2 0.0000 0.621 0.000 1.000 0.000
#> SRR1818639 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818640 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818637 3 0.6260 0.484 0.000 0.448 0.552
#> SRR1818638 3 0.6260 0.484 0.000 0.448 0.552
#> SRR1818635 2 0.6079 0.693 0.388 0.612 0.000
#> SRR1818636 2 0.6079 0.693 0.388 0.612 0.000
#> SRR1818643 2 0.5968 0.724 0.364 0.636 0.000
#> SRR1818644 2 0.5968 0.724 0.364 0.636 0.000
#> SRR1818641 2 0.6079 0.693 0.388 0.612 0.000
#> SRR1818642 2 0.6079 0.693 0.388 0.612 0.000
#> SRR1818633 3 0.9579 0.215 0.368 0.200 0.432
#> SRR1818634 3 0.9579 0.215 0.368 0.200 0.432
#> SRR1818665 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818666 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818667 2 0.0592 0.611 0.000 0.988 0.012
#> SRR1818668 2 0.0592 0.611 0.000 0.988 0.012
#> SRR1818669 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818670 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818663 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818664 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818629 2 0.5835 0.746 0.340 0.660 0.000
#> SRR1818630 2 0.5835 0.746 0.340 0.660 0.000
#> SRR1818627 1 0.0237 0.951 0.996 0.000 0.004
#> SRR1818628 1 0.0237 0.951 0.996 0.000 0.004
#> SRR1818621 3 0.6062 0.284 0.384 0.000 0.616
#> SRR1818622 3 0.6062 0.284 0.384 0.000 0.616
#> SRR1818625 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818623 3 0.5650 0.594 0.000 0.312 0.688
#> SRR1818624 3 0.5650 0.594 0.000 0.312 0.688
#> SRR1818619 1 0.1399 0.921 0.968 0.028 0.004
#> SRR1818620 1 0.1399 0.921 0.968 0.028 0.004
#> SRR1818617 2 0.5982 0.748 0.328 0.668 0.004
#> SRR1818618 2 0.5982 0.748 0.328 0.668 0.004
#> SRR1818615 2 0.0747 0.607 0.000 0.984 0.016
#> SRR1818616 2 0.0747 0.607 0.000 0.984 0.016
#> SRR1818609 3 0.6307 0.433 0.000 0.488 0.512
#> SRR1818610 3 0.6307 0.433 0.000 0.488 0.512
#> SRR1818607 2 0.0000 0.621 0.000 1.000 0.000
#> SRR1818608 2 0.0000 0.621 0.000 1.000 0.000
#> SRR1818613 1 0.0237 0.951 0.996 0.000 0.004
#> SRR1818614 1 0.0237 0.951 0.996 0.000 0.004
#> SRR1818611 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818612 1 0.0000 0.952 1.000 0.000 0.000
#> SRR1818605 1 0.5098 0.626 0.752 0.000 0.248
#> SRR1818606 1 0.5098 0.626 0.752 0.000 0.248
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.4500 0.591 0.000 0.032 0.776 0.192
#> SRR1818632 3 0.4500 0.591 0.000 0.032 0.776 0.192
#> SRR1818679 3 0.6538 0.604 0.176 0.168 0.652 0.004
#> SRR1818680 3 0.6538 0.604 0.176 0.168 0.652 0.004
#> SRR1818677 2 0.1211 0.827 0.040 0.960 0.000 0.000
#> SRR1818678 2 0.1211 0.827 0.040 0.960 0.000 0.000
#> SRR1818675 3 0.3300 0.627 0.000 0.008 0.848 0.144
#> SRR1818676 3 0.3300 0.627 0.000 0.008 0.848 0.144
#> SRR1818673 2 0.1211 0.827 0.040 0.960 0.000 0.000
#> SRR1818674 2 0.1211 0.827 0.040 0.960 0.000 0.000
#> SRR1818671 2 0.5085 0.507 0.000 0.616 0.008 0.376
#> SRR1818672 2 0.5085 0.507 0.000 0.616 0.008 0.376
#> SRR1818661 3 0.4900 0.545 0.000 0.032 0.732 0.236
#> SRR1818662 3 0.4900 0.545 0.000 0.032 0.732 0.236
#> SRR1818655 1 0.0927 0.855 0.976 0.016 0.000 0.008
#> SRR1818656 1 0.0927 0.855 0.976 0.016 0.000 0.008
#> SRR1818653 1 0.5161 0.201 0.520 0.004 0.476 0.000
#> SRR1818654 1 0.5161 0.201 0.520 0.004 0.476 0.000
#> SRR1818651 1 0.2999 0.792 0.864 0.004 0.132 0.000
#> SRR1818652 1 0.2999 0.792 0.864 0.004 0.132 0.000
#> SRR1818657 1 0.0188 0.857 0.996 0.004 0.000 0.000
#> SRR1818658 1 0.0188 0.857 0.996 0.004 0.000 0.000
#> SRR1818649 1 0.0592 0.857 0.984 0.016 0.000 0.000
#> SRR1818650 1 0.0592 0.857 0.984 0.016 0.000 0.000
#> SRR1818659 1 0.0927 0.855 0.976 0.016 0.000 0.008
#> SRR1818647 4 0.4516 0.561 0.000 0.012 0.252 0.736
#> SRR1818648 4 0.4516 0.561 0.000 0.012 0.252 0.736
#> SRR1818645 2 0.4511 0.662 0.000 0.724 0.008 0.268
#> SRR1818646 2 0.4511 0.662 0.000 0.724 0.008 0.268
#> SRR1818639 1 0.0927 0.855 0.976 0.016 0.000 0.008
#> SRR1818640 1 0.0927 0.855 0.976 0.016 0.000 0.008
#> SRR1818637 4 0.2376 0.751 0.000 0.068 0.016 0.916
#> SRR1818638 4 0.2376 0.751 0.000 0.068 0.016 0.916
#> SRR1818635 2 0.1867 0.814 0.072 0.928 0.000 0.000
#> SRR1818636 2 0.1867 0.814 0.072 0.928 0.000 0.000
#> SRR1818643 2 0.1557 0.824 0.056 0.944 0.000 0.000
#> SRR1818644 2 0.1557 0.824 0.056 0.944 0.000 0.000
#> SRR1818641 2 0.1867 0.814 0.072 0.928 0.000 0.000
#> SRR1818642 2 0.1867 0.814 0.072 0.928 0.000 0.000
#> SRR1818633 3 0.6657 0.573 0.208 0.152 0.636 0.004
#> SRR1818634 3 0.6657 0.573 0.208 0.152 0.636 0.004
#> SRR1818665 1 0.0672 0.857 0.984 0.008 0.000 0.008
#> SRR1818666 1 0.0672 0.857 0.984 0.008 0.000 0.008
#> SRR1818667 2 0.5602 0.414 0.000 0.568 0.024 0.408
#> SRR1818668 2 0.5602 0.414 0.000 0.568 0.024 0.408
#> SRR1818669 1 0.0336 0.858 0.992 0.008 0.000 0.000
#> SRR1818670 1 0.0336 0.858 0.992 0.008 0.000 0.000
#> SRR1818663 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> SRR1818629 2 0.1389 0.827 0.048 0.952 0.000 0.000
#> SRR1818630 2 0.1389 0.827 0.048 0.952 0.000 0.000
#> SRR1818627 1 0.3052 0.789 0.860 0.004 0.136 0.000
#> SRR1818628 1 0.3052 0.789 0.860 0.004 0.136 0.000
#> SRR1818621 3 0.3841 0.652 0.144 0.020 0.832 0.004
#> SRR1818622 3 0.3841 0.652 0.144 0.020 0.832 0.004
#> SRR1818625 1 0.0592 0.857 0.984 0.016 0.000 0.000
#> SRR1818626 1 0.0592 0.857 0.984 0.016 0.000 0.000
#> SRR1818623 4 0.3444 0.649 0.000 0.000 0.184 0.816
#> SRR1818624 4 0.3444 0.649 0.000 0.000 0.184 0.816
#> SRR1818619 1 0.6423 0.551 0.648 0.196 0.156 0.000
#> SRR1818620 1 0.6423 0.551 0.648 0.196 0.156 0.000
#> SRR1818617 2 0.1798 0.823 0.040 0.944 0.016 0.000
#> SRR1818618 2 0.1798 0.823 0.040 0.944 0.016 0.000
#> SRR1818615 4 0.4957 0.352 0.000 0.320 0.012 0.668
#> SRR1818616 4 0.4957 0.352 0.000 0.320 0.012 0.668
#> SRR1818609 4 0.1792 0.748 0.000 0.068 0.000 0.932
#> SRR1818610 4 0.1792 0.748 0.000 0.068 0.000 0.932
#> SRR1818607 2 0.4511 0.662 0.000 0.724 0.008 0.268
#> SRR1818608 2 0.4511 0.662 0.000 0.724 0.008 0.268
#> SRR1818613 1 0.3172 0.772 0.840 0.000 0.160 0.000
#> SRR1818614 1 0.3172 0.772 0.840 0.000 0.160 0.000
#> SRR1818611 1 0.0592 0.857 0.984 0.016 0.000 0.000
#> SRR1818612 1 0.0592 0.857 0.984 0.016 0.000 0.000
#> SRR1818605 1 0.5165 0.172 0.512 0.004 0.484 0.000
#> SRR1818606 1 0.5165 0.172 0.512 0.004 0.484 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.1410 0.7500 0.000 0.000 0.940 0.060 NA
#> SRR1818632 3 0.1410 0.7500 0.000 0.000 0.940 0.060 NA
#> SRR1818679 1 0.7968 -0.2259 0.384 0.088 0.240 0.000 NA
#> SRR1818680 1 0.7968 -0.2259 0.384 0.088 0.240 0.000 NA
#> SRR1818677 2 0.0451 0.7863 0.004 0.988 0.000 0.000 NA
#> SRR1818678 2 0.0451 0.7863 0.004 0.988 0.000 0.000 NA
#> SRR1818675 3 0.3584 0.7464 0.012 0.000 0.836 0.040 NA
#> SRR1818676 3 0.3584 0.7464 0.012 0.000 0.836 0.040 NA
#> SRR1818673 2 0.0451 0.7870 0.004 0.988 0.000 0.000 NA
#> SRR1818674 2 0.0451 0.7870 0.004 0.988 0.000 0.000 NA
#> SRR1818671 2 0.6349 0.3937 0.000 0.472 0.000 0.360 NA
#> SRR1818672 2 0.6349 0.3937 0.000 0.472 0.000 0.360 NA
#> SRR1818661 3 0.2233 0.7133 0.000 0.000 0.892 0.104 NA
#> SRR1818662 3 0.2233 0.7133 0.000 0.000 0.892 0.104 NA
#> SRR1818655 1 0.4392 0.6778 0.612 0.008 0.000 0.000 NA
#> SRR1818656 1 0.4392 0.6778 0.612 0.008 0.000 0.000 NA
#> SRR1818653 1 0.5923 0.1124 0.576 0.000 0.144 0.000 NA
#> SRR1818654 1 0.5923 0.1124 0.576 0.000 0.144 0.000 NA
#> SRR1818651 1 0.0510 0.5801 0.984 0.000 0.000 0.000 NA
#> SRR1818652 1 0.0510 0.5801 0.984 0.000 0.000 0.000 NA
#> SRR1818657 1 0.4047 0.6890 0.676 0.004 0.000 0.000 NA
#> SRR1818658 1 0.4047 0.6890 0.676 0.004 0.000 0.000 NA
#> SRR1818649 1 0.4181 0.6883 0.676 0.004 0.004 0.000 NA
#> SRR1818650 1 0.4181 0.6883 0.676 0.004 0.004 0.000 NA
#> SRR1818659 1 0.4276 0.6786 0.616 0.004 0.000 0.000 NA
#> SRR1818647 4 0.4581 0.4407 0.000 0.004 0.360 0.624 NA
#> SRR1818648 4 0.4581 0.4407 0.000 0.004 0.360 0.624 NA
#> SRR1818645 2 0.6115 0.5152 0.000 0.552 0.000 0.280 NA
#> SRR1818646 2 0.6115 0.5152 0.000 0.552 0.000 0.280 NA
#> SRR1818639 1 0.4392 0.6778 0.612 0.008 0.000 0.000 NA
#> SRR1818640 1 0.4392 0.6778 0.612 0.008 0.000 0.000 NA
#> SRR1818637 4 0.0693 0.7242 0.000 0.000 0.012 0.980 NA
#> SRR1818638 4 0.0693 0.7242 0.000 0.000 0.012 0.980 NA
#> SRR1818635 2 0.0613 0.7868 0.004 0.984 0.004 0.000 NA
#> SRR1818636 2 0.0613 0.7868 0.004 0.984 0.004 0.000 NA
#> SRR1818643 2 0.0451 0.7878 0.004 0.988 0.000 0.000 NA
#> SRR1818644 2 0.0451 0.7878 0.004 0.988 0.000 0.000 NA
#> SRR1818641 2 0.0486 0.7869 0.004 0.988 0.004 0.000 NA
#> SRR1818642 2 0.0486 0.7869 0.004 0.988 0.004 0.000 NA
#> SRR1818633 1 0.7899 -0.2141 0.388 0.080 0.240 0.000 NA
#> SRR1818634 1 0.7899 -0.2141 0.388 0.080 0.240 0.000 NA
#> SRR1818665 1 0.4264 0.6804 0.620 0.004 0.000 0.000 NA
#> SRR1818666 1 0.4264 0.6804 0.620 0.004 0.000 0.000 NA
#> SRR1818667 2 0.6633 0.2995 0.000 0.440 0.012 0.396 NA
#> SRR1818668 2 0.6633 0.2995 0.000 0.440 0.012 0.396 NA
#> SRR1818669 1 0.4151 0.6874 0.652 0.004 0.000 0.000 NA
#> SRR1818670 1 0.4151 0.6874 0.652 0.004 0.000 0.000 NA
#> SRR1818663 1 0.4066 0.6891 0.672 0.004 0.000 0.000 NA
#> SRR1818664 1 0.4066 0.6891 0.672 0.004 0.000 0.000 NA
#> SRR1818629 2 0.0324 0.7878 0.004 0.992 0.000 0.000 NA
#> SRR1818630 2 0.0324 0.7878 0.004 0.992 0.000 0.000 NA
#> SRR1818627 1 0.0963 0.5695 0.964 0.000 0.000 0.000 NA
#> SRR1818628 1 0.0963 0.5695 0.964 0.000 0.000 0.000 NA
#> SRR1818621 3 0.6306 0.5435 0.172 0.000 0.500 0.000 NA
#> SRR1818622 3 0.6306 0.5435 0.172 0.000 0.500 0.000 NA
#> SRR1818625 1 0.4084 0.6890 0.668 0.004 0.000 0.000 NA
#> SRR1818626 1 0.4084 0.6890 0.668 0.004 0.000 0.000 NA
#> SRR1818623 4 0.3727 0.6124 0.000 0.000 0.216 0.768 NA
#> SRR1818624 4 0.3727 0.6124 0.000 0.000 0.216 0.768 NA
#> SRR1818619 1 0.5355 0.3473 0.688 0.184 0.008 0.000 NA
#> SRR1818620 1 0.5355 0.3473 0.688 0.184 0.008 0.000 NA
#> SRR1818617 2 0.1662 0.7626 0.004 0.936 0.004 0.000 NA
#> SRR1818618 2 0.1662 0.7626 0.004 0.936 0.004 0.000 NA
#> SRR1818615 4 0.5481 0.4129 0.000 0.184 0.008 0.676 NA
#> SRR1818616 4 0.5481 0.4129 0.000 0.184 0.008 0.676 NA
#> SRR1818609 4 0.0162 0.7227 0.000 0.000 0.000 0.996 NA
#> SRR1818610 4 0.0162 0.7227 0.000 0.000 0.000 0.996 NA
#> SRR1818607 2 0.5973 0.5430 0.000 0.580 0.000 0.256 NA
#> SRR1818608 2 0.5973 0.5430 0.000 0.580 0.000 0.256 NA
#> SRR1818613 1 0.1041 0.5687 0.964 0.000 0.004 0.000 NA
#> SRR1818614 1 0.1041 0.5687 0.964 0.000 0.004 0.000 NA
#> SRR1818611 1 0.4236 0.6880 0.664 0.004 0.004 0.000 NA
#> SRR1818612 1 0.4236 0.6880 0.664 0.004 0.004 0.000 NA
#> SRR1818605 1 0.5987 0.0958 0.572 0.000 0.156 0.000 NA
#> SRR1818606 1 0.5987 0.0958 0.572 0.000 0.156 0.000 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.1257 0.7487 0.000 0.000 0.952 0.028 0.020 NA
#> SRR1818632 3 0.1257 0.7487 0.000 0.000 0.952 0.028 0.020 NA
#> SRR1818679 5 0.4394 0.6268 0.016 0.036 0.144 0.000 0.768 NA
#> SRR1818680 5 0.4394 0.6268 0.016 0.036 0.144 0.000 0.768 NA
#> SRR1818677 2 0.1320 0.7648 0.000 0.948 0.000 0.000 0.036 NA
#> SRR1818678 2 0.1320 0.7648 0.000 0.948 0.000 0.000 0.036 NA
#> SRR1818675 3 0.4130 0.6994 0.000 0.000 0.768 0.024 0.152 NA
#> SRR1818676 3 0.4130 0.6994 0.000 0.000 0.768 0.024 0.152 NA
#> SRR1818673 2 0.0000 0.7779 0.000 1.000 0.000 0.000 0.000 NA
#> SRR1818674 2 0.0000 0.7779 0.000 1.000 0.000 0.000 0.000 NA
#> SRR1818671 2 0.6383 0.1246 0.000 0.384 0.000 0.308 0.012 NA
#> SRR1818672 2 0.6383 0.1246 0.000 0.384 0.000 0.308 0.012 NA
#> SRR1818661 3 0.2201 0.7211 0.000 0.000 0.904 0.056 0.004 NA
#> SRR1818662 3 0.2201 0.7211 0.000 0.000 0.904 0.056 0.004 NA
#> SRR1818655 1 0.3121 0.7381 0.796 0.004 0.000 0.000 0.008 NA
#> SRR1818656 1 0.3121 0.7381 0.796 0.004 0.000 0.000 0.008 NA
#> SRR1818653 5 0.5523 0.6443 0.112 0.000 0.076 0.000 0.668 NA
#> SRR1818654 5 0.5523 0.6443 0.112 0.000 0.076 0.000 0.668 NA
#> SRR1818651 1 0.5025 0.3173 0.560 0.000 0.000 0.000 0.356 NA
#> SRR1818652 1 0.5025 0.3173 0.560 0.000 0.000 0.000 0.356 NA
#> SRR1818657 1 0.1053 0.7727 0.964 0.004 0.000 0.000 0.020 NA
#> SRR1818658 1 0.1053 0.7727 0.964 0.004 0.000 0.000 0.020 NA
#> SRR1818649 1 0.3072 0.7424 0.836 0.004 0.000 0.000 0.036 NA
#> SRR1818650 1 0.3072 0.7424 0.836 0.004 0.000 0.000 0.036 NA
#> SRR1818659 1 0.3121 0.7376 0.796 0.004 0.000 0.000 0.008 NA
#> SRR1818647 4 0.5048 0.2696 0.000 0.000 0.344 0.580 0.008 NA
#> SRR1818648 4 0.5048 0.2696 0.000 0.000 0.344 0.580 0.008 NA
#> SRR1818645 2 0.6051 0.3339 0.000 0.476 0.000 0.216 0.008 NA
#> SRR1818646 2 0.6051 0.3339 0.000 0.476 0.000 0.216 0.008 NA
#> SRR1818639 1 0.3023 0.7406 0.808 0.004 0.000 0.000 0.008 NA
#> SRR1818640 1 0.3023 0.7406 0.808 0.004 0.000 0.000 0.008 NA
#> SRR1818637 4 0.1026 0.6233 0.000 0.004 0.012 0.968 0.008 NA
#> SRR1818638 4 0.1026 0.6233 0.000 0.004 0.012 0.968 0.008 NA
#> SRR1818635 2 0.0146 0.7783 0.004 0.996 0.000 0.000 0.000 NA
#> SRR1818636 2 0.0146 0.7783 0.004 0.996 0.000 0.000 0.000 NA
#> SRR1818643 2 0.0291 0.7783 0.004 0.992 0.000 0.000 0.000 NA
#> SRR1818644 2 0.0291 0.7783 0.004 0.992 0.000 0.000 0.000 NA
#> SRR1818641 2 0.0146 0.7783 0.004 0.996 0.000 0.000 0.000 NA
#> SRR1818642 2 0.0146 0.7783 0.004 0.996 0.000 0.000 0.000 NA
#> SRR1818633 5 0.4345 0.6390 0.020 0.032 0.124 0.000 0.780 NA
#> SRR1818634 5 0.4345 0.6390 0.020 0.032 0.124 0.000 0.780 NA
#> SRR1818665 1 0.2362 0.7535 0.860 0.004 0.000 0.000 0.000 NA
#> SRR1818666 1 0.2362 0.7535 0.860 0.004 0.000 0.000 0.000 NA
#> SRR1818667 4 0.7147 0.0499 0.000 0.304 0.000 0.360 0.080 NA
#> SRR1818668 4 0.7147 0.0499 0.000 0.304 0.000 0.360 0.080 NA
#> SRR1818669 1 0.1477 0.7752 0.940 0.004 0.000 0.000 0.008 NA
#> SRR1818670 1 0.1477 0.7752 0.940 0.004 0.000 0.000 0.008 NA
#> SRR1818663 1 0.0806 0.7762 0.972 0.000 0.000 0.000 0.008 NA
#> SRR1818664 1 0.0806 0.7762 0.972 0.000 0.000 0.000 0.008 NA
#> SRR1818629 2 0.0291 0.7781 0.004 0.992 0.000 0.000 0.000 NA
#> SRR1818630 2 0.0291 0.7781 0.004 0.992 0.000 0.000 0.000 NA
#> SRR1818627 1 0.4972 0.2340 0.536 0.000 0.000 0.000 0.392 NA
#> SRR1818628 1 0.4972 0.2340 0.536 0.000 0.000 0.000 0.392 NA
#> SRR1818621 3 0.6133 0.2377 0.004 0.000 0.420 0.000 0.324 NA
#> SRR1818622 3 0.6133 0.2377 0.004 0.000 0.420 0.000 0.324 NA
#> SRR1818625 1 0.0748 0.7768 0.976 0.004 0.000 0.000 0.004 NA
#> SRR1818626 1 0.0748 0.7768 0.976 0.004 0.000 0.000 0.004 NA
#> SRR1818623 4 0.3655 0.5120 0.000 0.000 0.148 0.796 0.012 NA
#> SRR1818624 4 0.3655 0.5120 0.000 0.000 0.148 0.796 0.012 NA
#> SRR1818619 5 0.5381 0.5538 0.224 0.080 0.000 0.000 0.648 NA
#> SRR1818620 5 0.5381 0.5538 0.224 0.080 0.000 0.000 0.648 NA
#> SRR1818617 2 0.2831 0.6941 0.000 0.840 0.000 0.000 0.136 NA
#> SRR1818618 2 0.2831 0.6941 0.000 0.840 0.000 0.000 0.136 NA
#> SRR1818615 4 0.5722 0.4432 0.000 0.144 0.000 0.576 0.020 NA
#> SRR1818616 4 0.5722 0.4432 0.000 0.144 0.000 0.576 0.020 NA
#> SRR1818609 4 0.0291 0.6261 0.000 0.004 0.000 0.992 0.000 NA
#> SRR1818610 4 0.0291 0.6261 0.000 0.004 0.000 0.992 0.000 NA
#> SRR1818607 2 0.5934 0.3713 0.000 0.500 0.000 0.192 0.008 NA
#> SRR1818608 2 0.5934 0.3713 0.000 0.500 0.000 0.192 0.008 NA
#> SRR1818613 1 0.5249 0.2884 0.544 0.000 0.004 0.000 0.360 NA
#> SRR1818614 1 0.5249 0.2884 0.544 0.000 0.004 0.000 0.360 NA
#> SRR1818611 1 0.3558 0.7377 0.780 0.004 0.000 0.000 0.032 NA
#> SRR1818612 1 0.3558 0.7377 0.780 0.004 0.000 0.000 0.032 NA
#> SRR1818605 5 0.5957 0.6228 0.132 0.000 0.076 0.000 0.616 NA
#> SRR1818606 5 0.5957 0.6228 0.132 0.000 0.076 0.000 0.616 NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15216 rows and 75 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.536 0.779 0.901 0.4973 0.498 0.498
#> 3 3 0.907 0.931 0.967 0.3377 0.737 0.520
#> 4 4 0.916 0.912 0.957 0.1061 0.892 0.694
#> 5 5 0.840 0.824 0.872 0.0495 0.922 0.730
#> 6 6 0.824 0.829 0.865 0.0380 0.951 0.800
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 3
There is also optional best \(k\) = 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1818631 2 0.866 0.666 0.288 0.712
#> SRR1818632 2 0.866 0.666 0.288 0.712
#> SRR1818679 2 0.866 0.666 0.288 0.712
#> SRR1818680 2 0.866 0.666 0.288 0.712
#> SRR1818677 2 0.975 0.236 0.408 0.592
#> SRR1818678 2 0.975 0.236 0.408 0.592
#> SRR1818675 2 0.866 0.666 0.288 0.712
#> SRR1818676 2 0.866 0.666 0.288 0.712
#> SRR1818673 2 0.876 0.507 0.296 0.704
#> SRR1818674 2 0.876 0.507 0.296 0.704
#> SRR1818671 2 0.000 0.832 0.000 1.000
#> SRR1818672 2 0.000 0.832 0.000 1.000
#> SRR1818661 2 0.866 0.666 0.288 0.712
#> SRR1818662 2 0.866 0.666 0.288 0.712
#> SRR1818655 1 0.000 0.905 1.000 0.000
#> SRR1818656 1 0.000 0.905 1.000 0.000
#> SRR1818653 1 0.000 0.905 1.000 0.000
#> SRR1818654 1 0.000 0.905 1.000 0.000
#> SRR1818651 1 0.000 0.905 1.000 0.000
#> SRR1818652 1 0.000 0.905 1.000 0.000
#> SRR1818657 1 0.000 0.905 1.000 0.000
#> SRR1818658 1 0.000 0.905 1.000 0.000
#> SRR1818649 1 0.000 0.905 1.000 0.000
#> SRR1818650 1 0.000 0.905 1.000 0.000
#> SRR1818659 1 0.000 0.905 1.000 0.000
#> SRR1818647 2 0.000 0.832 0.000 1.000
#> SRR1818648 2 0.000 0.832 0.000 1.000
#> SRR1818645 2 0.000 0.832 0.000 1.000
#> SRR1818646 2 0.000 0.832 0.000 1.000
#> SRR1818639 1 0.000 0.905 1.000 0.000
#> SRR1818640 1 0.000 0.905 1.000 0.000
#> SRR1818637 2 0.000 0.832 0.000 1.000
#> SRR1818638 2 0.000 0.832 0.000 1.000
#> SRR1818635 1 0.866 0.609 0.712 0.288
#> SRR1818636 1 0.866 0.609 0.712 0.288
#> SRR1818643 1 0.866 0.609 0.712 0.288
#> SRR1818644 1 0.866 0.609 0.712 0.288
#> SRR1818641 1 0.866 0.609 0.712 0.288
#> SRR1818642 1 0.866 0.609 0.712 0.288
#> SRR1818633 2 0.866 0.666 0.288 0.712
#> SRR1818634 2 0.866 0.666 0.288 0.712
#> SRR1818665 1 0.000 0.905 1.000 0.000
#> SRR1818666 1 0.000 0.905 1.000 0.000
#> SRR1818667 2 0.000 0.832 0.000 1.000
#> SRR1818668 2 0.000 0.832 0.000 1.000
#> SRR1818669 1 0.000 0.905 1.000 0.000
#> SRR1818670 1 0.000 0.905 1.000 0.000
#> SRR1818663 1 0.000 0.905 1.000 0.000
#> SRR1818664 1 0.000 0.905 1.000 0.000
#> SRR1818629 1 0.866 0.609 0.712 0.288
#> SRR1818630 1 0.866 0.609 0.712 0.288
#> SRR1818627 1 0.000 0.905 1.000 0.000
#> SRR1818628 1 0.000 0.905 1.000 0.000
#> SRR1818621 1 0.876 0.442 0.704 0.296
#> SRR1818622 1 0.876 0.442 0.704 0.296
#> SRR1818625 1 0.000 0.905 1.000 0.000
#> SRR1818626 1 0.000 0.905 1.000 0.000
#> SRR1818623 2 0.000 0.832 0.000 1.000
#> SRR1818624 2 0.000 0.832 0.000 1.000
#> SRR1818619 1 0.000 0.905 1.000 0.000
#> SRR1818620 1 0.000 0.905 1.000 0.000
#> SRR1818617 2 0.494 0.761 0.108 0.892
#> SRR1818618 2 0.494 0.761 0.108 0.892
#> SRR1818615 2 0.000 0.832 0.000 1.000
#> SRR1818616 2 0.000 0.832 0.000 1.000
#> SRR1818609 2 0.000 0.832 0.000 1.000
#> SRR1818610 2 0.000 0.832 0.000 1.000
#> SRR1818607 2 0.000 0.832 0.000 1.000
#> SRR1818608 2 0.000 0.832 0.000 1.000
#> SRR1818613 1 0.000 0.905 1.000 0.000
#> SRR1818614 1 0.000 0.905 1.000 0.000
#> SRR1818611 1 0.000 0.905 1.000 0.000
#> SRR1818612 1 0.000 0.905 1.000 0.000
#> SRR1818605 1 0.000 0.905 1.000 0.000
#> SRR1818606 1 0.000 0.905 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818632 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818679 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818680 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818677 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818678 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818675 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818676 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818673 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818674 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818671 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818672 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818661 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818662 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818655 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818656 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818653 1 0.3116 0.896 0.892 0.000 0.108
#> SRR1818654 1 0.3116 0.896 0.892 0.000 0.108
#> SRR1818651 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818652 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818657 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818649 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818650 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818659 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818647 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818648 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818645 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818646 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818639 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818640 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818637 3 0.3116 0.848 0.000 0.108 0.892
#> SRR1818638 3 0.3116 0.848 0.000 0.108 0.892
#> SRR1818635 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818636 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818643 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818644 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818641 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818642 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818633 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818634 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818665 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818666 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818667 3 0.5882 0.557 0.000 0.348 0.652
#> SRR1818668 3 0.5882 0.557 0.000 0.348 0.652
#> SRR1818669 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818670 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818663 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818664 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818629 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818630 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818627 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818628 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818621 3 0.0237 0.904 0.004 0.000 0.996
#> SRR1818622 3 0.0237 0.904 0.004 0.000 0.996
#> SRR1818625 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818623 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818624 3 0.0000 0.906 0.000 0.000 1.000
#> SRR1818619 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818620 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818617 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818618 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818615 3 0.6291 0.284 0.000 0.468 0.532
#> SRR1818616 3 0.6291 0.284 0.000 0.468 0.532
#> SRR1818609 3 0.3192 0.846 0.000 0.112 0.888
#> SRR1818610 3 0.3192 0.846 0.000 0.112 0.888
#> SRR1818607 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818608 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1818613 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818614 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818611 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818612 1 0.0000 0.987 1.000 0.000 0.000
#> SRR1818605 1 0.2711 0.915 0.912 0.000 0.088
#> SRR1818606 1 0.2711 0.915 0.912 0.000 0.088
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818632 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818679 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818680 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818677 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818678 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818675 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818676 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818673 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818674 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818671 2 0.4967 0.372 0.000 0.548 0.000 0.452
#> SRR1818672 2 0.4967 0.372 0.000 0.548 0.000 0.452
#> SRR1818661 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818662 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818655 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818656 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818653 3 0.3726 0.774 0.212 0.000 0.788 0.000
#> SRR1818654 3 0.3726 0.774 0.212 0.000 0.788 0.000
#> SRR1818651 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818652 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818657 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818658 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818649 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818650 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818659 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818647 4 0.0817 0.979 0.000 0.000 0.024 0.976
#> SRR1818648 4 0.0817 0.979 0.000 0.000 0.024 0.976
#> SRR1818645 2 0.4916 0.434 0.000 0.576 0.000 0.424
#> SRR1818646 2 0.4916 0.434 0.000 0.576 0.000 0.424
#> SRR1818639 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818640 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818637 4 0.0000 0.990 0.000 0.000 0.000 1.000
#> SRR1818638 4 0.0000 0.990 0.000 0.000 0.000 1.000
#> SRR1818635 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818636 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818643 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818644 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818641 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818642 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818633 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818634 3 0.0336 0.926 0.000 0.000 0.992 0.008
#> SRR1818665 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818666 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818667 4 0.0000 0.990 0.000 0.000 0.000 1.000
#> SRR1818668 4 0.0000 0.990 0.000 0.000 0.000 1.000
#> SRR1818669 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818670 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818663 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818629 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818630 2 0.0000 0.878 0.000 1.000 0.000 0.000
#> SRR1818627 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818628 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818621 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> SRR1818622 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> SRR1818625 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818626 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818623 4 0.0817 0.979 0.000 0.000 0.024 0.976
#> SRR1818624 4 0.0817 0.979 0.000 0.000 0.024 0.976
#> SRR1818619 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818620 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818617 2 0.0188 0.876 0.000 0.996 0.000 0.004
#> SRR1818618 2 0.0188 0.876 0.000 0.996 0.000 0.004
#> SRR1818615 4 0.0000 0.990 0.000 0.000 0.000 1.000
#> SRR1818616 4 0.0000 0.990 0.000 0.000 0.000 1.000
#> SRR1818609 4 0.0000 0.990 0.000 0.000 0.000 1.000
#> SRR1818610 4 0.0000 0.990 0.000 0.000 0.000 1.000
#> SRR1818607 2 0.3764 0.727 0.000 0.784 0.000 0.216
#> SRR1818608 2 0.3764 0.727 0.000 0.784 0.000 0.216
#> SRR1818613 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818614 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818611 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818612 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1818605 3 0.3726 0.774 0.212 0.000 0.788 0.000
#> SRR1818606 3 0.3726 0.774 0.212 0.000 0.788 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000
#> SRR1818632 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000
#> SRR1818679 3 0.0162 0.985 0.000 0.000 0.996 0.000 0.004
#> SRR1818680 3 0.0162 0.985 0.000 0.000 0.996 0.000 0.004
#> SRR1818677 2 0.3274 0.781 0.000 0.780 0.000 0.000 0.220
#> SRR1818678 2 0.3274 0.781 0.000 0.780 0.000 0.000 0.220
#> SRR1818675 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000
#> SRR1818676 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000
#> SRR1818673 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818674 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818671 4 0.6369 0.409 0.000 0.240 0.000 0.520 0.240
#> SRR1818672 4 0.6369 0.409 0.000 0.240 0.000 0.520 0.240
#> SRR1818661 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000
#> SRR1818662 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000
#> SRR1818655 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818656 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818653 5 0.4733 0.965 0.028 0.000 0.348 0.000 0.624
#> SRR1818654 5 0.4733 0.965 0.028 0.000 0.348 0.000 0.624
#> SRR1818651 1 0.2280 0.874 0.880 0.000 0.000 0.000 0.120
#> SRR1818652 1 0.2280 0.874 0.880 0.000 0.000 0.000 0.120
#> SRR1818657 1 0.0000 0.963 1.000 0.000 0.000 0.000 0.000
#> SRR1818658 1 0.0000 0.963 1.000 0.000 0.000 0.000 0.000
#> SRR1818649 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818650 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818659 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818647 4 0.4201 0.241 0.000 0.000 0.408 0.592 0.000
#> SRR1818648 4 0.4201 0.241 0.000 0.000 0.408 0.592 0.000
#> SRR1818645 4 0.6441 0.388 0.000 0.256 0.000 0.504 0.240
#> SRR1818646 4 0.6441 0.388 0.000 0.256 0.000 0.504 0.240
#> SRR1818639 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818640 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818637 4 0.0000 0.682 0.000 0.000 0.000 1.000 0.000
#> SRR1818638 4 0.0000 0.682 0.000 0.000 0.000 1.000 0.000
#> SRR1818635 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818636 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818643 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818644 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818641 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818642 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818633 3 0.0963 0.956 0.000 0.000 0.964 0.000 0.036
#> SRR1818634 3 0.0963 0.956 0.000 0.000 0.964 0.000 0.036
#> SRR1818665 1 0.0000 0.963 1.000 0.000 0.000 0.000 0.000
#> SRR1818666 1 0.0000 0.963 1.000 0.000 0.000 0.000 0.000
#> SRR1818667 4 0.0290 0.683 0.000 0.000 0.000 0.992 0.008
#> SRR1818668 4 0.0290 0.683 0.000 0.000 0.000 0.992 0.008
#> SRR1818669 1 0.0000 0.963 1.000 0.000 0.000 0.000 0.000
#> SRR1818670 1 0.0000 0.963 1.000 0.000 0.000 0.000 0.000
#> SRR1818663 1 0.0000 0.963 1.000 0.000 0.000 0.000 0.000
#> SRR1818664 1 0.0000 0.963 1.000 0.000 0.000 0.000 0.000
#> SRR1818629 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818630 2 0.0000 0.918 0.000 1.000 0.000 0.000 0.000
#> SRR1818627 1 0.0510 0.957 0.984 0.000 0.000 0.000 0.016
#> SRR1818628 1 0.0510 0.957 0.984 0.000 0.000 0.000 0.016
#> SRR1818621 5 0.4161 0.927 0.000 0.000 0.392 0.000 0.608
#> SRR1818622 5 0.4161 0.927 0.000 0.000 0.392 0.000 0.608
#> SRR1818625 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818626 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818623 4 0.4171 0.264 0.000 0.000 0.396 0.604 0.000
#> SRR1818624 4 0.4171 0.264 0.000 0.000 0.396 0.604 0.000
#> SRR1818619 1 0.2516 0.860 0.860 0.000 0.000 0.000 0.140
#> SRR1818620 1 0.2516 0.860 0.860 0.000 0.000 0.000 0.140
#> SRR1818617 2 0.4235 0.706 0.000 0.656 0.000 0.008 0.336
#> SRR1818618 2 0.4118 0.710 0.000 0.660 0.000 0.004 0.336
#> SRR1818615 4 0.0290 0.683 0.000 0.000 0.000 0.992 0.008
#> SRR1818616 4 0.0290 0.683 0.000 0.000 0.000 0.992 0.008
#> SRR1818609 4 0.0000 0.682 0.000 0.000 0.000 1.000 0.000
#> SRR1818610 4 0.0000 0.682 0.000 0.000 0.000 1.000 0.000
#> SRR1818607 4 0.6504 0.360 0.000 0.272 0.000 0.488 0.240
#> SRR1818608 4 0.6504 0.360 0.000 0.272 0.000 0.488 0.240
#> SRR1818613 1 0.2813 0.827 0.832 0.000 0.000 0.000 0.168
#> SRR1818614 1 0.2813 0.827 0.832 0.000 0.000 0.000 0.168
#> SRR1818611 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818612 1 0.0290 0.963 0.992 0.000 0.000 0.000 0.008
#> SRR1818605 5 0.4733 0.965 0.028 0.000 0.348 0.000 0.624
#> SRR1818606 5 0.4733 0.965 0.028 0.000 0.348 0.000 0.624
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818632 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818679 3 0.0405 0.959 0.000 0.004 0.988 0.000 0.008 0.000
#> SRR1818680 3 0.0405 0.959 0.000 0.004 0.988 0.000 0.008 0.000
#> SRR1818677 6 0.1444 0.191 0.000 0.072 0.000 0.000 0.000 0.928
#> SRR1818678 6 0.1444 0.191 0.000 0.072 0.000 0.000 0.000 0.928
#> SRR1818675 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818676 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818673 2 0.3854 0.993 0.000 0.536 0.000 0.000 0.000 0.464
#> SRR1818674 2 0.3854 0.993 0.000 0.536 0.000 0.000 0.000 0.464
#> SRR1818671 6 0.3672 0.685 0.000 0.000 0.000 0.368 0.000 0.632
#> SRR1818672 6 0.3672 0.685 0.000 0.000 0.000 0.368 0.000 0.632
#> SRR1818661 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818662 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818655 1 0.0717 0.901 0.976 0.016 0.000 0.000 0.008 0.000
#> SRR1818656 1 0.0717 0.901 0.976 0.016 0.000 0.000 0.008 0.000
#> SRR1818653 5 0.2362 0.961 0.004 0.000 0.136 0.000 0.860 0.000
#> SRR1818654 5 0.2362 0.961 0.004 0.000 0.136 0.000 0.860 0.000
#> SRR1818651 1 0.3388 0.766 0.792 0.036 0.000 0.000 0.172 0.000
#> SRR1818652 1 0.3354 0.770 0.796 0.036 0.000 0.000 0.168 0.000
#> SRR1818657 1 0.0405 0.901 0.988 0.008 0.000 0.000 0.004 0.000
#> SRR1818658 1 0.0405 0.901 0.988 0.008 0.000 0.000 0.004 0.000
#> SRR1818649 1 0.0972 0.899 0.964 0.028 0.000 0.000 0.008 0.000
#> SRR1818650 1 0.0972 0.899 0.964 0.028 0.000 0.000 0.008 0.000
#> SRR1818659 1 0.0717 0.901 0.976 0.016 0.000 0.000 0.008 0.000
#> SRR1818647 4 0.3508 0.654 0.000 0.004 0.292 0.704 0.000 0.000
#> SRR1818648 4 0.3508 0.654 0.000 0.004 0.292 0.704 0.000 0.000
#> SRR1818645 6 0.3578 0.716 0.000 0.000 0.000 0.340 0.000 0.660
#> SRR1818646 6 0.3578 0.716 0.000 0.000 0.000 0.340 0.000 0.660
#> SRR1818639 1 0.0717 0.901 0.976 0.016 0.000 0.000 0.008 0.000
#> SRR1818640 1 0.0717 0.901 0.976 0.016 0.000 0.000 0.008 0.000
#> SRR1818637 4 0.0000 0.833 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818638 4 0.0000 0.833 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818635 2 0.3851 0.995 0.000 0.540 0.000 0.000 0.000 0.460
#> SRR1818636 2 0.3851 0.995 0.000 0.540 0.000 0.000 0.000 0.460
#> SRR1818643 2 0.3851 0.995 0.000 0.540 0.000 0.000 0.000 0.460
#> SRR1818644 2 0.3851 0.995 0.000 0.540 0.000 0.000 0.000 0.460
#> SRR1818641 2 0.3851 0.995 0.000 0.540 0.000 0.000 0.000 0.460
#> SRR1818642 2 0.3851 0.995 0.000 0.540 0.000 0.000 0.000 0.460
#> SRR1818633 3 0.2854 0.866 0.000 0.088 0.860 0.004 0.048 0.000
#> SRR1818634 3 0.2854 0.866 0.000 0.088 0.860 0.004 0.048 0.000
#> SRR1818665 1 0.0146 0.902 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR1818666 1 0.0146 0.902 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR1818667 4 0.0260 0.831 0.000 0.000 0.000 0.992 0.000 0.008
#> SRR1818668 4 0.0260 0.831 0.000 0.000 0.000 0.992 0.000 0.008
#> SRR1818669 1 0.0291 0.902 0.992 0.004 0.000 0.000 0.004 0.000
#> SRR1818670 1 0.0291 0.902 0.992 0.004 0.000 0.000 0.004 0.000
#> SRR1818663 1 0.0146 0.902 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR1818664 1 0.0146 0.902 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR1818629 2 0.3860 0.986 0.000 0.528 0.000 0.000 0.000 0.472
#> SRR1818630 2 0.3860 0.986 0.000 0.528 0.000 0.000 0.000 0.472
#> SRR1818627 1 0.2509 0.846 0.876 0.036 0.000 0.000 0.088 0.000
#> SRR1818628 1 0.2457 0.849 0.880 0.036 0.000 0.000 0.084 0.000
#> SRR1818621 5 0.2793 0.926 0.000 0.000 0.200 0.000 0.800 0.000
#> SRR1818622 5 0.2793 0.926 0.000 0.000 0.200 0.000 0.800 0.000
#> SRR1818625 1 0.0146 0.903 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR1818626 1 0.0146 0.903 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR1818623 4 0.3405 0.680 0.000 0.004 0.272 0.724 0.000 0.000
#> SRR1818624 4 0.3405 0.680 0.000 0.004 0.272 0.724 0.000 0.000
#> SRR1818619 1 0.5704 0.282 0.456 0.400 0.000 0.000 0.140 0.004
#> SRR1818620 1 0.5704 0.282 0.456 0.400 0.000 0.000 0.140 0.004
#> SRR1818617 6 0.4456 0.466 0.000 0.268 0.000 0.000 0.064 0.668
#> SRR1818618 6 0.4456 0.466 0.000 0.268 0.000 0.000 0.064 0.668
#> SRR1818615 4 0.0363 0.828 0.000 0.000 0.000 0.988 0.000 0.012
#> SRR1818616 4 0.0363 0.828 0.000 0.000 0.000 0.988 0.000 0.012
#> SRR1818609 4 0.0000 0.833 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818610 4 0.0000 0.833 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818607 6 0.3547 0.719 0.000 0.000 0.000 0.332 0.000 0.668
#> SRR1818608 6 0.3547 0.719 0.000 0.000 0.000 0.332 0.000 0.668
#> SRR1818613 1 0.3999 0.645 0.696 0.032 0.000 0.000 0.272 0.000
#> SRR1818614 1 0.3999 0.645 0.696 0.032 0.000 0.000 0.272 0.000
#> SRR1818611 1 0.0972 0.899 0.964 0.028 0.000 0.000 0.008 0.000
#> SRR1818612 1 0.0972 0.899 0.964 0.028 0.000 0.000 0.008 0.000
#> SRR1818605 5 0.2726 0.959 0.008 0.008 0.136 0.000 0.848 0.000
#> SRR1818606 5 0.2726 0.959 0.008 0.008 0.136 0.000 0.848 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", "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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.972 0.942 0.974 0.4091 0.580 0.580
#> 3 3 0.707 0.898 0.927 0.4490 0.692 0.518
#> 4 4 0.865 0.848 0.939 0.1231 0.928 0.820
#> 5 5 0.779 0.823 0.861 0.0827 0.919 0.784
#> 6 6 0.932 0.902 0.959 0.1169 0.874 0.616
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2
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
#> SRR1818631 1 0.000 0.989 1.000 0.000
#> SRR1818632 1 0.000 0.989 1.000 0.000
#> SRR1818679 1 0.000 0.989 1.000 0.000
#> SRR1818680 1 0.000 0.989 1.000 0.000
#> SRR1818677 1 0.278 0.952 0.952 0.048
#> SRR1818678 1 0.278 0.952 0.952 0.048
#> SRR1818675 1 0.141 0.973 0.980 0.020
#> SRR1818676 1 0.469 0.882 0.900 0.100
#> SRR1818673 2 0.866 0.614 0.288 0.712
#> SRR1818674 2 0.876 0.600 0.296 0.704
#> SRR1818671 2 0.000 0.931 0.000 1.000
#> SRR1818672 2 0.000 0.931 0.000 1.000
#> SRR1818661 2 0.975 0.371 0.408 0.592
#> SRR1818662 2 0.981 0.339 0.420 0.580
#> SRR1818655 1 0.000 0.989 1.000 0.000
#> SRR1818656 1 0.000 0.989 1.000 0.000
#> SRR1818653 1 0.000 0.989 1.000 0.000
#> SRR1818654 1 0.000 0.989 1.000 0.000
#> SRR1818651 1 0.000 0.989 1.000 0.000
#> SRR1818652 1 0.000 0.989 1.000 0.000
#> SRR1818657 1 0.000 0.989 1.000 0.000
#> SRR1818658 1 0.000 0.989 1.000 0.000
#> SRR1818649 1 0.000 0.989 1.000 0.000
#> SRR1818650 1 0.000 0.989 1.000 0.000
#> SRR1818659 1 0.000 0.989 1.000 0.000
#> SRR1818647 2 0.000 0.931 0.000 1.000
#> SRR1818648 2 0.000 0.931 0.000 1.000
#> SRR1818645 2 0.000 0.931 0.000 1.000
#> SRR1818646 2 0.000 0.931 0.000 1.000
#> SRR1818639 1 0.000 0.989 1.000 0.000
#> SRR1818640 1 0.000 0.989 1.000 0.000
#> SRR1818637 2 0.000 0.931 0.000 1.000
#> SRR1818638 2 0.000 0.931 0.000 1.000
#> SRR1818635 1 0.000 0.989 1.000 0.000
#> SRR1818636 1 0.000 0.989 1.000 0.000
#> SRR1818643 1 0.278 0.952 0.952 0.048
#> SRR1818644 1 0.278 0.952 0.952 0.048
#> SRR1818641 1 0.000 0.989 1.000 0.000
#> SRR1818642 1 0.000 0.989 1.000 0.000
#> SRR1818633 1 0.000 0.989 1.000 0.000
#> SRR1818634 1 0.000 0.989 1.000 0.000
#> SRR1818665 1 0.000 0.989 1.000 0.000
#> SRR1818666 1 0.000 0.989 1.000 0.000
#> SRR1818667 2 0.000 0.931 0.000 1.000
#> SRR1818668 2 0.000 0.931 0.000 1.000
#> SRR1818669 1 0.000 0.989 1.000 0.000
#> SRR1818670 1 0.000 0.989 1.000 0.000
#> SRR1818663 1 0.000 0.989 1.000 0.000
#> SRR1818664 1 0.000 0.989 1.000 0.000
#> SRR1818629 1 0.278 0.952 0.952 0.048
#> SRR1818630 1 0.278 0.952 0.952 0.048
#> SRR1818627 1 0.000 0.989 1.000 0.000
#> SRR1818628 1 0.000 0.989 1.000 0.000
#> SRR1818621 1 0.000 0.989 1.000 0.000
#> SRR1818622 1 0.000 0.989 1.000 0.000
#> SRR1818625 1 0.000 0.989 1.000 0.000
#> SRR1818626 1 0.000 0.989 1.000 0.000
#> SRR1818623 2 0.000 0.931 0.000 1.000
#> SRR1818624 2 0.000 0.931 0.000 1.000
#> SRR1818619 1 0.000 0.989 1.000 0.000
#> SRR1818620 1 0.000 0.989 1.000 0.000
#> SRR1818617 1 0.278 0.952 0.952 0.048
#> SRR1818618 1 0.278 0.952 0.952 0.048
#> SRR1818615 2 0.000 0.931 0.000 1.000
#> SRR1818616 2 0.000 0.931 0.000 1.000
#> SRR1818609 2 0.000 0.931 0.000 1.000
#> SRR1818610 2 0.000 0.931 0.000 1.000
#> SRR1818607 2 0.000 0.931 0.000 1.000
#> SRR1818608 2 0.000 0.931 0.000 1.000
#> SRR1818613 1 0.000 0.989 1.000 0.000
#> SRR1818614 1 0.000 0.989 1.000 0.000
#> SRR1818611 1 0.000 0.989 1.000 0.000
#> SRR1818612 1 0.000 0.989 1.000 0.000
#> SRR1818605 1 0.000 0.989 1.000 0.000
#> SRR1818606 1 0.000 0.989 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.000 0.872 0.000 0.000 1.000
#> SRR1818632 3 0.000 0.872 0.000 0.000 1.000
#> SRR1818679 1 0.263 0.880 0.916 0.084 0.000
#> SRR1818680 1 0.271 0.875 0.912 0.088 0.000
#> SRR1818677 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818678 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818675 1 0.604 0.462 0.620 0.000 0.380
#> SRR1818676 1 0.610 0.435 0.608 0.000 0.392
#> SRR1818673 2 0.435 0.869 0.184 0.816 0.000
#> SRR1818674 2 0.435 0.869 0.184 0.816 0.000
#> SRR1818671 2 0.000 0.796 0.000 1.000 0.000
#> SRR1818672 2 0.000 0.796 0.000 1.000 0.000
#> SRR1818661 3 0.000 0.872 0.000 0.000 1.000
#> SRR1818662 3 0.000 0.872 0.000 0.000 1.000
#> SRR1818655 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818656 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818653 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818654 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818651 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818652 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818657 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818658 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818649 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818650 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818659 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818647 3 0.440 0.932 0.000 0.188 0.812
#> SRR1818648 3 0.440 0.932 0.000 0.188 0.812
#> SRR1818645 2 0.000 0.796 0.000 1.000 0.000
#> SRR1818646 2 0.000 0.796 0.000 1.000 0.000
#> SRR1818639 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818640 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818637 3 0.445 0.932 0.000 0.192 0.808
#> SRR1818638 3 0.445 0.932 0.000 0.192 0.808
#> SRR1818635 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818636 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818643 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818644 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818641 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818642 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818633 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818634 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818665 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818666 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818667 2 0.000 0.796 0.000 1.000 0.000
#> SRR1818668 2 0.000 0.796 0.000 1.000 0.000
#> SRR1818669 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818670 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818663 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818664 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818629 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818630 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818627 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818628 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818621 1 0.280 0.882 0.908 0.000 0.092
#> SRR1818622 1 0.226 0.907 0.932 0.000 0.068
#> SRR1818625 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818626 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818623 3 0.445 0.932 0.000 0.192 0.808
#> SRR1818624 3 0.445 0.932 0.000 0.192 0.808
#> SRR1818619 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818620 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818617 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818618 2 0.445 0.870 0.192 0.808 0.000
#> SRR1818615 2 0.341 0.656 0.000 0.876 0.124
#> SRR1818616 2 0.196 0.744 0.000 0.944 0.056
#> SRR1818609 3 0.445 0.932 0.000 0.192 0.808
#> SRR1818610 3 0.445 0.932 0.000 0.192 0.808
#> SRR1818607 2 0.000 0.796 0.000 1.000 0.000
#> SRR1818608 2 0.000 0.796 0.000 1.000 0.000
#> SRR1818613 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818614 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818611 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818612 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818605 1 0.000 0.969 1.000 0.000 0.000
#> SRR1818606 1 0.000 0.969 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.000 0.717 0.000 0.000 1.000 0.000
#> SRR1818632 3 0.000 0.717 0.000 0.000 1.000 0.000
#> SRR1818679 1 0.384 0.740 0.816 0.016 0.168 0.000
#> SRR1818680 1 0.395 0.735 0.812 0.020 0.168 0.000
#> SRR1818677 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818678 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818675 3 0.504 0.380 0.404 0.000 0.592 0.004
#> SRR1818676 3 0.504 0.380 0.404 0.000 0.592 0.004
#> SRR1818673 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818674 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818671 4 0.500 -0.194 0.000 0.488 0.000 0.512
#> SRR1818672 2 0.487 0.429 0.000 0.596 0.000 0.404
#> SRR1818661 3 0.000 0.717 0.000 0.000 1.000 0.000
#> SRR1818662 3 0.000 0.717 0.000 0.000 1.000 0.000
#> SRR1818655 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818656 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818653 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818654 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818651 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818652 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818657 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818658 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818649 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818650 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818659 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818647 4 0.172 0.905 0.000 0.000 0.064 0.936
#> SRR1818648 4 0.172 0.905 0.000 0.000 0.064 0.936
#> SRR1818645 2 0.302 0.865 0.000 0.852 0.000 0.148
#> SRR1818646 2 0.302 0.865 0.000 0.852 0.000 0.148
#> SRR1818639 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818640 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818637 4 0.147 0.913 0.000 0.000 0.052 0.948
#> SRR1818638 4 0.147 0.913 0.000 0.000 0.052 0.948
#> SRR1818635 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818636 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818643 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818644 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818641 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818642 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818633 1 0.327 0.759 0.832 0.000 0.168 0.000
#> SRR1818634 1 0.327 0.759 0.832 0.000 0.168 0.000
#> SRR1818665 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818666 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818667 2 0.302 0.865 0.000 0.852 0.000 0.148
#> SRR1818668 2 0.302 0.865 0.000 0.852 0.000 0.148
#> SRR1818669 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818670 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818663 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818664 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818629 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818630 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818627 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818628 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818621 1 0.498 -0.025 0.540 0.000 0.460 0.000
#> SRR1818622 1 0.492 0.128 0.576 0.000 0.424 0.000
#> SRR1818625 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818626 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818623 4 0.147 0.913 0.000 0.000 0.052 0.948
#> SRR1818624 4 0.147 0.913 0.000 0.000 0.052 0.948
#> SRR1818619 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818620 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818617 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818618 2 0.000 0.933 0.000 1.000 0.000 0.000
#> SRR1818615 4 0.000 0.882 0.000 0.000 0.000 1.000
#> SRR1818616 4 0.000 0.882 0.000 0.000 0.000 1.000
#> SRR1818609 4 0.147 0.913 0.000 0.000 0.052 0.948
#> SRR1818610 4 0.147 0.913 0.000 0.000 0.052 0.948
#> SRR1818607 2 0.302 0.865 0.000 0.852 0.000 0.148
#> SRR1818608 2 0.302 0.865 0.000 0.852 0.000 0.148
#> SRR1818613 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818614 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818611 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818612 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818605 1 0.000 0.947 1.000 0.000 0.000 0.000
#> SRR1818606 1 0.000 0.947 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
#> SRR1818631 3 0.534 1.0000 0.000 0.000 0.628 0.288 0.084
#> SRR1818632 3 0.534 1.0000 0.000 0.000 0.628 0.288 0.084
#> SRR1818679 1 0.051 0.8123 0.984 0.000 0.016 0.000 0.000
#> SRR1818680 1 0.051 0.8123 0.984 0.000 0.016 0.000 0.000
#> SRR1818677 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818678 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818675 1 0.790 -0.0706 0.412 0.000 0.232 0.268 0.088
#> SRR1818676 1 0.790 -0.0706 0.412 0.000 0.232 0.268 0.088
#> SRR1818673 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818674 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818671 5 0.218 0.7493 0.000 0.112 0.000 0.000 0.888
#> SRR1818672 5 0.252 0.7790 0.000 0.140 0.000 0.000 0.860
#> SRR1818661 3 0.534 1.0000 0.000 0.000 0.628 0.288 0.084
#> SRR1818662 3 0.534 1.0000 0.000 0.000 0.628 0.288 0.084
#> SRR1818655 1 0.425 0.6957 0.624 0.004 0.372 0.000 0.000
#> SRR1818656 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818653 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818654 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818651 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818652 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818657 1 0.088 0.8149 0.968 0.000 0.032 0.000 0.000
#> SRR1818658 1 0.403 0.7075 0.648 0.000 0.352 0.000 0.000
#> SRR1818649 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818650 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818659 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818647 4 0.361 0.9760 0.000 0.000 0.000 0.732 0.268
#> SRR1818648 4 0.361 0.9760 0.000 0.000 0.000 0.732 0.268
#> SRR1818645 5 0.364 0.8528 0.000 0.272 0.000 0.000 0.728
#> SRR1818646 5 0.364 0.8528 0.000 0.272 0.000 0.000 0.728
#> SRR1818639 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818640 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818637 4 0.373 0.9919 0.000 0.000 0.000 0.712 0.288
#> SRR1818638 4 0.373 0.9919 0.000 0.000 0.000 0.712 0.288
#> SRR1818635 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818636 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818643 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818644 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818641 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818642 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818633 1 0.051 0.8123 0.984 0.000 0.016 0.000 0.000
#> SRR1818634 1 0.051 0.8123 0.984 0.000 0.016 0.000 0.000
#> SRR1818665 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818666 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818667 5 0.366 0.8496 0.000 0.276 0.000 0.000 0.724
#> SRR1818668 5 0.366 0.8496 0.000 0.276 0.000 0.000 0.724
#> SRR1818669 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818670 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818663 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818664 1 0.410 0.6992 0.628 0.000 0.372 0.000 0.000
#> SRR1818629 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818630 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818627 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818628 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818621 1 0.521 0.5249 0.696 0.000 0.200 0.096 0.008
#> SRR1818622 1 0.475 0.5796 0.736 0.000 0.184 0.072 0.008
#> SRR1818625 1 0.293 0.7735 0.820 0.000 0.180 0.000 0.000
#> SRR1818626 1 0.289 0.7747 0.824 0.000 0.176 0.000 0.000
#> SRR1818623 4 0.373 0.9919 0.000 0.000 0.000 0.712 0.288
#> SRR1818624 4 0.373 0.9919 0.000 0.000 0.000 0.712 0.288
#> SRR1818619 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818620 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818617 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818618 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1818615 5 0.218 0.5168 0.000 0.000 0.000 0.112 0.888
#> SRR1818616 5 0.179 0.5614 0.000 0.000 0.000 0.084 0.916
#> SRR1818609 4 0.373 0.9919 0.000 0.000 0.000 0.712 0.288
#> SRR1818610 4 0.373 0.9919 0.000 0.000 0.000 0.712 0.288
#> SRR1818607 5 0.364 0.8528 0.000 0.272 0.000 0.000 0.728
#> SRR1818608 5 0.364 0.8528 0.000 0.272 0.000 0.000 0.728
#> SRR1818613 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818614 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818611 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818612 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818605 1 0.000 0.8198 1.000 0.000 0.000 0.000 0.000
#> SRR1818606 1 0.000 0.8198 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
#> SRR1818631 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818632 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818679 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818680 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818677 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818678 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818675 5 0.3833 0.228 0.000 0.000 0.444 0.000 0.556 0.000
#> SRR1818676 5 0.3833 0.228 0.000 0.000 0.444 0.000 0.556 0.000
#> SRR1818673 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818674 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818671 6 0.0000 0.981 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818672 6 0.0000 0.981 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818661 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818662 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1818655 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818656 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818653 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818654 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818651 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818652 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818657 5 0.3151 0.621 0.252 0.000 0.000 0.000 0.748 0.000
#> SRR1818658 1 0.2883 0.703 0.788 0.000 0.000 0.000 0.212 0.000
#> SRR1818649 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818650 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818659 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818647 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818648 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818645 6 0.0000 0.981 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818646 6 0.0000 0.981 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818639 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818640 1 0.0547 0.928 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1818637 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818638 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818635 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818636 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818643 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818644 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818641 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818642 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818633 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818634 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818665 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818666 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818667 6 0.0146 0.979 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1818668 6 0.0146 0.979 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1818669 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818670 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818663 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818664 1 0.0363 0.934 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1818629 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818630 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818627 5 0.3727 0.323 0.388 0.000 0.000 0.000 0.612 0.000
#> SRR1818628 5 0.3727 0.323 0.388 0.000 0.000 0.000 0.612 0.000
#> SRR1818621 5 0.2266 0.801 0.012 0.000 0.108 0.000 0.880 0.000
#> SRR1818622 5 0.1913 0.828 0.012 0.000 0.080 0.000 0.908 0.000
#> SRR1818625 1 0.2854 0.735 0.792 0.000 0.000 0.000 0.208 0.000
#> SRR1818626 1 0.2883 0.730 0.788 0.000 0.000 0.000 0.212 0.000
#> SRR1818623 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818624 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818619 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818620 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818617 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818618 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1818615 6 0.2135 0.849 0.000 0.000 0.000 0.128 0.000 0.872
#> SRR1818616 6 0.0363 0.973 0.000 0.000 0.000 0.012 0.000 0.988
#> SRR1818609 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818610 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1818607 6 0.0000 0.981 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818608 6 0.0000 0.981 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1818613 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818614 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818611 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818612 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818605 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1818606 5 0.0000 0.899 0.000 0.000 0.000 0.000 1.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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.289 0.614 0.772 0.3668 0.514 0.514
#> 3 3 0.530 0.793 0.890 0.6102 0.621 0.433
#> 4 4 0.610 0.691 0.812 0.2186 0.627 0.314
#> 5 5 0.701 0.745 0.847 0.0349 0.991 0.968
#> 6 6 0.595 0.598 0.736 0.0600 0.874 0.560
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
#> SRR1818631 2 0.482 0.429 0.104 0.896
#> SRR1818632 2 0.482 0.429 0.104 0.896
#> SRR1818679 2 0.981 0.693 0.420 0.580
#> SRR1818680 2 0.983 0.688 0.424 0.576
#> SRR1818677 1 0.925 0.330 0.660 0.340
#> SRR1818678 1 0.925 0.330 0.660 0.340
#> SRR1818675 2 0.997 0.609 0.468 0.532
#> SRR1818676 2 0.997 0.609 0.468 0.532
#> SRR1818673 2 0.983 0.645 0.424 0.576
#> SRR1818674 1 1.000 -0.393 0.508 0.492
#> SRR1818671 2 0.949 0.761 0.368 0.632
#> SRR1818672 2 0.949 0.761 0.368 0.632
#> SRR1818661 2 0.482 0.429 0.104 0.896
#> SRR1818662 2 0.482 0.429 0.104 0.896
#> SRR1818655 1 0.000 0.777 1.000 0.000
#> SRR1818656 1 0.000 0.777 1.000 0.000
#> SRR1818653 1 0.000 0.777 1.000 0.000
#> SRR1818654 1 0.000 0.777 1.000 0.000
#> SRR1818651 1 0.000 0.777 1.000 0.000
#> SRR1818652 1 0.000 0.777 1.000 0.000
#> SRR1818657 1 0.000 0.777 1.000 0.000
#> SRR1818658 1 0.000 0.777 1.000 0.000
#> SRR1818649 1 0.000 0.777 1.000 0.000
#> SRR1818650 1 0.000 0.777 1.000 0.000
#> SRR1818659 1 0.000 0.777 1.000 0.000
#> SRR1818647 2 0.949 0.761 0.368 0.632
#> SRR1818648 2 0.949 0.761 0.368 0.632
#> SRR1818645 2 0.949 0.761 0.368 0.632
#> SRR1818646 2 0.949 0.761 0.368 0.632
#> SRR1818639 1 0.000 0.777 1.000 0.000
#> SRR1818640 1 0.000 0.777 1.000 0.000
#> SRR1818637 2 0.949 0.761 0.368 0.632
#> SRR1818638 2 0.949 0.761 0.368 0.632
#> SRR1818635 1 0.921 0.342 0.664 0.336
#> SRR1818636 1 0.921 0.342 0.664 0.336
#> SRR1818643 1 0.921 0.342 0.664 0.336
#> SRR1818644 1 0.921 0.342 0.664 0.336
#> SRR1818641 1 0.921 0.342 0.664 0.336
#> SRR1818642 1 0.921 0.342 0.664 0.336
#> SRR1818633 1 1.000 -0.510 0.504 0.496
#> SRR1818634 2 0.999 0.562 0.480 0.520
#> SRR1818665 1 0.000 0.777 1.000 0.000
#> SRR1818666 1 0.000 0.777 1.000 0.000
#> SRR1818667 2 0.949 0.761 0.368 0.632
#> SRR1818668 2 0.949 0.761 0.368 0.632
#> SRR1818669 1 0.000 0.777 1.000 0.000
#> SRR1818670 1 0.000 0.777 1.000 0.000
#> SRR1818663 1 0.000 0.777 1.000 0.000
#> SRR1818664 1 0.000 0.777 1.000 0.000
#> SRR1818629 1 0.921 0.342 0.664 0.336
#> SRR1818630 1 0.921 0.342 0.664 0.336
#> SRR1818627 1 0.000 0.777 1.000 0.000
#> SRR1818628 1 0.000 0.777 1.000 0.000
#> SRR1818621 2 0.925 0.170 0.340 0.660
#> SRR1818622 2 0.925 0.170 0.340 0.660
#> SRR1818625 1 0.000 0.777 1.000 0.000
#> SRR1818626 1 0.000 0.777 1.000 0.000
#> SRR1818623 2 0.949 0.761 0.368 0.632
#> SRR1818624 2 0.949 0.761 0.368 0.632
#> SRR1818619 1 0.866 0.402 0.712 0.288
#> SRR1818620 1 0.866 0.402 0.712 0.288
#> SRR1818617 1 0.925 0.330 0.660 0.340
#> SRR1818618 1 0.925 0.330 0.660 0.340
#> SRR1818615 2 0.949 0.761 0.368 0.632
#> SRR1818616 2 0.949 0.761 0.368 0.632
#> SRR1818609 2 0.949 0.761 0.368 0.632
#> SRR1818610 2 0.949 0.761 0.368 0.632
#> SRR1818607 2 0.949 0.761 0.368 0.632
#> SRR1818608 2 0.949 0.761 0.368 0.632
#> SRR1818613 1 0.000 0.777 1.000 0.000
#> SRR1818614 1 0.000 0.777 1.000 0.000
#> SRR1818611 1 0.000 0.777 1.000 0.000
#> SRR1818612 1 0.000 0.777 1.000 0.000
#> SRR1818605 1 0.000 0.777 1.000 0.000
#> SRR1818606 1 0.000 0.777 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.0424 0.92426 0.000 0.008 0.992
#> SRR1818632 3 0.0424 0.92426 0.000 0.008 0.992
#> SRR1818679 2 0.7072 0.72129 0.160 0.724 0.116
#> SRR1818680 2 0.6960 0.72903 0.152 0.732 0.116
#> SRR1818677 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818678 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818675 3 0.4099 0.80923 0.140 0.008 0.852
#> SRR1818676 3 0.4099 0.80923 0.140 0.008 0.852
#> SRR1818673 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818674 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818671 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818672 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818661 3 0.0424 0.92426 0.000 0.008 0.992
#> SRR1818662 3 0.0424 0.92426 0.000 0.008 0.992
#> SRR1818655 2 0.4842 0.67337 0.224 0.776 0.000
#> SRR1818656 2 0.4842 0.67337 0.224 0.776 0.000
#> SRR1818653 1 0.0424 0.90628 0.992 0.008 0.000
#> SRR1818654 1 0.0424 0.90628 0.992 0.008 0.000
#> SRR1818651 2 0.6111 0.47742 0.396 0.604 0.000
#> SRR1818652 2 0.6225 0.37998 0.432 0.568 0.000
#> SRR1818657 2 0.5404 0.73407 0.256 0.740 0.004
#> SRR1818658 2 0.5443 0.73166 0.260 0.736 0.004
#> SRR1818649 2 0.5835 0.55513 0.340 0.660 0.000
#> SRR1818650 2 0.5810 0.56097 0.336 0.664 0.000
#> SRR1818659 2 0.4842 0.67337 0.224 0.776 0.000
#> SRR1818647 3 0.1163 0.93170 0.000 0.028 0.972
#> SRR1818648 3 0.1163 0.93170 0.000 0.028 0.972
#> SRR1818645 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818646 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818639 2 0.6302 -0.01468 0.480 0.520 0.000
#> SRR1818640 1 0.6309 0.00577 0.500 0.500 0.000
#> SRR1818637 3 0.1163 0.93170 0.000 0.028 0.972
#> SRR1818638 3 0.1163 0.93170 0.000 0.028 0.972
#> SRR1818635 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818636 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818643 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818644 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818641 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818642 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818633 2 0.6037 0.77350 0.100 0.788 0.112
#> SRR1818634 2 0.6460 0.75782 0.124 0.764 0.112
#> SRR1818665 2 0.4465 0.78440 0.176 0.820 0.004
#> SRR1818666 2 0.4465 0.78440 0.176 0.820 0.004
#> SRR1818667 2 0.4178 0.75934 0.000 0.828 0.172
#> SRR1818668 2 0.4178 0.75934 0.000 0.828 0.172
#> SRR1818669 1 0.0424 0.90628 0.992 0.008 0.000
#> SRR1818670 1 0.0424 0.90628 0.992 0.008 0.000
#> SRR1818663 2 0.5115 0.75802 0.228 0.768 0.004
#> SRR1818664 2 0.4629 0.78625 0.188 0.808 0.004
#> SRR1818629 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818630 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818627 2 0.5690 0.69953 0.288 0.708 0.004
#> SRR1818628 2 0.5553 0.71723 0.272 0.724 0.004
#> SRR1818621 1 0.1163 0.88618 0.972 0.000 0.028
#> SRR1818622 1 0.1163 0.88618 0.972 0.000 0.028
#> SRR1818625 2 0.1647 0.83976 0.036 0.960 0.004
#> SRR1818626 2 0.1765 0.83929 0.040 0.956 0.004
#> SRR1818623 3 0.1163 0.93170 0.000 0.028 0.972
#> SRR1818624 3 0.1163 0.93170 0.000 0.028 0.972
#> SRR1818619 2 0.4178 0.78676 0.172 0.828 0.000
#> SRR1818620 2 0.4178 0.78676 0.172 0.828 0.000
#> SRR1818617 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818618 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818615 3 0.5016 0.69747 0.000 0.240 0.760
#> SRR1818616 3 0.5016 0.69747 0.000 0.240 0.760
#> SRR1818609 3 0.1163 0.93170 0.000 0.028 0.972
#> SRR1818610 3 0.1163 0.93170 0.000 0.028 0.972
#> SRR1818607 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818608 2 0.0000 0.84811 0.000 1.000 0.000
#> SRR1818613 1 0.0424 0.90628 0.992 0.008 0.000
#> SRR1818614 1 0.0424 0.90628 0.992 0.008 0.000
#> SRR1818611 1 0.3941 0.78166 0.844 0.156 0.000
#> SRR1818612 1 0.3941 0.78166 0.844 0.156 0.000
#> SRR1818605 1 0.0661 0.90441 0.988 0.008 0.004
#> SRR1818606 1 0.0661 0.90441 0.988 0.008 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.4898 0.340 0.000 0.000 0.584 0.416
#> SRR1818632 3 0.4898 0.340 0.000 0.000 0.584 0.416
#> SRR1818679 3 0.2732 0.750 0.076 0.008 0.904 0.012
#> SRR1818680 3 0.2790 0.751 0.072 0.012 0.904 0.012
#> SRR1818677 2 0.2408 0.810 0.000 0.896 0.104 0.000
#> SRR1818678 2 0.2469 0.807 0.000 0.892 0.108 0.000
#> SRR1818675 3 0.2662 0.743 0.084 0.000 0.900 0.016
#> SRR1818676 3 0.2706 0.745 0.080 0.000 0.900 0.020
#> SRR1818673 2 0.0336 0.823 0.000 0.992 0.008 0.000
#> SRR1818674 2 0.0336 0.823 0.000 0.992 0.008 0.000
#> SRR1818671 2 0.5571 0.119 0.000 0.580 0.024 0.396
#> SRR1818672 2 0.5560 0.123 0.000 0.584 0.024 0.392
#> SRR1818661 3 0.4331 0.484 0.000 0.000 0.712 0.288
#> SRR1818662 3 0.4331 0.484 0.000 0.000 0.712 0.288
#> SRR1818655 1 0.5050 0.397 0.588 0.408 0.004 0.000
#> SRR1818656 1 0.5050 0.397 0.588 0.408 0.004 0.000
#> SRR1818653 1 0.1557 0.877 0.944 0.000 0.056 0.000
#> SRR1818654 1 0.1474 0.878 0.948 0.000 0.052 0.000
#> SRR1818651 1 0.1109 0.882 0.968 0.000 0.028 0.004
#> SRR1818652 1 0.1109 0.882 0.968 0.000 0.028 0.004
#> SRR1818657 1 0.1109 0.882 0.968 0.000 0.028 0.004
#> SRR1818658 1 0.1191 0.883 0.968 0.004 0.024 0.004
#> SRR1818649 1 0.0592 0.881 0.984 0.016 0.000 0.000
#> SRR1818650 1 0.0592 0.881 0.984 0.016 0.000 0.000
#> SRR1818659 1 0.5853 0.256 0.508 0.460 0.032 0.000
#> SRR1818647 4 0.4955 0.139 0.000 0.000 0.444 0.556
#> SRR1818648 4 0.4955 0.139 0.000 0.000 0.444 0.556
#> SRR1818645 2 0.1970 0.802 0.000 0.932 0.008 0.060
#> SRR1818646 2 0.1970 0.802 0.000 0.932 0.008 0.060
#> SRR1818639 1 0.4313 0.659 0.736 0.260 0.004 0.000
#> SRR1818640 1 0.4313 0.659 0.736 0.260 0.004 0.000
#> SRR1818637 4 0.4088 0.634 0.000 0.140 0.040 0.820
#> SRR1818638 4 0.4088 0.634 0.000 0.140 0.040 0.820
#> SRR1818635 2 0.3047 0.811 0.000 0.872 0.116 0.012
#> SRR1818636 2 0.3047 0.811 0.000 0.872 0.116 0.012
#> SRR1818643 2 0.1584 0.831 0.000 0.952 0.036 0.012
#> SRR1818644 2 0.1584 0.831 0.000 0.952 0.036 0.012
#> SRR1818641 2 0.3047 0.811 0.000 0.872 0.116 0.012
#> SRR1818642 2 0.3047 0.811 0.000 0.872 0.116 0.012
#> SRR1818633 3 0.2954 0.751 0.064 0.008 0.900 0.028
#> SRR1818634 3 0.2975 0.749 0.060 0.008 0.900 0.032
#> SRR1818665 1 0.3938 0.838 0.848 0.084 0.064 0.004
#> SRR1818666 1 0.4004 0.835 0.844 0.088 0.064 0.004
#> SRR1818667 4 0.7159 0.536 0.000 0.244 0.200 0.556
#> SRR1818668 4 0.7182 0.532 0.000 0.248 0.200 0.552
#> SRR1818669 1 0.3862 0.811 0.824 0.024 0.152 0.000
#> SRR1818670 1 0.2813 0.863 0.896 0.024 0.080 0.000
#> SRR1818663 1 0.1847 0.876 0.940 0.004 0.052 0.004
#> SRR1818664 1 0.1847 0.876 0.940 0.004 0.052 0.004
#> SRR1818629 2 0.3047 0.811 0.000 0.872 0.116 0.012
#> SRR1818630 2 0.3047 0.811 0.000 0.872 0.116 0.012
#> SRR1818627 1 0.1109 0.882 0.968 0.000 0.028 0.004
#> SRR1818628 1 0.1109 0.882 0.968 0.000 0.028 0.004
#> SRR1818621 4 0.7344 0.206 0.300 0.000 0.188 0.512
#> SRR1818622 4 0.7344 0.206 0.300 0.000 0.188 0.512
#> SRR1818625 1 0.1707 0.883 0.952 0.024 0.020 0.004
#> SRR1818626 1 0.1707 0.883 0.952 0.024 0.020 0.004
#> SRR1818623 4 0.3726 0.507 0.000 0.000 0.212 0.788
#> SRR1818624 4 0.3726 0.507 0.000 0.000 0.212 0.788
#> SRR1818619 3 0.4190 0.660 0.032 0.148 0.816 0.004
#> SRR1818620 3 0.4190 0.660 0.032 0.148 0.816 0.004
#> SRR1818617 2 0.3801 0.685 0.000 0.780 0.220 0.000
#> SRR1818618 2 0.3801 0.685 0.000 0.780 0.220 0.000
#> SRR1818615 4 0.6570 0.594 0.000 0.204 0.164 0.632
#> SRR1818616 4 0.6407 0.601 0.000 0.204 0.148 0.648
#> SRR1818609 4 0.4050 0.634 0.000 0.144 0.036 0.820
#> SRR1818610 4 0.4050 0.634 0.000 0.144 0.036 0.820
#> SRR1818607 2 0.2142 0.802 0.000 0.928 0.016 0.056
#> SRR1818608 2 0.2142 0.802 0.000 0.928 0.016 0.056
#> SRR1818613 1 0.1211 0.878 0.960 0.000 0.040 0.000
#> SRR1818614 1 0.1211 0.878 0.960 0.000 0.040 0.000
#> SRR1818611 1 0.1406 0.879 0.960 0.024 0.016 0.000
#> SRR1818612 1 0.1406 0.879 0.960 0.024 0.016 0.000
#> SRR1818605 1 0.1716 0.862 0.936 0.000 0.064 0.000
#> SRR1818606 1 0.1716 0.862 0.936 0.000 0.064 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.3612 0.587 0.000 0.000 0.800 0.172 0.028
#> SRR1818632 3 0.3612 0.587 0.000 0.000 0.800 0.172 0.028
#> SRR1818679 3 0.3430 0.708 0.220 0.000 0.776 0.004 0.000
#> SRR1818680 3 0.3461 0.707 0.224 0.000 0.772 0.004 0.000
#> SRR1818677 2 0.1356 0.904 0.000 0.956 0.028 0.012 0.004
#> SRR1818678 2 0.1356 0.904 0.000 0.956 0.028 0.012 0.004
#> SRR1818675 3 0.1329 0.669 0.032 0.000 0.956 0.008 0.004
#> SRR1818676 3 0.1329 0.669 0.032 0.000 0.956 0.008 0.004
#> SRR1818673 2 0.0898 0.909 0.000 0.972 0.008 0.020 0.000
#> SRR1818674 2 0.0898 0.909 0.000 0.972 0.008 0.020 0.000
#> SRR1818671 2 0.5307 0.381 0.000 0.616 0.028 0.332 0.024
#> SRR1818672 2 0.5307 0.381 0.000 0.616 0.028 0.332 0.024
#> SRR1818661 3 0.3656 0.590 0.000 0.000 0.800 0.168 0.032
#> SRR1818662 3 0.3656 0.590 0.000 0.000 0.800 0.168 0.032
#> SRR1818655 1 0.4569 0.735 0.748 0.104 0.000 0.000 0.148
#> SRR1818656 1 0.4569 0.735 0.748 0.104 0.000 0.000 0.148
#> SRR1818653 1 0.2426 0.827 0.900 0.000 0.036 0.000 0.064
#> SRR1818654 1 0.3012 0.804 0.860 0.000 0.036 0.000 0.104
#> SRR1818651 1 0.0510 0.853 0.984 0.000 0.000 0.000 0.016
#> SRR1818652 1 0.0510 0.853 0.984 0.000 0.000 0.000 0.016
#> SRR1818657 1 0.1408 0.853 0.948 0.008 0.000 0.000 0.044
#> SRR1818658 1 0.1331 0.853 0.952 0.008 0.000 0.000 0.040
#> SRR1818649 1 0.1764 0.847 0.928 0.008 0.000 0.000 0.064
#> SRR1818650 1 0.1764 0.847 0.928 0.008 0.000 0.000 0.064
#> SRR1818659 1 0.5481 0.596 0.660 0.232 0.008 0.000 0.100
#> SRR1818647 4 0.4985 0.420 0.000 0.008 0.452 0.524 0.016
#> SRR1818648 4 0.4985 0.420 0.000 0.008 0.452 0.524 0.016
#> SRR1818645 2 0.1815 0.899 0.000 0.940 0.016 0.020 0.024
#> SRR1818646 2 0.1815 0.899 0.000 0.940 0.016 0.020 0.024
#> SRR1818639 1 0.3527 0.773 0.804 0.024 0.000 0.000 0.172
#> SRR1818640 1 0.3476 0.772 0.804 0.020 0.000 0.000 0.176
#> SRR1818637 4 0.1851 0.559 0.000 0.000 0.000 0.912 0.088
#> SRR1818638 4 0.1851 0.559 0.000 0.000 0.000 0.912 0.088
#> SRR1818635 2 0.0510 0.912 0.000 0.984 0.000 0.000 0.016
#> SRR1818636 2 0.0510 0.912 0.000 0.984 0.000 0.000 0.016
#> SRR1818643 2 0.1018 0.909 0.000 0.968 0.016 0.000 0.016
#> SRR1818644 2 0.1018 0.909 0.000 0.968 0.016 0.000 0.016
#> SRR1818641 2 0.0510 0.912 0.000 0.984 0.000 0.000 0.016
#> SRR1818642 2 0.0510 0.912 0.000 0.984 0.000 0.000 0.016
#> SRR1818633 3 0.3461 0.707 0.224 0.000 0.772 0.004 0.000
#> SRR1818634 3 0.3461 0.707 0.224 0.000 0.772 0.004 0.000
#> SRR1818665 1 0.2374 0.846 0.912 0.016 0.020 0.000 0.052
#> SRR1818666 1 0.2374 0.846 0.912 0.016 0.020 0.000 0.052
#> SRR1818667 4 0.5114 0.519 0.000 0.340 0.052 0.608 0.000
#> SRR1818668 4 0.5114 0.519 0.000 0.340 0.052 0.608 0.000
#> SRR1818669 1 0.5648 0.372 0.568 0.028 0.368 0.000 0.036
#> SRR1818670 1 0.5648 0.372 0.568 0.028 0.368 0.000 0.036
#> SRR1818663 1 0.1914 0.851 0.928 0.008 0.008 0.000 0.056
#> SRR1818664 1 0.1843 0.852 0.932 0.008 0.008 0.000 0.052
#> SRR1818629 2 0.0510 0.912 0.000 0.984 0.000 0.000 0.016
#> SRR1818630 2 0.0510 0.912 0.000 0.984 0.000 0.000 0.016
#> SRR1818627 1 0.1792 0.854 0.916 0.000 0.000 0.000 0.084
#> SRR1818628 1 0.1478 0.855 0.936 0.000 0.000 0.000 0.064
#> SRR1818621 5 0.2300 1.000 0.000 0.000 0.040 0.052 0.908
#> SRR1818622 5 0.2300 1.000 0.000 0.000 0.040 0.052 0.908
#> SRR1818625 1 0.2376 0.848 0.904 0.044 0.000 0.000 0.052
#> SRR1818626 1 0.2221 0.851 0.912 0.036 0.000 0.000 0.052
#> SRR1818623 4 0.3966 0.613 0.000 0.008 0.224 0.756 0.012
#> SRR1818624 4 0.3966 0.613 0.000 0.008 0.224 0.756 0.012
#> SRR1818619 3 0.4207 0.688 0.204 0.028 0.760 0.004 0.004
#> SRR1818620 3 0.4207 0.688 0.204 0.028 0.760 0.004 0.004
#> SRR1818617 2 0.2429 0.867 0.000 0.900 0.076 0.020 0.004
#> SRR1818618 2 0.2304 0.870 0.000 0.908 0.068 0.020 0.004
#> SRR1818615 4 0.4809 0.580 0.000 0.296 0.036 0.664 0.004
#> SRR1818616 4 0.4577 0.578 0.000 0.296 0.024 0.676 0.004
#> SRR1818609 4 0.0162 0.611 0.000 0.000 0.000 0.996 0.004
#> SRR1818610 4 0.0162 0.611 0.000 0.000 0.000 0.996 0.004
#> SRR1818607 2 0.2434 0.888 0.000 0.912 0.024 0.040 0.024
#> SRR1818608 2 0.2434 0.888 0.000 0.912 0.024 0.040 0.024
#> SRR1818613 1 0.0771 0.853 0.976 0.000 0.004 0.000 0.020
#> SRR1818614 1 0.0771 0.853 0.976 0.000 0.004 0.000 0.020
#> SRR1818611 1 0.5045 0.558 0.620 0.032 0.008 0.000 0.340
#> SRR1818612 1 0.5045 0.558 0.620 0.032 0.008 0.000 0.340
#> SRR1818605 1 0.1915 0.841 0.928 0.000 0.040 0.000 0.032
#> SRR1818606 1 0.1915 0.841 0.928 0.000 0.040 0.000 0.032
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.4155 0.5582 0.016 0.000 0.748 0.036 0.004 0.196
#> SRR1818632 3 0.4155 0.5582 0.016 0.000 0.748 0.036 0.004 0.196
#> SRR1818679 3 0.2932 0.7812 0.140 0.000 0.836 0.004 0.020 0.000
#> SRR1818680 3 0.2932 0.7812 0.140 0.000 0.836 0.004 0.020 0.000
#> SRR1818677 2 0.0551 0.7569 0.004 0.984 0.008 0.004 0.000 0.000
#> SRR1818678 2 0.0551 0.7569 0.004 0.984 0.008 0.004 0.000 0.000
#> SRR1818675 3 0.3060 0.7777 0.132 0.000 0.836 0.020 0.012 0.000
#> SRR1818676 3 0.3060 0.7777 0.132 0.000 0.836 0.020 0.012 0.000
#> SRR1818673 2 0.5210 0.4270 0.004 0.680 0.096 0.196 0.008 0.016
#> SRR1818674 2 0.5210 0.4270 0.004 0.680 0.096 0.196 0.008 0.016
#> SRR1818671 4 0.5349 0.2838 0.004 0.452 0.048 0.476 0.000 0.020
#> SRR1818672 4 0.5349 0.2838 0.004 0.452 0.048 0.476 0.000 0.020
#> SRR1818661 3 0.4016 0.5592 0.016 0.000 0.752 0.036 0.000 0.196
#> SRR1818662 3 0.4016 0.5592 0.016 0.000 0.752 0.036 0.000 0.196
#> SRR1818655 5 0.4299 0.4255 0.040 0.308 0.000 0.000 0.652 0.000
#> SRR1818656 5 0.4282 0.4280 0.040 0.304 0.000 0.000 0.656 0.000
#> SRR1818653 5 0.4961 0.1107 0.348 0.000 0.080 0.000 0.572 0.000
#> SRR1818654 5 0.5071 0.1228 0.340 0.000 0.080 0.000 0.576 0.004
#> SRR1818651 1 0.3489 0.7945 0.708 0.000 0.000 0.000 0.288 0.004
#> SRR1818652 1 0.3508 0.7924 0.704 0.000 0.000 0.000 0.292 0.004
#> SRR1818657 1 0.3645 0.8074 0.740 0.024 0.000 0.000 0.236 0.000
#> SRR1818658 1 0.4330 0.7521 0.696 0.068 0.000 0.000 0.236 0.000
#> SRR1818649 5 0.6103 -0.0659 0.320 0.244 0.000 0.000 0.432 0.004
#> SRR1818650 5 0.6103 -0.0659 0.320 0.244 0.000 0.000 0.432 0.004
#> SRR1818659 2 0.4701 -0.0905 0.036 0.524 0.004 0.000 0.436 0.000
#> SRR1818647 4 0.5392 0.4801 0.012 0.000 0.284 0.592 0.000 0.112
#> SRR1818648 4 0.5392 0.4801 0.012 0.000 0.284 0.592 0.000 0.112
#> SRR1818645 2 0.2537 0.7145 0.000 0.880 0.008 0.088 0.000 0.024
#> SRR1818646 2 0.2537 0.7145 0.000 0.880 0.008 0.088 0.000 0.024
#> SRR1818639 5 0.4316 0.4228 0.040 0.312 0.000 0.000 0.648 0.000
#> SRR1818640 5 0.4299 0.4257 0.040 0.308 0.000 0.000 0.652 0.000
#> SRR1818637 4 0.0632 0.6221 0.000 0.000 0.000 0.976 0.000 0.024
#> SRR1818638 4 0.0632 0.6221 0.000 0.000 0.000 0.976 0.000 0.024
#> SRR1818635 2 0.3245 0.7613 0.184 0.796 0.000 0.000 0.016 0.004
#> SRR1818636 2 0.3245 0.7613 0.184 0.796 0.000 0.000 0.016 0.004
#> SRR1818643 2 0.5073 0.7025 0.172 0.692 0.112 0.000 0.012 0.012
#> SRR1818644 2 0.5073 0.7025 0.172 0.692 0.112 0.000 0.012 0.012
#> SRR1818641 2 0.3245 0.7613 0.184 0.796 0.000 0.000 0.016 0.004
#> SRR1818642 2 0.3245 0.7613 0.184 0.796 0.000 0.000 0.016 0.004
#> SRR1818633 3 0.2932 0.7812 0.140 0.000 0.836 0.004 0.020 0.000
#> SRR1818634 3 0.2932 0.7812 0.140 0.000 0.836 0.004 0.020 0.000
#> SRR1818665 1 0.2823 0.8012 0.796 0.000 0.000 0.000 0.204 0.000
#> SRR1818666 1 0.2823 0.8012 0.796 0.000 0.000 0.000 0.204 0.000
#> SRR1818667 4 0.4834 0.6375 0.000 0.224 0.120 0.656 0.000 0.000
#> SRR1818668 4 0.4834 0.6375 0.000 0.224 0.120 0.656 0.000 0.000
#> SRR1818669 3 0.6691 0.5351 0.244 0.068 0.520 0.000 0.160 0.008
#> SRR1818670 3 0.6691 0.5351 0.244 0.068 0.520 0.000 0.160 0.008
#> SRR1818663 1 0.3192 0.7924 0.776 0.004 0.004 0.000 0.216 0.000
#> SRR1818664 1 0.2883 0.7968 0.788 0.000 0.000 0.000 0.212 0.000
#> SRR1818629 2 0.3245 0.7613 0.184 0.796 0.000 0.000 0.016 0.004
#> SRR1818630 2 0.3245 0.7613 0.184 0.796 0.000 0.000 0.016 0.004
#> SRR1818627 1 0.3650 0.8016 0.716 0.008 0.004 0.000 0.272 0.000
#> SRR1818628 1 0.3628 0.8043 0.720 0.004 0.008 0.000 0.268 0.000
#> SRR1818621 6 0.3297 1.0000 0.008 0.000 0.020 0.064 0.056 0.852
#> SRR1818622 6 0.3297 1.0000 0.008 0.000 0.020 0.064 0.056 0.852
#> SRR1818625 1 0.5851 0.3784 0.476 0.220 0.000 0.000 0.304 0.000
#> SRR1818626 1 0.5862 0.3676 0.468 0.216 0.000 0.000 0.316 0.000
#> SRR1818623 4 0.4174 0.6083 0.000 0.000 0.184 0.732 0.000 0.084
#> SRR1818624 4 0.4174 0.6083 0.000 0.000 0.184 0.732 0.000 0.084
#> SRR1818619 3 0.4550 0.7629 0.140 0.036 0.768 0.024 0.024 0.008
#> SRR1818620 3 0.4550 0.7629 0.140 0.036 0.768 0.024 0.024 0.008
#> SRR1818617 2 0.2510 0.7120 0.000 0.872 0.100 0.028 0.000 0.000
#> SRR1818618 2 0.2412 0.7190 0.000 0.880 0.092 0.028 0.000 0.000
#> SRR1818615 4 0.3663 0.6626 0.004 0.180 0.040 0.776 0.000 0.000
#> SRR1818616 4 0.3663 0.6626 0.004 0.180 0.040 0.776 0.000 0.000
#> SRR1818609 4 0.0146 0.6292 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1818610 4 0.0146 0.6292 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1818607 2 0.3194 0.6418 0.000 0.808 0.004 0.168 0.000 0.020
#> SRR1818608 2 0.3194 0.6418 0.000 0.808 0.004 0.168 0.000 0.020
#> SRR1818613 5 0.4095 0.4133 0.216 0.000 0.060 0.000 0.724 0.000
#> SRR1818614 5 0.4095 0.4133 0.216 0.000 0.060 0.000 0.724 0.000
#> SRR1818611 5 0.1007 0.4712 0.016 0.004 0.004 0.000 0.968 0.008
#> SRR1818612 5 0.1007 0.4712 0.016 0.004 0.004 0.000 0.968 0.008
#> SRR1818605 5 0.4264 0.4275 0.196 0.000 0.084 0.000 0.720 0.000
#> SRR1818606 5 0.4264 0.4275 0.196 0.000 0.084 0.000 0.720 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", "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 15216 rows and 75 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.707 0.846 0.934 0.4237 0.604 0.604
#> 3 3 0.981 0.917 0.970 0.2825 0.792 0.674
#> 4 4 0.621 0.794 0.882 0.2282 0.816 0.620
#> 5 5 0.562 0.575 0.683 0.0938 0.858 0.590
#> 6 6 0.576 0.282 0.592 0.0609 0.805 0.419
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
#> SRR1818631 1 0.0000 0.914 1.000 0.000
#> SRR1818632 1 0.0000 0.914 1.000 0.000
#> SRR1818679 1 0.0000 0.914 1.000 0.000
#> SRR1818680 1 0.0000 0.914 1.000 0.000
#> SRR1818677 1 0.8763 0.629 0.704 0.296
#> SRR1818678 1 0.8713 0.636 0.708 0.292
#> SRR1818675 1 0.0000 0.914 1.000 0.000
#> SRR1818676 1 0.0000 0.914 1.000 0.000
#> SRR1818673 2 0.9732 0.220 0.404 0.596
#> SRR1818674 2 0.9732 0.220 0.404 0.596
#> SRR1818671 2 0.0000 0.949 0.000 1.000
#> SRR1818672 2 0.0000 0.949 0.000 1.000
#> SRR1818661 1 0.7219 0.705 0.800 0.200
#> SRR1818662 1 0.7219 0.705 0.800 0.200
#> SRR1818655 1 0.0376 0.912 0.996 0.004
#> SRR1818656 1 0.0376 0.912 0.996 0.004
#> SRR1818653 1 0.0000 0.914 1.000 0.000
#> SRR1818654 1 0.0000 0.914 1.000 0.000
#> SRR1818651 1 0.0000 0.914 1.000 0.000
#> SRR1818652 1 0.0000 0.914 1.000 0.000
#> SRR1818657 1 0.0000 0.914 1.000 0.000
#> SRR1818658 1 0.0000 0.914 1.000 0.000
#> SRR1818649 1 0.0000 0.914 1.000 0.000
#> SRR1818650 1 0.0000 0.914 1.000 0.000
#> SRR1818659 1 0.0000 0.914 1.000 0.000
#> SRR1818647 2 0.0672 0.944 0.008 0.992
#> SRR1818648 2 0.0672 0.944 0.008 0.992
#> SRR1818645 2 0.0000 0.949 0.000 1.000
#> SRR1818646 2 0.0000 0.949 0.000 1.000
#> SRR1818639 1 0.0376 0.912 0.996 0.004
#> SRR1818640 1 0.0376 0.912 0.996 0.004
#> SRR1818637 2 0.0000 0.949 0.000 1.000
#> SRR1818638 2 0.0000 0.949 0.000 1.000
#> SRR1818635 1 0.8327 0.674 0.736 0.264
#> SRR1818636 1 0.8443 0.664 0.728 0.272
#> SRR1818643 1 0.8955 0.603 0.688 0.312
#> SRR1818644 1 0.8661 0.642 0.712 0.288
#> SRR1818641 1 0.8144 0.689 0.748 0.252
#> SRR1818642 1 0.8267 0.679 0.740 0.260
#> SRR1818633 1 0.0000 0.914 1.000 0.000
#> SRR1818634 1 0.0000 0.914 1.000 0.000
#> SRR1818665 1 0.0000 0.914 1.000 0.000
#> SRR1818666 1 0.0000 0.914 1.000 0.000
#> SRR1818667 2 0.0000 0.949 0.000 1.000
#> SRR1818668 2 0.0000 0.949 0.000 1.000
#> SRR1818669 1 0.0000 0.914 1.000 0.000
#> SRR1818670 1 0.0000 0.914 1.000 0.000
#> SRR1818663 1 0.0000 0.914 1.000 0.000
#> SRR1818664 1 0.0000 0.914 1.000 0.000
#> SRR1818629 1 0.9922 0.283 0.552 0.448
#> SRR1818630 1 0.9795 0.375 0.584 0.416
#> SRR1818627 1 0.0000 0.914 1.000 0.000
#> SRR1818628 1 0.0000 0.914 1.000 0.000
#> SRR1818621 1 0.0000 0.914 1.000 0.000
#> SRR1818622 1 0.0000 0.914 1.000 0.000
#> SRR1818625 1 0.0000 0.914 1.000 0.000
#> SRR1818626 1 0.0000 0.914 1.000 0.000
#> SRR1818623 2 0.0672 0.944 0.008 0.992
#> SRR1818624 2 0.0672 0.944 0.008 0.992
#> SRR1818619 1 0.0376 0.912 0.996 0.004
#> SRR1818620 1 0.0376 0.912 0.996 0.004
#> SRR1818617 1 0.9000 0.596 0.684 0.316
#> SRR1818618 1 0.8713 0.636 0.708 0.292
#> SRR1818615 2 0.0000 0.949 0.000 1.000
#> SRR1818616 2 0.0000 0.949 0.000 1.000
#> SRR1818609 2 0.0000 0.949 0.000 1.000
#> SRR1818610 2 0.0000 0.949 0.000 1.000
#> SRR1818607 2 0.0000 0.949 0.000 1.000
#> SRR1818608 2 0.0000 0.949 0.000 1.000
#> SRR1818613 1 0.0000 0.914 1.000 0.000
#> SRR1818614 1 0.0000 0.914 1.000 0.000
#> SRR1818611 1 0.0000 0.914 1.000 0.000
#> SRR1818612 1 0.0000 0.914 1.000 0.000
#> SRR1818605 1 0.0000 0.914 1.000 0.000
#> SRR1818606 1 0.0000 0.914 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1818631 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1818632 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1818679 1 0.1860 0.923 0.948 0.000 0.052
#> SRR1818680 1 0.1163 0.949 0.972 0.000 0.028
#> SRR1818677 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818678 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818675 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1818676 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1818673 1 0.0892 0.956 0.980 0.020 0.000
#> SRR1818674 1 0.1031 0.952 0.976 0.024 0.000
#> SRR1818671 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818672 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818661 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1818662 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1818655 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818656 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818653 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818654 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818651 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818652 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818657 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818658 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818649 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818650 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818659 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818647 2 0.5397 0.626 0.000 0.720 0.280
#> SRR1818648 2 0.5560 0.591 0.000 0.700 0.300
#> SRR1818645 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818646 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818639 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818640 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818637 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818638 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818635 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818636 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818643 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818644 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818641 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818642 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818633 1 0.6252 0.102 0.556 0.000 0.444
#> SRR1818634 1 0.6244 0.117 0.560 0.000 0.440
#> SRR1818665 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818666 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818667 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818668 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818669 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818670 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818663 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818664 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818629 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818630 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818627 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818628 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818621 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1818622 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1818625 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818626 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818623 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818624 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818619 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818620 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818617 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818618 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818615 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818616 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818609 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818610 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818607 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818608 2 0.0000 0.964 0.000 1.000 0.000
#> SRR1818613 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818614 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818611 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818612 1 0.0000 0.976 1.000 0.000 0.000
#> SRR1818605 3 0.5835 0.520 0.340 0.000 0.660
#> SRR1818606 3 0.5835 0.520 0.340 0.000 0.660
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1818631 3 0.0188 0.8466 0.000 0.000 0.996 0.004
#> SRR1818632 3 0.0336 0.8459 0.000 0.000 0.992 0.008
#> SRR1818679 3 0.6179 0.4499 0.320 0.000 0.608 0.072
#> SRR1818680 1 0.6471 0.0799 0.512 0.000 0.416 0.072
#> SRR1818677 1 0.1297 0.8601 0.964 0.016 0.000 0.020
#> SRR1818678 1 0.1297 0.8601 0.964 0.016 0.000 0.020
#> SRR1818675 3 0.0000 0.8468 0.000 0.000 1.000 0.000
#> SRR1818676 3 0.0188 0.8463 0.004 0.000 0.996 0.000
#> SRR1818673 1 0.2401 0.8138 0.904 0.092 0.000 0.004
#> SRR1818674 1 0.2401 0.8138 0.904 0.092 0.000 0.004
#> SRR1818671 2 0.2053 0.8752 0.072 0.924 0.000 0.004
#> SRR1818672 2 0.2053 0.8752 0.072 0.924 0.000 0.004
#> SRR1818661 3 0.0000 0.8468 0.000 0.000 1.000 0.000
#> SRR1818662 3 0.0000 0.8468 0.000 0.000 1.000 0.000
#> SRR1818655 1 0.2281 0.8753 0.904 0.000 0.000 0.096
#> SRR1818656 1 0.2408 0.8724 0.896 0.000 0.000 0.104
#> SRR1818653 4 0.2647 0.8291 0.120 0.000 0.000 0.880
#> SRR1818654 4 0.2530 0.8270 0.112 0.000 0.000 0.888
#> SRR1818651 1 0.3873 0.7542 0.772 0.000 0.000 0.228
#> SRR1818652 1 0.4072 0.7224 0.748 0.000 0.000 0.252
#> SRR1818657 1 0.1867 0.8797 0.928 0.000 0.000 0.072
#> SRR1818658 1 0.2011 0.8789 0.920 0.000 0.000 0.080
#> SRR1818649 1 0.3649 0.8079 0.796 0.000 0.000 0.204
#> SRR1818650 1 0.3688 0.7961 0.792 0.000 0.000 0.208
#> SRR1818659 4 0.4999 -0.0172 0.492 0.000 0.000 0.508
#> SRR1818647 3 0.2216 0.8079 0.000 0.092 0.908 0.000
#> SRR1818648 3 0.2011 0.8151 0.000 0.080 0.920 0.000
#> SRR1818645 2 0.2867 0.8524 0.104 0.884 0.000 0.012
#> SRR1818646 2 0.3105 0.8384 0.120 0.868 0.000 0.012
#> SRR1818639 1 0.4072 0.7196 0.748 0.000 0.000 0.252
#> SRR1818640 1 0.3975 0.7391 0.760 0.000 0.000 0.240
#> SRR1818637 2 0.0592 0.8616 0.000 0.984 0.000 0.016
#> SRR1818638 2 0.0592 0.8616 0.000 0.984 0.000 0.016
#> SRR1818635 1 0.1284 0.8761 0.964 0.012 0.000 0.024
#> SRR1818636 1 0.1004 0.8785 0.972 0.004 0.000 0.024
#> SRR1818643 1 0.1174 0.8629 0.968 0.012 0.000 0.020
#> SRR1818644 1 0.1174 0.8629 0.968 0.012 0.000 0.020
#> SRR1818641 1 0.1059 0.8670 0.972 0.012 0.000 0.016
#> SRR1818642 1 0.1388 0.8719 0.960 0.012 0.000 0.028
#> SRR1818633 3 0.4391 0.6005 0.252 0.000 0.740 0.008
#> SRR1818634 3 0.4053 0.6371 0.228 0.000 0.768 0.004
#> SRR1818665 1 0.2149 0.8788 0.912 0.000 0.000 0.088
#> SRR1818666 1 0.2149 0.8788 0.912 0.000 0.000 0.088
#> SRR1818667 2 0.1978 0.8763 0.068 0.928 0.000 0.004
#> SRR1818668 2 0.1978 0.8763 0.068 0.928 0.000 0.004
#> SRR1818669 1 0.2814 0.8717 0.868 0.000 0.000 0.132
#> SRR1818670 1 0.2814 0.8717 0.868 0.000 0.000 0.132
#> SRR1818663 1 0.2281 0.8768 0.904 0.000 0.000 0.096
#> SRR1818664 1 0.2345 0.8757 0.900 0.000 0.000 0.100
#> SRR1818629 1 0.2089 0.8421 0.932 0.048 0.000 0.020
#> SRR1818630 1 0.1936 0.8505 0.940 0.032 0.000 0.028
#> SRR1818627 1 0.2760 0.8730 0.872 0.000 0.000 0.128
#> SRR1818628 1 0.2760 0.8730 0.872 0.000 0.000 0.128
#> SRR1818621 4 0.3088 0.7232 0.008 0.000 0.128 0.864
#> SRR1818622 4 0.3088 0.7232 0.008 0.000 0.128 0.864
#> SRR1818625 1 0.1940 0.8793 0.924 0.000 0.000 0.076
#> SRR1818626 1 0.2011 0.8787 0.920 0.000 0.000 0.080
#> SRR1818623 2 0.1182 0.8533 0.000 0.968 0.016 0.016
#> SRR1818624 2 0.1706 0.8416 0.000 0.948 0.036 0.016
#> SRR1818619 1 0.2760 0.8720 0.872 0.000 0.000 0.128
#> SRR1818620 1 0.2760 0.8720 0.872 0.000 0.000 0.128
#> SRR1818617 1 0.2048 0.8358 0.928 0.064 0.000 0.008
#> SRR1818618 1 0.2060 0.8417 0.932 0.052 0.000 0.016
#> SRR1818615 2 0.1637 0.8772 0.060 0.940 0.000 0.000
#> SRR1818616 2 0.1474 0.8768 0.052 0.948 0.000 0.000
#> SRR1818609 2 0.0592 0.8616 0.000 0.984 0.000 0.016
#> SRR1818610 2 0.0592 0.8616 0.000 0.984 0.000 0.016
#> SRR1818607 2 0.5203 0.5241 0.348 0.636 0.000 0.016
#> SRR1818608 2 0.5512 0.1360 0.492 0.492 0.000 0.016
#> SRR1818613 4 0.3219 0.8155 0.164 0.000 0.000 0.836
#> SRR1818614 4 0.3444 0.7968 0.184 0.000 0.000 0.816
#> SRR1818611 4 0.2973 0.8281 0.144 0.000 0.000 0.856
#> SRR1818612 4 0.2973 0.8282 0.144 0.000 0.000 0.856
#> SRR1818605 4 0.3749 0.7560 0.032 0.000 0.128 0.840
#> SRR1818606 4 0.3638 0.7611 0.032 0.000 0.120 0.848
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1818631 3 0.1557 0.8138 0.000 0.052 0.940 0.000 0.008
#> SRR1818632 3 0.1894 0.8082 0.000 0.072 0.920 0.000 0.008
#> SRR1818679 3 0.6863 0.2260 0.324 0.264 0.408 0.000 0.004
#> SRR1818680 1 0.6915 -0.2452 0.388 0.292 0.316 0.000 0.004
#> SRR1818677 2 0.4434 0.8482 0.460 0.536 0.000 0.004 0.000
#> SRR1818678 2 0.4434 0.8409 0.460 0.536 0.000 0.004 0.000
#> SRR1818675 3 0.1628 0.8202 0.008 0.056 0.936 0.000 0.000
#> SRR1818676 3 0.1628 0.8202 0.008 0.056 0.936 0.000 0.000
#> SRR1818673 2 0.4978 0.8216 0.476 0.496 0.000 0.028 0.000
#> SRR1818674 2 0.4905 0.8326 0.476 0.500 0.000 0.024 0.000
#> SRR1818671 4 0.3949 0.7569 0.000 0.332 0.000 0.668 0.000
#> SRR1818672 4 0.3932 0.7592 0.000 0.328 0.000 0.672 0.000
#> SRR1818661 3 0.0324 0.8209 0.000 0.004 0.992 0.000 0.004
#> SRR1818662 3 0.0324 0.8209 0.000 0.004 0.992 0.000 0.004
#> SRR1818655 1 0.4169 0.3155 0.732 0.240 0.000 0.000 0.028
#> SRR1818656 1 0.4192 0.3160 0.736 0.232 0.000 0.000 0.032
#> SRR1818653 5 0.0794 0.7407 0.028 0.000 0.000 0.000 0.972
#> SRR1818654 5 0.0880 0.7423 0.032 0.000 0.000 0.000 0.968
#> SRR1818651 1 0.3861 0.4234 0.728 0.008 0.000 0.000 0.264
#> SRR1818652 1 0.3759 0.4902 0.764 0.016 0.000 0.000 0.220
#> SRR1818657 1 0.3452 0.2941 0.756 0.244 0.000 0.000 0.000
#> SRR1818658 1 0.3607 0.2933 0.752 0.244 0.000 0.000 0.004
#> SRR1818649 1 0.4452 0.3426 0.696 0.272 0.000 0.000 0.032
#> SRR1818650 1 0.4503 0.3410 0.696 0.268 0.000 0.000 0.036
#> SRR1818659 1 0.5550 0.2395 0.528 0.072 0.000 0.000 0.400
#> SRR1818647 3 0.4219 0.7510 0.000 0.104 0.780 0.116 0.000
#> SRR1818648 3 0.4073 0.7603 0.000 0.104 0.792 0.104 0.000
#> SRR1818645 2 0.5987 0.6561 0.272 0.572 0.000 0.156 0.000
#> SRR1818646 2 0.6063 0.6266 0.256 0.568 0.000 0.176 0.000
#> SRR1818639 1 0.5642 0.3377 0.636 0.184 0.000 0.000 0.180
#> SRR1818640 1 0.5605 0.3301 0.640 0.192 0.000 0.000 0.168
#> SRR1818637 4 0.0290 0.7824 0.000 0.008 0.000 0.992 0.000
#> SRR1818638 4 0.0290 0.7824 0.000 0.008 0.000 0.992 0.000
#> SRR1818635 1 0.4262 -0.6223 0.560 0.440 0.000 0.000 0.000
#> SRR1818636 1 0.4262 -0.6238 0.560 0.440 0.000 0.000 0.000
#> SRR1818643 2 0.4294 0.8478 0.468 0.532 0.000 0.000 0.000
#> SRR1818644 2 0.4294 0.8478 0.468 0.532 0.000 0.000 0.000
#> SRR1818641 2 0.4434 0.8507 0.460 0.536 0.000 0.000 0.004
#> SRR1818642 2 0.4440 0.8433 0.468 0.528 0.000 0.000 0.004
#> SRR1818633 3 0.3988 0.6229 0.196 0.036 0.768 0.000 0.000
#> SRR1818634 3 0.2997 0.7120 0.148 0.012 0.840 0.000 0.000
#> SRR1818665 1 0.0290 0.5534 0.992 0.008 0.000 0.000 0.000
#> SRR1818666 1 0.0162 0.5547 0.996 0.004 0.000 0.000 0.000
#> SRR1818667 4 0.3837 0.7825 0.000 0.308 0.000 0.692 0.000
#> SRR1818668 4 0.3816 0.7844 0.000 0.304 0.000 0.696 0.000
#> SRR1818669 1 0.1965 0.5505 0.904 0.096 0.000 0.000 0.000
#> SRR1818670 1 0.1732 0.5546 0.920 0.080 0.000 0.000 0.000
#> SRR1818663 1 0.1493 0.5635 0.948 0.028 0.000 0.000 0.024
#> SRR1818664 1 0.1310 0.5635 0.956 0.020 0.000 0.000 0.024
#> SRR1818629 2 0.4273 0.8524 0.448 0.552 0.000 0.000 0.000
#> SRR1818630 2 0.4273 0.8524 0.448 0.552 0.000 0.000 0.000
#> SRR1818627 1 0.3561 0.4071 0.740 0.260 0.000 0.000 0.000
#> SRR1818628 1 0.3741 0.3974 0.732 0.264 0.000 0.000 0.004
#> SRR1818621 5 0.0290 0.7194 0.000 0.000 0.008 0.000 0.992
#> SRR1818622 5 0.0290 0.7194 0.000 0.000 0.008 0.000 0.992
#> SRR1818625 1 0.2338 0.4910 0.884 0.112 0.000 0.000 0.004
#> SRR1818626 1 0.2124 0.5051 0.900 0.096 0.000 0.000 0.004
#> SRR1818623 4 0.1626 0.7582 0.000 0.044 0.016 0.940 0.000
#> SRR1818624 4 0.1626 0.7582 0.000 0.044 0.016 0.940 0.000
#> SRR1818619 1 0.3491 0.4276 0.768 0.228 0.000 0.000 0.004
#> SRR1818620 1 0.3461 0.4254 0.772 0.224 0.000 0.000 0.004
#> SRR1818617 1 0.4482 -0.2478 0.612 0.376 0.000 0.012 0.000
#> SRR1818618 1 0.4166 -0.0813 0.648 0.348 0.000 0.004 0.000
#> SRR1818615 4 0.3913 0.7813 0.000 0.324 0.000 0.676 0.000
#> SRR1818616 4 0.3837 0.7859 0.000 0.308 0.000 0.692 0.000
#> SRR1818609 4 0.0404 0.7802 0.000 0.012 0.000 0.988 0.000
#> SRR1818610 4 0.0404 0.7802 0.000 0.012 0.000 0.988 0.000
#> SRR1818607 2 0.5546 0.7659 0.340 0.576 0.000 0.084 0.000
#> SRR1818608 2 0.5435 0.7798 0.352 0.576 0.000 0.072 0.000
#> SRR1818613 5 0.5984 0.4674 0.416 0.096 0.004 0.000 0.484
#> SRR1818614 5 0.5935 0.4839 0.408 0.092 0.004 0.000 0.496
#> SRR1818611 5 0.2966 0.7399 0.184 0.000 0.000 0.000 0.816
#> SRR1818612 5 0.2813 0.7482 0.168 0.000 0.000 0.000 0.832
#> SRR1818605 5 0.6085 0.6583 0.212 0.036 0.112 0.000 0.640
#> SRR1818606 5 0.5926 0.6744 0.212 0.040 0.092 0.000 0.656
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1818631 3 0.3965 0.6117 0.000 0.008 0.604 0.000 0.000 0.388
#> SRR1818632 3 0.4057 0.5815 0.000 0.008 0.556 0.000 0.000 0.436
#> SRR1818679 6 0.3608 0.4083 0.072 0.016 0.096 0.000 0.000 0.816
#> SRR1818680 6 0.3164 0.4937 0.096 0.012 0.048 0.000 0.000 0.844
#> SRR1818677 1 0.3989 -0.0654 0.528 0.468 0.000 0.000 0.000 0.004
#> SRR1818678 1 0.3986 -0.0555 0.532 0.464 0.000 0.000 0.000 0.004
#> SRR1818675 3 0.4652 0.4158 0.004 0.024 0.520 0.004 0.000 0.448
#> SRR1818676 3 0.4510 0.4617 0.008 0.020 0.556 0.000 0.000 0.416
#> SRR1818673 1 0.4576 -0.0991 0.504 0.468 0.000 0.016 0.000 0.012
#> SRR1818674 1 0.4389 -0.1039 0.512 0.468 0.000 0.016 0.000 0.004
#> SRR1818671 4 0.5761 -0.2592 0.172 0.396 0.000 0.432 0.000 0.000
#> SRR1818672 4 0.5735 -0.2414 0.168 0.388 0.000 0.444 0.000 0.000
#> SRR1818661 3 0.0777 0.6954 0.000 0.004 0.972 0.000 0.000 0.024
#> SRR1818662 3 0.0777 0.6954 0.000 0.004 0.972 0.000 0.000 0.024
#> SRR1818655 1 0.1053 0.3817 0.964 0.012 0.000 0.000 0.004 0.020
#> SRR1818656 1 0.1275 0.3782 0.956 0.012 0.000 0.000 0.016 0.016
#> SRR1818653 5 0.1204 0.8138 0.056 0.000 0.000 0.000 0.944 0.000
#> SRR1818654 5 0.1075 0.8115 0.048 0.000 0.000 0.000 0.952 0.000
#> SRR1818651 1 0.6443 -0.3680 0.428 0.028 0.000 0.000 0.340 0.204
#> SRR1818652 1 0.6589 -0.4178 0.420 0.032 0.000 0.000 0.304 0.244
#> SRR1818657 1 0.2006 0.4312 0.904 0.080 0.000 0.000 0.000 0.016
#> SRR1818658 1 0.2006 0.4307 0.904 0.080 0.000 0.000 0.000 0.016
#> SRR1818649 6 0.5638 0.6837 0.412 0.116 0.000 0.000 0.008 0.464
#> SRR1818650 6 0.5731 0.6630 0.424 0.128 0.000 0.000 0.008 0.440
#> SRR1818659 1 0.3999 -0.3388 0.500 0.000 0.000 0.000 0.496 0.004
#> SRR1818647 3 0.5161 0.5418 0.000 0.264 0.636 0.076 0.000 0.024
#> SRR1818648 3 0.5073 0.5516 0.000 0.256 0.648 0.072 0.000 0.024
#> SRR1818645 2 0.3819 0.2858 0.372 0.624 0.000 0.004 0.000 0.000
#> SRR1818646 2 0.3934 0.2851 0.376 0.616 0.000 0.008 0.000 0.000
#> SRR1818639 1 0.3915 0.3997 0.776 0.092 0.000 0.000 0.128 0.004
#> SRR1818640 1 0.3612 0.4030 0.804 0.092 0.000 0.000 0.100 0.004
#> SRR1818637 4 0.0458 0.6910 0.000 0.016 0.000 0.984 0.000 0.000
#> SRR1818638 4 0.0458 0.6910 0.000 0.016 0.000 0.984 0.000 0.000
#> SRR1818635 1 0.3756 0.2789 0.712 0.268 0.000 0.000 0.000 0.020
#> SRR1818636 1 0.3606 0.2737 0.728 0.256 0.000 0.000 0.000 0.016
#> SRR1818643 1 0.4161 -0.0381 0.540 0.448 0.000 0.000 0.000 0.012
#> SRR1818644 1 0.4157 -0.0235 0.544 0.444 0.000 0.000 0.000 0.012
#> SRR1818641 1 0.3971 -0.0303 0.548 0.448 0.000 0.000 0.000 0.004
#> SRR1818642 1 0.3950 -0.0152 0.564 0.432 0.000 0.004 0.000 0.000
#> SRR1818633 3 0.3017 0.6571 0.132 0.016 0.840 0.008 0.000 0.004
#> SRR1818634 3 0.2708 0.6703 0.112 0.012 0.864 0.008 0.000 0.004
#> SRR1818665 1 0.4063 -0.4781 0.572 0.004 0.000 0.000 0.004 0.420
#> SRR1818666 1 0.4063 -0.4781 0.572 0.004 0.000 0.000 0.004 0.420
#> SRR1818667 2 0.4284 0.0989 0.012 0.544 0.004 0.440 0.000 0.000
#> SRR1818668 2 0.4169 0.0798 0.012 0.532 0.000 0.456 0.000 0.000
#> SRR1818669 6 0.4178 0.7334 0.372 0.020 0.000 0.000 0.000 0.608
#> SRR1818670 6 0.4099 0.7372 0.372 0.016 0.000 0.000 0.000 0.612
#> SRR1818663 1 0.5645 -0.6113 0.488 0.136 0.000 0.000 0.004 0.372
#> SRR1818664 1 0.5592 -0.6075 0.492 0.128 0.000 0.000 0.004 0.376
#> SRR1818629 1 0.3989 -0.0636 0.528 0.468 0.000 0.000 0.000 0.004
#> SRR1818630 1 0.3989 -0.0662 0.528 0.468 0.000 0.000 0.000 0.004
#> SRR1818627 6 0.3607 0.7702 0.348 0.000 0.000 0.000 0.000 0.652
#> SRR1818628 6 0.3634 0.7702 0.356 0.000 0.000 0.000 0.000 0.644
#> SRR1818621 5 0.0146 0.7766 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR1818622 5 0.0146 0.7766 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR1818625 1 0.3288 -0.0731 0.724 0.000 0.000 0.000 0.000 0.276
#> SRR1818626 1 0.3547 -0.1568 0.696 0.004 0.000 0.000 0.000 0.300
#> SRR1818623 4 0.4309 0.5726 0.000 0.104 0.020 0.760 0.000 0.116
#> SRR1818624 4 0.4255 0.5794 0.000 0.096 0.024 0.768 0.000 0.112
#> SRR1818619 1 0.4647 0.3479 0.700 0.096 0.000 0.008 0.000 0.196
#> SRR1818620 1 0.4374 0.3527 0.732 0.088 0.000 0.008 0.000 0.172
#> SRR1818617 1 0.4109 0.1923 0.652 0.328 0.000 0.008 0.000 0.012
#> SRR1818618 1 0.4235 0.2323 0.668 0.300 0.000 0.008 0.000 0.024
#> SRR1818615 2 0.4350 0.0216 0.000 0.552 0.004 0.428 0.000 0.016
#> SRR1818616 2 0.4386 -0.0545 0.000 0.516 0.004 0.464 0.000 0.016
#> SRR1818609 4 0.0551 0.6905 0.000 0.004 0.008 0.984 0.000 0.004
#> SRR1818610 4 0.0436 0.6918 0.000 0.004 0.004 0.988 0.000 0.004
#> SRR1818607 2 0.3984 0.2585 0.396 0.596 0.000 0.008 0.000 0.000
#> SRR1818608 2 0.4049 0.2253 0.412 0.580 0.000 0.004 0.000 0.004
#> SRR1818613 1 0.7105 -0.3312 0.440 0.176 0.000 0.000 0.264 0.120
#> SRR1818614 1 0.7081 -0.3342 0.448 0.176 0.000 0.000 0.256 0.120
#> SRR1818611 5 0.3053 0.7843 0.172 0.012 0.000 0.000 0.812 0.004
#> SRR1818612 5 0.3073 0.7898 0.164 0.016 0.000 0.000 0.816 0.004
#> SRR1818605 5 0.5918 0.6368 0.176 0.024 0.052 0.000 0.648 0.100
#> SRR1818606 5 0.5757 0.6545 0.176 0.020 0.052 0.000 0.660 0.092
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