Date: 2019-12-26 00:44:47 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 15854 rows and 72 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] 15854 72
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 | ||
---|---|---|---|---|---|---|
SD:kmeans | 2 | 1.000 | 0.975 | 0.989 | ** | |
SD:pam | 2 | 1.000 | 0.984 | 0.993 | ** | |
SD:NMF | 2 | 1.000 | 0.972 | 0.989 | ** | |
CV:pam | 5 | 1.000 | 0.956 | 0.983 | ** | |
CV:mclust | 2 | 1.000 | 0.968 | 0.986 | ** | |
CV:NMF | 3 | 1.000 | 0.955 | 0.981 | ** | |
MAD:kmeans | 2 | 1.000 | 0.973 | 0.988 | ** | |
MAD:pam | 2 | 1.000 | 0.980 | 0.991 | ** | |
ATC:pam | 5 | 1.000 | 0.965 | 0.988 | ** | 2,4 |
ATC:skmeans | 4 | 1.000 | 0.918 | 0.964 | ** | 2 |
CV:kmeans | 3 | 0.986 | 0.937 | 0.966 | ** | 2 |
CV:skmeans | 3 | 0.974 | 0.945 | 0.975 | ** | |
MAD:NMF | 2 | 0.970 | 0.939 | 0.974 | ** | |
SD:skmeans | 5 | 0.967 | 0.910 | 0.958 | ** | 2 |
MAD:skmeans | 3 | 0.918 | 0.905 | 0.953 | * | 2 |
ATC:hclust | 6 | 0.906 | 0.842 | 0.937 | * | 4 |
ATC:kmeans | 3 | 0.903 | 0.936 | 0.968 | * | 2 |
MAD:hclust | 2 | 0.891 | 0.940 | 0.972 | ||
SD:mclust | 2 | 0.795 | 0.945 | 0.972 | ||
MAD:mclust | 2 | 0.795 | 0.954 | 0.976 | ||
CV:hclust | 2 | 0.789 | 0.907 | 0.952 | ||
ATC:NMF | 3 | 0.784 | 0.859 | 0.937 | ||
ATC:mclust | 2 | 0.718 | 0.888 | 0.951 | ||
SD:hclust | 2 | 0.703 | 0.906 | 0.957 |
**: 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 1.000 0.972 0.989 0.504 0.495 0.495
#> CV:NMF 2 0.860 0.938 0.972 0.501 0.496 0.496
#> MAD:NMF 2 0.970 0.939 0.974 0.505 0.496 0.496
#> ATC:NMF 2 0.784 0.849 0.943 0.498 0.503 0.503
#> SD:skmeans 2 1.000 0.995 0.998 0.502 0.499 0.499
#> CV:skmeans 2 0.864 0.930 0.970 0.495 0.503 0.503
#> MAD:skmeans 2 1.000 0.990 0.995 0.503 0.496 0.496
#> ATC:skmeans 2 1.000 0.966 0.986 0.498 0.507 0.507
#> SD:mclust 2 0.795 0.945 0.972 0.500 0.499 0.499
#> CV:mclust 2 1.000 0.968 0.986 0.482 0.518 0.518
#> MAD:mclust 2 0.795 0.954 0.976 0.497 0.503 0.503
#> ATC:mclust 2 0.718 0.888 0.951 0.492 0.499 0.499
#> SD:kmeans 2 1.000 0.975 0.989 0.494 0.507 0.507
#> CV:kmeans 2 0.943 0.947 0.977 0.453 0.532 0.532
#> MAD:kmeans 2 1.000 0.973 0.988 0.491 0.507 0.507
#> ATC:kmeans 2 1.000 0.978 0.990 0.473 0.532 0.532
#> SD:pam 2 1.000 0.984 0.993 0.503 0.496 0.496
#> CV:pam 2 0.858 0.925 0.968 0.471 0.518 0.518
#> MAD:pam 2 1.000 0.980 0.991 0.505 0.495 0.495
#> ATC:pam 2 1.000 0.977 0.991 0.490 0.512 0.512
#> SD:hclust 2 0.703 0.906 0.957 0.474 0.532 0.532
#> CV:hclust 2 0.789 0.907 0.952 0.438 0.532 0.532
#> MAD:hclust 2 0.891 0.940 0.972 0.479 0.532 0.532
#> ATC:hclust 2 0.541 0.814 0.901 0.351 0.737 0.737
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 0.665 0.799 0.899 0.258 0.858 0.719
#> CV:NMF 3 1.000 0.955 0.981 0.264 0.835 0.678
#> MAD:NMF 3 0.651 0.740 0.865 0.270 0.817 0.649
#> ATC:NMF 3 0.784 0.859 0.937 0.301 0.821 0.654
#> SD:skmeans 3 0.729 0.873 0.916 0.295 0.792 0.601
#> CV:skmeans 3 0.974 0.945 0.975 0.184 0.885 0.777
#> MAD:skmeans 3 0.918 0.905 0.953 0.306 0.775 0.574
#> ATC:skmeans 3 0.898 0.912 0.947 0.155 0.908 0.820
#> SD:mclust 3 0.515 0.600 0.748 0.239 0.885 0.774
#> CV:mclust 3 0.768 0.838 0.925 0.300 0.829 0.683
#> MAD:mclust 3 0.489 0.743 0.829 0.215 0.852 0.720
#> ATC:mclust 3 0.495 0.668 0.827 0.236 0.852 0.710
#> SD:kmeans 3 0.639 0.701 0.791 0.313 0.792 0.602
#> CV:kmeans 3 0.986 0.937 0.966 0.366 0.762 0.585
#> MAD:kmeans 3 0.629 0.727 0.806 0.328 0.756 0.547
#> ATC:kmeans 3 0.903 0.936 0.968 0.315 0.762 0.585
#> SD:pam 3 0.745 0.755 0.812 0.249 0.868 0.738
#> CV:pam 3 0.883 0.925 0.971 0.210 0.863 0.746
#> MAD:pam 3 0.668 0.742 0.870 0.272 0.830 0.668
#> ATC:pam 3 0.840 0.837 0.890 0.245 0.808 0.641
#> SD:hclust 3 0.735 0.843 0.908 0.197 0.935 0.879
#> CV:hclust 3 0.761 0.860 0.912 0.200 0.944 0.894
#> MAD:hclust 3 0.690 0.848 0.877 0.200 0.935 0.879
#> ATC:hclust 3 0.797 0.914 0.957 0.686 0.653 0.529
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.834 0.827 0.927 0.1428 0.859 0.644
#> CV:NMF 4 0.778 0.760 0.827 0.1416 0.873 0.661
#> MAD:NMF 4 0.820 0.820 0.927 0.1386 0.859 0.633
#> ATC:NMF 4 0.730 0.635 0.798 0.0970 0.891 0.712
#> SD:skmeans 4 0.859 0.856 0.934 0.1143 0.878 0.668
#> CV:skmeans 4 0.853 0.899 0.946 0.1147 0.930 0.831
#> MAD:skmeans 4 0.763 0.679 0.832 0.1088 0.851 0.600
#> ATC:skmeans 4 1.000 0.918 0.964 0.1087 0.923 0.821
#> SD:mclust 4 0.604 0.568 0.753 0.1227 0.808 0.559
#> CV:mclust 4 0.781 0.730 0.865 0.1581 0.859 0.654
#> MAD:mclust 4 0.604 0.703 0.813 0.1257 0.749 0.495
#> ATC:mclust 4 0.605 0.687 0.796 0.1346 0.891 0.724
#> SD:kmeans 4 0.723 0.776 0.850 0.1368 0.895 0.695
#> CV:kmeans 4 0.746 0.742 0.848 0.0977 0.942 0.849
#> MAD:kmeans 4 0.718 0.764 0.788 0.1322 0.875 0.646
#> ATC:kmeans 4 0.777 0.827 0.900 0.1390 0.851 0.635
#> SD:pam 4 0.654 0.795 0.840 0.1264 0.794 0.530
#> CV:pam 4 0.783 0.697 0.826 0.0928 0.898 0.768
#> MAD:pam 4 0.640 0.489 0.707 0.1278 0.771 0.480
#> ATC:pam 4 0.960 0.935 0.974 0.1114 0.925 0.802
#> SD:hclust 4 0.685 0.809 0.864 0.2597 0.812 0.598
#> CV:hclust 4 0.835 0.774 0.898 0.0925 0.973 0.943
#> MAD:hclust 4 0.697 0.792 0.863 0.2472 0.812 0.598
#> ATC:hclust 4 0.970 0.921 0.965 0.1335 0.945 0.860
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.724 0.664 0.842 0.0435 0.966 0.876
#> CV:NMF 5 0.869 0.870 0.930 0.0664 0.956 0.832
#> MAD:NMF 5 0.750 0.704 0.860 0.0454 0.951 0.824
#> ATC:NMF 5 0.781 0.778 0.878 0.0576 0.894 0.669
#> SD:skmeans 5 0.967 0.910 0.958 0.0561 0.946 0.814
#> CV:skmeans 5 0.805 0.789 0.908 0.0583 0.966 0.904
#> MAD:skmeans 5 0.842 0.827 0.917 0.0530 0.904 0.674
#> ATC:skmeans 5 0.845 0.840 0.909 0.0659 0.995 0.986
#> SD:mclust 5 0.546 0.706 0.693 0.0759 0.831 0.507
#> CV:mclust 5 0.640 0.649 0.762 0.0291 0.945 0.825
#> MAD:mclust 5 0.547 0.607 0.704 0.1015 0.878 0.657
#> ATC:mclust 5 0.600 0.440 0.686 0.0991 0.835 0.531
#> SD:kmeans 5 0.726 0.678 0.793 0.0669 0.917 0.700
#> CV:kmeans 5 0.698 0.608 0.787 0.0677 0.954 0.870
#> MAD:kmeans 5 0.739 0.681 0.811 0.0686 0.924 0.717
#> ATC:kmeans 5 0.762 0.720 0.805 0.0796 0.919 0.731
#> SD:pam 5 0.762 0.729 0.842 0.0895 0.913 0.716
#> CV:pam 5 1.000 0.956 0.983 0.0984 0.938 0.830
#> MAD:pam 5 0.783 0.833 0.903 0.0938 0.808 0.440
#> ATC:pam 5 1.000 0.965 0.988 0.0330 0.971 0.911
#> SD:hclust 5 0.795 0.823 0.892 0.0625 0.961 0.863
#> CV:hclust 5 0.788 0.792 0.899 0.0410 0.973 0.941
#> MAD:hclust 5 0.696 0.747 0.813 0.0643 0.950 0.824
#> ATC:hclust 5 0.889 0.837 0.907 0.0495 1.000 1.000
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.739 0.649 0.812 0.02728 0.979 0.916
#> CV:NMF 6 0.836 0.733 0.870 0.03326 0.998 0.989
#> MAD:NMF 6 0.743 0.625 0.813 0.02863 0.993 0.969
#> ATC:NMF 6 0.767 0.667 0.821 0.02937 0.994 0.976
#> SD:skmeans 6 0.863 0.808 0.887 0.03801 0.957 0.829
#> CV:skmeans 6 0.769 0.652 0.845 0.06230 0.909 0.725
#> MAD:skmeans 6 0.837 0.623 0.856 0.03545 0.948 0.799
#> ATC:skmeans 6 0.831 0.775 0.857 0.03357 0.984 0.953
#> SD:mclust 6 0.579 0.442 0.608 0.04177 0.889 0.579
#> CV:mclust 6 0.634 0.675 0.789 0.03657 0.941 0.799
#> MAD:mclust 6 0.562 0.556 0.655 0.05512 0.881 0.563
#> ATC:mclust 6 0.718 0.647 0.759 0.07165 0.848 0.454
#> SD:kmeans 6 0.748 0.670 0.813 0.04562 0.924 0.672
#> CV:kmeans 6 0.709 0.564 0.734 0.05285 0.826 0.512
#> MAD:kmeans 6 0.754 0.672 0.807 0.04562 0.951 0.773
#> ATC:kmeans 6 0.747 0.514 0.676 0.05051 0.896 0.613
#> SD:pam 6 0.752 0.731 0.873 0.05845 0.838 0.443
#> CV:pam 6 1.000 0.950 0.987 0.00783 0.997 0.990
#> MAD:pam 6 0.835 0.725 0.873 0.03968 0.971 0.859
#> ATC:pam 6 0.855 0.686 0.857 0.09999 0.935 0.784
#> SD:hclust 6 0.813 0.833 0.855 0.04621 0.968 0.875
#> CV:hclust 6 0.783 0.780 0.850 0.04167 0.968 0.926
#> MAD:hclust 6 0.712 0.539 0.712 0.06210 0.899 0.601
#> ATC:hclust 6 0.906 0.842 0.937 0.01639 0.979 0.937
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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.703 0.906 0.957 0.4742 0.532 0.532
#> 3 3 0.735 0.843 0.908 0.1967 0.935 0.879
#> 4 4 0.685 0.809 0.864 0.2597 0.812 0.598
#> 5 5 0.795 0.823 0.892 0.0625 0.961 0.863
#> 6 6 0.813 0.833 0.855 0.0462 0.968 0.875
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
#> SRR1791347 1 0.943 0.488 0.640 0.360
#> SRR1791346 2 0.000 0.971 0.000 1.000
#> SRR1791345 1 0.184 0.924 0.972 0.028
#> SRR1791344 1 0.943 0.488 0.640 0.360
#> SRR1791343 2 0.000 0.971 0.000 1.000
#> SRR1791341 1 0.000 0.942 1.000 0.000
#> SRR1791342 1 0.260 0.912 0.956 0.044
#> SRR1791340 2 0.000 0.971 0.000 1.000
#> SRR1791375 1 0.141 0.930 0.980 0.020
#> SRR1791374 1 0.000 0.942 1.000 0.000
#> SRR1791372 1 0.000 0.942 1.000 0.000
#> SRR1791370 1 0.343 0.897 0.936 0.064
#> SRR1791373 1 0.311 0.902 0.944 0.056
#> SRR1791369 1 0.000 0.942 1.000 0.000
#> SRR1791371 1 0.000 0.942 1.000 0.000
#> SRR1791368 1 0.000 0.942 1.000 0.000
#> SRR1791366 2 0.000 0.971 0.000 1.000
#> SRR1791364 1 0.000 0.942 1.000 0.000
#> SRR1791367 1 0.000 0.942 1.000 0.000
#> SRR1791363 1 0.000 0.942 1.000 0.000
#> SRR1791361 1 0.000 0.942 1.000 0.000
#> SRR1791360 1 0.000 0.942 1.000 0.000
#> SRR1791359 2 0.494 0.892 0.108 0.892
#> SRR1791358 2 0.000 0.971 0.000 1.000
#> SRR1791365 2 0.000 0.971 0.000 1.000
#> SRR1791357 1 0.000 0.942 1.000 0.000
#> SRR1791356 1 0.000 0.942 1.000 0.000
#> SRR1791355 2 0.000 0.971 0.000 1.000
#> SRR1791362 1 0.000 0.942 1.000 0.000
#> SRR1791354 2 0.494 0.892 0.108 0.892
#> SRR1791353 1 0.000 0.942 1.000 0.000
#> SRR1791352 1 0.000 0.942 1.000 0.000
#> SRR1791349 2 0.000 0.971 0.000 1.000
#> SRR1791348 1 0.000 0.942 1.000 0.000
#> SRR1791351 2 0.000 0.971 0.000 1.000
#> SRR1791350 1 0.000 0.942 1.000 0.000
#> SRR1791339 1 0.943 0.488 0.640 0.360
#> SRR1791338 2 0.000 0.971 0.000 1.000
#> SRR1791336 2 0.000 0.971 0.000 1.000
#> SRR1791337 2 0.494 0.892 0.108 0.892
#> SRR1791335 2 0.000 0.971 0.000 1.000
#> SRR1791332 1 0.000 0.942 1.000 0.000
#> SRR1791331 1 0.943 0.488 0.640 0.360
#> SRR1791330 1 0.000 0.942 1.000 0.000
#> SRR1791334 1 0.000 0.942 1.000 0.000
#> SRR1791328 1 0.000 0.942 1.000 0.000
#> SRR1791327 2 0.000 0.971 0.000 1.000
#> SRR1791333 1 0.000 0.942 1.000 0.000
#> SRR1791326 2 0.000 0.971 0.000 1.000
#> SRR1791324 2 0.000 0.971 0.000 1.000
#> SRR1791323 2 0.000 0.971 0.000 1.000
#> SRR1791322 2 0.494 0.892 0.108 0.892
#> SRR1791329 2 0.000 0.971 0.000 1.000
#> SRR1791321 1 0.000 0.942 1.000 0.000
#> SRR1791320 1 0.943 0.488 0.640 0.360
#> SRR1791325 1 0.278 0.910 0.952 0.048
#> SRR1791318 1 0.000 0.942 1.000 0.000
#> SRR1791317 2 0.494 0.892 0.108 0.892
#> SRR1791313 1 0.000 0.942 1.000 0.000
#> SRR1791312 1 0.000 0.942 1.000 0.000
#> SRR1791319 1 0.000 0.942 1.000 0.000
#> SRR1791316 1 0.000 0.942 1.000 0.000
#> SRR1791315 1 0.000 0.942 1.000 0.000
#> SRR1791311 1 0.000 0.942 1.000 0.000
#> SRR1791314 2 0.000 0.971 0.000 1.000
#> SRR1791310 1 0.943 0.488 0.640 0.360
#> SRR1791308 2 0.000 0.971 0.000 1.000
#> SRR1791307 1 0.000 0.942 1.000 0.000
#> SRR1791306 1 0.000 0.942 1.000 0.000
#> SRR1791305 2 0.000 0.971 0.000 1.000
#> SRR1791309 2 0.494 0.892 0.108 0.892
#> SRR1791304 1 0.000 0.942 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 1 0.9213 0.426 0.536 0.236 0.228
#> SRR1791346 3 0.4750 0.794 0.000 0.216 0.784
#> SRR1791345 1 0.1753 0.897 0.952 0.000 0.048
#> SRR1791344 1 0.9213 0.426 0.536 0.236 0.228
#> SRR1791343 3 0.4887 0.797 0.000 0.228 0.772
#> SRR1791341 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791342 1 0.1832 0.895 0.956 0.036 0.008
#> SRR1791340 2 0.0000 0.997 0.000 1.000 0.000
#> SRR1791375 1 0.1529 0.902 0.960 0.000 0.040
#> SRR1791374 1 0.2878 0.866 0.904 0.000 0.096
#> SRR1791372 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791370 1 0.4178 0.807 0.828 0.000 0.172
#> SRR1791373 1 0.3879 0.823 0.848 0.000 0.152
#> SRR1791369 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791371 1 0.0424 0.918 0.992 0.000 0.008
#> SRR1791368 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791366 2 0.0000 0.997 0.000 1.000 0.000
#> SRR1791364 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791367 1 0.0424 0.918 0.992 0.000 0.008
#> SRR1791363 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791361 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791360 1 0.0424 0.918 0.992 0.000 0.008
#> SRR1791359 3 0.4974 0.568 0.000 0.236 0.764
#> SRR1791358 2 0.0000 0.997 0.000 1.000 0.000
#> SRR1791365 3 0.4887 0.797 0.000 0.228 0.772
#> SRR1791357 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791355 3 0.4887 0.797 0.000 0.228 0.772
#> SRR1791362 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791354 3 0.4974 0.568 0.000 0.236 0.764
#> SRR1791353 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791352 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791349 3 0.4887 0.797 0.000 0.228 0.772
#> SRR1791348 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.997 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791339 1 0.9213 0.426 0.536 0.236 0.228
#> SRR1791338 2 0.0424 0.991 0.000 0.992 0.008
#> SRR1791336 2 0.0424 0.991 0.000 0.992 0.008
#> SRR1791337 3 0.0000 0.709 0.000 0.000 1.000
#> SRR1791335 2 0.0424 0.991 0.000 0.992 0.008
#> SRR1791332 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791331 1 0.9213 0.426 0.536 0.236 0.228
#> SRR1791330 1 0.0424 0.918 0.992 0.000 0.008
#> SRR1791334 1 0.0237 0.919 0.996 0.000 0.004
#> SRR1791328 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791327 2 0.0000 0.997 0.000 1.000 0.000
#> SRR1791333 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791326 2 0.0000 0.997 0.000 1.000 0.000
#> SRR1791324 3 0.4887 0.797 0.000 0.228 0.772
#> SRR1791323 2 0.0000 0.997 0.000 1.000 0.000
#> SRR1791322 3 0.4974 0.568 0.000 0.236 0.764
#> SRR1791329 3 0.4887 0.797 0.000 0.228 0.772
#> SRR1791321 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791320 1 0.9213 0.426 0.536 0.236 0.228
#> SRR1791325 1 0.3941 0.821 0.844 0.000 0.156
#> SRR1791318 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791317 3 0.0000 0.709 0.000 0.000 1.000
#> SRR1791313 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791312 1 0.0424 0.918 0.992 0.000 0.008
#> SRR1791319 1 0.2878 0.866 0.904 0.000 0.096
#> SRR1791316 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791314 2 0.0000 0.997 0.000 1.000 0.000
#> SRR1791310 1 0.9213 0.426 0.536 0.236 0.228
#> SRR1791308 3 0.4750 0.794 0.000 0.216 0.784
#> SRR1791307 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791306 1 0.0000 0.921 1.000 0.000 0.000
#> SRR1791305 3 0.4887 0.797 0.000 0.228 0.772
#> SRR1791309 3 0.4974 0.568 0.000 0.236 0.764
#> SRR1791304 1 0.0000 0.921 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.5839 0.614 0.000 0.200 0.104 0.696
#> SRR1791346 3 0.3764 0.808 0.000 0.216 0.784 0.000
#> SRR1791345 1 0.5074 0.609 0.724 0.000 0.040 0.236
#> SRR1791344 4 0.5839 0.614 0.000 0.200 0.104 0.696
#> SRR1791343 3 0.3873 0.809 0.000 0.228 0.772 0.000
#> SRR1791341 4 0.3219 0.796 0.164 0.000 0.000 0.836
#> SRR1791342 4 0.2589 0.782 0.116 0.000 0.000 0.884
#> SRR1791340 2 0.0000 0.997 0.000 1.000 0.000 0.000
#> SRR1791375 4 0.4375 0.769 0.180 0.000 0.032 0.788
#> SRR1791374 1 0.2480 0.838 0.904 0.000 0.008 0.088
#> SRR1791372 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791370 1 0.6116 0.477 0.612 0.000 0.068 0.320
#> SRR1791373 1 0.3674 0.789 0.848 0.000 0.036 0.116
#> SRR1791369 1 0.0592 0.901 0.984 0.000 0.000 0.016
#> SRR1791371 1 0.0336 0.902 0.992 0.000 0.000 0.008
#> SRR1791368 4 0.3219 0.796 0.164 0.000 0.000 0.836
#> SRR1791366 2 0.0000 0.997 0.000 1.000 0.000 0.000
#> SRR1791364 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.0336 0.902 0.992 0.000 0.000 0.008
#> SRR1791363 4 0.3219 0.796 0.164 0.000 0.000 0.836
#> SRR1791361 1 0.4830 0.342 0.608 0.000 0.000 0.392
#> SRR1791360 1 0.0817 0.900 0.976 0.000 0.000 0.024
#> SRR1791359 3 0.4839 0.595 0.000 0.200 0.756 0.044
#> SRR1791358 2 0.0000 0.997 0.000 1.000 0.000 0.000
#> SRR1791365 3 0.3873 0.809 0.000 0.228 0.772 0.000
#> SRR1791357 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791355 3 0.3873 0.809 0.000 0.228 0.772 0.000
#> SRR1791362 1 0.2921 0.798 0.860 0.000 0.000 0.140
#> SRR1791354 3 0.4839 0.595 0.000 0.200 0.756 0.044
#> SRR1791353 4 0.3219 0.796 0.164 0.000 0.000 0.836
#> SRR1791352 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791349 3 0.3873 0.809 0.000 0.228 0.772 0.000
#> SRR1791348 1 0.0469 0.902 0.988 0.000 0.000 0.012
#> SRR1791351 2 0.0000 0.997 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.0592 0.901 0.984 0.000 0.000 0.016
#> SRR1791339 4 0.5839 0.614 0.000 0.200 0.104 0.696
#> SRR1791338 2 0.0336 0.991 0.000 0.992 0.008 0.000
#> SRR1791336 2 0.0336 0.991 0.000 0.992 0.008 0.000
#> SRR1791337 3 0.1637 0.721 0.000 0.000 0.940 0.060
#> SRR1791335 2 0.0336 0.991 0.000 0.992 0.008 0.000
#> SRR1791332 4 0.3219 0.796 0.164 0.000 0.000 0.836
#> SRR1791331 4 0.5839 0.614 0.000 0.200 0.104 0.696
#> SRR1791330 1 0.4585 0.490 0.668 0.000 0.000 0.332
#> SRR1791334 1 0.0707 0.901 0.980 0.000 0.000 0.020
#> SRR1791328 4 0.3172 0.796 0.160 0.000 0.000 0.840
#> SRR1791327 2 0.0000 0.997 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.2589 0.829 0.884 0.000 0.000 0.116
#> SRR1791326 2 0.0000 0.997 0.000 1.000 0.000 0.000
#> SRR1791324 3 0.3873 0.809 0.000 0.228 0.772 0.000
#> SRR1791323 2 0.0000 0.997 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.4839 0.595 0.000 0.200 0.756 0.044
#> SRR1791329 3 0.3873 0.809 0.000 0.228 0.772 0.000
#> SRR1791321 1 0.0592 0.901 0.984 0.000 0.000 0.016
#> SRR1791320 4 0.5839 0.614 0.000 0.200 0.104 0.696
#> SRR1791325 1 0.5847 0.506 0.628 0.000 0.052 0.320
#> SRR1791318 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 0.725 0.000 0.000 1.000 0.000
#> SRR1791313 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.0336 0.902 0.992 0.000 0.000 0.008
#> SRR1791319 1 0.2480 0.838 0.904 0.000 0.008 0.088
#> SRR1791316 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.904 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.0817 0.897 0.976 0.000 0.000 0.024
#> SRR1791314 2 0.0000 0.997 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.5839 0.614 0.000 0.200 0.104 0.696
#> SRR1791308 3 0.3764 0.808 0.000 0.216 0.784 0.000
#> SRR1791307 4 0.3219 0.796 0.164 0.000 0.000 0.836
#> SRR1791306 4 0.3219 0.796 0.164 0.000 0.000 0.836
#> SRR1791305 3 0.3873 0.809 0.000 0.228 0.772 0.000
#> SRR1791309 3 0.4839 0.595 0.000 0.200 0.756 0.044
#> SRR1791304 1 0.0000 0.904 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
#> SRR1791347 5 0.2561 1.000 0.000 0.000 0.000 0.144 0.856
#> SRR1791346 3 0.3109 0.768 0.000 0.200 0.800 0.000 0.000
#> SRR1791345 1 0.5449 0.540 0.632 0.000 0.000 0.104 0.264
#> SRR1791344 5 0.2561 1.000 0.000 0.000 0.000 0.144 0.856
#> SRR1791343 3 0.3210 0.768 0.000 0.212 0.788 0.000 0.000
#> SRR1791341 4 0.0162 0.878 0.004 0.000 0.000 0.996 0.000
#> SRR1791342 4 0.3143 0.633 0.000 0.000 0.000 0.796 0.204
#> SRR1791340 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791375 4 0.2230 0.797 0.044 0.000 0.000 0.912 0.044
#> SRR1791374 1 0.2011 0.864 0.908 0.000 0.000 0.004 0.088
#> SRR1791372 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791370 1 0.4763 0.491 0.616 0.000 0.020 0.004 0.360
#> SRR1791373 1 0.2763 0.818 0.848 0.000 0.000 0.004 0.148
#> SRR1791369 1 0.0609 0.911 0.980 0.000 0.000 0.020 0.000
#> SRR1791371 1 0.0162 0.913 0.996 0.000 0.000 0.000 0.004
#> SRR1791368 4 0.0162 0.878 0.004 0.000 0.000 0.996 0.000
#> SRR1791366 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791364 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791367 1 0.0162 0.913 0.996 0.000 0.000 0.000 0.004
#> SRR1791363 4 0.0162 0.878 0.004 0.000 0.000 0.996 0.000
#> SRR1791361 4 0.4747 -0.095 0.484 0.000 0.000 0.500 0.016
#> SRR1791360 1 0.0671 0.911 0.980 0.000 0.000 0.016 0.004
#> SRR1791359 3 0.4210 0.368 0.000 0.000 0.588 0.000 0.412
#> SRR1791358 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 3 0.3210 0.768 0.000 0.212 0.788 0.000 0.000
#> SRR1791357 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791356 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791355 3 0.3210 0.768 0.000 0.212 0.788 0.000 0.000
#> SRR1791362 1 0.2690 0.793 0.844 0.000 0.000 0.156 0.000
#> SRR1791354 3 0.4210 0.368 0.000 0.000 0.588 0.000 0.412
#> SRR1791353 4 0.0162 0.878 0.004 0.000 0.000 0.996 0.000
#> SRR1791352 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791349 3 0.3210 0.768 0.000 0.212 0.788 0.000 0.000
#> SRR1791348 1 0.0510 0.913 0.984 0.000 0.000 0.016 0.000
#> SRR1791351 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 1 0.0609 0.911 0.980 0.000 0.000 0.020 0.000
#> SRR1791339 5 0.2561 1.000 0.000 0.000 0.000 0.144 0.856
#> SRR1791338 2 0.0703 0.977 0.000 0.976 0.024 0.000 0.000
#> SRR1791336 2 0.0703 0.977 0.000 0.976 0.024 0.000 0.000
#> SRR1791337 3 0.1952 0.671 0.000 0.000 0.912 0.004 0.084
#> SRR1791335 2 0.0703 0.977 0.000 0.976 0.024 0.000 0.000
#> SRR1791332 4 0.0162 0.878 0.004 0.000 0.000 0.996 0.000
#> SRR1791331 5 0.2561 1.000 0.000 0.000 0.000 0.144 0.856
#> SRR1791330 1 0.4118 0.473 0.660 0.000 0.000 0.336 0.004
#> SRR1791334 1 0.0510 0.912 0.984 0.000 0.000 0.016 0.000
#> SRR1791328 4 0.0290 0.871 0.000 0.000 0.000 0.992 0.008
#> SRR1791327 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 1 0.3582 0.714 0.768 0.000 0.000 0.224 0.008
#> SRR1791326 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 3 0.3210 0.768 0.000 0.212 0.788 0.000 0.000
#> SRR1791323 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.4210 0.368 0.000 0.000 0.588 0.000 0.412
#> SRR1791329 3 0.3210 0.768 0.000 0.212 0.788 0.000 0.000
#> SRR1791321 1 0.0609 0.911 0.980 0.000 0.000 0.020 0.000
#> SRR1791320 5 0.2561 1.000 0.000 0.000 0.000 0.144 0.856
#> SRR1791325 1 0.4362 0.516 0.632 0.000 0.004 0.004 0.360
#> SRR1791318 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791317 3 0.0703 0.680 0.000 0.000 0.976 0.000 0.024
#> SRR1791313 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791312 1 0.0162 0.913 0.996 0.000 0.000 0.000 0.004
#> SRR1791319 1 0.2011 0.864 0.908 0.000 0.000 0.004 0.088
#> SRR1791316 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791315 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
#> SRR1791311 1 0.0880 0.906 0.968 0.000 0.000 0.032 0.000
#> SRR1791314 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.2561 1.000 0.000 0.000 0.000 0.144 0.856
#> SRR1791308 3 0.3109 0.768 0.000 0.200 0.800 0.000 0.000
#> SRR1791307 4 0.0162 0.878 0.004 0.000 0.000 0.996 0.000
#> SRR1791306 4 0.0162 0.878 0.004 0.000 0.000 0.996 0.000
#> SRR1791305 3 0.3210 0.768 0.000 0.212 0.788 0.000 0.000
#> SRR1791309 3 0.4210 0.368 0.000 0.000 0.588 0.000 0.412
#> SRR1791304 1 0.0162 0.915 0.996 0.000 0.000 0.004 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791346 2 0.2340 0.903 0.000 0.852 0.000 0.000 0.000 0.148
#> SRR1791345 1 0.7970 0.341 0.376 0.048 0.212 0.104 0.260 0.000
#> SRR1791344 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791343 2 0.2454 0.908 0.000 0.840 0.000 0.000 0.000 0.160
#> SRR1791341 4 0.0291 0.945 0.004 0.000 0.004 0.992 0.000 0.000
#> SRR1791342 4 0.3592 0.497 0.000 0.000 0.000 0.656 0.344 0.000
#> SRR1791340 6 0.1141 0.946 0.000 0.052 0.000 0.000 0.000 0.948
#> SRR1791375 4 0.2001 0.873 0.000 0.048 0.000 0.912 0.040 0.000
#> SRR1791374 1 0.4419 0.745 0.728 0.132 0.136 0.004 0.000 0.000
#> SRR1791372 1 0.0146 0.823 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1791370 1 0.7593 0.319 0.360 0.148 0.232 0.004 0.256 0.000
#> SRR1791373 1 0.5123 0.725 0.708 0.100 0.140 0.004 0.048 0.000
#> SRR1791369 1 0.1858 0.815 0.912 0.000 0.076 0.012 0.000 0.000
#> SRR1791371 1 0.3254 0.790 0.816 0.048 0.136 0.000 0.000 0.000
#> SRR1791368 4 0.0291 0.945 0.004 0.000 0.004 0.992 0.000 0.000
#> SRR1791366 6 0.0000 0.967 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791364 1 0.0000 0.823 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.3254 0.790 0.816 0.048 0.136 0.000 0.000 0.000
#> SRR1791363 4 0.0146 0.944 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1791361 1 0.6077 0.214 0.464 0.000 0.024 0.372 0.140 0.000
#> SRR1791360 1 0.2908 0.813 0.864 0.048 0.076 0.012 0.000 0.000
#> SRR1791359 3 0.3023 1.000 0.000 0.004 0.784 0.000 0.212 0.000
#> SRR1791358 6 0.0000 0.967 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791365 2 0.2454 0.908 0.000 0.840 0.000 0.000 0.000 0.160
#> SRR1791357 1 0.2178 0.801 0.868 0.000 0.132 0.000 0.000 0.000
#> SRR1791356 1 0.2178 0.801 0.868 0.000 0.132 0.000 0.000 0.000
#> SRR1791355 2 0.2454 0.908 0.000 0.840 0.000 0.000 0.000 0.160
#> SRR1791362 1 0.3801 0.754 0.784 0.008 0.060 0.148 0.000 0.000
#> SRR1791354 3 0.3023 1.000 0.000 0.004 0.784 0.000 0.212 0.000
#> SRR1791353 4 0.0146 0.944 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1791352 1 0.0547 0.823 0.980 0.000 0.020 0.000 0.000 0.000
#> SRR1791349 2 0.2454 0.908 0.000 0.840 0.000 0.000 0.000 0.160
#> SRR1791348 1 0.1757 0.816 0.916 0.000 0.076 0.008 0.000 0.000
#> SRR1791351 6 0.0000 0.967 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791350 1 0.1858 0.815 0.912 0.000 0.076 0.012 0.000 0.000
#> SRR1791339 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791338 6 0.1501 0.931 0.000 0.076 0.000 0.000 0.000 0.924
#> SRR1791336 6 0.1501 0.931 0.000 0.076 0.000 0.000 0.000 0.924
#> SRR1791337 2 0.3668 0.407 0.000 0.668 0.328 0.004 0.000 0.000
#> SRR1791335 6 0.1501 0.931 0.000 0.076 0.000 0.000 0.000 0.924
#> SRR1791332 4 0.0146 0.944 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1791331 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791330 1 0.5078 0.499 0.596 0.048 0.024 0.332 0.000 0.000
#> SRR1791334 1 0.2842 0.813 0.868 0.044 0.076 0.012 0.000 0.000
#> SRR1791328 4 0.0458 0.935 0.000 0.000 0.000 0.984 0.016 0.000
#> SRR1791327 6 0.0000 0.967 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 1 0.4576 0.671 0.696 0.000 0.076 0.220 0.008 0.000
#> SRR1791326 6 0.0000 0.967 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791324 2 0.2454 0.908 0.000 0.840 0.000 0.000 0.000 0.160
#> SRR1791323 6 0.0000 0.967 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791322 3 0.3023 1.000 0.000 0.004 0.784 0.000 0.212 0.000
#> SRR1791329 2 0.2454 0.908 0.000 0.840 0.000 0.000 0.000 0.160
#> SRR1791321 1 0.1858 0.815 0.912 0.000 0.076 0.012 0.000 0.000
#> SRR1791320 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791325 1 0.7548 0.349 0.376 0.148 0.216 0.004 0.256 0.000
#> SRR1791318 1 0.0000 0.823 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791317 2 0.3737 0.370 0.000 0.608 0.392 0.000 0.000 0.000
#> SRR1791313 1 0.0000 0.823 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791312 1 0.1434 0.824 0.940 0.048 0.012 0.000 0.000 0.000
#> SRR1791319 1 0.4419 0.745 0.728 0.132 0.136 0.004 0.000 0.000
#> SRR1791316 1 0.2178 0.801 0.868 0.000 0.132 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.823 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791311 1 0.2122 0.813 0.900 0.000 0.076 0.024 0.000 0.000
#> SRR1791314 6 0.0000 0.967 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791310 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791308 2 0.2340 0.903 0.000 0.852 0.000 0.000 0.000 0.148
#> SRR1791307 4 0.0291 0.945 0.004 0.000 0.004 0.992 0.000 0.000
#> SRR1791306 4 0.0291 0.945 0.004 0.000 0.004 0.992 0.000 0.000
#> SRR1791305 2 0.2454 0.908 0.000 0.840 0.000 0.000 0.000 0.160
#> SRR1791309 3 0.3023 1.000 0.000 0.004 0.784 0.000 0.212 0.000
#> SRR1791304 1 0.0000 0.823 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.975 0.989 0.4943 0.507 0.507
#> 3 3 0.639 0.701 0.791 0.3128 0.792 0.602
#> 4 4 0.723 0.776 0.850 0.1368 0.895 0.695
#> 5 5 0.726 0.678 0.793 0.0669 0.917 0.700
#> 6 6 0.748 0.670 0.813 0.0456 0.924 0.672
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
#> SRR1791347 2 0.141 0.974 0.020 0.980
#> SRR1791346 2 0.000 0.992 0.000 1.000
#> SRR1791345 1 0.000 0.987 1.000 0.000
#> SRR1791344 1 0.722 0.747 0.800 0.200
#> SRR1791343 2 0.000 0.992 0.000 1.000
#> SRR1791341 1 0.000 0.987 1.000 0.000
#> SRR1791342 1 0.000 0.987 1.000 0.000
#> SRR1791340 2 0.000 0.992 0.000 1.000
#> SRR1791375 1 0.000 0.987 1.000 0.000
#> SRR1791374 1 0.000 0.987 1.000 0.000
#> SRR1791372 1 0.000 0.987 1.000 0.000
#> SRR1791370 1 0.000 0.987 1.000 0.000
#> SRR1791373 1 0.000 0.987 1.000 0.000
#> SRR1791369 1 0.000 0.987 1.000 0.000
#> SRR1791371 1 0.000 0.987 1.000 0.000
#> SRR1791368 1 0.000 0.987 1.000 0.000
#> SRR1791366 2 0.000 0.992 0.000 1.000
#> SRR1791364 1 0.000 0.987 1.000 0.000
#> SRR1791367 1 0.000 0.987 1.000 0.000
#> SRR1791363 1 0.000 0.987 1.000 0.000
#> SRR1791361 1 0.000 0.987 1.000 0.000
#> SRR1791360 1 0.000 0.987 1.000 0.000
#> SRR1791359 2 0.000 0.992 0.000 1.000
#> SRR1791358 2 0.000 0.992 0.000 1.000
#> SRR1791365 2 0.000 0.992 0.000 1.000
#> SRR1791357 1 0.000 0.987 1.000 0.000
#> SRR1791356 1 0.000 0.987 1.000 0.000
#> SRR1791355 2 0.000 0.992 0.000 1.000
#> SRR1791362 1 0.000 0.987 1.000 0.000
#> SRR1791354 2 0.000 0.992 0.000 1.000
#> SRR1791353 1 0.000 0.987 1.000 0.000
#> SRR1791352 1 0.000 0.987 1.000 0.000
#> SRR1791349 2 0.000 0.992 0.000 1.000
#> SRR1791348 1 0.000 0.987 1.000 0.000
#> SRR1791351 2 0.000 0.992 0.000 1.000
#> SRR1791350 1 0.000 0.987 1.000 0.000
#> SRR1791339 2 0.722 0.746 0.200 0.800
#> SRR1791338 2 0.000 0.992 0.000 1.000
#> SRR1791336 2 0.000 0.992 0.000 1.000
#> SRR1791337 2 0.000 0.992 0.000 1.000
#> SRR1791335 2 0.000 0.992 0.000 1.000
#> SRR1791332 1 0.000 0.987 1.000 0.000
#> SRR1791331 2 0.000 0.992 0.000 1.000
#> SRR1791330 1 0.000 0.987 1.000 0.000
#> SRR1791334 1 0.000 0.987 1.000 0.000
#> SRR1791328 1 0.000 0.987 1.000 0.000
#> SRR1791327 2 0.000 0.992 0.000 1.000
#> SRR1791333 1 0.000 0.987 1.000 0.000
#> SRR1791326 2 0.000 0.992 0.000 1.000
#> SRR1791324 2 0.000 0.992 0.000 1.000
#> SRR1791323 2 0.000 0.992 0.000 1.000
#> SRR1791322 2 0.000 0.992 0.000 1.000
#> SRR1791329 2 0.000 0.992 0.000 1.000
#> SRR1791321 1 0.000 0.987 1.000 0.000
#> SRR1791320 1 0.909 0.522 0.676 0.324
#> SRR1791325 1 0.000 0.987 1.000 0.000
#> SRR1791318 1 0.000 0.987 1.000 0.000
#> SRR1791317 2 0.000 0.992 0.000 1.000
#> SRR1791313 1 0.000 0.987 1.000 0.000
#> SRR1791312 1 0.000 0.987 1.000 0.000
#> SRR1791319 1 0.000 0.987 1.000 0.000
#> SRR1791316 1 0.000 0.987 1.000 0.000
#> SRR1791315 1 0.000 0.987 1.000 0.000
#> SRR1791311 1 0.000 0.987 1.000 0.000
#> SRR1791314 2 0.000 0.992 0.000 1.000
#> SRR1791310 2 0.118 0.978 0.016 0.984
#> SRR1791308 2 0.000 0.992 0.000 1.000
#> SRR1791307 1 0.000 0.987 1.000 0.000
#> SRR1791306 1 0.000 0.987 1.000 0.000
#> SRR1791305 2 0.000 0.992 0.000 1.000
#> SRR1791309 2 0.000 0.992 0.000 1.000
#> SRR1791304 1 0.000 0.987 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.6308 0.3115 0.000 0.492 0.508
#> SRR1791346 2 0.2959 0.7557 0.100 0.900 0.000
#> SRR1791345 1 0.6260 0.9097 0.552 0.000 0.448
#> SRR1791344 3 0.6669 0.3455 0.008 0.468 0.524
#> SRR1791343 2 0.5058 0.8117 0.244 0.756 0.000
#> SRR1791341 3 0.0237 0.6885 0.004 0.000 0.996
#> SRR1791342 3 0.6235 0.3895 0.000 0.436 0.564
#> SRR1791340 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791375 3 0.3482 0.6192 0.000 0.128 0.872
#> SRR1791374 1 0.7287 0.8771 0.560 0.032 0.408
#> SRR1791372 1 0.6260 0.9122 0.552 0.000 0.448
#> SRR1791370 1 0.6625 0.2230 0.552 0.440 0.008
#> SRR1791373 1 0.8939 0.6553 0.560 0.176 0.264
#> SRR1791369 1 0.6260 0.9122 0.552 0.000 0.448
#> SRR1791371 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791368 3 0.0237 0.6885 0.004 0.000 0.996
#> SRR1791366 2 0.5178 0.8134 0.256 0.744 0.000
#> SRR1791364 1 0.6260 0.9122 0.552 0.000 0.448
#> SRR1791367 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791363 3 0.0000 0.6906 0.000 0.000 1.000
#> SRR1791361 3 0.0000 0.6906 0.000 0.000 1.000
#> SRR1791360 3 0.6180 -0.6359 0.416 0.000 0.584
#> SRR1791359 2 0.0237 0.6977 0.000 0.996 0.004
#> SRR1791358 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791365 2 0.5859 0.8096 0.344 0.656 0.000
#> SRR1791357 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791356 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791355 2 0.5058 0.8117 0.244 0.756 0.000
#> SRR1791362 3 0.0237 0.6885 0.004 0.000 0.996
#> SRR1791354 2 0.0237 0.6977 0.000 0.996 0.004
#> SRR1791353 3 0.0000 0.6906 0.000 0.000 1.000
#> SRR1791352 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791349 2 0.4887 0.8076 0.228 0.772 0.000
#> SRR1791348 1 0.6299 0.8731 0.524 0.000 0.476
#> SRR1791351 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791350 3 0.3038 0.5251 0.104 0.000 0.896
#> SRR1791339 2 0.6154 -0.1505 0.000 0.592 0.408
#> SRR1791338 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791336 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791337 2 0.6410 -0.0113 0.420 0.576 0.004
#> SRR1791335 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791332 3 0.0000 0.6906 0.000 0.000 1.000
#> SRR1791331 2 0.0000 0.7008 0.000 1.000 0.000
#> SRR1791330 3 0.0000 0.6906 0.000 0.000 1.000
#> SRR1791334 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791328 3 0.0000 0.6906 0.000 0.000 1.000
#> SRR1791327 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791333 3 0.3267 0.5108 0.116 0.000 0.884
#> SRR1791326 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791324 2 0.5291 0.8144 0.268 0.732 0.000
#> SRR1791323 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791322 2 0.0237 0.6977 0.000 0.996 0.004
#> SRR1791329 2 0.5291 0.8144 0.268 0.732 0.000
#> SRR1791321 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791320 3 0.6307 0.3181 0.000 0.488 0.512
#> SRR1791325 1 0.9063 0.5264 0.552 0.248 0.200
#> SRR1791318 1 0.6260 0.9122 0.552 0.000 0.448
#> SRR1791317 2 0.0000 0.7008 0.000 1.000 0.000
#> SRR1791313 1 0.6260 0.9122 0.552 0.000 0.448
#> SRR1791312 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791319 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791316 1 0.6244 0.9161 0.560 0.000 0.440
#> SRR1791315 1 0.6260 0.9122 0.552 0.000 0.448
#> SRR1791311 3 0.3038 0.5251 0.104 0.000 0.896
#> SRR1791314 2 0.6244 0.7950 0.440 0.560 0.000
#> SRR1791310 3 0.6308 0.3115 0.000 0.492 0.508
#> SRR1791308 2 0.5397 0.8144 0.280 0.720 0.000
#> SRR1791307 3 0.0237 0.6885 0.004 0.000 0.996
#> SRR1791306 3 0.0237 0.6885 0.004 0.000 0.996
#> SRR1791305 2 0.5098 0.8124 0.248 0.752 0.000
#> SRR1791309 2 0.0000 0.7008 0.000 1.000 0.000
#> SRR1791304 1 0.6244 0.9161 0.560 0.000 0.440
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.4898 0.3503 0.000 0.000 0.416 0.584
#> SRR1791346 3 0.2125 0.7645 0.000 0.076 0.920 0.004
#> SRR1791345 1 0.2775 0.8747 0.896 0.000 0.020 0.084
#> SRR1791344 4 0.4888 0.3541 0.000 0.000 0.412 0.588
#> SRR1791343 3 0.4897 0.6448 0.000 0.332 0.660 0.008
#> SRR1791341 4 0.2704 0.8285 0.124 0.000 0.000 0.876
#> SRR1791342 4 0.1302 0.7509 0.000 0.000 0.044 0.956
#> SRR1791340 2 0.0592 0.9406 0.000 0.984 0.000 0.016
#> SRR1791375 4 0.1474 0.7816 0.052 0.000 0.000 0.948
#> SRR1791374 1 0.1888 0.8956 0.940 0.000 0.016 0.044
#> SRR1791372 1 0.0817 0.9343 0.976 0.000 0.000 0.024
#> SRR1791370 3 0.1938 0.7483 0.012 0.000 0.936 0.052
#> SRR1791373 1 0.4236 0.7861 0.824 0.000 0.088 0.088
#> SRR1791369 1 0.1406 0.9313 0.960 0.000 0.016 0.024
#> SRR1791371 1 0.0336 0.9305 0.992 0.000 0.000 0.008
#> SRR1791368 4 0.2704 0.8285 0.124 0.000 0.000 0.876
#> SRR1791366 3 0.5263 0.4585 0.000 0.448 0.544 0.008
#> SRR1791364 1 0.0817 0.9343 0.976 0.000 0.000 0.024
#> SRR1791367 1 0.0336 0.9305 0.992 0.000 0.000 0.008
#> SRR1791363 4 0.2704 0.8285 0.124 0.000 0.000 0.876
#> SRR1791361 4 0.2704 0.8285 0.124 0.000 0.000 0.876
#> SRR1791360 1 0.5252 0.3068 0.644 0.000 0.020 0.336
#> SRR1791359 3 0.1913 0.7631 0.000 0.020 0.940 0.040
#> SRR1791358 2 0.0000 0.9436 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.5436 0.1236 0.000 0.620 0.356 0.024
#> SRR1791357 1 0.0469 0.9362 0.988 0.000 0.000 0.012
#> SRR1791356 1 0.0188 0.9348 0.996 0.000 0.000 0.004
#> SRR1791355 3 0.4897 0.6448 0.000 0.332 0.660 0.008
#> SRR1791362 4 0.3392 0.8205 0.124 0.000 0.020 0.856
#> SRR1791354 3 0.1913 0.7631 0.000 0.020 0.940 0.040
#> SRR1791353 4 0.2704 0.8285 0.124 0.000 0.000 0.876
#> SRR1791352 1 0.0469 0.9362 0.988 0.000 0.000 0.012
#> SRR1791349 3 0.4673 0.6738 0.000 0.292 0.700 0.008
#> SRR1791348 1 0.1520 0.9297 0.956 0.000 0.020 0.024
#> SRR1791351 2 0.0000 0.9436 0.000 1.000 0.000 0.000
#> SRR1791350 4 0.4121 0.7717 0.184 0.000 0.020 0.796
#> SRR1791339 3 0.2345 0.7369 0.000 0.000 0.900 0.100
#> SRR1791338 2 0.0707 0.9396 0.000 0.980 0.000 0.020
#> SRR1791336 2 0.0707 0.9396 0.000 0.980 0.000 0.020
#> SRR1791337 3 0.1297 0.7577 0.016 0.000 0.964 0.020
#> SRR1791335 2 0.0707 0.9396 0.000 0.980 0.000 0.020
#> SRR1791332 4 0.2704 0.8285 0.124 0.000 0.000 0.876
#> SRR1791331 3 0.3383 0.7564 0.000 0.052 0.872 0.076
#> SRR1791330 4 0.2760 0.8231 0.128 0.000 0.000 0.872
#> SRR1791334 1 0.1174 0.9331 0.968 0.000 0.020 0.012
#> SRR1791328 4 0.1302 0.7990 0.044 0.000 0.000 0.956
#> SRR1791327 2 0.0000 0.9436 0.000 1.000 0.000 0.000
#> SRR1791333 4 0.5606 0.0964 0.480 0.000 0.020 0.500
#> SRR1791326 2 0.0000 0.9436 0.000 1.000 0.000 0.000
#> SRR1791324 3 0.5138 0.5656 0.000 0.392 0.600 0.008
#> SRR1791323 2 0.0000 0.9436 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.1913 0.7631 0.000 0.020 0.940 0.040
#> SRR1791329 3 0.5125 0.5725 0.000 0.388 0.604 0.008
#> SRR1791321 1 0.1174 0.9331 0.968 0.000 0.020 0.012
#> SRR1791320 4 0.4898 0.3503 0.000 0.000 0.416 0.584
#> SRR1791325 1 0.5250 0.6947 0.736 0.000 0.196 0.068
#> SRR1791318 1 0.0817 0.9343 0.976 0.000 0.000 0.024
#> SRR1791317 3 0.0895 0.7677 0.000 0.020 0.976 0.004
#> SRR1791313 1 0.0817 0.9343 0.976 0.000 0.000 0.024
#> SRR1791312 1 0.1174 0.9331 0.968 0.000 0.020 0.012
#> SRR1791319 1 0.1022 0.9161 0.968 0.000 0.000 0.032
#> SRR1791316 1 0.0469 0.9362 0.988 0.000 0.000 0.012
#> SRR1791315 1 0.0817 0.9343 0.976 0.000 0.000 0.024
#> SRR1791311 4 0.4399 0.7416 0.212 0.000 0.020 0.768
#> SRR1791314 2 0.0000 0.9436 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.4898 0.3503 0.000 0.000 0.416 0.584
#> SRR1791308 3 0.5440 0.5533 0.000 0.384 0.596 0.020
#> SRR1791307 4 0.2704 0.8285 0.124 0.000 0.000 0.876
#> SRR1791306 4 0.2704 0.8285 0.124 0.000 0.000 0.876
#> SRR1791305 3 0.4897 0.6448 0.000 0.332 0.660 0.008
#> SRR1791309 3 0.0895 0.7677 0.000 0.020 0.976 0.004
#> SRR1791304 1 0.0469 0.9362 0.988 0.000 0.000 0.012
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 5 0.6261 0.604038 0.000 0.000 0.200 0.264 0.536
#> SRR1791346 3 0.2450 0.556591 0.000 0.052 0.900 0.000 0.048
#> SRR1791345 1 0.5235 0.485228 0.524 0.000 0.012 0.024 0.440
#> SRR1791344 5 0.6254 0.601636 0.000 0.000 0.196 0.268 0.536
#> SRR1791343 3 0.3480 0.650296 0.000 0.248 0.752 0.000 0.000
#> SRR1791341 4 0.0880 0.894246 0.032 0.000 0.000 0.968 0.000
#> SRR1791342 4 0.4276 0.219714 0.000 0.000 0.004 0.616 0.380
#> SRR1791340 2 0.0798 0.980908 0.000 0.976 0.000 0.008 0.016
#> SRR1791375 4 0.1485 0.846212 0.020 0.000 0.000 0.948 0.032
#> SRR1791374 1 0.4103 0.692738 0.748 0.000 0.012 0.012 0.228
#> SRR1791372 1 0.0880 0.845535 0.968 0.000 0.000 0.032 0.000
#> SRR1791370 5 0.4206 0.147522 0.020 0.000 0.272 0.000 0.708
#> SRR1791373 1 0.4858 0.584713 0.656 0.000 0.012 0.024 0.308
#> SRR1791369 1 0.3085 0.812656 0.852 0.000 0.000 0.032 0.116
#> SRR1791371 1 0.1571 0.822457 0.936 0.000 0.000 0.004 0.060
#> SRR1791368 4 0.1041 0.893290 0.032 0.000 0.000 0.964 0.004
#> SRR1791366 3 0.6623 0.368131 0.000 0.320 0.444 0.000 0.236
#> SRR1791364 1 0.0880 0.845535 0.968 0.000 0.000 0.032 0.000
#> SRR1791367 1 0.1704 0.818869 0.928 0.000 0.000 0.004 0.068
#> SRR1791363 4 0.0880 0.894246 0.032 0.000 0.000 0.968 0.000
#> SRR1791361 4 0.0880 0.894246 0.032 0.000 0.000 0.968 0.000
#> SRR1791360 1 0.6441 0.418508 0.504 0.000 0.000 0.256 0.240
#> SRR1791359 3 0.4227 0.043657 0.000 0.000 0.580 0.000 0.420
#> SRR1791358 2 0.0000 0.987075 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 3 0.4881 0.302049 0.000 0.460 0.520 0.004 0.016
#> SRR1791357 1 0.0609 0.846792 0.980 0.000 0.000 0.020 0.000
#> SRR1791356 1 0.0162 0.843351 0.996 0.000 0.000 0.004 0.000
#> SRR1791355 3 0.3480 0.650296 0.000 0.248 0.752 0.000 0.000
#> SRR1791362 4 0.3035 0.809611 0.032 0.000 0.000 0.856 0.112
#> SRR1791354 3 0.4227 0.043657 0.000 0.000 0.580 0.000 0.420
#> SRR1791353 4 0.0880 0.894246 0.032 0.000 0.000 0.968 0.000
#> SRR1791352 1 0.0609 0.846792 0.980 0.000 0.000 0.020 0.000
#> SRR1791349 3 0.3305 0.643952 0.000 0.224 0.776 0.000 0.000
#> SRR1791348 1 0.3527 0.800181 0.828 0.000 0.000 0.056 0.116
#> SRR1791351 2 0.0000 0.987075 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 4 0.4751 0.685785 0.152 0.000 0.000 0.732 0.116
#> SRR1791339 5 0.4861 0.314063 0.000 0.000 0.428 0.024 0.548
#> SRR1791338 2 0.1087 0.978012 0.000 0.968 0.008 0.008 0.016
#> SRR1791336 2 0.1087 0.978012 0.000 0.968 0.008 0.008 0.016
#> SRR1791337 3 0.4088 0.323628 0.008 0.000 0.688 0.000 0.304
#> SRR1791335 2 0.1087 0.978012 0.000 0.968 0.008 0.008 0.016
#> SRR1791332 4 0.0880 0.894246 0.032 0.000 0.000 0.968 0.000
#> SRR1791331 5 0.5173 0.228204 0.000 0.020 0.460 0.012 0.508
#> SRR1791330 4 0.1364 0.885496 0.036 0.000 0.000 0.952 0.012
#> SRR1791334 1 0.2727 0.815901 0.868 0.000 0.000 0.016 0.116
#> SRR1791328 4 0.1124 0.845087 0.004 0.000 0.000 0.960 0.036
#> SRR1791327 2 0.0000 0.987075 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 1 0.6710 0.270479 0.424 0.000 0.000 0.304 0.272
#> SRR1791326 2 0.0000 0.987075 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 3 0.3876 0.592759 0.000 0.316 0.684 0.000 0.000
#> SRR1791323 2 0.0000 0.987075 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.4256 -0.000757 0.000 0.000 0.564 0.000 0.436
#> SRR1791329 3 0.3816 0.607043 0.000 0.304 0.696 0.000 0.000
#> SRR1791321 1 0.2824 0.815732 0.864 0.000 0.000 0.020 0.116
#> SRR1791320 5 0.6244 0.603619 0.000 0.000 0.200 0.260 0.540
#> SRR1791325 5 0.5552 -0.481430 0.472 0.000 0.036 0.016 0.476
#> SRR1791318 1 0.0794 0.846200 0.972 0.000 0.000 0.028 0.000
#> SRR1791317 3 0.2648 0.463712 0.000 0.000 0.848 0.000 0.152
#> SRR1791313 1 0.0880 0.845535 0.968 0.000 0.000 0.032 0.000
#> SRR1791312 1 0.2824 0.815608 0.864 0.000 0.000 0.020 0.116
#> SRR1791319 1 0.4043 0.701250 0.756 0.000 0.012 0.012 0.220
#> SRR1791316 1 0.0609 0.846792 0.980 0.000 0.000 0.020 0.000
#> SRR1791315 1 0.0880 0.845535 0.968 0.000 0.000 0.032 0.000
#> SRR1791311 4 0.5039 0.643254 0.184 0.000 0.000 0.700 0.116
#> SRR1791314 2 0.0000 0.987075 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.6261 0.604038 0.000 0.000 0.200 0.264 0.536
#> SRR1791308 3 0.4798 0.623283 0.000 0.272 0.684 0.008 0.036
#> SRR1791307 4 0.0880 0.894246 0.032 0.000 0.000 0.968 0.000
#> SRR1791306 4 0.1041 0.893290 0.032 0.000 0.000 0.964 0.004
#> SRR1791305 3 0.3480 0.650296 0.000 0.248 0.752 0.000 0.000
#> SRR1791309 3 0.2561 0.459824 0.000 0.000 0.856 0.000 0.144
#> SRR1791304 1 0.0609 0.846792 0.980 0.000 0.000 0.020 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.3307 0.6973 0.000 0.072 0.000 0.108 0.820 0.000
#> SRR1791346 2 0.1598 0.7086 0.000 0.940 0.008 0.004 0.008 0.040
#> SRR1791345 3 0.4649 0.5329 0.192 0.004 0.704 0.004 0.096 0.000
#> SRR1791344 5 0.3196 0.6926 0.000 0.064 0.000 0.108 0.828 0.000
#> SRR1791343 2 0.2925 0.8031 0.000 0.832 0.004 0.000 0.016 0.148
#> SRR1791341 4 0.0632 0.8882 0.024 0.000 0.000 0.976 0.000 0.000
#> SRR1791342 5 0.3996 0.3781 0.000 0.004 0.008 0.352 0.636 0.000
#> SRR1791340 6 0.1434 0.9569 0.000 0.000 0.012 0.012 0.028 0.948
#> SRR1791375 4 0.1477 0.8529 0.000 0.004 0.008 0.940 0.048 0.000
#> SRR1791374 1 0.4442 -0.1643 0.504 0.004 0.476 0.004 0.012 0.000
#> SRR1791372 1 0.0551 0.7802 0.984 0.004 0.000 0.008 0.004 0.000
#> SRR1791370 3 0.3130 0.3701 0.000 0.048 0.828 0.000 0.124 0.000
#> SRR1791373 3 0.5241 0.1653 0.436 0.004 0.488 0.004 0.068 0.000
#> SRR1791369 1 0.4193 0.5746 0.724 0.000 0.220 0.008 0.048 0.000
#> SRR1791371 1 0.2149 0.6918 0.888 0.000 0.104 0.004 0.004 0.000
#> SRR1791368 4 0.0632 0.8882 0.024 0.000 0.000 0.976 0.000 0.000
#> SRR1791366 2 0.6546 0.2418 0.000 0.436 0.036 0.000 0.320 0.208
#> SRR1791364 1 0.0405 0.7805 0.988 0.000 0.000 0.008 0.004 0.000
#> SRR1791367 1 0.2377 0.6685 0.868 0.000 0.124 0.004 0.004 0.000
#> SRR1791363 4 0.0632 0.8882 0.024 0.000 0.000 0.976 0.000 0.000
#> SRR1791361 4 0.1490 0.8812 0.024 0.004 0.008 0.948 0.016 0.000
#> SRR1791360 3 0.6663 0.4069 0.232 0.004 0.512 0.188 0.064 0.000
#> SRR1791359 5 0.6053 0.3118 0.000 0.376 0.212 0.004 0.408 0.000
#> SRR1791358 6 0.0000 0.9679 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791365 2 0.3778 0.7143 0.000 0.708 0.000 0.000 0.020 0.272
#> SRR1791357 1 0.0291 0.7804 0.992 0.004 0.000 0.004 0.000 0.000
#> SRR1791356 1 0.0653 0.7683 0.980 0.000 0.012 0.004 0.004 0.000
#> SRR1791355 2 0.2925 0.8031 0.000 0.832 0.004 0.000 0.016 0.148
#> SRR1791362 4 0.4621 0.6228 0.024 0.000 0.224 0.700 0.052 0.000
#> SRR1791354 5 0.6053 0.3118 0.000 0.376 0.212 0.004 0.408 0.000
#> SRR1791353 4 0.0891 0.8861 0.024 0.000 0.008 0.968 0.000 0.000
#> SRR1791352 1 0.0146 0.7806 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791349 2 0.3101 0.8016 0.000 0.820 0.000 0.000 0.032 0.148
#> SRR1791348 1 0.4934 0.5259 0.684 0.000 0.220 0.044 0.052 0.000
#> SRR1791351 6 0.0000 0.9679 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791350 4 0.5656 0.5181 0.100 0.000 0.224 0.624 0.052 0.000
#> SRR1791339 5 0.2669 0.6474 0.000 0.156 0.008 0.000 0.836 0.000
#> SRR1791338 6 0.1793 0.9527 0.000 0.012 0.012 0.012 0.028 0.936
#> SRR1791336 6 0.1793 0.9527 0.000 0.012 0.012 0.012 0.028 0.936
#> SRR1791337 3 0.5093 -0.0341 0.000 0.416 0.512 0.004 0.068 0.000
#> SRR1791335 6 0.2494 0.9204 0.000 0.048 0.012 0.012 0.028 0.900
#> SRR1791332 4 0.0632 0.8882 0.024 0.000 0.000 0.976 0.000 0.000
#> SRR1791331 5 0.2994 0.6096 0.000 0.208 0.000 0.000 0.788 0.004
#> SRR1791330 4 0.2176 0.8646 0.020 0.004 0.036 0.916 0.024 0.000
#> SRR1791334 1 0.4364 0.5257 0.688 0.000 0.256 0.004 0.052 0.000
#> SRR1791328 4 0.1542 0.8523 0.000 0.004 0.008 0.936 0.052 0.000
#> SRR1791327 6 0.0000 0.9679 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 3 0.7023 0.4543 0.168 0.004 0.492 0.212 0.124 0.000
#> SRR1791326 6 0.0547 0.9613 0.000 0.000 0.020 0.000 0.000 0.980
#> SRR1791324 2 0.3352 0.7974 0.000 0.792 0.000 0.000 0.032 0.176
#> SRR1791323 6 0.0547 0.9613 0.000 0.000 0.020 0.000 0.000 0.980
#> SRR1791322 5 0.6053 0.3118 0.000 0.376 0.212 0.004 0.408 0.000
#> SRR1791329 2 0.3318 0.7994 0.000 0.796 0.000 0.000 0.032 0.172
#> SRR1791321 1 0.4272 0.5484 0.704 0.000 0.240 0.004 0.052 0.000
#> SRR1791320 5 0.3307 0.6973 0.000 0.072 0.000 0.108 0.820 0.000
#> SRR1791325 3 0.4257 0.5495 0.172 0.004 0.744 0.004 0.076 0.000
#> SRR1791318 1 0.0146 0.7806 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791317 2 0.4373 0.4095 0.000 0.720 0.192 0.004 0.084 0.000
#> SRR1791313 1 0.0405 0.7805 0.988 0.000 0.000 0.008 0.004 0.000
#> SRR1791312 1 0.4284 0.5746 0.720 0.004 0.220 0.004 0.052 0.000
#> SRR1791319 1 0.4442 -0.1643 0.504 0.004 0.476 0.004 0.012 0.000
#> SRR1791316 1 0.0291 0.7804 0.992 0.004 0.000 0.004 0.000 0.000
#> SRR1791315 1 0.0405 0.7805 0.988 0.000 0.000 0.008 0.004 0.000
#> SRR1791311 4 0.5952 0.4629 0.132 0.000 0.224 0.592 0.052 0.000
#> SRR1791314 6 0.0000 0.9679 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791310 5 0.3307 0.6973 0.000 0.072 0.000 0.108 0.820 0.000
#> SRR1791308 2 0.4070 0.7675 0.000 0.764 0.008 0.016 0.032 0.180
#> SRR1791307 4 0.0632 0.8882 0.024 0.000 0.000 0.976 0.000 0.000
#> SRR1791306 4 0.0632 0.8882 0.024 0.000 0.000 0.976 0.000 0.000
#> SRR1791305 2 0.3101 0.8016 0.000 0.820 0.000 0.000 0.032 0.148
#> SRR1791309 2 0.4676 0.3587 0.000 0.684 0.216 0.004 0.096 0.000
#> SRR1791304 1 0.0436 0.7806 0.988 0.004 0.000 0.004 0.004 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.995 0.998 0.5017 0.499 0.499
#> 3 3 0.729 0.873 0.916 0.2945 0.792 0.601
#> 4 4 0.859 0.856 0.934 0.1143 0.878 0.668
#> 5 5 0.967 0.910 0.958 0.0561 0.946 0.814
#> 6 6 0.863 0.808 0.887 0.0380 0.957 0.829
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2
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
#> SRR1791347 2 0.000 1.000 0.000 1.000
#> SRR1791346 2 0.000 1.000 0.000 1.000
#> SRR1791345 1 0.000 0.996 1.000 0.000
#> SRR1791344 2 0.000 1.000 0.000 1.000
#> SRR1791343 2 0.000 1.000 0.000 1.000
#> SRR1791341 1 0.000 0.996 1.000 0.000
#> SRR1791342 1 0.518 0.870 0.884 0.116
#> SRR1791340 2 0.000 1.000 0.000 1.000
#> SRR1791375 1 0.000 0.996 1.000 0.000
#> SRR1791374 1 0.000 0.996 1.000 0.000
#> SRR1791372 1 0.000 0.996 1.000 0.000
#> SRR1791370 1 0.000 0.996 1.000 0.000
#> SRR1791373 1 0.295 0.945 0.948 0.052
#> SRR1791369 1 0.000 0.996 1.000 0.000
#> SRR1791371 1 0.000 0.996 1.000 0.000
#> SRR1791368 1 0.000 0.996 1.000 0.000
#> SRR1791366 2 0.000 1.000 0.000 1.000
#> SRR1791364 1 0.000 0.996 1.000 0.000
#> SRR1791367 1 0.000 0.996 1.000 0.000
#> SRR1791363 1 0.000 0.996 1.000 0.000
#> SRR1791361 1 0.000 0.996 1.000 0.000
#> SRR1791360 1 0.000 0.996 1.000 0.000
#> SRR1791359 2 0.000 1.000 0.000 1.000
#> SRR1791358 2 0.000 1.000 0.000 1.000
#> SRR1791365 2 0.000 1.000 0.000 1.000
#> SRR1791357 1 0.000 0.996 1.000 0.000
#> SRR1791356 1 0.000 0.996 1.000 0.000
#> SRR1791355 2 0.000 1.000 0.000 1.000
#> SRR1791362 1 0.000 0.996 1.000 0.000
#> SRR1791354 2 0.000 1.000 0.000 1.000
#> SRR1791353 1 0.000 0.996 1.000 0.000
#> SRR1791352 1 0.000 0.996 1.000 0.000
#> SRR1791349 2 0.000 1.000 0.000 1.000
#> SRR1791348 1 0.000 0.996 1.000 0.000
#> SRR1791351 2 0.000 1.000 0.000 1.000
#> SRR1791350 1 0.000 0.996 1.000 0.000
#> SRR1791339 2 0.000 1.000 0.000 1.000
#> SRR1791338 2 0.000 1.000 0.000 1.000
#> SRR1791336 2 0.000 1.000 0.000 1.000
#> SRR1791337 2 0.000 1.000 0.000 1.000
#> SRR1791335 2 0.000 1.000 0.000 1.000
#> SRR1791332 1 0.000 0.996 1.000 0.000
#> SRR1791331 2 0.000 1.000 0.000 1.000
#> SRR1791330 1 0.000 0.996 1.000 0.000
#> SRR1791334 1 0.000 0.996 1.000 0.000
#> SRR1791328 1 0.000 0.996 1.000 0.000
#> SRR1791327 2 0.000 1.000 0.000 1.000
#> SRR1791333 1 0.000 0.996 1.000 0.000
#> SRR1791326 2 0.000 1.000 0.000 1.000
#> SRR1791324 2 0.000 1.000 0.000 1.000
#> SRR1791323 2 0.000 1.000 0.000 1.000
#> SRR1791322 2 0.000 1.000 0.000 1.000
#> SRR1791329 2 0.000 1.000 0.000 1.000
#> SRR1791321 1 0.000 0.996 1.000 0.000
#> SRR1791320 2 0.000 1.000 0.000 1.000
#> SRR1791325 1 0.000 0.996 1.000 0.000
#> SRR1791318 1 0.000 0.996 1.000 0.000
#> SRR1791317 2 0.000 1.000 0.000 1.000
#> SRR1791313 1 0.000 0.996 1.000 0.000
#> SRR1791312 1 0.000 0.996 1.000 0.000
#> SRR1791319 1 0.000 0.996 1.000 0.000
#> SRR1791316 1 0.000 0.996 1.000 0.000
#> SRR1791315 1 0.000 0.996 1.000 0.000
#> SRR1791311 1 0.000 0.996 1.000 0.000
#> SRR1791314 2 0.000 1.000 0.000 1.000
#> SRR1791310 2 0.000 1.000 0.000 1.000
#> SRR1791308 2 0.000 1.000 0.000 1.000
#> SRR1791307 1 0.000 0.996 1.000 0.000
#> SRR1791306 1 0.000 0.996 1.000 0.000
#> SRR1791305 2 0.000 1.000 0.000 1.000
#> SRR1791309 2 0.000 1.000 0.000 1.000
#> SRR1791304 1 0.000 0.996 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.613 0.399 0.000 0.400 0.600
#> SRR1791346 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791345 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791344 3 0.455 0.692 0.000 0.200 0.800
#> SRR1791343 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791341 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791342 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791340 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791375 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791374 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791372 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791370 1 0.000 0.786 1.000 0.000 0.000
#> SRR1791373 1 0.485 0.790 0.836 0.128 0.036
#> SRR1791369 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791371 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791368 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791366 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791364 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791367 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791363 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791361 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791360 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791359 2 0.406 0.860 0.164 0.836 0.000
#> SRR1791358 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791365 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791357 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791356 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791355 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791362 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791354 2 0.406 0.860 0.164 0.836 0.000
#> SRR1791353 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791352 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791349 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791348 1 0.455 0.920 0.800 0.000 0.200
#> SRR1791351 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791350 3 0.620 -0.186 0.424 0.000 0.576
#> SRR1791339 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791338 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791336 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791337 2 0.424 0.850 0.176 0.824 0.000
#> SRR1791335 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791332 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791331 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791330 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791334 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791328 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791327 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791333 1 0.571 0.768 0.680 0.000 0.320
#> SRR1791326 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791324 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791323 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791322 2 0.406 0.860 0.164 0.836 0.000
#> SRR1791329 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791321 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791320 3 0.613 0.399 0.000 0.400 0.600
#> SRR1791325 1 0.000 0.786 1.000 0.000 0.000
#> SRR1791318 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791317 2 0.406 0.860 0.164 0.836 0.000
#> SRR1791313 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791312 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791319 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791316 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791315 1 0.406 0.953 0.836 0.000 0.164
#> SRR1791311 1 0.625 0.529 0.556 0.000 0.444
#> SRR1791314 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791310 3 0.613 0.399 0.000 0.400 0.600
#> SRR1791308 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791307 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791306 3 0.000 0.858 0.000 0.000 1.000
#> SRR1791305 2 0.000 0.964 0.000 1.000 0.000
#> SRR1791309 2 0.406 0.860 0.164 0.836 0.000
#> SRR1791304 1 0.406 0.953 0.836 0.000 0.164
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 2 0.6471 0.216 0.000 0.512 0.072 0.416
#> SRR1791346 2 0.4164 0.619 0.000 0.736 0.264 0.000
#> SRR1791345 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791344 4 0.6407 0.132 0.000 0.384 0.072 0.544
#> SRR1791343 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791341 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791342 4 0.1792 0.833 0.000 0.000 0.068 0.932
#> SRR1791340 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791375 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791374 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791372 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791370 3 0.2408 0.843 0.104 0.000 0.896 0.000
#> SRR1791373 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> SRR1791369 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791371 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791368 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791366 2 0.0188 0.881 0.000 0.996 0.004 0.000
#> SRR1791364 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791363 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791361 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791360 1 0.1211 0.944 0.960 0.000 0.000 0.040
#> SRR1791359 3 0.1792 0.972 0.000 0.068 0.932 0.000
#> SRR1791358 2 0.0188 0.881 0.000 0.996 0.004 0.000
#> SRR1791365 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791357 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791355 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791362 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791354 3 0.1792 0.972 0.000 0.068 0.932 0.000
#> SRR1791353 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791352 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791349 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791348 1 0.1940 0.907 0.924 0.000 0.000 0.076
#> SRR1791351 2 0.0188 0.881 0.000 0.996 0.004 0.000
#> SRR1791350 4 0.4454 0.518 0.308 0.000 0.000 0.692
#> SRR1791339 2 0.1867 0.842 0.000 0.928 0.072 0.000
#> SRR1791338 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791336 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791337 3 0.1867 0.972 0.000 0.072 0.928 0.000
#> SRR1791335 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791332 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791331 2 0.1867 0.842 0.000 0.928 0.072 0.000
#> SRR1791330 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791334 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791328 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791327 2 0.0188 0.881 0.000 0.996 0.004 0.000
#> SRR1791333 1 0.3764 0.719 0.784 0.000 0.000 0.216
#> SRR1791326 2 0.0188 0.881 0.000 0.996 0.004 0.000
#> SRR1791324 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791323 2 0.1867 0.842 0.000 0.928 0.072 0.000
#> SRR1791322 3 0.1792 0.972 0.000 0.068 0.932 0.000
#> SRR1791329 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791321 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791320 2 0.6471 0.216 0.000 0.512 0.072 0.416
#> SRR1791325 1 0.2345 0.885 0.900 0.000 0.100 0.000
#> SRR1791318 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.1867 0.972 0.000 0.072 0.928 0.000
#> SRR1791313 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791319 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791316 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.979 1.000 0.000 0.000 0.000
#> SRR1791311 4 0.4907 0.237 0.420 0.000 0.000 0.580
#> SRR1791314 2 0.0000 0.881 0.000 1.000 0.000 0.000
#> SRR1791310 2 0.6465 0.227 0.000 0.516 0.072 0.412
#> SRR1791308 2 0.3266 0.752 0.000 0.832 0.168 0.000
#> SRR1791307 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791306 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791305 2 0.1022 0.884 0.000 0.968 0.032 0.000
#> SRR1791309 3 0.1867 0.972 0.000 0.072 0.928 0.000
#> SRR1791304 1 0.0000 0.979 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
#> SRR1791347 5 0.1485 0.9814 0.000 0.032 0.000 0.020 0.948
#> SRR1791346 2 0.1502 0.8973 0.000 0.940 0.056 0.000 0.004
#> SRR1791345 1 0.1484 0.9242 0.944 0.000 0.000 0.048 0.008
#> SRR1791344 5 0.1493 0.9776 0.000 0.024 0.000 0.028 0.948
#> SRR1791343 2 0.0324 0.9391 0.000 0.992 0.004 0.000 0.004
#> SRR1791341 4 0.0290 0.9370 0.000 0.000 0.000 0.992 0.008
#> SRR1791342 5 0.1341 0.9426 0.000 0.000 0.000 0.056 0.944
#> SRR1791340 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791375 4 0.0404 0.9352 0.000 0.000 0.000 0.988 0.012
#> SRR1791374 1 0.1251 0.9416 0.956 0.000 0.008 0.000 0.036
#> SRR1791372 1 0.0000 0.9582 1.000 0.000 0.000 0.000 0.000
#> SRR1791370 3 0.0000 0.9868 0.000 0.000 1.000 0.000 0.000
#> SRR1791373 1 0.1251 0.9416 0.956 0.000 0.008 0.000 0.036
#> SRR1791369 1 0.0693 0.9514 0.980 0.000 0.000 0.008 0.012
#> SRR1791371 1 0.0404 0.9560 0.988 0.000 0.000 0.000 0.012
#> SRR1791368 4 0.0290 0.9370 0.000 0.000 0.000 0.992 0.008
#> SRR1791366 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791364 1 0.0000 0.9582 1.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.0609 0.9532 0.980 0.000 0.000 0.000 0.020
#> SRR1791363 4 0.0290 0.9370 0.000 0.000 0.000 0.992 0.008
#> SRR1791361 4 0.0162 0.9365 0.000 0.000 0.000 0.996 0.004
#> SRR1791360 1 0.3942 0.6291 0.728 0.000 0.000 0.260 0.012
#> SRR1791359 3 0.0404 0.9920 0.000 0.012 0.988 0.000 0.000
#> SRR1791358 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.0162 0.9578 0.996 0.000 0.000 0.000 0.004
#> SRR1791356 1 0.0404 0.9560 0.988 0.000 0.000 0.000 0.012
#> SRR1791355 2 0.0324 0.9391 0.000 0.992 0.004 0.000 0.004
#> SRR1791362 4 0.0566 0.9257 0.004 0.000 0.000 0.984 0.012
#> SRR1791354 3 0.0404 0.9920 0.000 0.012 0.988 0.000 0.000
#> SRR1791353 4 0.0404 0.9352 0.000 0.000 0.000 0.988 0.012
#> SRR1791352 1 0.0162 0.9578 0.996 0.000 0.000 0.000 0.004
#> SRR1791349 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791348 1 0.3280 0.7778 0.812 0.000 0.000 0.176 0.012
#> SRR1791351 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 4 0.1364 0.9003 0.036 0.000 0.000 0.952 0.012
#> SRR1791339 2 0.4235 0.3060 0.000 0.576 0.000 0.000 0.424
#> SRR1791338 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791336 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791337 3 0.0162 0.9865 0.000 0.000 0.996 0.000 0.004
#> SRR1791335 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 4 0.0290 0.9370 0.000 0.000 0.000 0.992 0.008
#> SRR1791331 2 0.4060 0.4641 0.000 0.640 0.000 0.000 0.360
#> SRR1791330 4 0.0000 0.9353 0.000 0.000 0.000 1.000 0.000
#> SRR1791334 1 0.0807 0.9494 0.976 0.000 0.000 0.012 0.012
#> SRR1791328 4 0.0609 0.9302 0.000 0.000 0.000 0.980 0.020
#> SRR1791327 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 4 0.4650 0.0512 0.468 0.000 0.000 0.520 0.012
#> SRR1791326 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.3424 0.6797 0.000 0.760 0.000 0.000 0.240
#> SRR1791322 3 0.0404 0.9920 0.000 0.012 0.988 0.000 0.000
#> SRR1791329 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 1 0.0693 0.9514 0.980 0.000 0.000 0.008 0.012
#> SRR1791320 5 0.1485 0.9814 0.000 0.032 0.000 0.020 0.948
#> SRR1791325 1 0.3019 0.8728 0.864 0.000 0.088 0.000 0.048
#> SRR1791318 1 0.0000 0.9582 1.000 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.0451 0.9909 0.000 0.008 0.988 0.000 0.004
#> SRR1791313 1 0.0000 0.9582 1.000 0.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 0.9582 1.000 0.000 0.000 0.000 0.000
#> SRR1791319 1 0.1251 0.9416 0.956 0.000 0.008 0.000 0.036
#> SRR1791316 1 0.0000 0.9582 1.000 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.9582 1.000 0.000 0.000 0.000 0.000
#> SRR1791311 4 0.1522 0.8921 0.044 0.000 0.000 0.944 0.012
#> SRR1791314 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.1485 0.9814 0.000 0.032 0.000 0.020 0.948
#> SRR1791308 2 0.0771 0.9281 0.000 0.976 0.020 0.000 0.004
#> SRR1791307 4 0.0290 0.9370 0.000 0.000 0.000 0.992 0.008
#> SRR1791306 4 0.0000 0.9353 0.000 0.000 0.000 1.000 0.000
#> SRR1791305 2 0.0000 0.9435 0.000 1.000 0.000 0.000 0.000
#> SRR1791309 3 0.0290 0.9921 0.000 0.008 0.992 0.000 0.000
#> SRR1791304 1 0.0000 0.9582 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
#> SRR1791347 5 0.0551 0.967 0.000 0.004 0.000 0.008 0.984 0.004
#> SRR1791346 2 0.4180 0.664 0.000 0.680 0.024 0.000 0.008 0.288
#> SRR1791345 1 0.3374 0.491 0.772 0.000 0.000 0.020 0.000 0.208
#> SRR1791344 5 0.0603 0.967 0.000 0.004 0.000 0.016 0.980 0.000
#> SRR1791343 2 0.3421 0.724 0.000 0.736 0.000 0.000 0.008 0.256
#> SRR1791341 4 0.0000 0.924 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791342 5 0.1444 0.913 0.000 0.000 0.000 0.072 0.928 0.000
#> SRR1791340 2 0.0622 0.885 0.000 0.980 0.008 0.000 0.000 0.012
#> SRR1791375 4 0.0363 0.920 0.000 0.000 0.000 0.988 0.012 0.000
#> SRR1791374 6 0.3851 0.950 0.460 0.000 0.000 0.000 0.000 0.540
#> SRR1791372 1 0.0000 0.816 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791370 3 0.2730 0.798 0.000 0.000 0.808 0.000 0.000 0.192
#> SRR1791373 6 0.3979 0.947 0.456 0.000 0.000 0.000 0.004 0.540
#> SRR1791369 1 0.0632 0.805 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1791371 1 0.2854 0.470 0.792 0.000 0.000 0.000 0.000 0.208
#> SRR1791368 4 0.0146 0.924 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1791366 2 0.1577 0.878 0.000 0.940 0.008 0.000 0.016 0.036
#> SRR1791364 1 0.0458 0.813 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1791367 1 0.2969 0.415 0.776 0.000 0.000 0.000 0.000 0.224
#> SRR1791363 4 0.0146 0.923 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR1791361 4 0.0260 0.923 0.000 0.000 0.000 0.992 0.000 0.008
#> SRR1791360 1 0.3806 0.447 0.752 0.000 0.000 0.200 0.000 0.048
#> SRR1791359 3 0.0000 0.867 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791358 2 0.1483 0.879 0.000 0.944 0.008 0.000 0.012 0.036
#> SRR1791365 2 0.0146 0.886 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791357 1 0.1267 0.782 0.940 0.000 0.000 0.000 0.000 0.060
#> SRR1791356 1 0.2793 0.495 0.800 0.000 0.000 0.000 0.000 0.200
#> SRR1791355 2 0.3421 0.724 0.000 0.736 0.000 0.000 0.008 0.256
#> SRR1791362 4 0.1549 0.884 0.020 0.000 0.000 0.936 0.000 0.044
#> SRR1791354 3 0.0000 0.867 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791353 4 0.0260 0.922 0.000 0.000 0.000 0.992 0.008 0.000
#> SRR1791352 1 0.1327 0.778 0.936 0.000 0.000 0.000 0.000 0.064
#> SRR1791349 2 0.0363 0.886 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR1791348 1 0.1498 0.775 0.940 0.000 0.000 0.028 0.000 0.032
#> SRR1791351 2 0.1483 0.879 0.000 0.944 0.008 0.000 0.012 0.036
#> SRR1791350 4 0.4107 0.613 0.256 0.000 0.000 0.700 0.000 0.044
#> SRR1791339 2 0.5127 0.422 0.000 0.556 0.000 0.000 0.348 0.096
#> SRR1791338 2 0.0260 0.886 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1791336 2 0.0260 0.886 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1791337 3 0.4045 0.669 0.000 0.000 0.564 0.000 0.008 0.428
#> SRR1791335 2 0.0260 0.886 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1791332 4 0.0146 0.923 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR1791331 2 0.4224 0.654 0.000 0.700 0.008 0.000 0.256 0.036
#> SRR1791330 4 0.0260 0.923 0.000 0.000 0.000 0.992 0.000 0.008
#> SRR1791334 1 0.1265 0.782 0.948 0.000 0.000 0.008 0.000 0.044
#> SRR1791328 4 0.0363 0.920 0.000 0.000 0.000 0.988 0.012 0.000
#> SRR1791327 2 0.1483 0.879 0.000 0.944 0.008 0.000 0.012 0.036
#> SRR1791333 1 0.3830 0.430 0.744 0.000 0.000 0.212 0.000 0.044
#> SRR1791326 2 0.1577 0.878 0.000 0.940 0.008 0.000 0.016 0.036
#> SRR1791324 2 0.0363 0.886 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR1791323 2 0.3346 0.786 0.000 0.816 0.008 0.000 0.140 0.036
#> SRR1791322 3 0.0000 0.867 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791329 2 0.0713 0.881 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR1791321 1 0.0935 0.797 0.964 0.000 0.000 0.004 0.000 0.032
#> SRR1791320 5 0.1116 0.958 0.000 0.004 0.000 0.008 0.960 0.028
#> SRR1791325 6 0.3975 0.876 0.392 0.000 0.008 0.000 0.000 0.600
#> SRR1791318 1 0.0713 0.809 0.972 0.000 0.000 0.000 0.000 0.028
#> SRR1791317 3 0.3672 0.737 0.000 0.004 0.712 0.000 0.008 0.276
#> SRR1791313 1 0.0000 0.816 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791312 1 0.0260 0.814 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR1791319 6 0.3851 0.950 0.460 0.000 0.000 0.000 0.000 0.540
#> SRR1791316 1 0.0790 0.807 0.968 0.000 0.000 0.000 0.000 0.032
#> SRR1791315 1 0.0000 0.816 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791311 4 0.4493 0.457 0.344 0.000 0.000 0.612 0.000 0.044
#> SRR1791314 2 0.0865 0.883 0.000 0.964 0.000 0.000 0.000 0.036
#> SRR1791310 5 0.0405 0.968 0.000 0.004 0.000 0.008 0.988 0.000
#> SRR1791308 2 0.3733 0.689 0.000 0.700 0.004 0.000 0.008 0.288
#> SRR1791307 4 0.0000 0.924 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791306 4 0.0146 0.924 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1791305 2 0.0146 0.886 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791309 3 0.0000 0.867 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791304 1 0.0713 0.809 0.972 0.000 0.000 0.000 0.000 0.028
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 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 1.000 0.984 0.993 0.5033 0.496 0.496
#> 3 3 0.745 0.755 0.812 0.2492 0.868 0.738
#> 4 4 0.654 0.795 0.840 0.1264 0.794 0.530
#> 5 5 0.762 0.729 0.842 0.0895 0.913 0.716
#> 6 6 0.752 0.731 0.873 0.0584 0.838 0.443
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
#> SRR1791347 2 0.0672 0.981 0.008 0.992
#> SRR1791346 2 0.0000 0.988 0.000 1.000
#> SRR1791345 1 0.0000 0.997 1.000 0.000
#> SRR1791344 2 0.2948 0.938 0.052 0.948
#> SRR1791343 2 0.0000 0.988 0.000 1.000
#> SRR1791341 1 0.0000 0.997 1.000 0.000
#> SRR1791342 2 0.9000 0.543 0.316 0.684
#> SRR1791340 2 0.0000 0.988 0.000 1.000
#> SRR1791375 1 0.0000 0.997 1.000 0.000
#> SRR1791374 1 0.0000 0.997 1.000 0.000
#> SRR1791372 1 0.0000 0.997 1.000 0.000
#> SRR1791370 1 0.2236 0.961 0.964 0.036
#> SRR1791373 1 0.4431 0.898 0.908 0.092
#> SRR1791369 1 0.0000 0.997 1.000 0.000
#> SRR1791371 1 0.0000 0.997 1.000 0.000
#> SRR1791368 1 0.0000 0.997 1.000 0.000
#> SRR1791366 2 0.0000 0.988 0.000 1.000
#> SRR1791364 1 0.0000 0.997 1.000 0.000
#> SRR1791367 1 0.0000 0.997 1.000 0.000
#> SRR1791363 1 0.0000 0.997 1.000 0.000
#> SRR1791361 1 0.0000 0.997 1.000 0.000
#> SRR1791360 1 0.0000 0.997 1.000 0.000
#> SRR1791359 2 0.0000 0.988 0.000 1.000
#> SRR1791358 2 0.0000 0.988 0.000 1.000
#> SRR1791365 2 0.0000 0.988 0.000 1.000
#> SRR1791357 1 0.0000 0.997 1.000 0.000
#> SRR1791356 1 0.0000 0.997 1.000 0.000
#> SRR1791355 2 0.0000 0.988 0.000 1.000
#> SRR1791362 1 0.0000 0.997 1.000 0.000
#> SRR1791354 2 0.0000 0.988 0.000 1.000
#> SRR1791353 1 0.0000 0.997 1.000 0.000
#> SRR1791352 1 0.0000 0.997 1.000 0.000
#> SRR1791349 2 0.0000 0.988 0.000 1.000
#> SRR1791348 1 0.0000 0.997 1.000 0.000
#> SRR1791351 2 0.0000 0.988 0.000 1.000
#> SRR1791350 1 0.0000 0.997 1.000 0.000
#> SRR1791339 2 0.0000 0.988 0.000 1.000
#> SRR1791338 2 0.0000 0.988 0.000 1.000
#> SRR1791336 2 0.0000 0.988 0.000 1.000
#> SRR1791337 2 0.0000 0.988 0.000 1.000
#> SRR1791335 2 0.0000 0.988 0.000 1.000
#> SRR1791332 1 0.0000 0.997 1.000 0.000
#> SRR1791331 2 0.0000 0.988 0.000 1.000
#> SRR1791330 1 0.0000 0.997 1.000 0.000
#> SRR1791334 1 0.0000 0.997 1.000 0.000
#> SRR1791328 1 0.0000 0.997 1.000 0.000
#> SRR1791327 2 0.0000 0.988 0.000 1.000
#> SRR1791333 1 0.0000 0.997 1.000 0.000
#> SRR1791326 2 0.0000 0.988 0.000 1.000
#> SRR1791324 2 0.0000 0.988 0.000 1.000
#> SRR1791323 2 0.0000 0.988 0.000 1.000
#> SRR1791322 2 0.0000 0.988 0.000 1.000
#> SRR1791329 2 0.0000 0.988 0.000 1.000
#> SRR1791321 1 0.0000 0.997 1.000 0.000
#> SRR1791320 2 0.0376 0.985 0.004 0.996
#> SRR1791325 1 0.0000 0.997 1.000 0.000
#> SRR1791318 1 0.0000 0.997 1.000 0.000
#> SRR1791317 2 0.0000 0.988 0.000 1.000
#> SRR1791313 1 0.0000 0.997 1.000 0.000
#> SRR1791312 1 0.0000 0.997 1.000 0.000
#> SRR1791319 1 0.0000 0.997 1.000 0.000
#> SRR1791316 1 0.0000 0.997 1.000 0.000
#> SRR1791315 1 0.0000 0.997 1.000 0.000
#> SRR1791311 1 0.0000 0.997 1.000 0.000
#> SRR1791314 2 0.0000 0.988 0.000 1.000
#> SRR1791310 2 0.0000 0.988 0.000 1.000
#> SRR1791308 2 0.0000 0.988 0.000 1.000
#> SRR1791307 1 0.0000 0.997 1.000 0.000
#> SRR1791306 1 0.0000 0.997 1.000 0.000
#> SRR1791305 2 0.0000 0.988 0.000 1.000
#> SRR1791309 2 0.0000 0.988 0.000 1.000
#> SRR1791304 1 0.0000 0.997 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.0237 0.769 0.000 0.004 0.996
#> SRR1791346 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791345 1 0.1031 0.904 0.976 0.000 0.024
#> SRR1791344 3 0.0000 0.767 0.000 0.000 1.000
#> SRR1791343 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791341 1 0.1289 0.901 0.968 0.000 0.032
#> SRR1791342 3 0.0000 0.767 0.000 0.000 1.000
#> SRR1791340 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791375 3 0.6267 -0.107 0.452 0.000 0.548
#> SRR1791374 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791372 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791370 1 0.5560 0.611 0.700 0.000 0.300
#> SRR1791373 1 0.4555 0.705 0.800 0.000 0.200
#> SRR1791369 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791371 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791368 1 0.1289 0.901 0.968 0.000 0.032
#> SRR1791366 2 0.5760 0.748 0.000 0.672 0.328
#> SRR1791364 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791363 1 0.6111 0.449 0.604 0.000 0.396
#> SRR1791361 1 0.6111 0.449 0.604 0.000 0.396
#> SRR1791360 1 0.1289 0.901 0.968 0.000 0.032
#> SRR1791359 3 0.4346 0.586 0.000 0.184 0.816
#> SRR1791358 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791365 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791357 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791355 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791362 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791354 3 0.3686 0.659 0.000 0.140 0.860
#> SRR1791353 1 0.6302 0.235 0.520 0.000 0.480
#> SRR1791352 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791349 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791348 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791351 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791350 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791339 3 0.1163 0.762 0.000 0.028 0.972
#> SRR1791338 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791337 3 0.6309 -0.420 0.000 0.496 0.504
#> SRR1791335 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791332 1 0.5988 0.504 0.632 0.000 0.368
#> SRR1791331 3 0.0747 0.768 0.000 0.016 0.984
#> SRR1791330 1 0.1289 0.901 0.968 0.000 0.032
#> SRR1791334 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791328 3 0.5706 0.285 0.320 0.000 0.680
#> SRR1791327 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791333 1 0.6225 0.380 0.568 0.000 0.432
#> SRR1791326 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791324 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791323 2 0.1031 0.756 0.000 0.976 0.024
#> SRR1791322 3 0.3551 0.669 0.000 0.132 0.868
#> SRR1791329 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791321 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791320 3 0.0424 0.769 0.000 0.008 0.992
#> SRR1791325 1 0.1964 0.887 0.944 0.000 0.056
#> SRR1791318 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791317 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791313 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791312 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791319 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791316 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.906 1.000 0.000 0.000
#> SRR1791311 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791314 2 0.0000 0.772 0.000 1.000 0.000
#> SRR1791310 3 0.0747 0.768 0.000 0.016 0.984
#> SRR1791308 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791307 1 0.5098 0.689 0.752 0.000 0.248
#> SRR1791306 1 0.0747 0.907 0.984 0.000 0.016
#> SRR1791305 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791309 2 0.5591 0.779 0.000 0.696 0.304
#> SRR1791304 1 0.0000 0.906 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 3 0.4356 0.682 0.000 0.000 0.708 0.292
#> SRR1791346 3 0.4406 0.741 0.000 0.300 0.700 0.000
#> SRR1791345 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791344 3 0.4356 0.682 0.000 0.000 0.708 0.292
#> SRR1791343 3 0.4406 0.741 0.000 0.300 0.700 0.000
#> SRR1791341 4 0.4356 0.767 0.292 0.000 0.000 0.708
#> SRR1791342 4 0.2469 0.610 0.000 0.000 0.108 0.892
#> SRR1791340 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791375 4 0.5250 0.819 0.176 0.000 0.080 0.744
#> SRR1791374 1 0.0000 0.851 1.000 0.000 0.000 0.000
#> SRR1791372 1 0.0188 0.852 0.996 0.000 0.000 0.004
#> SRR1791370 1 0.7058 0.382 0.572 0.000 0.200 0.228
#> SRR1791373 1 0.3852 0.623 0.800 0.000 0.008 0.192
#> SRR1791369 1 0.2589 0.827 0.884 0.000 0.000 0.116
#> SRR1791371 1 0.0000 0.851 1.000 0.000 0.000 0.000
#> SRR1791368 4 0.4356 0.767 0.292 0.000 0.000 0.708
#> SRR1791366 3 0.4584 0.741 0.000 0.300 0.696 0.004
#> SRR1791364 1 0.0188 0.852 0.996 0.000 0.000 0.004
#> SRR1791367 1 0.0000 0.851 1.000 0.000 0.000 0.000
#> SRR1791363 4 0.3528 0.864 0.192 0.000 0.000 0.808
#> SRR1791361 4 0.3528 0.864 0.192 0.000 0.000 0.808
#> SRR1791360 1 0.3266 0.807 0.832 0.000 0.000 0.168
#> SRR1791359 3 0.0188 0.733 0.000 0.000 0.996 0.004
#> SRR1791358 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791365 3 0.5000 0.431 0.000 0.496 0.504 0.000
#> SRR1791357 1 0.0000 0.851 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.851 1.000 0.000 0.000 0.000
#> SRR1791355 3 0.4406 0.741 0.000 0.300 0.700 0.000
#> SRR1791362 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791354 3 0.0188 0.733 0.000 0.000 0.996 0.004
#> SRR1791353 4 0.3528 0.864 0.192 0.000 0.000 0.808
#> SRR1791352 1 0.0000 0.851 1.000 0.000 0.000 0.000
#> SRR1791349 3 0.4406 0.741 0.000 0.300 0.700 0.000
#> SRR1791348 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791351 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791339 3 0.4356 0.682 0.000 0.000 0.708 0.292
#> SRR1791338 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.2530 0.745 0.004 0.100 0.896 0.000
#> SRR1791335 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791332 4 0.3528 0.864 0.192 0.000 0.000 0.808
#> SRR1791331 3 0.4356 0.682 0.000 0.000 0.708 0.292
#> SRR1791330 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791334 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791328 4 0.2412 0.650 0.008 0.000 0.084 0.908
#> SRR1791327 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.4972 0.397 0.544 0.000 0.000 0.456
#> SRR1791326 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791324 3 0.4406 0.741 0.000 0.300 0.700 0.000
#> SRR1791323 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.0188 0.733 0.000 0.000 0.996 0.004
#> SRR1791329 3 0.4406 0.741 0.000 0.300 0.700 0.000
#> SRR1791321 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791320 3 0.4605 0.628 0.000 0.000 0.664 0.336
#> SRR1791325 1 0.3649 0.785 0.796 0.000 0.000 0.204
#> SRR1791318 1 0.0188 0.852 0.996 0.000 0.000 0.004
#> SRR1791317 3 0.2469 0.746 0.000 0.108 0.892 0.000
#> SRR1791313 1 0.0188 0.852 0.996 0.000 0.000 0.004
#> SRR1791312 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791319 1 0.0000 0.851 1.000 0.000 0.000 0.000
#> SRR1791316 1 0.0188 0.852 0.996 0.000 0.000 0.004
#> SRR1791315 1 0.0188 0.852 0.996 0.000 0.000 0.004
#> SRR1791311 1 0.3311 0.806 0.828 0.000 0.000 0.172
#> SRR1791314 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791310 3 0.4356 0.682 0.000 0.000 0.708 0.292
#> SRR1791308 3 0.4406 0.741 0.000 0.300 0.700 0.000
#> SRR1791307 4 0.3528 0.864 0.192 0.000 0.000 0.808
#> SRR1791306 4 0.4356 0.767 0.292 0.000 0.000 0.708
#> SRR1791305 3 0.4406 0.741 0.000 0.300 0.700 0.000
#> SRR1791309 3 0.2469 0.746 0.000 0.108 0.892 0.000
#> SRR1791304 1 0.0188 0.852 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
#> SRR1791347 5 0.0000 0.7376 0.000 0.000 0.000 0.000 1.000
#> SRR1791346 3 0.3039 0.8628 0.000 0.192 0.808 0.000 0.000
#> SRR1791345 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791344 5 0.0000 0.7376 0.000 0.000 0.000 0.000 1.000
#> SRR1791343 3 0.3039 0.8628 0.000 0.192 0.808 0.000 0.000
#> SRR1791341 4 0.4291 0.9523 0.464 0.000 0.000 0.536 0.000
#> SRR1791342 5 0.0000 0.7376 0.000 0.000 0.000 0.000 1.000
#> SRR1791340 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791375 5 0.4278 0.0122 0.452 0.000 0.000 0.000 0.548
#> SRR1791374 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791372 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791370 5 0.6245 0.0231 0.416 0.000 0.144 0.000 0.440
#> SRR1791373 1 0.6555 0.5750 0.524 0.000 0.008 0.256 0.212
#> SRR1791369 1 0.2966 0.6470 0.816 0.000 0.000 0.184 0.000
#> SRR1791371 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791368 4 0.4291 0.9523 0.464 0.000 0.000 0.536 0.000
#> SRR1791366 3 0.3318 0.8593 0.000 0.192 0.800 0.000 0.008
#> SRR1791364 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791367 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791363 4 0.4291 0.9523 0.464 0.000 0.000 0.536 0.000
#> SRR1791361 5 0.6685 -0.2329 0.280 0.000 0.000 0.284 0.436
#> SRR1791360 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791359 3 0.1106 0.7981 0.000 0.000 0.964 0.024 0.012
#> SRR1791358 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 3 0.4150 0.5795 0.000 0.388 0.612 0.000 0.000
#> SRR1791357 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791356 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791355 3 0.3039 0.8628 0.000 0.192 0.808 0.000 0.000
#> SRR1791362 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791354 3 0.0992 0.8004 0.000 0.000 0.968 0.024 0.008
#> SRR1791353 4 0.6227 0.6513 0.280 0.000 0.000 0.536 0.184
#> SRR1791352 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791349 3 0.3039 0.8628 0.000 0.192 0.808 0.000 0.000
#> SRR1791348 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791339 5 0.0000 0.7376 0.000 0.000 0.000 0.000 1.000
#> SRR1791338 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791336 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791337 3 0.0703 0.8037 0.000 0.000 0.976 0.024 0.000
#> SRR1791335 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 4 0.4291 0.9523 0.464 0.000 0.000 0.536 0.000
#> SRR1791331 5 0.2813 0.6278 0.000 0.000 0.168 0.000 0.832
#> SRR1791330 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791334 1 0.0162 0.5305 0.996 0.000 0.000 0.004 0.000
#> SRR1791328 5 0.3354 0.6382 0.088 0.000 0.000 0.068 0.844
#> SRR1791327 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 5 0.4278 0.2855 0.452 0.000 0.000 0.000 0.548
#> SRR1791326 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 3 0.3039 0.8628 0.000 0.192 0.808 0.000 0.000
#> SRR1791323 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.4243 0.4918 0.000 0.000 0.712 0.024 0.264
#> SRR1791329 3 0.3039 0.8628 0.000 0.192 0.808 0.000 0.000
#> SRR1791321 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791320 5 0.0000 0.7376 0.000 0.000 0.000 0.000 1.000
#> SRR1791325 1 0.3274 0.5044 0.780 0.000 0.000 0.000 0.220
#> SRR1791318 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791317 3 0.0703 0.8037 0.000 0.000 0.976 0.024 0.000
#> SRR1791313 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791312 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791319 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791316 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791315 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
#> SRR1791311 1 0.0000 0.5272 1.000 0.000 0.000 0.000 0.000
#> SRR1791314 2 0.0000 1.0000 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.0000 0.7376 0.000 0.000 0.000 0.000 1.000
#> SRR1791308 3 0.3039 0.8628 0.000 0.192 0.808 0.000 0.000
#> SRR1791307 4 0.4291 0.9523 0.464 0.000 0.000 0.536 0.000
#> SRR1791306 4 0.4291 0.9523 0.464 0.000 0.000 0.536 0.000
#> SRR1791305 3 0.3039 0.8628 0.000 0.192 0.808 0.000 0.000
#> SRR1791309 3 0.0703 0.8037 0.000 0.000 0.976 0.024 0.000
#> SRR1791304 1 0.4262 0.7523 0.560 0.000 0.000 0.440 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.0000 0.88585 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791346 2 0.0000 0.85458 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791345 4 0.2651 0.82534 0.112 0.000 0.028 0.860 0.000 0.000
#> SRR1791344 5 0.0000 0.88585 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791343 2 0.0000 0.85458 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791341 4 0.0458 0.81307 0.000 0.000 0.016 0.984 0.000 0.000
#> SRR1791342 5 0.0000 0.88585 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791340 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791375 4 0.2969 0.70528 0.000 0.000 0.000 0.776 0.224 0.000
#> SRR1791374 1 0.4099 0.57256 0.612 0.000 0.372 0.016 0.000 0.000
#> SRR1791372 1 0.0260 0.87016 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR1791370 3 0.7141 -0.03383 0.092 0.124 0.388 0.016 0.380 0.000
#> SRR1791373 1 0.5909 0.20083 0.420 0.000 0.372 0.000 0.208 0.000
#> SRR1791369 4 0.3866 0.24380 0.484 0.000 0.000 0.516 0.000 0.000
#> SRR1791371 1 0.1863 0.83490 0.896 0.000 0.104 0.000 0.000 0.000
#> SRR1791368 4 0.0458 0.81307 0.000 0.000 0.016 0.984 0.000 0.000
#> SRR1791366 2 0.0000 0.85458 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791364 1 0.0000 0.87517 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.2135 0.82103 0.872 0.000 0.128 0.000 0.000 0.000
#> SRR1791363 4 0.0458 0.81307 0.000 0.000 0.016 0.984 0.000 0.000
#> SRR1791361 4 0.4084 0.34574 0.000 0.000 0.012 0.588 0.400 0.000
#> SRR1791360 4 0.1957 0.83937 0.112 0.000 0.000 0.888 0.000 0.000
#> SRR1791359 2 0.3795 0.35459 0.000 0.632 0.364 0.000 0.004 0.000
#> SRR1791358 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791365 2 0.2454 0.66630 0.000 0.840 0.000 0.000 0.000 0.160
#> SRR1791357 1 0.0000 0.87517 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.1814 0.83700 0.900 0.000 0.100 0.000 0.000 0.000
#> SRR1791355 2 0.0000 0.85458 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791362 4 0.1957 0.83937 0.112 0.000 0.000 0.888 0.000 0.000
#> SRR1791354 2 0.3659 0.36118 0.000 0.636 0.364 0.000 0.000 0.000
#> SRR1791353 4 0.3348 0.60823 0.000 0.000 0.016 0.768 0.216 0.000
#> SRR1791352 1 0.0000 0.87517 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791349 2 0.0000 0.85458 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791348 4 0.1957 0.83937 0.112 0.000 0.000 0.888 0.000 0.000
#> SRR1791351 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791350 4 0.1957 0.83937 0.112 0.000 0.000 0.888 0.000 0.000
#> SRR1791339 5 0.0146 0.88260 0.000 0.004 0.000 0.000 0.996 0.000
#> SRR1791338 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791336 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791337 3 0.0458 0.37983 0.000 0.016 0.984 0.000 0.000 0.000
#> SRR1791335 6 0.1863 0.86879 0.000 0.104 0.000 0.000 0.000 0.896
#> SRR1791332 4 0.0458 0.81307 0.000 0.000 0.016 0.984 0.000 0.000
#> SRR1791331 5 0.3126 0.51601 0.000 0.248 0.000 0.000 0.752 0.000
#> SRR1791330 4 0.1957 0.83937 0.112 0.000 0.000 0.888 0.000 0.000
#> SRR1791334 4 0.2003 0.83732 0.116 0.000 0.000 0.884 0.000 0.000
#> SRR1791328 5 0.3189 0.55774 0.000 0.000 0.004 0.236 0.760 0.000
#> SRR1791327 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 4 0.3923 0.43542 0.008 0.000 0.000 0.620 0.372 0.000
#> SRR1791326 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791324 2 0.0000 0.85458 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791323 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791322 3 0.6104 0.15793 0.000 0.288 0.364 0.000 0.348 0.000
#> SRR1791329 2 0.0000 0.85458 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791321 4 0.1957 0.83937 0.112 0.000 0.000 0.888 0.000 0.000
#> SRR1791320 5 0.0000 0.88585 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791325 3 0.7246 0.00743 0.108 0.000 0.372 0.312 0.208 0.000
#> SRR1791318 1 0.0000 0.87517 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.3727 -0.01243 0.000 0.388 0.612 0.000 0.000 0.000
#> SRR1791313 1 0.0000 0.87517 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791312 4 0.2883 0.76180 0.212 0.000 0.000 0.788 0.000 0.000
#> SRR1791319 1 0.3684 0.58825 0.628 0.000 0.372 0.000 0.000 0.000
#> SRR1791316 1 0.0000 0.87517 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.87517 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791311 4 0.1957 0.83937 0.112 0.000 0.000 0.888 0.000 0.000
#> SRR1791314 6 0.0000 0.98639 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791310 5 0.0000 0.88585 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791308 2 0.3126 0.57626 0.000 0.752 0.248 0.000 0.000 0.000
#> SRR1791307 4 0.0458 0.81307 0.000 0.000 0.016 0.984 0.000 0.000
#> SRR1791306 4 0.0458 0.81307 0.000 0.000 0.016 0.984 0.000 0.000
#> SRR1791305 2 0.0000 0.85458 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791309 3 0.3727 -0.01243 0.000 0.388 0.612 0.000 0.000 0.000
#> SRR1791304 1 0.0000 0.87517 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.795 0.945 0.972 0.4996 0.499 0.499
#> 3 3 0.515 0.600 0.748 0.2394 0.885 0.774
#> 4 4 0.604 0.568 0.753 0.1227 0.808 0.559
#> 5 5 0.546 0.706 0.693 0.0759 0.831 0.507
#> 6 6 0.579 0.442 0.608 0.0418 0.889 0.579
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1791347 2 0.0000 0.953 0.000 1.000
#> SRR1791346 2 0.0000 0.953 0.000 1.000
#> SRR1791345 2 0.7056 0.807 0.192 0.808
#> SRR1791344 2 0.0000 0.953 0.000 1.000
#> SRR1791343 2 0.0000 0.953 0.000 1.000
#> SRR1791341 1 0.0000 0.990 1.000 0.000
#> SRR1791342 2 0.0000 0.953 0.000 1.000
#> SRR1791340 2 0.0000 0.953 0.000 1.000
#> SRR1791375 1 0.8713 0.541 0.708 0.292
#> SRR1791374 1 0.0000 0.990 1.000 0.000
#> SRR1791372 1 0.0000 0.990 1.000 0.000
#> SRR1791370 2 0.7056 0.807 0.192 0.808
#> SRR1791373 2 0.0000 0.953 0.000 1.000
#> SRR1791369 1 0.0000 0.990 1.000 0.000
#> SRR1791371 1 0.0000 0.990 1.000 0.000
#> SRR1791368 1 0.0376 0.986 0.996 0.004
#> SRR1791366 2 0.0000 0.953 0.000 1.000
#> SRR1791364 1 0.0000 0.990 1.000 0.000
#> SRR1791367 1 0.0000 0.990 1.000 0.000
#> SRR1791363 1 0.0000 0.990 1.000 0.000
#> SRR1791361 2 0.0000 0.953 0.000 1.000
#> SRR1791360 1 0.0000 0.990 1.000 0.000
#> SRR1791359 2 0.7056 0.807 0.192 0.808
#> SRR1791358 2 0.0000 0.953 0.000 1.000
#> SRR1791365 2 0.0000 0.953 0.000 1.000
#> SRR1791357 1 0.0000 0.990 1.000 0.000
#> SRR1791356 1 0.0000 0.990 1.000 0.000
#> SRR1791355 2 0.0000 0.953 0.000 1.000
#> SRR1791362 1 0.0000 0.990 1.000 0.000
#> SRR1791354 2 0.7056 0.807 0.192 0.808
#> SRR1791353 1 0.0000 0.990 1.000 0.000
#> SRR1791352 1 0.0000 0.990 1.000 0.000
#> SRR1791349 2 0.0000 0.953 0.000 1.000
#> SRR1791348 1 0.0000 0.990 1.000 0.000
#> SRR1791351 2 0.0000 0.953 0.000 1.000
#> SRR1791350 1 0.0000 0.990 1.000 0.000
#> SRR1791339 2 0.0000 0.953 0.000 1.000
#> SRR1791338 2 0.0000 0.953 0.000 1.000
#> SRR1791336 2 0.0000 0.953 0.000 1.000
#> SRR1791337 2 0.7056 0.807 0.192 0.808
#> SRR1791335 2 0.0000 0.953 0.000 1.000
#> SRR1791332 1 0.0000 0.990 1.000 0.000
#> SRR1791331 2 0.0000 0.953 0.000 1.000
#> SRR1791330 1 0.0000 0.990 1.000 0.000
#> SRR1791334 1 0.0000 0.990 1.000 0.000
#> SRR1791328 2 0.0000 0.953 0.000 1.000
#> SRR1791327 2 0.0000 0.953 0.000 1.000
#> SRR1791333 2 0.0000 0.953 0.000 1.000
#> SRR1791326 2 0.0000 0.953 0.000 1.000
#> SRR1791324 2 0.0000 0.953 0.000 1.000
#> SRR1791323 2 0.0000 0.953 0.000 1.000
#> SRR1791322 2 0.7056 0.807 0.192 0.808
#> SRR1791329 2 0.0000 0.953 0.000 1.000
#> SRR1791321 1 0.0000 0.990 1.000 0.000
#> SRR1791320 2 0.0000 0.953 0.000 1.000
#> SRR1791325 2 0.7299 0.792 0.204 0.796
#> SRR1791318 1 0.0000 0.990 1.000 0.000
#> SRR1791317 2 0.7056 0.807 0.192 0.808
#> SRR1791313 1 0.0000 0.990 1.000 0.000
#> SRR1791312 1 0.0000 0.990 1.000 0.000
#> SRR1791319 1 0.0000 0.990 1.000 0.000
#> SRR1791316 1 0.0000 0.990 1.000 0.000
#> SRR1791315 1 0.0000 0.990 1.000 0.000
#> SRR1791311 1 0.0000 0.990 1.000 0.000
#> SRR1791314 2 0.0000 0.953 0.000 1.000
#> SRR1791310 2 0.0000 0.953 0.000 1.000
#> SRR1791308 2 0.0000 0.953 0.000 1.000
#> SRR1791307 1 0.0000 0.990 1.000 0.000
#> SRR1791306 1 0.0000 0.990 1.000 0.000
#> SRR1791305 2 0.0000 0.953 0.000 1.000
#> SRR1791309 2 0.7056 0.807 0.192 0.808
#> SRR1791304 1 0.0000 0.990 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 2 0.2625 0.487 0.000 0.916 0.084
#> SRR1791346 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791345 2 0.9569 -0.469 0.240 0.480 0.280
#> SRR1791344 2 0.0000 0.435 0.000 1.000 0.000
#> SRR1791343 2 0.6111 0.685 0.000 0.604 0.396
#> SRR1791341 1 0.8159 0.442 0.588 0.320 0.092
#> SRR1791342 2 0.0592 0.424 0.000 0.988 0.012
#> SRR1791340 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791375 1 0.9836 -0.674 0.424 0.280 0.296
#> SRR1791374 1 0.4473 0.616 0.828 0.008 0.164
#> SRR1791372 1 0.5785 0.642 0.668 0.000 0.332
#> SRR1791370 3 0.9760 1.000 0.276 0.280 0.444
#> SRR1791373 2 0.3941 0.522 0.000 0.844 0.156
#> SRR1791369 1 0.0000 0.723 1.000 0.000 0.000
#> SRR1791371 1 0.2066 0.722 0.940 0.000 0.060
#> SRR1791368 1 0.5883 0.627 0.796 0.112 0.092
#> SRR1791366 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791364 1 0.5785 0.642 0.668 0.000 0.332
#> SRR1791367 1 0.1289 0.723 0.968 0.000 0.032
#> SRR1791363 1 0.8375 0.386 0.540 0.368 0.092
#> SRR1791361 2 0.5970 0.196 0.160 0.780 0.060
#> SRR1791360 1 0.6222 0.507 0.776 0.092 0.132
#> SRR1791359 3 0.9760 1.000 0.276 0.280 0.444
#> SRR1791358 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791365 2 0.6126 0.685 0.000 0.600 0.400
#> SRR1791357 1 0.5138 0.677 0.748 0.000 0.252
#> SRR1791356 1 0.4002 0.704 0.840 0.000 0.160
#> SRR1791355 2 0.6140 0.688 0.000 0.596 0.404
#> SRR1791362 1 0.0592 0.720 0.988 0.000 0.012
#> SRR1791354 3 0.9760 1.000 0.276 0.280 0.444
#> SRR1791353 1 0.6922 0.556 0.720 0.200 0.080
#> SRR1791352 1 0.5785 0.642 0.668 0.000 0.332
#> SRR1791349 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791348 1 0.0237 0.722 0.996 0.000 0.004
#> SRR1791351 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791350 1 0.1337 0.718 0.972 0.012 0.016
#> SRR1791339 2 0.0000 0.435 0.000 1.000 0.000
#> SRR1791338 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791336 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791337 3 0.9760 1.000 0.276 0.280 0.444
#> SRR1791335 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791332 1 0.8089 0.453 0.600 0.308 0.092
#> SRR1791331 2 0.3482 0.516 0.000 0.872 0.128
#> SRR1791330 1 0.2384 0.700 0.936 0.008 0.056
#> SRR1791334 1 0.0000 0.723 1.000 0.000 0.000
#> SRR1791328 2 0.5875 0.200 0.160 0.784 0.056
#> SRR1791327 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791333 2 0.5119 0.220 0.160 0.812 0.028
#> SRR1791326 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791324 2 0.6140 0.687 0.000 0.596 0.404
#> SRR1791323 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791322 3 0.9760 1.000 0.276 0.280 0.444
#> SRR1791329 2 0.6045 0.679 0.000 0.620 0.380
#> SRR1791321 1 0.0000 0.723 1.000 0.000 0.000
#> SRR1791320 2 0.0000 0.435 0.000 1.000 0.000
#> SRR1791325 1 0.9891 -0.727 0.404 0.280 0.316
#> SRR1791318 1 0.5785 0.642 0.668 0.000 0.332
#> SRR1791317 3 0.9760 1.000 0.276 0.280 0.444
#> SRR1791313 1 0.5785 0.642 0.668 0.000 0.332
#> SRR1791312 1 0.0892 0.724 0.980 0.000 0.020
#> SRR1791319 1 0.4228 0.685 0.844 0.008 0.148
#> SRR1791316 1 0.5254 0.671 0.736 0.000 0.264
#> SRR1791315 1 0.5785 0.642 0.668 0.000 0.332
#> SRR1791311 1 0.0424 0.722 0.992 0.000 0.008
#> SRR1791314 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791310 2 0.3879 0.526 0.000 0.848 0.152
#> SRR1791308 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791307 1 0.8202 0.433 0.580 0.328 0.092
#> SRR1791306 1 0.4357 0.674 0.868 0.052 0.080
#> SRR1791305 2 0.6180 0.691 0.000 0.584 0.416
#> SRR1791309 3 0.9760 1.000 0.276 0.280 0.444
#> SRR1791304 1 0.5785 0.642 0.668 0.000 0.332
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.5862 -0.1045 0.000 0.484 0.032 0.484
#> SRR1791346 2 0.0817 0.8559 0.000 0.976 0.024 0.000
#> SRR1791345 2 0.9062 -0.1779 0.172 0.456 0.112 0.260
#> SRR1791344 4 0.5850 -0.0156 0.000 0.456 0.032 0.512
#> SRR1791343 2 0.1833 0.8541 0.000 0.944 0.024 0.032
#> SRR1791341 4 0.4452 -0.0607 0.260 0.000 0.008 0.732
#> SRR1791342 4 0.5833 0.0228 0.000 0.440 0.032 0.528
#> SRR1791340 2 0.3266 0.7874 0.000 0.832 0.000 0.168
#> SRR1791375 3 0.8524 0.1632 0.212 0.056 0.492 0.240
#> SRR1791374 1 0.7628 0.5707 0.504 0.008 0.184 0.304
#> SRR1791372 1 0.0000 0.6778 1.000 0.000 0.000 0.000
#> SRR1791370 3 0.2021 0.8218 0.000 0.040 0.936 0.024
#> SRR1791373 2 0.6071 0.1051 0.000 0.504 0.044 0.452
#> SRR1791369 1 0.4990 0.7035 0.640 0.000 0.008 0.352
#> SRR1791371 1 0.4452 0.7163 0.732 0.000 0.008 0.260
#> SRR1791368 4 0.4594 -0.1113 0.280 0.000 0.008 0.712
#> SRR1791366 2 0.4050 0.7799 0.000 0.808 0.024 0.168
#> SRR1791364 1 0.0779 0.6857 0.980 0.000 0.004 0.016
#> SRR1791367 1 0.4973 0.7023 0.644 0.000 0.008 0.348
#> SRR1791363 4 0.3893 0.1065 0.196 0.000 0.008 0.796
#> SRR1791361 4 0.4840 0.3486 0.000 0.240 0.028 0.732
#> SRR1791360 1 0.7227 0.6397 0.556 0.036 0.072 0.336
#> SRR1791359 3 0.0188 0.8433 0.000 0.004 0.996 0.000
#> SRR1791358 2 0.0000 0.8519 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.1406 0.8571 0.000 0.960 0.024 0.016
#> SRR1791357 1 0.1118 0.6904 0.964 0.000 0.000 0.036
#> SRR1791356 1 0.3024 0.7061 0.852 0.000 0.000 0.148
#> SRR1791355 2 0.1406 0.8571 0.000 0.960 0.024 0.016
#> SRR1791362 1 0.5268 0.6363 0.540 0.000 0.008 0.452
#> SRR1791354 3 0.0188 0.8433 0.000 0.004 0.996 0.000
#> SRR1791353 4 0.5020 0.0343 0.232 0.012 0.020 0.736
#> SRR1791352 1 0.0000 0.6778 1.000 0.000 0.000 0.000
#> SRR1791349 2 0.3958 0.7845 0.000 0.816 0.024 0.160
#> SRR1791348 1 0.5138 0.6859 0.600 0.000 0.008 0.392
#> SRR1791351 2 0.0000 0.8519 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.5277 0.6267 0.532 0.000 0.008 0.460
#> SRR1791339 4 0.5856 -0.0420 0.000 0.464 0.032 0.504
#> SRR1791338 2 0.1022 0.8547 0.000 0.968 0.000 0.032
#> SRR1791336 2 0.0921 0.8554 0.000 0.972 0.000 0.028
#> SRR1791337 3 0.1211 0.8210 0.000 0.040 0.960 0.000
#> SRR1791335 2 0.0188 0.8529 0.000 0.996 0.000 0.004
#> SRR1791332 4 0.4086 0.0702 0.216 0.000 0.008 0.776
#> SRR1791331 2 0.5055 0.6495 0.000 0.712 0.032 0.256
#> SRR1791330 1 0.6554 0.6359 0.532 0.020 0.040 0.408
#> SRR1791334 1 0.5473 0.6699 0.576 0.004 0.012 0.408
#> SRR1791328 4 0.4903 0.3395 0.000 0.248 0.028 0.724
#> SRR1791327 2 0.0000 0.8519 0.000 1.000 0.000 0.000
#> SRR1791333 4 0.5565 0.2260 0.000 0.344 0.032 0.624
#> SRR1791326 2 0.3266 0.7874 0.000 0.832 0.000 0.168
#> SRR1791324 2 0.1004 0.8565 0.000 0.972 0.024 0.004
#> SRR1791323 2 0.0000 0.8519 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.0188 0.8433 0.000 0.004 0.996 0.000
#> SRR1791329 2 0.1151 0.8572 0.000 0.968 0.024 0.008
#> SRR1791321 1 0.5310 0.6696 0.576 0.000 0.012 0.412
#> SRR1791320 4 0.5850 -0.0156 0.000 0.456 0.032 0.512
#> SRR1791325 3 0.8649 0.2692 0.184 0.092 0.516 0.208
#> SRR1791318 1 0.0188 0.6794 0.996 0.000 0.000 0.004
#> SRR1791317 3 0.0188 0.8433 0.000 0.004 0.996 0.000
#> SRR1791313 1 0.0000 0.6778 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.5055 0.6961 0.624 0.000 0.008 0.368
#> SRR1791319 1 0.6990 0.6362 0.584 0.008 0.124 0.284
#> SRR1791316 1 0.2125 0.6996 0.920 0.000 0.004 0.076
#> SRR1791315 1 0.0000 0.6778 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.5268 0.6361 0.540 0.000 0.008 0.452
#> SRR1791314 2 0.0000 0.8519 0.000 1.000 0.000 0.000
#> SRR1791310 2 0.5222 0.6200 0.000 0.688 0.032 0.280
#> SRR1791308 2 0.0817 0.8559 0.000 0.976 0.024 0.000
#> SRR1791307 4 0.4011 0.0874 0.208 0.000 0.008 0.784
#> SRR1791306 4 0.4973 -0.3160 0.348 0.000 0.008 0.644
#> SRR1791305 2 0.3910 0.7865 0.000 0.820 0.024 0.156
#> SRR1791309 3 0.0188 0.8433 0.000 0.004 0.996 0.000
#> SRR1791304 1 0.0000 0.6778 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
#> SRR1791347 5 0.707 0.83252 0.252 0.164 0.044 0.004 0.536
#> SRR1791346 2 0.527 0.75217 0.000 0.736 0.048 0.088 0.128
#> SRR1791345 1 0.828 0.02984 0.512 0.192 0.136 0.064 0.096
#> SRR1791344 5 0.642 0.87771 0.252 0.108 0.044 0.000 0.596
#> SRR1791343 2 0.420 0.74994 0.000 0.756 0.048 0.000 0.196
#> SRR1791341 1 0.374 0.55621 0.732 0.000 0.004 0.000 0.264
#> SRR1791342 5 0.643 0.87645 0.276 0.104 0.040 0.000 0.580
#> SRR1791340 2 0.548 0.72498 0.000 0.644 0.000 0.124 0.232
#> SRR1791375 1 0.595 0.31175 0.556 0.004 0.344 0.004 0.092
#> SRR1791374 1 0.740 0.44813 0.524 0.000 0.204 0.180 0.092
#> SRR1791372 4 0.334 0.96378 0.228 0.000 0.000 0.772 0.000
#> SRR1791370 3 0.424 0.77553 0.104 0.004 0.800 0.008 0.084
#> SRR1791373 5 0.865 0.78020 0.252 0.128 0.056 0.124 0.440
#> SRR1791369 1 0.470 0.51991 0.736 0.000 0.000 0.156 0.108
#> SRR1791371 1 0.366 0.48126 0.724 0.000 0.000 0.276 0.000
#> SRR1791368 1 0.407 0.56074 0.728 0.000 0.012 0.004 0.256
#> SRR1791366 2 0.604 0.65570 0.000 0.580 0.048 0.048 0.324
#> SRR1791364 4 0.327 0.96062 0.220 0.000 0.000 0.780 0.000
#> SRR1791367 1 0.358 0.53272 0.768 0.000 0.008 0.224 0.000
#> SRR1791363 1 0.372 0.56432 0.736 0.000 0.004 0.000 0.260
#> SRR1791361 5 0.541 0.80842 0.316 0.080 0.000 0.000 0.604
#> SRR1791360 1 0.614 0.50062 0.656 0.000 0.184 0.064 0.096
#> SRR1791359 3 0.000 0.92309 0.000 0.000 1.000 0.000 0.000
#> SRR1791358 2 0.195 0.76184 0.000 0.912 0.000 0.084 0.004
#> SRR1791365 2 0.225 0.78726 0.000 0.896 0.008 0.000 0.096
#> SRR1791357 4 0.361 0.90941 0.268 0.000 0.000 0.732 0.000
#> SRR1791356 1 0.423 -0.00466 0.576 0.000 0.000 0.424 0.000
#> SRR1791355 2 0.383 0.76371 0.000 0.796 0.048 0.000 0.156
#> SRR1791362 1 0.120 0.64969 0.960 0.000 0.004 0.032 0.004
#> SRR1791354 3 0.000 0.92309 0.000 0.000 1.000 0.000 0.000
#> SRR1791353 1 0.364 0.57818 0.792 0.000 0.024 0.000 0.184
#> SRR1791352 4 0.331 0.96544 0.224 0.000 0.000 0.776 0.000
#> SRR1791349 2 0.606 0.66266 0.000 0.588 0.048 0.052 0.312
#> SRR1791348 1 0.436 0.54746 0.768 0.000 0.000 0.124 0.108
#> SRR1791351 2 0.195 0.76184 0.000 0.912 0.000 0.084 0.004
#> SRR1791350 1 0.318 0.61999 0.844 0.000 0.000 0.032 0.124
#> SRR1791339 5 0.718 0.76400 0.252 0.204 0.044 0.000 0.500
#> SRR1791338 2 0.486 0.75361 0.000 0.708 0.000 0.088 0.204
#> SRR1791336 2 0.483 0.75517 0.000 0.712 0.000 0.088 0.200
#> SRR1791337 3 0.319 0.85033 0.052 0.004 0.860 0.000 0.084
#> SRR1791335 2 0.239 0.76592 0.000 0.900 0.000 0.072 0.028
#> SRR1791332 1 0.374 0.55548 0.732 0.000 0.004 0.000 0.264
#> SRR1791331 2 0.490 0.70171 0.000 0.696 0.044 0.012 0.248
#> SRR1791330 1 0.526 0.57954 0.732 0.000 0.108 0.036 0.124
#> SRR1791334 1 0.263 0.63883 0.892 0.000 0.004 0.072 0.032
#> SRR1791328 5 0.551 0.81805 0.316 0.088 0.000 0.000 0.596
#> SRR1791327 2 0.177 0.76155 0.000 0.924 0.000 0.072 0.004
#> SRR1791333 5 0.619 0.84418 0.312 0.088 0.028 0.000 0.572
#> SRR1791326 2 0.550 0.72204 0.000 0.640 0.000 0.124 0.236
#> SRR1791324 2 0.253 0.77679 0.000 0.892 0.032 0.000 0.076
#> SRR1791323 2 0.195 0.76184 0.000 0.912 0.000 0.084 0.004
#> SRR1791322 3 0.000 0.92309 0.000 0.000 1.000 0.000 0.000
#> SRR1791329 2 0.301 0.77804 0.000 0.860 0.036 0.000 0.104
#> SRR1791321 1 0.306 0.62099 0.860 0.000 0.000 0.096 0.044
#> SRR1791320 5 0.642 0.87771 0.252 0.108 0.044 0.000 0.596
#> SRR1791325 1 0.726 0.20704 0.496 0.080 0.328 0.008 0.088
#> SRR1791318 4 0.334 0.96538 0.228 0.000 0.000 0.772 0.000
#> SRR1791317 3 0.148 0.90292 0.048 0.000 0.944 0.000 0.008
#> SRR1791313 4 0.334 0.96450 0.228 0.000 0.000 0.772 0.000
#> SRR1791312 1 0.483 0.50817 0.720 0.000 0.000 0.176 0.104
#> SRR1791319 1 0.701 0.50712 0.568 0.000 0.120 0.220 0.092
#> SRR1791316 4 0.386 0.85233 0.312 0.000 0.000 0.688 0.000
#> SRR1791315 4 0.334 0.96538 0.228 0.000 0.000 0.772 0.000
#> SRR1791311 1 0.296 0.61480 0.864 0.000 0.000 0.036 0.100
#> SRR1791314 2 0.189 0.76222 0.000 0.920 0.000 0.072 0.008
#> SRR1791310 2 0.563 0.67635 0.004 0.656 0.044 0.036 0.260
#> SRR1791308 2 0.511 0.75599 0.000 0.748 0.048 0.076 0.128
#> SRR1791307 1 0.366 0.56298 0.744 0.000 0.004 0.000 0.252
#> SRR1791306 1 0.183 0.64133 0.920 0.000 0.004 0.000 0.076
#> SRR1791305 2 0.601 0.67712 0.000 0.600 0.048 0.052 0.300
#> SRR1791309 3 0.000 0.92309 0.000 0.000 1.000 0.000 0.000
#> SRR1791304 4 0.331 0.96544 0.224 0.000 0.000 0.776 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.315 0.6111 0.000 0.116 0.000 0.024 0.840 0.020
#> SRR1791346 6 0.701 0.4066 0.064 0.308 0.000 0.000 0.260 0.368
#> SRR1791345 2 0.842 -0.0326 0.080 0.464 0.044 0.112 0.136 0.164
#> SRR1791344 5 0.170 0.6369 0.000 0.012 0.000 0.024 0.936 0.028
#> SRR1791343 6 0.489 0.4782 0.016 0.036 0.000 0.000 0.384 0.564
#> SRR1791341 4 0.107 0.4052 0.000 0.000 0.000 0.952 0.048 0.000
#> SRR1791342 5 0.311 0.6402 0.000 0.108 0.004 0.024 0.848 0.016
#> SRR1791340 6 0.585 0.5150 0.004 0.332 0.000 0.000 0.180 0.484
#> SRR1791375 4 0.724 0.2485 0.012 0.280 0.184 0.436 0.088 0.000
#> SRR1791374 2 0.722 -0.2836 0.092 0.420 0.040 0.360 0.088 0.000
#> SRR1791372 1 0.348 0.8832 0.684 0.000 0.000 0.316 0.000 0.000
#> SRR1791370 3 0.472 0.7819 0.028 0.048 0.772 0.052 0.096 0.004
#> SRR1791373 5 0.680 0.4455 0.276 0.284 0.004 0.020 0.408 0.008
#> SRR1791369 2 0.481 -0.4013 0.052 0.488 0.000 0.460 0.000 0.000
#> SRR1791371 4 0.624 0.2629 0.152 0.408 0.004 0.416 0.020 0.000
#> SRR1791368 4 0.126 0.4171 0.008 0.020 0.000 0.956 0.016 0.000
#> SRR1791366 5 0.624 -0.3919 0.004 0.348 0.000 0.000 0.348 0.300
#> SRR1791364 1 0.370 0.8650 0.660 0.004 0.000 0.336 0.000 0.000
#> SRR1791367 4 0.628 0.2762 0.100 0.416 0.004 0.432 0.048 0.000
#> SRR1791363 4 0.228 0.3985 0.000 0.024 0.000 0.888 0.088 0.000
#> SRR1791361 5 0.515 0.5036 0.012 0.308 0.004 0.068 0.608 0.000
#> SRR1791360 4 0.625 0.2968 0.012 0.404 0.040 0.456 0.088 0.000
#> SRR1791359 3 0.000 0.9160 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791358 6 0.124 0.6350 0.004 0.020 0.000 0.000 0.020 0.956
#> SRR1791365 6 0.455 0.4713 0.000 0.036 0.000 0.000 0.420 0.544
#> SRR1791357 1 0.504 0.7514 0.556 0.084 0.000 0.360 0.000 0.000
#> SRR1791356 1 0.629 0.1877 0.364 0.268 0.000 0.360 0.008 0.000
#> SRR1791355 6 0.494 0.4905 0.020 0.036 0.000 0.000 0.372 0.572
#> SRR1791362 4 0.461 0.4223 0.012 0.384 0.000 0.580 0.024 0.000
#> SRR1791354 3 0.000 0.9160 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791353 4 0.462 0.4298 0.000 0.236 0.004 0.680 0.080 0.000
#> SRR1791352 1 0.348 0.8832 0.684 0.000 0.000 0.316 0.000 0.000
#> SRR1791349 2 0.611 -0.6060 0.000 0.376 0.000 0.000 0.320 0.304
#> SRR1791348 2 0.481 -0.4047 0.052 0.484 0.000 0.464 0.000 0.000
#> SRR1791351 6 0.124 0.6350 0.004 0.020 0.000 0.000 0.020 0.956
#> SRR1791350 4 0.440 0.3705 0.024 0.460 0.000 0.516 0.000 0.000
#> SRR1791339 5 0.167 0.6294 0.000 0.008 0.000 0.020 0.936 0.036
#> SRR1791338 6 0.550 0.5581 0.000 0.296 0.000 0.000 0.160 0.544
#> SRR1791336 6 0.547 0.5609 0.000 0.296 0.000 0.000 0.156 0.548
#> SRR1791337 3 0.346 0.8429 0.000 0.068 0.828 0.008 0.092 0.004
#> SRR1791335 6 0.181 0.6188 0.004 0.000 0.000 0.000 0.088 0.908
#> SRR1791332 4 0.143 0.4070 0.000 0.012 0.000 0.940 0.048 0.000
#> SRR1791331 5 0.394 0.2588 0.000 0.024 0.000 0.000 0.688 0.288
#> SRR1791330 4 0.611 0.3398 0.012 0.368 0.036 0.500 0.084 0.000
#> SRR1791334 4 0.472 0.3680 0.024 0.472 0.000 0.492 0.012 0.000
#> SRR1791328 5 0.520 0.5159 0.008 0.284 0.004 0.068 0.628 0.008
#> SRR1791327 6 0.109 0.6353 0.000 0.020 0.000 0.000 0.020 0.960
#> SRR1791333 5 0.478 0.5006 0.012 0.328 0.004 0.036 0.620 0.000
#> SRR1791326 6 0.585 0.5150 0.004 0.332 0.000 0.000 0.180 0.484
#> SRR1791324 6 0.391 0.5915 0.000 0.028 0.000 0.000 0.268 0.704
#> SRR1791323 6 0.140 0.6358 0.004 0.020 0.000 0.000 0.028 0.948
#> SRR1791322 3 0.000 0.9160 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791329 6 0.405 0.5921 0.004 0.028 0.000 0.000 0.268 0.700
#> SRR1791321 4 0.463 0.3568 0.024 0.476 0.000 0.492 0.008 0.000
#> SRR1791320 5 0.170 0.6369 0.000 0.012 0.000 0.024 0.936 0.028
#> SRR1791325 2 0.772 -0.2579 0.056 0.380 0.128 0.340 0.096 0.000
#> SRR1791318 1 0.348 0.8832 0.684 0.000 0.000 0.316 0.000 0.000
#> SRR1791317 3 0.239 0.8907 0.000 0.064 0.892 0.004 0.040 0.000
#> SRR1791313 1 0.348 0.8832 0.684 0.000 0.000 0.316 0.000 0.000
#> SRR1791312 2 0.541 -0.3654 0.100 0.484 0.004 0.412 0.000 0.000
#> SRR1791319 2 0.724 -0.2866 0.108 0.416 0.032 0.356 0.088 0.000
#> SRR1791316 1 0.502 0.7338 0.548 0.080 0.000 0.372 0.000 0.000
#> SRR1791315 1 0.348 0.8832 0.684 0.000 0.000 0.316 0.000 0.000
#> SRR1791311 4 0.440 0.3663 0.024 0.464 0.000 0.512 0.000 0.000
#> SRR1791314 6 0.190 0.6152 0.004 0.004 0.000 0.000 0.084 0.908
#> SRR1791310 5 0.410 0.4265 0.004 0.024 0.000 0.012 0.728 0.232
#> SRR1791308 6 0.701 0.4586 0.056 0.292 0.004 0.000 0.248 0.400
#> SRR1791307 4 0.175 0.4134 0.000 0.020 0.000 0.924 0.056 0.000
#> SRR1791306 4 0.150 0.4492 0.000 0.076 0.000 0.924 0.000 0.000
#> SRR1791305 2 0.611 -0.6076 0.000 0.376 0.000 0.000 0.324 0.300
#> SRR1791309 3 0.000 0.9160 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791304 1 0.348 0.8832 0.684 0.000 0.000 0.316 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 15854 rows and 72 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 1.000 0.972 0.989 0.5042 0.495 0.495
#> 3 3 0.665 0.799 0.899 0.2580 0.858 0.719
#> 4 4 0.834 0.827 0.927 0.1428 0.859 0.644
#> 5 5 0.724 0.664 0.842 0.0435 0.966 0.876
#> 6 6 0.739 0.649 0.812 0.0273 0.979 0.916
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
#> SRR1791347 2 0.0000 0.977 0.000 1.000
#> SRR1791346 2 0.0000 0.977 0.000 1.000
#> SRR1791345 1 0.0000 0.999 1.000 0.000
#> SRR1791344 2 0.0000 0.977 0.000 1.000
#> SRR1791343 2 0.0000 0.977 0.000 1.000
#> SRR1791341 1 0.0000 0.999 1.000 0.000
#> SRR1791342 2 0.0000 0.977 0.000 1.000
#> SRR1791340 2 0.0000 0.977 0.000 1.000
#> SRR1791375 2 0.7950 0.686 0.240 0.760
#> SRR1791374 1 0.0000 0.999 1.000 0.000
#> SRR1791372 1 0.0000 0.999 1.000 0.000
#> SRR1791370 1 0.0000 0.999 1.000 0.000
#> SRR1791373 1 0.0938 0.988 0.988 0.012
#> SRR1791369 1 0.0000 0.999 1.000 0.000
#> SRR1791371 1 0.0000 0.999 1.000 0.000
#> SRR1791368 1 0.0000 0.999 1.000 0.000
#> SRR1791366 2 0.0000 0.977 0.000 1.000
#> SRR1791364 1 0.0000 0.999 1.000 0.000
#> SRR1791367 1 0.0000 0.999 1.000 0.000
#> SRR1791363 1 0.0000 0.999 1.000 0.000
#> SRR1791361 1 0.0000 0.999 1.000 0.000
#> SRR1791360 1 0.0000 0.999 1.000 0.000
#> SRR1791359 2 0.0000 0.977 0.000 1.000
#> SRR1791358 2 0.0000 0.977 0.000 1.000
#> SRR1791365 2 0.0000 0.977 0.000 1.000
#> SRR1791357 1 0.0000 0.999 1.000 0.000
#> SRR1791356 1 0.0000 0.999 1.000 0.000
#> SRR1791355 2 0.0000 0.977 0.000 1.000
#> SRR1791362 1 0.0000 0.999 1.000 0.000
#> SRR1791354 2 0.0000 0.977 0.000 1.000
#> SRR1791353 1 0.0000 0.999 1.000 0.000
#> SRR1791352 1 0.0000 0.999 1.000 0.000
#> SRR1791349 2 0.0000 0.977 0.000 1.000
#> SRR1791348 1 0.0000 0.999 1.000 0.000
#> SRR1791351 2 0.0000 0.977 0.000 1.000
#> SRR1791350 1 0.0000 0.999 1.000 0.000
#> SRR1791339 2 0.2948 0.929 0.052 0.948
#> SRR1791338 2 0.0000 0.977 0.000 1.000
#> SRR1791336 2 0.0000 0.977 0.000 1.000
#> SRR1791337 1 0.0000 0.999 1.000 0.000
#> SRR1791335 2 0.0000 0.977 0.000 1.000
#> SRR1791332 1 0.0000 0.999 1.000 0.000
#> SRR1791331 2 0.0000 0.977 0.000 1.000
#> SRR1791330 1 0.0000 0.999 1.000 0.000
#> SRR1791334 1 0.0000 0.999 1.000 0.000
#> SRR1791328 2 0.9963 0.157 0.464 0.536
#> SRR1791327 2 0.0000 0.977 0.000 1.000
#> SRR1791333 1 0.0938 0.988 0.988 0.012
#> SRR1791326 2 0.0000 0.977 0.000 1.000
#> SRR1791324 2 0.0000 0.977 0.000 1.000
#> SRR1791323 2 0.0000 0.977 0.000 1.000
#> SRR1791322 2 0.0000 0.977 0.000 1.000
#> SRR1791329 2 0.0000 0.977 0.000 1.000
#> SRR1791321 1 0.0000 0.999 1.000 0.000
#> SRR1791320 2 0.0376 0.973 0.004 0.996
#> SRR1791325 1 0.0000 0.999 1.000 0.000
#> SRR1791318 1 0.0000 0.999 1.000 0.000
#> SRR1791317 2 0.0000 0.977 0.000 1.000
#> SRR1791313 1 0.0000 0.999 1.000 0.000
#> SRR1791312 1 0.0000 0.999 1.000 0.000
#> SRR1791319 1 0.0000 0.999 1.000 0.000
#> SRR1791316 1 0.0000 0.999 1.000 0.000
#> SRR1791315 1 0.0000 0.999 1.000 0.000
#> SRR1791311 1 0.0000 0.999 1.000 0.000
#> SRR1791314 2 0.0000 0.977 0.000 1.000
#> SRR1791310 2 0.0000 0.977 0.000 1.000
#> SRR1791308 2 0.0000 0.977 0.000 1.000
#> SRR1791307 1 0.0000 0.999 1.000 0.000
#> SRR1791306 1 0.0000 0.999 1.000 0.000
#> SRR1791305 2 0.0000 0.977 0.000 1.000
#> SRR1791309 2 0.0000 0.977 0.000 1.000
#> SRR1791304 1 0.0000 0.999 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 2 0.3192 0.827 0.000 0.888 0.112
#> SRR1791346 2 0.6180 0.190 0.000 0.584 0.416
#> SRR1791345 1 0.4750 0.646 0.784 0.000 0.216
#> SRR1791344 2 0.0237 0.933 0.000 0.996 0.004
#> SRR1791343 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791341 1 0.4842 0.759 0.776 0.000 0.224
#> SRR1791342 2 0.4887 0.677 0.000 0.772 0.228
#> SRR1791340 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791375 3 0.0829 0.704 0.004 0.012 0.984
#> SRR1791374 1 0.5138 0.582 0.748 0.000 0.252
#> SRR1791372 1 0.0237 0.872 0.996 0.000 0.004
#> SRR1791370 3 0.4842 0.697 0.224 0.000 0.776
#> SRR1791373 1 0.3686 0.738 0.860 0.140 0.000
#> SRR1791369 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791368 1 0.4291 0.790 0.820 0.000 0.180
#> SRR1791366 2 0.0237 0.934 0.000 0.996 0.004
#> SRR1791364 1 0.0237 0.872 0.996 0.000 0.004
#> SRR1791367 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791363 1 0.4887 0.757 0.772 0.000 0.228
#> SRR1791361 1 0.8873 0.503 0.576 0.200 0.224
#> SRR1791360 1 0.4931 0.617 0.768 0.000 0.232
#> SRR1791359 3 0.4842 0.726 0.000 0.224 0.776
#> SRR1791358 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791365 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791357 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791355 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791362 1 0.4504 0.778 0.804 0.000 0.196
#> SRR1791354 3 0.4842 0.726 0.000 0.224 0.776
#> SRR1791353 3 0.5706 0.225 0.320 0.000 0.680
#> SRR1791352 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791349 2 0.0237 0.934 0.000 0.996 0.004
#> SRR1791348 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791350 1 0.0592 0.870 0.988 0.000 0.012
#> SRR1791339 2 0.1315 0.913 0.008 0.972 0.020
#> SRR1791338 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791337 3 0.4842 0.697 0.224 0.000 0.776
#> SRR1791335 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791332 1 0.4842 0.759 0.776 0.000 0.224
#> SRR1791331 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791330 3 0.5397 0.365 0.280 0.000 0.720
#> SRR1791334 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791328 2 0.7692 0.507 0.108 0.668 0.224
#> SRR1791327 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791333 1 0.8799 0.514 0.584 0.196 0.220
#> SRR1791326 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791324 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791323 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791322 3 0.4842 0.726 0.000 0.224 0.776
#> SRR1791329 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791321 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791320 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791325 3 0.4750 0.701 0.216 0.000 0.784
#> SRR1791318 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791317 3 0.5024 0.728 0.004 0.220 0.776
#> SRR1791313 1 0.0237 0.872 0.996 0.000 0.004
#> SRR1791312 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791319 1 0.0592 0.866 0.988 0.000 0.012
#> SRR1791316 1 0.0000 0.872 1.000 0.000 0.000
#> SRR1791315 1 0.0237 0.872 0.996 0.000 0.004
#> SRR1791311 1 0.4452 0.782 0.808 0.000 0.192
#> SRR1791314 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791310 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791308 2 0.5621 0.494 0.000 0.692 0.308
#> SRR1791307 1 0.4842 0.759 0.776 0.000 0.224
#> SRR1791306 1 0.4842 0.759 0.776 0.000 0.224
#> SRR1791305 2 0.0000 0.936 0.000 1.000 0.000
#> SRR1791309 3 0.4842 0.726 0.000 0.224 0.776
#> SRR1791304 1 0.0237 0.872 0.996 0.000 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 2 0.4040 0.6065 0.000 0.752 0.000 0.248
#> SRR1791346 3 0.4981 0.0586 0.000 0.464 0.536 0.000
#> SRR1791345 1 0.4857 0.5671 0.668 0.000 0.324 0.008
#> SRR1791344 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791343 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791341 4 0.0188 0.7973 0.004 0.000 0.000 0.996
#> SRR1791342 4 0.4817 0.4369 0.000 0.388 0.000 0.612
#> SRR1791340 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791375 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791374 1 0.3837 0.7218 0.776 0.000 0.224 0.000
#> SRR1791372 1 0.1867 0.8712 0.928 0.000 0.000 0.072
#> SRR1791370 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791373 1 0.3074 0.7470 0.848 0.152 0.000 0.000
#> SRR1791369 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791371 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791368 4 0.4103 0.5814 0.256 0.000 0.000 0.744
#> SRR1791366 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791364 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791363 4 0.0188 0.7965 0.000 0.000 0.004 0.996
#> SRR1791361 4 0.3569 0.7070 0.000 0.196 0.000 0.804
#> SRR1791360 1 0.4907 0.3781 0.580 0.000 0.420 0.000
#> SRR1791359 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791358 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791357 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791355 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791362 4 0.1792 0.7698 0.068 0.000 0.000 0.932
#> SRR1791354 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791353 4 0.0188 0.7965 0.000 0.000 0.004 0.996
#> SRR1791352 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791349 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791348 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.1637 0.8796 0.940 0.000 0.000 0.060
#> SRR1791339 2 0.0817 0.9411 0.000 0.976 0.000 0.024
#> SRR1791338 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791335 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791332 4 0.0188 0.7965 0.000 0.000 0.004 0.996
#> SRR1791331 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791330 4 0.4925 0.2813 0.000 0.000 0.428 0.572
#> SRR1791334 1 0.0188 0.9055 0.996 0.000 0.004 0.000
#> SRR1791328 4 0.4406 0.6040 0.000 0.300 0.000 0.700
#> SRR1791327 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791333 4 0.6683 0.6175 0.176 0.204 0.000 0.620
#> SRR1791326 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791324 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791323 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791329 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791321 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791320 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791325 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791318 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791313 1 0.0336 0.9043 0.992 0.000 0.000 0.008
#> SRR1791312 1 0.3801 0.7292 0.780 0.000 0.000 0.220
#> SRR1791319 1 0.1022 0.8929 0.968 0.000 0.032 0.000
#> SRR1791316 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.9070 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.4907 0.1716 0.580 0.000 0.000 0.420
#> SRR1791314 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791310 2 0.0000 0.9647 0.000 1.000 0.000 0.000
#> SRR1791308 2 0.4985 0.0882 0.000 0.532 0.468 0.000
#> SRR1791307 4 0.0188 0.7973 0.004 0.000 0.000 0.996
#> SRR1791306 4 0.0188 0.7973 0.004 0.000 0.000 0.996
#> SRR1791305 2 0.0336 0.9578 0.000 0.992 0.008 0.000
#> SRR1791309 3 0.0000 0.9262 0.000 0.000 1.000 0.000
#> SRR1791304 1 0.0921 0.8963 0.972 0.000 0.000 0.028
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 2 0.3321 0.7603 0.000 0.832 0.000 0.136 0.032
#> SRR1791346 3 0.5607 0.0484 0.040 0.448 0.496 0.000 0.016
#> SRR1791345 5 0.6629 0.4330 0.168 0.000 0.196 0.044 0.592
#> SRR1791344 2 0.0963 0.9137 0.000 0.964 0.000 0.000 0.036
#> SRR1791343 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791341 4 0.4088 -0.0532 0.000 0.000 0.000 0.632 0.368
#> SRR1791342 4 0.5429 0.3681 0.000 0.368 0.000 0.564 0.068
#> SRR1791340 2 0.0404 0.9337 0.000 0.988 0.000 0.000 0.012
#> SRR1791375 3 0.3607 0.6045 0.000 0.000 0.752 0.004 0.244
#> SRR1791374 1 0.4021 0.6142 0.764 0.000 0.200 0.000 0.036
#> SRR1791372 1 0.3752 0.7286 0.812 0.000 0.000 0.124 0.064
#> SRR1791370 3 0.1270 0.8392 0.000 0.000 0.948 0.000 0.052
#> SRR1791373 1 0.3278 0.6184 0.824 0.156 0.000 0.000 0.020
#> SRR1791369 1 0.1965 0.7782 0.904 0.000 0.000 0.000 0.096
#> SRR1791371 1 0.1892 0.7845 0.916 0.000 0.004 0.000 0.080
#> SRR1791368 5 0.5778 0.3428 0.128 0.000 0.000 0.280 0.592
#> SRR1791366 2 0.0609 0.9266 0.000 0.980 0.020 0.000 0.000
#> SRR1791364 1 0.1952 0.7823 0.912 0.000 0.000 0.004 0.084
#> SRR1791367 1 0.0510 0.7852 0.984 0.000 0.000 0.000 0.016
#> SRR1791363 4 0.1341 0.4799 0.000 0.000 0.000 0.944 0.056
#> SRR1791361 4 0.4593 0.4856 0.000 0.184 0.000 0.736 0.080
#> SRR1791360 1 0.6767 0.1321 0.476 0.000 0.280 0.008 0.236
#> SRR1791359 3 0.0404 0.8563 0.000 0.000 0.988 0.000 0.012
#> SRR1791358 2 0.0162 0.9369 0.000 0.996 0.000 0.000 0.004
#> SRR1791365 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.0865 0.7833 0.972 0.000 0.000 0.004 0.024
#> SRR1791356 1 0.0609 0.7831 0.980 0.000 0.000 0.000 0.020
#> SRR1791355 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791362 5 0.5273 0.3419 0.032 0.000 0.012 0.380 0.576
#> SRR1791354 3 0.0703 0.8542 0.000 0.000 0.976 0.000 0.024
#> SRR1791353 4 0.2732 0.4298 0.000 0.000 0.000 0.840 0.160
#> SRR1791352 1 0.1121 0.7899 0.956 0.000 0.000 0.000 0.044
#> SRR1791349 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791348 5 0.4306 -0.1409 0.492 0.000 0.000 0.000 0.508
#> SRR1791351 2 0.0162 0.9369 0.000 0.996 0.000 0.000 0.004
#> SRR1791350 1 0.5010 0.5773 0.688 0.000 0.000 0.088 0.224
#> SRR1791339 2 0.4944 0.3854 0.004 0.620 0.000 0.032 0.344
#> SRR1791338 2 0.0404 0.9337 0.000 0.988 0.000 0.000 0.012
#> SRR1791336 2 0.0162 0.9369 0.000 0.996 0.000 0.000 0.004
#> SRR1791337 3 0.0162 0.8572 0.000 0.000 0.996 0.000 0.004
#> SRR1791335 2 0.0162 0.9369 0.000 0.996 0.000 0.000 0.004
#> SRR1791332 5 0.4299 0.2957 0.004 0.000 0.000 0.388 0.608
#> SRR1791331 2 0.0290 0.9341 0.000 0.992 0.000 0.000 0.008
#> SRR1791330 5 0.6599 0.1973 0.000 0.000 0.344 0.220 0.436
#> SRR1791334 1 0.4302 0.6099 0.744 0.000 0.048 0.000 0.208
#> SRR1791328 4 0.6693 0.2576 0.000 0.240 0.000 0.396 0.364
#> SRR1791327 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 4 0.7515 0.2033 0.284 0.204 0.000 0.452 0.060
#> SRR1791326 2 0.0162 0.9369 0.000 0.996 0.000 0.000 0.004
#> SRR1791324 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.0000 0.8573 0.000 0.000 1.000 0.000 0.000
#> SRR1791329 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 1 0.2462 0.7477 0.880 0.000 0.008 0.000 0.112
#> SRR1791320 2 0.3128 0.7550 0.004 0.824 0.000 0.004 0.168
#> SRR1791325 3 0.1830 0.8167 0.008 0.000 0.924 0.000 0.068
#> SRR1791318 1 0.0963 0.7903 0.964 0.000 0.000 0.000 0.036
#> SRR1791317 3 0.0162 0.8568 0.000 0.000 0.996 0.000 0.004
#> SRR1791313 1 0.2416 0.7745 0.888 0.000 0.000 0.012 0.100
#> SRR1791312 1 0.7010 -0.1398 0.404 0.000 0.024 0.176 0.396
#> SRR1791319 1 0.2325 0.7532 0.904 0.000 0.068 0.000 0.028
#> SRR1791316 1 0.1197 0.7768 0.952 0.000 0.000 0.000 0.048
#> SRR1791315 1 0.1608 0.7866 0.928 0.000 0.000 0.000 0.072
#> SRR1791311 1 0.6337 -0.0166 0.500 0.000 0.000 0.180 0.320
#> SRR1791314 2 0.0000 0.9374 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 2 0.0290 0.9339 0.000 0.992 0.000 0.000 0.008
#> SRR1791308 2 0.5319 0.2223 0.012 0.556 0.400 0.000 0.032
#> SRR1791307 4 0.0609 0.4911 0.000 0.000 0.000 0.980 0.020
#> SRR1791306 4 0.1197 0.4806 0.000 0.000 0.000 0.952 0.048
#> SRR1791305 2 0.0703 0.9228 0.000 0.976 0.024 0.000 0.000
#> SRR1791309 3 0.0609 0.8523 0.000 0.000 0.980 0.000 0.020
#> SRR1791304 1 0.2676 0.7776 0.884 0.000 0.000 0.036 0.080
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 6 0.3439 0.7842 0.000 NA 0.000 0.016 0.060 0.828
#> SRR1791346 3 0.4712 0.0562 0.004 NA 0.512 0.000 0.000 0.448
#> SRR1791345 4 0.7414 0.3769 0.092 NA 0.144 0.460 0.036 0.000
#> SRR1791344 6 0.1812 0.8731 0.000 NA 0.000 0.008 0.000 0.912
#> SRR1791343 6 0.0000 0.9297 0.000 NA 0.000 0.000 0.000 1.000
#> SRR1791341 4 0.4636 0.1990 0.000 NA 0.000 0.516 0.444 0.000
#> SRR1791342 5 0.6621 0.1858 0.000 NA 0.000 0.036 0.380 0.368
#> SRR1791340 6 0.0508 0.9278 0.000 NA 0.004 0.000 0.000 0.984
#> SRR1791375 3 0.4827 0.4007 0.000 NA 0.632 0.276 0.000 0.000
#> SRR1791374 1 0.4131 0.6896 0.760 NA 0.168 0.020 0.000 0.000
#> SRR1791372 1 0.4288 0.6654 0.744 NA 0.000 0.020 0.180 0.000
#> SRR1791370 3 0.1682 0.8050 0.000 NA 0.928 0.020 0.000 0.000
#> SRR1791373 1 0.3723 0.6583 0.796 NA 0.000 0.008 0.004 0.144
#> SRR1791369 1 0.1444 0.7931 0.928 NA 0.000 0.072 0.000 0.000
#> SRR1791371 1 0.1461 0.7943 0.940 NA 0.000 0.044 0.000 0.000
#> SRR1791368 4 0.5195 0.4934 0.076 NA 0.000 0.700 0.088 0.000
#> SRR1791366 6 0.1049 0.9133 0.000 NA 0.032 0.000 0.000 0.960
#> SRR1791364 1 0.2046 0.7904 0.916 NA 0.000 0.044 0.008 0.000
#> SRR1791367 1 0.1493 0.7944 0.936 NA 0.004 0.004 0.000 0.000
#> SRR1791363 5 0.2212 0.3424 0.000 NA 0.000 0.112 0.880 0.000
#> SRR1791361 5 0.6950 0.2832 0.012 NA 0.000 0.120 0.528 0.152
#> SRR1791360 1 0.7450 0.2142 0.428 NA 0.180 0.112 0.016 0.000
#> SRR1791359 3 0.0363 0.8289 0.000 NA 0.988 0.000 0.000 0.000
#> SRR1791358 6 0.0260 0.9293 0.000 NA 0.000 0.000 0.000 0.992
#> SRR1791365 6 0.0146 0.9297 0.000 NA 0.000 0.000 0.000 0.996
#> SRR1791357 1 0.2618 0.7866 0.860 NA 0.000 0.000 0.024 0.000
#> SRR1791356 1 0.1152 0.7950 0.952 NA 0.000 0.004 0.000 0.000
#> SRR1791355 6 0.0000 0.9297 0.000 NA 0.000 0.000 0.000 1.000
#> SRR1791362 4 0.4498 0.5033 0.068 NA 0.000 0.752 0.136 0.000
#> SRR1791354 3 0.1434 0.8083 0.000 NA 0.940 0.012 0.000 0.000
#> SRR1791353 5 0.4311 0.2847 0.000 NA 0.000 0.088 0.716 0.000
#> SRR1791352 1 0.0717 0.7974 0.976 NA 0.000 0.016 0.000 0.000
#> SRR1791349 6 0.0551 0.9268 0.000 NA 0.004 0.004 0.000 0.984
#> SRR1791348 4 0.5544 0.3972 0.168 NA 0.000 0.568 0.004 0.000
#> SRR1791351 6 0.0363 0.9282 0.000 NA 0.000 0.000 0.000 0.988
#> SRR1791350 1 0.7284 0.0220 0.416 NA 0.000 0.256 0.148 0.000
#> SRR1791339 6 0.5511 0.3356 0.004 NA 0.000 0.316 0.024 0.580
#> SRR1791338 6 0.0458 0.9273 0.000 NA 0.000 0.000 0.000 0.984
#> SRR1791336 6 0.0547 0.9256 0.000 NA 0.000 0.000 0.000 0.980
#> SRR1791337 3 0.0260 0.8292 0.000 NA 0.992 0.000 0.000 0.000
#> SRR1791335 6 0.0146 0.9297 0.000 NA 0.000 0.000 0.000 0.996
#> SRR1791332 4 0.3598 0.4970 0.000 NA 0.004 0.804 0.112 0.000
#> SRR1791331 6 0.0858 0.9173 0.000 NA 0.000 0.004 0.000 0.968
#> SRR1791330 4 0.7167 0.3439 0.016 NA 0.268 0.460 0.080 0.000
#> SRR1791334 1 0.4810 0.6615 0.700 NA 0.016 0.080 0.004 0.000
#> SRR1791328 4 0.7546 -0.0271 0.000 NA 0.000 0.316 0.156 0.228
#> SRR1791327 6 0.0146 0.9297 0.000 NA 0.000 0.000 0.000 0.996
#> SRR1791333 5 0.8569 0.1409 0.268 NA 0.000 0.080 0.280 0.204
#> SRR1791326 6 0.0260 0.9294 0.000 NA 0.000 0.000 0.000 0.992
#> SRR1791324 6 0.0146 0.9291 0.000 NA 0.000 0.000 0.000 0.996
#> SRR1791323 6 0.0260 0.9286 0.000 NA 0.000 0.000 0.000 0.992
#> SRR1791322 3 0.0146 0.8290 0.000 NA 0.996 0.000 0.000 0.000
#> SRR1791329 6 0.0000 0.9297 0.000 NA 0.000 0.000 0.000 1.000
#> SRR1791321 1 0.3567 0.7447 0.804 NA 0.004 0.068 0.000 0.000
#> SRR1791320 6 0.3360 0.7986 0.004 NA 0.000 0.080 0.008 0.836
#> SRR1791325 3 0.2920 0.7608 0.016 NA 0.864 0.040 0.000 0.000
#> SRR1791318 1 0.0508 0.7976 0.984 NA 0.000 0.012 0.000 0.000
#> SRR1791317 3 0.0363 0.8282 0.000 NA 0.988 0.000 0.000 0.000
#> SRR1791313 1 0.3023 0.7652 0.864 NA 0.000 0.056 0.052 0.000
#> SRR1791312 5 0.7857 -0.1586 0.244 NA 0.012 0.256 0.324 0.000
#> SRR1791319 1 0.2638 0.7860 0.884 NA 0.040 0.016 0.000 0.000
#> SRR1791316 1 0.2170 0.7864 0.888 NA 0.000 0.012 0.000 0.000
#> SRR1791315 1 0.1370 0.7977 0.948 NA 0.000 0.036 0.004 0.000
#> SRR1791311 1 0.6536 -0.1518 0.416 NA 0.000 0.396 0.116 0.000
#> SRR1791314 6 0.0146 0.9297 0.000 NA 0.000 0.000 0.000 0.996
#> SRR1791310 6 0.0547 0.9240 0.000 NA 0.000 0.000 0.000 0.980
#> SRR1791308 6 0.5202 0.1212 0.004 NA 0.400 0.000 0.000 0.516
#> SRR1791307 5 0.1498 0.3798 0.000 NA 0.000 0.028 0.940 0.000
#> SRR1791306 5 0.2865 0.3439 0.012 NA 0.000 0.064 0.868 0.000
#> SRR1791305 6 0.0692 0.9220 0.000 NA 0.020 0.000 0.000 0.976
#> SRR1791309 3 0.0458 0.8267 0.000 NA 0.984 0.000 0.000 0.000
#> SRR1791304 1 0.3356 0.7609 0.840 NA 0.000 0.024 0.064 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 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.789 0.907 0.952 0.4377 0.532 0.532
#> 3 3 0.761 0.860 0.912 0.2002 0.944 0.894
#> 4 4 0.835 0.774 0.898 0.0925 0.973 0.943
#> 5 5 0.788 0.792 0.899 0.0410 0.973 0.941
#> 6 6 0.783 0.780 0.850 0.0417 0.968 0.926
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
#> SRR1791347 1 0.0376 0.987 0.996 0.004
#> SRR1791346 2 0.7674 0.733 0.224 0.776
#> SRR1791345 1 0.0000 0.991 1.000 0.000
#> SRR1791344 1 0.0376 0.987 0.996 0.004
#> SRR1791343 2 0.3114 0.868 0.056 0.944
#> SRR1791341 1 0.0000 0.991 1.000 0.000
#> SRR1791342 1 0.0000 0.991 1.000 0.000
#> SRR1791340 2 0.0000 0.871 0.000 1.000
#> SRR1791375 1 0.0000 0.991 1.000 0.000
#> SRR1791374 1 0.0000 0.991 1.000 0.000
#> SRR1791372 1 0.0000 0.991 1.000 0.000
#> SRR1791370 1 0.0000 0.991 1.000 0.000
#> SRR1791373 1 0.0000 0.991 1.000 0.000
#> SRR1791369 1 0.0000 0.991 1.000 0.000
#> SRR1791371 1 0.0000 0.991 1.000 0.000
#> SRR1791368 1 0.0000 0.991 1.000 0.000
#> SRR1791366 2 0.3114 0.868 0.056 0.944
#> SRR1791364 1 0.0000 0.991 1.000 0.000
#> SRR1791367 1 0.0000 0.991 1.000 0.000
#> SRR1791363 1 0.0000 0.991 1.000 0.000
#> SRR1791361 1 0.0000 0.991 1.000 0.000
#> SRR1791360 1 0.0000 0.991 1.000 0.000
#> SRR1791359 2 0.9795 0.488 0.416 0.584
#> SRR1791358 2 0.0000 0.871 0.000 1.000
#> SRR1791365 2 0.0672 0.871 0.008 0.992
#> SRR1791357 1 0.0000 0.991 1.000 0.000
#> SRR1791356 1 0.0000 0.991 1.000 0.000
#> SRR1791355 2 0.3114 0.868 0.056 0.944
#> SRR1791362 1 0.0000 0.991 1.000 0.000
#> SRR1791354 2 0.9795 0.488 0.416 0.584
#> SRR1791353 1 0.0000 0.991 1.000 0.000
#> SRR1791352 1 0.0000 0.991 1.000 0.000
#> SRR1791349 2 0.3114 0.868 0.056 0.944
#> SRR1791348 1 0.0000 0.991 1.000 0.000
#> SRR1791351 2 0.0000 0.871 0.000 1.000
#> SRR1791350 1 0.0000 0.991 1.000 0.000
#> SRR1791339 1 0.4431 0.884 0.908 0.092
#> SRR1791338 2 0.0000 0.871 0.000 1.000
#> SRR1791336 2 0.0000 0.871 0.000 1.000
#> SRR1791337 2 0.9795 0.488 0.416 0.584
#> SRR1791335 2 0.0000 0.871 0.000 1.000
#> SRR1791332 1 0.0000 0.991 1.000 0.000
#> SRR1791331 1 0.6247 0.789 0.844 0.156
#> SRR1791330 1 0.0000 0.991 1.000 0.000
#> SRR1791334 1 0.0000 0.991 1.000 0.000
#> SRR1791328 1 0.0000 0.991 1.000 0.000
#> SRR1791327 2 0.0000 0.871 0.000 1.000
#> SRR1791333 1 0.0000 0.991 1.000 0.000
#> SRR1791326 2 0.0376 0.871 0.004 0.996
#> SRR1791324 2 0.3114 0.868 0.056 0.944
#> SRR1791323 2 0.0000 0.871 0.000 1.000
#> SRR1791322 2 0.9795 0.488 0.416 0.584
#> SRR1791329 2 0.3114 0.868 0.056 0.944
#> SRR1791321 1 0.0000 0.991 1.000 0.000
#> SRR1791320 1 0.0376 0.987 0.996 0.004
#> SRR1791325 1 0.0000 0.991 1.000 0.000
#> SRR1791318 1 0.0000 0.991 1.000 0.000
#> SRR1791317 2 0.9795 0.488 0.416 0.584
#> SRR1791313 1 0.0000 0.991 1.000 0.000
#> SRR1791312 1 0.0000 0.991 1.000 0.000
#> SRR1791319 1 0.0000 0.991 1.000 0.000
#> SRR1791316 1 0.0000 0.991 1.000 0.000
#> SRR1791315 1 0.0000 0.991 1.000 0.000
#> SRR1791311 1 0.0000 0.991 1.000 0.000
#> SRR1791314 2 0.0000 0.871 0.000 1.000
#> SRR1791310 1 0.4431 0.884 0.908 0.092
#> SRR1791308 2 0.0000 0.871 0.000 1.000
#> SRR1791307 1 0.0000 0.991 1.000 0.000
#> SRR1791306 1 0.0000 0.991 1.000 0.000
#> SRR1791305 2 0.3114 0.868 0.056 0.944
#> SRR1791309 2 0.9795 0.488 0.416 0.584
#> SRR1791304 1 0.0000 0.991 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 1 0.2261 0.9148 0.932 0.000 0.068
#> SRR1791346 3 0.0747 0.5574 0.000 0.016 0.984
#> SRR1791345 1 0.1860 0.9260 0.948 0.000 0.052
#> SRR1791344 1 0.2261 0.9148 0.932 0.000 0.068
#> SRR1791343 2 0.6274 0.6273 0.000 0.544 0.456
#> SRR1791341 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791342 1 0.0747 0.9597 0.984 0.000 0.016
#> SRR1791340 2 0.0000 0.7655 0.000 1.000 0.000
#> SRR1791375 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791374 1 0.0237 0.9685 0.996 0.000 0.004
#> SRR1791372 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791370 1 0.0424 0.9658 0.992 0.000 0.008
#> SRR1791373 1 0.3267 0.8600 0.884 0.000 0.116
#> SRR1791369 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791368 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791366 2 0.6274 0.6273 0.000 0.544 0.456
#> SRR1791364 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791363 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791361 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791360 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791359 3 0.4504 0.8679 0.196 0.000 0.804
#> SRR1791358 2 0.0000 0.7655 0.000 1.000 0.000
#> SRR1791365 2 0.4796 0.7071 0.000 0.780 0.220
#> SRR1791357 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791356 1 0.0237 0.9685 0.996 0.000 0.004
#> SRR1791355 2 0.6274 0.6273 0.000 0.544 0.456
#> SRR1791362 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791354 3 0.4504 0.8679 0.196 0.000 0.804
#> SRR1791353 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791352 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791349 2 0.6274 0.6273 0.000 0.544 0.456
#> SRR1791348 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.7655 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791339 1 0.4887 0.7028 0.772 0.000 0.228
#> SRR1791338 2 0.0000 0.7655 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.7655 0.000 1.000 0.000
#> SRR1791337 3 0.4504 0.8679 0.196 0.000 0.804
#> SRR1791335 2 0.0000 0.7655 0.000 1.000 0.000
#> SRR1791332 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791331 1 0.5497 0.5858 0.708 0.000 0.292
#> SRR1791330 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791334 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791328 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791327 2 0.0000 0.7655 0.000 1.000 0.000
#> SRR1791333 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791326 2 0.4605 0.7125 0.000 0.796 0.204
#> SRR1791324 2 0.6274 0.6273 0.000 0.544 0.456
#> SRR1791323 2 0.0237 0.7652 0.000 0.996 0.004
#> SRR1791322 3 0.4504 0.8679 0.196 0.000 0.804
#> SRR1791329 2 0.6274 0.6273 0.000 0.544 0.456
#> SRR1791321 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791320 1 0.2261 0.9148 0.932 0.000 0.068
#> SRR1791325 1 0.0424 0.9658 0.992 0.000 0.008
#> SRR1791318 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791317 3 0.4504 0.8679 0.196 0.000 0.804
#> SRR1791313 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791319 1 0.0237 0.9685 0.996 0.000 0.004
#> SRR1791316 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791314 2 0.0000 0.7655 0.000 1.000 0.000
#> SRR1791310 1 0.4887 0.7028 0.772 0.000 0.228
#> SRR1791308 3 0.5810 0.0948 0.000 0.336 0.664
#> SRR1791307 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791306 1 0.0000 0.9710 1.000 0.000 0.000
#> SRR1791305 2 0.6274 0.6273 0.000 0.544 0.456
#> SRR1791309 3 0.4504 0.8679 0.196 0.000 0.804
#> SRR1791304 1 0.0000 0.9710 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.2405 0.833 0.036 0.016 0.020 0.928
#> SRR1791346 3 0.7221 0.525 0.140 0.428 0.432 0.000
#> SRR1791345 1 0.7098 0.000 0.472 0.000 0.128 0.400
#> SRR1791344 4 0.2405 0.833 0.036 0.016 0.020 0.928
#> SRR1791343 2 0.1211 0.647 0.000 0.960 0.040 0.000
#> SRR1791341 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791342 4 0.0859 0.899 0.008 0.008 0.004 0.980
#> SRR1791340 2 0.4898 0.752 0.416 0.584 0.000 0.000
#> SRR1791375 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791374 4 0.2921 0.685 0.140 0.000 0.000 0.860
#> SRR1791372 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791370 4 0.0336 0.912 0.000 0.000 0.008 0.992
#> SRR1791373 4 0.7314 -0.760 0.400 0.008 0.120 0.472
#> SRR1791369 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791371 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791368 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791366 2 0.1211 0.647 0.000 0.960 0.040 0.000
#> SRR1791364 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791367 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791363 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791361 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791360 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791359 3 0.2814 0.937 0.000 0.132 0.868 0.000
#> SRR1791358 2 0.4898 0.752 0.416 0.584 0.000 0.000
#> SRR1791365 2 0.3791 0.715 0.200 0.796 0.004 0.000
#> SRR1791357 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791356 4 0.3681 0.572 0.176 0.000 0.008 0.816
#> SRR1791355 2 0.1211 0.647 0.000 0.960 0.040 0.000
#> SRR1791362 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791354 3 0.2814 0.937 0.000 0.132 0.868 0.000
#> SRR1791353 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791352 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791349 2 0.1211 0.647 0.000 0.960 0.040 0.000
#> SRR1791348 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791351 2 0.4898 0.752 0.416 0.584 0.000 0.000
#> SRR1791350 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791339 4 0.5754 0.483 0.068 0.108 0.060 0.764
#> SRR1791338 2 0.4898 0.752 0.416 0.584 0.000 0.000
#> SRR1791336 2 0.4898 0.752 0.416 0.584 0.000 0.000
#> SRR1791337 3 0.2814 0.937 0.000 0.132 0.868 0.000
#> SRR1791335 2 0.4898 0.752 0.416 0.584 0.000 0.000
#> SRR1791332 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791331 4 0.6521 0.278 0.068 0.172 0.060 0.700
#> SRR1791330 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791334 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791328 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791327 2 0.4898 0.752 0.416 0.584 0.000 0.000
#> SRR1791333 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791326 2 0.3726 0.719 0.212 0.788 0.000 0.000
#> SRR1791324 2 0.1211 0.647 0.000 0.960 0.040 0.000
#> SRR1791323 2 0.4888 0.752 0.412 0.588 0.000 0.000
#> SRR1791322 3 0.2814 0.937 0.000 0.132 0.868 0.000
#> SRR1791329 2 0.1211 0.647 0.000 0.960 0.040 0.000
#> SRR1791321 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791320 4 0.2405 0.833 0.036 0.016 0.020 0.928
#> SRR1791325 4 0.0336 0.912 0.000 0.000 0.008 0.992
#> SRR1791318 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791317 3 0.2814 0.937 0.000 0.132 0.868 0.000
#> SRR1791313 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791312 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791319 4 0.3681 0.572 0.176 0.000 0.008 0.816
#> SRR1791316 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791315 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791311 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791314 2 0.4898 0.752 0.416 0.584 0.000 0.000
#> SRR1791310 4 0.5754 0.483 0.068 0.108 0.060 0.764
#> SRR1791308 2 0.7212 -0.112 0.160 0.516 0.324 0.000
#> SRR1791307 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791306 4 0.0000 0.921 0.000 0.000 0.000 1.000
#> SRR1791305 2 0.1211 0.647 0.000 0.960 0.040 0.000
#> SRR1791309 3 0.2814 0.937 0.000 0.132 0.868 0.000
#> SRR1791304 4 0.0000 0.921 0.000 0.000 0.000 1.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 1 0.3549 0.815 0.860 0.016 0.016 0.036 0.072
#> SRR1791346 4 0.5131 0.487 0.000 0.436 0.024 0.532 0.008
#> SRR1791345 5 0.1331 0.334 0.040 0.000 0.000 0.008 0.952
#> SRR1791344 1 0.3549 0.815 0.860 0.016 0.016 0.036 0.072
#> SRR1791343 2 0.0609 0.436 0.000 0.980 0.020 0.000 0.000
#> SRR1791341 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791342 1 0.2115 0.873 0.916 0.008 0.000 0.008 0.068
#> SRR1791340 2 0.4268 0.678 0.000 0.556 0.000 0.444 0.000
#> SRR1791375 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791374 1 0.2605 0.783 0.852 0.000 0.000 0.000 0.148
#> SRR1791372 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791370 1 0.0290 0.937 0.992 0.000 0.008 0.000 0.000
#> SRR1791373 5 0.5702 0.451 0.232 0.008 0.000 0.120 0.640
#> SRR1791369 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791371 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791368 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791366 2 0.0609 0.436 0.000 0.980 0.020 0.000 0.000
#> SRR1791364 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791363 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791361 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791360 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791359 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791358 2 0.4268 0.678 0.000 0.556 0.000 0.444 0.000
#> SRR1791365 2 0.3642 0.590 0.000 0.760 0.008 0.232 0.000
#> SRR1791357 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.3492 0.697 0.796 0.000 0.000 0.016 0.188
#> SRR1791355 2 0.0609 0.436 0.000 0.980 0.020 0.000 0.000
#> SRR1791362 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791354 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791353 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791352 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791349 2 0.0609 0.436 0.000 0.980 0.020 0.000 0.000
#> SRR1791348 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791351 2 0.4268 0.678 0.000 0.556 0.000 0.444 0.000
#> SRR1791350 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791339 1 0.6310 0.520 0.684 0.128 0.020 0.072 0.096
#> SRR1791338 2 0.4268 0.678 0.000 0.556 0.000 0.444 0.000
#> SRR1791336 2 0.4268 0.678 0.000 0.556 0.000 0.444 0.000
#> SRR1791337 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791335 2 0.4268 0.678 0.000 0.556 0.000 0.444 0.000
#> SRR1791332 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791331 1 0.6077 0.488 0.676 0.192 0.020 0.072 0.040
#> SRR1791330 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791334 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791328 1 0.0404 0.935 0.988 0.000 0.000 0.000 0.012
#> SRR1791327 2 0.4268 0.678 0.000 0.556 0.000 0.444 0.000
#> SRR1791333 1 0.0404 0.935 0.988 0.000 0.000 0.000 0.012
#> SRR1791326 2 0.3424 0.597 0.000 0.760 0.000 0.240 0.000
#> SRR1791324 2 0.0609 0.436 0.000 0.980 0.020 0.000 0.000
#> SRR1791323 2 0.4262 0.677 0.000 0.560 0.000 0.440 0.000
#> SRR1791322 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791329 2 0.0609 0.436 0.000 0.980 0.020 0.000 0.000
#> SRR1791321 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791320 1 0.3549 0.815 0.860 0.016 0.016 0.036 0.072
#> SRR1791325 1 0.0290 0.937 0.992 0.000 0.008 0.000 0.000
#> SRR1791318 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791313 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791319 1 0.3492 0.697 0.796 0.000 0.000 0.016 0.188
#> SRR1791316 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791311 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791314 2 0.4268 0.678 0.000 0.556 0.000 0.444 0.000
#> SRR1791310 1 0.6310 0.520 0.684 0.128 0.020 0.072 0.096
#> SRR1791308 4 0.4300 0.409 0.000 0.476 0.000 0.524 0.000
#> SRR1791307 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791306 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000
#> SRR1791305 2 0.0609 0.436 0.000 0.980 0.020 0.000 0.000
#> SRR1791309 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791304 1 0.0000 0.942 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
#> SRR1791347 4 0.3566 0.714 0.000 0.024 0 0.752 0.224 0.000
#> SRR1791346 5 0.5058 0.312 0.000 0.424 0 0.000 0.500 0.076
#> SRR1791345 1 0.0000 0.000 1.000 0.000 0 0.000 0.000 0.000
#> SRR1791344 4 0.3566 0.714 0.000 0.024 0 0.752 0.224 0.000
#> SRR1791343 2 0.0000 0.779 0.000 1.000 0 0.000 0.000 0.000
#> SRR1791341 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791342 4 0.2527 0.797 0.000 0.000 0 0.832 0.168 0.000
#> SRR1791340 2 0.4337 -0.907 0.000 0.500 0 0.000 0.020 0.480
#> SRR1791375 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791374 4 0.3023 0.749 0.008 0.000 0 0.808 0.004 0.180
#> SRR1791372 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791370 4 0.0891 0.907 0.000 0.008 0 0.968 0.024 0.000
#> SRR1791373 5 0.5927 -0.339 0.184 0.000 0 0.004 0.444 0.368
#> SRR1791369 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791371 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791368 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791366 2 0.0000 0.779 0.000 1.000 0 0.000 0.000 0.000
#> SRR1791364 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791367 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791363 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791361 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791360 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791359 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR1791358 6 0.3851 0.968 0.000 0.460 0 0.000 0.000 0.540
#> SRR1791365 2 0.3101 0.193 0.000 0.756 0 0.000 0.000 0.244
#> SRR1791357 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791356 4 0.4267 0.576 0.012 0.000 0 0.688 0.028 0.272
#> SRR1791355 2 0.0000 0.779 0.000 1.000 0 0.000 0.000 0.000
#> SRR1791362 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791354 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR1791353 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791352 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791349 2 0.0000 0.779 0.000 1.000 0 0.000 0.000 0.000
#> SRR1791348 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791351 6 0.3851 0.968 0.000 0.460 0 0.000 0.000 0.540
#> SRR1791350 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791339 4 0.5350 0.402 0.000 0.140 0 0.564 0.296 0.000
#> SRR1791338 6 0.3866 0.907 0.000 0.484 0 0.000 0.000 0.516
#> SRR1791336 6 0.3866 0.907 0.000 0.484 0 0.000 0.000 0.516
#> SRR1791337 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR1791335 6 0.3851 0.968 0.000 0.460 0 0.000 0.000 0.540
#> SRR1791332 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791331 4 0.5529 0.372 0.000 0.212 0 0.560 0.228 0.000
#> SRR1791330 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791334 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791328 4 0.0363 0.919 0.000 0.000 0 0.988 0.012 0.000
#> SRR1791327 6 0.3851 0.968 0.000 0.460 0 0.000 0.000 0.540
#> SRR1791333 4 0.0363 0.919 0.000 0.000 0 0.988 0.012 0.000
#> SRR1791326 2 0.3198 0.113 0.000 0.740 0 0.000 0.000 0.260
#> SRR1791324 2 0.0000 0.779 0.000 1.000 0 0.000 0.000 0.000
#> SRR1791323 6 0.3857 0.958 0.000 0.468 0 0.000 0.000 0.532
#> SRR1791322 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR1791329 2 0.0000 0.779 0.000 1.000 0 0.000 0.000 0.000
#> SRR1791321 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791320 4 0.3566 0.714 0.000 0.024 0 0.752 0.224 0.000
#> SRR1791325 4 0.0891 0.907 0.000 0.008 0 0.968 0.024 0.000
#> SRR1791318 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791317 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR1791313 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791312 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791319 4 0.4267 0.576 0.012 0.000 0 0.688 0.028 0.272
#> SRR1791316 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791315 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791311 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791314 6 0.3851 0.968 0.000 0.460 0 0.000 0.000 0.540
#> SRR1791310 4 0.5350 0.402 0.000 0.140 0 0.564 0.296 0.000
#> SRR1791308 5 0.5226 0.298 0.000 0.448 0 0.000 0.460 0.092
#> SRR1791307 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791306 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
#> SRR1791305 2 0.0000 0.779 0.000 1.000 0 0.000 0.000 0.000
#> SRR1791309 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR1791304 4 0.0000 0.925 0.000 0.000 0 1.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.943 0.947 0.977 0.4528 0.532 0.532
#> 3 3 0.986 0.937 0.966 0.3661 0.762 0.585
#> 4 4 0.746 0.742 0.848 0.0977 0.942 0.849
#> 5 5 0.698 0.608 0.787 0.0677 0.954 0.870
#> 6 6 0.709 0.564 0.734 0.0529 0.826 0.512
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1791347 1 0.000 1.000 1.000 0.000
#> SRR1791346 2 0.000 0.933 0.000 1.000
#> SRR1791345 1 0.000 1.000 1.000 0.000
#> SRR1791344 1 0.000 1.000 1.000 0.000
#> SRR1791343 2 0.000 0.933 0.000 1.000
#> SRR1791341 1 0.000 1.000 1.000 0.000
#> SRR1791342 1 0.000 1.000 1.000 0.000
#> SRR1791340 2 0.000 0.933 0.000 1.000
#> SRR1791375 1 0.000 1.000 1.000 0.000
#> SRR1791374 1 0.000 1.000 1.000 0.000
#> SRR1791372 1 0.000 1.000 1.000 0.000
#> SRR1791370 1 0.000 1.000 1.000 0.000
#> SRR1791373 1 0.000 1.000 1.000 0.000
#> SRR1791369 1 0.000 1.000 1.000 0.000
#> SRR1791371 1 0.000 1.000 1.000 0.000
#> SRR1791368 1 0.000 1.000 1.000 0.000
#> SRR1791366 2 0.000 0.933 0.000 1.000
#> SRR1791364 1 0.000 1.000 1.000 0.000
#> SRR1791367 1 0.000 1.000 1.000 0.000
#> SRR1791363 1 0.000 1.000 1.000 0.000
#> SRR1791361 1 0.000 1.000 1.000 0.000
#> SRR1791360 1 0.000 1.000 1.000 0.000
#> SRR1791359 2 0.983 0.359 0.424 0.576
#> SRR1791358 2 0.000 0.933 0.000 1.000
#> SRR1791365 2 0.000 0.933 0.000 1.000
#> SRR1791357 1 0.000 1.000 1.000 0.000
#> SRR1791356 1 0.000 1.000 1.000 0.000
#> SRR1791355 2 0.000 0.933 0.000 1.000
#> SRR1791362 1 0.000 1.000 1.000 0.000
#> SRR1791354 2 0.973 0.407 0.404 0.596
#> SRR1791353 1 0.000 1.000 1.000 0.000
#> SRR1791352 1 0.000 1.000 1.000 0.000
#> SRR1791349 2 0.000 0.933 0.000 1.000
#> SRR1791348 1 0.000 1.000 1.000 0.000
#> SRR1791351 2 0.000 0.933 0.000 1.000
#> SRR1791350 1 0.000 1.000 1.000 0.000
#> SRR1791339 1 0.000 1.000 1.000 0.000
#> SRR1791338 2 0.000 0.933 0.000 1.000
#> SRR1791336 2 0.000 0.933 0.000 1.000
#> SRR1791337 2 0.983 0.359 0.424 0.576
#> SRR1791335 2 0.000 0.933 0.000 1.000
#> SRR1791332 1 0.000 1.000 1.000 0.000
#> SRR1791331 2 0.000 0.933 0.000 1.000
#> SRR1791330 1 0.000 1.000 1.000 0.000
#> SRR1791334 1 0.000 1.000 1.000 0.000
#> SRR1791328 1 0.000 1.000 1.000 0.000
#> SRR1791327 2 0.000 0.933 0.000 1.000
#> SRR1791333 1 0.000 1.000 1.000 0.000
#> SRR1791326 2 0.000 0.933 0.000 1.000
#> SRR1791324 2 0.000 0.933 0.000 1.000
#> SRR1791323 2 0.000 0.933 0.000 1.000
#> SRR1791322 1 0.000 1.000 1.000 0.000
#> SRR1791329 2 0.000 0.933 0.000 1.000
#> SRR1791321 1 0.000 1.000 1.000 0.000
#> SRR1791320 1 0.000 1.000 1.000 0.000
#> SRR1791325 1 0.000 1.000 1.000 0.000
#> SRR1791318 1 0.000 1.000 1.000 0.000
#> SRR1791317 2 0.722 0.753 0.200 0.800
#> SRR1791313 1 0.000 1.000 1.000 0.000
#> SRR1791312 1 0.000 1.000 1.000 0.000
#> SRR1791319 1 0.000 1.000 1.000 0.000
#> SRR1791316 1 0.000 1.000 1.000 0.000
#> SRR1791315 1 0.000 1.000 1.000 0.000
#> SRR1791311 1 0.000 1.000 1.000 0.000
#> SRR1791314 2 0.000 0.933 0.000 1.000
#> SRR1791310 1 0.000 1.000 1.000 0.000
#> SRR1791308 2 0.000 0.933 0.000 1.000
#> SRR1791307 1 0.000 1.000 1.000 0.000
#> SRR1791306 1 0.000 1.000 1.000 0.000
#> SRR1791305 2 0.000 0.933 0.000 1.000
#> SRR1791309 2 0.722 0.753 0.200 0.800
#> SRR1791304 1 0.000 1.000 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.2066 0.872 0.060 0.000 0.940
#> SRR1791346 3 0.1031 0.903 0.000 0.024 0.976
#> SRR1791345 3 0.1031 0.898 0.024 0.000 0.976
#> SRR1791344 3 0.4887 0.676 0.228 0.000 0.772
#> SRR1791343 3 0.5327 0.650 0.000 0.272 0.728
#> SRR1791341 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791342 1 0.4842 0.724 0.776 0.000 0.224
#> SRR1791340 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791375 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791374 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791372 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791370 3 0.6225 0.231 0.432 0.000 0.568
#> SRR1791373 3 0.1031 0.898 0.024 0.000 0.976
#> SRR1791369 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791368 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791366 3 0.1860 0.896 0.000 0.052 0.948
#> SRR1791364 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791363 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791361 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791360 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791359 3 0.1031 0.903 0.000 0.024 0.976
#> SRR1791358 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791365 2 0.0892 0.984 0.000 0.980 0.020
#> SRR1791357 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791355 3 0.4654 0.744 0.000 0.208 0.792
#> SRR1791362 1 0.0892 0.983 0.980 0.000 0.020
#> SRR1791354 3 0.1031 0.903 0.000 0.024 0.976
#> SRR1791353 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791352 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791349 3 0.1860 0.896 0.000 0.052 0.948
#> SRR1791348 1 0.0892 0.983 0.980 0.000 0.020
#> SRR1791351 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791339 3 0.1163 0.891 0.028 0.000 0.972
#> SRR1791338 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791337 3 0.1031 0.903 0.000 0.024 0.976
#> SRR1791335 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791332 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791331 3 0.1529 0.899 0.000 0.040 0.960
#> SRR1791330 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791334 1 0.0592 0.983 0.988 0.000 0.012
#> SRR1791328 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791327 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791333 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791326 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791324 2 0.0892 0.984 0.000 0.980 0.020
#> SRR1791323 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791322 3 0.0000 0.898 0.000 0.000 1.000
#> SRR1791329 2 0.0892 0.984 0.000 0.980 0.020
#> SRR1791321 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791320 3 0.2066 0.872 0.060 0.000 0.940
#> SRR1791325 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791318 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791317 3 0.1031 0.903 0.000 0.024 0.976
#> SRR1791313 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791312 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791319 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791316 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791311 1 0.0747 0.983 0.984 0.000 0.016
#> SRR1791314 2 0.0000 0.994 0.000 1.000 0.000
#> SRR1791310 3 0.2066 0.872 0.060 0.000 0.940
#> SRR1791308 2 0.0892 0.984 0.000 0.980 0.020
#> SRR1791307 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791306 1 0.1031 0.982 0.976 0.000 0.024
#> SRR1791305 3 0.1860 0.896 0.000 0.052 0.948
#> SRR1791309 3 0.1031 0.903 0.000 0.024 0.976
#> SRR1791304 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
#> SRR1791347 4 0.4635 0.4340 0.012 0.000 0.268 0.720
#> SRR1791346 3 0.4790 0.2025 0.000 0.000 0.620 0.380
#> SRR1791345 4 0.5294 0.0118 0.008 0.000 0.484 0.508
#> SRR1791344 4 0.5328 0.4132 0.064 0.000 0.212 0.724
#> SRR1791343 4 0.7890 0.1961 0.000 0.308 0.312 0.380
#> SRR1791341 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791342 4 0.6332 -0.0106 0.452 0.000 0.060 0.488
#> SRR1791340 2 0.0336 0.9045 0.000 0.992 0.000 0.008
#> SRR1791375 1 0.2281 0.8888 0.904 0.000 0.000 0.096
#> SRR1791374 1 0.2760 0.8875 0.872 0.000 0.000 0.128
#> SRR1791372 1 0.1389 0.9078 0.952 0.000 0.000 0.048
#> SRR1791370 4 0.7761 0.1250 0.340 0.000 0.244 0.416
#> SRR1791373 4 0.4673 0.3738 0.008 0.000 0.292 0.700
#> SRR1791369 1 0.2149 0.9027 0.912 0.000 0.000 0.088
#> SRR1791371 1 0.2469 0.8966 0.892 0.000 0.000 0.108
#> SRR1791368 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791366 4 0.7563 0.2129 0.000 0.196 0.364 0.440
#> SRR1791364 1 0.2081 0.9034 0.916 0.000 0.000 0.084
#> SRR1791367 1 0.2469 0.8966 0.892 0.000 0.000 0.108
#> SRR1791363 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791361 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791360 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791359 3 0.0592 0.8767 0.000 0.000 0.984 0.016
#> SRR1791358 2 0.0000 0.9063 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.5248 0.7516 0.000 0.748 0.088 0.164
#> SRR1791357 1 0.2469 0.8966 0.892 0.000 0.000 0.108
#> SRR1791356 1 0.2814 0.8836 0.868 0.000 0.000 0.132
#> SRR1791355 4 0.7883 0.1968 0.000 0.292 0.328 0.380
#> SRR1791362 1 0.1211 0.9076 0.960 0.000 0.000 0.040
#> SRR1791354 3 0.0469 0.8769 0.000 0.000 0.988 0.012
#> SRR1791353 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791352 1 0.2469 0.8966 0.892 0.000 0.000 0.108
#> SRR1791349 4 0.7563 0.2129 0.000 0.196 0.364 0.440
#> SRR1791348 1 0.1118 0.9083 0.964 0.000 0.000 0.036
#> SRR1791351 2 0.0000 0.9063 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.0592 0.9106 0.984 0.000 0.000 0.016
#> SRR1791339 4 0.4585 0.3834 0.000 0.000 0.332 0.668
#> SRR1791338 2 0.0336 0.9045 0.000 0.992 0.000 0.008
#> SRR1791336 2 0.0336 0.9045 0.000 0.992 0.000 0.008
#> SRR1791337 3 0.0469 0.8769 0.000 0.000 0.988 0.012
#> SRR1791335 2 0.0000 0.9063 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791331 4 0.3873 0.3978 0.000 0.000 0.228 0.772
#> SRR1791330 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791334 1 0.1022 0.9114 0.968 0.000 0.000 0.032
#> SRR1791328 1 0.2281 0.8888 0.904 0.000 0.000 0.096
#> SRR1791327 2 0.0000 0.9063 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.2281 0.8888 0.904 0.000 0.000 0.096
#> SRR1791326 2 0.2216 0.8668 0.000 0.908 0.000 0.092
#> SRR1791324 2 0.5556 0.7159 0.000 0.720 0.092 0.188
#> SRR1791323 2 0.0000 0.9063 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.1792 0.8018 0.000 0.000 0.932 0.068
#> SRR1791329 2 0.5395 0.7376 0.000 0.736 0.092 0.172
#> SRR1791321 1 0.2149 0.9027 0.912 0.000 0.000 0.088
#> SRR1791320 4 0.4635 0.4340 0.012 0.000 0.268 0.720
#> SRR1791325 1 0.5231 0.5195 0.604 0.000 0.012 0.384
#> SRR1791318 1 0.2469 0.8966 0.892 0.000 0.000 0.108
#> SRR1791317 3 0.0188 0.8728 0.000 0.000 0.996 0.004
#> SRR1791313 1 0.2149 0.9027 0.912 0.000 0.000 0.088
#> SRR1791312 1 0.0000 0.9104 1.000 0.000 0.000 0.000
#> SRR1791319 1 0.2921 0.8797 0.860 0.000 0.000 0.140
#> SRR1791316 1 0.2469 0.8966 0.892 0.000 0.000 0.108
#> SRR1791315 1 0.2149 0.9027 0.912 0.000 0.000 0.088
#> SRR1791311 1 0.1022 0.9087 0.968 0.000 0.000 0.032
#> SRR1791314 2 0.0000 0.9063 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.4635 0.4340 0.012 0.000 0.268 0.720
#> SRR1791308 2 0.4901 0.7867 0.000 0.780 0.108 0.112
#> SRR1791307 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791306 1 0.1940 0.9003 0.924 0.000 0.000 0.076
#> SRR1791305 4 0.7822 0.1855 0.000 0.256 0.364 0.380
#> SRR1791309 3 0.0188 0.8728 0.000 0.000 0.996 0.004
#> SRR1791304 1 0.2216 0.9016 0.908 0.000 0.000 0.092
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 5 0.5152 -0.0370 0.024 0.000 0.064 0.200 0.712
#> SRR1791346 5 0.5229 0.2291 0.000 0.000 0.324 0.064 0.612
#> SRR1791345 4 0.5728 0.7910 0.000 0.000 0.176 0.624 0.200
#> SRR1791344 5 0.5787 -0.1010 0.060 0.000 0.064 0.200 0.676
#> SRR1791343 5 0.5452 0.2659 0.000 0.292 0.092 0.000 0.616
#> SRR1791341 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791342 1 0.7087 -0.2988 0.408 0.000 0.020 0.212 0.360
#> SRR1791340 2 0.2450 0.7952 0.000 0.900 0.000 0.048 0.052
#> SRR1791375 1 0.1809 0.7553 0.928 0.000 0.000 0.012 0.060
#> SRR1791374 1 0.4268 0.6448 0.556 0.000 0.000 0.444 0.000
#> SRR1791372 1 0.2891 0.7859 0.824 0.000 0.000 0.176 0.000
#> SRR1791370 5 0.8464 -0.3430 0.272 0.000 0.164 0.256 0.308
#> SRR1791373 4 0.5443 0.7680 0.000 0.000 0.084 0.604 0.312
#> SRR1791369 1 0.3508 0.7720 0.748 0.000 0.000 0.252 0.000
#> SRR1791371 1 0.3966 0.7393 0.664 0.000 0.000 0.336 0.000
#> SRR1791368 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791366 5 0.4970 0.4069 0.000 0.148 0.140 0.000 0.712
#> SRR1791364 1 0.3707 0.7632 0.716 0.000 0.000 0.284 0.000
#> SRR1791367 1 0.3949 0.7419 0.668 0.000 0.000 0.332 0.000
#> SRR1791363 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791361 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791360 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791359 3 0.1386 0.9572 0.000 0.000 0.952 0.016 0.032
#> SRR1791358 2 0.0000 0.8245 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 2 0.5176 0.1867 0.000 0.492 0.040 0.000 0.468
#> SRR1791357 1 0.3857 0.7523 0.688 0.000 0.000 0.312 0.000
#> SRR1791356 1 0.4291 0.6184 0.536 0.000 0.000 0.464 0.000
#> SRR1791355 5 0.5578 0.2964 0.000 0.272 0.112 0.000 0.616
#> SRR1791362 1 0.0000 0.7948 1.000 0.000 0.000 0.000 0.000
#> SRR1791354 3 0.0865 0.9551 0.000 0.000 0.972 0.004 0.024
#> SRR1791353 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791352 1 0.3913 0.7466 0.676 0.000 0.000 0.324 0.000
#> SRR1791349 5 0.4970 0.4069 0.000 0.148 0.140 0.000 0.712
#> SRR1791348 1 0.0000 0.7948 1.000 0.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 0.8245 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 1 0.1732 0.7966 0.920 0.000 0.000 0.080 0.000
#> SRR1791339 5 0.4588 -0.0170 0.004 0.000 0.060 0.200 0.736
#> SRR1791338 2 0.1043 0.8148 0.000 0.960 0.000 0.040 0.000
#> SRR1791336 2 0.1043 0.8148 0.000 0.960 0.000 0.040 0.000
#> SRR1791337 3 0.0771 0.9559 0.000 0.000 0.976 0.004 0.020
#> SRR1791335 2 0.0000 0.8245 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791331 5 0.2392 0.1383 0.000 0.004 0.004 0.104 0.888
#> SRR1791330 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791334 1 0.0963 0.7979 0.964 0.000 0.000 0.036 0.000
#> SRR1791328 1 0.3967 0.6176 0.800 0.000 0.000 0.108 0.092
#> SRR1791327 2 0.0000 0.8245 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 1 0.3906 0.6228 0.804 0.000 0.000 0.112 0.084
#> SRR1791326 2 0.3671 0.6600 0.000 0.756 0.000 0.008 0.236
#> SRR1791324 5 0.5175 -0.2207 0.000 0.464 0.040 0.000 0.496
#> SRR1791323 2 0.0162 0.8235 0.000 0.996 0.000 0.000 0.004
#> SRR1791322 3 0.1981 0.9179 0.000 0.000 0.920 0.016 0.064
#> SRR1791329 2 0.5176 0.1867 0.000 0.492 0.040 0.000 0.468
#> SRR1791321 1 0.3586 0.7690 0.736 0.000 0.000 0.264 0.000
#> SRR1791320 5 0.5152 -0.0370 0.024 0.000 0.064 0.200 0.712
#> SRR1791325 1 0.6795 0.2099 0.440 0.000 0.008 0.344 0.208
#> SRR1791318 1 0.3913 0.7466 0.676 0.000 0.000 0.324 0.000
#> SRR1791317 3 0.1270 0.9544 0.000 0.000 0.948 0.000 0.052
#> SRR1791313 1 0.3796 0.7572 0.700 0.000 0.000 0.300 0.000
#> SRR1791312 1 0.0880 0.7976 0.968 0.000 0.000 0.032 0.000
#> SRR1791319 1 0.4304 0.5968 0.516 0.000 0.000 0.484 0.000
#> SRR1791316 1 0.3913 0.7466 0.676 0.000 0.000 0.324 0.000
#> SRR1791315 1 0.3774 0.7586 0.704 0.000 0.000 0.296 0.000
#> SRR1791311 1 0.0290 0.7958 0.992 0.000 0.000 0.008 0.000
#> SRR1791314 2 0.0000 0.8245 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.4580 -0.0079 0.008 0.000 0.052 0.200 0.740
#> SRR1791308 2 0.6142 0.5265 0.000 0.612 0.072 0.048 0.268
#> SRR1791307 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791306 1 0.0404 0.7930 0.988 0.000 0.000 0.000 0.012
#> SRR1791305 5 0.5703 0.3302 0.000 0.244 0.140 0.000 0.616
#> SRR1791309 3 0.1270 0.9544 0.000 0.000 0.948 0.000 0.052
#> SRR1791304 1 0.3837 0.7541 0.692 0.000 0.000 0.308 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.7031 0.717 0.252 0.284 0.028 0.024 0.412 0.000
#> SRR1791346 2 0.5414 0.542 0.028 0.692 0.168 0.000 0.036 0.076
#> SRR1791345 5 0.4715 0.246 0.064 0.008 0.048 0.000 0.748 0.132
#> SRR1791344 5 0.7408 0.707 0.252 0.248 0.028 0.060 0.412 0.000
#> SRR1791343 2 0.2660 0.772 0.000 0.868 0.048 0.000 0.000 0.084
#> SRR1791341 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791342 5 0.7478 0.581 0.252 0.112 0.012 0.212 0.412 0.000
#> SRR1791340 6 0.4774 0.697 0.044 0.288 0.000 0.000 0.020 0.648
#> SRR1791375 4 0.2094 0.595 0.080 0.000 0.000 0.900 0.020 0.000
#> SRR1791374 1 0.3789 0.620 0.660 0.000 0.000 0.332 0.008 0.000
#> SRR1791372 4 0.3175 0.247 0.256 0.000 0.000 0.744 0.000 0.000
#> SRR1791370 1 0.8293 -0.325 0.332 0.072 0.088 0.260 0.244 0.004
#> SRR1791373 5 0.4441 0.272 0.060 0.012 0.036 0.000 0.772 0.120
#> SRR1791369 4 0.3804 -0.386 0.424 0.000 0.000 0.576 0.000 0.000
#> SRR1791371 1 0.3789 0.628 0.584 0.000 0.000 0.416 0.000 0.000
#> SRR1791368 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791366 2 0.1563 0.748 0.000 0.932 0.056 0.000 0.000 0.012
#> SRR1791364 4 0.3857 -0.516 0.468 0.000 0.000 0.532 0.000 0.000
#> SRR1791367 1 0.3833 0.615 0.556 0.000 0.000 0.444 0.000 0.000
#> SRR1791363 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791361 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791360 4 0.0363 0.700 0.012 0.000 0.000 0.988 0.000 0.000
#> SRR1791359 3 0.1414 0.969 0.012 0.020 0.952 0.000 0.012 0.004
#> SRR1791358 6 0.2219 0.951 0.000 0.136 0.000 0.000 0.000 0.864
#> SRR1791365 2 0.2743 0.732 0.008 0.828 0.000 0.000 0.000 0.164
#> SRR1791357 1 0.3868 0.562 0.508 0.000 0.000 0.492 0.000 0.000
#> SRR1791356 1 0.3782 0.629 0.636 0.000 0.000 0.360 0.004 0.000
#> SRR1791355 2 0.2660 0.772 0.000 0.868 0.048 0.000 0.000 0.084
#> SRR1791362 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791354 3 0.0405 0.970 0.004 0.008 0.988 0.000 0.000 0.000
#> SRR1791353 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791352 1 0.3868 0.562 0.508 0.000 0.000 0.492 0.000 0.000
#> SRR1791349 2 0.1563 0.748 0.000 0.932 0.056 0.000 0.000 0.012
#> SRR1791348 4 0.0405 0.704 0.008 0.004 0.000 0.988 0.000 0.000
#> SRR1791351 6 0.2219 0.951 0.000 0.136 0.000 0.000 0.000 0.864
#> SRR1791350 4 0.1908 0.612 0.096 0.004 0.000 0.900 0.000 0.000
#> SRR1791339 5 0.6673 0.697 0.252 0.300 0.028 0.004 0.416 0.000
#> SRR1791338 6 0.3514 0.927 0.028 0.144 0.000 0.000 0.020 0.808
#> SRR1791336 6 0.3514 0.927 0.028 0.144 0.000 0.000 0.020 0.808
#> SRR1791337 3 0.0260 0.970 0.000 0.008 0.992 0.000 0.000 0.000
#> SRR1791335 6 0.2219 0.951 0.000 0.136 0.000 0.000 0.000 0.864
#> SRR1791332 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791331 2 0.5841 -0.480 0.180 0.488 0.004 0.000 0.328 0.000
#> SRR1791330 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791334 4 0.1444 0.648 0.072 0.000 0.000 0.928 0.000 0.000
#> SRR1791328 4 0.3943 0.413 0.156 0.000 0.000 0.760 0.084 0.000
#> SRR1791327 6 0.2219 0.951 0.000 0.136 0.000 0.000 0.000 0.864
#> SRR1791333 4 0.4140 0.396 0.152 0.000 0.000 0.744 0.104 0.000
#> SRR1791326 2 0.4155 0.322 0.020 0.616 0.000 0.000 0.000 0.364
#> SRR1791324 2 0.2513 0.749 0.008 0.852 0.000 0.000 0.000 0.140
#> SRR1791323 6 0.2520 0.938 0.004 0.152 0.000 0.000 0.000 0.844
#> SRR1791322 3 0.1562 0.943 0.024 0.000 0.940 0.000 0.032 0.004
#> SRR1791329 2 0.2743 0.732 0.008 0.828 0.000 0.000 0.000 0.164
#> SRR1791321 4 0.3810 -0.398 0.428 0.000 0.000 0.572 0.000 0.000
#> SRR1791320 5 0.7031 0.717 0.252 0.284 0.028 0.024 0.412 0.000
#> SRR1791325 1 0.6601 0.187 0.448 0.032 0.000 0.304 0.212 0.004
#> SRR1791318 1 0.3867 0.568 0.512 0.000 0.000 0.488 0.000 0.000
#> SRR1791317 3 0.0790 0.970 0.000 0.032 0.968 0.000 0.000 0.000
#> SRR1791313 4 0.3868 -0.573 0.492 0.000 0.000 0.508 0.000 0.000
#> SRR1791312 4 0.1152 0.675 0.044 0.004 0.000 0.952 0.000 0.000
#> SRR1791319 1 0.3871 0.601 0.676 0.000 0.000 0.308 0.016 0.000
#> SRR1791316 1 0.3868 0.551 0.504 0.000 0.000 0.496 0.000 0.000
#> SRR1791315 4 0.3868 -0.573 0.492 0.000 0.000 0.508 0.000 0.000
#> SRR1791311 4 0.0260 0.705 0.008 0.000 0.000 0.992 0.000 0.000
#> SRR1791314 6 0.2219 0.951 0.000 0.136 0.000 0.000 0.000 0.864
#> SRR1791310 5 0.6920 0.712 0.252 0.292 0.024 0.020 0.412 0.000
#> SRR1791308 2 0.5451 0.530 0.064 0.664 0.036 0.000 0.020 0.216
#> SRR1791307 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791306 4 0.0000 0.710 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791305 2 0.2680 0.771 0.000 0.868 0.056 0.000 0.000 0.076
#> SRR1791309 3 0.0790 0.970 0.000 0.032 0.968 0.000 0.000 0.000
#> SRR1791304 4 0.3868 -0.573 0.492 0.000 0.000 0.508 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.864 0.930 0.970 0.4955 0.503 0.503
#> 3 3 0.974 0.945 0.975 0.1841 0.885 0.777
#> 4 4 0.853 0.899 0.946 0.1147 0.930 0.831
#> 5 5 0.805 0.789 0.908 0.0583 0.966 0.904
#> 6 6 0.769 0.652 0.845 0.0623 0.909 0.725
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
#> SRR1791347 1 0.981 0.285 0.580 0.420
#> SRR1791346 2 0.000 0.954 0.000 1.000
#> SRR1791345 2 0.969 0.403 0.396 0.604
#> SRR1791344 1 0.722 0.742 0.800 0.200
#> SRR1791343 2 0.000 0.954 0.000 1.000
#> SRR1791341 1 0.000 0.978 1.000 0.000
#> SRR1791342 1 0.000 0.978 1.000 0.000
#> SRR1791340 2 0.000 0.954 0.000 1.000
#> SRR1791375 1 0.000 0.978 1.000 0.000
#> SRR1791374 1 0.000 0.978 1.000 0.000
#> SRR1791372 1 0.000 0.978 1.000 0.000
#> SRR1791370 1 0.000 0.978 1.000 0.000
#> SRR1791373 2 0.000 0.954 0.000 1.000
#> SRR1791369 1 0.000 0.978 1.000 0.000
#> SRR1791371 1 0.000 0.978 1.000 0.000
#> SRR1791368 1 0.000 0.978 1.000 0.000
#> SRR1791366 2 0.000 0.954 0.000 1.000
#> SRR1791364 1 0.000 0.978 1.000 0.000
#> SRR1791367 1 0.000 0.978 1.000 0.000
#> SRR1791363 1 0.000 0.978 1.000 0.000
#> SRR1791361 1 0.000 0.978 1.000 0.000
#> SRR1791360 1 0.000 0.978 1.000 0.000
#> SRR1791359 2 0.722 0.761 0.200 0.800
#> SRR1791358 2 0.000 0.954 0.000 1.000
#> SRR1791365 2 0.000 0.954 0.000 1.000
#> SRR1791357 1 0.000 0.978 1.000 0.000
#> SRR1791356 1 0.000 0.978 1.000 0.000
#> SRR1791355 2 0.000 0.954 0.000 1.000
#> SRR1791362 1 0.000 0.978 1.000 0.000
#> SRR1791354 2 0.680 0.785 0.180 0.820
#> SRR1791353 1 0.000 0.978 1.000 0.000
#> SRR1791352 1 0.000 0.978 1.000 0.000
#> SRR1791349 2 0.000 0.954 0.000 1.000
#> SRR1791348 1 0.000 0.978 1.000 0.000
#> SRR1791351 2 0.000 0.954 0.000 1.000
#> SRR1791350 1 0.000 0.978 1.000 0.000
#> SRR1791339 2 0.000 0.954 0.000 1.000
#> SRR1791338 2 0.000 0.954 0.000 1.000
#> SRR1791336 2 0.000 0.954 0.000 1.000
#> SRR1791337 2 0.722 0.761 0.200 0.800
#> SRR1791335 2 0.000 0.954 0.000 1.000
#> SRR1791332 1 0.000 0.978 1.000 0.000
#> SRR1791331 2 0.000 0.954 0.000 1.000
#> SRR1791330 1 0.000 0.978 1.000 0.000
#> SRR1791334 1 0.000 0.978 1.000 0.000
#> SRR1791328 1 0.000 0.978 1.000 0.000
#> SRR1791327 2 0.000 0.954 0.000 1.000
#> SRR1791333 1 0.000 0.978 1.000 0.000
#> SRR1791326 2 0.000 0.954 0.000 1.000
#> SRR1791324 2 0.000 0.954 0.000 1.000
#> SRR1791323 2 0.000 0.954 0.000 1.000
#> SRR1791322 2 0.925 0.531 0.340 0.660
#> SRR1791329 2 0.000 0.954 0.000 1.000
#> SRR1791321 1 0.000 0.978 1.000 0.000
#> SRR1791320 1 0.722 0.742 0.800 0.200
#> SRR1791325 1 0.000 0.978 1.000 0.000
#> SRR1791318 1 0.000 0.978 1.000 0.000
#> SRR1791317 2 0.000 0.954 0.000 1.000
#> SRR1791313 1 0.000 0.978 1.000 0.000
#> SRR1791312 1 0.000 0.978 1.000 0.000
#> SRR1791319 1 0.000 0.978 1.000 0.000
#> SRR1791316 1 0.000 0.978 1.000 0.000
#> SRR1791315 1 0.000 0.978 1.000 0.000
#> SRR1791311 1 0.000 0.978 1.000 0.000
#> SRR1791314 2 0.000 0.954 0.000 1.000
#> SRR1791310 2 0.000 0.954 0.000 1.000
#> SRR1791308 2 0.000 0.954 0.000 1.000
#> SRR1791307 1 0.000 0.978 1.000 0.000
#> SRR1791306 1 0.000 0.978 1.000 0.000
#> SRR1791305 2 0.000 0.954 0.000 1.000
#> SRR1791309 2 0.000 0.954 0.000 1.000
#> SRR1791304 1 0.000 0.978 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 2 0.2050 0.936 0.020 0.952 0.028
#> SRR1791346 2 0.5529 0.532 0.000 0.704 0.296
#> SRR1791345 3 0.2176 0.887 0.032 0.020 0.948
#> SRR1791344 1 0.5708 0.683 0.768 0.204 0.028
#> SRR1791343 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791341 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791342 1 0.1163 0.962 0.972 0.000 0.028
#> SRR1791340 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791375 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791374 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791372 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791370 3 0.5291 0.632 0.268 0.000 0.732
#> SRR1791373 3 0.6189 0.427 0.004 0.364 0.632
#> SRR1791369 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791368 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791366 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791364 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791363 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791361 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791360 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791359 3 0.1163 0.908 0.000 0.028 0.972
#> SRR1791358 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791365 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791357 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791355 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791362 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791354 3 0.1163 0.908 0.000 0.028 0.972
#> SRR1791353 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791352 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791349 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791348 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791339 2 0.1031 0.962 0.000 0.976 0.024
#> SRR1791338 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791337 3 0.1163 0.908 0.000 0.028 0.972
#> SRR1791335 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791332 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791331 2 0.0747 0.968 0.000 0.984 0.016
#> SRR1791330 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791334 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791328 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791327 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791333 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791326 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791324 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791323 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791322 3 0.1163 0.908 0.000 0.028 0.972
#> SRR1791329 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791321 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791320 1 0.5849 0.664 0.756 0.216 0.028
#> SRR1791325 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791318 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791317 3 0.1163 0.908 0.000 0.028 0.972
#> SRR1791313 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791319 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791316 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.983 1.000 0.000 0.000
#> SRR1791311 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791314 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791310 2 0.1163 0.958 0.000 0.972 0.028
#> SRR1791308 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791307 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791306 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1791305 2 0.0000 0.980 0.000 1.000 0.000
#> SRR1791309 3 0.1163 0.908 0.000 0.028 0.972
#> SRR1791304 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
#> SRR1791347 4 0.1520 0.806 0.020 0.024 0.000 0.956
#> SRR1791346 2 0.2647 0.844 0.000 0.880 0.120 0.000
#> SRR1791345 3 0.2565 0.769 0.056 0.000 0.912 0.032
#> SRR1791344 4 0.1398 0.808 0.040 0.004 0.000 0.956
#> SRR1791343 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791341 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791342 4 0.1389 0.798 0.048 0.000 0.000 0.952
#> SRR1791340 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791375 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791374 1 0.1022 0.926 0.968 0.000 0.000 0.032
#> SRR1791372 1 0.0336 0.942 0.992 0.000 0.000 0.008
#> SRR1791370 3 0.4331 0.440 0.288 0.000 0.712 0.000
#> SRR1791373 3 0.7943 0.168 0.088 0.412 0.444 0.056
#> SRR1791369 1 0.0000 0.941 1.000 0.000 0.000 0.000
#> SRR1791371 1 0.0817 0.931 0.976 0.000 0.000 0.024
#> SRR1791368 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791366 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791364 1 0.0188 0.940 0.996 0.000 0.000 0.004
#> SRR1791367 1 0.0188 0.940 0.996 0.000 0.000 0.004
#> SRR1791363 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791361 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791360 1 0.2081 0.934 0.916 0.000 0.000 0.084
#> SRR1791359 3 0.0000 0.833 0.000 0.000 1.000 0.000
#> SRR1791358 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791357 1 0.0188 0.940 0.996 0.000 0.000 0.004
#> SRR1791356 1 0.1118 0.923 0.964 0.000 0.000 0.036
#> SRR1791355 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791362 1 0.1940 0.935 0.924 0.000 0.000 0.076
#> SRR1791354 3 0.0000 0.833 0.000 0.000 1.000 0.000
#> SRR1791353 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791352 1 0.0336 0.939 0.992 0.000 0.000 0.008
#> SRR1791349 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791348 1 0.2011 0.935 0.920 0.000 0.000 0.080
#> SRR1791351 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.0336 0.942 0.992 0.000 0.000 0.008
#> SRR1791339 4 0.4948 0.256 0.000 0.440 0.000 0.560
#> SRR1791338 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.0000 0.833 0.000 0.000 1.000 0.000
#> SRR1791335 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.2530 0.925 0.888 0.000 0.000 0.112
#> SRR1791331 2 0.1118 0.954 0.000 0.964 0.000 0.036
#> SRR1791330 1 0.2589 0.923 0.884 0.000 0.000 0.116
#> SRR1791334 1 0.0921 0.942 0.972 0.000 0.000 0.028
#> SRR1791328 1 0.2704 0.919 0.876 0.000 0.000 0.124
#> SRR1791327 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791326 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791324 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791323 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.0000 0.833 0.000 0.000 1.000 0.000
#> SRR1791329 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791321 1 0.0188 0.942 0.996 0.000 0.000 0.004
#> SRR1791320 4 0.1305 0.808 0.036 0.004 0.000 0.960
#> SRR1791325 1 0.1209 0.934 0.964 0.000 0.004 0.032
#> SRR1791318 1 0.0336 0.939 0.992 0.000 0.000 0.008
#> SRR1791317 3 0.0000 0.833 0.000 0.000 1.000 0.000
#> SRR1791313 1 0.0188 0.940 0.996 0.000 0.000 0.004
#> SRR1791312 1 0.0707 0.942 0.980 0.000 0.000 0.020
#> SRR1791319 1 0.1118 0.923 0.964 0.000 0.000 0.036
#> SRR1791316 1 0.0336 0.939 0.992 0.000 0.000 0.008
#> SRR1791315 1 0.0188 0.940 0.996 0.000 0.000 0.004
#> SRR1791311 1 0.2081 0.934 0.916 0.000 0.000 0.084
#> SRR1791314 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.2973 0.718 0.000 0.144 0.000 0.856
#> SRR1791308 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791307 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791306 1 0.2647 0.922 0.880 0.000 0.000 0.120
#> SRR1791305 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1791309 3 0.0000 0.833 0.000 0.000 1.000 0.000
#> SRR1791304 1 0.0188 0.940 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
#> SRR1791347 5 0.0404 0.761 0.012 0.000 0.000 0.000 0.988
#> SRR1791346 2 0.1981 0.912 0.000 0.924 0.048 0.028 0.000
#> SRR1791345 4 0.4063 -0.193 0.000 0.000 0.280 0.708 0.012
#> SRR1791344 5 0.0807 0.760 0.012 0.000 0.000 0.012 0.976
#> SRR1791343 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791341 1 0.0324 0.838 0.992 0.000 0.000 0.004 0.004
#> SRR1791342 5 0.3353 0.564 0.196 0.000 0.000 0.008 0.796
#> SRR1791340 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791375 1 0.0451 0.837 0.988 0.000 0.000 0.004 0.008
#> SRR1791374 1 0.4278 0.231 0.548 0.000 0.000 0.452 0.000
#> SRR1791372 1 0.2424 0.821 0.868 0.000 0.000 0.132 0.000
#> SRR1791370 3 0.4450 0.451 0.216 0.000 0.736 0.044 0.004
#> SRR1791373 4 0.3104 0.144 0.004 0.044 0.056 0.880 0.016
#> SRR1791369 1 0.2424 0.818 0.868 0.000 0.000 0.132 0.000
#> SRR1791371 1 0.3895 0.623 0.680 0.000 0.000 0.320 0.000
#> SRR1791368 1 0.0324 0.838 0.992 0.000 0.000 0.004 0.004
#> SRR1791366 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791364 1 0.3074 0.780 0.804 0.000 0.000 0.196 0.000
#> SRR1791367 1 0.3534 0.726 0.744 0.000 0.000 0.256 0.000
#> SRR1791363 1 0.0324 0.838 0.992 0.000 0.000 0.004 0.004
#> SRR1791361 1 0.0324 0.838 0.992 0.000 0.000 0.004 0.004
#> SRR1791360 1 0.0566 0.841 0.984 0.000 0.000 0.012 0.004
#> SRR1791359 3 0.0000 0.924 0.000 0.000 1.000 0.000 0.000
#> SRR1791358 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.3424 0.744 0.760 0.000 0.000 0.240 0.000
#> SRR1791356 4 0.4291 -0.102 0.464 0.000 0.000 0.536 0.000
#> SRR1791355 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791362 1 0.0162 0.839 0.996 0.000 0.000 0.000 0.004
#> SRR1791354 3 0.0404 0.919 0.000 0.000 0.988 0.012 0.000
#> SRR1791353 1 0.0324 0.838 0.992 0.000 0.000 0.004 0.004
#> SRR1791352 1 0.3534 0.726 0.744 0.000 0.000 0.256 0.000
#> SRR1791349 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791348 1 0.0404 0.841 0.988 0.000 0.000 0.012 0.000
#> SRR1791351 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 1 0.2020 0.831 0.900 0.000 0.000 0.100 0.000
#> SRR1791339 5 0.5604 0.115 0.000 0.460 0.000 0.072 0.468
#> SRR1791338 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791336 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791337 3 0.0162 0.923 0.000 0.000 0.996 0.004 0.000
#> SRR1791335 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 1 0.0324 0.838 0.992 0.000 0.000 0.004 0.004
#> SRR1791331 2 0.1638 0.920 0.000 0.932 0.000 0.004 0.064
#> SRR1791330 1 0.0162 0.839 0.996 0.000 0.000 0.000 0.004
#> SRR1791334 1 0.1410 0.838 0.940 0.000 0.000 0.060 0.000
#> SRR1791328 1 0.0798 0.828 0.976 0.000 0.000 0.008 0.016
#> SRR1791327 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 1 0.0451 0.836 0.988 0.000 0.000 0.004 0.008
#> SRR1791326 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.0290 0.920 0.000 0.000 0.992 0.008 0.000
#> SRR1791329 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 1 0.2561 0.812 0.856 0.000 0.000 0.144 0.000
#> SRR1791320 5 0.0566 0.761 0.012 0.000 0.000 0.004 0.984
#> SRR1791325 1 0.3906 0.602 0.704 0.000 0.004 0.292 0.000
#> SRR1791318 1 0.3534 0.726 0.744 0.000 0.000 0.256 0.000
#> SRR1791317 3 0.0000 0.924 0.000 0.000 1.000 0.000 0.000
#> SRR1791313 1 0.3336 0.755 0.772 0.000 0.000 0.228 0.000
#> SRR1791312 1 0.1792 0.834 0.916 0.000 0.000 0.084 0.000
#> SRR1791319 4 0.4350 0.114 0.408 0.000 0.000 0.588 0.004
#> SRR1791316 1 0.3452 0.739 0.756 0.000 0.000 0.244 0.000
#> SRR1791315 1 0.3074 0.781 0.804 0.000 0.000 0.196 0.000
#> SRR1791311 1 0.0566 0.841 0.984 0.000 0.000 0.012 0.004
#> SRR1791314 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.2470 0.712 0.000 0.104 0.000 0.012 0.884
#> SRR1791308 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791307 1 0.0324 0.838 0.992 0.000 0.000 0.004 0.004
#> SRR1791306 1 0.0324 0.838 0.992 0.000 0.000 0.004 0.004
#> SRR1791305 2 0.0000 0.992 0.000 1.000 0.000 0.000 0.000
#> SRR1791309 3 0.0000 0.924 0.000 0.000 1.000 0.000 0.000
#> SRR1791304 1 0.3480 0.736 0.752 0.000 0.000 0.248 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.0935 0.7448 0.032 0.000 0.000 0.004 0.964 0.000
#> SRR1791346 2 0.3608 0.7474 0.004 0.800 0.068 0.000 0.000 0.128
#> SRR1791345 6 0.2600 0.8899 0.036 0.000 0.084 0.004 0.000 0.876
#> SRR1791344 5 0.1503 0.7462 0.032 0.000 0.000 0.016 0.944 0.008
#> SRR1791343 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791341 4 0.0000 0.7008 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791342 5 0.4603 0.3575 0.040 0.000 0.000 0.324 0.628 0.008
#> SRR1791340 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791375 4 0.1049 0.6768 0.032 0.000 0.000 0.960 0.000 0.008
#> SRR1791374 1 0.3848 0.6650 0.736 0.000 0.000 0.224 0.000 0.040
#> SRR1791372 4 0.3244 0.4047 0.268 0.000 0.000 0.732 0.000 0.000
#> SRR1791370 3 0.5917 0.3331 0.220 0.000 0.584 0.160 0.000 0.036
#> SRR1791373 6 0.2019 0.8893 0.088 0.000 0.012 0.000 0.000 0.900
#> SRR1791369 4 0.3563 0.2068 0.336 0.000 0.000 0.664 0.000 0.000
#> SRR1791371 1 0.3547 0.6858 0.668 0.000 0.000 0.332 0.000 0.000
#> SRR1791368 4 0.0000 0.7008 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791366 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791364 4 0.3810 -0.2119 0.428 0.000 0.000 0.572 0.000 0.000
#> SRR1791367 1 0.3823 0.6031 0.564 0.000 0.000 0.436 0.000 0.000
#> SRR1791363 4 0.0291 0.6986 0.004 0.000 0.000 0.992 0.000 0.004
#> SRR1791361 4 0.0363 0.6999 0.012 0.000 0.000 0.988 0.000 0.000
#> SRR1791360 4 0.1714 0.6728 0.092 0.000 0.000 0.908 0.000 0.000
#> SRR1791359 3 0.0291 0.8841 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR1791358 2 0.0146 0.9517 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791365 2 0.0146 0.9517 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791357 4 0.3862 -0.4052 0.476 0.000 0.000 0.524 0.000 0.000
#> SRR1791356 1 0.4181 0.6829 0.700 0.000 0.000 0.248 0.000 0.052
#> SRR1791355 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791362 4 0.1444 0.6829 0.072 0.000 0.000 0.928 0.000 0.000
#> SRR1791354 3 0.1501 0.8333 0.000 0.000 0.924 0.000 0.000 0.076
#> SRR1791353 4 0.0291 0.6986 0.004 0.000 0.000 0.992 0.000 0.004
#> SRR1791352 1 0.3843 0.5692 0.548 0.000 0.000 0.452 0.000 0.000
#> SRR1791349 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791348 4 0.1588 0.6833 0.072 0.000 0.000 0.924 0.000 0.004
#> SRR1791351 2 0.0146 0.9517 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791350 4 0.3298 0.4802 0.236 0.000 0.000 0.756 0.000 0.008
#> SRR1791339 2 0.7132 -0.1598 0.120 0.404 0.000 0.000 0.316 0.160
#> SRR1791338 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791336 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791337 3 0.0363 0.8805 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1791335 2 0.0146 0.9517 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791332 4 0.0146 0.7001 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1791331 2 0.3078 0.8215 0.028 0.856 0.000 0.000 0.084 0.032
#> SRR1791330 4 0.0858 0.6987 0.028 0.000 0.000 0.968 0.000 0.004
#> SRR1791334 4 0.3175 0.4556 0.256 0.000 0.000 0.744 0.000 0.000
#> SRR1791328 4 0.1565 0.6492 0.028 0.000 0.000 0.940 0.028 0.004
#> SRR1791327 2 0.0146 0.9517 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791333 4 0.1657 0.6706 0.056 0.000 0.000 0.928 0.016 0.000
#> SRR1791326 2 0.0000 0.9520 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791324 2 0.0146 0.9517 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791323 2 0.0146 0.9517 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791322 3 0.0405 0.8832 0.008 0.000 0.988 0.000 0.000 0.004
#> SRR1791329 2 0.0000 0.9520 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791321 4 0.3727 -0.0196 0.388 0.000 0.000 0.612 0.000 0.000
#> SRR1791320 5 0.2137 0.7353 0.048 0.000 0.000 0.012 0.912 0.028
#> SRR1791325 1 0.4466 0.5483 0.620 0.000 0.000 0.336 0.000 0.044
#> SRR1791318 1 0.3851 0.5508 0.540 0.000 0.000 0.460 0.000 0.000
#> SRR1791317 3 0.0000 0.8851 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791313 4 0.3854 -0.3584 0.464 0.000 0.000 0.536 0.000 0.000
#> SRR1791312 4 0.2969 0.5068 0.224 0.000 0.000 0.776 0.000 0.000
#> SRR1791319 1 0.4114 0.6398 0.732 0.000 0.000 0.196 0.000 0.072
#> SRR1791316 1 0.3866 0.4797 0.516 0.000 0.000 0.484 0.000 0.000
#> SRR1791315 4 0.3817 -0.2247 0.432 0.000 0.000 0.568 0.000 0.000
#> SRR1791311 4 0.1267 0.6893 0.060 0.000 0.000 0.940 0.000 0.000
#> SRR1791314 2 0.0146 0.9517 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791310 5 0.3652 0.6402 0.072 0.080 0.000 0.000 0.820 0.028
#> SRR1791308 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791307 4 0.0146 0.6998 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1791306 4 0.0260 0.7011 0.008 0.000 0.000 0.992 0.000 0.000
#> SRR1791305 2 0.0146 0.9520 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791309 3 0.0000 0.8851 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791304 4 0.3864 -0.4209 0.480 0.000 0.000 0.520 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.858 0.925 0.968 0.47130 0.518 0.518
#> 3 3 0.883 0.925 0.971 0.20975 0.863 0.746
#> 4 4 0.783 0.697 0.826 0.09282 0.898 0.768
#> 5 5 1.000 0.956 0.983 0.09839 0.938 0.830
#> 6 6 1.000 0.950 0.987 0.00783 0.997 0.990
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
#> SRR1791347 1 0.000 0.988 1.000 0.000
#> SRR1791346 2 0.000 0.928 0.000 1.000
#> SRR1791345 1 0.706 0.744 0.808 0.192
#> SRR1791344 1 0.000 0.988 1.000 0.000
#> SRR1791343 2 0.000 0.928 0.000 1.000
#> SRR1791341 1 0.000 0.988 1.000 0.000
#> SRR1791342 1 0.000 0.988 1.000 0.000
#> SRR1791340 2 0.000 0.928 0.000 1.000
#> SRR1791375 1 0.000 0.988 1.000 0.000
#> SRR1791374 1 0.000 0.988 1.000 0.000
#> SRR1791372 1 0.000 0.988 1.000 0.000
#> SRR1791370 1 0.000 0.988 1.000 0.000
#> SRR1791373 1 0.552 0.842 0.872 0.128
#> SRR1791369 1 0.000 0.988 1.000 0.000
#> SRR1791371 1 0.000 0.988 1.000 0.000
#> SRR1791368 1 0.000 0.988 1.000 0.000
#> SRR1791366 2 0.000 0.928 0.000 1.000
#> SRR1791364 1 0.000 0.988 1.000 0.000
#> SRR1791367 1 0.000 0.988 1.000 0.000
#> SRR1791363 1 0.000 0.988 1.000 0.000
#> SRR1791361 1 0.000 0.988 1.000 0.000
#> SRR1791360 1 0.000 0.988 1.000 0.000
#> SRR1791359 2 0.971 0.397 0.400 0.600
#> SRR1791358 2 0.000 0.928 0.000 1.000
#> SRR1791365 2 0.000 0.928 0.000 1.000
#> SRR1791357 1 0.000 0.988 1.000 0.000
#> SRR1791356 1 0.000 0.988 1.000 0.000
#> SRR1791355 2 0.000 0.928 0.000 1.000
#> SRR1791362 1 0.000 0.988 1.000 0.000
#> SRR1791354 2 0.767 0.722 0.224 0.776
#> SRR1791353 1 0.000 0.988 1.000 0.000
#> SRR1791352 1 0.000 0.988 1.000 0.000
#> SRR1791349 2 0.000 0.928 0.000 1.000
#> SRR1791348 1 0.000 0.988 1.000 0.000
#> SRR1791351 2 0.000 0.928 0.000 1.000
#> SRR1791350 1 0.000 0.988 1.000 0.000
#> SRR1791339 2 0.000 0.928 0.000 1.000
#> SRR1791338 2 0.000 0.928 0.000 1.000
#> SRR1791336 2 0.000 0.928 0.000 1.000
#> SRR1791337 2 0.971 0.397 0.400 0.600
#> SRR1791335 2 0.000 0.928 0.000 1.000
#> SRR1791332 1 0.000 0.988 1.000 0.000
#> SRR1791331 2 0.000 0.928 0.000 1.000
#> SRR1791330 1 0.000 0.988 1.000 0.000
#> SRR1791334 1 0.000 0.988 1.000 0.000
#> SRR1791328 1 0.000 0.988 1.000 0.000
#> SRR1791327 2 0.000 0.928 0.000 1.000
#> SRR1791333 1 0.000 0.988 1.000 0.000
#> SRR1791326 2 0.000 0.928 0.000 1.000
#> SRR1791324 2 0.000 0.928 0.000 1.000
#> SRR1791323 2 0.000 0.928 0.000 1.000
#> SRR1791322 1 0.605 0.813 0.852 0.148
#> SRR1791329 2 0.000 0.928 0.000 1.000
#> SRR1791321 1 0.000 0.988 1.000 0.000
#> SRR1791320 1 0.000 0.988 1.000 0.000
#> SRR1791325 1 0.000 0.988 1.000 0.000
#> SRR1791318 1 0.000 0.988 1.000 0.000
#> SRR1791317 2 0.722 0.753 0.200 0.800
#> SRR1791313 1 0.000 0.988 1.000 0.000
#> SRR1791312 1 0.000 0.988 1.000 0.000
#> SRR1791319 1 0.000 0.988 1.000 0.000
#> SRR1791316 1 0.000 0.988 1.000 0.000
#> SRR1791315 1 0.000 0.988 1.000 0.000
#> SRR1791311 1 0.000 0.988 1.000 0.000
#> SRR1791314 2 0.000 0.928 0.000 1.000
#> SRR1791310 2 0.987 0.277 0.432 0.568
#> SRR1791308 2 0.000 0.928 0.000 1.000
#> SRR1791307 1 0.000 0.988 1.000 0.000
#> SRR1791306 1 0.000 0.988 1.000 0.000
#> SRR1791305 2 0.000 0.928 0.000 1.000
#> SRR1791309 2 0.722 0.753 0.200 0.800
#> SRR1791304 1 0.000 0.988 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.5058 0.645 0.244 0.000 0.756
#> SRR1791346 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791345 1 0.6295 -0.028 0.528 0.000 0.472
#> SRR1791344 1 0.4002 0.791 0.840 0.000 0.160
#> SRR1791343 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791341 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791342 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791340 2 0.1289 0.972 0.000 0.968 0.032
#> SRR1791375 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791374 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791372 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791370 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791373 3 0.1031 0.902 0.024 0.000 0.976
#> SRR1791369 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791368 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791366 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791364 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791363 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791361 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791360 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791359 3 0.4555 0.737 0.200 0.000 0.800
#> SRR1791358 2 0.0000 0.995 0.000 1.000 0.000
#> SRR1791365 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791357 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791355 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791362 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791354 3 0.4504 0.741 0.196 0.000 0.804
#> SRR1791353 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791352 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791349 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791348 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.995 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791339 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791338 2 0.0000 0.995 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.995 0.000 1.000 0.000
#> SRR1791337 3 0.4555 0.737 0.200 0.000 0.800
#> SRR1791335 2 0.0000 0.995 0.000 1.000 0.000
#> SRR1791332 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791331 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791330 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791334 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791328 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791327 2 0.0000 0.995 0.000 1.000 0.000
#> SRR1791333 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791326 3 0.0237 0.911 0.000 0.004 0.996
#> SRR1791324 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791323 2 0.0592 0.988 0.000 0.988 0.012
#> SRR1791322 3 0.5905 0.521 0.352 0.000 0.648
#> SRR1791329 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791321 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791320 1 0.3551 0.830 0.868 0.000 0.132
#> SRR1791325 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791318 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791317 3 0.1031 0.902 0.024 0.000 0.976
#> SRR1791313 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791319 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791316 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791314 2 0.0000 0.995 0.000 1.000 0.000
#> SRR1791310 3 0.0237 0.911 0.004 0.000 0.996
#> SRR1791308 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791307 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791306 1 0.0000 0.978 1.000 0.000 0.000
#> SRR1791305 3 0.0000 0.913 0.000 0.000 1.000
#> SRR1791309 3 0.1031 0.902 0.024 0.000 0.976
#> SRR1791304 1 0.0000 0.978 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.4977 0.3350 0.460 0.000 0.000 0.540
#> SRR1791346 4 0.4992 -0.5668 0.000 0.000 0.476 0.524
#> SRR1791345 1 0.6576 0.1968 0.628 0.000 0.152 0.220
#> SRR1791344 4 0.4977 0.3350 0.460 0.000 0.000 0.540
#> SRR1791343 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791341 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791342 4 0.4977 0.3350 0.460 0.000 0.000 0.540
#> SRR1791340 4 0.7456 -0.4212 0.000 0.180 0.360 0.460
#> SRR1791375 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791374 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791372 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791370 1 0.3266 0.7360 0.832 0.000 0.000 0.168
#> SRR1791373 4 0.4898 0.3957 0.416 0.000 0.000 0.584
#> SRR1791369 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791371 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791368 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791366 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791364 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791363 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791361 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791360 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791359 3 0.4730 0.2305 0.000 0.000 0.636 0.364
#> SRR1791358 2 0.0000 1.0000 0.000 1.000 0.000 0.000
#> SRR1791365 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791357 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791355 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791362 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791354 3 0.4713 0.2342 0.000 0.000 0.640 0.360
#> SRR1791353 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791352 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791349 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791348 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 1.0000 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791339 4 0.0000 -0.1282 0.000 0.000 0.000 1.000
#> SRR1791338 2 0.0000 1.0000 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 1.0000 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.4713 0.2342 0.000 0.000 0.640 0.360
#> SRR1791335 2 0.0000 1.0000 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791331 4 0.3356 -0.2557 0.000 0.000 0.176 0.824
#> SRR1791330 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791334 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791328 1 0.1474 0.9167 0.948 0.000 0.000 0.052
#> SRR1791327 2 0.0000 1.0000 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.0921 0.9471 0.972 0.000 0.000 0.028
#> SRR1791326 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791324 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791323 4 0.7358 -0.2771 0.000 0.392 0.160 0.448
#> SRR1791322 3 0.6883 0.0199 0.156 0.000 0.584 0.260
#> SRR1791329 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791321 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791320 4 0.4977 0.3350 0.460 0.000 0.000 0.540
#> SRR1791325 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791318 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.4679 0.2367 0.000 0.000 0.648 0.352
#> SRR1791313 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791319 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791316 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791314 2 0.0000 1.0000 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.4134 0.3222 0.260 0.000 0.000 0.740
#> SRR1791308 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791307 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791306 1 0.0000 0.9783 1.000 0.000 0.000 0.000
#> SRR1791305 3 0.4977 0.5561 0.000 0.000 0.540 0.460
#> SRR1791309 3 0.4713 0.2342 0.000 0.000 0.640 0.360
#> SRR1791304 1 0.0000 0.9783 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
#> SRR1791347 5 0.0000 0.927 0.000 0.000 0.000 0.000 1.000
#> SRR1791346 2 0.1270 0.931 0.000 0.948 0.000 0.000 0.052
#> SRR1791345 5 0.3455 0.623 0.208 0.008 0.000 0.000 0.784
#> SRR1791344 5 0.0000 0.927 0.000 0.000 0.000 0.000 1.000
#> SRR1791343 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791341 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791342 5 0.0000 0.927 0.000 0.000 0.000 0.000 1.000
#> SRR1791340 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791375 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791374 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791372 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791370 1 0.4210 0.266 0.588 0.000 0.000 0.000 0.412
#> SRR1791373 5 0.0000 0.927 0.000 0.000 0.000 0.000 1.000
#> SRR1791369 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791371 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791368 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791366 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791364 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791363 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791361 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791360 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791359 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> SRR1791358 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791365 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791355 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791362 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791354 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> SRR1791353 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791352 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791349 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791348 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791351 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791339 5 0.0000 0.927 0.000 0.000 0.000 0.000 1.000
#> SRR1791338 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791336 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791337 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> SRR1791335 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791332 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791331 5 0.3003 0.747 0.000 0.188 0.000 0.000 0.812
#> SRR1791330 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791334 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791328 1 0.1608 0.914 0.928 0.000 0.000 0.000 0.072
#> SRR1791327 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791333 1 0.1121 0.943 0.956 0.000 0.000 0.000 0.044
#> SRR1791326 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.3242 0.726 0.000 0.784 0.000 0.216 0.000
#> SRR1791322 3 0.0162 0.996 0.000 0.000 0.996 0.000 0.004
#> SRR1791329 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791320 5 0.0000 0.927 0.000 0.000 0.000 0.000 1.000
#> SRR1791325 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791318 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> SRR1791313 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791319 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791316 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791311 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791314 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791310 5 0.0000 0.927 0.000 0.000 0.000 0.000 1.000
#> SRR1791308 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791307 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791306 1 0.0000 0.985 1.000 0.000 0.000 0.000 0.000
#> SRR1791305 2 0.0000 0.977 0.000 1.000 0.000 0.000 0.000
#> SRR1791309 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> SRR1791304 1 0.0000 0.985 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
#> SRR1791347 5 0.0000 0.960 0 0.000 0 0.000 1.000 0.000
#> SRR1791346 2 0.1141 0.919 0 0.948 0 0.000 0.052 0.000
#> SRR1791345 1 0.0000 0.000 1 0.000 0 0.000 0.000 0.000
#> SRR1791344 5 0.0000 0.960 0 0.000 0 0.000 1.000 0.000
#> SRR1791343 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791341 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791342 5 0.0000 0.960 0 0.000 0 0.000 1.000 0.000
#> SRR1791340 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791375 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791374 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791372 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791370 4 0.3727 0.368 0 0.000 0 0.612 0.388 0.000
#> SRR1791373 5 0.0000 0.960 0 0.000 0 0.000 1.000 0.000
#> SRR1791369 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791371 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791368 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791366 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791364 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791367 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791363 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791361 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791360 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791359 3 0.0000 1.000 0 0.000 1 0.000 0.000 0.000
#> SRR1791358 6 0.0000 1.000 0 0.000 0 0.000 0.000 1.000
#> SRR1791365 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791357 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791356 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791355 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791362 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791354 3 0.0000 1.000 0 0.000 1 0.000 0.000 0.000
#> SRR1791353 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791352 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791349 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791348 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791351 6 0.0000 1.000 0 0.000 0 0.000 0.000 1.000
#> SRR1791350 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791339 5 0.0000 0.960 0 0.000 0 0.000 1.000 0.000
#> SRR1791338 6 0.0000 1.000 0 0.000 0 0.000 0.000 1.000
#> SRR1791336 6 0.0000 1.000 0 0.000 0 0.000 0.000 1.000
#> SRR1791337 3 0.0000 1.000 0 0.000 1 0.000 0.000 0.000
#> SRR1791335 6 0.0000 1.000 0 0.000 0 0.000 0.000 1.000
#> SRR1791332 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791331 5 0.2697 0.691 0 0.188 0 0.000 0.812 0.000
#> SRR1791330 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791334 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791328 4 0.1444 0.910 0 0.000 0 0.928 0.072 0.000
#> SRR1791327 6 0.0000 1.000 0 0.000 0 0.000 0.000 1.000
#> SRR1791333 4 0.0937 0.945 0 0.000 0 0.960 0.040 0.000
#> SRR1791326 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791323 2 0.2912 0.691 0 0.784 0 0.000 0.000 0.216
#> SRR1791322 3 0.0000 1.000 0 0.000 1 0.000 0.000 0.000
#> SRR1791329 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791321 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791320 5 0.0000 0.960 0 0.000 0 0.000 1.000 0.000
#> SRR1791325 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791318 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791317 3 0.0000 1.000 0 0.000 1 0.000 0.000 0.000
#> SRR1791313 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791312 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791319 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791316 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791315 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791311 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791314 6 0.0000 1.000 0 0.000 0 0.000 0.000 1.000
#> SRR1791310 5 0.0000 0.960 0 0.000 0 0.000 1.000 0.000
#> SRR1791308 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791307 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791306 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
#> SRR1791305 2 0.0000 0.973 0 1.000 0 0.000 0.000 0.000
#> SRR1791309 3 0.0000 1.000 0 0.000 1 0.000 0.000 0.000
#> SRR1791304 4 0.0000 0.985 0 0.000 0 1.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 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 1.000 0.968 0.986 0.4815 0.518 0.518
#> 3 3 0.768 0.838 0.925 0.3002 0.829 0.683
#> 4 4 0.781 0.730 0.865 0.1581 0.859 0.654
#> 5 5 0.640 0.649 0.762 0.0291 0.945 0.825
#> 6 6 0.634 0.675 0.789 0.0366 0.941 0.799
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
#> SRR1791347 2 0.0000 0.989 0.000 1.000
#> SRR1791346 2 0.0000 0.989 0.000 1.000
#> SRR1791345 2 0.0000 0.989 0.000 1.000
#> SRR1791344 2 0.0000 0.989 0.000 1.000
#> SRR1791343 2 0.0000 0.989 0.000 1.000
#> SRR1791341 1 0.0000 0.979 1.000 0.000
#> SRR1791342 2 0.0000 0.989 0.000 1.000
#> SRR1791340 2 0.0000 0.989 0.000 1.000
#> SRR1791375 2 0.7219 0.744 0.200 0.800
#> SRR1791374 2 0.0376 0.985 0.004 0.996
#> SRR1791372 1 0.0000 0.979 1.000 0.000
#> SRR1791370 2 0.0000 0.989 0.000 1.000
#> SRR1791373 2 0.0000 0.989 0.000 1.000
#> SRR1791369 1 0.0000 0.979 1.000 0.000
#> SRR1791371 1 0.0000 0.979 1.000 0.000
#> SRR1791368 1 0.0000 0.979 1.000 0.000
#> SRR1791366 2 0.0000 0.989 0.000 1.000
#> SRR1791364 1 0.0000 0.979 1.000 0.000
#> SRR1791367 1 0.0000 0.979 1.000 0.000
#> SRR1791363 1 0.0000 0.979 1.000 0.000
#> SRR1791361 2 0.0000 0.989 0.000 1.000
#> SRR1791360 1 0.8608 0.608 0.716 0.284
#> SRR1791359 2 0.0000 0.989 0.000 1.000
#> SRR1791358 2 0.0000 0.989 0.000 1.000
#> SRR1791365 2 0.0000 0.989 0.000 1.000
#> SRR1791357 1 0.0000 0.979 1.000 0.000
#> SRR1791356 1 0.0376 0.976 0.996 0.004
#> SRR1791355 2 0.0000 0.989 0.000 1.000
#> SRR1791362 1 0.0000 0.979 1.000 0.000
#> SRR1791354 2 0.0000 0.989 0.000 1.000
#> SRR1791353 1 0.2948 0.932 0.948 0.052
#> SRR1791352 1 0.0000 0.979 1.000 0.000
#> SRR1791349 2 0.0000 0.989 0.000 1.000
#> SRR1791348 1 0.0000 0.979 1.000 0.000
#> SRR1791351 2 0.0000 0.989 0.000 1.000
#> SRR1791350 2 0.8081 0.663 0.248 0.752
#> SRR1791339 2 0.0000 0.989 0.000 1.000
#> SRR1791338 2 0.0000 0.989 0.000 1.000
#> SRR1791336 2 0.0000 0.989 0.000 1.000
#> SRR1791337 2 0.0000 0.989 0.000 1.000
#> SRR1791335 2 0.0000 0.989 0.000 1.000
#> SRR1791332 1 0.7528 0.729 0.784 0.216
#> SRR1791331 2 0.0000 0.989 0.000 1.000
#> SRR1791330 1 0.0000 0.979 1.000 0.000
#> SRR1791334 1 0.0000 0.979 1.000 0.000
#> SRR1791328 2 0.0000 0.989 0.000 1.000
#> SRR1791327 2 0.0000 0.989 0.000 1.000
#> SRR1791333 2 0.0000 0.989 0.000 1.000
#> SRR1791326 2 0.0000 0.989 0.000 1.000
#> SRR1791324 2 0.0000 0.989 0.000 1.000
#> SRR1791323 2 0.0000 0.989 0.000 1.000
#> SRR1791322 2 0.0000 0.989 0.000 1.000
#> SRR1791329 2 0.0000 0.989 0.000 1.000
#> SRR1791321 1 0.0000 0.979 1.000 0.000
#> SRR1791320 2 0.0000 0.989 0.000 1.000
#> SRR1791325 2 0.0000 0.989 0.000 1.000
#> SRR1791318 1 0.0000 0.979 1.000 0.000
#> SRR1791317 2 0.0000 0.989 0.000 1.000
#> SRR1791313 1 0.0000 0.979 1.000 0.000
#> SRR1791312 1 0.0000 0.979 1.000 0.000
#> SRR1791319 2 0.0376 0.985 0.004 0.996
#> SRR1791316 1 0.0000 0.979 1.000 0.000
#> SRR1791315 1 0.0000 0.979 1.000 0.000
#> SRR1791311 1 0.0000 0.979 1.000 0.000
#> SRR1791314 2 0.0000 0.989 0.000 1.000
#> SRR1791310 2 0.0000 0.989 0.000 1.000
#> SRR1791308 2 0.0000 0.989 0.000 1.000
#> SRR1791307 1 0.0000 0.979 1.000 0.000
#> SRR1791306 1 0.0000 0.979 1.000 0.000
#> SRR1791305 2 0.0000 0.989 0.000 1.000
#> SRR1791309 2 0.0000 0.989 0.000 1.000
#> SRR1791304 1 0.0000 0.979 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.0747 0.944 0.000 0.016 0.984
#> SRR1791346 2 0.0000 0.946 0.000 1.000 0.000
#> SRR1791345 2 0.0892 0.942 0.000 0.980 0.020
#> SRR1791344 3 0.0747 0.944 0.000 0.016 0.984
#> SRR1791343 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791341 1 0.3816 0.792 0.852 0.000 0.148
#> SRR1791342 3 0.0424 0.942 0.000 0.008 0.992
#> SRR1791340 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791375 1 0.7948 0.190 0.520 0.060 0.420
#> SRR1791374 2 0.6724 0.251 0.420 0.568 0.012
#> SRR1791372 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791370 2 0.4280 0.818 0.124 0.856 0.020
#> SRR1791373 2 0.0892 0.942 0.000 0.980 0.020
#> SRR1791369 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791371 1 0.0892 0.857 0.980 0.020 0.000
#> SRR1791368 1 0.5650 0.604 0.688 0.000 0.312
#> SRR1791366 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791364 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791363 1 0.3619 0.801 0.864 0.000 0.136
#> SRR1791361 3 0.0424 0.942 0.000 0.008 0.992
#> SRR1791360 1 0.6154 0.331 0.592 0.000 0.408
#> SRR1791359 2 0.0848 0.942 0.008 0.984 0.008
#> SRR1791358 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1791365 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791357 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791356 1 0.3918 0.750 0.856 0.140 0.004
#> SRR1791355 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791362 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791354 2 0.0848 0.942 0.008 0.984 0.008
#> SRR1791353 1 0.5650 0.602 0.688 0.000 0.312
#> SRR1791352 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791349 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791348 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791351 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1791350 1 0.8037 0.352 0.572 0.352 0.076
#> SRR1791339 2 0.3879 0.813 0.000 0.848 0.152
#> SRR1791338 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791336 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791337 2 0.0848 0.942 0.008 0.984 0.008
#> SRR1791335 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1791332 1 0.6111 0.399 0.604 0.000 0.396
#> SRR1791331 3 0.5058 0.690 0.000 0.244 0.756
#> SRR1791330 1 0.6095 0.362 0.608 0.000 0.392
#> SRR1791334 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791328 3 0.0424 0.942 0.000 0.008 0.992
#> SRR1791327 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1791333 3 0.0592 0.944 0.000 0.012 0.988
#> SRR1791326 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791324 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1791323 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1791322 2 0.0848 0.942 0.008 0.984 0.008
#> SRR1791329 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1791321 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791320 3 0.1643 0.929 0.000 0.044 0.956
#> SRR1791325 2 0.5992 0.607 0.268 0.716 0.016
#> SRR1791318 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791317 2 0.0848 0.942 0.008 0.984 0.008
#> SRR1791313 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791319 2 0.4634 0.764 0.164 0.824 0.012
#> SRR1791316 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.869 1.000 0.000 0.000
#> SRR1791314 2 0.0424 0.948 0.000 0.992 0.008
#> SRR1791310 3 0.2261 0.908 0.000 0.068 0.932
#> SRR1791308 2 0.0000 0.946 0.000 1.000 0.000
#> SRR1791307 1 0.3619 0.801 0.864 0.000 0.136
#> SRR1791306 1 0.3619 0.801 0.864 0.000 0.136
#> SRR1791305 2 0.0592 0.948 0.000 0.988 0.012
#> SRR1791309 2 0.0848 0.942 0.008 0.984 0.008
#> SRR1791304 1 0.0000 0.869 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.5355 0.541 0.000 0.360 0.020 0.620
#> SRR1791346 2 0.5685 0.257 0.000 0.516 0.460 0.024
#> SRR1791345 3 0.0336 0.855 0.000 0.000 0.992 0.008
#> SRR1791344 4 0.5339 0.545 0.000 0.356 0.020 0.624
#> SRR1791343 2 0.1724 0.858 0.000 0.948 0.020 0.032
#> SRR1791341 1 0.4989 0.483 0.528 0.000 0.000 0.472
#> SRR1791342 4 0.1174 0.684 0.000 0.012 0.020 0.968
#> SRR1791340 2 0.0592 0.872 0.000 0.984 0.000 0.016
#> SRR1791375 1 0.6984 0.309 0.580 0.000 0.236 0.184
#> SRR1791374 3 0.3257 0.855 0.108 0.008 0.872 0.012
#> SRR1791372 1 0.0592 0.831 0.984 0.000 0.000 0.016
#> SRR1791370 3 0.2402 0.876 0.076 0.000 0.912 0.012
#> SRR1791373 3 0.0336 0.855 0.000 0.000 0.992 0.008
#> SRR1791369 1 0.0817 0.834 0.976 0.000 0.000 0.024
#> SRR1791371 1 0.4730 0.348 0.636 0.000 0.364 0.000
#> SRR1791368 1 0.4992 0.476 0.524 0.000 0.000 0.476
#> SRR1791366 2 0.1510 0.866 0.000 0.956 0.028 0.016
#> SRR1791364 1 0.0188 0.831 0.996 0.000 0.004 0.000
#> SRR1791367 1 0.0817 0.834 0.976 0.000 0.000 0.024
#> SRR1791363 1 0.4977 0.502 0.540 0.000 0.000 0.460
#> SRR1791361 4 0.0000 0.681 0.000 0.000 0.000 1.000
#> SRR1791360 1 0.4817 0.660 0.784 0.000 0.128 0.088
#> SRR1791359 3 0.1557 0.882 0.056 0.000 0.944 0.000
#> SRR1791358 2 0.0000 0.873 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.0779 0.873 0.000 0.980 0.004 0.016
#> SRR1791357 1 0.0000 0.831 1.000 0.000 0.000 0.000
#> SRR1791356 3 0.5273 0.128 0.456 0.000 0.536 0.008
#> SRR1791355 2 0.1936 0.856 0.000 0.940 0.028 0.032
#> SRR1791362 1 0.0921 0.833 0.972 0.000 0.000 0.028
#> SRR1791354 3 0.0895 0.870 0.020 0.004 0.976 0.000
#> SRR1791353 1 0.4977 0.504 0.540 0.000 0.000 0.460
#> SRR1791352 1 0.0000 0.831 1.000 0.000 0.000 0.000
#> SRR1791349 2 0.1411 0.869 0.000 0.960 0.020 0.020
#> SRR1791348 1 0.1557 0.828 0.944 0.000 0.000 0.056
#> SRR1791351 2 0.0000 0.873 0.000 1.000 0.000 0.000
#> SRR1791350 3 0.6375 0.473 0.312 0.000 0.600 0.088
#> SRR1791339 2 0.4963 0.461 0.000 0.696 0.020 0.284
#> SRR1791338 2 0.1576 0.851 0.000 0.948 0.048 0.004
#> SRR1791336 2 0.1576 0.851 0.000 0.948 0.048 0.004
#> SRR1791337 3 0.2214 0.870 0.044 0.028 0.928 0.000
#> SRR1791335 2 0.0000 0.873 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.4453 0.704 0.744 0.000 0.012 0.244
#> SRR1791331 2 0.4988 0.443 0.000 0.692 0.020 0.288
#> SRR1791330 1 0.1022 0.833 0.968 0.000 0.000 0.032
#> SRR1791334 1 0.0921 0.833 0.972 0.000 0.000 0.028
#> SRR1791328 4 0.0000 0.681 0.000 0.000 0.000 1.000
#> SRR1791327 2 0.0000 0.873 0.000 1.000 0.000 0.000
#> SRR1791333 4 0.0000 0.681 0.000 0.000 0.000 1.000
#> SRR1791326 2 0.0592 0.872 0.000 0.984 0.000 0.016
#> SRR1791324 2 0.1356 0.863 0.000 0.960 0.008 0.032
#> SRR1791323 2 0.0000 0.873 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.1557 0.882 0.056 0.000 0.944 0.000
#> SRR1791329 2 0.1356 0.863 0.000 0.960 0.008 0.032
#> SRR1791321 1 0.0817 0.834 0.976 0.000 0.000 0.024
#> SRR1791320 4 0.5339 0.545 0.000 0.356 0.020 0.624
#> SRR1791325 3 0.3263 0.860 0.100 0.012 0.876 0.012
#> SRR1791318 1 0.0000 0.831 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.1118 0.878 0.036 0.000 0.964 0.000
#> SRR1791313 1 0.0188 0.831 0.996 0.000 0.004 0.000
#> SRR1791312 1 0.1022 0.833 0.968 0.000 0.000 0.032
#> SRR1791319 3 0.2216 0.869 0.092 0.000 0.908 0.000
#> SRR1791316 1 0.0000 0.831 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0188 0.831 0.996 0.000 0.004 0.000
#> SRR1791311 1 0.2469 0.806 0.892 0.000 0.000 0.108
#> SRR1791314 2 0.0000 0.873 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.5606 0.228 0.000 0.480 0.020 0.500
#> SRR1791308 2 0.5506 0.245 0.000 0.512 0.472 0.016
#> SRR1791307 1 0.4972 0.507 0.544 0.000 0.000 0.456
#> SRR1791306 1 0.4961 0.517 0.552 0.000 0.000 0.448
#> SRR1791305 2 0.1182 0.871 0.000 0.968 0.016 0.016
#> SRR1791309 3 0.0921 0.874 0.028 0.000 0.972 0.000
#> SRR1791304 1 0.0188 0.831 0.996 0.000 0.004 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 5 0.4862 0.7713 0.000 0.220 0.068 NA 0.708
#> SRR1791346 3 0.7591 -0.1909 0.000 0.300 0.332 NA 0.040
#> SRR1791345 3 0.4434 0.4948 0.000 0.004 0.536 NA 0.000
#> SRR1791344 5 0.4393 0.7915 0.000 0.164 0.068 NA 0.764
#> SRR1791343 2 0.4055 0.6564 0.000 0.800 0.012 NA 0.048
#> SRR1791341 1 0.3452 0.7548 0.756 0.000 0.000 NA 0.244
#> SRR1791342 5 0.3281 0.7938 0.000 0.092 0.060 NA 0.848
#> SRR1791340 2 0.3490 0.6623 0.000 0.856 0.068 NA 0.028
#> SRR1791375 1 0.6686 -0.0244 0.448 0.000 0.396 NA 0.136
#> SRR1791374 3 0.5316 0.5259 0.296 0.000 0.636 NA 0.008
#> SRR1791372 1 0.2124 0.8194 0.916 0.000 0.000 NA 0.056
#> SRR1791370 3 0.5464 0.6237 0.232 0.012 0.684 NA 0.016
#> SRR1791373 3 0.4644 0.4907 0.000 0.012 0.528 NA 0.000
#> SRR1791369 1 0.0404 0.8232 0.988 0.000 0.000 NA 0.012
#> SRR1791371 1 0.4116 0.7494 0.804 0.000 0.132 NA 0.028
#> SRR1791368 1 0.3561 0.7425 0.740 0.000 0.000 NA 0.260
#> SRR1791366 2 0.1997 0.6556 0.000 0.932 0.024 NA 0.028
#> SRR1791364 1 0.2221 0.8140 0.912 0.000 0.000 NA 0.036
#> SRR1791367 1 0.0162 0.8232 0.996 0.000 0.000 NA 0.004
#> SRR1791363 1 0.3395 0.7596 0.764 0.000 0.000 NA 0.236
#> SRR1791361 5 0.2989 0.7558 0.024 0.052 0.040 NA 0.884
#> SRR1791360 1 0.5762 0.4689 0.620 0.000 0.248 NA 0.128
#> SRR1791359 3 0.1329 0.7072 0.032 0.004 0.956 NA 0.000
#> SRR1791358 2 0.4287 0.6307 0.000 0.540 0.000 NA 0.000
#> SRR1791365 2 0.1410 0.6554 0.000 0.940 0.000 NA 0.060
#> SRR1791357 1 0.2149 0.8148 0.916 0.000 0.000 NA 0.036
#> SRR1791356 1 0.6080 0.3154 0.560 0.000 0.272 NA 0.000
#> SRR1791355 2 0.5011 0.6196 0.000 0.724 0.012 NA 0.088
#> SRR1791362 1 0.1410 0.8172 0.940 0.000 0.000 NA 0.060
#> SRR1791354 3 0.0960 0.6929 0.004 0.016 0.972 NA 0.000
#> SRR1791353 1 0.4142 0.7339 0.728 0.016 0.004 NA 0.252
#> SRR1791352 1 0.2221 0.8140 0.912 0.000 0.000 NA 0.036
#> SRR1791349 2 0.1281 0.6611 0.000 0.956 0.012 NA 0.032
#> SRR1791348 1 0.1671 0.8159 0.924 0.000 0.000 NA 0.076
#> SRR1791351 2 0.4287 0.6307 0.000 0.540 0.000 NA 0.000
#> SRR1791350 1 0.7232 0.2527 0.472 0.000 0.244 NA 0.248
#> SRR1791339 5 0.5852 0.2803 0.000 0.444 0.072 NA 0.476
#> SRR1791338 2 0.5660 0.6400 0.000 0.644 0.100 NA 0.012
#> SRR1791336 2 0.5439 0.6415 0.000 0.652 0.100 NA 0.004
#> SRR1791337 3 0.2928 0.7023 0.092 0.004 0.872 NA 0.000
#> SRR1791335 2 0.4227 0.6370 0.000 0.580 0.000 NA 0.000
#> SRR1791332 1 0.5294 0.5919 0.632 0.000 0.056 NA 0.304
#> SRR1791331 2 0.5111 -0.2103 0.000 0.516 0.028 NA 0.452
#> SRR1791330 1 0.3019 0.7990 0.864 0.000 0.048 NA 0.088
#> SRR1791334 1 0.1251 0.8220 0.956 0.000 0.008 NA 0.036
#> SRR1791328 5 0.3038 0.7866 0.008 0.080 0.040 NA 0.872
#> SRR1791327 2 0.4287 0.6307 0.000 0.540 0.000 NA 0.000
#> SRR1791333 5 0.2897 0.7605 0.020 0.052 0.040 NA 0.888
#> SRR1791326 2 0.1582 0.6687 0.000 0.944 0.000 NA 0.028
#> SRR1791324 2 0.3289 0.6610 0.000 0.844 0.000 NA 0.048
#> SRR1791323 2 0.4273 0.6253 0.000 0.552 0.000 NA 0.000
#> SRR1791322 3 0.1996 0.7093 0.032 0.004 0.928 NA 0.000
#> SRR1791329 2 0.3216 0.6627 0.000 0.848 0.000 NA 0.044
#> SRR1791321 1 0.0404 0.8229 0.988 0.000 0.000 NA 0.012
#> SRR1791320 5 0.4919 0.7653 0.000 0.228 0.068 NA 0.700
#> SRR1791325 3 0.5545 0.5693 0.268 0.000 0.648 NA 0.024
#> SRR1791318 1 0.2221 0.8140 0.912 0.000 0.000 NA 0.036
#> SRR1791317 3 0.1012 0.7035 0.020 0.000 0.968 NA 0.000
#> SRR1791313 1 0.2221 0.8140 0.912 0.000 0.000 NA 0.036
#> SRR1791312 1 0.1043 0.8209 0.960 0.000 0.000 NA 0.040
#> SRR1791319 3 0.5915 0.5558 0.264 0.000 0.584 NA 0.000
#> SRR1791316 1 0.2221 0.8140 0.912 0.000 0.000 NA 0.036
#> SRR1791315 1 0.2221 0.8140 0.912 0.000 0.000 NA 0.036
#> SRR1791311 1 0.2179 0.8087 0.888 0.000 0.000 NA 0.112
#> SRR1791314 2 0.4287 0.6307 0.000 0.540 0.000 NA 0.000
#> SRR1791310 5 0.5506 0.5900 0.000 0.344 0.068 NA 0.584
#> SRR1791308 2 0.7051 0.1703 0.000 0.348 0.304 NA 0.008
#> SRR1791307 1 0.3366 0.7614 0.768 0.000 0.000 NA 0.232
#> SRR1791306 1 0.3395 0.7596 0.764 0.000 0.000 NA 0.236
#> SRR1791305 2 0.1701 0.6585 0.000 0.944 0.012 NA 0.028
#> SRR1791309 3 0.0290 0.6903 0.000 0.000 0.992 NA 0.000
#> SRR1791304 1 0.2221 0.8140 0.912 0.000 0.000 NA 0.036
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.3987 0.7430 0.016 0.168 0.048 0.000 0.768 0.000
#> SRR1791346 1 0.6632 0.4687 0.376 0.316 0.280 0.000 0.000 0.028
#> SRR1791345 1 0.3594 0.5515 0.796 0.008 0.152 0.000 0.044 0.000
#> SRR1791344 5 0.3331 0.7487 0.004 0.136 0.044 0.000 0.816 0.000
#> SRR1791343 2 0.1952 0.8032 0.012 0.920 0.000 0.000 0.052 0.016
#> SRR1791341 4 0.4235 0.7056 0.020 0.000 0.000 0.672 0.296 0.012
#> SRR1791342 5 0.2406 0.7262 0.004 0.060 0.036 0.000 0.896 0.004
#> SRR1791340 2 0.4542 0.6611 0.052 0.764 0.100 0.000 0.004 0.080
#> SRR1791375 4 0.6546 0.0917 0.012 0.000 0.316 0.456 0.196 0.020
#> SRR1791374 3 0.6765 0.4269 0.076 0.000 0.504 0.304 0.092 0.024
#> SRR1791372 4 0.1857 0.7815 0.032 0.000 0.000 0.928 0.028 0.012
#> SRR1791370 3 0.5365 0.5508 0.068 0.000 0.716 0.100 0.092 0.024
#> SRR1791373 1 0.3621 0.5489 0.796 0.008 0.148 0.000 0.048 0.000
#> SRR1791369 4 0.2395 0.7814 0.076 0.000 0.012 0.892 0.020 0.000
#> SRR1791371 4 0.4610 0.7003 0.020 0.000 0.128 0.760 0.064 0.028
#> SRR1791368 4 0.4305 0.6949 0.020 0.000 0.000 0.656 0.312 0.012
#> SRR1791366 2 0.1367 0.7952 0.000 0.944 0.044 0.000 0.012 0.000
#> SRR1791364 4 0.1718 0.7684 0.044 0.000 0.000 0.932 0.008 0.016
#> SRR1791367 4 0.2452 0.7849 0.040 0.000 0.016 0.904 0.028 0.012
#> SRR1791363 4 0.4103 0.7113 0.020 0.000 0.000 0.684 0.288 0.008
#> SRR1791361 5 0.2905 0.6581 0.016 0.036 0.008 0.056 0.880 0.004
#> SRR1791360 4 0.6495 0.3370 0.024 0.000 0.260 0.520 0.176 0.020
#> SRR1791359 3 0.0405 0.6220 0.004 0.000 0.988 0.008 0.000 0.000
#> SRR1791358 6 0.1327 0.9646 0.000 0.064 0.000 0.000 0.000 0.936
#> SRR1791365 2 0.1528 0.8044 0.016 0.936 0.000 0.000 0.048 0.000
#> SRR1791357 4 0.1929 0.7680 0.048 0.000 0.008 0.924 0.004 0.016
#> SRR1791356 4 0.6075 0.5037 0.216 0.000 0.136 0.592 0.052 0.004
#> SRR1791355 2 0.3497 0.7726 0.060 0.844 0.012 0.000 0.056 0.028
#> SRR1791362 4 0.3105 0.7774 0.096 0.000 0.012 0.852 0.036 0.004
#> SRR1791354 3 0.2165 0.5600 0.108 0.008 0.884 0.000 0.000 0.000
#> SRR1791353 4 0.4677 0.6884 0.020 0.008 0.008 0.648 0.308 0.008
#> SRR1791352 4 0.1969 0.7659 0.052 0.000 0.004 0.920 0.004 0.020
#> SRR1791349 2 0.0405 0.8065 0.004 0.988 0.000 0.000 0.008 0.000
#> SRR1791348 4 0.3252 0.7786 0.072 0.000 0.008 0.844 0.072 0.004
#> SRR1791351 6 0.1327 0.9646 0.000 0.064 0.000 0.000 0.000 0.936
#> SRR1791350 4 0.7390 0.3546 0.064 0.036 0.156 0.540 0.176 0.028
#> SRR1791339 5 0.5682 0.2271 0.016 0.436 0.100 0.000 0.448 0.000
#> SRR1791338 2 0.6549 0.3178 0.084 0.532 0.164 0.000 0.000 0.220
#> SRR1791336 2 0.6549 0.3178 0.084 0.532 0.164 0.000 0.000 0.220
#> SRR1791337 3 0.2653 0.5992 0.100 0.004 0.868 0.028 0.000 0.000
#> SRR1791335 6 0.1910 0.9271 0.000 0.108 0.000 0.000 0.000 0.892
#> SRR1791332 4 0.6340 0.6075 0.080 0.000 0.068 0.568 0.264 0.020
#> SRR1791331 5 0.5721 0.4692 0.036 0.352 0.080 0.000 0.532 0.000
#> SRR1791330 4 0.5067 0.7073 0.028 0.000 0.088 0.720 0.144 0.020
#> SRR1791334 4 0.3543 0.7734 0.096 0.000 0.024 0.832 0.040 0.008
#> SRR1791328 5 0.1976 0.6877 0.000 0.032 0.008 0.032 0.924 0.004
#> SRR1791327 6 0.1387 0.9647 0.000 0.068 0.000 0.000 0.000 0.932
#> SRR1791333 5 0.2619 0.7071 0.000 0.072 0.008 0.032 0.884 0.004
#> SRR1791326 2 0.2819 0.7644 0.036 0.880 0.024 0.000 0.004 0.056
#> SRR1791324 2 0.1429 0.8059 0.004 0.940 0.000 0.000 0.052 0.004
#> SRR1791323 6 0.3118 0.8985 0.020 0.068 0.048 0.000 0.004 0.860
#> SRR1791322 3 0.1036 0.6225 0.024 0.000 0.964 0.008 0.004 0.000
#> SRR1791329 2 0.1429 0.8059 0.004 0.940 0.000 0.000 0.052 0.004
#> SRR1791321 4 0.2395 0.7809 0.076 0.000 0.012 0.892 0.020 0.000
#> SRR1791320 5 0.4120 0.7417 0.024 0.172 0.044 0.000 0.760 0.000
#> SRR1791325 3 0.6738 0.4569 0.072 0.000 0.536 0.256 0.112 0.024
#> SRR1791318 4 0.1904 0.7656 0.048 0.000 0.004 0.924 0.004 0.020
#> SRR1791317 3 0.0692 0.6182 0.020 0.000 0.976 0.004 0.000 0.000
#> SRR1791313 4 0.2123 0.7630 0.052 0.000 0.000 0.912 0.012 0.024
#> SRR1791312 4 0.3105 0.7791 0.096 0.000 0.012 0.852 0.036 0.004
#> SRR1791319 3 0.7521 0.3474 0.172 0.004 0.416 0.304 0.076 0.028
#> SRR1791316 4 0.2017 0.7671 0.048 0.000 0.008 0.920 0.004 0.020
#> SRR1791315 4 0.1826 0.7659 0.052 0.000 0.000 0.924 0.004 0.020
#> SRR1791311 4 0.3731 0.7705 0.072 0.000 0.000 0.796 0.124 0.008
#> SRR1791314 6 0.1444 0.9632 0.000 0.072 0.000 0.000 0.000 0.928
#> SRR1791310 5 0.5083 0.6567 0.036 0.248 0.060 0.000 0.656 0.000
#> SRR1791308 1 0.7085 0.4615 0.364 0.304 0.260 0.000 0.000 0.072
#> SRR1791307 4 0.4103 0.7113 0.020 0.000 0.000 0.684 0.288 0.008
#> SRR1791306 4 0.4122 0.7091 0.020 0.000 0.000 0.680 0.292 0.008
#> SRR1791305 2 0.0520 0.8053 0.008 0.984 0.000 0.000 0.008 0.000
#> SRR1791309 3 0.0363 0.6138 0.012 0.000 0.988 0.000 0.000 0.000
#> SRR1791304 4 0.2022 0.7640 0.052 0.000 0.000 0.916 0.008 0.024
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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.860 0.938 0.972 0.5012 0.496 0.496
#> 3 3 1.000 0.955 0.981 0.2637 0.835 0.678
#> 4 4 0.778 0.760 0.827 0.1416 0.873 0.661
#> 5 5 0.869 0.870 0.930 0.0664 0.956 0.832
#> 6 6 0.836 0.733 0.870 0.0333 0.998 0.989
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
#> SRR1791347 2 0.0000 0.957 0.000 1.000
#> SRR1791346 2 0.0000 0.957 0.000 1.000
#> SRR1791345 1 0.0000 0.979 1.000 0.000
#> SRR1791344 2 0.0000 0.957 0.000 1.000
#> SRR1791343 2 0.0000 0.957 0.000 1.000
#> SRR1791341 1 0.0000 0.979 1.000 0.000
#> SRR1791342 2 0.0000 0.957 0.000 1.000
#> SRR1791340 2 0.0000 0.957 0.000 1.000
#> SRR1791375 1 0.8081 0.655 0.752 0.248
#> SRR1791374 1 0.0000 0.979 1.000 0.000
#> SRR1791372 1 0.0000 0.979 1.000 0.000
#> SRR1791370 1 0.7299 0.731 0.796 0.204
#> SRR1791373 1 0.0672 0.972 0.992 0.008
#> SRR1791369 1 0.0000 0.979 1.000 0.000
#> SRR1791371 1 0.0000 0.979 1.000 0.000
#> SRR1791368 1 0.0000 0.979 1.000 0.000
#> SRR1791366 2 0.0000 0.957 0.000 1.000
#> SRR1791364 1 0.0000 0.979 1.000 0.000
#> SRR1791367 1 0.0000 0.979 1.000 0.000
#> SRR1791363 1 0.0000 0.979 1.000 0.000
#> SRR1791361 1 0.4022 0.900 0.920 0.080
#> SRR1791360 1 0.0000 0.979 1.000 0.000
#> SRR1791359 2 0.7219 0.771 0.200 0.800
#> SRR1791358 2 0.0000 0.957 0.000 1.000
#> SRR1791365 2 0.0000 0.957 0.000 1.000
#> SRR1791357 1 0.0000 0.979 1.000 0.000
#> SRR1791356 1 0.0000 0.979 1.000 0.000
#> SRR1791355 2 0.0000 0.957 0.000 1.000
#> SRR1791362 1 0.0000 0.979 1.000 0.000
#> SRR1791354 2 0.9000 0.579 0.316 0.684
#> SRR1791353 1 0.0000 0.979 1.000 0.000
#> SRR1791352 1 0.0000 0.979 1.000 0.000
#> SRR1791349 2 0.0000 0.957 0.000 1.000
#> SRR1791348 1 0.0000 0.979 1.000 0.000
#> SRR1791351 2 0.0000 0.957 0.000 1.000
#> SRR1791350 1 0.0000 0.979 1.000 0.000
#> SRR1791339 2 0.0000 0.957 0.000 1.000
#> SRR1791338 2 0.0000 0.957 0.000 1.000
#> SRR1791336 2 0.0000 0.957 0.000 1.000
#> SRR1791337 1 0.0000 0.979 1.000 0.000
#> SRR1791335 2 0.0000 0.957 0.000 1.000
#> SRR1791332 1 0.0000 0.979 1.000 0.000
#> SRR1791331 2 0.0000 0.957 0.000 1.000
#> SRR1791330 1 0.0000 0.979 1.000 0.000
#> SRR1791334 1 0.0000 0.979 1.000 0.000
#> SRR1791328 2 0.6887 0.771 0.184 0.816
#> SRR1791327 2 0.0000 0.957 0.000 1.000
#> SRR1791333 1 0.7056 0.756 0.808 0.192
#> SRR1791326 2 0.0000 0.957 0.000 1.000
#> SRR1791324 2 0.0000 0.957 0.000 1.000
#> SRR1791323 2 0.0000 0.957 0.000 1.000
#> SRR1791322 2 0.7219 0.771 0.200 0.800
#> SRR1791329 2 0.0000 0.957 0.000 1.000
#> SRR1791321 1 0.0000 0.979 1.000 0.000
#> SRR1791320 2 0.0000 0.957 0.000 1.000
#> SRR1791325 1 0.0000 0.979 1.000 0.000
#> SRR1791318 1 0.0000 0.979 1.000 0.000
#> SRR1791317 2 0.7602 0.744 0.220 0.780
#> SRR1791313 1 0.0000 0.979 1.000 0.000
#> SRR1791312 1 0.0000 0.979 1.000 0.000
#> SRR1791319 1 0.0000 0.979 1.000 0.000
#> SRR1791316 1 0.0000 0.979 1.000 0.000
#> SRR1791315 1 0.0000 0.979 1.000 0.000
#> SRR1791311 1 0.0000 0.979 1.000 0.000
#> SRR1791314 2 0.0000 0.957 0.000 1.000
#> SRR1791310 2 0.0000 0.957 0.000 1.000
#> SRR1791308 2 0.0000 0.957 0.000 1.000
#> SRR1791307 1 0.0000 0.979 1.000 0.000
#> SRR1791306 1 0.0000 0.979 1.000 0.000
#> SRR1791305 2 0.0000 0.957 0.000 1.000
#> SRR1791309 2 0.7219 0.771 0.200 0.800
#> SRR1791304 1 0.0000 0.979 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791346 3 0.5988 0.466 0.000 0.368 0.632
#> SRR1791345 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791344 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791343 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791341 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791342 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791340 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791375 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791374 3 0.0424 0.925 0.008 0.000 0.992
#> SRR1791372 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791370 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791373 1 0.0237 0.978 0.996 0.004 0.000
#> SRR1791369 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791368 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791366 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791364 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791363 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791361 1 0.1643 0.934 0.956 0.044 0.000
#> SRR1791360 3 0.2711 0.860 0.088 0.000 0.912
#> SRR1791359 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791358 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791365 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791357 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791355 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791362 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791354 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791353 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791352 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791349 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791348 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791339 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791338 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791337 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791335 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791332 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791331 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791330 1 0.5291 0.630 0.732 0.000 0.268
#> SRR1791334 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791328 2 0.1411 0.951 0.036 0.964 0.000
#> SRR1791327 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791333 1 0.4750 0.702 0.784 0.216 0.000
#> SRR1791326 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791324 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791323 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791322 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791329 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791321 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791320 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791325 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791318 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791317 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791313 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791319 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791316 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791314 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791310 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791308 3 0.5882 0.508 0.000 0.348 0.652
#> SRR1791307 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791306 1 0.0000 0.982 1.000 0.000 0.000
#> SRR1791305 2 0.0000 0.998 0.000 1.000 0.000
#> SRR1791309 3 0.0000 0.930 0.000 0.000 1.000
#> SRR1791304 1 0.0000 0.982 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 2 0.3219 0.793 0.000 0.836 0.000 0.164
#> SRR1791346 3 0.7544 0.377 0.200 0.340 0.460 0.000
#> SRR1791345 1 0.3907 0.115 0.768 0.000 0.000 0.232
#> SRR1791344 2 0.0336 0.983 0.000 0.992 0.000 0.008
#> SRR1791343 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791341 4 0.1211 0.688 0.040 0.000 0.000 0.960
#> SRR1791342 4 0.4992 0.053 0.000 0.476 0.000 0.524
#> SRR1791340 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791375 3 0.2125 0.815 0.004 0.000 0.920 0.076
#> SRR1791374 3 0.3356 0.712 0.176 0.000 0.824 0.000
#> SRR1791372 1 0.4967 0.751 0.548 0.000 0.000 0.452
#> SRR1791370 3 0.0336 0.857 0.008 0.000 0.992 0.000
#> SRR1791373 1 0.1305 0.454 0.960 0.004 0.000 0.036
#> SRR1791369 1 0.4866 0.809 0.596 0.000 0.000 0.404
#> SRR1791371 1 0.4855 0.810 0.600 0.000 0.000 0.400
#> SRR1791368 4 0.0592 0.681 0.016 0.000 0.000 0.984
#> SRR1791366 2 0.0592 0.975 0.000 0.984 0.016 0.000
#> SRR1791364 1 0.4877 0.806 0.592 0.000 0.000 0.408
#> SRR1791367 1 0.4830 0.805 0.608 0.000 0.000 0.392
#> SRR1791363 4 0.4103 0.557 0.256 0.000 0.000 0.744
#> SRR1791361 4 0.1743 0.689 0.004 0.056 0.000 0.940
#> SRR1791360 3 0.2021 0.823 0.012 0.000 0.932 0.056
#> SRR1791359 3 0.0000 0.858 0.000 0.000 1.000 0.000
#> SRR1791358 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791357 1 0.4855 0.810 0.600 0.000 0.000 0.400
#> SRR1791356 1 0.4855 0.810 0.600 0.000 0.000 0.400
#> SRR1791355 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791362 4 0.1022 0.669 0.032 0.000 0.000 0.968
#> SRR1791354 3 0.5085 0.591 0.376 0.000 0.616 0.008
#> SRR1791353 4 0.1867 0.688 0.072 0.000 0.000 0.928
#> SRR1791352 1 0.4855 0.810 0.600 0.000 0.000 0.400
#> SRR1791349 2 0.0188 0.986 0.000 0.996 0.000 0.004
#> SRR1791348 1 0.4585 0.262 0.668 0.000 0.000 0.332
#> SRR1791351 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.2589 0.319 0.884 0.000 0.000 0.116
#> SRR1791339 2 0.0336 0.983 0.000 0.992 0.000 0.008
#> SRR1791338 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.0188 0.858 0.004 0.000 0.996 0.000
#> SRR1791335 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.4776 -0.209 0.624 0.000 0.000 0.376
#> SRR1791331 2 0.0188 0.986 0.000 0.996 0.000 0.004
#> SRR1791330 4 0.4284 0.564 0.020 0.000 0.200 0.780
#> SRR1791334 1 0.4855 0.810 0.600 0.000 0.000 0.400
#> SRR1791328 4 0.6426 0.245 0.072 0.392 0.000 0.536
#> SRR1791327 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791333 4 0.2973 0.635 0.000 0.144 0.000 0.856
#> SRR1791326 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791324 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791323 2 0.0188 0.986 0.000 0.996 0.000 0.004
#> SRR1791322 3 0.0000 0.858 0.000 0.000 1.000 0.000
#> SRR1791329 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791321 1 0.4855 0.810 0.600 0.000 0.000 0.400
#> SRR1791320 2 0.1716 0.928 0.000 0.936 0.000 0.064
#> SRR1791325 3 0.0336 0.857 0.008 0.000 0.992 0.000
#> SRR1791318 1 0.4855 0.810 0.600 0.000 0.000 0.400
#> SRR1791317 3 0.0000 0.858 0.000 0.000 1.000 0.000
#> SRR1791313 1 0.4877 0.806 0.592 0.000 0.000 0.408
#> SRR1791312 4 0.4222 0.260 0.272 0.000 0.000 0.728
#> SRR1791319 1 0.4830 0.805 0.608 0.000 0.000 0.392
#> SRR1791316 1 0.4855 0.810 0.600 0.000 0.000 0.400
#> SRR1791315 1 0.4888 0.802 0.588 0.000 0.000 0.412
#> SRR1791311 4 0.1637 0.631 0.060 0.000 0.000 0.940
#> SRR1791314 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1791310 2 0.0336 0.983 0.000 0.992 0.000 0.008
#> SRR1791308 3 0.4661 0.485 0.000 0.348 0.652 0.000
#> SRR1791307 4 0.0817 0.676 0.024 0.000 0.000 0.976
#> SRR1791306 4 0.2408 0.680 0.104 0.000 0.000 0.896
#> SRR1791305 2 0.0188 0.984 0.000 0.996 0.004 0.000
#> SRR1791309 3 0.0000 0.858 0.000 0.000 1.000 0.000
#> SRR1791304 1 0.4866 0.809 0.596 0.000 0.000 0.404
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 2 0.4327 0.424 0.000 0.632 0.000 0.360 0.008
#> SRR1791346 5 0.5544 0.558 0.000 0.220 0.088 0.020 0.672
#> SRR1791345 5 0.1310 0.829 0.024 0.000 0.000 0.020 0.956
#> SRR1791344 2 0.1168 0.944 0.000 0.960 0.000 0.032 0.008
#> SRR1791343 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791341 4 0.2248 0.864 0.088 0.000 0.000 0.900 0.012
#> SRR1791342 4 0.2411 0.778 0.000 0.108 0.000 0.884 0.008
#> SRR1791340 2 0.0290 0.967 0.000 0.992 0.000 0.000 0.008
#> SRR1791375 3 0.3916 0.614 0.000 0.000 0.732 0.256 0.012
#> SRR1791374 3 0.4047 0.468 0.320 0.000 0.676 0.000 0.004
#> SRR1791372 1 0.2389 0.852 0.880 0.000 0.000 0.116 0.004
#> SRR1791370 3 0.0798 0.847 0.000 0.000 0.976 0.016 0.008
#> SRR1791373 5 0.2753 0.807 0.104 0.008 0.000 0.012 0.876
#> SRR1791369 1 0.0404 0.979 0.988 0.000 0.000 0.012 0.000
#> SRR1791371 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> SRR1791368 4 0.1892 0.865 0.080 0.000 0.000 0.916 0.004
#> SRR1791366 2 0.0613 0.963 0.000 0.984 0.008 0.004 0.004
#> SRR1791364 1 0.0404 0.979 0.988 0.000 0.000 0.012 0.000
#> SRR1791367 1 0.0613 0.975 0.984 0.000 0.004 0.004 0.008
#> SRR1791363 4 0.1648 0.852 0.020 0.000 0.000 0.940 0.040
#> SRR1791361 4 0.2122 0.856 0.036 0.032 0.000 0.924 0.008
#> SRR1791360 3 0.2647 0.795 0.024 0.000 0.892 0.076 0.008
#> SRR1791359 3 0.0324 0.851 0.000 0.000 0.992 0.004 0.004
#> SRR1791358 2 0.0162 0.969 0.000 0.996 0.000 0.004 0.000
#> SRR1791365 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> SRR1791355 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791362 4 0.2068 0.863 0.092 0.000 0.000 0.904 0.004
#> SRR1791354 5 0.2388 0.789 0.000 0.000 0.072 0.028 0.900
#> SRR1791353 4 0.0510 0.844 0.000 0.000 0.000 0.984 0.016
#> SRR1791352 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> SRR1791349 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791348 5 0.5775 0.557 0.264 0.000 0.000 0.136 0.600
#> SRR1791351 2 0.0162 0.969 0.000 0.996 0.000 0.004 0.000
#> SRR1791350 5 0.1282 0.830 0.044 0.000 0.000 0.004 0.952
#> SRR1791339 2 0.0609 0.959 0.000 0.980 0.000 0.020 0.000
#> SRR1791338 2 0.0162 0.969 0.000 0.996 0.000 0.004 0.000
#> SRR1791336 2 0.0162 0.969 0.000 0.996 0.000 0.004 0.000
#> SRR1791337 3 0.0162 0.850 0.000 0.000 0.996 0.000 0.004
#> SRR1791335 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 5 0.1764 0.819 0.008 0.000 0.000 0.064 0.928
#> SRR1791331 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791330 4 0.3126 0.828 0.048 0.000 0.076 0.868 0.008
#> SRR1791334 1 0.0290 0.979 0.992 0.000 0.000 0.000 0.008
#> SRR1791328 4 0.4761 0.633 0.000 0.144 0.000 0.732 0.124
#> SRR1791327 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 4 0.2011 0.846 0.020 0.044 0.000 0.928 0.008
#> SRR1791326 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.0162 0.851 0.000 0.000 0.996 0.000 0.004
#> SRR1791329 2 0.0000 0.970 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> SRR1791320 2 0.2727 0.846 0.000 0.868 0.000 0.116 0.016
#> SRR1791325 3 0.1041 0.843 0.000 0.000 0.964 0.032 0.004
#> SRR1791318 1 0.0162 0.981 0.996 0.000 0.000 0.000 0.004
#> SRR1791317 3 0.0162 0.851 0.000 0.000 0.996 0.000 0.004
#> SRR1791313 1 0.0510 0.976 0.984 0.000 0.000 0.016 0.000
#> SRR1791312 4 0.5834 0.382 0.348 0.000 0.000 0.544 0.108
#> SRR1791319 1 0.0451 0.977 0.988 0.000 0.004 0.000 0.008
#> SRR1791316 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0609 0.973 0.980 0.000 0.000 0.020 0.000
#> SRR1791311 4 0.2424 0.838 0.132 0.000 0.000 0.868 0.000
#> SRR1791314 2 0.0162 0.969 0.000 0.996 0.000 0.004 0.000
#> SRR1791310 2 0.0992 0.950 0.000 0.968 0.000 0.024 0.008
#> SRR1791308 3 0.4457 0.407 0.000 0.328 0.656 0.012 0.004
#> SRR1791307 4 0.2124 0.861 0.096 0.000 0.000 0.900 0.004
#> SRR1791306 4 0.3752 0.804 0.064 0.000 0.000 0.812 0.124
#> SRR1791305 2 0.0162 0.969 0.000 0.996 0.000 0.000 0.004
#> SRR1791309 3 0.0162 0.851 0.000 0.000 0.996 0.000 0.004
#> SRR1791304 1 0.0324 0.981 0.992 0.000 0.000 0.004 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 6 0.5961 -0.0380 0.000 0.264 0.000 0.284 0.000 0.452
#> SRR1791346 2 0.7033 0.0000 0.000 0.416 0.100 0.008 0.352 0.124
#> SRR1791345 5 0.0777 0.6225 0.000 0.024 0.000 0.004 0.972 0.000
#> SRR1791344 6 0.3490 0.6261 0.000 0.268 0.000 0.008 0.000 0.724
#> SRR1791343 6 0.0260 0.8976 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR1791341 4 0.2415 0.7541 0.016 0.084 0.000 0.888 0.012 0.000
#> SRR1791342 4 0.4204 0.6012 0.000 0.252 0.000 0.696 0.000 0.052
#> SRR1791340 6 0.1141 0.8786 0.000 0.052 0.000 0.000 0.000 0.948
#> SRR1791375 3 0.4720 0.5672 0.000 0.128 0.692 0.176 0.004 0.000
#> SRR1791374 3 0.3672 0.3497 0.368 0.000 0.632 0.000 0.000 0.000
#> SRR1791372 1 0.4545 0.6327 0.696 0.112 0.000 0.192 0.000 0.000
#> SRR1791370 3 0.2773 0.7311 0.000 0.152 0.836 0.004 0.008 0.000
#> SRR1791373 5 0.3495 0.5282 0.060 0.128 0.000 0.000 0.808 0.004
#> SRR1791369 1 0.0405 0.9417 0.988 0.008 0.000 0.004 0.000 0.000
#> SRR1791371 1 0.0146 0.9410 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR1791368 4 0.0935 0.7765 0.004 0.032 0.000 0.964 0.000 0.000
#> SRR1791366 6 0.2420 0.8323 0.000 0.076 0.040 0.000 0.000 0.884
#> SRR1791364 1 0.0622 0.9392 0.980 0.008 0.000 0.012 0.000 0.000
#> SRR1791367 1 0.1349 0.9126 0.940 0.056 0.000 0.000 0.004 0.000
#> SRR1791363 4 0.0993 0.7731 0.000 0.024 0.000 0.964 0.012 0.000
#> SRR1791361 4 0.3175 0.6628 0.000 0.256 0.000 0.744 0.000 0.000
#> SRR1791360 3 0.4776 0.6361 0.012 0.176 0.708 0.100 0.004 0.000
#> SRR1791359 3 0.1010 0.7638 0.000 0.036 0.960 0.004 0.000 0.000
#> SRR1791358 6 0.0260 0.8969 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR1791365 6 0.0146 0.8987 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1791357 1 0.0713 0.9373 0.972 0.028 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.0146 0.9407 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR1791355 6 0.0458 0.8953 0.000 0.016 0.000 0.000 0.000 0.984
#> SRR1791362 4 0.1908 0.7676 0.056 0.028 0.000 0.916 0.000 0.000
#> SRR1791354 5 0.4533 0.3718 0.000 0.208 0.088 0.004 0.700 0.000
#> SRR1791353 4 0.1010 0.7747 0.000 0.036 0.000 0.960 0.004 0.000
#> SRR1791352 1 0.0000 0.9411 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791349 6 0.0713 0.8916 0.000 0.028 0.000 0.000 0.000 0.972
#> SRR1791348 5 0.7394 0.1879 0.204 0.236 0.000 0.160 0.400 0.000
#> SRR1791351 6 0.0260 0.8969 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR1791350 5 0.1364 0.6370 0.016 0.020 0.000 0.012 0.952 0.000
#> SRR1791339 6 0.2848 0.7516 0.000 0.176 0.000 0.008 0.000 0.816
#> SRR1791338 6 0.0146 0.8982 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1791336 6 0.0260 0.8969 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR1791337 3 0.0547 0.7646 0.000 0.020 0.980 0.000 0.000 0.000
#> SRR1791335 6 0.0146 0.8982 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1791332 5 0.1967 0.6032 0.000 0.012 0.000 0.084 0.904 0.000
#> SRR1791331 6 0.1007 0.8827 0.000 0.044 0.000 0.000 0.000 0.956
#> SRR1791330 4 0.3879 0.6849 0.024 0.036 0.144 0.792 0.004 0.000
#> SRR1791334 1 0.3339 0.7841 0.792 0.188 0.004 0.008 0.008 0.000
#> SRR1791328 4 0.6402 0.2615 0.000 0.344 0.000 0.480 0.088 0.088
#> SRR1791327 6 0.0000 0.8987 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 4 0.3512 0.6438 0.000 0.272 0.000 0.720 0.000 0.008
#> SRR1791326 6 0.0000 0.8987 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791324 6 0.0000 0.8987 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791323 6 0.0000 0.8987 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791322 3 0.1141 0.7630 0.000 0.052 0.948 0.000 0.000 0.000
#> SRR1791329 6 0.0000 0.8987 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791321 1 0.0291 0.9404 0.992 0.004 0.000 0.004 0.000 0.000
#> SRR1791320 6 0.4637 0.4551 0.000 0.308 0.000 0.064 0.000 0.628
#> SRR1791325 3 0.2678 0.7434 0.000 0.116 0.860 0.020 0.004 0.000
#> SRR1791318 1 0.0000 0.9411 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.0547 0.7640 0.000 0.020 0.980 0.000 0.000 0.000
#> SRR1791313 1 0.0508 0.9392 0.984 0.004 0.000 0.012 0.000 0.000
#> SRR1791312 4 0.6378 0.2702 0.172 0.300 0.000 0.488 0.040 0.000
#> SRR1791319 1 0.1296 0.9246 0.952 0.032 0.012 0.004 0.000 0.000
#> SRR1791316 1 0.0363 0.9407 0.988 0.012 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0622 0.9385 0.980 0.012 0.000 0.008 0.000 0.000
#> SRR1791311 4 0.3278 0.7015 0.152 0.040 0.000 0.808 0.000 0.000
#> SRR1791314 6 0.0260 0.8969 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR1791310 6 0.3298 0.6730 0.000 0.236 0.000 0.008 0.000 0.756
#> SRR1791308 3 0.5380 -0.0775 0.000 0.104 0.524 0.000 0.004 0.368
#> SRR1791307 4 0.0717 0.7759 0.016 0.008 0.000 0.976 0.000 0.000
#> SRR1791306 4 0.2925 0.7358 0.008 0.052 0.000 0.860 0.080 0.000
#> SRR1791305 6 0.1003 0.8873 0.000 0.016 0.020 0.000 0.000 0.964
#> SRR1791309 3 0.0632 0.7637 0.000 0.024 0.976 0.000 0.000 0.000
#> SRR1791304 1 0.2831 0.8330 0.840 0.136 0.000 0.024 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 15854 rows and 72 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.891 0.940 0.972 0.4788 0.532 0.532
#> 3 3 0.690 0.848 0.877 0.1998 0.935 0.879
#> 4 4 0.697 0.792 0.863 0.2472 0.812 0.598
#> 5 5 0.696 0.747 0.813 0.0643 0.950 0.824
#> 6 6 0.712 0.539 0.712 0.0621 0.899 0.601
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
#> SRR1791347 1 0.8608 0.653 0.716 0.284
#> SRR1791346 2 0.0000 0.999 0.000 1.000
#> SRR1791345 1 0.2603 0.925 0.956 0.044
#> SRR1791344 1 0.8713 0.640 0.708 0.292
#> SRR1791343 2 0.0000 0.999 0.000 1.000
#> SRR1791341 1 0.0000 0.954 1.000 0.000
#> SRR1791342 1 0.1843 0.936 0.972 0.028
#> SRR1791340 2 0.0000 0.999 0.000 1.000
#> SRR1791375 1 0.1184 0.944 0.984 0.016
#> SRR1791374 1 0.0000 0.954 1.000 0.000
#> SRR1791372 1 0.0000 0.954 1.000 0.000
#> SRR1791370 1 0.3114 0.916 0.944 0.056
#> SRR1791373 1 0.0376 0.952 0.996 0.004
#> SRR1791369 1 0.0000 0.954 1.000 0.000
#> SRR1791371 1 0.0000 0.954 1.000 0.000
#> SRR1791368 1 0.0000 0.954 1.000 0.000
#> SRR1791366 2 0.0000 0.999 0.000 1.000
#> SRR1791364 1 0.0000 0.954 1.000 0.000
#> SRR1791367 1 0.0000 0.954 1.000 0.000
#> SRR1791363 1 0.0000 0.954 1.000 0.000
#> SRR1791361 1 0.0000 0.954 1.000 0.000
#> SRR1791360 1 0.0000 0.954 1.000 0.000
#> SRR1791359 2 0.0376 0.996 0.004 0.996
#> SRR1791358 2 0.0000 0.999 0.000 1.000
#> SRR1791365 2 0.0000 0.999 0.000 1.000
#> SRR1791357 1 0.0000 0.954 1.000 0.000
#> SRR1791356 1 0.0000 0.954 1.000 0.000
#> SRR1791355 2 0.0000 0.999 0.000 1.000
#> SRR1791362 1 0.0000 0.954 1.000 0.000
#> SRR1791354 2 0.0376 0.996 0.004 0.996
#> SRR1791353 1 0.0000 0.954 1.000 0.000
#> SRR1791352 1 0.0000 0.954 1.000 0.000
#> SRR1791349 2 0.0000 0.999 0.000 1.000
#> SRR1791348 1 0.0000 0.954 1.000 0.000
#> SRR1791351 2 0.0000 0.999 0.000 1.000
#> SRR1791350 1 0.0000 0.954 1.000 0.000
#> SRR1791339 1 0.9170 0.569 0.668 0.332
#> SRR1791338 2 0.0000 0.999 0.000 1.000
#> SRR1791336 2 0.0000 0.999 0.000 1.000
#> SRR1791337 2 0.0376 0.996 0.004 0.996
#> SRR1791335 2 0.0000 0.999 0.000 1.000
#> SRR1791332 1 0.0000 0.954 1.000 0.000
#> SRR1791331 1 0.8713 0.640 0.708 0.292
#> SRR1791330 1 0.0000 0.954 1.000 0.000
#> SRR1791334 1 0.0000 0.954 1.000 0.000
#> SRR1791328 1 0.0000 0.954 1.000 0.000
#> SRR1791327 2 0.0000 0.999 0.000 1.000
#> SRR1791333 1 0.0000 0.954 1.000 0.000
#> SRR1791326 2 0.0000 0.999 0.000 1.000
#> SRR1791324 2 0.0000 0.999 0.000 1.000
#> SRR1791323 2 0.0000 0.999 0.000 1.000
#> SRR1791322 2 0.0376 0.996 0.004 0.996
#> SRR1791329 2 0.0000 0.999 0.000 1.000
#> SRR1791321 1 0.0000 0.954 1.000 0.000
#> SRR1791320 1 0.9170 0.569 0.668 0.332
#> SRR1791325 1 0.2778 0.922 0.952 0.048
#> SRR1791318 1 0.0000 0.954 1.000 0.000
#> SRR1791317 2 0.0000 0.999 0.000 1.000
#> SRR1791313 1 0.0000 0.954 1.000 0.000
#> SRR1791312 1 0.0000 0.954 1.000 0.000
#> SRR1791319 1 0.0000 0.954 1.000 0.000
#> SRR1791316 1 0.0000 0.954 1.000 0.000
#> SRR1791315 1 0.0000 0.954 1.000 0.000
#> SRR1791311 1 0.0000 0.954 1.000 0.000
#> SRR1791314 2 0.0000 0.999 0.000 1.000
#> SRR1791310 1 0.8713 0.640 0.708 0.292
#> SRR1791308 2 0.0000 0.999 0.000 1.000
#> SRR1791307 1 0.0000 0.954 1.000 0.000
#> SRR1791306 1 0.0000 0.954 1.000 0.000
#> SRR1791305 2 0.0000 0.999 0.000 1.000
#> SRR1791309 2 0.0000 0.999 0.000 1.000
#> SRR1791304 1 0.0000 0.954 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 1 0.9213 0.522 0.536 0.236 0.228
#> SRR1791346 3 0.4555 0.852 0.000 0.200 0.800
#> SRR1791345 1 0.4796 0.816 0.780 0.000 0.220
#> SRR1791344 1 0.9271 0.508 0.528 0.244 0.228
#> SRR1791343 3 0.5178 0.869 0.000 0.256 0.744
#> SRR1791341 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791342 1 0.4504 0.830 0.804 0.000 0.196
#> SRR1791340 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791375 1 0.4346 0.837 0.816 0.000 0.184
#> SRR1791374 1 0.4291 0.839 0.820 0.000 0.180
#> SRR1791372 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791370 1 0.4974 0.806 0.764 0.000 0.236
#> SRR1791373 1 0.4346 0.838 0.816 0.000 0.184
#> SRR1791369 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791371 1 0.1163 0.892 0.972 0.000 0.028
#> SRR1791368 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791366 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791364 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791367 1 0.1860 0.886 0.948 0.000 0.052
#> SRR1791363 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791361 1 0.4062 0.845 0.836 0.000 0.164
#> SRR1791360 1 0.1031 0.893 0.976 0.000 0.024
#> SRR1791359 3 0.6192 0.630 0.000 0.420 0.580
#> SRR1791358 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791365 3 0.5254 0.866 0.000 0.264 0.736
#> SRR1791357 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791355 3 0.5178 0.869 0.000 0.256 0.744
#> SRR1791362 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791354 3 0.6192 0.630 0.000 0.420 0.580
#> SRR1791353 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791352 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791349 3 0.5178 0.869 0.000 0.256 0.744
#> SRR1791348 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791351 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791339 1 0.9532 0.440 0.488 0.244 0.268
#> SRR1791338 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791336 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791337 3 0.4235 0.841 0.000 0.176 0.824
#> SRR1791335 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791332 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791331 1 0.9271 0.508 0.528 0.244 0.228
#> SRR1791330 1 0.1031 0.893 0.976 0.000 0.024
#> SRR1791334 1 0.0592 0.895 0.988 0.000 0.012
#> SRR1791328 1 0.4062 0.845 0.836 0.000 0.164
#> SRR1791327 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791333 1 0.4062 0.845 0.836 0.000 0.164
#> SRR1791326 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791324 3 0.5178 0.869 0.000 0.256 0.744
#> SRR1791323 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791322 3 0.6192 0.630 0.000 0.420 0.580
#> SRR1791329 3 0.5178 0.869 0.000 0.256 0.744
#> SRR1791321 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791320 1 0.9532 0.440 0.488 0.244 0.268
#> SRR1791325 1 0.4887 0.810 0.772 0.000 0.228
#> SRR1791318 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791317 3 0.4291 0.843 0.000 0.180 0.820
#> SRR1791313 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791312 1 0.1031 0.893 0.976 0.000 0.024
#> SRR1791319 1 0.4291 0.839 0.820 0.000 0.180
#> SRR1791316 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791314 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1791310 1 0.9271 0.508 0.528 0.244 0.228
#> SRR1791308 3 0.4555 0.852 0.000 0.200 0.800
#> SRR1791307 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791306 1 0.0000 0.897 1.000 0.000 0.000
#> SRR1791305 3 0.5254 0.866 0.000 0.264 0.736
#> SRR1791309 3 0.6204 0.630 0.000 0.424 0.576
#> SRR1791304 1 0.0000 0.897 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.4262 0.638 0.000 0.236 0.008 0.756
#> SRR1791346 3 0.3528 0.782 0.000 0.192 0.808 0.000
#> SRR1791345 1 0.5220 0.442 0.568 0.000 0.008 0.424
#> SRR1791344 4 0.4328 0.632 0.000 0.244 0.008 0.748
#> SRR1791343 3 0.4903 0.799 0.000 0.248 0.724 0.028
#> SRR1791341 4 0.3801 0.743 0.220 0.000 0.000 0.780
#> SRR1791342 4 0.0817 0.732 0.024 0.000 0.000 0.976
#> SRR1791340 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791375 4 0.1635 0.741 0.044 0.000 0.008 0.948
#> SRR1791374 1 0.3400 0.772 0.820 0.000 0.000 0.180
#> SRR1791372 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791370 1 0.5459 0.417 0.552 0.000 0.016 0.432
#> SRR1791373 1 0.3444 0.769 0.816 0.000 0.000 0.184
#> SRR1791369 1 0.0921 0.877 0.972 0.000 0.000 0.028
#> SRR1791371 1 0.0921 0.877 0.972 0.000 0.000 0.028
#> SRR1791368 4 0.3801 0.743 0.220 0.000 0.000 0.780
#> SRR1791366 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791364 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.1474 0.867 0.948 0.000 0.000 0.052
#> SRR1791363 4 0.3801 0.743 0.220 0.000 0.000 0.780
#> SRR1791361 1 0.4406 0.672 0.700 0.000 0.000 0.300
#> SRR1791360 1 0.1474 0.875 0.948 0.000 0.000 0.052
#> SRR1791359 3 0.4964 0.602 0.000 0.244 0.724 0.032
#> SRR1791358 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791365 3 0.4964 0.794 0.000 0.256 0.716 0.028
#> SRR1791357 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791355 3 0.4903 0.799 0.000 0.248 0.724 0.028
#> SRR1791362 1 0.1118 0.874 0.964 0.000 0.000 0.036
#> SRR1791354 3 0.4964 0.602 0.000 0.244 0.724 0.032
#> SRR1791353 4 0.3801 0.743 0.220 0.000 0.000 0.780
#> SRR1791352 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791349 3 0.4903 0.799 0.000 0.248 0.724 0.028
#> SRR1791348 1 0.0469 0.881 0.988 0.000 0.000 0.012
#> SRR1791351 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.1022 0.876 0.968 0.000 0.000 0.032
#> SRR1791339 4 0.5476 0.596 0.004 0.244 0.048 0.704
#> SRR1791338 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.0188 0.714 0.000 0.000 0.996 0.004
#> SRR1791335 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791332 4 0.3801 0.743 0.220 0.000 0.000 0.780
#> SRR1791331 4 0.4328 0.632 0.000 0.244 0.008 0.748
#> SRR1791330 1 0.4679 0.410 0.648 0.000 0.000 0.352
#> SRR1791334 1 0.1211 0.878 0.960 0.000 0.000 0.040
#> SRR1791328 4 0.1557 0.742 0.056 0.000 0.000 0.944
#> SRR1791327 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.3688 0.765 0.792 0.000 0.000 0.208
#> SRR1791326 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791324 3 0.4903 0.799 0.000 0.248 0.724 0.028
#> SRR1791323 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.4964 0.602 0.000 0.244 0.724 0.032
#> SRR1791329 3 0.4903 0.799 0.000 0.248 0.724 0.028
#> SRR1791321 1 0.0921 0.877 0.972 0.000 0.000 0.028
#> SRR1791320 4 0.5298 0.597 0.000 0.244 0.048 0.708
#> SRR1791325 1 0.5236 0.431 0.560 0.000 0.008 0.432
#> SRR1791318 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 0.715 0.000 0.000 1.000 0.000
#> SRR1791313 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.0817 0.878 0.976 0.000 0.000 0.024
#> SRR1791319 1 0.3400 0.772 0.820 0.000 0.000 0.180
#> SRR1791316 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.882 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.1022 0.876 0.968 0.000 0.000 0.032
#> SRR1791314 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.4328 0.632 0.000 0.244 0.008 0.748
#> SRR1791308 3 0.3569 0.781 0.000 0.196 0.804 0.000
#> SRR1791307 4 0.3801 0.743 0.220 0.000 0.000 0.780
#> SRR1791306 4 0.3801 0.743 0.220 0.000 0.000 0.780
#> SRR1791305 3 0.4964 0.794 0.000 0.256 0.716 0.028
#> SRR1791309 3 0.4872 0.605 0.000 0.244 0.728 0.028
#> SRR1791304 1 0.0000 0.882 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
#> SRR1791347 5 0.4045 0.633 0.000 0.000 0.000 0.356 0.644
#> SRR1791346 3 0.3506 0.770 0.000 0.132 0.824 0.000 0.044
#> SRR1791345 1 0.6368 0.056 0.436 0.000 0.000 0.164 0.400
#> SRR1791344 5 0.4201 0.666 0.000 0.000 0.008 0.328 0.664
#> SRR1791343 3 0.3732 0.795 0.000 0.176 0.792 0.000 0.032
#> SRR1791341 4 0.2852 0.872 0.172 0.000 0.000 0.828 0.000
#> SRR1791342 4 0.3491 0.340 0.004 0.000 0.000 0.768 0.228
#> SRR1791340 2 0.1502 0.951 0.000 0.940 0.056 0.004 0.000
#> SRR1791375 4 0.1408 0.656 0.008 0.000 0.000 0.948 0.044
#> SRR1791374 1 0.4010 0.706 0.792 0.000 0.000 0.072 0.136
#> SRR1791372 1 0.0404 0.843 0.988 0.000 0.000 0.000 0.012
#> SRR1791370 5 0.5785 -0.209 0.420 0.000 0.008 0.068 0.504
#> SRR1791373 1 0.4036 0.701 0.788 0.000 0.000 0.068 0.144
#> SRR1791369 1 0.3289 0.811 0.844 0.000 0.000 0.048 0.108
#> SRR1791371 1 0.1430 0.830 0.944 0.000 0.000 0.004 0.052
#> SRR1791368 4 0.2852 0.872 0.172 0.000 0.000 0.828 0.000
#> SRR1791366 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> SRR1791364 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.1894 0.819 0.920 0.000 0.000 0.008 0.072
#> SRR1791363 4 0.2852 0.872 0.172 0.000 0.000 0.828 0.000
#> SRR1791361 1 0.5982 0.483 0.552 0.000 0.000 0.312 0.136
#> SRR1791360 1 0.3622 0.808 0.820 0.000 0.000 0.056 0.124
#> SRR1791359 3 0.3949 0.583 0.000 0.000 0.668 0.000 0.332
#> SRR1791358 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 3 0.3805 0.790 0.000 0.184 0.784 0.000 0.032
#> SRR1791357 1 0.0794 0.838 0.972 0.000 0.000 0.000 0.028
#> SRR1791356 1 0.0794 0.838 0.972 0.000 0.000 0.000 0.028
#> SRR1791355 3 0.3732 0.795 0.000 0.176 0.792 0.000 0.032
#> SRR1791362 1 0.3427 0.807 0.836 0.000 0.000 0.056 0.108
#> SRR1791354 3 0.3949 0.583 0.000 0.000 0.668 0.000 0.332
#> SRR1791353 4 0.2852 0.872 0.172 0.000 0.000 0.828 0.000
#> SRR1791352 1 0.0794 0.838 0.972 0.000 0.000 0.000 0.028
#> SRR1791349 3 0.3732 0.795 0.000 0.176 0.792 0.000 0.032
#> SRR1791348 1 0.2932 0.819 0.864 0.000 0.000 0.032 0.104
#> SRR1791351 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 1 0.3359 0.809 0.840 0.000 0.000 0.052 0.108
#> SRR1791339 5 0.4822 0.658 0.000 0.000 0.048 0.288 0.664
#> SRR1791338 2 0.1571 0.949 0.000 0.936 0.060 0.004 0.000
#> SRR1791336 2 0.1571 0.949 0.000 0.936 0.060 0.004 0.000
#> SRR1791337 3 0.2233 0.718 0.000 0.000 0.892 0.004 0.104
#> SRR1791335 2 0.1571 0.949 0.000 0.936 0.060 0.004 0.000
#> SRR1791332 4 0.2852 0.872 0.172 0.000 0.000 0.828 0.000
#> SRR1791331 5 0.4201 0.666 0.000 0.000 0.008 0.328 0.664
#> SRR1791330 1 0.4682 0.405 0.620 0.000 0.000 0.356 0.024
#> SRR1791334 1 0.3459 0.811 0.832 0.000 0.000 0.052 0.116
#> SRR1791328 4 0.0992 0.673 0.008 0.000 0.000 0.968 0.024
#> SRR1791327 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 1 0.5459 0.617 0.644 0.000 0.000 0.236 0.120
#> SRR1791326 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 3 0.3732 0.795 0.000 0.176 0.792 0.000 0.032
#> SRR1791323 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.3949 0.583 0.000 0.000 0.668 0.000 0.332
#> SRR1791329 3 0.3732 0.795 0.000 0.176 0.792 0.000 0.032
#> SRR1791321 1 0.3289 0.811 0.844 0.000 0.000 0.048 0.108
#> SRR1791320 5 0.4843 0.658 0.000 0.000 0.048 0.292 0.660
#> SRR1791325 5 0.5538 -0.228 0.428 0.000 0.000 0.068 0.504
#> SRR1791318 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.2074 0.720 0.000 0.000 0.896 0.000 0.104
#> SRR1791313 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000
#> SRR1791312 1 0.1168 0.843 0.960 0.000 0.000 0.008 0.032
#> SRR1791319 1 0.4010 0.706 0.792 0.000 0.000 0.072 0.136
#> SRR1791316 1 0.0794 0.838 0.972 0.000 0.000 0.000 0.028
#> SRR1791315 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.000
#> SRR1791311 1 0.3359 0.809 0.840 0.000 0.000 0.052 0.108
#> SRR1791314 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.4201 0.666 0.000 0.000 0.008 0.328 0.664
#> SRR1791308 3 0.3663 0.769 0.000 0.132 0.820 0.004 0.044
#> SRR1791307 4 0.2852 0.872 0.172 0.000 0.000 0.828 0.000
#> SRR1791306 4 0.2852 0.872 0.172 0.000 0.000 0.828 0.000
#> SRR1791305 3 0.3805 0.790 0.000 0.184 0.784 0.000 0.032
#> SRR1791309 3 0.3932 0.587 0.000 0.000 0.672 0.000 0.328
#> SRR1791304 1 0.0162 0.843 0.996 0.000 0.000 0.000 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.1806 0.9294 0.000 0.000 0.004 0.088 0.908 0.000
#> SRR1791346 2 0.3225 0.7093 0.000 0.852 0.036 0.000 0.064 0.048
#> SRR1791345 1 0.5871 -0.2259 0.416 0.000 0.168 0.004 0.412 0.000
#> SRR1791344 5 0.1411 0.9544 0.000 0.000 0.004 0.060 0.936 0.000
#> SRR1791343 2 0.2070 0.7498 0.000 0.896 0.000 0.000 0.012 0.092
#> SRR1791341 4 0.0000 0.8060 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791342 4 0.3998 -0.0343 0.000 0.000 0.004 0.504 0.492 0.000
#> SRR1791340 6 0.2402 0.8757 0.000 0.140 0.004 0.000 0.000 0.856
#> SRR1791375 4 0.3298 0.5572 0.008 0.000 0.000 0.756 0.236 0.000
#> SRR1791374 1 0.0363 0.3902 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1791372 3 0.5534 0.3588 0.424 0.000 0.444 0.132 0.000 0.000
#> SRR1791370 1 0.5514 -0.0499 0.552 0.000 0.176 0.000 0.272 0.000
#> SRR1791373 1 0.0632 0.3893 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR1791369 3 0.5170 0.7663 0.204 0.000 0.620 0.176 0.000 0.000
#> SRR1791371 1 0.2680 0.3436 0.860 0.000 0.032 0.108 0.000 0.000
#> SRR1791368 4 0.0000 0.8060 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791366 6 0.0000 0.9341 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791364 1 0.5535 -0.4112 0.436 0.000 0.432 0.132 0.000 0.000
#> SRR1791367 1 0.2263 0.3549 0.884 0.000 0.016 0.100 0.000 0.000
#> SRR1791363 4 0.0000 0.8060 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791361 3 0.6756 0.3688 0.136 0.000 0.524 0.152 0.188 0.000
#> SRR1791360 3 0.5275 0.7477 0.232 0.000 0.600 0.168 0.000 0.000
#> SRR1791359 2 0.6016 0.3247 0.000 0.412 0.340 0.000 0.248 0.000
#> SRR1791358 6 0.0000 0.9341 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791365 2 0.2170 0.7451 0.000 0.888 0.000 0.000 0.012 0.100
#> SRR1791357 1 0.5207 -0.0275 0.592 0.000 0.276 0.132 0.000 0.000
#> SRR1791356 1 0.5076 0.0408 0.620 0.000 0.248 0.132 0.000 0.000
#> SRR1791355 2 0.2070 0.7498 0.000 0.896 0.000 0.000 0.012 0.092
#> SRR1791362 3 0.5175 0.7628 0.196 0.000 0.620 0.184 0.000 0.000
#> SRR1791354 2 0.6016 0.3247 0.000 0.412 0.340 0.000 0.248 0.000
#> SRR1791353 4 0.0000 0.8060 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791352 1 0.5521 -0.3468 0.468 0.000 0.400 0.132 0.000 0.000
#> SRR1791349 2 0.2070 0.7498 0.000 0.896 0.000 0.000 0.012 0.092
#> SRR1791348 3 0.5195 0.7444 0.228 0.000 0.612 0.160 0.000 0.000
#> SRR1791351 6 0.0000 0.9341 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791350 3 0.5173 0.7662 0.200 0.000 0.620 0.180 0.000 0.000
#> SRR1791339 5 0.2069 0.9185 0.000 0.068 0.004 0.020 0.908 0.000
#> SRR1791338 6 0.2442 0.8732 0.000 0.144 0.004 0.000 0.000 0.852
#> SRR1791336 6 0.2442 0.8732 0.000 0.144 0.004 0.000 0.000 0.852
#> SRR1791337 2 0.4087 0.6424 0.004 0.744 0.188 0.000 0.064 0.000
#> SRR1791335 6 0.2442 0.8732 0.000 0.144 0.004 0.000 0.000 0.852
#> SRR1791332 4 0.0000 0.8060 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791331 5 0.1411 0.9544 0.000 0.000 0.004 0.060 0.936 0.000
#> SRR1791330 4 0.5933 -0.4653 0.172 0.000 0.348 0.472 0.008 0.000
#> SRR1791334 3 0.5209 0.7586 0.220 0.000 0.612 0.168 0.000 0.000
#> SRR1791328 4 0.3081 0.5754 0.004 0.000 0.000 0.776 0.220 0.000
#> SRR1791327 6 0.0000 0.9341 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 3 0.6332 0.4707 0.184 0.000 0.568 0.080 0.168 0.000
#> SRR1791326 6 0.0000 0.9341 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791324 2 0.2070 0.7498 0.000 0.896 0.000 0.000 0.012 0.092
#> SRR1791323 6 0.0000 0.9341 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791322 2 0.6016 0.3247 0.000 0.412 0.340 0.000 0.248 0.000
#> SRR1791329 2 0.2070 0.7498 0.000 0.896 0.000 0.000 0.012 0.092
#> SRR1791321 3 0.5170 0.7663 0.204 0.000 0.620 0.176 0.000 0.000
#> SRR1791320 5 0.2009 0.9205 0.000 0.068 0.000 0.024 0.908 0.000
#> SRR1791325 1 0.5461 -0.0332 0.560 0.000 0.168 0.000 0.272 0.000
#> SRR1791318 1 0.5535 -0.4029 0.440 0.000 0.428 0.132 0.000 0.000
#> SRR1791317 2 0.3948 0.6442 0.000 0.748 0.188 0.000 0.064 0.000
#> SRR1791313 1 0.5535 -0.4112 0.436 0.000 0.432 0.132 0.000 0.000
#> SRR1791312 3 0.5481 0.3930 0.436 0.000 0.440 0.124 0.000 0.000
#> SRR1791319 1 0.0363 0.3902 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1791316 1 0.5096 0.0366 0.616 0.000 0.252 0.132 0.000 0.000
#> SRR1791315 1 0.5535 -0.4112 0.436 0.000 0.432 0.132 0.000 0.000
#> SRR1791311 3 0.5173 0.7662 0.200 0.000 0.620 0.180 0.000 0.000
#> SRR1791314 6 0.0000 0.9341 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791310 5 0.1411 0.9544 0.000 0.000 0.004 0.060 0.936 0.000
#> SRR1791308 2 0.3294 0.7075 0.000 0.848 0.040 0.000 0.064 0.048
#> SRR1791307 4 0.0000 0.8060 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791306 4 0.0000 0.8060 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791305 2 0.2170 0.7451 0.000 0.888 0.000 0.000 0.012 0.100
#> SRR1791309 2 0.6004 0.3301 0.000 0.416 0.340 0.000 0.244 0.000
#> SRR1791304 3 0.5535 0.3339 0.432 0.000 0.436 0.132 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 15854 rows and 72 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 1.000 0.973 0.988 0.4912 0.507 0.507
#> 3 3 0.629 0.727 0.806 0.3284 0.756 0.547
#> 4 4 0.718 0.764 0.788 0.1322 0.875 0.646
#> 5 5 0.739 0.681 0.811 0.0686 0.924 0.717
#> 6 6 0.754 0.672 0.807 0.0456 0.951 0.773
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
#> SRR1791347 2 0.5059 0.870 0.112 0.888
#> SRR1791346 2 0.0000 0.979 0.000 1.000
#> SRR1791345 1 0.0000 0.994 1.000 0.000
#> SRR1791344 1 0.0376 0.990 0.996 0.004
#> SRR1791343 2 0.0000 0.979 0.000 1.000
#> SRR1791341 1 0.0000 0.994 1.000 0.000
#> SRR1791342 1 0.0000 0.994 1.000 0.000
#> SRR1791340 2 0.0000 0.979 0.000 1.000
#> SRR1791375 1 0.0000 0.994 1.000 0.000
#> SRR1791374 1 0.0000 0.994 1.000 0.000
#> SRR1791372 1 0.0000 0.994 1.000 0.000
#> SRR1791370 1 0.0376 0.990 0.996 0.004
#> SRR1791373 1 0.0000 0.994 1.000 0.000
#> SRR1791369 1 0.0000 0.994 1.000 0.000
#> SRR1791371 1 0.0000 0.994 1.000 0.000
#> SRR1791368 1 0.0000 0.994 1.000 0.000
#> SRR1791366 2 0.0000 0.979 0.000 1.000
#> SRR1791364 1 0.0000 0.994 1.000 0.000
#> SRR1791367 1 0.0000 0.994 1.000 0.000
#> SRR1791363 1 0.0000 0.994 1.000 0.000
#> SRR1791361 1 0.0000 0.994 1.000 0.000
#> SRR1791360 1 0.0000 0.994 1.000 0.000
#> SRR1791359 2 0.0000 0.979 0.000 1.000
#> SRR1791358 2 0.0000 0.979 0.000 1.000
#> SRR1791365 2 0.0000 0.979 0.000 1.000
#> SRR1791357 1 0.0000 0.994 1.000 0.000
#> SRR1791356 1 0.0000 0.994 1.000 0.000
#> SRR1791355 2 0.0000 0.979 0.000 1.000
#> SRR1791362 1 0.0000 0.994 1.000 0.000
#> SRR1791354 2 0.0000 0.979 0.000 1.000
#> SRR1791353 1 0.0000 0.994 1.000 0.000
#> SRR1791352 1 0.0000 0.994 1.000 0.000
#> SRR1791349 2 0.0000 0.979 0.000 1.000
#> SRR1791348 1 0.0000 0.994 1.000 0.000
#> SRR1791351 2 0.0000 0.979 0.000 1.000
#> SRR1791350 1 0.0000 0.994 1.000 0.000
#> SRR1791339 2 0.9491 0.427 0.368 0.632
#> SRR1791338 2 0.0000 0.979 0.000 1.000
#> SRR1791336 2 0.0000 0.979 0.000 1.000
#> SRR1791337 2 0.0000 0.979 0.000 1.000
#> SRR1791335 2 0.0000 0.979 0.000 1.000
#> SRR1791332 1 0.0000 0.994 1.000 0.000
#> SRR1791331 2 0.0000 0.979 0.000 1.000
#> SRR1791330 1 0.0000 0.994 1.000 0.000
#> SRR1791334 1 0.0000 0.994 1.000 0.000
#> SRR1791328 1 0.0000 0.994 1.000 0.000
#> SRR1791327 2 0.0000 0.979 0.000 1.000
#> SRR1791333 1 0.0000 0.994 1.000 0.000
#> SRR1791326 2 0.0000 0.979 0.000 1.000
#> SRR1791324 2 0.0000 0.979 0.000 1.000
#> SRR1791323 2 0.0000 0.979 0.000 1.000
#> SRR1791322 2 0.0000 0.979 0.000 1.000
#> SRR1791329 2 0.0000 0.979 0.000 1.000
#> SRR1791321 1 0.0000 0.994 1.000 0.000
#> SRR1791320 1 0.7815 0.686 0.768 0.232
#> SRR1791325 1 0.0000 0.994 1.000 0.000
#> SRR1791318 1 0.0000 0.994 1.000 0.000
#> SRR1791317 2 0.0000 0.979 0.000 1.000
#> SRR1791313 1 0.0000 0.994 1.000 0.000
#> SRR1791312 1 0.0000 0.994 1.000 0.000
#> SRR1791319 1 0.0000 0.994 1.000 0.000
#> SRR1791316 1 0.0000 0.994 1.000 0.000
#> SRR1791315 1 0.0000 0.994 1.000 0.000
#> SRR1791311 1 0.0000 0.994 1.000 0.000
#> SRR1791314 2 0.0000 0.979 0.000 1.000
#> SRR1791310 2 0.5059 0.870 0.112 0.888
#> SRR1791308 2 0.0000 0.979 0.000 1.000
#> SRR1791307 1 0.0000 0.994 1.000 0.000
#> SRR1791306 1 0.0000 0.994 1.000 0.000
#> SRR1791305 2 0.0000 0.979 0.000 1.000
#> SRR1791309 2 0.0000 0.979 0.000 1.000
#> SRR1791304 1 0.0000 0.994 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.7868 0.4674 0.420 0.056 0.524
#> SRR1791346 2 0.4555 0.8790 0.200 0.800 0.000
#> SRR1791345 1 0.5058 0.6637 0.756 0.000 0.244
#> SRR1791344 3 0.6267 0.5135 0.452 0.000 0.548
#> SRR1791343 2 0.4399 0.8828 0.188 0.812 0.000
#> SRR1791341 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791342 3 0.6079 0.5390 0.388 0.000 0.612
#> SRR1791340 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791375 3 0.5098 0.5808 0.248 0.000 0.752
#> SRR1791374 1 0.5098 0.6696 0.752 0.000 0.248
#> SRR1791372 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791370 1 0.0424 0.3360 0.992 0.000 0.008
#> SRR1791373 1 0.4974 0.6561 0.764 0.000 0.236
#> SRR1791369 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791371 1 0.6244 0.8320 0.560 0.000 0.440
#> SRR1791368 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791366 2 0.4062 0.8872 0.164 0.836 0.000
#> SRR1791364 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791367 1 0.6244 0.8320 0.560 0.000 0.440
#> SRR1791363 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791361 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791360 3 0.5363 -0.0726 0.276 0.000 0.724
#> SRR1791359 2 0.6140 0.7093 0.404 0.596 0.000
#> SRR1791358 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791365 2 0.3551 0.8872 0.132 0.868 0.000
#> SRR1791357 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791356 1 0.6244 0.8320 0.560 0.000 0.440
#> SRR1791355 2 0.4399 0.8828 0.188 0.812 0.000
#> SRR1791362 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791354 2 0.6180 0.6969 0.416 0.584 0.000
#> SRR1791353 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791352 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791349 2 0.4235 0.8837 0.176 0.824 0.000
#> SRR1791348 1 0.6274 0.8185 0.544 0.000 0.456
#> SRR1791351 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791350 3 0.2165 0.6150 0.064 0.000 0.936
#> SRR1791339 3 0.8688 0.3803 0.436 0.104 0.460
#> SRR1791338 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791336 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791337 1 0.5465 -0.2658 0.712 0.288 0.000
#> SRR1791335 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791332 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791331 2 0.6192 0.6962 0.420 0.580 0.000
#> SRR1791330 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791334 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791328 3 0.1529 0.6883 0.040 0.000 0.960
#> SRR1791327 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791333 3 0.2448 0.6025 0.076 0.000 0.924
#> SRR1791326 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791324 2 0.4002 0.8870 0.160 0.840 0.000
#> SRR1791323 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791322 2 0.6180 0.6969 0.416 0.584 0.000
#> SRR1791329 2 0.4062 0.8869 0.164 0.836 0.000
#> SRR1791321 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791320 3 0.7346 0.4938 0.432 0.032 0.536
#> SRR1791325 1 0.4121 0.5638 0.832 0.000 0.168
#> SRR1791318 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791317 2 0.4555 0.8790 0.200 0.800 0.000
#> SRR1791313 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791312 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791319 1 0.5138 0.6734 0.748 0.000 0.252
#> SRR1791316 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791315 1 0.6252 0.8335 0.556 0.000 0.444
#> SRR1791311 3 0.2878 0.5533 0.096 0.000 0.904
#> SRR1791314 2 0.0237 0.8664 0.004 0.996 0.000
#> SRR1791310 3 0.7868 0.4674 0.420 0.056 0.524
#> SRR1791308 2 0.3816 0.8877 0.148 0.852 0.000
#> SRR1791307 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791306 3 0.0000 0.7017 0.000 0.000 1.000
#> SRR1791305 2 0.4062 0.8865 0.164 0.836 0.000
#> SRR1791309 2 0.4346 0.8826 0.184 0.816 0.000
#> SRR1791304 1 0.6252 0.8335 0.556 0.000 0.444
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.4781 0.58873 0.000 0.004 0.336 0.660
#> SRR1791346 3 0.4872 0.70636 0.000 0.356 0.640 0.004
#> SRR1791345 1 0.5938 0.69220 0.676 0.000 0.232 0.092
#> SRR1791344 4 0.4761 0.59095 0.000 0.004 0.332 0.664
#> SRR1791343 3 0.5039 0.68963 0.000 0.404 0.592 0.004
#> SRR1791341 4 0.2704 0.85129 0.124 0.000 0.000 0.876
#> SRR1791342 4 0.2345 0.77453 0.000 0.000 0.100 0.900
#> SRR1791340 2 0.0657 0.92195 0.000 0.984 0.004 0.012
#> SRR1791375 4 0.2300 0.79161 0.016 0.000 0.064 0.920
#> SRR1791374 1 0.4362 0.79833 0.816 0.000 0.096 0.088
#> SRR1791372 1 0.0188 0.90218 0.996 0.000 0.000 0.004
#> SRR1791370 3 0.2542 0.55673 0.012 0.000 0.904 0.084
#> SRR1791373 1 0.5174 0.74916 0.756 0.000 0.152 0.092
#> SRR1791369 1 0.1305 0.89351 0.960 0.000 0.036 0.004
#> SRR1791371 1 0.1297 0.88858 0.964 0.000 0.020 0.016
#> SRR1791368 4 0.2704 0.85129 0.124 0.000 0.000 0.876
#> SRR1791366 2 0.4898 -0.30787 0.000 0.584 0.416 0.000
#> SRR1791364 1 0.0188 0.90218 0.996 0.000 0.000 0.004
#> SRR1791367 1 0.1297 0.88858 0.964 0.000 0.020 0.016
#> SRR1791363 4 0.2704 0.85129 0.124 0.000 0.000 0.876
#> SRR1791361 4 0.2704 0.85129 0.124 0.000 0.000 0.876
#> SRR1791360 1 0.6627 0.00598 0.504 0.000 0.084 0.412
#> SRR1791359 3 0.2973 0.66117 0.000 0.096 0.884 0.020
#> SRR1791358 2 0.0000 0.92551 0.000 1.000 0.000 0.000
#> SRR1791365 3 0.4955 0.64767 0.000 0.444 0.556 0.000
#> SRR1791357 1 0.0188 0.90218 0.996 0.000 0.000 0.004
#> SRR1791356 1 0.0188 0.90061 0.996 0.000 0.000 0.004
#> SRR1791355 3 0.5039 0.68963 0.000 0.404 0.592 0.004
#> SRR1791362 4 0.3787 0.83624 0.124 0.000 0.036 0.840
#> SRR1791354 3 0.2973 0.66117 0.000 0.096 0.884 0.020
#> SRR1791353 4 0.2704 0.85129 0.124 0.000 0.000 0.876
#> SRR1791352 1 0.0188 0.90218 0.996 0.000 0.000 0.004
#> SRR1791349 3 0.4855 0.69512 0.000 0.400 0.600 0.000
#> SRR1791348 1 0.1452 0.89177 0.956 0.000 0.036 0.008
#> SRR1791351 2 0.0000 0.92551 0.000 1.000 0.000 0.000
#> SRR1791350 4 0.4466 0.79383 0.180 0.000 0.036 0.784
#> SRR1791339 3 0.2675 0.56456 0.000 0.008 0.892 0.100
#> SRR1791338 2 0.0937 0.91906 0.000 0.976 0.012 0.012
#> SRR1791336 2 0.0937 0.91906 0.000 0.976 0.012 0.012
#> SRR1791337 3 0.2141 0.62820 0.012 0.040 0.936 0.012
#> SRR1791335 2 0.0937 0.91906 0.000 0.976 0.012 0.012
#> SRR1791332 4 0.2704 0.85129 0.124 0.000 0.000 0.876
#> SRR1791331 3 0.4487 0.62500 0.000 0.100 0.808 0.092
#> SRR1791330 4 0.2589 0.84975 0.116 0.000 0.000 0.884
#> SRR1791334 1 0.1305 0.89351 0.960 0.000 0.036 0.004
#> SRR1791328 4 0.1389 0.82633 0.048 0.000 0.000 0.952
#> SRR1791327 2 0.0000 0.92551 0.000 1.000 0.000 0.000
#> SRR1791333 4 0.5569 0.53216 0.296 0.000 0.044 0.660
#> SRR1791326 2 0.0000 0.92551 0.000 1.000 0.000 0.000
#> SRR1791324 3 0.4933 0.67018 0.000 0.432 0.568 0.000
#> SRR1791323 2 0.0336 0.91754 0.000 0.992 0.008 0.000
#> SRR1791322 3 0.2973 0.66117 0.000 0.096 0.884 0.020
#> SRR1791329 3 0.4907 0.67440 0.000 0.420 0.580 0.000
#> SRR1791321 1 0.1305 0.89351 0.960 0.000 0.036 0.004
#> SRR1791320 4 0.4950 0.54663 0.000 0.004 0.376 0.620
#> SRR1791325 1 0.6478 0.56535 0.576 0.000 0.336 0.088
#> SRR1791318 1 0.0188 0.90218 0.996 0.000 0.000 0.004
#> SRR1791317 3 0.4872 0.70636 0.000 0.356 0.640 0.004
#> SRR1791313 1 0.0188 0.90218 0.996 0.000 0.000 0.004
#> SRR1791312 1 0.1305 0.89351 0.960 0.000 0.036 0.004
#> SRR1791319 1 0.3966 0.81407 0.840 0.000 0.072 0.088
#> SRR1791316 1 0.0188 0.90218 0.996 0.000 0.000 0.004
#> SRR1791315 1 0.0188 0.90218 0.996 0.000 0.000 0.004
#> SRR1791311 4 0.4590 0.78110 0.192 0.000 0.036 0.772
#> SRR1791314 2 0.0000 0.92551 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.4781 0.58873 0.000 0.004 0.336 0.660
#> SRR1791308 3 0.5417 0.66839 0.000 0.412 0.572 0.016
#> SRR1791307 4 0.2704 0.85129 0.124 0.000 0.000 0.876
#> SRR1791306 4 0.2704 0.85129 0.124 0.000 0.000 0.876
#> SRR1791305 3 0.4888 0.68882 0.000 0.412 0.588 0.000
#> SRR1791309 3 0.4697 0.70688 0.000 0.356 0.644 0.000
#> SRR1791304 1 0.0188 0.90218 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
#> SRR1791347 5 0.5064 0.5055 0.000 0.008 0.056 0.260 0.676
#> SRR1791346 3 0.2583 0.7814 0.000 0.132 0.864 0.000 0.004
#> SRR1791345 5 0.6362 -0.0934 0.372 0.000 0.132 0.008 0.488
#> SRR1791344 5 0.4452 0.4860 0.000 0.000 0.032 0.272 0.696
#> SRR1791343 3 0.3496 0.7870 0.000 0.200 0.788 0.000 0.012
#> SRR1791341 4 0.0880 0.8696 0.032 0.000 0.000 0.968 0.000
#> SRR1791342 4 0.4555 0.0199 0.000 0.000 0.008 0.520 0.472
#> SRR1791340 2 0.0865 0.9164 0.000 0.972 0.004 0.000 0.024
#> SRR1791375 4 0.3929 0.6109 0.000 0.000 0.028 0.764 0.208
#> SRR1791374 1 0.5195 0.5661 0.692 0.000 0.088 0.008 0.212
#> SRR1791372 1 0.1041 0.8547 0.964 0.000 0.004 0.032 0.000
#> SRR1791370 5 0.4884 0.1925 0.016 0.000 0.392 0.008 0.584
#> SRR1791373 1 0.5483 0.4921 0.648 0.000 0.088 0.008 0.256
#> SRR1791369 1 0.3989 0.7917 0.820 0.000 0.040 0.032 0.108
#> SRR1791371 1 0.1299 0.8327 0.960 0.000 0.020 0.008 0.012
#> SRR1791368 4 0.0880 0.8696 0.032 0.000 0.000 0.968 0.000
#> SRR1791366 2 0.6526 -0.2940 0.000 0.452 0.344 0.000 0.204
#> SRR1791364 1 0.1041 0.8547 0.964 0.000 0.004 0.032 0.000
#> SRR1791367 1 0.1498 0.8287 0.952 0.000 0.024 0.008 0.016
#> SRR1791363 4 0.0880 0.8696 0.032 0.000 0.000 0.968 0.000
#> SRR1791361 4 0.1168 0.8673 0.032 0.000 0.008 0.960 0.000
#> SRR1791360 1 0.7809 0.0904 0.420 0.000 0.080 0.276 0.224
#> SRR1791359 3 0.5143 0.3879 0.000 0.012 0.576 0.024 0.388
#> SRR1791358 2 0.0000 0.9207 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 3 0.4624 0.6419 0.000 0.340 0.636 0.000 0.024
#> SRR1791357 1 0.0609 0.8545 0.980 0.000 0.000 0.020 0.000
#> SRR1791356 1 0.0000 0.8477 1.000 0.000 0.000 0.000 0.000
#> SRR1791355 3 0.3496 0.7870 0.000 0.200 0.788 0.000 0.012
#> SRR1791362 4 0.4039 0.7591 0.032 0.000 0.040 0.816 0.112
#> SRR1791354 3 0.5143 0.3879 0.000 0.012 0.576 0.024 0.388
#> SRR1791353 4 0.1041 0.8684 0.032 0.000 0.004 0.964 0.000
#> SRR1791352 1 0.0703 0.8549 0.976 0.000 0.000 0.024 0.000
#> SRR1791349 3 0.3988 0.7884 0.000 0.196 0.768 0.000 0.036
#> SRR1791348 1 0.4068 0.7895 0.816 0.000 0.040 0.036 0.108
#> SRR1791351 2 0.0000 0.9207 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 4 0.4663 0.7249 0.068 0.000 0.040 0.780 0.112
#> SRR1791339 5 0.3774 0.2843 0.000 0.000 0.296 0.000 0.704
#> SRR1791338 2 0.0992 0.9150 0.000 0.968 0.008 0.000 0.024
#> SRR1791336 2 0.0992 0.9150 0.000 0.968 0.008 0.000 0.024
#> SRR1791337 3 0.3877 0.5107 0.000 0.000 0.764 0.024 0.212
#> SRR1791335 2 0.1106 0.9127 0.000 0.964 0.012 0.000 0.024
#> SRR1791332 4 0.0880 0.8696 0.032 0.000 0.000 0.968 0.000
#> SRR1791331 5 0.4356 0.1909 0.000 0.012 0.340 0.000 0.648
#> SRR1791330 4 0.2395 0.8372 0.036 0.000 0.040 0.912 0.012
#> SRR1791334 1 0.3830 0.7906 0.824 0.000 0.040 0.020 0.116
#> SRR1791328 4 0.1764 0.8118 0.000 0.000 0.008 0.928 0.064
#> SRR1791327 2 0.0000 0.9207 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 5 0.7899 0.1416 0.284 0.000 0.072 0.280 0.364
#> SRR1791326 2 0.0162 0.9188 0.000 0.996 0.004 0.000 0.000
#> SRR1791324 3 0.4352 0.7613 0.000 0.244 0.720 0.000 0.036
#> SRR1791323 2 0.0162 0.9188 0.000 0.996 0.004 0.000 0.000
#> SRR1791322 3 0.5186 0.3483 0.000 0.012 0.556 0.024 0.408
#> SRR1791329 3 0.3934 0.7609 0.000 0.244 0.740 0.000 0.016
#> SRR1791321 1 0.3830 0.7906 0.824 0.000 0.040 0.020 0.116
#> SRR1791320 5 0.4706 0.5083 0.000 0.000 0.052 0.256 0.692
#> SRR1791325 5 0.6082 0.0263 0.344 0.000 0.108 0.008 0.540
#> SRR1791318 1 0.0880 0.8541 0.968 0.000 0.000 0.032 0.000
#> SRR1791317 3 0.3784 0.7665 0.000 0.132 0.820 0.024 0.024
#> SRR1791313 1 0.1041 0.8547 0.964 0.000 0.004 0.032 0.000
#> SRR1791312 1 0.4045 0.7892 0.812 0.000 0.052 0.020 0.116
#> SRR1791319 1 0.4796 0.6364 0.740 0.000 0.088 0.008 0.164
#> SRR1791316 1 0.0609 0.8545 0.980 0.000 0.000 0.020 0.000
#> SRR1791315 1 0.1041 0.8547 0.964 0.000 0.004 0.032 0.000
#> SRR1791311 4 0.5104 0.6864 0.100 0.000 0.040 0.748 0.112
#> SRR1791314 2 0.0162 0.9201 0.000 0.996 0.004 0.000 0.000
#> SRR1791310 5 0.5064 0.5055 0.000 0.008 0.056 0.260 0.676
#> SRR1791308 3 0.3909 0.7677 0.000 0.216 0.760 0.000 0.024
#> SRR1791307 4 0.0880 0.8696 0.032 0.000 0.000 0.968 0.000
#> SRR1791306 4 0.0880 0.8696 0.032 0.000 0.000 0.968 0.000
#> SRR1791305 3 0.4021 0.7875 0.000 0.200 0.764 0.000 0.036
#> SRR1791309 3 0.4151 0.7649 0.000 0.136 0.800 0.024 0.040
#> SRR1791304 1 0.0703 0.8549 0.976 0.000 0.000 0.024 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.2051 0.6642 0.000 0.004 0.000 0.096 0.896 0.004
#> SRR1791346 2 0.2351 0.8095 0.000 0.900 0.036 0.000 0.012 0.052
#> SRR1791345 3 0.4618 0.6782 0.144 0.012 0.720 0.000 0.124 0.000
#> SRR1791344 5 0.2301 0.6491 0.000 0.000 0.020 0.096 0.884 0.000
#> SRR1791343 2 0.2958 0.8358 0.000 0.852 0.028 0.000 0.012 0.108
#> SRR1791341 4 0.0603 0.8666 0.016 0.004 0.000 0.980 0.000 0.000
#> SRR1791342 5 0.4443 0.2970 0.000 0.000 0.036 0.368 0.596 0.000
#> SRR1791340 6 0.1723 0.8801 0.000 0.012 0.048 0.004 0.004 0.932
#> SRR1791375 4 0.3997 0.6726 0.000 0.004 0.152 0.764 0.080 0.000
#> SRR1791374 1 0.5659 0.1119 0.524 0.052 0.372 0.000 0.052 0.000
#> SRR1791372 1 0.0405 0.7629 0.988 0.000 0.008 0.004 0.000 0.000
#> SRR1791370 3 0.5440 0.2395 0.000 0.152 0.552 0.000 0.296 0.000
#> SRR1791373 1 0.5785 0.0479 0.500 0.052 0.388 0.000 0.060 0.000
#> SRR1791369 1 0.3426 0.5468 0.720 0.000 0.276 0.004 0.000 0.000
#> SRR1791371 1 0.2692 0.6538 0.840 0.000 0.148 0.000 0.012 0.000
#> SRR1791368 4 0.0603 0.8666 0.016 0.004 0.000 0.980 0.000 0.000
#> SRR1791366 6 0.6978 -0.2098 0.000 0.252 0.060 0.000 0.344 0.344
#> SRR1791364 1 0.0405 0.7629 0.988 0.000 0.008 0.004 0.000 0.000
#> SRR1791367 1 0.2768 0.6452 0.832 0.000 0.156 0.000 0.012 0.000
#> SRR1791363 4 0.0603 0.8661 0.016 0.000 0.000 0.980 0.004 0.000
#> SRR1791361 4 0.1245 0.8573 0.016 0.000 0.032 0.952 0.000 0.000
#> SRR1791360 3 0.5752 0.6376 0.148 0.000 0.632 0.164 0.056 0.000
#> SRR1791359 5 0.5931 0.2429 0.000 0.372 0.132 0.012 0.480 0.004
#> SRR1791358 6 0.0146 0.8941 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1791365 2 0.4562 0.7470 0.000 0.704 0.024 0.000 0.048 0.224
#> SRR1791357 1 0.0146 0.7640 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791356 1 0.0909 0.7495 0.968 0.000 0.020 0.000 0.012 0.000
#> SRR1791355 2 0.2958 0.8358 0.000 0.852 0.028 0.000 0.012 0.108
#> SRR1791362 4 0.3778 0.5874 0.016 0.000 0.288 0.696 0.000 0.000
#> SRR1791354 5 0.5931 0.2429 0.000 0.372 0.132 0.012 0.480 0.004
#> SRR1791353 4 0.0748 0.8654 0.016 0.000 0.004 0.976 0.004 0.000
#> SRR1791352 1 0.0146 0.7640 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791349 2 0.4085 0.8202 0.000 0.784 0.028 0.000 0.076 0.112
#> SRR1791348 1 0.3555 0.5387 0.712 0.000 0.280 0.008 0.000 0.000
#> SRR1791351 6 0.0146 0.8941 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1791350 4 0.4079 0.5663 0.032 0.000 0.288 0.680 0.000 0.000
#> SRR1791339 5 0.2009 0.6397 0.000 0.068 0.024 0.000 0.908 0.000
#> SRR1791338 6 0.1816 0.8788 0.000 0.016 0.048 0.004 0.004 0.928
#> SRR1791336 6 0.1816 0.8788 0.000 0.016 0.048 0.004 0.004 0.928
#> SRR1791337 2 0.4765 0.4951 0.000 0.672 0.244 0.012 0.072 0.000
#> SRR1791335 6 0.3047 0.8101 0.000 0.092 0.048 0.004 0.004 0.852
#> SRR1791332 4 0.0748 0.8662 0.016 0.004 0.000 0.976 0.004 0.000
#> SRR1791331 5 0.1858 0.6464 0.000 0.092 0.000 0.000 0.904 0.004
#> SRR1791330 4 0.3018 0.7565 0.012 0.004 0.168 0.816 0.000 0.000
#> SRR1791334 1 0.3789 0.4630 0.660 0.000 0.332 0.008 0.000 0.000
#> SRR1791328 4 0.1492 0.8399 0.000 0.000 0.036 0.940 0.024 0.000
#> SRR1791327 6 0.0146 0.8941 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1791333 3 0.6172 0.6393 0.112 0.000 0.600 0.168 0.120 0.000
#> SRR1791326 6 0.0260 0.8933 0.000 0.000 0.008 0.000 0.000 0.992
#> SRR1791324 2 0.4168 0.8137 0.000 0.764 0.016 0.000 0.076 0.144
#> SRR1791323 6 0.0260 0.8933 0.000 0.000 0.008 0.000 0.000 0.992
#> SRR1791322 5 0.5904 0.2766 0.000 0.356 0.132 0.012 0.496 0.004
#> SRR1791329 2 0.3381 0.8252 0.000 0.808 0.004 0.000 0.040 0.148
#> SRR1791321 1 0.3741 0.4831 0.672 0.000 0.320 0.008 0.000 0.000
#> SRR1791320 5 0.2255 0.6579 0.000 0.004 0.016 0.088 0.892 0.000
#> SRR1791325 3 0.5396 0.6765 0.128 0.052 0.672 0.000 0.148 0.000
#> SRR1791318 1 0.0146 0.7640 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791317 2 0.4094 0.7526 0.000 0.804 0.088 0.012 0.044 0.052
#> SRR1791313 1 0.0405 0.7629 0.988 0.000 0.008 0.004 0.000 0.000
#> SRR1791312 1 0.3584 0.5203 0.688 0.000 0.308 0.004 0.000 0.000
#> SRR1791319 1 0.5495 0.1431 0.536 0.052 0.372 0.000 0.040 0.000
#> SRR1791316 1 0.0146 0.7640 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791315 1 0.0146 0.7640 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791311 4 0.4146 0.5595 0.036 0.000 0.288 0.676 0.000 0.000
#> SRR1791314 6 0.0146 0.8931 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1791310 5 0.2051 0.6642 0.000 0.004 0.000 0.096 0.896 0.004
#> SRR1791308 2 0.3560 0.8213 0.000 0.816 0.056 0.004 0.008 0.116
#> SRR1791307 4 0.0458 0.8666 0.016 0.000 0.000 0.984 0.000 0.000
#> SRR1791306 4 0.0458 0.8666 0.016 0.000 0.000 0.984 0.000 0.000
#> SRR1791305 2 0.4085 0.8202 0.000 0.784 0.028 0.000 0.076 0.112
#> SRR1791309 2 0.5182 0.6951 0.000 0.712 0.148 0.012 0.072 0.056
#> SRR1791304 1 0.0146 0.7640 0.996 0.000 0.000 0.004 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.990 0.995 0.5035 0.496 0.496
#> 3 3 0.918 0.905 0.953 0.3064 0.775 0.574
#> 4 4 0.763 0.679 0.832 0.1088 0.851 0.600
#> 5 5 0.842 0.827 0.917 0.0530 0.904 0.674
#> 6 6 0.837 0.623 0.856 0.0355 0.948 0.799
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1791347 2 0.000 0.992 0.000 1.000
#> SRR1791346 2 0.000 0.992 0.000 1.000
#> SRR1791345 1 0.000 0.998 1.000 0.000
#> SRR1791344 2 0.388 0.915 0.076 0.924
#> SRR1791343 2 0.000 0.992 0.000 1.000
#> SRR1791341 1 0.000 0.998 1.000 0.000
#> SRR1791342 1 0.373 0.922 0.928 0.072
#> SRR1791340 2 0.000 0.992 0.000 1.000
#> SRR1791375 1 0.000 0.998 1.000 0.000
#> SRR1791374 1 0.000 0.998 1.000 0.000
#> SRR1791372 1 0.000 0.998 1.000 0.000
#> SRR1791370 2 0.706 0.765 0.192 0.808
#> SRR1791373 1 0.000 0.998 1.000 0.000
#> SRR1791369 1 0.000 0.998 1.000 0.000
#> SRR1791371 1 0.000 0.998 1.000 0.000
#> SRR1791368 1 0.000 0.998 1.000 0.000
#> SRR1791366 2 0.000 0.992 0.000 1.000
#> SRR1791364 1 0.000 0.998 1.000 0.000
#> SRR1791367 1 0.000 0.998 1.000 0.000
#> SRR1791363 1 0.000 0.998 1.000 0.000
#> SRR1791361 1 0.000 0.998 1.000 0.000
#> SRR1791360 1 0.000 0.998 1.000 0.000
#> SRR1791359 2 0.000 0.992 0.000 1.000
#> SRR1791358 2 0.000 0.992 0.000 1.000
#> SRR1791365 2 0.000 0.992 0.000 1.000
#> SRR1791357 1 0.000 0.998 1.000 0.000
#> SRR1791356 1 0.000 0.998 1.000 0.000
#> SRR1791355 2 0.000 0.992 0.000 1.000
#> SRR1791362 1 0.000 0.998 1.000 0.000
#> SRR1791354 2 0.000 0.992 0.000 1.000
#> SRR1791353 1 0.000 0.998 1.000 0.000
#> SRR1791352 1 0.000 0.998 1.000 0.000
#> SRR1791349 2 0.000 0.992 0.000 1.000
#> SRR1791348 1 0.000 0.998 1.000 0.000
#> SRR1791351 2 0.000 0.992 0.000 1.000
#> SRR1791350 1 0.000 0.998 1.000 0.000
#> SRR1791339 2 0.000 0.992 0.000 1.000
#> SRR1791338 2 0.000 0.992 0.000 1.000
#> SRR1791336 2 0.000 0.992 0.000 1.000
#> SRR1791337 2 0.000 0.992 0.000 1.000
#> SRR1791335 2 0.000 0.992 0.000 1.000
#> SRR1791332 1 0.000 0.998 1.000 0.000
#> SRR1791331 2 0.000 0.992 0.000 1.000
#> SRR1791330 1 0.000 0.998 1.000 0.000
#> SRR1791334 1 0.000 0.998 1.000 0.000
#> SRR1791328 1 0.000 0.998 1.000 0.000
#> SRR1791327 2 0.000 0.992 0.000 1.000
#> SRR1791333 1 0.000 0.998 1.000 0.000
#> SRR1791326 2 0.000 0.992 0.000 1.000
#> SRR1791324 2 0.000 0.992 0.000 1.000
#> SRR1791323 2 0.000 0.992 0.000 1.000
#> SRR1791322 2 0.000 0.992 0.000 1.000
#> SRR1791329 2 0.000 0.992 0.000 1.000
#> SRR1791321 1 0.000 0.998 1.000 0.000
#> SRR1791320 2 0.000 0.992 0.000 1.000
#> SRR1791325 1 0.000 0.998 1.000 0.000
#> SRR1791318 1 0.000 0.998 1.000 0.000
#> SRR1791317 2 0.000 0.992 0.000 1.000
#> SRR1791313 1 0.000 0.998 1.000 0.000
#> SRR1791312 1 0.000 0.998 1.000 0.000
#> SRR1791319 1 0.000 0.998 1.000 0.000
#> SRR1791316 1 0.000 0.998 1.000 0.000
#> SRR1791315 1 0.000 0.998 1.000 0.000
#> SRR1791311 1 0.000 0.998 1.000 0.000
#> SRR1791314 2 0.000 0.992 0.000 1.000
#> SRR1791310 2 0.000 0.992 0.000 1.000
#> SRR1791308 2 0.000 0.992 0.000 1.000
#> SRR1791307 1 0.000 0.998 1.000 0.000
#> SRR1791306 1 0.000 0.998 1.000 0.000
#> SRR1791305 2 0.000 0.992 0.000 1.000
#> SRR1791309 2 0.000 0.992 0.000 1.000
#> SRR1791304 1 0.000 0.998 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.613 0.416 0.000 0.400 0.600
#> SRR1791346 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791345 1 0.271 0.876 0.912 0.000 0.088
#> SRR1791344 3 0.455 0.727 0.000 0.200 0.800
#> SRR1791343 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791341 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791342 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791340 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791375 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791374 1 0.129 0.930 0.968 0.000 0.032
#> SRR1791372 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791370 1 0.506 0.767 0.820 0.148 0.032
#> SRR1791373 1 0.129 0.930 0.968 0.000 0.032
#> SRR1791369 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791371 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791368 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791366 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791364 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791367 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791363 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791361 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791360 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791359 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791358 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791365 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791357 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791356 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791355 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791362 3 0.153 0.879 0.040 0.000 0.960
#> SRR1791354 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791353 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791352 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791349 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791348 1 0.129 0.927 0.968 0.000 0.032
#> SRR1791351 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791350 3 0.536 0.558 0.276 0.000 0.724
#> SRR1791339 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791338 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791336 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791337 2 0.129 0.967 0.000 0.968 0.032
#> SRR1791335 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791332 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791331 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791330 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791334 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791328 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791327 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791333 1 0.583 0.502 0.660 0.000 0.340
#> SRR1791326 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791324 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791323 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791322 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791329 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791321 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791320 3 0.613 0.416 0.000 0.400 0.600
#> SRR1791325 1 0.129 0.930 0.968 0.000 0.032
#> SRR1791318 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791317 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791313 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791312 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791319 1 0.129 0.930 0.968 0.000 0.032
#> SRR1791316 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791315 1 0.000 0.949 1.000 0.000 0.000
#> SRR1791311 1 0.624 0.251 0.560 0.000 0.440
#> SRR1791314 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791310 3 0.613 0.416 0.000 0.400 0.600
#> SRR1791308 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791307 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791306 3 0.129 0.885 0.032 0.000 0.968
#> SRR1791305 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791309 2 0.000 0.999 0.000 1.000 0.000
#> SRR1791304 1 0.000 0.949 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 2 0.4431 0.166 0.000 0.696 0.000 0.304
#> SRR1791346 3 0.3074 0.614 0.000 0.152 0.848 0.000
#> SRR1791345 1 0.2530 0.863 0.888 0.000 0.000 0.112
#> SRR1791344 2 0.4866 -0.113 0.000 0.596 0.000 0.404
#> SRR1791343 3 0.4985 -0.313 0.000 0.468 0.532 0.000
#> SRR1791341 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791342 4 0.4382 0.649 0.000 0.296 0.000 0.704
#> SRR1791340 2 0.4972 0.405 0.000 0.544 0.456 0.000
#> SRR1791375 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791374 1 0.0707 0.950 0.980 0.000 0.020 0.000
#> SRR1791372 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791370 3 0.3726 0.444 0.212 0.000 0.788 0.000
#> SRR1791373 1 0.0707 0.950 0.980 0.000 0.020 0.000
#> SRR1791369 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791371 1 0.0000 0.960 1.000 0.000 0.000 0.000
#> SRR1791368 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791366 2 0.4543 0.504 0.000 0.676 0.324 0.000
#> SRR1791364 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791367 1 0.0000 0.960 1.000 0.000 0.000 0.000
#> SRR1791363 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791361 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791360 1 0.2589 0.856 0.884 0.000 0.000 0.116
#> SRR1791359 3 0.1716 0.722 0.000 0.064 0.936 0.000
#> SRR1791358 2 0.4543 0.504 0.000 0.676 0.324 0.000
#> SRR1791365 2 0.4981 0.402 0.000 0.536 0.464 0.000
#> SRR1791357 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791356 1 0.0000 0.960 1.000 0.000 0.000 0.000
#> SRR1791355 3 0.4981 -0.301 0.000 0.464 0.536 0.000
#> SRR1791362 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791354 3 0.1716 0.722 0.000 0.064 0.936 0.000
#> SRR1791353 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791352 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791349 2 0.4981 0.402 0.000 0.536 0.464 0.000
#> SRR1791348 1 0.0592 0.954 0.984 0.000 0.000 0.016
#> SRR1791351 2 0.4543 0.504 0.000 0.676 0.324 0.000
#> SRR1791350 4 0.2814 0.821 0.132 0.000 0.000 0.868
#> SRR1791339 2 0.0188 0.397 0.000 0.996 0.004 0.000
#> SRR1791338 2 0.4981 0.402 0.000 0.536 0.464 0.000
#> SRR1791336 2 0.4981 0.402 0.000 0.536 0.464 0.000
#> SRR1791337 3 0.0000 0.706 0.000 0.000 1.000 0.000
#> SRR1791335 2 0.4981 0.402 0.000 0.536 0.464 0.000
#> SRR1791332 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791331 2 0.0000 0.395 0.000 1.000 0.000 0.000
#> SRR1791330 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791334 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791328 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791327 2 0.4543 0.504 0.000 0.676 0.324 0.000
#> SRR1791333 1 0.4967 0.154 0.548 0.000 0.000 0.452
#> SRR1791326 2 0.4543 0.504 0.000 0.676 0.324 0.000
#> SRR1791324 2 0.4981 0.402 0.000 0.536 0.464 0.000
#> SRR1791323 2 0.0188 0.397 0.000 0.996 0.004 0.000
#> SRR1791322 3 0.1792 0.720 0.000 0.068 0.932 0.000
#> SRR1791329 2 0.4981 0.402 0.000 0.536 0.464 0.000
#> SRR1791321 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791320 2 0.4431 0.166 0.000 0.696 0.000 0.304
#> SRR1791325 1 0.2011 0.907 0.920 0.000 0.080 0.000
#> SRR1791318 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791317 3 0.0707 0.720 0.000 0.020 0.980 0.000
#> SRR1791313 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791312 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791319 1 0.0707 0.950 0.980 0.000 0.020 0.000
#> SRR1791316 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791315 1 0.0188 0.962 0.996 0.000 0.000 0.004
#> SRR1791311 4 0.4382 0.550 0.296 0.000 0.000 0.704
#> SRR1791314 2 0.4564 0.502 0.000 0.672 0.328 0.000
#> SRR1791310 2 0.4431 0.166 0.000 0.696 0.000 0.304
#> SRR1791308 3 0.3074 0.614 0.000 0.152 0.848 0.000
#> SRR1791307 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791306 4 0.0336 0.943 0.008 0.000 0.000 0.992
#> SRR1791305 2 0.4981 0.402 0.000 0.536 0.464 0.000
#> SRR1791309 3 0.0817 0.722 0.000 0.024 0.976 0.000
#> SRR1791304 1 0.0188 0.962 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
#> SRR1791347 5 0.0992 0.7799 0.000 0.008 0.000 0.024 0.968
#> SRR1791346 2 0.3999 0.4705 0.000 0.656 0.344 0.000 0.000
#> SRR1791345 1 0.3757 0.8132 0.816 0.000 0.040 0.136 0.008
#> SRR1791344 5 0.1251 0.7792 0.000 0.008 0.000 0.036 0.956
#> SRR1791343 2 0.2813 0.7526 0.000 0.832 0.168 0.000 0.000
#> SRR1791341 4 0.0000 0.9367 0.000 0.000 0.000 1.000 0.000
#> SRR1791342 5 0.1908 0.7347 0.000 0.000 0.000 0.092 0.908
#> SRR1791340 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791375 4 0.0510 0.9312 0.000 0.000 0.000 0.984 0.016
#> SRR1791374 1 0.2777 0.8557 0.864 0.000 0.120 0.000 0.016
#> SRR1791372 1 0.0579 0.9347 0.984 0.000 0.000 0.008 0.008
#> SRR1791370 3 0.0000 0.7050 0.000 0.000 1.000 0.000 0.000
#> SRR1791373 1 0.2777 0.8557 0.864 0.000 0.120 0.000 0.016
#> SRR1791369 1 0.0693 0.9335 0.980 0.000 0.000 0.008 0.012
#> SRR1791371 1 0.0162 0.9324 0.996 0.000 0.000 0.000 0.004
#> SRR1791368 4 0.0000 0.9367 0.000 0.000 0.000 1.000 0.000
#> SRR1791366 2 0.0162 0.9035 0.000 0.996 0.000 0.000 0.004
#> SRR1791364 1 0.0451 0.9351 0.988 0.000 0.000 0.008 0.004
#> SRR1791367 1 0.0162 0.9324 0.996 0.000 0.000 0.000 0.004
#> SRR1791363 4 0.0290 0.9351 0.000 0.000 0.000 0.992 0.008
#> SRR1791361 4 0.0000 0.9367 0.000 0.000 0.000 1.000 0.000
#> SRR1791360 1 0.4511 0.4055 0.628 0.000 0.000 0.356 0.016
#> SRR1791359 3 0.4025 0.8035 0.000 0.292 0.700 0.000 0.008
#> SRR1791358 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.0162 0.9345 0.996 0.000 0.000 0.004 0.000
#> SRR1791356 1 0.0162 0.9324 0.996 0.000 0.000 0.000 0.004
#> SRR1791355 2 0.2891 0.7449 0.000 0.824 0.176 0.000 0.000
#> SRR1791362 4 0.0671 0.9253 0.004 0.000 0.000 0.980 0.016
#> SRR1791354 3 0.4003 0.8060 0.000 0.288 0.704 0.000 0.008
#> SRR1791353 4 0.0404 0.9333 0.000 0.000 0.000 0.988 0.012
#> SRR1791352 1 0.0324 0.9338 0.992 0.000 0.000 0.004 0.004
#> SRR1791349 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791348 1 0.2305 0.8736 0.896 0.000 0.000 0.092 0.012
#> SRR1791351 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 4 0.2046 0.8714 0.068 0.000 0.000 0.916 0.016
#> SRR1791339 5 0.4273 0.2634 0.000 0.448 0.000 0.000 0.552
#> SRR1791338 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791336 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791337 3 0.0162 0.7034 0.000 0.000 0.996 0.000 0.004
#> SRR1791335 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 4 0.0162 0.9363 0.000 0.000 0.000 0.996 0.004
#> SRR1791331 5 0.4182 0.3901 0.000 0.400 0.000 0.000 0.600
#> SRR1791330 4 0.0000 0.9367 0.000 0.000 0.000 1.000 0.000
#> SRR1791334 1 0.1211 0.9246 0.960 0.000 0.000 0.024 0.016
#> SRR1791328 4 0.0510 0.9312 0.000 0.000 0.000 0.984 0.016
#> SRR1791327 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 4 0.4689 0.2302 0.424 0.000 0.000 0.560 0.016
#> SRR1791326 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.4256 -0.0291 0.000 0.564 0.000 0.000 0.436
#> SRR1791322 3 0.4025 0.8035 0.000 0.292 0.700 0.000 0.008
#> SRR1791329 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 1 0.0912 0.9307 0.972 0.000 0.000 0.012 0.016
#> SRR1791320 5 0.1195 0.7823 0.000 0.012 0.000 0.028 0.960
#> SRR1791325 1 0.3550 0.7966 0.796 0.000 0.184 0.000 0.020
#> SRR1791318 1 0.0290 0.9351 0.992 0.000 0.000 0.008 0.000
#> SRR1791317 3 0.2329 0.7792 0.000 0.124 0.876 0.000 0.000
#> SRR1791313 1 0.0579 0.9347 0.984 0.000 0.000 0.008 0.008
#> SRR1791312 1 0.0579 0.9347 0.984 0.000 0.000 0.008 0.008
#> SRR1791319 1 0.2777 0.8557 0.864 0.000 0.120 0.000 0.016
#> SRR1791316 1 0.0290 0.9351 0.992 0.000 0.000 0.008 0.000
#> SRR1791315 1 0.0579 0.9347 0.984 0.000 0.000 0.008 0.008
#> SRR1791311 4 0.2293 0.8547 0.084 0.000 0.000 0.900 0.016
#> SRR1791314 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.1106 0.7814 0.000 0.012 0.000 0.024 0.964
#> SRR1791308 2 0.3837 0.5437 0.000 0.692 0.308 0.000 0.000
#> SRR1791307 4 0.0162 0.9363 0.000 0.000 0.000 0.996 0.004
#> SRR1791306 4 0.0000 0.9367 0.000 0.000 0.000 1.000 0.000
#> SRR1791305 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> SRR1791309 3 0.3491 0.8154 0.000 0.228 0.768 0.000 0.004
#> SRR1791304 1 0.0290 0.9351 0.992 0.000 0.000 0.008 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.0632 0.9657 0.000 0.000 0.000 0.024 0.976 0.000
#> SRR1791346 3 0.4097 -0.3217 0.000 0.008 0.500 0.000 0.000 0.492
#> SRR1791345 1 0.4785 0.0496 0.696 0.196 0.008 0.096 0.004 0.000
#> SRR1791344 5 0.1007 0.9619 0.000 0.000 0.000 0.044 0.956 0.000
#> SRR1791343 6 0.4051 0.3489 0.000 0.008 0.432 0.000 0.000 0.560
#> SRR1791341 4 0.0291 0.9247 0.000 0.004 0.000 0.992 0.004 0.000
#> SRR1791342 5 0.1806 0.9182 0.000 0.000 0.004 0.088 0.908 0.000
#> SRR1791340 6 0.0622 0.8437 0.000 0.008 0.012 0.000 0.000 0.980
#> SRR1791375 4 0.1219 0.8997 0.000 0.000 0.004 0.948 0.048 0.000
#> SRR1791374 1 0.3854 -0.8166 0.536 0.464 0.000 0.000 0.000 0.000
#> SRR1791372 1 0.0291 0.6853 0.992 0.000 0.000 0.004 0.004 0.000
#> SRR1791370 3 0.3899 0.6106 0.000 0.364 0.628 0.000 0.008 0.000
#> SRR1791373 1 0.3867 -0.8756 0.512 0.488 0.000 0.000 0.000 0.000
#> SRR1791369 1 0.1194 0.6682 0.956 0.032 0.000 0.008 0.004 0.000
#> SRR1791371 1 0.2378 0.4894 0.848 0.152 0.000 0.000 0.000 0.000
#> SRR1791368 4 0.0291 0.9247 0.000 0.004 0.000 0.992 0.004 0.000
#> SRR1791366 6 0.1515 0.8258 0.000 0.028 0.020 0.000 0.008 0.944
#> SRR1791364 1 0.0603 0.6841 0.980 0.016 0.000 0.004 0.000 0.000
#> SRR1791367 1 0.2491 0.4616 0.836 0.164 0.000 0.000 0.000 0.000
#> SRR1791363 4 0.0713 0.9164 0.000 0.000 0.000 0.972 0.028 0.000
#> SRR1791361 4 0.0405 0.9240 0.000 0.008 0.000 0.988 0.004 0.000
#> SRR1791360 1 0.4673 0.2519 0.672 0.052 0.000 0.260 0.016 0.000
#> SRR1791359 3 0.5359 0.6710 0.000 0.360 0.544 0.000 0.012 0.084
#> SRR1791358 6 0.0622 0.8437 0.000 0.008 0.012 0.000 0.000 0.980
#> SRR1791365 6 0.0291 0.8465 0.000 0.004 0.004 0.000 0.000 0.992
#> SRR1791357 1 0.0865 0.6719 0.964 0.036 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.2454 0.4719 0.840 0.160 0.000 0.000 0.000 0.000
#> SRR1791355 6 0.4051 0.3489 0.000 0.008 0.432 0.000 0.000 0.560
#> SRR1791362 4 0.2058 0.8706 0.024 0.048 0.000 0.916 0.012 0.000
#> SRR1791354 3 0.5316 0.6718 0.000 0.360 0.548 0.000 0.012 0.080
#> SRR1791353 4 0.0713 0.9164 0.000 0.000 0.000 0.972 0.028 0.000
#> SRR1791352 1 0.1007 0.6644 0.956 0.044 0.000 0.000 0.000 0.000
#> SRR1791349 6 0.0520 0.8447 0.000 0.008 0.008 0.000 0.000 0.984
#> SRR1791348 1 0.1692 0.6510 0.932 0.048 0.000 0.012 0.008 0.000
#> SRR1791351 6 0.0622 0.8437 0.000 0.008 0.012 0.000 0.000 0.980
#> SRR1791350 4 0.4151 0.6855 0.192 0.052 0.000 0.744 0.012 0.000
#> SRR1791339 6 0.5326 0.3247 0.000 0.052 0.028 0.000 0.380 0.540
#> SRR1791338 6 0.0363 0.8457 0.000 0.000 0.012 0.000 0.000 0.988
#> SRR1791336 6 0.0363 0.8457 0.000 0.000 0.012 0.000 0.000 0.988
#> SRR1791337 3 0.2135 0.5218 0.000 0.128 0.872 0.000 0.000 0.000
#> SRR1791335 6 0.0363 0.8457 0.000 0.000 0.012 0.000 0.000 0.988
#> SRR1791332 4 0.0260 0.9238 0.000 0.000 0.000 0.992 0.008 0.000
#> SRR1791331 6 0.4284 0.4113 0.000 0.008 0.012 0.000 0.384 0.596
#> SRR1791330 4 0.0146 0.9239 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR1791334 1 0.2137 0.6269 0.912 0.048 0.000 0.028 0.012 0.000
#> SRR1791328 4 0.0858 0.9149 0.000 0.000 0.004 0.968 0.028 0.000
#> SRR1791327 6 0.0622 0.8437 0.000 0.008 0.012 0.000 0.000 0.980
#> SRR1791333 1 0.4742 0.2134 0.644 0.052 0.000 0.292 0.012 0.000
#> SRR1791326 6 0.0725 0.8423 0.000 0.012 0.012 0.000 0.000 0.976
#> SRR1791324 6 0.0622 0.8436 0.000 0.008 0.012 0.000 0.000 0.980
#> SRR1791323 6 0.3562 0.6457 0.000 0.008 0.012 0.000 0.224 0.756
#> SRR1791322 3 0.5359 0.6710 0.000 0.360 0.544 0.000 0.012 0.084
#> SRR1791329 6 0.0806 0.8401 0.000 0.008 0.020 0.000 0.000 0.972
#> SRR1791321 1 0.1887 0.6406 0.924 0.048 0.000 0.016 0.012 0.000
#> SRR1791320 5 0.1418 0.9545 0.000 0.032 0.000 0.024 0.944 0.000
#> SRR1791325 2 0.4408 0.0000 0.468 0.512 0.012 0.000 0.008 0.000
#> SRR1791318 1 0.0547 0.6815 0.980 0.020 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.0692 0.5573 0.000 0.004 0.976 0.000 0.000 0.020
#> SRR1791313 1 0.0405 0.6850 0.988 0.000 0.000 0.008 0.004 0.000
#> SRR1791312 1 0.0665 0.6852 0.980 0.008 0.000 0.008 0.004 0.000
#> SRR1791319 1 0.3857 -0.8271 0.532 0.468 0.000 0.000 0.000 0.000
#> SRR1791316 1 0.0713 0.6776 0.972 0.028 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0146 0.6856 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR1791311 4 0.4565 0.5902 0.256 0.052 0.000 0.680 0.012 0.000
#> SRR1791314 6 0.0405 0.8464 0.000 0.008 0.004 0.000 0.000 0.988
#> SRR1791310 5 0.0632 0.9657 0.000 0.000 0.000 0.024 0.976 0.000
#> SRR1791308 6 0.4091 0.2584 0.000 0.008 0.472 0.000 0.000 0.520
#> SRR1791307 4 0.0146 0.9244 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR1791306 4 0.0146 0.9239 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR1791305 6 0.0146 0.8465 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1791309 3 0.5081 0.6735 0.000 0.356 0.568 0.000 0.008 0.068
#> SRR1791304 1 0.0632 0.6798 0.976 0.024 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 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 1.000 0.980 0.991 0.5051 0.495 0.495
#> 3 3 0.668 0.742 0.870 0.2720 0.830 0.668
#> 4 4 0.640 0.489 0.707 0.1278 0.771 0.480
#> 5 5 0.783 0.833 0.903 0.0938 0.808 0.440
#> 6 6 0.835 0.725 0.873 0.0397 0.971 0.859
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
#> SRR1791347 2 0.0376 0.981 0.004 0.996
#> SRR1791346 2 0.0000 0.984 0.000 1.000
#> SRR1791345 1 0.0000 0.997 1.000 0.000
#> SRR1791344 2 0.1633 0.963 0.024 0.976
#> SRR1791343 2 0.0000 0.984 0.000 1.000
#> SRR1791341 1 0.0000 0.997 1.000 0.000
#> SRR1791342 2 0.9286 0.489 0.344 0.656
#> SRR1791340 2 0.0000 0.984 0.000 1.000
#> SRR1791375 1 0.0000 0.997 1.000 0.000
#> SRR1791374 1 0.0000 0.997 1.000 0.000
#> SRR1791372 1 0.0000 0.997 1.000 0.000
#> SRR1791370 2 0.5946 0.830 0.144 0.856
#> SRR1791373 1 0.5178 0.866 0.884 0.116
#> SRR1791369 1 0.0000 0.997 1.000 0.000
#> SRR1791371 1 0.0000 0.997 1.000 0.000
#> SRR1791368 1 0.0000 0.997 1.000 0.000
#> SRR1791366 2 0.0000 0.984 0.000 1.000
#> SRR1791364 1 0.0000 0.997 1.000 0.000
#> SRR1791367 1 0.0000 0.997 1.000 0.000
#> SRR1791363 1 0.0000 0.997 1.000 0.000
#> SRR1791361 1 0.0000 0.997 1.000 0.000
#> SRR1791360 1 0.0000 0.997 1.000 0.000
#> SRR1791359 2 0.0000 0.984 0.000 1.000
#> SRR1791358 2 0.0000 0.984 0.000 1.000
#> SRR1791365 2 0.0000 0.984 0.000 1.000
#> SRR1791357 1 0.0000 0.997 1.000 0.000
#> SRR1791356 1 0.0000 0.997 1.000 0.000
#> SRR1791355 2 0.0000 0.984 0.000 1.000
#> SRR1791362 1 0.0000 0.997 1.000 0.000
#> SRR1791354 2 0.0000 0.984 0.000 1.000
#> SRR1791353 1 0.0000 0.997 1.000 0.000
#> SRR1791352 1 0.0000 0.997 1.000 0.000
#> SRR1791349 2 0.0000 0.984 0.000 1.000
#> SRR1791348 1 0.0000 0.997 1.000 0.000
#> SRR1791351 2 0.0000 0.984 0.000 1.000
#> SRR1791350 1 0.0000 0.997 1.000 0.000
#> SRR1791339 2 0.0000 0.984 0.000 1.000
#> SRR1791338 2 0.0000 0.984 0.000 1.000
#> SRR1791336 2 0.0000 0.984 0.000 1.000
#> SRR1791337 2 0.0000 0.984 0.000 1.000
#> SRR1791335 2 0.0000 0.984 0.000 1.000
#> SRR1791332 1 0.0000 0.997 1.000 0.000
#> SRR1791331 2 0.0000 0.984 0.000 1.000
#> SRR1791330 1 0.0000 0.997 1.000 0.000
#> SRR1791334 1 0.0000 0.997 1.000 0.000
#> SRR1791328 1 0.0000 0.997 1.000 0.000
#> SRR1791327 2 0.0000 0.984 0.000 1.000
#> SRR1791333 1 0.0000 0.997 1.000 0.000
#> SRR1791326 2 0.0000 0.984 0.000 1.000
#> SRR1791324 2 0.0000 0.984 0.000 1.000
#> SRR1791323 2 0.0000 0.984 0.000 1.000
#> SRR1791322 2 0.0000 0.984 0.000 1.000
#> SRR1791329 2 0.0000 0.984 0.000 1.000
#> SRR1791321 1 0.0000 0.997 1.000 0.000
#> SRR1791320 2 0.0000 0.984 0.000 1.000
#> SRR1791325 1 0.0000 0.997 1.000 0.000
#> SRR1791318 1 0.0000 0.997 1.000 0.000
#> SRR1791317 2 0.0000 0.984 0.000 1.000
#> SRR1791313 1 0.0000 0.997 1.000 0.000
#> SRR1791312 1 0.0000 0.997 1.000 0.000
#> SRR1791319 1 0.0000 0.997 1.000 0.000
#> SRR1791316 1 0.0000 0.997 1.000 0.000
#> SRR1791315 1 0.0000 0.997 1.000 0.000
#> SRR1791311 1 0.0000 0.997 1.000 0.000
#> SRR1791314 2 0.0000 0.984 0.000 1.000
#> SRR1791310 2 0.0000 0.984 0.000 1.000
#> SRR1791308 2 0.0000 0.984 0.000 1.000
#> SRR1791307 1 0.0000 0.997 1.000 0.000
#> SRR1791306 1 0.0000 0.997 1.000 0.000
#> SRR1791305 2 0.0000 0.984 0.000 1.000
#> SRR1791309 2 0.0000 0.984 0.000 1.000
#> SRR1791304 1 0.0000 0.997 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.0747 0.742 0.000 0.016 0.984
#> SRR1791346 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791345 1 0.4654 0.717 0.792 0.000 0.208
#> SRR1791344 3 0.0424 0.744 0.000 0.008 0.992
#> SRR1791343 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791341 1 0.4931 0.693 0.768 0.000 0.232
#> SRR1791342 3 0.0000 0.743 0.000 0.000 1.000
#> SRR1791340 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791375 3 0.5291 0.519 0.268 0.000 0.732
#> SRR1791374 1 0.1643 0.839 0.956 0.000 0.044
#> SRR1791372 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791370 3 0.0829 0.744 0.004 0.012 0.984
#> SRR1791373 1 0.4555 0.660 0.800 0.000 0.200
#> SRR1791369 1 0.0892 0.867 0.980 0.000 0.020
#> SRR1791371 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791368 1 0.4931 0.693 0.768 0.000 0.232
#> SRR1791366 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791364 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791363 3 0.6309 -0.110 0.500 0.000 0.500
#> SRR1791361 1 0.6295 0.129 0.528 0.000 0.472
#> SRR1791360 1 0.4931 0.693 0.768 0.000 0.232
#> SRR1791359 2 0.5810 0.750 0.000 0.664 0.336
#> SRR1791358 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791365 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791357 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791355 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791362 1 0.0892 0.867 0.980 0.000 0.020
#> SRR1791354 2 0.6140 0.646 0.000 0.596 0.404
#> SRR1791353 3 0.6180 0.204 0.416 0.000 0.584
#> SRR1791352 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791349 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791348 1 0.0892 0.867 0.980 0.000 0.020
#> SRR1791351 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791350 1 0.0892 0.867 0.980 0.000 0.020
#> SRR1791339 3 0.1411 0.722 0.000 0.036 0.964
#> SRR1791338 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791337 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791335 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791332 1 0.6111 0.375 0.604 0.000 0.396
#> SRR1791331 3 0.0892 0.739 0.000 0.020 0.980
#> SRR1791330 1 0.4931 0.693 0.768 0.000 0.232
#> SRR1791334 1 0.0892 0.867 0.980 0.000 0.020
#> SRR1791328 3 0.5291 0.519 0.268 0.000 0.732
#> SRR1791327 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791333 3 0.5926 0.320 0.356 0.000 0.644
#> SRR1791326 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791324 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791323 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791322 3 0.6026 -0.149 0.000 0.376 0.624
#> SRR1791329 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791321 1 0.0892 0.867 0.980 0.000 0.020
#> SRR1791320 3 0.0747 0.742 0.000 0.016 0.984
#> SRR1791325 1 0.6286 0.233 0.536 0.000 0.464
#> SRR1791318 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791317 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791313 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791312 1 0.0892 0.867 0.980 0.000 0.020
#> SRR1791319 1 0.0424 0.865 0.992 0.000 0.008
#> SRR1791316 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.868 1.000 0.000 0.000
#> SRR1791311 1 0.0892 0.867 0.980 0.000 0.020
#> SRR1791314 2 0.0000 0.837 0.000 1.000 0.000
#> SRR1791310 3 0.0892 0.739 0.000 0.020 0.980
#> SRR1791308 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791307 1 0.6095 0.386 0.608 0.000 0.392
#> SRR1791306 1 0.4654 0.719 0.792 0.000 0.208
#> SRR1791305 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791309 2 0.4750 0.877 0.000 0.784 0.216
#> SRR1791304 1 0.0000 0.868 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 3 0.4989 0.28041 0.000 0.000 0.528 0.472
#> SRR1791346 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791345 1 0.6966 0.54201 0.532 0.340 0.000 0.128
#> SRR1791344 4 0.7030 0.00991 0.000 0.120 0.408 0.472
#> SRR1791343 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791341 2 0.6917 -0.18302 0.144 0.568 0.000 0.288
#> SRR1791342 4 0.3975 0.54781 0.000 0.240 0.000 0.760
#> SRR1791340 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791375 4 0.4817 0.48583 0.000 0.388 0.000 0.612
#> SRR1791374 1 0.2345 0.68896 0.900 0.000 0.000 0.100
#> SRR1791372 1 0.0188 0.73203 0.996 0.004 0.000 0.000
#> SRR1791370 3 0.4978 0.42746 0.004 0.000 0.612 0.384
#> SRR1791373 1 0.3569 0.60181 0.804 0.000 0.000 0.196
#> SRR1791369 1 0.4761 0.62607 0.628 0.372 0.000 0.000
#> SRR1791371 1 0.0000 0.73029 1.000 0.000 0.000 0.000
#> SRR1791368 2 0.6917 -0.18302 0.144 0.568 0.000 0.288
#> SRR1791366 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791364 1 0.0188 0.73203 0.996 0.004 0.000 0.000
#> SRR1791367 1 0.0000 0.73029 1.000 0.000 0.000 0.000
#> SRR1791363 2 0.6189 -0.25068 0.060 0.568 0.000 0.372
#> SRR1791361 2 0.6253 -0.25067 0.064 0.564 0.000 0.372
#> SRR1791360 1 0.4941 0.59927 0.564 0.436 0.000 0.000
#> SRR1791359 3 0.3925 0.66400 0.000 0.016 0.808 0.176
#> SRR1791358 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791365 3 0.3751 0.54128 0.000 0.004 0.800 0.196
#> SRR1791357 1 0.0188 0.73203 0.996 0.004 0.000 0.000
#> SRR1791356 1 0.0000 0.73029 1.000 0.000 0.000 0.000
#> SRR1791355 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791362 1 0.4948 0.59602 0.560 0.440 0.000 0.000
#> SRR1791354 3 0.4434 0.61690 0.000 0.016 0.756 0.228
#> SRR1791353 2 0.6189 -0.25068 0.060 0.568 0.000 0.372
#> SRR1791352 1 0.0188 0.73203 0.996 0.004 0.000 0.000
#> SRR1791349 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791348 1 0.4941 0.59927 0.564 0.436 0.000 0.000
#> SRR1791351 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791350 1 0.4948 0.59602 0.560 0.440 0.000 0.000
#> SRR1791339 3 0.4985 0.28830 0.000 0.000 0.532 0.468
#> SRR1791338 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791336 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791337 3 0.0779 0.77764 0.004 0.016 0.980 0.000
#> SRR1791335 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791332 2 0.6189 -0.25068 0.060 0.568 0.000 0.372
#> SRR1791331 3 0.4989 0.28041 0.000 0.000 0.528 0.472
#> SRR1791330 1 0.4948 0.59602 0.560 0.440 0.000 0.000
#> SRR1791334 1 0.4941 0.59927 0.564 0.436 0.000 0.000
#> SRR1791328 4 0.4898 0.45538 0.000 0.416 0.000 0.584
#> SRR1791327 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791333 1 0.7795 0.31931 0.420 0.312 0.000 0.268
#> SRR1791326 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791324 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791323 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791322 3 0.5090 0.49785 0.000 0.016 0.660 0.324
#> SRR1791329 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791321 1 0.4941 0.59927 0.564 0.436 0.000 0.000
#> SRR1791320 4 0.7501 0.27700 0.000 0.196 0.332 0.472
#> SRR1791325 1 0.7449 0.47125 0.500 0.292 0.000 0.208
#> SRR1791318 1 0.0188 0.73203 0.996 0.004 0.000 0.000
#> SRR1791317 3 0.0592 0.77894 0.000 0.016 0.984 0.000
#> SRR1791313 1 0.0336 0.73085 0.992 0.008 0.000 0.000
#> SRR1791312 1 0.4941 0.59927 0.564 0.436 0.000 0.000
#> SRR1791319 1 0.0000 0.73029 1.000 0.000 0.000 0.000
#> SRR1791316 1 0.0188 0.73203 0.996 0.004 0.000 0.000
#> SRR1791315 1 0.0188 0.73203 0.996 0.004 0.000 0.000
#> SRR1791311 1 0.4948 0.59602 0.560 0.440 0.000 0.000
#> SRR1791314 2 0.7751 0.38784 0.000 0.416 0.344 0.240
#> SRR1791310 3 0.4989 0.28041 0.000 0.000 0.528 0.472
#> SRR1791308 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791307 2 0.6189 -0.25068 0.060 0.568 0.000 0.372
#> SRR1791306 2 0.6917 -0.18302 0.144 0.568 0.000 0.288
#> SRR1791305 3 0.0000 0.78235 0.000 0.000 1.000 0.000
#> SRR1791309 3 0.0592 0.77894 0.000 0.016 0.984 0.000
#> SRR1791304 1 0.0188 0.73203 0.996 0.004 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 5 0.0000 0.8236 0.000 0.000 0.000 0.000 1.000
#> SRR1791346 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791345 4 0.4916 0.6893 0.124 0.000 0.000 0.716 0.160
#> SRR1791344 5 0.0000 0.8236 0.000 0.000 0.000 0.000 1.000
#> SRR1791343 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791341 4 0.0000 0.8159 0.000 0.000 0.000 1.000 0.000
#> SRR1791342 5 0.0000 0.8236 0.000 0.000 0.000 0.000 1.000
#> SRR1791340 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791375 5 0.3876 0.4749 0.000 0.000 0.000 0.316 0.684
#> SRR1791374 1 0.3241 0.8278 0.832 0.000 0.000 0.024 0.144
#> SRR1791372 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791370 3 0.4305 0.0924 0.000 0.000 0.512 0.000 0.488
#> SRR1791373 1 0.3109 0.7504 0.800 0.000 0.000 0.000 0.200
#> SRR1791369 4 0.3366 0.7594 0.232 0.000 0.000 0.768 0.000
#> SRR1791371 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791368 4 0.0000 0.8159 0.000 0.000 0.000 1.000 0.000
#> SRR1791366 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791364 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791367 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791363 4 0.0000 0.8159 0.000 0.000 0.000 1.000 0.000
#> SRR1791361 4 0.4560 -0.0821 0.008 0.000 0.000 0.508 0.484
#> SRR1791360 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791359 3 0.0703 0.8889 0.024 0.000 0.976 0.000 0.000
#> SRR1791358 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 3 0.3707 0.6662 0.000 0.284 0.716 0.000 0.000
#> SRR1791357 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791356 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791355 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791362 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791354 3 0.0703 0.8889 0.024 0.000 0.976 0.000 0.000
#> SRR1791353 4 0.4126 0.1708 0.000 0.000 0.000 0.620 0.380
#> SRR1791352 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791349 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791348 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791351 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791339 5 0.2471 0.7168 0.000 0.000 0.136 0.000 0.864
#> SRR1791338 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791336 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791337 3 0.0703 0.8889 0.024 0.000 0.976 0.000 0.000
#> SRR1791335 2 0.0703 0.9749 0.000 0.976 0.024 0.000 0.000
#> SRR1791332 4 0.0000 0.8159 0.000 0.000 0.000 1.000 0.000
#> SRR1791331 5 0.0000 0.8236 0.000 0.000 0.000 0.000 1.000
#> SRR1791330 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791334 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791328 5 0.3039 0.6863 0.000 0.000 0.000 0.192 0.808
#> SRR1791327 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 5 0.4803 0.1547 0.020 0.000 0.000 0.444 0.536
#> SRR1791326 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791323 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.0865 0.8871 0.024 0.000 0.972 0.000 0.004
#> SRR1791329 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791321 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791320 5 0.0000 0.8236 0.000 0.000 0.000 0.000 1.000
#> SRR1791325 5 0.5575 0.3917 0.108 0.000 0.000 0.280 0.612
#> SRR1791318 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791317 3 0.0703 0.8889 0.024 0.000 0.976 0.000 0.000
#> SRR1791313 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791312 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791319 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791316 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791315 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
#> SRR1791311 4 0.2424 0.8556 0.132 0.000 0.000 0.868 0.000
#> SRR1791314 2 0.0000 0.9972 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.0000 0.8236 0.000 0.000 0.000 0.000 1.000
#> SRR1791308 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791307 4 0.0000 0.8159 0.000 0.000 0.000 1.000 0.000
#> SRR1791306 4 0.0000 0.8159 0.000 0.000 0.000 1.000 0.000
#> SRR1791305 3 0.1792 0.9110 0.000 0.084 0.916 0.000 0.000
#> SRR1791309 3 0.0703 0.8889 0.024 0.000 0.976 0.000 0.000
#> SRR1791304 1 0.0703 0.9732 0.976 0.000 0.000 0.024 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.0000 0.7822 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791346 2 0.0000 0.7489 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791345 4 0.4136 0.6243 0.004 0.000 0.080 0.748 0.168 0.000
#> SRR1791344 5 0.0000 0.7822 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791343 2 0.0000 0.7489 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791341 4 0.0713 0.8586 0.000 0.000 0.028 0.972 0.000 0.000
#> SRR1791342 5 0.0000 0.7822 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791340 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791375 5 0.3221 0.5473 0.000 0.000 0.000 0.264 0.736 0.000
#> SRR1791374 1 0.6228 -0.0732 0.456 0.000 0.360 0.028 0.156 0.000
#> SRR1791372 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791370 3 0.5839 0.2424 0.000 0.276 0.488 0.000 0.236 0.000
#> SRR1791373 3 0.7780 0.2339 0.296 0.120 0.360 0.024 0.200 0.000
#> SRR1791369 4 0.3175 0.6365 0.256 0.000 0.000 0.744 0.000 0.000
#> SRR1791371 1 0.2378 0.7833 0.848 0.000 0.152 0.000 0.000 0.000
#> SRR1791368 4 0.0713 0.8586 0.000 0.000 0.028 0.972 0.000 0.000
#> SRR1791366 2 0.2841 0.7548 0.000 0.824 0.164 0.000 0.000 0.012
#> SRR1791364 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.2378 0.7833 0.848 0.000 0.152 0.000 0.000 0.000
#> SRR1791363 4 0.0713 0.8586 0.000 0.000 0.028 0.972 0.000 0.000
#> SRR1791361 4 0.4569 0.0642 0.016 0.000 0.012 0.516 0.456 0.000
#> SRR1791360 4 0.0547 0.8652 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR1791359 2 0.3695 0.6727 0.000 0.624 0.376 0.000 0.000 0.000
#> SRR1791358 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791365 2 0.0937 0.7206 0.000 0.960 0.000 0.000 0.000 0.040
#> SRR1791357 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.2378 0.7833 0.848 0.000 0.152 0.000 0.000 0.000
#> SRR1791355 2 0.0000 0.7489 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791362 4 0.0547 0.8652 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR1791354 2 0.3695 0.6727 0.000 0.624 0.376 0.000 0.000 0.000
#> SRR1791353 4 0.4388 0.2143 0.000 0.000 0.028 0.572 0.400 0.000
#> SRR1791352 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791349 2 0.2491 0.7588 0.000 0.836 0.164 0.000 0.000 0.000
#> SRR1791348 4 0.0547 0.8652 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR1791351 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791350 4 0.0547 0.8652 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR1791339 5 0.2633 0.6270 0.000 0.032 0.104 0.000 0.864 0.000
#> SRR1791338 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791336 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791337 3 0.2793 0.3583 0.000 0.200 0.800 0.000 0.000 0.000
#> SRR1791335 6 0.2762 0.7305 0.000 0.196 0.000 0.000 0.000 0.804
#> SRR1791332 4 0.0713 0.8586 0.000 0.000 0.028 0.972 0.000 0.000
#> SRR1791331 5 0.0000 0.7822 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791330 4 0.0547 0.8652 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR1791334 4 0.0547 0.8652 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR1791328 5 0.3672 0.4972 0.000 0.000 0.008 0.304 0.688 0.000
#> SRR1791327 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 4 0.3727 0.3455 0.000 0.000 0.000 0.612 0.388 0.000
#> SRR1791326 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791324 2 0.2491 0.7588 0.000 0.836 0.164 0.000 0.000 0.000
#> SRR1791323 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791322 2 0.3934 0.6656 0.000 0.616 0.376 0.000 0.008 0.000
#> SRR1791329 2 0.0000 0.7489 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791321 4 0.0547 0.8652 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR1791320 5 0.0000 0.7822 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791325 5 0.6086 -0.1094 0.000 0.000 0.328 0.284 0.388 0.000
#> SRR1791318 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791317 2 0.3828 0.3334 0.000 0.560 0.440 0.000 0.000 0.000
#> SRR1791313 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791312 4 0.2562 0.7482 0.172 0.000 0.000 0.828 0.000 0.000
#> SRR1791319 1 0.3647 0.4730 0.640 0.000 0.360 0.000 0.000 0.000
#> SRR1791316 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1791311 4 0.0547 0.8652 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR1791314 6 0.0000 0.9737 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791310 5 0.0000 0.7822 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791308 2 0.3050 0.4988 0.000 0.764 0.236 0.000 0.000 0.000
#> SRR1791307 4 0.0713 0.8586 0.000 0.000 0.028 0.972 0.000 0.000
#> SRR1791306 4 0.0713 0.8586 0.000 0.000 0.028 0.972 0.000 0.000
#> SRR1791305 2 0.2491 0.7588 0.000 0.836 0.164 0.000 0.000 0.000
#> SRR1791309 2 0.3695 0.6727 0.000 0.624 0.376 0.000 0.000 0.000
#> SRR1791304 1 0.0000 0.8744 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 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.795 0.954 0.976 0.4974 0.503 0.503
#> 3 3 0.489 0.743 0.829 0.2151 0.852 0.720
#> 4 4 0.604 0.703 0.813 0.1257 0.749 0.495
#> 5 5 0.547 0.607 0.704 0.1015 0.878 0.657
#> 6 6 0.562 0.556 0.655 0.0551 0.881 0.563
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
#> SRR1791347 2 0.0000 0.959 0.000 1.000
#> SRR1791346 2 0.0000 0.959 0.000 1.000
#> SRR1791345 2 0.5408 0.879 0.124 0.876
#> SRR1791344 2 0.0000 0.959 0.000 1.000
#> SRR1791343 2 0.0000 0.959 0.000 1.000
#> SRR1791341 1 0.0938 0.992 0.988 0.012
#> SRR1791342 2 0.0000 0.959 0.000 1.000
#> SRR1791340 2 0.0000 0.959 0.000 1.000
#> SRR1791375 2 0.9866 0.312 0.432 0.568
#> SRR1791374 1 0.0000 0.994 1.000 0.000
#> SRR1791372 1 0.0000 0.994 1.000 0.000
#> SRR1791370 2 0.5408 0.879 0.124 0.876
#> SRR1791373 2 0.0000 0.959 0.000 1.000
#> SRR1791369 1 0.0000 0.994 1.000 0.000
#> SRR1791371 1 0.0000 0.994 1.000 0.000
#> SRR1791368 1 0.0938 0.992 0.988 0.012
#> SRR1791366 2 0.0000 0.959 0.000 1.000
#> SRR1791364 1 0.0000 0.994 1.000 0.000
#> SRR1791367 1 0.0000 0.994 1.000 0.000
#> SRR1791363 1 0.1184 0.989 0.984 0.016
#> SRR1791361 2 0.0000 0.959 0.000 1.000
#> SRR1791360 1 0.0938 0.992 0.988 0.012
#> SRR1791359 2 0.5408 0.879 0.124 0.876
#> SRR1791358 2 0.0000 0.959 0.000 1.000
#> SRR1791365 2 0.0000 0.959 0.000 1.000
#> SRR1791357 1 0.0000 0.994 1.000 0.000
#> SRR1791356 1 0.0000 0.994 1.000 0.000
#> SRR1791355 2 0.0000 0.959 0.000 1.000
#> SRR1791362 1 0.0938 0.992 0.988 0.012
#> SRR1791354 2 0.5408 0.879 0.124 0.876
#> SRR1791353 1 0.0938 0.992 0.988 0.012
#> SRR1791352 1 0.0000 0.994 1.000 0.000
#> SRR1791349 2 0.0000 0.959 0.000 1.000
#> SRR1791348 1 0.0000 0.994 1.000 0.000
#> SRR1791351 2 0.0000 0.959 0.000 1.000
#> SRR1791350 1 0.0938 0.992 0.988 0.012
#> SRR1791339 2 0.0000 0.959 0.000 1.000
#> SRR1791338 2 0.0000 0.959 0.000 1.000
#> SRR1791336 2 0.0000 0.959 0.000 1.000
#> SRR1791337 2 0.5408 0.879 0.124 0.876
#> SRR1791335 2 0.0000 0.959 0.000 1.000
#> SRR1791332 1 0.0938 0.992 0.988 0.012
#> SRR1791331 2 0.0000 0.959 0.000 1.000
#> SRR1791330 1 0.0938 0.992 0.988 0.012
#> SRR1791334 1 0.0938 0.992 0.988 0.012
#> SRR1791328 2 0.0000 0.959 0.000 1.000
#> SRR1791327 2 0.0000 0.959 0.000 1.000
#> SRR1791333 2 0.0000 0.959 0.000 1.000
#> SRR1791326 2 0.0000 0.959 0.000 1.000
#> SRR1791324 2 0.0000 0.959 0.000 1.000
#> SRR1791323 2 0.0000 0.959 0.000 1.000
#> SRR1791322 2 0.5408 0.879 0.124 0.876
#> SRR1791329 2 0.0000 0.959 0.000 1.000
#> SRR1791321 1 0.0938 0.992 0.988 0.012
#> SRR1791320 2 0.0000 0.959 0.000 1.000
#> SRR1791325 2 0.6247 0.844 0.156 0.844
#> SRR1791318 1 0.0000 0.994 1.000 0.000
#> SRR1791317 2 0.5408 0.879 0.124 0.876
#> SRR1791313 1 0.0000 0.994 1.000 0.000
#> SRR1791312 1 0.0000 0.994 1.000 0.000
#> SRR1791319 1 0.0000 0.994 1.000 0.000
#> SRR1791316 1 0.0000 0.994 1.000 0.000
#> SRR1791315 1 0.0000 0.994 1.000 0.000
#> SRR1791311 1 0.0938 0.992 0.988 0.012
#> SRR1791314 2 0.0000 0.959 0.000 1.000
#> SRR1791310 2 0.0000 0.959 0.000 1.000
#> SRR1791308 2 0.0000 0.959 0.000 1.000
#> SRR1791307 1 0.0938 0.992 0.988 0.012
#> SRR1791306 1 0.0938 0.992 0.988 0.012
#> SRR1791305 2 0.0000 0.959 0.000 1.000
#> SRR1791309 2 0.5408 0.879 0.124 0.876
#> SRR1791304 1 0.0000 0.994 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 2 0.4845 0.822 0.104 0.844 0.052
#> SRR1791346 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791345 2 0.7393 0.701 0.156 0.704 0.140
#> SRR1791344 2 0.4945 0.821 0.104 0.840 0.056
#> SRR1791343 2 0.0000 0.872 0.000 1.000 0.000
#> SRR1791341 1 0.0424 0.692 0.992 0.000 0.008
#> SRR1791342 2 0.4945 0.821 0.104 0.840 0.056
#> SRR1791340 2 0.0000 0.872 0.000 1.000 0.000
#> SRR1791375 2 0.8259 0.645 0.152 0.632 0.216
#> SRR1791374 1 0.5882 0.589 0.652 0.000 0.348
#> SRR1791372 3 0.4291 0.907 0.180 0.000 0.820
#> SRR1791370 2 0.8058 0.662 0.140 0.648 0.212
#> SRR1791373 2 0.4887 0.825 0.096 0.844 0.060
#> SRR1791369 1 0.5058 0.637 0.756 0.000 0.244
#> SRR1791371 1 0.5327 0.599 0.728 0.000 0.272
#> SRR1791368 1 0.0983 0.704 0.980 0.004 0.016
#> SRR1791366 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791364 3 0.4235 0.912 0.176 0.000 0.824
#> SRR1791367 1 0.5216 0.640 0.740 0.000 0.260
#> SRR1791363 1 0.0592 0.690 0.988 0.000 0.012
#> SRR1791361 1 0.7693 0.312 0.580 0.364 0.056
#> SRR1791360 1 0.7592 0.520 0.680 0.112 0.208
#> SRR1791359 2 0.8042 0.666 0.136 0.648 0.216
#> SRR1791358 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791365 2 0.0000 0.872 0.000 1.000 0.000
#> SRR1791357 3 0.6140 0.512 0.404 0.000 0.596
#> SRR1791356 1 0.5968 0.397 0.636 0.000 0.364
#> SRR1791355 2 0.0000 0.872 0.000 1.000 0.000
#> SRR1791362 1 0.3482 0.710 0.872 0.000 0.128
#> SRR1791354 2 0.8042 0.666 0.136 0.648 0.216
#> SRR1791353 1 0.0892 0.700 0.980 0.000 0.020
#> SRR1791352 3 0.4235 0.912 0.176 0.000 0.824
#> SRR1791349 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791348 1 0.4974 0.645 0.764 0.000 0.236
#> SRR1791351 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791350 1 0.3686 0.709 0.860 0.000 0.140
#> SRR1791339 2 0.4845 0.822 0.104 0.844 0.052
#> SRR1791338 2 0.0000 0.872 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.872 0.000 1.000 0.000
#> SRR1791337 2 0.8042 0.666 0.136 0.648 0.216
#> SRR1791335 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791332 1 0.0237 0.695 0.996 0.000 0.004
#> SRR1791331 2 0.4689 0.827 0.096 0.852 0.052
#> SRR1791330 1 0.3340 0.703 0.880 0.000 0.120
#> SRR1791334 1 0.3816 0.707 0.852 0.000 0.148
#> SRR1791328 1 0.7693 0.312 0.580 0.364 0.056
#> SRR1791327 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791333 1 0.7693 0.312 0.580 0.364 0.056
#> SRR1791326 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791324 2 0.0000 0.872 0.000 1.000 0.000
#> SRR1791323 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791322 2 0.8042 0.666 0.136 0.648 0.216
#> SRR1791329 2 0.0000 0.872 0.000 1.000 0.000
#> SRR1791321 1 0.3816 0.707 0.852 0.000 0.148
#> SRR1791320 2 0.4845 0.822 0.104 0.844 0.052
#> SRR1791325 2 0.8167 0.652 0.148 0.640 0.212
#> SRR1791318 3 0.4235 0.912 0.176 0.000 0.824
#> SRR1791317 2 0.8042 0.666 0.136 0.648 0.216
#> SRR1791313 3 0.4178 0.908 0.172 0.000 0.828
#> SRR1791312 1 0.4974 0.646 0.764 0.000 0.236
#> SRR1791319 1 0.6008 0.601 0.664 0.004 0.332
#> SRR1791316 3 0.5968 0.629 0.364 0.000 0.636
#> SRR1791315 3 0.4235 0.912 0.176 0.000 0.824
#> SRR1791311 1 0.3686 0.709 0.860 0.000 0.140
#> SRR1791314 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791310 2 0.4790 0.825 0.096 0.848 0.056
#> SRR1791308 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791307 1 0.0747 0.686 0.984 0.000 0.016
#> SRR1791306 1 0.1031 0.702 0.976 0.000 0.024
#> SRR1791305 2 0.0237 0.872 0.000 0.996 0.004
#> SRR1791309 2 0.8042 0.666 0.136 0.648 0.216
#> SRR1791304 3 0.4235 0.912 0.176 0.000 0.824
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.7936 0.395 0.260 0.272 0.008 0.460
#> SRR1791346 2 0.0657 0.907 0.004 0.984 0.012 0.000
#> SRR1791345 4 0.6341 0.551 0.008 0.192 0.124 0.676
#> SRR1791344 4 0.7936 0.395 0.260 0.272 0.008 0.460
#> SRR1791343 2 0.0804 0.906 0.012 0.980 0.008 0.000
#> SRR1791341 4 0.1940 0.623 0.076 0.000 0.000 0.924
#> SRR1791342 4 0.7937 0.400 0.264 0.268 0.008 0.460
#> SRR1791340 2 0.2921 0.865 0.140 0.860 0.000 0.000
#> SRR1791375 4 0.6881 0.560 0.056 0.088 0.184 0.672
#> SRR1791374 4 0.5100 0.531 0.168 0.000 0.076 0.756
#> SRR1791372 1 0.4454 0.963 0.692 0.000 0.000 0.308
#> SRR1791370 3 0.0524 0.990 0.000 0.008 0.988 0.004
#> SRR1791373 4 0.8000 0.343 0.224 0.308 0.012 0.456
#> SRR1791369 4 0.3583 0.494 0.180 0.000 0.004 0.816
#> SRR1791371 4 0.3975 0.424 0.240 0.000 0.000 0.760
#> SRR1791368 4 0.0592 0.622 0.016 0.000 0.000 0.984
#> SRR1791366 2 0.3681 0.842 0.176 0.816 0.008 0.000
#> SRR1791364 1 0.4406 0.971 0.700 0.000 0.000 0.300
#> SRR1791367 4 0.4399 0.475 0.212 0.000 0.020 0.768
#> SRR1791363 4 0.1940 0.623 0.076 0.000 0.000 0.924
#> SRR1791361 4 0.7525 0.446 0.276 0.232 0.000 0.492
#> SRR1791360 4 0.3634 0.599 0.048 0.000 0.096 0.856
#> SRR1791359 3 0.0188 0.996 0.000 0.000 0.996 0.004
#> SRR1791358 2 0.0376 0.907 0.004 0.992 0.004 0.000
#> SRR1791365 2 0.2480 0.887 0.088 0.904 0.008 0.000
#> SRR1791357 1 0.4877 0.776 0.592 0.000 0.000 0.408
#> SRR1791356 4 0.4250 0.360 0.276 0.000 0.000 0.724
#> SRR1791355 2 0.0469 0.908 0.000 0.988 0.012 0.000
#> SRR1791362 4 0.0779 0.616 0.016 0.000 0.004 0.980
#> SRR1791354 3 0.0188 0.996 0.000 0.000 0.996 0.004
#> SRR1791353 4 0.2587 0.627 0.076 0.012 0.004 0.908
#> SRR1791352 1 0.4406 0.971 0.700 0.000 0.000 0.300
#> SRR1791349 2 0.3636 0.845 0.172 0.820 0.008 0.000
#> SRR1791348 4 0.3157 0.525 0.144 0.000 0.004 0.852
#> SRR1791351 2 0.0376 0.907 0.004 0.992 0.004 0.000
#> SRR1791350 4 0.0188 0.620 0.004 0.000 0.000 0.996
#> SRR1791339 2 0.7912 -0.170 0.204 0.396 0.008 0.392
#> SRR1791338 2 0.0000 0.908 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.908 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.0524 0.990 0.000 0.008 0.988 0.004
#> SRR1791335 2 0.0188 0.908 0.004 0.996 0.000 0.000
#> SRR1791332 4 0.1940 0.623 0.076 0.000 0.000 0.924
#> SRR1791331 2 0.3484 0.859 0.144 0.844 0.008 0.004
#> SRR1791330 4 0.2741 0.615 0.000 0.012 0.096 0.892
#> SRR1791334 4 0.2412 0.594 0.084 0.000 0.008 0.908
#> SRR1791328 4 0.7536 0.437 0.264 0.244 0.000 0.492
#> SRR1791327 2 0.0376 0.907 0.004 0.992 0.004 0.000
#> SRR1791333 4 0.7527 0.373 0.216 0.300 0.000 0.484
#> SRR1791326 2 0.3219 0.852 0.164 0.836 0.000 0.000
#> SRR1791324 2 0.0657 0.907 0.004 0.984 0.012 0.000
#> SRR1791323 2 0.0376 0.907 0.004 0.992 0.004 0.000
#> SRR1791322 3 0.0188 0.996 0.000 0.000 0.996 0.004
#> SRR1791329 2 0.0469 0.908 0.000 0.988 0.012 0.000
#> SRR1791321 4 0.2412 0.594 0.084 0.000 0.008 0.908
#> SRR1791320 4 0.7845 0.324 0.208 0.324 0.008 0.460
#> SRR1791325 4 0.6685 0.513 0.000 0.160 0.224 0.616
#> SRR1791318 1 0.4406 0.971 0.700 0.000 0.000 0.300
#> SRR1791317 3 0.0188 0.996 0.000 0.000 0.996 0.004
#> SRR1791313 1 0.4406 0.971 0.700 0.000 0.000 0.300
#> SRR1791312 4 0.3688 0.476 0.208 0.000 0.000 0.792
#> SRR1791319 4 0.4979 0.527 0.176 0.000 0.064 0.760
#> SRR1791316 4 0.4994 -0.493 0.480 0.000 0.000 0.520
#> SRR1791315 1 0.4406 0.971 0.700 0.000 0.000 0.300
#> SRR1791311 4 0.0592 0.617 0.016 0.000 0.000 0.984
#> SRR1791314 2 0.0376 0.907 0.004 0.992 0.004 0.000
#> SRR1791310 2 0.3677 0.854 0.148 0.836 0.008 0.008
#> SRR1791308 2 0.0657 0.907 0.004 0.984 0.012 0.000
#> SRR1791307 4 0.1940 0.623 0.076 0.000 0.000 0.924
#> SRR1791306 4 0.0707 0.623 0.020 0.000 0.000 0.980
#> SRR1791305 2 0.3450 0.855 0.156 0.836 0.008 0.000
#> SRR1791309 3 0.0188 0.996 0.000 0.000 0.996 0.004
#> SRR1791304 1 0.4406 0.971 0.700 0.000 0.000 0.300
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 5 0.822 0.8384 0.276 0.212 0.092 0.012 0.408
#> SRR1791346 2 0.488 0.7005 0.000 0.768 0.112 0.056 0.064
#> SRR1791345 1 0.785 0.1173 0.512 0.124 0.256 0.064 0.044
#> SRR1791344 5 0.792 0.8551 0.280 0.220 0.092 0.000 0.408
#> SRR1791343 2 0.340 0.7091 0.000 0.848 0.072 0.004 0.076
#> SRR1791341 1 0.406 0.4465 0.640 0.000 0.000 0.000 0.360
#> SRR1791342 5 0.790 0.8527 0.284 0.212 0.092 0.000 0.412
#> SRR1791340 2 0.496 0.7132 0.000 0.680 0.000 0.072 0.248
#> SRR1791375 1 0.603 0.2164 0.556 0.012 0.336 0.000 0.096
#> SRR1791374 1 0.698 0.3911 0.540 0.000 0.204 0.212 0.044
#> SRR1791372 4 0.252 0.9068 0.140 0.000 0.000 0.860 0.000
#> SRR1791370 3 0.388 0.8089 0.120 0.004 0.824 0.032 0.020
#> SRR1791373 2 0.913 -0.6866 0.276 0.304 0.092 0.068 0.260
#> SRR1791369 1 0.428 0.4408 0.724 0.000 0.000 0.244 0.032
#> SRR1791371 1 0.460 0.1733 0.584 0.000 0.004 0.404 0.008
#> SRR1791368 1 0.405 0.4464 0.644 0.000 0.000 0.000 0.356
#> SRR1791366 2 0.606 0.6298 0.000 0.652 0.084 0.056 0.208
#> SRR1791364 4 0.256 0.9076 0.144 0.000 0.000 0.856 0.000
#> SRR1791367 1 0.515 0.3225 0.608 0.000 0.036 0.348 0.008
#> SRR1791363 1 0.393 0.4741 0.672 0.000 0.000 0.000 0.328
#> SRR1791361 5 0.660 0.6080 0.392 0.088 0.020 0.012 0.488
#> SRR1791360 1 0.570 0.4546 0.680 0.000 0.200 0.076 0.044
#> SRR1791359 3 0.000 0.9169 0.000 0.000 1.000 0.000 0.000
#> SRR1791358 2 0.296 0.7242 0.000 0.856 0.000 0.024 0.120
#> SRR1791365 2 0.133 0.7456 0.000 0.956 0.008 0.004 0.032
#> SRR1791357 4 0.345 0.8485 0.208 0.000 0.000 0.784 0.008
#> SRR1791356 4 0.452 0.2978 0.440 0.000 0.000 0.552 0.008
#> SRR1791355 2 0.227 0.7225 0.000 0.908 0.072 0.004 0.016
#> SRR1791362 1 0.234 0.5870 0.904 0.000 0.000 0.064 0.032
#> SRR1791354 3 0.000 0.9169 0.000 0.000 1.000 0.000 0.000
#> SRR1791353 1 0.260 0.5322 0.852 0.000 0.000 0.000 0.148
#> SRR1791352 4 0.256 0.9089 0.144 0.000 0.000 0.856 0.000
#> SRR1791349 2 0.597 0.6358 0.000 0.664 0.084 0.056 0.196
#> SRR1791348 1 0.410 0.4674 0.748 0.000 0.000 0.220 0.032
#> SRR1791351 2 0.296 0.7242 0.000 0.856 0.000 0.024 0.120
#> SRR1791350 1 0.212 0.5866 0.916 0.000 0.000 0.056 0.028
#> SRR1791339 5 0.802 0.8055 0.260 0.268 0.092 0.000 0.380
#> SRR1791338 2 0.470 0.7202 0.000 0.704 0.000 0.060 0.236
#> SRR1791336 2 0.467 0.7211 0.000 0.708 0.000 0.060 0.232
#> SRR1791337 3 0.367 0.8504 0.084 0.024 0.852 0.020 0.020
#> SRR1791335 2 0.310 0.7296 0.000 0.836 0.000 0.016 0.148
#> SRR1791332 1 0.405 0.4484 0.644 0.000 0.000 0.000 0.356
#> SRR1791331 2 0.554 0.5042 0.000 0.652 0.088 0.012 0.248
#> SRR1791330 1 0.531 0.5348 0.728 0.000 0.120 0.036 0.116
#> SRR1791334 1 0.281 0.5845 0.868 0.000 0.000 0.108 0.024
#> SRR1791328 5 0.637 0.6228 0.392 0.100 0.020 0.000 0.488
#> SRR1791327 2 0.296 0.7229 0.000 0.856 0.000 0.024 0.120
#> SRR1791333 1 0.738 -0.6963 0.416 0.116 0.052 0.012 0.404
#> SRR1791326 2 0.501 0.7125 0.000 0.676 0.000 0.076 0.248
#> SRR1791324 2 0.137 0.7382 0.000 0.952 0.040 0.004 0.004
#> SRR1791323 2 0.287 0.7245 0.000 0.860 0.000 0.020 0.120
#> SRR1791322 3 0.000 0.9169 0.000 0.000 1.000 0.000 0.000
#> SRR1791329 2 0.136 0.7361 0.000 0.948 0.048 0.004 0.000
#> SRR1791321 1 0.272 0.5837 0.872 0.000 0.000 0.108 0.020
#> SRR1791320 5 0.795 0.8523 0.276 0.232 0.092 0.000 0.400
#> SRR1791325 1 0.740 0.0467 0.472 0.100 0.356 0.032 0.040
#> SRR1791318 4 0.252 0.9088 0.140 0.000 0.000 0.860 0.000
#> SRR1791317 3 0.332 0.8345 0.004 0.104 0.856 0.020 0.016
#> SRR1791313 4 0.252 0.9088 0.140 0.000 0.000 0.860 0.000
#> SRR1791312 1 0.458 0.3687 0.672 0.000 0.000 0.296 0.032
#> SRR1791319 1 0.695 0.3985 0.544 0.000 0.188 0.224 0.044
#> SRR1791316 4 0.376 0.7861 0.248 0.000 0.000 0.744 0.008
#> SRR1791315 4 0.252 0.9088 0.140 0.000 0.000 0.860 0.000
#> SRR1791311 1 0.217 0.5876 0.912 0.000 0.000 0.064 0.024
#> SRR1791314 2 0.287 0.7236 0.000 0.860 0.000 0.020 0.120
#> SRR1791310 2 0.705 0.2713 0.068 0.572 0.092 0.016 0.252
#> SRR1791308 2 0.470 0.7107 0.000 0.780 0.108 0.048 0.064
#> SRR1791307 1 0.421 0.4491 0.636 0.004 0.000 0.000 0.360
#> SRR1791306 1 0.318 0.5421 0.792 0.000 0.000 0.000 0.208
#> SRR1791305 2 0.586 0.6455 0.000 0.672 0.076 0.056 0.196
#> SRR1791309 3 0.000 0.9169 0.000 0.000 1.000 0.000 0.000
#> SRR1791304 4 0.256 0.9089 0.144 0.000 0.000 0.856 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.2838 0.72691 0.000 0.052 0.008 0.044 0.880 0.016
#> SRR1791346 2 0.7548 0.52627 0.000 0.448 0.096 0.032 0.208 0.216
#> SRR1791345 4 0.8430 0.19633 0.112 0.024 0.168 0.388 0.252 0.056
#> SRR1791344 5 0.1655 0.74896 0.000 0.008 0.008 0.052 0.932 0.000
#> SRR1791343 2 0.5655 0.61015 0.000 0.628 0.072 0.004 0.236 0.060
#> SRR1791341 6 0.6109 0.79712 0.156 0.000 0.000 0.200 0.060 0.584
#> SRR1791342 5 0.1757 0.74864 0.000 0.012 0.008 0.052 0.928 0.000
#> SRR1791340 2 0.3952 0.67549 0.000 0.736 0.000 0.000 0.052 0.212
#> SRR1791375 3 0.8159 -0.33184 0.136 0.000 0.308 0.260 0.256 0.040
#> SRR1791374 4 0.7975 0.42858 0.224 0.000 0.132 0.376 0.232 0.036
#> SRR1791372 1 0.0508 0.76418 0.984 0.000 0.000 0.012 0.000 0.004
#> SRR1791370 3 0.6067 0.52642 0.036 0.000 0.608 0.088 0.236 0.032
#> SRR1791373 5 0.7799 0.44566 0.040 0.064 0.096 0.268 0.476 0.056
#> SRR1791369 4 0.4184 0.30494 0.408 0.000 0.000 0.576 0.000 0.016
#> SRR1791371 1 0.5221 -0.12348 0.476 0.000 0.000 0.432 0.092 0.000
#> SRR1791368 6 0.5958 0.75687 0.200 0.000 0.000 0.204 0.028 0.568
#> SRR1791366 2 0.5878 0.62301 0.000 0.564 0.020 0.000 0.224 0.192
#> SRR1791364 1 0.0405 0.76700 0.988 0.000 0.000 0.004 0.000 0.008
#> SRR1791367 1 0.5758 -0.18803 0.464 0.000 0.012 0.416 0.104 0.004
#> SRR1791363 6 0.6453 0.73664 0.120 0.000 0.000 0.184 0.132 0.564
#> SRR1791361 5 0.5823 0.52319 0.000 0.016 0.008 0.204 0.596 0.176
#> SRR1791360 4 0.7398 0.43159 0.168 0.000 0.088 0.476 0.232 0.036
#> SRR1791359 3 0.0000 0.74198 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791358 2 0.3671 0.66928 0.000 0.816 0.000 0.028 0.100 0.056
#> SRR1791365 2 0.4158 0.67869 0.000 0.724 0.008 0.000 0.224 0.044
#> SRR1791357 1 0.2146 0.69523 0.880 0.000 0.000 0.116 0.000 0.004
#> SRR1791356 1 0.4659 0.31491 0.656 0.000 0.000 0.260 0.084 0.000
#> SRR1791355 2 0.5881 0.58720 0.000 0.608 0.092 0.004 0.236 0.060
#> SRR1791362 4 0.6288 0.25789 0.212 0.000 0.004 0.576 0.068 0.140
#> SRR1791354 3 0.0000 0.74198 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791353 6 0.7627 -0.00698 0.204 0.000 0.000 0.268 0.204 0.324
#> SRR1791352 1 0.0146 0.77023 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791349 2 0.6798 0.56347 0.000 0.496 0.092 0.000 0.212 0.200
#> SRR1791348 4 0.4378 0.38106 0.368 0.000 0.000 0.600 0.000 0.032
#> SRR1791351 2 0.3671 0.66928 0.000 0.816 0.000 0.028 0.100 0.056
#> SRR1791350 4 0.5739 0.31575 0.248 0.000 0.000 0.596 0.036 0.120
#> SRR1791339 5 0.1881 0.74577 0.000 0.020 0.004 0.040 0.928 0.008
#> SRR1791338 2 0.3744 0.68384 0.000 0.764 0.000 0.000 0.052 0.184
#> SRR1791336 2 0.3744 0.68384 0.000 0.764 0.000 0.000 0.052 0.184
#> SRR1791337 3 0.4120 0.65399 0.000 0.000 0.744 0.012 0.196 0.048
#> SRR1791335 2 0.2979 0.67915 0.000 0.848 0.000 0.008 0.112 0.032
#> SRR1791332 6 0.6118 0.79836 0.164 0.000 0.000 0.192 0.060 0.584
#> SRR1791331 5 0.4828 0.22757 0.000 0.276 0.000 0.004 0.640 0.080
#> SRR1791330 4 0.7944 0.28884 0.184 0.000 0.044 0.420 0.192 0.160
#> SRR1791334 4 0.4651 0.47024 0.232 0.000 0.000 0.692 0.056 0.020
#> SRR1791328 5 0.5400 0.56089 0.000 0.008 0.008 0.160 0.640 0.184
#> SRR1791327 2 0.3374 0.66961 0.000 0.836 0.000 0.024 0.092 0.048
#> SRR1791333 5 0.5629 0.52300 0.016 0.016 0.012 0.268 0.624 0.064
#> SRR1791326 2 0.3555 0.69145 0.000 0.780 0.000 0.000 0.044 0.176
#> SRR1791324 2 0.3991 0.68422 0.000 0.748 0.008 0.000 0.200 0.044
#> SRR1791323 2 0.4039 0.66610 0.000 0.772 0.000 0.008 0.104 0.116
#> SRR1791322 3 0.0000 0.74198 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791329 2 0.3991 0.68241 0.000 0.748 0.008 0.000 0.200 0.044
#> SRR1791321 4 0.4450 0.47430 0.236 0.000 0.000 0.700 0.052 0.012
#> SRR1791320 5 0.1862 0.74847 0.000 0.016 0.008 0.044 0.928 0.004
#> SRR1791325 4 0.8185 0.23806 0.160 0.000 0.260 0.308 0.236 0.036
#> SRR1791318 1 0.0146 0.77023 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791317 3 0.3836 0.67414 0.000 0.000 0.772 0.012 0.176 0.040
#> SRR1791313 1 0.0291 0.76712 0.992 0.000 0.000 0.004 0.000 0.004
#> SRR1791312 4 0.3756 0.28035 0.400 0.000 0.000 0.600 0.000 0.000
#> SRR1791319 4 0.7884 0.43865 0.248 0.000 0.108 0.376 0.232 0.036
#> SRR1791316 1 0.2915 0.61293 0.808 0.000 0.000 0.184 0.000 0.008
#> SRR1791315 1 0.0146 0.77023 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1791311 4 0.5444 0.35961 0.244 0.000 0.000 0.628 0.036 0.092
#> SRR1791314 2 0.3620 0.66542 0.000 0.816 0.000 0.028 0.112 0.044
#> SRR1791310 5 0.4654 0.54621 0.000 0.168 0.000 0.020 0.720 0.092
#> SRR1791308 2 0.7255 0.57754 0.000 0.500 0.096 0.028 0.184 0.192
#> SRR1791307 6 0.6188 0.79228 0.160 0.000 0.000 0.200 0.064 0.576
#> SRR1791306 6 0.6106 0.64832 0.216 0.000 0.000 0.264 0.016 0.504
#> SRR1791305 2 0.6545 0.60189 0.000 0.532 0.060 0.004 0.208 0.196
#> SRR1791309 3 0.0000 0.74198 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791304 1 0.0146 0.76911 0.996 0.000 0.000 0.000 0.000 0.004
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 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.970 0.939 0.974 0.5048 0.496 0.496
#> 3 3 0.651 0.740 0.865 0.2703 0.817 0.649
#> 4 4 0.820 0.820 0.927 0.1386 0.859 0.633
#> 5 5 0.750 0.704 0.860 0.0454 0.951 0.824
#> 6 6 0.743 0.625 0.813 0.0286 0.993 0.969
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
#> SRR1791347 2 0.0000 0.9969 0.000 1.000
#> SRR1791346 2 0.0000 0.9969 0.000 1.000
#> SRR1791345 1 0.6438 0.7961 0.836 0.164
#> SRR1791344 2 0.0000 0.9969 0.000 1.000
#> SRR1791343 2 0.0000 0.9969 0.000 1.000
#> SRR1791341 1 0.0000 0.9532 1.000 0.000
#> SRR1791342 2 0.0000 0.9969 0.000 1.000
#> SRR1791340 2 0.0000 0.9969 0.000 1.000
#> SRR1791375 2 0.1184 0.9809 0.016 0.984
#> SRR1791374 1 0.0000 0.9532 1.000 0.000
#> SRR1791372 1 0.0000 0.9532 1.000 0.000
#> SRR1791370 1 0.9522 0.4574 0.628 0.372
#> SRR1791373 1 0.0938 0.9452 0.988 0.012
#> SRR1791369 1 0.0000 0.9532 1.000 0.000
#> SRR1791371 1 0.0000 0.9532 1.000 0.000
#> SRR1791368 1 0.0000 0.9532 1.000 0.000
#> SRR1791366 2 0.0000 0.9969 0.000 1.000
#> SRR1791364 1 0.0000 0.9532 1.000 0.000
#> SRR1791367 1 0.0000 0.9532 1.000 0.000
#> SRR1791363 1 0.0000 0.9532 1.000 0.000
#> SRR1791361 1 0.0672 0.9481 0.992 0.008
#> SRR1791360 1 0.0000 0.9532 1.000 0.000
#> SRR1791359 2 0.0000 0.9969 0.000 1.000
#> SRR1791358 2 0.0000 0.9969 0.000 1.000
#> SRR1791365 2 0.0000 0.9969 0.000 1.000
#> SRR1791357 1 0.0000 0.9532 1.000 0.000
#> SRR1791356 1 0.0000 0.9532 1.000 0.000
#> SRR1791355 2 0.0000 0.9969 0.000 1.000
#> SRR1791362 1 0.0000 0.9532 1.000 0.000
#> SRR1791354 2 0.0000 0.9969 0.000 1.000
#> SRR1791353 1 0.9000 0.5724 0.684 0.316
#> SRR1791352 1 0.0000 0.9532 1.000 0.000
#> SRR1791349 2 0.0000 0.9969 0.000 1.000
#> SRR1791348 1 0.0000 0.9532 1.000 0.000
#> SRR1791351 2 0.0000 0.9969 0.000 1.000
#> SRR1791350 1 0.0000 0.9532 1.000 0.000
#> SRR1791339 2 0.3879 0.9118 0.076 0.924
#> SRR1791338 2 0.0000 0.9969 0.000 1.000
#> SRR1791336 2 0.0000 0.9969 0.000 1.000
#> SRR1791337 1 0.9129 0.5505 0.672 0.328
#> SRR1791335 2 0.0000 0.9969 0.000 1.000
#> SRR1791332 1 0.0000 0.9532 1.000 0.000
#> SRR1791331 2 0.0000 0.9969 0.000 1.000
#> SRR1791330 1 0.0000 0.9532 1.000 0.000
#> SRR1791334 1 0.0000 0.9532 1.000 0.000
#> SRR1791328 1 1.0000 0.0815 0.500 0.500
#> SRR1791327 2 0.0000 0.9969 0.000 1.000
#> SRR1791333 1 0.0672 0.9481 0.992 0.008
#> SRR1791326 2 0.0000 0.9969 0.000 1.000
#> SRR1791324 2 0.0000 0.9969 0.000 1.000
#> SRR1791323 2 0.0000 0.9969 0.000 1.000
#> SRR1791322 2 0.0000 0.9969 0.000 1.000
#> SRR1791329 2 0.0000 0.9969 0.000 1.000
#> SRR1791321 1 0.0000 0.9532 1.000 0.000
#> SRR1791320 2 0.0000 0.9969 0.000 1.000
#> SRR1791325 1 0.2423 0.9225 0.960 0.040
#> SRR1791318 1 0.0000 0.9532 1.000 0.000
#> SRR1791317 2 0.0000 0.9969 0.000 1.000
#> SRR1791313 1 0.0000 0.9532 1.000 0.000
#> SRR1791312 1 0.0000 0.9532 1.000 0.000
#> SRR1791319 1 0.0000 0.9532 1.000 0.000
#> SRR1791316 1 0.0000 0.9532 1.000 0.000
#> SRR1791315 1 0.0000 0.9532 1.000 0.000
#> SRR1791311 1 0.0000 0.9532 1.000 0.000
#> SRR1791314 2 0.0000 0.9969 0.000 1.000
#> SRR1791310 2 0.0000 0.9969 0.000 1.000
#> SRR1791308 2 0.0000 0.9969 0.000 1.000
#> SRR1791307 1 0.0000 0.9532 1.000 0.000
#> SRR1791306 1 0.0000 0.9532 1.000 0.000
#> SRR1791305 2 0.0000 0.9969 0.000 1.000
#> SRR1791309 2 0.0000 0.9969 0.000 1.000
#> SRR1791304 1 0.0000 0.9532 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 2 0.4346 0.7252 0.000 0.816 0.184
#> SRR1791346 3 0.6154 0.5228 0.000 0.408 0.592
#> SRR1791345 1 0.5431 0.4869 0.716 0.000 0.284
#> SRR1791344 2 0.0424 0.9247 0.000 0.992 0.008
#> SRR1791343 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791341 1 0.5650 0.6625 0.688 0.000 0.312
#> SRR1791342 2 0.5650 0.5516 0.000 0.688 0.312
#> SRR1791340 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791375 3 0.3038 0.6258 0.000 0.104 0.896
#> SRR1791374 1 0.5363 0.4999 0.724 0.000 0.276
#> SRR1791372 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791370 3 0.6294 0.5465 0.288 0.020 0.692
#> SRR1791373 1 0.2959 0.7509 0.900 0.100 0.000
#> SRR1791369 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791368 1 0.4654 0.7358 0.792 0.000 0.208
#> SRR1791366 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791364 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791363 1 0.5650 0.6625 0.688 0.000 0.312
#> SRR1791361 1 0.9425 0.3939 0.488 0.200 0.312
#> SRR1791360 1 0.6045 0.2507 0.620 0.000 0.380
#> SRR1791359 3 0.5621 0.6642 0.000 0.308 0.692
#> SRR1791358 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791365 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791357 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791355 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791362 1 0.5178 0.7035 0.744 0.000 0.256
#> SRR1791354 3 0.5621 0.6642 0.000 0.308 0.692
#> SRR1791353 3 0.6079 -0.2129 0.388 0.000 0.612
#> SRR1791352 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791349 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791348 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791339 2 0.3879 0.7669 0.000 0.848 0.152
#> SRR1791338 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791336 2 0.0237 0.9283 0.000 0.996 0.004
#> SRR1791337 3 0.5845 0.5194 0.308 0.004 0.688
#> SRR1791335 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791332 1 0.5650 0.6625 0.688 0.000 0.312
#> SRR1791331 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791330 3 0.5859 0.0793 0.344 0.000 0.656
#> SRR1791334 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791328 2 0.7234 0.4747 0.048 0.640 0.312
#> SRR1791327 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791333 1 0.9340 0.4125 0.500 0.192 0.308
#> SRR1791326 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791324 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791323 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791322 3 0.5621 0.6642 0.000 0.308 0.692
#> SRR1791329 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791321 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791320 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791325 3 0.5497 0.5290 0.292 0.000 0.708
#> SRR1791318 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791317 3 0.5650 0.6612 0.000 0.312 0.688
#> SRR1791313 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791319 1 0.1163 0.8192 0.972 0.000 0.028
#> SRR1791316 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.8375 1.000 0.000 0.000
#> SRR1791311 1 0.5058 0.7123 0.756 0.000 0.244
#> SRR1791314 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791310 2 0.0000 0.9319 0.000 1.000 0.000
#> SRR1791308 3 0.6154 0.5210 0.000 0.408 0.592
#> SRR1791307 1 0.5650 0.6625 0.688 0.000 0.312
#> SRR1791306 1 0.5621 0.6652 0.692 0.000 0.308
#> SRR1791305 2 0.4842 0.5847 0.000 0.776 0.224
#> SRR1791309 3 0.5650 0.6612 0.000 0.312 0.688
#> SRR1791304 1 0.0000 0.8375 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 2 0.4605 0.4053 0.000 0.664 0.000 0.336
#> SRR1791346 3 0.3726 0.6501 0.000 0.212 0.788 0.000
#> SRR1791345 1 0.5000 0.0375 0.504 0.000 0.496 0.000
#> SRR1791344 2 0.0188 0.9712 0.000 0.996 0.000 0.004
#> SRR1791343 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791341 4 0.0336 0.7956 0.008 0.000 0.000 0.992
#> SRR1791342 4 0.4356 0.6076 0.000 0.292 0.000 0.708
#> SRR1791340 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791375 3 0.0188 0.8764 0.000 0.000 0.996 0.004
#> SRR1791374 1 0.3801 0.7073 0.780 0.000 0.220 0.000
#> SRR1791372 1 0.1940 0.8746 0.924 0.000 0.000 0.076
#> SRR1791370 3 0.0000 0.8784 0.000 0.000 1.000 0.000
#> SRR1791373 1 0.3024 0.7569 0.852 0.148 0.000 0.000
#> SRR1791369 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791371 1 0.0188 0.9167 0.996 0.000 0.004 0.000
#> SRR1791368 4 0.4713 0.3301 0.360 0.000 0.000 0.640
#> SRR1791366 2 0.0592 0.9644 0.000 0.984 0.016 0.000
#> SRR1791364 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.0188 0.9167 0.996 0.000 0.004 0.000
#> SRR1791363 4 0.0188 0.7948 0.000 0.000 0.004 0.996
#> SRR1791361 4 0.3311 0.7237 0.000 0.172 0.000 0.828
#> SRR1791360 3 0.5292 -0.0754 0.480 0.000 0.512 0.008
#> SRR1791359 3 0.0000 0.8784 0.000 0.000 1.000 0.000
#> SRR1791358 2 0.0000 0.9723 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791357 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791355 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791362 4 0.1635 0.7793 0.044 0.000 0.008 0.948
#> SRR1791354 3 0.0000 0.8784 0.000 0.000 1.000 0.000
#> SRR1791353 4 0.0336 0.7943 0.000 0.000 0.008 0.992
#> SRR1791352 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791349 2 0.0592 0.9649 0.000 0.984 0.016 0.000
#> SRR1791348 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 0.9723 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.0707 0.9089 0.980 0.000 0.000 0.020
#> SRR1791339 2 0.1792 0.9045 0.000 0.932 0.000 0.068
#> SRR1791338 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791336 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791337 3 0.0000 0.8784 0.000 0.000 1.000 0.000
#> SRR1791335 2 0.0000 0.9723 0.000 1.000 0.000 0.000
#> SRR1791332 4 0.0336 0.7943 0.000 0.000 0.008 0.992
#> SRR1791331 2 0.0188 0.9712 0.000 0.996 0.000 0.004
#> SRR1791330 4 0.5165 0.0950 0.004 0.000 0.484 0.512
#> SRR1791334 1 0.0188 0.9164 0.996 0.000 0.004 0.000
#> SRR1791328 4 0.4643 0.5168 0.000 0.344 0.000 0.656
#> SRR1791327 2 0.0000 0.9723 0.000 1.000 0.000 0.000
#> SRR1791333 4 0.6027 0.6668 0.124 0.192 0.000 0.684
#> SRR1791326 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791324 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791323 2 0.0188 0.9712 0.000 0.996 0.000 0.004
#> SRR1791322 3 0.0188 0.8764 0.000 0.000 0.996 0.004
#> SRR1791329 2 0.0188 0.9726 0.000 0.996 0.004 0.000
#> SRR1791321 1 0.0188 0.9165 0.996 0.000 0.000 0.004
#> SRR1791320 2 0.0188 0.9712 0.000 0.996 0.000 0.004
#> SRR1791325 3 0.0188 0.8764 0.000 0.000 0.996 0.004
#> SRR1791318 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 0.8784 0.000 0.000 1.000 0.000
#> SRR1791313 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.2676 0.8576 0.896 0.000 0.012 0.092
#> SRR1791319 1 0.2408 0.8450 0.896 0.000 0.104 0.000
#> SRR1791316 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.9176 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.4925 0.1385 0.572 0.000 0.000 0.428
#> SRR1791314 2 0.0000 0.9723 0.000 1.000 0.000 0.000
#> SRR1791310 2 0.0336 0.9688 0.000 0.992 0.000 0.008
#> SRR1791308 3 0.4040 0.5925 0.000 0.248 0.752 0.000
#> SRR1791307 4 0.0336 0.7958 0.008 0.000 0.000 0.992
#> SRR1791306 4 0.0469 0.7954 0.012 0.000 0.000 0.988
#> SRR1791305 2 0.1716 0.9169 0.000 0.936 0.064 0.000
#> SRR1791309 3 0.0000 0.8784 0.000 0.000 1.000 0.000
#> SRR1791304 1 0.0921 0.9058 0.972 0.000 0.000 0.028
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 2 0.3282 0.7212 0.000 0.804 0.000 0.188 0.008
#> SRR1791346 3 0.4952 0.6043 0.012 0.188 0.724 0.000 0.076
#> SRR1791345 5 0.6340 0.2751 0.112 0.000 0.356 0.016 0.516
#> SRR1791344 2 0.0451 0.9412 0.000 0.988 0.000 0.008 0.004
#> SRR1791343 2 0.0000 0.9458 0.000 1.000 0.000 0.000 0.000
#> SRR1791341 4 0.4249 -0.1645 0.000 0.000 0.000 0.568 0.432
#> SRR1791342 4 0.4252 0.3683 0.000 0.340 0.000 0.652 0.008
#> SRR1791340 2 0.0794 0.9369 0.000 0.972 0.000 0.000 0.028
#> SRR1791375 3 0.3607 0.6245 0.000 0.000 0.752 0.004 0.244
#> SRR1791374 1 0.3863 0.6722 0.772 0.000 0.200 0.000 0.028
#> SRR1791372 1 0.2653 0.7977 0.880 0.000 0.000 0.096 0.024
#> SRR1791370 3 0.0880 0.8816 0.000 0.000 0.968 0.000 0.032
#> SRR1791373 1 0.2408 0.7642 0.892 0.092 0.000 0.000 0.016
#> SRR1791369 1 0.1544 0.8221 0.932 0.000 0.000 0.000 0.068
#> SRR1791371 1 0.1121 0.8301 0.956 0.000 0.000 0.000 0.044
#> SRR1791368 5 0.5116 0.4051 0.120 0.000 0.000 0.188 0.692
#> SRR1791366 2 0.1836 0.9069 0.000 0.932 0.036 0.000 0.032
#> SRR1791364 1 0.0880 0.8343 0.968 0.000 0.000 0.000 0.032
#> SRR1791367 1 0.1117 0.8321 0.964 0.000 0.016 0.000 0.020
#> SRR1791363 4 0.1671 0.5518 0.000 0.000 0.000 0.924 0.076
#> SRR1791361 4 0.4066 0.5053 0.004 0.196 0.000 0.768 0.032
#> SRR1791360 1 0.6667 0.2489 0.480 0.000 0.268 0.004 0.248
#> SRR1791359 3 0.0162 0.8880 0.000 0.000 0.996 0.000 0.004
#> SRR1791358 2 0.0162 0.9457 0.000 0.996 0.000 0.000 0.004
#> SRR1791365 2 0.0000 0.9458 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.1341 0.8274 0.944 0.000 0.000 0.000 0.056
#> SRR1791356 1 0.0703 0.8324 0.976 0.000 0.000 0.000 0.024
#> SRR1791355 2 0.0162 0.9457 0.000 0.996 0.000 0.000 0.004
#> SRR1791362 5 0.5002 0.3162 0.040 0.000 0.000 0.364 0.596
#> SRR1791354 3 0.0703 0.8855 0.000 0.000 0.976 0.000 0.024
#> SRR1791353 4 0.2329 0.5399 0.000 0.000 0.000 0.876 0.124
#> SRR1791352 1 0.0510 0.8347 0.984 0.000 0.000 0.000 0.016
#> SRR1791349 2 0.0968 0.9381 0.000 0.972 0.012 0.004 0.012
#> SRR1791348 5 0.4114 0.2110 0.376 0.000 0.000 0.000 0.624
#> SRR1791351 2 0.0162 0.9457 0.000 0.996 0.000 0.000 0.004
#> SRR1791350 1 0.4378 0.6112 0.716 0.000 0.000 0.036 0.248
#> SRR1791339 2 0.5507 0.2835 0.012 0.588 0.000 0.052 0.348
#> SRR1791338 2 0.1205 0.9265 0.000 0.956 0.004 0.000 0.040
#> SRR1791336 2 0.0963 0.9315 0.000 0.964 0.000 0.000 0.036
#> SRR1791337 3 0.0404 0.8870 0.000 0.000 0.988 0.000 0.012
#> SRR1791335 2 0.0162 0.9457 0.000 0.996 0.000 0.000 0.004
#> SRR1791332 5 0.4238 0.2942 0.004 0.000 0.000 0.368 0.628
#> SRR1791331 2 0.0290 0.9432 0.000 0.992 0.000 0.008 0.000
#> SRR1791330 5 0.6402 0.2072 0.000 0.000 0.348 0.180 0.472
#> SRR1791334 1 0.3910 0.7033 0.772 0.000 0.032 0.000 0.196
#> SRR1791328 5 0.6785 -0.1494 0.000 0.308 0.000 0.304 0.388
#> SRR1791327 2 0.0000 0.9458 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 4 0.6697 0.3218 0.188 0.228 0.000 0.556 0.028
#> SRR1791326 2 0.0404 0.9432 0.000 0.988 0.000 0.000 0.012
#> SRR1791324 2 0.0000 0.9458 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.0162 0.9449 0.000 0.996 0.000 0.004 0.000
#> SRR1791322 3 0.0290 0.8878 0.000 0.000 0.992 0.000 0.008
#> SRR1791329 2 0.0000 0.9458 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 1 0.1732 0.8183 0.920 0.000 0.000 0.000 0.080
#> SRR1791320 2 0.2674 0.8176 0.012 0.868 0.000 0.000 0.120
#> SRR1791325 3 0.1410 0.8625 0.000 0.000 0.940 0.000 0.060
#> SRR1791318 1 0.0510 0.8346 0.984 0.000 0.000 0.000 0.016
#> SRR1791317 3 0.0290 0.8870 0.000 0.000 0.992 0.000 0.008
#> SRR1791313 1 0.1557 0.8262 0.940 0.000 0.000 0.008 0.052
#> SRR1791312 1 0.6476 0.0705 0.484 0.000 0.020 0.112 0.384
#> SRR1791319 1 0.2236 0.8060 0.908 0.000 0.068 0.000 0.024
#> SRR1791316 1 0.1544 0.8247 0.932 0.000 0.000 0.000 0.068
#> SRR1791315 1 0.0703 0.8339 0.976 0.000 0.000 0.000 0.024
#> SRR1791311 1 0.6590 -0.0405 0.464 0.000 0.000 0.248 0.288
#> SRR1791314 2 0.0000 0.9458 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 2 0.0000 0.9458 0.000 1.000 0.000 0.000 0.000
#> SRR1791308 3 0.4386 0.6764 0.000 0.140 0.764 0.000 0.096
#> SRR1791307 4 0.0609 0.5810 0.000 0.000 0.000 0.980 0.020
#> SRR1791306 4 0.1205 0.5781 0.004 0.000 0.000 0.956 0.040
#> SRR1791305 2 0.2628 0.8538 0.000 0.884 0.088 0.000 0.028
#> SRR1791309 3 0.0404 0.8863 0.000 0.000 0.988 0.000 0.012
#> SRR1791304 1 0.1485 0.8329 0.948 0.000 0.000 0.020 0.032
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 6 0.3664 0.6982 0.000 0.076 0.000 0.012 0.104 0.808
#> SRR1791346 3 0.5055 0.5549 0.024 0.080 0.700 0.012 0.000 0.184
#> SRR1791345 4 0.7450 0.2298 0.080 0.220 0.276 0.404 0.020 0.000
#> SRR1791344 6 0.1049 0.8919 0.000 0.032 0.000 0.000 0.008 0.960
#> SRR1791343 6 0.0000 0.9103 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791341 4 0.4610 0.2539 0.000 0.044 0.000 0.568 0.388 0.000
#> SRR1791342 5 0.6179 -0.0622 0.000 0.168 0.000 0.024 0.480 0.328
#> SRR1791340 6 0.1829 0.8716 0.000 0.064 0.012 0.004 0.000 0.920
#> SRR1791375 3 0.4900 0.4295 0.000 0.088 0.636 0.272 0.004 0.000
#> SRR1791374 1 0.4622 0.6589 0.724 0.092 0.164 0.020 0.000 0.000
#> SRR1791372 1 0.4027 0.6850 0.772 0.052 0.000 0.020 0.156 0.000
#> SRR1791370 3 0.1524 0.8392 0.000 0.060 0.932 0.008 0.000 0.000
#> SRR1791373 1 0.2987 0.7348 0.856 0.056 0.000 0.008 0.000 0.080
#> SRR1791369 1 0.1779 0.7728 0.920 0.016 0.000 0.064 0.000 0.000
#> SRR1791371 1 0.0909 0.7769 0.968 0.020 0.000 0.012 0.000 0.000
#> SRR1791368 4 0.5472 0.2519 0.048 0.224 0.000 0.640 0.088 0.000
#> SRR1791366 6 0.2803 0.8082 0.000 0.048 0.084 0.000 0.004 0.864
#> SRR1791364 1 0.1334 0.7760 0.948 0.032 0.000 0.020 0.000 0.000
#> SRR1791367 1 0.1333 0.7749 0.944 0.048 0.000 0.008 0.000 0.000
#> SRR1791363 5 0.2696 0.4240 0.000 0.028 0.000 0.116 0.856 0.000
#> SRR1791361 5 0.6535 0.1828 0.004 0.156 0.000 0.100 0.564 0.176
#> SRR1791360 1 0.6890 0.2033 0.400 0.348 0.204 0.032 0.016 0.000
#> SRR1791359 3 0.0260 0.8526 0.000 0.008 0.992 0.000 0.000 0.000
#> SRR1791358 6 0.0260 0.9098 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR1791365 6 0.0000 0.9103 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791357 1 0.2113 0.7756 0.896 0.092 0.000 0.008 0.004 0.000
#> SRR1791356 1 0.1643 0.7716 0.924 0.068 0.000 0.008 0.000 0.000
#> SRR1791355 6 0.0363 0.9085 0.000 0.012 0.000 0.000 0.000 0.988
#> SRR1791362 4 0.3939 0.3952 0.020 0.044 0.000 0.776 0.160 0.000
#> SRR1791354 3 0.1367 0.8414 0.000 0.044 0.944 0.012 0.000 0.000
#> SRR1791353 5 0.4000 0.2965 0.000 0.228 0.000 0.048 0.724 0.000
#> SRR1791352 1 0.0622 0.7783 0.980 0.012 0.000 0.008 0.000 0.000
#> SRR1791349 6 0.1148 0.9034 0.000 0.020 0.016 0.000 0.004 0.960
#> SRR1791348 4 0.5361 0.2581 0.192 0.180 0.000 0.620 0.008 0.000
#> SRR1791351 6 0.0363 0.9095 0.000 0.012 0.000 0.000 0.000 0.988
#> SRR1791350 1 0.6806 0.0800 0.452 0.156 0.000 0.308 0.084 0.000
#> SRR1791339 6 0.5395 -0.3011 0.008 0.044 0.000 0.452 0.020 0.476
#> SRR1791338 6 0.2002 0.8603 0.000 0.076 0.012 0.004 0.000 0.908
#> SRR1791336 6 0.1901 0.8640 0.000 0.076 0.008 0.004 0.000 0.912
#> SRR1791337 3 0.0363 0.8521 0.000 0.012 0.988 0.000 0.000 0.000
#> SRR1791335 6 0.0260 0.9101 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR1791332 4 0.3623 0.3790 0.004 0.068 0.004 0.808 0.116 0.000
#> SRR1791331 6 0.0692 0.9021 0.000 0.020 0.000 0.000 0.004 0.976
#> SRR1791330 4 0.7242 0.0997 0.004 0.272 0.264 0.380 0.080 0.000
#> SRR1791334 1 0.4913 0.5641 0.620 0.316 0.028 0.036 0.000 0.000
#> SRR1791328 2 0.7630 0.0000 0.000 0.304 0.000 0.292 0.192 0.212
#> SRR1791327 6 0.0000 0.9103 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 5 0.8193 -0.0736 0.224 0.096 0.000 0.076 0.360 0.244
#> SRR1791326 6 0.0922 0.9049 0.000 0.024 0.004 0.000 0.004 0.968
#> SRR1791324 6 0.0508 0.9087 0.000 0.012 0.000 0.000 0.004 0.984
#> SRR1791323 6 0.0405 0.9074 0.000 0.008 0.000 0.000 0.004 0.988
#> SRR1791322 3 0.0603 0.8512 0.000 0.016 0.980 0.004 0.000 0.000
#> SRR1791329 6 0.0000 0.9103 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791321 1 0.3590 0.7139 0.776 0.188 0.000 0.032 0.004 0.000
#> SRR1791320 6 0.2812 0.7823 0.004 0.024 0.000 0.108 0.004 0.860
#> SRR1791325 3 0.2277 0.8128 0.000 0.076 0.892 0.032 0.000 0.000
#> SRR1791318 1 0.0508 0.7788 0.984 0.004 0.000 0.012 0.000 0.000
#> SRR1791317 3 0.0260 0.8521 0.000 0.008 0.992 0.000 0.000 0.000
#> SRR1791313 1 0.2450 0.7541 0.896 0.048 0.000 0.040 0.016 0.000
#> SRR1791312 1 0.8076 -0.1051 0.360 0.168 0.052 0.288 0.132 0.000
#> SRR1791319 1 0.3441 0.7431 0.832 0.072 0.076 0.020 0.000 0.000
#> SRR1791316 1 0.2553 0.7528 0.848 0.144 0.000 0.008 0.000 0.000
#> SRR1791315 1 0.1245 0.7745 0.952 0.032 0.000 0.016 0.000 0.000
#> SRR1791311 1 0.6955 -0.1576 0.404 0.112 0.000 0.352 0.132 0.000
#> SRR1791314 6 0.0000 0.9103 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791310 6 0.0458 0.9057 0.000 0.016 0.000 0.000 0.000 0.984
#> SRR1791308 3 0.5094 0.5512 0.004 0.184 0.660 0.004 0.000 0.148
#> SRR1791307 5 0.0909 0.4572 0.000 0.012 0.000 0.020 0.968 0.000
#> SRR1791306 5 0.2591 0.4317 0.004 0.052 0.000 0.064 0.880 0.000
#> SRR1791305 6 0.3163 0.7327 0.000 0.040 0.140 0.000 0.000 0.820
#> SRR1791309 3 0.0363 0.8516 0.000 0.012 0.988 0.000 0.000 0.000
#> SRR1791304 1 0.2677 0.7641 0.884 0.056 0.000 0.036 0.024 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 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 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.541 0.814 0.901 0.3511 0.737 0.737
#> 3 3 0.797 0.914 0.957 0.6857 0.653 0.529
#> 4 4 0.970 0.921 0.965 0.1335 0.945 0.860
#> 5 5 0.889 0.837 0.907 0.0495 1.000 1.000
#> 6 6 0.906 0.842 0.937 0.0164 0.979 0.937
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 4
There is also optional best \(k\) = 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1791347 1 0.605 0.800 0.852 0.148
#> SRR1791346 1 0.961 0.566 0.616 0.384
#> SRR1791345 1 0.000 0.870 1.000 0.000
#> SRR1791344 1 0.605 0.800 0.852 0.148
#> SRR1791343 1 0.961 0.566 0.616 0.384
#> SRR1791341 1 0.000 0.870 1.000 0.000
#> SRR1791342 1 0.000 0.870 1.000 0.000
#> SRR1791340 2 0.000 1.000 0.000 1.000
#> SRR1791375 1 0.000 0.870 1.000 0.000
#> SRR1791374 1 0.000 0.870 1.000 0.000
#> SRR1791372 1 0.000 0.870 1.000 0.000
#> SRR1791370 1 0.552 0.811 0.872 0.128
#> SRR1791373 1 0.605 0.800 0.852 0.148
#> SRR1791369 1 0.000 0.870 1.000 0.000
#> SRR1791371 1 0.000 0.870 1.000 0.000
#> SRR1791368 1 0.000 0.870 1.000 0.000
#> SRR1791366 1 0.961 0.566 0.616 0.384
#> SRR1791364 1 0.000 0.870 1.000 0.000
#> SRR1791367 1 0.000 0.870 1.000 0.000
#> SRR1791363 1 0.000 0.870 1.000 0.000
#> SRR1791361 1 0.000 0.870 1.000 0.000
#> SRR1791360 1 0.000 0.870 1.000 0.000
#> SRR1791359 1 0.961 0.566 0.616 0.384
#> SRR1791358 2 0.000 1.000 0.000 1.000
#> SRR1791365 1 0.993 0.433 0.548 0.452
#> SRR1791357 1 0.000 0.870 1.000 0.000
#> SRR1791356 1 0.000 0.870 1.000 0.000
#> SRR1791355 1 0.961 0.566 0.616 0.384
#> SRR1791362 1 0.000 0.870 1.000 0.000
#> SRR1791354 1 0.961 0.566 0.616 0.384
#> SRR1791353 1 0.000 0.870 1.000 0.000
#> SRR1791352 1 0.000 0.870 1.000 0.000
#> SRR1791349 1 0.961 0.566 0.616 0.384
#> SRR1791348 1 0.000 0.870 1.000 0.000
#> SRR1791351 2 0.000 1.000 0.000 1.000
#> SRR1791350 1 0.000 0.870 1.000 0.000
#> SRR1791339 1 0.605 0.800 0.852 0.148
#> SRR1791338 2 0.000 1.000 0.000 1.000
#> SRR1791336 2 0.000 1.000 0.000 1.000
#> SRR1791337 1 0.961 0.566 0.616 0.384
#> SRR1791335 2 0.000 1.000 0.000 1.000
#> SRR1791332 1 0.000 0.870 1.000 0.000
#> SRR1791331 1 0.625 0.795 0.844 0.156
#> SRR1791330 1 0.000 0.870 1.000 0.000
#> SRR1791334 1 0.000 0.870 1.000 0.000
#> SRR1791328 1 0.000 0.870 1.000 0.000
#> SRR1791327 2 0.000 1.000 0.000 1.000
#> SRR1791333 1 0.000 0.870 1.000 0.000
#> SRR1791326 2 0.000 1.000 0.000 1.000
#> SRR1791324 1 0.993 0.433 0.548 0.452
#> SRR1791323 2 0.000 1.000 0.000 1.000
#> SRR1791322 1 0.949 0.587 0.632 0.368
#> SRR1791329 1 0.993 0.433 0.548 0.452
#> SRR1791321 1 0.000 0.870 1.000 0.000
#> SRR1791320 1 0.605 0.800 0.852 0.148
#> SRR1791325 1 0.000 0.870 1.000 0.000
#> SRR1791318 1 0.000 0.870 1.000 0.000
#> SRR1791317 1 0.961 0.566 0.616 0.384
#> SRR1791313 1 0.000 0.870 1.000 0.000
#> SRR1791312 1 0.000 0.870 1.000 0.000
#> SRR1791319 1 0.000 0.870 1.000 0.000
#> SRR1791316 1 0.000 0.870 1.000 0.000
#> SRR1791315 1 0.000 0.870 1.000 0.000
#> SRR1791311 1 0.000 0.870 1.000 0.000
#> SRR1791314 2 0.000 1.000 0.000 1.000
#> SRR1791310 1 0.605 0.800 0.852 0.148
#> SRR1791308 2 0.000 1.000 0.000 1.000
#> SRR1791307 1 0.000 0.870 1.000 0.000
#> SRR1791306 1 0.000 0.870 1.000 0.000
#> SRR1791305 1 0.961 0.566 0.616 0.384
#> SRR1791309 1 0.961 0.566 0.616 0.384
#> SRR1791304 1 0.000 0.870 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.5016 0.757 0.240 0.000 0.760
#> SRR1791346 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791345 3 0.6274 0.347 0.456 0.000 0.544
#> SRR1791344 3 0.5016 0.757 0.240 0.000 0.760
#> SRR1791343 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791341 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791342 1 0.3551 0.823 0.868 0.000 0.132
#> SRR1791340 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791375 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791374 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791372 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791370 3 0.5216 0.735 0.260 0.000 0.740
#> SRR1791373 3 0.5016 0.757 0.240 0.000 0.760
#> SRR1791369 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791368 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791366 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791364 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791363 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791361 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791360 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791359 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791358 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791365 3 0.2448 0.791 0.000 0.076 0.924
#> SRR1791357 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791355 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791362 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791354 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791353 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791352 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791349 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791348 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791339 3 0.5016 0.757 0.240 0.000 0.760
#> SRR1791338 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791337 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791335 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791332 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791331 3 0.4931 0.760 0.232 0.000 0.768
#> SRR1791330 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791334 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791328 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791327 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791333 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791326 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791324 3 0.2448 0.791 0.000 0.076 0.924
#> SRR1791323 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791322 3 0.0747 0.837 0.016 0.000 0.984
#> SRR1791329 3 0.2448 0.791 0.000 0.076 0.924
#> SRR1791321 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791320 3 0.5016 0.757 0.240 0.000 0.760
#> SRR1791325 1 0.3038 0.866 0.896 0.000 0.104
#> SRR1791318 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791317 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791313 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791319 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791316 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791314 2 0.0000 0.981 0.000 1.000 0.000
#> SRR1791310 3 0.5016 0.757 0.240 0.000 0.760
#> SRR1791308 2 0.4555 0.778 0.000 0.800 0.200
#> SRR1791307 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791306 1 0.0000 0.992 1.000 0.000 0.000
#> SRR1791305 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791309 3 0.0000 0.839 0.000 0.000 1.000
#> SRR1791304 1 0.0000 0.992 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.0000 0.919 0.000 0.000 0.000 1.000
#> SRR1791346 3 0.0707 0.943 0.000 0.000 0.980 0.020
#> SRR1791345 4 0.3764 0.657 0.216 0.000 0.000 0.784
#> SRR1791344 4 0.0000 0.919 0.000 0.000 0.000 1.000
#> SRR1791343 3 0.0707 0.943 0.000 0.000 0.980 0.020
#> SRR1791341 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791342 1 0.4746 0.435 0.632 0.000 0.000 0.368
#> SRR1791340 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791375 1 0.0336 0.968 0.992 0.000 0.000 0.008
#> SRR1791374 1 0.2281 0.885 0.904 0.000 0.000 0.096
#> SRR1791372 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791370 4 0.1109 0.897 0.028 0.000 0.004 0.968
#> SRR1791373 4 0.0000 0.919 0.000 0.000 0.000 1.000
#> SRR1791369 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791371 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791368 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791366 3 0.0707 0.943 0.000 0.000 0.980 0.020
#> SRR1791364 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.0707 0.958 0.980 0.000 0.000 0.020
#> SRR1791363 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791361 1 0.0336 0.968 0.992 0.000 0.000 0.008
#> SRR1791360 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791359 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1791358 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791365 3 0.2635 0.902 0.000 0.076 0.904 0.020
#> SRR1791357 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791355 3 0.0707 0.943 0.000 0.000 0.980 0.020
#> SRR1791362 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791354 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1791353 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791352 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791349 3 0.0707 0.943 0.000 0.000 0.980 0.020
#> SRR1791348 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791339 4 0.0000 0.919 0.000 0.000 0.000 1.000
#> SRR1791338 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.4790 0.376 0.000 0.000 0.620 0.380
#> SRR1791335 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791331 4 0.1940 0.869 0.000 0.000 0.076 0.924
#> SRR1791330 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791334 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791328 1 0.0336 0.968 0.992 0.000 0.000 0.008
#> SRR1791327 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.0336 0.968 0.992 0.000 0.000 0.008
#> SRR1791326 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791324 3 0.2635 0.902 0.000 0.076 0.904 0.020
#> SRR1791323 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791322 4 0.4072 0.621 0.000 0.000 0.252 0.748
#> SRR1791329 3 0.2635 0.902 0.000 0.076 0.904 0.020
#> SRR1791321 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791320 4 0.0000 0.919 0.000 0.000 0.000 1.000
#> SRR1791325 1 0.4605 0.510 0.664 0.000 0.000 0.336
#> SRR1791318 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1791313 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791319 1 0.2281 0.885 0.904 0.000 0.000 0.096
#> SRR1791316 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791314 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.0000 0.919 0.000 0.000 0.000 1.000
#> SRR1791308 2 0.3610 0.727 0.000 0.800 0.200 0.000
#> SRR1791307 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791306 1 0.0000 0.973 1.000 0.000 0.000 0.000
#> SRR1791305 3 0.0707 0.943 0.000 0.000 0.980 0.020
#> SRR1791309 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1791304 1 0.0000 0.973 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
#> SRR1791347 5 0.0000 0.8934 0.000 0.000 0.000 NA 1.000
#> SRR1791346 3 0.4726 0.8166 0.000 0.000 0.580 NA 0.020
#> SRR1791345 5 0.4262 0.5774 0.000 0.000 0.000 NA 0.560
#> SRR1791344 5 0.0000 0.8934 0.000 0.000 0.000 NA 1.000
#> SRR1791343 3 0.4726 0.8166 0.000 0.000 0.580 NA 0.020
#> SRR1791341 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791342 1 0.6650 0.0572 0.412 0.000 0.000 NA 0.360
#> SRR1791340 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791375 1 0.3336 0.7677 0.772 0.000 0.000 NA 0.000
#> SRR1791374 1 0.5013 0.6654 0.680 0.000 0.000 NA 0.080
#> SRR1791372 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791370 5 0.3086 0.8088 0.000 0.000 0.004 NA 0.816
#> SRR1791373 5 0.0000 0.8934 0.000 0.000 0.000 NA 1.000
#> SRR1791369 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791371 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791368 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791366 3 0.4726 0.8166 0.000 0.000 0.580 NA 0.020
#> SRR1791364 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791367 1 0.1310 0.9026 0.956 0.000 0.000 NA 0.020
#> SRR1791363 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791361 1 0.3336 0.7677 0.772 0.000 0.000 NA 0.000
#> SRR1791360 1 0.0794 0.9124 0.972 0.000 0.000 NA 0.000
#> SRR1791359 3 0.0000 0.6673 0.000 0.000 1.000 NA 0.000
#> SRR1791358 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791365 3 0.6114 0.7876 0.000 0.076 0.512 NA 0.020
#> SRR1791357 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791356 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791355 3 0.4726 0.8166 0.000 0.000 0.580 NA 0.020
#> SRR1791362 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791354 3 0.0000 0.6673 0.000 0.000 1.000 NA 0.000
#> SRR1791353 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791352 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791349 3 0.4726 0.8166 0.000 0.000 0.580 NA 0.020
#> SRR1791348 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791351 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791350 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791339 5 0.0000 0.8934 0.000 0.000 0.000 NA 1.000
#> SRR1791338 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791336 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791337 3 0.4126 0.1291 0.000 0.000 0.620 NA 0.380
#> SRR1791335 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791332 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791331 5 0.1877 0.8431 0.000 0.000 0.064 NA 0.924
#> SRR1791330 1 0.0162 0.9253 0.996 0.000 0.000 NA 0.000
#> SRR1791334 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791328 1 0.3336 0.7677 0.772 0.000 0.000 NA 0.000
#> SRR1791327 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791333 1 0.3336 0.7677 0.772 0.000 0.000 NA 0.000
#> SRR1791326 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791324 3 0.6114 0.7876 0.000 0.076 0.512 NA 0.020
#> SRR1791323 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791322 5 0.5854 0.5774 0.000 0.000 0.252 NA 0.596
#> SRR1791329 3 0.6114 0.7876 0.000 0.076 0.512 NA 0.020
#> SRR1791321 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791320 5 0.0000 0.8934 0.000 0.000 0.000 NA 1.000
#> SRR1791325 1 0.6649 0.1945 0.448 0.000 0.000 NA 0.268
#> SRR1791318 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791317 3 0.0000 0.6673 0.000 0.000 1.000 NA 0.000
#> SRR1791313 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791312 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791319 1 0.5013 0.6654 0.680 0.000 0.000 NA 0.080
#> SRR1791316 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791315 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791311 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791314 2 0.0000 0.9790 0.000 1.000 0.000 NA 0.000
#> SRR1791310 5 0.0000 0.8934 0.000 0.000 0.000 NA 1.000
#> SRR1791308 2 0.3109 0.7504 0.000 0.800 0.000 NA 0.000
#> SRR1791307 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791306 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
#> SRR1791305 3 0.4726 0.8166 0.000 0.000 0.580 NA 0.020
#> SRR1791309 3 0.0000 0.6673 0.000 0.000 1.000 NA 0.000
#> SRR1791304 1 0.0000 0.9273 1.000 0.000 0.000 NA 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.0000 0.884 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791346 2 0.0000 0.959 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791345 1 0.2631 0.000 0.820 0.000 0.000 0.000 0.180 0.000
#> SRR1791344 5 0.0000 0.884 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791343 2 0.0000 0.959 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791341 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791342 4 0.5973 -0.117 0.228 0.000 0.000 0.412 0.360 0.000
#> SRR1791340 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791375 4 0.2996 0.729 0.228 0.000 0.000 0.772 0.000 0.000
#> SRR1791374 4 0.4392 0.610 0.256 0.000 0.000 0.680 0.064 0.000
#> SRR1791372 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791370 5 0.3253 0.698 0.192 0.000 0.020 0.000 0.788 0.000
#> SRR1791373 5 0.0260 0.879 0.008 0.000 0.000 0.000 0.992 0.000
#> SRR1791369 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791371 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791368 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791366 2 0.0000 0.959 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791364 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791367 4 0.1082 0.893 0.040 0.000 0.000 0.956 0.004 0.000
#> SRR1791363 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791361 4 0.2996 0.729 0.228 0.000 0.000 0.772 0.000 0.000
#> SRR1791360 4 0.0713 0.903 0.028 0.000 0.000 0.972 0.000 0.000
#> SRR1791359 3 0.0547 0.862 0.000 0.020 0.980 0.000 0.000 0.000
#> SRR1791358 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791365 2 0.1501 0.918 0.000 0.924 0.000 0.000 0.000 0.076
#> SRR1791357 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791356 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791355 2 0.0000 0.959 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791362 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791354 3 0.0547 0.862 0.000 0.020 0.980 0.000 0.000 0.000
#> SRR1791353 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791352 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791349 2 0.0000 0.959 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791348 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791351 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791350 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791339 5 0.0000 0.884 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791338 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791336 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791337 3 0.3647 0.348 0.000 0.000 0.640 0.000 0.360 0.000
#> SRR1791335 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791332 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791331 5 0.1501 0.803 0.000 0.076 0.000 0.000 0.924 0.000
#> SRR1791330 4 0.0146 0.918 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1791334 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791328 4 0.2996 0.729 0.228 0.000 0.000 0.772 0.000 0.000
#> SRR1791327 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 4 0.2996 0.729 0.228 0.000 0.000 0.772 0.000 0.000
#> SRR1791326 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791324 2 0.1501 0.918 0.000 0.924 0.000 0.000 0.000 0.076
#> SRR1791323 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791322 5 0.5361 0.380 0.156 0.000 0.268 0.000 0.576 0.000
#> SRR1791329 2 0.1501 0.918 0.000 0.924 0.000 0.000 0.000 0.076
#> SRR1791321 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791320 5 0.0000 0.884 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791325 4 0.6160 0.042 0.300 0.000 0.008 0.448 0.244 0.000
#> SRR1791318 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791317 3 0.0547 0.862 0.000 0.020 0.980 0.000 0.000 0.000
#> SRR1791313 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791312 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791319 4 0.4392 0.610 0.256 0.000 0.000 0.680 0.064 0.000
#> SRR1791316 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791315 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791311 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791314 6 0.0000 0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791310 5 0.0000 0.884 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1791308 6 0.2793 0.711 0.000 0.200 0.000 0.000 0.000 0.800
#> SRR1791307 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791306 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791305 2 0.0000 0.959 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791309 3 0.0547 0.862 0.000 0.020 0.980 0.000 0.000 0.000
#> SRR1791304 4 0.0000 0.920 0.000 0.000 0.000 1.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.978 0.990 0.4732 0.532 0.532
#> 3 3 0.903 0.936 0.968 0.3150 0.762 0.585
#> 4 4 0.777 0.827 0.900 0.1390 0.851 0.635
#> 5 5 0.762 0.720 0.805 0.0796 0.919 0.731
#> 6 6 0.747 0.514 0.676 0.0505 0.896 0.613
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1791347 1 0.000 0.985 1.000 0.000
#> SRR1791346 2 0.000 1.000 0.000 1.000
#> SRR1791345 1 0.000 0.985 1.000 0.000
#> SRR1791344 1 0.000 0.985 1.000 0.000
#> SRR1791343 2 0.000 1.000 0.000 1.000
#> SRR1791341 1 0.000 0.985 1.000 0.000
#> SRR1791342 1 0.000 0.985 1.000 0.000
#> SRR1791340 2 0.000 1.000 0.000 1.000
#> SRR1791375 1 0.000 0.985 1.000 0.000
#> SRR1791374 1 0.000 0.985 1.000 0.000
#> SRR1791372 1 0.000 0.985 1.000 0.000
#> SRR1791370 1 0.000 0.985 1.000 0.000
#> SRR1791373 1 0.000 0.985 1.000 0.000
#> SRR1791369 1 0.000 0.985 1.000 0.000
#> SRR1791371 1 0.000 0.985 1.000 0.000
#> SRR1791368 1 0.000 0.985 1.000 0.000
#> SRR1791366 2 0.000 1.000 0.000 1.000
#> SRR1791364 1 0.000 0.985 1.000 0.000
#> SRR1791367 1 0.000 0.985 1.000 0.000
#> SRR1791363 1 0.000 0.985 1.000 0.000
#> SRR1791361 1 0.000 0.985 1.000 0.000
#> SRR1791360 1 0.000 0.985 1.000 0.000
#> SRR1791359 2 0.000 1.000 0.000 1.000
#> SRR1791358 2 0.000 1.000 0.000 1.000
#> SRR1791365 2 0.000 1.000 0.000 1.000
#> SRR1791357 1 0.000 0.985 1.000 0.000
#> SRR1791356 1 0.000 0.985 1.000 0.000
#> SRR1791355 2 0.000 1.000 0.000 1.000
#> SRR1791362 1 0.000 0.985 1.000 0.000
#> SRR1791354 2 0.000 1.000 0.000 1.000
#> SRR1791353 1 0.000 0.985 1.000 0.000
#> SRR1791352 1 0.000 0.985 1.000 0.000
#> SRR1791349 2 0.000 1.000 0.000 1.000
#> SRR1791348 1 0.000 0.985 1.000 0.000
#> SRR1791351 2 0.000 1.000 0.000 1.000
#> SRR1791350 1 0.000 0.985 1.000 0.000
#> SRR1791339 1 0.671 0.791 0.824 0.176
#> SRR1791338 2 0.000 1.000 0.000 1.000
#> SRR1791336 2 0.000 1.000 0.000 1.000
#> SRR1791337 2 0.000 1.000 0.000 1.000
#> SRR1791335 2 0.000 1.000 0.000 1.000
#> SRR1791332 1 0.000 0.985 1.000 0.000
#> SRR1791331 2 0.000 1.000 0.000 1.000
#> SRR1791330 1 0.000 0.985 1.000 0.000
#> SRR1791334 1 0.000 0.985 1.000 0.000
#> SRR1791328 1 0.000 0.985 1.000 0.000
#> SRR1791327 2 0.000 1.000 0.000 1.000
#> SRR1791333 1 0.000 0.985 1.000 0.000
#> SRR1791326 2 0.000 1.000 0.000 1.000
#> SRR1791324 2 0.000 1.000 0.000 1.000
#> SRR1791323 2 0.000 1.000 0.000 1.000
#> SRR1791322 1 0.921 0.510 0.664 0.336
#> SRR1791329 2 0.000 1.000 0.000 1.000
#> SRR1791321 1 0.000 0.985 1.000 0.000
#> SRR1791320 1 0.000 0.985 1.000 0.000
#> SRR1791325 1 0.000 0.985 1.000 0.000
#> SRR1791318 1 0.000 0.985 1.000 0.000
#> SRR1791317 2 0.000 1.000 0.000 1.000
#> SRR1791313 1 0.000 0.985 1.000 0.000
#> SRR1791312 1 0.000 0.985 1.000 0.000
#> SRR1791319 1 0.000 0.985 1.000 0.000
#> SRR1791316 1 0.000 0.985 1.000 0.000
#> SRR1791315 1 0.000 0.985 1.000 0.000
#> SRR1791311 1 0.000 0.985 1.000 0.000
#> SRR1791314 2 0.000 1.000 0.000 1.000
#> SRR1791310 1 0.671 0.791 0.824 0.176
#> SRR1791308 2 0.000 1.000 0.000 1.000
#> SRR1791307 1 0.000 0.985 1.000 0.000
#> SRR1791306 1 0.000 0.985 1.000 0.000
#> SRR1791305 2 0.000 1.000 0.000 1.000
#> SRR1791309 2 0.000 1.000 0.000 1.000
#> SRR1791304 1 0.000 0.985 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791346 3 0.3116 0.890 0.000 0.108 0.892
#> SRR1791345 3 0.0892 0.920 0.020 0.000 0.980
#> SRR1791344 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791343 3 0.4504 0.797 0.000 0.196 0.804
#> SRR1791341 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791342 1 0.5254 0.668 0.736 0.000 0.264
#> SRR1791340 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791375 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791374 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791372 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791370 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791373 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791369 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791368 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791366 3 0.3116 0.890 0.000 0.108 0.892
#> SRR1791364 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791363 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791361 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791360 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791359 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791358 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791365 2 0.5178 0.670 0.000 0.744 0.256
#> SRR1791357 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791355 3 0.4504 0.797 0.000 0.196 0.804
#> SRR1791362 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791354 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791353 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791352 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791349 3 0.3116 0.890 0.000 0.108 0.892
#> SRR1791348 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791339 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791338 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791337 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791335 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791332 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791331 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791330 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791334 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791328 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791327 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791333 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791326 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791324 2 0.5178 0.670 0.000 0.744 0.256
#> SRR1791323 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791322 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791329 2 0.5254 0.656 0.000 0.736 0.264
#> SRR1791321 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791320 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791325 1 0.3941 0.824 0.844 0.000 0.156
#> SRR1791318 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791317 3 0.1753 0.921 0.000 0.048 0.952
#> SRR1791313 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791319 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791316 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791314 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791310 3 0.0000 0.938 0.000 0.000 1.000
#> SRR1791308 2 0.0000 0.932 0.000 1.000 0.000
#> SRR1791307 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791306 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1791305 3 0.4504 0.797 0.000 0.196 0.804
#> SRR1791309 3 0.3116 0.890 0.000 0.108 0.892
#> SRR1791304 1 0.0000 0.988 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 1 0.3024 0.754 0.852 0.000 0.148 0.000
#> SRR1791346 3 0.1118 0.932 0.036 0.000 0.964 0.000
#> SRR1791345 1 0.3024 0.751 0.852 0.000 0.148 0.000
#> SRR1791344 1 0.3761 0.750 0.852 0.000 0.068 0.080
#> SRR1791343 3 0.1118 0.932 0.036 0.000 0.964 0.000
#> SRR1791341 4 0.0592 0.887 0.016 0.000 0.000 0.984
#> SRR1791342 1 0.3400 0.714 0.820 0.000 0.000 0.180
#> SRR1791340 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791375 4 0.4948 -0.096 0.440 0.000 0.000 0.560
#> SRR1791374 1 0.4776 0.206 0.624 0.000 0.000 0.376
#> SRR1791372 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791370 1 0.3400 0.746 0.820 0.000 0.180 0.000
#> SRR1791373 1 0.2401 0.751 0.904 0.000 0.092 0.004
#> SRR1791369 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791371 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791368 4 0.0592 0.887 0.016 0.000 0.000 0.984
#> SRR1791366 3 0.1118 0.932 0.036 0.000 0.964 0.000
#> SRR1791364 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791367 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791363 4 0.0592 0.887 0.016 0.000 0.000 0.984
#> SRR1791361 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791360 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791359 3 0.0921 0.918 0.028 0.000 0.972 0.000
#> SRR1791358 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791365 3 0.3149 0.881 0.032 0.088 0.880 0.000
#> SRR1791357 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791356 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791355 3 0.1118 0.932 0.036 0.000 0.964 0.000
#> SRR1791362 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791354 3 0.0921 0.918 0.028 0.000 0.972 0.000
#> SRR1791353 4 0.0592 0.887 0.016 0.000 0.000 0.984
#> SRR1791352 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791349 3 0.1118 0.932 0.036 0.000 0.964 0.000
#> SRR1791348 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791351 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791350 4 0.0469 0.888 0.012 0.000 0.000 0.988
#> SRR1791339 1 0.3074 0.751 0.848 0.000 0.152 0.000
#> SRR1791338 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.1211 0.911 0.040 0.000 0.960 0.000
#> SRR1791335 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791332 4 0.0592 0.887 0.016 0.000 0.000 0.984
#> SRR1791331 3 0.4661 0.491 0.348 0.000 0.652 0.000
#> SRR1791330 4 0.0188 0.889 0.004 0.000 0.000 0.996
#> SRR1791334 4 0.0000 0.890 0.000 0.000 0.000 1.000
#> SRR1791328 4 0.4522 0.340 0.320 0.000 0.000 0.680
#> SRR1791327 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.5000 0.227 0.504 0.000 0.000 0.496
#> SRR1791326 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791324 3 0.3149 0.881 0.032 0.088 0.880 0.000
#> SRR1791323 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791322 1 0.3873 0.707 0.772 0.000 0.228 0.000
#> SRR1791329 3 0.3149 0.881 0.032 0.088 0.880 0.000
#> SRR1791321 4 0.1022 0.892 0.032 0.000 0.000 0.968
#> SRR1791320 1 0.3249 0.757 0.852 0.000 0.140 0.008
#> SRR1791325 1 0.2868 0.723 0.864 0.000 0.000 0.136
#> SRR1791318 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791317 3 0.0188 0.924 0.004 0.000 0.996 0.000
#> SRR1791313 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791312 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791319 1 0.4817 0.168 0.612 0.000 0.000 0.388
#> SRR1791316 4 0.2814 0.892 0.132 0.000 0.000 0.868
#> SRR1791315 4 0.2921 0.890 0.140 0.000 0.000 0.860
#> SRR1791311 4 0.0469 0.888 0.012 0.000 0.000 0.988
#> SRR1791314 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> SRR1791310 1 0.3024 0.754 0.852 0.000 0.148 0.000
#> SRR1791308 2 0.3764 0.717 0.000 0.784 0.216 0.000
#> SRR1791307 4 0.0592 0.887 0.016 0.000 0.000 0.984
#> SRR1791306 4 0.0592 0.887 0.016 0.000 0.000 0.984
#> SRR1791305 3 0.1118 0.932 0.036 0.000 0.964 0.000
#> SRR1791309 3 0.0188 0.924 0.004 0.000 0.996 0.000
#> SRR1791304 4 0.2814 0.892 0.132 0.000 0.000 0.868
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 5 0.0671 0.84801 0.000 0.000 0.016 0.004 0.980
#> SRR1791346 3 0.0000 0.87239 0.000 0.000 1.000 0.000 0.000
#> SRR1791345 5 0.2172 0.83254 0.000 0.000 0.016 0.076 0.908
#> SRR1791344 5 0.0693 0.84439 0.000 0.000 0.008 0.012 0.980
#> SRR1791343 3 0.0000 0.87239 0.000 0.000 1.000 0.000 0.000
#> SRR1791341 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791342 5 0.1544 0.81859 0.000 0.000 0.000 0.068 0.932
#> SRR1791340 2 0.0955 0.94201 0.000 0.968 0.000 0.028 0.004
#> SRR1791375 4 0.5562 0.63977 0.156 0.000 0.000 0.644 0.200
#> SRR1791374 4 0.6549 0.53786 0.360 0.000 0.000 0.436 0.204
#> SRR1791372 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791370 5 0.2389 0.79432 0.000 0.000 0.004 0.116 0.880
#> SRR1791373 5 0.1483 0.84005 0.008 0.000 0.012 0.028 0.952
#> SRR1791369 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791371 1 0.3857 0.00768 0.688 0.000 0.000 0.312 0.000
#> SRR1791368 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791366 3 0.0000 0.87239 0.000 0.000 1.000 0.000 0.000
#> SRR1791364 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.3857 0.00768 0.688 0.000 0.000 0.312 0.000
#> SRR1791363 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791361 4 0.4709 0.48333 0.364 0.000 0.000 0.612 0.024
#> SRR1791360 4 0.4101 0.46606 0.372 0.000 0.000 0.628 0.000
#> SRR1791359 3 0.4594 0.75646 0.000 0.000 0.680 0.284 0.036
#> SRR1791358 2 0.0000 0.94869 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 3 0.0912 0.86259 0.000 0.012 0.972 0.016 0.000
#> SRR1791357 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.0162 0.74871 0.996 0.000 0.000 0.004 0.000
#> SRR1791355 3 0.0000 0.87239 0.000 0.000 1.000 0.000 0.000
#> SRR1791362 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791354 3 0.4594 0.75646 0.000 0.000 0.680 0.284 0.036
#> SRR1791353 1 0.3480 0.68785 0.752 0.000 0.000 0.248 0.000
#> SRR1791352 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791349 3 0.0000 0.87239 0.000 0.000 1.000 0.000 0.000
#> SRR1791348 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 0.94869 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791339 5 0.0609 0.84697 0.000 0.000 0.020 0.000 0.980
#> SRR1791338 2 0.0566 0.94582 0.000 0.984 0.000 0.012 0.004
#> SRR1791336 2 0.0566 0.94582 0.000 0.984 0.000 0.012 0.004
#> SRR1791337 3 0.6273 0.56265 0.000 0.000 0.524 0.292 0.184
#> SRR1791335 2 0.0000 0.94869 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791331 5 0.4045 0.44468 0.000 0.000 0.356 0.000 0.644
#> SRR1791330 4 0.4302 0.10313 0.480 0.000 0.000 0.520 0.000
#> SRR1791334 1 0.3336 0.71076 0.772 0.000 0.000 0.228 0.000
#> SRR1791328 4 0.5699 0.64792 0.220 0.000 0.000 0.624 0.156
#> SRR1791327 2 0.0000 0.94869 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 4 0.6043 0.49894 0.140 0.000 0.000 0.540 0.320
#> SRR1791326 2 0.1469 0.92177 0.000 0.948 0.036 0.016 0.000
#> SRR1791324 3 0.0912 0.86259 0.000 0.012 0.972 0.016 0.000
#> SRR1791323 2 0.0510 0.94467 0.000 0.984 0.000 0.016 0.000
#> SRR1791322 5 0.5967 0.38618 0.000 0.000 0.136 0.308 0.556
#> SRR1791329 3 0.0912 0.86259 0.000 0.012 0.972 0.016 0.000
#> SRR1791321 1 0.3274 0.71303 0.780 0.000 0.000 0.220 0.000
#> SRR1791320 5 0.0671 0.84801 0.000 0.000 0.016 0.004 0.980
#> SRR1791325 5 0.4533 0.26939 0.008 0.000 0.000 0.448 0.544
#> SRR1791318 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.4184 0.76874 0.000 0.000 0.700 0.284 0.016
#> SRR1791313 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791312 1 0.2732 0.49486 0.840 0.000 0.000 0.160 0.000
#> SRR1791319 4 0.6549 0.53786 0.360 0.000 0.000 0.436 0.204
#> SRR1791316 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.75249 1.000 0.000 0.000 0.000 0.000
#> SRR1791311 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791314 2 0.0000 0.94869 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.0671 0.84801 0.000 0.000 0.016 0.004 0.980
#> SRR1791308 2 0.4949 0.39869 0.000 0.600 0.368 0.028 0.004
#> SRR1791307 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791306 1 0.3366 0.70921 0.768 0.000 0.000 0.232 0.000
#> SRR1791305 3 0.0000 0.87239 0.000 0.000 1.000 0.000 0.000
#> SRR1791309 3 0.4184 0.76874 0.000 0.000 0.700 0.284 0.016
#> SRR1791304 1 0.0000 0.75249 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
#> SRR1791347 5 0.5651 0.3756 0.344 0.000 0.164 0.000 0.492 0.000
#> SRR1791346 2 0.0146 0.9215 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1791345 3 0.6037 -0.2493 0.352 0.000 0.396 0.000 0.252 0.000
#> SRR1791344 5 0.5651 0.3756 0.344 0.000 0.164 0.000 0.492 0.000
#> SRR1791343 2 0.0000 0.9231 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791341 4 0.0146 0.6292 0.000 0.000 0.004 0.996 0.000 0.000
#> SRR1791342 1 0.6122 -0.5262 0.356 0.000 0.308 0.000 0.336 0.000
#> SRR1791340 6 0.1970 0.9147 0.092 0.000 0.008 0.000 0.000 0.900
#> SRR1791375 3 0.3592 0.5239 0.020 0.000 0.740 0.240 0.000 0.000
#> SRR1791374 3 0.3529 0.3842 0.208 0.000 0.764 0.028 0.000 0.000
#> SRR1791372 4 0.3647 0.5673 0.360 0.000 0.000 0.640 0.000 0.000
#> SRR1791370 3 0.4941 0.1805 0.140 0.000 0.648 0.000 0.212 0.000
#> SRR1791373 5 0.6028 0.3206 0.316 0.000 0.264 0.000 0.420 0.000
#> SRR1791369 4 0.3647 0.5673 0.360 0.000 0.000 0.640 0.000 0.000
#> SRR1791371 1 0.5933 0.2997 0.452 0.000 0.312 0.236 0.000 0.000
#> SRR1791368 4 0.0146 0.6292 0.000 0.000 0.004 0.996 0.000 0.000
#> SRR1791366 2 0.0000 0.9231 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791364 4 0.3659 0.5665 0.364 0.000 0.000 0.636 0.000 0.000
#> SRR1791367 1 0.5941 0.3006 0.448 0.000 0.316 0.236 0.000 0.000
#> SRR1791363 4 0.0146 0.6292 0.000 0.000 0.004 0.996 0.000 0.000
#> SRR1791361 3 0.5466 0.3254 0.124 0.000 0.472 0.404 0.000 0.000
#> SRR1791360 3 0.5295 0.3295 0.104 0.000 0.500 0.396 0.000 0.000
#> SRR1791359 5 0.3997 -0.1356 0.004 0.488 0.000 0.000 0.508 0.000
#> SRR1791358 6 0.0000 0.9554 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791365 2 0.0603 0.9163 0.016 0.980 0.000 0.000 0.000 0.004
#> SRR1791357 4 0.3659 0.5665 0.364 0.000 0.000 0.636 0.000 0.000
#> SRR1791356 4 0.3854 0.4296 0.464 0.000 0.000 0.536 0.000 0.000
#> SRR1791355 2 0.0000 0.9231 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791362 4 0.2538 0.5584 0.124 0.000 0.016 0.860 0.000 0.000
#> SRR1791354 5 0.3867 -0.1355 0.000 0.488 0.000 0.000 0.512 0.000
#> SRR1791353 4 0.3206 0.4963 0.104 0.000 0.068 0.828 0.000 0.000
#> SRR1791352 4 0.3659 0.5665 0.364 0.000 0.000 0.636 0.000 0.000
#> SRR1791349 2 0.0000 0.9231 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791348 4 0.3992 0.5480 0.364 0.000 0.012 0.624 0.000 0.000
#> SRR1791351 6 0.0000 0.9554 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791350 4 0.0458 0.6272 0.000 0.000 0.016 0.984 0.000 0.000
#> SRR1791339 5 0.5651 0.3756 0.344 0.000 0.164 0.000 0.492 0.000
#> SRR1791338 6 0.0146 0.9545 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1791336 6 0.0146 0.9545 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1791337 5 0.3911 0.0250 0.000 0.368 0.008 0.000 0.624 0.000
#> SRR1791335 6 0.0000 0.9554 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791332 4 0.0146 0.6292 0.000 0.000 0.004 0.996 0.000 0.000
#> SRR1791331 5 0.6884 0.3321 0.252 0.192 0.088 0.000 0.468 0.000
#> SRR1791330 4 0.5219 0.0157 0.124 0.000 0.296 0.580 0.000 0.000
#> SRR1791334 4 0.2709 0.5456 0.132 0.000 0.020 0.848 0.000 0.000
#> SRR1791328 3 0.4580 0.4632 0.052 0.000 0.612 0.336 0.000 0.000
#> SRR1791327 6 0.0000 0.9554 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791333 3 0.4224 0.5283 0.024 0.000 0.732 0.212 0.032 0.000
#> SRR1791326 6 0.4247 0.7406 0.092 0.164 0.004 0.000 0.000 0.740
#> SRR1791324 2 0.0603 0.9163 0.016 0.980 0.000 0.000 0.000 0.004
#> SRR1791323 6 0.1858 0.9155 0.092 0.000 0.004 0.000 0.000 0.904
#> SRR1791322 5 0.3564 0.2721 0.016 0.088 0.076 0.000 0.820 0.000
#> SRR1791329 2 0.0603 0.9163 0.016 0.980 0.000 0.000 0.000 0.004
#> SRR1791321 4 0.2664 0.5560 0.136 0.000 0.016 0.848 0.000 0.000
#> SRR1791320 5 0.5651 0.3756 0.344 0.000 0.164 0.000 0.492 0.000
#> SRR1791325 3 0.2494 0.4548 0.016 0.000 0.864 0.000 0.120 0.000
#> SRR1791318 4 0.3659 0.5665 0.364 0.000 0.000 0.636 0.000 0.000
#> SRR1791317 5 0.3999 -0.1506 0.004 0.496 0.000 0.000 0.500 0.000
#> SRR1791313 4 0.3634 0.5681 0.356 0.000 0.000 0.644 0.000 0.000
#> SRR1791312 1 0.5469 -0.2377 0.468 0.000 0.124 0.408 0.000 0.000
#> SRR1791319 3 0.3529 0.3842 0.208 0.000 0.764 0.028 0.000 0.000
#> SRR1791316 4 0.3659 0.5665 0.364 0.000 0.000 0.636 0.000 0.000
#> SRR1791315 4 0.3547 0.5675 0.332 0.000 0.000 0.668 0.000 0.000
#> SRR1791311 4 0.0363 0.6269 0.000 0.000 0.012 0.988 0.000 0.000
#> SRR1791314 6 0.0000 0.9554 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1791310 5 0.5651 0.3756 0.344 0.000 0.164 0.000 0.492 0.000
#> SRR1791308 2 0.5218 0.2017 0.088 0.544 0.004 0.000 0.000 0.364
#> SRR1791307 4 0.0146 0.6292 0.000 0.000 0.004 0.996 0.000 0.000
#> SRR1791306 4 0.0146 0.6292 0.000 0.000 0.004 0.996 0.000 0.000
#> SRR1791305 2 0.0000 0.9231 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791309 5 0.3999 -0.1506 0.004 0.496 0.000 0.000 0.500 0.000
#> SRR1791304 4 0.3659 0.5665 0.364 0.000 0.000 0.636 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "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 15854 rows and 72 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 1.000 0.966 0.986 0.4975 0.507 0.507
#> 3 3 0.898 0.912 0.947 0.1549 0.908 0.820
#> 4 4 1.000 0.918 0.964 0.1087 0.923 0.821
#> 5 5 0.845 0.840 0.909 0.0659 0.995 0.986
#> 6 6 0.831 0.775 0.857 0.0336 0.984 0.953
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1791347 2 0.000 1.000 0.000 1.000
#> SRR1791346 2 0.000 1.000 0.000 1.000
#> SRR1791345 1 0.952 0.416 0.628 0.372
#> SRR1791344 1 0.662 0.787 0.828 0.172
#> SRR1791343 2 0.000 1.000 0.000 1.000
#> SRR1791341 1 0.000 0.976 1.000 0.000
#> SRR1791342 1 0.000 0.976 1.000 0.000
#> SRR1791340 2 0.000 1.000 0.000 1.000
#> SRR1791375 1 0.000 0.976 1.000 0.000
#> SRR1791374 1 0.000 0.976 1.000 0.000
#> SRR1791372 1 0.000 0.976 1.000 0.000
#> SRR1791370 1 0.000 0.976 1.000 0.000
#> SRR1791373 1 0.184 0.951 0.972 0.028
#> SRR1791369 1 0.000 0.976 1.000 0.000
#> SRR1791371 1 0.000 0.976 1.000 0.000
#> SRR1791368 1 0.000 0.976 1.000 0.000
#> SRR1791366 2 0.000 1.000 0.000 1.000
#> SRR1791364 1 0.000 0.976 1.000 0.000
#> SRR1791367 1 0.000 0.976 1.000 0.000
#> SRR1791363 1 0.000 0.976 1.000 0.000
#> SRR1791361 1 0.000 0.976 1.000 0.000
#> SRR1791360 1 0.000 0.976 1.000 0.000
#> SRR1791359 2 0.000 1.000 0.000 1.000
#> SRR1791358 2 0.000 1.000 0.000 1.000
#> SRR1791365 2 0.000 1.000 0.000 1.000
#> SRR1791357 1 0.000 0.976 1.000 0.000
#> SRR1791356 1 0.000 0.976 1.000 0.000
#> SRR1791355 2 0.000 1.000 0.000 1.000
#> SRR1791362 1 0.000 0.976 1.000 0.000
#> SRR1791354 2 0.000 1.000 0.000 1.000
#> SRR1791353 1 0.000 0.976 1.000 0.000
#> SRR1791352 1 0.000 0.976 1.000 0.000
#> SRR1791349 2 0.000 1.000 0.000 1.000
#> SRR1791348 1 0.000 0.976 1.000 0.000
#> SRR1791351 2 0.000 1.000 0.000 1.000
#> SRR1791350 1 0.000 0.976 1.000 0.000
#> SRR1791339 2 0.000 1.000 0.000 1.000
#> SRR1791338 2 0.000 1.000 0.000 1.000
#> SRR1791336 2 0.000 1.000 0.000 1.000
#> SRR1791337 2 0.000 1.000 0.000 1.000
#> SRR1791335 2 0.000 1.000 0.000 1.000
#> SRR1791332 1 0.000 0.976 1.000 0.000
#> SRR1791331 2 0.000 1.000 0.000 1.000
#> SRR1791330 1 0.000 0.976 1.000 0.000
#> SRR1791334 1 0.000 0.976 1.000 0.000
#> SRR1791328 1 0.000 0.976 1.000 0.000
#> SRR1791327 2 0.000 1.000 0.000 1.000
#> SRR1791333 1 0.000 0.976 1.000 0.000
#> SRR1791326 2 0.000 1.000 0.000 1.000
#> SRR1791324 2 0.000 1.000 0.000 1.000
#> SRR1791323 2 0.000 1.000 0.000 1.000
#> SRR1791322 2 0.000 1.000 0.000 1.000
#> SRR1791329 2 0.000 1.000 0.000 1.000
#> SRR1791321 1 0.000 0.976 1.000 0.000
#> SRR1791320 1 0.975 0.331 0.592 0.408
#> SRR1791325 1 0.000 0.976 1.000 0.000
#> SRR1791318 1 0.000 0.976 1.000 0.000
#> SRR1791317 2 0.000 1.000 0.000 1.000
#> SRR1791313 1 0.000 0.976 1.000 0.000
#> SRR1791312 1 0.000 0.976 1.000 0.000
#> SRR1791319 1 0.000 0.976 1.000 0.000
#> SRR1791316 1 0.000 0.976 1.000 0.000
#> SRR1791315 1 0.000 0.976 1.000 0.000
#> SRR1791311 1 0.000 0.976 1.000 0.000
#> SRR1791314 2 0.000 1.000 0.000 1.000
#> SRR1791310 2 0.000 1.000 0.000 1.000
#> SRR1791308 2 0.000 1.000 0.000 1.000
#> SRR1791307 1 0.000 0.976 1.000 0.000
#> SRR1791306 1 0.000 0.976 1.000 0.000
#> SRR1791305 2 0.000 1.000 0.000 1.000
#> SRR1791309 2 0.000 1.000 0.000 1.000
#> SRR1791304 1 0.000 0.976 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 2 0.4654 0.748 0.000 0.792 0.208
#> SRR1791346 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791345 3 0.8119 0.274 0.432 0.068 0.500
#> SRR1791344 1 0.8072 0.507 0.648 0.144 0.208
#> SRR1791343 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791341 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791342 1 0.2711 0.886 0.912 0.000 0.088
#> SRR1791340 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791375 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791374 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791372 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791370 3 0.4654 0.684 0.208 0.000 0.792
#> SRR1791373 1 0.6693 0.663 0.748 0.104 0.148
#> SRR1791369 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791368 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791366 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791364 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791367 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791363 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791361 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791360 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791359 3 0.4654 0.851 0.000 0.208 0.792
#> SRR1791358 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791365 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791357 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791356 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791355 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791362 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791354 3 0.4654 0.851 0.000 0.208 0.792
#> SRR1791353 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791352 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791349 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791348 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791350 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791339 2 0.3340 0.850 0.000 0.880 0.120
#> SRR1791338 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791337 3 0.4654 0.851 0.000 0.208 0.792
#> SRR1791335 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791332 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791331 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791330 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791334 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791328 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791327 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791333 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791326 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791324 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791323 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791322 3 0.4654 0.851 0.000 0.208 0.792
#> SRR1791329 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791321 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791320 1 0.9503 0.127 0.476 0.316 0.208
#> SRR1791325 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791318 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791317 3 0.4654 0.851 0.000 0.208 0.792
#> SRR1791313 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791319 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791316 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1791314 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791310 2 0.4654 0.748 0.000 0.792 0.208
#> SRR1791308 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791307 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791306 1 0.0424 0.961 0.992 0.000 0.008
#> SRR1791305 2 0.0000 0.972 0.000 1.000 0.000
#> SRR1791309 3 0.4654 0.851 0.000 0.208 0.792
#> SRR1791304 1 0.0000 0.964 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.1389 0.6561 0.000 0.048 0.000 0.952
#> SRR1791346 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791345 3 0.5662 0.0562 0.456 0.004 0.524 0.016
#> SRR1791344 4 0.0336 0.6716 0.008 0.000 0.000 0.992
#> SRR1791343 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791341 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791342 4 0.4925 0.2507 0.428 0.000 0.000 0.572
#> SRR1791340 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791375 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791374 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791372 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791370 3 0.0592 0.8537 0.016 0.000 0.984 0.000
#> SRR1791373 4 0.4804 0.4195 0.384 0.000 0.000 0.616
#> SRR1791369 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791371 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791368 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791366 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791364 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791363 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791361 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791360 1 0.1706 0.9645 0.948 0.000 0.016 0.036
#> SRR1791359 3 0.0592 0.8747 0.000 0.016 0.984 0.000
#> SRR1791358 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791357 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791355 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791362 1 0.1706 0.9645 0.948 0.000 0.016 0.036
#> SRR1791354 3 0.0592 0.8747 0.000 0.016 0.984 0.000
#> SRR1791353 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791352 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791349 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791348 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.1706 0.9645 0.948 0.000 0.016 0.036
#> SRR1791339 2 0.2149 0.9047 0.000 0.912 0.000 0.088
#> SRR1791338 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.0592 0.8747 0.000 0.016 0.984 0.000
#> SRR1791335 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791331 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791330 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791334 1 0.1388 0.9663 0.960 0.000 0.012 0.028
#> SRR1791328 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791327 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.1706 0.9645 0.948 0.000 0.016 0.036
#> SRR1791326 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791324 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791323 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.0592 0.8747 0.000 0.016 0.984 0.000
#> SRR1791329 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791321 1 0.0804 0.9678 0.980 0.000 0.012 0.008
#> SRR1791320 4 0.0524 0.6734 0.008 0.004 0.000 0.988
#> SRR1791325 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791318 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.0592 0.8747 0.000 0.016 0.984 0.000
#> SRR1791313 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791319 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791316 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.9685 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.1706 0.9645 0.948 0.000 0.016 0.036
#> SRR1791314 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.1792 0.6459 0.000 0.068 0.000 0.932
#> SRR1791308 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791307 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791306 1 0.1888 0.9620 0.940 0.000 0.016 0.044
#> SRR1791305 2 0.0000 0.9958 0.000 1.000 0.000 0.000
#> SRR1791309 3 0.0592 0.8747 0.000 0.016 0.984 0.000
#> SRR1791304 1 0.0000 0.9685 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
#> SRR1791347 5 0.0579 0.6780 0.000 0.008 0.000 0.008 0.984
#> SRR1791346 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791345 4 0.6153 0.2711 0.156 0.000 0.276 0.564 0.004
#> SRR1791344 5 0.0703 0.6794 0.000 0.000 0.000 0.024 0.976
#> SRR1791343 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791341 1 0.3395 0.8337 0.764 0.000 0.000 0.236 0.000
#> SRR1791342 5 0.5252 -0.0557 0.364 0.000 0.000 0.056 0.580
#> SRR1791340 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791375 1 0.3816 0.7813 0.696 0.000 0.000 0.304 0.000
#> SRR1791374 1 0.2074 0.7342 0.896 0.000 0.000 0.104 0.000
#> SRR1791372 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791370 3 0.3612 0.6349 0.000 0.000 0.732 0.268 0.000
#> SRR1791373 4 0.6590 0.2055 0.228 0.000 0.000 0.452 0.320
#> SRR1791369 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791371 1 0.0162 0.8275 0.996 0.000 0.000 0.004 0.000
#> SRR1791368 1 0.3395 0.8337 0.764 0.000 0.000 0.236 0.000
#> SRR1791366 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791364 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791367 1 0.0162 0.8275 0.996 0.000 0.000 0.004 0.000
#> SRR1791363 1 0.3395 0.8337 0.764 0.000 0.000 0.236 0.000
#> SRR1791361 1 0.3424 0.8315 0.760 0.000 0.000 0.240 0.000
#> SRR1791360 1 0.3366 0.8350 0.768 0.000 0.000 0.232 0.000
#> SRR1791359 3 0.0000 0.9506 0.000 0.000 1.000 0.000 0.000
#> SRR1791358 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791356 1 0.0162 0.8275 0.996 0.000 0.000 0.004 0.000
#> SRR1791355 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791362 1 0.3336 0.8360 0.772 0.000 0.000 0.228 0.000
#> SRR1791354 3 0.0000 0.9506 0.000 0.000 1.000 0.000 0.000
#> SRR1791353 1 0.3395 0.8337 0.764 0.000 0.000 0.236 0.000
#> SRR1791352 1 0.0162 0.8275 0.996 0.000 0.000 0.004 0.000
#> SRR1791349 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791348 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 1 0.3336 0.8360 0.772 0.000 0.000 0.228 0.000
#> SRR1791339 2 0.3644 0.7961 0.000 0.824 0.000 0.080 0.096
#> SRR1791338 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791336 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791337 3 0.0000 0.9506 0.000 0.000 1.000 0.000 0.000
#> SRR1791335 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 1 0.3395 0.8337 0.764 0.000 0.000 0.236 0.000
#> SRR1791331 2 0.0162 0.9881 0.000 0.996 0.000 0.000 0.004
#> SRR1791330 1 0.3366 0.8350 0.768 0.000 0.000 0.232 0.000
#> SRR1791334 1 0.3177 0.8385 0.792 0.000 0.000 0.208 0.000
#> SRR1791328 1 0.3395 0.8337 0.764 0.000 0.000 0.236 0.000
#> SRR1791327 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 1 0.3305 0.8370 0.776 0.000 0.000 0.224 0.000
#> SRR1791326 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.0000 0.9506 0.000 0.000 1.000 0.000 0.000
#> SRR1791329 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 1 0.3074 0.8391 0.804 0.000 0.000 0.196 0.000
#> SRR1791320 5 0.0794 0.6784 0.000 0.000 0.000 0.028 0.972
#> SRR1791325 1 0.3336 0.5370 0.772 0.000 0.000 0.228 0.000
#> SRR1791318 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 0.9506 0.000 0.000 1.000 0.000 0.000
#> SRR1791313 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791319 1 0.1965 0.7441 0.904 0.000 0.000 0.096 0.000
#> SRR1791316 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 0.8297 1.000 0.000 0.000 0.000 0.000
#> SRR1791311 1 0.3366 0.8351 0.768 0.000 0.000 0.232 0.000
#> SRR1791314 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 5 0.1914 0.6179 0.000 0.060 0.000 0.016 0.924
#> SRR1791308 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791307 1 0.3395 0.8337 0.764 0.000 0.000 0.236 0.000
#> SRR1791306 1 0.3395 0.8337 0.764 0.000 0.000 0.236 0.000
#> SRR1791305 2 0.0000 0.9916 0.000 1.000 0.000 0.000 0.000
#> SRR1791309 3 0.0000 0.9506 0.000 0.000 1.000 0.000 0.000
#> SRR1791304 1 0.0162 0.8275 0.996 0.000 0.000 0.004 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.2078 0.5867 0.040 0.012 0.000 0.000 0.916 0.032
#> SRR1791346 2 0.0146 0.9777 0.000 0.996 0.004 0.000 0.000 0.000
#> SRR1791345 1 0.5080 0.6246 0.696 0.000 0.064 0.048 0.004 0.188
#> SRR1791344 5 0.2887 0.5452 0.104 0.000 0.000 0.008 0.856 0.032
#> SRR1791343 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791341 4 0.0000 0.7615 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791342 5 0.6175 0.0600 0.076 0.000 0.000 0.376 0.476 0.072
#> SRR1791340 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791375 4 0.2402 0.6122 0.004 0.000 0.000 0.856 0.000 0.140
#> SRR1791374 4 0.3867 0.4779 0.000 0.000 0.000 0.512 0.000 0.488
#> SRR1791372 4 0.3428 0.7549 0.000 0.000 0.000 0.696 0.000 0.304
#> SRR1791370 6 0.4758 -0.4824 0.048 0.000 0.476 0.000 0.000 0.476
#> SRR1791373 1 0.3611 0.5811 0.796 0.000 0.000 0.000 0.096 0.108
#> SRR1791369 4 0.3428 0.7549 0.000 0.000 0.000 0.696 0.000 0.304
#> SRR1791371 4 0.3482 0.7464 0.000 0.000 0.000 0.684 0.000 0.316
#> SRR1791368 4 0.0000 0.7615 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791366 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791364 4 0.3428 0.7549 0.000 0.000 0.000 0.696 0.000 0.304
#> SRR1791367 4 0.3482 0.7464 0.000 0.000 0.000 0.684 0.000 0.316
#> SRR1791363 4 0.0603 0.7524 0.004 0.000 0.000 0.980 0.000 0.016
#> SRR1791361 4 0.0865 0.7361 0.000 0.000 0.000 0.964 0.000 0.036
#> SRR1791360 4 0.0260 0.7619 0.000 0.000 0.000 0.992 0.000 0.008
#> SRR1791359 3 0.0000 0.9991 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791358 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791365 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791357 4 0.3446 0.7525 0.000 0.000 0.000 0.692 0.000 0.308
#> SRR1791356 4 0.3482 0.7464 0.000 0.000 0.000 0.684 0.000 0.316
#> SRR1791355 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791362 4 0.0363 0.7657 0.000 0.000 0.000 0.988 0.000 0.012
#> SRR1791354 3 0.0000 0.9991 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791353 4 0.0692 0.7495 0.004 0.000 0.000 0.976 0.000 0.020
#> SRR1791352 4 0.3464 0.7496 0.000 0.000 0.000 0.688 0.000 0.312
#> SRR1791349 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791348 4 0.3428 0.7549 0.000 0.000 0.000 0.696 0.000 0.304
#> SRR1791351 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791350 4 0.0458 0.7668 0.000 0.000 0.000 0.984 0.000 0.016
#> SRR1791339 2 0.5771 0.4358 0.100 0.624 0.000 0.000 0.208 0.068
#> SRR1791338 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791336 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791337 3 0.0000 0.9991 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791335 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791332 4 0.0146 0.7615 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1791331 2 0.0146 0.9781 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1791330 4 0.0146 0.7630 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1791334 4 0.1610 0.7733 0.000 0.000 0.000 0.916 0.000 0.084
#> SRR1791328 4 0.0777 0.7464 0.004 0.000 0.000 0.972 0.000 0.024
#> SRR1791327 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791333 4 0.1814 0.7594 0.000 0.000 0.000 0.900 0.000 0.100
#> SRR1791326 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791323 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791322 3 0.0146 0.9956 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR1791329 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791321 4 0.1765 0.7734 0.000 0.000 0.000 0.904 0.000 0.096
#> SRR1791320 5 0.2119 0.5765 0.060 0.000 0.000 0.000 0.904 0.036
#> SRR1791325 6 0.4234 -0.0603 0.044 0.000 0.000 0.280 0.000 0.676
#> SRR1791318 4 0.3428 0.7549 0.000 0.000 0.000 0.696 0.000 0.304
#> SRR1791317 3 0.0000 0.9991 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791313 4 0.3428 0.7549 0.000 0.000 0.000 0.696 0.000 0.304
#> SRR1791312 4 0.3428 0.7549 0.000 0.000 0.000 0.696 0.000 0.304
#> SRR1791319 4 0.4086 0.5047 0.008 0.000 0.000 0.528 0.000 0.464
#> SRR1791316 4 0.3446 0.7525 0.000 0.000 0.000 0.692 0.000 0.308
#> SRR1791315 4 0.3409 0.7550 0.000 0.000 0.000 0.700 0.000 0.300
#> SRR1791311 4 0.0260 0.7646 0.000 0.000 0.000 0.992 0.000 0.008
#> SRR1791314 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791310 5 0.3294 0.5368 0.040 0.064 0.000 0.000 0.848 0.048
#> SRR1791308 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791307 4 0.0603 0.7524 0.004 0.000 0.000 0.980 0.000 0.016
#> SRR1791306 4 0.0000 0.7615 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1791305 2 0.0000 0.9814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1791309 3 0.0000 0.9991 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1791304 4 0.3446 0.7525 0.000 0.000 0.000 0.692 0.000 0.308
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 15854 rows and 72 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.977 0.991 0.490 0.512 0.512
#> 3 3 0.840 0.837 0.890 0.245 0.808 0.641
#> 4 4 0.960 0.935 0.974 0.111 0.925 0.802
#> 5 5 1.000 0.965 0.988 0.033 0.971 0.911
#> 6 6 0.855 0.686 0.857 0.100 0.935 0.784
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2 4
There is also optional best \(k\) = 2 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1791347 1 0.971 0.333 0.600 0.400
#> SRR1791346 2 0.000 0.995 0.000 1.000
#> SRR1791345 1 0.000 0.988 1.000 0.000
#> SRR1791344 1 0.000 0.988 1.000 0.000
#> SRR1791343 2 0.000 0.995 0.000 1.000
#> SRR1791341 1 0.000 0.988 1.000 0.000
#> SRR1791342 1 0.000 0.988 1.000 0.000
#> SRR1791340 2 0.000 0.995 0.000 1.000
#> SRR1791375 1 0.000 0.988 1.000 0.000
#> SRR1791374 1 0.000 0.988 1.000 0.000
#> SRR1791372 1 0.000 0.988 1.000 0.000
#> SRR1791370 1 0.000 0.988 1.000 0.000
#> SRR1791373 1 0.000 0.988 1.000 0.000
#> SRR1791369 1 0.000 0.988 1.000 0.000
#> SRR1791371 1 0.000 0.988 1.000 0.000
#> SRR1791368 1 0.000 0.988 1.000 0.000
#> SRR1791366 2 0.000 0.995 0.000 1.000
#> SRR1791364 1 0.000 0.988 1.000 0.000
#> SRR1791367 1 0.000 0.988 1.000 0.000
#> SRR1791363 1 0.000 0.988 1.000 0.000
#> SRR1791361 1 0.000 0.988 1.000 0.000
#> SRR1791360 1 0.000 0.988 1.000 0.000
#> SRR1791359 2 0.000 0.995 0.000 1.000
#> SRR1791358 2 0.000 0.995 0.000 1.000
#> SRR1791365 2 0.000 0.995 0.000 1.000
#> SRR1791357 1 0.000 0.988 1.000 0.000
#> SRR1791356 1 0.000 0.988 1.000 0.000
#> SRR1791355 2 0.000 0.995 0.000 1.000
#> SRR1791362 1 0.000 0.988 1.000 0.000
#> SRR1791354 2 0.000 0.995 0.000 1.000
#> SRR1791353 1 0.000 0.988 1.000 0.000
#> SRR1791352 1 0.000 0.988 1.000 0.000
#> SRR1791349 2 0.000 0.995 0.000 1.000
#> SRR1791348 1 0.000 0.988 1.000 0.000
#> SRR1791351 2 0.000 0.995 0.000 1.000
#> SRR1791350 1 0.000 0.988 1.000 0.000
#> SRR1791339 2 0.000 0.995 0.000 1.000
#> SRR1791338 2 0.000 0.995 0.000 1.000
#> SRR1791336 2 0.000 0.995 0.000 1.000
#> SRR1791337 2 0.000 0.995 0.000 1.000
#> SRR1791335 2 0.000 0.995 0.000 1.000
#> SRR1791332 1 0.000 0.988 1.000 0.000
#> SRR1791331 2 0.000 0.995 0.000 1.000
#> SRR1791330 1 0.000 0.988 1.000 0.000
#> SRR1791334 1 0.000 0.988 1.000 0.000
#> SRR1791328 1 0.000 0.988 1.000 0.000
#> SRR1791327 2 0.000 0.995 0.000 1.000
#> SRR1791333 1 0.000 0.988 1.000 0.000
#> SRR1791326 2 0.000 0.995 0.000 1.000
#> SRR1791324 2 0.000 0.995 0.000 1.000
#> SRR1791323 2 0.000 0.995 0.000 1.000
#> SRR1791322 2 0.000 0.995 0.000 1.000
#> SRR1791329 2 0.000 0.995 0.000 1.000
#> SRR1791321 1 0.000 0.988 1.000 0.000
#> SRR1791320 1 0.518 0.862 0.884 0.116
#> SRR1791325 1 0.000 0.988 1.000 0.000
#> SRR1791318 1 0.000 0.988 1.000 0.000
#> SRR1791317 2 0.000 0.995 0.000 1.000
#> SRR1791313 1 0.000 0.988 1.000 0.000
#> SRR1791312 1 0.000 0.988 1.000 0.000
#> SRR1791319 1 0.000 0.988 1.000 0.000
#> SRR1791316 1 0.000 0.988 1.000 0.000
#> SRR1791315 1 0.000 0.988 1.000 0.000
#> SRR1791311 1 0.000 0.988 1.000 0.000
#> SRR1791314 2 0.000 0.995 0.000 1.000
#> SRR1791310 2 0.584 0.833 0.140 0.860
#> SRR1791308 2 0.000 0.995 0.000 1.000
#> SRR1791307 1 0.000 0.988 1.000 0.000
#> SRR1791306 1 0.000 0.988 1.000 0.000
#> SRR1791305 2 0.000 0.995 0.000 1.000
#> SRR1791309 2 0.000 0.995 0.000 1.000
#> SRR1791304 1 0.000 0.988 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.6168 0.631 0.000 0.412 0.588
#> SRR1791346 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791345 3 0.5327 0.635 0.000 0.272 0.728
#> SRR1791344 3 0.0000 0.515 0.000 0.000 1.000
#> SRR1791343 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791341 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791342 3 0.0000 0.515 0.000 0.000 1.000
#> SRR1791340 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791375 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791374 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791372 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791370 3 0.0000 0.515 0.000 0.000 1.000
#> SRR1791373 3 0.0424 0.527 0.000 0.008 0.992
#> SRR1791369 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791371 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791368 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791366 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791364 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791367 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791363 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791361 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791360 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791359 3 0.6168 0.631 0.000 0.412 0.588
#> SRR1791358 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791365 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791357 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791356 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791355 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791362 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791354 3 0.6168 0.631 0.000 0.412 0.588
#> SRR1791353 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791352 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791349 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791348 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791351 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791350 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791339 3 0.6168 0.631 0.000 0.412 0.588
#> SRR1791338 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791336 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791337 3 0.6168 0.631 0.000 0.412 0.588
#> SRR1791335 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791332 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791331 3 0.6168 0.631 0.000 0.412 0.588
#> SRR1791330 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791334 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791328 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791327 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791333 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791326 2 0.0237 0.773 0.004 0.996 0.000
#> SRR1791324 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791323 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791322 3 0.6168 0.631 0.000 0.412 0.588
#> SRR1791329 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791321 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791320 3 0.0592 0.532 0.000 0.012 0.988
#> SRR1791325 3 0.0000 0.515 0.000 0.000 1.000
#> SRR1791318 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791317 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791313 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791312 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791319 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791316 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791315 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791311 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791314 2 0.6168 0.710 0.412 0.588 0.000
#> SRR1791310 3 0.6168 0.631 0.000 0.412 0.588
#> SRR1791308 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791307 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791306 1 0.6168 1.000 0.588 0.000 0.412
#> SRR1791305 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791309 2 0.0000 0.773 0.000 1.000 0.000
#> SRR1791304 1 0.6168 1.000 0.588 0.000 0.412
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791346 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791345 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791344 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791343 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791341 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791342 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791340 2 0.0592 0.948 0.000 0.984 0.016 0.000
#> SRR1791375 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791374 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791372 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791370 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791373 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791369 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791371 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791368 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791366 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791364 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791367 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791363 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791361 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791360 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791359 3 0.4356 0.594 0.000 0.000 0.708 0.292
#> SRR1791358 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> SRR1791365 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791357 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791356 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791355 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791362 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791354 3 0.4356 0.594 0.000 0.000 0.708 0.292
#> SRR1791353 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791352 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791349 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791348 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791351 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> SRR1791350 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791339 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791338 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.4804 0.410 0.000 0.000 0.616 0.384
#> SRR1791335 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791331 4 0.3837 0.677 0.000 0.000 0.224 0.776
#> SRR1791330 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791334 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791328 1 0.0188 0.996 0.996 0.000 0.000 0.004
#> SRR1791327 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> SRR1791333 1 0.0188 0.996 0.996 0.000 0.000 0.004
#> SRR1791326 3 0.1792 0.857 0.000 0.068 0.932 0.000
#> SRR1791324 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791323 2 0.4356 0.608 0.000 0.708 0.292 0.000
#> SRR1791322 4 0.2589 0.833 0.000 0.000 0.116 0.884
#> SRR1791329 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791321 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791320 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791325 4 0.3764 0.648 0.216 0.000 0.000 0.784
#> SRR1791318 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791317 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791313 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791312 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791319 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791316 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791315 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791311 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791314 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.0000 0.934 0.000 0.000 0.000 1.000
#> SRR1791308 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791307 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791306 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1791305 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791309 3 0.0000 0.920 0.000 0.000 1.000 0.000
#> SRR1791304 1 0.0000 1.000 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
#> SRR1791347 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791346 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791345 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791344 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791343 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791341 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791342 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791340 4 0.1410 0.9240 0.000 0.060 0.0 0.940 0.000
#> SRR1791375 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791374 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791372 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791370 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791373 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791369 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791371 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791368 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791366 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791364 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791367 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791363 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791361 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791360 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791359 3 0.0000 1.0000 0.000 0.000 1.0 0.000 0.000
#> SRR1791358 4 0.0000 0.9894 0.000 0.000 0.0 1.000 0.000
#> SRR1791365 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791357 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791356 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791355 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791362 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791354 3 0.0000 1.0000 0.000 0.000 1.0 0.000 0.000
#> SRR1791353 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791352 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791349 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791348 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791351 4 0.0000 0.9894 0.000 0.000 0.0 1.000 0.000
#> SRR1791350 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791339 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791338 4 0.0000 0.9894 0.000 0.000 0.0 1.000 0.000
#> SRR1791336 4 0.0000 0.9894 0.000 0.000 0.0 1.000 0.000
#> SRR1791337 3 0.0000 1.0000 0.000 0.000 1.0 0.000 0.000
#> SRR1791335 4 0.0000 0.9894 0.000 0.000 0.0 1.000 0.000
#> SRR1791332 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791331 5 0.0290 0.9115 0.000 0.008 0.0 0.000 0.992
#> SRR1791330 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791334 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791328 1 0.0510 0.9822 0.984 0.000 0.0 0.000 0.016
#> SRR1791327 4 0.0000 0.9894 0.000 0.000 0.0 1.000 0.000
#> SRR1791333 1 0.1121 0.9516 0.956 0.000 0.0 0.000 0.044
#> SRR1791326 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791324 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791323 2 0.0162 0.9956 0.000 0.996 0.0 0.004 0.000
#> SRR1791322 5 0.4307 0.0121 0.000 0.000 0.5 0.000 0.500
#> SRR1791329 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791321 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791320 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791325 5 0.3274 0.5848 0.220 0.000 0.0 0.000 0.780
#> SRR1791318 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791317 3 0.0000 1.0000 0.000 0.000 1.0 0.000 0.000
#> SRR1791313 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791312 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791319 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791316 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791315 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791311 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791314 4 0.0000 0.9894 0.000 0.000 0.0 1.000 0.000
#> SRR1791310 5 0.0000 0.9183 0.000 0.000 0.0 0.000 1.000
#> SRR1791308 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791307 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791306 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
#> SRR1791305 2 0.0000 0.9996 0.000 1.000 0.0 0.000 0.000
#> SRR1791309 3 0.0000 1.0000 0.000 0.000 1.0 0.000 0.000
#> SRR1791304 1 0.0000 0.9981 1.000 0.000 0.0 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.0000 0.889 0.000 0.00 0.000 0.000 1.000 0.00
#> SRR1791346 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791345 5 0.3607 0.646 0.348 0.00 0.000 0.000 0.652 0.00
#> SRR1791344 5 0.0000 0.889 0.000 0.00 0.000 0.000 1.000 0.00
#> SRR1791343 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791341 4 0.3823 0.545 0.436 0.00 0.000 0.564 0.000 0.00
#> SRR1791342 5 0.0000 0.889 0.000 0.00 0.000 0.000 1.000 0.00
#> SRR1791340 6 0.1267 0.924 0.000 0.06 0.000 0.000 0.000 0.94
#> SRR1791375 1 0.2527 0.400 0.832 0.00 0.000 0.168 0.000 0.00
#> SRR1791374 1 0.3672 0.418 0.632 0.00 0.000 0.368 0.000 0.00
#> SRR1791372 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
#> SRR1791370 5 0.3727 0.577 0.388 0.00 0.000 0.000 0.612 0.00
#> SRR1791373 5 0.0000 0.889 0.000 0.00 0.000 0.000 1.000 0.00
#> SRR1791369 4 0.3828 0.545 0.440 0.00 0.000 0.560 0.000 0.00
#> SRR1791371 4 0.0260 0.468 0.008 0.00 0.000 0.992 0.000 0.00
#> SRR1791368 4 0.3823 0.545 0.436 0.00 0.000 0.564 0.000 0.00
#> SRR1791366 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791364 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
#> SRR1791367 4 0.0260 0.468 0.008 0.00 0.000 0.992 0.000 0.00
#> SRR1791363 4 0.3823 0.545 0.436 0.00 0.000 0.564 0.000 0.00
#> SRR1791361 4 0.3833 0.541 0.444 0.00 0.000 0.556 0.000 0.00
#> SRR1791360 4 0.3833 0.541 0.444 0.00 0.000 0.556 0.000 0.00
#> SRR1791359 3 0.0000 0.999 0.000 0.00 1.000 0.000 0.000 0.00
#> SRR1791358 6 0.0000 0.989 0.000 0.00 0.000 0.000 0.000 1.00
#> SRR1791365 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791357 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
#> SRR1791356 4 0.0146 0.470 0.004 0.00 0.000 0.996 0.000 0.00
#> SRR1791355 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791362 4 0.3828 0.545 0.440 0.00 0.000 0.560 0.000 0.00
#> SRR1791354 3 0.0146 0.998 0.004 0.00 0.996 0.000 0.000 0.00
#> SRR1791353 4 0.3833 0.541 0.444 0.00 0.000 0.556 0.000 0.00
#> SRR1791352 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
#> SRR1791349 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791348 4 0.3782 0.533 0.412 0.00 0.000 0.588 0.000 0.00
#> SRR1791351 6 0.0000 0.989 0.000 0.00 0.000 0.000 0.000 1.00
#> SRR1791350 4 0.3828 0.545 0.440 0.00 0.000 0.560 0.000 0.00
#> SRR1791339 5 0.0000 0.889 0.000 0.00 0.000 0.000 1.000 0.00
#> SRR1791338 6 0.0000 0.989 0.000 0.00 0.000 0.000 0.000 1.00
#> SRR1791336 6 0.0000 0.989 0.000 0.00 0.000 0.000 0.000 1.00
#> SRR1791337 3 0.0146 0.998 0.004 0.00 0.996 0.000 0.000 0.00
#> SRR1791335 6 0.0000 0.989 0.000 0.00 0.000 0.000 0.000 1.00
#> SRR1791332 4 0.3823 0.545 0.436 0.00 0.000 0.564 0.000 0.00
#> SRR1791331 5 0.0000 0.889 0.000 0.00 0.000 0.000 1.000 0.00
#> SRR1791330 4 0.3833 0.541 0.444 0.00 0.000 0.556 0.000 0.00
#> SRR1791334 4 0.3833 0.541 0.444 0.00 0.000 0.556 0.000 0.00
#> SRR1791328 1 0.3869 -0.492 0.500 0.00 0.000 0.500 0.000 0.00
#> SRR1791327 6 0.0000 0.989 0.000 0.00 0.000 0.000 0.000 1.00
#> SRR1791333 1 0.4167 0.037 0.632 0.00 0.000 0.344 0.024 0.00
#> SRR1791326 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791324 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791323 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791322 5 0.3907 0.311 0.004 0.00 0.408 0.000 0.588 0.00
#> SRR1791329 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791321 4 0.3833 0.541 0.444 0.00 0.000 0.556 0.000 0.00
#> SRR1791320 5 0.0000 0.889 0.000 0.00 0.000 0.000 1.000 0.00
#> SRR1791325 1 0.3737 -0.241 0.608 0.00 0.000 0.000 0.392 0.00
#> SRR1791318 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
#> SRR1791317 3 0.0000 0.999 0.000 0.00 1.000 0.000 0.000 0.00
#> SRR1791313 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
#> SRR1791312 4 0.3833 0.541 0.444 0.00 0.000 0.556 0.000 0.00
#> SRR1791319 1 0.3747 0.396 0.604 0.00 0.000 0.396 0.000 0.00
#> SRR1791316 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
#> SRR1791315 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
#> SRR1791311 4 0.3828 0.545 0.440 0.00 0.000 0.560 0.000 0.00
#> SRR1791314 6 0.0000 0.989 0.000 0.00 0.000 0.000 0.000 1.00
#> SRR1791310 5 0.0000 0.889 0.000 0.00 0.000 0.000 1.000 0.00
#> SRR1791308 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791307 4 0.3823 0.545 0.436 0.00 0.000 0.564 0.000 0.00
#> SRR1791306 4 0.3823 0.545 0.436 0.00 0.000 0.564 0.000 0.00
#> SRR1791305 2 0.0000 1.000 0.000 1.00 0.000 0.000 0.000 0.00
#> SRR1791309 3 0.0000 0.999 0.000 0.00 1.000 0.000 0.000 0.00
#> SRR1791304 4 0.0000 0.472 0.000 0.00 0.000 1.000 0.000 0.00
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 15854 rows and 72 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 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.718 0.888 0.951 0.4918 0.499 0.499
#> 3 3 0.495 0.668 0.827 0.2358 0.852 0.710
#> 4 4 0.605 0.687 0.796 0.1346 0.891 0.724
#> 5 5 0.600 0.440 0.686 0.0991 0.835 0.531
#> 6 6 0.718 0.647 0.759 0.0716 0.848 0.454
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
#> SRR1791347 2 0.000 0.9501 0.000 1.000
#> SRR1791346 2 0.000 0.9501 0.000 1.000
#> SRR1791345 2 0.697 0.7942 0.188 0.812
#> SRR1791344 2 0.000 0.9501 0.000 1.000
#> SRR1791343 2 0.000 0.9501 0.000 1.000
#> SRR1791341 1 0.000 0.9344 1.000 0.000
#> SRR1791342 2 0.000 0.9501 0.000 1.000
#> SRR1791340 2 0.000 0.9501 0.000 1.000
#> SRR1791375 1 0.932 0.4794 0.652 0.348
#> SRR1791374 1 0.925 0.4970 0.660 0.340
#> SRR1791372 1 0.000 0.9344 1.000 0.000
#> SRR1791370 2 0.697 0.7942 0.188 0.812
#> SRR1791373 2 0.000 0.9501 0.000 1.000
#> SRR1791369 1 0.000 0.9344 1.000 0.000
#> SRR1791371 1 0.373 0.8805 0.928 0.072
#> SRR1791368 1 0.000 0.9344 1.000 0.000
#> SRR1791366 2 0.000 0.9501 0.000 1.000
#> SRR1791364 1 0.000 0.9344 1.000 0.000
#> SRR1791367 1 0.506 0.8430 0.888 0.112
#> SRR1791363 1 0.000 0.9344 1.000 0.000
#> SRR1791361 2 0.000 0.9501 0.000 1.000
#> SRR1791360 1 0.574 0.8171 0.864 0.136
#> SRR1791359 2 0.697 0.7942 0.188 0.812
#> SRR1791358 2 0.000 0.9501 0.000 1.000
#> SRR1791365 2 0.000 0.9501 0.000 1.000
#> SRR1791357 1 0.000 0.9344 1.000 0.000
#> SRR1791356 1 0.000 0.9344 1.000 0.000
#> SRR1791355 2 0.000 0.9501 0.000 1.000
#> SRR1791362 1 0.000 0.9344 1.000 0.000
#> SRR1791354 2 0.697 0.7942 0.188 0.812
#> SRR1791353 1 0.000 0.9344 1.000 0.000
#> SRR1791352 1 0.000 0.9344 1.000 0.000
#> SRR1791349 2 0.000 0.9501 0.000 1.000
#> SRR1791348 1 0.000 0.9344 1.000 0.000
#> SRR1791351 2 0.000 0.9501 0.000 1.000
#> SRR1791350 1 0.998 0.0437 0.528 0.472
#> SRR1791339 2 0.000 0.9501 0.000 1.000
#> SRR1791338 2 0.000 0.9501 0.000 1.000
#> SRR1791336 2 0.000 0.9501 0.000 1.000
#> SRR1791337 2 0.697 0.7942 0.188 0.812
#> SRR1791335 2 0.000 0.9501 0.000 1.000
#> SRR1791332 1 0.000 0.9344 1.000 0.000
#> SRR1791331 2 0.000 0.9501 0.000 1.000
#> SRR1791330 1 0.184 0.9154 0.972 0.028
#> SRR1791334 1 0.000 0.9344 1.000 0.000
#> SRR1791328 2 0.000 0.9501 0.000 1.000
#> SRR1791327 2 0.000 0.9501 0.000 1.000
#> SRR1791333 2 0.000 0.9501 0.000 1.000
#> SRR1791326 2 0.000 0.9501 0.000 1.000
#> SRR1791324 2 0.000 0.9501 0.000 1.000
#> SRR1791323 2 0.000 0.9501 0.000 1.000
#> SRR1791322 2 0.697 0.7942 0.188 0.812
#> SRR1791329 2 0.000 0.9501 0.000 1.000
#> SRR1791321 1 0.000 0.9344 1.000 0.000
#> SRR1791320 2 0.000 0.9501 0.000 1.000
#> SRR1791325 2 0.714 0.7833 0.196 0.804
#> SRR1791318 1 0.000 0.9344 1.000 0.000
#> SRR1791317 2 0.697 0.7942 0.188 0.812
#> SRR1791313 1 0.000 0.9344 1.000 0.000
#> SRR1791312 1 0.000 0.9344 1.000 0.000
#> SRR1791319 1 0.932 0.4794 0.652 0.348
#> SRR1791316 1 0.000 0.9344 1.000 0.000
#> SRR1791315 1 0.000 0.9344 1.000 0.000
#> SRR1791311 1 0.000 0.9344 1.000 0.000
#> SRR1791314 2 0.000 0.9501 0.000 1.000
#> SRR1791310 2 0.000 0.9501 0.000 1.000
#> SRR1791308 2 0.000 0.9501 0.000 1.000
#> SRR1791307 1 0.000 0.9344 1.000 0.000
#> SRR1791306 1 0.000 0.9344 1.000 0.000
#> SRR1791305 2 0.000 0.9501 0.000 1.000
#> SRR1791309 2 0.697 0.7942 0.188 0.812
#> SRR1791304 1 0.000 0.9344 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 3 0.4178 0.864 0.000 0.172 0.828
#> SRR1791346 2 0.1289 0.733 0.000 0.968 0.032
#> SRR1791345 1 0.9651 -0.103 0.396 0.396 0.208
#> SRR1791344 3 0.3941 0.868 0.000 0.156 0.844
#> SRR1791343 2 0.1411 0.730 0.000 0.964 0.036
#> SRR1791341 1 0.6095 0.613 0.608 0.000 0.392
#> SRR1791342 3 0.3941 0.868 0.000 0.156 0.844
#> SRR1791340 2 0.0000 0.751 0.000 1.000 0.000
#> SRR1791375 1 0.7925 0.310 0.584 0.344 0.072
#> SRR1791374 1 0.3879 0.698 0.848 0.000 0.152
#> SRR1791372 1 0.0237 0.792 0.996 0.000 0.004
#> SRR1791370 2 0.6617 0.302 0.436 0.556 0.008
#> SRR1791373 3 0.6079 0.272 0.000 0.388 0.612
#> SRR1791369 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791371 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791368 1 0.6126 0.605 0.600 0.000 0.400
#> SRR1791366 2 0.0592 0.747 0.000 0.988 0.012
#> SRR1791364 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791367 1 0.0237 0.792 0.996 0.000 0.004
#> SRR1791363 1 0.6140 0.599 0.596 0.000 0.404
#> SRR1791361 3 0.3941 0.868 0.000 0.156 0.844
#> SRR1791360 1 0.7199 0.616 0.704 0.204 0.092
#> SRR1791359 2 0.6617 0.302 0.436 0.556 0.008
#> SRR1791358 2 0.0000 0.751 0.000 1.000 0.000
#> SRR1791365 2 0.1031 0.737 0.000 0.976 0.024
#> SRR1791357 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791356 1 0.0237 0.792 0.996 0.000 0.004
#> SRR1791355 2 0.1289 0.733 0.000 0.968 0.032
#> SRR1791362 1 0.5254 0.723 0.736 0.000 0.264
#> SRR1791354 2 0.6617 0.302 0.436 0.556 0.008
#> SRR1791353 1 0.6168 0.590 0.588 0.000 0.412
#> SRR1791352 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791349 2 0.0237 0.751 0.000 0.996 0.004
#> SRR1791348 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.751 0.000 1.000 0.000
#> SRR1791350 1 0.6460 0.536 0.556 0.004 0.440
#> SRR1791339 3 0.5859 0.650 0.000 0.344 0.656
#> SRR1791338 2 0.0000 0.751 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.751 0.000 1.000 0.000
#> SRR1791337 2 0.6617 0.302 0.436 0.556 0.008
#> SRR1791335 2 0.0000 0.751 0.000 1.000 0.000
#> SRR1791332 1 0.6140 0.599 0.596 0.000 0.404
#> SRR1791331 3 0.6215 0.533 0.000 0.428 0.572
#> SRR1791330 1 0.5254 0.723 0.736 0.000 0.264
#> SRR1791334 1 0.5254 0.723 0.736 0.000 0.264
#> SRR1791328 3 0.3941 0.868 0.000 0.156 0.844
#> SRR1791327 2 0.0000 0.751 0.000 1.000 0.000
#> SRR1791333 3 0.3941 0.868 0.000 0.156 0.844
#> SRR1791326 2 0.0237 0.751 0.000 0.996 0.004
#> SRR1791324 2 0.0237 0.749 0.000 0.996 0.004
#> SRR1791323 2 0.0237 0.751 0.000 0.996 0.004
#> SRR1791322 2 0.6617 0.302 0.436 0.556 0.008
#> SRR1791329 2 0.2711 0.674 0.000 0.912 0.088
#> SRR1791321 1 0.5254 0.723 0.736 0.000 0.264
#> SRR1791320 3 0.4121 0.866 0.000 0.168 0.832
#> SRR1791325 2 0.6676 0.186 0.476 0.516 0.008
#> SRR1791318 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791317 2 0.6617 0.302 0.436 0.556 0.008
#> SRR1791313 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791312 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791319 1 0.3879 0.698 0.848 0.000 0.152
#> SRR1791316 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791315 1 0.0000 0.794 1.000 0.000 0.000
#> SRR1791311 1 0.5254 0.723 0.736 0.000 0.264
#> SRR1791314 2 0.0000 0.751 0.000 1.000 0.000
#> SRR1791310 3 0.4750 0.840 0.000 0.216 0.784
#> SRR1791308 2 0.0237 0.751 0.000 0.996 0.004
#> SRR1791307 1 0.6154 0.594 0.592 0.000 0.408
#> SRR1791306 1 0.5254 0.723 0.736 0.000 0.264
#> SRR1791305 2 0.0237 0.751 0.000 0.996 0.004
#> SRR1791309 2 0.6617 0.302 0.436 0.556 0.008
#> SRR1791304 1 0.0000 0.794 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 4 0.4690 0.7920 0.000 0.276 0.012 0.712
#> SRR1791346 2 0.1975 0.9501 0.000 0.936 0.016 0.048
#> SRR1791345 3 0.7503 -0.0485 0.020 0.376 0.492 0.112
#> SRR1791344 4 0.4606 0.7956 0.000 0.264 0.012 0.724
#> SRR1791343 2 0.1854 0.9510 0.000 0.940 0.012 0.048
#> SRR1791341 1 0.5402 0.5004 0.516 0.000 0.012 0.472
#> SRR1791342 4 0.4137 0.7939 0.000 0.208 0.012 0.780
#> SRR1791340 2 0.1022 0.9541 0.000 0.968 0.000 0.032
#> SRR1791375 1 0.7648 0.2790 0.576 0.048 0.264 0.112
#> SRR1791374 1 0.6116 0.2858 0.668 0.000 0.220 0.112
#> SRR1791372 1 0.1661 0.6948 0.944 0.000 0.052 0.004
#> SRR1791370 3 0.6286 0.2889 0.440 0.040 0.512 0.008
#> SRR1791373 4 0.7182 0.2870 0.004 0.356 0.128 0.512
#> SRR1791369 1 0.0469 0.7032 0.988 0.000 0.012 0.000
#> SRR1791371 1 0.1576 0.6788 0.948 0.000 0.004 0.048
#> SRR1791368 1 0.5399 0.5045 0.520 0.000 0.012 0.468
#> SRR1791366 2 0.2021 0.9463 0.000 0.932 0.012 0.056
#> SRR1791364 1 0.0592 0.7032 0.984 0.000 0.016 0.000
#> SRR1791367 1 0.1576 0.6788 0.948 0.000 0.004 0.048
#> SRR1791363 1 0.5158 0.5063 0.524 0.000 0.004 0.472
#> SRR1791361 4 0.4051 0.7905 0.004 0.208 0.004 0.784
#> SRR1791360 1 0.6742 0.5156 0.688 0.048 0.152 0.112
#> SRR1791359 3 0.3973 0.7669 0.200 0.004 0.792 0.004
#> SRR1791358 2 0.0000 0.9477 0.000 1.000 0.000 0.000
#> SRR1791365 2 0.1767 0.9526 0.000 0.944 0.012 0.044
#> SRR1791357 1 0.0188 0.7014 0.996 0.000 0.004 0.000
#> SRR1791356 1 0.2089 0.6791 0.932 0.000 0.020 0.048
#> SRR1791355 2 0.1767 0.9526 0.000 0.944 0.012 0.044
#> SRR1791362 1 0.3873 0.6546 0.772 0.000 0.000 0.228
#> SRR1791354 3 0.3808 0.7606 0.184 0.004 0.808 0.004
#> SRR1791353 1 0.5398 0.5311 0.580 0.000 0.016 0.404
#> SRR1791352 1 0.0469 0.7030 0.988 0.000 0.012 0.000
#> SRR1791349 2 0.1854 0.9512 0.000 0.940 0.012 0.048
#> SRR1791348 1 0.1022 0.7022 0.968 0.000 0.032 0.000
#> SRR1791351 2 0.0000 0.9477 0.000 1.000 0.000 0.000
#> SRR1791350 4 0.8605 -0.2461 0.360 0.068 0.144 0.428
#> SRR1791339 4 0.5408 0.5712 0.000 0.408 0.016 0.576
#> SRR1791338 2 0.0000 0.9477 0.000 1.000 0.000 0.000
#> SRR1791336 2 0.0000 0.9477 0.000 1.000 0.000 0.000
#> SRR1791337 3 0.3850 0.7634 0.188 0.004 0.804 0.004
#> SRR1791335 2 0.0000 0.9477 0.000 1.000 0.000 0.000
#> SRR1791332 1 0.5288 0.5031 0.520 0.000 0.008 0.472
#> SRR1791331 4 0.5143 0.6963 0.000 0.360 0.012 0.628
#> SRR1791330 1 0.5203 0.6253 0.720 0.048 0.000 0.232
#> SRR1791334 1 0.3873 0.6546 0.772 0.000 0.000 0.228
#> SRR1791328 4 0.4192 0.7904 0.004 0.208 0.008 0.780
#> SRR1791327 2 0.0000 0.9477 0.000 1.000 0.000 0.000
#> SRR1791333 4 0.4051 0.7905 0.004 0.208 0.004 0.784
#> SRR1791326 2 0.1211 0.9541 0.000 0.960 0.000 0.040
#> SRR1791324 2 0.1767 0.9526 0.000 0.944 0.012 0.044
#> SRR1791323 2 0.0188 0.9471 0.000 0.996 0.000 0.004
#> SRR1791322 3 0.5223 0.4250 0.408 0.004 0.584 0.004
#> SRR1791329 2 0.3390 0.8265 0.000 0.852 0.016 0.132
#> SRR1791321 1 0.3873 0.6546 0.772 0.000 0.000 0.228
#> SRR1791320 4 0.4690 0.7920 0.000 0.276 0.012 0.712
#> SRR1791325 1 0.7949 -0.1597 0.448 0.048 0.404 0.100
#> SRR1791318 1 0.1118 0.7012 0.964 0.000 0.036 0.000
#> SRR1791317 3 0.3973 0.7669 0.200 0.004 0.792 0.004
#> SRR1791313 1 0.1940 0.6839 0.924 0.000 0.076 0.000
#> SRR1791312 1 0.1545 0.6861 0.952 0.000 0.008 0.040
#> SRR1791319 1 0.6050 0.3087 0.676 0.000 0.212 0.112
#> SRR1791316 1 0.0921 0.7024 0.972 0.000 0.028 0.000
#> SRR1791315 1 0.0188 0.7021 0.996 0.000 0.000 0.004
#> SRR1791311 1 0.4304 0.6370 0.716 0.000 0.000 0.284
#> SRR1791314 2 0.0000 0.9477 0.000 1.000 0.000 0.000
#> SRR1791310 4 0.4795 0.7821 0.000 0.292 0.012 0.696
#> SRR1791308 2 0.2060 0.9463 0.000 0.932 0.016 0.052
#> SRR1791307 1 0.4992 0.5035 0.524 0.000 0.000 0.476
#> SRR1791306 1 0.5158 0.5063 0.524 0.000 0.004 0.472
#> SRR1791305 2 0.1854 0.9512 0.000 0.940 0.012 0.048
#> SRR1791309 3 0.3973 0.7669 0.200 0.004 0.792 0.004
#> SRR1791304 1 0.0817 0.7026 0.976 0.000 0.024 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 5 0.5424 0.5972 0.000 0.100 0.048 0.128 0.724
#> SRR1791346 5 0.5530 0.4844 0.000 0.368 0.076 0.000 0.556
#> SRR1791345 3 0.8529 0.3013 0.060 0.120 0.452 0.108 0.260
#> SRR1791344 5 0.4140 0.5434 0.000 0.012 0.048 0.148 0.792
#> SRR1791343 5 0.4752 0.5101 0.000 0.316 0.036 0.000 0.648
#> SRR1791341 1 0.5840 -0.0362 0.488 0.000 0.000 0.416 0.096
#> SRR1791342 5 0.4377 0.5236 0.008 0.000 0.048 0.184 0.760
#> SRR1791340 2 0.4383 -0.0269 0.000 0.572 0.004 0.000 0.424
#> SRR1791375 4 0.7126 0.4133 0.192 0.000 0.116 0.568 0.124
#> SRR1791374 4 0.7475 0.1173 0.392 0.000 0.116 0.400 0.092
#> SRR1791372 1 0.2233 0.5085 0.892 0.000 0.004 0.104 0.000
#> SRR1791370 3 0.7229 0.3645 0.100 0.000 0.516 0.280 0.104
#> SRR1791373 5 0.7403 0.5351 0.056 0.108 0.052 0.200 0.584
#> SRR1791369 1 0.0324 0.5457 0.992 0.000 0.004 0.004 0.000
#> SRR1791371 1 0.4679 0.3910 0.756 0.000 0.032 0.172 0.040
#> SRR1791368 1 0.5884 -0.0436 0.480 0.000 0.000 0.420 0.100
#> SRR1791366 5 0.5341 0.5234 0.000 0.300 0.080 0.000 0.620
#> SRR1791364 1 0.0290 0.5448 0.992 0.000 0.000 0.008 0.000
#> SRR1791367 1 0.4440 0.3982 0.764 0.000 0.028 0.180 0.028
#> SRR1791363 1 0.6146 -0.0623 0.488 0.000 0.000 0.376 0.136
#> SRR1791361 5 0.5265 0.2271 0.040 0.000 0.004 0.412 0.544
#> SRR1791360 4 0.6736 0.3784 0.388 0.000 0.056 0.476 0.080
#> SRR1791359 3 0.1605 0.8492 0.004 0.000 0.944 0.012 0.040
#> SRR1791358 2 0.0000 0.8265 0.000 1.000 0.000 0.000 0.000
#> SRR1791365 5 0.4770 0.5073 0.000 0.320 0.036 0.000 0.644
#> SRR1791357 1 0.2424 0.4846 0.868 0.000 0.000 0.132 0.000
#> SRR1791356 1 0.3750 0.4757 0.836 0.000 0.028 0.096 0.040
#> SRR1791355 5 0.4752 0.5101 0.000 0.316 0.036 0.000 0.648
#> SRR1791362 1 0.5229 -0.1223 0.568 0.000 0.012 0.392 0.028
#> SRR1791354 3 0.1205 0.8500 0.004 0.000 0.956 0.000 0.040
#> SRR1791353 4 0.6496 0.2539 0.336 0.000 0.004 0.484 0.176
#> SRR1791352 1 0.0162 0.5457 0.996 0.000 0.000 0.004 0.000
#> SRR1791349 5 0.4728 0.5210 0.000 0.296 0.040 0.000 0.664
#> SRR1791348 1 0.0162 0.5460 0.996 0.000 0.004 0.000 0.000
#> SRR1791351 2 0.0000 0.8265 0.000 1.000 0.000 0.000 0.000
#> SRR1791350 4 0.8201 0.2533 0.160 0.000 0.332 0.348 0.160
#> SRR1791339 5 0.5699 0.5990 0.000 0.132 0.048 0.120 0.700
#> SRR1791338 2 0.1478 0.8035 0.000 0.936 0.000 0.000 0.064
#> SRR1791336 2 0.0963 0.8198 0.000 0.964 0.000 0.000 0.036
#> SRR1791337 3 0.1605 0.8492 0.004 0.000 0.944 0.012 0.040
#> SRR1791335 2 0.1197 0.8138 0.000 0.952 0.000 0.000 0.048
#> SRR1791332 1 0.6395 -0.0668 0.468 0.000 0.020 0.412 0.100
#> SRR1791331 5 0.5770 0.5967 0.000 0.156 0.052 0.100 0.692
#> SRR1791330 4 0.6057 0.3300 0.428 0.000 0.028 0.488 0.056
#> SRR1791334 4 0.5300 0.2961 0.432 0.000 0.012 0.528 0.028
#> SRR1791328 5 0.5114 0.2418 0.032 0.000 0.004 0.404 0.560
#> SRR1791327 2 0.0000 0.8265 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 5 0.4882 0.3135 0.032 0.000 0.004 0.328 0.636
#> SRR1791326 2 0.4448 -0.1137 0.000 0.516 0.004 0.000 0.480
#> SRR1791324 5 0.4770 0.5073 0.000 0.320 0.036 0.000 0.644
#> SRR1791323 2 0.0566 0.8226 0.000 0.984 0.004 0.000 0.012
#> SRR1791322 3 0.3089 0.8120 0.032 0.000 0.880 0.048 0.040
#> SRR1791329 5 0.4716 0.5166 0.000 0.308 0.036 0.000 0.656
#> SRR1791321 4 0.5317 0.2692 0.448 0.000 0.012 0.512 0.028
#> SRR1791320 5 0.5715 0.5916 0.000 0.104 0.048 0.152 0.696
#> SRR1791325 4 0.8166 0.1140 0.172 0.000 0.320 0.364 0.144
#> SRR1791318 1 0.0451 0.5445 0.988 0.000 0.004 0.008 0.000
#> SRR1791317 3 0.1205 0.8500 0.004 0.000 0.956 0.000 0.040
#> SRR1791313 1 0.1430 0.5240 0.944 0.000 0.052 0.004 0.000
#> SRR1791312 1 0.3900 0.4454 0.808 0.000 0.032 0.144 0.016
#> SRR1791319 1 0.7374 -0.2141 0.420 0.000 0.104 0.384 0.092
#> SRR1791316 1 0.2471 0.4765 0.864 0.000 0.000 0.136 0.000
#> SRR1791315 1 0.0404 0.5450 0.988 0.000 0.000 0.012 0.000
#> SRR1791311 1 0.5088 -0.1491 0.528 0.000 0.000 0.436 0.036
#> SRR1791314 2 0.1197 0.8138 0.000 0.952 0.000 0.000 0.048
#> SRR1791310 5 0.5389 0.6009 0.000 0.112 0.048 0.112 0.728
#> SRR1791308 5 0.5103 0.4315 0.000 0.404 0.040 0.000 0.556
#> SRR1791307 1 0.6169 -0.0903 0.472 0.000 0.000 0.392 0.136
#> SRR1791306 1 0.5836 -0.0377 0.492 0.000 0.000 0.412 0.096
#> SRR1791305 5 0.4786 0.5137 0.000 0.308 0.040 0.000 0.652
#> SRR1791309 3 0.1205 0.8500 0.004 0.000 0.956 0.000 0.040
#> SRR1791304 1 0.0404 0.5451 0.988 0.000 0.000 0.012 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 5 0.2003 0.780 0.000 0.116 0.000 0.000 0.884 0.000
#> SRR1791346 2 0.1168 0.874 0.000 0.956 0.000 0.000 0.028 0.016
#> SRR1791345 3 0.7146 0.129 0.108 0.076 0.400 0.000 0.384 0.032
#> SRR1791344 5 0.2309 0.780 0.000 0.084 0.000 0.028 0.888 0.000
#> SRR1791343 2 0.0692 0.883 0.000 0.976 0.000 0.000 0.004 0.020
#> SRR1791341 4 0.0458 0.711 0.016 0.000 0.000 0.984 0.000 0.000
#> SRR1791342 5 0.2924 0.751 0.008 0.040 0.000 0.084 0.864 0.004
#> SRR1791340 2 0.3756 0.342 0.000 0.600 0.000 0.000 0.000 0.400
#> SRR1791375 1 0.6893 -0.225 0.416 0.000 0.060 0.272 0.252 0.000
#> SRR1791374 1 0.6018 0.191 0.596 0.000 0.148 0.036 0.212 0.008
#> SRR1791372 1 0.3563 0.592 0.664 0.000 0.000 0.336 0.000 0.000
#> SRR1791370 3 0.6263 0.336 0.208 0.000 0.468 0.020 0.304 0.000
#> SRR1791373 5 0.4114 0.692 0.108 0.076 0.000 0.000 0.784 0.032
#> SRR1791369 1 0.3804 0.579 0.576 0.000 0.000 0.424 0.000 0.000
#> SRR1791371 1 0.5377 0.528 0.648 0.000 0.100 0.224 0.020 0.008
#> SRR1791368 4 0.0508 0.709 0.012 0.000 0.000 0.984 0.004 0.000
#> SRR1791366 2 0.1226 0.860 0.000 0.952 0.004 0.000 0.040 0.004
#> SRR1791364 1 0.3843 0.569 0.548 0.000 0.000 0.452 0.000 0.000
#> SRR1791367 1 0.4969 0.519 0.664 0.000 0.100 0.224 0.012 0.000
#> SRR1791363 4 0.1693 0.713 0.020 0.004 0.000 0.932 0.044 0.000
#> SRR1791361 5 0.4386 0.370 0.008 0.008 0.000 0.412 0.568 0.004
#> SRR1791360 4 0.5890 0.549 0.300 0.000 0.032 0.548 0.120 0.000
#> SRR1791359 3 0.2342 0.836 0.004 0.088 0.888 0.000 0.020 0.000
#> SRR1791358 6 0.0865 0.935 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR1791365 2 0.0547 0.883 0.000 0.980 0.000 0.000 0.000 0.020
#> SRR1791357 1 0.3151 0.578 0.748 0.000 0.000 0.252 0.000 0.000
#> SRR1791356 1 0.5698 0.543 0.600 0.000 0.100 0.268 0.020 0.012
#> SRR1791355 2 0.0692 0.883 0.000 0.976 0.000 0.000 0.004 0.020
#> SRR1791362 4 0.3105 0.696 0.080 0.000 0.008 0.848 0.064 0.000
#> SRR1791354 3 0.2199 0.836 0.000 0.088 0.892 0.000 0.020 0.000
#> SRR1791353 4 0.5113 0.610 0.232 0.004 0.012 0.664 0.084 0.004
#> SRR1791352 1 0.3828 0.577 0.560 0.000 0.000 0.440 0.000 0.000
#> SRR1791349 2 0.0692 0.872 0.000 0.976 0.000 0.000 0.020 0.004
#> SRR1791348 1 0.4051 0.580 0.560 0.000 0.008 0.432 0.000 0.000
#> SRR1791351 6 0.0865 0.935 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR1791350 4 0.4845 0.221 0.016 0.000 0.392 0.560 0.032 0.000
#> SRR1791339 5 0.1910 0.781 0.000 0.108 0.000 0.000 0.892 0.000
#> SRR1791338 6 0.3309 0.612 0.000 0.280 0.000 0.000 0.000 0.720
#> SRR1791336 6 0.2048 0.861 0.000 0.120 0.000 0.000 0.000 0.880
#> SRR1791337 3 0.3013 0.808 0.000 0.088 0.844 0.000 0.068 0.000
#> SRR1791335 6 0.0865 0.935 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR1791332 4 0.1909 0.733 0.052 0.000 0.024 0.920 0.004 0.000
#> SRR1791331 5 0.3499 0.587 0.000 0.320 0.000 0.000 0.680 0.000
#> SRR1791330 4 0.4624 0.636 0.264 0.000 0.008 0.668 0.060 0.000
#> SRR1791334 4 0.4635 0.635 0.256 0.000 0.008 0.672 0.064 0.000
#> SRR1791328 5 0.4039 0.357 0.008 0.000 0.000 0.424 0.568 0.000
#> SRR1791327 6 0.0865 0.935 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR1791333 5 0.2980 0.691 0.008 0.000 0.000 0.192 0.800 0.000
#> SRR1791326 2 0.4219 0.345 0.000 0.592 0.000 0.000 0.020 0.388
#> SRR1791324 2 0.0547 0.883 0.000 0.980 0.000 0.000 0.000 0.020
#> SRR1791323 6 0.1245 0.912 0.000 0.032 0.000 0.000 0.016 0.952
#> SRR1791322 3 0.2734 0.831 0.020 0.088 0.872 0.000 0.020 0.000
#> SRR1791329 2 0.0547 0.883 0.000 0.980 0.000 0.000 0.000 0.020
#> SRR1791321 4 0.4591 0.640 0.248 0.000 0.008 0.680 0.064 0.000
#> SRR1791320 5 0.1910 0.781 0.000 0.108 0.000 0.000 0.892 0.000
#> SRR1791325 1 0.7468 -0.296 0.320 0.000 0.244 0.132 0.304 0.000
#> SRR1791318 1 0.3971 0.570 0.548 0.000 0.004 0.448 0.000 0.000
#> SRR1791317 3 0.2199 0.836 0.000 0.088 0.892 0.000 0.020 0.000
#> SRR1791313 1 0.4587 0.580 0.596 0.000 0.048 0.356 0.000 0.000
#> SRR1791312 1 0.4969 0.555 0.636 0.000 0.100 0.260 0.004 0.000
#> SRR1791319 1 0.6382 0.200 0.576 0.000 0.144 0.044 0.216 0.020
#> SRR1791316 1 0.3050 0.573 0.764 0.000 0.000 0.236 0.000 0.000
#> SRR1791315 1 0.3979 0.570 0.540 0.000 0.000 0.456 0.004 0.000
#> SRR1791311 4 0.2914 0.722 0.084 0.000 0.008 0.860 0.048 0.000
#> SRR1791314 6 0.0865 0.935 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR1791310 5 0.2300 0.767 0.000 0.144 0.000 0.000 0.856 0.000
#> SRR1791308 2 0.2527 0.763 0.000 0.832 0.000 0.000 0.000 0.168
#> SRR1791307 4 0.2150 0.719 0.036 0.004 0.000 0.912 0.044 0.004
#> SRR1791306 4 0.0865 0.721 0.036 0.000 0.000 0.964 0.000 0.000
#> SRR1791305 2 0.0692 0.872 0.000 0.976 0.000 0.000 0.020 0.004
#> SRR1791309 3 0.2199 0.836 0.000 0.088 0.892 0.000 0.020 0.000
#> SRR1791304 1 0.3774 0.584 0.592 0.000 0.000 0.408 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "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 15854 rows and 72 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.784 0.849 0.943 0.4980 0.503 0.503
#> 3 3 0.784 0.859 0.937 0.3007 0.821 0.654
#> 4 4 0.730 0.635 0.798 0.0970 0.891 0.712
#> 5 5 0.781 0.778 0.878 0.0576 0.894 0.669
#> 6 6 0.767 0.667 0.821 0.0294 0.994 0.976
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
#> SRR1791347 2 0.2423 0.90563 0.040 0.960
#> SRR1791346 2 0.2236 0.90934 0.036 0.964
#> SRR1791345 2 0.9909 0.15887 0.444 0.556
#> SRR1791344 2 0.0376 0.93355 0.004 0.996
#> SRR1791343 2 0.0000 0.93570 0.000 1.000
#> SRR1791341 1 0.0000 0.93211 1.000 0.000
#> SRR1791342 2 0.1633 0.91951 0.024 0.976
#> SRR1791340 2 0.0000 0.93570 0.000 1.000
#> SRR1791375 1 0.0376 0.92928 0.996 0.004
#> SRR1791374 1 0.0000 0.93211 1.000 0.000
#> SRR1791372 1 0.0000 0.93211 1.000 0.000
#> SRR1791370 1 0.0376 0.92928 0.996 0.004
#> SRR1791373 2 0.9393 0.42395 0.356 0.644
#> SRR1791369 1 0.0000 0.93211 1.000 0.000
#> SRR1791371 1 0.0000 0.93211 1.000 0.000
#> SRR1791368 1 0.0000 0.93211 1.000 0.000
#> SRR1791366 2 0.0672 0.93125 0.008 0.992
#> SRR1791364 1 0.0000 0.93211 1.000 0.000
#> SRR1791367 1 0.0000 0.93211 1.000 0.000
#> SRR1791363 1 0.0000 0.93211 1.000 0.000
#> SRR1791361 1 0.3431 0.87621 0.936 0.064
#> SRR1791360 1 0.0000 0.93211 1.000 0.000
#> SRR1791359 1 0.9710 0.34812 0.600 0.400
#> SRR1791358 2 0.0000 0.93570 0.000 1.000
#> SRR1791365 2 0.0000 0.93570 0.000 1.000
#> SRR1791357 1 0.0000 0.93211 1.000 0.000
#> SRR1791356 1 0.0000 0.93211 1.000 0.000
#> SRR1791355 2 0.0000 0.93570 0.000 1.000
#> SRR1791362 1 0.0000 0.93211 1.000 0.000
#> SRR1791354 2 0.9993 -0.00237 0.484 0.516
#> SRR1791353 1 0.0000 0.93211 1.000 0.000
#> SRR1791352 1 0.0000 0.93211 1.000 0.000
#> SRR1791349 2 0.0000 0.93570 0.000 1.000
#> SRR1791348 1 0.0000 0.93211 1.000 0.000
#> SRR1791351 2 0.0000 0.93570 0.000 1.000
#> SRR1791350 1 0.7139 0.71477 0.804 0.196
#> SRR1791339 2 0.0000 0.93570 0.000 1.000
#> SRR1791338 2 0.0000 0.93570 0.000 1.000
#> SRR1791336 2 0.0000 0.93570 0.000 1.000
#> SRR1791337 1 0.9661 0.36700 0.608 0.392
#> SRR1791335 2 0.0000 0.93570 0.000 1.000
#> SRR1791332 1 0.0000 0.93211 1.000 0.000
#> SRR1791331 2 0.0000 0.93570 0.000 1.000
#> SRR1791330 1 0.0000 0.93211 1.000 0.000
#> SRR1791334 1 0.0000 0.93211 1.000 0.000
#> SRR1791328 2 0.9129 0.48647 0.328 0.672
#> SRR1791327 2 0.0000 0.93570 0.000 1.000
#> SRR1791333 1 0.5946 0.78756 0.856 0.144
#> SRR1791326 2 0.0000 0.93570 0.000 1.000
#> SRR1791324 2 0.0000 0.93570 0.000 1.000
#> SRR1791323 2 0.0000 0.93570 0.000 1.000
#> SRR1791322 1 0.9710 0.34812 0.600 0.400
#> SRR1791329 2 0.0000 0.93570 0.000 1.000
#> SRR1791321 1 0.0000 0.93211 1.000 0.000
#> SRR1791320 2 0.0672 0.93125 0.008 0.992
#> SRR1791325 1 0.0000 0.93211 1.000 0.000
#> SRR1791318 1 0.0000 0.93211 1.000 0.000
#> SRR1791317 1 0.9710 0.34812 0.600 0.400
#> SRR1791313 1 0.0000 0.93211 1.000 0.000
#> SRR1791312 1 0.0000 0.93211 1.000 0.000
#> SRR1791319 1 0.0000 0.93211 1.000 0.000
#> SRR1791316 1 0.0000 0.93211 1.000 0.000
#> SRR1791315 1 0.0000 0.93211 1.000 0.000
#> SRR1791311 1 0.0000 0.93211 1.000 0.000
#> SRR1791314 2 0.0000 0.93570 0.000 1.000
#> SRR1791310 2 0.0000 0.93570 0.000 1.000
#> SRR1791308 2 0.0000 0.93570 0.000 1.000
#> SRR1791307 1 0.0000 0.93211 1.000 0.000
#> SRR1791306 1 0.0000 0.93211 1.000 0.000
#> SRR1791305 2 0.0000 0.93570 0.000 1.000
#> SRR1791309 1 0.9732 0.33741 0.596 0.404
#> SRR1791304 1 0.0000 0.93211 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1791347 2 0.1877 0.913 0.012 0.956 0.032
#> SRR1791346 3 0.5058 0.640 0.000 0.244 0.756
#> SRR1791345 3 0.8873 0.516 0.200 0.224 0.576
#> SRR1791344 2 0.0237 0.933 0.000 0.996 0.004
#> SRR1791343 2 0.0424 0.931 0.000 0.992 0.008
#> SRR1791341 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791342 2 0.4399 0.740 0.188 0.812 0.000
#> SRR1791340 2 0.0237 0.933 0.000 0.996 0.004
#> SRR1791375 3 0.0892 0.892 0.020 0.000 0.980
#> SRR1791374 3 0.1163 0.887 0.028 0.000 0.972
#> SRR1791372 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791370 3 0.0747 0.893 0.016 0.000 0.984
#> SRR1791373 2 0.5597 0.655 0.216 0.764 0.020
#> SRR1791369 1 0.0424 0.939 0.992 0.000 0.008
#> SRR1791371 1 0.4291 0.789 0.820 0.000 0.180
#> SRR1791368 1 0.0237 0.939 0.996 0.000 0.004
#> SRR1791366 2 0.5810 0.496 0.000 0.664 0.336
#> SRR1791364 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791367 1 0.4121 0.804 0.832 0.000 0.168
#> SRR1791363 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791361 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791360 3 0.3267 0.811 0.116 0.000 0.884
#> SRR1791359 3 0.0237 0.894 0.004 0.000 0.996
#> SRR1791358 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791365 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791357 1 0.0424 0.939 0.992 0.000 0.008
#> SRR1791356 1 0.0747 0.936 0.984 0.000 0.016
#> SRR1791355 2 0.0747 0.927 0.000 0.984 0.016
#> SRR1791362 1 0.0424 0.939 0.992 0.000 0.008
#> SRR1791354 3 0.0000 0.893 0.000 0.000 1.000
#> SRR1791353 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791352 1 0.1031 0.932 0.976 0.000 0.024
#> SRR1791349 2 0.3116 0.853 0.000 0.892 0.108
#> SRR1791348 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791351 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791350 1 0.3771 0.829 0.876 0.112 0.012
#> SRR1791339 2 0.0237 0.933 0.000 0.996 0.004
#> SRR1791338 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791336 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791337 3 0.0000 0.893 0.000 0.000 1.000
#> SRR1791335 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791332 1 0.1964 0.910 0.944 0.000 0.056
#> SRR1791331 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791330 1 0.6252 0.275 0.556 0.000 0.444
#> SRR1791334 1 0.3752 0.830 0.856 0.000 0.144
#> SRR1791328 2 0.2537 0.869 0.080 0.920 0.000
#> SRR1791327 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791333 1 0.0237 0.938 0.996 0.004 0.000
#> SRR1791326 2 0.0237 0.933 0.000 0.996 0.004
#> SRR1791324 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791323 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791322 3 0.0424 0.894 0.008 0.000 0.992
#> SRR1791329 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791321 1 0.0747 0.936 0.984 0.000 0.016
#> SRR1791320 2 0.3619 0.822 0.000 0.864 0.136
#> SRR1791325 3 0.1643 0.879 0.044 0.000 0.956
#> SRR1791318 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791317 3 0.0000 0.893 0.000 0.000 1.000
#> SRR1791313 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791312 1 0.0747 0.936 0.984 0.000 0.016
#> SRR1791319 1 0.6299 0.157 0.524 0.000 0.476
#> SRR1791316 1 0.1411 0.925 0.964 0.000 0.036
#> SRR1791315 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791311 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791314 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791310 2 0.0000 0.934 0.000 1.000 0.000
#> SRR1791308 3 0.6154 0.272 0.000 0.408 0.592
#> SRR1791307 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791306 1 0.0000 0.940 1.000 0.000 0.000
#> SRR1791305 2 0.5733 0.524 0.000 0.676 0.324
#> SRR1791309 3 0.0000 0.893 0.000 0.000 1.000
#> SRR1791304 1 0.0000 0.940 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1791347 2 0.5470 0.6671 0.020 0.716 0.028 0.236
#> SRR1791346 3 0.5085 0.4434 0.020 0.304 0.676 0.000
#> SRR1791345 1 0.7137 -0.0714 0.556 0.256 0.188 0.000
#> SRR1791344 2 0.0657 0.9075 0.012 0.984 0.000 0.004
#> SRR1791343 2 0.0000 0.9121 0.000 1.000 0.000 0.000
#> SRR1791341 4 0.1211 0.5398 0.040 0.000 0.000 0.960
#> SRR1791342 2 0.5590 0.3661 0.020 0.524 0.000 0.456
#> SRR1791340 2 0.0376 0.9119 0.004 0.992 0.004 0.000
#> SRR1791375 3 0.1724 0.8281 0.032 0.000 0.948 0.020
#> SRR1791374 3 0.2345 0.7765 0.100 0.000 0.900 0.000
#> SRR1791372 4 0.4948 0.4983 0.440 0.000 0.000 0.560
#> SRR1791370 3 0.1004 0.8330 0.024 0.000 0.972 0.004
#> SRR1791373 2 0.5430 0.5866 0.204 0.732 0.008 0.056
#> SRR1791369 4 0.4941 0.5013 0.436 0.000 0.000 0.564
#> SRR1791371 1 0.7597 0.3799 0.468 0.000 0.308 0.224
#> SRR1791368 4 0.1118 0.5416 0.036 0.000 0.000 0.964
#> SRR1791366 2 0.2859 0.8335 0.008 0.880 0.112 0.000
#> SRR1791364 4 0.4948 0.4983 0.440 0.000 0.000 0.560
#> SRR1791367 1 0.7325 0.4086 0.472 0.000 0.368 0.160
#> SRR1791363 4 0.0592 0.5147 0.016 0.000 0.000 0.984
#> SRR1791361 4 0.0927 0.5006 0.008 0.016 0.000 0.976
#> SRR1791360 3 0.4459 0.6818 0.032 0.000 0.780 0.188
#> SRR1791359 3 0.0336 0.8359 0.008 0.000 0.992 0.000
#> SRR1791358 2 0.0336 0.9113 0.008 0.992 0.000 0.000
#> SRR1791365 2 0.0000 0.9121 0.000 1.000 0.000 0.000
#> SRR1791357 4 0.5691 0.4323 0.468 0.000 0.024 0.508
#> SRR1791356 4 0.5396 0.4633 0.464 0.000 0.012 0.524
#> SRR1791355 2 0.0188 0.9117 0.000 0.996 0.004 0.000
#> SRR1791362 4 0.1743 0.5418 0.056 0.000 0.004 0.940
#> SRR1791354 3 0.2081 0.7917 0.084 0.000 0.916 0.000
#> SRR1791353 4 0.0779 0.5139 0.016 0.000 0.004 0.980
#> SRR1791352 4 0.6213 0.3635 0.464 0.000 0.052 0.484
#> SRR1791349 2 0.0592 0.9070 0.000 0.984 0.016 0.000
#> SRR1791348 4 0.5281 0.4699 0.464 0.000 0.008 0.528
#> SRR1791351 2 0.0336 0.9113 0.008 0.992 0.000 0.000
#> SRR1791350 1 0.2124 0.3179 0.924 0.000 0.008 0.068
#> SRR1791339 2 0.0524 0.9092 0.008 0.988 0.000 0.004
#> SRR1791338 2 0.0817 0.9054 0.024 0.976 0.000 0.000
#> SRR1791336 2 0.0817 0.9054 0.024 0.976 0.000 0.000
#> SRR1791337 3 0.0469 0.8330 0.012 0.000 0.988 0.000
#> SRR1791335 2 0.0336 0.9113 0.008 0.992 0.000 0.000
#> SRR1791332 1 0.5368 0.0895 0.636 0.000 0.024 0.340
#> SRR1791331 2 0.0188 0.9117 0.000 0.996 0.000 0.004
#> SRR1791330 3 0.5072 0.6341 0.052 0.000 0.740 0.208
#> SRR1791334 1 0.7831 0.3192 0.408 0.000 0.280 0.312
#> SRR1791328 2 0.5447 0.5736 0.024 0.652 0.004 0.320
#> SRR1791327 2 0.0336 0.9113 0.008 0.992 0.000 0.000
#> SRR1791333 4 0.1082 0.5202 0.020 0.004 0.004 0.972
#> SRR1791326 2 0.0000 0.9121 0.000 1.000 0.000 0.000
#> SRR1791324 2 0.0000 0.9121 0.000 1.000 0.000 0.000
#> SRR1791323 2 0.0000 0.9121 0.000 1.000 0.000 0.000
#> SRR1791322 3 0.0188 0.8360 0.004 0.000 0.996 0.000
#> SRR1791329 2 0.0000 0.9121 0.000 1.000 0.000 0.000
#> SRR1791321 4 0.5511 0.4665 0.352 0.000 0.028 0.620
#> SRR1791320 2 0.1575 0.8946 0.012 0.956 0.028 0.004
#> SRR1791325 3 0.1733 0.8271 0.028 0.000 0.948 0.024
#> SRR1791318 4 0.5126 0.4947 0.444 0.000 0.004 0.552
#> SRR1791317 3 0.0336 0.8345 0.008 0.000 0.992 0.000
#> SRR1791313 4 0.4955 0.4966 0.444 0.000 0.000 0.556
#> SRR1791312 4 0.5688 0.4404 0.464 0.000 0.024 0.512
#> SRR1791319 3 0.6197 -0.1416 0.400 0.000 0.544 0.056
#> SRR1791316 1 0.7318 -0.0170 0.476 0.000 0.160 0.364
#> SRR1791315 4 0.4941 0.4995 0.436 0.000 0.000 0.564
#> SRR1791311 4 0.1211 0.5436 0.040 0.000 0.000 0.960
#> SRR1791314 2 0.0188 0.9119 0.004 0.996 0.000 0.000
#> SRR1791310 2 0.0188 0.9117 0.000 0.996 0.000 0.004
#> SRR1791308 2 0.6741 0.1153 0.092 0.484 0.424 0.000
#> SRR1791307 4 0.0592 0.5214 0.016 0.000 0.000 0.984
#> SRR1791306 4 0.1211 0.5399 0.040 0.000 0.000 0.960
#> SRR1791305 2 0.2345 0.8462 0.000 0.900 0.100 0.000
#> SRR1791309 3 0.0817 0.8277 0.024 0.000 0.976 0.000
#> SRR1791304 4 0.5137 0.4888 0.452 0.000 0.004 0.544
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1791347 2 0.4290 0.7121 0.008 0.768 0.016 0.192 0.016
#> SRR1791346 3 0.4286 0.4792 0.000 0.260 0.716 0.004 0.020
#> SRR1791345 5 0.2003 0.8354 0.008 0.008 0.052 0.004 0.928
#> SRR1791344 2 0.0727 0.9428 0.000 0.980 0.004 0.004 0.012
#> SRR1791343 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791341 4 0.2124 0.8505 0.056 0.000 0.000 0.916 0.028
#> SRR1791342 4 0.3728 0.4478 0.000 0.244 0.000 0.748 0.008
#> SRR1791340 2 0.0290 0.9487 0.000 0.992 0.000 0.000 0.008
#> SRR1791375 3 0.2834 0.7663 0.060 0.000 0.888 0.040 0.012
#> SRR1791374 3 0.2597 0.7434 0.120 0.000 0.872 0.004 0.004
#> SRR1791372 1 0.2929 0.8039 0.820 0.000 0.000 0.180 0.000
#> SRR1791370 3 0.1202 0.7803 0.032 0.000 0.960 0.004 0.004
#> SRR1791373 2 0.4498 0.5098 0.304 0.676 0.012 0.004 0.004
#> SRR1791369 1 0.3662 0.7414 0.744 0.000 0.000 0.252 0.004
#> SRR1791371 1 0.3511 0.6923 0.800 0.000 0.184 0.012 0.004
#> SRR1791368 4 0.2270 0.8461 0.076 0.000 0.000 0.904 0.020
#> SRR1791366 2 0.1430 0.9129 0.000 0.944 0.052 0.000 0.004
#> SRR1791364 1 0.2522 0.8211 0.880 0.000 0.000 0.108 0.012
#> SRR1791367 1 0.4706 0.4868 0.656 0.000 0.316 0.008 0.020
#> SRR1791363 4 0.1281 0.8511 0.032 0.000 0.000 0.956 0.012
#> SRR1791361 4 0.1082 0.8482 0.028 0.000 0.000 0.964 0.008
#> SRR1791360 3 0.4356 0.6805 0.056 0.000 0.776 0.156 0.012
#> SRR1791359 3 0.0609 0.7782 0.000 0.000 0.980 0.000 0.020
#> SRR1791358 2 0.0290 0.9487 0.000 0.992 0.000 0.000 0.008
#> SRR1791365 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791357 1 0.2699 0.8280 0.880 0.000 0.012 0.100 0.008
#> SRR1791356 1 0.2110 0.8228 0.912 0.000 0.016 0.072 0.000
#> SRR1791355 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791362 4 0.2519 0.8303 0.100 0.000 0.000 0.884 0.016
#> SRR1791354 3 0.2929 0.6983 0.000 0.000 0.840 0.008 0.152
#> SRR1791353 4 0.0960 0.8400 0.016 0.000 0.008 0.972 0.004
#> SRR1791352 1 0.2005 0.8164 0.924 0.000 0.016 0.056 0.004
#> SRR1791349 2 0.0162 0.9496 0.000 0.996 0.004 0.000 0.000
#> SRR1791348 1 0.2806 0.7773 0.888 0.000 0.008 0.052 0.052
#> SRR1791351 2 0.0290 0.9487 0.000 0.992 0.000 0.000 0.008
#> SRR1791350 5 0.2899 0.8453 0.100 0.000 0.008 0.020 0.872
#> SRR1791339 2 0.0324 0.9483 0.000 0.992 0.000 0.004 0.004
#> SRR1791338 2 0.0510 0.9447 0.000 0.984 0.000 0.000 0.016
#> SRR1791336 2 0.0290 0.9487 0.000 0.992 0.000 0.000 0.008
#> SRR1791337 3 0.1285 0.7735 0.004 0.000 0.956 0.004 0.036
#> SRR1791335 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791332 5 0.4735 0.7396 0.036 0.000 0.028 0.196 0.740
#> SRR1791331 2 0.0162 0.9500 0.000 0.996 0.000 0.000 0.004
#> SRR1791330 3 0.4120 0.7145 0.072 0.000 0.804 0.112 0.012
#> SRR1791334 1 0.6432 0.2325 0.492 0.000 0.380 0.108 0.020
#> SRR1791328 2 0.5371 0.5689 0.020 0.676 0.012 0.256 0.036
#> SRR1791327 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791333 4 0.2029 0.8389 0.036 0.012 0.004 0.932 0.016
#> SRR1791326 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791324 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791323 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791322 3 0.0740 0.7811 0.008 0.000 0.980 0.004 0.008
#> SRR1791329 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791321 4 0.5372 -0.1417 0.448 0.000 0.044 0.504 0.004
#> SRR1791320 2 0.1173 0.9328 0.000 0.964 0.020 0.004 0.012
#> SRR1791325 3 0.2424 0.7727 0.052 0.000 0.908 0.032 0.008
#> SRR1791318 1 0.2233 0.8175 0.904 0.000 0.000 0.080 0.016
#> SRR1791317 3 0.0771 0.7776 0.000 0.000 0.976 0.004 0.020
#> SRR1791313 1 0.3769 0.7905 0.788 0.000 0.000 0.180 0.032
#> SRR1791312 1 0.4211 0.8096 0.792 0.000 0.028 0.148 0.032
#> SRR1791319 3 0.4700 -0.0174 0.472 0.000 0.516 0.008 0.004
#> SRR1791316 1 0.3415 0.7504 0.840 0.000 0.120 0.032 0.008
#> SRR1791315 1 0.3662 0.7363 0.744 0.000 0.000 0.252 0.004
#> SRR1791311 4 0.2193 0.8420 0.092 0.000 0.000 0.900 0.008
#> SRR1791314 2 0.0000 0.9510 0.000 1.000 0.000 0.000 0.000
#> SRR1791310 2 0.0162 0.9500 0.000 0.996 0.000 0.000 0.004
#> SRR1791308 3 0.5549 0.0403 0.000 0.460 0.480 0.004 0.056
#> SRR1791307 4 0.1121 0.8550 0.044 0.000 0.000 0.956 0.000
#> SRR1791306 4 0.1877 0.8540 0.064 0.000 0.000 0.924 0.012
#> SRR1791305 2 0.1270 0.9142 0.000 0.948 0.052 0.000 0.000
#> SRR1791309 3 0.1197 0.7663 0.000 0.000 0.952 0.000 0.048
#> SRR1791304 1 0.2488 0.8244 0.872 0.000 0.000 0.124 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1791347 6 0.3893 0.7475 0.000 0.092 0.000 0.140 0.000 0.768
#> SRR1791346 3 0.4441 0.2449 0.000 0.032 0.620 0.000 0.004 0.344
#> SRR1791345 5 0.1624 0.7956 0.000 0.020 0.040 0.004 0.936 0.000
#> SRR1791344 6 0.1444 0.9089 0.000 0.072 0.000 0.000 0.000 0.928
#> SRR1791343 6 0.0146 0.9343 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1791341 4 0.1572 0.8545 0.028 0.036 0.000 0.936 0.000 0.000
#> SRR1791342 4 0.3982 0.5263 0.000 0.060 0.000 0.740 0.000 0.200
#> SRR1791340 6 0.0951 0.9309 0.000 0.020 0.004 0.000 0.008 0.968
#> SRR1791375 3 0.3972 0.4448 0.016 0.220 0.740 0.024 0.000 0.000
#> SRR1791374 3 0.3618 0.4556 0.048 0.176 0.776 0.000 0.000 0.000
#> SRR1791372 1 0.3389 0.6709 0.800 0.032 0.000 0.164 0.004 0.000
#> SRR1791370 3 0.2473 0.5445 0.008 0.136 0.856 0.000 0.000 0.000
#> SRR1791373 6 0.4443 0.4977 0.300 0.052 0.000 0.000 0.000 0.648
#> SRR1791369 1 0.3560 0.6023 0.732 0.008 0.000 0.256 0.004 0.000
#> SRR1791371 1 0.3376 0.5663 0.816 0.052 0.128 0.000 0.004 0.000
#> SRR1791368 4 0.3140 0.8001 0.068 0.076 0.004 0.848 0.004 0.000
#> SRR1791366 6 0.1732 0.8939 0.000 0.004 0.072 0.000 0.004 0.920
#> SRR1791364 1 0.1957 0.7091 0.920 0.048 0.000 0.024 0.008 0.000
#> SRR1791367 1 0.5753 -0.4425 0.512 0.236 0.252 0.000 0.000 0.000
#> SRR1791363 4 0.0837 0.8537 0.004 0.020 0.000 0.972 0.004 0.000
#> SRR1791361 4 0.0993 0.8563 0.012 0.024 0.000 0.964 0.000 0.000
#> SRR1791360 3 0.5301 0.0865 0.012 0.324 0.576 0.088 0.000 0.000
#> SRR1791359 3 0.1138 0.5826 0.000 0.024 0.960 0.004 0.012 0.000
#> SRR1791358 6 0.0603 0.9326 0.000 0.016 0.000 0.000 0.004 0.980
#> SRR1791365 6 0.0146 0.9339 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1791357 1 0.3560 0.6239 0.788 0.176 0.016 0.020 0.000 0.000
#> SRR1791356 1 0.1453 0.7001 0.944 0.040 0.008 0.008 0.000 0.000
#> SRR1791355 6 0.0146 0.9343 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1791362 4 0.2119 0.8449 0.044 0.036 0.000 0.912 0.008 0.000
#> SRR1791354 3 0.3554 0.4891 0.000 0.108 0.808 0.004 0.080 0.000
#> SRR1791353 4 0.0547 0.8522 0.000 0.020 0.000 0.980 0.000 0.000
#> SRR1791352 1 0.1148 0.7015 0.960 0.020 0.016 0.004 0.000 0.000
#> SRR1791349 6 0.0622 0.9324 0.000 0.008 0.012 0.000 0.000 0.980
#> SRR1791348 1 0.5059 0.4812 0.656 0.260 0.004 0.040 0.040 0.000
#> SRR1791351 6 0.0603 0.9326 0.000 0.016 0.000 0.000 0.004 0.980
#> SRR1791350 5 0.3459 0.7984 0.044 0.124 0.008 0.004 0.820 0.000
#> SRR1791339 6 0.1387 0.9110 0.000 0.068 0.000 0.000 0.000 0.932
#> SRR1791338 6 0.1116 0.9271 0.000 0.028 0.004 0.000 0.008 0.960
#> SRR1791336 6 0.1036 0.9287 0.000 0.024 0.004 0.000 0.008 0.964
#> SRR1791337 3 0.0622 0.5873 0.000 0.012 0.980 0.000 0.008 0.000
#> SRR1791335 6 0.0458 0.9334 0.000 0.016 0.000 0.000 0.000 0.984
#> SRR1791332 5 0.5069 0.7128 0.044 0.080 0.012 0.144 0.720 0.000
#> SRR1791331 6 0.0713 0.9281 0.000 0.028 0.000 0.000 0.000 0.972
#> SRR1791330 3 0.4887 0.3160 0.024 0.256 0.668 0.048 0.004 0.000
#> SRR1791334 2 0.7131 0.0000 0.268 0.356 0.300 0.076 0.000 0.000
#> SRR1791328 6 0.5240 0.5834 0.008 0.168 0.000 0.168 0.004 0.652
#> SRR1791327 6 0.0458 0.9334 0.000 0.016 0.000 0.000 0.000 0.984
#> SRR1791333 4 0.2345 0.8214 0.020 0.060 0.000 0.900 0.000 0.020
#> SRR1791326 6 0.0508 0.9339 0.000 0.012 0.004 0.000 0.000 0.984
#> SRR1791324 6 0.0146 0.9339 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1791323 6 0.0260 0.9344 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR1791322 3 0.1141 0.5796 0.000 0.052 0.948 0.000 0.000 0.000
#> SRR1791329 6 0.0146 0.9339 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR1791321 4 0.6026 0.1252 0.304 0.144 0.028 0.524 0.000 0.000
#> SRR1791320 6 0.1908 0.8963 0.000 0.096 0.004 0.000 0.000 0.900
#> SRR1791325 3 0.4053 0.4482 0.012 0.204 0.744 0.040 0.000 0.000
#> SRR1791318 1 0.1649 0.7100 0.936 0.040 0.000 0.016 0.008 0.000
#> SRR1791317 3 0.0862 0.5855 0.000 0.016 0.972 0.004 0.008 0.000
#> SRR1791313 1 0.3314 0.6804 0.816 0.032 0.000 0.144 0.008 0.000
#> SRR1791312 1 0.5704 0.4253 0.584 0.288 0.016 0.100 0.012 0.000
#> SRR1791319 3 0.5873 -0.6631 0.368 0.200 0.432 0.000 0.000 0.000
#> SRR1791316 1 0.4540 0.4728 0.712 0.196 0.084 0.004 0.004 0.000
#> SRR1791315 1 0.4215 0.5650 0.688 0.024 0.000 0.276 0.012 0.000
#> SRR1791311 4 0.1594 0.8534 0.052 0.016 0.000 0.932 0.000 0.000
#> SRR1791314 6 0.0458 0.9334 0.000 0.016 0.000 0.000 0.000 0.984
#> SRR1791310 6 0.1267 0.9142 0.000 0.060 0.000 0.000 0.000 0.940
#> SRR1791308 3 0.5606 0.0958 0.000 0.092 0.472 0.000 0.016 0.420
#> SRR1791307 4 0.1334 0.8545 0.032 0.020 0.000 0.948 0.000 0.000
#> SRR1791306 4 0.1261 0.8575 0.024 0.024 0.000 0.952 0.000 0.000
#> SRR1791305 6 0.1888 0.8947 0.000 0.012 0.068 0.000 0.004 0.916
#> SRR1791309 3 0.1624 0.5723 0.000 0.040 0.936 0.004 0.020 0.000
#> SRR1791304 1 0.1780 0.7163 0.924 0.028 0.000 0.048 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
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