Date: 2019-12-25 22:48:40 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 17667 rows and 70 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] 17667 70
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:mclust | 2 | 1.000 | 0.941 | 0.973 | ** | |
CV:kmeans | 2 | 1.000 | 0.992 | 0.993 | ** | |
CV:pam | 2 | 1.000 | 0.999 | 1.000 | ** | |
ATC:kmeans | 2 | 1.000 | 0.920 | 0.972 | ** | |
MAD:skmeans | 6 | 0.996 | 0.956 | 0.972 | ** | 3,4 |
MAD:kmeans | 4 | 0.986 | 0.948 | 0.967 | ** | 3 |
ATC:NMF | 3 | 0.974 | 0.939 | 0.978 | ** | |
ATC:skmeans | 4 | 0.973 | 0.912 | 0.966 | ** | 2,3 |
SD:NMF | 4 | 0.961 | 0.945 | 0.978 | ** | 2 |
SD:kmeans | 4 | 0.959 | 0.937 | 0.951 | ** | 2 |
ATC:pam | 6 | 0.956 | 0.828 | 0.908 | ** | 4,5 |
SD:skmeans | 6 | 0.956 | 0.947 | 0.956 | ** | 2,4 |
MAD:pam | 6 | 0.943 | 0.910 | 0.963 | * | 2,3,4 |
CV:skmeans | 2 | 0.941 | 0.946 | 0.978 | * | |
SD:pam | 4 | 0.940 | 0.951 | 0.980 | * | 2,3 |
MAD:NMF | 4 | 0.915 | 0.887 | 0.957 | * | 2,3 |
MAD:mclust | 4 | 0.912 | 0.914 | 0.965 | * | 2 |
ATC:mclust | 4 | 0.907 | 0.912 | 0.960 | * | 2 |
CV:NMF | 4 | 0.906 | 0.889 | 0.959 | * | 2,3 |
ATC:hclust | 2 | 0.810 | 0.885 | 0.950 | ||
MAD:hclust | 4 | 0.770 | 0.828 | 0.923 | ||
CV:hclust | 3 | 0.678 | 0.729 | 0.874 | ||
CV:mclust | 2 | 0.675 | 0.868 | 0.936 | ||
SD:hclust | 4 | 0.648 | 0.809 | 0.875 |
**: 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.997 0.999 0.374 0.627 0.627
#> CV:NMF 2 0.970 0.955 0.981 0.387 0.627 0.627
#> MAD:NMF 2 1.000 0.995 0.997 0.400 0.599 0.599
#> ATC:NMF 2 0.825 0.936 0.970 0.353 0.658 0.658
#> SD:skmeans 2 1.000 0.986 0.993 0.431 0.574 0.574
#> CV:skmeans 2 0.941 0.946 0.978 0.434 0.574 0.574
#> MAD:skmeans 2 0.328 0.297 0.667 0.471 0.503 0.503
#> ATC:skmeans 2 1.000 0.999 1.000 0.504 0.496 0.496
#> SD:mclust 2 1.000 0.941 0.973 0.444 0.574 0.574
#> CV:mclust 2 0.675 0.868 0.936 0.455 0.552 0.552
#> MAD:mclust 2 1.000 1.000 1.000 0.427 0.574 0.574
#> ATC:mclust 2 0.969 0.946 0.965 0.418 0.574 0.574
#> SD:kmeans 2 1.000 0.995 0.998 0.340 0.658 0.658
#> CV:kmeans 2 1.000 0.992 0.993 0.345 0.658 0.658
#> MAD:kmeans 2 0.531 0.871 0.925 0.372 0.675 0.675
#> ATC:kmeans 2 1.000 0.920 0.972 0.487 0.519 0.519
#> SD:pam 2 1.000 0.985 0.994 0.335 0.658 0.658
#> CV:pam 2 1.000 0.999 1.000 0.342 0.658 0.658
#> MAD:pam 2 1.000 0.995 0.998 0.328 0.675 0.675
#> ATC:pam 2 0.611 0.812 0.923 0.412 0.586 0.586
#> SD:hclust 2 0.525 0.910 0.932 0.364 0.675 0.675
#> CV:hclust 2 0.498 0.802 0.843 0.376 0.658 0.658
#> MAD:hclust 2 0.645 0.825 0.914 0.411 0.599 0.599
#> ATC:hclust 2 0.810 0.885 0.950 0.478 0.526 0.526
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 0.693 0.736 0.861 0.559 0.683 0.509
#> CV:NMF 3 0.946 0.924 0.969 0.344 0.848 0.760
#> MAD:NMF 3 0.911 0.906 0.961 0.607 0.663 0.479
#> ATC:NMF 3 0.974 0.939 0.978 0.618 0.762 0.639
#> SD:skmeans 3 0.880 0.908 0.962 0.547 0.718 0.524
#> CV:skmeans 3 0.611 0.802 0.902 0.512 0.699 0.503
#> MAD:skmeans 3 0.955 0.912 0.966 0.409 0.685 0.452
#> ATC:skmeans 3 0.977 0.957 0.979 0.256 0.810 0.638
#> SD:mclust 3 0.690 0.812 0.906 0.377 0.816 0.680
#> CV:mclust 3 0.587 0.608 0.783 0.276 0.925 0.870
#> MAD:mclust 3 0.691 0.820 0.841 0.294 0.963 0.935
#> ATC:mclust 3 0.749 0.891 0.916 0.546 0.757 0.576
#> SD:kmeans 3 0.627 0.861 0.871 0.745 0.704 0.551
#> CV:kmeans 3 0.667 0.793 0.841 0.706 0.687 0.525
#> MAD:kmeans 3 0.916 0.942 0.955 0.639 0.702 0.559
#> ATC:kmeans 3 0.702 0.762 0.865 0.300 0.795 0.631
#> SD:pam 3 0.976 0.957 0.982 0.822 0.733 0.594
#> CV:pam 3 0.834 0.885 0.939 0.831 0.710 0.560
#> MAD:pam 3 1.000 0.989 0.995 0.838 0.725 0.594
#> ATC:pam 3 0.871 0.899 0.951 0.482 0.732 0.569
#> SD:hclust 3 0.568 0.688 0.819 0.578 0.676 0.520
#> CV:hclust 3 0.678 0.729 0.874 0.429 0.878 0.815
#> MAD:hclust 3 0.728 0.829 0.923 0.507 0.786 0.642
#> ATC:hclust 3 0.618 0.824 0.844 0.206 0.930 0.868
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.961 0.945 0.978 0.2173 0.742 0.425
#> CV:NMF 4 0.906 0.889 0.959 0.3885 0.756 0.518
#> MAD:NMF 4 0.915 0.887 0.957 0.1117 0.792 0.513
#> ATC:NMF 4 0.690 0.780 0.879 0.2866 0.812 0.572
#> SD:skmeans 4 0.948 0.935 0.971 0.0761 0.896 0.711
#> CV:skmeans 4 0.815 0.829 0.920 0.1088 0.937 0.817
#> MAD:skmeans 4 0.979 0.925 0.967 0.0830 0.901 0.722
#> ATC:skmeans 4 0.973 0.912 0.966 0.1201 0.916 0.771
#> SD:mclust 4 0.662 0.751 0.865 0.0522 0.907 0.780
#> CV:mclust 4 0.584 0.747 0.818 0.0563 0.888 0.799
#> MAD:mclust 4 0.912 0.914 0.965 0.2390 0.781 0.593
#> ATC:mclust 4 0.907 0.912 0.960 0.0717 0.888 0.699
#> SD:kmeans 4 0.959 0.937 0.951 0.1424 0.837 0.614
#> CV:kmeans 4 0.793 0.875 0.912 0.1836 0.854 0.626
#> MAD:kmeans 4 0.986 0.948 0.967 0.1242 0.867 0.679
#> ATC:kmeans 4 0.667 0.810 0.874 0.1396 0.761 0.462
#> SD:pam 4 0.940 0.951 0.980 0.1292 0.920 0.797
#> CV:pam 4 0.828 0.867 0.947 0.1254 0.899 0.733
#> MAD:pam 4 1.000 0.977 0.990 0.1286 0.918 0.795
#> ATC:pam 4 0.984 0.930 0.974 0.2205 0.773 0.482
#> SD:hclust 4 0.648 0.809 0.875 0.1306 0.782 0.503
#> CV:hclust 4 0.636 0.582 0.837 0.0721 0.954 0.915
#> MAD:hclust 4 0.770 0.828 0.923 0.1150 0.923 0.800
#> ATC:hclust 4 0.722 0.801 0.875 0.2414 0.814 0.594
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.800 0.779 0.901 0.0699 0.901 0.687
#> CV:NMF 5 0.774 0.779 0.875 0.0757 0.894 0.640
#> MAD:NMF 5 0.846 0.858 0.924 0.1016 0.884 0.620
#> ATC:NMF 5 0.788 0.792 0.889 0.0759 0.892 0.628
#> SD:skmeans 5 0.849 0.849 0.919 0.1030 0.882 0.617
#> CV:skmeans 5 0.774 0.772 0.880 0.0801 0.888 0.637
#> MAD:skmeans 5 0.861 0.884 0.927 0.0992 0.906 0.679
#> ATC:skmeans 5 0.876 0.851 0.925 0.0435 0.932 0.784
#> SD:mclust 5 0.681 0.659 0.815 0.1452 0.854 0.625
#> CV:mclust 5 0.552 0.542 0.770 0.2322 0.752 0.502
#> MAD:mclust 5 0.711 0.746 0.876 0.0860 0.891 0.684
#> ATC:mclust 5 0.743 0.642 0.833 0.1136 0.880 0.623
#> SD:kmeans 5 0.730 0.682 0.809 0.1212 0.917 0.740
#> CV:kmeans 5 0.697 0.623 0.803 0.0920 0.970 0.897
#> MAD:kmeans 5 0.736 0.688 0.801 0.1089 0.907 0.712
#> ATC:kmeans 5 0.718 0.700 0.836 0.0723 0.950 0.817
#> SD:pam 5 0.792 0.801 0.843 0.0911 0.929 0.778
#> CV:pam 5 0.732 0.799 0.856 0.0973 0.896 0.650
#> MAD:pam 5 0.800 0.744 0.852 0.1192 0.921 0.762
#> ATC:pam 5 0.942 0.886 0.947 0.0545 0.918 0.704
#> SD:hclust 5 0.622 0.784 0.853 0.0436 0.966 0.894
#> CV:hclust 5 0.676 0.855 0.897 0.2026 0.754 0.521
#> MAD:hclust 5 0.701 0.705 0.862 0.0496 0.995 0.982
#> ATC:hclust 5 0.802 0.819 0.908 0.0416 0.986 0.950
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.810 0.808 0.892 0.0545 0.893 0.607
#> CV:NMF 6 0.807 0.738 0.846 0.0440 0.926 0.687
#> MAD:NMF 6 0.881 0.743 0.903 0.0318 0.979 0.903
#> ATC:NMF 6 0.777 0.702 0.838 0.0364 0.945 0.747
#> SD:skmeans 6 0.956 0.947 0.956 0.0487 0.928 0.678
#> CV:skmeans 6 0.821 0.769 0.870 0.0525 0.925 0.676
#> MAD:skmeans 6 0.996 0.956 0.972 0.0511 0.932 0.697
#> ATC:skmeans 6 0.793 0.788 0.823 0.0405 0.972 0.898
#> SD:mclust 6 0.680 0.689 0.779 0.0884 0.862 0.537
#> CV:mclust 6 0.634 0.649 0.764 0.0495 0.822 0.436
#> MAD:mclust 6 0.784 0.827 0.869 0.0935 0.856 0.515
#> ATC:mclust 6 0.775 0.757 0.855 0.0484 0.906 0.630
#> SD:kmeans 6 0.708 0.555 0.758 0.0605 0.943 0.772
#> CV:kmeans 6 0.693 0.601 0.751 0.0632 0.875 0.553
#> MAD:kmeans 6 0.745 0.590 0.772 0.0658 0.901 0.618
#> ATC:kmeans 6 0.756 0.650 0.759 0.0455 0.938 0.748
#> SD:pam 6 0.858 0.874 0.901 0.0850 0.886 0.586
#> CV:pam 6 0.731 0.739 0.819 0.0337 0.985 0.930
#> MAD:pam 6 0.943 0.910 0.963 0.0748 0.891 0.605
#> ATC:pam 6 0.956 0.828 0.908 0.0243 0.966 0.845
#> SD:hclust 6 0.731 0.657 0.840 0.1070 0.973 0.910
#> CV:hclust 6 0.763 0.850 0.911 0.0306 0.997 0.989
#> MAD:hclust 6 0.739 0.729 0.858 0.0444 0.925 0.758
#> ATC:hclust 6 0.800 0.749 0.878 0.0211 0.995 0.982
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 17667 rows and 70 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 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.525 0.910 0.932 0.3635 0.675 0.675
#> 3 3 0.568 0.688 0.819 0.5777 0.676 0.520
#> 4 4 0.648 0.809 0.875 0.1306 0.782 0.503
#> 5 5 0.622 0.784 0.853 0.0436 0.966 0.894
#> 6 6 0.731 0.657 0.840 0.1070 0.973 0.910
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 1 0.714 0.862 0.804 0.196
#> SRR1405147 1 0.469 0.903 0.900 0.100
#> SRR1315412 2 0.000 1.000 0.000 1.000
#> SRR1338384 1 0.000 0.908 1.000 0.000
#> SRR1071105 1 0.795 0.634 0.760 0.240
#> SRR1432868 2 0.000 1.000 0.000 1.000
#> SRR1454480 1 0.000 0.908 1.000 0.000
#> SRR1330723 2 0.000 1.000 0.000 1.000
#> SRR1475324 1 0.714 0.862 0.804 0.196
#> SRR1340260 1 0.469 0.903 0.900 0.100
#> SRR1376450 1 0.224 0.890 0.964 0.036
#> SRR1321897 1 0.714 0.862 0.804 0.196
#> SRR1445194 1 0.000 0.908 1.000 0.000
#> SRR1443308 1 0.714 0.862 0.804 0.196
#> SRR1400931 1 0.000 0.908 1.000 0.000
#> SRR1416188 1 0.714 0.862 0.804 0.196
#> SRR1407044 1 0.529 0.897 0.880 0.120
#> SRR1078392 1 0.204 0.908 0.968 0.032
#> SRR1436468 1 0.714 0.862 0.804 0.196
#> SRR1476125 2 0.000 1.000 0.000 1.000
#> SRR1418747 1 0.430 0.905 0.912 0.088
#> SRR1318089 1 0.714 0.862 0.804 0.196
#> SRR1444370 1 0.000 0.908 1.000 0.000
#> SRR1348929 2 0.000 1.000 0.000 1.000
#> SRR1385690 1 0.000 0.908 1.000 0.000
#> SRR1460337 1 0.224 0.890 0.964 0.036
#> SRR1469062 1 0.000 0.908 1.000 0.000
#> SRR1388459 1 0.714 0.862 0.804 0.196
#> SRR1416841 1 0.714 0.862 0.804 0.196
#> SRR1473778 1 0.469 0.903 0.900 0.100
#> SRR1419561 1 0.000 0.908 1.000 0.000
#> SRR1339987 1 0.000 0.908 1.000 0.000
#> SRR1469662 1 0.000 0.908 1.000 0.000
#> SRR1432958 1 0.000 0.908 1.000 0.000
#> SRR1479198 1 0.000 0.908 1.000 0.000
#> SRR1353600 1 0.000 0.908 1.000 0.000
#> SRR1456492 1 0.714 0.862 0.804 0.196
#> SRR1389955 1 0.000 0.908 1.000 0.000
#> SRR1429540 1 0.469 0.903 0.900 0.100
#> SRR1356057 1 0.671 0.873 0.824 0.176
#> SRR1328715 1 0.469 0.903 0.900 0.100
#> SRR1429429 1 0.714 0.862 0.804 0.196
#> SRR1325201 2 0.000 1.000 0.000 1.000
#> SRR1382978 1 0.714 0.862 0.804 0.196
#> SRR1406348 2 0.000 1.000 0.000 1.000
#> SRR1469390 2 0.000 1.000 0.000 1.000
#> SRR1376380 1 0.714 0.862 0.804 0.196
#> SRR1418225 1 0.000 0.908 1.000 0.000
#> SRR1418473 2 0.000 1.000 0.000 1.000
#> SRR1376741 1 0.469 0.903 0.900 0.100
#> SRR1431823 1 0.714 0.862 0.804 0.196
#> SRR1447916 2 0.000 1.000 0.000 1.000
#> SRR1458643 1 0.000 0.908 1.000 0.000
#> SRR1445618 1 0.000 0.908 1.000 0.000
#> SRR1081589 1 0.000 0.908 1.000 0.000
#> SRR1097245 1 0.000 0.908 1.000 0.000
#> SRR1416141 1 0.000 0.908 1.000 0.000
#> SRR1404339 2 0.000 1.000 0.000 1.000
#> SRR1478614 1 0.000 0.908 1.000 0.000
#> SRR1406135 1 0.000 0.908 1.000 0.000
#> SRR1413307 1 0.000 0.908 1.000 0.000
#> SRR1397720 2 0.000 1.000 0.000 1.000
#> SRR1358391 1 0.000 0.908 1.000 0.000
#> SRR1381185 1 0.469 0.903 0.900 0.100
#> SRR1100608 2 0.000 1.000 0.000 1.000
#> SRR1386927 2 0.000 1.000 0.000 1.000
#> SRR1331771 1 0.714 0.862 0.804 0.196
#> SRR1486322 1 0.714 0.862 0.804 0.196
#> SRR1080790 1 0.529 0.897 0.880 0.120
#> SRR1459980 1 0.469 0.903 0.900 0.100
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1405147 3 0.6008 0.2646 0.372 0.000 0.628
#> SRR1315412 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1338384 1 0.5968 0.7464 0.636 0.000 0.364
#> SRR1071105 1 0.8266 0.5322 0.624 0.240 0.136
#> SRR1432868 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1454480 1 0.0000 0.5458 1.000 0.000 0.000
#> SRR1330723 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1475324 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1340260 3 0.6008 0.2646 0.372 0.000 0.628
#> SRR1376450 1 0.7084 0.7548 0.628 0.036 0.336
#> SRR1321897 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1445194 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1443308 3 0.4555 0.5143 0.200 0.000 0.800
#> SRR1400931 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1416188 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1407044 3 0.2796 0.6832 0.092 0.000 0.908
#> SRR1078392 3 0.6302 -0.2631 0.480 0.000 0.520
#> SRR1436468 3 0.0592 0.7270 0.012 0.000 0.988
#> SRR1476125 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1418747 3 0.6140 0.0746 0.404 0.000 0.596
#> SRR1318089 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1444370 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1348929 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1385690 1 0.5835 0.7876 0.660 0.000 0.340
#> SRR1460337 1 0.7084 0.7548 0.628 0.036 0.336
#> SRR1469062 1 0.6204 0.6259 0.576 0.000 0.424
#> SRR1388459 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1416841 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1473778 3 0.6140 0.1481 0.404 0.000 0.596
#> SRR1419561 1 0.6008 0.7326 0.628 0.000 0.372
#> SRR1339987 1 0.5835 0.7876 0.660 0.000 0.340
#> SRR1469662 1 0.5835 0.7876 0.660 0.000 0.340
#> SRR1432958 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1479198 1 0.5835 0.7876 0.660 0.000 0.340
#> SRR1353600 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1456492 3 0.3116 0.6728 0.108 0.000 0.892
#> SRR1389955 1 0.5835 0.7876 0.660 0.000 0.340
#> SRR1429540 3 0.6111 0.1830 0.396 0.000 0.604
#> SRR1356057 3 0.4931 0.5414 0.232 0.000 0.768
#> SRR1328715 3 0.6095 0.1931 0.392 0.000 0.608
#> SRR1429429 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1325201 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1382978 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1406348 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1469390 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1376380 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1418225 1 0.0000 0.5458 1.000 0.000 0.000
#> SRR1418473 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1376741 3 0.6008 0.2646 0.372 0.000 0.628
#> SRR1431823 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1447916 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1458643 1 0.0000 0.5458 1.000 0.000 0.000
#> SRR1445618 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1081589 1 0.0000 0.5458 1.000 0.000 0.000
#> SRR1097245 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1416141 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1404339 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1478614 1 0.5810 0.7902 0.664 0.000 0.336
#> SRR1406135 1 0.5835 0.7876 0.660 0.000 0.340
#> SRR1413307 1 0.0000 0.5458 1.000 0.000 0.000
#> SRR1397720 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1358391 1 0.0000 0.5458 1.000 0.000 0.000
#> SRR1381185 3 0.6008 0.2646 0.372 0.000 0.628
#> SRR1100608 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1386927 2 0.0000 1.0000 0.000 1.000 0.000
#> SRR1331771 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1486322 3 0.0000 0.7311 0.000 0.000 1.000
#> SRR1080790 3 0.4291 0.5989 0.180 0.000 0.820
#> SRR1459980 3 0.6008 0.2646 0.372 0.000 0.628
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.4999 0.52725 0.508 0.000 0.492 0.000
#> SRR1315412 2 0.0188 0.99625 0.004 0.996 0.000 0.000
#> SRR1338384 1 0.3873 0.82961 0.772 0.000 0.228 0.000
#> SRR1071105 1 0.4228 0.53770 0.760 0.232 0.000 0.008
#> SRR1432868 2 0.0000 0.99709 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0336 0.95274 0.008 0.000 0.000 0.992
#> SRR1330723 2 0.0000 0.99709 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.4999 0.52725 0.508 0.000 0.492 0.000
#> SRR1376450 1 0.4806 0.81711 0.764 0.028 0.200 0.008
#> SRR1321897 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1445194 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1443308 3 0.3751 0.55943 0.004 0.000 0.800 0.196
#> SRR1400931 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1416188 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.2216 0.78675 0.092 0.000 0.908 0.000
#> SRR1078392 1 0.4804 0.69270 0.616 0.000 0.384 0.000
#> SRR1436468 3 0.3024 0.70942 0.148 0.000 0.852 0.000
#> SRR1476125 2 0.0336 0.99313 0.000 0.992 0.000 0.008
#> SRR1418747 1 0.4981 0.53169 0.536 0.000 0.464 0.000
#> SRR1318089 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1348929 2 0.0000 0.99709 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.3649 0.83965 0.796 0.000 0.204 0.000
#> SRR1460337 1 0.4806 0.81711 0.764 0.028 0.200 0.008
#> SRR1469062 1 0.4356 0.78097 0.708 0.000 0.292 0.000
#> SRR1388459 3 0.2760 0.73994 0.128 0.000 0.872 0.000
#> SRR1416841 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.4977 0.58340 0.540 0.000 0.460 0.000
#> SRR1419561 1 0.3942 0.82629 0.764 0.000 0.236 0.000
#> SRR1339987 1 0.3649 0.83965 0.796 0.000 0.204 0.000
#> SRR1469662 1 0.3649 0.83965 0.796 0.000 0.204 0.000
#> SRR1432958 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1479198 1 0.3649 0.83965 0.796 0.000 0.204 0.000
#> SRR1353600 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1456492 3 0.3975 0.51923 0.240 0.000 0.760 0.000
#> SRR1389955 1 0.3649 0.83965 0.796 0.000 0.204 0.000
#> SRR1429540 1 0.4985 0.56979 0.532 0.000 0.468 0.000
#> SRR1356057 3 0.4905 -0.00315 0.364 0.000 0.632 0.004
#> SRR1328715 1 0.4989 0.56603 0.528 0.000 0.472 0.000
#> SRR1429429 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0336 0.99313 0.000 0.992 0.000 0.008
#> SRR1382978 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 0.99709 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0188 0.99625 0.004 0.996 0.000 0.000
#> SRR1376380 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1418225 4 0.0336 0.95274 0.008 0.000 0.000 0.992
#> SRR1418473 2 0.0188 0.99625 0.004 0.996 0.000 0.000
#> SRR1376741 1 0.4999 0.52725 0.508 0.000 0.492 0.000
#> SRR1431823 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1447916 2 0.0000 0.99709 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.3649 0.90359 0.204 0.000 0.000 0.796
#> SRR1445618 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1081589 4 0.3649 0.90359 0.204 0.000 0.000 0.796
#> SRR1097245 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1416141 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1404339 2 0.0000 0.99709 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.3610 0.83931 0.800 0.000 0.200 0.000
#> SRR1406135 1 0.3649 0.83965 0.796 0.000 0.204 0.000
#> SRR1413307 4 0.0336 0.95274 0.008 0.000 0.000 0.992
#> SRR1397720 2 0.0000 0.99709 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0336 0.95274 0.008 0.000 0.000 0.992
#> SRR1381185 1 0.4999 0.52725 0.508 0.000 0.492 0.000
#> SRR1100608 2 0.0524 0.99249 0.004 0.988 0.000 0.008
#> SRR1386927 2 0.0188 0.99625 0.004 0.996 0.000 0.000
#> SRR1331771 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1486322 3 0.0000 0.87632 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.4193 0.45889 0.268 0.000 0.732 0.000
#> SRR1459980 1 0.4999 0.52725 0.508 0.000 0.492 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1405147 1 0.3796 0.5766 0.700 0.000 0.300 0.000 0.000
#> SRR1315412 2 0.2389 0.8503 0.000 0.880 0.116 0.000 0.004
#> SRR1338384 1 0.0880 0.8262 0.968 0.000 0.032 0.000 0.000
#> SRR1071105 1 0.4349 0.5329 0.756 0.176 0.000 0.000 0.068
#> SRR1432868 2 0.0000 0.8790 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.9290 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 2 0.3305 0.6348 0.000 0.776 0.000 0.000 0.224
#> SRR1475324 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1340260 1 0.3774 0.5811 0.704 0.000 0.296 0.000 0.000
#> SRR1376450 1 0.1043 0.8169 0.960 0.000 0.000 0.000 0.040
#> SRR1321897 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1445194 1 0.0000 0.8335 1.000 0.000 0.000 0.000 0.000
#> SRR1443308 3 0.3231 0.6287 0.004 0.000 0.800 0.196 0.000
#> SRR1400931 1 0.0162 0.8335 0.996 0.000 0.000 0.000 0.004
#> SRR1416188 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1407044 3 0.3366 0.8077 0.232 0.000 0.768 0.000 0.000
#> SRR1078392 1 0.3074 0.7099 0.804 0.000 0.196 0.000 0.000
#> SRR1436468 3 0.3999 0.6356 0.344 0.000 0.656 0.000 0.000
#> SRR1476125 5 0.2929 0.9218 0.000 0.180 0.000 0.000 0.820
#> SRR1418747 1 0.3707 0.5573 0.716 0.000 0.284 0.000 0.000
#> SRR1318089 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1444370 1 0.0162 0.8335 0.996 0.000 0.000 0.000 0.004
#> SRR1348929 2 0.0000 0.8790 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.0290 0.8342 0.992 0.000 0.008 0.000 0.000
#> SRR1460337 1 0.1043 0.8169 0.960 0.000 0.000 0.000 0.040
#> SRR1469062 1 0.2230 0.7704 0.884 0.000 0.116 0.000 0.000
#> SRR1388459 3 0.3876 0.6843 0.316 0.000 0.684 0.000 0.000
#> SRR1416841 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1473778 1 0.3586 0.6270 0.736 0.000 0.264 0.000 0.000
#> SRR1419561 1 0.1197 0.8209 0.952 0.000 0.048 0.000 0.000
#> SRR1339987 1 0.0290 0.8342 0.992 0.000 0.008 0.000 0.000
#> SRR1469662 1 0.0290 0.8342 0.992 0.000 0.008 0.000 0.000
#> SRR1432958 1 0.0162 0.8335 0.996 0.000 0.000 0.000 0.004
#> SRR1479198 1 0.0290 0.8342 0.992 0.000 0.008 0.000 0.000
#> SRR1353600 1 0.0162 0.8335 0.996 0.000 0.000 0.000 0.004
#> SRR1456492 3 0.4219 0.4565 0.416 0.000 0.584 0.000 0.000
#> SRR1389955 1 0.0290 0.8342 0.992 0.000 0.008 0.000 0.000
#> SRR1429540 1 0.3636 0.6159 0.728 0.000 0.272 0.000 0.000
#> SRR1356057 1 0.4420 0.0813 0.548 0.000 0.448 0.004 0.000
#> SRR1328715 1 0.3636 0.6177 0.728 0.000 0.272 0.000 0.000
#> SRR1429429 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1325201 5 0.2929 0.9218 0.000 0.180 0.000 0.000 0.820
#> SRR1382978 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1406348 2 0.0000 0.8790 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.2389 0.8503 0.000 0.880 0.116 0.000 0.004
#> SRR1376380 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1418225 4 0.0000 0.9290 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.2389 0.8503 0.000 0.880 0.116 0.000 0.004
#> SRR1376741 1 0.3774 0.5811 0.704 0.000 0.296 0.000 0.000
#> SRR1431823 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1447916 2 0.0000 0.8790 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.3527 0.8513 0.000 0.000 0.024 0.804 0.172
#> SRR1445618 1 0.0162 0.8335 0.996 0.000 0.000 0.000 0.004
#> SRR1081589 4 0.3527 0.8513 0.000 0.000 0.024 0.804 0.172
#> SRR1097245 1 0.0162 0.8335 0.996 0.000 0.000 0.000 0.004
#> SRR1416141 1 0.0162 0.8335 0.996 0.000 0.000 0.000 0.004
#> SRR1404339 2 0.3305 0.6348 0.000 0.776 0.000 0.000 0.224
#> SRR1478614 1 0.0162 0.8335 0.996 0.000 0.000 0.000 0.004
#> SRR1406135 1 0.0162 0.8341 0.996 0.000 0.004 0.000 0.000
#> SRR1413307 4 0.0000 0.9290 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.8790 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.9290 0.000 0.000 0.000 1.000 0.000
#> SRR1381185 1 0.3796 0.5766 0.700 0.000 0.300 0.000 0.000
#> SRR1100608 5 0.3620 0.8459 0.000 0.068 0.108 0.000 0.824
#> SRR1386927 2 0.2389 0.8503 0.000 0.880 0.116 0.000 0.004
#> SRR1331771 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1486322 3 0.2516 0.8984 0.140 0.000 0.860 0.000 0.000
#> SRR1080790 3 0.4201 0.5009 0.408 0.000 0.592 0.000 0.000
#> SRR1459980 1 0.3796 0.5766 0.700 0.000 0.300 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0458 0.8914 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1405147 1 0.4641 0.2107 0.552 0.000 0.044 0.000 0.000 0.404
#> SRR1315412 2 0.2416 0.8208 0.000 0.844 0.000 0.000 0.156 0.000
#> SRR1338384 1 0.2896 0.6529 0.824 0.000 0.016 0.000 0.000 0.160
#> SRR1071105 1 0.4517 0.3171 0.744 0.156 0.000 0.000 0.048 0.052
#> SRR1432868 2 0.0000 0.8584 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.9266 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 2 0.3101 0.5941 0.000 0.756 0.000 0.000 0.244 0.000
#> SRR1475324 3 0.0458 0.8914 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1340260 1 0.4584 0.2193 0.556 0.000 0.040 0.000 0.000 0.404
#> SRR1376450 1 0.1141 0.6268 0.948 0.000 0.000 0.000 0.000 0.052
#> SRR1321897 3 0.0363 0.8905 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1445194 1 0.0146 0.6675 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1443308 3 0.3776 0.6808 0.000 0.000 0.756 0.196 0.000 0.048
#> SRR1400931 1 0.0000 0.6669 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.0363 0.8916 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1407044 3 0.2070 0.7757 0.092 0.000 0.896 0.000 0.000 0.012
#> SRR1078392 1 0.4078 0.4526 0.656 0.000 0.024 0.000 0.000 0.320
#> SRR1436468 6 0.4311 0.5484 0.196 0.000 0.088 0.000 0.000 0.716
#> SRR1476125 5 0.2416 0.8862 0.000 0.156 0.000 0.000 0.844 0.000
#> SRR1418747 1 0.5543 -0.0854 0.524 0.000 0.156 0.000 0.000 0.320
#> SRR1318089 3 0.0458 0.8914 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1444370 1 0.0000 0.6669 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.8584 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 1 0.2653 0.6649 0.844 0.000 0.012 0.000 0.000 0.144
#> SRR1460337 1 0.1141 0.6268 0.948 0.000 0.000 0.000 0.000 0.052
#> SRR1469062 1 0.4613 0.4640 0.688 0.000 0.116 0.000 0.000 0.196
#> SRR1388459 3 0.5537 -0.3058 0.152 0.000 0.520 0.000 0.000 0.328
#> SRR1416841 3 0.0458 0.8914 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1473778 1 0.4283 0.3043 0.592 0.000 0.024 0.000 0.000 0.384
#> SRR1419561 1 0.3168 0.6406 0.804 0.000 0.024 0.000 0.000 0.172
#> SRR1339987 1 0.2653 0.6649 0.844 0.000 0.012 0.000 0.000 0.144
#> SRR1469662 1 0.2653 0.6649 0.844 0.000 0.012 0.000 0.000 0.144
#> SRR1432958 1 0.0000 0.6669 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1479198 1 0.2653 0.6649 0.844 0.000 0.012 0.000 0.000 0.144
#> SRR1353600 1 0.0000 0.6669 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1456492 6 0.5942 0.5543 0.220 0.000 0.356 0.000 0.000 0.424
#> SRR1389955 1 0.2653 0.6649 0.844 0.000 0.012 0.000 0.000 0.144
#> SRR1429540 1 0.4301 0.2853 0.584 0.000 0.024 0.000 0.000 0.392
#> SRR1356057 6 0.5755 0.3077 0.400 0.000 0.148 0.004 0.000 0.448
#> SRR1328715 1 0.4084 0.2968 0.588 0.000 0.012 0.000 0.000 0.400
#> SRR1429429 3 0.0458 0.8914 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1325201 5 0.3247 0.8814 0.000 0.156 0.000 0.000 0.808 0.036
#> SRR1382978 3 0.0458 0.8914 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1406348 2 0.0000 0.8584 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.2416 0.8208 0.000 0.844 0.000 0.000 0.156 0.000
#> SRR1376380 3 0.0363 0.8905 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1418225 4 0.0000 0.9266 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.2416 0.8208 0.000 0.844 0.000 0.000 0.156 0.000
#> SRR1376741 1 0.4584 0.2193 0.556 0.000 0.040 0.000 0.000 0.404
#> SRR1431823 3 0.0363 0.8905 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1447916 2 0.0000 0.8584 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.2793 0.8460 0.000 0.000 0.000 0.800 0.000 0.200
#> SRR1445618 1 0.0000 0.6669 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1081589 4 0.2793 0.8460 0.000 0.000 0.000 0.800 0.000 0.200
#> SRR1097245 1 0.0000 0.6669 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.6669 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1404339 2 0.3101 0.5941 0.000 0.756 0.000 0.000 0.244 0.000
#> SRR1478614 1 0.0000 0.6669 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1406135 1 0.2300 0.6670 0.856 0.000 0.000 0.000 0.000 0.144
#> SRR1413307 4 0.0000 0.9266 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.8584 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.9266 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 1 0.4697 0.1980 0.548 0.000 0.048 0.000 0.000 0.404
#> SRR1100608 5 0.0363 0.7943 0.000 0.012 0.000 0.000 0.988 0.000
#> SRR1386927 2 0.2416 0.8208 0.000 0.844 0.000 0.000 0.156 0.000
#> SRR1331771 3 0.0363 0.8905 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1486322 3 0.0260 0.8912 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR1080790 3 0.4371 0.4149 0.180 0.000 0.716 0.000 0.000 0.104
#> SRR1459980 1 0.4697 0.1980 0.548 0.000 0.048 0.000 0.000 0.404
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 17667 rows and 70 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 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.995 0.998 0.3395 0.658 0.658
#> 3 3 0.627 0.861 0.871 0.7447 0.704 0.551
#> 4 4 0.959 0.937 0.951 0.1424 0.837 0.614
#> 5 5 0.730 0.682 0.809 0.1212 0.917 0.740
#> 6 6 0.708 0.555 0.758 0.0605 0.943 0.772
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
#> SRR1433493 1 0.000 1.000 1.000 0.000
#> SRR1405147 1 0.000 1.000 1.000 0.000
#> SRR1315412 2 0.000 0.988 0.000 1.000
#> SRR1338384 1 0.000 1.000 1.000 0.000
#> SRR1071105 2 0.644 0.804 0.164 0.836
#> SRR1432868 2 0.000 0.988 0.000 1.000
#> SRR1454480 1 0.000 1.000 1.000 0.000
#> SRR1330723 2 0.000 0.988 0.000 1.000
#> SRR1475324 1 0.000 1.000 1.000 0.000
#> SRR1340260 1 0.000 1.000 1.000 0.000
#> SRR1376450 1 0.000 1.000 1.000 0.000
#> SRR1321897 1 0.000 1.000 1.000 0.000
#> SRR1445194 1 0.000 1.000 1.000 0.000
#> SRR1443308 1 0.000 1.000 1.000 0.000
#> SRR1400931 1 0.000 1.000 1.000 0.000
#> SRR1416188 1 0.000 1.000 1.000 0.000
#> SRR1407044 1 0.000 1.000 1.000 0.000
#> SRR1078392 1 0.000 1.000 1.000 0.000
#> SRR1436468 1 0.000 1.000 1.000 0.000
#> SRR1476125 2 0.000 0.988 0.000 1.000
#> SRR1418747 1 0.000 1.000 1.000 0.000
#> SRR1318089 1 0.000 1.000 1.000 0.000
#> SRR1444370 1 0.000 1.000 1.000 0.000
#> SRR1348929 2 0.000 0.988 0.000 1.000
#> SRR1385690 1 0.000 1.000 1.000 0.000
#> SRR1460337 1 0.000 1.000 1.000 0.000
#> SRR1469062 1 0.000 1.000 1.000 0.000
#> SRR1388459 1 0.000 1.000 1.000 0.000
#> SRR1416841 1 0.000 1.000 1.000 0.000
#> SRR1473778 1 0.000 1.000 1.000 0.000
#> SRR1419561 1 0.000 1.000 1.000 0.000
#> SRR1339987 1 0.000 1.000 1.000 0.000
#> SRR1469662 1 0.000 1.000 1.000 0.000
#> SRR1432958 1 0.000 1.000 1.000 0.000
#> SRR1479198 1 0.000 1.000 1.000 0.000
#> SRR1353600 1 0.000 1.000 1.000 0.000
#> SRR1456492 1 0.000 1.000 1.000 0.000
#> SRR1389955 1 0.000 1.000 1.000 0.000
#> SRR1429540 1 0.000 1.000 1.000 0.000
#> SRR1356057 1 0.000 1.000 1.000 0.000
#> SRR1328715 1 0.000 1.000 1.000 0.000
#> SRR1429429 1 0.000 1.000 1.000 0.000
#> SRR1325201 2 0.000 0.988 0.000 1.000
#> SRR1382978 1 0.000 1.000 1.000 0.000
#> SRR1406348 2 0.000 0.988 0.000 1.000
#> SRR1469390 2 0.000 0.988 0.000 1.000
#> SRR1376380 1 0.000 1.000 1.000 0.000
#> SRR1418225 1 0.000 1.000 1.000 0.000
#> SRR1418473 2 0.000 0.988 0.000 1.000
#> SRR1376741 1 0.000 1.000 1.000 0.000
#> SRR1431823 1 0.000 1.000 1.000 0.000
#> SRR1447916 2 0.000 0.988 0.000 1.000
#> SRR1458643 1 0.000 1.000 1.000 0.000
#> SRR1445618 1 0.000 1.000 1.000 0.000
#> SRR1081589 1 0.000 1.000 1.000 0.000
#> SRR1097245 1 0.000 1.000 1.000 0.000
#> SRR1416141 1 0.000 1.000 1.000 0.000
#> SRR1404339 2 0.000 0.988 0.000 1.000
#> SRR1478614 1 0.000 1.000 1.000 0.000
#> SRR1406135 1 0.000 1.000 1.000 0.000
#> SRR1413307 1 0.000 1.000 1.000 0.000
#> SRR1397720 2 0.000 0.988 0.000 1.000
#> SRR1358391 1 0.000 1.000 1.000 0.000
#> SRR1381185 1 0.000 1.000 1.000 0.000
#> SRR1100608 2 0.000 0.988 0.000 1.000
#> SRR1386927 2 0.000 0.988 0.000 1.000
#> SRR1331771 1 0.000 1.000 1.000 0.000
#> SRR1486322 1 0.000 1.000 1.000 0.000
#> SRR1080790 1 0.000 1.000 1.000 0.000
#> SRR1459980 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
#> SRR1433493 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1405147 1 0.6305 0.5004 0.516 0.000 0.484
#> SRR1315412 2 0.0000 0.9550 0.000 1.000 0.000
#> SRR1338384 1 0.5497 0.8656 0.708 0.000 0.292
#> SRR1071105 2 0.7074 0.0298 0.480 0.500 0.020
#> SRR1432868 2 0.0000 0.9550 0.000 1.000 0.000
#> SRR1454480 1 0.1411 0.7327 0.964 0.000 0.036
#> SRR1330723 2 0.1031 0.9510 0.024 0.976 0.000
#> SRR1475324 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1340260 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1376450 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1321897 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1445194 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1443308 3 0.2448 0.8680 0.076 0.000 0.924
#> SRR1400931 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1416188 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1407044 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1078392 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1436468 3 0.4931 0.5841 0.232 0.000 0.768
#> SRR1476125 2 0.1031 0.9510 0.024 0.976 0.000
#> SRR1418747 1 0.5706 0.8344 0.680 0.000 0.320
#> SRR1318089 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1444370 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1348929 2 0.0000 0.9550 0.000 1.000 0.000
#> SRR1385690 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1460337 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1469062 1 0.5497 0.8707 0.708 0.000 0.292
#> SRR1388459 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1416841 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1473778 3 0.4178 0.7138 0.172 0.000 0.828
#> SRR1419561 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1339987 1 0.5327 0.8843 0.728 0.000 0.272
#> SRR1469662 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1432958 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1479198 1 0.5327 0.8816 0.728 0.000 0.272
#> SRR1353600 1 0.3752 0.8310 0.856 0.000 0.144
#> SRR1456492 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1389955 1 0.5327 0.8816 0.728 0.000 0.272
#> SRR1429540 1 0.5529 0.8615 0.704 0.000 0.296
#> SRR1356057 3 0.5216 0.5240 0.260 0.000 0.740
#> SRR1328715 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1429429 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1325201 2 0.1031 0.9510 0.024 0.976 0.000
#> SRR1382978 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1406348 2 0.0424 0.9541 0.008 0.992 0.000
#> SRR1469390 2 0.0000 0.9550 0.000 1.000 0.000
#> SRR1376380 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1418225 1 0.1411 0.7327 0.964 0.000 0.036
#> SRR1418473 2 0.0000 0.9550 0.000 1.000 0.000
#> SRR1376741 1 0.5497 0.8657 0.708 0.000 0.292
#> SRR1431823 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1447916 2 0.0000 0.9550 0.000 1.000 0.000
#> SRR1458643 1 0.1411 0.7327 0.964 0.000 0.036
#> SRR1445618 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1081589 1 0.1411 0.7327 0.964 0.000 0.036
#> SRR1097245 1 0.3752 0.8310 0.856 0.000 0.144
#> SRR1416141 1 0.3879 0.8361 0.848 0.000 0.152
#> SRR1404339 2 0.0747 0.9528 0.016 0.984 0.000
#> SRR1478614 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1406135 1 0.5138 0.8932 0.748 0.000 0.252
#> SRR1413307 1 0.1411 0.7327 0.964 0.000 0.036
#> SRR1397720 2 0.0000 0.9550 0.000 1.000 0.000
#> SRR1358391 1 0.1411 0.7327 0.964 0.000 0.036
#> SRR1381185 3 0.1860 0.8949 0.052 0.000 0.948
#> SRR1100608 2 0.1031 0.9510 0.024 0.976 0.000
#> SRR1386927 2 0.0000 0.9550 0.000 1.000 0.000
#> SRR1331771 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1486322 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1080790 3 0.0000 0.9459 0.000 0.000 1.000
#> SRR1459980 1 0.6309 0.4570 0.500 0.000 0.500
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1405147 1 0.1474 0.904 0.948 0.000 0.052 0.000
#> SRR1315412 2 0.0524 0.961 0.000 0.988 0.008 0.004
#> SRR1338384 1 0.0188 0.943 0.996 0.000 0.004 0.000
#> SRR1071105 1 0.7224 0.308 0.568 0.320 0.036 0.076
#> SRR1432868 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.2011 0.998 0.080 0.000 0.000 0.920
#> SRR1330723 2 0.3037 0.930 0.000 0.888 0.036 0.076
#> SRR1475324 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1340260 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1321897 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1445194 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1443308 3 0.2300 0.942 0.028 0.000 0.924 0.048
#> SRR1400931 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1407044 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1078392 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1436468 1 0.4222 0.625 0.728 0.000 0.272 0.000
#> SRR1476125 2 0.3037 0.930 0.000 0.888 0.036 0.076
#> SRR1418747 1 0.0469 0.938 0.988 0.000 0.012 0.000
#> SRR1318089 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1444370 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1460337 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1469062 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1388459 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1416841 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1473778 1 0.1716 0.892 0.936 0.000 0.064 0.000
#> SRR1419561 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1339987 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1469662 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1353600 1 0.0707 0.927 0.980 0.000 0.000 0.020
#> SRR1456492 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1389955 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1429540 1 0.0336 0.940 0.992 0.000 0.008 0.000
#> SRR1356057 1 0.4543 0.519 0.676 0.000 0.324 0.000
#> SRR1328715 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1325201 2 0.3037 0.930 0.000 0.888 0.036 0.076
#> SRR1382978 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1406348 2 0.0817 0.959 0.000 0.976 0.024 0.000
#> SRR1469390 2 0.0524 0.961 0.000 0.988 0.008 0.004
#> SRR1376380 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1418225 4 0.2011 0.998 0.080 0.000 0.000 0.920
#> SRR1418473 2 0.0524 0.961 0.000 0.988 0.008 0.004
#> SRR1376741 1 0.0188 0.943 0.996 0.000 0.004 0.000
#> SRR1431823 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1447916 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.2342 0.996 0.080 0.000 0.008 0.912
#> SRR1445618 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.2342 0.996 0.080 0.000 0.008 0.912
#> SRR1097245 1 0.0707 0.927 0.980 0.000 0.000 0.020
#> SRR1416141 1 0.0336 0.938 0.992 0.000 0.000 0.008
#> SRR1404339 2 0.2032 0.949 0.000 0.936 0.028 0.036
#> SRR1478614 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1413307 4 0.2011 0.998 0.080 0.000 0.000 0.920
#> SRR1397720 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.2011 0.998 0.080 0.000 0.000 0.920
#> SRR1381185 1 0.3569 0.744 0.804 0.000 0.196 0.000
#> SRR1100608 2 0.3198 0.930 0.000 0.880 0.040 0.080
#> SRR1386927 2 0.0524 0.961 0.000 0.988 0.008 0.004
#> SRR1331771 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1486322 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1080790 3 0.1474 0.997 0.052 0.000 0.948 0.000
#> SRR1459980 1 0.1474 0.904 0.948 0.000 0.052 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0693 0.866 0.012 0.000 0.980 0.000 0.008
#> SRR1405147 1 0.4505 -0.209 0.604 0.000 0.012 0.000 0.384
#> SRR1315412 2 0.2060 0.908 0.000 0.928 0.012 0.024 0.036
#> SRR1338384 1 0.3300 0.447 0.792 0.000 0.004 0.000 0.204
#> SRR1071105 1 0.6337 0.157 0.524 0.216 0.000 0.000 0.260
#> SRR1432868 2 0.0000 0.917 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0703 0.993 0.024 0.000 0.000 0.976 0.000
#> SRR1330723 2 0.3109 0.854 0.000 0.800 0.000 0.000 0.200
#> SRR1475324 3 0.0693 0.866 0.012 0.000 0.980 0.000 0.008
#> SRR1340260 1 0.3661 0.295 0.724 0.000 0.000 0.000 0.276
#> SRR1376450 1 0.2966 0.592 0.816 0.000 0.000 0.000 0.184
#> SRR1321897 3 0.2006 0.861 0.012 0.000 0.916 0.000 0.072
#> SRR1445194 1 0.1478 0.648 0.936 0.000 0.000 0.000 0.064
#> SRR1443308 3 0.4622 0.745 0.012 0.000 0.700 0.024 0.264
#> SRR1400931 1 0.0162 0.649 0.996 0.000 0.000 0.000 0.004
#> SRR1416188 3 0.0404 0.866 0.012 0.000 0.988 0.000 0.000
#> SRR1407044 3 0.3280 0.829 0.012 0.000 0.812 0.000 0.176
#> SRR1078392 5 0.4114 0.719 0.376 0.000 0.000 0.000 0.624
#> SRR1436468 5 0.5928 0.618 0.392 0.000 0.108 0.000 0.500
#> SRR1476125 2 0.3424 0.835 0.000 0.760 0.000 0.000 0.240
#> SRR1418747 5 0.4264 0.743 0.376 0.000 0.004 0.000 0.620
#> SRR1318089 3 0.0404 0.866 0.012 0.000 0.988 0.000 0.000
#> SRR1444370 1 0.1341 0.649 0.944 0.000 0.000 0.000 0.056
#> SRR1348929 2 0.0000 0.917 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.3508 0.502 0.748 0.000 0.000 0.000 0.252
#> SRR1460337 1 0.0510 0.645 0.984 0.000 0.000 0.000 0.016
#> SRR1469062 5 0.4182 0.752 0.352 0.000 0.004 0.000 0.644
#> SRR1388459 3 0.2390 0.830 0.020 0.000 0.896 0.000 0.084
#> SRR1416841 3 0.0693 0.866 0.012 0.000 0.980 0.000 0.008
#> SRR1473778 1 0.4736 -0.321 0.576 0.000 0.020 0.000 0.404
#> SRR1419561 1 0.4192 0.155 0.596 0.000 0.000 0.000 0.404
#> SRR1339987 5 0.4126 0.713 0.380 0.000 0.000 0.000 0.620
#> SRR1469662 1 0.2891 0.589 0.824 0.000 0.000 0.000 0.176
#> SRR1432958 1 0.0162 0.648 0.996 0.000 0.000 0.000 0.004
#> SRR1479198 1 0.4415 -0.141 0.552 0.000 0.004 0.000 0.444
#> SRR1353600 1 0.2068 0.635 0.904 0.000 0.000 0.004 0.092
#> SRR1456492 3 0.4620 0.588 0.016 0.000 0.592 0.000 0.392
#> SRR1389955 1 0.4410 -0.125 0.556 0.000 0.004 0.000 0.440
#> SRR1429540 1 0.3884 0.251 0.708 0.000 0.004 0.000 0.288
#> SRR1356057 5 0.5556 0.679 0.276 0.000 0.108 0.000 0.616
#> SRR1328715 1 0.2377 0.599 0.872 0.000 0.000 0.000 0.128
#> SRR1429429 3 0.0693 0.866 0.012 0.000 0.980 0.000 0.008
#> SRR1325201 2 0.3424 0.835 0.000 0.760 0.000 0.000 0.240
#> SRR1382978 3 0.0693 0.866 0.012 0.000 0.980 0.000 0.008
#> SRR1406348 2 0.0510 0.916 0.000 0.984 0.000 0.000 0.016
#> SRR1469390 2 0.2060 0.908 0.000 0.928 0.012 0.024 0.036
#> SRR1376380 3 0.3280 0.829 0.012 0.000 0.812 0.000 0.176
#> SRR1418225 4 0.0703 0.993 0.024 0.000 0.000 0.976 0.000
#> SRR1418473 2 0.2060 0.908 0.000 0.928 0.012 0.024 0.036
#> SRR1376741 1 0.4009 0.185 0.684 0.000 0.004 0.000 0.312
#> SRR1431823 3 0.3280 0.829 0.012 0.000 0.812 0.000 0.176
#> SRR1447916 2 0.0290 0.917 0.000 0.992 0.000 0.008 0.000
#> SRR1458643 4 0.1493 0.987 0.024 0.000 0.000 0.948 0.028
#> SRR1445618 1 0.0162 0.648 0.996 0.000 0.000 0.000 0.004
#> SRR1081589 4 0.1493 0.987 0.024 0.000 0.000 0.948 0.028
#> SRR1097245 1 0.1041 0.645 0.964 0.000 0.000 0.004 0.032
#> SRR1416141 1 0.1638 0.647 0.932 0.000 0.000 0.004 0.064
#> SRR1404339 2 0.1608 0.904 0.000 0.928 0.000 0.000 0.072
#> SRR1478614 1 0.0162 0.649 0.996 0.000 0.000 0.000 0.004
#> SRR1406135 1 0.2690 0.600 0.844 0.000 0.000 0.000 0.156
#> SRR1413307 4 0.0703 0.993 0.024 0.000 0.000 0.976 0.000
#> SRR1397720 2 0.0000 0.917 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0703 0.993 0.024 0.000 0.000 0.976 0.000
#> SRR1381185 5 0.5435 0.734 0.352 0.000 0.072 0.000 0.576
#> SRR1100608 2 0.3561 0.834 0.000 0.740 0.000 0.000 0.260
#> SRR1386927 2 0.2060 0.908 0.000 0.928 0.012 0.024 0.036
#> SRR1331771 3 0.3280 0.829 0.012 0.000 0.812 0.000 0.176
#> SRR1486322 3 0.0404 0.866 0.012 0.000 0.988 0.000 0.000
#> SRR1080790 3 0.4644 0.359 0.012 0.000 0.528 0.000 0.460
#> SRR1459980 5 0.4574 0.725 0.412 0.000 0.012 0.000 0.576
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0291 0.7999 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR1405147 1 0.6073 -0.2073 0.380 0.000 0.000 0.000 0.352 0.268
#> SRR1315412 2 0.2563 0.7511 0.000 0.876 0.000 0.000 0.072 0.052
#> SRR1338384 1 0.4466 0.2017 0.620 0.000 0.000 0.000 0.336 0.044
#> SRR1071105 6 0.6091 0.0000 0.340 0.188 0.000 0.000 0.012 0.460
#> SRR1432868 2 0.0000 0.7696 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.9736 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 2 0.3706 0.4545 0.000 0.620 0.000 0.000 0.000 0.380
#> SRR1475324 3 0.0291 0.7999 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR1340260 1 0.5950 -0.0354 0.456 0.000 0.000 0.000 0.280 0.264
#> SRR1376450 1 0.4514 0.2905 0.588 0.000 0.000 0.000 0.372 0.040
#> SRR1321897 3 0.4293 0.7738 0.004 0.000 0.740 0.000 0.112 0.144
#> SRR1445194 1 0.1866 0.5622 0.908 0.000 0.000 0.000 0.084 0.008
#> SRR1443308 3 0.6393 0.6491 0.000 0.000 0.524 0.060 0.264 0.152
#> SRR1400931 1 0.0000 0.5700 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.1958 0.7938 0.004 0.000 0.896 0.000 0.000 0.100
#> SRR1407044 3 0.5019 0.7512 0.004 0.000 0.656 0.000 0.188 0.152
#> SRR1078392 5 0.3651 0.5770 0.180 0.000 0.000 0.000 0.772 0.048
#> SRR1436468 5 0.6195 0.3593 0.264 0.000 0.008 0.000 0.440 0.288
#> SRR1476125 2 0.4158 0.4072 0.000 0.572 0.004 0.000 0.008 0.416
#> SRR1418747 5 0.3210 0.5897 0.168 0.000 0.000 0.000 0.804 0.028
#> SRR1318089 3 0.0146 0.8000 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR1444370 1 0.1802 0.5648 0.916 0.000 0.000 0.000 0.072 0.012
#> SRR1348929 2 0.0000 0.7696 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 1 0.4098 0.0368 0.496 0.000 0.000 0.000 0.496 0.008
#> SRR1460337 1 0.1168 0.5559 0.956 0.000 0.000 0.000 0.016 0.028
#> SRR1469062 5 0.3206 0.5818 0.152 0.000 0.004 0.000 0.816 0.028
#> SRR1388459 3 0.4183 0.5738 0.004 0.000 0.740 0.000 0.076 0.180
#> SRR1416841 3 0.0291 0.7999 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR1473778 1 0.6068 -0.2297 0.372 0.000 0.000 0.000 0.364 0.264
#> SRR1419561 5 0.4037 0.2384 0.380 0.000 0.000 0.000 0.608 0.012
#> SRR1339987 5 0.2778 0.5782 0.168 0.000 0.000 0.000 0.824 0.008
#> SRR1469662 1 0.4176 0.2332 0.580 0.000 0.000 0.000 0.404 0.016
#> SRR1432958 1 0.0405 0.5690 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR1479198 5 0.4109 0.3999 0.328 0.000 0.000 0.000 0.648 0.024
#> SRR1353600 1 0.1958 0.5461 0.896 0.000 0.000 0.004 0.100 0.000
#> SRR1456492 3 0.5796 0.5611 0.004 0.000 0.480 0.000 0.352 0.164
#> SRR1389955 5 0.4139 0.3859 0.336 0.000 0.000 0.000 0.640 0.024
#> SRR1429540 1 0.5950 -0.0354 0.456 0.000 0.000 0.000 0.280 0.264
#> SRR1356057 5 0.5796 0.4848 0.180 0.000 0.012 0.000 0.552 0.256
#> SRR1328715 1 0.3175 0.5021 0.808 0.000 0.000 0.000 0.164 0.028
#> SRR1429429 3 0.0291 0.7999 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR1325201 2 0.3810 0.4052 0.000 0.572 0.000 0.000 0.000 0.428
#> SRR1382978 3 0.0291 0.7999 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR1406348 2 0.0865 0.7612 0.000 0.964 0.000 0.000 0.000 0.036
#> SRR1469390 2 0.2563 0.7511 0.000 0.876 0.000 0.000 0.072 0.052
#> SRR1376380 3 0.5019 0.7512 0.004 0.000 0.656 0.000 0.188 0.152
#> SRR1418225 4 0.0000 0.9736 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.2563 0.7511 0.000 0.876 0.000 0.000 0.072 0.052
#> SRR1376741 1 0.6031 -0.1119 0.420 0.000 0.000 0.000 0.312 0.268
#> SRR1431823 3 0.5019 0.7512 0.004 0.000 0.656 0.000 0.188 0.152
#> SRR1447916 2 0.0458 0.7697 0.000 0.984 0.000 0.000 0.016 0.000
#> SRR1458643 4 0.1845 0.9477 0.000 0.000 0.000 0.920 0.028 0.052
#> SRR1445618 1 0.0405 0.5690 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR1081589 4 0.1845 0.9477 0.000 0.000 0.000 0.920 0.028 0.052
#> SRR1097245 1 0.0603 0.5598 0.980 0.000 0.000 0.004 0.016 0.000
#> SRR1416141 1 0.1501 0.5606 0.924 0.000 0.000 0.000 0.076 0.000
#> SRR1404339 2 0.2664 0.6748 0.000 0.816 0.000 0.000 0.000 0.184
#> SRR1478614 1 0.0146 0.5691 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR1406135 1 0.4420 0.3345 0.620 0.000 0.000 0.000 0.340 0.040
#> SRR1413307 4 0.0146 0.9721 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1397720 2 0.0000 0.7696 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.9736 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 5 0.6113 0.4746 0.144 0.000 0.032 0.000 0.512 0.312
#> SRR1100608 2 0.4080 0.3996 0.000 0.536 0.000 0.000 0.008 0.456
#> SRR1386927 2 0.2563 0.7511 0.000 0.876 0.000 0.000 0.072 0.052
#> SRR1331771 3 0.5019 0.7512 0.004 0.000 0.656 0.000 0.188 0.152
#> SRR1486322 3 0.0146 0.8000 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR1080790 5 0.4480 0.1788 0.004 0.000 0.304 0.000 0.648 0.044
#> SRR1459980 5 0.5682 0.4557 0.208 0.000 0.000 0.000 0.524 0.268
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 17667 rows and 70 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 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.986 0.993 0.4313 0.574 0.574
#> 3 3 0.880 0.908 0.962 0.5475 0.718 0.524
#> 4 4 0.948 0.935 0.971 0.0761 0.896 0.711
#> 5 5 0.849 0.849 0.919 0.1030 0.882 0.617
#> 6 6 0.956 0.947 0.956 0.0487 0.928 0.678
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 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
#> SRR1433493 1 0.0000 0.990 1.000 0.000
#> SRR1405147 1 0.0000 0.990 1.000 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1.000
#> SRR1338384 1 0.0000 0.990 1.000 0.000
#> SRR1071105 2 0.0000 1.000 0.000 1.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000
#> SRR1454480 2 0.0376 0.996 0.004 0.996
#> SRR1330723 2 0.0000 1.000 0.000 1.000
#> SRR1475324 1 0.0000 0.990 1.000 0.000
#> SRR1340260 1 0.0000 0.990 1.000 0.000
#> SRR1376450 1 0.6148 0.829 0.848 0.152
#> SRR1321897 1 0.0000 0.990 1.000 0.000
#> SRR1445194 1 0.0000 0.990 1.000 0.000
#> SRR1443308 1 0.0000 0.990 1.000 0.000
#> SRR1400931 1 0.0376 0.987 0.996 0.004
#> SRR1416188 1 0.0000 0.990 1.000 0.000
#> SRR1407044 1 0.0000 0.990 1.000 0.000
#> SRR1078392 1 0.0000 0.990 1.000 0.000
#> SRR1436468 1 0.0000 0.990 1.000 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1.000
#> SRR1418747 1 0.0000 0.990 1.000 0.000
#> SRR1318089 1 0.0000 0.990 1.000 0.000
#> SRR1444370 1 0.0000 0.990 1.000 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1.000
#> SRR1385690 1 0.0000 0.990 1.000 0.000
#> SRR1460337 1 0.6247 0.824 0.844 0.156
#> SRR1469062 1 0.0000 0.990 1.000 0.000
#> SRR1388459 1 0.0000 0.990 1.000 0.000
#> SRR1416841 1 0.0000 0.990 1.000 0.000
#> SRR1473778 1 0.0000 0.990 1.000 0.000
#> SRR1419561 1 0.0000 0.990 1.000 0.000
#> SRR1339987 1 0.0000 0.990 1.000 0.000
#> SRR1469662 1 0.0000 0.990 1.000 0.000
#> SRR1432958 1 0.0000 0.990 1.000 0.000
#> SRR1479198 1 0.0000 0.990 1.000 0.000
#> SRR1353600 1 0.0376 0.987 0.996 0.004
#> SRR1456492 1 0.0000 0.990 1.000 0.000
#> SRR1389955 1 0.0000 0.990 1.000 0.000
#> SRR1429540 1 0.0000 0.990 1.000 0.000
#> SRR1356057 1 0.0000 0.990 1.000 0.000
#> SRR1328715 1 0.0000 0.990 1.000 0.000
#> SRR1429429 1 0.0000 0.990 1.000 0.000
#> SRR1325201 2 0.0000 1.000 0.000 1.000
#> SRR1382978 1 0.0000 0.990 1.000 0.000
#> SRR1406348 2 0.0000 1.000 0.000 1.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000
#> SRR1376380 1 0.0000 0.990 1.000 0.000
#> SRR1418225 2 0.0000 1.000 0.000 1.000
#> SRR1418473 2 0.0000 1.000 0.000 1.000
#> SRR1376741 1 0.0000 0.990 1.000 0.000
#> SRR1431823 1 0.0000 0.990 1.000 0.000
#> SRR1447916 2 0.0000 1.000 0.000 1.000
#> SRR1458643 2 0.0000 1.000 0.000 1.000
#> SRR1445618 1 0.0000 0.990 1.000 0.000
#> SRR1081589 2 0.0000 1.000 0.000 1.000
#> SRR1097245 1 0.0376 0.987 0.996 0.004
#> SRR1416141 1 0.0376 0.987 0.996 0.004
#> SRR1404339 2 0.0000 1.000 0.000 1.000
#> SRR1478614 1 0.0376 0.987 0.996 0.004
#> SRR1406135 1 0.5629 0.853 0.868 0.132
#> SRR1413307 2 0.0000 1.000 0.000 1.000
#> SRR1397720 2 0.0000 1.000 0.000 1.000
#> SRR1358391 2 0.0376 0.996 0.004 0.996
#> SRR1381185 1 0.0000 0.990 1.000 0.000
#> SRR1100608 2 0.0000 1.000 0.000 1.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000
#> SRR1331771 1 0.0000 0.990 1.000 0.000
#> SRR1486322 1 0.0000 0.990 1.000 0.000
#> SRR1080790 1 0.0000 0.990 1.000 0.000
#> SRR1459980 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
#> SRR1433493 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1405147 3 0.6295 0.202 0.472 0.000 0.528
#> SRR1315412 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1071105 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1432868 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1454480 1 0.3941 0.805 0.844 0.156 0.000
#> SRR1330723 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1475324 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1340260 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1321897 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1445194 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1443308 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1400931 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1416188 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1407044 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1078392 1 0.1411 0.950 0.964 0.000 0.036
#> SRR1436468 3 0.3551 0.854 0.132 0.000 0.868
#> SRR1476125 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1418747 3 0.1289 0.926 0.032 0.000 0.968
#> SRR1318089 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1444370 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1348929 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1385690 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1469062 3 0.4399 0.771 0.188 0.000 0.812
#> SRR1388459 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1416841 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1473778 3 0.4121 0.819 0.168 0.000 0.832
#> SRR1419561 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1339987 3 0.4002 0.813 0.160 0.000 0.840
#> SRR1469662 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1479198 1 0.0237 0.978 0.996 0.000 0.004
#> SRR1353600 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1456492 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1389955 1 0.2165 0.922 0.936 0.000 0.064
#> SRR1429540 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1356057 3 0.1753 0.916 0.048 0.000 0.952
#> SRR1328715 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1429429 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1325201 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1382978 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1406348 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1469390 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1376380 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1418225 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1418473 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1431823 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1447916 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1458643 2 0.6291 0.135 0.468 0.532 0.000
#> SRR1445618 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1081589 2 0.6291 0.135 0.468 0.532 0.000
#> SRR1097245 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1404339 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.981 1.000 0.000 0.000
#> SRR1413307 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1358391 1 0.3816 0.816 0.852 0.148 0.000
#> SRR1381185 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1100608 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1386927 2 0.0000 0.945 0.000 1.000 0.000
#> SRR1331771 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1486322 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1080790 3 0.0000 0.942 0.000 0.000 1.000
#> SRR1459980 3 0.3752 0.843 0.144 0.000 0.856
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1405147 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1338384 1 0.0188 0.954 0.996 0 0.004 0.000
#> SRR1071105 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1454480 4 0.0000 1.000 0.000 0 0.000 1.000
#> SRR1330723 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1475324 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1340260 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1376450 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1321897 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1445194 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1443308 3 0.3610 0.762 0.000 0 0.800 0.200
#> SRR1400931 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1416188 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1407044 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1078392 1 0.0804 0.947 0.980 0 0.012 0.008
#> SRR1436468 3 0.3311 0.762 0.172 0 0.828 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1418747 3 0.1940 0.880 0.076 0 0.924 0.000
#> SRR1318089 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1444370 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1385690 1 0.1118 0.937 0.964 0 0.000 0.036
#> SRR1460337 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1469062 3 0.4522 0.539 0.000 0 0.680 0.320
#> SRR1388459 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1416841 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1473778 1 0.4605 0.487 0.664 0 0.336 0.000
#> SRR1419561 1 0.0336 0.952 0.992 0 0.000 0.008
#> SRR1339987 3 0.2699 0.870 0.068 0 0.904 0.028
#> SRR1469662 1 0.0188 0.954 0.996 0 0.000 0.004
#> SRR1432958 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1479198 1 0.0376 0.953 0.992 0 0.004 0.004
#> SRR1353600 1 0.2814 0.841 0.868 0 0.000 0.132
#> SRR1456492 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1389955 1 0.1724 0.923 0.948 0 0.032 0.020
#> SRR1429540 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1356057 3 0.3610 0.762 0.000 0 0.800 0.200
#> SRR1328715 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1429429 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1325201 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1382978 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1406348 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1376380 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1418225 4 0.0000 1.000 0.000 0 0.000 1.000
#> SRR1418473 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1376741 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1431823 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1447916 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1458643 4 0.0000 1.000 0.000 0 0.000 1.000
#> SRR1445618 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1081589 4 0.0000 1.000 0.000 0 0.000 1.000
#> SRR1097245 1 0.2704 0.846 0.876 0 0.000 0.124
#> SRR1416141 1 0.0817 0.943 0.976 0 0.000 0.024
#> SRR1404339 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1478614 1 0.0000 0.955 1.000 0 0.000 0.000
#> SRR1406135 1 0.0188 0.954 0.996 0 0.000 0.004
#> SRR1413307 4 0.0000 1.000 0.000 0 0.000 1.000
#> SRR1397720 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1358391 4 0.0000 1.000 0.000 0 0.000 1.000
#> SRR1381185 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1100608 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR1331771 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1486322 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1080790 3 0.0000 0.947 0.000 0 1.000 0.000
#> SRR1459980 1 0.3801 0.690 0.780 0 0.220 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1405147 1 0.0162 0.782 0.996 0 0.000 0.000 0.004
#> SRR1315412 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1338384 1 0.2813 0.829 0.832 0 0.000 0.000 0.168
#> SRR1071105 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1454480 4 0.0000 1.000 0.000 0 0.000 1.000 0.000
#> SRR1330723 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1475324 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1340260 1 0.0162 0.782 0.996 0 0.000 0.000 0.004
#> SRR1376450 5 0.0404 0.827 0.012 0 0.000 0.000 0.988
#> SRR1321897 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1445194 5 0.4305 -0.328 0.488 0 0.000 0.000 0.512
#> SRR1443308 3 0.3109 0.750 0.000 0 0.800 0.200 0.000
#> SRR1400931 1 0.2813 0.830 0.832 0 0.000 0.000 0.168
#> SRR1416188 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1407044 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1078392 5 0.2424 0.752 0.132 0 0.000 0.000 0.868
#> SRR1436468 1 0.4457 0.205 0.620 0 0.368 0.000 0.012
#> SRR1476125 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1418747 5 0.2970 0.725 0.004 0 0.168 0.000 0.828
#> SRR1318089 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1444370 1 0.3661 0.733 0.724 0 0.000 0.000 0.276
#> SRR1348929 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1385690 5 0.0162 0.830 0.004 0 0.000 0.000 0.996
#> SRR1460337 1 0.2813 0.830 0.832 0 0.000 0.000 0.168
#> SRR1469062 5 0.3304 0.720 0.000 0 0.168 0.016 0.816
#> SRR1388459 3 0.2813 0.803 0.168 0 0.832 0.000 0.000
#> SRR1416841 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1473778 1 0.0451 0.777 0.988 0 0.008 0.000 0.004
#> SRR1419561 5 0.0290 0.829 0.008 0 0.000 0.000 0.992
#> SRR1339987 5 0.2813 0.725 0.000 0 0.168 0.000 0.832
#> SRR1469662 5 0.0290 0.829 0.008 0 0.000 0.000 0.992
#> SRR1432958 1 0.2813 0.830 0.832 0 0.000 0.000 0.168
#> SRR1479198 5 0.0162 0.830 0.004 0 0.000 0.000 0.996
#> SRR1353600 1 0.5180 0.642 0.624 0 0.000 0.064 0.312
#> SRR1456492 3 0.0290 0.938 0.000 0 0.992 0.000 0.008
#> SRR1389955 5 0.0162 0.830 0.004 0 0.000 0.000 0.996
#> SRR1429540 1 0.0162 0.782 0.996 0 0.000 0.000 0.004
#> SRR1356057 3 0.5873 0.575 0.168 0 0.632 0.192 0.008
#> SRR1328715 1 0.2891 0.827 0.824 0 0.000 0.000 0.176
#> SRR1429429 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1325201 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1382978 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1406348 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1376380 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1418225 4 0.0000 1.000 0.000 0 0.000 1.000 0.000
#> SRR1418473 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1376741 1 0.0162 0.782 0.996 0 0.000 0.000 0.004
#> SRR1431823 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1447916 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1458643 4 0.0000 1.000 0.000 0 0.000 1.000 0.000
#> SRR1445618 1 0.2813 0.830 0.832 0 0.000 0.000 0.168
#> SRR1081589 4 0.0000 1.000 0.000 0 0.000 1.000 0.000
#> SRR1097245 1 0.4215 0.799 0.768 0 0.000 0.064 0.168
#> SRR1416141 1 0.6497 0.443 0.472 0 0.000 0.208 0.320
#> SRR1404339 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1478614 1 0.2813 0.830 0.832 0 0.000 0.000 0.168
#> SRR1406135 5 0.0290 0.829 0.008 0 0.000 0.000 0.992
#> SRR1413307 4 0.0000 1.000 0.000 0 0.000 1.000 0.000
#> SRR1397720 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1358391 4 0.0000 1.000 0.000 0 0.000 1.000 0.000
#> SRR1381185 3 0.3203 0.795 0.168 0 0.820 0.000 0.012
#> SRR1100608 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> SRR1331771 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1486322 3 0.0000 0.943 0.000 0 1.000 0.000 0.000
#> SRR1080790 3 0.1671 0.876 0.000 0 0.924 0.000 0.076
#> SRR1459980 5 0.4299 0.479 0.388 0 0.004 0.000 0.608
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0547 0.968 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR1405147 6 0.2219 0.895 0.136 0.000 0.000 0.000 0.000 0.864
#> SRR1315412 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 1 0.2450 0.836 0.868 0.000 0.000 0.000 0.016 0.116
#> SRR1071105 2 0.1141 0.950 0.000 0.948 0.000 0.000 0.000 0.052
#> SRR1432868 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1475324 3 0.0547 0.968 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR1340260 6 0.2378 0.891 0.152 0.000 0.000 0.000 0.000 0.848
#> SRR1376450 5 0.2221 0.912 0.032 0.000 0.000 0.000 0.896 0.072
#> SRR1321897 3 0.0603 0.965 0.000 0.000 0.980 0.000 0.004 0.016
#> SRR1445194 1 0.1349 0.938 0.940 0.000 0.000 0.000 0.056 0.004
#> SRR1443308 3 0.3518 0.749 0.000 0.000 0.784 0.184 0.008 0.024
#> SRR1400931 1 0.0000 0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.968 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1407044 3 0.0603 0.965 0.000 0.000 0.980 0.000 0.004 0.016
#> SRR1078392 5 0.1327 0.938 0.000 0.000 0.000 0.000 0.936 0.064
#> SRR1436468 6 0.2214 0.890 0.096 0.000 0.016 0.000 0.000 0.888
#> SRR1476125 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1418747 5 0.1657 0.933 0.000 0.000 0.016 0.000 0.928 0.056
#> SRR1318089 3 0.0363 0.968 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1444370 1 0.0777 0.955 0.972 0.000 0.000 0.000 0.024 0.004
#> SRR1348929 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.0508 0.956 0.004 0.000 0.000 0.000 0.984 0.012
#> SRR1460337 1 0.1387 0.923 0.932 0.000 0.000 0.000 0.000 0.068
#> SRR1469062 5 0.2263 0.906 0.000 0.000 0.048 0.000 0.896 0.056
#> SRR1388459 6 0.3050 0.702 0.000 0.000 0.236 0.000 0.000 0.764
#> SRR1416841 3 0.0547 0.968 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR1473778 6 0.2362 0.896 0.136 0.000 0.004 0.000 0.000 0.860
#> SRR1419561 5 0.0858 0.954 0.004 0.000 0.000 0.000 0.968 0.028
#> SRR1339987 5 0.0603 0.955 0.000 0.000 0.004 0.000 0.980 0.016
#> SRR1469662 5 0.0291 0.956 0.004 0.000 0.000 0.000 0.992 0.004
#> SRR1432958 1 0.0000 0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1479198 5 0.0405 0.957 0.004 0.000 0.000 0.000 0.988 0.008
#> SRR1353600 1 0.1453 0.946 0.944 0.000 0.000 0.008 0.040 0.008
#> SRR1456492 3 0.1434 0.944 0.000 0.000 0.940 0.000 0.012 0.048
#> SRR1389955 5 0.0405 0.957 0.004 0.000 0.000 0.000 0.988 0.008
#> SRR1429540 6 0.2378 0.891 0.152 0.000 0.000 0.000 0.000 0.848
#> SRR1356057 6 0.3299 0.801 0.000 0.000 0.028 0.080 0.048 0.844
#> SRR1328715 1 0.0820 0.956 0.972 0.000 0.000 0.000 0.016 0.012
#> SRR1429429 3 0.0547 0.968 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR1325201 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1382978 3 0.0547 0.968 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR1406348 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 3 0.0603 0.965 0.000 0.000 0.980 0.000 0.004 0.016
#> SRR1418225 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 6 0.2260 0.895 0.140 0.000 0.000 0.000 0.000 0.860
#> SRR1431823 3 0.0603 0.965 0.000 0.000 0.980 0.000 0.004 0.016
#> SRR1447916 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1445618 1 0.0000 0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1081589 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1097245 1 0.0862 0.954 0.972 0.000 0.000 0.016 0.004 0.008
#> SRR1416141 1 0.1082 0.950 0.956 0.000 0.000 0.004 0.040 0.000
#> SRR1404339 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.0146 0.957 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1406135 5 0.2066 0.918 0.024 0.000 0.000 0.000 0.904 0.072
#> SRR1413307 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 6 0.2219 0.808 0.000 0.000 0.136 0.000 0.000 0.864
#> SRR1100608 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1386927 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.0603 0.965 0.000 0.000 0.980 0.000 0.004 0.016
#> SRR1486322 3 0.0458 0.968 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1080790 3 0.0891 0.963 0.000 0.000 0.968 0.000 0.008 0.024
#> SRR1459980 6 0.2176 0.845 0.024 0.000 0.000 0.000 0.080 0.896
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 17667 rows and 70 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 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.985 0.994 0.3355 0.658 0.658
#> 3 3 0.976 0.957 0.982 0.8223 0.733 0.594
#> 4 4 0.940 0.951 0.980 0.1292 0.920 0.797
#> 5 5 0.792 0.801 0.843 0.0911 0.929 0.778
#> 6 6 0.858 0.874 0.901 0.0850 0.886 0.586
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 1 0.000 1.000 1.0 0.0
#> SRR1405147 1 0.000 1.000 1.0 0.0
#> SRR1315412 2 0.000 0.971 0.0 1.0
#> SRR1338384 1 0.000 1.000 1.0 0.0
#> SRR1071105 2 0.971 0.333 0.4 0.6
#> SRR1432868 2 0.000 0.971 0.0 1.0
#> SRR1454480 1 0.000 1.000 1.0 0.0
#> SRR1330723 2 0.000 0.971 0.0 1.0
#> SRR1475324 1 0.000 1.000 1.0 0.0
#> SRR1340260 1 0.000 1.000 1.0 0.0
#> SRR1376450 1 0.000 1.000 1.0 0.0
#> SRR1321897 1 0.000 1.000 1.0 0.0
#> SRR1445194 1 0.000 1.000 1.0 0.0
#> SRR1443308 1 0.000 1.000 1.0 0.0
#> SRR1400931 1 0.000 1.000 1.0 0.0
#> SRR1416188 1 0.000 1.000 1.0 0.0
#> SRR1407044 1 0.000 1.000 1.0 0.0
#> SRR1078392 1 0.000 1.000 1.0 0.0
#> SRR1436468 1 0.000 1.000 1.0 0.0
#> SRR1476125 2 0.000 0.971 0.0 1.0
#> SRR1418747 1 0.000 1.000 1.0 0.0
#> SRR1318089 1 0.000 1.000 1.0 0.0
#> SRR1444370 1 0.000 1.000 1.0 0.0
#> SRR1348929 2 0.000 0.971 0.0 1.0
#> SRR1385690 1 0.000 1.000 1.0 0.0
#> SRR1460337 1 0.000 1.000 1.0 0.0
#> SRR1469062 1 0.000 1.000 1.0 0.0
#> SRR1388459 1 0.000 1.000 1.0 0.0
#> SRR1416841 1 0.000 1.000 1.0 0.0
#> SRR1473778 1 0.000 1.000 1.0 0.0
#> SRR1419561 1 0.000 1.000 1.0 0.0
#> SRR1339987 1 0.000 1.000 1.0 0.0
#> SRR1469662 1 0.000 1.000 1.0 0.0
#> SRR1432958 1 0.000 1.000 1.0 0.0
#> SRR1479198 1 0.000 1.000 1.0 0.0
#> SRR1353600 1 0.000 1.000 1.0 0.0
#> SRR1456492 1 0.000 1.000 1.0 0.0
#> SRR1389955 1 0.000 1.000 1.0 0.0
#> SRR1429540 1 0.000 1.000 1.0 0.0
#> SRR1356057 1 0.000 1.000 1.0 0.0
#> SRR1328715 1 0.000 1.000 1.0 0.0
#> SRR1429429 1 0.000 1.000 1.0 0.0
#> SRR1325201 2 0.000 0.971 0.0 1.0
#> SRR1382978 1 0.000 1.000 1.0 0.0
#> SRR1406348 2 0.000 0.971 0.0 1.0
#> SRR1469390 2 0.000 0.971 0.0 1.0
#> SRR1376380 1 0.000 1.000 1.0 0.0
#> SRR1418225 1 0.000 1.000 1.0 0.0
#> SRR1418473 2 0.000 0.971 0.0 1.0
#> SRR1376741 1 0.000 1.000 1.0 0.0
#> SRR1431823 1 0.000 1.000 1.0 0.0
#> SRR1447916 2 0.000 0.971 0.0 1.0
#> SRR1458643 1 0.000 1.000 1.0 0.0
#> SRR1445618 1 0.000 1.000 1.0 0.0
#> SRR1081589 1 0.000 1.000 1.0 0.0
#> SRR1097245 1 0.000 1.000 1.0 0.0
#> SRR1416141 1 0.000 1.000 1.0 0.0
#> SRR1404339 2 0.000 0.971 0.0 1.0
#> SRR1478614 1 0.000 1.000 1.0 0.0
#> SRR1406135 1 0.000 1.000 1.0 0.0
#> SRR1413307 1 0.000 1.000 1.0 0.0
#> SRR1397720 2 0.000 0.971 0.0 1.0
#> SRR1358391 1 0.000 1.000 1.0 0.0
#> SRR1381185 1 0.000 1.000 1.0 0.0
#> SRR1100608 2 0.000 0.971 0.0 1.0
#> SRR1386927 2 0.000 0.971 0.0 1.0
#> SRR1331771 1 0.000 1.000 1.0 0.0
#> SRR1486322 1 0.000 1.000 1.0 0.0
#> SRR1080790 1 0.000 1.000 1.0 0.0
#> SRR1459980 1 0.000 1.000 1.0 0.0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1405147 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1315412 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1338384 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1071105 2 0.6126 0.306 0.400 0.6 0.000
#> SRR1432868 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1454480 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1330723 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1475324 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1340260 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1376450 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1321897 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1445194 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1443308 3 0.0592 0.984 0.012 0.0 0.988
#> SRR1400931 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1416188 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1407044 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1078392 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1436468 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1476125 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1418747 1 0.4702 0.753 0.788 0.0 0.212
#> SRR1318089 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1444370 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1348929 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1385690 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1460337 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1469062 1 0.0237 0.973 0.996 0.0 0.004
#> SRR1388459 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1416841 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1473778 1 0.4178 0.804 0.828 0.0 0.172
#> SRR1419561 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1339987 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1469662 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1432958 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1479198 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1353600 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1456492 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1389955 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1429540 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1356057 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1328715 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1429429 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1325201 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1382978 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1406348 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1469390 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1376380 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1418225 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1418473 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1376741 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1431823 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1447916 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1458643 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1445618 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1081589 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1097245 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1416141 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1404339 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1478614 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1406135 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1413307 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1397720 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1358391 1 0.0000 0.976 1.000 0.0 0.000
#> SRR1381185 1 0.5098 0.698 0.752 0.0 0.248
#> SRR1100608 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1386927 2 0.0000 0.963 0.000 1.0 0.000
#> SRR1331771 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1486322 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1080790 3 0.0000 0.999 0.000 0.0 1.000
#> SRR1459980 1 0.4399 0.785 0.812 0.0 0.188
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1405147 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1315412 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1338384 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1071105 2 0.4855 0.303 0.400 0.6 0.000 0.000
#> SRR1432868 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1454480 4 0.0592 0.983 0.016 0.0 0.000 0.984
#> SRR1330723 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1475324 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1340260 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1376450 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1321897 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1445194 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1443308 3 0.3356 0.775 0.000 0.0 0.824 0.176
#> SRR1400931 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1416188 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1407044 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1078392 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1436468 1 0.1474 0.930 0.948 0.0 0.052 0.000
#> SRR1476125 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1418747 1 0.2345 0.885 0.900 0.0 0.100 0.000
#> SRR1318089 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1444370 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1348929 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1385690 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1460337 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1469062 1 0.0188 0.969 0.996 0.0 0.004 0.000
#> SRR1388459 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1416841 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1473778 1 0.3266 0.811 0.832 0.0 0.168 0.000
#> SRR1419561 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1339987 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1469662 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1432958 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1479198 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1353600 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1456492 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1389955 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1429540 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1356057 1 0.2530 0.873 0.888 0.0 0.112 0.000
#> SRR1328715 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1429429 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1325201 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1382978 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1406348 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1469390 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1376380 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1418225 4 0.0000 0.992 0.000 0.0 0.000 1.000
#> SRR1418473 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1376741 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1431823 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1447916 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1458643 4 0.0000 0.992 0.000 0.0 0.000 1.000
#> SRR1445618 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1081589 4 0.0000 0.992 0.000 0.0 0.000 1.000
#> SRR1097245 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1416141 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1404339 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1478614 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1406135 1 0.0000 0.971 1.000 0.0 0.000 0.000
#> SRR1413307 4 0.0000 0.992 0.000 0.0 0.000 1.000
#> SRR1397720 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1358391 4 0.0592 0.983 0.016 0.0 0.000 0.984
#> SRR1381185 1 0.4040 0.703 0.752 0.0 0.248 0.000
#> SRR1100608 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1386927 2 0.0000 0.957 0.000 1.0 0.000 0.000
#> SRR1331771 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1486322 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1080790 3 0.0000 0.988 0.000 0.0 1.000 0.000
#> SRR1459980 1 0.2530 0.875 0.888 0.0 0.112 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0000 0.885 0.000 0.000 1.000 0.000 0.000
#> SRR1405147 1 0.0324 0.860 0.992 0.000 0.004 0.000 0.004
#> SRR1315412 2 0.1965 0.908 0.000 0.904 0.000 0.000 0.096
#> SRR1338384 1 0.2648 0.843 0.848 0.000 0.000 0.000 0.152
#> SRR1071105 2 0.4812 0.240 0.372 0.600 0.000 0.000 0.028
#> SRR1432868 2 0.0000 0.922 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0510 0.980 0.016 0.000 0.000 0.984 0.000
#> SRR1330723 2 0.0000 0.922 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.0000 0.885 0.000 0.000 1.000 0.000 0.000
#> SRR1340260 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1376450 1 0.3730 0.811 0.712 0.000 0.000 0.000 0.288
#> SRR1321897 5 0.4138 0.636 0.000 0.000 0.384 0.000 0.616
#> SRR1445194 1 0.2966 0.848 0.816 0.000 0.000 0.000 0.184
#> SRR1443308 5 0.5766 0.566 0.000 0.000 0.220 0.164 0.616
#> SRR1400931 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.885 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 5 0.4045 0.639 0.000 0.000 0.356 0.000 0.644
#> SRR1078392 1 0.3274 0.840 0.780 0.000 0.000 0.000 0.220
#> SRR1436468 1 0.0609 0.849 0.980 0.000 0.020 0.000 0.000
#> SRR1476125 2 0.0000 0.922 0.000 1.000 0.000 0.000 0.000
#> SRR1418747 5 0.4984 0.046 0.308 0.000 0.052 0.000 0.640
#> SRR1318089 3 0.0000 0.885 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.922 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.3730 0.811 0.712 0.000 0.000 0.000 0.288
#> SRR1460337 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1469062 5 0.2068 0.482 0.092 0.000 0.004 0.000 0.904
#> SRR1388459 3 0.0404 0.870 0.012 0.000 0.988 0.000 0.000
#> SRR1416841 3 0.0000 0.885 0.000 0.000 1.000 0.000 0.000
#> SRR1473778 1 0.2629 0.756 0.860 0.000 0.136 0.000 0.004
#> SRR1419561 1 0.3534 0.826 0.744 0.000 0.000 0.000 0.256
#> SRR1339987 1 0.3730 0.811 0.712 0.000 0.000 0.000 0.288
#> SRR1469662 1 0.3730 0.811 0.712 0.000 0.000 0.000 0.288
#> SRR1432958 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1479198 1 0.3730 0.811 0.712 0.000 0.000 0.000 0.288
#> SRR1353600 1 0.2732 0.852 0.840 0.000 0.000 0.000 0.160
#> SRR1456492 3 0.4305 -0.452 0.000 0.000 0.512 0.000 0.488
#> SRR1389955 1 0.3730 0.811 0.712 0.000 0.000 0.000 0.288
#> SRR1429540 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1356057 1 0.2179 0.799 0.896 0.000 0.100 0.000 0.004
#> SRR1328715 1 0.2179 0.859 0.888 0.000 0.000 0.000 0.112
#> SRR1429429 3 0.0000 0.885 0.000 0.000 1.000 0.000 0.000
#> SRR1325201 2 0.0000 0.922 0.000 1.000 0.000 0.000 0.000
#> SRR1382978 3 0.0000 0.885 0.000 0.000 1.000 0.000 0.000
#> SRR1406348 2 0.0000 0.922 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.1965 0.908 0.000 0.904 0.000 0.000 0.096
#> SRR1376380 5 0.4138 0.636 0.000 0.000 0.384 0.000 0.616
#> SRR1418225 4 0.0000 0.990 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.1965 0.908 0.000 0.904 0.000 0.000 0.096
#> SRR1376741 1 0.0290 0.861 0.992 0.000 0.000 0.000 0.008
#> SRR1431823 5 0.4138 0.636 0.000 0.000 0.384 0.000 0.616
#> SRR1447916 2 0.1965 0.908 0.000 0.904 0.000 0.000 0.096
#> SRR1458643 4 0.0000 0.990 0.000 0.000 0.000 1.000 0.000
#> SRR1445618 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1081589 4 0.0000 0.990 0.000 0.000 0.000 1.000 0.000
#> SRR1097245 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.2179 0.858 0.888 0.000 0.000 0.000 0.112
#> SRR1404339 2 0.0000 0.922 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> SRR1406135 1 0.3730 0.811 0.712 0.000 0.000 0.000 0.288
#> SRR1413307 4 0.0000 0.990 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.922 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0510 0.980 0.016 0.000 0.000 0.984 0.000
#> SRR1381185 5 0.4541 0.570 0.112 0.000 0.136 0.000 0.752
#> SRR1100608 2 0.1965 0.908 0.000 0.904 0.000 0.000 0.096
#> SRR1386927 2 0.1965 0.908 0.000 0.904 0.000 0.000 0.096
#> SRR1331771 5 0.4138 0.636 0.000 0.000 0.384 0.000 0.616
#> SRR1486322 3 0.0000 0.885 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 3 0.3305 0.532 0.000 0.000 0.776 0.000 0.224
#> SRR1459980 1 0.5179 0.747 0.640 0.000 0.072 0.000 0.288
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 1 0.1152 0.892 0.952 0.000 0.004 0.000 0.044 0.000
#> SRR1315412 2 0.0000 0.826 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 1 0.3706 0.416 0.620 0.000 0.000 0.000 0.380 0.000
#> SRR1071105 5 0.4934 0.399 0.000 0.112 0.000 0.000 0.632 0.256
#> SRR1432868 2 0.3979 0.874 0.000 0.708 0.000 0.000 0.036 0.256
#> SRR1454480 4 0.0260 0.991 0.008 0.000 0.000 0.992 0.000 0.000
#> SRR1330723 2 0.3979 0.874 0.000 0.708 0.000 0.000 0.036 0.256
#> SRR1475324 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1340260 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1376450 5 0.0937 0.925 0.040 0.000 0.000 0.000 0.960 0.000
#> SRR1321897 6 0.3175 0.882 0.000 0.000 0.256 0.000 0.000 0.744
#> SRR1445194 1 0.3198 0.716 0.740 0.000 0.000 0.000 0.260 0.000
#> SRR1443308 6 0.4094 0.717 0.000 0.000 0.088 0.168 0.000 0.744
#> SRR1400931 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.0146 0.991 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR1407044 6 0.3175 0.882 0.000 0.000 0.256 0.000 0.000 0.744
#> SRR1078392 1 0.3499 0.629 0.680 0.000 0.000 0.000 0.320 0.000
#> SRR1436468 1 0.0820 0.895 0.972 0.000 0.000 0.000 0.012 0.016
#> SRR1476125 2 0.3979 0.874 0.000 0.708 0.000 0.000 0.036 0.256
#> SRR1418747 5 0.1010 0.898 0.004 0.000 0.000 0.000 0.960 0.036
#> SRR1318089 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1348929 2 0.3979 0.874 0.000 0.708 0.000 0.000 0.036 0.256
#> SRR1385690 5 0.1007 0.922 0.044 0.000 0.000 0.000 0.956 0.000
#> SRR1460337 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1469062 5 0.1010 0.898 0.004 0.000 0.000 0.000 0.960 0.036
#> SRR1388459 3 0.0458 0.970 0.016 0.000 0.984 0.000 0.000 0.000
#> SRR1416841 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1473778 1 0.2586 0.831 0.868 0.000 0.100 0.000 0.032 0.000
#> SRR1419561 5 0.2219 0.830 0.136 0.000 0.000 0.000 0.864 0.000
#> SRR1339987 5 0.0937 0.925 0.040 0.000 0.000 0.000 0.960 0.000
#> SRR1469662 5 0.0937 0.925 0.040 0.000 0.000 0.000 0.960 0.000
#> SRR1432958 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1479198 5 0.0937 0.925 0.040 0.000 0.000 0.000 0.960 0.000
#> SRR1353600 1 0.2491 0.809 0.836 0.000 0.000 0.000 0.164 0.000
#> SRR1456492 6 0.3765 0.677 0.000 0.000 0.404 0.000 0.000 0.596
#> SRR1389955 5 0.0937 0.925 0.040 0.000 0.000 0.000 0.960 0.000
#> SRR1429540 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1356057 1 0.2877 0.782 0.820 0.000 0.168 0.000 0.012 0.000
#> SRR1328715 1 0.2135 0.848 0.872 0.000 0.000 0.000 0.128 0.000
#> SRR1429429 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1325201 2 0.3979 0.874 0.000 0.708 0.000 0.000 0.036 0.256
#> SRR1382978 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.3979 0.874 0.000 0.708 0.000 0.000 0.036 0.256
#> SRR1469390 2 0.0000 0.826 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 6 0.3175 0.882 0.000 0.000 0.256 0.000 0.000 0.744
#> SRR1418225 4 0.0000 0.995 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0000 0.826 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 1 0.1204 0.889 0.944 0.000 0.000 0.000 0.056 0.000
#> SRR1431823 6 0.3175 0.882 0.000 0.000 0.256 0.000 0.000 0.744
#> SRR1447916 2 0.0000 0.826 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.0146 0.994 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR1445618 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1081589 4 0.0146 0.994 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR1097245 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.1714 0.867 0.908 0.000 0.000 0.000 0.092 0.000
#> SRR1404339 2 0.3979 0.874 0.000 0.708 0.000 0.000 0.036 0.256
#> SRR1478614 1 0.0000 0.900 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1406135 5 0.0937 0.925 0.040 0.000 0.000 0.000 0.960 0.000
#> SRR1413307 4 0.0000 0.995 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.3979 0.874 0.000 0.708 0.000 0.000 0.036 0.256
#> SRR1358391 4 0.0260 0.991 0.008 0.000 0.000 0.992 0.000 0.000
#> SRR1381185 6 0.4726 0.678 0.060 0.000 0.052 0.000 0.160 0.728
#> SRR1100608 2 0.0000 0.826 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1386927 2 0.0000 0.826 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 6 0.3175 0.882 0.000 0.000 0.256 0.000 0.000 0.744
#> SRR1486322 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 5 0.2562 0.747 0.000 0.000 0.172 0.000 0.828 0.000
#> SRR1459980 5 0.1049 0.921 0.032 0.000 0.008 0.000 0.960 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 17667 rows and 70 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 1.000 0.941 0.973 0.4436 0.574 0.574
#> 3 3 0.690 0.812 0.906 0.3765 0.816 0.680
#> 4 4 0.662 0.751 0.865 0.0522 0.907 0.780
#> 5 5 0.681 0.659 0.815 0.1452 0.854 0.625
#> 6 6 0.680 0.689 0.779 0.0884 0.862 0.537
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
#> SRR1433493 1 0.000 0.960 1.000 0.000
#> SRR1405147 1 0.000 0.960 1.000 0.000
#> SRR1315412 2 0.000 1.000 0.000 1.000
#> SRR1338384 1 0.000 0.960 1.000 0.000
#> SRR1071105 2 0.000 1.000 0.000 1.000
#> SRR1432868 2 0.000 1.000 0.000 1.000
#> SRR1454480 2 0.000 1.000 0.000 1.000
#> SRR1330723 2 0.000 1.000 0.000 1.000
#> SRR1475324 1 0.000 0.960 1.000 0.000
#> SRR1340260 1 0.000 0.960 1.000 0.000
#> SRR1376450 1 0.969 0.417 0.604 0.396
#> SRR1321897 1 0.000 0.960 1.000 0.000
#> SRR1445194 1 0.000 0.960 1.000 0.000
#> SRR1443308 1 0.430 0.896 0.912 0.088
#> SRR1400931 1 0.430 0.896 0.912 0.088
#> SRR1416188 1 0.000 0.960 1.000 0.000
#> SRR1407044 1 0.000 0.960 1.000 0.000
#> SRR1078392 1 0.000 0.960 1.000 0.000
#> SRR1436468 1 0.443 0.893 0.908 0.092
#> SRR1476125 2 0.000 1.000 0.000 1.000
#> SRR1418747 1 0.000 0.960 1.000 0.000
#> SRR1318089 1 0.000 0.960 1.000 0.000
#> SRR1444370 1 0.000 0.960 1.000 0.000
#> SRR1348929 2 0.000 1.000 0.000 1.000
#> SRR1385690 1 0.000 0.960 1.000 0.000
#> SRR1460337 1 0.969 0.417 0.604 0.396
#> SRR1469062 1 0.000 0.960 1.000 0.000
#> SRR1388459 1 0.000 0.960 1.000 0.000
#> SRR1416841 1 0.000 0.960 1.000 0.000
#> SRR1473778 1 0.000 0.960 1.000 0.000
#> SRR1419561 1 0.430 0.896 0.912 0.088
#> SRR1339987 1 0.000 0.960 1.000 0.000
#> SRR1469662 1 0.000 0.960 1.000 0.000
#> SRR1432958 1 0.000 0.960 1.000 0.000
#> SRR1479198 1 0.000 0.960 1.000 0.000
#> SRR1353600 1 0.000 0.960 1.000 0.000
#> SRR1456492 1 0.000 0.960 1.000 0.000
#> SRR1389955 1 0.000 0.960 1.000 0.000
#> SRR1429540 1 0.000 0.960 1.000 0.000
#> SRR1356057 1 0.000 0.960 1.000 0.000
#> SRR1328715 1 0.000 0.960 1.000 0.000
#> SRR1429429 1 0.000 0.960 1.000 0.000
#> SRR1325201 2 0.000 1.000 0.000 1.000
#> SRR1382978 1 0.000 0.960 1.000 0.000
#> SRR1406348 2 0.000 1.000 0.000 1.000
#> SRR1469390 2 0.000 1.000 0.000 1.000
#> SRR1376380 1 0.000 0.960 1.000 0.000
#> SRR1418225 2 0.000 1.000 0.000 1.000
#> SRR1418473 2 0.000 1.000 0.000 1.000
#> SRR1376741 1 0.000 0.960 1.000 0.000
#> SRR1431823 1 0.000 0.960 1.000 0.000
#> SRR1447916 2 0.000 1.000 0.000 1.000
#> SRR1458643 2 0.000 1.000 0.000 1.000
#> SRR1445618 1 0.000 0.960 1.000 0.000
#> SRR1081589 2 0.000 1.000 0.000 1.000
#> SRR1097245 1 0.430 0.896 0.912 0.088
#> SRR1416141 1 0.000 0.960 1.000 0.000
#> SRR1404339 2 0.000 1.000 0.000 1.000
#> SRR1478614 1 0.689 0.790 0.816 0.184
#> SRR1406135 1 0.969 0.417 0.604 0.396
#> SRR1413307 2 0.000 1.000 0.000 1.000
#> SRR1397720 2 0.000 1.000 0.000 1.000
#> SRR1358391 2 0.000 1.000 0.000 1.000
#> SRR1381185 1 0.000 0.960 1.000 0.000
#> SRR1100608 2 0.000 1.000 0.000 1.000
#> SRR1386927 2 0.000 1.000 0.000 1.000
#> SRR1331771 1 0.430 0.896 0.912 0.088
#> SRR1486322 1 0.000 0.960 1.000 0.000
#> SRR1080790 1 0.000 0.960 1.000 0.000
#> SRR1459980 1 0.000 0.960 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.3752 0.873 0.144 0.000 0.856
#> SRR1405147 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1315412 2 0.0000 0.974 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1071105 2 0.2711 0.943 0.000 0.912 0.088
#> SRR1432868 2 0.1289 0.971 0.000 0.968 0.032
#> SRR1454480 2 0.1163 0.972 0.000 0.972 0.028
#> SRR1330723 2 0.1411 0.970 0.000 0.964 0.036
#> SRR1475324 3 0.3267 0.890 0.116 0.000 0.884
#> SRR1340260 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1376450 1 0.7839 0.279 0.560 0.380 0.060
#> SRR1321897 3 0.3412 0.887 0.124 0.000 0.876
#> SRR1445194 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1443308 1 0.6047 0.405 0.680 0.008 0.312
#> SRR1400931 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1416188 3 0.3267 0.890 0.116 0.000 0.884
#> SRR1407044 3 0.5760 0.656 0.328 0.000 0.672
#> SRR1078392 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1436468 1 0.4842 0.672 0.776 0.000 0.224
#> SRR1476125 2 0.2625 0.945 0.000 0.916 0.084
#> SRR1418747 1 0.1411 0.841 0.964 0.000 0.036
#> SRR1318089 3 0.3267 0.890 0.116 0.000 0.884
#> SRR1444370 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1348929 2 0.1289 0.971 0.000 0.968 0.032
#> SRR1385690 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1460337 1 0.8283 0.222 0.536 0.380 0.084
#> SRR1469062 1 0.2959 0.779 0.900 0.000 0.100
#> SRR1388459 1 0.5363 0.504 0.724 0.000 0.276
#> SRR1416841 3 0.3267 0.890 0.116 0.000 0.884
#> SRR1473778 1 0.0237 0.861 0.996 0.000 0.004
#> SRR1419561 1 0.0892 0.848 0.980 0.020 0.000
#> SRR1339987 1 0.4555 0.648 0.800 0.000 0.200
#> SRR1469662 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1353600 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1456492 1 0.6026 0.230 0.624 0.000 0.376
#> SRR1389955 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1429540 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1356057 1 0.4796 0.615 0.780 0.000 0.220
#> SRR1328715 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1429429 3 0.3267 0.890 0.116 0.000 0.884
#> SRR1325201 2 0.2625 0.945 0.000 0.916 0.084
#> SRR1382978 3 0.3267 0.890 0.116 0.000 0.884
#> SRR1406348 2 0.1289 0.971 0.000 0.968 0.032
#> SRR1469390 2 0.0892 0.973 0.000 0.980 0.020
#> SRR1376380 3 0.6215 0.436 0.428 0.000 0.572
#> SRR1418225 2 0.1163 0.972 0.000 0.972 0.028
#> SRR1418473 2 0.0000 0.974 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1431823 3 0.6286 0.335 0.464 0.000 0.536
#> SRR1447916 2 0.0000 0.974 0.000 1.000 0.000
#> SRR1458643 2 0.1163 0.972 0.000 0.972 0.028
#> SRR1445618 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1081589 2 0.1163 0.972 0.000 0.972 0.028
#> SRR1097245 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1404339 2 0.1289 0.971 0.000 0.968 0.032
#> SRR1478614 1 0.3031 0.784 0.912 0.076 0.012
#> SRR1406135 1 0.6849 0.329 0.600 0.380 0.020
#> SRR1413307 2 0.1163 0.972 0.000 0.972 0.028
#> SRR1397720 2 0.1289 0.971 0.000 0.968 0.032
#> SRR1358391 2 0.1163 0.972 0.000 0.972 0.028
#> SRR1381185 1 0.0000 0.863 1.000 0.000 0.000
#> SRR1100608 2 0.0424 0.974 0.000 0.992 0.008
#> SRR1386927 2 0.0892 0.973 0.000 0.980 0.020
#> SRR1331771 1 0.6154 0.115 0.592 0.000 0.408
#> SRR1486322 3 0.3267 0.890 0.116 0.000 0.884
#> SRR1080790 1 0.1529 0.838 0.960 0.000 0.040
#> SRR1459980 1 0.0000 0.863 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.4382 0.9611 0.296 0.000 0.704 0.000
#> SRR1405147 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1315412 2 0.0000 0.9401 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1071105 2 0.4372 0.7787 0.004 0.728 0.268 0.000
#> SRR1432868 2 0.0000 0.9401 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0469 0.9228 0.000 0.012 0.000 0.988
#> SRR1330723 2 0.2011 0.9253 0.000 0.920 0.080 0.000
#> SRR1475324 3 0.4356 0.9600 0.292 0.000 0.708 0.000
#> SRR1340260 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.5174 0.4461 0.620 0.000 0.368 0.012
#> SRR1321897 3 0.4406 0.9563 0.300 0.000 0.700 0.000
#> SRR1445194 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1443308 4 0.6724 0.2982 0.192 0.000 0.192 0.616
#> SRR1400931 1 0.0188 0.8008 0.996 0.000 0.004 0.000
#> SRR1416188 3 0.4382 0.9611 0.296 0.000 0.704 0.000
#> SRR1407044 3 0.4989 0.5678 0.472 0.000 0.528 0.000
#> SRR1078392 1 0.1211 0.7831 0.960 0.000 0.040 0.000
#> SRR1436468 1 0.4770 0.5357 0.700 0.000 0.288 0.012
#> SRR1476125 2 0.2973 0.8935 0.000 0.856 0.144 0.000
#> SRR1418747 1 0.1637 0.7686 0.940 0.000 0.060 0.000
#> SRR1318089 3 0.4382 0.9611 0.296 0.000 0.704 0.000
#> SRR1444370 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.9401 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.1211 0.7831 0.960 0.000 0.040 0.000
#> SRR1460337 1 0.5174 0.4461 0.620 0.000 0.368 0.012
#> SRR1469062 1 0.2973 0.6659 0.856 0.000 0.144 0.000
#> SRR1388459 1 0.4164 0.4281 0.736 0.000 0.264 0.000
#> SRR1416841 3 0.4356 0.9600 0.292 0.000 0.708 0.000
#> SRR1473778 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1419561 1 0.0817 0.7910 0.976 0.000 0.024 0.000
#> SRR1339987 1 0.3907 0.5001 0.768 0.000 0.232 0.000
#> SRR1469662 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1353600 1 0.2741 0.7546 0.892 0.000 0.096 0.012
#> SRR1456492 1 0.4605 0.1780 0.664 0.000 0.336 0.000
#> SRR1389955 1 0.1211 0.7831 0.960 0.000 0.040 0.000
#> SRR1429540 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1356057 1 0.4277 0.3785 0.720 0.000 0.280 0.000
#> SRR1328715 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.4356 0.9600 0.292 0.000 0.708 0.000
#> SRR1325201 2 0.2973 0.8935 0.000 0.856 0.144 0.000
#> SRR1382978 3 0.4356 0.9600 0.292 0.000 0.708 0.000
#> SRR1406348 2 0.1302 0.9344 0.000 0.956 0.044 0.000
#> SRR1469390 2 0.0188 0.9387 0.000 0.996 0.000 0.004
#> SRR1376380 1 0.4941 -0.2429 0.564 0.000 0.436 0.000
#> SRR1418225 4 0.0469 0.9228 0.000 0.012 0.000 0.988
#> SRR1418473 2 0.0000 0.9401 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1431823 1 0.4843 -0.0442 0.604 0.000 0.396 0.000
#> SRR1447916 2 0.0000 0.9401 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.0469 0.9228 0.000 0.012 0.000 0.988
#> SRR1445618 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.0469 0.9228 0.000 0.012 0.000 0.988
#> SRR1097245 1 0.2101 0.7559 0.928 0.000 0.060 0.012
#> SRR1416141 1 0.1677 0.7827 0.948 0.000 0.040 0.012
#> SRR1404339 2 0.1867 0.9273 0.000 0.928 0.072 0.000
#> SRR1478614 1 0.4319 0.5785 0.760 0.000 0.228 0.012
#> SRR1406135 1 0.5110 0.4646 0.636 0.000 0.352 0.012
#> SRR1413307 4 0.0469 0.9228 0.000 0.012 0.000 0.988
#> SRR1397720 2 0.0000 0.9401 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0469 0.9228 0.000 0.012 0.000 0.988
#> SRR1381185 1 0.1637 0.7615 0.940 0.000 0.060 0.000
#> SRR1100608 2 0.2973 0.8935 0.000 0.856 0.144 0.000
#> SRR1386927 2 0.0188 0.9387 0.000 0.996 0.000 0.004
#> SRR1331771 1 0.4992 -0.1639 0.524 0.000 0.476 0.000
#> SRR1486322 3 0.4382 0.9611 0.296 0.000 0.704 0.000
#> SRR1080790 1 0.3649 0.5692 0.796 0.000 0.204 0.000
#> SRR1459980 1 0.0000 0.8023 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
#> SRR1433493 3 0.2605 0.808961 0.148 0.000 0.852 0.0 0.000
#> SRR1405147 1 0.0510 0.698819 0.984 0.000 0.016 0.0 0.000
#> SRR1315412 2 0.0000 0.828956 0.000 1.000 0.000 0.0 0.000
#> SRR1338384 1 0.0609 0.697573 0.980 0.000 0.020 0.0 0.000
#> SRR1071105 2 0.4824 0.681548 0.000 0.512 0.020 0.0 0.468
#> SRR1432868 2 0.0000 0.828956 0.000 1.000 0.000 0.0 0.000
#> SRR1454480 4 0.0000 1.000000 0.000 0.000 0.000 1.0 0.000
#> SRR1330723 2 0.4171 0.736249 0.000 0.604 0.000 0.0 0.396
#> SRR1475324 3 0.0794 0.800453 0.028 0.000 0.972 0.0 0.000
#> SRR1340260 1 0.0671 0.698042 0.980 0.000 0.016 0.0 0.004
#> SRR1376450 5 0.5104 0.930817 0.308 0.000 0.060 0.0 0.632
#> SRR1321897 3 0.2450 0.828529 0.076 0.000 0.896 0.0 0.028
#> SRR1445194 1 0.2208 0.681350 0.908 0.000 0.020 0.0 0.072
#> SRR1443308 3 0.7513 0.385738 0.296 0.000 0.368 0.3 0.036
#> SRR1400931 1 0.2903 0.586837 0.872 0.000 0.048 0.0 0.080
#> SRR1416188 3 0.1478 0.825464 0.064 0.000 0.936 0.0 0.000
#> SRR1407044 3 0.3389 0.821545 0.116 0.000 0.836 0.0 0.048
#> SRR1078392 1 0.4707 0.503909 0.716 0.000 0.212 0.0 0.072
#> SRR1436468 1 0.5544 -0.000919 0.608 0.000 0.100 0.0 0.292
#> SRR1476125 2 0.4774 0.718027 0.000 0.556 0.020 0.0 0.424
#> SRR1418747 1 0.5480 0.320572 0.616 0.000 0.288 0.0 0.096
#> SRR1318089 3 0.1732 0.828807 0.080 0.000 0.920 0.0 0.000
#> SRR1444370 1 0.1310 0.693494 0.956 0.000 0.020 0.0 0.024
#> SRR1348929 2 0.0000 0.828956 0.000 1.000 0.000 0.0 0.000
#> SRR1385690 1 0.1894 0.672793 0.920 0.000 0.008 0.0 0.072
#> SRR1460337 5 0.5045 0.930548 0.308 0.000 0.056 0.0 0.636
#> SRR1469062 1 0.5566 0.131126 0.580 0.000 0.332 0.0 0.088
#> SRR1388459 3 0.5232 0.634698 0.268 0.000 0.648 0.0 0.084
#> SRR1416841 3 0.1121 0.814160 0.044 0.000 0.956 0.0 0.000
#> SRR1473778 1 0.0510 0.698819 0.984 0.000 0.016 0.0 0.000
#> SRR1419561 1 0.4575 0.299693 0.712 0.000 0.052 0.0 0.236
#> SRR1339987 1 0.5663 0.012923 0.548 0.000 0.364 0.0 0.088
#> SRR1469662 1 0.1894 0.674043 0.920 0.000 0.008 0.0 0.072
#> SRR1432958 1 0.1300 0.689360 0.956 0.000 0.016 0.0 0.028
#> SRR1479198 1 0.1893 0.688876 0.928 0.000 0.024 0.0 0.048
#> SRR1353600 1 0.4166 -0.056870 0.648 0.000 0.004 0.0 0.348
#> SRR1456492 1 0.5692 -0.253460 0.472 0.000 0.448 0.0 0.080
#> SRR1389955 1 0.2520 0.681431 0.896 0.000 0.048 0.0 0.056
#> SRR1429540 1 0.0510 0.698819 0.984 0.000 0.016 0.0 0.000
#> SRR1356057 1 0.5757 -0.175335 0.496 0.000 0.416 0.0 0.088
#> SRR1328715 1 0.2077 0.667065 0.908 0.000 0.008 0.0 0.084
#> SRR1429429 3 0.0609 0.792249 0.020 0.000 0.980 0.0 0.000
#> SRR1325201 2 0.4774 0.718027 0.000 0.556 0.020 0.0 0.424
#> SRR1382978 3 0.1410 0.823277 0.060 0.000 0.940 0.0 0.000
#> SRR1406348 2 0.2020 0.813494 0.000 0.900 0.000 0.0 0.100
#> SRR1469390 2 0.0000 0.828956 0.000 1.000 0.000 0.0 0.000
#> SRR1376380 3 0.4136 0.771691 0.188 0.000 0.764 0.0 0.048
#> SRR1418225 4 0.0000 1.000000 0.000 0.000 0.000 1.0 0.000
#> SRR1418473 2 0.0000 0.828956 0.000 1.000 0.000 0.0 0.000
#> SRR1376741 1 0.0510 0.698819 0.984 0.000 0.016 0.0 0.000
#> SRR1431823 3 0.4453 0.732643 0.228 0.000 0.724 0.0 0.048
#> SRR1447916 2 0.0000 0.828956 0.000 1.000 0.000 0.0 0.000
#> SRR1458643 4 0.0000 1.000000 0.000 0.000 0.000 1.0 0.000
#> SRR1445618 1 0.1300 0.689360 0.956 0.000 0.016 0.0 0.028
#> SRR1081589 4 0.0000 1.000000 0.000 0.000 0.000 1.0 0.000
#> SRR1097245 1 0.4264 -0.186032 0.620 0.000 0.004 0.0 0.376
#> SRR1416141 1 0.3861 0.223417 0.712 0.000 0.004 0.0 0.284
#> SRR1404339 2 0.4045 0.753929 0.000 0.644 0.000 0.0 0.356
#> SRR1478614 5 0.5359 0.814249 0.412 0.000 0.056 0.0 0.532
#> SRR1406135 5 0.5113 0.929133 0.324 0.000 0.056 0.0 0.620
#> SRR1413307 4 0.0000 1.000000 0.000 0.000 0.000 1.0 0.000
#> SRR1397720 2 0.0609 0.827670 0.000 0.980 0.000 0.0 0.020
#> SRR1358391 4 0.0000 1.000000 0.000 0.000 0.000 1.0 0.000
#> SRR1381185 1 0.2376 0.683388 0.904 0.000 0.044 0.0 0.052
#> SRR1100608 2 0.4774 0.718027 0.000 0.556 0.020 0.0 0.424
#> SRR1386927 2 0.0000 0.828956 0.000 1.000 0.000 0.0 0.000
#> SRR1331771 3 0.5066 0.637919 0.240 0.000 0.676 0.0 0.084
#> SRR1486322 3 0.1831 0.828047 0.076 0.000 0.920 0.0 0.004
#> SRR1080790 3 0.5840 0.287345 0.416 0.000 0.488 0.0 0.096
#> SRR1459980 1 0.0510 0.698819 0.984 0.000 0.016 0.0 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0405 0.884 0.000 0.000 0.988 0.000 0.008 0.004
#> SRR1405147 5 0.5041 0.634 0.000 0.000 0.128 0.000 0.624 0.248
#> SRR1315412 2 0.0000 0.858 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 5 0.3395 0.673 0.000 0.000 0.132 0.000 0.808 0.060
#> SRR1071105 6 0.4610 0.874 0.012 0.384 0.000 0.000 0.024 0.580
#> SRR1432868 2 0.0146 0.859 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1454480 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 6 0.4689 0.820 0.044 0.440 0.000 0.000 0.000 0.516
#> SRR1475324 3 0.0000 0.887 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1340260 5 0.4874 0.662 0.036 0.000 0.104 0.000 0.716 0.144
#> SRR1376450 1 0.0291 0.661 0.992 0.000 0.000 0.000 0.004 0.004
#> SRR1321897 3 0.0260 0.886 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1445194 1 0.5146 0.509 0.516 0.000 0.088 0.000 0.396 0.000
#> SRR1443308 5 0.6127 0.160 0.000 0.000 0.220 0.328 0.444 0.008
#> SRR1400931 1 0.4918 0.578 0.596 0.000 0.084 0.000 0.320 0.000
#> SRR1416188 3 0.0000 0.887 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1407044 3 0.1625 0.864 0.000 0.000 0.928 0.000 0.060 0.012
#> SRR1078392 5 0.3042 0.622 0.020 0.000 0.028 0.000 0.852 0.100
#> SRR1436468 1 0.6813 0.293 0.488 0.000 0.092 0.000 0.240 0.180
#> SRR1476125 6 0.4300 0.915 0.020 0.432 0.000 0.000 0.000 0.548
#> SRR1418747 5 0.3099 0.654 0.008 0.000 0.176 0.000 0.808 0.008
#> SRR1318089 3 0.0000 0.887 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.5178 0.452 0.488 0.000 0.088 0.000 0.424 0.000
#> SRR1348929 2 0.0146 0.859 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1385690 5 0.3838 0.535 0.116 0.000 0.004 0.000 0.784 0.096
#> SRR1460337 1 0.1564 0.646 0.936 0.000 0.000 0.000 0.024 0.040
#> SRR1469062 5 0.3364 0.616 0.012 0.000 0.036 0.000 0.820 0.132
#> SRR1388459 3 0.2905 0.792 0.008 0.000 0.836 0.000 0.144 0.012
#> SRR1416841 3 0.0000 0.887 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1473778 5 0.5041 0.630 0.000 0.000 0.128 0.000 0.624 0.248
#> SRR1419561 5 0.4207 0.338 0.308 0.000 0.012 0.000 0.664 0.016
#> SRR1339987 5 0.3831 0.608 0.028 0.000 0.044 0.000 0.796 0.132
#> SRR1469662 5 0.2848 0.519 0.160 0.000 0.008 0.000 0.828 0.004
#> SRR1432958 1 0.5112 0.514 0.516 0.000 0.084 0.000 0.400 0.000
#> SRR1479198 5 0.2678 0.664 0.020 0.000 0.116 0.000 0.860 0.004
#> SRR1353600 1 0.2854 0.679 0.792 0.000 0.000 0.000 0.208 0.000
#> SRR1456492 3 0.5840 0.199 0.012 0.000 0.472 0.000 0.380 0.136
#> SRR1389955 5 0.2455 0.666 0.012 0.000 0.112 0.000 0.872 0.004
#> SRR1429540 5 0.4771 0.653 0.000 0.000 0.116 0.000 0.664 0.220
#> SRR1356057 5 0.3920 0.604 0.024 0.000 0.052 0.000 0.788 0.136
#> SRR1328715 5 0.4172 -0.254 0.424 0.000 0.004 0.000 0.564 0.008
#> SRR1429429 3 0.0146 0.885 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1325201 6 0.3950 0.913 0.004 0.432 0.000 0.000 0.000 0.564
#> SRR1382978 3 0.0000 0.887 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.2992 0.658 0.044 0.864 0.000 0.000 0.024 0.068
#> SRR1469390 2 0.0458 0.846 0.000 0.984 0.000 0.016 0.000 0.000
#> SRR1376380 3 0.2070 0.845 0.000 0.000 0.896 0.000 0.092 0.012
#> SRR1418225 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0000 0.858 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 5 0.4931 0.640 0.000 0.000 0.116 0.000 0.636 0.248
#> SRR1431823 3 0.2170 0.839 0.000 0.000 0.888 0.000 0.100 0.012
#> SRR1447916 2 0.0146 0.859 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1458643 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1445618 1 0.5112 0.514 0.516 0.000 0.084 0.000 0.400 0.000
#> SRR1081589 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1097245 1 0.2854 0.679 0.792 0.000 0.000 0.000 0.208 0.000
#> SRR1416141 1 0.3273 0.674 0.776 0.000 0.004 0.000 0.212 0.008
#> SRR1404339 2 0.5237 -0.806 0.044 0.476 0.000 0.000 0.024 0.456
#> SRR1478614 1 0.2442 0.674 0.884 0.000 0.000 0.000 0.068 0.048
#> SRR1406135 1 0.0146 0.660 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1413307 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0891 0.835 0.024 0.968 0.000 0.000 0.000 0.008
#> SRR1358391 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 5 0.5167 0.642 0.012 0.000 0.164 0.000 0.656 0.168
#> SRR1100608 6 0.3966 0.909 0.004 0.444 0.000 0.000 0.000 0.552
#> SRR1386927 2 0.0458 0.846 0.000 0.984 0.000 0.016 0.000 0.000
#> SRR1331771 3 0.5041 0.666 0.072 0.000 0.700 0.000 0.172 0.056
#> SRR1486322 3 0.0000 0.887 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 3 0.3991 0.531 0.008 0.000 0.680 0.000 0.300 0.012
#> SRR1459980 5 0.5176 0.635 0.004 0.000 0.128 0.000 0.620 0.248
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 17667 rows and 70 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 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.997 0.999 0.3741 0.627 0.627
#> 3 3 0.693 0.736 0.861 0.5590 0.683 0.509
#> 4 4 0.961 0.945 0.978 0.2173 0.742 0.425
#> 5 5 0.800 0.779 0.901 0.0699 0.901 0.687
#> 6 6 0.810 0.808 0.892 0.0545 0.893 0.607
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
#> SRR1433493 1 0.0000 0.999 1.000 0.000
#> SRR1405147 1 0.0000 0.999 1.000 0.000
#> SRR1315412 2 0.0000 0.998 0.000 1.000
#> SRR1338384 1 0.0000 0.999 1.000 0.000
#> SRR1071105 2 0.0000 0.998 0.000 1.000
#> SRR1432868 2 0.0000 0.998 0.000 1.000
#> SRR1454480 1 0.0000 0.999 1.000 0.000
#> SRR1330723 2 0.0000 0.998 0.000 1.000
#> SRR1475324 1 0.0000 0.999 1.000 0.000
#> SRR1340260 1 0.0000 0.999 1.000 0.000
#> SRR1376450 1 0.0000 0.999 1.000 0.000
#> SRR1321897 1 0.0000 0.999 1.000 0.000
#> SRR1445194 1 0.0000 0.999 1.000 0.000
#> SRR1443308 1 0.0000 0.999 1.000 0.000
#> SRR1400931 1 0.0000 0.999 1.000 0.000
#> SRR1416188 1 0.0000 0.999 1.000 0.000
#> SRR1407044 1 0.0000 0.999 1.000 0.000
#> SRR1078392 1 0.0000 0.999 1.000 0.000
#> SRR1436468 1 0.0000 0.999 1.000 0.000
#> SRR1476125 2 0.0000 0.998 0.000 1.000
#> SRR1418747 1 0.0000 0.999 1.000 0.000
#> SRR1318089 1 0.0000 0.999 1.000 0.000
#> SRR1444370 1 0.0000 0.999 1.000 0.000
#> SRR1348929 2 0.0000 0.998 0.000 1.000
#> SRR1385690 1 0.0000 0.999 1.000 0.000
#> SRR1460337 1 0.0000 0.999 1.000 0.000
#> SRR1469062 1 0.0000 0.999 1.000 0.000
#> SRR1388459 1 0.0000 0.999 1.000 0.000
#> SRR1416841 1 0.0000 0.999 1.000 0.000
#> SRR1473778 1 0.0000 0.999 1.000 0.000
#> SRR1419561 1 0.0000 0.999 1.000 0.000
#> SRR1339987 1 0.0000 0.999 1.000 0.000
#> SRR1469662 1 0.0000 0.999 1.000 0.000
#> SRR1432958 1 0.0000 0.999 1.000 0.000
#> SRR1479198 1 0.0000 0.999 1.000 0.000
#> SRR1353600 1 0.0000 0.999 1.000 0.000
#> SRR1456492 1 0.0000 0.999 1.000 0.000
#> SRR1389955 1 0.0000 0.999 1.000 0.000
#> SRR1429540 1 0.0000 0.999 1.000 0.000
#> SRR1356057 1 0.0000 0.999 1.000 0.000
#> SRR1328715 1 0.0000 0.999 1.000 0.000
#> SRR1429429 1 0.0000 0.999 1.000 0.000
#> SRR1325201 2 0.0000 0.998 0.000 1.000
#> SRR1382978 1 0.0000 0.999 1.000 0.000
#> SRR1406348 2 0.0000 0.998 0.000 1.000
#> SRR1469390 2 0.0000 0.998 0.000 1.000
#> SRR1376380 1 0.0000 0.999 1.000 0.000
#> SRR1418225 2 0.0000 0.998 0.000 1.000
#> SRR1418473 2 0.0000 0.998 0.000 1.000
#> SRR1376741 1 0.0000 0.999 1.000 0.000
#> SRR1431823 1 0.0000 0.999 1.000 0.000
#> SRR1447916 2 0.0000 0.998 0.000 1.000
#> SRR1458643 1 0.2778 0.950 0.952 0.048
#> SRR1445618 1 0.0000 0.999 1.000 0.000
#> SRR1081589 1 0.0938 0.987 0.988 0.012
#> SRR1097245 1 0.0000 0.999 1.000 0.000
#> SRR1416141 1 0.0000 0.999 1.000 0.000
#> SRR1404339 2 0.0000 0.998 0.000 1.000
#> SRR1478614 1 0.0000 0.999 1.000 0.000
#> SRR1406135 1 0.0000 0.999 1.000 0.000
#> SRR1413307 2 0.2043 0.967 0.032 0.968
#> SRR1397720 2 0.0000 0.998 0.000 1.000
#> SRR1358391 1 0.0000 0.999 1.000 0.000
#> SRR1381185 1 0.0000 0.999 1.000 0.000
#> SRR1100608 2 0.0000 0.998 0.000 1.000
#> SRR1386927 2 0.0000 0.998 0.000 1.000
#> SRR1331771 1 0.0000 0.999 1.000 0.000
#> SRR1486322 1 0.0000 0.999 1.000 0.000
#> SRR1080790 1 0.0000 0.999 1.000 0.000
#> SRR1459980 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
#> SRR1433493 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1405147 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1338384 1 0.6308 -0.758 0.508 0.000 0.492
#> SRR1071105 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1454480 1 0.6045 0.506 0.620 0.000 0.380
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1475324 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1340260 3 0.6267 0.864 0.452 0.000 0.548
#> SRR1376450 3 0.6305 0.797 0.484 0.000 0.516
#> SRR1321897 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1445194 1 0.1163 0.598 0.972 0.000 0.028
#> SRR1443308 3 0.3879 0.547 0.152 0.000 0.848
#> SRR1400931 1 0.0424 0.607 0.992 0.000 0.008
#> SRR1416188 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1407044 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1078392 1 0.6307 -0.749 0.512 0.000 0.488
#> SRR1436468 3 0.6095 0.955 0.392 0.000 0.608
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1418747 3 0.6079 0.959 0.388 0.000 0.612
#> SRR1318089 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1444370 1 0.1031 0.602 0.976 0.000 0.024
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1385690 1 0.1031 0.602 0.976 0.000 0.024
#> SRR1460337 1 0.5956 -0.241 0.672 0.004 0.324
#> SRR1469062 1 0.5706 -0.233 0.680 0.000 0.320
#> SRR1388459 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1416841 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1473778 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1419561 3 0.6260 0.871 0.448 0.000 0.552
#> SRR1339987 1 0.6215 -0.596 0.572 0.000 0.428
#> SRR1469662 1 0.1529 0.584 0.960 0.000 0.040
#> SRR1432958 1 0.1031 0.602 0.976 0.000 0.024
#> SRR1479198 3 0.6215 0.905 0.428 0.000 0.572
#> SRR1353600 1 0.4974 0.607 0.764 0.000 0.236
#> SRR1456492 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1389955 1 0.4842 0.165 0.776 0.000 0.224
#> SRR1429540 3 0.6095 0.955 0.392 0.000 0.608
#> SRR1356057 3 0.6062 0.957 0.384 0.000 0.616
#> SRR1328715 1 0.1031 0.602 0.976 0.000 0.024
#> SRR1429429 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1382978 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376380 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1418225 1 0.6045 0.506 0.620 0.000 0.380
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376741 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1431823 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1458643 1 0.6045 0.506 0.620 0.000 0.380
#> SRR1445618 1 0.1031 0.602 0.976 0.000 0.024
#> SRR1081589 1 0.6045 0.506 0.620 0.000 0.380
#> SRR1097245 1 0.5058 0.606 0.756 0.000 0.244
#> SRR1416141 1 0.3816 0.613 0.852 0.000 0.148
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.609 1.000 0.000 0.000
#> SRR1406135 1 0.2261 0.544 0.932 0.000 0.068
#> SRR1413307 1 0.6045 0.506 0.620 0.000 0.380
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1358391 1 0.6045 0.506 0.620 0.000 0.380
#> SRR1381185 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1331771 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1486322 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1080790 3 0.6045 0.966 0.380 0.000 0.620
#> SRR1459980 3 0.6045 0.966 0.380 0.000 0.620
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1405147 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1315412 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1338384 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1071105 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1432868 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1454480 4 0.0000 1.0000 0.000 0.0 0.000 1.000
#> SRR1330723 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1475324 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1340260 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1376450 1 0.2345 0.8748 0.900 0.1 0.000 0.000
#> SRR1321897 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1445194 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1443308 3 0.2589 0.8487 0.000 0.0 0.884 0.116
#> SRR1400931 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1416188 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1407044 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1078392 3 0.4989 0.0768 0.472 0.0 0.528 0.000
#> SRR1436468 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1476125 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1418747 1 0.2530 0.8587 0.888 0.0 0.112 0.000
#> SRR1318089 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1444370 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1348929 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1385690 1 0.1637 0.9239 0.940 0.0 0.000 0.060
#> SRR1460337 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1469062 3 0.1716 0.8977 0.000 0.0 0.936 0.064
#> SRR1388459 3 0.0188 0.9416 0.004 0.0 0.996 0.000
#> SRR1416841 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1473778 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1419561 1 0.1118 0.9438 0.964 0.0 0.036 0.000
#> SRR1339987 3 0.0707 0.9319 0.000 0.0 0.980 0.020
#> SRR1469662 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1432958 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1479198 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1353600 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1456492 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1389955 1 0.0469 0.9650 0.988 0.0 0.012 0.000
#> SRR1429540 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1356057 3 0.4008 0.6649 0.000 0.0 0.756 0.244
#> SRR1328715 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1429429 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1325201 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1382978 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1406348 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1469390 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1376380 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1418225 4 0.0000 1.0000 0.000 0.0 0.000 1.000
#> SRR1418473 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1376741 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1431823 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1447916 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1458643 4 0.0000 1.0000 0.000 0.0 0.000 1.000
#> SRR1445618 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1081589 4 0.0000 1.0000 0.000 0.0 0.000 1.000
#> SRR1097245 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1416141 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1404339 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1478614 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1406135 1 0.0000 0.9745 1.000 0.0 0.000 0.000
#> SRR1413307 4 0.0000 1.0000 0.000 0.0 0.000 1.000
#> SRR1397720 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1358391 4 0.0000 1.0000 0.000 0.0 0.000 1.000
#> SRR1381185 1 0.4277 0.6122 0.720 0.0 0.280 0.000
#> SRR1100608 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1386927 2 0.0000 1.0000 0.000 1.0 0.000 0.000
#> SRR1331771 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1486322 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1080790 3 0.0000 0.9450 0.000 0.0 1.000 0.000
#> SRR1459980 1 0.0000 0.9745 1.000 0.0 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0880 0.9009 0.000 0.000 0.968 0.000 0.032
#> SRR1405147 1 0.0404 0.8468 0.988 0.000 0.000 0.000 0.012
#> SRR1315412 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.1282 0.8300 0.952 0.000 0.004 0.000 0.044
#> SRR1071105 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.8836 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.0794 0.9020 0.000 0.000 0.972 0.000 0.028
#> SRR1340260 1 0.0000 0.8479 1.000 0.000 0.000 0.000 0.000
#> SRR1376450 1 0.5369 0.4459 0.660 0.124 0.000 0.000 0.216
#> SRR1321897 3 0.0162 0.9053 0.000 0.000 0.996 0.000 0.004
#> SRR1445194 1 0.3210 0.6406 0.788 0.000 0.000 0.000 0.212
#> SRR1443308 3 0.4047 0.5149 0.000 0.000 0.676 0.320 0.004
#> SRR1400931 1 0.0963 0.8359 0.964 0.000 0.000 0.000 0.036
#> SRR1416188 3 0.0162 0.9053 0.000 0.000 0.996 0.000 0.004
#> SRR1407044 3 0.0609 0.8997 0.000 0.000 0.980 0.000 0.020
#> SRR1078392 1 0.5849 0.0693 0.508 0.000 0.392 0.000 0.100
#> SRR1436468 1 0.0510 0.8447 0.984 0.000 0.000 0.000 0.016
#> SRR1476125 2 0.2221 0.8999 0.052 0.912 0.000 0.000 0.036
#> SRR1418747 3 0.4470 0.4145 0.012 0.000 0.616 0.000 0.372
#> SRR1318089 3 0.0404 0.9058 0.000 0.000 0.988 0.000 0.012
#> SRR1444370 1 0.2966 0.6793 0.816 0.000 0.000 0.000 0.184
#> SRR1348929 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 5 0.4587 0.5949 0.204 0.000 0.068 0.000 0.728
#> SRR1460337 1 0.0162 0.8474 0.996 0.000 0.000 0.000 0.004
#> SRR1469062 3 0.1485 0.8845 0.000 0.000 0.948 0.032 0.020
#> SRR1388459 3 0.3134 0.7724 0.120 0.000 0.848 0.000 0.032
#> SRR1416841 3 0.0880 0.9009 0.000 0.000 0.968 0.000 0.032
#> SRR1473778 1 0.0000 0.8479 1.000 0.000 0.000 0.000 0.000
#> SRR1419561 1 0.3810 0.6647 0.788 0.000 0.036 0.000 0.176
#> SRR1339987 3 0.4491 0.5966 0.024 0.000 0.708 0.008 0.260
#> SRR1469662 1 0.4126 0.2448 0.620 0.000 0.000 0.000 0.380
#> SRR1432958 1 0.0880 0.8380 0.968 0.000 0.000 0.000 0.032
#> SRR1479198 5 0.6411 0.3270 0.392 0.000 0.172 0.000 0.436
#> SRR1353600 1 0.0703 0.8424 0.976 0.000 0.000 0.000 0.024
#> SRR1456492 3 0.0404 0.9055 0.000 0.000 0.988 0.000 0.012
#> SRR1389955 5 0.4152 0.4759 0.060 0.000 0.168 0.000 0.772
#> SRR1429540 1 0.0290 0.8470 0.992 0.000 0.000 0.000 0.008
#> SRR1356057 4 0.6143 0.4641 0.164 0.000 0.164 0.640 0.032
#> SRR1328715 1 0.0290 0.8465 0.992 0.000 0.000 0.000 0.008
#> SRR1429429 3 0.0880 0.9009 0.000 0.000 0.968 0.000 0.032
#> SRR1325201 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1382978 3 0.0794 0.9020 0.000 0.000 0.972 0.000 0.028
#> SRR1406348 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.0162 0.9053 0.000 0.000 0.996 0.000 0.004
#> SRR1418225 4 0.0000 0.8836 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.0404 0.8463 0.988 0.000 0.000 0.000 0.012
#> SRR1431823 3 0.0162 0.9053 0.000 0.000 0.996 0.000 0.004
#> SRR1447916 2 0.0162 0.9904 0.000 0.996 0.000 0.000 0.004
#> SRR1458643 5 0.3796 0.1243 0.000 0.000 0.000 0.300 0.700
#> SRR1445618 1 0.0000 0.8479 1.000 0.000 0.000 0.000 0.000
#> SRR1081589 5 0.3752 0.1400 0.000 0.000 0.000 0.292 0.708
#> SRR1097245 1 0.0880 0.8380 0.968 0.000 0.000 0.000 0.032
#> SRR1416141 5 0.3999 0.5083 0.344 0.000 0.000 0.000 0.656
#> SRR1404339 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.0290 0.8468 0.992 0.000 0.000 0.000 0.008
#> SRR1406135 5 0.5215 0.4209 0.380 0.016 0.024 0.000 0.580
#> SRR1413307 4 0.0000 0.8836 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.8836 0.000 0.000 0.000 1.000 0.000
#> SRR1381185 1 0.3913 0.3646 0.676 0.000 0.324 0.000 0.000
#> SRR1100608 2 0.0162 0.9904 0.000 0.996 0.000 0.000 0.004
#> SRR1386927 2 0.0000 0.9927 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.0162 0.9053 0.000 0.000 0.996 0.000 0.004
#> SRR1486322 3 0.0404 0.9057 0.000 0.000 0.988 0.000 0.012
#> SRR1080790 3 0.3209 0.7351 0.008 0.000 0.812 0.000 0.180
#> SRR1459980 1 0.1012 0.8376 0.968 0.000 0.012 0.000 0.020
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.2282 0.869 0.000 0.000 0.888 0.000 0.088 0.024
#> SRR1405147 1 0.3217 0.734 0.768 0.000 0.000 0.000 0.224 0.008
#> SRR1315412 2 0.0146 0.978 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1338384 1 0.2112 0.798 0.896 0.000 0.000 0.000 0.016 0.088
#> SRR1071105 2 0.0000 0.979 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 0.979 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0790 0.794 0.000 0.000 0.000 0.968 0.000 0.032
#> SRR1330723 2 0.0146 0.978 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1475324 3 0.1492 0.888 0.000 0.000 0.940 0.000 0.036 0.024
#> SRR1340260 1 0.1765 0.835 0.904 0.000 0.000 0.000 0.096 0.000
#> SRR1376450 5 0.2830 0.753 0.068 0.064 0.000 0.000 0.864 0.004
#> SRR1321897 3 0.0291 0.896 0.000 0.000 0.992 0.000 0.004 0.004
#> SRR1445194 5 0.3189 0.725 0.184 0.000 0.000 0.000 0.796 0.020
#> SRR1443308 3 0.1555 0.866 0.000 0.000 0.932 0.060 0.004 0.004
#> SRR1400931 1 0.1398 0.827 0.940 0.000 0.000 0.000 0.008 0.052
#> SRR1416188 3 0.0291 0.896 0.000 0.000 0.992 0.000 0.004 0.004
#> SRR1407044 3 0.0717 0.893 0.000 0.000 0.976 0.000 0.008 0.016
#> SRR1078392 5 0.4517 0.678 0.156 0.000 0.104 0.000 0.728 0.012
#> SRR1436468 1 0.0363 0.845 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1476125 2 0.4128 0.708 0.124 0.768 0.000 0.000 0.012 0.096
#> SRR1418747 5 0.4735 0.511 0.000 0.000 0.296 0.000 0.628 0.076
#> SRR1318089 3 0.0717 0.894 0.000 0.000 0.976 0.000 0.016 0.008
#> SRR1444370 5 0.3215 0.667 0.240 0.000 0.000 0.000 0.756 0.004
#> SRR1348929 2 0.0000 0.979 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.4392 0.656 0.024 0.000 0.060 0.000 0.740 0.176
#> SRR1460337 1 0.2178 0.815 0.868 0.000 0.000 0.000 0.132 0.000
#> SRR1469062 3 0.1333 0.878 0.000 0.000 0.944 0.000 0.008 0.048
#> SRR1388459 3 0.5128 0.619 0.124 0.000 0.676 0.000 0.176 0.024
#> SRR1416841 3 0.2333 0.867 0.000 0.000 0.884 0.000 0.092 0.024
#> SRR1473778 1 0.1411 0.846 0.936 0.000 0.004 0.000 0.060 0.000
#> SRR1419561 5 0.3019 0.741 0.128 0.000 0.012 0.000 0.840 0.020
#> SRR1339987 5 0.2001 0.751 0.000 0.000 0.048 0.000 0.912 0.040
#> SRR1469662 5 0.2277 0.769 0.076 0.000 0.000 0.000 0.892 0.032
#> SRR1432958 1 0.1333 0.825 0.944 0.000 0.000 0.000 0.008 0.048
#> SRR1479198 5 0.1991 0.774 0.044 0.000 0.012 0.000 0.920 0.024
#> SRR1353600 1 0.1074 0.840 0.960 0.000 0.000 0.000 0.012 0.028
#> SRR1456492 3 0.0363 0.897 0.000 0.000 0.988 0.000 0.012 0.000
#> SRR1389955 5 0.3009 0.729 0.004 0.000 0.040 0.000 0.844 0.112
#> SRR1429540 1 0.0790 0.847 0.968 0.000 0.000 0.000 0.032 0.000
#> SRR1356057 4 0.6306 0.317 0.220 0.000 0.024 0.568 0.164 0.024
#> SRR1328715 1 0.3351 0.642 0.712 0.000 0.000 0.000 0.288 0.000
#> SRR1429429 3 0.2230 0.872 0.000 0.000 0.892 0.000 0.084 0.024
#> SRR1325201 2 0.0146 0.979 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1382978 3 0.2230 0.872 0.000 0.000 0.892 0.000 0.084 0.024
#> SRR1406348 2 0.0000 0.979 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0146 0.979 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1376380 3 0.0405 0.896 0.000 0.000 0.988 0.000 0.004 0.008
#> SRR1418225 4 0.0000 0.817 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0260 0.977 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR1376741 1 0.3531 0.572 0.672 0.000 0.000 0.000 0.328 0.000
#> SRR1431823 3 0.0622 0.894 0.000 0.000 0.980 0.000 0.008 0.012
#> SRR1447916 2 0.0146 0.978 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1458643 6 0.2860 0.995 0.000 0.000 0.000 0.100 0.048 0.852
#> SRR1445618 1 0.1327 0.846 0.936 0.000 0.000 0.000 0.064 0.000
#> SRR1081589 6 0.2812 0.995 0.000 0.000 0.000 0.096 0.048 0.856
#> SRR1097245 1 0.1398 0.822 0.940 0.000 0.000 0.000 0.008 0.052
#> SRR1416141 5 0.5019 0.199 0.072 0.000 0.000 0.000 0.500 0.428
#> SRR1404339 2 0.0000 0.979 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.0520 0.843 0.984 0.000 0.000 0.000 0.008 0.008
#> SRR1406135 5 0.3325 0.753 0.036 0.008 0.024 0.000 0.848 0.084
#> SRR1413307 4 0.0000 0.817 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.979 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.817 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 3 0.4419 0.314 0.384 0.000 0.584 0.000 0.032 0.000
#> SRR1100608 2 0.0291 0.976 0.000 0.992 0.000 0.000 0.004 0.004
#> SRR1386927 2 0.0260 0.977 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR1331771 3 0.0622 0.894 0.000 0.000 0.980 0.000 0.008 0.012
#> SRR1486322 3 0.2006 0.877 0.000 0.000 0.904 0.000 0.080 0.016
#> SRR1080790 5 0.3133 0.645 0.000 0.000 0.212 0.000 0.780 0.008
#> SRR1459980 1 0.4067 0.255 0.548 0.000 0.000 0.000 0.444 0.008
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.498 0.802 0.843 0.3757 0.658 0.658
#> 3 3 0.678 0.729 0.874 0.4288 0.878 0.815
#> 4 4 0.636 0.582 0.837 0.0721 0.954 0.915
#> 5 5 0.676 0.855 0.897 0.2026 0.754 0.521
#> 6 6 0.763 0.850 0.911 0.0306 0.997 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
#> SRR1433493 1 0.8661 0.797 0.712 0.288
#> SRR1405147 1 0.8661 0.797 0.712 0.288
#> SRR1315412 2 0.2236 0.960 0.036 0.964
#> SRR1338384 1 0.2948 0.777 0.948 0.052
#> SRR1071105 2 0.9998 0.254 0.492 0.508
#> SRR1432868 2 0.2236 0.960 0.036 0.964
#> SRR1454480 1 0.2236 0.744 0.964 0.036
#> SRR1330723 2 0.2236 0.960 0.036 0.964
#> SRR1475324 1 0.8661 0.797 0.712 0.288
#> SRR1340260 1 0.8661 0.797 0.712 0.288
#> SRR1376450 1 0.7056 0.531 0.808 0.192
#> SRR1321897 1 0.8661 0.797 0.712 0.288
#> SRR1445194 1 0.0000 0.769 1.000 0.000
#> SRR1443308 1 0.8713 0.794 0.708 0.292
#> SRR1400931 1 0.0000 0.769 1.000 0.000
#> SRR1416188 1 0.8661 0.797 0.712 0.288
#> SRR1407044 1 0.8661 0.797 0.712 0.288
#> SRR1078392 1 0.8386 0.797 0.732 0.268
#> SRR1436468 1 0.8661 0.797 0.712 0.288
#> SRR1476125 2 0.2236 0.960 0.036 0.964
#> SRR1418747 1 0.8555 0.797 0.720 0.280
#> SRR1318089 1 0.8661 0.797 0.712 0.288
#> SRR1444370 1 0.0000 0.769 1.000 0.000
#> SRR1348929 2 0.2236 0.960 0.036 0.964
#> SRR1385690 1 0.0000 0.769 1.000 0.000
#> SRR1460337 1 0.8661 0.447 0.712 0.288
#> SRR1469062 1 0.8499 0.797 0.724 0.276
#> SRR1388459 1 0.8661 0.797 0.712 0.288
#> SRR1416841 1 0.8661 0.797 0.712 0.288
#> SRR1473778 1 0.8661 0.797 0.712 0.288
#> SRR1419561 1 0.2948 0.777 0.948 0.052
#> SRR1339987 1 0.0376 0.770 0.996 0.004
#> SRR1469662 1 0.0000 0.769 1.000 0.000
#> SRR1432958 1 0.0000 0.769 1.000 0.000
#> SRR1479198 1 0.0000 0.769 1.000 0.000
#> SRR1353600 1 0.0000 0.769 1.000 0.000
#> SRR1456492 1 0.8608 0.797 0.716 0.284
#> SRR1389955 1 0.0000 0.769 1.000 0.000
#> SRR1429540 1 0.8661 0.797 0.712 0.288
#> SRR1356057 1 0.8661 0.797 0.712 0.288
#> SRR1328715 1 0.8661 0.797 0.712 0.288
#> SRR1429429 1 0.8661 0.797 0.712 0.288
#> SRR1325201 2 0.2236 0.960 0.036 0.964
#> SRR1382978 1 0.8661 0.797 0.712 0.288
#> SRR1406348 2 0.2236 0.960 0.036 0.964
#> SRR1469390 2 0.1633 0.952 0.024 0.976
#> SRR1376380 1 0.8661 0.797 0.712 0.288
#> SRR1418225 1 0.2236 0.744 0.964 0.036
#> SRR1418473 2 0.1633 0.952 0.024 0.976
#> SRR1376741 1 0.8661 0.797 0.712 0.288
#> SRR1431823 1 0.8661 0.797 0.712 0.288
#> SRR1447916 2 0.2236 0.960 0.036 0.964
#> SRR1458643 1 0.1633 0.752 0.976 0.024
#> SRR1445618 1 0.0000 0.769 1.000 0.000
#> SRR1081589 1 0.1633 0.752 0.976 0.024
#> SRR1097245 1 0.0000 0.769 1.000 0.000
#> SRR1416141 1 0.0000 0.769 1.000 0.000
#> SRR1404339 2 0.2236 0.960 0.036 0.964
#> SRR1478614 1 0.0000 0.769 1.000 0.000
#> SRR1406135 1 0.0000 0.769 1.000 0.000
#> SRR1413307 1 0.2236 0.744 0.964 0.036
#> SRR1397720 2 0.2236 0.960 0.036 0.964
#> SRR1358391 1 0.2236 0.744 0.964 0.036
#> SRR1381185 1 0.8661 0.797 0.712 0.288
#> SRR1100608 2 0.1633 0.952 0.024 0.976
#> SRR1386927 2 0.1633 0.952 0.024 0.976
#> SRR1331771 1 0.8661 0.797 0.712 0.288
#> SRR1486322 1 0.8661 0.797 0.712 0.288
#> SRR1080790 1 0.8386 0.797 0.732 0.268
#> SRR1459980 1 0.8661 0.797 0.712 0.288
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1405147 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1315412 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1338384 1 0.5465 0.6328 0.712 0.000 0.288
#> SRR1071105 2 0.9283 -0.0636 0.216 0.524 0.260
#> SRR1432868 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1454480 3 0.0000 0.8761 0.000 0.000 1.000
#> SRR1330723 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1475324 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1340260 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1376450 1 0.9521 0.1330 0.440 0.192 0.368
#> SRR1321897 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1445194 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1443308 1 0.6079 0.1531 0.612 0.000 0.388
#> SRR1400931 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1416188 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1407044 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1078392 1 0.1163 0.7820 0.972 0.000 0.028
#> SRR1436468 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1476125 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1418747 1 0.1289 0.7801 0.968 0.000 0.032
#> SRR1318089 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1444370 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1348929 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1385690 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1460337 1 0.9759 0.1076 0.444 0.284 0.272
#> SRR1469062 1 0.1411 0.7787 0.964 0.000 0.036
#> SRR1388459 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1416841 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1473778 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1419561 1 0.5465 0.6328 0.712 0.000 0.288
#> SRR1339987 1 0.5968 0.5716 0.636 0.000 0.364
#> SRR1469662 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1432958 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1479198 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1353600 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1456492 1 0.0747 0.7855 0.984 0.000 0.016
#> SRR1389955 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1429540 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1356057 1 0.3752 0.6389 0.856 0.000 0.144
#> SRR1328715 1 0.0592 0.7865 0.988 0.000 0.012
#> SRR1429429 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1325201 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1382978 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1406348 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1469390 2 0.0592 0.9460 0.000 0.988 0.012
#> SRR1376380 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1418225 3 0.0000 0.8761 0.000 0.000 1.000
#> SRR1418473 2 0.0592 0.9460 0.000 0.988 0.012
#> SRR1376741 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1431823 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1447916 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1458643 3 0.4452 0.7244 0.192 0.000 0.808
#> SRR1445618 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1081589 3 0.4452 0.7244 0.192 0.000 0.808
#> SRR1097245 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1416141 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1404339 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1478614 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1406135 1 0.5988 0.5681 0.632 0.000 0.368
#> SRR1413307 3 0.0000 0.8761 0.000 0.000 1.000
#> SRR1397720 2 0.0000 0.9508 0.000 1.000 0.000
#> SRR1358391 3 0.0000 0.8761 0.000 0.000 1.000
#> SRR1381185 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1100608 2 0.0592 0.9460 0.000 0.988 0.012
#> SRR1386927 2 0.0592 0.9460 0.000 0.988 0.012
#> SRR1331771 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1486322 1 0.0000 0.7886 1.000 0.000 0.000
#> SRR1080790 1 0.0892 0.7843 0.980 0.000 0.020
#> SRR1459980 1 0.0000 0.7886 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1405147 1 0.0188 0.7092 0.996 0.000 0.004 0.000
#> SRR1315412 2 0.1867 0.8536 0.000 0.928 0.072 0.000
#> SRR1338384 1 0.4522 0.3166 0.680 0.000 0.320 0.000
#> SRR1071105 3 0.7486 0.3859 0.188 0.348 0.464 0.000
#> SRR1432868 2 0.0000 0.8694 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0000 0.8540 0.000 0.000 0.000 1.000
#> SRR1330723 2 0.0000 0.8694 0.000 1.000 0.000 0.000
#> SRR1475324 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1340260 1 0.0188 0.7092 0.996 0.000 0.004 0.000
#> SRR1376450 3 0.5387 0.4922 0.400 0.016 0.584 0.000
#> SRR1321897 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1445194 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1443308 1 0.4817 0.0401 0.612 0.000 0.000 0.388
#> SRR1400931 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1416188 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1407044 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1078392 1 0.1151 0.6976 0.968 0.000 0.024 0.008
#> SRR1436468 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1476125 2 0.4730 0.6432 0.000 0.636 0.364 0.000
#> SRR1418747 1 0.1118 0.6919 0.964 0.000 0.036 0.000
#> SRR1318089 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1348929 2 0.0000 0.8694 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1460337 3 0.6915 0.5721 0.416 0.108 0.476 0.000
#> SRR1469062 1 0.1211 0.6892 0.960 0.000 0.040 0.000
#> SRR1388459 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1416841 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1473778 1 0.0707 0.7039 0.980 0.000 0.020 0.000
#> SRR1419561 1 0.4522 0.3166 0.680 0.000 0.320 0.000
#> SRR1339987 1 0.4866 0.1623 0.596 0.000 0.404 0.000
#> SRR1469662 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1432958 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1479198 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1353600 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1456492 1 0.0779 0.7033 0.980 0.000 0.016 0.004
#> SRR1389955 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1429540 1 0.0469 0.7071 0.988 0.000 0.012 0.000
#> SRR1356057 1 0.2973 0.4947 0.856 0.000 0.000 0.144
#> SRR1328715 1 0.0592 0.7054 0.984 0.000 0.016 0.000
#> SRR1429429 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1325201 2 0.4866 0.6382 0.000 0.596 0.404 0.000
#> SRR1382978 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.0000 0.8694 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.3873 0.7926 0.000 0.772 0.228 0.000
#> SRR1376380 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1418225 4 0.0000 0.8540 0.000 0.000 0.000 1.000
#> SRR1418473 2 0.3873 0.7926 0.000 0.772 0.228 0.000
#> SRR1376741 1 0.0188 0.7092 0.996 0.000 0.004 0.000
#> SRR1431823 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1447916 2 0.0000 0.8694 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.3528 0.6666 0.192 0.000 0.000 0.808
#> SRR1445618 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1081589 4 0.3528 0.6666 0.192 0.000 0.000 0.808
#> SRR1097245 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1416141 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1404339 2 0.0000 0.8694 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1406135 1 0.4877 0.1550 0.592 0.000 0.408 0.000
#> SRR1413307 4 0.0000 0.8540 0.000 0.000 0.000 1.000
#> SRR1397720 2 0.0000 0.8694 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0000 0.8540 0.000 0.000 0.000 1.000
#> SRR1381185 1 0.0188 0.7092 0.996 0.000 0.004 0.000
#> SRR1100608 2 0.4989 0.6494 0.000 0.528 0.472 0.000
#> SRR1386927 2 0.3873 0.7926 0.000 0.772 0.228 0.000
#> SRR1331771 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1486322 1 0.0000 0.7092 1.000 0.000 0.000 0.000
#> SRR1080790 1 0.0707 0.7023 0.980 0.000 0.020 0.000
#> SRR1459980 1 0.0188 0.7092 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
#> SRR1433493 3 0.0162 0.951794 0.004 0.000 0.996 0.000 0.000
#> SRR1405147 3 0.0880 0.940801 0.032 0.000 0.968 0.000 0.000
#> SRR1315412 2 0.1608 0.867134 0.000 0.928 0.000 0.000 0.072
#> SRR1338384 1 0.3366 0.811106 0.768 0.000 0.232 0.000 0.000
#> SRR1071105 1 0.6760 0.000488 0.480 0.244 0.008 0.000 0.268
#> SRR1432868 2 0.0000 0.902180 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.868306 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 2 0.0000 0.902180 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1340260 3 0.0880 0.940801 0.032 0.000 0.968 0.000 0.000
#> SRR1376450 1 0.5080 0.719610 0.708 0.004 0.112 0.000 0.176
#> SRR1321897 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1445194 1 0.2648 0.869663 0.848 0.000 0.152 0.000 0.000
#> SRR1443308 3 0.4576 0.374875 0.016 0.000 0.608 0.376 0.000
#> SRR1400931 1 0.2127 0.863578 0.892 0.000 0.108 0.000 0.000
#> SRR1416188 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1078392 3 0.1121 0.937412 0.044 0.000 0.956 0.000 0.000
#> SRR1436468 3 0.0162 0.951794 0.004 0.000 0.996 0.000 0.000
#> SRR1476125 5 0.3628 0.820506 0.012 0.216 0.000 0.000 0.772
#> SRR1418747 3 0.1197 0.925369 0.048 0.000 0.952 0.000 0.000
#> SRR1318089 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.2690 0.869239 0.844 0.000 0.156 0.000 0.000
#> SRR1348929 2 0.0000 0.902180 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.3177 0.852232 0.792 0.000 0.208 0.000 0.000
#> SRR1460337 1 0.5869 0.580558 0.600 0.004 0.128 0.000 0.268
#> SRR1469062 3 0.1197 0.923136 0.048 0.000 0.952 0.000 0.000
#> SRR1388459 3 0.0162 0.951794 0.004 0.000 0.996 0.000 0.000
#> SRR1416841 3 0.0162 0.951794 0.004 0.000 0.996 0.000 0.000
#> SRR1473778 3 0.3039 0.730733 0.192 0.000 0.808 0.000 0.000
#> SRR1419561 1 0.3816 0.742161 0.696 0.000 0.304 0.000 0.000
#> SRR1339987 1 0.3210 0.850043 0.788 0.000 0.212 0.000 0.000
#> SRR1469662 1 0.3177 0.852232 0.792 0.000 0.208 0.000 0.000
#> SRR1432958 1 0.2127 0.863578 0.892 0.000 0.108 0.000 0.000
#> SRR1479198 1 0.3336 0.839492 0.772 0.000 0.228 0.000 0.000
#> SRR1353600 1 0.1908 0.850591 0.908 0.000 0.092 0.000 0.000
#> SRR1456492 3 0.0609 0.946200 0.020 0.000 0.980 0.000 0.000
#> SRR1389955 1 0.3336 0.839492 0.772 0.000 0.228 0.000 0.000
#> SRR1429540 3 0.1792 0.893545 0.084 0.000 0.916 0.000 0.000
#> SRR1356057 3 0.3106 0.796216 0.024 0.000 0.844 0.132 0.000
#> SRR1328715 3 0.1341 0.923665 0.056 0.000 0.944 0.000 0.000
#> SRR1429429 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1325201 5 0.3242 0.838916 0.000 0.216 0.000 0.000 0.784
#> SRR1382978 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1406348 2 0.0000 0.902180 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.3336 0.759867 0.000 0.772 0.000 0.000 0.228
#> SRR1376380 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1418225 4 0.0963 0.858377 0.036 0.000 0.000 0.964 0.000
#> SRR1418473 2 0.3336 0.759867 0.000 0.772 0.000 0.000 0.228
#> SRR1376741 3 0.0880 0.940801 0.032 0.000 0.968 0.000 0.000
#> SRR1431823 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1447916 2 0.0000 0.902180 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.4162 0.742387 0.176 0.000 0.056 0.768 0.000
#> SRR1445618 1 0.2179 0.864928 0.888 0.000 0.112 0.000 0.000
#> SRR1081589 4 0.4162 0.742387 0.176 0.000 0.056 0.768 0.000
#> SRR1097245 1 0.1908 0.850591 0.908 0.000 0.092 0.000 0.000
#> SRR1416141 1 0.2127 0.863578 0.892 0.000 0.108 0.000 0.000
#> SRR1404339 2 0.0000 0.902180 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.2074 0.860726 0.896 0.000 0.104 0.000 0.000
#> SRR1406135 1 0.2516 0.869286 0.860 0.000 0.140 0.000 0.000
#> SRR1413307 4 0.0000 0.868306 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.902180 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.868306 0.000 0.000 0.000 1.000 0.000
#> SRR1381185 3 0.0290 0.950857 0.008 0.000 0.992 0.000 0.000
#> SRR1100608 5 0.2648 0.704376 0.000 0.152 0.000 0.000 0.848
#> SRR1386927 2 0.3336 0.759867 0.000 0.772 0.000 0.000 0.228
#> SRR1331771 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1486322 3 0.0000 0.952079 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 3 0.1410 0.912030 0.060 0.000 0.940 0.000 0.000
#> SRR1459980 3 0.0609 0.946778 0.020 0.000 0.980 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0146 0.9481 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR1405147 3 0.0790 0.9378 0.032 0.000 0.968 0.000 0.000 0.000
#> SRR1315412 2 0.1444 0.8669 0.000 0.928 0.000 0.000 0.000 0.072
#> SRR1338384 1 0.2527 0.7704 0.832 0.000 0.168 0.000 0.000 0.000
#> SRR1071105 1 0.6159 0.0675 0.476 0.244 0.000 0.000 0.012 0.268
#> SRR1432868 2 0.0000 0.9020 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.9616 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 2 0.0000 0.9020 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1475324 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1340260 3 0.1075 0.9303 0.048 0.000 0.952 0.000 0.000 0.000
#> SRR1376450 1 0.4336 0.6925 0.744 0.004 0.064 0.000 0.012 0.176
#> SRR1321897 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1445194 1 0.1814 0.8289 0.900 0.000 0.100 0.000 0.000 0.000
#> SRR1443308 3 0.4627 0.3667 0.004 0.000 0.592 0.364 0.040 0.000
#> SRR1400931 1 0.0547 0.8108 0.980 0.000 0.020 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1407044 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1078392 3 0.1124 0.9342 0.036 0.000 0.956 0.000 0.008 0.000
#> SRR1436468 3 0.0146 0.9481 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR1476125 6 0.3586 0.7704 0.000 0.216 0.000 0.000 0.028 0.756
#> SRR1418747 3 0.1075 0.9238 0.048 0.000 0.952 0.000 0.000 0.000
#> SRR1318089 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.1814 0.8287 0.900 0.000 0.100 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.9020 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 1 0.2491 0.8052 0.836 0.000 0.164 0.000 0.000 0.000
#> SRR1460337 1 0.5123 0.5540 0.636 0.004 0.080 0.000 0.012 0.268
#> SRR1469062 3 0.1075 0.9217 0.048 0.000 0.952 0.000 0.000 0.000
#> SRR1388459 3 0.0146 0.9481 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR1416841 3 0.0146 0.9481 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR1473778 3 0.3023 0.6836 0.232 0.000 0.768 0.000 0.000 0.000
#> SRR1419561 1 0.3151 0.6893 0.748 0.000 0.252 0.000 0.000 0.000
#> SRR1339987 1 0.2527 0.8026 0.832 0.000 0.168 0.000 0.000 0.000
#> SRR1469662 1 0.2454 0.8074 0.840 0.000 0.160 0.000 0.000 0.000
#> SRR1432958 1 0.0632 0.8139 0.976 0.000 0.024 0.000 0.000 0.000
#> SRR1479198 1 0.2762 0.7794 0.804 0.000 0.196 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.7895 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1456492 3 0.0603 0.9429 0.016 0.000 0.980 0.000 0.004 0.000
#> SRR1389955 1 0.2762 0.7794 0.804 0.000 0.196 0.000 0.000 0.000
#> SRR1429540 3 0.1714 0.8871 0.092 0.000 0.908 0.000 0.000 0.000
#> SRR1356057 3 0.3307 0.7825 0.012 0.000 0.828 0.120 0.040 0.000
#> SRR1328715 3 0.1556 0.9015 0.080 0.000 0.920 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1325201 6 0.2912 0.8007 0.000 0.216 0.000 0.000 0.000 0.784
#> SRR1382978 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.0000 0.9020 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.2996 0.7593 0.000 0.772 0.000 0.000 0.000 0.228
#> SRR1376380 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1418225 4 0.2003 0.8794 0.000 0.000 0.000 0.884 0.116 0.000
#> SRR1418473 2 0.2996 0.7593 0.000 0.772 0.000 0.000 0.000 0.228
#> SRR1376741 3 0.0790 0.9378 0.032 0.000 0.968 0.000 0.000 0.000
#> SRR1431823 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1447916 2 0.0000 0.9020 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 5 0.3073 1.0000 0.152 0.000 0.008 0.016 0.824 0.000
#> SRR1445618 1 0.0865 0.8193 0.964 0.000 0.036 0.000 0.000 0.000
#> SRR1081589 5 0.3073 1.0000 0.152 0.000 0.008 0.016 0.824 0.000
#> SRR1097245 1 0.0000 0.7895 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.0632 0.8139 0.976 0.000 0.024 0.000 0.000 0.000
#> SRR1404339 2 0.0000 0.9020 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.0458 0.8071 0.984 0.000 0.016 0.000 0.000 0.000
#> SRR1406135 1 0.1501 0.8282 0.924 0.000 0.076 0.000 0.000 0.000
#> SRR1413307 4 0.0000 0.9616 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.9020 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.9616 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 3 0.0260 0.9472 0.008 0.000 0.992 0.000 0.000 0.000
#> SRR1100608 6 0.2378 0.6476 0.000 0.152 0.000 0.000 0.000 0.848
#> SRR1386927 2 0.2996 0.7593 0.000 0.772 0.000 0.000 0.000 0.228
#> SRR1331771 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1486322 3 0.0000 0.9483 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 3 0.1267 0.9117 0.060 0.000 0.940 0.000 0.000 0.000
#> SRR1459980 3 0.0547 0.9435 0.020 0.000 0.980 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["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 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.992 0.993 0.3451 0.658 0.658
#> 3 3 0.667 0.793 0.841 0.7065 0.687 0.525
#> 4 4 0.793 0.875 0.912 0.1836 0.854 0.626
#> 5 5 0.697 0.623 0.803 0.0920 0.970 0.897
#> 6 6 0.693 0.601 0.751 0.0632 0.875 0.553
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
#> SRR1433493 1 0.1184 0.991 0.984 0.016
#> SRR1405147 1 0.1184 0.991 0.984 0.016
#> SRR1315412 2 0.0000 0.997 0.000 1.000
#> SRR1338384 1 0.0000 0.992 1.000 0.000
#> SRR1071105 2 0.0000 0.997 0.000 1.000
#> SRR1432868 2 0.0000 0.997 0.000 1.000
#> SRR1454480 1 0.0000 0.992 1.000 0.000
#> SRR1330723 2 0.0000 0.997 0.000 1.000
#> SRR1475324 1 0.1184 0.991 0.984 0.016
#> SRR1340260 1 0.1184 0.991 0.984 0.016
#> SRR1376450 1 0.0000 0.992 1.000 0.000
#> SRR1321897 1 0.1184 0.991 0.984 0.016
#> SRR1445194 1 0.0000 0.992 1.000 0.000
#> SRR1443308 1 0.1184 0.991 0.984 0.016
#> SRR1400931 1 0.0000 0.992 1.000 0.000
#> SRR1416188 1 0.1184 0.991 0.984 0.016
#> SRR1407044 1 0.0672 0.992 0.992 0.008
#> SRR1078392 1 0.0000 0.992 1.000 0.000
#> SRR1436468 1 0.1184 0.991 0.984 0.016
#> SRR1476125 2 0.1184 0.986 0.016 0.984
#> SRR1418747 1 0.0000 0.992 1.000 0.000
#> SRR1318089 1 0.1184 0.991 0.984 0.016
#> SRR1444370 1 0.0000 0.992 1.000 0.000
#> SRR1348929 2 0.0000 0.997 0.000 1.000
#> SRR1385690 1 0.0000 0.992 1.000 0.000
#> SRR1460337 1 0.0000 0.992 1.000 0.000
#> SRR1469062 1 0.0000 0.992 1.000 0.000
#> SRR1388459 1 0.1184 0.991 0.984 0.016
#> SRR1416841 1 0.1184 0.991 0.984 0.016
#> SRR1473778 1 0.1184 0.991 0.984 0.016
#> SRR1419561 1 0.0000 0.992 1.000 0.000
#> SRR1339987 1 0.0000 0.992 1.000 0.000
#> SRR1469662 1 0.0000 0.992 1.000 0.000
#> SRR1432958 1 0.0000 0.992 1.000 0.000
#> SRR1479198 1 0.0000 0.992 1.000 0.000
#> SRR1353600 1 0.0000 0.992 1.000 0.000
#> SRR1456492 1 0.1184 0.991 0.984 0.016
#> SRR1389955 1 0.0000 0.992 1.000 0.000
#> SRR1429540 1 0.1184 0.991 0.984 0.016
#> SRR1356057 1 0.1184 0.991 0.984 0.016
#> SRR1328715 1 0.0000 0.992 1.000 0.000
#> SRR1429429 1 0.1184 0.991 0.984 0.016
#> SRR1325201 2 0.1184 0.986 0.016 0.984
#> SRR1382978 1 0.1184 0.991 0.984 0.016
#> SRR1406348 2 0.0000 0.997 0.000 1.000
#> SRR1469390 2 0.0000 0.997 0.000 1.000
#> SRR1376380 1 0.1184 0.991 0.984 0.016
#> SRR1418225 1 0.0938 0.985 0.988 0.012
#> SRR1418473 2 0.0000 0.997 0.000 1.000
#> SRR1376741 1 0.1184 0.991 0.984 0.016
#> SRR1431823 1 0.1184 0.991 0.984 0.016
#> SRR1447916 2 0.0000 0.997 0.000 1.000
#> SRR1458643 1 0.0376 0.990 0.996 0.004
#> SRR1445618 1 0.0000 0.992 1.000 0.000
#> SRR1081589 1 0.0376 0.990 0.996 0.004
#> SRR1097245 1 0.0000 0.992 1.000 0.000
#> SRR1416141 1 0.0000 0.992 1.000 0.000
#> SRR1404339 2 0.0000 0.997 0.000 1.000
#> SRR1478614 1 0.0000 0.992 1.000 0.000
#> SRR1406135 1 0.0000 0.992 1.000 0.000
#> SRR1413307 1 0.0376 0.990 0.996 0.004
#> SRR1397720 2 0.0000 0.997 0.000 1.000
#> SRR1358391 1 0.0000 0.992 1.000 0.000
#> SRR1381185 1 0.1184 0.991 0.984 0.016
#> SRR1100608 2 0.1184 0.986 0.016 0.984
#> SRR1386927 2 0.0000 0.997 0.000 1.000
#> SRR1331771 1 0.1184 0.991 0.984 0.016
#> SRR1486322 1 0.1184 0.991 0.984 0.016
#> SRR1080790 1 0.0672 0.992 0.992 0.008
#> SRR1459980 1 0.1184 0.991 0.984 0.016
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.6244 0.953 0.440 0 0.560
#> SRR1405147 3 0.6302 0.914 0.480 0 0.520
#> SRR1315412 2 0.0000 1.000 0.000 1 0.000
#> SRR1338384 1 0.1860 0.625 0.948 0 0.052
#> SRR1071105 2 0.0000 1.000 0.000 1 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1 0.000
#> SRR1454480 1 0.6302 0.522 0.520 0 0.480
#> SRR1330723 2 0.0000 1.000 0.000 1 0.000
#> SRR1475324 3 0.6244 0.953 0.440 0 0.560
#> SRR1340260 3 0.6302 0.914 0.480 0 0.520
#> SRR1376450 1 0.0000 0.698 1.000 0 0.000
#> SRR1321897 3 0.6244 0.953 0.440 0 0.560
#> SRR1445194 1 0.0000 0.698 1.000 0 0.000
#> SRR1443308 3 0.4399 0.488 0.188 0 0.812
#> SRR1400931 1 0.0000 0.698 1.000 0 0.000
#> SRR1416188 3 0.6244 0.953 0.440 0 0.560
#> SRR1407044 3 0.6244 0.953 0.440 0 0.560
#> SRR1078392 1 0.5529 -0.207 0.704 0 0.296
#> SRR1436468 3 0.6267 0.944 0.452 0 0.548
#> SRR1476125 2 0.0000 1.000 0.000 1 0.000
#> SRR1418747 3 0.6252 0.950 0.444 0 0.556
#> SRR1318089 3 0.6244 0.953 0.440 0 0.560
#> SRR1444370 1 0.0000 0.698 1.000 0 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1 0.000
#> SRR1385690 1 0.0747 0.686 0.984 0 0.016
#> SRR1460337 1 0.0000 0.698 1.000 0 0.000
#> SRR1469062 1 0.5678 -0.293 0.684 0 0.316
#> SRR1388459 3 0.6252 0.950 0.444 0 0.556
#> SRR1416841 3 0.6244 0.953 0.440 0 0.560
#> SRR1473778 3 0.6302 0.914 0.480 0 0.520
#> SRR1419561 1 0.0000 0.698 1.000 0 0.000
#> SRR1339987 1 0.3340 0.521 0.880 0 0.120
#> SRR1469662 1 0.0000 0.698 1.000 0 0.000
#> SRR1432958 1 0.0000 0.698 1.000 0 0.000
#> SRR1479198 1 0.3038 0.530 0.896 0 0.104
#> SRR1353600 1 0.5810 0.585 0.664 0 0.336
#> SRR1456492 3 0.6244 0.953 0.440 0 0.560
#> SRR1389955 1 0.3192 0.533 0.888 0 0.112
#> SRR1429540 3 0.6302 0.914 0.480 0 0.520
#> SRR1356057 3 0.5216 0.630 0.260 0 0.740
#> SRR1328715 1 0.0000 0.698 1.000 0 0.000
#> SRR1429429 3 0.6244 0.953 0.440 0 0.560
#> SRR1325201 2 0.0000 1.000 0.000 1 0.000
#> SRR1382978 3 0.6244 0.953 0.440 0 0.560
#> SRR1406348 2 0.0000 1.000 0.000 1 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1 0.000
#> SRR1376380 3 0.6244 0.953 0.440 0 0.560
#> SRR1418225 1 0.6302 0.522 0.520 0 0.480
#> SRR1418473 2 0.0000 1.000 0.000 1 0.000
#> SRR1376741 3 0.6302 0.914 0.480 0 0.520
#> SRR1431823 3 0.6244 0.953 0.440 0 0.560
#> SRR1447916 2 0.0000 1.000 0.000 1 0.000
#> SRR1458643 1 0.6302 0.522 0.520 0 0.480
#> SRR1445618 1 0.0000 0.698 1.000 0 0.000
#> SRR1081589 1 0.6225 0.558 0.568 0 0.432
#> SRR1097245 1 0.5810 0.585 0.664 0 0.336
#> SRR1416141 1 0.2959 0.665 0.900 0 0.100
#> SRR1404339 2 0.0000 1.000 0.000 1 0.000
#> SRR1478614 1 0.0000 0.698 1.000 0 0.000
#> SRR1406135 1 0.0000 0.698 1.000 0 0.000
#> SRR1413307 1 0.6302 0.522 0.520 0 0.480
#> SRR1397720 2 0.0000 1.000 0.000 1 0.000
#> SRR1358391 1 0.6302 0.522 0.520 0 0.480
#> SRR1381185 3 0.6244 0.953 0.440 0 0.560
#> SRR1100608 2 0.0000 1.000 0.000 1 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1 0.000
#> SRR1331771 3 0.6244 0.953 0.440 0 0.560
#> SRR1486322 3 0.6244 0.953 0.440 0 0.560
#> SRR1080790 3 0.6244 0.953 0.440 0 0.560
#> SRR1459980 3 0.6274 0.940 0.456 0 0.544
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.926 0.000 0.000 1.000 0.000
#> SRR1405147 3 0.0707 0.917 0.020 0.000 0.980 0.000
#> SRR1315412 2 0.1305 0.952 0.036 0.960 0.000 0.004
#> SRR1338384 1 0.1940 0.889 0.924 0.000 0.076 0.000
#> SRR1071105 2 0.4282 0.813 0.124 0.816 0.000 0.060
#> SRR1432868 2 0.0000 0.958 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.2281 0.961 0.096 0.000 0.000 0.904
#> SRR1330723 2 0.1356 0.952 0.008 0.960 0.000 0.032
#> SRR1475324 3 0.0000 0.926 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.4564 0.631 0.672 0.000 0.328 0.000
#> SRR1376450 1 0.1716 0.891 0.936 0.000 0.064 0.000
#> SRR1321897 3 0.0921 0.926 0.000 0.000 0.972 0.028
#> SRR1445194 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1443308 3 0.4428 0.652 0.004 0.000 0.720 0.276
#> SRR1400931 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1416188 3 0.0921 0.926 0.000 0.000 0.972 0.028
#> SRR1407044 3 0.0921 0.926 0.000 0.000 0.972 0.028
#> SRR1078392 3 0.5149 0.425 0.336 0.000 0.648 0.016
#> SRR1436468 3 0.0336 0.923 0.008 0.000 0.992 0.000
#> SRR1476125 2 0.2222 0.938 0.016 0.924 0.000 0.060
#> SRR1418747 3 0.4238 0.743 0.176 0.000 0.796 0.028
#> SRR1318089 3 0.0707 0.926 0.000 0.000 0.980 0.020
#> SRR1444370 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1348929 2 0.0000 0.958 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1460337 1 0.1716 0.891 0.936 0.000 0.064 0.000
#> SRR1469062 3 0.4323 0.732 0.184 0.000 0.788 0.028
#> SRR1388459 3 0.0000 0.926 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.926 0.000 0.000 1.000 0.000
#> SRR1473778 3 0.3123 0.769 0.156 0.000 0.844 0.000
#> SRR1419561 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1339987 1 0.4897 0.599 0.660 0.000 0.332 0.008
#> SRR1469662 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1432958 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1479198 1 0.4049 0.761 0.780 0.000 0.212 0.008
#> SRR1353600 1 0.2329 0.808 0.916 0.000 0.012 0.072
#> SRR1456492 3 0.0817 0.926 0.000 0.000 0.976 0.024
#> SRR1389955 1 0.4328 0.726 0.748 0.000 0.244 0.008
#> SRR1429540 1 0.4713 0.570 0.640 0.000 0.360 0.000
#> SRR1356057 3 0.4541 0.749 0.060 0.000 0.796 0.144
#> SRR1328715 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1429429 3 0.0000 0.926 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.2222 0.938 0.016 0.924 0.000 0.060
#> SRR1382978 3 0.0000 0.926 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0188 0.958 0.000 0.996 0.000 0.004
#> SRR1469390 2 0.1305 0.952 0.036 0.960 0.000 0.004
#> SRR1376380 3 0.0921 0.926 0.000 0.000 0.972 0.028
#> SRR1418225 4 0.2281 0.961 0.096 0.000 0.000 0.904
#> SRR1418473 2 0.1305 0.952 0.036 0.960 0.000 0.004
#> SRR1376741 1 0.4564 0.631 0.672 0.000 0.328 0.000
#> SRR1431823 3 0.0921 0.926 0.000 0.000 0.972 0.028
#> SRR1447916 2 0.0188 0.958 0.000 0.996 0.000 0.004
#> SRR1458643 4 0.3219 0.926 0.164 0.000 0.000 0.836
#> SRR1445618 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1081589 4 0.3791 0.889 0.200 0.000 0.004 0.796
#> SRR1097245 1 0.2329 0.808 0.916 0.000 0.012 0.072
#> SRR1416141 1 0.1824 0.886 0.936 0.000 0.060 0.004
#> SRR1404339 2 0.1356 0.952 0.008 0.960 0.000 0.032
#> SRR1478614 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1406135 1 0.1792 0.894 0.932 0.000 0.068 0.000
#> SRR1413307 4 0.2281 0.961 0.096 0.000 0.000 0.904
#> SRR1397720 2 0.0000 0.958 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.2281 0.961 0.096 0.000 0.000 0.904
#> SRR1381185 3 0.0000 0.926 0.000 0.000 1.000 0.000
#> SRR1100608 2 0.3164 0.934 0.052 0.884 0.000 0.064
#> SRR1386927 2 0.1305 0.952 0.036 0.960 0.000 0.004
#> SRR1331771 3 0.0921 0.926 0.000 0.000 0.972 0.028
#> SRR1486322 3 0.0921 0.926 0.000 0.000 0.972 0.028
#> SRR1080790 3 0.0921 0.926 0.000 0.000 0.972 0.028
#> SRR1459980 3 0.0336 0.923 0.008 0.000 0.992 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.1270 0.69597 0.000 0.000 0.948 0.000 0.052
#> SRR1405147 3 0.5002 0.40181 0.044 0.000 0.612 0.000 0.344
#> SRR1315412 2 0.2660 0.87963 0.008 0.864 0.000 0.000 0.128
#> SRR1338384 1 0.1579 0.73071 0.944 0.000 0.024 0.000 0.032
#> SRR1071105 2 0.3966 0.82373 0.036 0.784 0.000 0.004 0.176
#> SRR1432868 2 0.0000 0.90896 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0162 0.94186 0.004 0.000 0.000 0.996 0.000
#> SRR1330723 2 0.1341 0.90171 0.000 0.944 0.000 0.000 0.056
#> SRR1475324 3 0.1197 0.69621 0.000 0.000 0.952 0.000 0.048
#> SRR1340260 1 0.5566 0.28518 0.580 0.000 0.088 0.000 0.332
#> SRR1376450 1 0.3940 0.65654 0.756 0.000 0.024 0.000 0.220
#> SRR1321897 3 0.1197 0.68607 0.000 0.000 0.952 0.000 0.048
#> SRR1445194 1 0.3745 0.67051 0.780 0.000 0.024 0.000 0.196
#> SRR1443308 3 0.5379 0.39976 0.000 0.000 0.636 0.268 0.096
#> SRR1400931 1 0.0992 0.72729 0.968 0.000 0.024 0.000 0.008
#> SRR1416188 3 0.0404 0.68972 0.000 0.000 0.988 0.000 0.012
#> SRR1407044 3 0.3177 0.49499 0.000 0.000 0.792 0.000 0.208
#> SRR1078392 5 0.5888 0.57808 0.124 0.000 0.316 0.000 0.560
#> SRR1436468 3 0.4642 0.49438 0.032 0.000 0.660 0.000 0.308
#> SRR1476125 2 0.3575 0.84521 0.016 0.800 0.000 0.004 0.180
#> SRR1418747 3 0.6032 -0.55564 0.116 0.000 0.460 0.000 0.424
#> SRR1318089 3 0.0290 0.69275 0.000 0.000 0.992 0.000 0.008
#> SRR1444370 1 0.1310 0.73012 0.956 0.000 0.024 0.000 0.020
#> SRR1348929 2 0.0000 0.90896 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.4592 0.54529 0.644 0.000 0.024 0.000 0.332
#> SRR1460337 1 0.2362 0.72575 0.900 0.000 0.024 0.000 0.076
#> SRR1469062 5 0.5814 0.41199 0.092 0.000 0.436 0.000 0.472
#> SRR1388459 3 0.3366 0.59634 0.000 0.000 0.768 0.000 0.232
#> SRR1416841 3 0.1341 0.69618 0.000 0.000 0.944 0.000 0.056
#> SRR1473778 3 0.6362 0.07417 0.184 0.000 0.496 0.000 0.320
#> SRR1419561 1 0.4243 0.62864 0.712 0.000 0.024 0.000 0.264
#> SRR1339987 5 0.6519 0.24552 0.368 0.000 0.196 0.000 0.436
#> SRR1469662 1 0.4268 0.61011 0.708 0.000 0.024 0.000 0.268
#> SRR1432958 1 0.0992 0.72794 0.968 0.000 0.024 0.000 0.008
#> SRR1479198 1 0.6169 -0.10755 0.472 0.000 0.136 0.000 0.392
#> SRR1353600 1 0.2312 0.70104 0.912 0.000 0.012 0.016 0.060
#> SRR1456492 3 0.3305 0.57893 0.000 0.000 0.776 0.000 0.224
#> SRR1389955 1 0.6362 -0.16126 0.464 0.000 0.168 0.000 0.368
#> SRR1429540 1 0.5820 0.23809 0.572 0.000 0.120 0.000 0.308
#> SRR1356057 3 0.6217 0.30005 0.024 0.000 0.516 0.080 0.380
#> SRR1328715 1 0.4219 0.59352 0.716 0.000 0.024 0.000 0.260
#> SRR1429429 3 0.1341 0.69478 0.000 0.000 0.944 0.000 0.056
#> SRR1325201 2 0.3360 0.85420 0.012 0.816 0.000 0.004 0.168
#> SRR1382978 3 0.1197 0.69621 0.000 0.000 0.952 0.000 0.048
#> SRR1406348 2 0.0000 0.90896 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.2660 0.87963 0.008 0.864 0.000 0.000 0.128
#> SRR1376380 3 0.1544 0.68354 0.000 0.000 0.932 0.000 0.068
#> SRR1418225 4 0.0162 0.94186 0.004 0.000 0.000 0.996 0.000
#> SRR1418473 2 0.2660 0.87963 0.008 0.864 0.000 0.000 0.128
#> SRR1376741 1 0.5775 0.12146 0.472 0.000 0.088 0.000 0.440
#> SRR1431823 3 0.1544 0.68354 0.000 0.000 0.932 0.000 0.068
#> SRR1447916 2 0.0290 0.90867 0.000 0.992 0.000 0.000 0.008
#> SRR1458643 4 0.3276 0.87844 0.032 0.000 0.000 0.836 0.132
#> SRR1445618 1 0.0865 0.72883 0.972 0.000 0.024 0.000 0.004
#> SRR1081589 4 0.3849 0.85596 0.052 0.000 0.004 0.808 0.136
#> SRR1097245 1 0.2243 0.70145 0.916 0.000 0.012 0.016 0.056
#> SRR1416141 1 0.1211 0.73108 0.960 0.000 0.024 0.000 0.016
#> SRR1404339 2 0.1341 0.90171 0.000 0.944 0.000 0.000 0.056
#> SRR1478614 1 0.0992 0.72729 0.968 0.000 0.024 0.000 0.008
#> SRR1406135 1 0.4000 0.64044 0.748 0.000 0.024 0.000 0.228
#> SRR1413307 4 0.0162 0.94186 0.004 0.000 0.000 0.996 0.000
#> SRR1397720 2 0.0000 0.90896 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0162 0.94186 0.004 0.000 0.000 0.996 0.000
#> SRR1381185 3 0.3730 0.56829 0.000 0.000 0.712 0.000 0.288
#> SRR1100608 2 0.3884 0.83442 0.000 0.708 0.000 0.004 0.288
#> SRR1386927 2 0.2660 0.87963 0.008 0.864 0.000 0.000 0.128
#> SRR1331771 3 0.1544 0.68354 0.000 0.000 0.932 0.000 0.068
#> SRR1486322 3 0.0510 0.68836 0.000 0.000 0.984 0.000 0.016
#> SRR1080790 3 0.4321 0.07612 0.004 0.000 0.600 0.000 0.396
#> SRR1459980 3 0.4906 0.00396 0.024 0.000 0.496 0.000 0.480
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.1714 0.73149 0.000 0.000 0.908 0.000 0.000 0.092
#> SRR1405147 6 0.6584 0.57120 0.072 0.000 0.308 0.000 0.140 0.480
#> SRR1315412 2 0.3201 0.81052 0.000 0.780 0.000 0.000 0.012 0.208
#> SRR1338384 1 0.1549 0.71904 0.936 0.000 0.000 0.000 0.044 0.020
#> SRR1071105 2 0.4784 0.76185 0.028 0.720 0.000 0.000 0.112 0.140
#> SRR1432868 2 0.0000 0.86266 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.90967 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 2 0.1789 0.85266 0.000 0.924 0.000 0.000 0.032 0.044
#> SRR1475324 3 0.1610 0.73519 0.000 0.000 0.916 0.000 0.000 0.084
#> SRR1340260 6 0.6076 0.47190 0.388 0.000 0.028 0.000 0.128 0.456
#> SRR1376450 1 0.4513 -0.00807 0.528 0.000 0.000 0.000 0.440 0.032
#> SRR1321897 3 0.2263 0.73665 0.000 0.000 0.896 0.000 0.056 0.048
#> SRR1445194 1 0.4504 0.01588 0.536 0.000 0.000 0.000 0.432 0.032
#> SRR1443308 3 0.6321 0.42277 0.000 0.000 0.540 0.264 0.124 0.072
#> SRR1400931 1 0.0000 0.73317 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.0508 0.75188 0.000 0.000 0.984 0.000 0.012 0.004
#> SRR1407044 3 0.4348 0.53726 0.000 0.000 0.688 0.000 0.248 0.064
#> SRR1078392 5 0.5151 0.42490 0.032 0.000 0.128 0.000 0.684 0.156
#> SRR1436468 6 0.5781 0.45189 0.028 0.000 0.332 0.000 0.104 0.536
#> SRR1476125 2 0.4390 0.77544 0.000 0.720 0.000 0.000 0.148 0.132
#> SRR1418747 5 0.5796 0.33514 0.024 0.000 0.292 0.000 0.556 0.128
#> SRR1318089 3 0.0632 0.74835 0.000 0.000 0.976 0.000 0.000 0.024
#> SRR1444370 1 0.1649 0.72071 0.932 0.000 0.000 0.000 0.036 0.032
#> SRR1348929 2 0.0000 0.86266 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.3758 0.38700 0.324 0.000 0.000 0.000 0.668 0.008
#> SRR1460337 1 0.3381 0.61789 0.800 0.000 0.000 0.000 0.044 0.156
#> SRR1469062 5 0.5329 0.41733 0.020 0.000 0.200 0.000 0.644 0.136
#> SRR1388459 3 0.4791 -0.19564 0.000 0.000 0.512 0.000 0.052 0.436
#> SRR1416841 3 0.1765 0.72975 0.000 0.000 0.904 0.000 0.000 0.096
#> SRR1473778 6 0.6990 0.64632 0.184 0.000 0.220 0.000 0.120 0.476
#> SRR1419561 5 0.4045 0.14400 0.428 0.000 0.000 0.000 0.564 0.008
#> SRR1339987 5 0.4164 0.57775 0.184 0.000 0.064 0.000 0.744 0.008
#> SRR1469662 5 0.4429 0.20506 0.424 0.000 0.000 0.000 0.548 0.028
#> SRR1432958 1 0.0146 0.73363 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1479198 5 0.5132 0.55501 0.244 0.000 0.056 0.000 0.656 0.044
#> SRR1353600 1 0.2790 0.63517 0.840 0.000 0.000 0.000 0.140 0.020
#> SRR1456492 3 0.5579 0.30219 0.000 0.000 0.548 0.000 0.248 0.204
#> SRR1389955 5 0.5278 0.56154 0.244 0.000 0.072 0.000 0.644 0.040
#> SRR1429540 6 0.6137 0.48271 0.388 0.000 0.036 0.000 0.120 0.456
#> SRR1356057 6 0.6364 0.48035 0.008 0.000 0.236 0.016 0.248 0.492
#> SRR1328715 1 0.5937 -0.12409 0.428 0.000 0.000 0.000 0.220 0.352
#> SRR1429429 3 0.1814 0.72696 0.000 0.000 0.900 0.000 0.000 0.100
#> SRR1325201 2 0.4196 0.78745 0.000 0.740 0.000 0.000 0.144 0.116
#> SRR1382978 3 0.1556 0.73746 0.000 0.000 0.920 0.000 0.000 0.080
#> SRR1406348 2 0.0146 0.86266 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1469390 2 0.3201 0.81052 0.000 0.780 0.000 0.000 0.012 0.208
#> SRR1376380 3 0.2744 0.72556 0.000 0.000 0.864 0.000 0.072 0.064
#> SRR1418225 4 0.0000 0.90967 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.3201 0.81052 0.000 0.780 0.000 0.000 0.012 0.208
#> SRR1376741 6 0.6392 0.50299 0.328 0.000 0.032 0.000 0.184 0.456
#> SRR1431823 3 0.2744 0.72556 0.000 0.000 0.864 0.000 0.072 0.064
#> SRR1447916 2 0.0363 0.86220 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR1458643 4 0.4244 0.80007 0.004 0.000 0.000 0.732 0.188 0.076
#> SRR1445618 1 0.0363 0.73347 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR1081589 4 0.4536 0.79070 0.016 0.000 0.000 0.720 0.188 0.076
#> SRR1097245 1 0.1951 0.68282 0.908 0.000 0.000 0.000 0.076 0.016
#> SRR1416141 1 0.1168 0.72999 0.956 0.000 0.000 0.000 0.028 0.016
#> SRR1404339 2 0.1789 0.85266 0.000 0.924 0.000 0.000 0.032 0.044
#> SRR1478614 1 0.0291 0.73269 0.992 0.000 0.000 0.000 0.004 0.004
#> SRR1406135 1 0.4250 -0.05924 0.528 0.000 0.000 0.000 0.456 0.016
#> SRR1413307 4 0.0000 0.90967 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.86266 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.90967 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 3 0.5115 -0.24444 0.000 0.000 0.460 0.000 0.080 0.460
#> SRR1100608 2 0.5289 0.74514 0.000 0.580 0.000 0.000 0.140 0.280
#> SRR1386927 2 0.3201 0.81052 0.000 0.780 0.000 0.000 0.012 0.208
#> SRR1331771 3 0.2857 0.72239 0.000 0.000 0.856 0.000 0.072 0.072
#> SRR1486322 3 0.0291 0.75197 0.000 0.000 0.992 0.000 0.004 0.004
#> SRR1080790 5 0.5312 0.24160 0.000 0.000 0.364 0.000 0.524 0.112
#> SRR1459980 6 0.6231 0.54073 0.020 0.000 0.268 0.000 0.224 0.488
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 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.941 0.946 0.978 0.4335 0.574 0.574
#> 3 3 0.611 0.802 0.902 0.5122 0.699 0.503
#> 4 4 0.815 0.829 0.920 0.1088 0.937 0.817
#> 5 5 0.774 0.772 0.880 0.0801 0.888 0.637
#> 6 6 0.821 0.769 0.870 0.0525 0.925 0.676
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
#> SRR1433493 1 0.000 0.976 1.000 0.000
#> SRR1405147 1 0.000 0.976 1.000 0.000
#> SRR1315412 2 0.000 0.976 0.000 1.000
#> SRR1338384 1 0.000 0.976 1.000 0.000
#> SRR1071105 2 0.000 0.976 0.000 1.000
#> SRR1432868 2 0.000 0.976 0.000 1.000
#> SRR1454480 2 0.000 0.976 0.000 1.000
#> SRR1330723 2 0.000 0.976 0.000 1.000
#> SRR1475324 1 0.000 0.976 1.000 0.000
#> SRR1340260 1 0.000 0.976 1.000 0.000
#> SRR1376450 1 0.987 0.263 0.568 0.432
#> SRR1321897 1 0.000 0.976 1.000 0.000
#> SRR1445194 1 0.000 0.976 1.000 0.000
#> SRR1443308 1 0.000 0.976 1.000 0.000
#> SRR1400931 1 0.000 0.976 1.000 0.000
#> SRR1416188 1 0.000 0.976 1.000 0.000
#> SRR1407044 1 0.000 0.976 1.000 0.000
#> SRR1078392 1 0.000 0.976 1.000 0.000
#> SRR1436468 1 0.000 0.976 1.000 0.000
#> SRR1476125 2 0.000 0.976 0.000 1.000
#> SRR1418747 1 0.000 0.976 1.000 0.000
#> SRR1318089 1 0.000 0.976 1.000 0.000
#> SRR1444370 1 0.000 0.976 1.000 0.000
#> SRR1348929 2 0.000 0.976 0.000 1.000
#> SRR1385690 1 0.000 0.976 1.000 0.000
#> SRR1460337 1 0.980 0.309 0.584 0.416
#> SRR1469062 1 0.000 0.976 1.000 0.000
#> SRR1388459 1 0.000 0.976 1.000 0.000
#> SRR1416841 1 0.000 0.976 1.000 0.000
#> SRR1473778 1 0.000 0.976 1.000 0.000
#> SRR1419561 1 0.000 0.976 1.000 0.000
#> SRR1339987 1 0.000 0.976 1.000 0.000
#> SRR1469662 1 0.000 0.976 1.000 0.000
#> SRR1432958 1 0.000 0.976 1.000 0.000
#> SRR1479198 1 0.000 0.976 1.000 0.000
#> SRR1353600 1 0.000 0.976 1.000 0.000
#> SRR1456492 1 0.000 0.976 1.000 0.000
#> SRR1389955 1 0.000 0.976 1.000 0.000
#> SRR1429540 1 0.000 0.976 1.000 0.000
#> SRR1356057 1 0.000 0.976 1.000 0.000
#> SRR1328715 1 0.000 0.976 1.000 0.000
#> SRR1429429 1 0.000 0.976 1.000 0.000
#> SRR1325201 2 0.000 0.976 0.000 1.000
#> SRR1382978 1 0.000 0.976 1.000 0.000
#> SRR1406348 2 0.000 0.976 0.000 1.000
#> SRR1469390 2 0.000 0.976 0.000 1.000
#> SRR1376380 1 0.000 0.976 1.000 0.000
#> SRR1418225 2 0.000 0.976 0.000 1.000
#> SRR1418473 2 0.000 0.976 0.000 1.000
#> SRR1376741 1 0.000 0.976 1.000 0.000
#> SRR1431823 1 0.000 0.976 1.000 0.000
#> SRR1447916 2 0.000 0.976 0.000 1.000
#> SRR1458643 2 0.722 0.759 0.200 0.800
#> SRR1445618 1 0.000 0.976 1.000 0.000
#> SRR1081589 2 0.722 0.759 0.200 0.800
#> SRR1097245 1 0.311 0.921 0.944 0.056
#> SRR1416141 1 0.000 0.976 1.000 0.000
#> SRR1404339 2 0.000 0.976 0.000 1.000
#> SRR1478614 1 0.000 0.976 1.000 0.000
#> SRR1406135 1 0.714 0.748 0.804 0.196
#> SRR1413307 2 0.000 0.976 0.000 1.000
#> SRR1397720 2 0.000 0.976 0.000 1.000
#> SRR1358391 2 0.327 0.924 0.060 0.940
#> SRR1381185 1 0.000 0.976 1.000 0.000
#> SRR1100608 2 0.000 0.976 0.000 1.000
#> SRR1386927 2 0.000 0.976 0.000 1.000
#> SRR1331771 1 0.000 0.976 1.000 0.000
#> SRR1486322 1 0.000 0.976 1.000 0.000
#> SRR1080790 1 0.000 0.976 1.000 0.000
#> SRR1459980 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
#> SRR1433493 3 0.000 0.926 0.000 0.000 1.000
#> SRR1405147 3 0.000 0.926 0.000 0.000 1.000
#> SRR1315412 2 0.000 0.946 0.000 1.000 0.000
#> SRR1338384 1 0.455 0.759 0.800 0.000 0.200
#> SRR1071105 2 0.000 0.946 0.000 1.000 0.000
#> SRR1432868 2 0.000 0.946 0.000 1.000 0.000
#> SRR1454480 1 0.455 0.614 0.800 0.200 0.000
#> SRR1330723 2 0.000 0.946 0.000 1.000 0.000
#> SRR1475324 3 0.000 0.926 0.000 0.000 1.000
#> SRR1340260 3 0.455 0.721 0.200 0.000 0.800
#> SRR1376450 1 0.455 0.694 0.800 0.200 0.000
#> SRR1321897 3 0.000 0.926 0.000 0.000 1.000
#> SRR1445194 1 0.455 0.759 0.800 0.000 0.200
#> SRR1443308 3 0.455 0.720 0.200 0.000 0.800
#> SRR1400931 1 0.455 0.759 0.800 0.000 0.200
#> SRR1416188 3 0.000 0.926 0.000 0.000 1.000
#> SRR1407044 3 0.000 0.926 0.000 0.000 1.000
#> SRR1078392 3 0.608 0.394 0.388 0.000 0.612
#> SRR1436468 3 0.000 0.926 0.000 0.000 1.000
#> SRR1476125 2 0.000 0.946 0.000 1.000 0.000
#> SRR1418747 3 0.000 0.926 0.000 0.000 1.000
#> SRR1318089 3 0.000 0.926 0.000 0.000 1.000
#> SRR1444370 1 0.455 0.759 0.800 0.000 0.200
#> SRR1348929 2 0.000 0.946 0.000 1.000 0.000
#> SRR1385690 1 0.000 0.770 1.000 0.000 0.000
#> SRR1460337 1 0.455 0.694 0.800 0.200 0.000
#> SRR1469062 3 0.435 0.696 0.184 0.000 0.816
#> SRR1388459 3 0.000 0.926 0.000 0.000 1.000
#> SRR1416841 3 0.000 0.926 0.000 0.000 1.000
#> SRR1473778 3 0.334 0.820 0.120 0.000 0.880
#> SRR1419561 1 0.000 0.770 1.000 0.000 0.000
#> SRR1339987 1 0.546 0.633 0.712 0.000 0.288
#> SRR1469662 1 0.455 0.759 0.800 0.000 0.200
#> SRR1432958 1 0.455 0.759 0.800 0.000 0.200
#> SRR1479198 1 0.613 0.523 0.600 0.000 0.400
#> SRR1353600 1 0.000 0.770 1.000 0.000 0.000
#> SRR1456492 3 0.000 0.926 0.000 0.000 1.000
#> SRR1389955 1 0.613 0.523 0.600 0.000 0.400
#> SRR1429540 3 0.455 0.721 0.200 0.000 0.800
#> SRR1356057 3 0.455 0.720 0.200 0.000 0.800
#> SRR1328715 1 0.000 0.770 1.000 0.000 0.000
#> SRR1429429 3 0.000 0.926 0.000 0.000 1.000
#> SRR1325201 2 0.000 0.946 0.000 1.000 0.000
#> SRR1382978 3 0.000 0.926 0.000 0.000 1.000
#> SRR1406348 2 0.000 0.946 0.000 1.000 0.000
#> SRR1469390 2 0.000 0.946 0.000 1.000 0.000
#> SRR1376380 3 0.000 0.926 0.000 0.000 1.000
#> SRR1418225 2 0.610 0.402 0.392 0.608 0.000
#> SRR1418473 2 0.000 0.946 0.000 1.000 0.000
#> SRR1376741 3 0.455 0.721 0.200 0.000 0.800
#> SRR1431823 3 0.000 0.926 0.000 0.000 1.000
#> SRR1447916 2 0.000 0.946 0.000 1.000 0.000
#> SRR1458643 1 0.610 0.236 0.608 0.392 0.000
#> SRR1445618 1 0.455 0.759 0.800 0.000 0.200
#> SRR1081589 1 0.613 0.213 0.600 0.400 0.000
#> SRR1097245 1 0.000 0.770 1.000 0.000 0.000
#> SRR1416141 1 0.296 0.786 0.900 0.000 0.100
#> SRR1404339 2 0.000 0.946 0.000 1.000 0.000
#> SRR1478614 1 0.000 0.770 1.000 0.000 0.000
#> SRR1406135 1 0.455 0.694 0.800 0.200 0.000
#> SRR1413307 2 0.610 0.402 0.392 0.608 0.000
#> SRR1397720 2 0.000 0.946 0.000 1.000 0.000
#> SRR1358391 1 0.455 0.614 0.800 0.200 0.000
#> SRR1381185 3 0.000 0.926 0.000 0.000 1.000
#> SRR1100608 2 0.000 0.946 0.000 1.000 0.000
#> SRR1386927 2 0.000 0.946 0.000 1.000 0.000
#> SRR1331771 3 0.000 0.926 0.000 0.000 1.000
#> SRR1486322 3 0.000 0.926 0.000 0.000 1.000
#> SRR1080790 3 0.000 0.926 0.000 0.000 1.000
#> SRR1459980 3 0.000 0.926 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1405147 3 0.2589 0.804 0.116 0.000 0.884 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.830 1.000 0.000 0.000 0.000
#> SRR1071105 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1340260 3 0.4925 0.380 0.428 0.000 0.572 0.000
#> SRR1376450 1 0.3610 0.719 0.800 0.200 0.000 0.000
#> SRR1321897 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1445194 1 0.0000 0.830 1.000 0.000 0.000 0.000
#> SRR1443308 4 0.0592 0.979 0.000 0.000 0.016 0.984
#> SRR1400931 1 0.0000 0.830 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1078392 3 0.5550 0.257 0.020 0.000 0.552 0.428
#> SRR1436468 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1418747 3 0.0336 0.878 0.008 0.000 0.992 0.000
#> SRR1318089 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0000 0.830 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.3942 0.714 0.764 0.000 0.000 0.236
#> SRR1460337 1 0.3074 0.759 0.848 0.152 0.000 0.000
#> SRR1469062 3 0.4920 0.397 0.004 0.000 0.628 0.368
#> SRR1388459 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1473778 3 0.4040 0.673 0.248 0.000 0.752 0.000
#> SRR1419561 1 0.3610 0.742 0.800 0.000 0.000 0.200
#> SRR1339987 1 0.6121 0.483 0.588 0.000 0.352 0.060
#> SRR1469662 1 0.0469 0.829 0.988 0.000 0.000 0.012
#> SRR1432958 1 0.0000 0.830 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.5161 0.420 0.592 0.000 0.400 0.008
#> SRR1353600 1 0.3942 0.714 0.764 0.000 0.000 0.236
#> SRR1456492 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1389955 1 0.5279 0.419 0.588 0.000 0.400 0.012
#> SRR1429540 3 0.4888 0.413 0.412 0.000 0.588 0.000
#> SRR1356057 3 0.4817 0.394 0.000 0.000 0.612 0.388
#> SRR1328715 1 0.2921 0.780 0.860 0.000 0.000 0.140
#> SRR1429429 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1382978 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1418225 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1376741 3 0.4948 0.353 0.440 0.000 0.560 0.000
#> SRR1431823 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> SRR1445618 1 0.0000 0.830 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> SRR1097245 1 0.3873 0.719 0.772 0.000 0.000 0.228
#> SRR1416141 1 0.0469 0.829 0.988 0.000 0.000 0.012
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0000 0.830 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.2101 0.812 0.928 0.060 0.000 0.012
#> SRR1413307 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> SRR1381185 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1486322 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> SRR1459980 3 0.0000 0.884 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0794 0.849 0.028 0.000 0.972 0.000 0.000
#> SRR1405147 3 0.3635 0.704 0.248 0.000 0.748 0.000 0.004
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.2732 0.771 0.840 0.000 0.000 0.000 0.160
#> SRR1071105 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.946 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.0794 0.849 0.028 0.000 0.972 0.000 0.000
#> SRR1340260 1 0.1124 0.702 0.960 0.000 0.036 0.000 0.004
#> SRR1376450 5 0.4385 0.619 0.068 0.180 0.000 0.000 0.752
#> SRR1321897 3 0.0000 0.850 0.000 0.000 1.000 0.000 0.000
#> SRR1445194 5 0.4138 0.265 0.384 0.000 0.000 0.000 0.616
#> SRR1443308 4 0.3579 0.659 0.000 0.000 0.240 0.756 0.004
#> SRR1400931 1 0.2773 0.770 0.836 0.000 0.000 0.000 0.164
#> SRR1416188 3 0.0000 0.850 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 3 0.3480 0.607 0.000 0.000 0.752 0.000 0.248
#> SRR1078392 5 0.6950 0.178 0.092 0.000 0.328 0.072 0.508
#> SRR1436468 3 0.2732 0.785 0.160 0.000 0.840 0.000 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1418747 3 0.4114 0.353 0.000 0.000 0.624 0.000 0.376
#> SRR1318089 3 0.0000 0.850 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.2813 0.766 0.832 0.000 0.000 0.000 0.168
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 5 0.0963 0.755 0.000 0.000 0.000 0.036 0.964
#> SRR1460337 1 0.4686 0.687 0.736 0.104 0.000 0.000 0.160
#> SRR1469062 3 0.4443 0.128 0.000 0.000 0.524 0.004 0.472
#> SRR1388459 3 0.2605 0.792 0.148 0.000 0.852 0.000 0.000
#> SRR1416841 3 0.0794 0.849 0.028 0.000 0.972 0.000 0.000
#> SRR1473778 1 0.4434 -0.135 0.536 0.000 0.460 0.000 0.004
#> SRR1419561 5 0.4073 0.656 0.104 0.000 0.000 0.104 0.792
#> SRR1339987 5 0.1597 0.760 0.000 0.000 0.048 0.012 0.940
#> SRR1469662 5 0.1571 0.754 0.060 0.000 0.000 0.004 0.936
#> SRR1432958 1 0.2732 0.771 0.840 0.000 0.000 0.000 0.160
#> SRR1479198 5 0.2694 0.740 0.004 0.000 0.128 0.004 0.864
#> SRR1353600 1 0.6120 0.560 0.560 0.000 0.000 0.256 0.184
#> SRR1456492 3 0.1908 0.802 0.000 0.000 0.908 0.000 0.092
#> SRR1389955 5 0.2488 0.744 0.000 0.000 0.124 0.004 0.872
#> SRR1429540 1 0.1282 0.696 0.952 0.000 0.044 0.000 0.004
#> SRR1356057 3 0.6428 0.225 0.132 0.000 0.500 0.356 0.012
#> SRR1328715 1 0.3521 0.676 0.820 0.000 0.000 0.040 0.140
#> SRR1429429 3 0.0794 0.849 0.028 0.000 0.972 0.000 0.000
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1382978 3 0.0510 0.850 0.016 0.000 0.984 0.000 0.000
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.0000 0.850 0.000 0.000 1.000 0.000 0.000
#> SRR1418225 4 0.0000 0.946 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.1830 0.674 0.924 0.000 0.068 0.000 0.008
#> SRR1431823 3 0.0000 0.850 0.000 0.000 1.000 0.000 0.000
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.0162 0.944 0.000 0.000 0.000 0.996 0.004
#> SRR1445618 1 0.2732 0.771 0.840 0.000 0.000 0.000 0.160
#> SRR1081589 4 0.0290 0.942 0.000 0.000 0.000 0.992 0.008
#> SRR1097245 1 0.5909 0.595 0.592 0.000 0.000 0.244 0.164
#> SRR1416141 1 0.4589 0.700 0.724 0.000 0.000 0.064 0.212
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.2605 0.770 0.852 0.000 0.000 0.000 0.148
#> SRR1406135 5 0.2362 0.739 0.076 0.024 0.000 0.000 0.900
#> SRR1413307 4 0.0000 0.946 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.946 0.000 0.000 0.000 1.000 0.000
#> SRR1381185 3 0.2230 0.811 0.116 0.000 0.884 0.000 0.000
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.0000 0.850 0.000 0.000 1.000 0.000 0.000
#> SRR1486322 3 0.0000 0.850 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 3 0.3636 0.570 0.000 0.000 0.728 0.000 0.272
#> SRR1459980 3 0.3835 0.768 0.156 0.000 0.796 0.000 0.048
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.2278 0.7981 0.000 0.000 0.868 0.000 0.004 0.128
#> SRR1405147 6 0.2956 0.8210 0.040 0.000 0.120 0.000 0.000 0.840
#> SRR1315412 2 0.0713 0.9819 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR1338384 1 0.1082 0.8538 0.956 0.000 0.000 0.000 0.004 0.040
#> SRR1071105 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.9074 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1475324 3 0.1610 0.8256 0.000 0.000 0.916 0.000 0.000 0.084
#> SRR1340260 6 0.2664 0.7829 0.184 0.000 0.000 0.000 0.000 0.816
#> SRR1376450 5 0.6006 0.5545 0.196 0.108 0.000 0.000 0.608 0.088
#> SRR1321897 3 0.0363 0.8431 0.000 0.000 0.988 0.000 0.012 0.000
#> SRR1445194 5 0.4648 0.1883 0.464 0.000 0.000 0.000 0.496 0.040
#> SRR1443308 4 0.4433 0.3055 0.000 0.000 0.416 0.560 0.016 0.008
#> SRR1400931 1 0.0260 0.8577 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR1416188 3 0.0146 0.8448 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR1407044 3 0.2595 0.7299 0.000 0.000 0.836 0.000 0.160 0.004
#> SRR1078392 5 0.5499 0.5192 0.000 0.000 0.168 0.056 0.660 0.116
#> SRR1436468 6 0.3272 0.8094 0.020 0.000 0.144 0.000 0.016 0.820
#> SRR1476125 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1418747 3 0.4229 0.1701 0.000 0.000 0.548 0.000 0.436 0.016
#> SRR1318089 3 0.0260 0.8451 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR1444370 1 0.1049 0.8551 0.960 0.000 0.000 0.000 0.008 0.032
#> SRR1348929 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.0692 0.7252 0.020 0.000 0.000 0.004 0.976 0.000
#> SRR1460337 1 0.3324 0.7587 0.824 0.060 0.000 0.000 0.004 0.112
#> SRR1469062 5 0.4086 -0.0525 0.000 0.000 0.464 0.000 0.528 0.008
#> SRR1388459 6 0.2854 0.7495 0.000 0.000 0.208 0.000 0.000 0.792
#> SRR1416841 3 0.2320 0.7960 0.000 0.000 0.864 0.000 0.004 0.132
#> SRR1473778 6 0.2942 0.8149 0.132 0.000 0.032 0.000 0.000 0.836
#> SRR1419561 5 0.5556 0.4750 0.272 0.000 0.000 0.084 0.604 0.040
#> SRR1339987 5 0.0508 0.7246 0.012 0.000 0.004 0.000 0.984 0.000
#> SRR1469662 5 0.1913 0.7223 0.080 0.000 0.000 0.000 0.908 0.012
#> SRR1432958 1 0.0547 0.8588 0.980 0.000 0.000 0.000 0.000 0.020
#> SRR1479198 5 0.2858 0.7133 0.016 0.000 0.092 0.000 0.864 0.028
#> SRR1353600 1 0.3484 0.7289 0.784 0.000 0.000 0.188 0.012 0.016
#> SRR1456492 3 0.2889 0.7783 0.000 0.000 0.848 0.000 0.108 0.044
#> SRR1389955 5 0.2432 0.7242 0.016 0.000 0.072 0.000 0.892 0.020
#> SRR1429540 6 0.2697 0.7790 0.188 0.000 0.000 0.000 0.000 0.812
#> SRR1356057 6 0.5422 0.4586 0.000 0.000 0.064 0.296 0.040 0.600
#> SRR1328715 1 0.5880 0.1455 0.480 0.000 0.000 0.016 0.132 0.372
#> SRR1429429 3 0.2135 0.7984 0.000 0.000 0.872 0.000 0.000 0.128
#> SRR1325201 2 0.0146 0.9897 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1382978 3 0.1556 0.8276 0.000 0.000 0.920 0.000 0.000 0.080
#> SRR1406348 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0713 0.9819 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR1376380 3 0.0363 0.8431 0.000 0.000 0.988 0.000 0.012 0.000
#> SRR1418225 4 0.0000 0.9074 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0713 0.9819 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR1376741 6 0.2562 0.7916 0.172 0.000 0.000 0.000 0.000 0.828
#> SRR1431823 3 0.0363 0.8431 0.000 0.000 0.988 0.000 0.012 0.000
#> SRR1447916 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.0363 0.9035 0.000 0.000 0.000 0.988 0.000 0.012
#> SRR1445618 1 0.0632 0.8584 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1081589 4 0.0508 0.9011 0.000 0.000 0.000 0.984 0.004 0.012
#> SRR1097245 1 0.3245 0.7367 0.796 0.000 0.000 0.184 0.004 0.016
#> SRR1416141 1 0.1780 0.8430 0.932 0.000 0.000 0.012 0.028 0.028
#> SRR1404339 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.0547 0.8549 0.980 0.000 0.000 0.000 0.000 0.020
#> SRR1406135 5 0.4355 0.6768 0.136 0.024 0.000 0.000 0.756 0.084
#> SRR1413307 4 0.0000 0.9074 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.9906 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.9074 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 3 0.4091 0.0244 0.000 0.000 0.520 0.000 0.008 0.472
#> SRR1100608 2 0.0713 0.9819 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR1386927 2 0.0713 0.9819 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR1331771 3 0.0363 0.8431 0.000 0.000 0.988 0.000 0.012 0.000
#> SRR1486322 3 0.0692 0.8446 0.000 0.000 0.976 0.000 0.004 0.020
#> SRR1080790 3 0.3916 0.5072 0.000 0.000 0.680 0.000 0.300 0.020
#> SRR1459980 6 0.2912 0.7852 0.000 0.000 0.172 0.000 0.012 0.816
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 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.999 1.000 0.3418 0.658 0.658
#> 3 3 0.834 0.885 0.939 0.8312 0.710 0.560
#> 4 4 0.828 0.867 0.947 0.1254 0.899 0.733
#> 5 5 0.732 0.799 0.856 0.0973 0.896 0.650
#> 6 6 0.731 0.739 0.819 0.0337 0.985 0.930
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 1 0.000 1.000 1.000 0.000
#> SRR1405147 1 0.000 1.000 1.000 0.000
#> SRR1315412 2 0.000 0.998 0.000 1.000
#> SRR1338384 1 0.000 1.000 1.000 0.000
#> SRR1071105 2 0.184 0.971 0.028 0.972
#> SRR1432868 2 0.000 0.998 0.000 1.000
#> SRR1454480 1 0.000 1.000 1.000 0.000
#> SRR1330723 2 0.000 0.998 0.000 1.000
#> SRR1475324 1 0.000 1.000 1.000 0.000
#> SRR1340260 1 0.000 1.000 1.000 0.000
#> SRR1376450 1 0.000 1.000 1.000 0.000
#> SRR1321897 1 0.000 1.000 1.000 0.000
#> SRR1445194 1 0.000 1.000 1.000 0.000
#> SRR1443308 1 0.000 1.000 1.000 0.000
#> SRR1400931 1 0.000 1.000 1.000 0.000
#> SRR1416188 1 0.000 1.000 1.000 0.000
#> SRR1407044 1 0.000 1.000 1.000 0.000
#> SRR1078392 1 0.000 1.000 1.000 0.000
#> SRR1436468 1 0.000 1.000 1.000 0.000
#> SRR1476125 2 0.000 0.998 0.000 1.000
#> SRR1418747 1 0.000 1.000 1.000 0.000
#> SRR1318089 1 0.000 1.000 1.000 0.000
#> SRR1444370 1 0.000 1.000 1.000 0.000
#> SRR1348929 2 0.000 0.998 0.000 1.000
#> SRR1385690 1 0.000 1.000 1.000 0.000
#> SRR1460337 1 0.000 1.000 1.000 0.000
#> SRR1469062 1 0.000 1.000 1.000 0.000
#> SRR1388459 1 0.000 1.000 1.000 0.000
#> SRR1416841 1 0.000 1.000 1.000 0.000
#> SRR1473778 1 0.000 1.000 1.000 0.000
#> SRR1419561 1 0.000 1.000 1.000 0.000
#> SRR1339987 1 0.000 1.000 1.000 0.000
#> SRR1469662 1 0.000 1.000 1.000 0.000
#> SRR1432958 1 0.000 1.000 1.000 0.000
#> SRR1479198 1 0.000 1.000 1.000 0.000
#> SRR1353600 1 0.000 1.000 1.000 0.000
#> SRR1456492 1 0.000 1.000 1.000 0.000
#> SRR1389955 1 0.000 1.000 1.000 0.000
#> SRR1429540 1 0.000 1.000 1.000 0.000
#> SRR1356057 1 0.000 1.000 1.000 0.000
#> SRR1328715 1 0.000 1.000 1.000 0.000
#> SRR1429429 1 0.000 1.000 1.000 0.000
#> SRR1325201 2 0.000 0.998 0.000 1.000
#> SRR1382978 1 0.000 1.000 1.000 0.000
#> SRR1406348 2 0.000 0.998 0.000 1.000
#> SRR1469390 2 0.000 0.998 0.000 1.000
#> SRR1376380 1 0.000 1.000 1.000 0.000
#> SRR1418225 1 0.000 1.000 1.000 0.000
#> SRR1418473 2 0.000 0.998 0.000 1.000
#> SRR1376741 1 0.000 1.000 1.000 0.000
#> SRR1431823 1 0.000 1.000 1.000 0.000
#> SRR1447916 2 0.000 0.998 0.000 1.000
#> SRR1458643 1 0.000 1.000 1.000 0.000
#> SRR1445618 1 0.000 1.000 1.000 0.000
#> SRR1081589 1 0.000 1.000 1.000 0.000
#> SRR1097245 1 0.000 1.000 1.000 0.000
#> SRR1416141 1 0.000 1.000 1.000 0.000
#> SRR1404339 2 0.000 0.998 0.000 1.000
#> SRR1478614 1 0.000 1.000 1.000 0.000
#> SRR1406135 1 0.000 1.000 1.000 0.000
#> SRR1413307 1 0.000 1.000 1.000 0.000
#> SRR1397720 2 0.000 0.998 0.000 1.000
#> SRR1358391 1 0.000 1.000 1.000 0.000
#> SRR1381185 1 0.000 1.000 1.000 0.000
#> SRR1100608 2 0.000 0.998 0.000 1.000
#> SRR1386927 2 0.000 0.998 0.000 1.000
#> SRR1331771 1 0.000 1.000 1.000 0.000
#> SRR1486322 1 0.000 1.000 1.000 0.000
#> SRR1080790 1 0.000 1.000 1.000 0.000
#> SRR1459980 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
#> SRR1433493 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1405147 1 0.4654 0.7227 0.792 0.000 0.208
#> SRR1315412 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1338384 1 0.2448 0.8725 0.924 0.000 0.076
#> SRR1071105 2 0.1163 0.9647 0.028 0.972 0.000
#> SRR1432868 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1454480 1 0.1643 0.8978 0.956 0.000 0.044
#> SRR1330723 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1475324 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1340260 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1321897 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1445194 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1443308 1 0.6309 0.0167 0.500 0.000 0.500
#> SRR1400931 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1416188 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1407044 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1078392 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1436468 3 0.2356 0.9132 0.072 0.000 0.928
#> SRR1476125 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1418747 3 0.3412 0.8740 0.124 0.000 0.876
#> SRR1318089 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1444370 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1348929 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1385690 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1469062 1 0.6291 0.0342 0.532 0.000 0.468
#> SRR1388459 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1416841 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1473778 1 0.3941 0.7926 0.844 0.000 0.156
#> SRR1419561 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1339987 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1469662 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1479198 1 0.3941 0.7926 0.844 0.000 0.156
#> SRR1353600 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1456492 3 0.4235 0.8078 0.176 0.000 0.824
#> SRR1389955 1 0.4504 0.7411 0.804 0.000 0.196
#> SRR1429540 1 0.3941 0.7926 0.844 0.000 0.156
#> SRR1356057 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1328715 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1429429 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1325201 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1382978 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1406348 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1469390 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1376380 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1418225 1 0.1643 0.8978 0.956 0.000 0.044
#> SRR1418473 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1376741 1 0.0237 0.9274 0.996 0.000 0.004
#> SRR1431823 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1447916 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1458643 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1445618 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1081589 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1097245 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1404339 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.9297 1.000 0.000 0.000
#> SRR1413307 1 0.1643 0.8978 0.956 0.000 0.044
#> SRR1397720 2 0.0000 0.9960 0.000 1.000 0.000
#> SRR1358391 1 0.1643 0.8978 0.956 0.000 0.044
#> SRR1381185 3 0.4750 0.7656 0.216 0.000 0.784
#> SRR1100608 2 0.0237 0.9938 0.000 0.996 0.004
#> SRR1386927 2 0.1031 0.9807 0.000 0.976 0.024
#> SRR1331771 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1486322 3 0.1643 0.9318 0.044 0.000 0.956
#> SRR1080790 3 0.5216 0.6972 0.260 0.000 0.740
#> SRR1459980 3 0.6260 0.2305 0.448 0.000 0.552
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.4040 0.6865 0.752 0.000 0.248 0.000
#> SRR1315412 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0817 0.9327 0.976 0.000 0.024 0.000
#> SRR1071105 2 0.0921 0.9532 0.028 0.972 0.000 0.000
#> SRR1432868 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0000 0.8036 0.000 0.000 0.000 1.000
#> SRR1330723 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1321897 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1445194 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1443308 4 0.5700 0.2635 0.028 0.000 0.412 0.560
#> SRR1400931 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1078392 1 0.2760 0.8398 0.872 0.000 0.128 0.000
#> SRR1436468 3 0.1211 0.8604 0.040 0.000 0.960 0.000
#> SRR1476125 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1418747 3 0.2081 0.8236 0.084 0.000 0.916 0.000
#> SRR1318089 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1460337 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1469062 3 0.4998 0.0381 0.488 0.000 0.512 0.000
#> SRR1388459 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.3528 0.7684 0.808 0.000 0.192 0.000
#> SRR1419561 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1339987 1 0.0921 0.9315 0.972 0.000 0.028 0.000
#> SRR1469662 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.2216 0.8819 0.908 0.000 0.092 0.000
#> SRR1353600 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.1716 0.8282 0.064 0.000 0.936 0.000
#> SRR1389955 1 0.2647 0.8518 0.880 0.000 0.120 0.000
#> SRR1429540 1 0.2408 0.8716 0.896 0.000 0.104 0.000
#> SRR1356057 1 0.2647 0.8470 0.880 0.000 0.120 0.000
#> SRR1328715 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1382978 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1418225 4 0.0000 0.8036 0.000 0.000 0.000 1.000
#> SRR1418473 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0188 0.9448 0.996 0.000 0.004 0.000
#> SRR1431823 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1447916 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.3610 0.7159 0.200 0.000 0.000 0.800
#> SRR1445618 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.5428 0.4251 0.380 0.000 0.020 0.600
#> SRR1097245 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1404339 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.0000 0.9468 1.000 0.000 0.000 0.000
#> SRR1413307 4 0.0000 0.8036 0.000 0.000 0.000 1.000
#> SRR1397720 2 0.0000 0.9893 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0000 0.8036 0.000 0.000 0.000 1.000
#> SRR1381185 3 0.3311 0.7241 0.172 0.000 0.828 0.000
#> SRR1100608 2 0.0336 0.9837 0.000 0.992 0.000 0.008
#> SRR1386927 2 0.2345 0.8925 0.000 0.900 0.000 0.100
#> SRR1331771 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1486322 3 0.0000 0.8911 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.3764 0.6676 0.216 0.000 0.784 0.000
#> SRR1459980 3 0.4866 0.3224 0.404 0.000 0.596 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1405147 1 0.2929 0.688 0.820 0.000 0.180 0.000 0.000
#> SRR1315412 2 0.2471 0.896 0.000 0.864 0.000 0.000 0.136
#> SRR1338384 1 0.0162 0.867 0.996 0.000 0.004 0.000 0.000
#> SRR1071105 2 0.3109 0.704 0.000 0.800 0.000 0.000 0.200
#> SRR1432868 2 0.0000 0.926 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.800 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 2 0.0000 0.926 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1340260 1 0.1270 0.868 0.948 0.000 0.000 0.000 0.052
#> SRR1376450 5 0.3932 0.656 0.328 0.000 0.000 0.000 0.672
#> SRR1321897 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1445194 5 0.4138 0.638 0.384 0.000 0.000 0.000 0.616
#> SRR1443308 4 0.4909 0.242 0.028 0.000 0.412 0.560 0.000
#> SRR1400931 1 0.0880 0.863 0.968 0.000 0.000 0.000 0.032
#> SRR1416188 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 3 0.3210 0.642 0.000 0.000 0.788 0.000 0.212
#> SRR1078392 1 0.4333 0.795 0.752 0.000 0.060 0.000 0.188
#> SRR1436468 3 0.2605 0.788 0.148 0.000 0.852 0.000 0.000
#> SRR1476125 2 0.0000 0.926 0.000 1.000 0.000 0.000 0.000
#> SRR1418747 5 0.4359 0.430 0.004 0.000 0.412 0.000 0.584
#> SRR1318089 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.0880 0.863 0.968 0.000 0.000 0.000 0.032
#> SRR1348929 2 0.0000 0.926 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 5 0.3561 0.643 0.260 0.000 0.000 0.000 0.740
#> SRR1460337 1 0.0794 0.864 0.972 0.000 0.000 0.000 0.028
#> SRR1469062 5 0.4789 0.471 0.024 0.000 0.392 0.000 0.584
#> SRR1388459 3 0.0162 0.942 0.004 0.000 0.996 0.000 0.000
#> SRR1416841 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1473778 1 0.2424 0.764 0.868 0.000 0.132 0.000 0.000
#> SRR1419561 1 0.3913 0.566 0.676 0.000 0.000 0.000 0.324
#> SRR1339987 5 0.3783 0.649 0.252 0.000 0.008 0.000 0.740
#> SRR1469662 5 0.3730 0.655 0.288 0.000 0.000 0.000 0.712
#> SRR1432958 1 0.0510 0.867 0.984 0.000 0.000 0.000 0.016
#> SRR1479198 5 0.5452 0.694 0.292 0.000 0.092 0.000 0.616
#> SRR1353600 1 0.2929 0.824 0.820 0.000 0.000 0.000 0.180
#> SRR1456492 3 0.2519 0.817 0.016 0.000 0.884 0.000 0.100
#> SRR1389955 5 0.5639 0.697 0.260 0.000 0.124 0.000 0.616
#> SRR1429540 1 0.1270 0.846 0.948 0.000 0.052 0.000 0.000
#> SRR1356057 1 0.3688 0.817 0.816 0.000 0.060 0.000 0.124
#> SRR1328715 1 0.2377 0.850 0.872 0.000 0.000 0.000 0.128
#> SRR1429429 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1325201 2 0.0000 0.926 0.000 1.000 0.000 0.000 0.000
#> SRR1382978 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1406348 2 0.0000 0.926 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.2690 0.888 0.000 0.844 0.000 0.000 0.156
#> SRR1376380 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1418225 4 0.0000 0.800 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.2690 0.888 0.000 0.844 0.000 0.000 0.156
#> SRR1376741 1 0.0162 0.867 0.996 0.000 0.004 0.000 0.000
#> SRR1431823 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1447916 2 0.1792 0.911 0.000 0.916 0.000 0.000 0.084
#> SRR1458643 4 0.4879 0.652 0.076 0.000 0.000 0.696 0.228
#> SRR1445618 1 0.0000 0.867 1.000 0.000 0.000 0.000 0.000
#> SRR1081589 4 0.6261 0.475 0.160 0.000 0.008 0.564 0.268
#> SRR1097245 1 0.2329 0.850 0.876 0.000 0.000 0.000 0.124
#> SRR1416141 1 0.2280 0.839 0.880 0.000 0.000 0.000 0.120
#> SRR1404339 2 0.0000 0.926 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.2329 0.850 0.876 0.000 0.000 0.000 0.124
#> SRR1406135 5 0.4138 0.638 0.384 0.000 0.000 0.000 0.616
#> SRR1413307 4 0.0000 0.800 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.926 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.800 0.000 0.000 0.000 1.000 0.000
#> SRR1381185 3 0.2891 0.728 0.176 0.000 0.824 0.000 0.000
#> SRR1100608 2 0.2690 0.888 0.000 0.844 0.000 0.000 0.156
#> SRR1386927 2 0.4098 0.839 0.000 0.780 0.000 0.064 0.156
#> SRR1331771 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1486322 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 5 0.4219 0.420 0.000 0.000 0.416 0.000 0.584
#> SRR1459980 5 0.5569 0.469 0.080 0.000 0.364 0.000 0.556
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.886 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 1 0.2416 0.710 0.844 0.000 0.156 0.000 0.000 0.000
#> SRR1315412 2 0.1075 0.723 0.000 0.952 0.000 0.000 0.048 0.000
#> SRR1338384 1 0.0000 0.827 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1071105 5 0.5284 -0.628 0.000 0.388 0.000 0.000 0.508 0.104
#> SRR1432868 2 0.5081 0.827 0.000 0.588 0.000 0.000 0.308 0.104
#> SRR1454480 4 0.2854 0.890 0.000 0.000 0.000 0.792 0.000 0.208
#> SRR1330723 2 0.5081 0.827 0.000 0.588 0.000 0.000 0.308 0.104
#> SRR1475324 3 0.0000 0.886 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1340260 1 0.1814 0.819 0.900 0.000 0.000 0.000 0.000 0.100
#> SRR1376450 5 0.4354 0.606 0.240 0.000 0.000 0.000 0.692 0.068
#> SRR1321897 3 0.2823 0.821 0.000 0.000 0.796 0.204 0.000 0.000
#> SRR1445194 5 0.3446 0.599 0.308 0.000 0.000 0.000 0.692 0.000
#> SRR1443308 4 0.1341 0.572 0.028 0.000 0.024 0.948 0.000 0.000
#> SRR1400931 1 0.1141 0.819 0.948 0.000 0.000 0.000 0.052 0.000
#> SRR1416188 3 0.0000 0.886 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1407044 3 0.2883 0.680 0.000 0.000 0.788 0.000 0.212 0.000
#> SRR1078392 1 0.4641 0.729 0.684 0.000 0.000 0.000 0.116 0.200
#> SRR1436468 3 0.2854 0.660 0.208 0.000 0.792 0.000 0.000 0.000
#> SRR1476125 2 0.5081 0.827 0.000 0.588 0.000 0.000 0.308 0.104
#> SRR1418747 5 0.3795 0.464 0.004 0.000 0.364 0.000 0.632 0.000
#> SRR1318089 3 0.0000 0.886 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.1141 0.819 0.948 0.000 0.000 0.000 0.052 0.000
#> SRR1348929 2 0.5081 0.827 0.000 0.588 0.000 0.000 0.308 0.104
#> SRR1385690 5 0.4560 0.534 0.108 0.000 0.000 0.000 0.692 0.200
#> SRR1460337 1 0.1007 0.821 0.956 0.000 0.000 0.000 0.044 0.000
#> SRR1469062 5 0.4009 0.478 0.008 0.000 0.356 0.000 0.632 0.004
#> SRR1388459 3 0.0146 0.884 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR1416841 3 0.0000 0.886 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1473778 1 0.2048 0.759 0.880 0.000 0.120 0.000 0.000 0.000
#> SRR1419561 1 0.5501 0.517 0.564 0.000 0.000 0.000 0.236 0.200
#> SRR1339987 5 0.4560 0.534 0.108 0.000 0.000 0.000 0.692 0.200
#> SRR1469662 5 0.4596 0.592 0.188 0.000 0.000 0.000 0.692 0.120
#> SRR1432958 1 0.0632 0.826 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR1479198 5 0.4475 0.639 0.220 0.000 0.088 0.000 0.692 0.000
#> SRR1353600 1 0.4431 0.748 0.704 0.000 0.000 0.000 0.096 0.200
#> SRR1456492 3 0.2597 0.677 0.000 0.000 0.824 0.000 0.000 0.176
#> SRR1389955 5 0.4513 0.636 0.212 0.000 0.096 0.000 0.692 0.000
#> SRR1429540 1 0.0937 0.818 0.960 0.000 0.040 0.000 0.000 0.000
#> SRR1356057 1 0.3043 0.787 0.792 0.000 0.000 0.000 0.008 0.200
#> SRR1328715 1 0.3141 0.786 0.788 0.000 0.000 0.000 0.012 0.200
#> SRR1429429 3 0.0000 0.886 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1325201 2 0.5081 0.827 0.000 0.588 0.000 0.000 0.308 0.104
#> SRR1382978 3 0.0000 0.886 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.5081 0.827 0.000 0.588 0.000 0.000 0.308 0.104
#> SRR1469390 2 0.0000 0.699 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 3 0.2854 0.819 0.000 0.000 0.792 0.208 0.000 0.000
#> SRR1418225 4 0.2854 0.890 0.000 0.000 0.000 0.792 0.000 0.208
#> SRR1418473 2 0.0000 0.699 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 1 0.0000 0.827 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1431823 3 0.2854 0.819 0.000 0.000 0.792 0.208 0.000 0.000
#> SRR1447916 2 0.2697 0.773 0.000 0.812 0.000 0.000 0.188 0.000
#> SRR1458643 6 0.1863 0.883 0.000 0.000 0.000 0.104 0.000 0.896
#> SRR1445618 1 0.0000 0.827 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1081589 6 0.2793 0.888 0.020 0.000 0.000 0.060 0.044 0.876
#> SRR1097245 1 0.3043 0.787 0.792 0.000 0.000 0.000 0.008 0.200
#> SRR1416141 1 0.3274 0.780 0.824 0.000 0.000 0.000 0.096 0.080
#> SRR1404339 2 0.5081 0.827 0.000 0.588 0.000 0.000 0.308 0.104
#> SRR1478614 1 0.3043 0.787 0.792 0.000 0.000 0.000 0.008 0.200
#> SRR1406135 5 0.3446 0.599 0.308 0.000 0.000 0.000 0.692 0.000
#> SRR1413307 4 0.2854 0.890 0.000 0.000 0.000 0.792 0.000 0.208
#> SRR1397720 2 0.5081 0.827 0.000 0.588 0.000 0.000 0.308 0.104
#> SRR1358391 4 0.2854 0.890 0.000 0.000 0.000 0.792 0.000 0.208
#> SRR1381185 3 0.2994 0.817 0.004 0.000 0.788 0.208 0.000 0.000
#> SRR1100608 2 0.0000 0.699 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1386927 2 0.0000 0.699 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.2854 0.819 0.000 0.000 0.792 0.208 0.000 0.000
#> SRR1486322 3 0.0000 0.886 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 5 0.3672 0.456 0.000 0.000 0.368 0.000 0.632 0.000
#> SRR1459980 5 0.5273 0.495 0.136 0.000 0.284 0.000 0.580 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 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.675 0.868 0.936 0.4549 0.552 0.552
#> 3 3 0.587 0.608 0.783 0.2757 0.925 0.870
#> 4 4 0.584 0.747 0.818 0.0563 0.888 0.799
#> 5 5 0.552 0.542 0.770 0.2322 0.752 0.502
#> 6 6 0.634 0.649 0.764 0.0495 0.822 0.436
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
#> SRR1433493 1 0.0000 0.914 1.000 0.000
#> SRR1405147 1 0.0000 0.914 1.000 0.000
#> SRR1315412 2 0.0000 0.956 0.000 1.000
#> SRR1338384 1 0.0000 0.914 1.000 0.000
#> SRR1071105 2 0.0000 0.956 0.000 1.000
#> SRR1432868 2 0.0000 0.956 0.000 1.000
#> SRR1454480 2 0.0000 0.956 0.000 1.000
#> SRR1330723 2 0.0000 0.956 0.000 1.000
#> SRR1475324 1 0.0000 0.914 1.000 0.000
#> SRR1340260 1 0.0000 0.914 1.000 0.000
#> SRR1376450 2 0.9795 0.139 0.416 0.584
#> SRR1321897 1 0.0000 0.914 1.000 0.000
#> SRR1445194 1 0.0000 0.914 1.000 0.000
#> SRR1443308 1 0.9661 0.482 0.608 0.392
#> SRR1400931 1 0.8955 0.646 0.688 0.312
#> SRR1416188 1 0.0000 0.914 1.000 0.000
#> SRR1407044 1 0.0000 0.914 1.000 0.000
#> SRR1078392 1 0.6712 0.823 0.824 0.176
#> SRR1436468 1 0.1184 0.907 0.984 0.016
#> SRR1476125 2 0.0000 0.956 0.000 1.000
#> SRR1418747 1 0.0000 0.914 1.000 0.000
#> SRR1318089 1 0.0000 0.914 1.000 0.000
#> SRR1444370 1 0.0000 0.914 1.000 0.000
#> SRR1348929 2 0.0000 0.956 0.000 1.000
#> SRR1385690 1 0.6712 0.823 0.824 0.176
#> SRR1460337 2 0.9795 0.139 0.416 0.584
#> SRR1469062 1 0.6712 0.823 0.824 0.176
#> SRR1388459 1 0.0000 0.914 1.000 0.000
#> SRR1416841 1 0.0000 0.914 1.000 0.000
#> SRR1473778 1 0.0000 0.914 1.000 0.000
#> SRR1419561 1 0.7815 0.766 0.768 0.232
#> SRR1339987 1 0.6712 0.823 0.824 0.176
#> SRR1469662 1 0.3431 0.889 0.936 0.064
#> SRR1432958 1 0.0376 0.913 0.996 0.004
#> SRR1479198 1 0.2603 0.898 0.956 0.044
#> SRR1353600 1 0.7219 0.801 0.800 0.200
#> SRR1456492 1 0.6712 0.823 0.824 0.176
#> SRR1389955 1 0.0000 0.914 1.000 0.000
#> SRR1429540 1 0.0000 0.914 1.000 0.000
#> SRR1356057 1 0.7219 0.801 0.800 0.200
#> SRR1328715 1 0.6712 0.823 0.824 0.176
#> SRR1429429 1 0.0000 0.914 1.000 0.000
#> SRR1325201 2 0.0000 0.956 0.000 1.000
#> SRR1382978 1 0.0000 0.914 1.000 0.000
#> SRR1406348 2 0.0000 0.956 0.000 1.000
#> SRR1469390 2 0.0000 0.956 0.000 1.000
#> SRR1376380 1 0.0000 0.914 1.000 0.000
#> SRR1418225 2 0.0000 0.956 0.000 1.000
#> SRR1418473 2 0.0000 0.956 0.000 1.000
#> SRR1376741 1 0.0000 0.914 1.000 0.000
#> SRR1431823 1 0.0000 0.914 1.000 0.000
#> SRR1447916 2 0.0000 0.956 0.000 1.000
#> SRR1458643 2 0.0000 0.956 0.000 1.000
#> SRR1445618 1 0.0000 0.914 1.000 0.000
#> SRR1081589 2 0.0000 0.956 0.000 1.000
#> SRR1097245 1 0.7219 0.801 0.800 0.200
#> SRR1416141 1 0.2603 0.898 0.956 0.044
#> SRR1404339 2 0.0000 0.956 0.000 1.000
#> SRR1478614 1 0.8144 0.740 0.748 0.252
#> SRR1406135 1 0.9710 0.463 0.600 0.400
#> SRR1413307 2 0.0000 0.956 0.000 1.000
#> SRR1397720 2 0.0000 0.956 0.000 1.000
#> SRR1358391 2 0.0000 0.956 0.000 1.000
#> SRR1381185 1 0.0000 0.914 1.000 0.000
#> SRR1100608 2 0.0000 0.956 0.000 1.000
#> SRR1386927 2 0.0000 0.956 0.000 1.000
#> SRR1331771 1 0.7528 0.785 0.784 0.216
#> SRR1486322 1 0.0000 0.914 1.000 0.000
#> SRR1080790 1 0.0000 0.914 1.000 0.000
#> SRR1459980 1 0.0000 0.914 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 1 0.6252 0.5200 0.556 0.000 0.444
#> SRR1405147 1 0.0237 0.7301 0.996 0.000 0.004
#> SRR1315412 2 0.0000 0.7352 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.7297 1.000 0.000 0.000
#> SRR1071105 2 0.6180 0.4403 0.000 0.584 0.416
#> SRR1432868 2 0.5058 0.6356 0.000 0.756 0.244
#> SRR1454480 2 0.1860 0.7169 0.000 0.948 0.052
#> SRR1330723 2 0.5650 0.5838 0.000 0.688 0.312
#> SRR1475324 1 0.6302 0.4943 0.520 0.000 0.480
#> SRR1340260 1 0.0237 0.7301 0.996 0.000 0.004
#> SRR1376450 1 0.9627 -0.6117 0.428 0.364 0.208
#> SRR1321897 1 0.6302 0.4943 0.520 0.000 0.480
#> SRR1445194 1 0.0237 0.7287 0.996 0.000 0.004
#> SRR1443308 1 0.5526 0.6375 0.792 0.036 0.172
#> SRR1400931 3 0.9843 0.7806 0.376 0.248 0.376
#> SRR1416188 1 0.6302 0.4943 0.520 0.000 0.480
#> SRR1407044 1 0.5678 0.5826 0.684 0.000 0.316
#> SRR1078392 1 0.1860 0.7078 0.948 0.000 0.052
#> SRR1436468 1 0.4121 0.6686 0.832 0.000 0.168
#> SRR1476125 2 0.6192 0.4331 0.000 0.580 0.420
#> SRR1418747 1 0.0424 0.7298 0.992 0.000 0.008
#> SRR1318089 1 0.6302 0.4943 0.520 0.000 0.480
#> SRR1444370 1 0.0237 0.7301 0.996 0.000 0.004
#> SRR1348929 2 0.5058 0.6356 0.000 0.756 0.244
#> SRR1385690 1 0.1860 0.7078 0.948 0.000 0.052
#> SRR1460337 3 0.9483 0.4097 0.188 0.364 0.448
#> SRR1469062 1 0.1964 0.7089 0.944 0.000 0.056
#> SRR1388459 1 0.5138 0.6394 0.748 0.000 0.252
#> SRR1416841 1 0.6299 0.4976 0.524 0.000 0.476
#> SRR1473778 1 0.0237 0.7301 0.996 0.000 0.004
#> SRR1419561 1 0.7065 0.2127 0.672 0.276 0.052
#> SRR1339987 1 0.1860 0.7078 0.948 0.000 0.052
#> SRR1469662 1 0.1860 0.7078 0.948 0.000 0.052
#> SRR1432958 1 0.0000 0.7297 1.000 0.000 0.000
#> SRR1479198 1 0.1411 0.7194 0.964 0.000 0.036
#> SRR1353600 1 0.2446 0.7024 0.936 0.012 0.052
#> SRR1456492 1 0.3816 0.6915 0.852 0.000 0.148
#> SRR1389955 1 0.0000 0.7297 1.000 0.000 0.000
#> SRR1429540 1 0.0237 0.7301 0.996 0.000 0.004
#> SRR1356057 1 0.4110 0.6879 0.844 0.004 0.152
#> SRR1328715 1 0.1860 0.7078 0.948 0.000 0.052
#> SRR1429429 1 0.6302 0.4943 0.520 0.000 0.480
#> SRR1325201 2 0.6192 0.4331 0.000 0.580 0.420
#> SRR1382978 1 0.6302 0.4943 0.520 0.000 0.480
#> SRR1406348 2 0.5650 0.5838 0.000 0.688 0.312
#> SRR1469390 2 0.0000 0.7352 0.000 1.000 0.000
#> SRR1376380 1 0.6267 0.5120 0.548 0.000 0.452
#> SRR1418225 2 0.1860 0.7169 0.000 0.948 0.052
#> SRR1418473 2 0.0000 0.7352 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.7297 1.000 0.000 0.000
#> SRR1431823 1 0.6204 0.5278 0.576 0.000 0.424
#> SRR1447916 2 0.0000 0.7352 0.000 1.000 0.000
#> SRR1458643 2 0.5892 0.4807 0.100 0.796 0.104
#> SRR1445618 1 0.0000 0.7297 1.000 0.000 0.000
#> SRR1081589 2 0.6317 0.4238 0.124 0.772 0.104
#> SRR1097245 1 0.1860 0.7078 0.948 0.000 0.052
#> SRR1416141 1 0.1753 0.7100 0.952 0.000 0.048
#> SRR1404339 2 0.5650 0.5838 0.000 0.688 0.312
#> SRR1478614 3 0.9858 0.7811 0.372 0.252 0.376
#> SRR1406135 1 0.7123 -0.0606 0.604 0.364 0.032
#> SRR1413307 2 0.1860 0.7169 0.000 0.948 0.052
#> SRR1397720 2 0.5650 0.5838 0.000 0.688 0.312
#> SRR1358391 2 0.1860 0.7169 0.000 0.948 0.052
#> SRR1381185 1 0.4121 0.6710 0.832 0.000 0.168
#> SRR1100608 2 0.0000 0.7352 0.000 1.000 0.000
#> SRR1386927 2 0.0000 0.7352 0.000 1.000 0.000
#> SRR1331771 1 0.6641 0.5246 0.544 0.008 0.448
#> SRR1486322 1 0.6302 0.4943 0.520 0.000 0.480
#> SRR1080790 1 0.0592 0.7296 0.988 0.000 0.012
#> SRR1459980 1 0.0237 0.7301 0.996 0.000 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 1 0.4866 0.707 0.596 0.000 0.404 0.000
#> SRR1405147 1 0.0469 0.793 0.988 0.000 0.012 0.000
#> SRR1315412 2 0.1940 0.864 0.000 0.924 0.000 0.076
#> SRR1338384 1 0.0000 0.790 1.000 0.000 0.000 0.000
#> SRR1071105 3 0.6309 0.554 0.000 0.336 0.588 0.076
#> SRR1432868 2 0.0000 0.867 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0469 0.942 0.000 0.012 0.000 0.988
#> SRR1330723 2 0.3356 0.758 0.000 0.824 0.176 0.000
#> SRR1475324 1 0.4888 0.702 0.588 0.000 0.412 0.000
#> SRR1340260 1 0.0000 0.790 1.000 0.000 0.000 0.000
#> SRR1376450 3 0.7117 0.482 0.216 0.004 0.584 0.196
#> SRR1321897 1 0.4888 0.702 0.588 0.000 0.412 0.000
#> SRR1445194 1 0.0000 0.790 1.000 0.000 0.000 0.000
#> SRR1443308 1 0.6985 0.316 0.480 0.000 0.116 0.404
#> SRR1400931 1 0.5432 0.606 0.740 0.000 0.136 0.124
#> SRR1416188 1 0.4888 0.702 0.588 0.000 0.412 0.000
#> SRR1407044 1 0.4830 0.714 0.608 0.000 0.392 0.000
#> SRR1078392 1 0.2589 0.795 0.884 0.000 0.116 0.000
#> SRR1436468 1 0.4072 0.687 0.748 0.000 0.252 0.000
#> SRR1476125 3 0.6367 0.555 0.000 0.336 0.584 0.080
#> SRR1418747 1 0.2973 0.794 0.856 0.000 0.144 0.000
#> SRR1318089 1 0.4888 0.702 0.588 0.000 0.412 0.000
#> SRR1444370 1 0.0000 0.790 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.867 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0336 0.787 0.992 0.000 0.008 0.000
#> SRR1460337 3 0.7088 0.485 0.212 0.004 0.588 0.196
#> SRR1469062 1 0.2589 0.795 0.884 0.000 0.116 0.000
#> SRR1388459 1 0.4072 0.763 0.748 0.000 0.252 0.000
#> SRR1416841 1 0.4866 0.707 0.596 0.000 0.404 0.000
#> SRR1473778 1 0.0592 0.793 0.984 0.000 0.016 0.000
#> SRR1419561 1 0.3819 0.719 0.816 0.004 0.008 0.172
#> SRR1339987 1 0.2216 0.796 0.908 0.000 0.092 0.000
#> SRR1469662 1 0.0188 0.789 0.996 0.000 0.004 0.000
#> SRR1432958 1 0.4150 0.706 0.824 0.000 0.056 0.120
#> SRR1479198 1 0.0188 0.789 0.996 0.000 0.004 0.000
#> SRR1353600 1 0.2976 0.745 0.872 0.000 0.008 0.120
#> SRR1456492 1 0.3356 0.788 0.824 0.000 0.176 0.000
#> SRR1389955 1 0.0469 0.792 0.988 0.000 0.012 0.000
#> SRR1429540 1 0.0000 0.790 1.000 0.000 0.000 0.000
#> SRR1356057 1 0.5724 0.755 0.716 0.000 0.144 0.140
#> SRR1328715 1 0.0336 0.787 0.992 0.000 0.008 0.000
#> SRR1429429 1 0.4888 0.702 0.588 0.000 0.412 0.000
#> SRR1325201 3 0.6367 0.555 0.000 0.336 0.584 0.080
#> SRR1382978 1 0.4877 0.705 0.592 0.000 0.408 0.000
#> SRR1406348 2 0.2647 0.815 0.000 0.880 0.120 0.000
#> SRR1469390 2 0.1940 0.864 0.000 0.924 0.000 0.076
#> SRR1376380 1 0.4888 0.702 0.588 0.000 0.412 0.000
#> SRR1418225 4 0.0592 0.940 0.000 0.016 0.000 0.984
#> SRR1418473 2 0.1940 0.864 0.000 0.924 0.000 0.076
#> SRR1376741 1 0.0000 0.790 1.000 0.000 0.000 0.000
#> SRR1431823 1 0.4888 0.702 0.588 0.000 0.412 0.000
#> SRR1447916 2 0.0469 0.870 0.000 0.988 0.000 0.012
#> SRR1458643 4 0.2433 0.889 0.060 0.012 0.008 0.920
#> SRR1445618 1 0.1151 0.784 0.968 0.000 0.008 0.024
#> SRR1081589 4 0.2510 0.883 0.064 0.012 0.008 0.916
#> SRR1097245 1 0.2976 0.745 0.872 0.000 0.008 0.120
#> SRR1416141 1 0.1398 0.781 0.956 0.000 0.004 0.040
#> SRR1404339 2 0.3311 0.762 0.000 0.828 0.172 0.000
#> SRR1478614 1 0.6883 0.284 0.584 0.000 0.260 0.156
#> SRR1406135 1 0.6644 0.461 0.640 0.004 0.164 0.192
#> SRR1413307 4 0.0469 0.942 0.000 0.012 0.000 0.988
#> SRR1397720 2 0.0000 0.867 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0469 0.942 0.000 0.012 0.000 0.988
#> SRR1381185 1 0.4008 0.766 0.756 0.000 0.244 0.000
#> SRR1100608 2 0.5100 0.718 0.000 0.756 0.168 0.076
#> SRR1386927 2 0.1940 0.864 0.000 0.924 0.000 0.076
#> SRR1331771 1 0.5346 0.774 0.732 0.000 0.192 0.076
#> SRR1486322 1 0.4888 0.702 0.588 0.000 0.412 0.000
#> SRR1080790 1 0.3528 0.784 0.808 0.000 0.192 0.000
#> SRR1459980 1 0.2973 0.794 0.856 0.000 0.144 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0290 0.8190 0.008 0.000 0.992 0.000 0.000
#> SRR1405147 1 0.2970 0.6538 0.828 0.000 0.168 0.004 0.000
#> SRR1315412 2 0.4924 0.5844 0.000 0.552 0.000 0.028 0.420
#> SRR1338384 1 0.3681 0.6686 0.808 0.044 0.148 0.000 0.000
#> SRR1071105 5 0.0162 0.4962 0.000 0.004 0.000 0.000 0.996
#> SRR1432868 2 0.3452 0.6641 0.000 0.756 0.000 0.000 0.244
#> SRR1454480 4 0.0579 0.8675 0.008 0.000 0.000 0.984 0.008
#> SRR1330723 5 0.4249 -0.3374 0.000 0.432 0.000 0.000 0.568
#> SRR1475324 3 0.0162 0.8201 0.004 0.000 0.996 0.000 0.000
#> SRR1340260 1 0.2773 0.6576 0.836 0.000 0.164 0.000 0.000
#> SRR1376450 5 0.8303 0.1671 0.020 0.244 0.120 0.168 0.448
#> SRR1321897 3 0.1043 0.8003 0.040 0.000 0.960 0.000 0.000
#> SRR1445194 1 0.4649 0.6372 0.708 0.244 0.044 0.004 0.000
#> SRR1443308 4 0.6748 0.1077 0.228 0.000 0.328 0.440 0.004
#> SRR1400931 1 0.9875 0.2010 0.252 0.244 0.152 0.172 0.180
#> SRR1416188 3 0.0162 0.8201 0.004 0.000 0.996 0.000 0.000
#> SRR1407044 1 0.4268 0.1724 0.556 0.000 0.444 0.000 0.000
#> SRR1078392 1 0.1430 0.6604 0.944 0.000 0.052 0.004 0.000
#> SRR1436468 3 0.4341 0.3031 0.404 0.000 0.592 0.004 0.000
#> SRR1476125 5 0.0000 0.4982 0.000 0.000 0.000 0.000 1.000
#> SRR1418747 1 0.2629 0.6348 0.860 0.000 0.136 0.004 0.000
#> SRR1318089 3 0.0162 0.8201 0.004 0.000 0.996 0.000 0.000
#> SRR1444370 1 0.6148 0.6066 0.632 0.244 0.044 0.004 0.076
#> SRR1348929 2 0.3452 0.6641 0.000 0.756 0.000 0.000 0.244
#> SRR1385690 1 0.1430 0.6834 0.944 0.052 0.000 0.004 0.000
#> SRR1460337 5 0.8247 0.1659 0.016 0.244 0.120 0.172 0.448
#> SRR1469062 1 0.1430 0.6604 0.944 0.000 0.052 0.004 0.000
#> SRR1388459 3 0.3366 0.6355 0.212 0.000 0.784 0.004 0.000
#> SRR1416841 3 0.0290 0.8199 0.008 0.000 0.992 0.000 0.000
#> SRR1473778 1 0.2970 0.6538 0.828 0.000 0.168 0.004 0.000
#> SRR1419561 1 0.9018 0.4076 0.440 0.100 0.132 0.172 0.156
#> SRR1339987 1 0.0162 0.6752 0.996 0.000 0.000 0.004 0.000
#> SRR1469662 1 0.1990 0.6848 0.920 0.068 0.008 0.004 0.000
#> SRR1432958 1 0.8657 0.4532 0.428 0.244 0.132 0.156 0.040
#> SRR1479198 1 0.1357 0.6744 0.948 0.000 0.048 0.004 0.000
#> SRR1353600 1 0.6335 0.4535 0.572 0.244 0.000 0.172 0.012
#> SRR1456492 1 0.4350 -0.0498 0.588 0.000 0.408 0.004 0.000
#> SRR1389955 1 0.0671 0.6738 0.980 0.000 0.016 0.004 0.000
#> SRR1429540 1 0.2773 0.6576 0.836 0.000 0.164 0.000 0.000
#> SRR1356057 1 0.6417 -0.1873 0.424 0.000 0.404 0.172 0.000
#> SRR1328715 1 0.0324 0.6765 0.992 0.004 0.000 0.004 0.000
#> SRR1429429 3 0.0162 0.8201 0.004 0.000 0.996 0.000 0.000
#> SRR1325201 5 0.0000 0.4982 0.000 0.000 0.000 0.000 1.000
#> SRR1382978 3 0.0162 0.8201 0.004 0.000 0.996 0.000 0.000
#> SRR1406348 2 0.3534 0.6546 0.000 0.744 0.000 0.000 0.256
#> SRR1469390 2 0.4996 0.5826 0.000 0.548 0.000 0.032 0.420
#> SRR1376380 3 0.3534 0.6225 0.256 0.000 0.744 0.000 0.000
#> SRR1418225 4 0.0290 0.8656 0.000 0.000 0.000 0.992 0.008
#> SRR1418473 2 0.4924 0.5844 0.000 0.552 0.000 0.028 0.420
#> SRR1376741 1 0.2773 0.6576 0.836 0.000 0.164 0.000 0.000
#> SRR1431823 3 0.3143 0.6708 0.204 0.000 0.796 0.000 0.000
#> SRR1447916 2 0.3452 0.6641 0.000 0.756 0.000 0.000 0.244
#> SRR1458643 4 0.0955 0.8568 0.028 0.000 0.004 0.968 0.000
#> SRR1445618 1 0.7208 0.5756 0.544 0.244 0.156 0.016 0.040
#> SRR1081589 4 0.1041 0.8549 0.032 0.000 0.004 0.964 0.000
#> SRR1097245 1 0.6335 0.4535 0.572 0.244 0.000 0.172 0.012
#> SRR1416141 1 0.3934 0.6209 0.740 0.244 0.000 0.016 0.000
#> SRR1404339 5 0.4249 -0.3374 0.000 0.432 0.000 0.000 0.568
#> SRR1478614 2 0.9890 -0.4338 0.244 0.244 0.152 0.172 0.188
#> SRR1406135 1 0.9739 0.2028 0.280 0.244 0.116 0.172 0.188
#> SRR1413307 4 0.0451 0.8660 0.000 0.000 0.004 0.988 0.008
#> SRR1397720 2 0.3452 0.6641 0.000 0.756 0.000 0.000 0.244
#> SRR1358391 4 0.0579 0.8675 0.008 0.000 0.000 0.984 0.008
#> SRR1381185 3 0.4449 0.0610 0.484 0.000 0.512 0.004 0.000
#> SRR1100608 5 0.2209 0.4180 0.000 0.056 0.000 0.032 0.912
#> SRR1386927 2 0.4996 0.5826 0.000 0.548 0.000 0.032 0.420
#> SRR1331771 3 0.5374 0.5928 0.164 0.000 0.696 0.128 0.012
#> SRR1486322 3 0.0609 0.8139 0.020 0.000 0.980 0.000 0.000
#> SRR1080790 1 0.3741 0.5331 0.732 0.000 0.264 0.004 0.000
#> SRR1459980 1 0.3491 0.6014 0.768 0.000 0.228 0.004 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.1168 0.832 0.028 0.000 0.956 0.000 0.016 0.000
#> SRR1405147 5 0.4772 0.636 0.056 0.000 0.048 0.000 0.716 0.180
#> SRR1315412 2 0.0000 0.508 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 5 0.4264 0.371 0.332 0.000 0.032 0.000 0.636 0.000
#> SRR1071105 6 0.5954 0.745 0.220 0.372 0.000 0.000 0.000 0.408
#> SRR1432868 2 0.3756 0.606 0.000 0.600 0.000 0.000 0.000 0.400
#> SRR1454480 4 0.2762 0.877 0.000 0.196 0.000 0.804 0.000 0.000
#> SRR1330723 6 0.5509 0.559 0.164 0.292 0.000 0.000 0.000 0.544
#> SRR1475324 3 0.1851 0.826 0.036 0.000 0.928 0.024 0.012 0.000
#> SRR1340260 5 0.6187 0.580 0.208 0.000 0.048 0.000 0.560 0.184
#> SRR1376450 1 0.4775 0.737 0.688 0.152 0.004 0.000 0.156 0.000
#> SRR1321897 3 0.0146 0.834 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1445194 1 0.3934 0.813 0.708 0.000 0.032 0.000 0.260 0.000
#> SRR1443308 3 0.6537 0.392 0.000 0.168 0.552 0.196 0.080 0.004
#> SRR1400931 1 0.3488 0.821 0.764 0.000 0.016 0.004 0.216 0.000
#> SRR1416188 3 0.0405 0.834 0.000 0.000 0.988 0.004 0.008 0.000
#> SRR1407044 3 0.2964 0.688 0.000 0.000 0.792 0.000 0.204 0.004
#> SRR1078392 5 0.2955 0.630 0.000 0.000 0.004 0.172 0.816 0.008
#> SRR1436468 5 0.4572 0.525 0.064 0.000 0.264 0.000 0.668 0.004
#> SRR1476125 6 0.5954 0.745 0.220 0.372 0.000 0.000 0.000 0.408
#> SRR1418747 5 0.1010 0.674 0.000 0.000 0.036 0.000 0.960 0.004
#> SRR1318089 3 0.0260 0.835 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1444370 1 0.3956 0.811 0.704 0.000 0.032 0.000 0.264 0.000
#> SRR1348929 2 0.3756 0.606 0.000 0.600 0.000 0.000 0.000 0.400
#> SRR1385690 5 0.3874 0.599 0.068 0.000 0.000 0.172 0.760 0.000
#> SRR1460337 1 0.4382 0.764 0.720 0.124 0.000 0.000 0.156 0.000
#> SRR1469062 5 0.2814 0.629 0.000 0.000 0.000 0.172 0.820 0.008
#> SRR1388459 3 0.3671 0.701 0.036 0.000 0.756 0.000 0.208 0.000
#> SRR1416841 3 0.1794 0.827 0.036 0.000 0.924 0.000 0.040 0.000
#> SRR1473778 5 0.4858 0.634 0.060 0.000 0.048 0.000 0.708 0.184
#> SRR1419561 5 0.6010 0.023 0.352 0.000 0.016 0.156 0.476 0.000
#> SRR1339987 5 0.2814 0.629 0.000 0.000 0.000 0.172 0.820 0.008
#> SRR1469662 5 0.3758 0.558 0.192 0.000 0.004 0.040 0.764 0.000
#> SRR1432958 1 0.3586 0.820 0.712 0.000 0.004 0.004 0.280 0.000
#> SRR1479198 5 0.0865 0.676 0.000 0.000 0.036 0.000 0.964 0.000
#> SRR1353600 1 0.5239 0.769 0.600 0.152 0.000 0.000 0.248 0.000
#> SRR1456492 3 0.5672 0.372 0.000 0.000 0.560 0.172 0.260 0.008
#> SRR1389955 5 0.0777 0.671 0.004 0.000 0.024 0.000 0.972 0.000
#> SRR1429540 5 0.6187 0.580 0.208 0.000 0.048 0.000 0.560 0.184
#> SRR1356057 3 0.5705 0.359 0.000 0.000 0.552 0.172 0.268 0.008
#> SRR1328715 5 0.4020 0.605 0.068 0.000 0.008 0.160 0.764 0.000
#> SRR1429429 3 0.1679 0.831 0.036 0.000 0.936 0.012 0.016 0.000
#> SRR1325201 6 0.5939 0.744 0.216 0.372 0.000 0.000 0.000 0.412
#> SRR1382978 3 0.1245 0.833 0.032 0.000 0.952 0.000 0.016 0.000
#> SRR1406348 2 0.3756 0.606 0.000 0.600 0.000 0.000 0.000 0.400
#> SRR1469390 2 0.0000 0.508 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 3 0.1349 0.829 0.000 0.000 0.940 0.004 0.056 0.000
#> SRR1418225 4 0.2762 0.877 0.000 0.196 0.000 0.804 0.000 0.000
#> SRR1418473 2 0.0000 0.508 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 5 0.6069 0.593 0.188 0.000 0.048 0.000 0.580 0.184
#> SRR1431823 3 0.1007 0.832 0.000 0.000 0.956 0.000 0.044 0.000
#> SRR1447916 2 0.3756 0.606 0.000 0.600 0.000 0.000 0.000 0.400
#> SRR1458643 4 0.1088 0.771 0.000 0.016 0.000 0.960 0.024 0.000
#> SRR1445618 1 0.3812 0.818 0.712 0.000 0.024 0.000 0.264 0.000
#> SRR1081589 4 0.0632 0.754 0.000 0.000 0.000 0.976 0.024 0.000
#> SRR1097245 1 0.5239 0.769 0.600 0.152 0.000 0.000 0.248 0.000
#> SRR1416141 1 0.3448 0.820 0.716 0.000 0.000 0.004 0.280 0.000
#> SRR1404339 6 0.5509 0.559 0.164 0.292 0.000 0.000 0.000 0.544
#> SRR1478614 1 0.3329 0.802 0.792 0.000 0.020 0.004 0.184 0.000
#> SRR1406135 1 0.4858 0.812 0.676 0.092 0.012 0.000 0.220 0.000
#> SRR1413307 4 0.2762 0.877 0.000 0.196 0.000 0.804 0.000 0.000
#> SRR1397720 2 0.3756 0.606 0.000 0.600 0.000 0.000 0.000 0.400
#> SRR1358391 4 0.2762 0.877 0.000 0.196 0.000 0.804 0.000 0.000
#> SRR1381185 5 0.4888 0.259 0.056 0.000 0.380 0.000 0.560 0.004
#> SRR1100608 2 0.5723 -0.753 0.164 0.428 0.000 0.000 0.000 0.408
#> SRR1386927 2 0.0000 0.508 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.6110 0.449 0.012 0.148 0.588 0.024 0.224 0.004
#> SRR1486322 3 0.0260 0.835 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1080790 5 0.3290 0.578 0.000 0.000 0.252 0.000 0.744 0.004
#> SRR1459980 5 0.4005 0.621 0.056 0.000 0.192 0.000 0.748 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["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 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.970 0.955 0.981 0.3870 0.627 0.627
#> 3 3 0.946 0.924 0.969 0.3438 0.848 0.760
#> 4 4 0.906 0.889 0.959 0.3885 0.756 0.518
#> 5 5 0.774 0.779 0.875 0.0757 0.894 0.640
#> 6 6 0.807 0.738 0.846 0.0440 0.926 0.687
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 1 0.000 0.978 1.000 0.000
#> SRR1405147 1 0.000 0.978 1.000 0.000
#> SRR1315412 2 0.000 0.988 0.000 1.000
#> SRR1338384 1 0.000 0.978 1.000 0.000
#> SRR1071105 2 0.000 0.988 0.000 1.000
#> SRR1432868 2 0.000 0.988 0.000 1.000
#> SRR1454480 1 0.000 0.978 1.000 0.000
#> SRR1330723 2 0.000 0.988 0.000 1.000
#> SRR1475324 1 0.000 0.978 1.000 0.000
#> SRR1340260 1 0.000 0.978 1.000 0.000
#> SRR1376450 1 0.722 0.752 0.800 0.200
#> SRR1321897 1 0.000 0.978 1.000 0.000
#> SRR1445194 1 0.000 0.978 1.000 0.000
#> SRR1443308 1 0.000 0.978 1.000 0.000
#> SRR1400931 1 0.000 0.978 1.000 0.000
#> SRR1416188 1 0.000 0.978 1.000 0.000
#> SRR1407044 1 0.000 0.978 1.000 0.000
#> SRR1078392 1 0.000 0.978 1.000 0.000
#> SRR1436468 1 0.000 0.978 1.000 0.000
#> SRR1476125 2 0.000 0.988 0.000 1.000
#> SRR1418747 1 0.000 0.978 1.000 0.000
#> SRR1318089 1 0.000 0.978 1.000 0.000
#> SRR1444370 1 0.000 0.978 1.000 0.000
#> SRR1348929 2 0.000 0.988 0.000 1.000
#> SRR1385690 1 0.000 0.978 1.000 0.000
#> SRR1460337 1 0.722 0.752 0.800 0.200
#> SRR1469062 1 0.000 0.978 1.000 0.000
#> SRR1388459 1 0.000 0.978 1.000 0.000
#> SRR1416841 1 0.000 0.978 1.000 0.000
#> SRR1473778 1 0.000 0.978 1.000 0.000
#> SRR1419561 1 0.000 0.978 1.000 0.000
#> SRR1339987 1 0.000 0.978 1.000 0.000
#> SRR1469662 1 0.000 0.978 1.000 0.000
#> SRR1432958 1 0.000 0.978 1.000 0.000
#> SRR1479198 1 0.000 0.978 1.000 0.000
#> SRR1353600 1 0.000 0.978 1.000 0.000
#> SRR1456492 1 0.000 0.978 1.000 0.000
#> SRR1389955 1 0.000 0.978 1.000 0.000
#> SRR1429540 1 0.000 0.978 1.000 0.000
#> SRR1356057 1 0.000 0.978 1.000 0.000
#> SRR1328715 1 0.000 0.978 1.000 0.000
#> SRR1429429 1 0.000 0.978 1.000 0.000
#> SRR1325201 2 0.000 0.988 0.000 1.000
#> SRR1382978 1 0.000 0.978 1.000 0.000
#> SRR1406348 2 0.000 0.988 0.000 1.000
#> SRR1469390 2 0.000 0.988 0.000 1.000
#> SRR1376380 1 0.000 0.978 1.000 0.000
#> SRR1418225 2 0.000 0.988 0.000 1.000
#> SRR1418473 2 0.000 0.988 0.000 1.000
#> SRR1376741 1 0.000 0.978 1.000 0.000
#> SRR1431823 1 0.000 0.978 1.000 0.000
#> SRR1447916 2 0.000 0.988 0.000 1.000
#> SRR1458643 1 0.775 0.701 0.772 0.228
#> SRR1445618 1 0.000 0.978 1.000 0.000
#> SRR1081589 1 0.988 0.221 0.564 0.436
#> SRR1097245 1 0.000 0.978 1.000 0.000
#> SRR1416141 1 0.000 0.978 1.000 0.000
#> SRR1404339 2 0.000 0.988 0.000 1.000
#> SRR1478614 1 0.000 0.978 1.000 0.000
#> SRR1406135 1 0.327 0.921 0.940 0.060
#> SRR1413307 2 0.697 0.761 0.188 0.812
#> SRR1397720 2 0.000 0.988 0.000 1.000
#> SRR1358391 1 0.000 0.978 1.000 0.000
#> SRR1381185 1 0.000 0.978 1.000 0.000
#> SRR1100608 2 0.000 0.988 0.000 1.000
#> SRR1386927 2 0.000 0.988 0.000 1.000
#> SRR1331771 1 0.000 0.978 1.000 0.000
#> SRR1486322 1 0.000 0.978 1.000 0.000
#> SRR1080790 1 0.000 0.978 1.000 0.000
#> SRR1459980 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
#> SRR1433493 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1405147 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1071105 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1454480 3 0.0000 0.864 0.000 0.000 1.000
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1475324 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1340260 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1376450 1 0.4605 0.717 0.796 0.204 0.000
#> SRR1321897 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1445194 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1443308 3 0.2448 0.813 0.076 0.000 0.924
#> SRR1400931 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1416188 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1407044 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1078392 1 0.1411 0.944 0.964 0.000 0.036
#> SRR1436468 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1418747 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1318089 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1444370 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1385690 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1460337 1 0.4702 0.704 0.788 0.212 0.000
#> SRR1469062 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1388459 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1416841 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1473778 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1419561 1 0.0237 0.963 0.996 0.000 0.004
#> SRR1339987 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1469662 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1353600 3 0.5926 0.502 0.356 0.000 0.644
#> SRR1456492 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1389955 1 0.0237 0.964 0.996 0.000 0.004
#> SRR1429540 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1356057 1 0.6008 0.366 0.628 0.000 0.372
#> SRR1328715 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1429429 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1382978 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376380 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1418225 3 0.0000 0.864 0.000 0.000 1.000
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1431823 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1458643 3 0.0000 0.864 0.000 0.000 1.000
#> SRR1445618 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1081589 3 0.0000 0.864 0.000 0.000 1.000
#> SRR1097245 3 0.5560 0.614 0.300 0.000 0.700
#> SRR1416141 1 0.5905 0.373 0.648 0.000 0.352
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1406135 1 0.1289 0.937 0.968 0.032 0.000
#> SRR1413307 3 0.0000 0.864 0.000 0.000 1.000
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1358391 3 0.0000 0.864 0.000 0.000 1.000
#> SRR1381185 1 0.0000 0.964 1.000 0.000 0.000
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1386927 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1331771 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1486322 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1080790 1 0.0237 0.964 0.996 0.000 0.004
#> SRR1459980 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
#> SRR1433493 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.3873 0.69993 0.772 0.000 0.228 0.000
#> SRR1315412 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1071105 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1432868 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0000 0.93692 0.000 0.000 0.000 1.000
#> SRR1330723 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.4072 0.68222 0.748 0.252 0.000 0.000
#> SRR1321897 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1445194 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1443308 4 0.4564 0.48578 0.000 0.000 0.328 0.672
#> SRR1400931 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1078392 3 0.2921 0.77935 0.000 0.000 0.860 0.140
#> SRR1436468 1 0.0188 0.92887 0.996 0.000 0.004 0.000
#> SRR1476125 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1418747 3 0.4985 -0.00687 0.468 0.000 0.532 0.000
#> SRR1318089 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.3796 0.82116 0.848 0.000 0.056 0.096
#> SRR1460337 1 0.0188 0.92891 0.996 0.004 0.000 0.000
#> SRR1469062 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1388459 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1419561 1 0.1557 0.89380 0.944 0.000 0.000 0.056
#> SRR1339987 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1469662 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.2408 0.84443 0.896 0.000 0.104 0.000
#> SRR1353600 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1389955 1 0.4996 0.11500 0.516 0.000 0.484 0.000
#> SRR1429540 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1356057 3 0.4994 -0.03908 0.000 0.000 0.520 0.480
#> SRR1328715 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1382978 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1418225 4 0.0000 0.93692 0.000 0.000 0.000 1.000
#> SRR1418473 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1431823 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1447916 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.0000 0.93692 0.000 0.000 0.000 1.000
#> SRR1445618 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.0000 0.93692 0.000 0.000 0.000 1.000
#> SRR1097245 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1404339 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0000 0.93112 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.3219 0.78821 0.836 0.164 0.000 0.000
#> SRR1413307 4 0.0000 0.93692 0.000 0.000 0.000 1.000
#> SRR1397720 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0000 0.93692 0.000 0.000 0.000 1.000
#> SRR1381185 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1100608 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1386927 2 0.0000 1.00000 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1486322 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.0000 0.93880 0.000 0.000 1.000 0.000
#> SRR1459980 3 0.0336 0.93058 0.008 0.000 0.992 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1405147 1 0.5575 0.429 0.640 0.000 0.212 0.000 0.148
#> SRR1315412 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.1197 0.868 0.952 0.000 0.000 0.000 0.048
#> SRR1071105 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0404 0.838 0.000 0.000 0.000 0.988 0.012
#> SRR1330723 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.1121 0.881 0.000 0.000 0.956 0.000 0.044
#> SRR1340260 1 0.1851 0.852 0.912 0.000 0.000 0.000 0.088
#> SRR1376450 5 0.6301 0.465 0.216 0.252 0.000 0.000 0.532
#> SRR1321897 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1445194 5 0.4171 0.447 0.396 0.000 0.000 0.000 0.604
#> SRR1443308 4 0.3086 0.729 0.000 0.000 0.180 0.816 0.004
#> SRR1400931 1 0.0963 0.874 0.964 0.000 0.000 0.000 0.036
#> SRR1416188 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 3 0.3983 0.330 0.000 0.000 0.660 0.000 0.340
#> SRR1078392 3 0.5031 0.527 0.032 0.000 0.684 0.024 0.260
#> SRR1436468 1 0.0671 0.881 0.980 0.000 0.004 0.000 0.016
#> SRR1476125 2 0.2408 0.878 0.092 0.892 0.000 0.000 0.016
#> SRR1418747 5 0.4283 0.258 0.000 0.000 0.456 0.000 0.544
#> SRR1318089 3 0.0510 0.898 0.000 0.000 0.984 0.000 0.016
#> SRR1444370 5 0.4201 0.404 0.408 0.000 0.000 0.000 0.592
#> SRR1348929 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 5 0.5578 0.619 0.104 0.000 0.120 0.060 0.716
#> SRR1460337 1 0.2331 0.849 0.900 0.020 0.000 0.000 0.080
#> SRR1469062 3 0.3231 0.685 0.000 0.000 0.800 0.004 0.196
#> SRR1388459 3 0.2291 0.834 0.036 0.000 0.908 0.000 0.056
#> SRR1416841 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1473778 1 0.0162 0.881 0.996 0.000 0.000 0.000 0.004
#> SRR1419561 1 0.5684 0.225 0.564 0.000 0.000 0.096 0.340
#> SRR1339987 5 0.4242 0.319 0.000 0.000 0.428 0.000 0.572
#> SRR1469662 5 0.3949 0.515 0.332 0.000 0.000 0.000 0.668
#> SRR1432958 1 0.0963 0.874 0.964 0.000 0.000 0.000 0.036
#> SRR1479198 5 0.5673 0.601 0.132 0.000 0.252 0.000 0.616
#> SRR1353600 1 0.1568 0.867 0.944 0.000 0.000 0.020 0.036
#> SRR1456492 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1389955 5 0.2690 0.551 0.000 0.000 0.156 0.000 0.844
#> SRR1429540 1 0.0000 0.879 1.000 0.000 0.000 0.000 0.000
#> SRR1356057 4 0.5121 0.521 0.040 0.000 0.300 0.648 0.012
#> SRR1328715 1 0.1908 0.849 0.908 0.000 0.000 0.000 0.092
#> SRR1429429 3 0.1197 0.878 0.000 0.000 0.952 0.000 0.048
#> SRR1325201 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1382978 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1406348 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1418225 4 0.0162 0.838 0.000 0.000 0.000 0.996 0.004
#> SRR1418473 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.1965 0.845 0.904 0.000 0.000 0.000 0.096
#> SRR1431823 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1447916 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.3895 0.733 0.000 0.000 0.000 0.680 0.320
#> SRR1445618 1 0.1270 0.872 0.948 0.000 0.000 0.000 0.052
#> SRR1081589 4 0.3913 0.730 0.000 0.000 0.000 0.676 0.324
#> SRR1097245 1 0.0404 0.878 0.988 0.000 0.000 0.000 0.012
#> SRR1416141 5 0.4161 0.407 0.392 0.000 0.000 0.000 0.608
#> SRR1404339 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.0290 0.879 0.992 0.000 0.000 0.000 0.008
#> SRR1406135 5 0.5535 0.536 0.256 0.116 0.000 0.000 0.628
#> SRR1413307 4 0.0162 0.838 0.000 0.000 0.000 0.996 0.004
#> SRR1397720 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.838 0.000 0.000 0.000 1.000 0.000
#> SRR1381185 3 0.1444 0.871 0.040 0.000 0.948 0.000 0.012
#> SRR1100608 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> SRR1386927 2 0.0404 0.981 0.000 0.988 0.000 0.012 0.000
#> SRR1331771 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1486322 3 0.0000 0.905 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 5 0.4300 0.203 0.000 0.000 0.476 0.000 0.524
#> SRR1459980 3 0.4161 0.639 0.040 0.000 0.752 0.000 0.208
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.1444 0.887 0.000 0.000 0.928 0.072 0.000 0.000
#> SRR1405147 5 0.6838 0.189 0.200 0.000 0.044 0.280 0.464 0.012
#> SRR1315412 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 1 0.0405 0.731 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR1071105 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.3847 0.308 0.000 0.000 0.000 0.544 0.000 0.456
#> SRR1330723 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1475324 3 0.2817 0.852 0.000 0.000 0.868 0.072 0.052 0.008
#> SRR1340260 1 0.5259 0.591 0.600 0.000 0.000 0.240 0.160 0.000
#> SRR1376450 5 0.3450 0.613 0.012 0.208 0.000 0.008 0.772 0.000
#> SRR1321897 3 0.0260 0.899 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1445194 5 0.1858 0.741 0.092 0.000 0.000 0.004 0.904 0.000
#> SRR1443308 4 0.4672 0.189 0.000 0.000 0.432 0.532 0.008 0.028
#> SRR1400931 1 0.0363 0.735 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1416188 3 0.0260 0.899 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1407044 3 0.1226 0.881 0.000 0.000 0.952 0.004 0.040 0.004
#> SRR1078392 5 0.5154 0.618 0.004 0.000 0.088 0.256 0.640 0.012
#> SRR1436468 1 0.3763 0.711 0.736 0.000 0.012 0.240 0.012 0.000
#> SRR1476125 1 0.4524 -0.152 0.492 0.484 0.000 0.004 0.004 0.016
#> SRR1418747 5 0.3772 0.527 0.000 0.000 0.320 0.004 0.672 0.004
#> SRR1318089 3 0.1297 0.893 0.000 0.000 0.948 0.040 0.012 0.000
#> SRR1444370 5 0.2053 0.737 0.108 0.000 0.000 0.004 0.888 0.000
#> SRR1348929 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.2280 0.748 0.016 0.000 0.036 0.028 0.912 0.008
#> SRR1460337 1 0.6184 0.598 0.580 0.076 0.000 0.212 0.132 0.000
#> SRR1469062 3 0.2007 0.859 0.000 0.000 0.916 0.004 0.036 0.044
#> SRR1388459 3 0.5154 0.486 0.004 0.000 0.600 0.292 0.104 0.000
#> SRR1416841 3 0.1444 0.887 0.000 0.000 0.928 0.072 0.000 0.000
#> SRR1473778 1 0.3221 0.734 0.792 0.000 0.000 0.188 0.020 0.000
#> SRR1419561 5 0.4647 0.654 0.096 0.000 0.000 0.196 0.700 0.008
#> SRR1339987 5 0.1610 0.741 0.000 0.000 0.084 0.000 0.916 0.000
#> SRR1469662 5 0.1349 0.745 0.056 0.000 0.000 0.004 0.940 0.000
#> SRR1432958 1 0.0260 0.736 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1479198 5 0.1863 0.750 0.016 0.000 0.060 0.004 0.920 0.000
#> SRR1353600 1 0.1382 0.716 0.948 0.000 0.000 0.036 0.008 0.008
#> SRR1456492 3 0.0820 0.898 0.000 0.000 0.972 0.016 0.012 0.000
#> SRR1389955 5 0.2030 0.742 0.000 0.000 0.064 0.000 0.908 0.028
#> SRR1429540 1 0.3261 0.729 0.780 0.000 0.000 0.204 0.016 0.000
#> SRR1356057 4 0.0964 0.321 0.004 0.000 0.016 0.968 0.000 0.012
#> SRR1328715 1 0.5812 0.424 0.496 0.000 0.000 0.268 0.236 0.000
#> SRR1429429 3 0.3783 0.811 0.000 0.000 0.816 0.072 0.060 0.052
#> SRR1325201 2 0.1732 0.912 0.072 0.920 0.000 0.000 0.004 0.004
#> SRR1382978 3 0.1444 0.887 0.000 0.000 0.928 0.072 0.000 0.000
#> SRR1406348 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0146 0.983 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1376380 3 0.0260 0.899 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1418225 4 0.3707 0.549 0.000 0.000 0.000 0.680 0.008 0.312
#> SRR1418473 2 0.0291 0.981 0.000 0.992 0.000 0.000 0.004 0.004
#> SRR1376741 5 0.5826 0.310 0.236 0.000 0.000 0.272 0.492 0.000
#> SRR1431823 3 0.0260 0.899 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1447916 2 0.0146 0.983 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1458643 6 0.1588 1.000 0.000 0.000 0.000 0.072 0.004 0.924
#> SRR1445618 1 0.4172 0.712 0.724 0.000 0.000 0.204 0.072 0.000
#> SRR1081589 6 0.1588 1.000 0.000 0.000 0.000 0.072 0.004 0.924
#> SRR1097245 1 0.0260 0.736 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1416141 5 0.5861 0.299 0.204 0.000 0.000 0.004 0.504 0.288
#> SRR1404339 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.0405 0.737 0.988 0.000 0.000 0.004 0.008 0.000
#> SRR1406135 5 0.1972 0.735 0.024 0.056 0.000 0.000 0.916 0.004
#> SRR1413307 4 0.3409 0.561 0.000 0.000 0.000 0.700 0.000 0.300
#> SRR1397720 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.3409 0.561 0.000 0.000 0.000 0.700 0.000 0.300
#> SRR1381185 3 0.4034 0.632 0.008 0.000 0.708 0.260 0.024 0.000
#> SRR1100608 2 0.0508 0.975 0.000 0.984 0.000 0.004 0.000 0.012
#> SRR1386927 2 0.1788 0.910 0.000 0.916 0.000 0.076 0.004 0.004
#> SRR1331771 3 0.0405 0.898 0.000 0.000 0.988 0.004 0.008 0.000
#> SRR1486322 3 0.0603 0.899 0.000 0.000 0.980 0.016 0.004 0.000
#> SRR1080790 5 0.2664 0.679 0.000 0.000 0.184 0.000 0.816 0.000
#> SRR1459980 5 0.5062 0.622 0.016 0.000 0.088 0.248 0.648 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 17667 rows and 70 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 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.645 0.825 0.914 0.4108 0.599 0.599
#> 3 3 0.728 0.829 0.923 0.5069 0.786 0.642
#> 4 4 0.770 0.828 0.923 0.1150 0.923 0.800
#> 5 5 0.701 0.705 0.862 0.0496 0.995 0.982
#> 6 6 0.739 0.729 0.858 0.0444 0.925 0.758
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 1 0.000 0.900 1.000 0.000
#> SRR1405147 2 0.881 0.624 0.300 0.700
#> SRR1315412 2 0.000 0.899 0.000 1.000
#> SRR1338384 2 0.278 0.907 0.048 0.952
#> SRR1071105 2 0.224 0.910 0.036 0.964
#> SRR1432868 2 0.000 0.899 0.000 1.000
#> SRR1454480 2 0.224 0.910 0.036 0.964
#> SRR1330723 2 0.000 0.899 0.000 1.000
#> SRR1475324 1 0.000 0.900 1.000 0.000
#> SRR1340260 2 0.833 0.683 0.264 0.736
#> SRR1376450 2 0.224 0.910 0.036 0.964
#> SRR1321897 1 0.141 0.901 0.980 0.020
#> SRR1445194 2 0.260 0.908 0.044 0.956
#> SRR1443308 1 0.141 0.901 0.980 0.020
#> SRR1400931 2 0.224 0.910 0.036 0.964
#> SRR1416188 1 0.000 0.900 1.000 0.000
#> SRR1407044 1 0.625 0.790 0.844 0.156
#> SRR1078392 2 0.518 0.862 0.116 0.884
#> SRR1436468 1 0.689 0.762 0.816 0.184
#> SRR1476125 2 0.000 0.899 0.000 1.000
#> SRR1418747 2 0.958 0.437 0.380 0.620
#> SRR1318089 1 0.000 0.900 1.000 0.000
#> SRR1444370 2 0.224 0.910 0.036 0.964
#> SRR1348929 2 0.000 0.899 0.000 1.000
#> SRR1385690 2 0.295 0.905 0.052 0.948
#> SRR1460337 2 0.224 0.910 0.036 0.964
#> SRR1469062 2 0.876 0.617 0.296 0.704
#> SRR1388459 1 0.529 0.826 0.880 0.120
#> SRR1416841 1 0.000 0.900 1.000 0.000
#> SRR1473778 2 0.802 0.710 0.244 0.756
#> SRR1419561 2 0.278 0.907 0.048 0.952
#> SRR1339987 2 0.373 0.895 0.072 0.928
#> SRR1469662 2 0.295 0.905 0.052 0.948
#> SRR1432958 2 0.224 0.910 0.036 0.964
#> SRR1479198 2 0.373 0.895 0.072 0.928
#> SRR1353600 2 0.224 0.910 0.036 0.964
#> SRR1456492 1 0.808 0.672 0.752 0.248
#> SRR1389955 2 0.373 0.895 0.072 0.928
#> SRR1429540 2 0.808 0.705 0.248 0.752
#> SRR1356057 1 0.946 0.410 0.636 0.364
#> SRR1328715 2 0.506 0.865 0.112 0.888
#> SRR1429429 1 0.000 0.900 1.000 0.000
#> SRR1325201 2 0.000 0.899 0.000 1.000
#> SRR1382978 1 0.000 0.900 1.000 0.000
#> SRR1406348 2 0.000 0.899 0.000 1.000
#> SRR1469390 2 0.000 0.899 0.000 1.000
#> SRR1376380 1 0.141 0.901 0.980 0.020
#> SRR1418225 2 0.224 0.910 0.036 0.964
#> SRR1418473 2 0.000 0.899 0.000 1.000
#> SRR1376741 2 0.991 0.267 0.444 0.556
#> SRR1431823 1 0.141 0.901 0.980 0.020
#> SRR1447916 2 0.000 0.899 0.000 1.000
#> SRR1458643 2 0.224 0.910 0.036 0.964
#> SRR1445618 2 0.224 0.910 0.036 0.964
#> SRR1081589 2 0.224 0.910 0.036 0.964
#> SRR1097245 2 0.224 0.910 0.036 0.964
#> SRR1416141 2 0.224 0.910 0.036 0.964
#> SRR1404339 2 0.000 0.899 0.000 1.000
#> SRR1478614 2 0.224 0.910 0.036 0.964
#> SRR1406135 2 0.295 0.905 0.052 0.948
#> SRR1413307 2 0.697 0.767 0.188 0.812
#> SRR1397720 2 0.000 0.899 0.000 1.000
#> SRR1358391 2 0.224 0.910 0.036 0.964
#> SRR1381185 2 0.997 0.188 0.468 0.532
#> SRR1100608 2 0.000 0.899 0.000 1.000
#> SRR1386927 2 0.000 0.899 0.000 1.000
#> SRR1331771 1 0.141 0.901 0.980 0.020
#> SRR1486322 1 0.000 0.900 1.000 0.000
#> SRR1080790 1 0.943 0.412 0.640 0.360
#> SRR1459980 2 0.998 0.174 0.472 0.528
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1405147 1 0.5254 0.661 0.736 0.000 0.264
#> SRR1315412 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1338384 1 0.0592 0.882 0.988 0.000 0.012
#> SRR1071105 1 0.5785 0.515 0.668 0.332 0.000
#> SRR1432868 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1454480 1 0.0237 0.881 0.996 0.004 0.000
#> SRR1330723 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1475324 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1340260 1 0.4887 0.708 0.772 0.000 0.228
#> SRR1376450 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1321897 3 0.0892 0.886 0.020 0.000 0.980
#> SRR1445194 1 0.0424 0.883 0.992 0.000 0.008
#> SRR1443308 3 0.0892 0.886 0.020 0.000 0.980
#> SRR1400931 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1416188 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1407044 3 0.3941 0.777 0.156 0.000 0.844
#> SRR1078392 1 0.2537 0.850 0.920 0.000 0.080
#> SRR1436468 3 0.4796 0.702 0.220 0.000 0.780
#> SRR1476125 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1418747 1 0.5859 0.496 0.656 0.000 0.344
#> SRR1318089 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1444370 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1348929 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1385690 1 0.0747 0.881 0.984 0.000 0.016
#> SRR1460337 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1469062 1 0.5216 0.640 0.740 0.000 0.260
#> SRR1388459 3 0.3879 0.780 0.152 0.000 0.848
#> SRR1416841 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1473778 1 0.4654 0.730 0.792 0.000 0.208
#> SRR1419561 1 0.0592 0.882 0.988 0.000 0.012
#> SRR1339987 1 0.1411 0.875 0.964 0.000 0.036
#> SRR1469662 1 0.0747 0.881 0.984 0.000 0.016
#> SRR1432958 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1479198 1 0.1411 0.875 0.964 0.000 0.036
#> SRR1353600 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1456492 3 0.5431 0.604 0.284 0.000 0.716
#> SRR1389955 1 0.1411 0.875 0.964 0.000 0.036
#> SRR1429540 1 0.4702 0.726 0.788 0.000 0.212
#> SRR1356057 3 0.6126 0.304 0.400 0.000 0.600
#> SRR1328715 1 0.2448 0.851 0.924 0.000 0.076
#> SRR1429429 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1325201 2 0.0592 0.991 0.012 0.988 0.000
#> SRR1382978 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1406348 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1469390 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1376380 3 0.0892 0.886 0.020 0.000 0.980
#> SRR1418225 1 0.0237 0.881 0.996 0.004 0.000
#> SRR1418473 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1376741 1 0.6154 0.356 0.592 0.000 0.408
#> SRR1431823 3 0.0892 0.886 0.020 0.000 0.980
#> SRR1447916 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1458643 1 0.0237 0.881 0.996 0.004 0.000
#> SRR1445618 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1081589 1 0.0237 0.881 0.996 0.004 0.000
#> SRR1097245 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1404339 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1478614 1 0.0000 0.883 1.000 0.000 0.000
#> SRR1406135 1 0.0747 0.881 0.984 0.000 0.016
#> SRR1413307 1 0.4629 0.701 0.808 0.004 0.188
#> SRR1397720 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1358391 1 0.0237 0.881 0.996 0.004 0.000
#> SRR1381185 1 0.6225 0.290 0.568 0.000 0.432
#> SRR1100608 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1386927 2 0.0237 0.999 0.004 0.996 0.000
#> SRR1331771 3 0.0892 0.886 0.020 0.000 0.980
#> SRR1486322 3 0.0000 0.884 0.000 0.000 1.000
#> SRR1080790 3 0.5948 0.413 0.360 0.000 0.640
#> SRR1459980 1 0.6235 0.277 0.564 0.000 0.436
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.859 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.4072 0.672 0.748 0.000 0.252 0.000
#> SRR1315412 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.869 1.000 0.000 0.000 0.000
#> SRR1071105 1 0.5038 0.500 0.652 0.336 0.000 0.012
#> SRR1432868 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0000 0.961 0.000 0.000 0.000 1.000
#> SRR1330723 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.859 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.3764 0.717 0.784 0.000 0.216 0.000
#> SRR1376450 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1321897 3 0.1022 0.862 0.032 0.000 0.968 0.000
#> SRR1445194 1 0.0188 0.869 0.996 0.000 0.000 0.004
#> SRR1443308 3 0.1022 0.862 0.032 0.000 0.968 0.000
#> SRR1400931 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1416188 3 0.0000 0.859 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.3266 0.758 0.168 0.000 0.832 0.000
#> SRR1078392 1 0.1792 0.845 0.932 0.000 0.068 0.000
#> SRR1436468 3 0.3907 0.685 0.232 0.000 0.768 0.000
#> SRR1476125 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1418747 1 0.4585 0.515 0.668 0.000 0.332 0.000
#> SRR1318089 3 0.0000 0.859 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1348929 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0188 0.869 0.996 0.000 0.004 0.000
#> SRR1460337 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1469062 1 0.4040 0.643 0.752 0.000 0.248 0.000
#> SRR1388459 3 0.3172 0.765 0.160 0.000 0.840 0.000
#> SRR1416841 3 0.0000 0.859 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.3569 0.737 0.804 0.000 0.196 0.000
#> SRR1419561 1 0.0000 0.869 1.000 0.000 0.000 0.000
#> SRR1339987 1 0.0817 0.865 0.976 0.000 0.024 0.000
#> SRR1469662 1 0.0188 0.869 0.996 0.000 0.004 0.000
#> SRR1432958 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1479198 1 0.0817 0.865 0.976 0.000 0.024 0.000
#> SRR1353600 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1456492 3 0.4382 0.583 0.296 0.000 0.704 0.000
#> SRR1389955 1 0.0817 0.865 0.976 0.000 0.024 0.000
#> SRR1429540 1 0.3610 0.733 0.800 0.000 0.200 0.000
#> SRR1356057 3 0.4888 0.266 0.412 0.000 0.588 0.000
#> SRR1328715 1 0.1716 0.845 0.936 0.000 0.064 0.000
#> SRR1429429 3 0.0000 0.859 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0376 0.990 0.004 0.992 0.000 0.004
#> SRR1382978 3 0.0000 0.859 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.1022 0.862 0.032 0.000 0.968 0.000
#> SRR1418225 4 0.0000 0.961 0.000 0.000 0.000 1.000
#> SRR1418473 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.4843 0.387 0.604 0.000 0.396 0.000
#> SRR1431823 3 0.1022 0.862 0.032 0.000 0.968 0.000
#> SRR1447916 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.0000 0.961 0.000 0.000 0.000 1.000
#> SRR1445618 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1081589 4 0.0000 0.961 0.000 0.000 0.000 1.000
#> SRR1097245 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1416141 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1404339 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0469 0.869 0.988 0.000 0.000 0.012
#> SRR1406135 1 0.0188 0.869 0.996 0.000 0.004 0.000
#> SRR1413307 4 0.3486 0.781 0.000 0.000 0.188 0.812
#> SRR1397720 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0000 0.961 0.000 0.000 0.000 1.000
#> SRR1381185 1 0.4907 0.323 0.580 0.000 0.420 0.000
#> SRR1100608 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1386927 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.1022 0.862 0.032 0.000 0.968 0.000
#> SRR1486322 3 0.0000 0.859 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.4761 0.402 0.372 0.000 0.628 0.000
#> SRR1459980 1 0.4916 0.311 0.576 0.000 0.424 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.2471 0.778 0.000 0.000 0.864 0.000 0.136
#> SRR1405147 1 0.5008 0.699 0.708 0.000 0.152 0.000 0.140
#> SRR1315412 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.0609 0.862 0.980 0.000 0.000 0.000 0.020
#> SRR1071105 1 0.5528 0.514 0.644 0.140 0.000 0.000 0.216
#> SRR1432868 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.971 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 2 0.1851 0.677 0.000 0.912 0.000 0.000 0.088
#> SRR1475324 3 0.2471 0.778 0.000 0.000 0.864 0.000 0.136
#> SRR1340260 1 0.4630 0.737 0.744 0.000 0.116 0.000 0.140
#> SRR1376450 1 0.0703 0.859 0.976 0.000 0.000 0.000 0.024
#> SRR1321897 3 0.0404 0.786 0.012 0.000 0.988 0.000 0.000
#> SRR1445194 1 0.0912 0.861 0.972 0.000 0.012 0.000 0.016
#> SRR1443308 3 0.3355 0.702 0.012 0.000 0.804 0.000 0.184
#> SRR1400931 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1416188 3 0.1197 0.784 0.000 0.000 0.952 0.000 0.048
#> SRR1407044 3 0.2605 0.709 0.148 0.000 0.852 0.000 0.000
#> SRR1078392 1 0.2520 0.840 0.896 0.000 0.048 0.000 0.056
#> SRR1436468 3 0.5466 0.564 0.192 0.000 0.656 0.000 0.152
#> SRR1476125 2 0.4307 -0.975 0.000 0.504 0.000 0.000 0.496
#> SRR1418747 1 0.4984 0.545 0.640 0.000 0.308 0.000 0.052
#> SRR1318089 3 0.2471 0.778 0.000 0.000 0.864 0.000 0.136
#> SRR1444370 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1348929 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.0703 0.860 0.976 0.000 0.024 0.000 0.000
#> SRR1460337 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1469062 1 0.4040 0.649 0.724 0.000 0.260 0.000 0.016
#> SRR1388459 3 0.4930 0.664 0.144 0.000 0.716 0.000 0.140
#> SRR1416841 3 0.2471 0.778 0.000 0.000 0.864 0.000 0.136
#> SRR1473778 1 0.4170 0.760 0.780 0.000 0.080 0.000 0.140
#> SRR1419561 1 0.0898 0.861 0.972 0.000 0.020 0.000 0.008
#> SRR1339987 1 0.1121 0.857 0.956 0.000 0.044 0.000 0.000
#> SRR1469662 1 0.0609 0.861 0.980 0.000 0.020 0.000 0.000
#> SRR1432958 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1479198 1 0.1121 0.857 0.956 0.000 0.044 0.000 0.000
#> SRR1353600 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1456492 3 0.5128 0.504 0.268 0.000 0.656 0.000 0.076
#> SRR1389955 1 0.1121 0.857 0.956 0.000 0.044 0.000 0.000
#> SRR1429540 1 0.4212 0.757 0.776 0.000 0.080 0.000 0.144
#> SRR1356057 3 0.6171 0.103 0.372 0.000 0.488 0.000 0.140
#> SRR1328715 1 0.2450 0.842 0.896 0.000 0.028 0.000 0.076
#> SRR1429429 3 0.2471 0.778 0.000 0.000 0.864 0.000 0.136
#> SRR1325201 5 0.4307 0.000 0.000 0.496 0.000 0.000 0.504
#> SRR1382978 3 0.2471 0.778 0.000 0.000 0.864 0.000 0.136
#> SRR1406348 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.0404 0.786 0.012 0.000 0.988 0.000 0.000
#> SRR1418225 4 0.0000 0.971 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.5956 0.474 0.564 0.000 0.296 0.000 0.140
#> SRR1431823 3 0.0404 0.786 0.012 0.000 0.988 0.000 0.000
#> SRR1447916 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.0000 0.971 0.000 0.000 0.000 1.000 0.000
#> SRR1445618 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1081589 4 0.0000 0.971 0.000 0.000 0.000 1.000 0.000
#> SRR1097245 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1416141 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1404339 2 0.1851 0.677 0.000 0.912 0.000 0.000 0.088
#> SRR1478614 1 0.0963 0.857 0.964 0.000 0.000 0.000 0.036
#> SRR1406135 1 0.0703 0.860 0.976 0.000 0.024 0.000 0.000
#> SRR1413307 4 0.3123 0.845 0.000 0.000 0.004 0.812 0.184
#> SRR1397720 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.971 0.000 0.000 0.000 1.000 0.000
#> SRR1381185 1 0.6063 0.426 0.540 0.000 0.316 0.000 0.144
#> SRR1100608 2 0.4307 -0.975 0.000 0.504 0.000 0.000 0.496
#> SRR1386927 2 0.0000 0.805 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.0404 0.786 0.012 0.000 0.988 0.000 0.000
#> SRR1486322 3 0.2424 0.778 0.000 0.000 0.868 0.000 0.132
#> SRR1080790 3 0.4030 0.378 0.352 0.000 0.648 0.000 0.000
#> SRR1459980 1 0.6076 0.417 0.536 0.000 0.320 0.000 0.144
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.81878 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 1 0.3944 0.16194 0.568 0.000 0.004 0.000 0.000 0.428
#> SRR1315412 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 1 0.1863 0.77777 0.896 0.000 0.000 0.000 0.000 0.104
#> SRR1071105 1 0.3774 0.38232 0.664 0.008 0.000 0.000 0.328 0.000
#> SRR1432868 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.96690 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 2 0.2219 0.83411 0.000 0.864 0.000 0.000 0.136 0.000
#> SRR1475324 3 0.0000 0.81878 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1340260 1 0.3672 0.36810 0.632 0.000 0.000 0.000 0.000 0.368
#> SRR1376450 1 0.0363 0.80347 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR1321897 3 0.2762 0.77621 0.000 0.000 0.804 0.000 0.000 0.196
#> SRR1445194 1 0.0790 0.80451 0.968 0.000 0.000 0.000 0.000 0.032
#> SRR1443308 3 0.5061 0.62543 0.000 0.000 0.620 0.000 0.128 0.252
#> SRR1400931 1 0.0632 0.79886 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1416188 3 0.1765 0.80666 0.000 0.000 0.904 0.000 0.000 0.096
#> SRR1407044 3 0.4801 0.55879 0.136 0.000 0.668 0.000 0.000 0.196
#> SRR1078392 1 0.2793 0.70045 0.800 0.000 0.000 0.000 0.000 0.200
#> SRR1436468 6 0.2197 0.42553 0.056 0.000 0.044 0.000 0.000 0.900
#> SRR1476125 5 0.2135 0.99266 0.000 0.128 0.000 0.000 0.872 0.000
#> SRR1418747 1 0.5203 0.00973 0.548 0.000 0.104 0.000 0.000 0.348
#> SRR1318089 3 0.0260 0.81980 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR1444370 1 0.0632 0.79886 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1348929 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 1 0.1327 0.80010 0.936 0.000 0.000 0.000 0.000 0.064
#> SRR1460337 1 0.0547 0.79971 0.980 0.000 0.000 0.000 0.000 0.020
#> SRR1469062 1 0.4601 0.29162 0.628 0.000 0.060 0.000 0.000 0.312
#> SRR1388459 6 0.4289 0.00252 0.020 0.000 0.424 0.000 0.000 0.556
#> SRR1416841 3 0.0000 0.81878 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1473778 1 0.3428 0.49010 0.696 0.000 0.000 0.000 0.000 0.304
#> SRR1419561 1 0.1957 0.77784 0.888 0.000 0.000 0.000 0.000 0.112
#> SRR1339987 1 0.1663 0.79148 0.912 0.000 0.000 0.000 0.000 0.088
#> SRR1469662 1 0.1267 0.80118 0.940 0.000 0.000 0.000 0.000 0.060
#> SRR1432958 1 0.0632 0.79886 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1479198 1 0.1663 0.79148 0.912 0.000 0.000 0.000 0.000 0.088
#> SRR1353600 1 0.0632 0.79886 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1456492 6 0.5697 0.29170 0.176 0.000 0.332 0.000 0.000 0.492
#> SRR1389955 1 0.1663 0.79148 0.912 0.000 0.000 0.000 0.000 0.088
#> SRR1429540 1 0.3446 0.48126 0.692 0.000 0.000 0.000 0.000 0.308
#> SRR1356057 6 0.5279 0.59422 0.244 0.000 0.160 0.000 0.000 0.596
#> SRR1328715 1 0.2631 0.71498 0.820 0.000 0.000 0.000 0.000 0.180
#> SRR1429429 3 0.0000 0.81878 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1325201 5 0.2389 0.98970 0.008 0.128 0.000 0.000 0.864 0.000
#> SRR1382978 3 0.0000 0.81878 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 3 0.2762 0.77621 0.000 0.000 0.804 0.000 0.000 0.196
#> SRR1418225 4 0.0000 0.96690 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 6 0.3843 0.27975 0.452 0.000 0.000 0.000 0.000 0.548
#> SRR1431823 3 0.2762 0.77621 0.000 0.000 0.804 0.000 0.000 0.196
#> SRR1447916 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.0000 0.96690 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1445618 1 0.0632 0.79886 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1081589 4 0.0000 0.96690 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1097245 1 0.0632 0.79886 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1416141 1 0.0632 0.79886 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1404339 2 0.2219 0.83411 0.000 0.864 0.000 0.000 0.136 0.000
#> SRR1478614 1 0.0632 0.79886 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1406135 1 0.1327 0.80010 0.936 0.000 0.000 0.000 0.000 0.064
#> SRR1413307 4 0.3354 0.82084 0.000 0.000 0.000 0.812 0.128 0.060
#> SRR1397720 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.96690 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 6 0.3872 0.44019 0.392 0.000 0.004 0.000 0.000 0.604
#> SRR1100608 5 0.2178 0.99218 0.000 0.132 0.000 0.000 0.868 0.000
#> SRR1386927 2 0.0000 0.96763 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.2762 0.77621 0.000 0.000 0.804 0.000 0.000 0.196
#> SRR1486322 3 0.0547 0.82029 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR1080790 3 0.5720 -0.04072 0.332 0.000 0.488 0.000 0.000 0.180
#> SRR1459980 6 0.3862 0.44764 0.388 0.000 0.004 0.000 0.000 0.608
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 17667 rows and 70 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 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.531 0.871 0.925 0.3721 0.675 0.675
#> 3 3 0.916 0.942 0.955 0.6386 0.702 0.559
#> 4 4 0.986 0.948 0.967 0.1242 0.867 0.679
#> 5 5 0.736 0.688 0.801 0.1089 0.907 0.712
#> 6 6 0.745 0.590 0.772 0.0658 0.901 0.618
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 3
There is also optional best \(k\) = 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 1 0.7602 0.794 0.780 0.220
#> SRR1405147 1 0.0000 0.904 1.000 0.000
#> SRR1315412 2 0.0000 0.947 0.000 1.000
#> SRR1338384 1 0.0672 0.905 0.992 0.008
#> SRR1071105 1 0.0672 0.905 0.992 0.008
#> SRR1432868 2 0.0000 0.947 0.000 1.000
#> SRR1454480 1 0.0672 0.905 0.992 0.008
#> SRR1330723 2 0.0000 0.947 0.000 1.000
#> SRR1475324 1 0.7602 0.794 0.780 0.220
#> SRR1340260 1 0.0672 0.905 0.992 0.008
#> SRR1376450 1 0.0672 0.905 0.992 0.008
#> SRR1321897 1 0.7528 0.797 0.784 0.216
#> SRR1445194 1 0.0672 0.905 0.992 0.008
#> SRR1443308 1 0.7528 0.797 0.784 0.216
#> SRR1400931 1 0.0672 0.905 0.992 0.008
#> SRR1416188 1 0.7602 0.794 0.780 0.220
#> SRR1407044 1 0.6247 0.833 0.844 0.156
#> SRR1078392 1 0.0376 0.905 0.996 0.004
#> SRR1436468 1 0.7299 0.805 0.796 0.204
#> SRR1476125 2 0.6887 0.791 0.184 0.816
#> SRR1418747 1 0.0000 0.904 1.000 0.000
#> SRR1318089 1 0.7602 0.794 0.780 0.220
#> SRR1444370 1 0.0672 0.905 0.992 0.008
#> SRR1348929 2 0.0000 0.947 0.000 1.000
#> SRR1385690 1 0.0672 0.905 0.992 0.008
#> SRR1460337 1 0.0672 0.905 0.992 0.008
#> SRR1469062 1 0.0000 0.904 1.000 0.000
#> SRR1388459 1 0.7602 0.794 0.780 0.220
#> SRR1416841 1 0.7602 0.794 0.780 0.220
#> SRR1473778 1 0.0000 0.904 1.000 0.000
#> SRR1419561 1 0.0672 0.905 0.992 0.008
#> SRR1339987 1 0.0000 0.904 1.000 0.000
#> SRR1469662 1 0.0672 0.905 0.992 0.008
#> SRR1432958 1 0.0672 0.905 0.992 0.008
#> SRR1479198 1 0.0672 0.905 0.992 0.008
#> SRR1353600 1 0.0672 0.905 0.992 0.008
#> SRR1456492 1 0.7528 0.797 0.784 0.216
#> SRR1389955 1 0.0672 0.905 0.992 0.008
#> SRR1429540 1 0.0672 0.905 0.992 0.008
#> SRR1356057 1 0.0000 0.904 1.000 0.000
#> SRR1328715 1 0.0672 0.905 0.992 0.008
#> SRR1429429 1 0.7602 0.794 0.780 0.220
#> SRR1325201 2 0.7453 0.754 0.212 0.788
#> SRR1382978 1 0.7602 0.794 0.780 0.220
#> SRR1406348 2 0.0000 0.947 0.000 1.000
#> SRR1469390 2 0.0000 0.947 0.000 1.000
#> SRR1376380 1 0.7453 0.800 0.788 0.212
#> SRR1418225 1 0.6531 0.757 0.832 0.168
#> SRR1418473 2 0.0000 0.947 0.000 1.000
#> SRR1376741 1 0.0000 0.904 1.000 0.000
#> SRR1431823 1 0.7453 0.800 0.788 0.212
#> SRR1447916 2 0.0000 0.947 0.000 1.000
#> SRR1458643 1 0.6531 0.757 0.832 0.168
#> SRR1445618 1 0.0672 0.905 0.992 0.008
#> SRR1081589 1 0.6531 0.757 0.832 0.168
#> SRR1097245 1 0.0672 0.905 0.992 0.008
#> SRR1416141 1 0.0672 0.905 0.992 0.008
#> SRR1404339 2 0.0000 0.947 0.000 1.000
#> SRR1478614 1 0.0672 0.905 0.992 0.008
#> SRR1406135 1 0.0672 0.905 0.992 0.008
#> SRR1413307 1 0.9044 0.682 0.680 0.320
#> SRR1397720 2 0.0000 0.947 0.000 1.000
#> SRR1358391 1 0.0672 0.905 0.992 0.008
#> SRR1381185 1 0.0000 0.904 1.000 0.000
#> SRR1100608 2 0.6887 0.791 0.184 0.816
#> SRR1386927 2 0.0000 0.947 0.000 1.000
#> SRR1331771 1 0.7528 0.797 0.784 0.216
#> SRR1486322 1 0.7602 0.794 0.780 0.220
#> SRR1080790 1 0.0000 0.904 1.000 0.000
#> SRR1459980 1 0.0000 0.904 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1405147 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1315412 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1338384 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1071105 1 0.0592 0.963 0.988 0.000 0.012
#> SRR1432868 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1454480 1 0.2096 0.931 0.944 0.004 0.052
#> SRR1330723 2 0.0747 0.993 0.000 0.984 0.016
#> SRR1475324 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1340260 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1321897 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1445194 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1443308 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1400931 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1416188 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1407044 3 0.2261 0.940 0.068 0.000 0.932
#> SRR1078392 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1436468 3 0.5948 0.583 0.360 0.000 0.640
#> SRR1476125 2 0.0829 0.991 0.004 0.984 0.012
#> SRR1418747 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1318089 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1444370 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1348929 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1385690 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1469062 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1388459 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1416841 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1473778 1 0.3879 0.785 0.848 0.000 0.152
#> SRR1419561 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1339987 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1469662 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1353600 1 0.0424 0.967 0.992 0.000 0.008
#> SRR1456492 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1389955 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1429540 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1356057 3 0.5678 0.665 0.316 0.000 0.684
#> SRR1328715 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1429429 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1325201 2 0.0829 0.991 0.004 0.984 0.012
#> SRR1382978 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1406348 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1469390 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1376380 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1418225 1 0.4845 0.848 0.844 0.104 0.052
#> SRR1418473 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1376741 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1431823 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1447916 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1458643 1 0.4845 0.848 0.844 0.104 0.052
#> SRR1445618 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1081589 1 0.4845 0.848 0.844 0.104 0.052
#> SRR1097245 1 0.0424 0.967 0.992 0.000 0.008
#> SRR1416141 1 0.1031 0.956 0.976 0.000 0.024
#> SRR1404339 2 0.0747 0.993 0.000 0.984 0.016
#> SRR1478614 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.971 1.000 0.000 0.000
#> SRR1413307 1 0.4845 0.848 0.844 0.104 0.052
#> SRR1397720 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1358391 1 0.2096 0.931 0.944 0.004 0.052
#> SRR1381185 3 0.5948 0.583 0.360 0.000 0.640
#> SRR1100608 2 0.0829 0.991 0.004 0.984 0.012
#> SRR1386927 2 0.0237 0.996 0.000 0.996 0.004
#> SRR1331771 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1486322 3 0.2165 0.943 0.064 0.000 0.936
#> SRR1080790 3 0.2261 0.940 0.068 0.000 0.932
#> SRR1459980 1 0.0000 0.971 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0188 0.988 0.000 0.000 0.996 0.004
#> SRR1405147 1 0.0921 0.939 0.972 0.000 0.000 0.028
#> SRR1315412 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1071105 1 0.1716 0.911 0.936 0.000 0.000 0.064
#> SRR1432868 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.2216 0.992 0.092 0.000 0.000 0.908
#> SRR1330723 2 0.0707 0.981 0.000 0.980 0.000 0.020
#> SRR1475324 3 0.0188 0.988 0.000 0.000 0.996 0.004
#> SRR1340260 1 0.0592 0.945 0.984 0.000 0.000 0.016
#> SRR1376450 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1321897 3 0.0469 0.989 0.000 0.000 0.988 0.012
#> SRR1445194 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1443308 3 0.0592 0.988 0.000 0.000 0.984 0.016
#> SRR1400931 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1416188 3 0.0000 0.989 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.0592 0.988 0.000 0.000 0.984 0.016
#> SRR1078392 1 0.0188 0.950 0.996 0.000 0.000 0.004
#> SRR1436468 1 0.5367 0.516 0.664 0.000 0.304 0.032
#> SRR1476125 2 0.1557 0.962 0.000 0.944 0.000 0.056
#> SRR1418747 1 0.0657 0.946 0.984 0.000 0.004 0.012
#> SRR1318089 3 0.0000 0.989 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1348929 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1460337 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1469062 1 0.0779 0.944 0.980 0.000 0.004 0.016
#> SRR1388459 3 0.1042 0.973 0.008 0.000 0.972 0.020
#> SRR1416841 3 0.0188 0.988 0.000 0.000 0.996 0.004
#> SRR1473778 1 0.1610 0.924 0.952 0.000 0.016 0.032
#> SRR1419561 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1339987 1 0.0657 0.946 0.984 0.000 0.004 0.012
#> SRR1469662 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1432958 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1479198 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1353600 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1456492 3 0.0927 0.983 0.008 0.000 0.976 0.016
#> SRR1389955 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1429540 1 0.0592 0.945 0.984 0.000 0.000 0.016
#> SRR1356057 1 0.5856 0.103 0.504 0.000 0.464 0.032
#> SRR1328715 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1429429 3 0.0188 0.988 0.000 0.000 0.996 0.004
#> SRR1325201 2 0.1557 0.962 0.000 0.944 0.000 0.056
#> SRR1382978 3 0.0188 0.988 0.000 0.000 0.996 0.004
#> SRR1406348 2 0.0188 0.986 0.000 0.996 0.000 0.004
#> SRR1469390 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.0592 0.988 0.000 0.000 0.984 0.016
#> SRR1418225 4 0.2334 0.993 0.088 0.004 0.000 0.908
#> SRR1418473 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0817 0.942 0.976 0.000 0.000 0.024
#> SRR1431823 3 0.0592 0.988 0.000 0.000 0.984 0.016
#> SRR1447916 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.2334 0.993 0.088 0.004 0.000 0.908
#> SRR1445618 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1081589 4 0.2334 0.993 0.088 0.004 0.000 0.908
#> SRR1097245 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1416141 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1404339 2 0.0469 0.984 0.000 0.988 0.000 0.012
#> SRR1478614 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1406135 1 0.0336 0.952 0.992 0.000 0.000 0.008
#> SRR1413307 4 0.2125 0.979 0.076 0.000 0.004 0.920
#> SRR1397720 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.2216 0.992 0.092 0.000 0.000 0.908
#> SRR1381185 1 0.2892 0.863 0.896 0.000 0.068 0.036
#> SRR1100608 2 0.1557 0.962 0.000 0.944 0.000 0.056
#> SRR1386927 2 0.0000 0.987 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.0592 0.988 0.000 0.000 0.984 0.016
#> SRR1486322 3 0.0000 0.989 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.0927 0.983 0.008 0.000 0.976 0.016
#> SRR1459980 1 0.1022 0.937 0.968 0.000 0.000 0.032
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0510 0.9009 0.000 0.000 0.984 0.000 0.016
#> SRR1405147 1 0.4273 0.0454 0.552 0.000 0.000 0.000 0.448
#> SRR1315412 2 0.0290 0.9262 0.000 0.992 0.000 0.008 0.000
#> SRR1338384 1 0.2773 0.6380 0.836 0.000 0.000 0.000 0.164
#> SRR1071105 1 0.3521 0.4699 0.764 0.000 0.000 0.004 0.232
#> SRR1432868 2 0.0000 0.9262 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0898 0.9876 0.020 0.000 0.000 0.972 0.008
#> SRR1330723 2 0.2338 0.8927 0.000 0.884 0.000 0.004 0.112
#> SRR1475324 3 0.0510 0.9009 0.000 0.000 0.984 0.000 0.016
#> SRR1340260 1 0.4045 0.3135 0.644 0.000 0.000 0.000 0.356
#> SRR1376450 1 0.3074 0.5590 0.804 0.000 0.000 0.000 0.196
#> SRR1321897 3 0.1956 0.8925 0.000 0.000 0.916 0.008 0.076
#> SRR1445194 1 0.0290 0.6715 0.992 0.000 0.000 0.000 0.008
#> SRR1443308 3 0.3098 0.8673 0.000 0.000 0.836 0.016 0.148
#> SRR1400931 1 0.1478 0.6733 0.936 0.000 0.000 0.000 0.064
#> SRR1416188 3 0.0000 0.9009 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 3 0.3343 0.8555 0.000 0.000 0.812 0.016 0.172
#> SRR1078392 1 0.4300 -0.2902 0.524 0.000 0.000 0.000 0.476
#> SRR1436468 5 0.5683 0.4964 0.304 0.000 0.108 0.000 0.588
#> SRR1476125 2 0.3861 0.7964 0.000 0.712 0.000 0.004 0.284
#> SRR1418747 5 0.4528 0.4915 0.444 0.000 0.000 0.008 0.548
#> SRR1318089 3 0.0000 0.9009 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.0290 0.6715 0.992 0.000 0.000 0.000 0.008
#> SRR1348929 2 0.0000 0.9262 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.3109 0.5504 0.800 0.000 0.000 0.000 0.200
#> SRR1460337 1 0.1608 0.6713 0.928 0.000 0.000 0.000 0.072
#> SRR1469062 5 0.4522 0.4967 0.440 0.000 0.000 0.008 0.552
#> SRR1388459 3 0.2230 0.8419 0.000 0.000 0.884 0.000 0.116
#> SRR1416841 3 0.0510 0.9009 0.000 0.000 0.984 0.000 0.016
#> SRR1473778 5 0.4448 0.1879 0.480 0.000 0.004 0.000 0.516
#> SRR1419561 1 0.4030 0.2523 0.648 0.000 0.000 0.000 0.352
#> SRR1339987 5 0.4538 0.4741 0.452 0.000 0.000 0.008 0.540
#> SRR1469662 1 0.3039 0.5616 0.808 0.000 0.000 0.000 0.192
#> SRR1432958 1 0.1478 0.6733 0.936 0.000 0.000 0.000 0.064
#> SRR1479198 1 0.4126 0.1508 0.620 0.000 0.000 0.000 0.380
#> SRR1353600 1 0.0000 0.6726 1.000 0.000 0.000 0.000 0.000
#> SRR1456492 3 0.3906 0.8038 0.000 0.000 0.744 0.016 0.240
#> SRR1389955 1 0.3949 0.2953 0.668 0.000 0.000 0.000 0.332
#> SRR1429540 1 0.3983 0.3473 0.660 0.000 0.000 0.000 0.340
#> SRR1356057 5 0.5413 0.5317 0.172 0.000 0.164 0.000 0.664
#> SRR1328715 1 0.2813 0.6241 0.832 0.000 0.000 0.000 0.168
#> SRR1429429 3 0.0510 0.9009 0.000 0.000 0.984 0.000 0.016
#> SRR1325201 2 0.4015 0.7931 0.004 0.708 0.000 0.004 0.284
#> SRR1382978 3 0.0510 0.9009 0.000 0.000 0.984 0.000 0.016
#> SRR1406348 2 0.1205 0.9176 0.000 0.956 0.000 0.004 0.040
#> SRR1469390 2 0.0290 0.9262 0.000 0.992 0.000 0.008 0.000
#> SRR1376380 3 0.3343 0.8555 0.000 0.000 0.812 0.016 0.172
#> SRR1418225 4 0.0898 0.9881 0.020 0.008 0.000 0.972 0.000
#> SRR1418473 2 0.0162 0.9263 0.000 0.996 0.000 0.004 0.000
#> SRR1376741 1 0.4242 0.1385 0.572 0.000 0.000 0.000 0.428
#> SRR1431823 3 0.3343 0.8555 0.000 0.000 0.812 0.016 0.172
#> SRR1447916 2 0.0290 0.9262 0.000 0.992 0.000 0.008 0.000
#> SRR1458643 4 0.1405 0.9874 0.020 0.008 0.000 0.956 0.016
#> SRR1445618 1 0.1478 0.6733 0.936 0.000 0.000 0.000 0.064
#> SRR1081589 4 0.1405 0.9874 0.020 0.008 0.000 0.956 0.016
#> SRR1097245 1 0.1478 0.6733 0.936 0.000 0.000 0.000 0.064
#> SRR1416141 1 0.0290 0.6715 0.992 0.000 0.000 0.000 0.008
#> SRR1404339 2 0.2011 0.9025 0.000 0.908 0.000 0.004 0.088
#> SRR1478614 1 0.1544 0.6713 0.932 0.000 0.000 0.000 0.068
#> SRR1406135 1 0.2648 0.5883 0.848 0.000 0.000 0.000 0.152
#> SRR1413307 4 0.0404 0.9810 0.012 0.000 0.000 0.988 0.000
#> SRR1397720 2 0.0000 0.9262 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0898 0.9876 0.020 0.000 0.000 0.972 0.008
#> SRR1381185 5 0.4380 0.5720 0.304 0.000 0.020 0.000 0.676
#> SRR1100608 2 0.3861 0.7964 0.000 0.712 0.000 0.004 0.284
#> SRR1386927 2 0.0290 0.9262 0.000 0.992 0.000 0.008 0.000
#> SRR1331771 3 0.3343 0.8555 0.000 0.000 0.812 0.016 0.172
#> SRR1486322 3 0.0000 0.9009 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 5 0.4967 -0.0947 0.016 0.000 0.436 0.008 0.540
#> SRR1459980 5 0.3966 0.5462 0.336 0.000 0.000 0.000 0.664
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.800 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 6 0.6127 0.780 0.320 0.000 0.000 0.000 0.328 0.352
#> SRR1315412 2 0.0790 0.890 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR1338384 1 0.3717 0.014 0.616 0.000 0.000 0.000 0.384 0.000
#> SRR1071105 1 0.3629 0.502 0.712 0.000 0.000 0.000 0.012 0.276
#> SRR1432868 2 0.0260 0.890 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR1454480 4 0.0146 0.975 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1330723 2 0.2520 0.849 0.000 0.844 0.000 0.000 0.004 0.152
#> SRR1475324 3 0.0000 0.800 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1340260 1 0.5868 -0.640 0.448 0.000 0.000 0.000 0.204 0.348
#> SRR1376450 5 0.3857 0.318 0.468 0.000 0.000 0.000 0.532 0.000
#> SRR1321897 3 0.4771 0.774 0.000 0.000 0.684 0.004 0.124 0.188
#> SRR1445194 1 0.1663 0.713 0.912 0.000 0.000 0.000 0.088 0.000
#> SRR1443308 3 0.5284 0.761 0.000 0.000 0.620 0.004 0.184 0.192
#> SRR1400931 1 0.0000 0.758 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.2100 0.796 0.000 0.000 0.884 0.000 0.004 0.112
#> SRR1407044 3 0.5311 0.760 0.000 0.000 0.616 0.004 0.188 0.192
#> SRR1078392 5 0.3943 0.397 0.156 0.000 0.000 0.000 0.760 0.084
#> SRR1436468 6 0.6597 0.589 0.184 0.000 0.044 0.000 0.360 0.412
#> SRR1476125 2 0.4047 0.707 0.012 0.604 0.000 0.000 0.000 0.384
#> SRR1418747 5 0.2308 0.431 0.108 0.000 0.000 0.004 0.880 0.008
#> SRR1318089 3 0.0146 0.800 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1444370 1 0.1556 0.720 0.920 0.000 0.000 0.000 0.080 0.000
#> SRR1348929 2 0.0260 0.890 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR1385690 5 0.3833 0.363 0.444 0.000 0.000 0.000 0.556 0.000
#> SRR1460337 1 0.0363 0.751 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1469062 5 0.2587 0.421 0.108 0.000 0.000 0.004 0.868 0.020
#> SRR1388459 3 0.3744 0.561 0.000 0.000 0.756 0.000 0.044 0.200
#> SRR1416841 3 0.0000 0.800 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1473778 5 0.6100 -0.822 0.284 0.000 0.000 0.000 0.360 0.356
#> SRR1419561 5 0.3464 0.471 0.312 0.000 0.000 0.000 0.688 0.000
#> SRR1339987 5 0.2053 0.435 0.108 0.000 0.000 0.004 0.888 0.000
#> SRR1469662 5 0.3860 0.313 0.472 0.000 0.000 0.000 0.528 0.000
#> SRR1432958 1 0.0000 0.758 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1479198 5 0.3266 0.481 0.272 0.000 0.000 0.000 0.728 0.000
#> SRR1353600 1 0.1267 0.732 0.940 0.000 0.000 0.000 0.060 0.000
#> SRR1456492 3 0.5700 0.698 0.000 0.000 0.548 0.004 0.236 0.212
#> SRR1389955 5 0.3563 0.492 0.336 0.000 0.000 0.000 0.664 0.000
#> SRR1429540 1 0.5868 -0.640 0.448 0.000 0.000 0.000 0.204 0.348
#> SRR1356057 5 0.6323 -0.616 0.116 0.000 0.052 0.000 0.428 0.404
#> SRR1328715 1 0.3017 0.568 0.840 0.000 0.000 0.000 0.108 0.052
#> SRR1429429 3 0.0000 0.800 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1325201 2 0.4283 0.696 0.024 0.592 0.000 0.000 0.000 0.384
#> SRR1382978 3 0.0000 0.800 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.1462 0.882 0.000 0.936 0.000 0.000 0.008 0.056
#> SRR1469390 2 0.0790 0.890 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR1376380 3 0.5311 0.760 0.000 0.000 0.616 0.004 0.188 0.192
#> SRR1418225 4 0.0146 0.975 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1418473 2 0.0632 0.891 0.000 0.976 0.000 0.000 0.024 0.000
#> SRR1376741 6 0.6128 0.770 0.332 0.000 0.000 0.000 0.320 0.348
#> SRR1431823 3 0.5311 0.760 0.000 0.000 0.616 0.004 0.188 0.192
#> SRR1447916 2 0.0790 0.890 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR1458643 4 0.2173 0.953 0.004 0.000 0.000 0.904 0.028 0.064
#> SRR1445618 1 0.0000 0.758 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1081589 4 0.2173 0.953 0.004 0.000 0.000 0.904 0.028 0.064
#> SRR1097245 1 0.0000 0.758 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.1663 0.713 0.912 0.000 0.000 0.000 0.088 0.000
#> SRR1404339 2 0.2278 0.859 0.000 0.868 0.000 0.000 0.004 0.128
#> SRR1478614 1 0.0260 0.753 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1406135 5 0.3868 0.258 0.496 0.000 0.000 0.000 0.504 0.000
#> SRR1413307 4 0.0146 0.972 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1397720 2 0.0260 0.890 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR1358391 4 0.0146 0.975 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR1381185 5 0.5527 -0.605 0.132 0.000 0.000 0.000 0.460 0.408
#> SRR1100608 2 0.3955 0.710 0.008 0.608 0.000 0.000 0.000 0.384
#> SRR1386927 2 0.0713 0.890 0.000 0.972 0.000 0.000 0.028 0.000
#> SRR1331771 3 0.5311 0.760 0.000 0.000 0.616 0.004 0.188 0.192
#> SRR1486322 3 0.0146 0.800 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1080790 5 0.2940 0.275 0.000 0.000 0.112 0.004 0.848 0.036
#> SRR1459980 5 0.5457 -0.556 0.132 0.000 0.000 0.000 0.512 0.356
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 17667 rows and 70 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 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.328 0.297 0.667 0.4710 0.503 0.503
#> 3 3 0.955 0.912 0.966 0.4094 0.685 0.452
#> 4 4 0.979 0.925 0.967 0.0830 0.901 0.722
#> 5 5 0.861 0.884 0.927 0.0992 0.906 0.679
#> 6 6 0.996 0.956 0.972 0.0511 0.932 0.697
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] 3 4
There is also optional best \(k\) = 3 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
#> SRR1433493 2 0.9833 0.289 0.424 0.576
#> SRR1405147 1 0.9393 0.331 0.644 0.356
#> SRR1315412 2 0.9393 0.207 0.356 0.644
#> SRR1338384 1 0.9393 0.331 0.644 0.356
#> SRR1071105 1 0.9833 0.119 0.576 0.424
#> SRR1432868 2 0.9393 0.207 0.356 0.644
#> SRR1454480 1 0.9833 0.119 0.576 0.424
#> SRR1330723 2 0.9393 0.207 0.356 0.644
#> SRR1475324 2 0.9833 0.289 0.424 0.576
#> SRR1340260 1 0.9393 0.331 0.644 0.356
#> SRR1376450 1 0.0000 0.466 1.000 0.000
#> SRR1321897 2 0.9833 0.289 0.424 0.576
#> SRR1445194 1 0.0376 0.466 0.996 0.004
#> SRR1443308 2 0.9833 0.289 0.424 0.576
#> SRR1400931 1 0.0000 0.466 1.000 0.000
#> SRR1416188 2 0.9833 0.289 0.424 0.576
#> SRR1407044 2 0.9833 0.289 0.424 0.576
#> SRR1078392 1 0.9393 0.331 0.644 0.356
#> SRR1436468 2 0.9833 0.289 0.424 0.576
#> SRR1476125 1 0.9850 0.114 0.572 0.428
#> SRR1418747 1 0.9393 0.331 0.644 0.356
#> SRR1318089 2 0.9833 0.289 0.424 0.576
#> SRR1444370 1 0.1414 0.463 0.980 0.020
#> SRR1348929 2 0.9393 0.207 0.356 0.644
#> SRR1385690 1 0.5178 0.433 0.884 0.116
#> SRR1460337 1 0.0000 0.466 1.000 0.000
#> SRR1469062 1 0.9393 0.331 0.644 0.356
#> SRR1388459 2 0.9833 0.289 0.424 0.576
#> SRR1416841 2 0.9833 0.289 0.424 0.576
#> SRR1473778 1 0.9393 0.331 0.644 0.356
#> SRR1419561 1 0.9393 0.331 0.644 0.356
#> SRR1339987 1 0.9393 0.331 0.644 0.356
#> SRR1469662 1 0.4815 0.438 0.896 0.104
#> SRR1432958 1 0.0000 0.466 1.000 0.000
#> SRR1479198 1 0.9393 0.331 0.644 0.356
#> SRR1353600 1 0.0000 0.466 1.000 0.000
#> SRR1456492 2 0.9833 0.289 0.424 0.576
#> SRR1389955 1 0.9393 0.331 0.644 0.356
#> SRR1429540 1 0.9393 0.331 0.644 0.356
#> SRR1356057 2 0.9850 0.279 0.428 0.572
#> SRR1328715 1 0.7056 0.397 0.808 0.192
#> SRR1429429 2 0.9833 0.289 0.424 0.576
#> SRR1325201 1 0.9850 0.114 0.572 0.428
#> SRR1382978 2 0.9833 0.289 0.424 0.576
#> SRR1406348 2 0.9393 0.207 0.356 0.644
#> SRR1469390 2 0.9393 0.207 0.356 0.644
#> SRR1376380 2 0.9833 0.289 0.424 0.576
#> SRR1418225 1 0.9833 0.119 0.576 0.424
#> SRR1418473 2 0.9393 0.207 0.356 0.644
#> SRR1376741 1 0.9393 0.331 0.644 0.356
#> SRR1431823 2 0.9833 0.289 0.424 0.576
#> SRR1447916 2 0.9393 0.207 0.356 0.644
#> SRR1458643 1 0.9833 0.119 0.576 0.424
#> SRR1445618 1 0.0000 0.466 1.000 0.000
#> SRR1081589 1 0.9833 0.119 0.576 0.424
#> SRR1097245 1 0.0000 0.466 1.000 0.000
#> SRR1416141 1 0.0000 0.466 1.000 0.000
#> SRR1404339 2 0.9393 0.207 0.356 0.644
#> SRR1478614 1 0.0000 0.466 1.000 0.000
#> SRR1406135 1 0.0000 0.466 1.000 0.000
#> SRR1413307 2 0.9393 0.207 0.356 0.644
#> SRR1397720 2 0.9393 0.207 0.356 0.644
#> SRR1358391 1 0.9833 0.119 0.576 0.424
#> SRR1381185 1 0.9608 0.271 0.616 0.384
#> SRR1100608 1 0.9850 0.114 0.572 0.428
#> SRR1386927 2 0.9393 0.207 0.356 0.644
#> SRR1331771 2 0.9833 0.289 0.424 0.576
#> SRR1486322 2 0.9833 0.289 0.424 0.576
#> SRR1080790 1 0.9608 0.271 0.616 0.384
#> SRR1459980 1 0.9393 0.331 0.644 0.356
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1405147 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1315412 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1071105 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1432868 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1454480 1 0.0237 0.968 0.996 0.004 0.000
#> SRR1330723 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1475324 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1340260 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1321897 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1445194 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1443308 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1400931 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1416188 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1407044 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1078392 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1436468 3 0.2448 0.890 0.076 0.000 0.924
#> SRR1476125 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1418747 3 0.5465 0.599 0.288 0.000 0.712
#> SRR1318089 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1444370 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1348929 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1385690 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1469062 3 0.1753 0.916 0.048 0.000 0.952
#> SRR1388459 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1416841 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1473778 3 0.6244 0.235 0.440 0.000 0.560
#> SRR1419561 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1339987 1 0.6140 0.314 0.596 0.000 0.404
#> SRR1469662 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1353600 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1456492 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1389955 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1429540 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1356057 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1328715 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1429429 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1325201 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1382978 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1406348 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1469390 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1376380 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1418225 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1418473 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1431823 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1447916 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1458643 2 0.6168 0.328 0.412 0.588 0.000
#> SRR1445618 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1081589 2 0.6062 0.399 0.384 0.616 0.000
#> SRR1097245 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1404339 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.972 1.000 0.000 0.000
#> SRR1413307 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1358391 1 0.0237 0.968 0.996 0.004 0.000
#> SRR1381185 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1100608 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1386927 2 0.0000 0.952 0.000 1.000 0.000
#> SRR1331771 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1486322 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1080790 3 0.0000 0.957 0.000 0.000 1.000
#> SRR1459980 1 0.5465 0.578 0.712 0.000 0.288
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1071105 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0000 0.936 0.000 0.000 0.000 1.000
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.0817 0.956 0.976 0.000 0.000 0.024
#> SRR1321897 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1445194 1 0.0469 0.960 0.988 0.000 0.000 0.012
#> SRR1443308 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1400931 1 0.0188 0.961 0.996 0.000 0.000 0.004
#> SRR1416188 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1078392 1 0.1474 0.943 0.948 0.000 0.000 0.052
#> SRR1436468 3 0.3311 0.731 0.172 0.000 0.828 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1418747 3 0.6253 0.300 0.372 0.000 0.564 0.064
#> SRR1318089 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0188 0.961 0.996 0.000 0.000 0.004
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.2216 0.914 0.908 0.000 0.000 0.092
#> SRR1460337 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1469062 4 0.4222 0.612 0.000 0.000 0.272 0.728
#> SRR1388459 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.4522 0.492 0.680 0.000 0.320 0.000
#> SRR1419561 1 0.0707 0.957 0.980 0.000 0.000 0.020
#> SRR1339987 3 0.7028 0.329 0.228 0.000 0.576 0.196
#> SRR1469662 1 0.1637 0.939 0.940 0.000 0.000 0.060
#> SRR1432958 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.1716 0.936 0.936 0.000 0.000 0.064
#> SRR1353600 1 0.0469 0.960 0.988 0.000 0.000 0.012
#> SRR1456492 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1389955 1 0.2216 0.914 0.908 0.000 0.000 0.092
#> SRR1429540 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1356057 3 0.0188 0.936 0.004 0.000 0.996 0.000
#> SRR1328715 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1382978 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1418225 4 0.0592 0.941 0.000 0.016 0.000 0.984
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1431823 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.0592 0.941 0.000 0.016 0.000 0.984
#> SRR1445618 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.0592 0.941 0.000 0.016 0.000 0.984
#> SRR1097245 1 0.0188 0.961 0.996 0.000 0.000 0.004
#> SRR1416141 1 0.2081 0.919 0.916 0.000 0.000 0.084
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.1716 0.936 0.936 0.000 0.000 0.064
#> SRR1413307 4 0.0592 0.941 0.000 0.016 0.000 0.984
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0000 0.936 0.000 0.000 0.000 1.000
#> SRR1381185 3 0.0188 0.936 0.004 0.000 0.996 0.000
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1486322 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.0000 0.939 0.000 0.000 1.000 0.000
#> SRR1459980 1 0.0188 0.960 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
#> SRR1433493 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1405147 1 0.0162 0.800 0.996 0.000 0.000 0.004 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.3109 0.883 0.800 0.000 0.000 0.000 0.200
#> SRR1071105 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0162 0.995 0.000 0.000 0.000 0.996 0.004
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1340260 1 0.0162 0.800 0.996 0.000 0.000 0.004 0.000
#> SRR1376450 5 0.0162 0.882 0.004 0.000 0.000 0.000 0.996
#> SRR1321897 3 0.0162 0.921 0.000 0.000 0.996 0.000 0.004
#> SRR1445194 1 0.4060 0.721 0.640 0.000 0.000 0.000 0.360
#> SRR1443308 3 0.0162 0.921 0.000 0.000 0.996 0.000 0.004
#> SRR1400931 1 0.3074 0.885 0.804 0.000 0.000 0.000 0.196
#> SRR1416188 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 3 0.0162 0.921 0.000 0.000 0.996 0.000 0.004
#> SRR1078392 5 0.2230 0.820 0.116 0.000 0.000 0.000 0.884
#> SRR1436468 3 0.4397 0.423 0.432 0.000 0.564 0.004 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1418747 5 0.3003 0.741 0.000 0.000 0.188 0.000 0.812
#> SRR1318089 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.3534 0.844 0.744 0.000 0.000 0.000 0.256
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 5 0.0162 0.882 0.004 0.000 0.000 0.000 0.996
#> SRR1460337 1 0.3039 0.885 0.808 0.000 0.000 0.000 0.192
#> SRR1469062 5 0.4478 0.705 0.000 0.000 0.100 0.144 0.756
#> SRR1388459 3 0.2439 0.833 0.120 0.000 0.876 0.004 0.000
#> SRR1416841 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1473778 1 0.0162 0.800 0.996 0.000 0.000 0.004 0.000
#> SRR1419561 5 0.0290 0.880 0.008 0.000 0.000 0.000 0.992
#> SRR1339987 5 0.2891 0.756 0.000 0.000 0.176 0.000 0.824
#> SRR1469662 5 0.0162 0.882 0.004 0.000 0.000 0.000 0.996
#> SRR1432958 1 0.3074 0.885 0.804 0.000 0.000 0.000 0.196
#> SRR1479198 5 0.0162 0.882 0.004 0.000 0.000 0.000 0.996
#> SRR1353600 1 0.3452 0.854 0.756 0.000 0.000 0.000 0.244
#> SRR1456492 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1389955 5 0.0162 0.882 0.004 0.000 0.000 0.000 0.996
#> SRR1429540 1 0.0162 0.800 0.996 0.000 0.000 0.004 0.000
#> SRR1356057 3 0.3266 0.763 0.200 0.000 0.796 0.004 0.000
#> SRR1328715 1 0.3039 0.885 0.808 0.000 0.000 0.000 0.192
#> SRR1429429 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1382978 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.0162 0.921 0.000 0.000 0.996 0.000 0.004
#> SRR1418225 4 0.0162 0.998 0.000 0.004 0.000 0.996 0.000
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.0162 0.800 0.996 0.000 0.000 0.004 0.000
#> SRR1431823 3 0.0162 0.921 0.000 0.000 0.996 0.000 0.004
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.0162 0.998 0.000 0.004 0.000 0.996 0.000
#> SRR1445618 1 0.3074 0.885 0.804 0.000 0.000 0.000 0.196
#> SRR1081589 4 0.0162 0.998 0.000 0.004 0.000 0.996 0.000
#> SRR1097245 1 0.3074 0.885 0.804 0.000 0.000 0.000 0.196
#> SRR1416141 1 0.6012 0.693 0.572 0.000 0.000 0.164 0.264
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.3039 0.885 0.808 0.000 0.000 0.000 0.192
#> SRR1406135 5 0.0162 0.882 0.004 0.000 0.000 0.000 0.996
#> SRR1413307 4 0.0162 0.998 0.000 0.004 0.000 0.996 0.000
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0162 0.995 0.000 0.000 0.000 0.996 0.004
#> SRR1381185 3 0.3422 0.763 0.200 0.000 0.792 0.004 0.004
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.0162 0.921 0.000 0.000 0.996 0.000 0.004
#> SRR1486322 3 0.0000 0.921 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 3 0.4150 0.274 0.000 0.000 0.612 0.000 0.388
#> SRR1459980 5 0.3838 0.676 0.280 0.000 0.000 0.004 0.716
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0458 0.969 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1405147 6 0.1204 0.899 0.056 0.000 0.000 0.000 0.000 0.944
#> SRR1315412 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 1 0.0692 0.974 0.976 0.000 0.000 0.000 0.020 0.004
#> SRR1071105 2 0.0146 0.997 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1432868 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1475324 3 0.0458 0.969 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1340260 6 0.1610 0.889 0.084 0.000 0.000 0.000 0.000 0.916
#> SRR1376450 5 0.0790 0.968 0.032 0.000 0.000 0.000 0.968 0.000
#> SRR1321897 3 0.1074 0.965 0.000 0.000 0.960 0.000 0.012 0.028
#> SRR1445194 1 0.1387 0.931 0.932 0.000 0.000 0.000 0.068 0.000
#> SRR1443308 3 0.1074 0.965 0.000 0.000 0.960 0.000 0.012 0.028
#> SRR1400931 1 0.0146 0.982 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1416188 3 0.0000 0.971 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1407044 3 0.1074 0.965 0.000 0.000 0.960 0.000 0.012 0.028
#> SRR1078392 5 0.1367 0.953 0.012 0.000 0.000 0.000 0.944 0.044
#> SRR1436468 6 0.1124 0.889 0.008 0.000 0.036 0.000 0.000 0.956
#> SRR1476125 2 0.0146 0.997 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1418747 5 0.0363 0.966 0.000 0.000 0.000 0.000 0.988 0.012
#> SRR1318089 3 0.0000 0.971 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.0547 0.973 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1348929 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.0458 0.974 0.016 0.000 0.000 0.000 0.984 0.000
#> SRR1460337 1 0.0146 0.982 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1469062 5 0.2190 0.899 0.000 0.000 0.044 0.008 0.908 0.040
#> SRR1388459 6 0.3810 0.275 0.000 0.000 0.428 0.000 0.000 0.572
#> SRR1416841 3 0.0458 0.969 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1473778 6 0.1387 0.897 0.068 0.000 0.000 0.000 0.000 0.932
#> SRR1419561 5 0.0858 0.972 0.028 0.000 0.000 0.000 0.968 0.004
#> SRR1339987 5 0.0146 0.969 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR1469662 5 0.0547 0.974 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR1432958 1 0.0146 0.982 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1479198 5 0.0508 0.974 0.012 0.000 0.000 0.000 0.984 0.004
#> SRR1353600 1 0.0363 0.977 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1456492 3 0.0458 0.970 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1389955 5 0.0508 0.974 0.012 0.000 0.000 0.000 0.984 0.004
#> SRR1429540 6 0.1714 0.883 0.092 0.000 0.000 0.000 0.000 0.908
#> SRR1356057 6 0.1007 0.880 0.000 0.000 0.044 0.000 0.000 0.956
#> SRR1328715 1 0.0146 0.982 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1429429 3 0.0458 0.969 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1325201 2 0.0146 0.997 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1382978 3 0.0458 0.969 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1406348 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 3 0.1074 0.965 0.000 0.000 0.960 0.000 0.012 0.028
#> SRR1418225 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 6 0.1204 0.899 0.056 0.000 0.000 0.000 0.000 0.944
#> SRR1431823 3 0.1074 0.965 0.000 0.000 0.960 0.000 0.012 0.028
#> SRR1447916 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1445618 1 0.0146 0.982 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1081589 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1097245 1 0.0146 0.982 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1416141 1 0.1498 0.944 0.940 0.000 0.000 0.028 0.032 0.000
#> SRR1404339 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.0146 0.982 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1406135 5 0.0713 0.971 0.028 0.000 0.000 0.000 0.972 0.000
#> SRR1413307 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 6 0.0713 0.881 0.000 0.000 0.028 0.000 0.000 0.972
#> SRR1100608 2 0.0146 0.997 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1386927 2 0.0000 0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.1074 0.965 0.000 0.000 0.960 0.000 0.012 0.028
#> SRR1486322 3 0.0260 0.970 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR1080790 3 0.2618 0.868 0.000 0.000 0.860 0.000 0.116 0.024
#> SRR1459980 6 0.1297 0.880 0.012 0.000 0.000 0.000 0.040 0.948
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 17667 rows and 70 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 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.995 0.998 0.3280 0.675 0.675
#> 3 3 1.000 0.989 0.995 0.8375 0.725 0.594
#> 4 4 1.000 0.977 0.990 0.1286 0.918 0.795
#> 5 5 0.800 0.744 0.852 0.1192 0.921 0.762
#> 6 6 0.943 0.910 0.963 0.0748 0.891 0.605
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4
There is also optional best \(k\) = 2 3 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
#> SRR1433493 1 0.000 0.997 1.00 0.00
#> SRR1405147 1 0.000 0.997 1.00 0.00
#> SRR1315412 2 0.000 1.000 0.00 1.00
#> SRR1338384 1 0.000 0.997 1.00 0.00
#> SRR1071105 1 0.634 0.810 0.84 0.16
#> SRR1432868 2 0.000 1.000 0.00 1.00
#> SRR1454480 1 0.000 0.997 1.00 0.00
#> SRR1330723 2 0.000 1.000 0.00 1.00
#> SRR1475324 1 0.000 0.997 1.00 0.00
#> SRR1340260 1 0.000 0.997 1.00 0.00
#> SRR1376450 1 0.000 0.997 1.00 0.00
#> SRR1321897 1 0.000 0.997 1.00 0.00
#> SRR1445194 1 0.000 0.997 1.00 0.00
#> SRR1443308 1 0.000 0.997 1.00 0.00
#> SRR1400931 1 0.000 0.997 1.00 0.00
#> SRR1416188 1 0.000 0.997 1.00 0.00
#> SRR1407044 1 0.000 0.997 1.00 0.00
#> SRR1078392 1 0.000 0.997 1.00 0.00
#> SRR1436468 1 0.000 0.997 1.00 0.00
#> SRR1476125 2 0.000 1.000 0.00 1.00
#> SRR1418747 1 0.000 0.997 1.00 0.00
#> SRR1318089 1 0.000 0.997 1.00 0.00
#> SRR1444370 1 0.000 0.997 1.00 0.00
#> SRR1348929 2 0.000 1.000 0.00 1.00
#> SRR1385690 1 0.000 0.997 1.00 0.00
#> SRR1460337 1 0.000 0.997 1.00 0.00
#> SRR1469062 1 0.000 0.997 1.00 0.00
#> SRR1388459 1 0.000 0.997 1.00 0.00
#> SRR1416841 1 0.000 0.997 1.00 0.00
#> SRR1473778 1 0.000 0.997 1.00 0.00
#> SRR1419561 1 0.000 0.997 1.00 0.00
#> SRR1339987 1 0.000 0.997 1.00 0.00
#> SRR1469662 1 0.000 0.997 1.00 0.00
#> SRR1432958 1 0.000 0.997 1.00 0.00
#> SRR1479198 1 0.000 0.997 1.00 0.00
#> SRR1353600 1 0.000 0.997 1.00 0.00
#> SRR1456492 1 0.000 0.997 1.00 0.00
#> SRR1389955 1 0.000 0.997 1.00 0.00
#> SRR1429540 1 0.000 0.997 1.00 0.00
#> SRR1356057 1 0.000 0.997 1.00 0.00
#> SRR1328715 1 0.000 0.997 1.00 0.00
#> SRR1429429 1 0.000 0.997 1.00 0.00
#> SRR1325201 2 0.000 1.000 0.00 1.00
#> SRR1382978 1 0.000 0.997 1.00 0.00
#> SRR1406348 2 0.000 1.000 0.00 1.00
#> SRR1469390 2 0.000 1.000 0.00 1.00
#> SRR1376380 1 0.000 0.997 1.00 0.00
#> SRR1418225 1 0.000 0.997 1.00 0.00
#> SRR1418473 2 0.000 1.000 0.00 1.00
#> SRR1376741 1 0.000 0.997 1.00 0.00
#> SRR1431823 1 0.000 0.997 1.00 0.00
#> SRR1447916 2 0.000 1.000 0.00 1.00
#> SRR1458643 1 0.000 0.997 1.00 0.00
#> SRR1445618 1 0.000 0.997 1.00 0.00
#> SRR1081589 1 0.000 0.997 1.00 0.00
#> SRR1097245 1 0.000 0.997 1.00 0.00
#> SRR1416141 1 0.000 0.997 1.00 0.00
#> SRR1404339 2 0.000 1.000 0.00 1.00
#> SRR1478614 1 0.000 0.997 1.00 0.00
#> SRR1406135 1 0.000 0.997 1.00 0.00
#> SRR1413307 1 0.000 0.997 1.00 0.00
#> SRR1397720 2 0.000 1.000 0.00 1.00
#> SRR1358391 1 0.000 0.997 1.00 0.00
#> SRR1381185 1 0.000 0.997 1.00 0.00
#> SRR1100608 2 0.000 1.000 0.00 1.00
#> SRR1386927 2 0.000 1.000 0.00 1.00
#> SRR1331771 1 0.000 0.997 1.00 0.00
#> SRR1486322 1 0.000 0.997 1.00 0.00
#> SRR1080790 1 0.000 0.997 1.00 0.00
#> SRR1459980 1 0.000 0.997 1.00 0.00
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1405147 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1071105 1 0.4654 0.742 0.792 0.208 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1454480 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1475324 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1340260 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1321897 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1445194 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1443308 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1400931 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1416188 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1407044 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1078392 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1436468 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1418747 1 0.2796 0.899 0.908 0.000 0.092
#> SRR1318089 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1444370 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1385690 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1469062 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1388459 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1416841 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1473778 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1419561 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1339987 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1469662 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1353600 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1456492 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1389955 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1429540 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1356057 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1328715 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1429429 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1382978 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376380 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1418225 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1431823 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1458643 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1445618 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1081589 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1097245 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1413307 1 0.0747 0.977 0.984 0.000 0.016
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1358391 1 0.0000 0.991 1.000 0.000 0.000
#> SRR1381185 1 0.1163 0.966 0.972 0.000 0.028
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1331771 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1486322 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1080790 3 0.0000 1.000 0.000 0.000 1.000
#> SRR1459980 1 0.0000 0.991 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1071105 1 0.3688 0.712 0.792 0.208 0.000 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.2589 0.852 0.116 0.000 0.000 0.884
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1321897 3 0.0188 0.998 0.000 0.000 0.996 0.004
#> SRR1445194 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1443308 3 0.0188 0.998 0.000 0.000 0.996 0.004
#> SRR1400931 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.0188 0.998 0.000 0.000 0.996 0.004
#> SRR1078392 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1436468 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1418747 1 0.2401 0.874 0.904 0.000 0.092 0.004
#> SRR1318089 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1460337 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1469062 1 0.0188 0.983 0.996 0.000 0.000 0.004
#> SRR1388459 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1419561 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1339987 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1469662 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.0188 0.998 0.000 0.000 0.996 0.004
#> SRR1389955 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1429540 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1356057 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1328715 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1382978 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.0188 0.998 0.000 0.000 0.996 0.004
#> SRR1418225 4 0.0188 0.914 0.004 0.000 0.000 0.996
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1431823 3 0.0188 0.998 0.000 0.000 0.996 0.004
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.0188 0.914 0.004 0.000 0.000 0.996
#> SRR1445618 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.0188 0.914 0.004 0.000 0.000 0.996
#> SRR1097245 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> SRR1413307 4 0.0000 0.910 0.000 0.000 0.000 1.000
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.3610 0.764 0.200 0.000 0.000 0.800
#> SRR1381185 1 0.1209 0.950 0.964 0.000 0.032 0.004
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.0188 0.998 0.000 0.000 0.996 0.004
#> SRR1486322 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.0000 0.998 0.000 0.000 1.000 0.000
#> SRR1459980 1 0.0000 0.987 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0000 0.8916 0.000 0.000 1.000 0.000 0.000
#> SRR1405147 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1315412 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1338384 1 0.3983 0.6667 0.660 0.340 0.000 0.000 0.000
#> SRR1071105 1 0.4902 0.5634 0.648 0.304 0.000 0.000 0.048
#> SRR1432868 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1454480 4 0.2179 0.8457 0.112 0.000 0.000 0.888 0.000
#> SRR1330723 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1475324 3 0.0000 0.8916 0.000 0.000 1.000 0.000 0.000
#> SRR1340260 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1376450 1 0.4304 0.5875 0.516 0.484 0.000 0.000 0.000
#> SRR1321897 5 0.4304 0.6190 0.000 0.000 0.484 0.000 0.516
#> SRR1445194 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1443308 5 0.4304 0.6190 0.000 0.000 0.484 0.000 0.516
#> SRR1400931 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.0404 0.8745 0.000 0.000 0.988 0.000 0.012
#> SRR1407044 5 0.6015 0.4889 0.000 0.360 0.124 0.000 0.516
#> SRR1078392 1 0.3452 0.7023 0.756 0.244 0.000 0.000 0.000
#> SRR1436468 1 0.0162 0.7844 0.996 0.000 0.000 0.000 0.004
#> SRR1476125 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1418747 2 0.6308 -0.4688 0.164 0.484 0.000 0.000 0.352
#> SRR1318089 3 0.0000 0.8916 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1348929 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1385690 1 0.4304 0.5875 0.516 0.484 0.000 0.000 0.000
#> SRR1460337 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1469062 5 0.4304 0.4200 0.000 0.484 0.000 0.000 0.516
#> SRR1388459 3 0.0000 0.8916 0.000 0.000 1.000 0.000 0.000
#> SRR1416841 3 0.0000 0.8916 0.000 0.000 1.000 0.000 0.000
#> SRR1473778 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1419561 1 0.4242 0.6213 0.572 0.428 0.000 0.000 0.000
#> SRR1339987 1 0.4304 0.5875 0.516 0.484 0.000 0.000 0.000
#> SRR1469662 1 0.4304 0.5875 0.516 0.484 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1479198 1 0.4304 0.5875 0.516 0.484 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1456492 5 0.4304 0.6190 0.000 0.000 0.484 0.000 0.516
#> SRR1389955 1 0.4304 0.5875 0.516 0.484 0.000 0.000 0.000
#> SRR1429540 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1356057 1 0.3395 0.6063 0.764 0.000 0.236 0.000 0.000
#> SRR1328715 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.8916 0.000 0.000 1.000 0.000 0.000
#> SRR1325201 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1382978 3 0.0000 0.8916 0.000 0.000 1.000 0.000 0.000
#> SRR1406348 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1469390 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1376380 5 0.4304 0.6190 0.000 0.000 0.484 0.000 0.516
#> SRR1418225 4 0.0000 0.9121 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1376741 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1431823 5 0.4304 0.6190 0.000 0.000 0.484 0.000 0.516
#> SRR1447916 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1458643 4 0.0000 0.9121 0.000 0.000 0.000 1.000 0.000
#> SRR1445618 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1081589 4 0.0000 0.9121 0.000 0.000 0.000 1.000 0.000
#> SRR1097245 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1404339 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1478614 1 0.0000 0.7871 1.000 0.000 0.000 0.000 0.000
#> SRR1406135 1 0.4304 0.5875 0.516 0.484 0.000 0.000 0.000
#> SRR1413307 4 0.0000 0.9121 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1358391 4 0.3109 0.7433 0.200 0.000 0.000 0.800 0.000
#> SRR1381185 5 0.4897 0.4238 0.024 0.460 0.000 0.000 0.516
#> SRR1100608 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1386927 2 0.4304 0.9231 0.000 0.516 0.000 0.000 0.484
#> SRR1331771 5 0.4304 0.6190 0.000 0.000 0.484 0.000 0.516
#> SRR1486322 3 0.0000 0.8916 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 3 0.4304 0.0699 0.000 0.484 0.516 0.000 0.000
#> SRR1459980 1 0.4304 0.5875 0.516 0.484 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
#> SRR1433493 3 0.0000 0.9902 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1315412 2 0.0146 0.9976 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1338384 1 0.3867 0.0883 0.512 0.000 0.000 0.000 0.488 0.000
#> SRR1071105 5 0.5428 0.3696 0.320 0.140 0.000 0.000 0.540 0.000
#> SRR1432868 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.1957 0.8464 0.112 0.000 0.000 0.888 0.000 0.000
#> SRR1330723 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1475324 3 0.0458 0.9834 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1340260 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1376450 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1321897 6 0.0146 0.9533 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1445194 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1443308 6 0.0146 0.9533 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1400931 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.1007 0.9584 0.000 0.000 0.956 0.000 0.000 0.044
#> SRR1407044 6 0.0146 0.9533 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1078392 1 0.3330 0.5876 0.716 0.000 0.000 0.000 0.284 0.000
#> SRR1436468 1 0.0363 0.9250 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR1476125 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1418747 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1318089 3 0.0458 0.9834 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1444370 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1460337 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1469062 5 0.0458 0.9103 0.000 0.000 0.000 0.000 0.984 0.016
#> SRR1388459 3 0.0000 0.9902 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1416841 3 0.0000 0.9902 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1473778 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1419561 5 0.2416 0.7503 0.156 0.000 0.000 0.000 0.844 0.000
#> SRR1339987 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1469662 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1432958 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1479198 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1353600 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1456492 6 0.2454 0.8041 0.000 0.000 0.160 0.000 0.000 0.840
#> SRR1389955 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1429540 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1356057 1 0.3244 0.6224 0.732 0.000 0.268 0.000 0.000 0.000
#> SRR1328715 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.9902 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1325201 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1382978 3 0.0000 0.9902 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0146 0.9976 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1376380 6 0.0146 0.9533 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1418225 4 0.0000 0.9124 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0146 0.9976 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1376741 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1431823 6 0.0146 0.9533 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1447916 2 0.0146 0.9976 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1458643 4 0.0000 0.9124 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1445618 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1081589 4 0.0000 0.9124 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1097245 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.0146 0.9316 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1404339 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.0000 0.9345 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1406135 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1413307 4 0.0000 0.9124 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.2793 0.7492 0.200 0.000 0.000 0.800 0.000 0.000
#> SRR1381185 6 0.2048 0.8370 0.000 0.000 0.000 0.000 0.120 0.880
#> SRR1100608 2 0.0000 0.9987 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1386927 2 0.0146 0.9976 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1331771 6 0.0146 0.9533 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR1486322 3 0.0000 0.9902 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 5 0.2664 0.7529 0.000 0.000 0.184 0.000 0.816 0.000
#> SRR1459980 5 0.0000 0.9204 0.000 0.000 0.000 0.000 1.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 17667 rows and 70 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 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 1.000 1.000 0.4267 0.574 0.574
#> 3 3 0.691 0.820 0.841 0.2941 0.963 0.935
#> 4 4 0.912 0.914 0.965 0.2390 0.781 0.593
#> 5 5 0.711 0.746 0.876 0.0860 0.891 0.684
#> 6 6 0.784 0.827 0.869 0.0935 0.856 0.515
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
#> SRR1433493 1 0 1 1 0
#> SRR1405147 1 0 1 1 0
#> SRR1315412 2 0 1 0 1
#> SRR1338384 1 0 1 1 0
#> SRR1071105 2 0 1 0 1
#> SRR1432868 2 0 1 0 1
#> SRR1454480 2 0 1 0 1
#> SRR1330723 2 0 1 0 1
#> SRR1475324 1 0 1 1 0
#> SRR1340260 1 0 1 1 0
#> SRR1376450 1 0 1 1 0
#> SRR1321897 1 0 1 1 0
#> SRR1445194 1 0 1 1 0
#> SRR1443308 1 0 1 1 0
#> SRR1400931 1 0 1 1 0
#> SRR1416188 1 0 1 1 0
#> SRR1407044 1 0 1 1 0
#> SRR1078392 1 0 1 1 0
#> SRR1436468 1 0 1 1 0
#> SRR1476125 2 0 1 0 1
#> SRR1418747 1 0 1 1 0
#> SRR1318089 1 0 1 1 0
#> SRR1444370 1 0 1 1 0
#> SRR1348929 2 0 1 0 1
#> SRR1385690 1 0 1 1 0
#> SRR1460337 1 0 1 1 0
#> SRR1469062 1 0 1 1 0
#> SRR1388459 1 0 1 1 0
#> SRR1416841 1 0 1 1 0
#> SRR1473778 1 0 1 1 0
#> SRR1419561 1 0 1 1 0
#> SRR1339987 1 0 1 1 0
#> SRR1469662 1 0 1 1 0
#> SRR1432958 1 0 1 1 0
#> SRR1479198 1 0 1 1 0
#> SRR1353600 1 0 1 1 0
#> SRR1456492 1 0 1 1 0
#> SRR1389955 1 0 1 1 0
#> SRR1429540 1 0 1 1 0
#> SRR1356057 1 0 1 1 0
#> SRR1328715 1 0 1 1 0
#> SRR1429429 1 0 1 1 0
#> SRR1325201 2 0 1 0 1
#> SRR1382978 1 0 1 1 0
#> SRR1406348 2 0 1 0 1
#> SRR1469390 2 0 1 0 1
#> SRR1376380 1 0 1 1 0
#> SRR1418225 2 0 1 0 1
#> SRR1418473 2 0 1 0 1
#> SRR1376741 1 0 1 1 0
#> SRR1431823 1 0 1 1 0
#> SRR1447916 2 0 1 0 1
#> SRR1458643 2 0 1 0 1
#> SRR1445618 1 0 1 1 0
#> SRR1081589 2 0 1 0 1
#> SRR1097245 1 0 1 1 0
#> SRR1416141 1 0 1 1 0
#> SRR1404339 2 0 1 0 1
#> SRR1478614 1 0 1 1 0
#> SRR1406135 1 0 1 1 0
#> SRR1413307 2 0 1 0 1
#> SRR1397720 2 0 1 0 1
#> SRR1358391 2 0 1 0 1
#> SRR1381185 1 0 1 1 0
#> SRR1100608 2 0 1 0 1
#> SRR1386927 2 0 1 0 1
#> SRR1331771 1 0 1 1 0
#> SRR1486322 1 0 1 1 0
#> SRR1080790 1 0 1 1 0
#> SRR1459980 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1405147 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1315412 2 0.0237 0.951 0.000 0.996 0.004
#> SRR1338384 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1071105 2 0.3192 0.734 0.000 0.888 0.112
#> SRR1432868 2 0.0000 0.954 0.000 1.000 0.000
#> SRR1454480 3 0.6309 1.000 0.000 0.496 0.504
#> SRR1330723 2 0.0424 0.949 0.000 0.992 0.008
#> SRR1475324 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1340260 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1321897 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1445194 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1443308 1 0.6260 0.639 0.552 0.000 0.448
#> SRR1400931 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1416188 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1407044 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1078392 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1436468 1 0.4128 0.795 0.856 0.012 0.132
#> SRR1476125 2 0.0424 0.949 0.000 0.992 0.008
#> SRR1418747 1 0.0424 0.840 0.992 0.000 0.008
#> SRR1318089 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1444370 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1348929 2 0.0000 0.954 0.000 1.000 0.000
#> SRR1385690 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1460337 1 0.1647 0.814 0.960 0.004 0.036
#> SRR1469062 1 0.1163 0.835 0.972 0.000 0.028
#> SRR1388459 1 0.3551 0.799 0.868 0.000 0.132
#> SRR1416841 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1473778 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1419561 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1339987 1 0.3412 0.802 0.876 0.000 0.124
#> SRR1469662 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1353600 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1456492 1 0.6215 0.651 0.572 0.000 0.428
#> SRR1389955 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1429540 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1356057 1 0.3412 0.802 0.876 0.000 0.124
#> SRR1328715 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1429429 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1325201 2 0.0424 0.949 0.000 0.992 0.008
#> SRR1382978 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1406348 2 0.0000 0.954 0.000 1.000 0.000
#> SRR1469390 2 0.3941 0.560 0.000 0.844 0.156
#> SRR1376380 1 0.6302 0.619 0.520 0.000 0.480
#> SRR1418225 3 0.6309 1.000 0.000 0.496 0.504
#> SRR1418473 2 0.0000 0.954 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1431823 1 0.6299 0.622 0.524 0.000 0.476
#> SRR1447916 2 0.0237 0.951 0.000 0.996 0.004
#> SRR1458643 3 0.6309 1.000 0.000 0.496 0.504
#> SRR1445618 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1081589 3 0.6309 1.000 0.000 0.496 0.504
#> SRR1097245 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1404339 2 0.0000 0.954 0.000 1.000 0.000
#> SRR1478614 1 0.0237 0.839 0.996 0.004 0.000
#> SRR1406135 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1413307 3 0.6309 1.000 0.000 0.496 0.504
#> SRR1397720 2 0.0000 0.954 0.000 1.000 0.000
#> SRR1358391 3 0.6309 1.000 0.000 0.496 0.504
#> SRR1381185 1 0.0000 0.842 1.000 0.000 0.000
#> SRR1100608 2 0.0424 0.949 0.000 0.992 0.008
#> SRR1386927 2 0.0424 0.947 0.000 0.992 0.008
#> SRR1331771 1 0.6260 0.639 0.552 0.000 0.448
#> SRR1486322 1 0.6307 0.614 0.512 0.000 0.488
#> SRR1080790 1 0.0237 0.841 0.996 0.000 0.004
#> SRR1459980 1 0.0000 0.842 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.1022 0.896 0.032 0.000 0.968 0.000
#> SRR1405147 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1315412 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1071105 2 0.0188 0.997 0.000 0.996 0.004 0.000
#> SRR1432868 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1330723 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0188 0.907 0.004 0.000 0.996 0.000
#> SRR1340260 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.0188 0.948 0.996 0.000 0.004 0.000
#> SRR1321897 3 0.0188 0.907 0.004 0.000 0.996 0.000
#> SRR1445194 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1443308 3 0.3494 0.775 0.004 0.000 0.824 0.172
#> SRR1400931 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0188 0.907 0.004 0.000 0.996 0.000
#> SRR1407044 3 0.2149 0.840 0.088 0.000 0.912 0.000
#> SRR1078392 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1436468 1 0.4830 0.307 0.608 0.000 0.392 0.000
#> SRR1476125 2 0.0188 0.997 0.000 0.996 0.004 0.000
#> SRR1418747 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1318089 3 0.0188 0.907 0.004 0.000 0.996 0.000
#> SRR1444370 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1460337 1 0.0188 0.948 0.996 0.000 0.004 0.000
#> SRR1469062 1 0.2704 0.827 0.876 0.000 0.124 0.000
#> SRR1388459 3 0.4605 0.516 0.336 0.000 0.664 0.000
#> SRR1416841 3 0.0188 0.907 0.004 0.000 0.996 0.000
#> SRR1473778 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1419561 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1339987 1 0.3311 0.766 0.828 0.000 0.172 0.000
#> SRR1469662 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.3649 0.724 0.204 0.000 0.796 0.000
#> SRR1389955 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1429540 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1356057 1 0.4817 0.309 0.612 0.000 0.388 0.000
#> SRR1328715 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.0188 0.907 0.004 0.000 0.996 0.000
#> SRR1325201 2 0.0188 0.997 0.000 0.996 0.004 0.000
#> SRR1382978 3 0.0188 0.907 0.004 0.000 0.996 0.000
#> SRR1406348 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.0707 0.903 0.020 0.000 0.980 0.000
#> SRR1418225 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1418473 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1431823 3 0.0817 0.902 0.024 0.000 0.976 0.000
#> SRR1447916 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1445618 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1097245 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1404339 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0188 0.948 0.996 0.000 0.004 0.000
#> SRR1406135 1 0.0188 0.948 0.996 0.000 0.004 0.000
#> SRR1413307 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1397720 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR1381185 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1100608 2 0.0188 0.997 0.000 0.996 0.004 0.000
#> SRR1386927 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.3024 0.790 0.148 0.000 0.852 0.000
#> SRR1486322 3 0.0188 0.907 0.004 0.000 0.996 0.000
#> SRR1080790 1 0.4331 0.567 0.712 0.000 0.288 0.000
#> SRR1459980 1 0.0000 0.951 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
#> SRR1433493 3 0.1281 0.866 0.012 0.000 0.956 0.000 0.032
#> SRR1405147 1 0.3075 0.776 0.860 0.000 0.048 0.000 0.092
#> SRR1315412 2 0.0000 0.889 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.1444 0.808 0.948 0.000 0.012 0.000 0.040
#> SRR1071105 5 0.3861 0.119 0.008 0.264 0.000 0.000 0.728
#> SRR1432868 2 0.0000 0.889 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 5 0.4302 -0.348 0.000 0.480 0.000 0.000 0.520
#> SRR1475324 3 0.0880 0.868 0.000 0.000 0.968 0.000 0.032
#> SRR1340260 1 0.1121 0.805 0.956 0.000 0.000 0.000 0.044
#> SRR1376450 1 0.3109 0.646 0.800 0.000 0.000 0.000 0.200
#> SRR1321897 3 0.0880 0.868 0.000 0.000 0.968 0.000 0.032
#> SRR1445194 1 0.0162 0.808 0.996 0.000 0.000 0.000 0.004
#> SRR1443308 3 0.2171 0.842 0.000 0.000 0.912 0.024 0.064
#> SRR1400931 1 0.0162 0.808 0.996 0.000 0.000 0.000 0.004
#> SRR1416188 3 0.0880 0.868 0.000 0.000 0.968 0.000 0.032
#> SRR1407044 3 0.1082 0.859 0.028 0.000 0.964 0.000 0.008
#> SRR1078392 1 0.5105 0.573 0.660 0.000 0.264 0.000 0.076
#> SRR1436468 5 0.4359 0.296 0.412 0.000 0.004 0.000 0.584
#> SRR1476125 2 0.3707 0.714 0.000 0.716 0.000 0.000 0.284
#> SRR1418747 1 0.5368 0.439 0.596 0.000 0.332 0.000 0.072
#> SRR1318089 3 0.0880 0.868 0.000 0.000 0.968 0.000 0.032
#> SRR1444370 1 0.0162 0.808 0.996 0.000 0.000 0.000 0.004
#> SRR1348929 2 0.0000 0.889 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.3106 0.744 0.844 0.000 0.132 0.000 0.024
#> SRR1460337 5 0.4235 0.271 0.424 0.000 0.000 0.000 0.576
#> SRR1469062 3 0.5783 0.262 0.360 0.000 0.540 0.000 0.100
#> SRR1388459 3 0.2616 0.815 0.076 0.000 0.888 0.000 0.036
#> SRR1416841 3 0.0880 0.868 0.000 0.000 0.968 0.000 0.032
#> SRR1473778 1 0.4057 0.723 0.792 0.000 0.120 0.000 0.088
#> SRR1419561 1 0.2230 0.745 0.884 0.000 0.000 0.000 0.116
#> SRR1339987 3 0.5506 0.473 0.284 0.000 0.616 0.000 0.100
#> SRR1469662 1 0.1892 0.792 0.916 0.000 0.080 0.000 0.004
#> SRR1432958 1 0.0162 0.808 0.996 0.000 0.000 0.000 0.004
#> SRR1479198 1 0.3975 0.720 0.792 0.000 0.144 0.000 0.064
#> SRR1353600 1 0.2592 0.790 0.892 0.000 0.052 0.000 0.056
#> SRR1456492 3 0.1981 0.844 0.016 0.000 0.920 0.000 0.064
#> SRR1389955 1 0.4412 0.687 0.756 0.000 0.164 0.000 0.080
#> SRR1429540 1 0.1732 0.796 0.920 0.000 0.000 0.000 0.080
#> SRR1356057 3 0.4732 0.647 0.208 0.000 0.716 0.000 0.076
#> SRR1328715 1 0.0162 0.808 0.996 0.000 0.000 0.000 0.004
#> SRR1429429 3 0.0880 0.868 0.000 0.000 0.968 0.000 0.032
#> SRR1325201 2 0.3707 0.714 0.000 0.716 0.000 0.000 0.284
#> SRR1382978 3 0.0880 0.868 0.000 0.000 0.968 0.000 0.032
#> SRR1406348 2 0.1671 0.857 0.000 0.924 0.000 0.000 0.076
#> SRR1469390 2 0.0000 0.889 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.0579 0.863 0.008 0.000 0.984 0.000 0.008
#> SRR1418225 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.0000 0.889 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.1908 0.790 0.908 0.000 0.000 0.000 0.092
#> SRR1431823 3 0.0579 0.863 0.008 0.000 0.984 0.000 0.008
#> SRR1447916 2 0.0000 0.889 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1445618 1 0.0162 0.808 0.996 0.000 0.000 0.000 0.004
#> SRR1081589 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1097245 1 0.1851 0.765 0.912 0.000 0.000 0.000 0.088
#> SRR1416141 1 0.3297 0.770 0.848 0.000 0.084 0.000 0.068
#> SRR1404339 2 0.3242 0.767 0.000 0.784 0.000 0.000 0.216
#> SRR1478614 1 0.3999 0.301 0.656 0.000 0.000 0.000 0.344
#> SRR1406135 1 0.2773 0.694 0.836 0.000 0.000 0.000 0.164
#> SRR1413307 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.889 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR1381185 1 0.4316 0.709 0.772 0.000 0.120 0.000 0.108
#> SRR1100608 2 0.3707 0.714 0.000 0.716 0.000 0.000 0.284
#> SRR1386927 2 0.0000 0.889 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.1764 0.847 0.008 0.000 0.928 0.000 0.064
#> SRR1486322 3 0.0880 0.868 0.000 0.000 0.968 0.000 0.032
#> SRR1080790 3 0.4557 0.243 0.404 0.000 0.584 0.000 0.012
#> SRR1459980 1 0.4194 0.714 0.780 0.000 0.132 0.000 0.088
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.911 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 5 0.1913 0.786 0.080 0.000 0.000 0.000 0.908 0.012
#> SRR1315412 2 0.0000 0.951 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 5 0.2300 0.784 0.144 0.000 0.000 0.000 0.856 0.000
#> SRR1071105 6 0.2724 0.785 0.084 0.052 0.000 0.000 0.000 0.864
#> SRR1432868 2 0.0363 0.948 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR1454480 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1330723 6 0.2178 0.873 0.000 0.132 0.000 0.000 0.000 0.868
#> SRR1475324 3 0.0363 0.909 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1340260 5 0.3046 0.746 0.188 0.000 0.000 0.000 0.800 0.012
#> SRR1376450 1 0.0508 0.869 0.984 0.000 0.000 0.000 0.012 0.004
#> SRR1321897 3 0.0000 0.911 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1445194 1 0.1556 0.859 0.920 0.000 0.000 0.000 0.080 0.000
#> SRR1443308 3 0.4180 0.471 0.000 0.000 0.628 0.024 0.348 0.000
#> SRR1400931 1 0.1700 0.865 0.916 0.000 0.000 0.000 0.080 0.004
#> SRR1416188 3 0.0000 0.911 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1407044 3 0.0692 0.905 0.004 0.000 0.976 0.000 0.020 0.000
#> SRR1078392 5 0.4140 0.784 0.076 0.000 0.036 0.000 0.784 0.104
#> SRR1436468 1 0.3493 0.740 0.800 0.000 0.000 0.000 0.064 0.136
#> SRR1476125 6 0.2823 0.895 0.000 0.204 0.000 0.000 0.000 0.796
#> SRR1418747 5 0.6082 0.577 0.068 0.000 0.260 0.000 0.568 0.104
#> SRR1318089 3 0.0000 0.911 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.3563 0.425 0.664 0.000 0.000 0.000 0.336 0.000
#> SRR1348929 2 0.0363 0.948 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR1385690 5 0.4801 0.749 0.136 0.000 0.036 0.000 0.724 0.104
#> SRR1460337 1 0.1829 0.837 0.920 0.000 0.000 0.000 0.024 0.056
#> SRR1469062 5 0.4674 0.773 0.068 0.000 0.080 0.000 0.748 0.104
#> SRR1388459 3 0.3271 0.697 0.008 0.000 0.760 0.000 0.232 0.000
#> SRR1416841 3 0.0363 0.909 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1473778 5 0.1686 0.789 0.064 0.000 0.000 0.000 0.924 0.012
#> SRR1419561 5 0.3915 0.425 0.412 0.000 0.000 0.000 0.584 0.004
#> SRR1339987 5 0.4518 0.777 0.068 0.000 0.068 0.000 0.760 0.104
#> SRR1469662 5 0.3862 0.373 0.388 0.000 0.004 0.000 0.608 0.000
#> SRR1432958 1 0.1806 0.862 0.908 0.000 0.000 0.000 0.088 0.004
#> SRR1479198 5 0.3456 0.785 0.076 0.000 0.004 0.000 0.816 0.104
#> SRR1353600 1 0.2088 0.834 0.904 0.000 0.028 0.000 0.068 0.000
#> SRR1456492 3 0.4066 0.678 0.000 0.000 0.732 0.000 0.204 0.064
#> SRR1389955 5 0.4069 0.785 0.076 0.000 0.032 0.000 0.788 0.104
#> SRR1429540 5 0.1858 0.788 0.076 0.000 0.000 0.000 0.912 0.012
#> SRR1356057 5 0.4517 0.731 0.012 0.000 0.156 0.000 0.728 0.104
#> SRR1328715 1 0.3175 0.628 0.744 0.000 0.000 0.000 0.256 0.000
#> SRR1429429 3 0.0363 0.909 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1325201 6 0.3175 0.879 0.000 0.256 0.000 0.000 0.000 0.744
#> SRR1382978 3 0.0363 0.909 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1406348 2 0.3288 0.510 0.000 0.724 0.000 0.000 0.000 0.276
#> SRR1469390 2 0.0000 0.951 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 3 0.0458 0.908 0.000 0.000 0.984 0.000 0.016 0.000
#> SRR1418225 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0000 0.951 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 5 0.1802 0.788 0.072 0.000 0.000 0.000 0.916 0.012
#> SRR1431823 3 0.0363 0.908 0.000 0.000 0.988 0.000 0.012 0.000
#> SRR1447916 2 0.0000 0.951 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1445618 1 0.1806 0.862 0.908 0.000 0.000 0.000 0.088 0.004
#> SRR1081589 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1097245 1 0.0363 0.869 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1416141 1 0.2237 0.828 0.896 0.000 0.036 0.000 0.068 0.000
#> SRR1404339 6 0.2912 0.883 0.000 0.216 0.000 0.000 0.000 0.784
#> SRR1478614 1 0.1418 0.855 0.944 0.000 0.000 0.000 0.024 0.032
#> SRR1406135 1 0.1364 0.852 0.944 0.000 0.004 0.000 0.048 0.004
#> SRR1413307 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0363 0.948 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR1358391 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 5 0.2094 0.794 0.080 0.000 0.020 0.000 0.900 0.000
#> SRR1100608 6 0.3175 0.879 0.000 0.256 0.000 0.000 0.000 0.744
#> SRR1386927 2 0.0000 0.951 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.2300 0.820 0.000 0.000 0.856 0.000 0.144 0.000
#> SRR1486322 3 0.0000 0.911 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 3 0.2867 0.804 0.040 0.000 0.848 0.000 0.112 0.000
#> SRR1459980 5 0.2070 0.781 0.092 0.000 0.000 0.000 0.896 0.012
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 17667 rows and 70 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 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.995 0.997 0.4001 0.599 0.599
#> 3 3 0.911 0.906 0.961 0.6071 0.663 0.479
#> 4 4 0.915 0.887 0.957 0.1117 0.792 0.513
#> 5 5 0.846 0.858 0.924 0.1016 0.884 0.620
#> 6 6 0.881 0.743 0.903 0.0318 0.979 0.903
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 1 0.0000 0.999 1.000 0.000
#> SRR1405147 1 0.0000 0.999 1.000 0.000
#> SRR1315412 2 0.0000 0.992 0.000 1.000
#> SRR1338384 1 0.0000 0.999 1.000 0.000
#> SRR1071105 2 0.0000 0.992 0.000 1.000
#> SRR1432868 2 0.0000 0.992 0.000 1.000
#> SRR1454480 1 0.1184 0.984 0.984 0.016
#> SRR1330723 2 0.0000 0.992 0.000 1.000
#> SRR1475324 1 0.0000 0.999 1.000 0.000
#> SRR1340260 1 0.0000 0.999 1.000 0.000
#> SRR1376450 1 0.0000 0.999 1.000 0.000
#> SRR1321897 1 0.0000 0.999 1.000 0.000
#> SRR1445194 1 0.0000 0.999 1.000 0.000
#> SRR1443308 1 0.0000 0.999 1.000 0.000
#> SRR1400931 1 0.0000 0.999 1.000 0.000
#> SRR1416188 1 0.0000 0.999 1.000 0.000
#> SRR1407044 1 0.0000 0.999 1.000 0.000
#> SRR1078392 1 0.0000 0.999 1.000 0.000
#> SRR1436468 1 0.0000 0.999 1.000 0.000
#> SRR1476125 2 0.0000 0.992 0.000 1.000
#> SRR1418747 1 0.0000 0.999 1.000 0.000
#> SRR1318089 1 0.0000 0.999 1.000 0.000
#> SRR1444370 1 0.0000 0.999 1.000 0.000
#> SRR1348929 2 0.0000 0.992 0.000 1.000
#> SRR1385690 1 0.0000 0.999 1.000 0.000
#> SRR1460337 1 0.0000 0.999 1.000 0.000
#> SRR1469062 1 0.0000 0.999 1.000 0.000
#> SRR1388459 1 0.0000 0.999 1.000 0.000
#> SRR1416841 1 0.0000 0.999 1.000 0.000
#> SRR1473778 1 0.0000 0.999 1.000 0.000
#> SRR1419561 1 0.0000 0.999 1.000 0.000
#> SRR1339987 1 0.0000 0.999 1.000 0.000
#> SRR1469662 1 0.0000 0.999 1.000 0.000
#> SRR1432958 1 0.0000 0.999 1.000 0.000
#> SRR1479198 1 0.0000 0.999 1.000 0.000
#> SRR1353600 1 0.0000 0.999 1.000 0.000
#> SRR1456492 1 0.0000 0.999 1.000 0.000
#> SRR1389955 1 0.0000 0.999 1.000 0.000
#> SRR1429540 1 0.0000 0.999 1.000 0.000
#> SRR1356057 1 0.0000 0.999 1.000 0.000
#> SRR1328715 1 0.0000 0.999 1.000 0.000
#> SRR1429429 1 0.0000 0.999 1.000 0.000
#> SRR1325201 2 0.0000 0.992 0.000 1.000
#> SRR1382978 1 0.0000 0.999 1.000 0.000
#> SRR1406348 2 0.0000 0.992 0.000 1.000
#> SRR1469390 2 0.0000 0.992 0.000 1.000
#> SRR1376380 1 0.0000 0.999 1.000 0.000
#> SRR1418225 2 0.0000 0.992 0.000 1.000
#> SRR1418473 2 0.0000 0.992 0.000 1.000
#> SRR1376741 1 0.0000 0.999 1.000 0.000
#> SRR1431823 1 0.0000 0.999 1.000 0.000
#> SRR1447916 2 0.0000 0.992 0.000 1.000
#> SRR1458643 2 0.5737 0.844 0.136 0.864
#> SRR1445618 1 0.0000 0.999 1.000 0.000
#> SRR1081589 2 0.0000 0.992 0.000 1.000
#> SRR1097245 1 0.0000 0.999 1.000 0.000
#> SRR1416141 1 0.0000 0.999 1.000 0.000
#> SRR1404339 2 0.0000 0.992 0.000 1.000
#> SRR1478614 1 0.0000 0.999 1.000 0.000
#> SRR1406135 1 0.0000 0.999 1.000 0.000
#> SRR1413307 2 0.1184 0.978 0.016 0.984
#> SRR1397720 2 0.0000 0.992 0.000 1.000
#> SRR1358391 1 0.0938 0.988 0.988 0.012
#> SRR1381185 1 0.0000 0.999 1.000 0.000
#> SRR1100608 2 0.0000 0.992 0.000 1.000
#> SRR1386927 2 0.0000 0.992 0.000 1.000
#> SRR1331771 1 0.0000 0.999 1.000 0.000
#> SRR1486322 1 0.0000 0.999 1.000 0.000
#> SRR1080790 1 0.0000 0.999 1.000 0.000
#> SRR1459980 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
#> SRR1433493 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1405147 3 0.5733 0.540 0.324 0.000 0.676
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1071105 2 0.0237 0.995 0.004 0.996 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1454480 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1475324 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1340260 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1321897 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1445194 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1443308 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1400931 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1416188 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1407044 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1078392 1 0.0237 0.946 0.996 0.000 0.004
#> SRR1436468 1 0.2165 0.896 0.936 0.000 0.064
#> SRR1476125 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1418747 1 0.5327 0.637 0.728 0.000 0.272
#> SRR1318089 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1444370 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1385690 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1469062 1 0.5254 0.657 0.736 0.000 0.264
#> SRR1388459 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1416841 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1473778 3 0.6062 0.406 0.384 0.000 0.616
#> SRR1419561 1 0.0892 0.934 0.980 0.000 0.020
#> SRR1339987 1 0.5397 0.626 0.720 0.000 0.280
#> SRR1469662 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1479198 1 0.0592 0.941 0.988 0.000 0.012
#> SRR1353600 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1456492 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1389955 1 0.0237 0.946 0.996 0.000 0.004
#> SRR1429540 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1356057 3 0.5988 0.446 0.368 0.000 0.632
#> SRR1328715 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1429429 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1382978 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376380 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1418225 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376741 1 0.6225 0.183 0.568 0.000 0.432
#> SRR1431823 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1458643 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1445618 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1081589 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1097245 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1413307 1 0.4555 0.733 0.800 0.200 0.000
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1358391 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1381185 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1331771 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1486322 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1080790 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1459980 3 0.2448 0.870 0.076 0.000 0.924
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1315412 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1071105 2 0.4040 0.600 0.248 0.752 0.000 0.000
#> SRR1432868 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0000 0.931 0.000 0.000 0.000 1.000
#> SRR1330723 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1321897 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1445194 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1443308 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1400931 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1078392 1 0.4008 0.664 0.756 0.000 0.244 0.000
#> SRR1436468 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1476125 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1418747 3 0.4877 0.256 0.408 0.000 0.592 0.000
#> SRR1318089 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1385690 4 0.4741 0.491 0.328 0.000 0.004 0.668
#> SRR1460337 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1469062 3 0.4790 0.410 0.000 0.000 0.620 0.380
#> SRR1388459 3 0.0336 0.922 0.008 0.000 0.992 0.000
#> SRR1416841 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1419561 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1339987 3 0.4643 0.487 0.000 0.000 0.656 0.344
#> SRR1469662 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1389955 1 0.6828 0.366 0.588 0.000 0.148 0.264
#> SRR1429540 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1356057 1 0.4804 0.387 0.616 0.000 0.384 0.000
#> SRR1328715 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1382978 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1418225 4 0.0000 0.931 0.000 0.000 0.000 1.000
#> SRR1418473 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1431823 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1447916 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.0000 0.931 0.000 0.000 0.000 1.000
#> SRR1445618 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.0000 0.931 0.000 0.000 0.000 1.000
#> SRR1097245 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.1474 0.897 0.948 0.000 0.000 0.052
#> SRR1404339 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.0000 0.945 1.000 0.000 0.000 0.000
#> SRR1413307 4 0.0000 0.931 0.000 0.000 0.000 1.000
#> SRR1397720 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.0000 0.931 0.000 0.000 0.000 1.000
#> SRR1381185 1 0.3444 0.745 0.816 0.000 0.184 0.000
#> SRR1100608 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1386927 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1486322 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.0000 0.931 0.000 0.000 1.000 0.000
#> SRR1459980 1 0.0000 0.945 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
#> SRR1433493 3 0.0703 0.932 0.000 0.000 0.976 0.000 0.024
#> SRR1405147 1 0.1341 0.895 0.944 0.000 0.000 0.000 0.056
#> SRR1315412 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.3837 0.529 0.692 0.000 0.000 0.000 0.308
#> SRR1071105 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.979 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.0162 0.937 0.000 0.000 0.996 0.000 0.004
#> SRR1340260 1 0.0963 0.899 0.964 0.000 0.000 0.000 0.036
#> SRR1376450 5 0.2389 0.826 0.116 0.000 0.004 0.000 0.880
#> SRR1321897 3 0.0000 0.938 0.000 0.000 1.000 0.000 0.000
#> SRR1445194 5 0.2690 0.810 0.156 0.000 0.000 0.000 0.844
#> SRR1443308 3 0.0290 0.935 0.000 0.000 0.992 0.008 0.000
#> SRR1400931 1 0.2179 0.833 0.888 0.000 0.000 0.000 0.112
#> SRR1416188 3 0.0000 0.938 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 3 0.0703 0.926 0.000 0.000 0.976 0.000 0.024
#> SRR1078392 5 0.6698 0.193 0.368 0.000 0.204 0.004 0.424
#> SRR1436468 1 0.0162 0.892 0.996 0.000 0.000 0.000 0.004
#> SRR1476125 2 0.4733 0.436 0.348 0.624 0.000 0.000 0.028
#> SRR1418747 5 0.2612 0.785 0.008 0.000 0.124 0.000 0.868
#> SRR1318089 3 0.0000 0.938 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 5 0.2891 0.789 0.176 0.000 0.000 0.000 0.824
#> SRR1348929 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 5 0.2379 0.783 0.012 0.000 0.028 0.048 0.912
#> SRR1460337 1 0.1121 0.898 0.956 0.000 0.000 0.000 0.044
#> SRR1469062 3 0.4225 0.417 0.000 0.000 0.632 0.364 0.004
#> SRR1388459 3 0.4891 0.438 0.316 0.000 0.640 0.000 0.044
#> SRR1416841 3 0.0880 0.928 0.000 0.000 0.968 0.000 0.032
#> SRR1473778 1 0.0880 0.899 0.968 0.000 0.000 0.000 0.032
#> SRR1419561 5 0.3146 0.819 0.128 0.000 0.028 0.000 0.844
#> SRR1339987 5 0.3246 0.730 0.000 0.000 0.184 0.008 0.808
#> SRR1469662 5 0.1544 0.833 0.068 0.000 0.000 0.000 0.932
#> SRR1432958 1 0.0703 0.889 0.976 0.000 0.000 0.000 0.024
#> SRR1479198 5 0.1818 0.832 0.044 0.000 0.024 0.000 0.932
#> SRR1353600 1 0.1792 0.866 0.916 0.000 0.000 0.000 0.084
#> SRR1456492 3 0.0510 0.930 0.016 0.000 0.984 0.000 0.000
#> SRR1389955 5 0.0579 0.815 0.008 0.000 0.008 0.000 0.984
#> SRR1429540 1 0.0404 0.897 0.988 0.000 0.000 0.000 0.012
#> SRR1356057 1 0.4854 0.599 0.680 0.000 0.260 0.000 0.060
#> SRR1328715 1 0.1908 0.876 0.908 0.000 0.000 0.000 0.092
#> SRR1429429 3 0.0703 0.932 0.000 0.000 0.976 0.000 0.024
#> SRR1325201 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1382978 3 0.0609 0.934 0.000 0.000 0.980 0.000 0.020
#> SRR1406348 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.0000 0.938 0.000 0.000 1.000 0.000 0.000
#> SRR1418225 4 0.0000 0.979 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.1792 0.881 0.916 0.000 0.000 0.000 0.084
#> SRR1431823 3 0.0000 0.938 0.000 0.000 1.000 0.000 0.000
#> SRR1447916 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.1410 0.962 0.000 0.000 0.000 0.940 0.060
#> SRR1445618 1 0.0963 0.899 0.964 0.000 0.000 0.000 0.036
#> SRR1081589 4 0.1608 0.954 0.000 0.000 0.000 0.928 0.072
#> SRR1097245 1 0.0609 0.889 0.980 0.000 0.000 0.000 0.020
#> SRR1416141 5 0.2388 0.825 0.072 0.000 0.000 0.028 0.900
#> SRR1404339 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.0162 0.894 0.996 0.000 0.000 0.000 0.004
#> SRR1406135 5 0.1197 0.825 0.048 0.000 0.000 0.000 0.952
#> SRR1413307 4 0.0000 0.979 0.000 0.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0290 0.977 0.000 0.000 0.000 0.992 0.008
#> SRR1381185 1 0.3534 0.649 0.744 0.000 0.256 0.000 0.000
#> SRR1100608 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1386927 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.0000 0.938 0.000 0.000 1.000 0.000 0.000
#> SRR1486322 3 0.0703 0.932 0.000 0.000 0.976 0.000 0.024
#> SRR1080790 5 0.4161 0.411 0.000 0.000 0.392 0.000 0.608
#> SRR1459980 1 0.2011 0.878 0.908 0.000 0.004 0.000 0.088
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.1967 0.9298 0.000 0.000 0.904 0.000 0.012 0.084
#> SRR1405147 1 0.0806 0.6716 0.972 0.000 0.000 0.000 0.020 0.008
#> SRR1315412 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 6 0.4629 0.0000 0.436 0.000 0.000 0.000 0.040 0.524
#> SRR1071105 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1432868 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.1501 0.8890 0.000 0.000 0.000 0.924 0.000 0.076
#> SRR1330723 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1475324 3 0.1501 0.9377 0.000 0.000 0.924 0.000 0.000 0.076
#> SRR1340260 1 0.0260 0.6733 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1376450 5 0.0717 0.8914 0.016 0.000 0.000 0.000 0.976 0.008
#> SRR1321897 3 0.0000 0.9489 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1445194 5 0.0777 0.8894 0.024 0.000 0.000 0.000 0.972 0.004
#> SRR1443308 3 0.0000 0.9489 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1400931 1 0.4219 -0.5684 0.592 0.000 0.000 0.000 0.020 0.388
#> SRR1416188 3 0.0000 0.9489 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1407044 3 0.1644 0.9011 0.000 0.000 0.920 0.000 0.004 0.076
#> SRR1078392 5 0.6069 0.1374 0.388 0.000 0.020 0.032 0.492 0.068
#> SRR1436468 1 0.0260 0.6708 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR1476125 2 0.5479 -0.0738 0.124 0.448 0.000 0.000 0.000 0.428
#> SRR1418747 5 0.2956 0.8100 0.000 0.000 0.088 0.000 0.848 0.064
#> SRR1318089 3 0.0713 0.9484 0.000 0.000 0.972 0.000 0.000 0.028
#> SRR1444370 5 0.1049 0.8859 0.032 0.000 0.000 0.000 0.960 0.008
#> SRR1348929 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.4585 0.6007 0.000 0.000 0.068 0.000 0.648 0.284
#> SRR1460337 1 0.0547 0.6719 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1469062 3 0.1934 0.8998 0.000 0.000 0.916 0.040 0.000 0.044
#> SRR1388459 1 0.5513 0.0900 0.520 0.000 0.376 0.000 0.016 0.088
#> SRR1416841 3 0.2786 0.8958 0.000 0.000 0.860 0.000 0.056 0.084
#> SRR1473778 1 0.0000 0.6714 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1419561 5 0.1341 0.8827 0.024 0.000 0.000 0.000 0.948 0.028
#> SRR1339987 5 0.0508 0.8918 0.000 0.000 0.004 0.000 0.984 0.012
#> SRR1469662 5 0.0291 0.8918 0.004 0.000 0.000 0.000 0.992 0.004
#> SRR1432958 1 0.3515 -0.2451 0.676 0.000 0.000 0.000 0.000 0.324
#> SRR1479198 5 0.0146 0.8923 0.004 0.000 0.000 0.000 0.996 0.000
#> SRR1353600 1 0.4016 -0.1784 0.684 0.000 0.000 0.004 0.020 0.292
#> SRR1456492 3 0.0632 0.9492 0.000 0.000 0.976 0.000 0.000 0.024
#> SRR1389955 5 0.0146 0.8909 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR1429540 1 0.0146 0.6696 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1356057 1 0.4872 0.4367 0.752 0.000 0.076 0.068 0.016 0.088
#> SRR1328715 1 0.1910 0.6046 0.892 0.000 0.000 0.000 0.108 0.000
#> SRR1429429 3 0.1866 0.9318 0.000 0.000 0.908 0.000 0.008 0.084
#> SRR1325201 2 0.0692 0.9373 0.004 0.976 0.000 0.000 0.000 0.020
#> SRR1382978 3 0.1753 0.9337 0.000 0.000 0.912 0.000 0.004 0.084
#> SRR1406348 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 3 0.0000 0.9489 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1418225 4 0.0000 0.8935 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418473 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 1 0.2146 0.5957 0.880 0.000 0.000 0.000 0.116 0.004
#> SRR1431823 3 0.0260 0.9465 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR1447916 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.3934 0.8149 0.000 0.000 0.000 0.676 0.020 0.304
#> SRR1445618 1 0.0508 0.6667 0.984 0.000 0.000 0.000 0.004 0.012
#> SRR1081589 4 0.3934 0.8150 0.000 0.000 0.000 0.676 0.020 0.304
#> SRR1097245 1 0.3175 0.0811 0.744 0.000 0.000 0.000 0.000 0.256
#> SRR1416141 5 0.1806 0.8519 0.004 0.000 0.000 0.000 0.908 0.088
#> SRR1404339 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.1501 0.5918 0.924 0.000 0.000 0.000 0.000 0.076
#> SRR1406135 5 0.1080 0.8849 0.004 0.000 0.004 0.000 0.960 0.032
#> SRR1413307 4 0.0000 0.8935 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0260 0.8921 0.000 0.000 0.000 0.992 0.008 0.000
#> SRR1381185 1 0.2547 0.5585 0.868 0.000 0.112 0.000 0.004 0.016
#> SRR1100608 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1386927 2 0.0000 0.9586 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.0458 0.9431 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1486322 3 0.1812 0.9340 0.000 0.000 0.912 0.000 0.008 0.080
#> SRR1080790 5 0.1686 0.8564 0.000 0.000 0.064 0.000 0.924 0.012
#> SRR1459980 1 0.2383 0.6039 0.880 0.000 0.000 0.000 0.096 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["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 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.810 0.885 0.950 0.4776 0.526 0.526
#> 3 3 0.618 0.824 0.844 0.2058 0.930 0.868
#> 4 4 0.722 0.801 0.875 0.2414 0.814 0.594
#> 5 5 0.802 0.819 0.908 0.0416 0.986 0.950
#> 6 6 0.800 0.749 0.878 0.0211 0.995 0.982
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
#> SRR1433493 2 0.0376 0.945 0.004 0.996
#> SRR1405147 1 0.0376 0.943 0.996 0.004
#> SRR1315412 2 0.0000 0.947 0.000 1.000
#> SRR1338384 1 0.0000 0.945 1.000 0.000
#> SRR1071105 1 0.0672 0.943 0.992 0.008
#> SRR1432868 2 0.0000 0.947 0.000 1.000
#> SRR1454480 1 0.2236 0.929 0.964 0.036
#> SRR1330723 2 0.0000 0.947 0.000 1.000
#> SRR1475324 2 0.0000 0.947 0.000 1.000
#> SRR1340260 1 0.0000 0.945 1.000 0.000
#> SRR1376450 1 0.0000 0.945 1.000 0.000
#> SRR1321897 1 0.8861 0.602 0.696 0.304
#> SRR1445194 1 0.0000 0.945 1.000 0.000
#> SRR1443308 2 0.0376 0.945 0.004 0.996
#> SRR1400931 1 0.0000 0.945 1.000 0.000
#> SRR1416188 2 0.0672 0.942 0.008 0.992
#> SRR1407044 1 0.2236 0.930 0.964 0.036
#> SRR1078392 1 0.0000 0.945 1.000 0.000
#> SRR1436468 2 0.0376 0.945 0.004 0.996
#> SRR1476125 2 0.9732 0.366 0.404 0.596
#> SRR1418747 1 0.2043 0.932 0.968 0.032
#> SRR1318089 2 0.0376 0.945 0.004 0.996
#> SRR1444370 1 0.0000 0.945 1.000 0.000
#> SRR1348929 2 0.0000 0.947 0.000 1.000
#> SRR1385690 1 0.0000 0.945 1.000 0.000
#> SRR1460337 1 0.0000 0.945 1.000 0.000
#> SRR1469062 1 0.3431 0.911 0.936 0.064
#> SRR1388459 2 0.0376 0.945 0.004 0.996
#> SRR1416841 2 0.0000 0.947 0.000 1.000
#> SRR1473778 1 0.3584 0.908 0.932 0.068
#> SRR1419561 1 0.0000 0.945 1.000 0.000
#> SRR1339987 1 0.0938 0.941 0.988 0.012
#> SRR1469662 1 0.0000 0.945 1.000 0.000
#> SRR1432958 1 0.0000 0.945 1.000 0.000
#> SRR1479198 1 0.0000 0.945 1.000 0.000
#> SRR1353600 1 0.0000 0.945 1.000 0.000
#> SRR1456492 2 0.0000 0.947 0.000 1.000
#> SRR1389955 1 0.0000 0.945 1.000 0.000
#> SRR1429540 1 0.0376 0.943 0.996 0.004
#> SRR1356057 1 0.5178 0.862 0.884 0.116
#> SRR1328715 1 0.0672 0.943 0.992 0.008
#> SRR1429429 2 0.0000 0.947 0.000 1.000
#> SRR1325201 2 0.9732 0.366 0.404 0.596
#> SRR1382978 2 0.0000 0.947 0.000 1.000
#> SRR1406348 2 0.0000 0.947 0.000 1.000
#> SRR1469390 2 0.0000 0.947 0.000 1.000
#> SRR1376380 1 0.9866 0.314 0.568 0.432
#> SRR1418225 1 0.2236 0.929 0.964 0.036
#> SRR1418473 2 0.0000 0.947 0.000 1.000
#> SRR1376741 1 0.0000 0.945 1.000 0.000
#> SRR1431823 1 0.9866 0.314 0.568 0.432
#> SRR1447916 2 0.0000 0.947 0.000 1.000
#> SRR1458643 1 0.0000 0.945 1.000 0.000
#> SRR1445618 1 0.0000 0.945 1.000 0.000
#> SRR1081589 1 0.0000 0.945 1.000 0.000
#> SRR1097245 1 0.0000 0.945 1.000 0.000
#> SRR1416141 1 0.0000 0.945 1.000 0.000
#> SRR1404339 2 0.0000 0.947 0.000 1.000
#> SRR1478614 1 0.0000 0.945 1.000 0.000
#> SRR1406135 1 0.0000 0.945 1.000 0.000
#> SRR1413307 1 0.7815 0.718 0.768 0.232
#> SRR1397720 2 0.0000 0.947 0.000 1.000
#> SRR1358391 1 0.2236 0.929 0.964 0.036
#> SRR1381185 1 0.3431 0.911 0.936 0.064
#> SRR1100608 2 0.9732 0.366 0.404 0.596
#> SRR1386927 2 0.0000 0.947 0.000 1.000
#> SRR1331771 1 0.8861 0.602 0.696 0.304
#> SRR1486322 2 0.0376 0.945 0.004 0.996
#> SRR1080790 1 0.2236 0.930 0.964 0.036
#> SRR1459980 1 0.0000 0.945 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.0000 0.940 0.000 0.000 1.000
#> SRR1405147 1 0.3532 0.865 0.884 0.108 0.008
#> SRR1315412 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1338384 1 0.0747 0.881 0.984 0.016 0.000
#> SRR1071105 1 0.3695 0.865 0.880 0.108 0.012
#> SRR1432868 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1454480 1 0.6049 0.817 0.756 0.204 0.040
#> SRR1330723 2 0.5431 0.791 0.000 0.716 0.284
#> SRR1475324 3 0.2878 0.898 0.000 0.096 0.904
#> SRR1340260 1 0.0000 0.881 1.000 0.000 0.000
#> SRR1376450 1 0.1289 0.880 0.968 0.032 0.000
#> SRR1321897 1 0.8349 0.569 0.584 0.108 0.308
#> SRR1445194 1 0.0237 0.880 0.996 0.004 0.000
#> SRR1443308 3 0.0000 0.940 0.000 0.000 1.000
#> SRR1400931 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1416188 3 0.0237 0.935 0.000 0.004 0.996
#> SRR1407044 1 0.6096 0.815 0.752 0.208 0.040
#> SRR1078392 1 0.0000 0.881 1.000 0.000 0.000
#> SRR1436468 3 0.0000 0.940 0.000 0.000 1.000
#> SRR1476125 2 0.6226 0.489 0.252 0.720 0.028
#> SRR1418747 1 0.5111 0.845 0.820 0.144 0.036
#> SRR1318089 3 0.0000 0.940 0.000 0.000 1.000
#> SRR1444370 1 0.0237 0.880 0.996 0.004 0.000
#> SRR1348929 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1385690 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1460337 1 0.0000 0.881 1.000 0.000 0.000
#> SRR1469062 1 0.6765 0.797 0.724 0.208 0.068
#> SRR1388459 3 0.0000 0.940 0.000 0.000 1.000
#> SRR1416841 3 0.2878 0.898 0.000 0.096 0.904
#> SRR1473778 1 0.6804 0.798 0.724 0.204 0.072
#> SRR1419561 1 0.1411 0.880 0.964 0.036 0.000
#> SRR1339987 1 0.4139 0.860 0.860 0.124 0.016
#> SRR1469662 1 0.0237 0.880 0.996 0.004 0.000
#> SRR1432958 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1479198 1 0.1289 0.880 0.968 0.032 0.000
#> SRR1353600 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1456492 3 0.2066 0.919 0.000 0.060 0.940
#> SRR1389955 1 0.1031 0.881 0.976 0.024 0.000
#> SRR1429540 1 0.3532 0.865 0.884 0.108 0.008
#> SRR1356057 1 0.7720 0.752 0.672 0.208 0.120
#> SRR1328715 1 0.3695 0.865 0.880 0.108 0.012
#> SRR1429429 3 0.2878 0.898 0.000 0.096 0.904
#> SRR1325201 2 0.6226 0.489 0.252 0.720 0.028
#> SRR1382978 3 0.2878 0.898 0.000 0.096 0.904
#> SRR1406348 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1469390 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1376380 1 0.7138 0.388 0.540 0.024 0.436
#> SRR1418225 1 0.6049 0.817 0.756 0.204 0.040
#> SRR1418473 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1376741 1 0.2400 0.875 0.932 0.064 0.004
#> SRR1431823 1 0.7138 0.388 0.540 0.024 0.436
#> SRR1447916 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1458643 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1445618 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1081589 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1097245 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1416141 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1404339 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1478614 1 0.0424 0.881 0.992 0.008 0.000
#> SRR1406135 1 0.0424 0.880 0.992 0.008 0.000
#> SRR1413307 1 0.7807 0.675 0.656 0.108 0.236
#> SRR1397720 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1358391 1 0.6049 0.817 0.756 0.204 0.040
#> SRR1381185 1 0.6765 0.797 0.724 0.208 0.068
#> SRR1100608 2 0.6226 0.489 0.252 0.720 0.028
#> SRR1386927 2 0.5138 0.828 0.000 0.748 0.252
#> SRR1331771 1 0.8349 0.569 0.584 0.108 0.308
#> SRR1486322 3 0.0000 0.940 0.000 0.000 1.000
#> SRR1080790 1 0.6096 0.815 0.752 0.208 0.040
#> SRR1459980 1 0.1765 0.879 0.956 0.040 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.879 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.4356 0.622 0.708 0.000 0.000 0.292
#> SRR1315412 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1338384 1 0.1557 0.907 0.944 0.000 0.000 0.056
#> SRR1071105 1 0.4343 0.665 0.732 0.000 0.004 0.264
#> SRR1432868 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1454480 4 0.2412 0.786 0.084 0.000 0.008 0.908
#> SRR1330723 2 0.3074 0.742 0.000 0.848 0.152 0.000
#> SRR1475324 3 0.4008 0.768 0.000 0.244 0.756 0.000
#> SRR1340260 1 0.0336 0.929 0.992 0.000 0.000 0.008
#> SRR1376450 1 0.1302 0.914 0.956 0.000 0.000 0.044
#> SRR1321897 4 0.5003 0.628 0.016 0.000 0.308 0.676
#> SRR1445194 1 0.0188 0.930 0.996 0.000 0.000 0.004
#> SRR1443308 3 0.0000 0.879 0.000 0.000 1.000 0.000
#> SRR1400931 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0188 0.874 0.000 0.000 0.996 0.004
#> SRR1407044 4 0.3813 0.766 0.148 0.000 0.024 0.828
#> SRR1078392 1 0.0336 0.929 0.992 0.000 0.000 0.008
#> SRR1436468 3 0.0000 0.879 0.000 0.000 1.000 0.000
#> SRR1476125 2 0.6957 0.543 0.172 0.580 0.000 0.248
#> SRR1418747 4 0.5526 0.274 0.416 0.000 0.020 0.564
#> SRR1318089 3 0.0000 0.879 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0188 0.930 0.996 0.000 0.000 0.004
#> SRR1348929 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1385690 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1460337 1 0.0336 0.929 0.992 0.000 0.000 0.008
#> SRR1469062 4 0.2965 0.790 0.072 0.000 0.036 0.892
#> SRR1388459 3 0.0000 0.879 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.4008 0.768 0.000 0.244 0.756 0.000
#> SRR1473778 4 0.3056 0.790 0.072 0.000 0.040 0.888
#> SRR1419561 1 0.1940 0.893 0.924 0.000 0.000 0.076
#> SRR1339987 4 0.4977 0.145 0.460 0.000 0.000 0.540
#> SRR1469662 1 0.0188 0.930 0.996 0.000 0.000 0.004
#> SRR1432958 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.1302 0.914 0.956 0.000 0.000 0.044
#> SRR1353600 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.2345 0.854 0.000 0.100 0.900 0.000
#> SRR1389955 1 0.0921 0.922 0.972 0.000 0.000 0.028
#> SRR1429540 1 0.4164 0.671 0.736 0.000 0.000 0.264
#> SRR1356057 4 0.2843 0.762 0.020 0.000 0.088 0.892
#> SRR1328715 1 0.4343 0.665 0.732 0.000 0.004 0.264
#> SRR1429429 3 0.4008 0.768 0.000 0.244 0.756 0.000
#> SRR1325201 2 0.6957 0.543 0.172 0.580 0.000 0.248
#> SRR1382978 3 0.4008 0.768 0.000 0.244 0.756 0.000
#> SRR1406348 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1469390 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1376380 4 0.5112 0.438 0.004 0.000 0.436 0.560
#> SRR1418225 4 0.2412 0.786 0.084 0.000 0.008 0.908
#> SRR1418473 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1376741 1 0.3123 0.821 0.844 0.000 0.000 0.156
#> SRR1431823 4 0.5112 0.438 0.004 0.000 0.436 0.560
#> SRR1447916 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1458643 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1445618 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1081589 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1097245 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1404339 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1478614 1 0.0336 0.929 0.992 0.000 0.000 0.008
#> SRR1406135 1 0.0000 0.929 1.000 0.000 0.000 0.000
#> SRR1413307 4 0.3688 0.682 0.000 0.000 0.208 0.792
#> SRR1397720 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1358391 4 0.2412 0.786 0.084 0.000 0.008 0.908
#> SRR1381185 4 0.2965 0.790 0.072 0.000 0.036 0.892
#> SRR1100608 2 0.6957 0.543 0.172 0.580 0.000 0.248
#> SRR1386927 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> SRR1331771 4 0.5003 0.628 0.016 0.000 0.308 0.676
#> SRR1486322 3 0.0000 0.879 0.000 0.000 1.000 0.000
#> SRR1080790 4 0.3813 0.766 0.148 0.000 0.024 0.828
#> SRR1459980 1 0.2814 0.845 0.868 0.000 0.000 0.132
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0324 0.866 0.000 0.004 0.992 0.004 0.00
#> SRR1405147 1 0.4074 0.549 0.636 0.000 0.000 0.364 0.00
#> SRR1315412 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1338384 1 0.1732 0.881 0.920 0.000 0.000 0.080 0.00
#> SRR1071105 1 0.4015 0.583 0.652 0.000 0.000 0.348 0.00
#> SRR1432868 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1454480 4 0.1216 0.754 0.020 0.000 0.000 0.960 0.02
#> SRR1330723 2 0.2516 0.787 0.000 0.860 0.140 0.000 0.00
#> SRR1475324 3 0.3452 0.758 0.000 0.244 0.756 0.000 0.00
#> SRR1340260 1 0.0404 0.907 0.988 0.000 0.000 0.012 0.00
#> SRR1376450 1 0.1792 0.882 0.916 0.000 0.000 0.084 0.00
#> SRR1321897 4 0.3837 0.631 0.000 0.000 0.308 0.692 0.00
#> SRR1445194 1 0.0162 0.907 0.996 0.000 0.000 0.004 0.00
#> SRR1443308 3 0.0324 0.866 0.000 0.004 0.992 0.004 0.00
#> SRR1400931 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1416188 3 0.0162 0.862 0.000 0.000 0.996 0.004 0.00
#> SRR1407044 4 0.1894 0.736 0.072 0.000 0.008 0.920 0.00
#> SRR1078392 1 0.0290 0.907 0.992 0.000 0.000 0.008 0.00
#> SRR1436468 3 0.0324 0.866 0.000 0.004 0.992 0.004 0.00
#> SRR1476125 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.00
#> SRR1418747 4 0.4252 0.350 0.340 0.000 0.008 0.652 0.00
#> SRR1318089 3 0.0324 0.866 0.000 0.004 0.992 0.004 0.00
#> SRR1444370 1 0.0162 0.907 0.996 0.000 0.000 0.004 0.00
#> SRR1348929 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1385690 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1460337 1 0.0404 0.907 0.988 0.000 0.000 0.012 0.00
#> SRR1469062 4 0.0404 0.757 0.000 0.000 0.012 0.988 0.00
#> SRR1388459 3 0.0324 0.866 0.000 0.004 0.992 0.004 0.00
#> SRR1416841 3 0.3452 0.758 0.000 0.244 0.756 0.000 0.00
#> SRR1473778 4 0.0404 0.758 0.000 0.000 0.012 0.988 0.00
#> SRR1419561 1 0.2280 0.857 0.880 0.000 0.000 0.120 0.00
#> SRR1339987 4 0.4138 0.238 0.384 0.000 0.000 0.616 0.00
#> SRR1469662 1 0.0162 0.907 0.996 0.000 0.000 0.004 0.00
#> SRR1432958 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1479198 1 0.1792 0.882 0.916 0.000 0.000 0.084 0.00
#> SRR1353600 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1456492 3 0.2020 0.835 0.000 0.100 0.900 0.000 0.00
#> SRR1389955 1 0.1544 0.889 0.932 0.000 0.000 0.068 0.00
#> SRR1429540 1 0.3983 0.595 0.660 0.000 0.000 0.340 0.00
#> SRR1356057 4 0.1478 0.748 0.000 0.000 0.064 0.936 0.00
#> SRR1328715 1 0.3999 0.590 0.656 0.000 0.000 0.344 0.00
#> SRR1429429 3 0.3452 0.758 0.000 0.244 0.756 0.000 0.00
#> SRR1325201 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.00
#> SRR1382978 3 0.3452 0.758 0.000 0.244 0.756 0.000 0.00
#> SRR1406348 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1469390 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1376380 4 0.4256 0.443 0.000 0.000 0.436 0.564 0.00
#> SRR1418225 4 0.1216 0.754 0.020 0.000 0.000 0.960 0.02
#> SRR1418473 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1376741 1 0.3336 0.760 0.772 0.000 0.000 0.228 0.00
#> SRR1431823 4 0.4256 0.443 0.000 0.000 0.436 0.564 0.00
#> SRR1447916 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1458643 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1445618 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1081589 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1097245 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1416141 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1404339 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1478614 1 0.1121 0.899 0.956 0.000 0.000 0.044 0.00
#> SRR1406135 1 0.0000 0.907 1.000 0.000 0.000 0.000 0.00
#> SRR1413307 4 0.3690 0.672 0.000 0.000 0.200 0.780 0.02
#> SRR1397720 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1358391 4 0.1216 0.754 0.020 0.000 0.000 0.960 0.02
#> SRR1381185 4 0.0404 0.757 0.000 0.000 0.012 0.988 0.00
#> SRR1100608 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.00
#> SRR1386927 2 0.0000 0.980 0.000 1.000 0.000 0.000 0.00
#> SRR1331771 4 0.3837 0.631 0.000 0.000 0.308 0.692 0.00
#> SRR1486322 3 0.0324 0.866 0.000 0.004 0.992 0.004 0.00
#> SRR1080790 4 0.1894 0.736 0.072 0.000 0.008 0.920 0.00
#> SRR1459980 1 0.3039 0.797 0.808 0.000 0.000 0.192 0.00
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.562 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 1 0.4396 0.523 0.612 0.000 0.000 0.000 0.352 0.036
#> SRR1315412 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 1 0.2201 0.859 0.896 0.000 0.000 0.000 0.076 0.028
#> SRR1071105 1 0.4344 0.558 0.628 0.000 0.000 0.000 0.336 0.036
#> SRR1432868 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 5 0.1957 0.723 0.024 0.000 0.000 0.008 0.920 0.048
#> SRR1330723 2 0.2260 0.782 0.000 0.860 0.140 0.000 0.000 0.000
#> SRR1475324 3 0.5024 0.542 0.000 0.088 0.572 0.000 0.000 0.340
#> SRR1340260 1 0.0260 0.896 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1376450 1 0.1701 0.874 0.920 0.000 0.000 0.000 0.072 0.008
#> SRR1321897 5 0.3528 0.545 0.000 0.000 0.296 0.000 0.700 0.004
#> SRR1445194 1 0.0363 0.897 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR1443308 3 0.0000 0.562 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1400931 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1416188 3 0.0146 0.555 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1407044 5 0.2066 0.712 0.072 0.000 0.000 0.000 0.904 0.024
#> SRR1078392 1 0.0146 0.897 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR1436468 6 0.3866 0.000 0.000 0.000 0.484 0.000 0.000 0.516
#> SRR1476125 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1418747 5 0.4493 0.397 0.312 0.000 0.000 0.000 0.636 0.052
#> SRR1318089 3 0.0000 0.562 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.0363 0.897 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR1348929 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1460337 1 0.0260 0.896 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1469062 5 0.1141 0.725 0.000 0.000 0.000 0.000 0.948 0.052
#> SRR1388459 3 0.0000 0.562 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1416841 3 0.5024 0.542 0.000 0.088 0.572 0.000 0.000 0.340
#> SRR1473778 5 0.0870 0.731 0.004 0.000 0.012 0.000 0.972 0.012
#> SRR1419561 1 0.2696 0.835 0.856 0.000 0.000 0.000 0.116 0.028
#> SRR1339987 5 0.4420 0.268 0.360 0.000 0.000 0.000 0.604 0.036
#> SRR1469662 1 0.0000 0.897 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1432958 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1479198 1 0.1701 0.874 0.920 0.000 0.000 0.000 0.072 0.008
#> SRR1353600 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1456492 3 0.3812 0.548 0.000 0.024 0.712 0.000 0.000 0.264
#> SRR1389955 1 0.1462 0.880 0.936 0.000 0.000 0.000 0.056 0.008
#> SRR1429540 1 0.4315 0.570 0.636 0.000 0.000 0.000 0.328 0.036
#> SRR1356057 5 0.2265 0.708 0.000 0.000 0.052 0.000 0.896 0.052
#> SRR1328715 1 0.4330 0.565 0.632 0.000 0.000 0.000 0.332 0.036
#> SRR1429429 3 0.5024 0.542 0.000 0.088 0.572 0.000 0.000 0.340
#> SRR1325201 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1382978 3 0.5024 0.542 0.000 0.088 0.572 0.000 0.000 0.340
#> SRR1406348 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 5 0.3944 0.313 0.000 0.000 0.428 0.000 0.568 0.004
#> SRR1418225 5 0.1957 0.723 0.024 0.000 0.000 0.008 0.920 0.048
#> SRR1418473 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 1 0.3727 0.738 0.748 0.000 0.000 0.000 0.216 0.036
#> SRR1431823 5 0.3944 0.313 0.000 0.000 0.428 0.000 0.568 0.004
#> SRR1447916 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1445618 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1081589 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1097245 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1416141 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1404339 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 1 0.1297 0.891 0.948 0.000 0.000 0.000 0.040 0.012
#> SRR1406135 1 0.0458 0.897 0.984 0.000 0.000 0.000 0.000 0.016
#> SRR1413307 5 0.3900 0.611 0.000 0.000 0.188 0.008 0.760 0.044
#> SRR1397720 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 5 0.1957 0.723 0.024 0.000 0.000 0.008 0.920 0.048
#> SRR1381185 5 0.1141 0.725 0.000 0.000 0.000 0.000 0.948 0.052
#> SRR1100608 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1386927 2 0.0000 0.981 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 5 0.3528 0.545 0.000 0.000 0.296 0.000 0.700 0.004
#> SRR1486322 3 0.0000 0.562 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 5 0.2066 0.712 0.072 0.000 0.000 0.000 0.904 0.024
#> SRR1459980 1 0.3455 0.776 0.784 0.000 0.000 0.000 0.180 0.036
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["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 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.920 0.972 0.4866 0.519 0.519
#> 3 3 0.702 0.762 0.865 0.3001 0.795 0.631
#> 4 4 0.667 0.810 0.874 0.1396 0.761 0.462
#> 5 5 0.718 0.700 0.836 0.0723 0.950 0.817
#> 6 6 0.756 0.650 0.759 0.0455 0.938 0.748
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
#> SRR1433493 2 0.0000 0.9831 0.000 1.000
#> SRR1405147 1 0.0000 0.9612 1.000 0.000
#> SRR1315412 2 0.0000 0.9831 0.000 1.000
#> SRR1338384 1 0.0000 0.9612 1.000 0.000
#> SRR1071105 1 0.0000 0.9612 1.000 0.000
#> SRR1432868 2 0.0000 0.9831 0.000 1.000
#> SRR1454480 1 0.0000 0.9612 1.000 0.000
#> SRR1330723 2 0.0000 0.9831 0.000 1.000
#> SRR1475324 2 0.0000 0.9831 0.000 1.000
#> SRR1340260 1 0.0000 0.9612 1.000 0.000
#> SRR1376450 1 0.0000 0.9612 1.000 0.000
#> SRR1321897 1 0.9998 0.0504 0.508 0.492
#> SRR1445194 1 0.0000 0.9612 1.000 0.000
#> SRR1443308 2 0.0000 0.9831 0.000 1.000
#> SRR1400931 1 0.0000 0.9612 1.000 0.000
#> SRR1416188 2 0.0000 0.9831 0.000 1.000
#> SRR1407044 1 0.0000 0.9612 1.000 0.000
#> SRR1078392 1 0.0000 0.9612 1.000 0.000
#> SRR1436468 2 0.0000 0.9831 0.000 1.000
#> SRR1476125 1 0.0672 0.9542 0.992 0.008
#> SRR1418747 1 0.0000 0.9612 1.000 0.000
#> SRR1318089 2 0.0000 0.9831 0.000 1.000
#> SRR1444370 1 0.0000 0.9612 1.000 0.000
#> SRR1348929 2 0.0000 0.9831 0.000 1.000
#> SRR1385690 1 0.0000 0.9612 1.000 0.000
#> SRR1460337 1 0.0000 0.9612 1.000 0.000
#> SRR1469062 1 0.0000 0.9612 1.000 0.000
#> SRR1388459 2 0.0000 0.9831 0.000 1.000
#> SRR1416841 2 0.0000 0.9831 0.000 1.000
#> SRR1473778 1 0.0000 0.9612 1.000 0.000
#> SRR1419561 1 0.0000 0.9612 1.000 0.000
#> SRR1339987 1 0.0000 0.9612 1.000 0.000
#> SRR1469662 1 0.0000 0.9612 1.000 0.000
#> SRR1432958 1 0.0000 0.9612 1.000 0.000
#> SRR1479198 1 0.0000 0.9612 1.000 0.000
#> SRR1353600 1 0.0000 0.9612 1.000 0.000
#> SRR1456492 2 0.0000 0.9831 0.000 1.000
#> SRR1389955 1 0.0000 0.9612 1.000 0.000
#> SRR1429540 1 0.0000 0.9612 1.000 0.000
#> SRR1356057 2 0.9580 0.3411 0.380 0.620
#> SRR1328715 1 0.0000 0.9612 1.000 0.000
#> SRR1429429 2 0.0000 0.9831 0.000 1.000
#> SRR1325201 1 0.3879 0.8868 0.924 0.076
#> SRR1382978 2 0.0000 0.9831 0.000 1.000
#> SRR1406348 2 0.0000 0.9831 0.000 1.000
#> SRR1469390 2 0.0000 0.9831 0.000 1.000
#> SRR1376380 1 0.9998 0.0504 0.508 0.492
#> SRR1418225 1 0.0000 0.9612 1.000 0.000
#> SRR1418473 2 0.0000 0.9831 0.000 1.000
#> SRR1376741 1 0.0000 0.9612 1.000 0.000
#> SRR1431823 2 0.0000 0.9831 0.000 1.000
#> SRR1447916 2 0.0000 0.9831 0.000 1.000
#> SRR1458643 1 0.0000 0.9612 1.000 0.000
#> SRR1445618 1 0.0000 0.9612 1.000 0.000
#> SRR1081589 1 0.0000 0.9612 1.000 0.000
#> SRR1097245 1 0.0000 0.9612 1.000 0.000
#> SRR1416141 1 0.0000 0.9612 1.000 0.000
#> SRR1404339 2 0.0000 0.9831 0.000 1.000
#> SRR1478614 1 0.0000 0.9612 1.000 0.000
#> SRR1406135 1 0.0000 0.9612 1.000 0.000
#> SRR1413307 2 0.0000 0.9831 0.000 1.000
#> SRR1397720 2 0.0000 0.9831 0.000 1.000
#> SRR1358391 1 0.0000 0.9612 1.000 0.000
#> SRR1381185 1 0.0000 0.9612 1.000 0.000
#> SRR1100608 2 0.2043 0.9512 0.032 0.968
#> SRR1386927 2 0.0000 0.9831 0.000 1.000
#> SRR1331771 1 0.9998 0.0504 0.508 0.492
#> SRR1486322 2 0.0000 0.9831 0.000 1.000
#> SRR1080790 1 0.0000 0.9612 1.000 0.000
#> SRR1459980 1 0.0000 0.9612 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.1860 0.748 0.000 0.052 0.948
#> SRR1405147 1 0.5269 0.790 0.784 0.200 0.016
#> SRR1315412 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1338384 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1071105 1 0.6446 0.761 0.736 0.212 0.052
#> SRR1432868 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1454480 1 0.6446 0.761 0.736 0.212 0.052
#> SRR1330723 2 0.5431 0.821 0.000 0.716 0.284
#> SRR1475324 3 0.3686 0.676 0.000 0.140 0.860
#> SRR1340260 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1321897 3 0.5536 0.678 0.024 0.200 0.776
#> SRR1445194 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1443308 3 0.0000 0.755 0.000 0.000 1.000
#> SRR1400931 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1416188 3 0.0000 0.755 0.000 0.000 1.000
#> SRR1407044 3 0.9602 -0.131 0.396 0.200 0.404
#> SRR1078392 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1436468 3 0.0892 0.754 0.000 0.020 0.980
#> SRR1476125 2 0.3851 0.537 0.004 0.860 0.136
#> SRR1418747 1 0.9558 0.223 0.444 0.200 0.356
#> SRR1318089 3 0.2066 0.744 0.000 0.060 0.940
#> SRR1444370 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1348929 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1385690 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1469062 1 0.9334 0.393 0.508 0.200 0.292
#> SRR1388459 3 0.1643 0.751 0.000 0.044 0.956
#> SRR1416841 3 0.3686 0.676 0.000 0.140 0.860
#> SRR1473778 1 0.9566 0.211 0.440 0.200 0.360
#> SRR1419561 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1339987 1 0.5269 0.790 0.784 0.200 0.016
#> SRR1469662 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1353600 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1456492 3 0.2448 0.734 0.000 0.076 0.924
#> SRR1389955 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1429540 1 0.4178 0.812 0.828 0.172 0.000
#> SRR1356057 3 0.5536 0.678 0.024 0.200 0.776
#> SRR1328715 1 0.6306 0.765 0.748 0.200 0.052
#> SRR1429429 3 0.3686 0.676 0.000 0.140 0.860
#> SRR1325201 2 0.3851 0.537 0.004 0.860 0.136
#> SRR1382978 3 0.3686 0.676 0.000 0.140 0.860
#> SRR1406348 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1469390 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1376380 3 0.5536 0.678 0.024 0.200 0.776
#> SRR1418225 1 0.6446 0.761 0.736 0.212 0.052
#> SRR1418473 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1376741 1 0.5072 0.795 0.792 0.196 0.012
#> SRR1431823 3 0.4555 0.688 0.000 0.200 0.800
#> SRR1447916 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1458643 1 0.0237 0.877 0.996 0.004 0.000
#> SRR1445618 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1081589 1 0.0592 0.872 0.988 0.012 0.000
#> SRR1097245 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1404339 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1478614 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.879 1.000 0.000 0.000
#> SRR1413307 3 0.4654 0.684 0.000 0.208 0.792
#> SRR1397720 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1358391 1 0.5414 0.787 0.772 0.212 0.016
#> SRR1381185 1 0.7932 0.666 0.660 0.200 0.140
#> SRR1100608 2 0.3686 0.535 0.000 0.860 0.140
#> SRR1386927 2 0.4842 0.877 0.000 0.776 0.224
#> SRR1331771 3 0.5536 0.678 0.024 0.200 0.776
#> SRR1486322 3 0.1860 0.748 0.000 0.052 0.948
#> SRR1080790 1 0.6306 0.765 0.748 0.200 0.052
#> SRR1459980 1 0.0000 0.879 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0336 0.9121 0.000 0.008 0.992 0.000
#> SRR1405147 4 0.4222 0.6985 0.272 0.000 0.000 0.728
#> SRR1315412 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1338384 1 0.0188 0.9863 0.996 0.000 0.000 0.004
#> SRR1071105 4 0.4252 0.6413 0.252 0.000 0.004 0.744
#> SRR1432868 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1454480 4 0.3679 0.7080 0.140 0.016 0.004 0.840
#> SRR1330723 2 0.4224 0.8158 0.000 0.812 0.144 0.044
#> SRR1475324 3 0.2704 0.8618 0.000 0.124 0.876 0.000
#> SRR1340260 1 0.0188 0.9863 0.996 0.000 0.000 0.004
#> SRR1376450 1 0.0188 0.9863 0.996 0.000 0.000 0.004
#> SRR1321897 4 0.4679 0.4540 0.000 0.000 0.352 0.648
#> SRR1445194 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1443308 3 0.1022 0.9006 0.000 0.000 0.968 0.032
#> SRR1400931 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.1022 0.9006 0.000 0.000 0.968 0.032
#> SRR1407044 4 0.5209 0.6788 0.104 0.000 0.140 0.756
#> SRR1078392 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1436468 3 0.3052 0.8042 0.000 0.004 0.860 0.136
#> SRR1476125 4 0.5337 -0.0149 0.000 0.424 0.012 0.564
#> SRR1418747 4 0.5174 0.6899 0.116 0.000 0.124 0.760
#> SRR1318089 3 0.0469 0.9121 0.000 0.012 0.988 0.000
#> SRR1444370 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1385690 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1460337 1 0.0188 0.9863 0.996 0.000 0.000 0.004
#> SRR1469062 4 0.4916 0.7193 0.184 0.000 0.056 0.760
#> SRR1388459 3 0.0336 0.9121 0.000 0.008 0.992 0.000
#> SRR1416841 3 0.2760 0.8582 0.000 0.128 0.872 0.000
#> SRR1473778 4 0.5174 0.6899 0.116 0.000 0.124 0.760
#> SRR1419561 1 0.0188 0.9863 0.996 0.000 0.000 0.004
#> SRR1339987 4 0.4193 0.7015 0.268 0.000 0.000 0.732
#> SRR1469662 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.0188 0.9863 0.996 0.000 0.000 0.004
#> SRR1353600 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.0469 0.9121 0.000 0.012 0.988 0.000
#> SRR1389955 1 0.0188 0.9863 0.996 0.000 0.000 0.004
#> SRR1429540 4 0.4967 0.4224 0.452 0.000 0.000 0.548
#> SRR1356057 4 0.4679 0.4540 0.000 0.000 0.352 0.648
#> SRR1328715 4 0.4193 0.7016 0.268 0.000 0.000 0.732
#> SRR1429429 3 0.2760 0.8582 0.000 0.128 0.872 0.000
#> SRR1325201 4 0.5337 -0.0149 0.000 0.424 0.012 0.564
#> SRR1382978 3 0.2704 0.8618 0.000 0.124 0.876 0.000
#> SRR1406348 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1469390 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1376380 4 0.4679 0.4540 0.000 0.000 0.352 0.648
#> SRR1418225 4 0.4898 0.6360 0.264 0.016 0.004 0.716
#> SRR1418473 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1376741 4 0.4250 0.6953 0.276 0.000 0.000 0.724
#> SRR1431823 3 0.3726 0.6987 0.000 0.000 0.788 0.212
#> SRR1447916 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1458643 1 0.0524 0.9776 0.988 0.004 0.000 0.008
#> SRR1445618 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1081589 1 0.1489 0.9365 0.952 0.004 0.000 0.044
#> SRR1097245 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.0188 0.9849 0.996 0.004 0.000 0.000
#> SRR1404339 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1478614 1 0.0188 0.9863 0.996 0.000 0.000 0.004
#> SRR1406135 1 0.0000 0.9871 1.000 0.000 0.000 0.000
#> SRR1413307 4 0.4399 0.5418 0.000 0.016 0.224 0.760
#> SRR1397720 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1358391 4 0.5395 0.5699 0.352 0.016 0.004 0.628
#> SRR1381185 4 0.4319 0.7237 0.228 0.000 0.012 0.760
#> SRR1100608 4 0.5337 -0.0149 0.000 0.424 0.012 0.564
#> SRR1386927 2 0.0817 0.9834 0.000 0.976 0.024 0.000
#> SRR1331771 4 0.4679 0.4540 0.000 0.000 0.352 0.648
#> SRR1486322 3 0.0336 0.9121 0.000 0.008 0.992 0.000
#> SRR1080790 4 0.4122 0.7191 0.236 0.000 0.004 0.760
#> SRR1459980 1 0.2814 0.8000 0.868 0.000 0.000 0.132
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0510 0.87462 0.000 0.000 0.984 0.016 0.000
#> SRR1405147 5 0.2488 0.49448 0.124 0.000 0.000 0.004 0.872
#> SRR1315412 2 0.0000 0.95816 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.3353 0.85619 0.796 0.000 0.000 0.008 0.196
#> SRR1071105 4 0.5542 -0.00462 0.068 0.000 0.000 0.500 0.432
#> SRR1432868 2 0.0000 0.95816 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 5 0.5375 0.27559 0.076 0.000 0.000 0.320 0.604
#> SRR1330723 2 0.5660 0.46401 0.000 0.640 0.096 0.252 0.012
#> SRR1475324 3 0.2293 0.84461 0.000 0.084 0.900 0.016 0.000
#> SRR1340260 1 0.3318 0.85826 0.800 0.000 0.000 0.008 0.192
#> SRR1376450 1 0.3462 0.85602 0.792 0.000 0.000 0.012 0.196
#> SRR1321897 5 0.5819 0.45880 0.000 0.000 0.148 0.252 0.600
#> SRR1445194 1 0.0290 0.87725 0.992 0.000 0.000 0.000 0.008
#> SRR1443308 3 0.3119 0.79817 0.000 0.000 0.860 0.068 0.072
#> SRR1400931 1 0.0162 0.87476 0.996 0.000 0.000 0.004 0.000
#> SRR1416188 3 0.3119 0.79817 0.000 0.000 0.860 0.068 0.072
#> SRR1407044 5 0.4522 0.54520 0.012 0.000 0.028 0.236 0.724
#> SRR1078392 1 0.3391 0.85983 0.800 0.000 0.000 0.012 0.188
#> SRR1436468 3 0.5816 0.45129 0.000 0.000 0.608 0.228 0.164
#> SRR1476125 4 0.3650 0.63407 0.000 0.176 0.000 0.796 0.028
#> SRR1418747 5 0.4494 0.54652 0.012 0.000 0.028 0.232 0.728
#> SRR1318089 3 0.0510 0.87206 0.000 0.000 0.984 0.016 0.000
#> SRR1444370 1 0.2798 0.87298 0.852 0.000 0.000 0.008 0.140
#> SRR1348929 2 0.0000 0.95816 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.1670 0.88038 0.936 0.000 0.000 0.012 0.052
#> SRR1460337 1 0.3039 0.86008 0.808 0.000 0.000 0.000 0.192
#> SRR1469062 5 0.4352 0.54395 0.012 0.000 0.020 0.236 0.732
#> SRR1388459 3 0.0510 0.87462 0.000 0.000 0.984 0.016 0.000
#> SRR1416841 3 0.2408 0.83843 0.000 0.092 0.892 0.016 0.000
#> SRR1473778 5 0.4494 0.54652 0.012 0.000 0.028 0.232 0.728
#> SRR1419561 1 0.3462 0.85602 0.792 0.000 0.000 0.012 0.196
#> SRR1339987 5 0.2563 0.49577 0.120 0.000 0.000 0.008 0.872
#> SRR1469662 1 0.2674 0.87542 0.868 0.000 0.000 0.012 0.120
#> SRR1432958 1 0.0162 0.87476 0.996 0.000 0.000 0.004 0.000
#> SRR1479198 1 0.3779 0.82252 0.752 0.000 0.000 0.012 0.236
#> SRR1353600 1 0.0162 0.87476 0.996 0.000 0.000 0.004 0.000
#> SRR1456492 3 0.0404 0.87439 0.000 0.000 0.988 0.012 0.000
#> SRR1389955 1 0.3530 0.85070 0.784 0.000 0.000 0.012 0.204
#> SRR1429540 5 0.4118 0.21117 0.336 0.000 0.000 0.004 0.660
#> SRR1356057 5 0.5819 0.45880 0.000 0.000 0.148 0.252 0.600
#> SRR1328715 5 0.3134 0.49684 0.120 0.000 0.000 0.032 0.848
#> SRR1429429 3 0.2408 0.83843 0.000 0.092 0.892 0.016 0.000
#> SRR1325201 4 0.3650 0.63407 0.000 0.176 0.000 0.796 0.028
#> SRR1382978 3 0.2293 0.84461 0.000 0.084 0.900 0.016 0.000
#> SRR1406348 2 0.0000 0.95816 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.95816 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 5 0.5819 0.45880 0.000 0.000 0.148 0.252 0.600
#> SRR1418225 5 0.5874 0.12103 0.108 0.000 0.000 0.364 0.528
#> SRR1418473 2 0.0404 0.95394 0.000 0.988 0.000 0.000 0.012
#> SRR1376741 5 0.2536 0.49291 0.128 0.000 0.000 0.004 0.868
#> SRR1431823 5 0.6771 0.14107 0.000 0.000 0.356 0.272 0.372
#> SRR1447916 2 0.0000 0.95816 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 1 0.1493 0.84821 0.948 0.000 0.000 0.024 0.028
#> SRR1445618 1 0.0162 0.87476 0.996 0.000 0.000 0.004 0.000
#> SRR1081589 1 0.1493 0.84821 0.948 0.000 0.000 0.024 0.028
#> SRR1097245 1 0.0162 0.87476 0.996 0.000 0.000 0.004 0.000
#> SRR1416141 1 0.0566 0.87143 0.984 0.000 0.000 0.012 0.004
#> SRR1404339 2 0.0404 0.95394 0.000 0.988 0.000 0.000 0.012
#> SRR1478614 1 0.1121 0.87947 0.956 0.000 0.000 0.000 0.044
#> SRR1406135 1 0.0510 0.87577 0.984 0.000 0.000 0.016 0.000
#> SRR1413307 4 0.5985 -0.26406 0.000 0.000 0.112 0.480 0.408
#> SRR1397720 2 0.0000 0.95816 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 5 0.5892 0.18872 0.180 0.000 0.000 0.220 0.600
#> SRR1381185 5 0.4193 0.54668 0.040 0.000 0.000 0.212 0.748
#> SRR1100608 4 0.3650 0.63407 0.000 0.176 0.000 0.796 0.028
#> SRR1386927 2 0.0404 0.95394 0.000 0.988 0.000 0.000 0.012
#> SRR1331771 5 0.5819 0.45880 0.000 0.000 0.148 0.252 0.600
#> SRR1486322 3 0.0510 0.87462 0.000 0.000 0.984 0.016 0.000
#> SRR1080790 5 0.2438 0.54131 0.040 0.000 0.000 0.060 0.900
#> SRR1459980 1 0.4617 0.48129 0.552 0.000 0.000 0.012 0.436
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.2300 0.83864 0.000 0.000 0.856 0.000 0.000 0.144
#> SRR1405147 5 0.1218 0.53171 0.028 0.000 0.000 0.004 0.956 0.012
#> SRR1315412 2 0.0260 0.94148 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1338384 1 0.3925 0.71228 0.656 0.000 0.000 0.008 0.332 0.004
#> SRR1071105 5 0.4572 0.23628 0.020 0.000 0.000 0.400 0.568 0.012
#> SRR1432868 2 0.0146 0.94167 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1454480 5 0.5904 0.31213 0.012 0.000 0.000 0.284 0.524 0.180
#> SRR1330723 2 0.5390 0.44828 0.000 0.620 0.004 0.176 0.004 0.196
#> SRR1475324 3 0.1682 0.81780 0.000 0.052 0.928 0.020 0.000 0.000
#> SRR1340260 1 0.3684 0.72845 0.692 0.000 0.000 0.004 0.300 0.004
#> SRR1376450 1 0.3804 0.71001 0.656 0.000 0.000 0.008 0.336 0.000
#> SRR1321897 6 0.3738 0.74480 0.000 0.000 0.016 0.000 0.280 0.704
#> SRR1445194 1 0.0146 0.75647 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR1443308 3 0.3890 0.55392 0.000 0.000 0.596 0.004 0.000 0.400
#> SRR1400931 1 0.1767 0.74366 0.932 0.000 0.036 0.020 0.000 0.012
#> SRR1416188 3 0.3890 0.55392 0.000 0.000 0.596 0.004 0.000 0.400
#> SRR1407044 5 0.4462 0.01093 0.008 0.000 0.000 0.016 0.540 0.436
#> SRR1078392 1 0.3741 0.72096 0.672 0.000 0.000 0.008 0.320 0.000
#> SRR1436468 6 0.5489 0.26147 0.000 0.000 0.292 0.036 0.076 0.596
#> SRR1476125 4 0.2349 0.99507 0.000 0.080 0.000 0.892 0.008 0.020
#> SRR1418747 5 0.4533 0.00961 0.008 0.000 0.000 0.020 0.540 0.432
#> SRR1318089 3 0.1663 0.84150 0.000 0.000 0.912 0.000 0.000 0.088
#> SRR1444370 1 0.3733 0.73444 0.700 0.000 0.000 0.008 0.288 0.004
#> SRR1348929 2 0.0260 0.94148 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1385690 1 0.2980 0.75454 0.800 0.000 0.000 0.008 0.192 0.000
#> SRR1460337 1 0.3809 0.72693 0.684 0.000 0.000 0.008 0.304 0.004
#> SRR1469062 5 0.4538 0.00741 0.008 0.000 0.000 0.020 0.536 0.436
#> SRR1388459 3 0.2883 0.79667 0.000 0.000 0.788 0.000 0.000 0.212
#> SRR1416841 3 0.1745 0.81473 0.000 0.056 0.924 0.020 0.000 0.000
#> SRR1473778 5 0.4522 0.03613 0.008 0.000 0.000 0.020 0.548 0.424
#> SRR1419561 1 0.3804 0.71001 0.656 0.000 0.000 0.008 0.336 0.000
#> SRR1339987 5 0.1065 0.53045 0.020 0.000 0.000 0.008 0.964 0.008
#> SRR1469662 1 0.3421 0.74243 0.736 0.000 0.000 0.008 0.256 0.000
#> SRR1432958 1 0.1767 0.74366 0.932 0.000 0.036 0.020 0.000 0.012
#> SRR1479198 1 0.4039 0.59845 0.568 0.000 0.000 0.008 0.424 0.000
#> SRR1353600 1 0.1666 0.74342 0.936 0.000 0.036 0.020 0.000 0.008
#> SRR1456492 3 0.2766 0.83757 0.000 0.000 0.844 0.008 0.008 0.140
#> SRR1389955 1 0.3887 0.68765 0.632 0.000 0.000 0.008 0.360 0.000
#> SRR1429540 5 0.2979 0.41071 0.188 0.000 0.000 0.004 0.804 0.004
#> SRR1356057 6 0.3758 0.74383 0.000 0.000 0.016 0.000 0.284 0.700
#> SRR1328715 5 0.1710 0.53282 0.028 0.000 0.000 0.020 0.936 0.016
#> SRR1429429 3 0.1745 0.81473 0.000 0.056 0.924 0.020 0.000 0.000
#> SRR1325201 4 0.2432 0.99472 0.000 0.080 0.000 0.888 0.008 0.024
#> SRR1382978 3 0.1682 0.81780 0.000 0.052 0.928 0.020 0.000 0.000
#> SRR1406348 2 0.0000 0.94148 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0260 0.94148 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1376380 6 0.3797 0.73965 0.000 0.000 0.016 0.000 0.292 0.692
#> SRR1418225 5 0.5811 0.21645 0.020 0.000 0.000 0.344 0.516 0.120
#> SRR1418473 2 0.1296 0.92336 0.000 0.948 0.000 0.004 0.004 0.044
#> SRR1376741 5 0.0935 0.53033 0.032 0.000 0.000 0.004 0.964 0.000
#> SRR1431823 6 0.4125 0.70515 0.000 0.000 0.080 0.000 0.184 0.736
#> SRR1447916 2 0.0260 0.94148 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1458643 1 0.4429 0.63263 0.780 0.000 0.048 0.064 0.012 0.096
#> SRR1445618 1 0.1767 0.74366 0.932 0.000 0.036 0.020 0.000 0.012
#> SRR1081589 1 0.4429 0.63263 0.780 0.000 0.048 0.064 0.012 0.096
#> SRR1097245 1 0.1767 0.74366 0.932 0.000 0.036 0.020 0.000 0.012
#> SRR1416141 1 0.3367 0.69297 0.852 0.000 0.048 0.040 0.008 0.052
#> SRR1404339 2 0.1296 0.92336 0.000 0.948 0.000 0.004 0.004 0.044
#> SRR1478614 1 0.1829 0.76037 0.920 0.000 0.000 0.012 0.064 0.004
#> SRR1406135 1 0.2024 0.74883 0.924 0.000 0.036 0.020 0.012 0.008
#> SRR1413307 6 0.4925 0.35127 0.000 0.000 0.008 0.256 0.088 0.648
#> SRR1397720 2 0.0000 0.94148 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 5 0.5772 0.36821 0.056 0.000 0.000 0.208 0.620 0.116
#> SRR1381185 5 0.4426 0.14481 0.008 0.000 0.000 0.020 0.596 0.376
#> SRR1100608 4 0.2320 0.99290 0.000 0.080 0.000 0.892 0.004 0.024
#> SRR1386927 2 0.1296 0.92336 0.000 0.948 0.000 0.004 0.004 0.044
#> SRR1331771 6 0.3778 0.73981 0.000 0.000 0.016 0.000 0.288 0.696
#> SRR1486322 3 0.2300 0.83864 0.000 0.000 0.856 0.000 0.000 0.144
#> SRR1080790 5 0.3595 0.29383 0.008 0.000 0.000 0.000 0.704 0.288
#> SRR1459980 5 0.3804 -0.02944 0.336 0.000 0.000 0.008 0.656 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 17667 rows and 70 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.999 1.000 0.5039 0.496 0.496
#> 3 3 0.977 0.957 0.979 0.2561 0.810 0.638
#> 4 4 0.973 0.912 0.966 0.1201 0.916 0.771
#> 5 5 0.876 0.851 0.925 0.0435 0.932 0.784
#> 6 6 0.793 0.788 0.823 0.0405 0.972 0.898
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 2 0.000 0.999 0.000 1.000
#> SRR1405147 1 0.000 1.000 1.000 0.000
#> SRR1315412 2 0.000 0.999 0.000 1.000
#> SRR1338384 1 0.000 1.000 1.000 0.000
#> SRR1071105 1 0.000 1.000 1.000 0.000
#> SRR1432868 2 0.000 0.999 0.000 1.000
#> SRR1454480 1 0.000 1.000 1.000 0.000
#> SRR1330723 2 0.000 0.999 0.000 1.000
#> SRR1475324 2 0.000 0.999 0.000 1.000
#> SRR1340260 1 0.000 1.000 1.000 0.000
#> SRR1376450 1 0.000 1.000 1.000 0.000
#> SRR1321897 2 0.000 0.999 0.000 1.000
#> SRR1445194 1 0.000 1.000 1.000 0.000
#> SRR1443308 2 0.000 0.999 0.000 1.000
#> SRR1400931 1 0.000 1.000 1.000 0.000
#> SRR1416188 2 0.000 0.999 0.000 1.000
#> SRR1407044 1 0.000 1.000 1.000 0.000
#> SRR1078392 1 0.000 1.000 1.000 0.000
#> SRR1436468 2 0.000 0.999 0.000 1.000
#> SRR1476125 2 0.204 0.967 0.032 0.968
#> SRR1418747 1 0.000 1.000 1.000 0.000
#> SRR1318089 2 0.000 0.999 0.000 1.000
#> SRR1444370 1 0.000 1.000 1.000 0.000
#> SRR1348929 2 0.000 0.999 0.000 1.000
#> SRR1385690 1 0.000 1.000 1.000 0.000
#> SRR1460337 1 0.000 1.000 1.000 0.000
#> SRR1469062 1 0.000 1.000 1.000 0.000
#> SRR1388459 2 0.000 0.999 0.000 1.000
#> SRR1416841 2 0.000 0.999 0.000 1.000
#> SRR1473778 1 0.000 1.000 1.000 0.000
#> SRR1419561 1 0.000 1.000 1.000 0.000
#> SRR1339987 1 0.000 1.000 1.000 0.000
#> SRR1469662 1 0.000 1.000 1.000 0.000
#> SRR1432958 1 0.000 1.000 1.000 0.000
#> SRR1479198 1 0.000 1.000 1.000 0.000
#> SRR1353600 1 0.000 1.000 1.000 0.000
#> SRR1456492 2 0.000 0.999 0.000 1.000
#> SRR1389955 1 0.000 1.000 1.000 0.000
#> SRR1429540 1 0.000 1.000 1.000 0.000
#> SRR1356057 2 0.000 0.999 0.000 1.000
#> SRR1328715 1 0.000 1.000 1.000 0.000
#> SRR1429429 2 0.000 0.999 0.000 1.000
#> SRR1325201 2 0.000 0.999 0.000 1.000
#> SRR1382978 2 0.000 0.999 0.000 1.000
#> SRR1406348 2 0.000 0.999 0.000 1.000
#> SRR1469390 2 0.000 0.999 0.000 1.000
#> SRR1376380 2 0.000 0.999 0.000 1.000
#> SRR1418225 1 0.000 1.000 1.000 0.000
#> SRR1418473 2 0.000 0.999 0.000 1.000
#> SRR1376741 1 0.000 1.000 1.000 0.000
#> SRR1431823 2 0.000 0.999 0.000 1.000
#> SRR1447916 2 0.000 0.999 0.000 1.000
#> SRR1458643 1 0.000 1.000 1.000 0.000
#> SRR1445618 1 0.000 1.000 1.000 0.000
#> SRR1081589 1 0.000 1.000 1.000 0.000
#> SRR1097245 1 0.000 1.000 1.000 0.000
#> SRR1416141 1 0.000 1.000 1.000 0.000
#> SRR1404339 2 0.000 0.999 0.000 1.000
#> SRR1478614 1 0.000 1.000 1.000 0.000
#> SRR1406135 1 0.000 1.000 1.000 0.000
#> SRR1413307 2 0.000 0.999 0.000 1.000
#> SRR1397720 2 0.000 0.999 0.000 1.000
#> SRR1358391 1 0.000 1.000 1.000 0.000
#> SRR1381185 1 0.000 1.000 1.000 0.000
#> SRR1100608 2 0.000 0.999 0.000 1.000
#> SRR1386927 2 0.000 0.999 0.000 1.000
#> SRR1331771 2 0.000 0.999 0.000 1.000
#> SRR1486322 2 0.000 0.999 0.000 1.000
#> SRR1080790 1 0.000 1.000 1.000 0.000
#> SRR1459980 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
#> SRR1433493 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1405147 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1315412 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1071105 1 0.0237 0.985 0.996 0.004 0.000
#> SRR1432868 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1454480 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1330723 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1475324 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1340260 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1321897 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1445194 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1443308 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1400931 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1416188 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1407044 3 0.4796 0.740 0.220 0.000 0.780
#> SRR1078392 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1436468 3 0.1529 0.920 0.000 0.040 0.960
#> SRR1476125 2 0.0237 0.995 0.004 0.996 0.000
#> SRR1418747 3 0.4887 0.731 0.228 0.000 0.772
#> SRR1318089 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1444370 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1348929 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1385690 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1469062 3 0.5327 0.662 0.272 0.000 0.728
#> SRR1388459 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1416841 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1473778 3 0.4002 0.800 0.160 0.000 0.840
#> SRR1419561 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1339987 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1469662 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1353600 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1456492 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1389955 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1429540 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1356057 3 0.0424 0.939 0.000 0.008 0.992
#> SRR1328715 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1429429 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1325201 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1382978 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1406348 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1469390 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376380 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1418225 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1418473 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1431823 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1447916 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1458643 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1445618 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1081589 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1097245 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1404339 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1413307 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1397720 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1358391 1 0.0000 0.988 1.000 0.000 0.000
#> SRR1381185 1 0.5363 0.596 0.724 0.000 0.276
#> SRR1100608 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1386927 2 0.0000 1.000 0.000 1.000 0.000
#> SRR1331771 3 0.0000 0.935 0.000 0.000 1.000
#> SRR1486322 3 0.0592 0.940 0.000 0.012 0.988
#> SRR1080790 1 0.2537 0.904 0.920 0.000 0.080
#> SRR1459980 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
#> SRR1433493 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.4994 -0.123 0.520 0.000 0.000 0.480
#> SRR1315412 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1071105 1 0.0336 0.956 0.992 0.008 0.000 0.000
#> SRR1432868 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1454480 1 0.0592 0.951 0.984 0.000 0.000 0.016
#> SRR1330723 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1321897 3 0.3123 0.843 0.000 0.000 0.844 0.156
#> SRR1445194 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1443308 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1400931 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1407044 4 0.0779 0.842 0.004 0.000 0.016 0.980
#> SRR1078392 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1436468 3 0.0707 0.961 0.000 0.020 0.980 0.000
#> SRR1476125 2 0.0336 0.987 0.000 0.992 0.000 0.008
#> SRR1418747 4 0.0895 0.839 0.004 0.000 0.020 0.976
#> SRR1318089 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1460337 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1469062 4 0.0657 0.842 0.004 0.000 0.012 0.984
#> SRR1388459 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1473778 4 0.0779 0.842 0.004 0.000 0.016 0.980
#> SRR1419561 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1339987 1 0.4817 0.229 0.612 0.000 0.000 0.388
#> SRR1469662 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1389955 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1429540 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1356057 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1328715 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.0336 0.987 0.000 0.992 0.000 0.008
#> SRR1382978 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.2011 0.919 0.000 0.000 0.920 0.080
#> SRR1418225 1 0.0592 0.951 0.984 0.000 0.000 0.016
#> SRR1418473 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1376741 4 0.4843 0.402 0.396 0.000 0.000 0.604
#> SRR1431823 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1447916 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1458643 1 0.0336 0.957 0.992 0.000 0.000 0.008
#> SRR1445618 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1081589 1 0.0336 0.957 0.992 0.000 0.000 0.008
#> SRR1097245 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1404339 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.0000 0.962 1.000 0.000 0.000 0.000
#> SRR1413307 2 0.2676 0.882 0.000 0.896 0.092 0.012
#> SRR1397720 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1358391 1 0.0469 0.954 0.988 0.000 0.000 0.012
#> SRR1381185 4 0.0672 0.842 0.008 0.000 0.008 0.984
#> SRR1100608 2 0.0336 0.987 0.000 0.992 0.000 0.008
#> SRR1386927 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.2408 0.897 0.000 0.000 0.896 0.104
#> SRR1486322 3 0.0000 0.978 0.000 0.000 1.000 0.000
#> SRR1080790 4 0.0707 0.837 0.020 0.000 0.000 0.980
#> SRR1459980 4 0.4898 0.353 0.416 0.000 0.000 0.584
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1405147 1 0.3602 0.68826 0.796 0.000 0.000 0.024 0.180
#> SRR1315412 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.0162 0.91144 0.996 0.000 0.000 0.004 0.000
#> SRR1071105 1 0.1792 0.85219 0.916 0.000 0.000 0.084 0.000
#> SRR1432868 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.3752 0.71609 0.292 0.000 0.000 0.708 0.000
#> SRR1330723 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1475324 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1340260 1 0.0162 0.91206 0.996 0.000 0.000 0.004 0.000
#> SRR1376450 1 0.0162 0.91144 0.996 0.000 0.000 0.004 0.000
#> SRR1321897 3 0.4630 0.39567 0.000 0.000 0.588 0.016 0.396
#> SRR1445194 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1443308 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1400931 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1416188 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 5 0.0162 0.95330 0.000 0.000 0.000 0.004 0.996
#> SRR1078392 1 0.0162 0.91144 0.996 0.000 0.000 0.004 0.000
#> SRR1436468 3 0.0794 0.90974 0.000 0.028 0.972 0.000 0.000
#> SRR1476125 2 0.3534 0.74996 0.000 0.744 0.000 0.256 0.000
#> SRR1418747 5 0.0324 0.95324 0.004 0.000 0.000 0.004 0.992
#> SRR1318089 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.0000 0.91187 1.000 0.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.0162 0.91144 0.996 0.000 0.000 0.004 0.000
#> SRR1460337 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1469062 5 0.1671 0.95316 0.000 0.000 0.000 0.076 0.924
#> SRR1388459 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1416841 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1473778 5 0.1892 0.95208 0.000 0.000 0.004 0.080 0.916
#> SRR1419561 1 0.0162 0.91144 0.996 0.000 0.000 0.004 0.000
#> SRR1339987 1 0.3766 0.58036 0.728 0.000 0.000 0.004 0.268
#> SRR1469662 1 0.0162 0.91144 0.996 0.000 0.000 0.004 0.000
#> SRR1432958 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1479198 1 0.0324 0.90974 0.992 0.000 0.000 0.004 0.004
#> SRR1353600 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1456492 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1389955 1 0.0162 0.91144 0.996 0.000 0.000 0.004 0.000
#> SRR1429540 1 0.0794 0.90339 0.972 0.000 0.000 0.028 0.000
#> SRR1356057 3 0.1502 0.89381 0.000 0.000 0.940 0.056 0.004
#> SRR1328715 1 0.0609 0.90854 0.980 0.000 0.000 0.020 0.000
#> SRR1429429 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1325201 2 0.3210 0.79017 0.000 0.788 0.000 0.212 0.000
#> SRR1382978 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1406348 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.3689 0.68100 0.000 0.000 0.740 0.004 0.256
#> SRR1418225 4 0.3508 0.70099 0.252 0.000 0.000 0.748 0.000
#> SRR1418473 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.4382 0.50422 0.688 0.000 0.000 0.024 0.288
#> SRR1431823 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1447916 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 1 0.3395 0.60189 0.764 0.000 0.000 0.236 0.000
#> SRR1445618 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1081589 1 0.3424 0.59328 0.760 0.000 0.000 0.240 0.000
#> SRR1097245 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1416141 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1404339 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 1 0.0510 0.91109 0.984 0.000 0.000 0.016 0.000
#> SRR1406135 1 0.0290 0.91197 0.992 0.000 0.000 0.008 0.000
#> SRR1413307 4 0.5206 -0.00802 0.000 0.428 0.044 0.528 0.000
#> SRR1397720 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.3983 0.66256 0.340 0.000 0.000 0.660 0.000
#> SRR1381185 5 0.1908 0.94873 0.000 0.000 0.000 0.092 0.908
#> SRR1100608 2 0.3508 0.75427 0.000 0.748 0.000 0.252 0.000
#> SRR1386927 2 0.0000 0.94417 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.3980 0.63137 0.000 0.000 0.708 0.008 0.284
#> SRR1486322 3 0.0000 0.93206 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 5 0.0566 0.94606 0.012 0.000 0.000 0.004 0.984
#> SRR1459980 1 0.4040 0.54579 0.712 0.000 0.000 0.012 0.276
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 1 0.4921 0.6607 0.688 0.212 0.000 0.036 0.064 0.000
#> SRR1315412 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1338384 1 0.2006 0.8515 0.892 0.104 0.000 0.004 0.000 0.000
#> SRR1071105 1 0.3741 0.4785 0.672 0.008 0.000 0.000 0.000 0.320
#> SRR1432868 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1454480 4 0.2877 0.7090 0.168 0.000 0.000 0.820 0.000 0.012
#> SRR1330723 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1475324 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1340260 1 0.0146 0.8602 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR1376450 1 0.1958 0.8530 0.896 0.100 0.000 0.004 0.000 0.000
#> SRR1321897 3 0.4891 0.3393 0.000 0.028 0.540 0.020 0.412 0.000
#> SRR1445194 1 0.0146 0.8594 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1443308 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1400931 1 0.0291 0.8587 0.992 0.004 0.000 0.004 0.000 0.000
#> SRR1416188 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1407044 5 0.0146 0.6228 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR1078392 1 0.1958 0.8530 0.896 0.100 0.000 0.004 0.000 0.000
#> SRR1436468 3 0.1334 0.8639 0.000 0.032 0.948 0.000 0.000 0.020
#> SRR1476125 6 0.0363 0.9670 0.000 0.000 0.000 0.012 0.000 0.988
#> SRR1418747 5 0.1562 0.6161 0.000 0.024 0.004 0.032 0.940 0.000
#> SRR1318089 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.1219 0.8602 0.948 0.048 0.000 0.004 0.000 0.000
#> SRR1348929 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1385690 1 0.1958 0.8530 0.896 0.100 0.000 0.004 0.000 0.000
#> SRR1460337 1 0.0405 0.8580 0.988 0.008 0.000 0.004 0.000 0.000
#> SRR1469062 5 0.4892 0.5974 0.000 0.176 0.000 0.164 0.660 0.000
#> SRR1388459 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1416841 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1473778 5 0.5639 0.5657 0.000 0.284 0.004 0.168 0.544 0.000
#> SRR1419561 1 0.2100 0.8480 0.884 0.112 0.000 0.004 0.000 0.000
#> SRR1339987 5 0.5579 -0.1741 0.432 0.120 0.000 0.004 0.444 0.000
#> SRR1469662 1 0.1958 0.8530 0.896 0.100 0.000 0.004 0.000 0.000
#> SRR1432958 1 0.0146 0.8594 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1479198 1 0.2544 0.8374 0.864 0.120 0.000 0.004 0.012 0.000
#> SRR1353600 1 0.0291 0.8587 0.992 0.004 0.000 0.004 0.000 0.000
#> SRR1456492 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1389955 1 0.1958 0.8530 0.896 0.100 0.000 0.004 0.000 0.000
#> SRR1429540 1 0.2887 0.7708 0.844 0.120 0.000 0.036 0.000 0.000
#> SRR1356057 3 0.4704 0.6517 0.000 0.144 0.724 0.108 0.024 0.000
#> SRR1328715 1 0.2696 0.7812 0.856 0.116 0.000 0.028 0.000 0.000
#> SRR1429429 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1325201 6 0.0363 0.9663 0.000 0.012 0.000 0.000 0.000 0.988
#> SRR1382978 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1406348 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1469390 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1376380 3 0.3828 0.6302 0.000 0.004 0.696 0.012 0.288 0.000
#> SRR1418225 4 0.3202 0.6976 0.144 0.000 0.000 0.816 0.000 0.040
#> SRR1418473 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1376741 1 0.6021 0.4992 0.568 0.240 0.000 0.040 0.152 0.000
#> SRR1431823 3 0.0260 0.9032 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR1447916 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1458643 1 0.3629 0.5478 0.712 0.012 0.000 0.276 0.000 0.000
#> SRR1445618 1 0.0291 0.8587 0.992 0.004 0.000 0.004 0.000 0.000
#> SRR1081589 1 0.3468 0.5202 0.712 0.004 0.000 0.284 0.000 0.000
#> SRR1097245 1 0.0291 0.8587 0.992 0.004 0.000 0.004 0.000 0.000
#> SRR1416141 1 0.0508 0.8600 0.984 0.012 0.000 0.004 0.000 0.000
#> SRR1404339 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1478614 1 0.0405 0.8580 0.988 0.008 0.000 0.004 0.000 0.000
#> SRR1406135 1 0.1908 0.8539 0.900 0.096 0.000 0.004 0.000 0.000
#> SRR1413307 4 0.5963 -0.0958 0.000 0.416 0.044 0.456 0.000 0.084
#> SRR1397720 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1358391 4 0.2772 0.7001 0.180 0.000 0.000 0.816 0.000 0.004
#> SRR1381185 5 0.5662 0.5606 0.000 0.280 0.000 0.196 0.524 0.000
#> SRR1100608 6 0.0000 0.9773 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1386927 2 0.3797 1.0000 0.000 0.580 0.000 0.000 0.000 0.420
#> SRR1331771 3 0.4288 0.5491 0.000 0.016 0.644 0.012 0.328 0.000
#> SRR1486322 3 0.0000 0.9070 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 5 0.2065 0.5980 0.032 0.052 0.000 0.004 0.912 0.000
#> SRR1459980 1 0.5316 0.5824 0.632 0.148 0.000 0.012 0.208 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "pam"]
# you can also extract it by
# res = res_list["ATC:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.611 0.812 0.923 0.4117 0.586 0.586
#> 3 3 0.871 0.899 0.951 0.4817 0.732 0.569
#> 4 4 0.984 0.930 0.974 0.2205 0.773 0.482
#> 5 5 0.942 0.886 0.947 0.0545 0.918 0.704
#> 6 6 0.956 0.828 0.908 0.0243 0.966 0.845
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 5
There is also optional best \(k\) = 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR1433493 1 0.963 0.345 0.612 0.388
#> SRR1405147 1 0.000 0.926 1.000 0.000
#> SRR1315412 2 0.000 0.857 0.000 1.000
#> SRR1338384 1 0.000 0.926 1.000 0.000
#> SRR1071105 1 0.000 0.926 1.000 0.000
#> SRR1432868 2 0.000 0.857 0.000 1.000
#> SRR1454480 1 0.000 0.926 1.000 0.000
#> SRR1330723 2 0.000 0.857 0.000 1.000
#> SRR1475324 2 0.730 0.699 0.204 0.796
#> SRR1340260 1 0.000 0.926 1.000 0.000
#> SRR1376450 1 0.000 0.926 1.000 0.000
#> SRR1321897 1 0.697 0.753 0.812 0.188
#> SRR1445194 1 0.000 0.926 1.000 0.000
#> SRR1443308 1 0.738 0.727 0.792 0.208
#> SRR1400931 1 0.000 0.926 1.000 0.000
#> SRR1416188 1 0.775 0.698 0.772 0.228
#> SRR1407044 1 0.000 0.926 1.000 0.000
#> SRR1078392 1 0.000 0.926 1.000 0.000
#> SRR1436468 2 0.997 0.138 0.468 0.532
#> SRR1476125 2 0.995 0.240 0.460 0.540
#> SRR1418747 1 0.000 0.926 1.000 0.000
#> SRR1318089 2 0.996 0.153 0.464 0.536
#> SRR1444370 1 0.000 0.926 1.000 0.000
#> SRR1348929 2 0.000 0.857 0.000 1.000
#> SRR1385690 1 0.000 0.926 1.000 0.000
#> SRR1460337 1 0.000 0.926 1.000 0.000
#> SRR1469062 1 0.000 0.926 1.000 0.000
#> SRR1388459 1 0.722 0.738 0.800 0.200
#> SRR1416841 2 0.000 0.857 0.000 1.000
#> SRR1473778 1 0.000 0.926 1.000 0.000
#> SRR1419561 1 0.000 0.926 1.000 0.000
#> SRR1339987 1 0.000 0.926 1.000 0.000
#> SRR1469662 1 0.000 0.926 1.000 0.000
#> SRR1432958 1 0.000 0.926 1.000 0.000
#> SRR1479198 1 0.000 0.926 1.000 0.000
#> SRR1353600 1 0.000 0.926 1.000 0.000
#> SRR1456492 2 0.958 0.398 0.380 0.620
#> SRR1389955 1 0.000 0.926 1.000 0.000
#> SRR1429540 1 0.000 0.926 1.000 0.000
#> SRR1356057 1 0.697 0.753 0.812 0.188
#> SRR1328715 1 0.000 0.926 1.000 0.000
#> SRR1429429 2 0.000 0.857 0.000 1.000
#> SRR1325201 1 0.881 0.479 0.700 0.300
#> SRR1382978 2 0.781 0.665 0.232 0.768
#> SRR1406348 2 0.000 0.857 0.000 1.000
#> SRR1469390 2 0.000 0.857 0.000 1.000
#> SRR1376380 1 0.697 0.753 0.812 0.188
#> SRR1418225 1 0.000 0.926 1.000 0.000
#> SRR1418473 2 0.000 0.857 0.000 1.000
#> SRR1376741 1 0.000 0.926 1.000 0.000
#> SRR1431823 1 0.697 0.753 0.812 0.188
#> SRR1447916 2 0.000 0.857 0.000 1.000
#> SRR1458643 1 0.000 0.926 1.000 0.000
#> SRR1445618 1 0.000 0.926 1.000 0.000
#> SRR1081589 1 0.000 0.926 1.000 0.000
#> SRR1097245 1 0.000 0.926 1.000 0.000
#> SRR1416141 1 0.000 0.926 1.000 0.000
#> SRR1404339 2 0.000 0.857 0.000 1.000
#> SRR1478614 1 0.000 0.926 1.000 0.000
#> SRR1406135 1 0.000 0.926 1.000 0.000
#> SRR1413307 1 0.827 0.643 0.740 0.260
#> SRR1397720 2 0.000 0.857 0.000 1.000
#> SRR1358391 1 0.000 0.926 1.000 0.000
#> SRR1381185 1 0.000 0.926 1.000 0.000
#> SRR1100608 2 0.689 0.714 0.184 0.816
#> SRR1386927 2 0.000 0.857 0.000 1.000
#> SRR1331771 1 0.697 0.753 0.812 0.188
#> SRR1486322 1 0.994 0.115 0.544 0.456
#> SRR1080790 1 0.000 0.926 1.000 0.000
#> SRR1459980 1 0.000 0.926 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.000 0.953 0.000 0.000 1.000
#> SRR1405147 1 0.175 0.934 0.952 0.000 0.048
#> SRR1315412 2 0.000 0.888 0.000 1.000 0.000
#> SRR1338384 1 0.000 0.955 1.000 0.000 0.000
#> SRR1071105 1 0.175 0.934 0.952 0.000 0.048
#> SRR1432868 2 0.000 0.888 0.000 1.000 0.000
#> SRR1454480 1 0.175 0.934 0.952 0.000 0.048
#> SRR1330723 2 0.362 0.773 0.000 0.864 0.136
#> SRR1475324 3 0.280 0.906 0.000 0.092 0.908
#> SRR1340260 1 0.000 0.955 1.000 0.000 0.000
#> SRR1376450 1 0.000 0.955 1.000 0.000 0.000
#> SRR1321897 3 0.000 0.953 0.000 0.000 1.000
#> SRR1445194 1 0.000 0.955 1.000 0.000 0.000
#> SRR1443308 3 0.000 0.953 0.000 0.000 1.000
#> SRR1400931 1 0.000 0.955 1.000 0.000 0.000
#> SRR1416188 3 0.000 0.953 0.000 0.000 1.000
#> SRR1407044 1 0.595 0.527 0.640 0.000 0.360
#> SRR1078392 1 0.000 0.955 1.000 0.000 0.000
#> SRR1436468 3 0.116 0.946 0.000 0.028 0.972
#> SRR1476125 2 0.811 0.420 0.352 0.568 0.080
#> SRR1418747 1 0.455 0.790 0.800 0.000 0.200
#> SRR1318089 3 0.175 0.938 0.000 0.048 0.952
#> SRR1444370 1 0.000 0.955 1.000 0.000 0.000
#> SRR1348929 2 0.000 0.888 0.000 1.000 0.000
#> SRR1385690 1 0.000 0.955 1.000 0.000 0.000
#> SRR1460337 1 0.000 0.955 1.000 0.000 0.000
#> SRR1469062 1 0.455 0.790 0.800 0.000 0.200
#> SRR1388459 3 0.000 0.953 0.000 0.000 1.000
#> SRR1416841 3 0.440 0.802 0.000 0.188 0.812
#> SRR1473778 1 0.455 0.790 0.800 0.000 0.200
#> SRR1419561 1 0.000 0.955 1.000 0.000 0.000
#> SRR1339987 1 0.000 0.955 1.000 0.000 0.000
#> SRR1469662 1 0.000 0.955 1.000 0.000 0.000
#> SRR1432958 1 0.000 0.955 1.000 0.000 0.000
#> SRR1479198 1 0.000 0.955 1.000 0.000 0.000
#> SRR1353600 1 0.000 0.955 1.000 0.000 0.000
#> SRR1456492 3 0.175 0.938 0.000 0.048 0.952
#> SRR1389955 1 0.000 0.955 1.000 0.000 0.000
#> SRR1429540 1 0.175 0.934 0.952 0.000 0.048
#> SRR1356057 3 0.000 0.953 0.000 0.000 1.000
#> SRR1328715 1 0.175 0.934 0.952 0.000 0.048
#> SRR1429429 3 0.440 0.802 0.000 0.188 0.812
#> SRR1325201 2 0.760 0.370 0.384 0.568 0.048
#> SRR1382978 3 0.207 0.931 0.000 0.060 0.940
#> SRR1406348 2 0.000 0.888 0.000 1.000 0.000
#> SRR1469390 2 0.000 0.888 0.000 1.000 0.000
#> SRR1376380 3 0.000 0.953 0.000 0.000 1.000
#> SRR1418225 1 0.164 0.936 0.956 0.000 0.044
#> SRR1418473 2 0.000 0.888 0.000 1.000 0.000
#> SRR1376741 1 0.175 0.934 0.952 0.000 0.048
#> SRR1431823 3 0.000 0.953 0.000 0.000 1.000
#> SRR1447916 2 0.000 0.888 0.000 1.000 0.000
#> SRR1458643 1 0.000 0.955 1.000 0.000 0.000
#> SRR1445618 1 0.000 0.955 1.000 0.000 0.000
#> SRR1081589 1 0.000 0.955 1.000 0.000 0.000
#> SRR1097245 1 0.000 0.955 1.000 0.000 0.000
#> SRR1416141 1 0.000 0.955 1.000 0.000 0.000
#> SRR1404339 2 0.000 0.888 0.000 1.000 0.000
#> SRR1478614 1 0.000 0.955 1.000 0.000 0.000
#> SRR1406135 1 0.000 0.955 1.000 0.000 0.000
#> SRR1413307 3 0.000 0.953 0.000 0.000 1.000
#> SRR1397720 2 0.000 0.888 0.000 1.000 0.000
#> SRR1358391 1 0.000 0.955 1.000 0.000 0.000
#> SRR1381185 1 0.455 0.790 0.800 0.000 0.200
#> SRR1100608 2 0.473 0.718 0.004 0.800 0.196
#> SRR1386927 2 0.000 0.888 0.000 1.000 0.000
#> SRR1331771 3 0.000 0.953 0.000 0.000 1.000
#> SRR1486322 3 0.175 0.938 0.000 0.048 0.952
#> SRR1080790 1 0.175 0.934 0.952 0.000 0.048
#> SRR1459980 1 0.000 0.955 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1405147 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1315412 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1338384 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1071105 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1432868 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1454480 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1330723 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1475324 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1340260 1 0.485 0.322 0.6 0.000 0.000 0.400
#> SRR1376450 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1321897 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1445194 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1443308 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1400931 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1416188 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1407044 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1078392 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1436468 3 0.147 0.936 0.0 0.000 0.948 0.052
#> SRR1476125 4 0.445 0.509 0.0 0.308 0.000 0.692
#> SRR1418747 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1318089 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1444370 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1348929 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1385690 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1460337 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1469062 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1388459 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1416841 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1473778 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1419561 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1339987 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1469662 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1432958 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1479198 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1353600 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1456492 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1389955 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1429540 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1356057 4 0.373 0.718 0.0 0.000 0.212 0.788
#> SRR1328715 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1429429 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1325201 4 0.102 0.923 0.0 0.032 0.000 0.968
#> SRR1382978 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1406348 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1469390 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1376380 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1418225 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1418473 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1376741 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1431823 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1447916 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1458643 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1445618 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1081589 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1097245 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1416141 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1404339 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1478614 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1406135 1 0.000 0.977 1.0 0.000 0.000 0.000
#> SRR1413307 4 0.489 0.309 0.0 0.000 0.412 0.588
#> SRR1397720 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1358391 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1381185 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1100608 2 0.489 0.284 0.0 0.588 0.000 0.412
#> SRR1386927 2 0.000 0.957 0.0 1.000 0.000 0.000
#> SRR1331771 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1486322 3 0.000 0.995 0.0 0.000 1.000 0.000
#> SRR1080790 4 0.000 0.952 0.0 0.000 0.000 1.000
#> SRR1459980 1 0.000 0.977 1.0 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
#> SRR1433493 5 0.3336 0.735 0.000 0.000 0.228 0.000 0.772
#> SRR1405147 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1315412 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1071105 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1432868 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1330723 2 0.2966 0.745 0.000 0.816 0.184 0.000 0.000
#> SRR1475324 5 0.0963 0.956 0.000 0.000 0.036 0.000 0.964
#> SRR1340260 1 0.4182 0.358 0.600 0.000 0.000 0.400 0.000
#> SRR1376450 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1321897 3 0.0000 0.859 0.000 0.000 1.000 0.000 0.000
#> SRR1445194 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1443308 3 0.0794 0.858 0.000 0.000 0.972 0.000 0.028
#> SRR1400931 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.0794 0.858 0.000 0.000 0.972 0.000 0.028
#> SRR1407044 3 0.4256 0.219 0.000 0.000 0.564 0.436 0.000
#> SRR1078392 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1436468 3 0.1310 0.863 0.000 0.000 0.956 0.020 0.024
#> SRR1476125 4 0.4572 0.560 0.000 0.280 0.000 0.684 0.036
#> SRR1418747 4 0.0794 0.938 0.000 0.000 0.028 0.972 0.000
#> SRR1318089 5 0.0963 0.956 0.000 0.000 0.036 0.000 0.964
#> SRR1444370 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1460337 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1469062 3 0.3395 0.646 0.000 0.000 0.764 0.236 0.000
#> SRR1388459 3 0.0794 0.858 0.000 0.000 0.972 0.000 0.028
#> SRR1416841 5 0.0963 0.956 0.000 0.000 0.036 0.000 0.964
#> SRR1473778 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1419561 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1339987 4 0.0794 0.938 0.000 0.000 0.028 0.972 0.000
#> SRR1469662 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1456492 3 0.2929 0.727 0.000 0.000 0.820 0.000 0.180
#> SRR1389955 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1429540 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1356057 3 0.1478 0.852 0.000 0.000 0.936 0.064 0.000
#> SRR1328715 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1429429 5 0.0963 0.956 0.000 0.000 0.036 0.000 0.964
#> SRR1325201 4 0.1836 0.901 0.000 0.032 0.000 0.932 0.036
#> SRR1382978 5 0.0963 0.956 0.000 0.000 0.036 0.000 0.964
#> SRR1406348 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 3 0.0963 0.855 0.000 0.000 0.964 0.036 0.000
#> SRR1418225 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1418473 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 4 0.0794 0.938 0.000 0.000 0.028 0.972 0.000
#> SRR1431823 3 0.0794 0.858 0.000 0.000 0.972 0.000 0.028
#> SRR1447916 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1445618 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1081589 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1097245 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1404339 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 4 0.0000 0.949 0.000 0.000 0.000 1.000 0.000
#> SRR1406135 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000
#> SRR1413307 3 0.1410 0.854 0.000 0.000 0.940 0.060 0.000
#> SRR1397720 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0162 0.946 0.004 0.000 0.000 0.996 0.000
#> SRR1381185 4 0.3561 0.632 0.000 0.000 0.260 0.740 0.000
#> SRR1100608 2 0.6825 0.450 0.000 0.552 0.200 0.212 0.036
#> SRR1386927 2 0.0000 0.938 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.0963 0.855 0.000 0.000 0.964 0.036 0.000
#> SRR1486322 3 0.3480 0.595 0.000 0.000 0.752 0.000 0.248
#> SRR1080790 4 0.0794 0.938 0.000 0.000 0.028 0.972 0.000
#> SRR1459980 1 0.0955 0.944 0.968 0.000 0.028 0.004 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 6 0.3747 0.670 0.000 0.000 0.000 0.396 0.000 0.604
#> SRR1405147 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1315412 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1071105 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1432868 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1330723 2 0.0632 0.973 0.000 0.976 0.024 0.000 0.000 0.000
#> SRR1475324 6 0.0000 0.839 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1340260 1 0.3774 0.279 0.592 0.000 0.000 0.408 0.000 0.000
#> SRR1376450 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1321897 3 0.0000 0.828 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1445194 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1443308 3 0.4371 0.597 0.000 0.000 0.580 0.392 0.000 0.028
#> SRR1400931 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416188 3 0.4322 0.612 0.000 0.000 0.600 0.372 0.000 0.028
#> SRR1407044 3 0.0891 0.812 0.000 0.000 0.968 0.008 0.024 0.000
#> SRR1078392 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1436468 3 0.1176 0.827 0.000 0.000 0.956 0.020 0.000 0.024
#> SRR1476125 5 0.0000 0.640 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1418747 4 0.4379 0.823 0.000 0.000 0.028 0.576 0.396 0.000
#> SRR1318089 6 0.3747 0.670 0.000 0.000 0.000 0.396 0.000 0.604
#> SRR1444370 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1460337 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1469062 3 0.0891 0.812 0.000 0.000 0.968 0.008 0.024 0.000
#> SRR1388459 3 0.4379 0.594 0.000 0.000 0.576 0.396 0.000 0.028
#> SRR1416841 6 0.0000 0.839 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1473778 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1419561 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1339987 4 0.4379 0.823 0.000 0.000 0.028 0.576 0.396 0.000
#> SRR1469662 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1456492 3 0.4886 0.547 0.000 0.000 0.540 0.396 0.000 0.064
#> SRR1389955 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1429540 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1356057 3 0.0713 0.824 0.000 0.000 0.972 0.028 0.000 0.000
#> SRR1328715 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1429429 6 0.0000 0.839 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1325201 5 0.0146 0.638 0.000 0.000 0.000 0.004 0.996 0.000
#> SRR1382978 6 0.0000 0.839 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1406348 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 3 0.0000 0.828 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1418225 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1418473 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 4 0.4379 0.823 0.000 0.000 0.028 0.576 0.396 0.000
#> SRR1431823 3 0.0713 0.828 0.000 0.000 0.972 0.000 0.000 0.028
#> SRR1447916 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1445618 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1081589 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1097245 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1404339 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1406135 1 0.0000 0.974 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1413307 3 0.0713 0.824 0.000 0.000 0.972 0.028 0.000 0.000
#> SRR1397720 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.3747 0.850 0.000 0.000 0.000 0.604 0.396 0.000
#> SRR1381185 5 0.6104 -0.230 0.000 0.000 0.296 0.328 0.376 0.000
#> SRR1100608 5 0.2340 0.561 0.000 0.000 0.148 0.000 0.852 0.000
#> SRR1386927 2 0.0000 0.997 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.0000 0.828 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1486322 4 0.6062 -0.570 0.000 0.000 0.336 0.396 0.000 0.268
#> SRR1080790 4 0.4379 0.823 0.000 0.000 0.028 0.576 0.396 0.000
#> SRR1459980 1 0.0972 0.939 0.964 0.000 0.028 0.008 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "mclust"]
# you can also extract it by
# res = res_list["ATC:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17667 rows and 70 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.969 0.946 0.965 0.4182 0.574 0.574
#> 3 3 0.749 0.891 0.916 0.5457 0.757 0.576
#> 4 4 0.907 0.912 0.960 0.0717 0.888 0.699
#> 5 5 0.743 0.642 0.833 0.1136 0.880 0.623
#> 6 6 0.775 0.757 0.855 0.0484 0.906 0.630
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
#> SRR1433493 1 0.3431 0.958 0.936 0.064
#> SRR1405147 1 0.0000 0.971 1.000 0.000
#> SRR1315412 2 0.0000 0.945 0.000 1.000
#> SRR1338384 1 0.0000 0.971 1.000 0.000
#> SRR1071105 2 0.9754 0.435 0.408 0.592
#> SRR1432868 2 0.0000 0.945 0.000 1.000
#> SRR1454480 2 0.4298 0.900 0.088 0.912
#> SRR1330723 2 0.0000 0.945 0.000 1.000
#> SRR1475324 1 0.3431 0.958 0.936 0.064
#> SRR1340260 1 0.0000 0.971 1.000 0.000
#> SRR1376450 1 0.0000 0.971 1.000 0.000
#> SRR1321897 1 0.3431 0.958 0.936 0.064
#> SRR1445194 1 0.0000 0.971 1.000 0.000
#> SRR1443308 1 0.3431 0.958 0.936 0.064
#> SRR1400931 1 0.0000 0.971 1.000 0.000
#> SRR1416188 1 0.3431 0.958 0.936 0.064
#> SRR1407044 1 0.2236 0.966 0.964 0.036
#> SRR1078392 1 0.0000 0.971 1.000 0.000
#> SRR1436468 1 0.3431 0.958 0.936 0.064
#> SRR1476125 2 0.0000 0.945 0.000 1.000
#> SRR1418747 1 0.1843 0.968 0.972 0.028
#> SRR1318089 1 0.3431 0.958 0.936 0.064
#> SRR1444370 1 0.0000 0.971 1.000 0.000
#> SRR1348929 2 0.0000 0.945 0.000 1.000
#> SRR1385690 1 0.0376 0.971 0.996 0.004
#> SRR1460337 1 0.0000 0.971 1.000 0.000
#> SRR1469062 1 0.3431 0.958 0.936 0.064
#> SRR1388459 1 0.3431 0.958 0.936 0.064
#> SRR1416841 1 0.3431 0.958 0.936 0.064
#> SRR1473778 1 0.2043 0.967 0.968 0.032
#> SRR1419561 1 0.0000 0.971 1.000 0.000
#> SRR1339987 1 0.0672 0.970 0.992 0.008
#> SRR1469662 1 0.0000 0.971 1.000 0.000
#> SRR1432958 1 0.0000 0.971 1.000 0.000
#> SRR1479198 1 0.0000 0.971 1.000 0.000
#> SRR1353600 1 0.0000 0.971 1.000 0.000
#> SRR1456492 1 0.3431 0.958 0.936 0.064
#> SRR1389955 1 0.0000 0.971 1.000 0.000
#> SRR1429540 1 0.0000 0.971 1.000 0.000
#> SRR1356057 1 0.3431 0.958 0.936 0.064
#> SRR1328715 1 0.0000 0.971 1.000 0.000
#> SRR1429429 1 0.3431 0.958 0.936 0.064
#> SRR1325201 2 0.0000 0.945 0.000 1.000
#> SRR1382978 1 0.3431 0.958 0.936 0.064
#> SRR1406348 2 0.0000 0.945 0.000 1.000
#> SRR1469390 2 0.0000 0.945 0.000 1.000
#> SRR1376380 1 0.2043 0.967 0.968 0.032
#> SRR1418225 2 0.3733 0.910 0.072 0.928
#> SRR1418473 2 0.0000 0.945 0.000 1.000
#> SRR1376741 1 0.0000 0.971 1.000 0.000
#> SRR1431823 1 0.3431 0.958 0.936 0.064
#> SRR1447916 2 0.0000 0.945 0.000 1.000
#> SRR1458643 2 0.7139 0.819 0.196 0.804
#> SRR1445618 1 0.0000 0.971 1.000 0.000
#> SRR1081589 2 0.7056 0.823 0.192 0.808
#> SRR1097245 1 0.0000 0.971 1.000 0.000
#> SRR1416141 1 0.0000 0.971 1.000 0.000
#> SRR1404339 2 0.0000 0.945 0.000 1.000
#> SRR1478614 1 0.0000 0.971 1.000 0.000
#> SRR1406135 1 0.0000 0.971 1.000 0.000
#> SRR1413307 2 0.4298 0.900 0.088 0.912
#> SRR1397720 2 0.0000 0.945 0.000 1.000
#> SRR1358391 2 0.4562 0.893 0.096 0.904
#> SRR1381185 1 0.3431 0.958 0.936 0.064
#> SRR1100608 2 0.0000 0.945 0.000 1.000
#> SRR1386927 2 0.0000 0.945 0.000 1.000
#> SRR1331771 1 0.3431 0.958 0.936 0.064
#> SRR1486322 1 0.3431 0.958 0.936 0.064
#> SRR1080790 1 0.0672 0.970 0.992 0.008
#> SRR1459980 1 0.0000 0.971 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.2878 0.952 0.096 0.000 0.904
#> SRR1405147 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1315412 2 0.0000 0.907 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1071105 2 0.6975 0.784 0.124 0.732 0.144
#> SRR1432868 2 0.1643 0.904 0.000 0.956 0.044
#> SRR1454480 2 0.4887 0.810 0.000 0.772 0.228
#> SRR1330723 2 0.2625 0.902 0.000 0.916 0.084
#> SRR1475324 3 0.2796 0.952 0.092 0.000 0.908
#> SRR1340260 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1321897 3 0.3116 0.949 0.108 0.000 0.892
#> SRR1445194 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1443308 3 0.2796 0.948 0.092 0.000 0.908
#> SRR1400931 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1416188 3 0.2796 0.952 0.092 0.000 0.908
#> SRR1407044 3 0.4931 0.834 0.232 0.000 0.768
#> SRR1078392 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1436468 3 0.3791 0.877 0.060 0.048 0.892
#> SRR1476125 2 0.2165 0.901 0.000 0.936 0.064
#> SRR1418747 3 0.5397 0.761 0.280 0.000 0.720
#> SRR1318089 3 0.2796 0.952 0.092 0.000 0.908
#> SRR1444370 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1348929 2 0.1643 0.904 0.000 0.956 0.044
#> SRR1385690 1 0.0592 0.944 0.988 0.012 0.000
#> SRR1460337 1 0.1643 0.909 0.956 0.000 0.044
#> SRR1469062 3 0.2711 0.945 0.088 0.000 0.912
#> SRR1388459 3 0.2959 0.952 0.100 0.000 0.900
#> SRR1416841 3 0.2796 0.952 0.092 0.000 0.908
#> SRR1473778 1 0.3879 0.769 0.848 0.000 0.152
#> SRR1419561 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1339987 1 0.6308 -0.220 0.508 0.000 0.492
#> SRR1469662 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1353600 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1456492 3 0.2796 0.952 0.092 0.000 0.908
#> SRR1389955 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1429540 1 0.0747 0.940 0.984 0.000 0.016
#> SRR1356057 3 0.3482 0.939 0.128 0.000 0.872
#> SRR1328715 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1429429 3 0.2796 0.952 0.092 0.000 0.908
#> SRR1325201 2 0.3116 0.901 0.000 0.892 0.108
#> SRR1382978 3 0.2796 0.952 0.092 0.000 0.908
#> SRR1406348 2 0.1643 0.904 0.000 0.956 0.044
#> SRR1469390 2 0.0000 0.907 0.000 1.000 0.000
#> SRR1376380 3 0.5397 0.760 0.280 0.000 0.720
#> SRR1418225 2 0.4887 0.810 0.000 0.772 0.228
#> SRR1418473 2 0.0000 0.907 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1431823 3 0.3038 0.951 0.104 0.000 0.896
#> SRR1447916 2 0.0000 0.907 0.000 1.000 0.000
#> SRR1458643 2 0.5955 0.780 0.180 0.772 0.048
#> SRR1445618 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1081589 2 0.6001 0.784 0.176 0.772 0.052
#> SRR1097245 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1404339 2 0.1643 0.904 0.000 0.956 0.044
#> SRR1478614 1 0.0424 0.948 0.992 0.000 0.008
#> SRR1406135 1 0.0000 0.955 1.000 0.000 0.000
#> SRR1413307 2 0.4887 0.810 0.000 0.772 0.228
#> SRR1397720 2 0.1643 0.904 0.000 0.956 0.044
#> SRR1358391 2 0.4887 0.810 0.000 0.772 0.228
#> SRR1381185 3 0.4121 0.908 0.168 0.000 0.832
#> SRR1100608 2 0.2165 0.901 0.000 0.936 0.064
#> SRR1386927 2 0.0000 0.907 0.000 1.000 0.000
#> SRR1331771 3 0.3619 0.934 0.136 0.000 0.864
#> SRR1486322 3 0.2796 0.952 0.092 0.000 0.908
#> SRR1080790 1 0.5529 0.479 0.704 0.000 0.296
#> SRR1459980 1 0.0000 0.955 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1315412 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1071105 1 0.2300 0.896 0.920 0.000 0.016 0.064
#> SRR1432868 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.0592 0.880 0.000 0.000 0.016 0.984
#> SRR1330723 2 0.2011 0.924 0.000 0.920 0.000 0.080
#> SRR1475324 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1376450 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1321897 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1445194 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1443308 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1400931 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1416188 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.3024 0.771 0.148 0.000 0.852 0.000
#> SRR1078392 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1436468 1 0.5102 0.660 0.748 0.000 0.188 0.064
#> SRR1476125 2 0.3123 0.865 0.000 0.844 0.000 0.156
#> SRR1418747 3 0.4477 0.539 0.312 0.000 0.688 0.000
#> SRR1318089 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1348929 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1385690 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1460337 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1469062 3 0.3024 0.794 0.000 0.000 0.852 0.148
#> SRR1388459 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.1211 0.936 0.960 0.000 0.040 0.000
#> SRR1419561 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1339987 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1469662 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1432958 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1479198 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1353600 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1456492 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1389955 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1429540 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1356057 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1328715 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1429429 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.2011 0.924 0.000 0.920 0.000 0.080
#> SRR1382978 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1376380 3 0.3356 0.734 0.176 0.000 0.824 0.000
#> SRR1418225 4 0.0592 0.880 0.000 0.000 0.016 0.984
#> SRR1418473 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1431823 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1447916 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.3528 0.779 0.192 0.000 0.000 0.808
#> SRR1445618 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1081589 4 0.3074 0.821 0.152 0.000 0.000 0.848
#> SRR1097245 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1416141 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1404339 2 0.0336 0.962 0.000 0.992 0.000 0.008
#> SRR1478614 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1406135 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1413307 4 0.1792 0.863 0.000 0.000 0.068 0.932
#> SRR1397720 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.1510 0.886 0.028 0.000 0.016 0.956
#> SRR1381185 1 0.4621 0.737 0.796 0.000 0.128 0.076
#> SRR1100608 2 0.3123 0.865 0.000 0.844 0.000 0.156
#> SRR1386927 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.1474 0.868 0.052 0.000 0.948 0.000
#> SRR1486322 3 0.0000 0.910 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.4866 0.386 0.404 0.000 0.596 0.000
#> SRR1459980 1 0.0000 0.977 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
#> SRR1433493 3 0.0000 0.8823 0.000 0.000 1.000 0.000 0.000
#> SRR1405147 5 0.4294 0.2062 0.468 0.000 0.000 0.000 0.532
#> SRR1315412 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.4114 0.2382 0.624 0.000 0.000 0.000 0.376
#> SRR1071105 5 0.6519 -0.2243 0.400 0.000 0.000 0.192 0.408
#> SRR1432868 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0162 0.9316 0.000 0.000 0.000 0.996 0.004
#> SRR1330723 2 0.3586 0.7979 0.000 0.792 0.000 0.188 0.020
#> SRR1475324 3 0.0162 0.8821 0.000 0.000 0.996 0.004 0.000
#> SRR1340260 1 0.0794 0.7790 0.972 0.000 0.000 0.000 0.028
#> SRR1376450 1 0.0880 0.7759 0.968 0.000 0.000 0.000 0.032
#> SRR1321897 3 0.2377 0.8010 0.000 0.000 0.872 0.000 0.128
#> SRR1445194 1 0.0000 0.7831 1.000 0.000 0.000 0.000 0.000
#> SRR1443308 3 0.1270 0.8596 0.000 0.000 0.948 0.000 0.052
#> SRR1400931 1 0.4074 0.4366 0.636 0.000 0.000 0.000 0.364
#> SRR1416188 3 0.1043 0.8663 0.000 0.000 0.960 0.000 0.040
#> SRR1407044 5 0.4305 -0.1102 0.000 0.000 0.488 0.000 0.512
#> SRR1078392 1 0.3336 0.5764 0.772 0.000 0.000 0.000 0.228
#> SRR1436468 5 0.5740 -0.0545 0.148 0.000 0.012 0.184 0.656
#> SRR1476125 2 0.3366 0.7911 0.000 0.784 0.000 0.212 0.004
#> SRR1418747 5 0.4341 0.1442 0.004 0.000 0.404 0.000 0.592
#> SRR1318089 3 0.0000 0.8823 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.0162 0.7829 0.996 0.000 0.000 0.000 0.004
#> SRR1348929 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 1 0.2424 0.6927 0.868 0.000 0.000 0.000 0.132
#> SRR1460337 1 0.4192 0.4096 0.596 0.000 0.000 0.000 0.404
#> SRR1469062 3 0.6112 0.1959 0.000 0.000 0.516 0.140 0.344
#> SRR1388459 3 0.0000 0.8823 0.000 0.000 1.000 0.000 0.000
#> SRR1416841 3 0.0162 0.8821 0.000 0.000 0.996 0.004 0.000
#> SRR1473778 5 0.4331 0.3115 0.400 0.000 0.004 0.000 0.596
#> SRR1419561 1 0.3999 0.3345 0.656 0.000 0.000 0.000 0.344
#> SRR1339987 5 0.4448 0.1786 0.480 0.000 0.004 0.000 0.516
#> SRR1469662 1 0.2127 0.7290 0.892 0.000 0.000 0.000 0.108
#> SRR1432958 1 0.0000 0.7831 1.000 0.000 0.000 0.000 0.000
#> SRR1479198 1 0.3983 0.3388 0.660 0.000 0.000 0.000 0.340
#> SRR1353600 1 0.0000 0.7831 1.000 0.000 0.000 0.000 0.000
#> SRR1456492 3 0.0162 0.8817 0.000 0.000 0.996 0.000 0.004
#> SRR1389955 1 0.2424 0.7088 0.868 0.000 0.000 0.000 0.132
#> SRR1429540 1 0.3508 0.6090 0.748 0.000 0.000 0.000 0.252
#> SRR1356057 3 0.5368 0.1308 0.028 0.000 0.540 0.016 0.416
#> SRR1328715 1 0.1197 0.7715 0.952 0.000 0.000 0.000 0.048
#> SRR1429429 3 0.0162 0.8821 0.000 0.000 0.996 0.004 0.000
#> SRR1325201 2 0.3132 0.8193 0.000 0.820 0.000 0.172 0.008
#> SRR1382978 3 0.0162 0.8821 0.000 0.000 0.996 0.004 0.000
#> SRR1406348 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 5 0.4227 0.1064 0.000 0.000 0.420 0.000 0.580
#> SRR1418225 4 0.0162 0.9316 0.000 0.000 0.000 0.996 0.004
#> SRR1418473 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 5 0.4287 0.2201 0.460 0.000 0.000 0.000 0.540
#> SRR1431823 3 0.3039 0.7118 0.000 0.000 0.808 0.000 0.192
#> SRR1447916 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.2648 0.8017 0.152 0.000 0.000 0.848 0.000
#> SRR1445618 1 0.0162 0.7817 0.996 0.000 0.000 0.000 0.004
#> SRR1081589 4 0.1792 0.8811 0.084 0.000 0.000 0.916 0.000
#> SRR1097245 1 0.0162 0.7817 0.996 0.000 0.000 0.000 0.004
#> SRR1416141 1 0.0000 0.7831 1.000 0.000 0.000 0.000 0.000
#> SRR1404339 2 0.0703 0.9205 0.000 0.976 0.000 0.024 0.000
#> SRR1478614 1 0.4150 0.4082 0.612 0.000 0.000 0.000 0.388
#> SRR1406135 1 0.0000 0.7831 1.000 0.000 0.000 0.000 0.000
#> SRR1413307 4 0.0162 0.9316 0.000 0.000 0.000 0.996 0.004
#> SRR1397720 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1358391 4 0.0451 0.9306 0.008 0.000 0.000 0.988 0.004
#> SRR1381185 5 0.7187 0.2839 0.400 0.000 0.064 0.116 0.420
#> SRR1100608 2 0.3366 0.7911 0.000 0.784 0.000 0.212 0.004
#> SRR1386927 2 0.0000 0.9310 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 5 0.5088 0.0727 0.036 0.000 0.436 0.000 0.528
#> SRR1486322 3 0.0000 0.8823 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 5 0.4446 0.1565 0.008 0.000 0.400 0.000 0.592
#> SRR1459980 5 0.4443 0.1998 0.472 0.000 0.004 0.000 0.524
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.855 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 5 0.3062 0.775 0.024 0.000 0.000 0.000 0.816 0.160
#> SRR1315412 2 0.0146 0.919 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1338384 5 0.4589 0.689 0.132 0.000 0.000 0.000 0.696 0.172
#> SRR1071105 6 0.4988 0.402 0.136 0.000 0.000 0.164 0.016 0.684
#> SRR1432868 2 0.0000 0.920 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0363 0.864 0.000 0.000 0.000 0.988 0.012 0.000
#> SRR1330723 6 0.5866 0.436 0.000 0.312 0.000 0.160 0.012 0.516
#> SRR1475324 3 0.0777 0.852 0.000 0.000 0.972 0.004 0.000 0.024
#> SRR1340260 1 0.3017 0.798 0.816 0.000 0.000 0.000 0.020 0.164
#> SRR1376450 1 0.2653 0.809 0.844 0.000 0.000 0.000 0.012 0.144
#> SRR1321897 3 0.5159 0.297 0.000 0.000 0.480 0.004 0.444 0.072
#> SRR1445194 1 0.0713 0.827 0.972 0.000 0.000 0.000 0.000 0.028
#> SRR1443308 3 0.3534 0.750 0.000 0.000 0.800 0.000 0.124 0.076
#> SRR1400931 1 0.0622 0.822 0.980 0.000 0.000 0.008 0.000 0.012
#> SRR1416188 3 0.2912 0.790 0.000 0.000 0.852 0.000 0.076 0.072
#> SRR1407044 5 0.3460 0.588 0.000 0.000 0.164 0.004 0.796 0.036
#> SRR1078392 5 0.5683 0.266 0.348 0.000 0.000 0.000 0.484 0.168
#> SRR1436468 1 0.7106 -0.124 0.392 0.000 0.000 0.116 0.156 0.336
#> SRR1476125 2 0.3259 0.669 0.000 0.772 0.000 0.216 0.012 0.000
#> SRR1418747 5 0.0291 0.782 0.000 0.000 0.000 0.004 0.992 0.004
#> SRR1318089 3 0.0000 0.855 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.2520 0.810 0.844 0.000 0.000 0.000 0.004 0.152
#> SRR1348929 2 0.0000 0.920 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 1 0.4179 0.661 0.744 0.000 0.000 0.012 0.188 0.056
#> SRR1460337 1 0.2778 0.806 0.824 0.000 0.000 0.000 0.008 0.168
#> SRR1469062 5 0.4136 0.679 0.000 0.000 0.036 0.124 0.780 0.060
#> SRR1388459 3 0.0717 0.855 0.000 0.000 0.976 0.000 0.016 0.008
#> SRR1416841 3 0.0922 0.853 0.000 0.000 0.968 0.004 0.004 0.024
#> SRR1473778 5 0.1152 0.788 0.000 0.000 0.000 0.004 0.952 0.044
#> SRR1419561 5 0.5296 0.548 0.236 0.000 0.000 0.000 0.596 0.168
#> SRR1339987 5 0.2750 0.784 0.020 0.000 0.000 0.000 0.844 0.136
#> SRR1469662 1 0.4520 0.705 0.704 0.000 0.000 0.000 0.128 0.168
#> SRR1432958 1 0.0405 0.825 0.988 0.000 0.000 0.008 0.000 0.004
#> SRR1479198 5 0.4575 0.693 0.124 0.000 0.000 0.000 0.696 0.180
#> SRR1353600 1 0.0520 0.824 0.984 0.000 0.000 0.008 0.000 0.008
#> SRR1456492 3 0.0909 0.855 0.000 0.000 0.968 0.000 0.020 0.012
#> SRR1389955 1 0.4232 0.739 0.732 0.000 0.000 0.000 0.100 0.168
#> SRR1429540 1 0.4110 0.752 0.712 0.000 0.000 0.000 0.052 0.236
#> SRR1356057 5 0.2345 0.743 0.000 0.000 0.020 0.020 0.900 0.060
#> SRR1328715 1 0.3923 0.768 0.748 0.000 0.000 0.000 0.060 0.192
#> SRR1429429 3 0.0922 0.853 0.000 0.000 0.968 0.004 0.004 0.024
#> SRR1325201 2 0.3488 0.711 0.000 0.800 0.000 0.160 0.012 0.028
#> SRR1382978 3 0.0922 0.853 0.000 0.000 0.968 0.004 0.004 0.024
#> SRR1406348 2 0.0000 0.920 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0146 0.919 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1376380 5 0.0146 0.780 0.000 0.000 0.000 0.004 0.996 0.000
#> SRR1418225 4 0.0363 0.864 0.000 0.000 0.000 0.988 0.012 0.000
#> SRR1418473 2 0.0000 0.920 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 5 0.2830 0.783 0.020 0.000 0.000 0.000 0.836 0.144
#> SRR1431823 3 0.5116 0.397 0.000 0.000 0.524 0.004 0.400 0.072
#> SRR1447916 2 0.0146 0.919 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1458643 4 0.2743 0.734 0.164 0.000 0.000 0.828 0.000 0.008
#> SRR1445618 1 0.0520 0.827 0.984 0.000 0.000 0.008 0.000 0.008
#> SRR1081589 4 0.2743 0.734 0.164 0.000 0.000 0.828 0.000 0.008
#> SRR1097245 1 0.0520 0.824 0.984 0.000 0.000 0.008 0.000 0.008
#> SRR1416141 1 0.0520 0.824 0.984 0.000 0.000 0.008 0.000 0.008
#> SRR1404339 2 0.0547 0.906 0.000 0.980 0.000 0.020 0.000 0.000
#> SRR1478614 1 0.1204 0.803 0.944 0.000 0.000 0.000 0.000 0.056
#> SRR1406135 1 0.0405 0.825 0.988 0.000 0.000 0.008 0.000 0.004
#> SRR1413307 4 0.0363 0.864 0.000 0.000 0.000 0.988 0.012 0.000
#> SRR1397720 2 0.0000 0.920 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0508 0.863 0.004 0.000 0.000 0.984 0.012 0.000
#> SRR1381185 5 0.2883 0.747 0.000 0.000 0.008 0.092 0.860 0.040
#> SRR1100608 2 0.3259 0.669 0.000 0.772 0.000 0.216 0.012 0.000
#> SRR1386927 2 0.0000 0.920 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 5 0.0951 0.767 0.000 0.000 0.008 0.004 0.968 0.020
#> SRR1486322 3 0.0622 0.856 0.000 0.000 0.980 0.000 0.012 0.008
#> SRR1080790 5 0.1390 0.789 0.016 0.000 0.004 0.000 0.948 0.032
#> SRR1459980 5 0.2983 0.782 0.032 0.000 0.000 0.000 0.832 0.136
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 17667 rows and 70 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.825 0.936 0.970 0.3528 0.658 0.658
#> 3 3 0.974 0.939 0.978 0.6183 0.762 0.639
#> 4 4 0.690 0.780 0.879 0.2866 0.812 0.572
#> 5 5 0.788 0.792 0.889 0.0759 0.892 0.628
#> 6 6 0.777 0.702 0.838 0.0364 0.945 0.747
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
#> SRR1433493 1 0.0000 0.970 1.000 0.000
#> SRR1405147 1 0.0000 0.970 1.000 0.000
#> SRR1315412 2 0.0000 0.962 0.000 1.000
#> SRR1338384 1 0.0000 0.970 1.000 0.000
#> SRR1071105 2 1.0000 -0.112 0.500 0.500
#> SRR1432868 2 0.0000 0.962 0.000 1.000
#> SRR1454480 1 0.2778 0.943 0.952 0.048
#> SRR1330723 2 0.0000 0.962 0.000 1.000
#> SRR1475324 1 0.0000 0.970 1.000 0.000
#> SRR1340260 1 0.0376 0.969 0.996 0.004
#> SRR1376450 1 0.0000 0.970 1.000 0.000
#> SRR1321897 1 0.0000 0.970 1.000 0.000
#> SRR1445194 1 0.1414 0.961 0.980 0.020
#> SRR1443308 1 0.0000 0.970 1.000 0.000
#> SRR1400931 1 0.5842 0.862 0.860 0.140
#> SRR1416188 1 0.0000 0.970 1.000 0.000
#> SRR1407044 1 0.0000 0.970 1.000 0.000
#> SRR1078392 1 0.0000 0.970 1.000 0.000
#> SRR1436468 1 0.0000 0.970 1.000 0.000
#> SRR1476125 2 0.0000 0.962 0.000 1.000
#> SRR1418747 1 0.0000 0.970 1.000 0.000
#> SRR1318089 1 0.0000 0.970 1.000 0.000
#> SRR1444370 1 0.0938 0.966 0.988 0.012
#> SRR1348929 2 0.0000 0.962 0.000 1.000
#> SRR1385690 1 0.0376 0.969 0.996 0.004
#> SRR1460337 1 0.1843 0.957 0.972 0.028
#> SRR1469062 1 0.0000 0.970 1.000 0.000
#> SRR1388459 1 0.0000 0.970 1.000 0.000
#> SRR1416841 1 0.0000 0.970 1.000 0.000
#> SRR1473778 1 0.0000 0.970 1.000 0.000
#> SRR1419561 1 0.0000 0.970 1.000 0.000
#> SRR1339987 1 0.0000 0.970 1.000 0.000
#> SRR1469662 1 0.0938 0.966 0.988 0.012
#> SRR1432958 1 0.1184 0.964 0.984 0.016
#> SRR1479198 1 0.0000 0.970 1.000 0.000
#> SRR1353600 1 0.6048 0.854 0.852 0.148
#> SRR1456492 1 0.0000 0.970 1.000 0.000
#> SRR1389955 1 0.0376 0.969 0.996 0.004
#> SRR1429540 1 0.0938 0.966 0.988 0.012
#> SRR1356057 1 0.0000 0.970 1.000 0.000
#> SRR1328715 1 0.0376 0.969 0.996 0.004
#> SRR1429429 1 0.0000 0.970 1.000 0.000
#> SRR1325201 2 0.0000 0.962 0.000 1.000
#> SRR1382978 1 0.0000 0.970 1.000 0.000
#> SRR1406348 2 0.0000 0.962 0.000 1.000
#> SRR1469390 2 0.0000 0.962 0.000 1.000
#> SRR1376380 1 0.0000 0.970 1.000 0.000
#> SRR1418225 1 0.7219 0.788 0.800 0.200
#> SRR1418473 2 0.0000 0.962 0.000 1.000
#> SRR1376741 1 0.0000 0.970 1.000 0.000
#> SRR1431823 1 0.0000 0.970 1.000 0.000
#> SRR1447916 2 0.0000 0.962 0.000 1.000
#> SRR1458643 1 0.6048 0.854 0.852 0.148
#> SRR1445618 1 0.1414 0.961 0.980 0.020
#> SRR1081589 1 0.7219 0.788 0.800 0.200
#> SRR1097245 1 0.3879 0.921 0.924 0.076
#> SRR1416141 1 0.4939 0.894 0.892 0.108
#> SRR1404339 2 0.0000 0.962 0.000 1.000
#> SRR1478614 1 0.5842 0.862 0.860 0.140
#> SRR1406135 1 0.1184 0.964 0.984 0.016
#> SRR1413307 1 0.4690 0.901 0.900 0.100
#> SRR1397720 2 0.0000 0.962 0.000 1.000
#> SRR1358391 1 0.5737 0.867 0.864 0.136
#> SRR1381185 1 0.0000 0.970 1.000 0.000
#> SRR1100608 2 0.0000 0.962 0.000 1.000
#> SRR1386927 2 0.0000 0.962 0.000 1.000
#> SRR1331771 1 0.0000 0.970 1.000 0.000
#> SRR1486322 1 0.0000 0.970 1.000 0.000
#> SRR1080790 1 0.0000 0.970 1.000 0.000
#> SRR1459980 1 0.0000 0.970 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR1433493 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1405147 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1315412 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1338384 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1071105 2 0.6308 0.0947 0.492 0.508 0.000
#> SRR1432868 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1454480 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1330723 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1475324 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1340260 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1376450 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1321897 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1445194 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1443308 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1400931 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1416188 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1407044 1 0.6045 0.3701 0.620 0.000 0.380
#> SRR1078392 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1436468 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1476125 2 0.4346 0.7330 0.184 0.816 0.000
#> SRR1418747 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1318089 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1444370 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1348929 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1385690 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1460337 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1469062 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1388459 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1416841 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1473778 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1419561 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1339987 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1469662 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1432958 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1479198 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1353600 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1456492 3 0.0424 0.9677 0.008 0.000 0.992
#> SRR1389955 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1429540 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1356057 1 0.0424 0.9812 0.992 0.000 0.008
#> SRR1328715 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1429429 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1325201 2 0.1031 0.8906 0.024 0.976 0.000
#> SRR1382978 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1406348 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1469390 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1376380 1 0.0747 0.9736 0.984 0.000 0.016
#> SRR1418225 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1418473 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1376741 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1431823 3 0.3412 0.8255 0.124 0.000 0.876
#> SRR1447916 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1458643 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1445618 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1081589 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1097245 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1416141 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1404339 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1478614 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1406135 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1413307 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1397720 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1358391 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1381185 1 0.0000 0.9888 1.000 0.000 0.000
#> SRR1100608 2 0.4555 0.7144 0.200 0.800 0.000
#> SRR1386927 2 0.0000 0.9090 0.000 1.000 0.000
#> SRR1331771 3 0.2878 0.8651 0.096 0.000 0.904
#> SRR1486322 3 0.0000 0.9749 0.000 0.000 1.000
#> SRR1080790 1 0.0592 0.9775 0.988 0.000 0.012
#> SRR1459980 1 0.0000 0.9888 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR1433493 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1405147 1 0.1637 0.7714 0.940 0.000 0.000 0.060
#> SRR1315412 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1338384 1 0.4661 0.5935 0.652 0.000 0.000 0.348
#> SRR1071105 2 0.4524 0.6925 0.204 0.768 0.000 0.028
#> SRR1432868 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1454480 4 0.1022 0.8887 0.032 0.000 0.000 0.968
#> SRR1330723 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1475324 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1340260 1 0.0592 0.7688 0.984 0.000 0.000 0.016
#> SRR1376450 1 0.3123 0.7350 0.844 0.000 0.000 0.156
#> SRR1321897 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1445194 1 0.4661 0.5305 0.652 0.000 0.000 0.348
#> SRR1443308 3 0.2469 0.8299 0.000 0.000 0.892 0.108
#> SRR1400931 1 0.2589 0.7778 0.884 0.000 0.000 0.116
#> SRR1416188 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1407044 3 0.2483 0.8458 0.032 0.000 0.916 0.052
#> SRR1078392 1 0.2345 0.7610 0.900 0.000 0.000 0.100
#> SRR1436468 1 0.3726 0.6778 0.788 0.000 0.000 0.212
#> SRR1476125 2 0.2976 0.8469 0.008 0.872 0.000 0.120
#> SRR1418747 1 0.3219 0.7615 0.836 0.000 0.000 0.164
#> SRR1318089 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1444370 1 0.2408 0.7713 0.896 0.000 0.000 0.104
#> SRR1348929 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1385690 4 0.2216 0.8752 0.092 0.000 0.000 0.908
#> SRR1460337 1 0.0188 0.7655 0.996 0.000 0.000 0.004
#> SRR1469062 4 0.1584 0.8711 0.036 0.000 0.012 0.952
#> SRR1388459 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1416841 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1473778 1 0.3278 0.7472 0.864 0.000 0.020 0.116
#> SRR1419561 4 0.4543 0.5367 0.324 0.000 0.000 0.676
#> SRR1339987 1 0.4304 0.6233 0.716 0.000 0.000 0.284
#> SRR1469662 1 0.4040 0.6652 0.752 0.000 0.000 0.248
#> SRR1432958 1 0.3764 0.7403 0.784 0.000 0.000 0.216
#> SRR1479198 1 0.4888 0.3588 0.588 0.000 0.000 0.412
#> SRR1353600 1 0.2647 0.7727 0.880 0.000 0.000 0.120
#> SRR1456492 3 0.5395 0.6950 0.172 0.000 0.736 0.092
#> SRR1389955 1 0.4454 0.5886 0.692 0.000 0.000 0.308
#> SRR1429540 1 0.2469 0.7598 0.892 0.000 0.000 0.108
#> SRR1356057 3 0.6854 0.4499 0.172 0.000 0.596 0.232
#> SRR1328715 1 0.0336 0.7670 0.992 0.000 0.000 0.008
#> SRR1429429 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1325201 2 0.2011 0.8806 0.080 0.920 0.000 0.000
#> SRR1382978 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1406348 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1469390 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1376380 1 0.5597 0.0390 0.516 0.000 0.464 0.020
#> SRR1418225 4 0.0921 0.8898 0.028 0.000 0.000 0.972
#> SRR1418473 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1376741 1 0.1940 0.7785 0.924 0.000 0.000 0.076
#> SRR1431823 3 0.1576 0.8754 0.004 0.000 0.948 0.048
#> SRR1447916 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1458643 4 0.2530 0.8638 0.112 0.000 0.000 0.888
#> SRR1445618 1 0.2647 0.7548 0.880 0.000 0.000 0.120
#> SRR1081589 4 0.2589 0.8518 0.116 0.000 0.000 0.884
#> SRR1097245 1 0.4477 0.6526 0.688 0.000 0.000 0.312
#> SRR1416141 1 0.3942 0.6758 0.764 0.000 0.000 0.236
#> SRR1404339 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1478614 1 0.3172 0.7323 0.840 0.000 0.000 0.160
#> SRR1406135 4 0.3649 0.7612 0.204 0.000 0.000 0.796
#> SRR1413307 4 0.0921 0.8898 0.028 0.000 0.000 0.972
#> SRR1397720 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1358391 4 0.1022 0.8904 0.032 0.000 0.000 0.968
#> SRR1381185 4 0.2610 0.8587 0.088 0.000 0.012 0.900
#> SRR1100608 2 0.4011 0.7502 0.008 0.784 0.000 0.208
#> SRR1386927 2 0.0000 0.9482 0.000 1.000 0.000 0.000
#> SRR1331771 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1486322 3 0.0000 0.9058 0.000 0.000 1.000 0.000
#> SRR1080790 3 0.7636 0.0733 0.284 0.000 0.468 0.248
#> SRR1459980 1 0.4697 0.5311 0.644 0.000 0.000 0.356
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR1433493 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1405147 5 0.3452 0.6919 0.244 0.000 0.000 0.000 0.756
#> SRR1315412 2 0.0000 0.9612 0.000 1.000 0.000 0.000 0.000
#> SRR1338384 1 0.4385 0.6660 0.752 0.000 0.000 0.180 0.068
#> SRR1071105 2 0.2843 0.8032 0.144 0.848 0.000 0.008 0.000
#> SRR1432868 2 0.0000 0.9612 0.000 1.000 0.000 0.000 0.000
#> SRR1454480 4 0.0566 0.8439 0.004 0.000 0.000 0.984 0.012
#> SRR1330723 2 0.0162 0.9602 0.000 0.996 0.000 0.000 0.004
#> SRR1475324 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1340260 1 0.2561 0.7516 0.856 0.000 0.000 0.000 0.144
#> SRR1376450 1 0.0162 0.7994 0.996 0.000 0.000 0.000 0.004
#> SRR1321897 3 0.0162 0.9835 0.000 0.000 0.996 0.000 0.004
#> SRR1445194 1 0.1568 0.7987 0.944 0.000 0.000 0.036 0.020
#> SRR1443308 3 0.2068 0.8930 0.000 0.000 0.904 0.092 0.004
#> SRR1400931 1 0.3807 0.6370 0.748 0.000 0.000 0.012 0.240
#> SRR1416188 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1407044 3 0.1721 0.9369 0.016 0.000 0.944 0.020 0.020
#> SRR1078392 1 0.0404 0.7997 0.988 0.000 0.000 0.000 0.012
#> SRR1436468 5 0.1628 0.7387 0.056 0.000 0.000 0.008 0.936
#> SRR1476125 2 0.0955 0.9467 0.000 0.968 0.000 0.004 0.028
#> SRR1418747 5 0.5814 0.1700 0.436 0.000 0.092 0.000 0.472
#> SRR1318089 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1444370 1 0.4182 0.2728 0.600 0.000 0.000 0.000 0.400
#> SRR1348929 2 0.0000 0.9612 0.000 1.000 0.000 0.000 0.000
#> SRR1385690 4 0.2446 0.8105 0.056 0.000 0.000 0.900 0.044
#> SRR1460337 1 0.2773 0.7312 0.836 0.000 0.000 0.000 0.164
#> SRR1469062 4 0.2050 0.8233 0.008 0.000 0.008 0.920 0.064
#> SRR1388459 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1416841 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1473778 5 0.3117 0.7658 0.100 0.000 0.036 0.004 0.860
#> SRR1419561 1 0.4801 0.5246 0.668 0.000 0.000 0.284 0.048
#> SRR1339987 1 0.0898 0.7993 0.972 0.000 0.000 0.020 0.008
#> SRR1469662 1 0.0162 0.7989 0.996 0.000 0.000 0.004 0.000
#> SRR1432958 1 0.4450 0.7112 0.760 0.000 0.000 0.108 0.132
#> SRR1479198 1 0.1168 0.7896 0.960 0.000 0.000 0.008 0.032
#> SRR1353600 1 0.3366 0.6642 0.784 0.000 0.000 0.004 0.212
#> SRR1456492 5 0.2550 0.6914 0.020 0.000 0.084 0.004 0.892
#> SRR1389955 1 0.1018 0.7990 0.968 0.000 0.000 0.016 0.016
#> SRR1429540 5 0.2813 0.7499 0.168 0.000 0.000 0.000 0.832
#> SRR1356057 5 0.4313 0.5059 0.012 0.000 0.276 0.008 0.704
#> SRR1328715 1 0.2127 0.7664 0.892 0.000 0.000 0.000 0.108
#> SRR1429429 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1325201 2 0.1942 0.8965 0.068 0.920 0.000 0.000 0.012
#> SRR1382978 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1406348 2 0.0290 0.9591 0.000 0.992 0.000 0.000 0.008
#> SRR1469390 2 0.0000 0.9612 0.000 1.000 0.000 0.000 0.000
#> SRR1376380 1 0.4415 0.3333 0.604 0.000 0.388 0.000 0.008
#> SRR1418225 4 0.0566 0.8439 0.004 0.000 0.000 0.984 0.012
#> SRR1418473 2 0.0000 0.9612 0.000 1.000 0.000 0.000 0.000
#> SRR1376741 1 0.4224 0.6893 0.744 0.000 0.000 0.040 0.216
#> SRR1431823 3 0.0404 0.9781 0.000 0.000 0.988 0.000 0.012
#> SRR1447916 2 0.0000 0.9612 0.000 1.000 0.000 0.000 0.000
#> SRR1458643 4 0.1430 0.8360 0.052 0.000 0.000 0.944 0.004
#> SRR1445618 5 0.3913 0.5690 0.324 0.000 0.000 0.000 0.676
#> SRR1081589 4 0.2408 0.7975 0.092 0.000 0.000 0.892 0.016
#> SRR1097245 5 0.5784 0.5331 0.144 0.000 0.000 0.252 0.604
#> SRR1416141 1 0.1012 0.7979 0.968 0.000 0.000 0.012 0.020
#> SRR1404339 2 0.0000 0.9612 0.000 1.000 0.000 0.000 0.000
#> SRR1478614 5 0.2439 0.7633 0.120 0.000 0.000 0.004 0.876
#> SRR1406135 4 0.5171 0.0442 0.456 0.000 0.000 0.504 0.040
#> SRR1413307 4 0.0912 0.8437 0.012 0.000 0.000 0.972 0.016
#> SRR1397720 2 0.0290 0.9591 0.000 0.992 0.000 0.000 0.008
#> SRR1358391 4 0.0807 0.8446 0.012 0.000 0.000 0.976 0.012
#> SRR1381185 4 0.5129 0.4468 0.028 0.000 0.012 0.604 0.356
#> SRR1100608 2 0.3993 0.7195 0.000 0.756 0.000 0.028 0.216
#> SRR1386927 2 0.0000 0.9612 0.000 1.000 0.000 0.000 0.000
#> SRR1331771 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1486322 3 0.0000 0.9861 0.000 0.000 1.000 0.000 0.000
#> SRR1080790 1 0.3266 0.7244 0.852 0.000 0.108 0.008 0.032
#> SRR1459980 1 0.4449 0.6925 0.780 0.000 0.020 0.140 0.060
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR1433493 3 0.0000 0.97804 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1405147 6 0.5446 0.51605 0.176 0.000 0.000 0.000 0.256 0.568
#> SRR1315412 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1338384 5 0.2794 0.65384 0.144 0.000 0.000 0.012 0.840 0.004
#> SRR1071105 2 0.3196 0.78281 0.064 0.836 0.000 0.000 0.096 0.004
#> SRR1432868 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1454480 4 0.0458 0.90160 0.000 0.000 0.000 0.984 0.016 0.000
#> SRR1330723 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1475324 3 0.0000 0.97804 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1340260 1 0.4478 0.58408 0.680 0.000 0.000 0.000 0.244 0.076
#> SRR1376450 1 0.1863 0.71103 0.896 0.000 0.000 0.000 0.104 0.000
#> SRR1321897 3 0.0146 0.97668 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1445194 1 0.2706 0.64248 0.832 0.000 0.000 0.008 0.160 0.000
#> SRR1443308 3 0.1700 0.90508 0.000 0.000 0.916 0.080 0.004 0.000
#> SRR1400931 1 0.4094 0.55187 0.744 0.000 0.000 0.000 0.168 0.088
#> SRR1416188 3 0.0260 0.97468 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1407044 3 0.2623 0.82125 0.016 0.000 0.852 0.000 0.132 0.000
#> SRR1078392 1 0.2482 0.69189 0.848 0.000 0.000 0.000 0.148 0.004
#> SRR1436468 6 0.0436 0.53356 0.004 0.000 0.000 0.004 0.004 0.988
#> SRR1476125 2 0.1777 0.87646 0.000 0.928 0.000 0.004 0.044 0.024
#> SRR1418747 6 0.6343 -0.05417 0.416 0.000 0.076 0.012 0.056 0.440
#> SRR1318089 3 0.0000 0.97804 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1444370 1 0.4191 0.63668 0.732 0.000 0.000 0.000 0.088 0.180
#> SRR1348929 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1385690 5 0.3345 0.57002 0.020 0.000 0.000 0.204 0.776 0.000
#> SRR1460337 1 0.3118 0.67536 0.836 0.000 0.000 0.000 0.092 0.072
#> SRR1469062 5 0.4724 -0.00158 0.000 0.000 0.004 0.480 0.480 0.036
#> SRR1388459 3 0.0146 0.97668 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1416841 3 0.0000 0.97804 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1473778 6 0.5875 0.41725 0.080 0.000 0.040 0.000 0.424 0.456
#> SRR1419561 5 0.3349 0.63915 0.244 0.000 0.000 0.008 0.748 0.000
#> SRR1339987 1 0.1897 0.71378 0.908 0.000 0.000 0.004 0.084 0.004
#> SRR1469662 1 0.2178 0.69917 0.868 0.000 0.000 0.000 0.132 0.000
#> SRR1432958 1 0.5016 0.14701 0.488 0.000 0.000 0.012 0.456 0.044
#> SRR1479198 1 0.2664 0.65894 0.816 0.000 0.000 0.000 0.184 0.000
#> SRR1353600 1 0.2859 0.66715 0.872 0.000 0.000 0.020 0.048 0.060
#> SRR1456492 6 0.1261 0.52598 0.004 0.000 0.028 0.004 0.008 0.956
#> SRR1389955 1 0.1333 0.71691 0.944 0.000 0.000 0.008 0.048 0.000
#> SRR1429540 6 0.5444 0.59144 0.208 0.000 0.000 0.000 0.216 0.576
#> SRR1356057 6 0.4866 0.26909 0.000 0.000 0.068 0.000 0.364 0.568
#> SRR1328715 1 0.3029 0.64618 0.840 0.000 0.000 0.004 0.120 0.036
#> SRR1429429 3 0.0000 0.97804 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1325201 2 0.5866 0.31058 0.296 0.564 0.000 0.032 0.104 0.004
#> SRR1382978 3 0.0146 0.97584 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1406348 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1469390 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376380 1 0.4617 0.20657 0.540 0.000 0.428 0.000 0.012 0.020
#> SRR1418225 4 0.0713 0.89444 0.000 0.000 0.000 0.972 0.028 0.000
#> SRR1418473 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1376741 5 0.3084 0.63984 0.132 0.000 0.004 0.000 0.832 0.032
#> SRR1431823 3 0.0363 0.97005 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1447916 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1458643 4 0.2112 0.85050 0.088 0.000 0.000 0.896 0.016 0.000
#> SRR1445618 1 0.4165 0.03834 0.536 0.000 0.000 0.000 0.012 0.452
#> SRR1081589 4 0.3792 0.69131 0.188 0.000 0.000 0.764 0.044 0.004
#> SRR1097245 6 0.6704 0.37919 0.332 0.000 0.000 0.032 0.284 0.352
#> SRR1416141 1 0.0806 0.70962 0.972 0.000 0.000 0.008 0.020 0.000
#> SRR1404339 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1478614 6 0.5284 0.59633 0.184 0.000 0.000 0.004 0.192 0.620
#> SRR1406135 5 0.4681 0.21561 0.432 0.000 0.000 0.044 0.524 0.000
#> SRR1413307 4 0.0260 0.90438 0.000 0.000 0.000 0.992 0.008 0.000
#> SRR1397720 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1358391 4 0.0000 0.90456 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1381185 5 0.4197 0.40400 0.000 0.000 0.016 0.060 0.752 0.172
#> SRR1100608 2 0.3881 0.64781 0.000 0.720 0.000 0.024 0.004 0.252
#> SRR1386927 2 0.0000 0.92790 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1331771 3 0.0000 0.97804 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1486322 3 0.0000 0.97804 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1080790 1 0.4435 0.50510 0.672 0.000 0.064 0.000 0.264 0.000
#> SRR1459980 5 0.3109 0.65079 0.224 0.000 0.004 0.000 0.772 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