cola Report for recount2:SRP059431
Date: 2019-12-26 01:09:41 CET, cola version: 1.3.2
Document is loading... 
Summary
All available functions which can be applied to this res_list
object:
res_list
#> A 'ConsensusPartitionList' object with 24 methods.
#> On a matrix with 14886 rows and 74 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] 14886 74
Density distribution
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)

Suggest the best k
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 |
6 |
1.000 |
0.996 |
0.998 |
** |
2,4,5 |
SD:NMF |
3 |
1.000 |
0.971 |
0.985 |
** |
|
CV:pam |
6 |
1.000 |
1.000 |
1.000 |
** |
2,5 |
CV:mclust |
6 |
1.000 |
0.963 |
0.985 |
** |
3,4,5 |
CV:NMF |
2 |
1.000 |
0.997 |
0.998 |
** |
|
MAD:mclust |
6 |
1.000 |
0.998 |
0.999 |
** |
4,5 |
MAD:NMF |
2 |
1.000 |
0.989 |
0.995 |
** |
|
ATC:kmeans |
2 |
1.000 |
0.989 |
0.996 |
** |
|
ATC:skmeans |
2 |
1.000 |
0.996 |
0.998 |
** |
|
ATC:NMF |
2 |
1.000 |
0.969 |
0.987 |
** |
|
ATC:mclust |
6 |
0.950 |
0.930 |
0.956 |
** |
2,4 |
ATC:hclust |
4 |
0.943 |
0.896 |
0.955 |
* |
|
CV:skmeans |
6 |
0.942 |
0.952 |
0.946 |
* |
4,5 |
SD:skmeans |
6 |
0.940 |
0.908 |
0.910 |
* |
2,3,4,5 |
MAD:skmeans |
6 |
0.938 |
0.893 |
0.934 |
* |
2 |
MAD:pam |
6 |
0.937 |
0.848 |
0.919 |
* |
2,3,4 |
ATC:pam |
6 |
0.934 |
0.948 |
0.957 |
* |
2,3,4,5 |
MAD:hclust |
6 |
0.932 |
0.950 |
0.962 |
* |
4 |
SD:pam |
6 |
0.930 |
0.874 |
0.928 |
* |
2,3,4,5 |
CV:hclust |
6 |
0.920 |
0.926 |
0.940 |
* |
5 |
SD:hclust |
3 |
0.823 |
0.871 |
0.919 |
|
|
MAD:kmeans |
2 |
0.684 |
0.946 |
0.947 |
|
|
CV:kmeans |
4 |
0.594 |
0.786 |
0.823 |
|
|
SD:kmeans |
2 |
0.495 |
0.858 |
0.868 |
|
|
**: 1-PAC > 0.95, *: 1-PAC > 0.9
CDF of consensus matrices
Cumulative distribution function curves of consensus matrix for all methods.
collect_plots(res_list, fun = plot_ecdf)

Consensus heatmap
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 heatmap
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 heatmap
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)

Statistics table
The statistics used for measuring the stability of consensus partitioning.
(How are they
defined?)
get_stats(res_list, k = 2)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 2 0.542 0.872 0.907 0.492 0.496 0.496
#> CV:NMF 2 1.000 0.997 0.998 0.361 0.641 0.641
#> MAD:NMF 2 1.000 0.989 0.995 0.504 0.496 0.496
#> ATC:NMF 2 1.000 0.969 0.987 0.495 0.502 0.502
#> SD:skmeans 2 1.000 0.998 0.999 0.507 0.494 0.494
#> CV:skmeans 2 0.491 0.397 0.772 0.506 0.494 0.494
#> MAD:skmeans 2 1.000 1.000 1.000 0.507 0.494 0.494
#> ATC:skmeans 2 1.000 0.996 0.998 0.504 0.496 0.496
#> SD:mclust 2 1.000 1.000 1.000 0.359 0.641 0.641
#> CV:mclust 2 0.495 0.859 0.899 0.472 0.495 0.495
#> MAD:mclust 2 0.627 0.818 0.882 0.435 0.495 0.495
#> ATC:mclust 2 1.000 0.990 0.991 0.362 0.641 0.641
#> SD:kmeans 2 0.495 0.858 0.868 0.468 0.495 0.495
#> CV:kmeans 2 0.312 0.418 0.644 0.453 0.506 0.506
#> MAD:kmeans 2 0.684 0.946 0.947 0.492 0.495 0.495
#> ATC:kmeans 2 1.000 0.989 0.996 0.503 0.496 0.496
#> SD:pam 2 1.000 0.981 0.993 0.503 0.496 0.496
#> CV:pam 2 1.000 0.992 0.993 0.362 0.641 0.641
#> MAD:pam 2 1.000 0.992 0.996 0.504 0.496 0.496
#> ATC:pam 2 1.000 0.975 0.991 0.495 0.502 0.502
#> SD:hclust 2 0.354 0.858 0.875 0.425 0.588 0.588
#> CV:hclust 2 0.236 0.268 0.725 0.406 0.783 0.783
#> MAD:hclust 2 0.847 0.946 0.976 0.503 0.494 0.494
#> ATC:hclust 2 0.566 0.772 0.907 0.475 0.496 0.496
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 1.000 0.971 0.985 0.300 0.735 0.526
#> CV:NMF 3 0.684 0.816 0.907 0.742 0.707 0.543
#> MAD:NMF 3 0.803 0.875 0.942 0.293 0.755 0.548
#> ATC:NMF 3 0.793 0.826 0.912 0.304 0.786 0.596
#> SD:skmeans 3 1.000 0.979 0.984 0.300 0.795 0.605
#> CV:skmeans 3 0.705 0.797 0.867 0.276 0.629 0.385
#> MAD:skmeans 3 0.884 0.935 0.953 0.273 0.827 0.660
#> ATC:skmeans 3 0.749 0.794 0.839 0.210 0.855 0.708
#> SD:mclust 3 0.746 0.907 0.809 0.772 0.486 0.319
#> CV:mclust 3 1.000 0.996 0.992 0.368 0.859 0.716
#> MAD:mclust 3 0.747 0.977 0.948 0.479 0.859 0.716
#> ATC:mclust 3 0.712 0.664 0.801 0.759 0.740 0.595
#> SD:kmeans 3 0.513 0.715 0.822 0.354 0.841 0.691
#> CV:kmeans 3 0.491 0.739 0.801 0.390 0.632 0.396
#> MAD:kmeans 3 0.604 0.650 0.795 0.285 0.964 0.928
#> ATC:kmeans 3 0.647 0.748 0.873 0.290 0.742 0.524
#> SD:pam 3 0.957 0.956 0.981 0.250 0.862 0.727
#> CV:pam 3 0.624 0.851 0.895 0.769 0.704 0.538
#> MAD:pam 3 1.000 0.981 0.987 0.238 0.862 0.727
#> ATC:pam 3 1.000 0.985 0.993 0.307 0.795 0.614
#> SD:hclust 3 0.823 0.871 0.919 0.512 0.773 0.615
#> CV:hclust 3 0.605 0.804 0.872 0.557 0.538 0.432
#> MAD:hclust 3 0.839 0.902 0.930 0.179 0.917 0.833
#> ATC:hclust 3 0.757 0.838 0.911 0.371 0.742 0.524
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.860 0.845 0.929 0.1242 0.808 0.537
#> CV:NMF 4 0.807 0.844 0.875 0.0845 0.887 0.731
#> MAD:NMF 4 0.798 0.795 0.908 0.1065 0.787 0.493
#> ATC:NMF 4 0.665 0.650 0.842 0.1349 0.818 0.529
#> SD:skmeans 4 1.000 0.976 0.983 0.1308 0.862 0.623
#> CV:skmeans 4 0.938 0.927 0.965 0.1621 0.875 0.653
#> MAD:skmeans 4 0.881 0.931 0.954 0.1275 0.889 0.700
#> ATC:skmeans 4 0.827 0.894 0.941 0.1364 0.836 0.608
#> SD:mclust 4 1.000 0.992 0.997 0.1927 0.887 0.680
#> CV:mclust 4 1.000 0.984 0.994 0.1754 0.887 0.680
#> MAD:mclust 4 1.000 0.989 0.996 0.1800 0.887 0.680
#> ATC:mclust 4 1.000 0.965 0.982 0.1444 0.766 0.474
#> SD:kmeans 4 0.607 0.552 0.713 0.1337 0.864 0.662
#> CV:kmeans 4 0.594 0.786 0.823 0.1428 0.889 0.687
#> MAD:kmeans 4 0.648 0.666 0.747 0.1266 0.784 0.548
#> ATC:kmeans 4 0.692 0.758 0.830 0.1140 0.850 0.586
#> SD:pam 4 0.960 0.957 0.981 0.1550 0.882 0.695
#> CV:pam 4 0.864 0.944 0.968 0.1619 0.889 0.687
#> MAD:pam 4 1.000 0.989 0.996 0.1459 0.895 0.726
#> ATC:pam 4 0.922 0.874 0.945 0.1461 0.895 0.709
#> SD:hclust 4 0.792 0.835 0.818 0.0963 0.925 0.792
#> CV:hclust 4 0.800 0.914 0.938 0.1803 0.859 0.631
#> MAD:hclust 4 0.932 0.944 0.956 0.1031 0.930 0.832
#> ATC:hclust 4 0.943 0.896 0.955 0.1102 0.919 0.763
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.675 0.695 0.838 0.0254 0.974 0.913
#> CV:NMF 5 0.781 0.839 0.892 0.0314 0.908 0.759
#> MAD:NMF 5 0.661 0.585 0.795 0.0720 0.880 0.636
#> ATC:NMF 5 0.678 0.553 0.760 0.0546 0.894 0.627
#> SD:skmeans 5 0.928 0.950 0.966 0.0574 0.947 0.794
#> CV:skmeans 5 0.934 0.842 0.886 0.0508 0.947 0.794
#> MAD:skmeans 5 0.888 0.914 0.940 0.0676 0.929 0.754
#> ATC:skmeans 5 0.893 0.931 0.931 0.0675 0.924 0.767
#> SD:mclust 5 1.000 0.997 0.999 0.0396 0.970 0.875
#> CV:mclust 5 1.000 0.994 0.997 0.0397 0.970 0.875
#> MAD:mclust 5 1.000 0.996 0.999 0.0397 0.970 0.875
#> ATC:mclust 5 0.890 0.933 0.916 0.0493 0.973 0.903
#> SD:kmeans 5 0.755 0.721 0.749 0.0713 0.830 0.510
#> CV:kmeans 5 0.833 0.771 0.838 0.0786 1.000 1.000
#> MAD:kmeans 5 0.671 0.690 0.752 0.0777 0.921 0.730
#> ATC:kmeans 5 0.687 0.845 0.815 0.0647 0.961 0.844
#> SD:pam 5 1.000 0.979 0.993 0.0634 0.936 0.774
#> CV:pam 5 0.921 0.966 0.943 0.0426 0.973 0.895
#> MAD:pam 5 0.882 0.943 0.961 0.0777 0.933 0.771
#> ATC:pam 5 1.000 0.999 1.000 0.0572 0.944 0.792
#> SD:hclust 5 0.773 0.827 0.861 0.0741 0.973 0.907
#> CV:hclust 5 0.920 0.919 0.943 0.0493 0.970 0.875
#> MAD:hclust 5 0.836 0.881 0.925 0.1493 0.914 0.751
#> ATC:hclust 5 0.840 0.770 0.865 0.0686 0.980 0.927
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.751 0.635 0.855 0.0765 0.914 0.705
#> CV:NMF 6 0.706 0.621 0.800 0.0812 0.922 0.756
#> MAD:NMF 6 0.739 0.641 0.827 0.0580 0.890 0.607
#> ATC:NMF 6 0.709 0.693 0.802 0.0224 0.862 0.512
#> SD:skmeans 6 0.940 0.908 0.910 0.0383 0.973 0.873
#> CV:skmeans 6 0.942 0.952 0.946 0.0402 0.957 0.800
#> MAD:skmeans 6 0.938 0.893 0.934 0.0526 0.934 0.720
#> ATC:skmeans 6 0.844 0.899 0.927 0.0408 0.994 0.978
#> SD:mclust 6 1.000 0.996 0.998 0.0330 0.959 0.813
#> CV:mclust 6 1.000 0.963 0.985 0.0329 0.973 0.873
#> MAD:mclust 6 1.000 0.998 0.999 0.0329 0.959 0.813
#> ATC:mclust 6 0.950 0.930 0.956 0.0648 0.926 0.711
#> SD:kmeans 6 0.743 0.770 0.783 0.0450 0.933 0.719
#> CV:kmeans 6 0.856 0.743 0.800 0.0379 0.924 0.722
#> MAD:kmeans 6 0.848 0.785 0.810 0.0507 0.946 0.766
#> ATC:kmeans 6 0.744 0.779 0.773 0.0479 0.962 0.828
#> SD:pam 6 0.930 0.874 0.928 0.0589 0.929 0.703
#> CV:pam 6 1.000 1.000 1.000 0.0473 0.948 0.777
#> MAD:pam 6 0.937 0.848 0.919 0.0625 0.926 0.697
#> ATC:pam 6 0.934 0.948 0.957 0.0467 0.964 0.832
#> SD:hclust 6 0.877 0.869 0.906 0.0723 0.933 0.743
#> CV:hclust 6 0.920 0.926 0.940 0.0358 0.973 0.873
#> MAD:hclust 6 0.932 0.950 0.962 0.0738 0.933 0.743
#> ATC:hclust 6 0.840 0.705 0.801 0.0384 0.902 0.626
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)

Partition from all methods
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)

Top rows overlap
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)

Results for each method
SD:hclust
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"]
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 14886 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)

The plots are:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.354 0.858 0.875 0.4252 0.588 0.588
#> 3 3 0.823 0.871 0.919 0.5120 0.773 0.615
#> 4 4 0.792 0.835 0.818 0.0963 0.925 0.792
#> 5 5 0.773 0.827 0.861 0.0741 0.973 0.907
#> 6 6 0.877 0.869 0.906 0.0723 0.933 0.743
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.6801 0.996 0.180 0.820
#> SRR2061467 2 0.6801 0.996 0.180 0.820
#> SRR2061466 2 0.6801 0.996 0.180 0.820
#> SRR2061464 2 0.6887 0.994 0.184 0.816
#> SRR2061465 2 0.6801 0.996 0.180 0.820
#> SRR2061463 2 0.6887 0.994 0.184 0.816
#> SRR2061462 2 0.6887 0.994 0.184 0.816
#> SRR2061460 1 0.0376 0.871 0.996 0.004
#> SRR2061459 1 0.0376 0.871 0.996 0.004
#> SRR2061461 1 0.0376 0.871 0.996 0.004
#> SRR2061458 1 0.0376 0.871 0.996 0.004
#> SRR2061457 1 0.0376 0.871 0.996 0.004
#> SRR2061481 1 0.8267 0.766 0.740 0.260
#> SRR2061488 1 0.8713 0.742 0.708 0.292
#> SRR2061456 1 0.0376 0.871 0.996 0.004
#> SRR2061487 1 0.8713 0.742 0.708 0.292
#> SRR2061485 1 0.8713 0.742 0.708 0.292
#> SRR2061486 1 0.8713 0.742 0.708 0.292
#> SRR2061484 1 0.8713 0.742 0.708 0.292
#> SRR2061482 1 0.8267 0.766 0.740 0.260
#> SRR2061480 1 0.8267 0.766 0.740 0.260
#> SRR2061483 1 0.8713 0.742 0.708 0.292
#> SRR2061478 1 0.6801 0.798 0.820 0.180
#> SRR2061477 1 0.6801 0.798 0.820 0.180
#> SRR2061475 1 0.6801 0.798 0.820 0.180
#> SRR2061474 1 0.6801 0.798 0.820 0.180
#> SRR2061476 1 0.6801 0.798 0.820 0.180
#> SRR2061473 1 0.6801 0.798 0.820 0.180
#> SRR2061472 1 0.6801 0.798 0.820 0.180
#> SRR2061470 2 0.6801 0.996 0.180 0.820
#> SRR2061469 2 0.6801 0.996 0.180 0.820
#> SRR2061455 1 0.0376 0.871 0.996 0.004
#> SRR2061454 1 0.0376 0.871 0.996 0.004
#> SRR2061452 1 0.0000 0.872 1.000 0.000
#> SRR2061453 1 0.0376 0.871 0.996 0.004
#> SRR2061450 1 0.0000 0.872 1.000 0.000
#> SRR2061451 1 0.0000 0.872 1.000 0.000
#> SRR2061448 2 0.6887 0.997 0.184 0.816
#> SRR2061471 1 0.6801 0.798 0.820 0.180
#> SRR2061449 2 0.6887 0.997 0.184 0.816
#> SRR2061447 2 0.6887 0.997 0.184 0.816
#> SRR2061446 2 0.6887 0.997 0.184 0.816
#> SRR2061444 2 0.6887 0.997 0.184 0.816
#> SRR2061443 1 0.7883 0.588 0.764 0.236
#> SRR2061442 1 0.7883 0.588 0.764 0.236
#> SRR2061441 1 0.7883 0.588 0.764 0.236
#> SRR2061445 2 0.6887 0.997 0.184 0.816
#> SRR2061439 1 0.0000 0.872 1.000 0.000
#> SRR2061440 1 0.0000 0.872 1.000 0.000
#> SRR2061437 1 0.0000 0.872 1.000 0.000
#> SRR2061438 1 0.0000 0.872 1.000 0.000
#> SRR2061435 1 0.0000 0.872 1.000 0.000
#> SRR2061436 1 0.0000 0.872 1.000 0.000
#> SRR2061433 1 0.0000 0.872 1.000 0.000
#> SRR2061434 1 0.0000 0.872 1.000 0.000
#> SRR2061432 1 0.0000 0.872 1.000 0.000
#> SRR2061431 2 0.6887 0.997 0.184 0.816
#> SRR2061429 2 0.6887 0.997 0.184 0.816
#> SRR2061430 2 0.6887 0.997 0.184 0.816
#> SRR2061428 2 0.6887 0.997 0.184 0.816
#> SRR2061426 2 0.6887 0.997 0.184 0.816
#> SRR2061427 2 0.6887 0.997 0.184 0.816
#> SRR2061425 1 0.7883 0.588 0.764 0.236
#> SRR2061424 1 0.7883 0.588 0.764 0.236
#> SRR2061423 1 0.7883 0.588 0.764 0.236
#> SRR2061422 1 0.0000 0.872 1.000 0.000
#> SRR2061421 1 0.0000 0.872 1.000 0.000
#> SRR2061420 1 0.7219 0.650 0.800 0.200
#> SRR2061419 1 0.0000 0.872 1.000 0.000
#> SRR2061418 1 0.0000 0.872 1.000 0.000
#> SRR2061417 1 0.0000 0.872 1.000 0.000
#> SRR2061415 1 0.0000 0.872 1.000 0.000
#> SRR2061416 1 0.0000 0.872 1.000 0.000
#> SRR2061414 1 0.0000 0.872 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.935 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.935 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.935 0.000 1.000 0.000
#> SRR2061464 2 0.0237 0.935 0.004 0.996 0.000
#> SRR2061465 2 0.0000 0.935 0.000 1.000 0.000
#> SRR2061463 2 0.0237 0.935 0.004 0.996 0.000
#> SRR2061462 2 0.0237 0.935 0.004 0.996 0.000
#> SRR2061460 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061459 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061461 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061458 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061457 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061481 3 0.1964 0.938 0.000 0.056 0.944
#> SRR2061488 3 0.2711 0.931 0.000 0.088 0.912
#> SRR2061456 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061487 3 0.2711 0.931 0.000 0.088 0.912
#> SRR2061485 3 0.2711 0.931 0.000 0.088 0.912
#> SRR2061486 3 0.2711 0.931 0.000 0.088 0.912
#> SRR2061484 3 0.2711 0.931 0.000 0.088 0.912
#> SRR2061482 3 0.1964 0.938 0.000 0.056 0.944
#> SRR2061480 3 0.1964 0.938 0.000 0.056 0.944
#> SRR2061483 3 0.2711 0.931 0.000 0.088 0.912
#> SRR2061478 3 0.2537 0.938 0.080 0.000 0.920
#> SRR2061477 3 0.2537 0.938 0.080 0.000 0.920
#> SRR2061475 3 0.2537 0.938 0.080 0.000 0.920
#> SRR2061474 3 0.2537 0.938 0.080 0.000 0.920
#> SRR2061476 3 0.2537 0.938 0.080 0.000 0.920
#> SRR2061473 3 0.2537 0.938 0.080 0.000 0.920
#> SRR2061472 3 0.2537 0.938 0.080 0.000 0.920
#> SRR2061470 2 0.0000 0.935 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.935 0.000 1.000 0.000
#> SRR2061455 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061454 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061452 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061453 1 0.2537 0.851 0.920 0.080 0.000
#> SRR2061450 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061448 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061471 3 0.2537 0.938 0.080 0.000 0.920
#> SRR2061449 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061447 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061446 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061444 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061443 1 0.7559 0.491 0.608 0.336 0.056
#> SRR2061442 1 0.7559 0.491 0.608 0.336 0.056
#> SRR2061441 1 0.7559 0.491 0.608 0.336 0.056
#> SRR2061445 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061439 1 0.1964 0.873 0.944 0.000 0.056
#> SRR2061440 1 0.1964 0.873 0.944 0.000 0.056
#> SRR2061437 1 0.1964 0.873 0.944 0.000 0.056
#> SRR2061438 1 0.1964 0.873 0.944 0.000 0.056
#> SRR2061435 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061431 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061429 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061430 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061428 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061426 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061427 2 0.2537 0.953 0.080 0.920 0.000
#> SRR2061425 1 0.7559 0.491 0.608 0.336 0.056
#> SRR2061424 1 0.7559 0.491 0.608 0.336 0.056
#> SRR2061423 1 0.7559 0.491 0.608 0.336 0.056
#> SRR2061422 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061420 1 0.7308 0.560 0.648 0.296 0.056
#> SRR2061419 1 0.1964 0.873 0.944 0.000 0.056
#> SRR2061418 1 0.1964 0.873 0.944 0.000 0.056
#> SRR2061417 1 0.1964 0.873 0.944 0.000 0.056
#> SRR2061415 1 0.0000 0.879 1.000 0.000 0.000
#> SRR2061416 1 0.1964 0.873 0.944 0.000 0.056
#> SRR2061414 1 0.1964 0.873 0.944 0.000 0.056
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0000 0.712 0.000 1.000 0.000 0.000
#> SRR2061467 2 0.0000 0.712 0.000 1.000 0.000 0.000
#> SRR2061466 2 0.0000 0.712 0.000 1.000 0.000 0.000
#> SRR2061464 2 0.0469 0.706 0.000 0.988 0.000 0.012
#> SRR2061465 2 0.0000 0.712 0.000 1.000 0.000 0.000
#> SRR2061463 2 0.0469 0.706 0.000 0.988 0.000 0.012
#> SRR2061462 2 0.0469 0.706 0.000 0.988 0.000 0.012
#> SRR2061460 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061459 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061461 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061458 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061457 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061481 3 0.0000 0.830 0.000 0.000 1.000 0.000
#> SRR2061488 3 0.1938 0.821 0.000 0.012 0.936 0.052
#> SRR2061456 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061487 3 0.1938 0.821 0.000 0.012 0.936 0.052
#> SRR2061485 3 0.1938 0.821 0.000 0.012 0.936 0.052
#> SRR2061486 3 0.1938 0.821 0.000 0.012 0.936 0.052
#> SRR2061484 3 0.1938 0.821 0.000 0.012 0.936 0.052
#> SRR2061482 3 0.0000 0.830 0.000 0.000 1.000 0.000
#> SRR2061480 3 0.0000 0.830 0.000 0.000 1.000 0.000
#> SRR2061483 3 0.1938 0.821 0.000 0.012 0.936 0.052
#> SRR2061478 3 0.5989 0.813 0.080 0.000 0.656 0.264
#> SRR2061477 3 0.5989 0.813 0.080 0.000 0.656 0.264
#> SRR2061475 3 0.5989 0.813 0.080 0.000 0.656 0.264
#> SRR2061474 3 0.5989 0.813 0.080 0.000 0.656 0.264
#> SRR2061476 3 0.5989 0.813 0.080 0.000 0.656 0.264
#> SRR2061473 3 0.5989 0.813 0.080 0.000 0.656 0.264
#> SRR2061472 3 0.5989 0.813 0.080 0.000 0.656 0.264
#> SRR2061470 2 0.0000 0.712 0.000 1.000 0.000 0.000
#> SRR2061469 2 0.0000 0.712 0.000 1.000 0.000 0.000
#> SRR2061455 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061454 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061452 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061453 1 0.2197 0.881 0.916 0.080 0.000 0.004
#> SRR2061450 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061448 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061471 3 0.5989 0.813 0.080 0.000 0.656 0.264
#> SRR2061449 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061447 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061446 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061444 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061443 4 0.4522 0.974 0.320 0.000 0.000 0.680
#> SRR2061442 4 0.4522 0.974 0.320 0.000 0.000 0.680
#> SRR2061441 4 0.4522 0.974 0.320 0.000 0.000 0.680
#> SRR2061445 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061439 1 0.1940 0.879 0.924 0.000 0.000 0.076
#> SRR2061440 1 0.1940 0.879 0.924 0.000 0.000 0.076
#> SRR2061437 1 0.1940 0.879 0.924 0.000 0.000 0.076
#> SRR2061438 1 0.1940 0.879 0.924 0.000 0.000 0.076
#> SRR2061435 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061429 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061430 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061428 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061426 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061427 2 0.4843 0.745 0.000 0.604 0.000 0.396
#> SRR2061425 4 0.4522 0.974 0.320 0.000 0.000 0.680
#> SRR2061424 4 0.4522 0.974 0.320 0.000 0.000 0.680
#> SRR2061423 4 0.4522 0.974 0.320 0.000 0.000 0.680
#> SRR2061422 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061420 4 0.4907 0.816 0.420 0.000 0.000 0.580
#> SRR2061419 1 0.1940 0.879 0.924 0.000 0.000 0.076
#> SRR2061418 1 0.1940 0.879 0.924 0.000 0.000 0.076
#> SRR2061417 1 0.1940 0.879 0.924 0.000 0.000 0.076
#> SRR2061415 1 0.0000 0.917 1.000 0.000 0.000 0.000
#> SRR2061416 1 0.1940 0.879 0.924 0.000 0.000 0.076
#> SRR2061414 1 0.1940 0.879 0.924 0.000 0.000 0.076
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.0000 0.685 0.000 1.000 0.000 0.000 0.000
#> SRR2061467 2 0.0000 0.685 0.000 1.000 0.000 0.000 0.000
#> SRR2061466 2 0.0000 0.685 0.000 1.000 0.000 0.000 0.000
#> SRR2061464 2 0.0404 0.678 0.000 0.988 0.000 0.000 0.012
#> SRR2061465 2 0.0000 0.685 0.000 1.000 0.000 0.000 0.000
#> SRR2061463 2 0.0404 0.678 0.000 0.988 0.000 0.000 0.012
#> SRR2061462 2 0.0404 0.678 0.000 0.988 0.000 0.000 0.012
#> SRR2061460 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061459 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061461 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061458 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061457 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061481 3 0.1608 0.926 0.000 0.000 0.928 0.072 0.000
#> SRR2061488 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000
#> SRR2061456 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061487 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000
#> SRR2061485 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000
#> SRR2061486 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000
#> SRR2061484 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000
#> SRR2061482 3 0.1608 0.926 0.000 0.000 0.928 0.072 0.000
#> SRR2061480 3 0.1608 0.926 0.000 0.000 0.928 0.072 0.000
#> SRR2061483 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000
#> SRR2061478 4 0.3109 1.000 0.000 0.000 0.200 0.800 0.000
#> SRR2061477 4 0.3109 1.000 0.000 0.000 0.200 0.800 0.000
#> SRR2061475 4 0.3109 1.000 0.000 0.000 0.200 0.800 0.000
#> SRR2061474 4 0.3109 1.000 0.000 0.000 0.200 0.800 0.000
#> SRR2061476 4 0.3109 1.000 0.000 0.000 0.200 0.800 0.000
#> SRR2061473 4 0.3109 1.000 0.000 0.000 0.200 0.800 0.000
#> SRR2061472 4 0.3109 1.000 0.000 0.000 0.200 0.800 0.000
#> SRR2061470 2 0.0000 0.685 0.000 1.000 0.000 0.000 0.000
#> SRR2061469 2 0.0000 0.685 0.000 1.000 0.000 0.000 0.000
#> SRR2061455 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061454 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061452 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061453 1 0.3109 0.807 0.800 0.000 0.000 0.200 0.000
#> SRR2061450 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061448 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061471 4 0.3109 1.000 0.000 0.000 0.200 0.800 0.000
#> SRR2061449 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061447 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061446 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061444 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061443 5 0.0162 0.917 0.004 0.000 0.000 0.000 0.996
#> SRR2061442 5 0.0162 0.917 0.004 0.000 0.000 0.000 0.996
#> SRR2061441 5 0.0162 0.917 0.004 0.000 0.000 0.000 0.996
#> SRR2061445 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061439 1 0.2813 0.800 0.832 0.000 0.000 0.000 0.168
#> SRR2061440 1 0.2813 0.800 0.832 0.000 0.000 0.000 0.168
#> SRR2061437 1 0.2648 0.809 0.848 0.000 0.000 0.000 0.152
#> SRR2061438 1 0.2813 0.800 0.832 0.000 0.000 0.000 0.168
#> SRR2061435 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061429 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061430 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061428 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061426 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061427 2 0.4182 0.707 0.000 0.600 0.000 0.000 0.400
#> SRR2061425 5 0.0162 0.917 0.004 0.000 0.000 0.000 0.996
#> SRR2061424 5 0.0162 0.917 0.004 0.000 0.000 0.000 0.996
#> SRR2061423 5 0.0162 0.917 0.004 0.000 0.000 0.000 0.996
#> SRR2061422 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061420 5 0.3796 0.499 0.300 0.000 0.000 0.000 0.700
#> SRR2061419 1 0.2813 0.800 0.832 0.000 0.000 0.000 0.168
#> SRR2061418 1 0.2813 0.800 0.832 0.000 0.000 0.000 0.168
#> SRR2061417 1 0.2813 0.800 0.832 0.000 0.000 0.000 0.168
#> SRR2061415 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.2813 0.800 0.832 0.000 0.000 0.000 0.168
#> SRR2061414 1 0.2813 0.800 0.832 0.000 0.000 0.000 0.168
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.0000 0.684 0.000 1.000 0.000 0 0.000 0.000
#> SRR2061467 2 0.0000 0.684 0.000 1.000 0.000 0 0.000 0.000
#> SRR2061466 2 0.0000 0.684 0.000 1.000 0.000 0 0.000 0.000
#> SRR2061464 2 0.0363 0.677 0.000 0.988 0.000 0 0.012 0.000
#> SRR2061465 2 0.0000 0.684 0.000 1.000 0.000 0 0.000 0.000
#> SRR2061463 2 0.0363 0.677 0.000 0.988 0.000 0 0.012 0.000
#> SRR2061462 2 0.0363 0.677 0.000 0.988 0.000 0 0.012 0.000
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061481 3 0.1444 0.942 0.000 0.000 0.928 0 0.000 0.072
#> SRR2061488 3 0.0000 0.972 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061487 3 0.0000 0.972 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061485 3 0.0000 0.972 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061486 3 0.0000 0.972 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061484 3 0.0000 0.972 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061482 3 0.1444 0.942 0.000 0.000 0.928 0 0.000 0.072
#> SRR2061480 3 0.1444 0.942 0.000 0.000 0.928 0 0.000 0.072
#> SRR2061483 3 0.0000 0.972 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061478 6 0.0146 1.000 0.000 0.000 0.004 0 0.000 0.996
#> SRR2061477 6 0.0146 1.000 0.000 0.000 0.004 0 0.000 0.996
#> SRR2061475 6 0.0146 1.000 0.000 0.000 0.004 0 0.000 0.996
#> SRR2061474 6 0.0146 1.000 0.000 0.000 0.004 0 0.000 0.996
#> SRR2061476 6 0.0146 1.000 0.000 0.000 0.004 0 0.000 0.996
#> SRR2061473 6 0.0146 1.000 0.000 0.000 0.004 0 0.000 0.996
#> SRR2061472 6 0.0146 1.000 0.000 0.000 0.004 0 0.000 0.996
#> SRR2061470 2 0.0000 0.684 0.000 1.000 0.000 0 0.000 0.000
#> SRR2061469 2 0.0000 0.684 0.000 1.000 0.000 0 0.000 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061452 1 0.0000 0.911 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061450 1 0.0000 0.911 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061451 1 0.0000 0.911 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061448 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061471 6 0.0146 1.000 0.000 0.000 0.004 0 0.000 0.996
#> SRR2061449 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061447 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061446 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061444 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061443 5 0.0000 0.927 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061442 5 0.0000 0.927 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061441 5 0.0000 0.927 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061445 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061439 1 0.2562 0.878 0.828 0.000 0.000 0 0.172 0.000
#> SRR2061440 1 0.2562 0.878 0.828 0.000 0.000 0 0.172 0.000
#> SRR2061437 1 0.2378 0.885 0.848 0.000 0.000 0 0.152 0.000
#> SRR2061438 1 0.2562 0.878 0.828 0.000 0.000 0 0.172 0.000
#> SRR2061435 1 0.0146 0.910 0.996 0.000 0.000 0 0.004 0.000
#> SRR2061436 1 0.0000 0.911 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061433 1 0.0000 0.911 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061434 1 0.0000 0.911 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061432 1 0.0000 0.911 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061431 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061429 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061430 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061428 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061426 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061427 2 0.3881 0.705 0.000 0.600 0.000 0 0.396 0.004
#> SRR2061425 5 0.0000 0.927 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061424 5 0.0000 0.927 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061423 5 0.0000 0.927 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061422 1 0.0146 0.910 0.996 0.000 0.000 0 0.004 0.000
#> SRR2061421 1 0.0146 0.910 0.996 0.000 0.000 0 0.004 0.000
#> SRR2061420 5 0.3390 0.525 0.296 0.000 0.000 0 0.704 0.000
#> SRR2061419 1 0.2527 0.880 0.832 0.000 0.000 0 0.168 0.000
#> SRR2061418 1 0.2527 0.880 0.832 0.000 0.000 0 0.168 0.000
#> SRR2061417 1 0.2527 0.880 0.832 0.000 0.000 0 0.168 0.000
#> SRR2061415 1 0.0000 0.911 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061416 1 0.2527 0.880 0.832 0.000 0.000 0 0.168 0.000
#> SRR2061414 1 0.2527 0.880 0.832 0.000 0.000 0 0.168 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.
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.
SD:kmeans
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"]
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 14886 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)

The plots are:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.495 0.858 0.868 0.4676 0.495 0.495
#> 3 3 0.513 0.715 0.822 0.3539 0.841 0.691
#> 4 4 0.607 0.552 0.713 0.1337 0.864 0.662
#> 5 5 0.755 0.721 0.749 0.0713 0.830 0.510
#> 6 6 0.743 0.770 0.783 0.0450 0.933 0.719
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.2423 0.887 0.040 0.960
#> SRR2061467 2 0.2423 0.887 0.040 0.960
#> SRR2061466 2 0.2423 0.887 0.040 0.960
#> SRR2061464 2 0.2043 0.886 0.032 0.968
#> SRR2061465 2 0.2423 0.887 0.040 0.960
#> SRR2061463 2 0.2043 0.886 0.032 0.968
#> SRR2061462 2 0.2043 0.886 0.032 0.968
#> SRR2061460 1 0.8207 0.895 0.744 0.256
#> SRR2061459 1 0.8207 0.895 0.744 0.256
#> SRR2061461 1 0.8207 0.895 0.744 0.256
#> SRR2061458 1 0.8207 0.895 0.744 0.256
#> SRR2061457 1 0.8207 0.895 0.744 0.256
#> SRR2061481 2 0.8327 0.745 0.264 0.736
#> SRR2061488 2 0.8207 0.749 0.256 0.744
#> SRR2061456 1 0.8207 0.895 0.744 0.256
#> SRR2061487 2 0.8207 0.749 0.256 0.744
#> SRR2061485 2 0.8207 0.749 0.256 0.744
#> SRR2061486 2 0.8207 0.749 0.256 0.744
#> SRR2061484 2 0.8207 0.749 0.256 0.744
#> SRR2061482 2 0.8327 0.745 0.264 0.736
#> SRR2061480 2 0.8327 0.745 0.264 0.736
#> SRR2061483 2 0.8207 0.749 0.256 0.744
#> SRR2061478 1 0.1843 0.719 0.972 0.028
#> SRR2061477 1 0.1843 0.719 0.972 0.028
#> SRR2061475 1 0.1843 0.719 0.972 0.028
#> SRR2061474 1 0.1843 0.719 0.972 0.028
#> SRR2061476 1 0.1843 0.719 0.972 0.028
#> SRR2061473 1 0.1843 0.719 0.972 0.028
#> SRR2061472 1 0.1843 0.719 0.972 0.028
#> SRR2061470 2 0.2423 0.887 0.040 0.960
#> SRR2061469 2 0.2423 0.887 0.040 0.960
#> SRR2061455 1 0.8207 0.895 0.744 0.256
#> SRR2061454 1 0.8207 0.895 0.744 0.256
#> SRR2061452 1 0.8499 0.911 0.724 0.276
#> SRR2061453 1 0.8207 0.895 0.744 0.256
#> SRR2061450 1 0.8499 0.911 0.724 0.276
#> SRR2061451 1 0.8499 0.911 0.724 0.276
#> SRR2061448 2 0.0376 0.893 0.004 0.996
#> SRR2061471 1 0.1843 0.719 0.972 0.028
#> SRR2061449 2 0.0376 0.893 0.004 0.996
#> SRR2061447 2 0.0376 0.893 0.004 0.996
#> SRR2061446 2 0.0376 0.893 0.004 0.996
#> SRR2061444 2 0.0376 0.893 0.004 0.996
#> SRR2061443 2 0.0376 0.893 0.004 0.996
#> SRR2061442 1 0.9850 0.695 0.572 0.428
#> SRR2061441 2 0.0376 0.893 0.004 0.996
#> SRR2061445 2 0.0376 0.893 0.004 0.996
#> SRR2061439 1 0.8499 0.911 0.724 0.276
#> SRR2061440 1 0.8499 0.911 0.724 0.276
#> SRR2061437 1 0.8499 0.911 0.724 0.276
#> SRR2061438 1 0.8499 0.911 0.724 0.276
#> SRR2061435 1 0.8499 0.911 0.724 0.276
#> SRR2061436 1 0.8499 0.911 0.724 0.276
#> SRR2061433 1 0.8499 0.911 0.724 0.276
#> SRR2061434 1 0.8499 0.911 0.724 0.276
#> SRR2061432 1 0.8499 0.911 0.724 0.276
#> SRR2061431 2 0.0000 0.894 0.000 1.000
#> SRR2061429 2 0.0000 0.894 0.000 1.000
#> SRR2061430 2 0.0000 0.894 0.000 1.000
#> SRR2061428 2 0.0000 0.894 0.000 1.000
#> SRR2061426 2 0.0000 0.894 0.000 1.000
#> SRR2061427 2 0.0000 0.894 0.000 1.000
#> SRR2061425 2 0.0376 0.893 0.004 0.996
#> SRR2061424 2 0.1184 0.884 0.016 0.984
#> SRR2061423 2 0.0376 0.893 0.004 0.996
#> SRR2061422 1 0.8499 0.911 0.724 0.276
#> SRR2061421 1 0.8499 0.911 0.724 0.276
#> SRR2061420 1 0.8499 0.911 0.724 0.276
#> SRR2061419 1 0.8499 0.911 0.724 0.276
#> SRR2061418 1 0.8499 0.911 0.724 0.276
#> SRR2061417 1 0.8499 0.911 0.724 0.276
#> SRR2061415 1 0.8499 0.911 0.724 0.276
#> SRR2061416 1 0.8499 0.911 0.724 0.276
#> SRR2061414 1 0.8499 0.911 0.724 0.276
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.385 0.786 0.028 0.884 0.088
#> SRR2061467 2 0.385 0.786 0.028 0.884 0.088
#> SRR2061466 2 0.385 0.786 0.028 0.884 0.088
#> SRR2061464 2 0.634 0.687 0.028 0.708 0.264
#> SRR2061465 2 0.385 0.786 0.028 0.884 0.088
#> SRR2061463 2 0.634 0.687 0.028 0.708 0.264
#> SRR2061462 2 0.634 0.687 0.028 0.708 0.264
#> SRR2061460 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061459 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061461 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061458 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061457 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061481 3 0.535 0.616 0.028 0.176 0.796
#> SRR2061488 2 0.626 0.218 0.000 0.552 0.448
#> SRR2061456 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061487 2 0.626 0.218 0.000 0.552 0.448
#> SRR2061485 2 0.628 0.206 0.000 0.540 0.460
#> SRR2061486 2 0.626 0.218 0.000 0.552 0.448
#> SRR2061484 2 0.628 0.206 0.000 0.540 0.460
#> SRR2061482 3 0.535 0.616 0.028 0.176 0.796
#> SRR2061480 3 0.535 0.616 0.028 0.176 0.796
#> SRR2061483 2 0.628 0.206 0.000 0.540 0.460
#> SRR2061478 3 0.572 0.860 0.292 0.004 0.704
#> SRR2061477 3 0.572 0.860 0.292 0.004 0.704
#> SRR2061475 3 0.572 0.860 0.292 0.004 0.704
#> SRR2061474 3 0.572 0.860 0.292 0.004 0.704
#> SRR2061476 3 0.572 0.860 0.292 0.004 0.704
#> SRR2061473 3 0.572 0.860 0.292 0.004 0.704
#> SRR2061472 3 0.572 0.860 0.292 0.004 0.704
#> SRR2061470 2 0.385 0.786 0.028 0.884 0.088
#> SRR2061469 2 0.385 0.786 0.028 0.884 0.088
#> SRR2061455 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061454 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061452 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061453 1 0.817 0.593 0.632 0.132 0.236
#> SRR2061450 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061451 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061448 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061471 3 0.572 0.860 0.292 0.004 0.704
#> SRR2061449 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061447 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061446 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061444 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061443 2 0.589 0.754 0.100 0.796 0.104
#> SRR2061442 1 0.697 0.530 0.728 0.168 0.104
#> SRR2061441 2 0.532 0.775 0.072 0.824 0.104
#> SRR2061445 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061439 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061440 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061437 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061438 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061435 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061436 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061433 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061434 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061432 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061431 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061429 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061430 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061428 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061426 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061427 2 0.226 0.816 0.068 0.932 0.000
#> SRR2061425 2 0.523 0.778 0.068 0.828 0.104
#> SRR2061424 1 0.857 0.132 0.524 0.372 0.104
#> SRR2061423 2 0.523 0.778 0.068 0.828 0.104
#> SRR2061422 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061421 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061420 1 0.280 0.750 0.908 0.000 0.092
#> SRR2061419 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061418 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061417 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061415 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061416 1 0.000 0.825 1.000 0.000 0.000
#> SRR2061414 1 0.000 0.825 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0469 0.5443 0.000 0.988 0.012 0.000
#> SRR2061467 2 0.0657 0.5437 0.000 0.984 0.012 0.004
#> SRR2061466 2 0.0657 0.5437 0.000 0.984 0.012 0.004
#> SRR2061464 2 0.7844 -0.0802 0.316 0.444 0.004 0.236
#> SRR2061465 2 0.0657 0.5437 0.000 0.984 0.012 0.004
#> SRR2061463 2 0.7844 -0.0802 0.316 0.444 0.004 0.236
#> SRR2061462 2 0.7844 -0.0802 0.316 0.444 0.004 0.236
#> SRR2061460 1 0.4958 0.3883 0.788 0.080 0.124 0.008
#> SRR2061459 1 0.4958 0.3883 0.788 0.080 0.124 0.008
#> SRR2061461 1 0.4958 0.3883 0.788 0.080 0.124 0.008
#> SRR2061458 1 0.4816 0.3907 0.792 0.080 0.124 0.004
#> SRR2061457 1 0.4816 0.3907 0.792 0.080 0.124 0.004
#> SRR2061481 3 0.5323 0.5791 0.000 0.020 0.628 0.352
#> SRR2061488 3 0.7901 0.4189 0.000 0.316 0.372 0.312
#> SRR2061456 1 0.4816 0.3907 0.792 0.080 0.124 0.004
#> SRR2061487 3 0.7901 0.4189 0.000 0.316 0.372 0.312
#> SRR2061485 3 0.7901 0.4211 0.000 0.312 0.372 0.316
#> SRR2061486 3 0.7901 0.4189 0.000 0.316 0.372 0.312
#> SRR2061484 3 0.7901 0.4211 0.000 0.312 0.372 0.316
#> SRR2061482 3 0.5323 0.5791 0.000 0.020 0.628 0.352
#> SRR2061480 3 0.5323 0.5791 0.000 0.020 0.628 0.352
#> SRR2061483 3 0.7901 0.4211 0.000 0.312 0.372 0.316
#> SRR2061478 3 0.1305 0.6497 0.036 0.000 0.960 0.004
#> SRR2061477 3 0.1305 0.6497 0.036 0.000 0.960 0.004
#> SRR2061475 3 0.1389 0.6498 0.048 0.000 0.952 0.000
#> SRR2061474 3 0.1389 0.6498 0.048 0.000 0.952 0.000
#> SRR2061476 3 0.1389 0.6498 0.048 0.000 0.952 0.000
#> SRR2061473 3 0.1389 0.6498 0.048 0.000 0.952 0.000
#> SRR2061472 3 0.1389 0.6498 0.048 0.000 0.952 0.000
#> SRR2061470 2 0.0469 0.5443 0.000 0.988 0.012 0.000
#> SRR2061469 2 0.0469 0.5443 0.000 0.988 0.012 0.000
#> SRR2061455 1 0.4816 0.3907 0.792 0.080 0.124 0.004
#> SRR2061454 1 0.4816 0.3907 0.792 0.080 0.124 0.004
#> SRR2061452 1 0.6597 0.7425 0.588 0.000 0.108 0.304
#> SRR2061453 1 0.4816 0.3907 0.792 0.080 0.124 0.004
#> SRR2061450 1 0.6597 0.7425 0.588 0.000 0.108 0.304
#> SRR2061451 1 0.6597 0.7425 0.588 0.000 0.108 0.304
#> SRR2061448 2 0.4516 0.6270 0.012 0.736 0.000 0.252
#> SRR2061471 3 0.1389 0.6498 0.048 0.000 0.952 0.000
#> SRR2061449 2 0.4516 0.6270 0.012 0.736 0.000 0.252
#> SRR2061447 2 0.4516 0.6270 0.012 0.736 0.000 0.252
#> SRR2061446 2 0.4546 0.6263 0.012 0.732 0.000 0.256
#> SRR2061444 2 0.4546 0.6263 0.012 0.732 0.000 0.256
#> SRR2061443 4 0.5610 0.5001 0.024 0.356 0.004 0.616
#> SRR2061442 4 0.5658 0.0111 0.244 0.012 0.044 0.700
#> SRR2061441 4 0.5626 0.4965 0.024 0.360 0.004 0.612
#> SRR2061445 2 0.4546 0.6263 0.012 0.732 0.000 0.256
#> SRR2061439 1 0.6654 0.7461 0.588 0.000 0.116 0.296
#> SRR2061440 1 0.6654 0.7461 0.588 0.000 0.116 0.296
#> SRR2061437 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061438 1 0.6654 0.7461 0.588 0.000 0.116 0.296
#> SRR2061435 1 0.6654 0.7461 0.588 0.000 0.116 0.296
#> SRR2061436 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061433 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061434 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061432 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061431 2 0.4485 0.6269 0.012 0.740 0.000 0.248
#> SRR2061429 2 0.4485 0.6269 0.012 0.740 0.000 0.248
#> SRR2061430 2 0.4485 0.6269 0.012 0.740 0.000 0.248
#> SRR2061428 2 0.4546 0.6263 0.012 0.732 0.000 0.256
#> SRR2061426 2 0.4546 0.6263 0.012 0.732 0.000 0.256
#> SRR2061427 2 0.4546 0.6263 0.012 0.732 0.000 0.256
#> SRR2061425 4 0.5683 0.4603 0.024 0.376 0.004 0.596
#> SRR2061424 4 0.5608 0.4697 0.096 0.120 0.024 0.760
#> SRR2061423 4 0.5864 -0.0302 0.024 0.484 0.004 0.488
#> SRR2061422 1 0.6654 0.7461 0.588 0.000 0.116 0.296
#> SRR2061421 1 0.6654 0.7461 0.588 0.000 0.116 0.296
#> SRR2061420 1 0.6452 0.5171 0.468 0.000 0.068 0.464
#> SRR2061419 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061418 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061417 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061415 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061416 1 0.6634 0.7475 0.592 0.000 0.116 0.292
#> SRR2061414 1 0.6634 0.7475 0.592 0.000 0.116 0.292
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.6732 0.525 0.000 0.600 0.068 0.148 0.184
#> SRR2061467 2 0.6732 0.525 0.000 0.600 0.068 0.148 0.184
#> SRR2061466 2 0.6732 0.525 0.000 0.600 0.068 0.148 0.184
#> SRR2061464 4 0.6990 0.358 0.000 0.080 0.144 0.572 0.204
#> SRR2061465 2 0.6732 0.525 0.000 0.600 0.068 0.148 0.184
#> SRR2061463 4 0.6990 0.358 0.000 0.080 0.144 0.572 0.204
#> SRR2061462 4 0.6990 0.358 0.000 0.080 0.144 0.572 0.204
#> SRR2061460 4 0.3797 0.822 0.232 0.004 0.000 0.756 0.008
#> SRR2061459 4 0.3797 0.822 0.232 0.004 0.000 0.756 0.008
#> SRR2061461 4 0.3797 0.822 0.232 0.004 0.000 0.756 0.008
#> SRR2061458 4 0.3550 0.824 0.236 0.004 0.000 0.760 0.000
#> SRR2061457 4 0.3550 0.824 0.236 0.004 0.000 0.760 0.000
#> SRR2061481 3 0.4583 0.167 0.000 0.000 0.672 0.032 0.296
#> SRR2061488 3 0.3796 0.757 0.000 0.300 0.700 0.000 0.000
#> SRR2061456 4 0.3550 0.824 0.236 0.004 0.000 0.760 0.000
#> SRR2061487 3 0.3796 0.757 0.000 0.300 0.700 0.000 0.000
#> SRR2061485 3 0.3774 0.758 0.000 0.296 0.704 0.000 0.000
#> SRR2061486 3 0.3796 0.757 0.000 0.300 0.700 0.000 0.000
#> SRR2061484 3 0.3774 0.758 0.000 0.296 0.704 0.000 0.000
#> SRR2061482 3 0.4583 0.167 0.000 0.000 0.672 0.032 0.296
#> SRR2061480 3 0.4583 0.167 0.000 0.000 0.672 0.032 0.296
#> SRR2061483 3 0.3774 0.758 0.000 0.296 0.704 0.000 0.000
#> SRR2061478 5 0.6391 0.984 0.068 0.004 0.252 0.064 0.612
#> SRR2061477 5 0.6391 0.984 0.068 0.004 0.252 0.064 0.612
#> SRR2061475 5 0.6148 0.995 0.068 0.000 0.256 0.056 0.620
#> SRR2061474 5 0.6148 0.995 0.068 0.000 0.256 0.056 0.620
#> SRR2061476 5 0.6148 0.995 0.068 0.000 0.256 0.056 0.620
#> SRR2061473 5 0.6148 0.995 0.068 0.000 0.256 0.056 0.620
#> SRR2061472 5 0.6148 0.995 0.068 0.000 0.256 0.056 0.620
#> SRR2061470 2 0.6732 0.525 0.000 0.600 0.068 0.148 0.184
#> SRR2061469 2 0.6732 0.525 0.000 0.600 0.068 0.148 0.184
#> SRR2061455 4 0.3550 0.824 0.236 0.004 0.000 0.760 0.000
#> SRR2061454 4 0.3550 0.824 0.236 0.004 0.000 0.760 0.000
#> SRR2061452 1 0.0510 0.920 0.984 0.000 0.000 0.000 0.016
#> SRR2061453 4 0.3550 0.824 0.236 0.004 0.000 0.760 0.000
#> SRR2061450 1 0.0510 0.920 0.984 0.000 0.000 0.000 0.016
#> SRR2061451 1 0.0510 0.920 0.984 0.000 0.000 0.000 0.016
#> SRR2061448 2 0.0162 0.701 0.004 0.996 0.000 0.000 0.000
#> SRR2061471 5 0.6148 0.995 0.068 0.000 0.256 0.056 0.620
#> SRR2061449 2 0.0162 0.701 0.004 0.996 0.000 0.000 0.000
#> SRR2061447 2 0.0162 0.701 0.004 0.996 0.000 0.000 0.000
#> SRR2061446 2 0.0566 0.699 0.004 0.984 0.012 0.000 0.000
#> SRR2061444 2 0.0566 0.699 0.004 0.984 0.012 0.000 0.000
#> SRR2061443 2 0.7923 0.380 0.012 0.476 0.252 0.096 0.164
#> SRR2061442 1 0.9626 -0.119 0.288 0.200 0.252 0.096 0.164
#> SRR2061441 2 0.7827 0.384 0.008 0.480 0.252 0.096 0.164
#> SRR2061445 2 0.0566 0.699 0.004 0.984 0.012 0.000 0.000
#> SRR2061439 1 0.0451 0.924 0.988 0.000 0.004 0.008 0.000
#> SRR2061440 1 0.0451 0.924 0.988 0.000 0.004 0.008 0.000
#> SRR2061437 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0451 0.924 0.988 0.000 0.004 0.008 0.000
#> SRR2061435 1 0.0451 0.924 0.988 0.000 0.004 0.008 0.000
#> SRR2061436 1 0.0162 0.926 0.996 0.000 0.000 0.000 0.004
#> SRR2061433 1 0.0162 0.926 0.996 0.000 0.000 0.000 0.004
#> SRR2061434 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.0324 0.699 0.004 0.992 0.004 0.000 0.000
#> SRR2061429 2 0.0324 0.699 0.004 0.992 0.004 0.000 0.000
#> SRR2061430 2 0.0324 0.699 0.004 0.992 0.004 0.000 0.000
#> SRR2061428 2 0.0162 0.701 0.004 0.996 0.000 0.000 0.000
#> SRR2061426 2 0.0162 0.701 0.004 0.996 0.000 0.000 0.000
#> SRR2061427 2 0.0162 0.701 0.004 0.996 0.000 0.000 0.000
#> SRR2061425 2 0.7718 0.386 0.004 0.484 0.252 0.096 0.164
#> SRR2061424 2 0.9669 0.117 0.228 0.260 0.252 0.096 0.164
#> SRR2061423 2 0.7718 0.386 0.004 0.484 0.252 0.096 0.164
#> SRR2061422 1 0.0451 0.924 0.988 0.000 0.004 0.008 0.000
#> SRR2061421 1 0.0613 0.923 0.984 0.000 0.004 0.008 0.004
#> SRR2061420 1 0.7188 0.330 0.560 0.000 0.180 0.100 0.160
#> SRR2061419 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.0162 0.926 0.996 0.000 0.000 0.000 0.004
#> SRR2061416 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.7698 0.5006 0.000 0.452 0.212 0.128 0.168 0.040
#> SRR2061467 2 0.7726 0.5002 0.000 0.448 0.212 0.132 0.168 0.040
#> SRR2061466 2 0.7726 0.5002 0.000 0.448 0.212 0.132 0.168 0.040
#> SRR2061464 4 0.6373 0.3642 0.000 0.024 0.116 0.500 0.336 0.024
#> SRR2061465 2 0.7726 0.5002 0.000 0.448 0.212 0.132 0.168 0.040
#> SRR2061463 4 0.6373 0.3642 0.000 0.024 0.116 0.500 0.336 0.024
#> SRR2061462 4 0.6373 0.3642 0.000 0.024 0.116 0.500 0.336 0.024
#> SRR2061460 4 0.3106 0.8309 0.140 0.000 0.004 0.832 0.012 0.012
#> SRR2061459 4 0.3106 0.8309 0.140 0.000 0.004 0.832 0.012 0.012
#> SRR2061461 4 0.3216 0.8305 0.140 0.000 0.008 0.828 0.012 0.012
#> SRR2061458 4 0.2734 0.8351 0.148 0.000 0.004 0.840 0.000 0.008
#> SRR2061457 4 0.2593 0.8355 0.148 0.000 0.000 0.844 0.000 0.008
#> SRR2061481 6 0.5868 -0.0399 0.000 0.000 0.404 0.020 0.116 0.460
#> SRR2061488 3 0.4859 0.9978 0.000 0.140 0.676 0.004 0.000 0.180
#> SRR2061456 4 0.2593 0.8355 0.148 0.000 0.000 0.844 0.000 0.008
#> SRR2061487 3 0.4859 0.9978 0.000 0.140 0.676 0.004 0.000 0.180
#> SRR2061485 3 0.4723 0.9978 0.000 0.140 0.680 0.000 0.000 0.180
#> SRR2061486 3 0.4859 0.9978 0.000 0.140 0.676 0.004 0.000 0.180
#> SRR2061484 3 0.4723 0.9978 0.000 0.140 0.680 0.000 0.000 0.180
#> SRR2061482 6 0.5868 -0.0399 0.000 0.000 0.404 0.020 0.116 0.460
#> SRR2061480 6 0.5868 -0.0399 0.000 0.000 0.404 0.020 0.116 0.460
#> SRR2061483 3 0.4723 0.9978 0.000 0.140 0.680 0.000 0.000 0.180
#> SRR2061478 6 0.2269 0.7923 0.080 0.000 0.000 0.012 0.012 0.896
#> SRR2061477 6 0.2269 0.7923 0.080 0.000 0.000 0.012 0.012 0.896
#> SRR2061475 6 0.1812 0.7975 0.080 0.000 0.000 0.008 0.000 0.912
#> SRR2061474 6 0.1812 0.7975 0.080 0.000 0.000 0.008 0.000 0.912
#> SRR2061476 6 0.1812 0.7975 0.080 0.000 0.000 0.008 0.000 0.912
#> SRR2061473 6 0.1700 0.7975 0.080 0.000 0.000 0.004 0.000 0.916
#> SRR2061472 6 0.1700 0.7975 0.080 0.000 0.000 0.004 0.000 0.916
#> SRR2061470 2 0.7698 0.5006 0.000 0.452 0.212 0.128 0.168 0.040
#> SRR2061469 2 0.7698 0.5006 0.000 0.452 0.212 0.128 0.168 0.040
#> SRR2061455 4 0.2734 0.8351 0.148 0.000 0.004 0.840 0.000 0.008
#> SRR2061454 4 0.2593 0.8355 0.148 0.000 0.000 0.844 0.000 0.008
#> SRR2061452 1 0.2375 0.9087 0.896 0.000 0.068 0.000 0.016 0.020
#> SRR2061453 4 0.2593 0.8355 0.148 0.000 0.000 0.844 0.000 0.008
#> SRR2061450 1 0.2375 0.9087 0.896 0.000 0.068 0.000 0.016 0.020
#> SRR2061451 1 0.2375 0.9087 0.896 0.000 0.068 0.000 0.016 0.020
#> SRR2061448 2 0.0000 0.7378 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061471 6 0.1700 0.7975 0.080 0.000 0.000 0.004 0.000 0.916
#> SRR2061449 2 0.0000 0.7378 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061447 2 0.0000 0.7378 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061446 2 0.1225 0.7109 0.000 0.956 0.004 0.004 0.032 0.004
#> SRR2061444 2 0.0790 0.7118 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR2061443 5 0.3489 0.8332 0.004 0.288 0.000 0.000 0.708 0.000
#> SRR2061442 5 0.4434 0.7808 0.116 0.172 0.000 0.000 0.712 0.000
#> SRR2061441 5 0.3489 0.8332 0.004 0.288 0.000 0.000 0.708 0.000
#> SRR2061445 2 0.1225 0.7109 0.000 0.956 0.004 0.004 0.032 0.004
#> SRR2061439 1 0.1476 0.9542 0.948 0.000 0.028 0.008 0.012 0.004
#> SRR2061440 1 0.1476 0.9542 0.948 0.000 0.028 0.008 0.012 0.004
#> SRR2061437 1 0.0000 0.9628 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.1476 0.9542 0.948 0.000 0.028 0.008 0.012 0.004
#> SRR2061435 1 0.1294 0.9556 0.956 0.000 0.024 0.008 0.008 0.004
#> SRR2061436 1 0.0692 0.9592 0.976 0.000 0.020 0.000 0.004 0.000
#> SRR2061433 1 0.0508 0.9600 0.984 0.000 0.012 0.000 0.004 0.000
#> SRR2061434 1 0.0363 0.9620 0.988 0.000 0.012 0.000 0.000 0.000
#> SRR2061432 1 0.0146 0.9624 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR2061431 2 0.0000 0.7378 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061429 2 0.0000 0.7378 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061430 2 0.0000 0.7378 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061428 2 0.0436 0.7362 0.000 0.988 0.004 0.004 0.000 0.004
#> SRR2061426 2 0.0436 0.7362 0.000 0.988 0.004 0.004 0.000 0.004
#> SRR2061427 2 0.0436 0.7362 0.000 0.988 0.004 0.004 0.000 0.004
#> SRR2061425 5 0.3489 0.8332 0.004 0.288 0.000 0.000 0.708 0.000
#> SRR2061424 5 0.4202 0.8188 0.064 0.224 0.000 0.000 0.712 0.000
#> SRR2061423 5 0.3371 0.8270 0.000 0.292 0.000 0.000 0.708 0.000
#> SRR2061422 1 0.1294 0.9556 0.956 0.000 0.024 0.008 0.008 0.004
#> SRR2061421 1 0.1476 0.9554 0.948 0.000 0.028 0.008 0.012 0.004
#> SRR2061420 5 0.4625 0.3880 0.348 0.000 0.028 0.008 0.612 0.004
#> SRR2061419 1 0.0603 0.9624 0.980 0.000 0.016 0.000 0.004 0.000
#> SRR2061418 1 0.0603 0.9624 0.980 0.000 0.016 0.000 0.004 0.000
#> SRR2061417 1 0.1067 0.9607 0.964 0.000 0.024 0.004 0.004 0.004
#> SRR2061415 1 0.0935 0.9550 0.964 0.000 0.032 0.000 0.004 0.000
#> SRR2061416 1 0.0603 0.9624 0.980 0.000 0.016 0.000 0.004 0.000
#> SRR2061414 1 0.0603 0.9624 0.980 0.000 0.016 0.000 0.004 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
SD:skmeans*
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"]
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 14886 rows and 74 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.998 0.999 0.5069 0.494 0.494
#> 3 3 1.000 0.979 0.984 0.2998 0.795 0.605
#> 4 4 1.000 0.976 0.983 0.1308 0.862 0.623
#> 5 5 0.928 0.950 0.966 0.0574 0.947 0.794
#> 6 6 0.940 0.908 0.910 0.0383 0.973 0.873
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 5
There is also optional best \(k\) = 2 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 0.998 0.000 1.000
#> SRR2061467 2 0.000 0.998 0.000 1.000
#> SRR2061466 2 0.000 0.998 0.000 1.000
#> SRR2061464 2 0.000 0.998 0.000 1.000
#> SRR2061465 2 0.000 0.998 0.000 1.000
#> SRR2061463 2 0.000 0.998 0.000 1.000
#> SRR2061462 2 0.000 0.998 0.000 1.000
#> SRR2061460 1 0.000 1.000 1.000 0.000
#> SRR2061459 1 0.000 1.000 1.000 0.000
#> SRR2061461 1 0.000 1.000 1.000 0.000
#> SRR2061458 1 0.000 1.000 1.000 0.000
#> SRR2061457 1 0.000 1.000 1.000 0.000
#> SRR2061481 2 0.000 0.998 0.000 1.000
#> SRR2061488 2 0.000 0.998 0.000 1.000
#> SRR2061456 1 0.000 1.000 1.000 0.000
#> SRR2061487 2 0.000 0.998 0.000 1.000
#> SRR2061485 2 0.000 0.998 0.000 1.000
#> SRR2061486 2 0.000 0.998 0.000 1.000
#> SRR2061484 2 0.000 0.998 0.000 1.000
#> SRR2061482 2 0.000 0.998 0.000 1.000
#> SRR2061480 2 0.000 0.998 0.000 1.000
#> SRR2061483 2 0.000 0.998 0.000 1.000
#> SRR2061478 1 0.000 1.000 1.000 0.000
#> SRR2061477 1 0.000 1.000 1.000 0.000
#> SRR2061475 1 0.000 1.000 1.000 0.000
#> SRR2061474 1 0.000 1.000 1.000 0.000
#> SRR2061476 1 0.000 1.000 1.000 0.000
#> SRR2061473 1 0.000 1.000 1.000 0.000
#> SRR2061472 1 0.000 1.000 1.000 0.000
#> SRR2061470 2 0.000 0.998 0.000 1.000
#> SRR2061469 2 0.000 0.998 0.000 1.000
#> SRR2061455 1 0.000 1.000 1.000 0.000
#> SRR2061454 1 0.000 1.000 1.000 0.000
#> SRR2061452 1 0.000 1.000 1.000 0.000
#> SRR2061453 1 0.000 1.000 1.000 0.000
#> SRR2061450 1 0.000 1.000 1.000 0.000
#> SRR2061451 1 0.000 1.000 1.000 0.000
#> SRR2061448 2 0.000 0.998 0.000 1.000
#> SRR2061471 1 0.000 1.000 1.000 0.000
#> SRR2061449 2 0.000 0.998 0.000 1.000
#> SRR2061447 2 0.000 0.998 0.000 1.000
#> SRR2061446 2 0.000 0.998 0.000 1.000
#> SRR2061444 2 0.000 0.998 0.000 1.000
#> SRR2061443 2 0.000 0.998 0.000 1.000
#> SRR2061442 2 0.311 0.941 0.056 0.944
#> SRR2061441 2 0.000 0.998 0.000 1.000
#> SRR2061445 2 0.000 0.998 0.000 1.000
#> SRR2061439 1 0.000 1.000 1.000 0.000
#> SRR2061440 1 0.000 1.000 1.000 0.000
#> SRR2061437 1 0.000 1.000 1.000 0.000
#> SRR2061438 1 0.000 1.000 1.000 0.000
#> SRR2061435 1 0.000 1.000 1.000 0.000
#> SRR2061436 1 0.000 1.000 1.000 0.000
#> SRR2061433 1 0.000 1.000 1.000 0.000
#> SRR2061434 1 0.000 1.000 1.000 0.000
#> SRR2061432 1 0.000 1.000 1.000 0.000
#> SRR2061431 2 0.000 0.998 0.000 1.000
#> SRR2061429 2 0.000 0.998 0.000 1.000
#> SRR2061430 2 0.000 0.998 0.000 1.000
#> SRR2061428 2 0.000 0.998 0.000 1.000
#> SRR2061426 2 0.000 0.998 0.000 1.000
#> SRR2061427 2 0.000 0.998 0.000 1.000
#> SRR2061425 2 0.000 0.998 0.000 1.000
#> SRR2061424 2 0.000 0.998 0.000 1.000
#> SRR2061423 2 0.000 0.998 0.000 1.000
#> SRR2061422 1 0.000 1.000 1.000 0.000
#> SRR2061421 1 0.000 1.000 1.000 0.000
#> SRR2061420 1 0.000 1.000 1.000 0.000
#> SRR2061419 1 0.000 1.000 1.000 0.000
#> SRR2061418 1 0.000 1.000 1.000 0.000
#> SRR2061417 1 0.000 1.000 1.000 0.000
#> SRR2061415 1 0.000 1.000 1.000 0.000
#> SRR2061416 1 0.000 1.000 1.000 0.000
#> SRR2061414 1 0.000 1.000 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061464 2 0.0592 0.983 0.000 0.988 0.012
#> SRR2061465 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061463 2 0.0592 0.983 0.000 0.988 0.012
#> SRR2061462 2 0.0592 0.983 0.000 0.988 0.012
#> SRR2061460 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061459 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061461 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061458 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061457 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061481 3 0.0592 0.974 0.000 0.012 0.988
#> SRR2061488 3 0.1964 0.960 0.000 0.056 0.944
#> SRR2061456 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061487 3 0.1964 0.960 0.000 0.056 0.944
#> SRR2061485 3 0.1964 0.960 0.000 0.056 0.944
#> SRR2061486 3 0.1964 0.960 0.000 0.056 0.944
#> SRR2061484 3 0.1964 0.960 0.000 0.056 0.944
#> SRR2061482 3 0.0592 0.974 0.000 0.012 0.988
#> SRR2061480 3 0.0592 0.974 0.000 0.012 0.988
#> SRR2061483 3 0.1964 0.960 0.000 0.056 0.944
#> SRR2061478 3 0.0592 0.975 0.012 0.000 0.988
#> SRR2061477 3 0.0592 0.975 0.012 0.000 0.988
#> SRR2061475 3 0.0592 0.975 0.012 0.000 0.988
#> SRR2061474 3 0.0592 0.975 0.012 0.000 0.988
#> SRR2061476 3 0.0592 0.975 0.012 0.000 0.988
#> SRR2061473 3 0.0592 0.975 0.012 0.000 0.988
#> SRR2061472 3 0.0592 0.975 0.012 0.000 0.988
#> SRR2061470 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061455 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061454 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061452 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061453 1 0.1964 0.962 0.944 0.000 0.056
#> SRR2061450 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061448 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061471 3 0.0592 0.975 0.012 0.000 0.988
#> SRR2061449 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061447 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061446 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061444 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061443 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061442 2 0.3116 0.877 0.108 0.892 0.000
#> SRR2061441 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061445 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061439 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061440 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061437 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061438 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061435 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061431 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061425 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061424 2 0.1643 0.948 0.044 0.956 0.000
#> SRR2061423 2 0.0000 0.992 0.000 1.000 0.000
#> SRR2061422 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061420 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061419 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061418 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061417 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061415 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061416 1 0.0000 0.984 1.000 0.000 0.000
#> SRR2061414 1 0.0000 0.984 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.1302 0.962 0.000 0.956 0.000 0.044
#> SRR2061467 2 0.1302 0.962 0.000 0.956 0.000 0.044
#> SRR2061466 2 0.1302 0.962 0.000 0.956 0.000 0.044
#> SRR2061464 4 0.0188 0.971 0.000 0.000 0.004 0.996
#> SRR2061465 2 0.1302 0.962 0.000 0.956 0.000 0.044
#> SRR2061463 4 0.0188 0.971 0.000 0.000 0.004 0.996
#> SRR2061462 4 0.0188 0.971 0.000 0.000 0.004 0.996
#> SRR2061460 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061459 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061461 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061458 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061457 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061481 3 0.0000 0.972 0.000 0.000 1.000 0.000
#> SRR2061488 3 0.1637 0.952 0.000 0.060 0.940 0.000
#> SRR2061456 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061487 3 0.1637 0.952 0.000 0.060 0.940 0.000
#> SRR2061485 3 0.1637 0.952 0.000 0.060 0.940 0.000
#> SRR2061486 3 0.1637 0.952 0.000 0.060 0.940 0.000
#> SRR2061484 3 0.1637 0.952 0.000 0.060 0.940 0.000
#> SRR2061482 3 0.0000 0.972 0.000 0.000 1.000 0.000
#> SRR2061480 3 0.0000 0.972 0.000 0.000 1.000 0.000
#> SRR2061483 3 0.1637 0.952 0.000 0.060 0.940 0.000
#> SRR2061478 3 0.0188 0.973 0.000 0.000 0.996 0.004
#> SRR2061477 3 0.0188 0.973 0.000 0.000 0.996 0.004
#> SRR2061475 3 0.0188 0.973 0.000 0.000 0.996 0.004
#> SRR2061474 3 0.0188 0.973 0.000 0.000 0.996 0.004
#> SRR2061476 3 0.0188 0.973 0.000 0.000 0.996 0.004
#> SRR2061473 3 0.0188 0.973 0.000 0.000 0.996 0.004
#> SRR2061472 3 0.0188 0.973 0.000 0.000 0.996 0.004
#> SRR2061470 2 0.1302 0.962 0.000 0.956 0.000 0.044
#> SRR2061469 2 0.1302 0.962 0.000 0.956 0.000 0.044
#> SRR2061455 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061454 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061452 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061453 4 0.0921 0.990 0.028 0.000 0.000 0.972
#> SRR2061450 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061448 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061471 3 0.0188 0.973 0.000 0.000 0.996 0.004
#> SRR2061449 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061447 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061446 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061444 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061443 2 0.1296 0.964 0.004 0.964 0.004 0.028
#> SRR2061442 1 0.2400 0.924 0.924 0.044 0.004 0.028
#> SRR2061441 2 0.1109 0.967 0.000 0.968 0.004 0.028
#> SRR2061445 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061439 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061429 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061430 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061428 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061426 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061427 2 0.0000 0.981 0.000 1.000 0.000 0.000
#> SRR2061425 2 0.1109 0.967 0.000 0.968 0.004 0.028
#> SRR2061424 1 0.3366 0.866 0.872 0.096 0.004 0.028
#> SRR2061423 2 0.1109 0.967 0.000 0.968 0.004 0.028
#> SRR2061422 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061420 1 0.0921 0.965 0.972 0.000 0.000 0.028
#> SRR2061419 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061415 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.989 1.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.104 0.969 0.000 0.960 0.000 0.000 0.040
#> SRR2061467 2 0.104 0.969 0.000 0.960 0.000 0.000 0.040
#> SRR2061466 2 0.104 0.969 0.000 0.960 0.000 0.000 0.040
#> SRR2061464 4 0.318 0.806 0.000 0.000 0.000 0.792 0.208
#> SRR2061465 2 0.104 0.969 0.000 0.960 0.000 0.000 0.040
#> SRR2061463 4 0.318 0.806 0.000 0.000 0.000 0.792 0.208
#> SRR2061462 4 0.318 0.806 0.000 0.000 0.000 0.792 0.208
#> SRR2061460 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061459 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061461 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061458 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061457 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061481 3 0.088 0.927 0.000 0.000 0.968 0.000 0.032
#> SRR2061488 3 0.318 0.881 0.000 0.124 0.844 0.000 0.032
#> SRR2061456 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061487 3 0.318 0.881 0.000 0.124 0.844 0.000 0.032
#> SRR2061485 3 0.318 0.881 0.000 0.124 0.844 0.000 0.032
#> SRR2061486 3 0.318 0.881 0.000 0.124 0.844 0.000 0.032
#> SRR2061484 3 0.318 0.881 0.000 0.124 0.844 0.000 0.032
#> SRR2061482 3 0.088 0.927 0.000 0.000 0.968 0.000 0.032
#> SRR2061480 3 0.088 0.927 0.000 0.000 0.968 0.000 0.032
#> SRR2061483 3 0.318 0.881 0.000 0.124 0.844 0.000 0.032
#> SRR2061478 3 0.000 0.930 0.000 0.000 1.000 0.000 0.000
#> SRR2061477 3 0.000 0.930 0.000 0.000 1.000 0.000 0.000
#> SRR2061475 3 0.000 0.930 0.000 0.000 1.000 0.000 0.000
#> SRR2061474 3 0.000 0.930 0.000 0.000 1.000 0.000 0.000
#> SRR2061476 3 0.000 0.930 0.000 0.000 1.000 0.000 0.000
#> SRR2061473 3 0.000 0.930 0.000 0.000 1.000 0.000 0.000
#> SRR2061472 3 0.000 0.930 0.000 0.000 1.000 0.000 0.000
#> SRR2061470 2 0.104 0.969 0.000 0.960 0.000 0.000 0.040
#> SRR2061469 2 0.104 0.969 0.000 0.960 0.000 0.000 0.040
#> SRR2061455 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061454 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061452 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.000 0.944 0.000 0.000 0.000 1.000 0.000
#> SRR2061450 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061448 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061471 3 0.000 0.930 0.000 0.000 1.000 0.000 0.000
#> SRR2061449 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061447 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061446 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061444 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061443 5 0.161 0.927 0.000 0.072 0.000 0.000 0.928
#> SRR2061442 5 0.192 0.913 0.036 0.036 0.000 0.000 0.928
#> SRR2061441 5 0.161 0.927 0.000 0.072 0.000 0.000 0.928
#> SRR2061445 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061439 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061437 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061429 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061430 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061428 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061426 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061427 2 0.000 0.984 0.000 1.000 0.000 0.000 0.000
#> SRR2061425 5 0.161 0.927 0.000 0.072 0.000 0.000 0.928
#> SRR2061424 5 0.192 0.916 0.032 0.040 0.000 0.000 0.928
#> SRR2061423 5 0.161 0.927 0.000 0.072 0.000 0.000 0.928
#> SRR2061422 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061421 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061420 5 0.340 0.695 0.236 0.000 0.000 0.000 0.764
#> SRR2061419 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.0458 0.726 0.000 0.984 0.016 0.000 0.000 0.000
#> SRR2061467 2 0.0458 0.726 0.000 0.984 0.016 0.000 0.000 0.000
#> SRR2061466 2 0.0458 0.726 0.000 0.984 0.016 0.000 0.000 0.000
#> SRR2061464 4 0.5600 0.501 0.000 0.332 0.000 0.508 0.160 0.000
#> SRR2061465 2 0.0458 0.726 0.000 0.984 0.016 0.000 0.000 0.000
#> SRR2061463 4 0.5600 0.501 0.000 0.332 0.000 0.508 0.160 0.000
#> SRR2061462 4 0.5600 0.501 0.000 0.332 0.000 0.508 0.160 0.000
#> SRR2061460 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061459 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061461 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061458 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061457 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061481 3 0.3330 0.962 0.000 0.000 0.716 0.000 0.000 0.284
#> SRR2061488 3 0.3151 0.982 0.000 0.000 0.748 0.000 0.000 0.252
#> SRR2061456 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061487 3 0.3151 0.982 0.000 0.000 0.748 0.000 0.000 0.252
#> SRR2061485 3 0.3151 0.982 0.000 0.000 0.748 0.000 0.000 0.252
#> SRR2061486 3 0.3151 0.982 0.000 0.000 0.748 0.000 0.000 0.252
#> SRR2061484 3 0.3151 0.982 0.000 0.000 0.748 0.000 0.000 0.252
#> SRR2061482 3 0.3330 0.962 0.000 0.000 0.716 0.000 0.000 0.284
#> SRR2061480 3 0.3330 0.962 0.000 0.000 0.716 0.000 0.000 0.284
#> SRR2061483 3 0.3151 0.982 0.000 0.000 0.748 0.000 0.000 0.252
#> SRR2061478 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061477 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061475 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061474 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061476 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061473 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061472 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061470 2 0.0458 0.726 0.000 0.984 0.016 0.000 0.000 0.000
#> SRR2061469 2 0.0458 0.726 0.000 0.984 0.016 0.000 0.000 0.000
#> SRR2061455 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061454 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061452 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061450 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061448 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061471 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061449 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061447 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061446 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061444 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061443 5 0.0000 0.942 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061442 5 0.0458 0.928 0.016 0.000 0.000 0.000 0.984 0.000
#> SRR2061441 5 0.0000 0.942 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061445 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061439 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061429 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061430 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061428 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061426 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061427 2 0.4456 0.872 0.000 0.668 0.268 0.000 0.064 0.000
#> SRR2061425 5 0.0000 0.942 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061424 5 0.0000 0.942 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061423 5 0.0000 0.942 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061422 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061420 5 0.2969 0.680 0.224 0.000 0.000 0.000 0.776 0.000
#> SRR2061419 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
SD:pam*
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or k-1.
The detailed explanations of these statistics can be found in the cola
vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)

The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.981 0.993 0.5031 0.496 0.496
#> 3 3 0.957 0.956 0.981 0.2501 0.862 0.727
#> 4 4 0.960 0.957 0.981 0.1550 0.882 0.695
#> 5 5 1.000 0.979 0.993 0.0634 0.936 0.774
#> 6 6 0.930 0.874 0.928 0.0589 0.929 0.703
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 5
There is also optional best \(k\) = 2 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.0000 0.987 0.000 1.000
#> SRR2061467 2 0.0000 0.987 0.000 1.000
#> SRR2061466 2 0.0000 0.987 0.000 1.000
#> SRR2061464 2 0.0000 0.987 0.000 1.000
#> SRR2061465 2 0.0000 0.987 0.000 1.000
#> SRR2061463 2 0.0000 0.987 0.000 1.000
#> SRR2061462 2 0.0000 0.987 0.000 1.000
#> SRR2061460 1 0.0000 0.997 1.000 0.000
#> SRR2061459 1 0.0000 0.997 1.000 0.000
#> SRR2061461 1 0.0000 0.997 1.000 0.000
#> SRR2061458 1 0.0000 0.997 1.000 0.000
#> SRR2061457 1 0.0000 0.997 1.000 0.000
#> SRR2061481 2 0.0000 0.987 0.000 1.000
#> SRR2061488 2 0.0000 0.987 0.000 1.000
#> SRR2061456 1 0.0000 0.997 1.000 0.000
#> SRR2061487 2 0.0000 0.987 0.000 1.000
#> SRR2061485 2 0.0000 0.987 0.000 1.000
#> SRR2061486 2 0.0000 0.987 0.000 1.000
#> SRR2061484 2 0.0000 0.987 0.000 1.000
#> SRR2061482 2 0.0000 0.987 0.000 1.000
#> SRR2061480 2 0.0000 0.987 0.000 1.000
#> SRR2061483 2 0.0000 0.987 0.000 1.000
#> SRR2061478 1 0.0000 0.997 1.000 0.000
#> SRR2061477 1 0.0000 0.997 1.000 0.000
#> SRR2061475 1 0.0000 0.997 1.000 0.000
#> SRR2061474 1 0.0000 0.997 1.000 0.000
#> SRR2061476 1 0.0000 0.997 1.000 0.000
#> SRR2061473 1 0.0000 0.997 1.000 0.000
#> SRR2061472 1 0.0000 0.997 1.000 0.000
#> SRR2061470 2 0.0000 0.987 0.000 1.000
#> SRR2061469 2 0.0000 0.987 0.000 1.000
#> SRR2061455 1 0.0000 0.997 1.000 0.000
#> SRR2061454 1 0.0000 0.997 1.000 0.000
#> SRR2061452 1 0.0000 0.997 1.000 0.000
#> SRR2061453 1 0.0000 0.997 1.000 0.000
#> SRR2061450 1 0.0000 0.997 1.000 0.000
#> SRR2061451 1 0.0000 0.997 1.000 0.000
#> SRR2061448 2 0.0000 0.987 0.000 1.000
#> SRR2061471 1 0.0000 0.997 1.000 0.000
#> SRR2061449 2 0.0000 0.987 0.000 1.000
#> SRR2061447 2 0.0000 0.987 0.000 1.000
#> SRR2061446 2 0.0000 0.987 0.000 1.000
#> SRR2061444 2 0.0000 0.987 0.000 1.000
#> SRR2061443 2 0.9815 0.269 0.420 0.580
#> SRR2061442 1 0.0376 0.993 0.996 0.004
#> SRR2061441 2 0.0000 0.987 0.000 1.000
#> SRR2061445 2 0.0000 0.987 0.000 1.000
#> SRR2061439 1 0.0000 0.997 1.000 0.000
#> SRR2061440 1 0.0000 0.997 1.000 0.000
#> SRR2061437 1 0.0000 0.997 1.000 0.000
#> SRR2061438 1 0.0000 0.997 1.000 0.000
#> SRR2061435 1 0.0000 0.997 1.000 0.000
#> SRR2061436 1 0.0000 0.997 1.000 0.000
#> SRR2061433 1 0.0000 0.997 1.000 0.000
#> SRR2061434 1 0.0000 0.997 1.000 0.000
#> SRR2061432 1 0.0000 0.997 1.000 0.000
#> SRR2061431 2 0.0000 0.987 0.000 1.000
#> SRR2061429 2 0.0000 0.987 0.000 1.000
#> SRR2061430 2 0.0000 0.987 0.000 1.000
#> SRR2061428 2 0.0000 0.987 0.000 1.000
#> SRR2061426 2 0.0000 0.987 0.000 1.000
#> SRR2061427 2 0.0000 0.987 0.000 1.000
#> SRR2061425 2 0.0000 0.987 0.000 1.000
#> SRR2061424 1 0.5294 0.861 0.880 0.120
#> SRR2061423 2 0.0000 0.987 0.000 1.000
#> SRR2061422 1 0.0000 0.997 1.000 0.000
#> SRR2061421 1 0.0000 0.997 1.000 0.000
#> SRR2061420 1 0.0000 0.997 1.000 0.000
#> SRR2061419 1 0.0000 0.997 1.000 0.000
#> SRR2061418 1 0.0000 0.997 1.000 0.000
#> SRR2061417 1 0.0000 0.997 1.000 0.000
#> SRR2061415 1 0.0000 0.997 1.000 0.000
#> SRR2061416 1 0.0000 0.997 1.000 0.000
#> SRR2061414 1 0.0000 0.997 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061467 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061466 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061464 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061465 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061463 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061462 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061460 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061459 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061461 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061458 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061457 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061481 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061488 2 0.450 0.778 0.000 0.804 0.196
#> SRR2061456 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061487 2 0.412 0.811 0.000 0.832 0.168
#> SRR2061485 2 0.334 0.860 0.000 0.880 0.120
#> SRR2061486 2 0.455 0.773 0.000 0.800 0.200
#> SRR2061484 2 0.312 0.870 0.000 0.892 0.108
#> SRR2061482 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061480 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061483 2 0.341 0.856 0.000 0.876 0.124
#> SRR2061478 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061477 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061475 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061474 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061476 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061473 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061472 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061470 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061469 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061455 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061454 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061452 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061453 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061450 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061451 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061448 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061471 3 0.000 1.000 0.000 0.000 1.000
#> SRR2061449 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061447 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061446 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061444 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061443 2 0.627 0.147 0.456 0.544 0.000
#> SRR2061442 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061441 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061445 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061439 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061440 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061437 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061438 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061435 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061436 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061433 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061434 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061432 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061431 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061429 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061430 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061428 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061426 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061427 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061425 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061424 1 0.207 0.928 0.940 0.060 0.000
#> SRR2061423 2 0.000 0.949 0.000 1.000 0.000
#> SRR2061422 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061421 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061420 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061419 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061418 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061417 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061415 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061416 1 0.000 0.998 1.000 0.000 0.000
#> SRR2061414 1 0.000 0.998 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061467 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061466 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061464 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061465 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061463 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061462 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061460 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061459 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061461 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061458 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061457 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061481 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061488 2 0.357 0.782 0.000 0.804 0.196 0
#> SRR2061456 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061487 2 0.327 0.814 0.000 0.832 0.168 0
#> SRR2061485 2 0.265 0.861 0.000 0.880 0.120 0
#> SRR2061486 2 0.361 0.777 0.000 0.800 0.200 0
#> SRR2061484 2 0.247 0.871 0.000 0.892 0.108 0
#> SRR2061482 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061480 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061483 2 0.270 0.858 0.000 0.876 0.124 0
#> SRR2061478 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061477 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061475 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061474 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061476 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061473 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061472 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061470 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061469 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061455 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061454 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061452 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061453 4 0.000 1.000 0.000 0.000 0.000 1
#> SRR2061450 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061451 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061448 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061471 3 0.000 1.000 0.000 0.000 1.000 0
#> SRR2061449 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061447 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061446 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061444 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061443 2 0.497 0.141 0.456 0.544 0.000 0
#> SRR2061442 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061441 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061445 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061439 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061440 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061437 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061438 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061435 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061436 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061433 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061434 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061432 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061431 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061429 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061430 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061428 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061426 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061427 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061425 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061424 1 0.164 0.928 0.940 0.060 0.000 0
#> SRR2061423 2 0.000 0.945 0.000 1.000 0.000 0
#> SRR2061422 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061421 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061420 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061419 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061418 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061417 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061415 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061416 1 0.000 0.997 1.000 0.000 0.000 0
#> SRR2061414 1 0.000 0.997 1.000 0.000 0.000 0
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061467 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061466 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061464 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061465 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061463 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061462 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061460 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061459 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061461 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061458 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061457 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061481 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061488 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061456 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061487 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061485 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061486 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061484 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061482 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061480 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061483 3 0.000 1.000 0.000 0.000 1 0 0
#> SRR2061478 5 0.000 1.000 0.000 0.000 0 0 1
#> SRR2061477 5 0.000 1.000 0.000 0.000 0 0 1
#> SRR2061475 5 0.000 1.000 0.000 0.000 0 0 1
#> SRR2061474 5 0.000 1.000 0.000 0.000 0 0 1
#> SRR2061476 5 0.000 1.000 0.000 0.000 0 0 1
#> SRR2061473 5 0.000 1.000 0.000 0.000 0 0 1
#> SRR2061472 5 0.000 1.000 0.000 0.000 0 0 1
#> SRR2061470 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061469 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061455 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061454 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061452 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061453 4 0.000 1.000 0.000 0.000 0 1 0
#> SRR2061450 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061451 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061448 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061471 5 0.000 1.000 0.000 0.000 0 0 1
#> SRR2061449 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061447 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061446 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061444 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061443 2 0.428 0.154 0.456 0.544 0 0 0
#> SRR2061442 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061441 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061445 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061439 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061440 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061437 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061438 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061435 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061436 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061433 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061434 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061432 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061431 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061429 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061430 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061428 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061426 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061427 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061425 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061424 1 0.141 0.925 0.940 0.060 0 0 0
#> SRR2061423 2 0.000 0.973 0.000 1.000 0 0 0
#> SRR2061422 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061421 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061420 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061419 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061418 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061417 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061415 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061416 1 0.000 0.997 1.000 0.000 0 0 0
#> SRR2061414 1 0.000 0.997 1.000 0.000 0 0 0
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.000 0.586 0.000 1.000 0 0 0.000 0
#> SRR2061467 2 0.000 0.586 0.000 1.000 0 0 0.000 0
#> SRR2061466 2 0.000 0.586 0.000 1.000 0 0 0.000 0
#> SRR2061464 5 0.375 0.567 0.000 0.396 0 0 0.604 0
#> SRR2061465 2 0.000 0.586 0.000 1.000 0 0 0.000 0
#> SRR2061463 5 0.375 0.567 0.000 0.396 0 0 0.604 0
#> SRR2061462 5 0.375 0.567 0.000 0.396 0 0 0.604 0
#> SRR2061460 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061459 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061461 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061458 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061457 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061481 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061488 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061456 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061487 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061485 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061486 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061484 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061482 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061480 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061483 3 0.000 1.000 0.000 0.000 1 0 0.000 0
#> SRR2061478 6 0.000 1.000 0.000 0.000 0 0 0.000 1
#> SRR2061477 6 0.000 1.000 0.000 0.000 0 0 0.000 1
#> SRR2061475 6 0.000 1.000 0.000 0.000 0 0 0.000 1
#> SRR2061474 6 0.000 1.000 0.000 0.000 0 0 0.000 1
#> SRR2061476 6 0.000 1.000 0.000 0.000 0 0 0.000 1
#> SRR2061473 6 0.000 1.000 0.000 0.000 0 0 0.000 1
#> SRR2061472 6 0.000 1.000 0.000 0.000 0 0 0.000 1
#> SRR2061470 2 0.000 0.586 0.000 1.000 0 0 0.000 0
#> SRR2061469 2 0.000 0.586 0.000 1.000 0 0 0.000 0
#> SRR2061455 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061454 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061452 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061453 4 0.000 1.000 0.000 0.000 0 1 0.000 0
#> SRR2061450 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061451 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061448 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061471 6 0.000 1.000 0.000 0.000 0 0 0.000 1
#> SRR2061449 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061447 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061446 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061444 2 0.387 0.668 0.000 0.508 0 0 0.492 0
#> SRR2061443 5 0.000 0.669 0.000 0.000 0 0 1.000 0
#> SRR2061442 5 0.256 0.624 0.172 0.000 0 0 0.828 0
#> SRR2061441 5 0.000 0.669 0.000 0.000 0 0 1.000 0
#> SRR2061445 2 0.387 0.668 0.000 0.508 0 0 0.492 0
#> SRR2061439 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061440 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061437 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061438 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061435 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061436 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061433 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061434 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061432 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061431 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061429 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061430 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061428 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061426 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061427 2 0.375 0.780 0.000 0.604 0 0 0.396 0
#> SRR2061425 5 0.000 0.669 0.000 0.000 0 0 1.000 0
#> SRR2061424 5 0.000 0.669 0.000 0.000 0 0 1.000 0
#> SRR2061423 5 0.000 0.669 0.000 0.000 0 0 1.000 0
#> SRR2061422 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061421 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061420 5 0.375 0.324 0.396 0.000 0 0 0.604 0
#> SRR2061419 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061418 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061417 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061415 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061416 1 0.000 1.000 1.000 0.000 0 0 0.000 0
#> SRR2061414 1 0.000 1.000 1.000 0.000 0 0 0.000 0
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.
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.
SD:mclust**
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.3594 0.641 0.641
#> 3 3 0.746 0.907 0.809 0.7717 0.486 0.319
#> 4 4 1.000 0.992 0.997 0.1927 0.887 0.680
#> 5 5 1.000 0.997 0.999 0.0396 0.970 0.875
#> 6 6 1.000 0.996 0.998 0.0330 0.959 0.813
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 4 5
There is also optional best \(k\) = 2 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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 1 0 1 1 0
#> SRR2061467 1 0 1 1 0
#> SRR2061466 1 0 1 1 0
#> SRR2061464 1 0 1 1 0
#> SRR2061465 1 0 1 1 0
#> SRR2061463 1 0 1 1 0
#> SRR2061462 1 0 1 1 0
#> SRR2061460 1 0 1 1 0
#> SRR2061459 1 0 1 1 0
#> SRR2061461 1 0 1 1 0
#> SRR2061458 1 0 1 1 0
#> SRR2061457 1 0 1 1 0
#> SRR2061481 2 0 1 0 1
#> SRR2061488 2 0 1 0 1
#> SRR2061456 1 0 1 1 0
#> SRR2061487 2 0 1 0 1
#> SRR2061485 2 0 1 0 1
#> SRR2061486 2 0 1 0 1
#> SRR2061484 2 0 1 0 1
#> SRR2061482 2 0 1 0 1
#> SRR2061480 2 0 1 0 1
#> SRR2061483 2 0 1 0 1
#> SRR2061478 2 0 1 0 1
#> SRR2061477 2 0 1 0 1
#> SRR2061475 2 0 1 0 1
#> SRR2061474 2 0 1 0 1
#> SRR2061476 2 0 1 0 1
#> SRR2061473 2 0 1 0 1
#> SRR2061472 2 0 1 0 1
#> SRR2061470 1 0 1 1 0
#> SRR2061469 1 0 1 1 0
#> SRR2061455 1 0 1 1 0
#> SRR2061454 1 0 1 1 0
#> SRR2061452 1 0 1 1 0
#> SRR2061453 1 0 1 1 0
#> SRR2061450 1 0 1 1 0
#> SRR2061451 1 0 1 1 0
#> SRR2061448 1 0 1 1 0
#> SRR2061471 2 0 1 0 1
#> SRR2061449 1 0 1 1 0
#> SRR2061447 1 0 1 1 0
#> SRR2061446 1 0 1 1 0
#> SRR2061444 1 0 1 1 0
#> SRR2061443 1 0 1 1 0
#> SRR2061442 1 0 1 1 0
#> SRR2061441 1 0 1 1 0
#> SRR2061445 1 0 1 1 0
#> SRR2061439 1 0 1 1 0
#> SRR2061440 1 0 1 1 0
#> SRR2061437 1 0 1 1 0
#> SRR2061438 1 0 1 1 0
#> SRR2061435 1 0 1 1 0
#> SRR2061436 1 0 1 1 0
#> SRR2061433 1 0 1 1 0
#> SRR2061434 1 0 1 1 0
#> SRR2061432 1 0 1 1 0
#> SRR2061431 1 0 1 1 0
#> SRR2061429 1 0 1 1 0
#> SRR2061430 1 0 1 1 0
#> SRR2061428 1 0 1 1 0
#> SRR2061426 1 0 1 1 0
#> SRR2061427 1 0 1 1 0
#> SRR2061425 1 0 1 1 0
#> SRR2061424 1 0 1 1 0
#> SRR2061423 1 0 1 1 0
#> SRR2061422 1 0 1 1 0
#> SRR2061421 1 0 1 1 0
#> SRR2061420 1 0 1 1 0
#> SRR2061419 1 0 1 1 0
#> SRR2061418 1 0 1 1 0
#> SRR2061417 1 0 1 1 0
#> SRR2061415 1 0 1 1 0
#> SRR2061416 1 0 1 1 0
#> SRR2061414 1 0 1 1 0
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061467 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061466 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061464 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061465 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061463 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061462 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061460 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061459 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061461 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061458 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061457 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061481 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061488 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061456 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061487 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061485 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061486 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061484 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061482 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061480 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061483 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061478 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061477 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061475 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061474 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061476 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061473 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061472 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061470 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061469 3 0.141 0.809 0.000 0.036 0.964
#> SRR2061455 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061454 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061452 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061453 3 0.141 0.810 0.036 0.000 0.964
#> SRR2061450 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061451 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061448 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061471 3 0.601 0.812 0.000 0.372 0.628
#> SRR2061449 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061447 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061446 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061444 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061443 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061442 2 0.611 0.951 0.396 0.604 0.000
#> SRR2061441 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061445 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061439 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061440 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061437 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061438 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061435 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061436 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061433 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061434 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061432 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061431 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061429 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061430 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061428 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061426 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061427 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061425 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061424 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061423 2 0.601 0.992 0.372 0.628 0.000
#> SRR2061422 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061421 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061420 2 0.621 0.897 0.428 0.572 0.000
#> SRR2061419 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061418 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061417 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061415 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061416 1 0.000 1.000 1.000 0.000 0.000
#> SRR2061414 1 0.000 1.000 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061467 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061466 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061464 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061465 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061463 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061462 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061460 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061459 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061461 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061458 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061457 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061481 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061488 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061456 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061487 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061485 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061486 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061484 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061482 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061480 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061483 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061478 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061477 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061475 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061474 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061476 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061473 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061472 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061470 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061469 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061455 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061454 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061452 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061453 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061450 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061451 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061448 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061471 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061449 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061447 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061446 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061444 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061443 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061442 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061441 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061445 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061439 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061440 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061437 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061438 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061435 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061436 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061433 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061434 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061432 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061431 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061429 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061430 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061428 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061426 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061427 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061425 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061424 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061423 2 0.000 0.986 0.000 1.000 0 0
#> SRR2061422 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061421 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061420 2 0.401 0.677 0.244 0.756 0 0
#> SRR2061419 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061418 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061417 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061415 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061416 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061414 1 0.000 1.000 1.000 0.000 0 0
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061467 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061466 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061464 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061465 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061463 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061462 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061460 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061459 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061461 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061458 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061457 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061481 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061488 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061456 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061487 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061485 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061486 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061484 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061482 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061480 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061483 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061478 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061477 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061475 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061474 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061476 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061473 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061472 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061470 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061469 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061455 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061454 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061452 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061453 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061450 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061451 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061448 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061471 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061449 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061447 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061446 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061444 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061443 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061442 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061441 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061445 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061439 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061440 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061437 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061438 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061435 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061436 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061433 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061434 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061432 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061431 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061429 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061430 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061428 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061426 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061427 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061425 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061424 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061423 5 0.000 0.994 0.000 0 0 0 1.000
#> SRR2061422 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061421 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061420 5 0.191 0.885 0.092 0 0 0 0.908
#> SRR2061419 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061418 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061417 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061415 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061416 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061414 1 0.000 1.000 1.000 0 0 0 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061467 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061466 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061464 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061465 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061463 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061462 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061460 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061459 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061461 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061458 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061457 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061481 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061488 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061456 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061487 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061485 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061486 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061484 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061482 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061480 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061483 3 0.000 1.000 0.00 0 1 0 0.00 0
#> SRR2061478 6 0.000 1.000 0.00 0 0 0 0.00 1
#> SRR2061477 6 0.000 1.000 0.00 0 0 0 0.00 1
#> SRR2061475 6 0.000 1.000 0.00 0 0 0 0.00 1
#> SRR2061474 6 0.000 1.000 0.00 0 0 0 0.00 1
#> SRR2061476 6 0.000 1.000 0.00 0 0 0 0.00 1
#> SRR2061473 6 0.000 1.000 0.00 0 0 0 0.00 1
#> SRR2061472 6 0.000 1.000 0.00 0 0 0 0.00 1
#> SRR2061470 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061469 2 0.000 1.000 0.00 1 0 0 0.00 0
#> SRR2061455 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061454 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061452 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061453 4 0.000 1.000 0.00 0 0 1 0.00 0
#> SRR2061450 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061451 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061448 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061471 6 0.000 1.000 0.00 0 0 0 0.00 1
#> SRR2061449 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061447 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061446 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061444 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061443 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061442 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061441 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061445 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061439 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061440 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061437 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061438 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061435 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061436 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061433 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061434 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061432 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061431 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061429 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061430 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061428 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061426 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061427 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061425 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061424 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061423 5 0.000 1.000 0.00 0 0 0 1.00 0
#> SRR2061422 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061421 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061420 1 0.205 0.849 0.88 0 0 0 0.12 0
#> SRR2061419 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061418 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061417 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061415 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061416 1 0.000 0.993 1.00 0 0 0 0.00 0
#> SRR2061414 1 0.000 0.993 1.00 0 0 0 0.00 0
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.
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.
SD:NMF**
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.542 0.872 0.907 0.4924 0.496 0.496
#> 3 3 1.000 0.971 0.985 0.2999 0.735 0.526
#> 4 4 0.860 0.845 0.929 0.1242 0.808 0.537
#> 5 5 0.675 0.695 0.838 0.0254 0.974 0.913
#> 6 6 0.751 0.635 0.855 0.0765 0.914 0.705
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 0.915 0.000 1.000
#> SRR2061467 2 0.000 0.915 0.000 1.000
#> SRR2061466 2 0.000 0.915 0.000 1.000
#> SRR2061464 2 0.000 0.915 0.000 1.000
#> SRR2061465 2 0.000 0.915 0.000 1.000
#> SRR2061463 2 0.000 0.915 0.000 1.000
#> SRR2061462 2 0.000 0.915 0.000 1.000
#> SRR2061460 1 0.706 0.888 0.808 0.192
#> SRR2061459 1 0.644 0.903 0.836 0.164
#> SRR2061461 1 0.722 0.882 0.800 0.200
#> SRR2061458 1 0.706 0.888 0.808 0.192
#> SRR2061457 1 0.706 0.888 0.808 0.192
#> SRR2061481 2 0.963 0.572 0.388 0.612
#> SRR2061488 2 0.714 0.800 0.196 0.804
#> SRR2061456 1 0.697 0.891 0.812 0.188
#> SRR2061487 2 0.714 0.800 0.196 0.804
#> SRR2061485 2 0.714 0.800 0.196 0.804
#> SRR2061486 2 0.714 0.800 0.196 0.804
#> SRR2061484 2 0.714 0.800 0.196 0.804
#> SRR2061482 2 0.999 0.352 0.484 0.516
#> SRR2061480 2 0.980 0.517 0.416 0.584
#> SRR2061483 2 0.714 0.800 0.196 0.804
#> SRR2061478 1 0.000 0.878 1.000 0.000
#> SRR2061477 1 0.000 0.878 1.000 0.000
#> SRR2061475 1 0.000 0.878 1.000 0.000
#> SRR2061474 1 0.000 0.878 1.000 0.000
#> SRR2061476 1 0.000 0.878 1.000 0.000
#> SRR2061473 1 0.000 0.878 1.000 0.000
#> SRR2061472 1 0.000 0.878 1.000 0.000
#> SRR2061470 2 0.000 0.915 0.000 1.000
#> SRR2061469 2 0.000 0.915 0.000 1.000
#> SRR2061455 1 0.714 0.885 0.804 0.196
#> SRR2061454 1 0.706 0.888 0.808 0.192
#> SRR2061452 1 0.402 0.909 0.920 0.080
#> SRR2061453 1 0.706 0.888 0.808 0.192
#> SRR2061450 1 0.416 0.910 0.916 0.084
#> SRR2061451 1 0.388 0.908 0.924 0.076
#> SRR2061448 2 0.000 0.915 0.000 1.000
#> SRR2061471 1 0.000 0.878 1.000 0.000
#> SRR2061449 2 0.000 0.915 0.000 1.000
#> SRR2061447 2 0.000 0.915 0.000 1.000
#> SRR2061446 2 0.000 0.915 0.000 1.000
#> SRR2061444 2 0.000 0.915 0.000 1.000
#> SRR2061443 2 0.730 0.669 0.204 0.796
#> SRR2061442 1 0.714 0.885 0.804 0.196
#> SRR2061441 2 0.343 0.859 0.064 0.936
#> SRR2061445 2 0.000 0.915 0.000 1.000
#> SRR2061439 1 0.141 0.890 0.980 0.020
#> SRR2061440 1 0.541 0.912 0.876 0.124
#> SRR2061437 1 0.456 0.911 0.904 0.096
#> SRR2061438 1 0.563 0.911 0.868 0.132
#> SRR2061435 1 0.529 0.912 0.880 0.120
#> SRR2061436 1 0.141 0.890 0.980 0.020
#> SRR2061433 1 0.163 0.892 0.976 0.024
#> SRR2061434 1 0.671 0.897 0.824 0.176
#> SRR2061432 1 0.595 0.909 0.856 0.144
#> SRR2061431 2 0.000 0.915 0.000 1.000
#> SRR2061429 2 0.000 0.915 0.000 1.000
#> SRR2061430 2 0.000 0.915 0.000 1.000
#> SRR2061428 2 0.000 0.915 0.000 1.000
#> SRR2061426 2 0.000 0.915 0.000 1.000
#> SRR2061427 2 0.000 0.915 0.000 1.000
#> SRR2061425 2 0.000 0.915 0.000 1.000
#> SRR2061424 1 0.745 0.871 0.788 0.212
#> SRR2061423 2 0.000 0.915 0.000 1.000
#> SRR2061422 1 0.605 0.908 0.852 0.148
#> SRR2061421 1 0.118 0.888 0.984 0.016
#> SRR2061420 1 0.714 0.885 0.804 0.196
#> SRR2061419 1 0.416 0.910 0.916 0.084
#> SRR2061418 1 0.184 0.893 0.972 0.028
#> SRR2061417 1 0.563 0.911 0.868 0.132
#> SRR2061415 1 0.163 0.892 0.976 0.024
#> SRR2061416 1 0.634 0.904 0.840 0.160
#> SRR2061414 1 0.653 0.901 0.832 0.168
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061464 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061465 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061463 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061462 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061460 1 0.0237 0.991 0.996 0.004 0.000
#> SRR2061459 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061461 1 0.0892 0.976 0.980 0.020 0.000
#> SRR2061458 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061457 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061481 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061488 3 0.1860 0.961 0.000 0.052 0.948
#> SRR2061456 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061487 3 0.1860 0.961 0.000 0.052 0.948
#> SRR2061485 3 0.1753 0.963 0.000 0.048 0.952
#> SRR2061486 3 0.1964 0.959 0.000 0.056 0.944
#> SRR2061484 3 0.2066 0.956 0.000 0.060 0.940
#> SRR2061482 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061480 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061483 3 0.2165 0.952 0.000 0.064 0.936
#> SRR2061478 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061477 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061475 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061474 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061476 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061473 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061472 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061470 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061455 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061454 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061452 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061453 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061450 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061448 2 0.3879 0.835 0.152 0.848 0.000
#> SRR2061471 3 0.0000 0.980 0.000 0.000 1.000
#> SRR2061449 2 0.1964 0.935 0.056 0.944 0.000
#> SRR2061447 2 0.1964 0.935 0.056 0.944 0.000
#> SRR2061446 2 0.1643 0.942 0.044 0.956 0.000
#> SRR2061444 2 0.2448 0.919 0.076 0.924 0.000
#> SRR2061443 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061442 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061441 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061445 2 0.3686 0.849 0.140 0.860 0.000
#> SRR2061439 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061440 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061437 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061438 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061435 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061431 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.965 0.000 1.000 0.000
#> SRR2061425 1 0.4062 0.794 0.836 0.164 0.000
#> SRR2061424 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061423 2 0.2711 0.906 0.088 0.912 0.000
#> SRR2061422 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061420 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061419 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061418 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061417 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061415 1 0.0237 0.991 0.996 0.000 0.004
#> SRR2061416 1 0.0000 0.994 1.000 0.000 0.000
#> SRR2061414 1 0.0000 0.994 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.1792 0.8581 0.000 0.932 0.000 0.068
#> SRR2061467 2 0.1867 0.8560 0.000 0.928 0.000 0.072
#> SRR2061466 2 0.1792 0.8584 0.000 0.932 0.000 0.068
#> SRR2061464 4 0.4304 0.6845 0.000 0.284 0.000 0.716
#> SRR2061465 2 0.2149 0.8435 0.000 0.912 0.000 0.088
#> SRR2061463 4 0.3764 0.7817 0.000 0.216 0.000 0.784
#> SRR2061462 4 0.3444 0.8157 0.000 0.184 0.000 0.816
#> SRR2061460 4 0.0707 0.9308 0.000 0.020 0.000 0.980
#> SRR2061459 4 0.0188 0.9295 0.000 0.004 0.000 0.996
#> SRR2061461 4 0.0921 0.9279 0.000 0.028 0.000 0.972
#> SRR2061458 4 0.0000 0.9311 0.000 0.000 0.000 1.000
#> SRR2061457 4 0.0188 0.9321 0.000 0.004 0.000 0.996
#> SRR2061481 3 0.0000 0.9359 0.000 0.000 1.000 0.000
#> SRR2061488 3 0.3172 0.8671 0.000 0.160 0.840 0.000
#> SRR2061456 4 0.0188 0.9295 0.000 0.004 0.000 0.996
#> SRR2061487 3 0.3074 0.8731 0.000 0.152 0.848 0.000
#> SRR2061485 3 0.2589 0.8951 0.000 0.116 0.884 0.000
#> SRR2061486 3 0.3311 0.8547 0.000 0.172 0.828 0.000
#> SRR2061484 3 0.3400 0.8514 0.000 0.180 0.820 0.000
#> SRR2061482 3 0.0000 0.9359 0.000 0.000 1.000 0.000
#> SRR2061480 3 0.0000 0.9359 0.000 0.000 1.000 0.000
#> SRR2061483 3 0.3528 0.8368 0.000 0.192 0.808 0.000
#> SRR2061478 3 0.0000 0.9359 0.000 0.000 1.000 0.000
#> SRR2061477 3 0.0000 0.9359 0.000 0.000 1.000 0.000
#> SRR2061475 3 0.0000 0.9359 0.000 0.000 1.000 0.000
#> SRR2061474 3 0.0657 0.9296 0.000 0.004 0.984 0.012
#> SRR2061476 3 0.0188 0.9344 0.000 0.000 0.996 0.004
#> SRR2061473 3 0.0000 0.9359 0.000 0.000 1.000 0.000
#> SRR2061472 3 0.0000 0.9359 0.000 0.000 1.000 0.000
#> SRR2061470 2 0.1792 0.8584 0.000 0.932 0.000 0.068
#> SRR2061469 2 0.1637 0.8600 0.000 0.940 0.000 0.060
#> SRR2061455 4 0.0469 0.9325 0.000 0.012 0.000 0.988
#> SRR2061454 4 0.0469 0.9325 0.000 0.012 0.000 0.988
#> SRR2061452 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061453 4 0.0188 0.9321 0.000 0.004 0.000 0.996
#> SRR2061450 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061448 1 0.4985 0.0623 0.532 0.468 0.000 0.000
#> SRR2061471 3 0.0657 0.9296 0.000 0.004 0.984 0.012
#> SRR2061449 2 0.4830 0.3571 0.392 0.608 0.000 0.000
#> SRR2061447 2 0.4624 0.4878 0.340 0.660 0.000 0.000
#> SRR2061446 1 0.4999 -0.0345 0.508 0.492 0.000 0.000
#> SRR2061444 1 0.4967 0.1270 0.548 0.452 0.000 0.000
#> SRR2061443 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061442 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061441 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061445 1 0.3873 0.6572 0.772 0.228 0.000 0.000
#> SRR2061439 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0921 0.9002 0.972 0.000 0.000 0.028
#> SRR2061431 2 0.1302 0.8709 0.044 0.956 0.000 0.000
#> SRR2061429 2 0.1398 0.8731 0.040 0.956 0.000 0.004
#> SRR2061430 2 0.1557 0.8661 0.056 0.944 0.000 0.000
#> SRR2061428 2 0.1211 0.8708 0.040 0.960 0.000 0.000
#> SRR2061426 2 0.1209 0.8708 0.032 0.964 0.000 0.004
#> SRR2061427 2 0.1557 0.8650 0.056 0.944 0.000 0.000
#> SRR2061425 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061424 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061423 1 0.4406 0.5361 0.700 0.300 0.000 0.000
#> SRR2061422 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061420 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061419 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061415 1 0.2281 0.8366 0.904 0.000 0.000 0.096
#> SRR2061416 1 0.0000 0.9211 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0469 0.9123 0.988 0.000 0.000 0.012
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.4403 0.0948 0.000 0.560 0.000 0.436 NA
#> SRR2061467 4 0.4238 0.3696 0.000 0.368 0.000 0.628 NA
#> SRR2061466 4 0.4238 0.3696 0.000 0.368 0.000 0.628 NA
#> SRR2061464 4 0.3242 0.7607 0.000 0.040 0.000 0.844 NA
#> SRR2061465 4 0.4238 0.3696 0.000 0.368 0.000 0.628 NA
#> SRR2061463 4 0.3085 0.7647 0.000 0.032 0.000 0.852 NA
#> SRR2061462 4 0.3085 0.7647 0.000 0.032 0.000 0.852 NA
#> SRR2061460 4 0.0000 0.8149 0.000 0.000 0.000 1.000 NA
#> SRR2061459 4 0.0510 0.8168 0.000 0.000 0.000 0.984 NA
#> SRR2061461 4 0.0162 0.8146 0.000 0.004 0.000 0.996 NA
#> SRR2061458 4 0.1121 0.8164 0.000 0.000 0.000 0.956 NA
#> SRR2061457 4 0.2179 0.8048 0.000 0.000 0.000 0.888 NA
#> SRR2061481 3 0.1792 0.8964 0.000 0.000 0.916 0.000 NA
#> SRR2061488 3 0.4227 0.6377 0.000 0.292 0.692 0.000 NA
#> SRR2061456 4 0.2471 0.7956 0.000 0.000 0.000 0.864 NA
#> SRR2061487 3 0.4348 0.5973 0.000 0.316 0.668 0.000 NA
#> SRR2061485 3 0.2012 0.8931 0.000 0.060 0.920 0.000 NA
#> SRR2061486 3 0.3527 0.7737 0.000 0.192 0.792 0.000 NA
#> SRR2061484 3 0.2331 0.8803 0.000 0.080 0.900 0.000 NA
#> SRR2061482 3 0.1851 0.8948 0.000 0.000 0.912 0.000 NA
#> SRR2061480 3 0.1908 0.8936 0.000 0.000 0.908 0.000 NA
#> SRR2061483 3 0.2291 0.8984 0.000 0.036 0.908 0.000 NA
#> SRR2061478 3 0.0162 0.9134 0.000 0.000 0.996 0.000 NA
#> SRR2061477 3 0.0162 0.9134 0.000 0.000 0.996 0.000 NA
#> SRR2061475 3 0.0404 0.9126 0.000 0.000 0.988 0.000 NA
#> SRR2061474 3 0.0510 0.9116 0.000 0.000 0.984 0.000 NA
#> SRR2061476 3 0.0404 0.9126 0.000 0.000 0.988 0.000 NA
#> SRR2061473 3 0.0290 0.9132 0.000 0.000 0.992 0.000 NA
#> SRR2061472 3 0.0162 0.9133 0.000 0.000 0.996 0.000 NA
#> SRR2061470 2 0.4430 0.0302 0.000 0.540 0.000 0.456 NA
#> SRR2061469 2 0.4350 0.1652 0.000 0.588 0.000 0.408 NA
#> SRR2061455 4 0.1908 0.8099 0.000 0.000 0.000 0.908 NA
#> SRR2061454 4 0.2424 0.7975 0.000 0.000 0.000 0.868 NA
#> SRR2061452 1 0.2719 0.7620 0.852 0.000 0.000 0.004 NA
#> SRR2061453 4 0.2471 0.7956 0.000 0.000 0.000 0.864 NA
#> SRR2061450 1 0.1121 0.8129 0.956 0.000 0.000 0.000 NA
#> SRR2061451 1 0.1608 0.8035 0.928 0.000 0.000 0.000 NA
#> SRR2061448 1 0.4283 -0.0456 0.544 0.456 0.000 0.000 NA
#> SRR2061471 3 0.0404 0.9126 0.000 0.000 0.988 0.000 NA
#> SRR2061449 2 0.4278 0.2595 0.452 0.548 0.000 0.000 NA
#> SRR2061447 2 0.4227 0.3434 0.420 0.580 0.000 0.000 NA
#> SRR2061446 1 0.3508 0.5485 0.748 0.252 0.000 0.000 NA
#> SRR2061444 1 0.4300 -0.1082 0.524 0.476 0.000 0.000 NA
#> SRR2061443 1 0.3663 0.7144 0.776 0.016 0.000 0.000 NA
#> SRR2061442 1 0.3630 0.7190 0.780 0.016 0.000 0.000 NA
#> SRR2061441 1 0.3476 0.7348 0.804 0.020 0.000 0.000 NA
#> SRR2061445 1 0.2561 0.7149 0.856 0.144 0.000 0.000 NA
#> SRR2061439 1 0.2127 0.7769 0.892 0.000 0.000 0.000 NA
#> SRR2061440 1 0.0290 0.8157 0.992 0.008 0.000 0.000 NA
#> SRR2061437 1 0.0000 0.8166 1.000 0.000 0.000 0.000 NA
#> SRR2061438 1 0.0162 0.8174 0.996 0.000 0.000 0.004 NA
#> SRR2061435 1 0.2376 0.8030 0.904 0.000 0.000 0.044 NA
#> SRR2061436 1 0.0963 0.8133 0.964 0.000 0.000 0.000 NA
#> SRR2061433 1 0.0000 0.8166 1.000 0.000 0.000 0.000 NA
#> SRR2061434 1 0.1408 0.8107 0.948 0.000 0.000 0.008 NA
#> SRR2061432 1 0.3861 0.7329 0.804 0.000 0.000 0.068 NA
#> SRR2061431 2 0.2763 0.7020 0.148 0.848 0.000 0.000 NA
#> SRR2061429 2 0.3143 0.6797 0.204 0.796 0.000 0.000 NA
#> SRR2061430 2 0.3300 0.6797 0.204 0.792 0.000 0.000 NA
#> SRR2061428 2 0.1965 0.6804 0.096 0.904 0.000 0.000 NA
#> SRR2061426 2 0.1732 0.6685 0.080 0.920 0.000 0.000 NA
#> SRR2061427 2 0.2629 0.6952 0.136 0.860 0.000 0.000 NA
#> SRR2061425 1 0.5796 0.4827 0.572 0.116 0.000 0.000 NA
#> SRR2061424 1 0.4418 0.5977 0.652 0.016 0.000 0.000 NA
#> SRR2061423 1 0.6952 0.1968 0.412 0.260 0.000 0.008 NA
#> SRR2061422 1 0.0968 0.8165 0.972 0.012 0.004 0.000 NA
#> SRR2061421 1 0.3366 0.6900 0.784 0.000 0.004 0.000 NA
#> SRR2061420 1 0.0693 0.8160 0.980 0.012 0.000 0.000 NA
#> SRR2061419 1 0.0000 0.8166 1.000 0.000 0.000 0.000 NA
#> SRR2061418 1 0.0000 0.8166 1.000 0.000 0.000 0.000 NA
#> SRR2061417 1 0.0510 0.8168 0.984 0.000 0.000 0.000 NA
#> SRR2061415 1 0.5282 0.5628 0.644 0.000 0.000 0.088 NA
#> SRR2061416 1 0.0000 0.8166 1.000 0.000 0.000 0.000 NA
#> SRR2061414 1 0.2726 0.7893 0.884 0.000 0.000 0.064 NA
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.4224 0.10987 0.000 0.552 0.000 0.432 0.016 0.000
#> SRR2061467 4 0.3017 0.78879 0.000 0.164 0.000 0.816 0.020 0.000
#> SRR2061466 4 0.3017 0.78879 0.000 0.164 0.000 0.816 0.020 0.000
#> SRR2061464 4 0.2752 0.84842 0.000 0.036 0.000 0.856 0.108 0.000
#> SRR2061465 4 0.3377 0.75679 0.000 0.188 0.000 0.784 0.028 0.000
#> SRR2061463 4 0.1838 0.88131 0.000 0.016 0.000 0.916 0.068 0.000
#> SRR2061462 4 0.1588 0.88400 0.000 0.004 0.000 0.924 0.072 0.000
#> SRR2061460 4 0.0000 0.90197 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061459 4 0.0146 0.90233 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR2061461 4 0.0260 0.90097 0.000 0.000 0.000 0.992 0.008 0.000
#> SRR2061458 4 0.0291 0.90225 0.000 0.000 0.000 0.992 0.004 0.004
#> SRR2061457 4 0.0603 0.90128 0.000 0.000 0.000 0.980 0.004 0.016
#> SRR2061481 3 0.2121 0.87372 0.000 0.000 0.892 0.000 0.096 0.012
#> SRR2061488 3 0.2794 0.86729 0.000 0.060 0.860 0.000 0.000 0.080
#> SRR2061456 4 0.0777 0.89913 0.000 0.000 0.000 0.972 0.004 0.024
#> SRR2061487 3 0.2852 0.86407 0.000 0.064 0.856 0.000 0.000 0.080
#> SRR2061485 3 0.1556 0.89643 0.000 0.000 0.920 0.000 0.000 0.080
#> SRR2061486 3 0.1913 0.89327 0.000 0.012 0.908 0.000 0.000 0.080
#> SRR2061484 3 0.1556 0.89643 0.000 0.000 0.920 0.000 0.000 0.080
#> SRR2061482 3 0.1957 0.86558 0.000 0.000 0.888 0.000 0.112 0.000
#> SRR2061480 3 0.1812 0.88571 0.000 0.000 0.912 0.000 0.080 0.008
#> SRR2061483 3 0.1556 0.89643 0.000 0.000 0.920 0.000 0.000 0.080
#> SRR2061478 3 0.1714 0.90896 0.000 0.000 0.908 0.000 0.000 0.092
#> SRR2061477 3 0.1714 0.90896 0.000 0.000 0.908 0.000 0.000 0.092
#> SRR2061475 3 0.1814 0.90807 0.000 0.000 0.900 0.000 0.000 0.100
#> SRR2061474 3 0.1765 0.90864 0.000 0.000 0.904 0.000 0.000 0.096
#> SRR2061476 3 0.1814 0.90807 0.000 0.000 0.900 0.000 0.000 0.100
#> SRR2061473 3 0.1863 0.90703 0.000 0.000 0.896 0.000 0.000 0.104
#> SRR2061472 3 0.1863 0.90703 0.000 0.000 0.896 0.000 0.000 0.104
#> SRR2061470 4 0.4131 0.37782 0.000 0.384 0.000 0.600 0.016 0.000
#> SRR2061469 2 0.4256 -0.00991 0.000 0.520 0.000 0.464 0.016 0.000
#> SRR2061455 4 0.0405 0.90198 0.000 0.000 0.000 0.988 0.004 0.008
#> SRR2061454 4 0.0603 0.90128 0.000 0.000 0.000 0.980 0.004 0.016
#> SRR2061452 1 0.3201 0.12903 0.780 0.000 0.000 0.012 0.000 0.208
#> SRR2061453 4 0.0692 0.90039 0.000 0.000 0.000 0.976 0.004 0.020
#> SRR2061450 1 0.2402 0.40079 0.868 0.000 0.000 0.012 0.000 0.120
#> SRR2061451 1 0.2946 0.25102 0.812 0.000 0.000 0.012 0.000 0.176
#> SRR2061448 2 0.3804 0.39436 0.336 0.656 0.000 0.000 0.008 0.000
#> SRR2061471 3 0.1765 0.90864 0.000 0.000 0.904 0.000 0.000 0.096
#> SRR2061449 2 0.3629 0.51868 0.276 0.712 0.000 0.000 0.012 0.000
#> SRR2061447 2 0.3136 0.59033 0.228 0.768 0.000 0.000 0.004 0.000
#> SRR2061446 1 0.4186 0.10194 0.656 0.312 0.000 0.000 0.032 0.000
#> SRR2061444 1 0.4184 -0.05474 0.500 0.488 0.000 0.000 0.012 0.000
#> SRR2061443 5 0.2703 0.86498 0.172 0.004 0.000 0.000 0.824 0.000
#> SRR2061442 5 0.2278 0.88636 0.128 0.004 0.000 0.000 0.868 0.000
#> SRR2061441 5 0.3189 0.75975 0.236 0.004 0.000 0.000 0.760 0.000
#> SRR2061445 1 0.2680 0.44937 0.860 0.108 0.000 0.000 0.032 0.000
#> SRR2061439 1 0.0692 0.57282 0.976 0.004 0.000 0.000 0.020 0.000
#> SRR2061440 1 0.0858 0.57136 0.968 0.004 0.000 0.000 0.028 0.000
#> SRR2061437 1 0.0146 0.56997 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.1232 0.57607 0.956 0.004 0.000 0.000 0.024 0.016
#> SRR2061435 1 0.2568 0.55741 0.880 0.004 0.000 0.004 0.024 0.088
#> SRR2061436 1 0.3499 -0.29258 0.680 0.000 0.000 0.000 0.000 0.320
#> SRR2061433 1 0.2854 0.29804 0.792 0.000 0.000 0.000 0.000 0.208
#> SRR2061434 1 0.2003 0.51796 0.884 0.000 0.000 0.000 0.000 0.116
#> SRR2061432 1 0.4715 -0.55795 0.544 0.000 0.000 0.032 0.008 0.416
#> SRR2061431 2 0.0405 0.74012 0.008 0.988 0.000 0.000 0.004 0.000
#> SRR2061429 2 0.0891 0.74508 0.024 0.968 0.000 0.000 0.008 0.000
#> SRR2061430 2 0.1219 0.74161 0.048 0.948 0.000 0.000 0.004 0.000
#> SRR2061428 2 0.0622 0.74216 0.012 0.980 0.000 0.000 0.008 0.000
#> SRR2061426 2 0.0146 0.73367 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR2061427 2 0.1296 0.74273 0.032 0.952 0.004 0.000 0.012 0.000
#> SRR2061425 5 0.2263 0.88911 0.100 0.016 0.000 0.000 0.884 0.000
#> SRR2061424 5 0.1644 0.86457 0.076 0.004 0.000 0.000 0.920 0.000
#> SRR2061423 5 0.2740 0.84515 0.076 0.060 0.000 0.000 0.864 0.000
#> SRR2061422 1 0.1082 0.56648 0.956 0.004 0.000 0.000 0.040 0.000
#> SRR2061421 1 0.2586 0.48859 0.868 0.000 0.000 0.000 0.032 0.100
#> SRR2061420 1 0.3986 -0.09743 0.532 0.004 0.000 0.000 0.464 0.000
#> SRR2061419 1 0.2723 0.51489 0.856 0.004 0.000 0.000 0.020 0.120
#> SRR2061418 1 0.1732 0.55221 0.920 0.004 0.000 0.000 0.004 0.072
#> SRR2061417 1 0.3441 0.39902 0.784 0.004 0.000 0.000 0.024 0.188
#> SRR2061415 6 0.4392 0.00000 0.476 0.000 0.004 0.016 0.000 0.504
#> SRR2061416 1 0.1471 0.55134 0.932 0.000 0.000 0.000 0.004 0.064
#> SRR2061414 1 0.4047 0.10928 0.716 0.000 0.000 0.036 0.004 0.244
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.
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.
CV:hclust*
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.236 0.268 0.725 0.4059 0.783 0.783
#> 3 3 0.605 0.804 0.872 0.5566 0.538 0.432
#> 4 4 0.800 0.914 0.938 0.1803 0.859 0.631
#> 5 5 0.920 0.919 0.943 0.0493 0.970 0.875
#> 6 6 0.920 0.926 0.940 0.0358 0.973 0.873
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 5
There is also optional best \(k\) = 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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.980 1.0000 0.416 0.584
#> SRR2061467 2 0.980 1.0000 0.416 0.584
#> SRR2061466 2 0.980 1.0000 0.416 0.584
#> SRR2061464 2 0.980 1.0000 0.416 0.584
#> SRR2061465 2 0.980 1.0000 0.416 0.584
#> SRR2061463 2 0.980 1.0000 0.416 0.584
#> SRR2061462 2 0.980 1.0000 0.416 0.584
#> SRR2061460 1 0.871 -0.0608 0.708 0.292
#> SRR2061459 1 0.871 -0.0608 0.708 0.292
#> SRR2061461 1 0.871 -0.0608 0.708 0.292
#> SRR2061458 1 0.871 -0.0608 0.708 0.292
#> SRR2061457 1 0.871 -0.0608 0.708 0.292
#> SRR2061481 1 0.980 0.4401 0.584 0.416
#> SRR2061488 1 0.980 0.4401 0.584 0.416
#> SRR2061456 1 0.871 -0.0608 0.708 0.292
#> SRR2061487 1 0.980 0.4401 0.584 0.416
#> SRR2061485 1 0.980 0.4401 0.584 0.416
#> SRR2061486 1 0.980 0.4401 0.584 0.416
#> SRR2061484 1 0.980 0.4401 0.584 0.416
#> SRR2061482 1 0.980 0.4401 0.584 0.416
#> SRR2061480 1 0.980 0.4401 0.584 0.416
#> SRR2061483 1 0.980 0.4401 0.584 0.416
#> SRR2061478 1 0.980 0.4401 0.584 0.416
#> SRR2061477 1 0.980 0.4401 0.584 0.416
#> SRR2061475 1 0.980 0.4401 0.584 0.416
#> SRR2061474 1 0.980 0.4401 0.584 0.416
#> SRR2061476 1 0.980 0.4401 0.584 0.416
#> SRR2061473 1 0.980 0.4401 0.584 0.416
#> SRR2061472 1 0.980 0.4401 0.584 0.416
#> SRR2061470 2 0.980 1.0000 0.416 0.584
#> SRR2061469 2 0.980 1.0000 0.416 0.584
#> SRR2061455 1 0.871 -0.0608 0.708 0.292
#> SRR2061454 1 0.871 -0.0608 0.708 0.292
#> SRR2061452 1 0.000 0.4782 1.000 0.000
#> SRR2061453 1 0.871 -0.0608 0.708 0.292
#> SRR2061450 1 0.000 0.4782 1.000 0.000
#> SRR2061451 1 0.000 0.4782 1.000 0.000
#> SRR2061448 1 0.966 -0.4110 0.608 0.392
#> SRR2061471 1 0.980 0.4401 0.584 0.416
#> SRR2061449 1 0.966 -0.4110 0.608 0.392
#> SRR2061447 1 0.966 -0.4110 0.608 0.392
#> SRR2061446 1 0.966 -0.4110 0.608 0.392
#> SRR2061444 1 0.966 -0.4110 0.608 0.392
#> SRR2061443 1 0.866 -0.1077 0.712 0.288
#> SRR2061442 1 0.866 -0.1077 0.712 0.288
#> SRR2061441 1 0.866 -0.1077 0.712 0.288
#> SRR2061445 1 0.966 -0.4110 0.608 0.392
#> SRR2061439 1 0.000 0.4782 1.000 0.000
#> SRR2061440 1 0.000 0.4782 1.000 0.000
#> SRR2061437 1 0.000 0.4782 1.000 0.000
#> SRR2061438 1 0.000 0.4782 1.000 0.000
#> SRR2061435 1 0.000 0.4782 1.000 0.000
#> SRR2061436 1 0.000 0.4782 1.000 0.000
#> SRR2061433 1 0.000 0.4782 1.000 0.000
#> SRR2061434 1 0.000 0.4782 1.000 0.000
#> SRR2061432 1 0.000 0.4782 1.000 0.000
#> SRR2061431 1 0.966 -0.4110 0.608 0.392
#> SRR2061429 1 0.966 -0.4110 0.608 0.392
#> SRR2061430 1 0.966 -0.4110 0.608 0.392
#> SRR2061428 1 0.966 -0.4110 0.608 0.392
#> SRR2061426 1 0.966 -0.4110 0.608 0.392
#> SRR2061427 1 0.966 -0.4110 0.608 0.392
#> SRR2061425 1 0.866 -0.1077 0.712 0.288
#> SRR2061424 1 0.866 -0.1077 0.712 0.288
#> SRR2061423 1 0.866 -0.1077 0.712 0.288
#> SRR2061422 1 0.000 0.4782 1.000 0.000
#> SRR2061421 1 0.000 0.4782 1.000 0.000
#> SRR2061420 1 0.861 -0.0967 0.716 0.284
#> SRR2061419 1 0.000 0.4782 1.000 0.000
#> SRR2061418 1 0.000 0.4782 1.000 0.000
#> SRR2061417 1 0.000 0.4782 1.000 0.000
#> SRR2061415 1 0.000 0.4782 1.000 0.000
#> SRR2061416 1 0.000 0.4782 1.000 0.000
#> SRR2061414 1 0.000 0.4782 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.599 0.783 0.368 0.632 0
#> SRR2061467 2 0.599 0.783 0.368 0.632 0
#> SRR2061466 2 0.599 0.783 0.368 0.632 0
#> SRR2061464 2 0.599 0.783 0.368 0.632 0
#> SRR2061465 2 0.599 0.783 0.368 0.632 0
#> SRR2061463 2 0.599 0.783 0.368 0.632 0
#> SRR2061462 2 0.599 0.783 0.368 0.632 0
#> SRR2061460 2 0.236 0.769 0.072 0.928 0
#> SRR2061459 2 0.236 0.769 0.072 0.928 0
#> SRR2061461 2 0.236 0.769 0.072 0.928 0
#> SRR2061458 2 0.236 0.769 0.072 0.928 0
#> SRR2061457 2 0.236 0.769 0.072 0.928 0
#> SRR2061481 3 0.000 1.000 0.000 0.000 1
#> SRR2061488 3 0.000 1.000 0.000 0.000 1
#> SRR2061456 2 0.236 0.769 0.072 0.928 0
#> SRR2061487 3 0.000 1.000 0.000 0.000 1
#> SRR2061485 3 0.000 1.000 0.000 0.000 1
#> SRR2061486 3 0.000 1.000 0.000 0.000 1
#> SRR2061484 3 0.000 1.000 0.000 0.000 1
#> SRR2061482 3 0.000 1.000 0.000 0.000 1
#> SRR2061480 3 0.000 1.000 0.000 0.000 1
#> SRR2061483 3 0.000 1.000 0.000 0.000 1
#> SRR2061478 3 0.000 1.000 0.000 0.000 1
#> SRR2061477 3 0.000 1.000 0.000 0.000 1
#> SRR2061475 3 0.000 1.000 0.000 0.000 1
#> SRR2061474 3 0.000 1.000 0.000 0.000 1
#> SRR2061476 3 0.000 1.000 0.000 0.000 1
#> SRR2061473 3 0.000 1.000 0.000 0.000 1
#> SRR2061472 3 0.000 1.000 0.000 0.000 1
#> SRR2061470 2 0.599 0.783 0.368 0.632 0
#> SRR2061469 2 0.599 0.783 0.368 0.632 0
#> SRR2061455 2 0.236 0.769 0.072 0.928 0
#> SRR2061454 2 0.236 0.769 0.072 0.928 0
#> SRR2061452 1 0.599 0.769 0.632 0.368 0
#> SRR2061453 2 0.236 0.769 0.072 0.928 0
#> SRR2061450 1 0.599 0.769 0.632 0.368 0
#> SRR2061451 1 0.599 0.769 0.632 0.368 0
#> SRR2061448 1 0.129 0.670 0.968 0.032 0
#> SRR2061471 3 0.000 1.000 0.000 0.000 1
#> SRR2061449 1 0.129 0.670 0.968 0.032 0
#> SRR2061447 1 0.129 0.670 0.968 0.032 0
#> SRR2061446 1 0.129 0.670 0.968 0.032 0
#> SRR2061444 1 0.129 0.670 0.968 0.032 0
#> SRR2061443 1 0.245 0.728 0.924 0.076 0
#> SRR2061442 1 0.245 0.728 0.924 0.076 0
#> SRR2061441 1 0.245 0.728 0.924 0.076 0
#> SRR2061445 1 0.129 0.670 0.968 0.032 0
#> SRR2061439 1 0.599 0.769 0.632 0.368 0
#> SRR2061440 1 0.599 0.769 0.632 0.368 0
#> SRR2061437 1 0.599 0.769 0.632 0.368 0
#> SRR2061438 1 0.599 0.769 0.632 0.368 0
#> SRR2061435 1 0.599 0.769 0.632 0.368 0
#> SRR2061436 1 0.599 0.769 0.632 0.368 0
#> SRR2061433 1 0.599 0.769 0.632 0.368 0
#> SRR2061434 1 0.599 0.769 0.632 0.368 0
#> SRR2061432 1 0.599 0.769 0.632 0.368 0
#> SRR2061431 1 0.129 0.670 0.968 0.032 0
#> SRR2061429 1 0.129 0.670 0.968 0.032 0
#> SRR2061430 1 0.129 0.670 0.968 0.032 0
#> SRR2061428 1 0.129 0.670 0.968 0.032 0
#> SRR2061426 1 0.129 0.670 0.968 0.032 0
#> SRR2061427 1 0.129 0.670 0.968 0.032 0
#> SRR2061425 1 0.245 0.728 0.924 0.076 0
#> SRR2061424 1 0.245 0.728 0.924 0.076 0
#> SRR2061423 1 0.245 0.728 0.924 0.076 0
#> SRR2061422 1 0.599 0.769 0.632 0.368 0
#> SRR2061421 1 0.599 0.769 0.632 0.368 0
#> SRR2061420 1 0.254 0.728 0.920 0.080 0
#> SRR2061419 1 0.599 0.769 0.632 0.368 0
#> SRR2061418 1 0.599 0.769 0.632 0.368 0
#> SRR2061417 1 0.599 0.769 0.632 0.368 0
#> SRR2061415 1 0.599 0.769 0.632 0.368 0
#> SRR2061416 1 0.599 0.769 0.632 0.368 0
#> SRR2061414 1 0.599 0.769 0.632 0.368 0
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 4 0.2469 0.813 0.000 0.108 0 0.892
#> SRR2061467 4 0.2469 0.813 0.000 0.108 0 0.892
#> SRR2061466 4 0.2469 0.813 0.000 0.108 0 0.892
#> SRR2061464 4 0.1940 0.820 0.000 0.076 0 0.924
#> SRR2061465 4 0.2469 0.813 0.000 0.108 0 0.892
#> SRR2061463 4 0.1940 0.820 0.000 0.076 0 0.924
#> SRR2061462 4 0.1940 0.820 0.000 0.076 0 0.924
#> SRR2061460 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061459 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061461 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061458 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061457 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061481 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061488 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061456 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061487 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061485 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061486 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061484 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061482 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061480 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061483 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061478 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061477 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061475 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061474 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061476 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061473 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061472 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061470 4 0.2469 0.813 0.000 0.108 0 0.892
#> SRR2061469 4 0.2469 0.813 0.000 0.108 0 0.892
#> SRR2061455 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061454 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061452 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061453 4 0.3801 0.811 0.220 0.000 0 0.780
#> SRR2061450 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061451 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061448 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061471 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061449 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061447 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061446 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061444 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061443 2 0.4008 0.782 0.244 0.756 0 0.000
#> SRR2061442 2 0.4008 0.782 0.244 0.756 0 0.000
#> SRR2061441 2 0.4008 0.782 0.244 0.756 0 0.000
#> SRR2061445 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061439 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061440 1 0.0336 0.991 0.992 0.008 0 0.000
#> SRR2061437 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061438 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061435 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061436 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061433 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061434 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061432 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061431 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061429 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061430 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061428 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061426 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061427 2 0.0000 0.883 0.000 1.000 0 0.000
#> SRR2061425 2 0.4008 0.782 0.244 0.756 0 0.000
#> SRR2061424 2 0.4008 0.782 0.244 0.756 0 0.000
#> SRR2061423 2 0.4008 0.782 0.244 0.756 0 0.000
#> SRR2061422 1 0.0469 0.986 0.988 0.012 0 0.000
#> SRR2061421 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061420 2 0.4072 0.772 0.252 0.748 0 0.000
#> SRR2061419 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061418 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061417 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061415 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061416 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061414 1 0.0000 0.999 1.000 0.000 0 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.1908 0.860 0.000 0.908 0.000 0.000 0.092
#> SRR2061467 2 0.1908 0.860 0.000 0.908 0.000 0.000 0.092
#> SRR2061466 2 0.1908 0.860 0.000 0.908 0.000 0.000 0.092
#> SRR2061464 2 0.5246 0.607 0.000 0.596 0.000 0.344 0.060
#> SRR2061465 2 0.1908 0.860 0.000 0.908 0.000 0.000 0.092
#> SRR2061463 2 0.5246 0.607 0.000 0.596 0.000 0.344 0.060
#> SRR2061462 2 0.5246 0.607 0.000 0.596 0.000 0.344 0.060
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061481 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061488 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061487 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061485 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061486 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061484 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061482 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061480 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061483 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000
#> SRR2061478 3 0.1908 0.955 0.000 0.092 0.908 0.000 0.000
#> SRR2061477 3 0.1908 0.955 0.000 0.092 0.908 0.000 0.000
#> SRR2061475 3 0.1908 0.955 0.000 0.092 0.908 0.000 0.000
#> SRR2061474 3 0.1908 0.955 0.000 0.092 0.908 0.000 0.000
#> SRR2061476 3 0.1908 0.955 0.000 0.092 0.908 0.000 0.000
#> SRR2061473 3 0.1908 0.955 0.000 0.092 0.908 0.000 0.000
#> SRR2061472 3 0.1908 0.955 0.000 0.092 0.908 0.000 0.000
#> SRR2061470 2 0.1908 0.860 0.000 0.908 0.000 0.000 0.092
#> SRR2061469 2 0.1908 0.860 0.000 0.908 0.000 0.000 0.092
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061452 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061450 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061448 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061471 3 0.1908 0.955 0.000 0.092 0.908 0.000 0.000
#> SRR2061449 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061447 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061446 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061444 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061443 5 0.3452 0.773 0.244 0.000 0.000 0.000 0.756
#> SRR2061442 5 0.3452 0.773 0.244 0.000 0.000 0.000 0.756
#> SRR2061441 5 0.3452 0.773 0.244 0.000 0.000 0.000 0.756
#> SRR2061445 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061439 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.0290 0.991 0.992 0.000 0.000 0.000 0.008
#> SRR2061437 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061429 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061430 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061428 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061426 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061427 5 0.0000 0.865 0.000 0.000 0.000 0.000 1.000
#> SRR2061425 5 0.3452 0.773 0.244 0.000 0.000 0.000 0.756
#> SRR2061424 5 0.3452 0.773 0.244 0.000 0.000 0.000 0.756
#> SRR2061423 5 0.3452 0.773 0.244 0.000 0.000 0.000 0.756
#> SRR2061422 1 0.0404 0.986 0.988 0.000 0.000 0.000 0.012
#> SRR2061421 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061420 5 0.3508 0.764 0.252 0.000 0.000 0.000 0.748
#> SRR2061419 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.0790 0.860 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR2061467 2 0.0790 0.860 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR2061466 2 0.0790 0.860 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR2061464 2 0.3592 0.606 0.000 0.656 0.000 0.344 0.000 0.000
#> SRR2061465 2 0.0790 0.860 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR2061463 2 0.3592 0.606 0.000 0.656 0.000 0.344 0.000 0.000
#> SRR2061462 2 0.3592 0.606 0.000 0.656 0.000 0.344 0.000 0.000
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061481 3 0.1444 0.942 0.000 0.000 0.928 0.000 0.000 0.072
#> SRR2061488 3 0.0000 0.972 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061487 3 0.0000 0.972 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061485 3 0.0000 0.972 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061486 3 0.0000 0.972 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061484 3 0.0000 0.972 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061482 3 0.1444 0.942 0.000 0.000 0.928 0.000 0.000 0.072
#> SRR2061480 3 0.1444 0.942 0.000 0.000 0.928 0.000 0.000 0.072
#> SRR2061483 3 0.0000 0.972 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061478 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061477 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061475 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061474 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061476 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061473 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061472 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061470 2 0.0790 0.860 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR2061469 2 0.0790 0.860 0.000 0.968 0.000 0.000 0.032 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061452 1 0.0458 0.987 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061450 1 0.0458 0.987 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.0458 0.987 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR2061448 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061471 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061449 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061447 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061446 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061444 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061443 5 0.3431 0.789 0.228 0.016 0.000 0.000 0.756 0.000
#> SRR2061442 5 0.3431 0.789 0.228 0.016 0.000 0.000 0.756 0.000
#> SRR2061441 5 0.3431 0.789 0.228 0.016 0.000 0.000 0.756 0.000
#> SRR2061445 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061439 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.0405 0.985 0.988 0.004 0.000 0.000 0.008 0.000
#> SRR2061437 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0146 0.991 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.0146 0.991 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.0458 0.987 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.0458 0.987 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061431 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061429 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061430 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061428 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061426 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061427 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061425 5 0.3431 0.789 0.228 0.016 0.000 0.000 0.756 0.000
#> SRR2061424 5 0.3431 0.789 0.228 0.016 0.000 0.000 0.756 0.000
#> SRR2061423 5 0.3431 0.789 0.228 0.016 0.000 0.000 0.756 0.000
#> SRR2061422 1 0.0508 0.981 0.984 0.004 0.000 0.000 0.012 0.000
#> SRR2061421 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061420 5 0.3483 0.781 0.236 0.016 0.000 0.000 0.748 0.000
#> SRR2061419 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.0458 0.987 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
CV:kmeans
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.312 0.418 0.644 0.4527 0.506 0.506
#> 3 3 0.491 0.739 0.801 0.3897 0.632 0.396
#> 4 4 0.594 0.786 0.823 0.1428 0.889 0.687
#> 5 5 0.833 0.771 0.838 0.0786 1.000 1.000
#> 6 6 0.856 0.743 0.800 0.0379 0.924 0.722
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.0000 0.515 0.000 1.000
#> SRR2061467 2 0.0000 0.515 0.000 1.000
#> SRR2061466 2 0.0000 0.515 0.000 1.000
#> SRR2061464 2 0.0376 0.515 0.004 0.996
#> SRR2061465 2 0.0000 0.515 0.000 1.000
#> SRR2061463 2 0.0376 0.515 0.004 0.996
#> SRR2061462 2 0.0376 0.515 0.004 0.996
#> SRR2061460 2 0.9661 -0.170 0.392 0.608
#> SRR2061459 2 0.9661 -0.170 0.392 0.608
#> SRR2061461 2 0.9661 -0.170 0.392 0.608
#> SRR2061458 2 0.9661 -0.170 0.392 0.608
#> SRR2061457 2 0.9661 -0.170 0.392 0.608
#> SRR2061481 2 0.9358 0.390 0.352 0.648
#> SRR2061488 2 0.9323 0.392 0.348 0.652
#> SRR2061456 2 0.9661 -0.170 0.392 0.608
#> SRR2061487 2 0.9323 0.392 0.348 0.652
#> SRR2061485 2 0.9323 0.392 0.348 0.652
#> SRR2061486 2 0.9323 0.392 0.348 0.652
#> SRR2061484 2 0.9323 0.392 0.348 0.652
#> SRR2061482 2 0.9358 0.390 0.352 0.648
#> SRR2061480 2 0.9358 0.390 0.352 0.648
#> SRR2061483 2 0.9323 0.392 0.348 0.652
#> SRR2061478 1 0.8608 0.157 0.716 0.284
#> SRR2061477 1 0.8608 0.157 0.716 0.284
#> SRR2061475 1 0.8608 0.157 0.716 0.284
#> SRR2061474 1 0.8608 0.157 0.716 0.284
#> SRR2061476 1 0.8608 0.157 0.716 0.284
#> SRR2061473 1 0.8608 0.157 0.716 0.284
#> SRR2061472 1 0.8608 0.157 0.716 0.284
#> SRR2061470 2 0.0000 0.515 0.000 1.000
#> SRR2061469 2 0.0000 0.515 0.000 1.000
#> SRR2061455 2 0.9661 -0.170 0.392 0.608
#> SRR2061454 2 0.9661 -0.170 0.392 0.608
#> SRR2061452 1 0.8861 0.704 0.696 0.304
#> SRR2061453 2 0.9661 -0.170 0.392 0.608
#> SRR2061450 1 0.8861 0.704 0.696 0.304
#> SRR2061451 1 0.8861 0.704 0.696 0.304
#> SRR2061448 2 0.8386 0.448 0.268 0.732
#> SRR2061471 1 0.8608 0.157 0.716 0.284
#> SRR2061449 2 0.8386 0.448 0.268 0.732
#> SRR2061447 2 0.8386 0.448 0.268 0.732
#> SRR2061446 2 0.8386 0.448 0.268 0.732
#> SRR2061444 2 0.8386 0.448 0.268 0.732
#> SRR2061443 2 0.9087 0.360 0.324 0.676
#> SRR2061442 1 0.8861 0.704 0.696 0.304
#> SRR2061441 2 0.9000 0.375 0.316 0.684
#> SRR2061445 2 0.8386 0.448 0.268 0.732
#> SRR2061439 1 0.8861 0.704 0.696 0.304
#> SRR2061440 1 0.8861 0.704 0.696 0.304
#> SRR2061437 1 0.8861 0.704 0.696 0.304
#> SRR2061438 1 0.8861 0.704 0.696 0.304
#> SRR2061435 1 0.8861 0.704 0.696 0.304
#> SRR2061436 1 0.8861 0.704 0.696 0.304
#> SRR2061433 1 0.8861 0.704 0.696 0.304
#> SRR2061434 1 0.8861 0.704 0.696 0.304
#> SRR2061432 1 0.8861 0.704 0.696 0.304
#> SRR2061431 2 0.8386 0.448 0.268 0.732
#> SRR2061429 2 0.8386 0.448 0.268 0.732
#> SRR2061430 2 0.8386 0.448 0.268 0.732
#> SRR2061428 2 0.8386 0.448 0.268 0.732
#> SRR2061426 2 0.8386 0.448 0.268 0.732
#> SRR2061427 2 0.8386 0.448 0.268 0.732
#> SRR2061425 2 0.9000 0.375 0.316 0.684
#> SRR2061424 1 0.9129 0.655 0.672 0.328
#> SRR2061423 2 0.8499 0.437 0.276 0.724
#> SRR2061422 1 0.8861 0.704 0.696 0.304
#> SRR2061421 1 0.8861 0.704 0.696 0.304
#> SRR2061420 1 0.8861 0.704 0.696 0.304
#> SRR2061419 1 0.8861 0.704 0.696 0.304
#> SRR2061418 1 0.8861 0.704 0.696 0.304
#> SRR2061417 1 0.8861 0.704 0.696 0.304
#> SRR2061415 1 0.8861 0.704 0.696 0.304
#> SRR2061416 1 0.8861 0.704 0.696 0.304
#> SRR2061414 1 0.8861 0.704 0.696 0.304
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.7153 0.656 0.300 0.652 0.048
#> SRR2061467 2 0.7153 0.656 0.300 0.652 0.048
#> SRR2061466 2 0.7153 0.656 0.300 0.652 0.048
#> SRR2061464 2 0.8013 0.598 0.364 0.564 0.072
#> SRR2061465 2 0.7153 0.656 0.300 0.652 0.048
#> SRR2061463 2 0.8013 0.598 0.364 0.564 0.072
#> SRR2061462 2 0.8013 0.598 0.364 0.564 0.072
#> SRR2061460 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061459 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061461 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061458 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061457 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061481 3 0.3112 0.850 0.004 0.096 0.900
#> SRR2061488 3 0.5455 0.808 0.020 0.204 0.776
#> SRR2061456 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061487 3 0.5455 0.808 0.020 0.204 0.776
#> SRR2061485 3 0.5455 0.808 0.020 0.204 0.776
#> SRR2061486 3 0.5455 0.808 0.020 0.204 0.776
#> SRR2061484 3 0.5455 0.808 0.020 0.204 0.776
#> SRR2061482 3 0.3112 0.850 0.004 0.096 0.900
#> SRR2061480 3 0.3112 0.850 0.004 0.096 0.900
#> SRR2061483 3 0.5455 0.808 0.020 0.204 0.776
#> SRR2061478 3 0.2448 0.858 0.076 0.000 0.924
#> SRR2061477 3 0.2448 0.858 0.076 0.000 0.924
#> SRR2061475 3 0.2448 0.858 0.076 0.000 0.924
#> SRR2061474 3 0.2448 0.858 0.076 0.000 0.924
#> SRR2061476 3 0.2448 0.858 0.076 0.000 0.924
#> SRR2061473 3 0.2448 0.858 0.076 0.000 0.924
#> SRR2061472 3 0.2448 0.858 0.076 0.000 0.924
#> SRR2061470 2 0.7153 0.656 0.300 0.652 0.048
#> SRR2061469 2 0.7153 0.656 0.300 0.652 0.048
#> SRR2061455 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061454 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061452 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061453 1 0.5740 0.440 0.804 0.096 0.100
#> SRR2061450 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061451 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061448 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061471 3 0.2448 0.858 0.076 0.000 0.924
#> SRR2061449 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061447 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061446 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061444 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061443 2 0.3213 0.655 0.092 0.900 0.008
#> SRR2061442 1 0.8330 0.767 0.552 0.356 0.092
#> SRR2061441 2 0.2173 0.725 0.048 0.944 0.008
#> SRR2061445 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061439 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061440 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061437 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061438 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061435 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061436 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061433 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061434 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061432 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061431 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061429 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061430 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061428 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061426 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061427 2 0.0424 0.788 0.000 0.992 0.008
#> SRR2061425 2 0.2173 0.725 0.048 0.944 0.008
#> SRR2061424 1 0.8346 0.762 0.548 0.360 0.092
#> SRR2061423 2 0.0829 0.779 0.004 0.984 0.012
#> SRR2061422 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061421 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061420 1 0.8222 0.794 0.576 0.332 0.092
#> SRR2061419 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061418 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061417 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061415 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061416 1 0.8155 0.804 0.580 0.332 0.088
#> SRR2061414 1 0.8155 0.804 0.580 0.332 0.088
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.6493 0.195 0.008 0.500 0.052 0.440
#> SRR2061467 2 0.6493 0.195 0.008 0.500 0.052 0.440
#> SRR2061466 2 0.6493 0.195 0.008 0.500 0.052 0.440
#> SRR2061464 4 0.4875 0.592 0.008 0.180 0.040 0.772
#> SRR2061465 2 0.6493 0.195 0.008 0.500 0.052 0.440
#> SRR2061463 4 0.4875 0.592 0.008 0.180 0.040 0.772
#> SRR2061462 4 0.4875 0.592 0.008 0.180 0.040 0.772
#> SRR2061460 4 0.5282 0.889 0.240 0.028 0.012 0.720
#> SRR2061459 4 0.5282 0.889 0.240 0.028 0.012 0.720
#> SRR2061461 4 0.5282 0.889 0.240 0.028 0.012 0.720
#> SRR2061458 4 0.5313 0.889 0.244 0.028 0.012 0.716
#> SRR2061457 4 0.5313 0.889 0.244 0.028 0.012 0.716
#> SRR2061481 3 0.0524 0.821 0.000 0.004 0.988 0.008
#> SRR2061488 3 0.4944 0.773 0.000 0.160 0.768 0.072
#> SRR2061456 4 0.5313 0.889 0.244 0.028 0.012 0.716
#> SRR2061487 3 0.4944 0.773 0.000 0.160 0.768 0.072
#> SRR2061485 3 0.4944 0.773 0.000 0.160 0.768 0.072
#> SRR2061486 3 0.4944 0.773 0.000 0.160 0.768 0.072
#> SRR2061484 3 0.4944 0.773 0.000 0.160 0.768 0.072
#> SRR2061482 3 0.0524 0.821 0.000 0.004 0.988 0.008
#> SRR2061480 3 0.0524 0.821 0.000 0.004 0.988 0.008
#> SRR2061483 3 0.4944 0.773 0.000 0.160 0.768 0.072
#> SRR2061478 3 0.5363 0.828 0.052 0.052 0.784 0.112
#> SRR2061477 3 0.5363 0.828 0.052 0.052 0.784 0.112
#> SRR2061475 3 0.5363 0.828 0.052 0.052 0.784 0.112
#> SRR2061474 3 0.5363 0.828 0.052 0.052 0.784 0.112
#> SRR2061476 3 0.5363 0.828 0.052 0.052 0.784 0.112
#> SRR2061473 3 0.5363 0.828 0.052 0.052 0.784 0.112
#> SRR2061472 3 0.5363 0.828 0.052 0.052 0.784 0.112
#> SRR2061470 2 0.6493 0.195 0.008 0.500 0.052 0.440
#> SRR2061469 2 0.6493 0.195 0.008 0.500 0.052 0.440
#> SRR2061455 4 0.5313 0.889 0.244 0.028 0.012 0.716
#> SRR2061454 4 0.5313 0.889 0.244 0.028 0.012 0.716
#> SRR2061452 1 0.0592 0.962 0.984 0.000 0.000 0.016
#> SRR2061453 4 0.5313 0.889 0.244 0.028 0.012 0.716
#> SRR2061450 1 0.0592 0.962 0.984 0.000 0.000 0.016
#> SRR2061451 1 0.0592 0.962 0.984 0.000 0.000 0.016
#> SRR2061448 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061471 3 0.5363 0.828 0.052 0.052 0.784 0.112
#> SRR2061449 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061447 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061446 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061444 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061443 2 0.6837 0.433 0.356 0.564 0.036 0.044
#> SRR2061442 1 0.4750 0.772 0.816 0.104 0.036 0.044
#> SRR2061441 2 0.6359 0.610 0.260 0.660 0.036 0.044
#> SRR2061445 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061439 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061429 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061430 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061428 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061426 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061427 2 0.2647 0.774 0.120 0.880 0.000 0.000
#> SRR2061425 2 0.6359 0.610 0.260 0.660 0.036 0.044
#> SRR2061424 1 0.4978 0.751 0.800 0.120 0.036 0.044
#> SRR2061423 2 0.5032 0.728 0.124 0.796 0.036 0.044
#> SRR2061422 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061420 1 0.2443 0.898 0.924 0.008 0.024 0.044
#> SRR2061419 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061415 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.972 1.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.6906 0.235 0.000 0.388 0.004 0.280 0.328
#> SRR2061467 2 0.6902 0.235 0.000 0.392 0.004 0.280 0.324
#> SRR2061466 2 0.6902 0.235 0.000 0.392 0.004 0.280 0.324
#> SRR2061464 4 0.3745 0.762 0.000 0.024 0.000 0.780 0.196
#> SRR2061465 2 0.6902 0.235 0.000 0.392 0.004 0.280 0.324
#> SRR2061463 4 0.3745 0.762 0.000 0.024 0.000 0.780 0.196
#> SRR2061462 4 0.3745 0.762 0.000 0.024 0.000 0.780 0.196
#> SRR2061460 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061459 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061461 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061458 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061457 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061481 3 0.3693 0.800 0.000 0.012 0.804 0.016 0.168
#> SRR2061488 3 0.5478 0.721 0.000 0.064 0.516 0.000 0.420
#> SRR2061456 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061487 3 0.5478 0.721 0.000 0.064 0.516 0.000 0.420
#> SRR2061485 3 0.5524 0.721 0.000 0.068 0.516 0.000 0.416
#> SRR2061486 3 0.5478 0.721 0.000 0.064 0.516 0.000 0.420
#> SRR2061484 3 0.5524 0.721 0.000 0.068 0.516 0.000 0.416
#> SRR2061482 3 0.3693 0.800 0.000 0.012 0.804 0.016 0.168
#> SRR2061480 3 0.3693 0.800 0.000 0.012 0.804 0.016 0.168
#> SRR2061483 3 0.5524 0.721 0.000 0.068 0.516 0.000 0.416
#> SRR2061478 3 0.1018 0.809 0.016 0.000 0.968 0.016 0.000
#> SRR2061477 3 0.1018 0.809 0.016 0.000 0.968 0.016 0.000
#> SRR2061475 3 0.0912 0.809 0.016 0.000 0.972 0.012 0.000
#> SRR2061474 3 0.0912 0.809 0.016 0.000 0.972 0.012 0.000
#> SRR2061476 3 0.0912 0.809 0.016 0.000 0.972 0.012 0.000
#> SRR2061473 3 0.0912 0.809 0.016 0.000 0.972 0.012 0.000
#> SRR2061472 3 0.0912 0.809 0.016 0.000 0.972 0.012 0.000
#> SRR2061470 2 0.6906 0.235 0.000 0.388 0.004 0.280 0.328
#> SRR2061469 2 0.6906 0.235 0.000 0.388 0.004 0.280 0.328
#> SRR2061455 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061454 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061452 1 0.1478 0.908 0.936 0.000 0.000 0.000 0.064
#> SRR2061453 4 0.1638 0.929 0.064 0.004 0.000 0.932 0.000
#> SRR2061450 1 0.1478 0.908 0.936 0.000 0.000 0.000 0.064
#> SRR2061451 1 0.1478 0.908 0.936 0.000 0.000 0.000 0.064
#> SRR2061448 2 0.1041 0.751 0.032 0.964 0.000 0.000 0.004
#> SRR2061471 3 0.0912 0.809 0.016 0.000 0.972 0.012 0.000
#> SRR2061449 2 0.1041 0.751 0.032 0.964 0.000 0.000 0.004
#> SRR2061447 2 0.1041 0.751 0.032 0.964 0.000 0.000 0.004
#> SRR2061446 2 0.0880 0.751 0.032 0.968 0.000 0.000 0.000
#> SRR2061444 2 0.0880 0.751 0.032 0.968 0.000 0.000 0.000
#> SRR2061443 2 0.6795 0.499 0.160 0.548 0.012 0.016 0.264
#> SRR2061442 1 0.6144 0.559 0.616 0.092 0.012 0.016 0.264
#> SRR2061441 2 0.6280 0.556 0.104 0.604 0.012 0.016 0.264
#> SRR2061445 2 0.0880 0.751 0.032 0.968 0.000 0.000 0.000
#> SRR2061439 1 0.0162 0.943 0.996 0.000 0.000 0.000 0.004
#> SRR2061440 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.0162 0.943 0.996 0.000 0.000 0.000 0.004
#> SRR2061433 1 0.0162 0.943 0.996 0.000 0.000 0.000 0.004
#> SRR2061434 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.1041 0.751 0.032 0.964 0.000 0.000 0.004
#> SRR2061429 2 0.1041 0.751 0.032 0.964 0.000 0.000 0.004
#> SRR2061430 2 0.1041 0.751 0.032 0.964 0.000 0.000 0.004
#> SRR2061428 2 0.0880 0.751 0.032 0.968 0.000 0.000 0.000
#> SRR2061426 2 0.0880 0.751 0.032 0.968 0.000 0.000 0.000
#> SRR2061427 2 0.0880 0.751 0.032 0.968 0.000 0.000 0.000
#> SRR2061425 2 0.6280 0.556 0.104 0.604 0.012 0.016 0.264
#> SRR2061424 1 0.6280 0.539 0.604 0.104 0.012 0.016 0.264
#> SRR2061423 2 0.5254 0.606 0.032 0.676 0.012 0.016 0.264
#> SRR2061422 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061421 1 0.0162 0.943 0.996 0.000 0.000 0.000 0.004
#> SRR2061420 1 0.4444 0.688 0.708 0.000 0.012 0.016 0.264
#> SRR2061419 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0162 0.943 0.996 0.000 0.000 0.000 0.004
#> SRR2061417 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.0162 0.943 0.996 0.000 0.000 0.000 0.004
#> SRR2061416 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.944 1.000 0.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.3355 0.9968 0.000 0.816 0.000 0.132 0.048 NA
#> SRR2061467 2 0.3213 0.9968 0.000 0.820 0.000 0.132 0.048 NA
#> SRR2061466 2 0.3213 0.9968 0.000 0.820 0.000 0.132 0.048 NA
#> SRR2061464 4 0.5533 0.4032 0.000 0.308 0.000 0.584 0.048 NA
#> SRR2061465 2 0.3213 0.9968 0.000 0.820 0.000 0.132 0.048 NA
#> SRR2061463 4 0.5533 0.4032 0.000 0.308 0.000 0.584 0.048 NA
#> SRR2061462 4 0.5533 0.4032 0.000 0.308 0.000 0.584 0.048 NA
#> SRR2061460 4 0.1285 0.8677 0.052 0.000 0.000 0.944 0.004 NA
#> SRR2061459 4 0.1285 0.8677 0.052 0.000 0.000 0.944 0.004 NA
#> SRR2061461 4 0.1285 0.8677 0.052 0.000 0.000 0.944 0.004 NA
#> SRR2061458 4 0.1141 0.8685 0.052 0.000 0.000 0.948 0.000 NA
#> SRR2061457 4 0.1141 0.8685 0.052 0.000 0.000 0.948 0.000 NA
#> SRR2061481 3 0.4519 0.7673 0.000 0.056 0.728 0.004 0.020 NA
#> SRR2061488 3 0.1155 0.7013 0.000 0.036 0.956 0.004 0.004 NA
#> SRR2061456 4 0.1141 0.8685 0.052 0.000 0.000 0.948 0.000 NA
#> SRR2061487 3 0.1155 0.7013 0.000 0.036 0.956 0.004 0.004 NA
#> SRR2061485 3 0.1010 0.7017 0.000 0.036 0.960 0.000 0.004 NA
#> SRR2061486 3 0.1155 0.7013 0.000 0.036 0.956 0.004 0.004 NA
#> SRR2061484 3 0.1010 0.7017 0.000 0.036 0.960 0.000 0.004 NA
#> SRR2061482 3 0.4519 0.7673 0.000 0.056 0.728 0.004 0.020 NA
#> SRR2061480 3 0.4519 0.7673 0.000 0.056 0.728 0.004 0.020 NA
#> SRR2061483 3 0.1010 0.7017 0.000 0.036 0.960 0.000 0.004 NA
#> SRR2061478 3 0.4217 0.7823 0.004 0.000 0.524 0.008 0.000 NA
#> SRR2061477 3 0.4217 0.7823 0.004 0.000 0.524 0.008 0.000 NA
#> SRR2061475 3 0.3991 0.7829 0.004 0.000 0.524 0.000 0.000 NA
#> SRR2061474 3 0.3991 0.7829 0.004 0.000 0.524 0.000 0.000 NA
#> SRR2061476 3 0.3991 0.7829 0.004 0.000 0.524 0.000 0.000 NA
#> SRR2061473 3 0.3991 0.7829 0.004 0.000 0.524 0.000 0.000 NA
#> SRR2061472 3 0.3991 0.7829 0.004 0.000 0.524 0.000 0.000 NA
#> SRR2061470 2 0.3355 0.9968 0.000 0.816 0.000 0.132 0.048 NA
#> SRR2061469 2 0.3355 0.9968 0.000 0.816 0.000 0.132 0.048 NA
#> SRR2061455 4 0.1141 0.8685 0.052 0.000 0.000 0.948 0.000 NA
#> SRR2061454 4 0.1141 0.8685 0.052 0.000 0.000 0.948 0.000 NA
#> SRR2061452 1 0.3534 0.7956 0.772 0.024 0.000 0.000 0.004 NA
#> SRR2061453 4 0.1141 0.8685 0.052 0.000 0.000 0.948 0.000 NA
#> SRR2061450 1 0.3534 0.7956 0.772 0.024 0.000 0.000 0.004 NA
#> SRR2061451 1 0.3580 0.7957 0.772 0.028 0.000 0.000 0.004 NA
#> SRR2061448 5 0.7208 0.6310 0.020 0.276 0.020 0.020 0.432 NA
#> SRR2061471 3 0.3991 0.7829 0.004 0.000 0.524 0.000 0.000 NA
#> SRR2061449 5 0.7208 0.6310 0.020 0.276 0.020 0.020 0.432 NA
#> SRR2061447 5 0.7208 0.6310 0.020 0.276 0.020 0.020 0.432 NA
#> SRR2061446 5 0.7326 0.6318 0.020 0.284 0.020 0.032 0.436 NA
#> SRR2061444 5 0.7326 0.6318 0.020 0.284 0.020 0.032 0.436 NA
#> SRR2061443 5 0.1531 0.3839 0.068 0.000 0.000 0.004 0.928 NA
#> SRR2061442 5 0.3950 -0.1548 0.432 0.000 0.000 0.004 0.564 NA
#> SRR2061441 5 0.1010 0.3981 0.036 0.000 0.000 0.004 0.960 NA
#> SRR2061445 5 0.7326 0.6318 0.020 0.284 0.020 0.032 0.436 NA
#> SRR2061439 1 0.0935 0.9479 0.964 0.000 0.000 0.000 0.004 NA
#> SRR2061440 1 0.0858 0.9485 0.968 0.000 0.000 0.000 0.004 NA
#> SRR2061437 1 0.0000 0.9540 1.000 0.000 0.000 0.000 0.000 NA
#> SRR2061438 1 0.0858 0.9485 0.968 0.000 0.000 0.000 0.004 NA
#> SRR2061435 1 0.0858 0.9485 0.968 0.000 0.000 0.000 0.004 NA
#> SRR2061436 1 0.0717 0.9487 0.976 0.008 0.000 0.000 0.000 NA
#> SRR2061433 1 0.0717 0.9487 0.976 0.008 0.000 0.000 0.000 NA
#> SRR2061434 1 0.0000 0.9540 1.000 0.000 0.000 0.000 0.000 NA
#> SRR2061432 1 0.0146 0.9535 0.996 0.004 0.000 0.000 0.000 NA
#> SRR2061431 5 0.7151 0.6310 0.020 0.276 0.020 0.016 0.432 NA
#> SRR2061429 5 0.7151 0.6310 0.020 0.276 0.020 0.016 0.432 NA
#> SRR2061430 5 0.7151 0.6310 0.020 0.276 0.020 0.016 0.432 NA
#> SRR2061428 5 0.7292 0.6308 0.020 0.288 0.020 0.028 0.432 NA
#> SRR2061426 5 0.7292 0.6308 0.020 0.288 0.020 0.028 0.432 NA
#> SRR2061427 5 0.7283 0.6317 0.020 0.284 0.020 0.028 0.436 NA
#> SRR2061425 5 0.1010 0.3981 0.036 0.000 0.000 0.004 0.960 NA
#> SRR2061424 5 0.3907 -0.0937 0.408 0.000 0.000 0.004 0.588 NA
#> SRR2061423 5 0.1148 0.3981 0.020 0.016 0.000 0.004 0.960 NA
#> SRR2061422 1 0.0858 0.9485 0.968 0.000 0.000 0.000 0.004 NA
#> SRR2061421 1 0.1080 0.9475 0.960 0.004 0.000 0.000 0.004 NA
#> SRR2061420 5 0.4222 -0.2544 0.472 0.000 0.000 0.004 0.516 NA
#> SRR2061419 1 0.0000 0.9540 1.000 0.000 0.000 0.000 0.000 NA
#> SRR2061418 1 0.0146 0.9537 0.996 0.000 0.000 0.000 0.000 NA
#> SRR2061417 1 0.0363 0.9529 0.988 0.000 0.000 0.000 0.000 NA
#> SRR2061415 1 0.0717 0.9487 0.976 0.008 0.000 0.000 0.000 NA
#> SRR2061416 1 0.0000 0.9540 1.000 0.000 0.000 0.000 0.000 NA
#> SRR2061414 1 0.0000 0.9540 1.000 0.000 0.000 0.000 0.000 NA
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
CV:skmeans*
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.491 0.397 0.772 0.5057 0.494 0.494
#> 3 3 0.705 0.797 0.867 0.2760 0.629 0.385
#> 4 4 0.938 0.927 0.965 0.1621 0.875 0.653
#> 5 5 0.934 0.842 0.886 0.0508 0.947 0.794
#> 6 6 0.942 0.952 0.946 0.0402 0.957 0.800
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 0.599 0.000 1.000
#> SRR2061467 2 0.000 0.599 0.000 1.000
#> SRR2061466 2 0.000 0.599 0.000 1.000
#> SRR2061464 2 0.000 0.599 0.000 1.000
#> SRR2061465 2 0.000 0.599 0.000 1.000
#> SRR2061463 2 0.000 0.599 0.000 1.000
#> SRR2061462 2 0.000 0.599 0.000 1.000
#> SRR2061460 2 1.000 0.296 0.500 0.500
#> SRR2061459 1 1.000 -0.333 0.500 0.500
#> SRR2061461 2 1.000 0.296 0.500 0.500
#> SRR2061458 2 1.000 0.296 0.500 0.500
#> SRR2061457 1 1.000 -0.333 0.500 0.500
#> SRR2061481 2 0.000 0.599 0.000 1.000
#> SRR2061488 2 0.000 0.599 0.000 1.000
#> SRR2061456 2 1.000 0.296 0.500 0.500
#> SRR2061487 2 0.000 0.599 0.000 1.000
#> SRR2061485 2 0.000 0.599 0.000 1.000
#> SRR2061486 2 0.000 0.599 0.000 1.000
#> SRR2061484 2 0.000 0.599 0.000 1.000
#> SRR2061482 2 0.000 0.599 0.000 1.000
#> SRR2061480 2 0.000 0.599 0.000 1.000
#> SRR2061483 2 0.000 0.599 0.000 1.000
#> SRR2061478 2 1.000 0.301 0.496 0.504
#> SRR2061477 2 1.000 0.301 0.496 0.504
#> SRR2061475 2 1.000 0.301 0.496 0.504
#> SRR2061474 2 1.000 0.301 0.496 0.504
#> SRR2061476 2 1.000 0.301 0.496 0.504
#> SRR2061473 2 1.000 0.301 0.496 0.504
#> SRR2061472 2 1.000 0.301 0.496 0.504
#> SRR2061470 2 0.000 0.599 0.000 1.000
#> SRR2061469 2 0.000 0.599 0.000 1.000
#> SRR2061455 1 1.000 -0.333 0.500 0.500
#> SRR2061454 2 1.000 0.296 0.500 0.500
#> SRR2061452 1 0.000 0.657 1.000 0.000
#> SRR2061453 1 1.000 -0.333 0.500 0.500
#> SRR2061450 1 0.000 0.657 1.000 0.000
#> SRR2061451 1 0.000 0.657 1.000 0.000
#> SRR2061448 2 1.000 -0.287 0.500 0.500
#> SRR2061471 2 1.000 0.301 0.496 0.504
#> SRR2061449 2 1.000 -0.287 0.500 0.500
#> SRR2061447 1 1.000 0.247 0.500 0.500
#> SRR2061446 1 1.000 0.247 0.500 0.500
#> SRR2061444 2 1.000 -0.287 0.500 0.500
#> SRR2061443 1 1.000 0.251 0.504 0.496
#> SRR2061442 1 0.000 0.657 1.000 0.000
#> SRR2061441 1 1.000 0.251 0.504 0.496
#> SRR2061445 2 1.000 -0.287 0.500 0.500
#> SRR2061439 1 0.000 0.657 1.000 0.000
#> SRR2061440 1 0.000 0.657 1.000 0.000
#> SRR2061437 1 0.000 0.657 1.000 0.000
#> SRR2061438 1 0.000 0.657 1.000 0.000
#> SRR2061435 1 0.000 0.657 1.000 0.000
#> SRR2061436 1 0.000 0.657 1.000 0.000
#> SRR2061433 1 0.000 0.657 1.000 0.000
#> SRR2061434 1 0.000 0.657 1.000 0.000
#> SRR2061432 1 0.000 0.657 1.000 0.000
#> SRR2061431 2 1.000 -0.287 0.500 0.500
#> SRR2061429 1 1.000 0.247 0.500 0.500
#> SRR2061430 1 1.000 0.247 0.500 0.500
#> SRR2061428 1 1.000 0.247 0.500 0.500
#> SRR2061426 1 1.000 0.247 0.500 0.500
#> SRR2061427 1 1.000 0.247 0.500 0.500
#> SRR2061425 1 1.000 0.251 0.504 0.496
#> SRR2061424 1 0.969 0.332 0.604 0.396
#> SRR2061423 1 1.000 0.251 0.504 0.496
#> SRR2061422 1 0.000 0.657 1.000 0.000
#> SRR2061421 1 0.000 0.657 1.000 0.000
#> SRR2061420 1 0.000 0.657 1.000 0.000
#> SRR2061419 1 0.000 0.657 1.000 0.000
#> SRR2061418 1 0.000 0.657 1.000 0.000
#> SRR2061417 1 0.000 0.657 1.000 0.000
#> SRR2061415 1 0.000 0.657 1.000 0.000
#> SRR2061416 1 0.000 0.657 1.000 0.000
#> SRR2061414 1 0.000 0.657 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.5929 0.680 0.320 0.676 0.004
#> SRR2061467 2 0.5929 0.680 0.320 0.676 0.004
#> SRR2061466 2 0.5929 0.680 0.320 0.676 0.004
#> SRR2061464 2 0.6769 0.665 0.320 0.652 0.028
#> SRR2061465 2 0.5929 0.680 0.320 0.676 0.004
#> SRR2061463 2 0.6769 0.665 0.320 0.652 0.028
#> SRR2061462 2 0.6769 0.665 0.320 0.652 0.028
#> SRR2061460 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061459 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061461 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061458 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061457 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061481 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061488 3 0.1163 0.978 0.000 0.028 0.972
#> SRR2061456 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061487 3 0.1163 0.978 0.000 0.028 0.972
#> SRR2061485 3 0.1163 0.978 0.000 0.028 0.972
#> SRR2061486 3 0.1163 0.978 0.000 0.028 0.972
#> SRR2061484 3 0.1163 0.978 0.000 0.028 0.972
#> SRR2061482 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061480 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061483 3 0.1163 0.978 0.000 0.028 0.972
#> SRR2061478 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061477 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061475 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061474 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061476 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061473 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061472 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061470 2 0.5929 0.680 0.320 0.676 0.004
#> SRR2061469 2 0.5929 0.680 0.320 0.676 0.004
#> SRR2061455 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061454 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061452 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061453 1 0.2663 0.591 0.932 0.024 0.044
#> SRR2061450 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061451 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061448 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061471 3 0.0000 0.988 0.000 0.000 1.000
#> SRR2061449 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061447 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061446 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061444 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061443 2 0.2165 0.725 0.064 0.936 0.000
#> SRR2061442 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061441 2 0.1411 0.759 0.036 0.964 0.000
#> SRR2061445 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061439 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061440 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061437 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061438 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061435 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061436 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061433 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061434 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061432 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061431 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.794 0.000 1.000 0.000
#> SRR2061425 2 0.1411 0.759 0.036 0.964 0.000
#> SRR2061424 2 0.6008 -0.150 0.372 0.628 0.000
#> SRR2061423 2 0.0424 0.786 0.008 0.992 0.000
#> SRR2061422 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061421 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061420 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061419 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061418 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061417 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061415 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061416 1 0.5706 0.838 0.680 0.320 0.000
#> SRR2061414 1 0.5706 0.838 0.680 0.320 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.4888 0.464 0.000 0.588 0 0.412
#> SRR2061467 2 0.4888 0.464 0.000 0.588 0 0.412
#> SRR2061466 2 0.4888 0.464 0.000 0.588 0 0.412
#> SRR2061464 4 0.0188 0.995 0.000 0.004 0 0.996
#> SRR2061465 2 0.4888 0.464 0.000 0.588 0 0.412
#> SRR2061463 4 0.0188 0.995 0.000 0.004 0 0.996
#> SRR2061462 4 0.0188 0.995 0.000 0.004 0 0.996
#> SRR2061460 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061459 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061461 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061458 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061457 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061481 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061488 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061456 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061487 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061485 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061486 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061484 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061482 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061480 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061483 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061478 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061477 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061475 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061474 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061476 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061473 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061472 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061470 2 0.4888 0.464 0.000 0.588 0 0.412
#> SRR2061469 2 0.4888 0.464 0.000 0.588 0 0.412
#> SRR2061455 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061454 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061452 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061453 4 0.0188 0.998 0.004 0.000 0 0.996
#> SRR2061450 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061451 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061448 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061471 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR2061449 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061447 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061446 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061444 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061443 2 0.0895 0.850 0.020 0.976 0 0.004
#> SRR2061442 1 0.0188 0.996 0.996 0.000 0 0.004
#> SRR2061441 2 0.0188 0.867 0.000 0.996 0 0.004
#> SRR2061445 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061439 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061440 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061437 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061438 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061435 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061436 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061433 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061434 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061432 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061431 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061429 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061430 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061428 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061426 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061427 2 0.0000 0.868 0.000 1.000 0 0.000
#> SRR2061425 2 0.0188 0.867 0.000 0.996 0 0.004
#> SRR2061424 1 0.0376 0.993 0.992 0.004 0 0.004
#> SRR2061423 2 0.0188 0.867 0.000 0.996 0 0.004
#> SRR2061422 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061421 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061420 1 0.0188 0.996 0.996 0.000 0 0.004
#> SRR2061419 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061418 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061417 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061415 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061416 1 0.0000 0.999 1.000 0.000 0 0.000
#> SRR2061414 1 0.0000 0.999 1.000 0.000 0 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.559 0.538 0.000 0.496 0.000 0.072 0.432
#> SRR2061467 2 0.559 0.538 0.000 0.496 0.000 0.072 0.432
#> SRR2061466 2 0.559 0.538 0.000 0.496 0.000 0.072 0.432
#> SRR2061464 4 0.409 0.674 0.000 0.000 0.000 0.632 0.368
#> SRR2061465 2 0.559 0.538 0.000 0.496 0.000 0.072 0.432
#> SRR2061463 4 0.409 0.674 0.000 0.000 0.000 0.632 0.368
#> SRR2061462 4 0.409 0.674 0.000 0.000 0.000 0.632 0.368
#> SRR2061460 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061459 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061461 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061458 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061457 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061481 3 0.000 0.990 0.000 0.000 1.000 0.000 0.000
#> SRR2061488 3 0.029 0.989 0.000 0.000 0.992 0.000 0.008
#> SRR2061456 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061487 3 0.029 0.989 0.000 0.000 0.992 0.000 0.008
#> SRR2061485 3 0.029 0.989 0.000 0.000 0.992 0.000 0.008
#> SRR2061486 3 0.029 0.989 0.000 0.000 0.992 0.000 0.008
#> SRR2061484 3 0.029 0.989 0.000 0.000 0.992 0.000 0.008
#> SRR2061482 3 0.000 0.990 0.000 0.000 1.000 0.000 0.000
#> SRR2061480 3 0.000 0.990 0.000 0.000 1.000 0.000 0.000
#> SRR2061483 3 0.029 0.989 0.000 0.000 0.992 0.000 0.008
#> SRR2061478 3 0.051 0.990 0.000 0.000 0.984 0.000 0.016
#> SRR2061477 3 0.051 0.990 0.000 0.000 0.984 0.000 0.016
#> SRR2061475 3 0.051 0.990 0.000 0.000 0.984 0.000 0.016
#> SRR2061474 3 0.051 0.990 0.000 0.000 0.984 0.000 0.016
#> SRR2061476 3 0.051 0.990 0.000 0.000 0.984 0.000 0.016
#> SRR2061473 3 0.051 0.990 0.000 0.000 0.984 0.000 0.016
#> SRR2061472 3 0.051 0.990 0.000 0.000 0.984 0.000 0.016
#> SRR2061470 2 0.559 0.538 0.000 0.496 0.000 0.072 0.432
#> SRR2061469 2 0.559 0.538 0.000 0.496 0.000 0.072 0.432
#> SRR2061455 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061454 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061452 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.000 0.899 0.000 0.000 0.000 1.000 0.000
#> SRR2061450 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061448 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061471 3 0.051 0.990 0.000 0.000 0.984 0.000 0.016
#> SRR2061449 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061447 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061446 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061444 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061443 5 0.427 0.521 0.000 0.448 0.000 0.000 0.552
#> SRR2061442 5 0.427 0.349 0.448 0.000 0.000 0.000 0.552
#> SRR2061441 5 0.427 0.521 0.000 0.448 0.000 0.000 0.552
#> SRR2061445 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061439 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061437 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061429 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061430 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061428 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061426 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061427 2 0.000 0.752 0.000 1.000 0.000 0.000 0.000
#> SRR2061425 5 0.427 0.521 0.000 0.448 0.000 0.000 0.552
#> SRR2061424 5 0.442 0.357 0.444 0.004 0.000 0.000 0.552
#> SRR2061423 5 0.427 0.521 0.000 0.448 0.000 0.000 0.552
#> SRR2061422 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061421 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061420 5 0.427 0.349 0.448 0.000 0.000 0.000 0.552
#> SRR2061419 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 6 0.295 0.903 0.000 0.148 0.000 0.024 0.000 0.828
#> SRR2061467 6 0.295 0.903 0.000 0.148 0.000 0.024 0.000 0.828
#> SRR2061466 6 0.295 0.903 0.000 0.148 0.000 0.024 0.000 0.828
#> SRR2061464 6 0.297 0.774 0.000 0.000 0.000 0.224 0.000 0.776
#> SRR2061465 6 0.295 0.903 0.000 0.148 0.000 0.024 0.000 0.828
#> SRR2061463 6 0.297 0.774 0.000 0.000 0.000 0.224 0.000 0.776
#> SRR2061462 6 0.297 0.774 0.000 0.000 0.000 0.224 0.000 0.776
#> SRR2061460 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061459 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061461 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061458 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061457 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061481 3 0.360 0.891 0.000 0.000 0.784 0.000 0.056 0.160
#> SRR2061488 3 0.383 0.887 0.000 0.000 0.756 0.000 0.056 0.188
#> SRR2061456 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061487 3 0.383 0.887 0.000 0.000 0.756 0.000 0.056 0.188
#> SRR2061485 3 0.383 0.887 0.000 0.000 0.756 0.000 0.056 0.188
#> SRR2061486 3 0.383 0.887 0.000 0.000 0.756 0.000 0.056 0.188
#> SRR2061484 3 0.383 0.887 0.000 0.000 0.756 0.000 0.056 0.188
#> SRR2061482 3 0.360 0.891 0.000 0.000 0.784 0.000 0.056 0.160
#> SRR2061480 3 0.360 0.891 0.000 0.000 0.784 0.000 0.056 0.160
#> SRR2061483 3 0.383 0.887 0.000 0.000 0.756 0.000 0.056 0.188
#> SRR2061478 3 0.000 0.881 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061477 3 0.000 0.881 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061475 3 0.000 0.881 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061474 3 0.000 0.881 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061476 3 0.000 0.881 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061473 3 0.000 0.881 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061472 3 0.000 0.881 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061470 6 0.295 0.903 0.000 0.148 0.000 0.024 0.000 0.828
#> SRR2061469 6 0.295 0.903 0.000 0.148 0.000 0.024 0.000 0.828
#> SRR2061455 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061454 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061452 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061450 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061448 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061471 3 0.000 0.881 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061449 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061447 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061446 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061444 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061443 5 0.120 0.954 0.000 0.056 0.000 0.000 0.944 0.000
#> SRR2061442 5 0.120 0.939 0.056 0.000 0.000 0.000 0.944 0.000
#> SRR2061441 5 0.120 0.954 0.000 0.056 0.000 0.000 0.944 0.000
#> SRR2061445 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061439 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061437 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061429 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061430 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061428 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061426 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061427 2 0.000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061425 5 0.120 0.954 0.000 0.056 0.000 0.000 0.944 0.000
#> SRR2061424 5 0.120 0.939 0.056 0.000 0.000 0.000 0.944 0.000
#> SRR2061423 5 0.120 0.954 0.000 0.056 0.000 0.000 0.944 0.000
#> SRR2061422 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061421 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061420 5 0.120 0.939 0.056 0.000 0.000 0.000 0.944 0.000
#> SRR2061419 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
CV:pam**
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.3616 0.641 0.641
#> 3 3 0.624 0.851 0.895 0.7695 0.704 0.538
#> 4 4 0.864 0.944 0.968 0.1619 0.889 0.687
#> 5 5 0.921 0.966 0.943 0.0426 0.973 0.895
#> 6 6 1.000 1.000 1.000 0.0473 0.948 0.777
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 5
There is also optional best \(k\) = 2 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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 1 0.118 0.991 0.984 0.016
#> SRR2061467 1 0.118 0.991 0.984 0.016
#> SRR2061466 1 0.118 0.991 0.984 0.016
#> SRR2061464 1 0.118 0.991 0.984 0.016
#> SRR2061465 1 0.118 0.991 0.984 0.016
#> SRR2061463 1 0.118 0.991 0.984 0.016
#> SRR2061462 1 0.118 0.991 0.984 0.016
#> SRR2061460 1 0.000 0.993 1.000 0.000
#> SRR2061459 1 0.000 0.993 1.000 0.000
#> SRR2061461 1 0.000 0.993 1.000 0.000
#> SRR2061458 1 0.000 0.993 1.000 0.000
#> SRR2061457 1 0.000 0.993 1.000 0.000
#> SRR2061481 2 0.000 0.992 0.000 1.000
#> SRR2061488 2 0.000 0.992 0.000 1.000
#> SRR2061456 1 0.000 0.993 1.000 0.000
#> SRR2061487 2 0.000 0.992 0.000 1.000
#> SRR2061485 2 0.000 0.992 0.000 1.000
#> SRR2061486 2 0.000 0.992 0.000 1.000
#> SRR2061484 2 0.000 0.992 0.000 1.000
#> SRR2061482 2 0.000 0.992 0.000 1.000
#> SRR2061480 2 0.000 0.992 0.000 1.000
#> SRR2061483 2 0.000 0.992 0.000 1.000
#> SRR2061478 2 0.118 0.991 0.016 0.984
#> SRR2061477 2 0.118 0.991 0.016 0.984
#> SRR2061475 2 0.118 0.991 0.016 0.984
#> SRR2061474 2 0.118 0.991 0.016 0.984
#> SRR2061476 2 0.118 0.991 0.016 0.984
#> SRR2061473 2 0.118 0.991 0.016 0.984
#> SRR2061472 2 0.118 0.991 0.016 0.984
#> SRR2061470 1 0.118 0.991 0.984 0.016
#> SRR2061469 1 0.118 0.991 0.984 0.016
#> SRR2061455 1 0.000 0.993 1.000 0.000
#> SRR2061454 1 0.000 0.993 1.000 0.000
#> SRR2061452 1 0.000 0.993 1.000 0.000
#> SRR2061453 1 0.000 0.993 1.000 0.000
#> SRR2061450 1 0.000 0.993 1.000 0.000
#> SRR2061451 1 0.000 0.993 1.000 0.000
#> SRR2061448 1 0.118 0.991 0.984 0.016
#> SRR2061471 2 0.118 0.991 0.016 0.984
#> SRR2061449 1 0.118 0.991 0.984 0.016
#> SRR2061447 1 0.118 0.991 0.984 0.016
#> SRR2061446 1 0.118 0.991 0.984 0.016
#> SRR2061444 1 0.118 0.991 0.984 0.016
#> SRR2061443 1 0.118 0.991 0.984 0.016
#> SRR2061442 1 0.000 0.993 1.000 0.000
#> SRR2061441 1 0.118 0.991 0.984 0.016
#> SRR2061445 1 0.118 0.991 0.984 0.016
#> SRR2061439 1 0.000 0.993 1.000 0.000
#> SRR2061440 1 0.000 0.993 1.000 0.000
#> SRR2061437 1 0.000 0.993 1.000 0.000
#> SRR2061438 1 0.000 0.993 1.000 0.000
#> SRR2061435 1 0.000 0.993 1.000 0.000
#> SRR2061436 1 0.000 0.993 1.000 0.000
#> SRR2061433 1 0.000 0.993 1.000 0.000
#> SRR2061434 1 0.000 0.993 1.000 0.000
#> SRR2061432 1 0.000 0.993 1.000 0.000
#> SRR2061431 1 0.118 0.991 0.984 0.016
#> SRR2061429 1 0.118 0.991 0.984 0.016
#> SRR2061430 1 0.118 0.991 0.984 0.016
#> SRR2061428 1 0.118 0.991 0.984 0.016
#> SRR2061426 1 0.118 0.991 0.984 0.016
#> SRR2061427 1 0.118 0.991 0.984 0.016
#> SRR2061425 1 0.118 0.991 0.984 0.016
#> SRR2061424 1 0.000 0.993 1.000 0.000
#> SRR2061423 1 0.118 0.991 0.984 0.016
#> SRR2061422 1 0.000 0.993 1.000 0.000
#> SRR2061421 1 0.000 0.993 1.000 0.000
#> SRR2061420 1 0.000 0.993 1.000 0.000
#> SRR2061419 1 0.000 0.993 1.000 0.000
#> SRR2061418 1 0.000 0.993 1.000 0.000
#> SRR2061417 1 0.000 0.993 1.000 0.000
#> SRR2061415 1 0.000 0.993 1.000 0.000
#> SRR2061416 1 0.000 0.993 1.000 0.000
#> SRR2061414 1 0.000 0.993 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061464 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061465 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061463 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061462 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061460 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061459 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061461 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061458 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061457 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061481 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061488 3 0.4452 0.827 0.000 0.192 0.808
#> SRR2061456 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061487 3 0.4452 0.827 0.000 0.192 0.808
#> SRR2061485 3 0.4452 0.827 0.000 0.192 0.808
#> SRR2061486 3 0.4452 0.827 0.000 0.192 0.808
#> SRR2061484 3 0.4452 0.827 0.000 0.192 0.808
#> SRR2061482 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061480 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061483 3 0.4452 0.827 0.000 0.192 0.808
#> SRR2061478 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061477 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061475 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061474 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061476 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061473 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061472 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061470 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.749 0.000 1.000 0.000
#> SRR2061455 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061454 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061452 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061453 1 0.5254 0.738 0.736 0.264 0.000
#> SRR2061450 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061448 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061471 3 0.0000 0.920 0.000 0.000 1.000
#> SRR2061449 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061447 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061446 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061444 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061443 2 0.5363 0.853 0.276 0.724 0.000
#> SRR2061442 1 0.0592 0.888 0.988 0.012 0.000
#> SRR2061441 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061445 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061439 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061440 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061437 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061438 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061435 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061431 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061429 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061430 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061428 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061426 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061427 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061425 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061424 1 0.0424 0.892 0.992 0.008 0.000
#> SRR2061423 2 0.5254 0.866 0.264 0.736 0.000
#> SRR2061422 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061420 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061419 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061418 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061417 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061415 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061416 1 0.0000 0.899 1.000 0.000 0.000
#> SRR2061414 1 0.0000 0.899 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.3610 0.811 0.000 0.800 0.000 0.2
#> SRR2061467 2 0.3610 0.811 0.000 0.800 0.000 0.2
#> SRR2061466 2 0.3610 0.811 0.000 0.800 0.000 0.2
#> SRR2061464 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061465 2 0.3610 0.811 0.000 0.800 0.000 0.2
#> SRR2061463 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061462 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061481 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061488 3 0.3528 0.828 0.000 0.192 0.808 0.0
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061487 3 0.3528 0.828 0.000 0.192 0.808 0.0
#> SRR2061485 3 0.3528 0.828 0.000 0.192 0.808 0.0
#> SRR2061486 3 0.3528 0.828 0.000 0.192 0.808 0.0
#> SRR2061484 3 0.3528 0.828 0.000 0.192 0.808 0.0
#> SRR2061482 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061480 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061483 3 0.3528 0.828 0.000 0.192 0.808 0.0
#> SRR2061478 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061477 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061475 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061474 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061476 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061473 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061472 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061470 2 0.3610 0.811 0.000 0.800 0.000 0.2
#> SRR2061469 2 0.3610 0.811 0.000 0.800 0.000 0.2
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061452 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.0
#> SRR2061450 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061451 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061448 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061471 3 0.0000 0.914 0.000 0.000 1.000 0.0
#> SRR2061449 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061447 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061446 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061444 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061443 2 0.1022 0.910 0.032 0.968 0.000 0.0
#> SRR2061442 1 0.0336 0.992 0.992 0.008 0.000 0.0
#> SRR2061441 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061445 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061439 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061440 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061437 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061438 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061435 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061436 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061433 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061434 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061432 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061431 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061429 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061430 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061428 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061426 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061427 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061425 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061424 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061423 2 0.0000 0.937 0.000 1.000 0.000 0.0
#> SRR2061422 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061421 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061420 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061419 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061418 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061417 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061415 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061416 1 0.0000 1.000 1.000 0.000 0.000 0.0
#> SRR2061414 1 0.0000 1.000 1.000 0.000 0.000 0.0
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.395 0.838 0.000 0.800 0.116 0.084 0.000
#> SRR2061467 2 0.395 0.838 0.000 0.800 0.116 0.084 0.000
#> SRR2061466 2 0.395 0.838 0.000 0.800 0.116 0.084 0.000
#> SRR2061464 4 0.223 0.906 0.000 0.000 0.116 0.884 0.000
#> SRR2061465 2 0.395 0.838 0.000 0.800 0.116 0.084 0.000
#> SRR2061463 4 0.223 0.906 0.000 0.000 0.116 0.884 0.000
#> SRR2061462 4 0.223 0.906 0.000 0.000 0.116 0.884 0.000
#> SRR2061460 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061459 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061461 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061458 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061457 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061481 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061488 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061456 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061487 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061485 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061486 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061484 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061482 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061480 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061483 3 0.223 1.000 0.000 0.000 0.884 0.000 0.116
#> SRR2061478 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061477 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061475 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061474 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061476 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061473 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061472 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061470 2 0.395 0.838 0.000 0.800 0.116 0.084 0.000
#> SRR2061469 2 0.395 0.838 0.000 0.800 0.116 0.084 0.000
#> SRR2061455 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061454 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061452 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.000 0.970 0.000 0.000 0.000 1.000 0.000
#> SRR2061450 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061448 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061471 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061449 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061447 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061446 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061444 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061443 2 0.088 0.915 0.032 0.968 0.000 0.000 0.000
#> SRR2061442 1 0.029 0.991 0.992 0.008 0.000 0.000 0.000
#> SRR2061441 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061445 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061439 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061437 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061429 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061430 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061428 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061426 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061427 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061425 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061424 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061423 2 0.000 0.942 0.000 1.000 0.000 0.000 0.000
#> SRR2061422 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061421 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061420 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061419 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.000 1.000 1.000 0.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061467 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061466 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061464 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061465 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061463 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061462 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061460 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061459 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061461 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061458 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061457 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061481 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061488 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061456 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061487 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061485 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061486 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061484 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061482 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061480 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061483 3 0.000 1.000 0.000 0 1 0 0.000 0
#> SRR2061478 6 0.000 1.000 0.000 0 0 0 0.000 1
#> SRR2061477 6 0.000 1.000 0.000 0 0 0 0.000 1
#> SRR2061475 6 0.000 1.000 0.000 0 0 0 0.000 1
#> SRR2061474 6 0.000 1.000 0.000 0 0 0 0.000 1
#> SRR2061476 6 0.000 1.000 0.000 0 0 0 0.000 1
#> SRR2061473 6 0.000 1.000 0.000 0 0 0 0.000 1
#> SRR2061472 6 0.000 1.000 0.000 0 0 0 0.000 1
#> SRR2061470 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061469 2 0.000 1.000 0.000 1 0 0 0.000 0
#> SRR2061455 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061454 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061452 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061453 4 0.000 1.000 0.000 0 0 1 0.000 0
#> SRR2061450 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061451 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061448 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061471 6 0.000 1.000 0.000 0 0 0 0.000 1
#> SRR2061449 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061447 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061446 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061444 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061443 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061442 1 0.026 0.991 0.992 0 0 0 0.008 0
#> SRR2061441 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061445 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061439 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061440 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061437 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061438 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061435 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061436 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061433 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061434 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061432 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061431 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061429 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061430 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061428 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061426 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061427 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061425 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061424 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061423 5 0.000 1.000 0.000 0 0 0 1.000 0
#> SRR2061422 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061421 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061420 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061419 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061418 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061417 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061415 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061416 1 0.000 1.000 1.000 0 0 0 0.000 0
#> SRR2061414 1 0.000 1.000 1.000 0 0 0 0.000 0
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.
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.
CV:mclust**
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.495 0.859 0.899 0.4721 0.495 0.495
#> 3 3 1.000 0.996 0.992 0.3683 0.859 0.716
#> 4 4 1.000 0.984 0.994 0.1754 0.887 0.680
#> 5 5 1.000 0.994 0.997 0.0397 0.970 0.875
#> 6 6 1.000 0.963 0.985 0.0329 0.973 0.873
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4 5
There is also optional best \(k\) = 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.9209 0.764 0.336 0.664
#> SRR2061467 2 0.9209 0.764 0.336 0.664
#> SRR2061466 2 0.9209 0.764 0.336 0.664
#> SRR2061464 2 0.9209 0.764 0.336 0.664
#> SRR2061465 2 0.9209 0.764 0.336 0.664
#> SRR2061463 2 0.9209 0.764 0.336 0.664
#> SRR2061462 2 0.9209 0.764 0.336 0.664
#> SRR2061460 2 0.9209 0.764 0.336 0.664
#> SRR2061459 2 0.9209 0.764 0.336 0.664
#> SRR2061461 2 0.9209 0.764 0.336 0.664
#> SRR2061458 2 0.9209 0.764 0.336 0.664
#> SRR2061457 2 0.9209 0.764 0.336 0.664
#> SRR2061481 2 0.0000 0.802 0.000 1.000
#> SRR2061488 2 0.0000 0.802 0.000 1.000
#> SRR2061456 2 0.9209 0.764 0.336 0.664
#> SRR2061487 2 0.0000 0.802 0.000 1.000
#> SRR2061485 2 0.0000 0.802 0.000 1.000
#> SRR2061486 2 0.0000 0.802 0.000 1.000
#> SRR2061484 2 0.0000 0.802 0.000 1.000
#> SRR2061482 2 0.0000 0.802 0.000 1.000
#> SRR2061480 2 0.0000 0.802 0.000 1.000
#> SRR2061483 2 0.0000 0.802 0.000 1.000
#> SRR2061478 2 0.0000 0.802 0.000 1.000
#> SRR2061477 2 0.0000 0.802 0.000 1.000
#> SRR2061475 2 0.0000 0.802 0.000 1.000
#> SRR2061474 2 0.0000 0.802 0.000 1.000
#> SRR2061476 2 0.0000 0.802 0.000 1.000
#> SRR2061473 2 0.0000 0.802 0.000 1.000
#> SRR2061472 2 0.0000 0.802 0.000 1.000
#> SRR2061470 2 0.9248 0.759 0.340 0.660
#> SRR2061469 2 0.9248 0.759 0.340 0.660
#> SRR2061455 2 0.9209 0.764 0.336 0.664
#> SRR2061454 2 0.9209 0.764 0.336 0.664
#> SRR2061452 1 0.3274 0.919 0.940 0.060
#> SRR2061453 2 0.9209 0.764 0.336 0.664
#> SRR2061450 1 0.3114 0.921 0.944 0.056
#> SRR2061451 1 0.3584 0.913 0.932 0.068
#> SRR2061448 1 0.0000 0.951 1.000 0.000
#> SRR2061471 2 0.0000 0.802 0.000 1.000
#> SRR2061449 1 0.1414 0.942 0.980 0.020
#> SRR2061447 1 0.0000 0.951 1.000 0.000
#> SRR2061446 1 0.0000 0.951 1.000 0.000
#> SRR2061444 1 0.0000 0.951 1.000 0.000
#> SRR2061443 1 0.0000 0.951 1.000 0.000
#> SRR2061442 1 0.5737 0.861 0.864 0.136
#> SRR2061441 1 0.0000 0.951 1.000 0.000
#> SRR2061445 1 0.0000 0.951 1.000 0.000
#> SRR2061439 1 0.5737 0.861 0.864 0.136
#> SRR2061440 1 0.0000 0.951 1.000 0.000
#> SRR2061437 1 0.0000 0.951 1.000 0.000
#> SRR2061438 1 0.0000 0.951 1.000 0.000
#> SRR2061435 1 0.0000 0.951 1.000 0.000
#> SRR2061436 1 0.5737 0.861 0.864 0.136
#> SRR2061433 1 0.5737 0.861 0.864 0.136
#> SRR2061434 1 0.0000 0.951 1.000 0.000
#> SRR2061432 1 0.0000 0.951 1.000 0.000
#> SRR2061431 1 0.0000 0.951 1.000 0.000
#> SRR2061429 1 0.0000 0.951 1.000 0.000
#> SRR2061430 1 0.0000 0.951 1.000 0.000
#> SRR2061428 1 0.0000 0.951 1.000 0.000
#> SRR2061426 1 0.0000 0.951 1.000 0.000
#> SRR2061427 1 0.5519 0.867 0.872 0.128
#> SRR2061425 1 0.0000 0.951 1.000 0.000
#> SRR2061424 1 0.5737 0.861 0.864 0.136
#> SRR2061423 1 0.0000 0.951 1.000 0.000
#> SRR2061422 1 0.0000 0.951 1.000 0.000
#> SRR2061421 1 0.5737 0.861 0.864 0.136
#> SRR2061420 1 0.0000 0.951 1.000 0.000
#> SRR2061419 1 0.0000 0.951 1.000 0.000
#> SRR2061418 1 0.5737 0.861 0.864 0.136
#> SRR2061417 1 0.0000 0.951 1.000 0.000
#> SRR2061415 1 0.5737 0.861 0.864 0.136
#> SRR2061416 1 0.0672 0.948 0.992 0.008
#> SRR2061414 1 0.0000 0.951 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061467 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061466 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061464 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061465 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061463 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061462 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061460 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061459 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061461 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061458 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061457 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061481 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061488 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061456 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061487 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061485 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061486 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061484 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061482 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061480 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061483 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061478 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061477 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061475 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061474 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061476 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061473 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061472 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061470 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061469 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061455 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061454 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061452 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061453 3 0.0000 0.994 0.000 0.000 1.000
#> SRR2061450 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061451 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061448 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061471 3 0.0747 0.993 0.000 0.016 0.984
#> SRR2061449 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061447 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061446 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061444 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061443 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061442 2 0.0892 0.995 0.020 0.980 0.000
#> SRR2061441 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061445 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061439 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061440 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061437 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061438 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061435 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061436 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061433 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061434 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061432 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061431 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061429 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061430 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061428 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061426 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061427 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061425 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061424 2 0.0892 0.995 0.020 0.980 0.000
#> SRR2061423 2 0.0747 0.998 0.016 0.984 0.000
#> SRR2061422 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061421 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061420 2 0.1411 0.980 0.036 0.964 0.000
#> SRR2061419 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061418 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061417 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061415 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061416 1 0.0000 1.000 1.000 0.000 0.000
#> SRR2061414 1 0.0000 1.000 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061467 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061466 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061464 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061465 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061463 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061462 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061481 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061488 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061487 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061485 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061486 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061484 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061482 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061480 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061483 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061478 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061477 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061475 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061474 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061476 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061473 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061472 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061470 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061469 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061452 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0 1
#> SRR2061450 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061451 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061448 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061471 3 0.0000 1.000 0.000 0.000 1 0
#> SRR2061449 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061447 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061446 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061444 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061443 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061442 2 0.0188 0.972 0.004 0.996 0 0
#> SRR2061441 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061445 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061439 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061440 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061437 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061438 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061435 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061436 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061433 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061434 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061432 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061431 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061429 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061430 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061428 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061426 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061427 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061425 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061424 2 0.0188 0.972 0.004 0.996 0 0
#> SRR2061423 2 0.0000 0.975 0.000 1.000 0 0
#> SRR2061422 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061421 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061420 2 0.4898 0.289 0.416 0.584 0 0
#> SRR2061419 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061418 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061417 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061415 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061416 1 0.0000 1.000 1.000 0.000 0 0
#> SRR2061414 1 0.0000 1.000 1.000 0.000 0 0
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061467 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061466 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061464 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061465 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061463 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061462 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061460 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061459 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061461 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061458 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061457 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061481 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061488 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061456 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061487 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061485 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061486 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061484 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061482 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061480 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061483 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061478 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061477 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061475 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061474 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061476 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061473 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061472 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061470 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061469 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061455 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061454 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061452 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061453 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061450 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061451 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061448 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061471 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061449 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061447 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061446 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061444 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061443 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061442 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061441 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061445 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061439 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061440 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061437 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061438 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061435 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061436 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061433 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061434 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061432 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061431 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061429 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061430 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061428 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061426 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061427 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061425 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061424 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061423 5 0.000 0.987 0.000 0 0 0 1.000
#> SRR2061422 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061421 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061420 5 0.304 0.747 0.192 0 0 0 0.808
#> SRR2061419 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061418 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061417 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061415 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061416 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061414 1 0.000 1.000 1.000 0 0 0 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061467 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061466 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061464 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061465 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061463 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061462 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061460 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061459 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061461 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061458 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061457 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061481 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061488 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061456 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061487 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061485 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061486 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061484 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061482 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061480 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061483 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061478 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061477 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061475 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061474 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061476 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061473 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061472 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061470 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061469 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061455 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061454 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061452 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061453 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061450 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061451 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061448 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061471 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061449 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061447 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061446 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061444 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061443 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061442 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061441 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061445 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061439 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061440 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061437 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061438 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061435 1 0.0146 0.927 0.996 0 0 0 0.004 0
#> SRR2061436 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061433 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061434 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061432 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061431 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061429 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061430 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061428 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061426 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061427 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061425 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061424 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061423 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061422 1 0.3620 0.510 0.648 0 0 0 0.352 0
#> SRR2061421 1 0.3717 0.441 0.616 0 0 0 0.384 0
#> SRR2061420 5 0.0363 0.986 0.012 0 0 0 0.988 0
#> SRR2061419 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061418 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061417 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061415 1 0.3607 0.518 0.652 0 0 0 0.348 0
#> SRR2061416 1 0.0000 0.930 1.000 0 0 0 0.000 0
#> SRR2061414 1 0.0000 0.930 1.000 0 0 0 0.000 0
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.
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.
CV:NMF**
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"]
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 14886 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)

The plots are:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.998 0.3608 0.641 0.641
#> 3 3 0.684 0.816 0.907 0.7415 0.707 0.543
#> 4 4 0.807 0.844 0.875 0.0845 0.887 0.731
#> 5 5 0.781 0.839 0.892 0.0314 0.908 0.759
#> 6 6 0.706 0.621 0.800 0.0812 0.922 0.756
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 1 0.0000 0.998 1.000 0.000
#> SRR2061467 1 0.0000 0.998 1.000 0.000
#> SRR2061466 1 0.0000 0.998 1.000 0.000
#> SRR2061464 1 0.0000 0.998 1.000 0.000
#> SRR2061465 1 0.0000 0.998 1.000 0.000
#> SRR2061463 1 0.0000 0.998 1.000 0.000
#> SRR2061462 1 0.0672 0.992 0.992 0.008
#> SRR2061460 1 0.0376 0.995 0.996 0.004
#> SRR2061459 1 0.0938 0.989 0.988 0.012
#> SRR2061461 1 0.0000 0.998 1.000 0.000
#> SRR2061458 1 0.0000 0.998 1.000 0.000
#> SRR2061457 1 0.0000 0.998 1.000 0.000
#> SRR2061481 2 0.0000 1.000 0.000 1.000
#> SRR2061488 2 0.0000 1.000 0.000 1.000
#> SRR2061456 1 0.0938 0.989 0.988 0.012
#> SRR2061487 2 0.0000 1.000 0.000 1.000
#> SRR2061485 2 0.0000 1.000 0.000 1.000
#> SRR2061486 2 0.0000 1.000 0.000 1.000
#> SRR2061484 2 0.0000 1.000 0.000 1.000
#> SRR2061482 2 0.0000 1.000 0.000 1.000
#> SRR2061480 2 0.0000 1.000 0.000 1.000
#> SRR2061483 2 0.0000 1.000 0.000 1.000
#> SRR2061478 2 0.0000 1.000 0.000 1.000
#> SRR2061477 2 0.0000 1.000 0.000 1.000
#> SRR2061475 2 0.0000 1.000 0.000 1.000
#> SRR2061474 2 0.0000 1.000 0.000 1.000
#> SRR2061476 2 0.0000 1.000 0.000 1.000
#> SRR2061473 2 0.0000 1.000 0.000 1.000
#> SRR2061472 2 0.0000 1.000 0.000 1.000
#> SRR2061470 1 0.0000 0.998 1.000 0.000
#> SRR2061469 1 0.0000 0.998 1.000 0.000
#> SRR2061455 1 0.0000 0.998 1.000 0.000
#> SRR2061454 1 0.0000 0.998 1.000 0.000
#> SRR2061452 1 0.0000 0.998 1.000 0.000
#> SRR2061453 1 0.0672 0.992 0.992 0.008
#> SRR2061450 1 0.0000 0.998 1.000 0.000
#> SRR2061451 1 0.0000 0.998 1.000 0.000
#> SRR2061448 1 0.0000 0.998 1.000 0.000
#> SRR2061471 2 0.0000 1.000 0.000 1.000
#> SRR2061449 1 0.0000 0.998 1.000 0.000
#> SRR2061447 1 0.0000 0.998 1.000 0.000
#> SRR2061446 1 0.0000 0.998 1.000 0.000
#> SRR2061444 1 0.0000 0.998 1.000 0.000
#> SRR2061443 1 0.0000 0.998 1.000 0.000
#> SRR2061442 1 0.0000 0.998 1.000 0.000
#> SRR2061441 1 0.0000 0.998 1.000 0.000
#> SRR2061445 1 0.0000 0.998 1.000 0.000
#> SRR2061439 1 0.0000 0.998 1.000 0.000
#> SRR2061440 1 0.0000 0.998 1.000 0.000
#> SRR2061437 1 0.0000 0.998 1.000 0.000
#> SRR2061438 1 0.0000 0.998 1.000 0.000
#> SRR2061435 1 0.0000 0.998 1.000 0.000
#> SRR2061436 1 0.0672 0.992 0.992 0.008
#> SRR2061433 1 0.1184 0.985 0.984 0.016
#> SRR2061434 1 0.0000 0.998 1.000 0.000
#> SRR2061432 1 0.0000 0.998 1.000 0.000
#> SRR2061431 1 0.0000 0.998 1.000 0.000
#> SRR2061429 1 0.0000 0.998 1.000 0.000
#> SRR2061430 1 0.0000 0.998 1.000 0.000
#> SRR2061428 1 0.0000 0.998 1.000 0.000
#> SRR2061426 1 0.0000 0.998 1.000 0.000
#> SRR2061427 1 0.0000 0.998 1.000 0.000
#> SRR2061425 1 0.0000 0.998 1.000 0.000
#> SRR2061424 1 0.0000 0.998 1.000 0.000
#> SRR2061423 1 0.0000 0.998 1.000 0.000
#> SRR2061422 1 0.0000 0.998 1.000 0.000
#> SRR2061421 1 0.0376 0.995 0.996 0.004
#> SRR2061420 1 0.0000 0.998 1.000 0.000
#> SRR2061419 1 0.0000 0.998 1.000 0.000
#> SRR2061418 1 0.0000 0.998 1.000 0.000
#> SRR2061417 1 0.0000 0.998 1.000 0.000
#> SRR2061415 1 0.2423 0.960 0.960 0.040
#> SRR2061416 1 0.0000 0.998 1.000 0.000
#> SRR2061414 1 0.0000 0.998 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0424 0.707 0.008 0.992 0.000
#> SRR2061467 2 0.0424 0.707 0.008 0.992 0.000
#> SRR2061466 2 0.0424 0.707 0.008 0.992 0.000
#> SRR2061464 2 0.0592 0.709 0.012 0.988 0.000
#> SRR2061465 2 0.0424 0.707 0.008 0.992 0.000
#> SRR2061463 2 0.0592 0.709 0.012 0.988 0.000
#> SRR2061462 2 0.0592 0.709 0.012 0.988 0.000
#> SRR2061460 2 0.4842 0.681 0.224 0.776 0.000
#> SRR2061459 2 0.5588 0.652 0.276 0.720 0.004
#> SRR2061461 2 0.4974 0.681 0.236 0.764 0.000
#> SRR2061458 2 0.6081 0.594 0.344 0.652 0.004
#> SRR2061457 2 0.6057 0.599 0.340 0.656 0.004
#> SRR2061481 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061488 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061456 2 0.5956 0.615 0.324 0.672 0.004
#> SRR2061487 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061485 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061486 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061484 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061482 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061480 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061483 3 0.0237 0.988 0.000 0.004 0.996
#> SRR2061478 3 0.0000 0.987 0.000 0.000 1.000
#> SRR2061477 3 0.0829 0.984 0.012 0.004 0.984
#> SRR2061475 3 0.1170 0.982 0.016 0.008 0.976
#> SRR2061474 3 0.1170 0.982 0.016 0.008 0.976
#> SRR2061476 3 0.1170 0.982 0.016 0.008 0.976
#> SRR2061473 3 0.1170 0.982 0.016 0.008 0.976
#> SRR2061472 3 0.1170 0.982 0.016 0.008 0.976
#> SRR2061470 2 0.0424 0.707 0.008 0.992 0.000
#> SRR2061469 2 0.0424 0.707 0.008 0.992 0.000
#> SRR2061455 2 0.5968 0.570 0.364 0.636 0.000
#> SRR2061454 2 0.5929 0.619 0.320 0.676 0.004
#> SRR2061452 1 0.0424 0.940 0.992 0.008 0.000
#> SRR2061453 2 0.6318 0.576 0.356 0.636 0.008
#> SRR2061450 1 0.0237 0.942 0.996 0.004 0.000
#> SRR2061451 1 0.0424 0.940 0.992 0.008 0.000
#> SRR2061448 1 0.3482 0.816 0.872 0.128 0.000
#> SRR2061471 3 0.1170 0.982 0.016 0.008 0.976
#> SRR2061449 1 0.5431 0.539 0.716 0.284 0.000
#> SRR2061447 1 0.5785 0.427 0.668 0.332 0.000
#> SRR2061446 1 0.3816 0.786 0.852 0.148 0.000
#> SRR2061444 1 0.3412 0.821 0.876 0.124 0.000
#> SRR2061443 1 0.0892 0.938 0.980 0.020 0.000
#> SRR2061442 1 0.0747 0.940 0.984 0.016 0.000
#> SRR2061441 1 0.0892 0.938 0.980 0.020 0.000
#> SRR2061445 1 0.1643 0.916 0.956 0.044 0.000
#> SRR2061439 1 0.0424 0.940 0.992 0.008 0.000
#> SRR2061440 1 0.0237 0.944 0.996 0.004 0.000
#> SRR2061437 1 0.0000 0.944 1.000 0.000 0.000
#> SRR2061438 1 0.0237 0.944 0.996 0.004 0.000
#> SRR2061435 1 0.0237 0.944 0.996 0.004 0.000
#> SRR2061436 1 0.0661 0.937 0.988 0.008 0.004
#> SRR2061433 1 0.0661 0.937 0.988 0.008 0.004
#> SRR2061434 1 0.0237 0.944 0.996 0.004 0.000
#> SRR2061432 1 0.0237 0.942 0.996 0.004 0.000
#> SRR2061431 2 0.6168 0.352 0.412 0.588 0.000
#> SRR2061429 2 0.6168 0.352 0.412 0.588 0.000
#> SRR2061430 2 0.6168 0.352 0.412 0.588 0.000
#> SRR2061428 2 0.6168 0.352 0.412 0.588 0.000
#> SRR2061426 2 0.6168 0.352 0.412 0.588 0.000
#> SRR2061427 2 0.6274 0.231 0.456 0.544 0.000
#> SRR2061425 1 0.0892 0.938 0.980 0.020 0.000
#> SRR2061424 1 0.0892 0.938 0.980 0.020 0.000
#> SRR2061423 1 0.0892 0.938 0.980 0.020 0.000
#> SRR2061422 1 0.0237 0.944 0.996 0.004 0.000
#> SRR2061421 1 0.0424 0.940 0.992 0.008 0.000
#> SRR2061420 1 0.0747 0.940 0.984 0.016 0.000
#> SRR2061419 1 0.0237 0.942 0.996 0.004 0.000
#> SRR2061418 1 0.0424 0.940 0.992 0.008 0.000
#> SRR2061417 1 0.0237 0.944 0.996 0.004 0.000
#> SRR2061415 1 0.0661 0.937 0.988 0.008 0.004
#> SRR2061416 1 0.0237 0.944 0.996 0.004 0.000
#> SRR2061414 1 0.0000 0.944 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 4 0.4981 0.721 0.000 NA 0.000 0.536
#> SRR2061467 4 0.4916 0.743 0.000 NA 0.000 0.576
#> SRR2061466 4 0.4933 0.739 0.000 NA 0.000 0.568
#> SRR2061464 4 0.2216 0.848 0.000 NA 0.000 0.908
#> SRR2061465 4 0.4898 0.746 0.000 NA 0.000 0.584
#> SRR2061463 4 0.2081 0.849 0.000 NA 0.000 0.916
#> SRR2061462 4 0.2081 0.849 0.000 NA 0.000 0.916
#> SRR2061460 4 0.1022 0.851 0.000 NA 0.000 0.968
#> SRR2061459 4 0.0336 0.848 0.000 NA 0.000 0.992
#> SRR2061461 4 0.1389 0.851 0.000 NA 0.000 0.952
#> SRR2061458 4 0.0592 0.847 0.000 NA 0.000 0.984
#> SRR2061457 4 0.0336 0.849 0.000 NA 0.000 0.992
#> SRR2061481 3 0.0000 0.994 0.000 NA 1.000 0.000
#> SRR2061488 3 0.0336 0.993 0.000 NA 0.992 0.000
#> SRR2061456 4 0.1118 0.840 0.000 NA 0.000 0.964
#> SRR2061487 3 0.0336 0.993 0.000 NA 0.992 0.000
#> SRR2061485 3 0.0336 0.993 0.000 NA 0.992 0.000
#> SRR2061486 3 0.0336 0.993 0.000 NA 0.992 0.000
#> SRR2061484 3 0.0336 0.993 0.000 NA 0.992 0.000
#> SRR2061482 3 0.0000 0.994 0.000 NA 1.000 0.000
#> SRR2061480 3 0.0000 0.994 0.000 NA 1.000 0.000
#> SRR2061483 3 0.0336 0.993 0.000 NA 0.992 0.000
#> SRR2061478 3 0.0336 0.994 0.000 NA 0.992 0.000
#> SRR2061477 3 0.0336 0.994 0.000 NA 0.992 0.000
#> SRR2061475 3 0.0336 0.994 0.000 NA 0.992 0.000
#> SRR2061474 3 0.0469 0.993 0.000 NA 0.988 0.000
#> SRR2061476 3 0.0336 0.994 0.000 NA 0.992 0.000
#> SRR2061473 3 0.0336 0.994 0.000 NA 0.992 0.000
#> SRR2061472 3 0.0336 0.994 0.000 NA 0.992 0.000
#> SRR2061470 4 0.4992 0.713 0.000 NA 0.000 0.524
#> SRR2061469 4 0.4994 0.710 0.000 NA 0.000 0.520
#> SRR2061455 4 0.0188 0.849 0.000 NA 0.000 0.996
#> SRR2061454 4 0.0336 0.849 0.000 NA 0.000 0.992
#> SRR2061452 1 0.1151 0.863 0.968 NA 0.000 0.008
#> SRR2061453 4 0.1637 0.830 0.000 NA 0.000 0.940
#> SRR2061450 1 0.0592 0.870 0.984 NA 0.000 0.000
#> SRR2061451 1 0.3279 0.806 0.872 NA 0.000 0.032
#> SRR2061448 1 0.3610 0.795 0.800 NA 0.000 0.000
#> SRR2061471 3 0.0469 0.993 0.000 NA 0.988 0.000
#> SRR2061449 1 0.4543 0.700 0.676 NA 0.000 0.000
#> SRR2061447 1 0.4564 0.696 0.672 NA 0.000 0.000
#> SRR2061446 1 0.3400 0.807 0.820 NA 0.000 0.000
#> SRR2061444 1 0.3266 0.814 0.832 NA 0.000 0.000
#> SRR2061443 1 0.1389 0.865 0.952 NA 0.000 0.000
#> SRR2061442 1 0.0188 0.873 0.996 NA 0.000 0.000
#> SRR2061441 1 0.1389 0.865 0.952 NA 0.000 0.000
#> SRR2061445 1 0.2530 0.842 0.888 NA 0.000 0.000
#> SRR2061439 1 0.0469 0.871 0.988 NA 0.000 0.000
#> SRR2061440 1 0.0000 0.873 1.000 NA 0.000 0.000
#> SRR2061437 1 0.0000 0.873 1.000 NA 0.000 0.000
#> SRR2061438 1 0.0000 0.873 1.000 NA 0.000 0.000
#> SRR2061435 1 0.0000 0.873 1.000 NA 0.000 0.000
#> SRR2061436 1 0.2675 0.821 0.892 NA 0.000 0.008
#> SRR2061433 1 0.4281 0.739 0.792 NA 0.000 0.028
#> SRR2061434 1 0.0000 0.873 1.000 NA 0.000 0.000
#> SRR2061432 1 0.0817 0.867 0.976 NA 0.000 0.000
#> SRR2061431 1 0.4985 0.547 0.532 NA 0.000 0.000
#> SRR2061429 1 0.4981 0.553 0.536 NA 0.000 0.000
#> SRR2061430 1 0.4977 0.558 0.540 NA 0.000 0.000
#> SRR2061428 1 0.4977 0.558 0.540 NA 0.000 0.000
#> SRR2061426 1 0.4985 0.547 0.532 NA 0.000 0.000
#> SRR2061427 1 0.4977 0.558 0.540 NA 0.000 0.000
#> SRR2061425 1 0.1389 0.865 0.952 NA 0.000 0.000
#> SRR2061424 1 0.0188 0.873 0.996 NA 0.000 0.000
#> SRR2061423 1 0.1557 0.863 0.944 NA 0.000 0.000
#> SRR2061422 1 0.0000 0.873 1.000 NA 0.000 0.000
#> SRR2061421 1 0.0524 0.871 0.988 NA 0.000 0.004
#> SRR2061420 1 0.0000 0.873 1.000 NA 0.000 0.000
#> SRR2061419 1 0.0188 0.873 0.996 NA 0.000 0.000
#> SRR2061418 1 0.0188 0.873 0.996 NA 0.000 0.000
#> SRR2061417 1 0.0188 0.873 0.996 NA 0.000 0.000
#> SRR2061415 1 0.5343 0.648 0.708 NA 0.000 0.052
#> SRR2061416 1 0.0000 0.873 1.000 NA 0.000 0.000
#> SRR2061414 1 0.0000 0.873 1.000 NA 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 4 0.4221 0.856 0.000 0.108 0.000 0.780 NA
#> SRR2061467 4 0.3849 0.874 0.000 0.080 0.000 0.808 NA
#> SRR2061466 4 0.3906 0.872 0.000 0.084 0.000 0.804 NA
#> SRR2061464 4 0.1956 0.912 0.000 0.008 0.000 0.916 NA
#> SRR2061465 4 0.3731 0.878 0.000 0.072 0.000 0.816 NA
#> SRR2061463 4 0.1502 0.917 0.000 0.004 0.000 0.940 NA
#> SRR2061462 4 0.1430 0.918 0.000 0.004 0.000 0.944 NA
#> SRR2061460 4 0.0000 0.923 0.000 0.000 0.000 1.000 NA
#> SRR2061459 4 0.0000 0.923 0.000 0.000 0.000 1.000 NA
#> SRR2061461 4 0.0000 0.923 0.000 0.000 0.000 1.000 NA
#> SRR2061458 4 0.0000 0.923 0.000 0.000 0.000 1.000 NA
#> SRR2061457 4 0.0000 0.923 0.000 0.000 0.000 1.000 NA
#> SRR2061481 3 0.0609 0.954 0.000 0.000 0.980 0.000 NA
#> SRR2061488 3 0.2338 0.887 0.000 0.112 0.884 0.000 NA
#> SRR2061456 4 0.0162 0.922 0.000 0.000 0.000 0.996 NA
#> SRR2061487 3 0.2970 0.829 0.000 0.168 0.828 0.000 NA
#> SRR2061485 3 0.0693 0.953 0.000 0.012 0.980 0.000 NA
#> SRR2061486 3 0.1124 0.944 0.000 0.036 0.960 0.000 NA
#> SRR2061484 3 0.0693 0.953 0.000 0.012 0.980 0.000 NA
#> SRR2061482 3 0.0609 0.954 0.000 0.000 0.980 0.000 NA
#> SRR2061480 3 0.0609 0.954 0.000 0.000 0.980 0.000 NA
#> SRR2061483 3 0.0898 0.952 0.000 0.008 0.972 0.000 NA
#> SRR2061478 3 0.1282 0.957 0.000 0.004 0.952 0.000 NA
#> SRR2061477 3 0.1502 0.954 0.000 0.004 0.940 0.000 NA
#> SRR2061475 3 0.1357 0.956 0.000 0.004 0.948 0.000 NA
#> SRR2061474 3 0.1571 0.953 0.000 0.004 0.936 0.000 NA
#> SRR2061476 3 0.1430 0.955 0.000 0.004 0.944 0.000 NA
#> SRR2061473 3 0.1357 0.956 0.000 0.004 0.948 0.000 NA
#> SRR2061472 3 0.1282 0.957 0.000 0.004 0.952 0.000 NA
#> SRR2061470 4 0.5153 0.768 0.000 0.204 0.000 0.684 NA
#> SRR2061469 4 0.5348 0.737 0.000 0.232 0.000 0.656 NA
#> SRR2061455 4 0.0000 0.923 0.000 0.000 0.000 1.000 NA
#> SRR2061454 4 0.0000 0.923 0.000 0.000 0.000 1.000 NA
#> SRR2061452 1 0.2179 0.798 0.896 0.000 0.000 0.004 NA
#> SRR2061453 4 0.0162 0.922 0.000 0.000 0.000 0.996 NA
#> SRR2061450 1 0.0865 0.868 0.972 0.000 0.000 0.004 NA
#> SRR2061451 1 0.3093 0.696 0.824 0.000 0.000 0.008 NA
#> SRR2061448 2 0.4307 0.690 0.496 0.504 0.000 0.000 NA
#> SRR2061471 3 0.1638 0.952 0.000 0.004 0.932 0.000 NA
#> SRR2061449 2 0.4307 0.691 0.496 0.504 0.000 0.000 NA
#> SRR2061447 2 0.4287 0.743 0.460 0.540 0.000 0.000 NA
#> SRR2061446 1 0.2773 0.672 0.836 0.164 0.000 0.000 NA
#> SRR2061444 1 0.2852 0.652 0.828 0.172 0.000 0.000 NA
#> SRR2061443 1 0.2011 0.816 0.908 0.088 0.000 0.000 NA
#> SRR2061442 1 0.1124 0.865 0.960 0.036 0.000 0.000 NA
#> SRR2061441 1 0.2286 0.791 0.888 0.108 0.000 0.000 NA
#> SRR2061445 1 0.2516 0.723 0.860 0.140 0.000 0.000 NA
#> SRR2061439 1 0.0290 0.876 0.992 0.000 0.000 0.000 NA
#> SRR2061440 1 0.0000 0.876 1.000 0.000 0.000 0.000 NA
#> SRR2061437 1 0.0000 0.876 1.000 0.000 0.000 0.000 NA
#> SRR2061438 1 0.0000 0.876 1.000 0.000 0.000 0.000 NA
#> SRR2061435 1 0.0000 0.876 1.000 0.000 0.000 0.000 NA
#> SRR2061436 1 0.0955 0.866 0.968 0.000 0.000 0.004 NA
#> SRR2061433 1 0.2719 0.740 0.852 0.000 0.000 0.004 NA
#> SRR2061434 1 0.0000 0.876 1.000 0.000 0.000 0.000 NA
#> SRR2061432 1 0.0771 0.869 0.976 0.000 0.000 0.004 NA
#> SRR2061431 2 0.3534 0.758 0.256 0.744 0.000 0.000 NA
#> SRR2061429 2 0.3561 0.762 0.260 0.740 0.000 0.000 NA
#> SRR2061430 2 0.3586 0.764 0.264 0.736 0.000 0.000 NA
#> SRR2061428 2 0.4302 0.702 0.480 0.520 0.000 0.000 NA
#> SRR2061426 2 0.4088 0.781 0.368 0.632 0.000 0.000 NA
#> SRR2061427 1 0.4171 -0.316 0.604 0.396 0.000 0.000 NA
#> SRR2061425 1 0.2624 0.781 0.872 0.116 0.000 0.000 NA
#> SRR2061424 1 0.1661 0.855 0.940 0.036 0.000 0.000 NA
#> SRR2061423 1 0.2818 0.758 0.856 0.132 0.000 0.000 NA
#> SRR2061422 1 0.0162 0.876 0.996 0.004 0.000 0.000 NA
#> SRR2061421 1 0.1341 0.836 0.944 0.000 0.000 0.000 NA
#> SRR2061420 1 0.0404 0.872 0.988 0.012 0.000 0.000 NA
#> SRR2061419 1 0.0162 0.876 0.996 0.000 0.000 0.000 NA
#> SRR2061418 1 0.0290 0.875 0.992 0.000 0.000 0.000 NA
#> SRR2061417 1 0.0290 0.875 0.992 0.000 0.000 0.000 NA
#> SRR2061415 1 0.3916 0.513 0.732 0.000 0.000 0.012 NA
#> SRR2061416 1 0.0000 0.876 1.000 0.000 0.000 0.000 NA
#> SRR2061414 1 0.0324 0.875 0.992 0.000 0.000 0.004 NA
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 4 0.3861 0.7352 0.000 0.352 0.000 0.640 0.000 0.008
#> SRR2061467 4 0.3861 0.8085 0.000 0.220 0.000 0.744 0.028 0.008
#> SRR2061466 4 0.3861 0.8085 0.000 0.220 0.000 0.744 0.028 0.008
#> SRR2061464 4 0.3283 0.8305 0.000 0.160 0.000 0.804 0.036 0.000
#> SRR2061465 4 0.3834 0.8101 0.000 0.216 0.000 0.748 0.028 0.008
#> SRR2061463 4 0.2510 0.8454 0.000 0.100 0.000 0.872 0.028 0.000
#> SRR2061462 4 0.2309 0.8476 0.000 0.084 0.000 0.888 0.028 0.000
#> SRR2061460 4 0.0000 0.8533 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061459 4 0.0632 0.8532 0.000 0.000 0.000 0.976 0.024 0.000
#> SRR2061461 4 0.0363 0.8525 0.000 0.000 0.000 0.988 0.012 0.000
#> SRR2061458 4 0.1285 0.8496 0.004 0.000 0.000 0.944 0.052 0.000
#> SRR2061457 4 0.1588 0.8452 0.004 0.000 0.000 0.924 0.072 0.000
#> SRR2061481 3 0.3512 0.8512 0.000 0.000 0.720 0.000 0.008 0.272
#> SRR2061488 3 0.4777 0.8240 0.000 0.024 0.640 0.000 0.036 0.300
#> SRR2061456 4 0.1411 0.8482 0.004 0.000 0.000 0.936 0.060 0.000
#> SRR2061487 3 0.4777 0.8240 0.000 0.024 0.640 0.000 0.036 0.300
#> SRR2061485 3 0.3371 0.8483 0.000 0.000 0.708 0.000 0.000 0.292
#> SRR2061486 3 0.4235 0.8379 0.000 0.008 0.668 0.000 0.024 0.300
#> SRR2061484 3 0.3371 0.8483 0.000 0.000 0.708 0.000 0.000 0.292
#> SRR2061482 3 0.3470 0.8546 0.000 0.000 0.740 0.000 0.012 0.248
#> SRR2061480 3 0.3217 0.8570 0.000 0.000 0.768 0.000 0.008 0.224
#> SRR2061483 3 0.3371 0.8483 0.000 0.000 0.708 0.000 0.000 0.292
#> SRR2061478 3 0.0146 0.8463 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR2061477 3 0.0146 0.8463 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR2061475 3 0.0632 0.8435 0.000 0.000 0.976 0.000 0.000 0.024
#> SRR2061474 3 0.1124 0.8388 0.000 0.008 0.956 0.000 0.000 0.036
#> SRR2061476 3 0.0858 0.8422 0.000 0.004 0.968 0.000 0.000 0.028
#> SRR2061473 3 0.0935 0.8413 0.000 0.004 0.964 0.000 0.000 0.032
#> SRR2061472 3 0.0935 0.8413 0.000 0.004 0.964 0.000 0.000 0.032
#> SRR2061470 4 0.4097 0.5735 0.000 0.488 0.000 0.504 0.000 0.008
#> SRR2061469 4 0.4067 0.6341 0.000 0.444 0.000 0.548 0.000 0.008
#> SRR2061455 4 0.1588 0.8452 0.004 0.000 0.000 0.924 0.072 0.000
#> SRR2061454 4 0.1644 0.8446 0.004 0.000 0.000 0.920 0.076 0.000
#> SRR2061452 1 0.4702 0.4801 0.744 0.008 0.000 0.028 0.096 0.124
#> SRR2061453 4 0.1644 0.8438 0.004 0.000 0.000 0.920 0.076 0.000
#> SRR2061450 1 0.3639 0.5511 0.828 0.008 0.000 0.028 0.092 0.044
#> SRR2061451 1 0.4997 0.4408 0.712 0.008 0.000 0.028 0.096 0.156
#> SRR2061448 1 0.5383 0.1217 0.584 0.184 0.000 0.000 0.232 0.000
#> SRR2061471 3 0.1124 0.8388 0.000 0.008 0.956 0.000 0.000 0.036
#> SRR2061449 1 0.5383 0.1267 0.584 0.184 0.000 0.000 0.232 0.000
#> SRR2061447 1 0.5649 -0.0484 0.536 0.232 0.000 0.000 0.232 0.000
#> SRR2061446 1 0.4871 0.3109 0.660 0.144 0.000 0.000 0.196 0.000
#> SRR2061444 1 0.4904 0.3078 0.656 0.148 0.000 0.000 0.196 0.000
#> SRR2061443 1 0.3857 -0.6651 0.532 0.000 0.000 0.000 0.468 0.000
#> SRR2061442 1 0.3828 -0.6468 0.560 0.000 0.000 0.000 0.440 0.000
#> SRR2061441 1 0.4039 -0.5294 0.568 0.008 0.000 0.000 0.424 0.000
#> SRR2061445 1 0.3896 0.3674 0.748 0.056 0.000 0.000 0.196 0.000
#> SRR2061439 1 0.0713 0.6083 0.972 0.000 0.000 0.000 0.028 0.000
#> SRR2061440 1 0.0713 0.6049 0.972 0.000 0.000 0.000 0.028 0.000
#> SRR2061437 1 0.0405 0.6192 0.988 0.004 0.000 0.000 0.000 0.008
#> SRR2061438 1 0.0632 0.6094 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR2061435 1 0.0777 0.6106 0.972 0.000 0.000 0.000 0.024 0.004
#> SRR2061436 1 0.3183 0.4536 0.788 0.000 0.000 0.004 0.008 0.200
#> SRR2061433 1 0.4612 0.3060 0.668 0.004 0.000 0.020 0.028 0.280
#> SRR2061434 1 0.0767 0.6189 0.976 0.004 0.000 0.008 0.000 0.012
#> SRR2061432 1 0.4291 0.5116 0.776 0.004 0.000 0.028 0.092 0.100
#> SRR2061431 2 0.4614 0.7656 0.096 0.676 0.000 0.000 0.228 0.000
#> SRR2061429 2 0.4796 0.7895 0.116 0.660 0.000 0.000 0.224 0.000
#> SRR2061430 2 0.4918 0.7950 0.124 0.644 0.000 0.000 0.232 0.000
#> SRR2061428 2 0.5807 0.6273 0.308 0.484 0.000 0.000 0.208 0.000
#> SRR2061426 2 0.5231 0.7836 0.168 0.608 0.000 0.000 0.224 0.000
#> SRR2061427 2 0.5890 0.5098 0.368 0.428 0.000 0.000 0.204 0.000
#> SRR2061425 5 0.4045 0.7751 0.428 0.000 0.000 0.000 0.564 0.008
#> SRR2061424 5 0.3982 0.6520 0.460 0.000 0.000 0.000 0.536 0.004
#> SRR2061423 5 0.4242 0.6955 0.448 0.016 0.000 0.000 0.536 0.000
#> SRR2061422 1 0.0790 0.6040 0.968 0.000 0.000 0.000 0.032 0.000
#> SRR2061421 1 0.1082 0.6035 0.956 0.000 0.000 0.000 0.040 0.004
#> SRR2061420 1 0.1267 0.5825 0.940 0.000 0.000 0.000 0.060 0.000
#> SRR2061419 1 0.0000 0.6171 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0260 0.6179 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR2061417 1 0.0976 0.6183 0.968 0.000 0.000 0.008 0.016 0.008
#> SRR2061415 1 0.5834 0.0741 0.516 0.000 0.004 0.028 0.088 0.364
#> SRR2061416 1 0.0405 0.6192 0.988 0.004 0.000 0.000 0.000 0.008
#> SRR2061414 1 0.2671 0.5874 0.888 0.004 0.000 0.028 0.056 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.
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.
MAD:hclust*
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"]
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 14886 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)

The plots are:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.847 0.946 0.976 0.5032 0.494 0.494
#> 3 3 0.839 0.902 0.930 0.1786 0.917 0.833
#> 4 4 0.932 0.944 0.956 0.1031 0.930 0.832
#> 5 5 0.836 0.881 0.925 0.1493 0.914 0.751
#> 6 6 0.932 0.950 0.962 0.0738 0.933 0.743
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 4
There is also optional best \(k\) = 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 0.960 0.000 1.000
#> SRR2061467 2 0.000 0.960 0.000 1.000
#> SRR2061466 2 0.000 0.960 0.000 1.000
#> SRR2061464 2 0.000 0.960 0.000 1.000
#> SRR2061465 2 0.000 0.960 0.000 1.000
#> SRR2061463 2 0.000 0.960 0.000 1.000
#> SRR2061462 2 0.000 0.960 0.000 1.000
#> SRR2061460 1 0.000 0.988 1.000 0.000
#> SRR2061459 1 0.000 0.988 1.000 0.000
#> SRR2061461 1 0.000 0.988 1.000 0.000
#> SRR2061458 1 0.000 0.988 1.000 0.000
#> SRR2061457 1 0.000 0.988 1.000 0.000
#> SRR2061481 2 0.000 0.960 0.000 1.000
#> SRR2061488 2 0.000 0.960 0.000 1.000
#> SRR2061456 1 0.000 0.988 1.000 0.000
#> SRR2061487 2 0.000 0.960 0.000 1.000
#> SRR2061485 2 0.000 0.960 0.000 1.000
#> SRR2061486 2 0.000 0.960 0.000 1.000
#> SRR2061484 2 0.000 0.960 0.000 1.000
#> SRR2061482 2 0.000 0.960 0.000 1.000
#> SRR2061480 2 0.000 0.960 0.000 1.000
#> SRR2061483 2 0.000 0.960 0.000 1.000
#> SRR2061478 1 0.000 0.988 1.000 0.000
#> SRR2061477 1 0.000 0.988 1.000 0.000
#> SRR2061475 1 0.000 0.988 1.000 0.000
#> SRR2061474 1 0.000 0.988 1.000 0.000
#> SRR2061476 1 0.000 0.988 1.000 0.000
#> SRR2061473 1 0.000 0.988 1.000 0.000
#> SRR2061472 1 0.000 0.988 1.000 0.000
#> SRR2061470 2 0.000 0.960 0.000 1.000
#> SRR2061469 2 0.000 0.960 0.000 1.000
#> SRR2061455 1 0.000 0.988 1.000 0.000
#> SRR2061454 1 0.000 0.988 1.000 0.000
#> SRR2061452 1 0.000 0.988 1.000 0.000
#> SRR2061453 1 0.000 0.988 1.000 0.000
#> SRR2061450 1 0.000 0.988 1.000 0.000
#> SRR2061451 1 0.000 0.988 1.000 0.000
#> SRR2061448 2 0.000 0.960 0.000 1.000
#> SRR2061471 1 0.000 0.988 1.000 0.000
#> SRR2061449 2 0.000 0.960 0.000 1.000
#> SRR2061447 2 0.000 0.960 0.000 1.000
#> SRR2061446 2 0.000 0.960 0.000 1.000
#> SRR2061444 2 0.000 0.960 0.000 1.000
#> SRR2061443 2 0.767 0.747 0.224 0.776
#> SRR2061442 2 0.767 0.747 0.224 0.776
#> SRR2061441 2 0.767 0.747 0.224 0.776
#> SRR2061445 2 0.000 0.960 0.000 1.000
#> SRR2061439 1 0.000 0.988 1.000 0.000
#> SRR2061440 1 0.000 0.988 1.000 0.000
#> SRR2061437 1 0.000 0.988 1.000 0.000
#> SRR2061438 1 0.000 0.988 1.000 0.000
#> SRR2061435 1 0.000 0.988 1.000 0.000
#> SRR2061436 1 0.000 0.988 1.000 0.000
#> SRR2061433 1 0.000 0.988 1.000 0.000
#> SRR2061434 1 0.000 0.988 1.000 0.000
#> SRR2061432 1 0.000 0.988 1.000 0.000
#> SRR2061431 2 0.000 0.960 0.000 1.000
#> SRR2061429 2 0.000 0.960 0.000 1.000
#> SRR2061430 2 0.000 0.960 0.000 1.000
#> SRR2061428 2 0.000 0.960 0.000 1.000
#> SRR2061426 2 0.000 0.960 0.000 1.000
#> SRR2061427 2 0.000 0.960 0.000 1.000
#> SRR2061425 2 0.767 0.747 0.224 0.776
#> SRR2061424 2 0.767 0.747 0.224 0.776
#> SRR2061423 2 0.767 0.747 0.224 0.776
#> SRR2061422 1 0.000 0.988 1.000 0.000
#> SRR2061421 1 0.000 0.988 1.000 0.000
#> SRR2061420 1 0.985 0.170 0.572 0.428
#> SRR2061419 1 0.000 0.988 1.000 0.000
#> SRR2061418 1 0.000 0.988 1.000 0.000
#> SRR2061417 1 0.000 0.988 1.000 0.000
#> SRR2061415 1 0.000 0.988 1.000 0.000
#> SRR2061416 1 0.000 0.988 1.000 0.000
#> SRR2061414 1 0.000 0.988 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061464 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061465 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061463 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061462 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061460 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061459 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061461 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061458 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061457 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061481 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061488 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061456 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061487 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061485 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061486 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061484 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061482 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061480 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061483 2 0.5926 0.758 0.000 0.644 0.356
#> SRR2061478 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061477 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061475 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061474 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061476 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061473 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061472 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061470 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.773 0.000 1.000 0.000
#> SRR2061455 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061454 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061452 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061453 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061450 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061448 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061471 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061449 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061447 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061446 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061444 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061443 3 0.0000 0.908 0.000 0.000 1.000
#> SRR2061442 3 0.0000 0.908 0.000 0.000 1.000
#> SRR2061441 3 0.0000 0.908 0.000 0.000 1.000
#> SRR2061445 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061439 1 0.0424 0.993 0.992 0.000 0.008
#> SRR2061440 1 0.0424 0.993 0.992 0.000 0.008
#> SRR2061437 1 0.0424 0.993 0.992 0.000 0.008
#> SRR2061438 1 0.0424 0.993 0.992 0.000 0.008
#> SRR2061435 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061431 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061429 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061430 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061428 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061426 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061427 2 0.4555 0.848 0.000 0.800 0.200
#> SRR2061425 3 0.0000 0.908 0.000 0.000 1.000
#> SRR2061424 3 0.0000 0.908 0.000 0.000 1.000
#> SRR2061423 3 0.0000 0.908 0.000 0.000 1.000
#> SRR2061422 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061420 3 0.5882 0.463 0.348 0.000 0.652
#> SRR2061419 1 0.0424 0.993 0.992 0.000 0.008
#> SRR2061418 1 0.0424 0.993 0.992 0.000 0.008
#> SRR2061417 1 0.0424 0.993 0.992 0.000 0.008
#> SRR2061415 1 0.0000 0.998 1.000 0.000 0.000
#> SRR2061416 1 0.0424 0.993 0.992 0.000 0.008
#> SRR2061414 1 0.0424 0.993 0.992 0.000 0.008
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061467 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061466 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061464 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061465 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061463 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061462 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061460 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061459 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061461 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061458 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061457 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061481 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061488 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061456 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061487 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061485 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061486 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061484 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061482 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061480 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061483 3 0.0592 1.000 0.000 0.0 0.984 0.016
#> SRR2061478 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061477 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061475 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061474 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061476 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061473 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061472 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061470 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061469 2 0.0000 0.858 0.000 1.0 0.000 0.000
#> SRR2061455 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061454 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061452 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061453 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061450 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061451 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061448 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061471 1 0.0592 0.990 0.984 0.0 0.016 0.000
#> SRR2061449 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061447 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061446 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061444 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061443 4 0.0000 0.902 0.000 0.0 0.000 1.000
#> SRR2061442 4 0.0000 0.902 0.000 0.0 0.000 1.000
#> SRR2061441 4 0.0000 0.902 0.000 0.0 0.000 1.000
#> SRR2061445 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061439 1 0.0336 0.988 0.992 0.0 0.000 0.008
#> SRR2061440 1 0.0336 0.988 0.992 0.0 0.000 0.008
#> SRR2061437 1 0.0336 0.988 0.992 0.0 0.000 0.008
#> SRR2061438 1 0.0336 0.988 0.992 0.0 0.000 0.008
#> SRR2061435 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061436 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061433 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061434 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061432 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061431 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061429 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061430 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061428 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061426 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061427 2 0.3610 0.887 0.000 0.8 0.000 0.200
#> SRR2061425 4 0.0000 0.902 0.000 0.0 0.000 1.000
#> SRR2061424 4 0.0000 0.902 0.000 0.0 0.000 1.000
#> SRR2061423 4 0.0000 0.902 0.000 0.0 0.000 1.000
#> SRR2061422 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061421 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061420 4 0.4661 0.441 0.348 0.0 0.000 0.652
#> SRR2061419 1 0.0336 0.988 0.992 0.0 0.000 0.008
#> SRR2061418 1 0.0336 0.988 0.992 0.0 0.000 0.008
#> SRR2061417 1 0.0336 0.988 0.992 0.0 0.000 0.008
#> SRR2061415 1 0.0000 0.990 1.000 0.0 0.000 0.000
#> SRR2061416 1 0.0336 0.988 0.992 0.0 0.000 0.008
#> SRR2061414 1 0.0336 0.988 0.992 0.0 0.000 0.008
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061467 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061466 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061464 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061465 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061463 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061462 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061460 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061459 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061461 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061458 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061457 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061481 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061488 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061456 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061487 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061485 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061486 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061484 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061482 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061480 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061483 3 0.000 1.000 0.000 0.0 1 0.0 0.000
#> SRR2061478 4 0.000 1.000 0.000 0.0 0 1.0 0.000
#> SRR2061477 4 0.000 1.000 0.000 0.0 0 1.0 0.000
#> SRR2061475 4 0.000 1.000 0.000 0.0 0 1.0 0.000
#> SRR2061474 4 0.000 1.000 0.000 0.0 0 1.0 0.000
#> SRR2061476 4 0.000 1.000 0.000 0.0 0 1.0 0.000
#> SRR2061473 4 0.000 1.000 0.000 0.0 0 1.0 0.000
#> SRR2061472 4 0.000 1.000 0.000 0.0 0 1.0 0.000
#> SRR2061470 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061469 2 0.000 0.858 0.000 1.0 0 0.0 0.000
#> SRR2061455 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061454 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061452 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061453 1 0.380 0.693 0.700 0.0 0 0.3 0.000
#> SRR2061450 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061451 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061448 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061471 4 0.000 1.000 0.000 0.0 0 1.0 0.000
#> SRR2061449 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061447 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061446 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061444 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061443 5 0.000 0.912 0.000 0.0 0 0.0 1.000
#> SRR2061442 5 0.000 0.912 0.000 0.0 0 0.0 1.000
#> SRR2061441 5 0.000 0.912 0.000 0.0 0 0.0 1.000
#> SRR2061445 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061439 1 0.029 0.884 0.992 0.0 0 0.0 0.008
#> SRR2061440 1 0.029 0.884 0.992 0.0 0 0.0 0.008
#> SRR2061437 1 0.029 0.884 0.992 0.0 0 0.0 0.008
#> SRR2061438 1 0.029 0.884 0.992 0.0 0 0.0 0.008
#> SRR2061435 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061436 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061433 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061434 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061432 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061431 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061429 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061430 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061428 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061426 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061427 2 0.311 0.887 0.000 0.8 0 0.0 0.200
#> SRR2061425 5 0.000 0.912 0.000 0.0 0 0.0 1.000
#> SRR2061424 5 0.000 0.912 0.000 0.0 0 0.0 1.000
#> SRR2061423 5 0.000 0.912 0.000 0.0 0 0.0 1.000
#> SRR2061422 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061421 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061420 5 0.402 0.400 0.348 0.0 0 0.0 0.652
#> SRR2061419 1 0.029 0.884 0.992 0.0 0 0.0 0.008
#> SRR2061418 1 0.029 0.884 0.992 0.0 0 0.0 0.008
#> SRR2061417 1 0.029 0.884 0.992 0.0 0 0.0 0.008
#> SRR2061415 1 0.000 0.886 1.000 0.0 0 0.0 0.000
#> SRR2061416 1 0.029 0.884 0.992 0.0 0 0.0 0.008
#> SRR2061414 1 0.029 0.884 0.992 0.0 0 0.0 0.008
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061467 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061466 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061464 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061465 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061463 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061462 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061460 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061459 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061461 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061458 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061457 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061481 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061488 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061456 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061487 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061485 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061486 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061484 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061482 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061480 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061483 3 0.000 1.000 0.000 0.0 1 0 0.000 0
#> SRR2061478 6 0.000 1.000 0.000 0.0 0 0 0.000 1
#> SRR2061477 6 0.000 1.000 0.000 0.0 0 0 0.000 1
#> SRR2061475 6 0.000 1.000 0.000 0.0 0 0 0.000 1
#> SRR2061474 6 0.000 1.000 0.000 0.0 0 0 0.000 1
#> SRR2061476 6 0.000 1.000 0.000 0.0 0 0 0.000 1
#> SRR2061473 6 0.000 1.000 0.000 0.0 0 0 0.000 1
#> SRR2061472 6 0.000 1.000 0.000 0.0 0 0 0.000 1
#> SRR2061470 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061469 2 0.000 0.857 0.000 1.0 0 0 0.000 0
#> SRR2061455 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061454 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061452 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061453 4 0.000 1.000 0.000 0.0 0 1 0.000 0
#> SRR2061450 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061451 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061448 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061471 6 0.000 1.000 0.000 0.0 0 0 0.000 1
#> SRR2061449 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061447 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061446 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061444 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061443 5 0.000 0.922 0.000 0.0 0 0 1.000 0
#> SRR2061442 5 0.000 0.922 0.000 0.0 0 0 1.000 0
#> SRR2061441 5 0.000 0.922 0.000 0.0 0 0 1.000 0
#> SRR2061445 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061439 1 0.026 0.995 0.992 0.0 0 0 0.008 0
#> SRR2061440 1 0.026 0.995 0.992 0.0 0 0 0.008 0
#> SRR2061437 1 0.026 0.995 0.992 0.0 0 0 0.008 0
#> SRR2061438 1 0.026 0.995 0.992 0.0 0 0 0.008 0
#> SRR2061435 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061436 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061433 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061434 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061432 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061431 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061429 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061430 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061428 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061426 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061427 2 0.279 0.886 0.000 0.8 0 0 0.200 0
#> SRR2061425 5 0.000 0.922 0.000 0.0 0 0 1.000 0
#> SRR2061424 5 0.000 0.922 0.000 0.0 0 0 1.000 0
#> SRR2061423 5 0.000 0.922 0.000 0.0 0 0 1.000 0
#> SRR2061422 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061421 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061420 5 0.361 0.472 0.348 0.0 0 0 0.652 0
#> SRR2061419 1 0.026 0.995 0.992 0.0 0 0 0.008 0
#> SRR2061418 1 0.026 0.995 0.992 0.0 0 0 0.008 0
#> SRR2061417 1 0.026 0.995 0.992 0.0 0 0 0.008 0
#> SRR2061415 1 0.000 0.996 1.000 0.0 0 0 0.000 0
#> SRR2061416 1 0.026 0.995 0.992 0.0 0 0 0.008 0
#> SRR2061414 1 0.026 0.995 0.992 0.0 0 0 0.008 0
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.
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.
MAD:kmeans
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"]
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 14886 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)

The plots are:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.684 0.946 0.947 0.4921 0.495 0.495
#> 3 3 0.604 0.650 0.795 0.2852 0.964 0.928
#> 4 4 0.648 0.666 0.747 0.1266 0.784 0.548
#> 5 5 0.671 0.690 0.752 0.0777 0.921 0.730
#> 6 6 0.848 0.785 0.810 0.0507 0.946 0.766
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.0000 0.964 0.000 1.000
#> SRR2061467 2 0.0000 0.964 0.000 1.000
#> SRR2061466 2 0.0000 0.964 0.000 1.000
#> SRR2061464 2 0.0000 0.964 0.000 1.000
#> SRR2061465 2 0.0000 0.964 0.000 1.000
#> SRR2061463 2 0.0000 0.964 0.000 1.000
#> SRR2061462 2 0.0000 0.964 0.000 1.000
#> SRR2061460 1 0.4939 0.962 0.892 0.108
#> SRR2061459 1 0.4939 0.962 0.892 0.108
#> SRR2061461 1 0.4939 0.962 0.892 0.108
#> SRR2061458 1 0.4939 0.962 0.892 0.108
#> SRR2061457 1 0.4939 0.962 0.892 0.108
#> SRR2061481 2 0.4562 0.914 0.096 0.904
#> SRR2061488 2 0.4562 0.914 0.096 0.904
#> SRR2061456 1 0.4939 0.962 0.892 0.108
#> SRR2061487 2 0.4562 0.914 0.096 0.904
#> SRR2061485 2 0.4562 0.914 0.096 0.904
#> SRR2061486 2 0.4562 0.914 0.096 0.904
#> SRR2061484 2 0.4562 0.914 0.096 0.904
#> SRR2061482 2 0.4562 0.914 0.096 0.904
#> SRR2061480 2 0.4562 0.914 0.096 0.904
#> SRR2061483 2 0.4562 0.914 0.096 0.904
#> SRR2061478 1 0.0938 0.902 0.988 0.012
#> SRR2061477 1 0.0938 0.902 0.988 0.012
#> SRR2061475 1 0.0938 0.902 0.988 0.012
#> SRR2061474 1 0.0938 0.902 0.988 0.012
#> SRR2061476 1 0.0938 0.902 0.988 0.012
#> SRR2061473 1 0.0938 0.902 0.988 0.012
#> SRR2061472 1 0.0938 0.902 0.988 0.012
#> SRR2061470 2 0.0000 0.964 0.000 1.000
#> SRR2061469 2 0.0000 0.964 0.000 1.000
#> SRR2061455 1 0.4939 0.962 0.892 0.108
#> SRR2061454 1 0.4939 0.962 0.892 0.108
#> SRR2061452 1 0.4562 0.965 0.904 0.096
#> SRR2061453 1 0.4939 0.962 0.892 0.108
#> SRR2061450 1 0.4562 0.965 0.904 0.096
#> SRR2061451 1 0.4562 0.965 0.904 0.096
#> SRR2061448 2 0.0938 0.965 0.012 0.988
#> SRR2061471 1 0.0938 0.902 0.988 0.012
#> SRR2061449 2 0.0938 0.965 0.012 0.988
#> SRR2061447 2 0.0938 0.965 0.012 0.988
#> SRR2061446 2 0.0938 0.965 0.012 0.988
#> SRR2061444 2 0.0938 0.965 0.012 0.988
#> SRR2061443 2 0.0938 0.965 0.012 0.988
#> SRR2061442 1 0.9491 0.560 0.632 0.368
#> SRR2061441 2 0.0938 0.965 0.012 0.988
#> SRR2061445 2 0.0938 0.965 0.012 0.988
#> SRR2061439 1 0.4562 0.965 0.904 0.096
#> SRR2061440 1 0.4562 0.965 0.904 0.096
#> SRR2061437 1 0.4562 0.965 0.904 0.096
#> SRR2061438 1 0.4562 0.965 0.904 0.096
#> SRR2061435 1 0.4562 0.965 0.904 0.096
#> SRR2061436 1 0.4562 0.965 0.904 0.096
#> SRR2061433 1 0.4562 0.965 0.904 0.096
#> SRR2061434 1 0.4562 0.965 0.904 0.096
#> SRR2061432 1 0.4562 0.965 0.904 0.096
#> SRR2061431 2 0.0938 0.965 0.012 0.988
#> SRR2061429 2 0.0938 0.965 0.012 0.988
#> SRR2061430 2 0.0938 0.965 0.012 0.988
#> SRR2061428 2 0.0938 0.965 0.012 0.988
#> SRR2061426 2 0.0938 0.965 0.012 0.988
#> SRR2061427 2 0.0938 0.965 0.012 0.988
#> SRR2061425 2 0.0938 0.965 0.012 0.988
#> SRR2061424 2 0.0938 0.965 0.012 0.988
#> SRR2061423 2 0.0938 0.965 0.012 0.988
#> SRR2061422 1 0.4562 0.965 0.904 0.096
#> SRR2061421 1 0.4562 0.965 0.904 0.096
#> SRR2061420 1 0.4562 0.965 0.904 0.096
#> SRR2061419 1 0.4562 0.965 0.904 0.096
#> SRR2061418 1 0.4562 0.965 0.904 0.096
#> SRR2061417 1 0.4562 0.965 0.904 0.096
#> SRR2061415 1 0.4562 0.965 0.904 0.096
#> SRR2061416 1 0.4562 0.965 0.904 0.096
#> SRR2061414 1 0.4562 0.965 0.904 0.096
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.3116 0.7053 0.000 0.892 0.108
#> SRR2061467 2 0.3116 0.7053 0.000 0.892 0.108
#> SRR2061466 2 0.3116 0.7053 0.000 0.892 0.108
#> SRR2061464 2 0.5882 0.4095 0.000 0.652 0.348
#> SRR2061465 2 0.3116 0.7053 0.000 0.892 0.108
#> SRR2061463 2 0.5882 0.4095 0.000 0.652 0.348
#> SRR2061462 2 0.5882 0.4095 0.000 0.652 0.348
#> SRR2061460 1 0.6600 0.6483 0.604 0.012 0.384
#> SRR2061459 1 0.6600 0.6483 0.604 0.012 0.384
#> SRR2061461 1 0.6600 0.6483 0.604 0.012 0.384
#> SRR2061458 1 0.6548 0.6522 0.616 0.012 0.372
#> SRR2061457 1 0.6548 0.6522 0.616 0.012 0.372
#> SRR2061481 3 0.5859 1.0000 0.000 0.344 0.656
#> SRR2061488 2 0.5327 0.3528 0.000 0.728 0.272
#> SRR2061456 1 0.6548 0.6522 0.616 0.012 0.372
#> SRR2061487 2 0.5327 0.3528 0.000 0.728 0.272
#> SRR2061485 2 0.5397 0.3400 0.000 0.720 0.280
#> SRR2061486 2 0.5327 0.3528 0.000 0.728 0.272
#> SRR2061484 2 0.5397 0.3400 0.000 0.720 0.280
#> SRR2061482 3 0.5859 1.0000 0.000 0.344 0.656
#> SRR2061480 3 0.5859 1.0000 0.000 0.344 0.656
#> SRR2061483 2 0.5397 0.3400 0.000 0.720 0.280
#> SRR2061478 1 0.6302 0.5214 0.520 0.000 0.480
#> SRR2061477 1 0.6302 0.5214 0.520 0.000 0.480
#> SRR2061475 1 0.6291 0.5278 0.532 0.000 0.468
#> SRR2061474 1 0.6291 0.5278 0.532 0.000 0.468
#> SRR2061476 1 0.6291 0.5278 0.532 0.000 0.468
#> SRR2061473 1 0.6291 0.5278 0.532 0.000 0.468
#> SRR2061472 1 0.6291 0.5278 0.532 0.000 0.468
#> SRR2061470 2 0.3116 0.7053 0.000 0.892 0.108
#> SRR2061469 2 0.3116 0.7053 0.000 0.892 0.108
#> SRR2061455 1 0.6548 0.6522 0.616 0.012 0.372
#> SRR2061454 1 0.6548 0.6522 0.616 0.012 0.372
#> SRR2061452 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061453 1 0.6548 0.6522 0.616 0.012 0.372
#> SRR2061450 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061448 2 0.0424 0.7411 0.000 0.992 0.008
#> SRR2061471 1 0.6291 0.5278 0.532 0.000 0.468
#> SRR2061449 2 0.0424 0.7411 0.000 0.992 0.008
#> SRR2061447 2 0.0424 0.7411 0.000 0.992 0.008
#> SRR2061446 2 0.0424 0.7411 0.000 0.992 0.008
#> SRR2061444 2 0.0424 0.7411 0.000 0.992 0.008
#> SRR2061443 2 0.4842 0.5048 0.000 0.776 0.224
#> SRR2061442 1 0.9087 0.1538 0.552 0.224 0.224
#> SRR2061441 2 0.4796 0.5110 0.000 0.780 0.220
#> SRR2061445 2 0.0424 0.7411 0.000 0.992 0.008
#> SRR2061439 1 0.1031 0.7811 0.976 0.000 0.024
#> SRR2061440 1 0.1031 0.7811 0.976 0.000 0.024
#> SRR2061437 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061438 1 0.1031 0.7811 0.976 0.000 0.024
#> SRR2061435 1 0.1031 0.7811 0.976 0.000 0.024
#> SRR2061436 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061431 2 0.0000 0.7418 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.7418 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.7418 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.7418 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.7418 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.7418 0.000 1.000 0.000
#> SRR2061425 2 0.4796 0.5110 0.000 0.780 0.220
#> SRR2061424 2 0.8911 0.0116 0.204 0.572 0.224
#> SRR2061423 2 0.4555 0.5386 0.000 0.800 0.200
#> SRR2061422 1 0.1031 0.7811 0.976 0.000 0.024
#> SRR2061421 1 0.1031 0.7811 0.976 0.000 0.024
#> SRR2061420 1 0.4702 0.6175 0.788 0.000 0.212
#> SRR2061419 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061418 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061417 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061415 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061416 1 0.0000 0.7881 1.000 0.000 0.000
#> SRR2061414 1 0.0000 0.7881 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.6204 0.6565 0.000 0.672 0.168 0.160
#> SRR2061467 2 0.6204 0.6565 0.000 0.672 0.168 0.160
#> SRR2061466 2 0.6204 0.6565 0.000 0.672 0.168 0.160
#> SRR2061464 4 0.7728 -0.2370 0.000 0.308 0.252 0.440
#> SRR2061465 2 0.6204 0.6565 0.000 0.672 0.168 0.160
#> SRR2061463 4 0.7728 -0.2370 0.000 0.308 0.252 0.440
#> SRR2061462 4 0.7728 -0.2370 0.000 0.308 0.252 0.440
#> SRR2061460 4 0.4643 0.6211 0.344 0.000 0.000 0.656
#> SRR2061459 4 0.4643 0.6211 0.344 0.000 0.000 0.656
#> SRR2061461 4 0.4643 0.6211 0.344 0.000 0.000 0.656
#> SRR2061458 4 0.4746 0.6292 0.368 0.000 0.000 0.632
#> SRR2061457 4 0.4746 0.6292 0.368 0.000 0.000 0.632
#> SRR2061481 3 0.2773 0.3251 0.000 0.072 0.900 0.028
#> SRR2061488 2 0.5906 0.5334 0.000 0.528 0.436 0.036
#> SRR2061456 4 0.4746 0.6292 0.368 0.000 0.000 0.632
#> SRR2061487 2 0.5906 0.5334 0.000 0.528 0.436 0.036
#> SRR2061485 2 0.5928 0.5232 0.000 0.508 0.456 0.036
#> SRR2061486 2 0.5906 0.5334 0.000 0.528 0.436 0.036
#> SRR2061484 2 0.5928 0.5232 0.000 0.508 0.456 0.036
#> SRR2061482 3 0.2773 0.3251 0.000 0.072 0.900 0.028
#> SRR2061480 3 0.2773 0.3251 0.000 0.072 0.900 0.028
#> SRR2061483 2 0.5928 0.5232 0.000 0.508 0.456 0.036
#> SRR2061478 3 0.7862 0.6955 0.296 0.000 0.396 0.308
#> SRR2061477 3 0.7862 0.6955 0.296 0.000 0.396 0.308
#> SRR2061475 3 0.7884 0.7015 0.312 0.000 0.384 0.304
#> SRR2061474 3 0.7884 0.7015 0.312 0.000 0.384 0.304
#> SRR2061476 3 0.7884 0.7015 0.312 0.000 0.384 0.304
#> SRR2061473 3 0.7884 0.7015 0.312 0.000 0.384 0.304
#> SRR2061472 3 0.7884 0.7015 0.312 0.000 0.384 0.304
#> SRR2061470 2 0.6204 0.6565 0.000 0.672 0.168 0.160
#> SRR2061469 2 0.6204 0.6565 0.000 0.672 0.168 0.160
#> SRR2061455 4 0.4746 0.6292 0.368 0.000 0.000 0.632
#> SRR2061454 4 0.4746 0.6292 0.368 0.000 0.000 0.632
#> SRR2061452 1 0.0469 0.9264 0.988 0.000 0.012 0.000
#> SRR2061453 4 0.4746 0.6292 0.368 0.000 0.000 0.632
#> SRR2061450 1 0.0469 0.9264 0.988 0.000 0.012 0.000
#> SRR2061451 1 0.0469 0.9264 0.988 0.000 0.012 0.000
#> SRR2061448 2 0.0336 0.7477 0.000 0.992 0.000 0.008
#> SRR2061471 3 0.7884 0.7015 0.312 0.000 0.384 0.304
#> SRR2061449 2 0.0336 0.7477 0.000 0.992 0.000 0.008
#> SRR2061447 2 0.0336 0.7477 0.000 0.992 0.000 0.008
#> SRR2061446 2 0.0895 0.7424 0.000 0.976 0.004 0.020
#> SRR2061444 2 0.0895 0.7424 0.000 0.976 0.004 0.020
#> SRR2061443 2 0.6888 0.5499 0.020 0.644 0.200 0.136
#> SRR2061442 1 0.9268 0.0994 0.444 0.224 0.200 0.132
#> SRR2061441 2 0.6784 0.5544 0.016 0.648 0.200 0.136
#> SRR2061445 2 0.0895 0.7424 0.000 0.976 0.004 0.020
#> SRR2061439 1 0.1004 0.9211 0.972 0.000 0.004 0.024
#> SRR2061440 1 0.1004 0.9211 0.972 0.000 0.004 0.024
#> SRR2061437 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.1004 0.9211 0.972 0.000 0.004 0.024
#> SRR2061435 1 0.1004 0.9211 0.972 0.000 0.004 0.024
#> SRR2061436 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.0657 0.7490 0.000 0.984 0.012 0.004
#> SRR2061429 2 0.0657 0.7490 0.000 0.984 0.012 0.004
#> SRR2061430 2 0.0657 0.7490 0.000 0.984 0.012 0.004
#> SRR2061428 2 0.0336 0.7493 0.000 0.992 0.008 0.000
#> SRR2061426 2 0.0336 0.7493 0.000 0.992 0.008 0.000
#> SRR2061427 2 0.0336 0.7493 0.000 0.992 0.008 0.000
#> SRR2061425 2 0.6240 0.5706 0.000 0.664 0.200 0.136
#> SRR2061424 2 0.9557 0.1450 0.284 0.372 0.204 0.140
#> SRR2061423 2 0.6098 0.5793 0.000 0.676 0.200 0.124
#> SRR2061422 1 0.1004 0.9211 0.972 0.000 0.004 0.024
#> SRR2061421 1 0.1004 0.9211 0.972 0.000 0.004 0.024
#> SRR2061420 1 0.5201 0.6333 0.772 0.008 0.092 0.128
#> SRR2061419 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0188 0.9310 0.996 0.000 0.000 0.004
#> SRR2061415 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.9321 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.9321 1.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.6217 0.3947 0.000 0.556 0.140 0.296 0.008
#> SRR2061467 2 0.6182 0.3966 0.000 0.560 0.136 0.296 0.008
#> SRR2061466 2 0.6182 0.3966 0.000 0.560 0.136 0.296 0.008
#> SRR2061464 4 0.4019 0.0972 0.000 0.152 0.052 0.792 0.004
#> SRR2061465 2 0.6182 0.3966 0.000 0.560 0.136 0.296 0.008
#> SRR2061463 4 0.4019 0.0972 0.000 0.152 0.052 0.792 0.004
#> SRR2061462 4 0.4019 0.0972 0.000 0.152 0.052 0.792 0.004
#> SRR2061460 4 0.8213 0.6727 0.176 0.000 0.200 0.412 0.212
#> SRR2061459 4 0.8213 0.6727 0.176 0.000 0.200 0.412 0.212
#> SRR2061461 4 0.8213 0.6727 0.176 0.000 0.200 0.412 0.212
#> SRR2061458 4 0.8252 0.6752 0.184 0.000 0.196 0.404 0.216
#> SRR2061457 4 0.8252 0.6752 0.184 0.000 0.196 0.404 0.216
#> SRR2061481 3 0.6738 0.3910 0.000 0.028 0.476 0.128 0.368
#> SRR2061488 3 0.5710 0.7261 0.000 0.340 0.576 0.008 0.076
#> SRR2061456 4 0.8252 0.6752 0.184 0.000 0.196 0.404 0.216
#> SRR2061487 3 0.5710 0.7261 0.000 0.340 0.576 0.008 0.076
#> SRR2061485 3 0.5554 0.7330 0.000 0.328 0.592 0.004 0.076
#> SRR2061486 3 0.5710 0.7261 0.000 0.340 0.576 0.008 0.076
#> SRR2061484 3 0.5554 0.7330 0.000 0.328 0.592 0.004 0.076
#> SRR2061482 3 0.6738 0.3910 0.000 0.028 0.476 0.128 0.368
#> SRR2061480 3 0.6738 0.3910 0.000 0.028 0.476 0.128 0.368
#> SRR2061483 3 0.5554 0.7330 0.000 0.328 0.592 0.004 0.076
#> SRR2061478 5 0.3067 0.9881 0.140 0.000 0.004 0.012 0.844
#> SRR2061477 5 0.3067 0.9881 0.140 0.000 0.004 0.012 0.844
#> SRR2061475 5 0.2516 0.9960 0.140 0.000 0.000 0.000 0.860
#> SRR2061474 5 0.2516 0.9960 0.140 0.000 0.000 0.000 0.860
#> SRR2061476 5 0.2516 0.9960 0.140 0.000 0.000 0.000 0.860
#> SRR2061473 5 0.2516 0.9960 0.140 0.000 0.000 0.000 0.860
#> SRR2061472 5 0.2516 0.9960 0.140 0.000 0.000 0.000 0.860
#> SRR2061470 2 0.6217 0.3947 0.000 0.556 0.140 0.296 0.008
#> SRR2061469 2 0.6217 0.3947 0.000 0.556 0.140 0.296 0.008
#> SRR2061455 4 0.8252 0.6752 0.184 0.000 0.196 0.404 0.216
#> SRR2061454 4 0.8252 0.6752 0.184 0.000 0.196 0.404 0.216
#> SRR2061452 1 0.1872 0.9198 0.928 0.000 0.052 0.000 0.020
#> SRR2061453 4 0.8252 0.6752 0.184 0.000 0.196 0.404 0.216
#> SRR2061450 1 0.1872 0.9198 0.928 0.000 0.052 0.000 0.020
#> SRR2061451 1 0.1872 0.9198 0.928 0.000 0.052 0.000 0.020
#> SRR2061448 2 0.0324 0.6610 0.000 0.992 0.004 0.004 0.000
#> SRR2061471 5 0.2516 0.9960 0.140 0.000 0.000 0.000 0.860
#> SRR2061449 2 0.0324 0.6610 0.000 0.992 0.004 0.004 0.000
#> SRR2061447 2 0.0324 0.6610 0.000 0.992 0.004 0.004 0.000
#> SRR2061446 2 0.1117 0.6538 0.000 0.964 0.016 0.020 0.000
#> SRR2061444 2 0.1117 0.6538 0.000 0.964 0.016 0.020 0.000
#> SRR2061443 2 0.7343 0.3471 0.012 0.492 0.156 0.300 0.040
#> SRR2061442 4 0.9147 -0.1555 0.240 0.272 0.152 0.296 0.040
#> SRR2061441 2 0.7136 0.3545 0.004 0.500 0.156 0.300 0.040
#> SRR2061445 2 0.1216 0.6520 0.000 0.960 0.020 0.020 0.000
#> SRR2061439 1 0.1299 0.9487 0.960 0.000 0.008 0.020 0.012
#> SRR2061440 1 0.1059 0.9490 0.968 0.000 0.008 0.020 0.004
#> SRR2061437 1 0.0000 0.9560 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.1059 0.9490 0.968 0.000 0.008 0.020 0.004
#> SRR2061435 1 0.0960 0.9500 0.972 0.000 0.008 0.016 0.004
#> SRR2061436 1 0.0290 0.9548 0.992 0.000 0.000 0.000 0.008
#> SRR2061433 1 0.0290 0.9548 0.992 0.000 0.000 0.000 0.008
#> SRR2061434 1 0.0000 0.9560 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.9560 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.0404 0.6559 0.000 0.988 0.012 0.000 0.000
#> SRR2061429 2 0.0404 0.6559 0.000 0.988 0.012 0.000 0.000
#> SRR2061430 2 0.0404 0.6559 0.000 0.988 0.012 0.000 0.000
#> SRR2061428 2 0.0000 0.6613 0.000 1.000 0.000 0.000 0.000
#> SRR2061426 2 0.0000 0.6613 0.000 1.000 0.000 0.000 0.000
#> SRR2061427 2 0.0000 0.6613 0.000 1.000 0.000 0.000 0.000
#> SRR2061425 2 0.6991 0.3574 0.000 0.504 0.156 0.300 0.040
#> SRR2061424 2 0.8951 0.1614 0.160 0.340 0.156 0.304 0.040
#> SRR2061423 2 0.6899 0.3664 0.000 0.516 0.156 0.292 0.036
#> SRR2061422 1 0.0960 0.9500 0.972 0.000 0.008 0.016 0.004
#> SRR2061421 1 0.1200 0.9493 0.964 0.000 0.008 0.016 0.012
#> SRR2061420 1 0.6003 0.5337 0.660 0.000 0.120 0.180 0.040
#> SRR2061419 1 0.0162 0.9560 0.996 0.000 0.000 0.004 0.000
#> SRR2061418 1 0.0451 0.9552 0.988 0.000 0.000 0.004 0.008
#> SRR2061417 1 0.0324 0.9558 0.992 0.000 0.004 0.004 0.000
#> SRR2061415 1 0.1168 0.9402 0.960 0.000 0.032 0.000 0.008
#> SRR2061416 1 0.0162 0.9560 0.996 0.000 0.000 0.004 0.000
#> SRR2061414 1 0.0162 0.9560 0.996 0.000 0.000 0.004 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.6568 0.4404 0.000 0.452 0.116 0.028 0.376 0.028
#> SRR2061467 2 0.6595 0.4398 0.000 0.448 0.120 0.024 0.376 0.032
#> SRR2061466 2 0.6595 0.4398 0.000 0.448 0.120 0.024 0.376 0.032
#> SRR2061464 5 0.5127 0.3987 0.000 0.036 0.052 0.204 0.692 0.016
#> SRR2061465 2 0.6595 0.4398 0.000 0.448 0.120 0.024 0.376 0.032
#> SRR2061463 5 0.5127 0.3987 0.000 0.036 0.052 0.204 0.692 0.016
#> SRR2061462 5 0.5127 0.3987 0.000 0.036 0.052 0.204 0.692 0.016
#> SRR2061460 4 0.1866 0.9823 0.084 0.000 0.008 0.908 0.000 0.000
#> SRR2061459 4 0.1866 0.9823 0.084 0.000 0.008 0.908 0.000 0.000
#> SRR2061461 4 0.2060 0.9809 0.084 0.000 0.016 0.900 0.000 0.000
#> SRR2061458 4 0.2020 0.9883 0.096 0.000 0.008 0.896 0.000 0.000
#> SRR2061457 4 0.1765 0.9899 0.096 0.000 0.000 0.904 0.000 0.000
#> SRR2061481 3 0.5420 0.5435 0.000 0.000 0.576 0.008 0.120 0.296
#> SRR2061488 3 0.4007 0.8070 0.000 0.220 0.728 0.000 0.000 0.052
#> SRR2061456 4 0.1765 0.9899 0.096 0.000 0.000 0.904 0.000 0.000
#> SRR2061487 3 0.4007 0.8070 0.000 0.220 0.728 0.000 0.000 0.052
#> SRR2061485 3 0.4063 0.8112 0.000 0.208 0.736 0.000 0.004 0.052
#> SRR2061486 3 0.4007 0.8070 0.000 0.220 0.728 0.000 0.000 0.052
#> SRR2061484 3 0.4063 0.8112 0.000 0.208 0.736 0.000 0.004 0.052
#> SRR2061482 3 0.5420 0.5435 0.000 0.000 0.576 0.008 0.120 0.296
#> SRR2061480 3 0.5420 0.5435 0.000 0.000 0.576 0.008 0.120 0.296
#> SRR2061483 3 0.4063 0.8112 0.000 0.208 0.736 0.000 0.004 0.052
#> SRR2061478 6 0.3190 0.9803 0.068 0.000 0.000 0.068 0.016 0.848
#> SRR2061477 6 0.3435 0.9778 0.068 0.000 0.000 0.068 0.028 0.836
#> SRR2061475 6 0.2685 0.9905 0.072 0.000 0.000 0.060 0.000 0.868
#> SRR2061474 6 0.3038 0.9882 0.072 0.000 0.000 0.060 0.012 0.856
#> SRR2061476 6 0.2685 0.9905 0.072 0.000 0.000 0.060 0.000 0.868
#> SRR2061473 6 0.2685 0.9905 0.072 0.000 0.000 0.060 0.000 0.868
#> SRR2061472 6 0.2685 0.9905 0.072 0.000 0.000 0.060 0.000 0.868
#> SRR2061470 2 0.6568 0.4404 0.000 0.452 0.116 0.028 0.376 0.028
#> SRR2061469 2 0.6568 0.4404 0.000 0.452 0.116 0.028 0.376 0.028
#> SRR2061455 4 0.2020 0.9883 0.096 0.000 0.008 0.896 0.000 0.000
#> SRR2061454 4 0.1765 0.9899 0.096 0.000 0.000 0.904 0.000 0.000
#> SRR2061452 1 0.3201 0.8533 0.848 0.000 0.088 0.000 0.036 0.028
#> SRR2061453 4 0.1765 0.9899 0.096 0.000 0.000 0.904 0.000 0.000
#> SRR2061450 1 0.3201 0.8533 0.848 0.000 0.088 0.000 0.036 0.028
#> SRR2061451 1 0.3201 0.8533 0.848 0.000 0.088 0.000 0.036 0.028
#> SRR2061448 2 0.0260 0.7330 0.000 0.992 0.008 0.000 0.000 0.000
#> SRR2061471 6 0.3038 0.9882 0.072 0.000 0.000 0.060 0.012 0.856
#> SRR2061449 2 0.0260 0.7330 0.000 0.992 0.008 0.000 0.000 0.000
#> SRR2061447 2 0.0260 0.7330 0.000 0.992 0.008 0.000 0.000 0.000
#> SRR2061446 2 0.1338 0.7008 0.000 0.952 0.008 0.004 0.032 0.004
#> SRR2061444 2 0.0858 0.7060 0.000 0.968 0.004 0.000 0.028 0.000
#> SRR2061443 5 0.6702 0.6820 0.000 0.288 0.088 0.044 0.528 0.052
#> SRR2061442 5 0.7691 0.6441 0.088 0.200 0.088 0.044 0.528 0.052
#> SRR2061441 5 0.6702 0.6820 0.000 0.288 0.088 0.044 0.528 0.052
#> SRR2061445 2 0.1621 0.6807 0.000 0.936 0.008 0.004 0.048 0.004
#> SRR2061439 1 0.0909 0.9271 0.968 0.000 0.020 0.012 0.000 0.000
#> SRR2061440 1 0.0909 0.9271 0.968 0.000 0.020 0.012 0.000 0.000
#> SRR2061437 1 0.0000 0.9323 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0909 0.9271 0.968 0.000 0.020 0.012 0.000 0.000
#> SRR2061435 1 0.0993 0.9266 0.964 0.000 0.024 0.012 0.000 0.000
#> SRR2061436 1 0.1194 0.9206 0.956 0.000 0.032 0.000 0.004 0.008
#> SRR2061433 1 0.1116 0.9210 0.960 0.000 0.028 0.000 0.004 0.008
#> SRR2061434 1 0.0146 0.9319 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.9323 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.0405 0.7334 0.000 0.988 0.008 0.000 0.004 0.000
#> SRR2061429 2 0.0405 0.7334 0.000 0.988 0.008 0.000 0.004 0.000
#> SRR2061430 2 0.0405 0.7334 0.000 0.988 0.008 0.000 0.004 0.000
#> SRR2061428 2 0.0436 0.7303 0.000 0.988 0.004 0.004 0.000 0.004
#> SRR2061426 2 0.0582 0.7313 0.000 0.984 0.004 0.004 0.004 0.004
#> SRR2061427 2 0.0436 0.7303 0.000 0.988 0.004 0.004 0.000 0.004
#> SRR2061425 5 0.6702 0.6820 0.000 0.288 0.088 0.044 0.528 0.052
#> SRR2061424 5 0.7461 0.6719 0.052 0.236 0.088 0.044 0.528 0.052
#> SRR2061423 5 0.6658 0.6781 0.000 0.292 0.088 0.040 0.528 0.052
#> SRR2061422 1 0.0993 0.9266 0.964 0.000 0.024 0.012 0.000 0.000
#> SRR2061421 1 0.1483 0.9258 0.944 0.000 0.036 0.012 0.000 0.008
#> SRR2061420 1 0.6856 -0.0513 0.452 0.000 0.080 0.052 0.368 0.048
#> SRR2061419 1 0.0000 0.9323 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.9323 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.0603 0.9300 0.980 0.000 0.016 0.004 0.000 0.000
#> SRR2061415 1 0.2046 0.8998 0.916 0.000 0.044 0.000 0.032 0.008
#> SRR2061416 1 0.0000 0.9323 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.9323 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
MAD:skmeans*
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"]
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 14886 rows and 74 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.5070 0.494 0.494
#> 3 3 0.884 0.935 0.953 0.2728 0.827 0.660
#> 4 4 0.881 0.931 0.954 0.1275 0.889 0.700
#> 5 5 0.888 0.914 0.940 0.0676 0.929 0.754
#> 6 6 0.938 0.893 0.934 0.0526 0.934 0.720
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0 1 0 1
#> SRR2061467 2 0 1 0 1
#> SRR2061466 2 0 1 0 1
#> SRR2061464 2 0 1 0 1
#> SRR2061465 2 0 1 0 1
#> SRR2061463 2 0 1 0 1
#> SRR2061462 2 0 1 0 1
#> SRR2061460 1 0 1 1 0
#> SRR2061459 1 0 1 1 0
#> SRR2061461 1 0 1 1 0
#> SRR2061458 1 0 1 1 0
#> SRR2061457 1 0 1 1 0
#> SRR2061481 2 0 1 0 1
#> SRR2061488 2 0 1 0 1
#> SRR2061456 1 0 1 1 0
#> SRR2061487 2 0 1 0 1
#> SRR2061485 2 0 1 0 1
#> SRR2061486 2 0 1 0 1
#> SRR2061484 2 0 1 0 1
#> SRR2061482 2 0 1 0 1
#> SRR2061480 2 0 1 0 1
#> SRR2061483 2 0 1 0 1
#> SRR2061478 1 0 1 1 0
#> SRR2061477 1 0 1 1 0
#> SRR2061475 1 0 1 1 0
#> SRR2061474 1 0 1 1 0
#> SRR2061476 1 0 1 1 0
#> SRR2061473 1 0 1 1 0
#> SRR2061472 1 0 1 1 0
#> SRR2061470 2 0 1 0 1
#> SRR2061469 2 0 1 0 1
#> SRR2061455 1 0 1 1 0
#> SRR2061454 1 0 1 1 0
#> SRR2061452 1 0 1 1 0
#> SRR2061453 1 0 1 1 0
#> SRR2061450 1 0 1 1 0
#> SRR2061451 1 0 1 1 0
#> SRR2061448 2 0 1 0 1
#> SRR2061471 1 0 1 1 0
#> SRR2061449 2 0 1 0 1
#> SRR2061447 2 0 1 0 1
#> SRR2061446 2 0 1 0 1
#> SRR2061444 2 0 1 0 1
#> SRR2061443 2 0 1 0 1
#> SRR2061442 2 0 1 0 1
#> SRR2061441 2 0 1 0 1
#> SRR2061445 2 0 1 0 1
#> SRR2061439 1 0 1 1 0
#> SRR2061440 1 0 1 1 0
#> SRR2061437 1 0 1 1 0
#> SRR2061438 1 0 1 1 0
#> SRR2061435 1 0 1 1 0
#> SRR2061436 1 0 1 1 0
#> SRR2061433 1 0 1 1 0
#> SRR2061434 1 0 1 1 0
#> SRR2061432 1 0 1 1 0
#> SRR2061431 2 0 1 0 1
#> SRR2061429 2 0 1 0 1
#> SRR2061430 2 0 1 0 1
#> SRR2061428 2 0 1 0 1
#> SRR2061426 2 0 1 0 1
#> SRR2061427 2 0 1 0 1
#> SRR2061425 2 0 1 0 1
#> SRR2061424 2 0 1 0 1
#> SRR2061423 2 0 1 0 1
#> SRR2061422 1 0 1 1 0
#> SRR2061421 1 0 1 1 0
#> SRR2061420 1 0 1 1 0
#> SRR2061419 1 0 1 1 0
#> SRR2061418 1 0 1 1 0
#> SRR2061417 1 0 1 1 0
#> SRR2061415 1 0 1 1 0
#> SRR2061416 1 0 1 1 0
#> SRR2061414 1 0 1 1 0
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0237 0.969 0.000 0.996 0.004
#> SRR2061467 2 0.0237 0.969 0.000 0.996 0.004
#> SRR2061466 2 0.0237 0.969 0.000 0.996 0.004
#> SRR2061464 2 0.2356 0.928 0.000 0.928 0.072
#> SRR2061465 2 0.0237 0.969 0.000 0.996 0.004
#> SRR2061463 2 0.2356 0.928 0.000 0.928 0.072
#> SRR2061462 2 0.2356 0.928 0.000 0.928 0.072
#> SRR2061460 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061459 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061461 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061458 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061457 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061481 2 0.4002 0.865 0.000 0.840 0.160
#> SRR2061488 2 0.2165 0.943 0.000 0.936 0.064
#> SRR2061456 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061487 2 0.2165 0.943 0.000 0.936 0.064
#> SRR2061485 2 0.2165 0.943 0.000 0.936 0.064
#> SRR2061486 2 0.2165 0.943 0.000 0.936 0.064
#> SRR2061484 2 0.2165 0.943 0.000 0.936 0.064
#> SRR2061482 2 0.4002 0.865 0.000 0.840 0.160
#> SRR2061480 2 0.4002 0.865 0.000 0.840 0.160
#> SRR2061483 2 0.2165 0.943 0.000 0.936 0.064
#> SRR2061478 3 0.2448 0.904 0.076 0.000 0.924
#> SRR2061477 3 0.2448 0.904 0.076 0.000 0.924
#> SRR2061475 3 0.2448 0.904 0.076 0.000 0.924
#> SRR2061474 3 0.2448 0.904 0.076 0.000 0.924
#> SRR2061476 3 0.2448 0.904 0.076 0.000 0.924
#> SRR2061473 3 0.2448 0.904 0.076 0.000 0.924
#> SRR2061472 3 0.2448 0.904 0.076 0.000 0.924
#> SRR2061470 2 0.0237 0.969 0.000 0.996 0.004
#> SRR2061469 2 0.0237 0.969 0.000 0.996 0.004
#> SRR2061455 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061454 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061452 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061453 3 0.3686 0.912 0.140 0.000 0.860
#> SRR2061450 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061448 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061471 3 0.2448 0.904 0.076 0.000 0.924
#> SRR2061449 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061447 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061446 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061444 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061443 2 0.0237 0.968 0.000 0.996 0.004
#> SRR2061442 1 0.2772 0.866 0.916 0.080 0.004
#> SRR2061441 2 0.0237 0.968 0.000 0.996 0.004
#> SRR2061445 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061439 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061440 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061437 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061438 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061435 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061431 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.969 0.000 1.000 0.000
#> SRR2061425 2 0.0237 0.968 0.000 0.996 0.004
#> SRR2061424 1 0.6442 0.249 0.564 0.432 0.004
#> SRR2061423 2 0.0237 0.968 0.000 0.996 0.004
#> SRR2061422 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061420 1 0.0237 0.963 0.996 0.000 0.004
#> SRR2061419 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061418 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061417 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061415 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061416 1 0.0000 0.968 1.000 0.000 0.000
#> SRR2061414 1 0.0000 0.968 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0469 0.936 0.000 0.988 0.012 0.000
#> SRR2061467 2 0.0469 0.936 0.000 0.988 0.012 0.000
#> SRR2061466 2 0.0469 0.936 0.000 0.988 0.012 0.000
#> SRR2061464 4 0.3634 0.865 0.000 0.048 0.096 0.856
#> SRR2061465 2 0.0469 0.936 0.000 0.988 0.012 0.000
#> SRR2061463 4 0.3634 0.865 0.000 0.048 0.096 0.856
#> SRR2061462 4 0.3634 0.865 0.000 0.048 0.096 0.856
#> SRR2061460 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061459 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061461 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061458 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061457 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061481 3 0.0000 0.896 0.000 0.000 1.000 0.000
#> SRR2061488 2 0.3610 0.803 0.000 0.800 0.200 0.000
#> SRR2061456 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061487 2 0.3610 0.803 0.000 0.800 0.200 0.000
#> SRR2061485 2 0.3610 0.803 0.000 0.800 0.200 0.000
#> SRR2061486 2 0.3610 0.803 0.000 0.800 0.200 0.000
#> SRR2061484 2 0.3610 0.803 0.000 0.800 0.200 0.000
#> SRR2061482 3 0.0000 0.896 0.000 0.000 1.000 0.000
#> SRR2061480 3 0.0000 0.896 0.000 0.000 1.000 0.000
#> SRR2061483 2 0.3610 0.803 0.000 0.800 0.200 0.000
#> SRR2061478 3 0.2973 0.961 0.020 0.000 0.884 0.096
#> SRR2061477 3 0.2973 0.961 0.020 0.000 0.884 0.096
#> SRR2061475 3 0.2973 0.961 0.020 0.000 0.884 0.096
#> SRR2061474 3 0.2973 0.961 0.020 0.000 0.884 0.096
#> SRR2061476 3 0.2973 0.961 0.020 0.000 0.884 0.096
#> SRR2061473 3 0.2973 0.961 0.020 0.000 0.884 0.096
#> SRR2061472 3 0.2973 0.961 0.020 0.000 0.884 0.096
#> SRR2061470 2 0.0469 0.936 0.000 0.988 0.012 0.000
#> SRR2061469 2 0.0469 0.936 0.000 0.988 0.012 0.000
#> SRR2061455 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061454 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061452 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061453 4 0.0000 0.956 0.000 0.000 0.000 1.000
#> SRR2061450 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061448 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061471 3 0.2973 0.961 0.020 0.000 0.884 0.096
#> SRR2061449 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061447 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061446 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061444 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061443 2 0.2149 0.888 0.000 0.912 0.088 0.000
#> SRR2061442 1 0.3505 0.851 0.864 0.048 0.088 0.000
#> SRR2061441 2 0.2149 0.888 0.000 0.912 0.088 0.000
#> SRR2061445 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061439 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061429 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061430 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061428 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061426 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061427 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> SRR2061425 2 0.2149 0.888 0.000 0.912 0.088 0.000
#> SRR2061424 1 0.5457 0.672 0.728 0.184 0.088 0.000
#> SRR2061423 2 0.2149 0.888 0.000 0.912 0.088 0.000
#> SRR2061422 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061420 1 0.0469 0.969 0.988 0.000 0.012 0.000
#> SRR2061419 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061415 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.980 1.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.0000 0.894 0.000 1.000 0.000 0.00 0.000
#> SRR2061467 2 0.0000 0.894 0.000 1.000 0.000 0.00 0.000
#> SRR2061466 2 0.0000 0.894 0.000 1.000 0.000 0.00 0.000
#> SRR2061464 5 0.5864 0.554 0.000 0.128 0.000 0.30 0.572
#> SRR2061465 2 0.0000 0.894 0.000 1.000 0.000 0.00 0.000
#> SRR2061463 5 0.5864 0.554 0.000 0.128 0.000 0.30 0.572
#> SRR2061462 5 0.5864 0.554 0.000 0.128 0.000 0.30 0.572
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061481 3 0.1608 0.928 0.000 0.000 0.928 0.00 0.072
#> SRR2061488 2 0.2409 0.852 0.000 0.900 0.032 0.00 0.068
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061487 2 0.2409 0.852 0.000 0.900 0.032 0.00 0.068
#> SRR2061485 2 0.2409 0.852 0.000 0.900 0.032 0.00 0.068
#> SRR2061486 2 0.2409 0.852 0.000 0.900 0.032 0.00 0.068
#> SRR2061484 2 0.2409 0.852 0.000 0.900 0.032 0.00 0.068
#> SRR2061482 3 0.1608 0.928 0.000 0.000 0.928 0.00 0.072
#> SRR2061480 3 0.1608 0.928 0.000 0.000 0.928 0.00 0.072
#> SRR2061483 2 0.2409 0.852 0.000 0.900 0.032 0.00 0.068
#> SRR2061478 3 0.0609 0.974 0.000 0.000 0.980 0.02 0.000
#> SRR2061477 3 0.0609 0.974 0.000 0.000 0.980 0.02 0.000
#> SRR2061475 3 0.0609 0.974 0.000 0.000 0.980 0.02 0.000
#> SRR2061474 3 0.0609 0.974 0.000 0.000 0.980 0.02 0.000
#> SRR2061476 3 0.0609 0.974 0.000 0.000 0.980 0.02 0.000
#> SRR2061473 3 0.0609 0.974 0.000 0.000 0.980 0.02 0.000
#> SRR2061472 3 0.0609 0.974 0.000 0.000 0.980 0.02 0.000
#> SRR2061470 2 0.0000 0.894 0.000 1.000 0.000 0.00 0.000
#> SRR2061469 2 0.0000 0.894 0.000 1.000 0.000 0.00 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061452 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061450 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061451 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061448 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061471 3 0.0609 0.974 0.000 0.000 0.980 0.02 0.000
#> SRR2061449 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061447 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061446 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061444 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061443 5 0.1544 0.815 0.000 0.068 0.000 0.00 0.932
#> SRR2061442 5 0.2011 0.754 0.088 0.004 0.000 0.00 0.908
#> SRR2061441 5 0.1544 0.815 0.000 0.068 0.000 0.00 0.932
#> SRR2061445 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061439 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061440 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061437 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061438 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061435 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061436 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061433 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061434 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061432 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061431 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061429 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061430 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061428 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061426 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061427 2 0.2439 0.902 0.000 0.876 0.004 0.00 0.120
#> SRR2061425 5 0.1544 0.815 0.000 0.068 0.000 0.00 0.932
#> SRR2061424 5 0.1818 0.806 0.024 0.044 0.000 0.00 0.932
#> SRR2061423 5 0.1544 0.815 0.000 0.068 0.000 0.00 0.932
#> SRR2061422 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061421 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061420 1 0.3752 0.596 0.708 0.000 0.000 0.00 0.292
#> SRR2061419 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061418 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061417 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061415 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061416 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
#> SRR2061414 1 0.0000 0.985 1.000 0.000 0.000 0.00 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.4164 0.7952 0.000 0.744 0.184 0.000 0.064 0.008
#> SRR2061467 2 0.4164 0.7952 0.000 0.744 0.184 0.000 0.064 0.008
#> SRR2061466 2 0.4164 0.7952 0.000 0.744 0.184 0.000 0.064 0.008
#> SRR2061464 5 0.5721 0.4316 0.000 0.000 0.172 0.272 0.548 0.008
#> SRR2061465 2 0.4164 0.7952 0.000 0.744 0.184 0.000 0.064 0.008
#> SRR2061463 5 0.5721 0.4316 0.000 0.000 0.172 0.272 0.548 0.008
#> SRR2061462 5 0.5721 0.4316 0.000 0.000 0.172 0.272 0.548 0.008
#> SRR2061460 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061459 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061461 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061458 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061457 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061481 3 0.2762 0.7885 0.000 0.000 0.804 0.000 0.000 0.196
#> SRR2061488 3 0.1267 0.9049 0.000 0.060 0.940 0.000 0.000 0.000
#> SRR2061456 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061487 3 0.1267 0.9049 0.000 0.060 0.940 0.000 0.000 0.000
#> SRR2061485 3 0.1267 0.9049 0.000 0.060 0.940 0.000 0.000 0.000
#> SRR2061486 3 0.1267 0.9049 0.000 0.060 0.940 0.000 0.000 0.000
#> SRR2061484 3 0.1267 0.9049 0.000 0.060 0.940 0.000 0.000 0.000
#> SRR2061482 3 0.2762 0.7885 0.000 0.000 0.804 0.000 0.000 0.196
#> SRR2061480 3 0.2762 0.7885 0.000 0.000 0.804 0.000 0.000 0.196
#> SRR2061483 3 0.1267 0.9049 0.000 0.060 0.940 0.000 0.000 0.000
#> SRR2061478 6 0.0291 1.0000 0.004 0.000 0.000 0.004 0.000 0.992
#> SRR2061477 6 0.0291 1.0000 0.004 0.000 0.000 0.004 0.000 0.992
#> SRR2061475 6 0.0291 1.0000 0.004 0.000 0.000 0.004 0.000 0.992
#> SRR2061474 6 0.0291 1.0000 0.004 0.000 0.000 0.004 0.000 0.992
#> SRR2061476 6 0.0291 1.0000 0.004 0.000 0.000 0.004 0.000 0.992
#> SRR2061473 6 0.0291 1.0000 0.004 0.000 0.000 0.004 0.000 0.992
#> SRR2061472 6 0.0291 1.0000 0.004 0.000 0.000 0.004 0.000 0.992
#> SRR2061470 2 0.4164 0.7952 0.000 0.744 0.184 0.000 0.064 0.008
#> SRR2061469 2 0.4164 0.7952 0.000 0.744 0.184 0.000 0.064 0.008
#> SRR2061455 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061454 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061452 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061450 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061448 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061471 6 0.0291 1.0000 0.004 0.000 0.000 0.004 0.000 0.992
#> SRR2061449 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061447 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061446 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061444 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061443 5 0.1327 0.7506 0.000 0.064 0.000 0.000 0.936 0.000
#> SRR2061442 5 0.1528 0.7418 0.016 0.048 0.000 0.000 0.936 0.000
#> SRR2061441 5 0.1327 0.7506 0.000 0.064 0.000 0.000 0.936 0.000
#> SRR2061445 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061439 1 0.0260 0.9939 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR2061440 1 0.0260 0.9939 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0260 0.9939 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR2061435 1 0.0363 0.9927 0.988 0.000 0.012 0.000 0.000 0.000
#> SRR2061436 1 0.0146 0.9955 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.0146 0.9955 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061429 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061430 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061428 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061426 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061427 2 0.0000 0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061425 5 0.1327 0.7506 0.000 0.064 0.000 0.000 0.936 0.000
#> SRR2061424 5 0.1327 0.7506 0.000 0.064 0.000 0.000 0.936 0.000
#> SRR2061423 5 0.1327 0.7506 0.000 0.064 0.000 0.000 0.936 0.000
#> SRR2061422 1 0.0363 0.9927 0.988 0.000 0.012 0.000 0.000 0.000
#> SRR2061421 1 0.0363 0.9927 0.988 0.000 0.012 0.000 0.000 0.000
#> SRR2061420 5 0.4096 -0.0445 0.484 0.000 0.008 0.000 0.508 0.000
#> SRR2061419 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.0146 0.9955 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.9967 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
MAD:pam*
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"]
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 14886 rows and 74 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.996 0.5045 0.496 0.496
#> 3 3 1.000 0.981 0.987 0.2380 0.862 0.727
#> 4 4 1.000 0.989 0.996 0.1459 0.895 0.726
#> 5 5 0.882 0.943 0.961 0.0777 0.933 0.771
#> 6 6 0.937 0.848 0.919 0.0625 0.926 0.697
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 1.000 0.000 1.000
#> SRR2061467 2 0.000 1.000 0.000 1.000
#> SRR2061466 2 0.000 1.000 0.000 1.000
#> SRR2061464 2 0.000 1.000 0.000 1.000
#> SRR2061465 2 0.000 1.000 0.000 1.000
#> SRR2061463 2 0.000 1.000 0.000 1.000
#> SRR2061462 2 0.000 1.000 0.000 1.000
#> SRR2061460 1 0.000 0.993 1.000 0.000
#> SRR2061459 1 0.000 0.993 1.000 0.000
#> SRR2061461 1 0.000 0.993 1.000 0.000
#> SRR2061458 1 0.000 0.993 1.000 0.000
#> SRR2061457 1 0.000 0.993 1.000 0.000
#> SRR2061481 2 0.000 1.000 0.000 1.000
#> SRR2061488 2 0.000 1.000 0.000 1.000
#> SRR2061456 1 0.000 0.993 1.000 0.000
#> SRR2061487 2 0.000 1.000 0.000 1.000
#> SRR2061485 2 0.000 1.000 0.000 1.000
#> SRR2061486 2 0.000 1.000 0.000 1.000
#> SRR2061484 2 0.000 1.000 0.000 1.000
#> SRR2061482 2 0.000 1.000 0.000 1.000
#> SRR2061480 2 0.000 1.000 0.000 1.000
#> SRR2061483 2 0.000 1.000 0.000 1.000
#> SRR2061478 1 0.000 0.993 1.000 0.000
#> SRR2061477 1 0.000 0.993 1.000 0.000
#> SRR2061475 1 0.000 0.993 1.000 0.000
#> SRR2061474 1 0.000 0.993 1.000 0.000
#> SRR2061476 1 0.000 0.993 1.000 0.000
#> SRR2061473 1 0.000 0.993 1.000 0.000
#> SRR2061472 1 0.000 0.993 1.000 0.000
#> SRR2061470 2 0.000 1.000 0.000 1.000
#> SRR2061469 2 0.000 1.000 0.000 1.000
#> SRR2061455 1 0.000 0.993 1.000 0.000
#> SRR2061454 1 0.000 0.993 1.000 0.000
#> SRR2061452 1 0.000 0.993 1.000 0.000
#> SRR2061453 1 0.000 0.993 1.000 0.000
#> SRR2061450 1 0.000 0.993 1.000 0.000
#> SRR2061451 1 0.000 0.993 1.000 0.000
#> SRR2061448 2 0.000 1.000 0.000 1.000
#> SRR2061471 1 0.000 0.993 1.000 0.000
#> SRR2061449 2 0.000 1.000 0.000 1.000
#> SRR2061447 2 0.000 1.000 0.000 1.000
#> SRR2061446 2 0.000 1.000 0.000 1.000
#> SRR2061444 2 0.000 1.000 0.000 1.000
#> SRR2061443 2 0.000 1.000 0.000 1.000
#> SRR2061442 1 0.224 0.958 0.964 0.036
#> SRR2061441 2 0.000 1.000 0.000 1.000
#> SRR2061445 2 0.000 1.000 0.000 1.000
#> SRR2061439 1 0.000 0.993 1.000 0.000
#> SRR2061440 1 0.000 0.993 1.000 0.000
#> SRR2061437 1 0.000 0.993 1.000 0.000
#> SRR2061438 1 0.000 0.993 1.000 0.000
#> SRR2061435 1 0.000 0.993 1.000 0.000
#> SRR2061436 1 0.000 0.993 1.000 0.000
#> SRR2061433 1 0.000 0.993 1.000 0.000
#> SRR2061434 1 0.000 0.993 1.000 0.000
#> SRR2061432 1 0.000 0.993 1.000 0.000
#> SRR2061431 2 0.000 1.000 0.000 1.000
#> SRR2061429 2 0.000 1.000 0.000 1.000
#> SRR2061430 2 0.000 1.000 0.000 1.000
#> SRR2061428 2 0.000 1.000 0.000 1.000
#> SRR2061426 2 0.000 1.000 0.000 1.000
#> SRR2061427 2 0.000 1.000 0.000 1.000
#> SRR2061425 2 0.000 1.000 0.000 1.000
#> SRR2061424 1 0.775 0.707 0.772 0.228
#> SRR2061423 2 0.000 1.000 0.000 1.000
#> SRR2061422 1 0.000 0.993 1.000 0.000
#> SRR2061421 1 0.000 0.993 1.000 0.000
#> SRR2061420 1 0.000 0.993 1.000 0.000
#> SRR2061419 1 0.000 0.993 1.000 0.000
#> SRR2061418 1 0.000 0.993 1.000 0.000
#> SRR2061417 1 0.000 0.993 1.000 0.000
#> SRR2061415 1 0.000 0.993 1.000 0.000
#> SRR2061416 1 0.000 0.993 1.000 0.000
#> SRR2061414 1 0.000 0.993 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061464 2 0.0747 0.983 0.000 0.984 0.016
#> SRR2061465 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061463 2 0.1411 0.964 0.000 0.964 0.036
#> SRR2061462 2 0.1411 0.964 0.000 0.964 0.036
#> SRR2061460 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061459 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061461 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061458 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061457 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061481 3 0.1411 0.965 0.000 0.036 0.964
#> SRR2061488 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061456 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061487 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061485 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061486 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061484 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061482 3 0.1411 0.965 0.000 0.036 0.964
#> SRR2061480 3 0.1411 0.965 0.000 0.036 0.964
#> SRR2061483 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061478 3 0.1411 0.984 0.036 0.000 0.964
#> SRR2061477 3 0.1411 0.984 0.036 0.000 0.964
#> SRR2061475 3 0.1411 0.984 0.036 0.000 0.964
#> SRR2061474 3 0.1411 0.984 0.036 0.000 0.964
#> SRR2061476 3 0.1411 0.984 0.036 0.000 0.964
#> SRR2061473 3 0.1411 0.984 0.036 0.000 0.964
#> SRR2061472 3 0.0424 0.969 0.008 0.000 0.992
#> SRR2061470 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061455 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061454 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061452 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061453 1 0.1411 0.966 0.964 0.000 0.036
#> SRR2061450 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061448 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061471 3 0.1411 0.984 0.036 0.000 0.964
#> SRR2061449 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061447 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061446 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061444 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061443 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061442 1 0.0237 0.978 0.996 0.004 0.000
#> SRR2061441 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061445 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061439 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061440 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061437 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061438 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061435 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061431 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061425 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061424 1 0.4555 0.718 0.800 0.200 0.000
#> SRR2061423 2 0.0000 0.997 0.000 1.000 0.000
#> SRR2061422 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061420 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061419 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061418 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061417 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061415 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061416 1 0.0000 0.981 1.000 0.000 0.000
#> SRR2061414 1 0.0000 0.981 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061467 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061466 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061464 2 0.2408 0.884 0.0 0.896 0 0.104
#> SRR2061465 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061463 4 0.0469 0.984 0.0 0.012 0 0.988
#> SRR2061462 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061460 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061459 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061461 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061458 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061457 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061481 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061488 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061456 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061487 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061485 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061486 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061484 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061482 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061480 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061483 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061478 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061477 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061475 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061474 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061476 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061473 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061472 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061470 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061469 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061455 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061454 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061452 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061453 4 0.0000 0.998 0.0 0.000 0 1.000
#> SRR2061450 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061451 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061448 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061471 3 0.0000 1.000 0.0 0.000 1 0.000
#> SRR2061449 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061447 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061446 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061444 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061443 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061442 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061441 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061445 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061439 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061440 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061437 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061438 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061435 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061436 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061433 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061434 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061432 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061431 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061429 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061430 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061428 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061426 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061427 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061425 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061424 1 0.3610 0.723 0.8 0.200 0 0.000
#> SRR2061423 2 0.0000 0.996 0.0 1.000 0 0.000
#> SRR2061422 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061421 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061420 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061419 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061418 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061417 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061415 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061416 1 0.0000 0.989 1.0 0.000 0 0.000
#> SRR2061414 1 0.0000 0.989 1.0 0.000 0 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061467 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061466 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061464 2 0.431 0.792 0.000 0.772 0.124 0.104 0.000
#> SRR2061465 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061463 4 0.272 0.864 0.000 0.012 0.124 0.864 0.000
#> SRR2061462 4 0.233 0.874 0.000 0.000 0.124 0.876 0.000
#> SRR2061460 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061459 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061461 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061458 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061457 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061481 3 0.196 0.853 0.000 0.000 0.904 0.000 0.096
#> SRR2061488 3 0.233 0.935 0.000 0.124 0.876 0.000 0.000
#> SRR2061456 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061487 3 0.233 0.935 0.000 0.124 0.876 0.000 0.000
#> SRR2061485 3 0.233 0.935 0.000 0.124 0.876 0.000 0.000
#> SRR2061486 3 0.233 0.935 0.000 0.124 0.876 0.000 0.000
#> SRR2061484 3 0.233 0.935 0.000 0.124 0.876 0.000 0.000
#> SRR2061482 3 0.228 0.850 0.000 0.000 0.880 0.000 0.120
#> SRR2061480 3 0.233 0.848 0.000 0.000 0.876 0.000 0.124
#> SRR2061483 3 0.233 0.935 0.000 0.124 0.876 0.000 0.000
#> SRR2061478 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061477 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061475 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061474 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061476 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061473 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061472 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061470 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061469 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061455 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061454 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061452 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061453 4 0.000 0.973 0.000 0.000 0.000 1.000 0.000
#> SRR2061450 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061451 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061448 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061471 5 0.000 1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2061449 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061447 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061446 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061444 2 0.233 0.889 0.000 0.876 0.124 0.000 0.000
#> SRR2061443 2 0.233 0.889 0.000 0.876 0.124 0.000 0.000
#> SRR2061442 1 0.233 0.863 0.876 0.000 0.124 0.000 0.000
#> SRR2061441 2 0.233 0.889 0.000 0.876 0.124 0.000 0.000
#> SRR2061445 2 0.233 0.889 0.000 0.876 0.124 0.000 0.000
#> SRR2061439 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061437 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061436 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061433 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061432 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061429 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061430 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061428 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061426 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061427 2 0.000 0.951 0.000 1.000 0.000 0.000 0.000
#> SRR2061425 2 0.233 0.889 0.000 0.876 0.124 0.000 0.000
#> SRR2061424 1 0.525 0.590 0.676 0.200 0.124 0.000 0.000
#> SRR2061423 2 0.233 0.889 0.000 0.876 0.124 0.000 0.000
#> SRR2061422 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061421 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061420 1 0.233 0.863 0.876 0.000 0.124 0.000 0.000
#> SRR2061419 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061416 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.000 0.973 1.000 0.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.373 0.5731 0.000 0.612 0 0 0.388 0
#> SRR2061467 2 0.373 0.5731 0.000 0.612 0 0 0.388 0
#> SRR2061466 2 0.373 0.5731 0.000 0.612 0 0 0.388 0
#> SRR2061464 5 0.000 0.5379 0.000 0.000 0 0 1.000 0
#> SRR2061465 2 0.373 0.5731 0.000 0.612 0 0 0.388 0
#> SRR2061463 5 0.000 0.5379 0.000 0.000 0 0 1.000 0
#> SRR2061462 5 0.000 0.5379 0.000 0.000 0 0 1.000 0
#> SRR2061460 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061459 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061461 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061458 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061457 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061481 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061488 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061456 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061487 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061485 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061486 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061484 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061482 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061480 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061483 3 0.000 1.0000 0.000 0.000 1 0 0.000 0
#> SRR2061478 6 0.000 1.0000 0.000 0.000 0 0 0.000 1
#> SRR2061477 6 0.000 1.0000 0.000 0.000 0 0 0.000 1
#> SRR2061475 6 0.000 1.0000 0.000 0.000 0 0 0.000 1
#> SRR2061474 6 0.000 1.0000 0.000 0.000 0 0 0.000 1
#> SRR2061476 6 0.000 1.0000 0.000 0.000 0 0 0.000 1
#> SRR2061473 6 0.000 1.0000 0.000 0.000 0 0 0.000 1
#> SRR2061472 6 0.000 1.0000 0.000 0.000 0 0 0.000 1
#> SRR2061470 2 0.373 0.5731 0.000 0.612 0 0 0.388 0
#> SRR2061469 2 0.373 0.5731 0.000 0.612 0 0 0.388 0
#> SRR2061455 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061454 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061452 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061453 4 0.000 1.0000 0.000 0.000 0 1 0.000 0
#> SRR2061450 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061451 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061448 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061471 6 0.000 1.0000 0.000 0.000 0 0 0.000 1
#> SRR2061449 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061447 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061446 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061444 2 0.359 -0.0555 0.000 0.656 0 0 0.344 0
#> SRR2061443 5 0.373 0.6978 0.000 0.388 0 0 0.612 0
#> SRR2061442 5 0.373 0.6978 0.000 0.388 0 0 0.612 0
#> SRR2061441 5 0.373 0.6978 0.000 0.388 0 0 0.612 0
#> SRR2061445 2 0.359 -0.0555 0.000 0.656 0 0 0.344 0
#> SRR2061439 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061440 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061437 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061438 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061435 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061436 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061433 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061434 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061432 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061431 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061429 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061430 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061428 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061426 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061427 2 0.000 0.7298 0.000 1.000 0 0 0.000 0
#> SRR2061425 5 0.373 0.6978 0.000 0.388 0 0 0.612 0
#> SRR2061424 5 0.373 0.6978 0.000 0.388 0 0 0.612 0
#> SRR2061423 5 0.373 0.6978 0.000 0.388 0 0 0.612 0
#> SRR2061422 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061421 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061420 5 0.373 0.3140 0.388 0.000 0 0 0.612 0
#> SRR2061419 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061418 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061417 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061415 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061416 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
#> SRR2061414 1 0.000 1.0000 1.000 0.000 0 0 0.000 0
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.
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.
MAD:mclust**
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.627 0.818 0.882 0.4350 0.495 0.495
#> 3 3 0.747 0.977 0.948 0.4795 0.859 0.716
#> 4 4 1.000 0.989 0.996 0.1800 0.887 0.680
#> 5 5 1.000 0.996 0.999 0.0397 0.970 0.875
#> 6 6 1.000 0.998 0.999 0.0329 0.959 0.813
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 0.531 0.000 1.000
#> SRR2061467 2 0.000 0.531 0.000 1.000
#> SRR2061466 2 0.000 0.531 0.000 1.000
#> SRR2061464 2 0.000 0.531 0.000 1.000
#> SRR2061465 2 0.000 0.531 0.000 1.000
#> SRR2061463 2 0.000 0.531 0.000 1.000
#> SRR2061462 2 0.000 0.531 0.000 1.000
#> SRR2061460 2 0.000 0.531 0.000 1.000
#> SRR2061459 2 0.000 0.531 0.000 1.000
#> SRR2061461 2 0.000 0.531 0.000 1.000
#> SRR2061458 2 0.000 0.531 0.000 1.000
#> SRR2061457 2 0.000 0.531 0.000 1.000
#> SRR2061481 2 0.999 0.705 0.484 0.516
#> SRR2061488 2 0.999 0.705 0.484 0.516
#> SRR2061456 2 0.000 0.531 0.000 1.000
#> SRR2061487 2 0.999 0.705 0.484 0.516
#> SRR2061485 2 0.999 0.705 0.484 0.516
#> SRR2061486 2 0.999 0.705 0.484 0.516
#> SRR2061484 2 0.999 0.705 0.484 0.516
#> SRR2061482 2 0.999 0.705 0.484 0.516
#> SRR2061480 2 0.999 0.705 0.484 0.516
#> SRR2061483 2 0.999 0.705 0.484 0.516
#> SRR2061478 2 0.999 0.705 0.484 0.516
#> SRR2061477 2 0.999 0.705 0.484 0.516
#> SRR2061475 2 0.999 0.705 0.484 0.516
#> SRR2061474 2 0.999 0.705 0.484 0.516
#> SRR2061476 2 0.999 0.705 0.484 0.516
#> SRR2061473 2 0.999 0.705 0.484 0.516
#> SRR2061472 2 0.999 0.705 0.484 0.516
#> SRR2061470 2 0.000 0.531 0.000 1.000
#> SRR2061469 2 0.000 0.531 0.000 1.000
#> SRR2061455 2 0.000 0.531 0.000 1.000
#> SRR2061454 2 0.000 0.531 0.000 1.000
#> SRR2061452 1 0.999 1.000 0.516 0.484
#> SRR2061453 2 0.000 0.531 0.000 1.000
#> SRR2061450 1 0.999 1.000 0.516 0.484
#> SRR2061451 1 0.999 1.000 0.516 0.484
#> SRR2061448 1 0.999 1.000 0.516 0.484
#> SRR2061471 2 0.999 0.705 0.484 0.516
#> SRR2061449 1 0.999 1.000 0.516 0.484
#> SRR2061447 1 0.999 1.000 0.516 0.484
#> SRR2061446 1 0.999 1.000 0.516 0.484
#> SRR2061444 1 0.999 1.000 0.516 0.484
#> SRR2061443 1 0.999 1.000 0.516 0.484
#> SRR2061442 1 0.999 1.000 0.516 0.484
#> SRR2061441 1 0.999 1.000 0.516 0.484
#> SRR2061445 1 0.999 1.000 0.516 0.484
#> SRR2061439 1 0.999 1.000 0.516 0.484
#> SRR2061440 1 0.999 1.000 0.516 0.484
#> SRR2061437 1 0.999 1.000 0.516 0.484
#> SRR2061438 1 0.999 1.000 0.516 0.484
#> SRR2061435 1 0.999 1.000 0.516 0.484
#> SRR2061436 1 0.999 1.000 0.516 0.484
#> SRR2061433 1 0.999 1.000 0.516 0.484
#> SRR2061434 1 0.999 1.000 0.516 0.484
#> SRR2061432 1 0.999 1.000 0.516 0.484
#> SRR2061431 1 0.999 1.000 0.516 0.484
#> SRR2061429 1 0.999 1.000 0.516 0.484
#> SRR2061430 1 0.999 1.000 0.516 0.484
#> SRR2061428 1 0.999 1.000 0.516 0.484
#> SRR2061426 1 0.999 1.000 0.516 0.484
#> SRR2061427 1 0.999 1.000 0.516 0.484
#> SRR2061425 1 0.999 1.000 0.516 0.484
#> SRR2061424 1 0.999 1.000 0.516 0.484
#> SRR2061423 1 0.999 1.000 0.516 0.484
#> SRR2061422 1 0.999 1.000 0.516 0.484
#> SRR2061421 1 0.999 1.000 0.516 0.484
#> SRR2061420 1 0.999 1.000 0.516 0.484
#> SRR2061419 1 0.999 1.000 0.516 0.484
#> SRR2061418 1 0.999 1.000 0.516 0.484
#> SRR2061417 1 0.999 1.000 0.516 0.484
#> SRR2061415 1 0.999 1.000 0.516 0.484
#> SRR2061416 1 0.999 1.000 0.516 0.484
#> SRR2061414 1 0.999 1.000 0.516 0.484
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061467 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061466 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061464 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061465 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061463 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061462 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061460 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061459 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061461 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061458 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061457 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061481 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061488 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061456 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061487 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061485 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061486 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061484 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061482 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061480 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061483 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061478 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061477 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061475 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061474 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061476 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061473 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061472 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061470 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061469 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061455 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061454 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061452 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061453 3 0.000 0.957 0.000 0.000 1.000
#> SRR2061450 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061451 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061448 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061471 3 0.304 0.954 0.104 0.000 0.896
#> SRR2061449 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061447 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061446 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061444 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061443 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061442 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061441 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061445 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061439 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061440 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061437 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061438 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061435 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061436 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061433 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061434 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061432 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061431 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061429 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061430 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061428 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061426 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061427 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061425 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061424 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061423 2 0.000 0.996 0.000 1.000 0.000
#> SRR2061422 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061421 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061420 2 0.226 0.918 0.068 0.932 0.000
#> SRR2061419 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061418 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061417 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061415 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061416 1 0.304 1.000 0.896 0.104 0.000
#> SRR2061414 1 0.304 1.000 0.896 0.104 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061467 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061466 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061464 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061465 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061463 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061462 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061460 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061459 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061461 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061458 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061457 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061481 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061488 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061456 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061487 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061485 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061486 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061484 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061482 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061480 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061483 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061478 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061477 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061475 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061474 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061476 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061473 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061472 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061470 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061469 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061455 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061454 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061452 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061453 4 0.000 1.000 0.000 0.000 0 1
#> SRR2061450 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061451 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061448 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061471 3 0.000 1.000 0.000 0.000 1 0
#> SRR2061449 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061447 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061446 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061444 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061443 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061442 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061441 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061445 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061439 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061440 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061437 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061438 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061435 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061436 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061433 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061434 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061432 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061431 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061429 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061430 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061428 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061426 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061427 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061425 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061424 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061423 2 0.000 0.981 0.000 1.000 0 0
#> SRR2061422 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061421 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061420 2 0.454 0.521 0.324 0.676 0 0
#> SRR2061419 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061418 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061417 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061415 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061416 1 0.000 1.000 1.000 0.000 0 0
#> SRR2061414 1 0.000 1.000 1.000 0.000 0 0
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061467 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061466 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061464 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061465 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061463 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061462 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061460 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061459 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061461 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061458 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061457 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061481 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061488 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061456 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061487 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061485 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061486 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061484 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061482 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061480 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061483 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061478 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061477 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061475 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061474 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061476 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061473 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061472 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061470 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061469 2 0.000 1.000 0.000 1 0 0 0.000
#> SRR2061455 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061454 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061452 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061453 4 0.000 1.000 0.000 0 0 1 0.000
#> SRR2061450 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061451 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061448 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061471 3 0.000 1.000 0.000 0 1 0 0.000
#> SRR2061449 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061447 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061446 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061444 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061443 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061442 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061441 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061445 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061439 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061440 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061437 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061438 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061435 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061436 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061433 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061434 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061432 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061431 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061429 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061430 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061428 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061426 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061427 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061425 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061424 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061423 5 0.000 0.993 0.000 0 0 0 1.000
#> SRR2061422 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061421 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061420 5 0.213 0.864 0.108 0 0 0 0.892
#> SRR2061419 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061418 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061417 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061415 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061416 1 0.000 1.000 1.000 0 0 0 0.000
#> SRR2061414 1 0.000 1.000 1.000 0 0 0 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061467 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061466 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061464 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061465 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061463 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061462 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061460 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061459 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061461 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061458 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061457 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061481 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061488 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061456 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061487 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061485 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061486 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061484 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061482 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061480 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061483 3 0.0000 1.000 0.000 0 1 0 0.000 0
#> SRR2061478 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061477 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061475 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061474 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061476 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061473 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061472 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061470 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061469 2 0.0000 1.000 0.000 1 0 0 0.000 0
#> SRR2061455 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061454 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061452 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061453 4 0.0000 1.000 0.000 0 0 1 0.000 0
#> SRR2061450 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061451 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061448 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061471 6 0.0000 1.000 0.000 0 0 0 0.000 1
#> SRR2061449 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061447 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061446 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061444 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061443 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061442 5 0.0146 0.995 0.004 0 0 0 0.996 0
#> SRR2061441 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061445 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061439 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061440 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061437 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061438 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061435 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061436 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061433 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061434 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061432 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061431 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061429 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061430 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061428 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061426 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061427 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061425 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061424 5 0.0146 0.995 0.004 0 0 0 0.996 0
#> SRR2061423 5 0.0000 0.999 0.000 0 0 0 1.000 0
#> SRR2061422 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061421 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061420 1 0.1267 0.928 0.940 0 0 0 0.060 0
#> SRR2061419 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061418 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061417 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061415 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061416 1 0.0000 0.997 1.000 0 0 0 0.000 0
#> SRR2061414 1 0.0000 0.997 1.000 0 0 0 0.000 0
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.
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.
MAD:NMF**
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"]
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 14886 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)

The plots are:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.989 0.995 0.504 0.496 0.496
#> 3 3 0.803 0.875 0.942 0.293 0.755 0.548
#> 4 4 0.798 0.795 0.908 0.106 0.787 0.493
#> 5 5 0.661 0.585 0.795 0.072 0.880 0.636
#> 6 6 0.739 0.641 0.827 0.058 0.890 0.607
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.0000 0.996 0.000 1.000
#> SRR2061467 2 0.0000 0.996 0.000 1.000
#> SRR2061466 2 0.0000 0.996 0.000 1.000
#> SRR2061464 2 0.0000 0.996 0.000 1.000
#> SRR2061465 2 0.0000 0.996 0.000 1.000
#> SRR2061463 2 0.0000 0.996 0.000 1.000
#> SRR2061462 2 0.0000 0.996 0.000 1.000
#> SRR2061460 1 0.0000 0.994 1.000 0.000
#> SRR2061459 1 0.0000 0.994 1.000 0.000
#> SRR2061461 1 0.0000 0.994 1.000 0.000
#> SRR2061458 1 0.0000 0.994 1.000 0.000
#> SRR2061457 1 0.0000 0.994 1.000 0.000
#> SRR2061481 2 0.0000 0.996 0.000 1.000
#> SRR2061488 2 0.0000 0.996 0.000 1.000
#> SRR2061456 1 0.0000 0.994 1.000 0.000
#> SRR2061487 2 0.0000 0.996 0.000 1.000
#> SRR2061485 2 0.0000 0.996 0.000 1.000
#> SRR2061486 2 0.0000 0.996 0.000 1.000
#> SRR2061484 2 0.0000 0.996 0.000 1.000
#> SRR2061482 2 0.0376 0.992 0.004 0.996
#> SRR2061480 2 0.0000 0.996 0.000 1.000
#> SRR2061483 2 0.0000 0.996 0.000 1.000
#> SRR2061478 1 0.0000 0.994 1.000 0.000
#> SRR2061477 1 0.0000 0.994 1.000 0.000
#> SRR2061475 1 0.0000 0.994 1.000 0.000
#> SRR2061474 1 0.0000 0.994 1.000 0.000
#> SRR2061476 1 0.0000 0.994 1.000 0.000
#> SRR2061473 1 0.0000 0.994 1.000 0.000
#> SRR2061472 1 0.0000 0.994 1.000 0.000
#> SRR2061470 2 0.0000 0.996 0.000 1.000
#> SRR2061469 2 0.0000 0.996 0.000 1.000
#> SRR2061455 1 0.0000 0.994 1.000 0.000
#> SRR2061454 1 0.0000 0.994 1.000 0.000
#> SRR2061452 1 0.0000 0.994 1.000 0.000
#> SRR2061453 1 0.0000 0.994 1.000 0.000
#> SRR2061450 1 0.0000 0.994 1.000 0.000
#> SRR2061451 1 0.0000 0.994 1.000 0.000
#> SRR2061448 2 0.0000 0.996 0.000 1.000
#> SRR2061471 1 0.0000 0.994 1.000 0.000
#> SRR2061449 2 0.0000 0.996 0.000 1.000
#> SRR2061447 2 0.0000 0.996 0.000 1.000
#> SRR2061446 2 0.0000 0.996 0.000 1.000
#> SRR2061444 2 0.0000 0.996 0.000 1.000
#> SRR2061443 2 0.5294 0.863 0.120 0.880
#> SRR2061442 1 0.1184 0.979 0.984 0.016
#> SRR2061441 2 0.1184 0.981 0.016 0.984
#> SRR2061445 2 0.0000 0.996 0.000 1.000
#> SRR2061439 1 0.0000 0.994 1.000 0.000
#> SRR2061440 1 0.0000 0.994 1.000 0.000
#> SRR2061437 1 0.0000 0.994 1.000 0.000
#> SRR2061438 1 0.0000 0.994 1.000 0.000
#> SRR2061435 1 0.0000 0.994 1.000 0.000
#> SRR2061436 1 0.0000 0.994 1.000 0.000
#> SRR2061433 1 0.0000 0.994 1.000 0.000
#> SRR2061434 1 0.0000 0.994 1.000 0.000
#> SRR2061432 1 0.0000 0.994 1.000 0.000
#> SRR2061431 2 0.0000 0.996 0.000 1.000
#> SRR2061429 2 0.0000 0.996 0.000 1.000
#> SRR2061430 2 0.0000 0.996 0.000 1.000
#> SRR2061428 2 0.0000 0.996 0.000 1.000
#> SRR2061426 2 0.0000 0.996 0.000 1.000
#> SRR2061427 2 0.0000 0.996 0.000 1.000
#> SRR2061425 2 0.0000 0.996 0.000 1.000
#> SRR2061424 1 0.7528 0.723 0.784 0.216
#> SRR2061423 2 0.0000 0.996 0.000 1.000
#> SRR2061422 1 0.0000 0.994 1.000 0.000
#> SRR2061421 1 0.0000 0.994 1.000 0.000
#> SRR2061420 1 0.0000 0.994 1.000 0.000
#> SRR2061419 1 0.0000 0.994 1.000 0.000
#> SRR2061418 1 0.0000 0.994 1.000 0.000
#> SRR2061417 1 0.0000 0.994 1.000 0.000
#> SRR2061415 1 0.0000 0.994 1.000 0.000
#> SRR2061416 1 0.0000 0.994 1.000 0.000
#> SRR2061414 1 0.0000 0.994 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061464 2 0.0237 0.939 0.000 0.996 0.004
#> SRR2061465 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061463 2 0.0237 0.939 0.000 0.996 0.004
#> SRR2061462 2 0.0237 0.939 0.000 0.996 0.004
#> SRR2061460 3 0.5591 0.660 0.304 0.000 0.696
#> SRR2061459 3 0.5216 0.722 0.260 0.000 0.740
#> SRR2061461 1 0.6045 0.278 0.620 0.000 0.380
#> SRR2061458 1 0.5988 0.315 0.632 0.000 0.368
#> SRR2061457 3 0.5431 0.692 0.284 0.000 0.716
#> SRR2061481 3 0.0237 0.884 0.000 0.004 0.996
#> SRR2061488 2 0.0892 0.932 0.000 0.980 0.020
#> SRR2061456 3 0.4702 0.765 0.212 0.000 0.788
#> SRR2061487 2 0.0747 0.934 0.000 0.984 0.016
#> SRR2061485 2 0.0892 0.932 0.000 0.980 0.020
#> SRR2061486 2 0.0592 0.936 0.000 0.988 0.012
#> SRR2061484 2 0.0592 0.936 0.000 0.988 0.012
#> SRR2061482 3 0.0237 0.884 0.000 0.004 0.996
#> SRR2061480 3 0.0237 0.884 0.000 0.004 0.996
#> SRR2061483 2 0.0592 0.936 0.000 0.988 0.012
#> SRR2061478 3 0.0000 0.885 0.000 0.000 1.000
#> SRR2061477 3 0.0000 0.885 0.000 0.000 1.000
#> SRR2061475 3 0.0000 0.885 0.000 0.000 1.000
#> SRR2061474 3 0.0000 0.885 0.000 0.000 1.000
#> SRR2061476 3 0.0000 0.885 0.000 0.000 1.000
#> SRR2061473 3 0.0000 0.885 0.000 0.000 1.000
#> SRR2061472 3 0.0000 0.885 0.000 0.000 1.000
#> SRR2061470 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061455 1 0.5968 0.326 0.636 0.000 0.364
#> SRR2061454 3 0.5291 0.713 0.268 0.000 0.732
#> SRR2061452 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061453 3 0.5621 0.654 0.308 0.000 0.692
#> SRR2061450 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061448 2 0.4887 0.762 0.228 0.772 0.000
#> SRR2061471 3 0.0000 0.885 0.000 0.000 1.000
#> SRR2061449 2 0.4291 0.811 0.180 0.820 0.000
#> SRR2061447 2 0.4504 0.796 0.196 0.804 0.000
#> SRR2061446 2 0.4235 0.815 0.176 0.824 0.000
#> SRR2061444 2 0.5016 0.747 0.240 0.760 0.000
#> SRR2061443 1 0.0237 0.945 0.996 0.004 0.000
#> SRR2061442 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061441 1 0.0237 0.945 0.996 0.004 0.000
#> SRR2061445 2 0.5058 0.742 0.244 0.756 0.000
#> SRR2061439 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061440 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061437 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061438 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061435 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061431 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.940 0.000 1.000 0.000
#> SRR2061425 1 0.2066 0.886 0.940 0.060 0.000
#> SRR2061424 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061423 2 0.2165 0.898 0.064 0.936 0.000
#> SRR2061422 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061420 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061419 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061418 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061417 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061415 1 0.0424 0.942 0.992 0.000 0.008
#> SRR2061416 1 0.0000 0.949 1.000 0.000 0.000
#> SRR2061414 1 0.0000 0.949 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0592 0.831 0.000 0.984 0.000 0.016
#> SRR2061467 2 0.0921 0.830 0.000 0.972 0.000 0.028
#> SRR2061466 2 0.0921 0.830 0.000 0.972 0.000 0.028
#> SRR2061464 2 0.4888 0.301 0.000 0.588 0.000 0.412
#> SRR2061465 2 0.0817 0.831 0.000 0.976 0.000 0.024
#> SRR2061463 2 0.4933 0.256 0.000 0.568 0.000 0.432
#> SRR2061462 2 0.4985 0.158 0.000 0.532 0.000 0.468
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061481 3 0.0469 0.836 0.000 0.012 0.988 0.000
#> SRR2061488 3 0.4746 0.617 0.000 0.368 0.632 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061487 3 0.4776 0.607 0.000 0.376 0.624 0.000
#> SRR2061485 3 0.4697 0.628 0.000 0.356 0.644 0.000
#> SRR2061486 3 0.4761 0.612 0.000 0.372 0.628 0.000
#> SRR2061484 3 0.4790 0.601 0.000 0.380 0.620 0.000
#> SRR2061482 3 0.0469 0.836 0.000 0.012 0.988 0.000
#> SRR2061480 3 0.0469 0.836 0.000 0.012 0.988 0.000
#> SRR2061483 3 0.4790 0.601 0.000 0.380 0.620 0.000
#> SRR2061478 3 0.0000 0.837 0.000 0.000 1.000 0.000
#> SRR2061477 3 0.0000 0.837 0.000 0.000 1.000 0.000
#> SRR2061475 3 0.0000 0.837 0.000 0.000 1.000 0.000
#> SRR2061474 3 0.0000 0.837 0.000 0.000 1.000 0.000
#> SRR2061476 3 0.0000 0.837 0.000 0.000 1.000 0.000
#> SRR2061473 3 0.0000 0.837 0.000 0.000 1.000 0.000
#> SRR2061472 3 0.0000 0.837 0.000 0.000 1.000 0.000
#> SRR2061470 2 0.1022 0.829 0.000 0.968 0.000 0.032
#> SRR2061469 2 0.0817 0.831 0.000 0.976 0.000 0.024
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061452 1 0.0188 0.912 0.996 0.000 0.000 0.004
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061450 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061448 1 0.4277 0.601 0.720 0.280 0.000 0.000
#> SRR2061471 3 0.0000 0.837 0.000 0.000 1.000 0.000
#> SRR2061449 1 0.4994 0.128 0.520 0.480 0.000 0.000
#> SRR2061447 2 0.4877 0.191 0.408 0.592 0.000 0.000
#> SRR2061446 1 0.4522 0.530 0.680 0.320 0.000 0.000
#> SRR2061444 1 0.4877 0.343 0.592 0.408 0.000 0.000
#> SRR2061443 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061442 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061441 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061445 1 0.2973 0.785 0.856 0.144 0.000 0.000
#> SRR2061439 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.2216 0.855 0.908 0.000 0.000 0.092
#> SRR2061436 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0336 0.910 0.992 0.000 0.000 0.008
#> SRR2061432 1 0.3024 0.804 0.852 0.000 0.000 0.148
#> SRR2061431 2 0.0000 0.828 0.000 1.000 0.000 0.000
#> SRR2061429 2 0.0000 0.828 0.000 1.000 0.000 0.000
#> SRR2061430 2 0.0000 0.828 0.000 1.000 0.000 0.000
#> SRR2061428 2 0.0000 0.828 0.000 1.000 0.000 0.000
#> SRR2061426 2 0.0000 0.828 0.000 1.000 0.000 0.000
#> SRR2061427 2 0.0188 0.826 0.004 0.996 0.000 0.000
#> SRR2061425 1 0.0188 0.912 0.996 0.004 0.000 0.000
#> SRR2061424 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061423 2 0.4164 0.573 0.264 0.736 0.000 0.000
#> SRR2061422 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061421 1 0.0188 0.912 0.996 0.000 0.004 0.000
#> SRR2061420 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061419 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.1389 0.886 0.952 0.000 0.000 0.048
#> SRR2061415 1 0.4546 0.658 0.732 0.000 0.012 0.256
#> SRR2061416 1 0.0000 0.914 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.3610 0.745 0.800 0.000 0.000 0.200
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.1892 0.71419 0.000 0.916 0.000 0.080 0.004
#> SRR2061467 2 0.4894 0.25221 0.000 0.520 0.000 0.456 0.024
#> SRR2061466 2 0.4904 0.21805 0.000 0.504 0.000 0.472 0.024
#> SRR2061464 4 0.4342 0.54802 0.000 0.040 0.000 0.728 0.232
#> SRR2061465 2 0.4906 0.18249 0.000 0.496 0.000 0.480 0.024
#> SRR2061463 4 0.4192 0.55555 0.000 0.032 0.000 0.736 0.232
#> SRR2061462 4 0.4113 0.55923 0.000 0.028 0.000 0.740 0.232
#> SRR2061460 4 0.0000 0.73534 0.000 0.000 0.000 1.000 0.000
#> SRR2061459 4 0.1851 0.75552 0.000 0.000 0.000 0.912 0.088
#> SRR2061461 4 0.0609 0.72574 0.000 0.000 0.000 0.980 0.020
#> SRR2061458 4 0.2690 0.76147 0.000 0.000 0.000 0.844 0.156
#> SRR2061457 4 0.3109 0.75363 0.000 0.000 0.000 0.800 0.200
#> SRR2061481 3 0.3177 0.75356 0.000 0.000 0.792 0.000 0.208
#> SRR2061488 2 0.4235 0.38922 0.000 0.656 0.336 0.000 0.008
#> SRR2061456 4 0.3508 0.72112 0.000 0.000 0.000 0.748 0.252
#> SRR2061487 2 0.4147 0.41982 0.000 0.676 0.316 0.000 0.008
#> SRR2061485 3 0.4199 0.70733 0.000 0.160 0.772 0.000 0.068
#> SRR2061486 2 0.4415 0.28558 0.000 0.604 0.388 0.000 0.008
#> SRR2061484 3 0.4226 0.68787 0.000 0.176 0.764 0.000 0.060
#> SRR2061482 3 0.3210 0.75101 0.000 0.000 0.788 0.000 0.212
#> SRR2061480 3 0.3177 0.75283 0.000 0.000 0.792 0.000 0.208
#> SRR2061483 3 0.4334 0.73837 0.000 0.080 0.764 0.000 0.156
#> SRR2061478 3 0.0000 0.80283 0.000 0.000 1.000 0.000 0.000
#> SRR2061477 3 0.0162 0.80280 0.000 0.000 0.996 0.000 0.004
#> SRR2061475 3 0.2280 0.79055 0.000 0.000 0.880 0.000 0.120
#> SRR2061474 3 0.2179 0.79421 0.000 0.000 0.888 0.000 0.112
#> SRR2061476 3 0.2561 0.78250 0.000 0.000 0.856 0.000 0.144
#> SRR2061473 3 0.3957 0.68095 0.000 0.000 0.712 0.008 0.280
#> SRR2061472 3 0.3671 0.72044 0.000 0.000 0.756 0.008 0.236
#> SRR2061470 2 0.1892 0.71419 0.000 0.916 0.000 0.080 0.004
#> SRR2061469 2 0.1892 0.71419 0.000 0.916 0.000 0.080 0.004
#> SRR2061455 4 0.3143 0.75236 0.000 0.000 0.000 0.796 0.204
#> SRR2061454 4 0.3424 0.73067 0.000 0.000 0.000 0.760 0.240
#> SRR2061452 1 0.3942 0.46446 0.748 0.000 0.000 0.020 0.232
#> SRR2061453 4 0.3612 0.70548 0.000 0.000 0.000 0.732 0.268
#> SRR2061450 1 0.2286 0.65751 0.888 0.000 0.000 0.004 0.108
#> SRR2061451 1 0.3093 0.58778 0.824 0.000 0.000 0.008 0.168
#> SRR2061448 2 0.4350 0.28702 0.408 0.588 0.000 0.000 0.004
#> SRR2061471 3 0.3210 0.75127 0.000 0.000 0.788 0.000 0.212
#> SRR2061449 2 0.3579 0.54875 0.240 0.756 0.000 0.000 0.004
#> SRR2061447 2 0.3231 0.59759 0.196 0.800 0.000 0.000 0.004
#> SRR2061446 1 0.4101 0.24726 0.664 0.332 0.000 0.000 0.004
#> SRR2061444 2 0.4251 0.31275 0.372 0.624 0.000 0.000 0.004
#> SRR2061443 1 0.4402 0.32299 0.636 0.012 0.000 0.000 0.352
#> SRR2061442 1 0.3983 0.36774 0.660 0.000 0.000 0.000 0.340
#> SRR2061441 1 0.4348 0.38396 0.668 0.016 0.000 0.000 0.316
#> SRR2061445 1 0.1892 0.66170 0.916 0.080 0.000 0.000 0.004
#> SRR2061439 1 0.0703 0.71884 0.976 0.000 0.000 0.000 0.024
#> SRR2061440 1 0.0162 0.71937 0.996 0.000 0.000 0.000 0.004
#> SRR2061437 1 0.0000 0.72025 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0404 0.71975 0.988 0.000 0.000 0.000 0.012
#> SRR2061435 1 0.4038 0.58680 0.792 0.000 0.000 0.128 0.080
#> SRR2061436 1 0.1628 0.70232 0.936 0.000 0.000 0.008 0.056
#> SRR2061433 1 0.0404 0.71906 0.988 0.000 0.000 0.000 0.012
#> SRR2061434 1 0.3536 0.61280 0.832 0.000 0.000 0.084 0.084
#> SRR2061432 1 0.6236 -0.03704 0.544 0.000 0.000 0.208 0.248
#> SRR2061431 2 0.0000 0.71951 0.000 1.000 0.000 0.000 0.000
#> SRR2061429 2 0.1522 0.72016 0.012 0.944 0.000 0.044 0.000
#> SRR2061430 2 0.0451 0.71911 0.008 0.988 0.000 0.000 0.004
#> SRR2061428 2 0.0290 0.71886 0.000 0.992 0.000 0.000 0.008
#> SRR2061426 2 0.0000 0.71951 0.000 1.000 0.000 0.000 0.000
#> SRR2061427 2 0.0290 0.71886 0.000 0.992 0.000 0.000 0.008
#> SRR2061425 1 0.5579 0.00259 0.508 0.072 0.000 0.000 0.420
#> SRR2061424 1 0.4791 0.05725 0.524 0.012 0.004 0.000 0.460
#> SRR2061423 5 0.7910 0.06432 0.280 0.120 0.000 0.168 0.432
#> SRR2061422 1 0.1041 0.71700 0.964 0.000 0.000 0.004 0.032
#> SRR2061421 1 0.2136 0.68307 0.904 0.000 0.000 0.008 0.088
#> SRR2061420 1 0.2891 0.61170 0.824 0.000 0.000 0.000 0.176
#> SRR2061419 1 0.0000 0.72025 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.72025 1.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.2761 0.66453 0.872 0.000 0.000 0.104 0.024
#> SRR2061415 5 0.7379 0.04740 0.328 0.000 0.040 0.212 0.420
#> SRR2061416 1 0.0000 0.72025 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.5251 0.37268 0.680 0.000 0.000 0.184 0.136
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.3002 0.7398 0.000 0.836 0.000 0.136 0.008 0.020
#> SRR2061467 4 0.4836 0.2077 0.000 0.416 0.000 0.536 0.008 0.040
#> SRR2061466 4 0.4760 0.1478 0.000 0.436 0.000 0.520 0.004 0.040
#> SRR2061464 4 0.4683 0.6530 0.000 0.060 0.000 0.700 0.216 0.024
#> SRR2061465 2 0.4779 -0.0880 0.000 0.488 0.000 0.468 0.004 0.040
#> SRR2061463 4 0.3005 0.8156 0.000 0.052 0.000 0.864 0.060 0.024
#> SRR2061462 4 0.3543 0.7861 0.000 0.044 0.000 0.820 0.112 0.024
#> SRR2061460 4 0.0603 0.8560 0.000 0.000 0.000 0.980 0.004 0.016
#> SRR2061459 4 0.0405 0.8600 0.000 0.000 0.004 0.988 0.000 0.008
#> SRR2061461 4 0.0692 0.8546 0.000 0.000 0.000 0.976 0.004 0.020
#> SRR2061458 4 0.0622 0.8579 0.000 0.000 0.008 0.980 0.000 0.012
#> SRR2061457 4 0.0405 0.8591 0.000 0.000 0.008 0.988 0.000 0.004
#> SRR2061481 3 0.4422 0.6797 0.000 0.000 0.680 0.000 0.252 0.068
#> SRR2061488 3 0.5208 0.6413 0.000 0.248 0.624 0.000 0.008 0.120
#> SRR2061456 4 0.0806 0.8563 0.000 0.000 0.008 0.972 0.000 0.020
#> SRR2061487 3 0.5323 0.6017 0.000 0.272 0.600 0.000 0.008 0.120
#> SRR2061485 3 0.2976 0.8278 0.000 0.012 0.844 0.000 0.020 0.124
#> SRR2061486 3 0.3794 0.8095 0.000 0.080 0.792 0.000 0.008 0.120
#> SRR2061484 3 0.2982 0.8274 0.000 0.016 0.844 0.000 0.016 0.124
#> SRR2061482 3 0.4646 0.5774 0.000 0.000 0.616 0.000 0.324 0.060
#> SRR2061480 3 0.4570 0.6223 0.000 0.000 0.644 0.000 0.292 0.064
#> SRR2061483 3 0.2957 0.8273 0.000 0.004 0.844 0.000 0.032 0.120
#> SRR2061478 3 0.0146 0.8452 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR2061477 3 0.0146 0.8452 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR2061475 3 0.0692 0.8449 0.000 0.000 0.976 0.020 0.000 0.004
#> SRR2061474 3 0.0806 0.8445 0.000 0.000 0.972 0.020 0.000 0.008
#> SRR2061476 3 0.0692 0.8449 0.000 0.000 0.976 0.020 0.000 0.004
#> SRR2061473 3 0.0993 0.8416 0.000 0.000 0.964 0.024 0.000 0.012
#> SRR2061472 3 0.0777 0.8443 0.000 0.000 0.972 0.024 0.000 0.004
#> SRR2061470 2 0.3653 0.6314 0.000 0.748 0.000 0.228 0.004 0.020
#> SRR2061469 2 0.2652 0.7625 0.000 0.868 0.000 0.104 0.008 0.020
#> SRR2061455 4 0.0520 0.8591 0.000 0.000 0.008 0.984 0.000 0.008
#> SRR2061454 4 0.0622 0.8580 0.000 0.000 0.008 0.980 0.000 0.012
#> SRR2061452 1 0.4026 0.1490 0.612 0.000 0.000 0.012 0.000 0.376
#> SRR2061453 4 0.1049 0.8517 0.000 0.000 0.008 0.960 0.000 0.032
#> SRR2061450 1 0.3470 0.4205 0.740 0.000 0.000 0.012 0.000 0.248
#> SRR2061451 1 0.3979 0.2150 0.628 0.000 0.000 0.012 0.000 0.360
#> SRR2061448 2 0.3560 0.5976 0.256 0.732 0.000 0.000 0.008 0.004
#> SRR2061471 3 0.0951 0.8434 0.000 0.000 0.968 0.020 0.004 0.008
#> SRR2061449 2 0.3121 0.6856 0.192 0.796 0.000 0.000 0.008 0.004
#> SRR2061447 2 0.2278 0.7499 0.128 0.868 0.000 0.000 0.004 0.000
#> SRR2061446 1 0.4760 0.1694 0.588 0.364 0.000 0.000 0.036 0.012
#> SRR2061444 2 0.3965 0.3898 0.376 0.616 0.000 0.000 0.004 0.004
#> SRR2061443 5 0.2039 0.8771 0.076 0.020 0.000 0.000 0.904 0.000
#> SRR2061442 5 0.1075 0.8790 0.048 0.000 0.000 0.000 0.952 0.000
#> SRR2061441 5 0.2333 0.8621 0.092 0.024 0.000 0.000 0.884 0.000
#> SRR2061445 1 0.3103 0.5278 0.848 0.100 0.000 0.000 0.036 0.016
#> SRR2061439 1 0.0603 0.6132 0.980 0.000 0.000 0.000 0.016 0.004
#> SRR2061440 1 0.1152 0.6053 0.952 0.000 0.000 0.000 0.044 0.004
#> SRR2061437 1 0.0146 0.6164 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061438 1 0.1367 0.6173 0.944 0.000 0.000 0.000 0.012 0.044
#> SRR2061435 1 0.3310 0.5925 0.816 0.000 0.000 0.020 0.016 0.148
#> SRR2061436 1 0.4251 -0.0894 0.520 0.000 0.004 0.004 0.004 0.468
#> SRR2061433 1 0.3961 0.0205 0.556 0.000 0.004 0.000 0.000 0.440
#> SRR2061434 1 0.3753 0.4377 0.696 0.004 0.000 0.008 0.000 0.292
#> SRR2061432 6 0.4294 0.6413 0.280 0.000 0.000 0.048 0.000 0.672
#> SRR2061431 2 0.0291 0.8045 0.000 0.992 0.000 0.000 0.004 0.004
#> SRR2061429 2 0.0260 0.8040 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR2061430 2 0.0146 0.8045 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR2061428 2 0.0858 0.8014 0.000 0.968 0.000 0.000 0.028 0.004
#> SRR2061426 2 0.0692 0.8035 0.000 0.976 0.000 0.000 0.020 0.004
#> SRR2061427 2 0.1829 0.7895 0.008 0.928 0.000 0.000 0.028 0.036
#> SRR2061425 5 0.1616 0.8827 0.048 0.020 0.000 0.000 0.932 0.000
#> SRR2061424 5 0.0790 0.8683 0.032 0.000 0.000 0.000 0.968 0.000
#> SRR2061423 5 0.2469 0.8659 0.044 0.048 0.000 0.004 0.896 0.008
#> SRR2061422 1 0.2165 0.5605 0.884 0.000 0.000 0.000 0.108 0.008
#> SRR2061421 1 0.4174 0.4655 0.732 0.000 0.000 0.000 0.084 0.184
#> SRR2061420 5 0.4037 0.3620 0.380 0.000 0.000 0.000 0.608 0.012
#> SRR2061419 1 0.2994 0.5108 0.788 0.000 0.000 0.000 0.004 0.208
#> SRR2061418 1 0.2257 0.5961 0.876 0.000 0.000 0.000 0.008 0.116
#> SRR2061417 1 0.4087 0.3661 0.692 0.000 0.000 0.028 0.004 0.276
#> SRR2061415 6 0.4454 0.6696 0.220 0.000 0.044 0.016 0.004 0.716
#> SRR2061416 1 0.2260 0.5810 0.860 0.000 0.000 0.000 0.000 0.140
#> SRR2061414 1 0.4825 -0.1861 0.504 0.000 0.004 0.044 0.000 0.448
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.
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.
ATC:hclust*
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.566 0.772 0.907 0.4753 0.496 0.496
#> 3 3 0.757 0.838 0.911 0.3712 0.742 0.524
#> 4 4 0.943 0.896 0.955 0.1102 0.919 0.763
#> 5 5 0.840 0.770 0.865 0.0686 0.980 0.927
#> 6 6 0.840 0.705 0.801 0.0384 0.902 0.626
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 0.839 0.000 1.000
#> SRR2061467 2 0.000 0.839 0.000 1.000
#> SRR2061466 2 0.000 0.839 0.000 1.000
#> SRR2061464 2 0.981 0.356 0.420 0.580
#> SRR2061465 2 0.000 0.839 0.000 1.000
#> SRR2061463 2 0.981 0.356 0.420 0.580
#> SRR2061462 2 0.981 0.356 0.420 0.580
#> SRR2061460 1 0.563 0.829 0.868 0.132
#> SRR2061459 1 0.563 0.829 0.868 0.132
#> SRR2061461 1 0.563 0.829 0.868 0.132
#> SRR2061458 1 0.563 0.829 0.868 0.132
#> SRR2061457 1 0.563 0.829 0.868 0.132
#> SRR2061481 2 0.994 0.274 0.456 0.544
#> SRR2061488 2 0.000 0.839 0.000 1.000
#> SRR2061456 1 0.563 0.829 0.868 0.132
#> SRR2061487 2 0.000 0.839 0.000 1.000
#> SRR2061485 2 0.000 0.839 0.000 1.000
#> SRR2061486 2 0.000 0.839 0.000 1.000
#> SRR2061484 2 0.000 0.839 0.000 1.000
#> SRR2061482 2 0.994 0.274 0.456 0.544
#> SRR2061480 2 0.994 0.274 0.456 0.544
#> SRR2061483 2 0.000 0.839 0.000 1.000
#> SRR2061478 1 0.000 0.922 1.000 0.000
#> SRR2061477 1 0.000 0.922 1.000 0.000
#> SRR2061475 1 0.000 0.922 1.000 0.000
#> SRR2061474 1 0.000 0.922 1.000 0.000
#> SRR2061476 1 0.000 0.922 1.000 0.000
#> SRR2061473 1 0.000 0.922 1.000 0.000
#> SRR2061472 1 0.000 0.922 1.000 0.000
#> SRR2061470 2 0.000 0.839 0.000 1.000
#> SRR2061469 2 0.000 0.839 0.000 1.000
#> SRR2061455 1 0.563 0.829 0.868 0.132
#> SRR2061454 1 0.563 0.829 0.868 0.132
#> SRR2061452 1 0.000 0.922 1.000 0.000
#> SRR2061453 1 0.563 0.829 0.868 0.132
#> SRR2061450 1 0.000 0.922 1.000 0.000
#> SRR2061451 1 0.000 0.922 1.000 0.000
#> SRR2061448 2 0.000 0.839 0.000 1.000
#> SRR2061471 1 0.000 0.922 1.000 0.000
#> SRR2061449 2 0.000 0.839 0.000 1.000
#> SRR2061447 2 0.000 0.839 0.000 1.000
#> SRR2061446 2 0.000 0.839 0.000 1.000
#> SRR2061444 2 0.000 0.839 0.000 1.000
#> SRR2061443 2 0.994 0.274 0.456 0.544
#> SRR2061442 1 0.975 0.224 0.592 0.408
#> SRR2061441 2 0.994 0.274 0.456 0.544
#> SRR2061445 2 0.000 0.839 0.000 1.000
#> SRR2061439 1 0.000 0.922 1.000 0.000
#> SRR2061440 1 0.000 0.922 1.000 0.000
#> SRR2061437 1 0.000 0.922 1.000 0.000
#> SRR2061438 1 0.000 0.922 1.000 0.000
#> SRR2061435 1 0.000 0.922 1.000 0.000
#> SRR2061436 1 0.000 0.922 1.000 0.000
#> SRR2061433 1 0.000 0.922 1.000 0.000
#> SRR2061434 1 0.000 0.922 1.000 0.000
#> SRR2061432 1 0.000 0.922 1.000 0.000
#> SRR2061431 2 0.000 0.839 0.000 1.000
#> SRR2061429 2 0.000 0.839 0.000 1.000
#> SRR2061430 2 0.000 0.839 0.000 1.000
#> SRR2061428 2 0.000 0.839 0.000 1.000
#> SRR2061426 2 0.000 0.839 0.000 1.000
#> SRR2061427 2 0.000 0.839 0.000 1.000
#> SRR2061425 2 0.994 0.274 0.456 0.544
#> SRR2061424 1 0.975 0.224 0.592 0.408
#> SRR2061423 2 0.993 0.284 0.452 0.548
#> SRR2061422 1 0.000 0.922 1.000 0.000
#> SRR2061421 1 0.000 0.922 1.000 0.000
#> SRR2061420 1 0.975 0.224 0.592 0.408
#> SRR2061419 1 0.000 0.922 1.000 0.000
#> SRR2061418 1 0.000 0.922 1.000 0.000
#> SRR2061417 1 0.000 0.922 1.000 0.000
#> SRR2061415 1 0.000 0.922 1.000 0.000
#> SRR2061416 1 0.000 0.922 1.000 0.000
#> SRR2061414 1 0.000 0.922 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061464 3 0.7400 0.703 0.412 0.036 0.552
#> SRR2061465 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061463 3 0.7400 0.703 0.412 0.036 0.552
#> SRR2061462 3 0.7400 0.703 0.412 0.036 0.552
#> SRR2061460 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061459 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061461 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061458 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061457 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061481 3 0.6168 0.729 0.412 0.000 0.588
#> SRR2061488 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061456 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061487 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061485 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061486 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061484 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061482 3 0.6168 0.729 0.412 0.000 0.588
#> SRR2061480 3 0.6168 0.729 0.412 0.000 0.588
#> SRR2061483 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061478 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061477 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061475 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061474 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061476 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061473 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061472 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061470 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061455 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061454 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061452 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061453 3 0.0000 0.593 0.000 0.000 1.000
#> SRR2061450 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061451 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061448 2 0.6438 0.732 0.136 0.764 0.100
#> SRR2061471 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061449 2 0.6438 0.732 0.136 0.764 0.100
#> SRR2061447 2 0.6438 0.732 0.136 0.764 0.100
#> SRR2061446 2 0.8925 0.281 0.412 0.464 0.124
#> SRR2061444 2 0.8925 0.281 0.412 0.464 0.124
#> SRR2061443 3 0.6168 0.729 0.412 0.000 0.588
#> SRR2061442 3 0.5363 0.750 0.276 0.000 0.724
#> SRR2061441 3 0.6168 0.729 0.412 0.000 0.588
#> SRR2061445 2 0.8925 0.281 0.412 0.464 0.124
#> SRR2061439 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061440 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061437 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061438 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061435 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061436 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061433 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061434 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061432 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061431 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.899 0.000 1.000 0.000
#> SRR2061428 2 0.0892 0.892 0.020 0.980 0.000
#> SRR2061426 2 0.0892 0.892 0.020 0.980 0.000
#> SRR2061427 2 0.0892 0.892 0.020 0.980 0.000
#> SRR2061425 3 0.6168 0.729 0.412 0.000 0.588
#> SRR2061424 3 0.5363 0.750 0.276 0.000 0.724
#> SRR2061423 3 0.6386 0.727 0.412 0.004 0.584
#> SRR2061422 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061421 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061420 3 0.5363 0.750 0.276 0.000 0.724
#> SRR2061419 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061418 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061417 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061415 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061416 1 0.6168 1.000 0.588 0.000 0.412
#> SRR2061414 1 0.6168 1.000 0.588 0.000 0.412
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061467 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061466 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061464 3 0.0000 0.798 0.000 0.000 1.000 0.000
#> SRR2061465 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061463 3 0.0000 0.798 0.000 0.000 1.000 0.000
#> SRR2061462 3 0.0000 0.798 0.000 0.000 1.000 0.000
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061481 3 0.1118 0.808 0.000 0.000 0.964 0.036
#> SRR2061488 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061487 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061485 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061486 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061484 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061482 3 0.1118 0.808 0.000 0.000 0.964 0.036
#> SRR2061480 3 0.1118 0.808 0.000 0.000 0.964 0.036
#> SRR2061483 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061478 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061477 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061475 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061474 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061476 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061473 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061472 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061470 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061469 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061452 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061450 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061448 2 0.4222 0.646 0.000 0.728 0.272 0.000
#> SRR2061471 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061449 2 0.4222 0.646 0.000 0.728 0.272 0.000
#> SRR2061447 2 0.4222 0.646 0.000 0.728 0.272 0.000
#> SRR2061446 3 0.4925 0.196 0.000 0.428 0.572 0.000
#> SRR2061444 3 0.4925 0.196 0.000 0.428 0.572 0.000
#> SRR2061443 3 0.1118 0.808 0.000 0.000 0.964 0.036
#> SRR2061442 3 0.4356 0.547 0.000 0.000 0.708 0.292
#> SRR2061441 3 0.1118 0.808 0.000 0.000 0.964 0.036
#> SRR2061445 3 0.4925 0.196 0.000 0.428 0.572 0.000
#> SRR2061439 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.0188 0.996 0.996 0.000 0.000 0.004
#> SRR2061436 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0188 0.996 0.996 0.000 0.000 0.004
#> SRR2061432 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061429 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061430 2 0.0000 0.951 0.000 1.000 0.000 0.000
#> SRR2061428 2 0.0707 0.939 0.000 0.980 0.020 0.000
#> SRR2061426 2 0.0707 0.939 0.000 0.980 0.020 0.000
#> SRR2061427 2 0.0707 0.939 0.000 0.980 0.020 0.000
#> SRR2061425 3 0.1118 0.808 0.000 0.000 0.964 0.036
#> SRR2061424 3 0.4356 0.547 0.000 0.000 0.708 0.292
#> SRR2061423 3 0.1022 0.807 0.000 0.000 0.968 0.032
#> SRR2061422 1 0.0188 0.996 0.996 0.000 0.000 0.004
#> SRR2061421 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061420 3 0.4356 0.547 0.000 0.000 0.708 0.292
#> SRR2061419 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061415 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 1.000 1.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061467 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061466 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061464 5 0.0963 0.763 0.000 0.000 0.036 0.000 0.964
#> SRR2061465 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061463 5 0.0963 0.763 0.000 0.000 0.036 0.000 0.964
#> SRR2061462 5 0.0963 0.763 0.000 0.000 0.036 0.000 0.964
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061481 5 0.0000 0.776 0.000 0.000 0.000 0.000 1.000
#> SRR2061488 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061487 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061485 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061486 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061484 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061482 5 0.0000 0.776 0.000 0.000 0.000 0.000 1.000
#> SRR2061480 5 0.0000 0.776 0.000 0.000 0.000 0.000 1.000
#> SRR2061483 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061478 1 0.0290 0.814 0.992 0.000 0.008 0.000 0.000
#> SRR2061477 1 0.0290 0.814 0.992 0.000 0.008 0.000 0.000
#> SRR2061475 1 0.0290 0.814 0.992 0.000 0.008 0.000 0.000
#> SRR2061474 1 0.0290 0.814 0.992 0.000 0.008 0.000 0.000
#> SRR2061476 1 0.0290 0.814 0.992 0.000 0.008 0.000 0.000
#> SRR2061473 1 0.0290 0.814 0.992 0.000 0.008 0.000 0.000
#> SRR2061472 1 0.0290 0.814 0.992 0.000 0.008 0.000 0.000
#> SRR2061470 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061469 2 0.0000 0.880 0.000 1.000 0.000 0.000 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061452 1 0.3949 0.854 0.668 0.000 0.332 0.000 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR2061450 1 0.3949 0.854 0.668 0.000 0.332 0.000 0.000
#> SRR2061451 1 0.3949 0.854 0.668 0.000 0.332 0.000 0.000
#> SRR2061448 3 0.6417 1.000 0.000 0.280 0.504 0.000 0.216
#> SRR2061471 1 0.0290 0.814 0.992 0.000 0.008 0.000 0.000
#> SRR2061449 3 0.6417 1.000 0.000 0.280 0.504 0.000 0.216
#> SRR2061447 3 0.6417 1.000 0.000 0.280 0.504 0.000 0.216
#> SRR2061446 5 0.4304 -0.110 0.000 0.000 0.484 0.000 0.516
#> SRR2061444 5 0.4304 -0.110 0.000 0.000 0.484 0.000 0.516
#> SRR2061443 5 0.0000 0.776 0.000 0.000 0.000 0.000 1.000
#> SRR2061442 5 0.5440 0.556 0.000 0.000 0.156 0.184 0.660
#> SRR2061441 5 0.0000 0.776 0.000 0.000 0.000 0.000 1.000
#> SRR2061445 5 0.4304 -0.110 0.000 0.000 0.484 0.000 0.516
#> SRR2061439 1 0.3949 0.854 0.668 0.000 0.332 0.000 0.000
#> SRR2061440 1 0.3837 0.859 0.692 0.000 0.308 0.000 0.000
#> SRR2061437 1 0.3837 0.859 0.692 0.000 0.308 0.000 0.000
#> SRR2061438 1 0.3837 0.859 0.692 0.000 0.308 0.000 0.000
#> SRR2061435 1 0.0162 0.816 0.996 0.000 0.000 0.004 0.000
#> SRR2061436 1 0.3949 0.854 0.668 0.000 0.332 0.000 0.000
#> SRR2061433 1 0.3949 0.854 0.668 0.000 0.332 0.000 0.000
#> SRR2061434 1 0.0162 0.816 0.996 0.000 0.000 0.004 0.000
#> SRR2061432 1 0.3837 0.859 0.692 0.000 0.308 0.000 0.000
#> SRR2061431 2 0.0609 0.865 0.000 0.980 0.020 0.000 0.000
#> SRR2061429 2 0.0609 0.865 0.000 0.980 0.020 0.000 0.000
#> SRR2061430 2 0.0609 0.865 0.000 0.980 0.020 0.000 0.000
#> SRR2061428 2 0.4273 -0.231 0.000 0.552 0.448 0.000 0.000
#> SRR2061426 2 0.4273 -0.231 0.000 0.552 0.448 0.000 0.000
#> SRR2061427 2 0.4273 -0.231 0.000 0.552 0.448 0.000 0.000
#> SRR2061425 5 0.0000 0.776 0.000 0.000 0.000 0.000 1.000
#> SRR2061424 5 0.5440 0.556 0.000 0.000 0.156 0.184 0.660
#> SRR2061423 5 0.0162 0.775 0.000 0.000 0.004 0.000 0.996
#> SRR2061422 1 0.0162 0.816 0.996 0.000 0.000 0.004 0.000
#> SRR2061421 1 0.2561 0.839 0.856 0.000 0.144 0.000 0.000
#> SRR2061420 5 0.5440 0.556 0.000 0.000 0.156 0.184 0.660
#> SRR2061419 1 0.3837 0.859 0.692 0.000 0.308 0.000 0.000
#> SRR2061418 1 0.3949 0.854 0.668 0.000 0.332 0.000 0.000
#> SRR2061417 1 0.3837 0.859 0.692 0.000 0.308 0.000 0.000
#> SRR2061415 1 0.2561 0.839 0.856 0.000 0.144 0.000 0.000
#> SRR2061416 1 0.3837 0.859 0.692 0.000 0.308 0.000 0.000
#> SRR2061414 1 0.3837 0.859 0.692 0.000 0.308 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061467 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061466 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061464 2 0.3854 -0.369 0.000 0.536 0.000 0.000 0.464 0.000
#> SRR2061465 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061463 2 0.3854 -0.369 0.000 0.536 0.000 0.000 0.464 0.000
#> SRR2061462 2 0.3854 -0.369 0.000 0.536 0.000 0.000 0.464 0.000
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061481 5 0.3828 0.464 0.000 0.440 0.000 0.000 0.560 0.000
#> SRR2061488 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061487 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061485 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061486 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061484 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061482 5 0.3828 0.464 0.000 0.440 0.000 0.000 0.560 0.000
#> SRR2061480 5 0.3828 0.464 0.000 0.440 0.000 0.000 0.560 0.000
#> SRR2061483 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061478 6 0.3695 0.995 0.376 0.000 0.000 0.000 0.000 0.624
#> SRR2061477 6 0.3695 0.995 0.376 0.000 0.000 0.000 0.000 0.624
#> SRR2061475 6 0.3695 0.995 0.376 0.000 0.000 0.000 0.000 0.624
#> SRR2061474 6 0.3695 0.995 0.376 0.000 0.000 0.000 0.000 0.624
#> SRR2061476 6 0.3695 0.995 0.376 0.000 0.000 0.000 0.000 0.624
#> SRR2061473 6 0.3695 0.995 0.376 0.000 0.000 0.000 0.000 0.624
#> SRR2061472 6 0.3695 0.995 0.376 0.000 0.000 0.000 0.000 0.624
#> SRR2061470 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061469 3 0.0000 0.904 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061452 1 0.0146 0.869 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061450 1 0.0146 0.869 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061451 1 0.0146 0.869 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061448 2 0.3778 0.392 0.000 0.708 0.272 0.000 0.020 0.000
#> SRR2061471 6 0.3695 0.995 0.376 0.000 0.000 0.000 0.000 0.624
#> SRR2061449 2 0.3778 0.392 0.000 0.708 0.272 0.000 0.020 0.000
#> SRR2061447 2 0.3778 0.392 0.000 0.708 0.272 0.000 0.020 0.000
#> SRR2061446 2 0.0260 0.446 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR2061444 2 0.0260 0.446 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR2061443 5 0.3828 0.464 0.000 0.440 0.000 0.000 0.560 0.000
#> SRR2061442 5 0.5020 0.212 0.000 0.000 0.000 0.080 0.548 0.372
#> SRR2061441 5 0.3828 0.464 0.000 0.440 0.000 0.000 0.560 0.000
#> SRR2061445 2 0.0260 0.446 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR2061439 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061440 1 0.1204 0.874 0.944 0.000 0.000 0.000 0.000 0.056
#> SRR2061437 1 0.1204 0.874 0.944 0.000 0.000 0.000 0.000 0.056
#> SRR2061438 1 0.1204 0.874 0.944 0.000 0.000 0.000 0.000 0.056
#> SRR2061435 6 0.3841 0.987 0.380 0.000 0.000 0.004 0.000 0.616
#> SRR2061436 1 0.0146 0.869 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061433 1 0.0146 0.869 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061434 6 0.3841 0.987 0.380 0.000 0.000 0.004 0.000 0.616
#> SRR2061432 1 0.1204 0.874 0.944 0.000 0.000 0.000 0.000 0.056
#> SRR2061431 3 0.0806 0.890 0.000 0.008 0.972 0.000 0.020 0.000
#> SRR2061429 3 0.0806 0.890 0.000 0.008 0.972 0.000 0.020 0.000
#> SRR2061430 3 0.0806 0.890 0.000 0.008 0.972 0.000 0.020 0.000
#> SRR2061428 3 0.3847 0.309 0.000 0.456 0.544 0.000 0.000 0.000
#> SRR2061426 3 0.3847 0.309 0.000 0.456 0.544 0.000 0.000 0.000
#> SRR2061427 3 0.3847 0.309 0.000 0.456 0.544 0.000 0.000 0.000
#> SRR2061425 5 0.3828 0.464 0.000 0.440 0.000 0.000 0.560 0.000
#> SRR2061424 5 0.5020 0.212 0.000 0.000 0.000 0.080 0.548 0.372
#> SRR2061423 5 0.3838 0.449 0.000 0.448 0.000 0.000 0.552 0.000
#> SRR2061422 6 0.3841 0.987 0.380 0.000 0.000 0.004 0.000 0.616
#> SRR2061421 1 0.3647 -0.268 0.640 0.000 0.000 0.000 0.000 0.360
#> SRR2061420 5 0.5020 0.212 0.000 0.000 0.000 0.080 0.548 0.372
#> SRR2061419 1 0.1204 0.874 0.944 0.000 0.000 0.000 0.000 0.056
#> SRR2061418 1 0.0000 0.870 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.1204 0.874 0.944 0.000 0.000 0.000 0.000 0.056
#> SRR2061415 1 0.3647 -0.268 0.640 0.000 0.000 0.000 0.000 0.360
#> SRR2061416 1 0.1204 0.874 0.944 0.000 0.000 0.000 0.000 0.056
#> SRR2061414 1 0.1204 0.874 0.944 0.000 0.000 0.000 0.000 0.056
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
ATC:kmeans**
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"]
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 14886 rows and 74 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.989 0.996 0.5032 0.496 0.496
#> 3 3 0.647 0.748 0.873 0.2905 0.742 0.524
#> 4 4 0.692 0.758 0.830 0.1140 0.850 0.586
#> 5 5 0.687 0.845 0.815 0.0647 0.961 0.844
#> 6 6 0.744 0.779 0.773 0.0479 0.962 0.828
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 0.990 0.000 1.000
#> SRR2061467 2 0.000 0.990 0.000 1.000
#> SRR2061466 2 0.000 0.990 0.000 1.000
#> SRR2061464 2 0.000 0.990 0.000 1.000
#> SRR2061465 2 0.000 0.990 0.000 1.000
#> SRR2061463 2 0.000 0.990 0.000 1.000
#> SRR2061462 2 0.000 0.990 0.000 1.000
#> SRR2061460 1 0.000 1.000 1.000 0.000
#> SRR2061459 1 0.000 1.000 1.000 0.000
#> SRR2061461 1 0.000 1.000 1.000 0.000
#> SRR2061458 1 0.000 1.000 1.000 0.000
#> SRR2061457 1 0.000 1.000 1.000 0.000
#> SRR2061481 2 0.000 0.990 0.000 1.000
#> SRR2061488 2 0.000 0.990 0.000 1.000
#> SRR2061456 1 0.000 1.000 1.000 0.000
#> SRR2061487 2 0.000 0.990 0.000 1.000
#> SRR2061485 2 0.000 0.990 0.000 1.000
#> SRR2061486 2 0.000 0.990 0.000 1.000
#> SRR2061484 2 0.000 0.990 0.000 1.000
#> SRR2061482 2 0.000 0.990 0.000 1.000
#> SRR2061480 2 0.000 0.990 0.000 1.000
#> SRR2061483 2 0.000 0.990 0.000 1.000
#> SRR2061478 1 0.000 1.000 1.000 0.000
#> SRR2061477 1 0.000 1.000 1.000 0.000
#> SRR2061475 1 0.000 1.000 1.000 0.000
#> SRR2061474 1 0.000 1.000 1.000 0.000
#> SRR2061476 1 0.000 1.000 1.000 0.000
#> SRR2061473 1 0.000 1.000 1.000 0.000
#> SRR2061472 1 0.000 1.000 1.000 0.000
#> SRR2061470 2 0.000 0.990 0.000 1.000
#> SRR2061469 2 0.000 0.990 0.000 1.000
#> SRR2061455 1 0.000 1.000 1.000 0.000
#> SRR2061454 1 0.000 1.000 1.000 0.000
#> SRR2061452 1 0.000 1.000 1.000 0.000
#> SRR2061453 1 0.000 1.000 1.000 0.000
#> SRR2061450 1 0.000 1.000 1.000 0.000
#> SRR2061451 1 0.000 1.000 1.000 0.000
#> SRR2061448 2 0.000 0.990 0.000 1.000
#> SRR2061471 1 0.000 1.000 1.000 0.000
#> SRR2061449 2 0.000 0.990 0.000 1.000
#> SRR2061447 2 0.000 0.990 0.000 1.000
#> SRR2061446 2 0.000 0.990 0.000 1.000
#> SRR2061444 2 0.000 0.990 0.000 1.000
#> SRR2061443 2 0.913 0.512 0.328 0.672
#> SRR2061442 1 0.000 1.000 1.000 0.000
#> SRR2061441 2 0.000 0.990 0.000 1.000
#> SRR2061445 2 0.000 0.990 0.000 1.000
#> SRR2061439 1 0.000 1.000 1.000 0.000
#> SRR2061440 1 0.000 1.000 1.000 0.000
#> SRR2061437 1 0.000 1.000 1.000 0.000
#> SRR2061438 1 0.000 1.000 1.000 0.000
#> SRR2061435 1 0.000 1.000 1.000 0.000
#> SRR2061436 1 0.000 1.000 1.000 0.000
#> SRR2061433 1 0.000 1.000 1.000 0.000
#> SRR2061434 1 0.000 1.000 1.000 0.000
#> SRR2061432 1 0.000 1.000 1.000 0.000
#> SRR2061431 2 0.000 0.990 0.000 1.000
#> SRR2061429 2 0.000 0.990 0.000 1.000
#> SRR2061430 2 0.000 0.990 0.000 1.000
#> SRR2061428 2 0.000 0.990 0.000 1.000
#> SRR2061426 2 0.000 0.990 0.000 1.000
#> SRR2061427 2 0.000 0.990 0.000 1.000
#> SRR2061425 2 0.000 0.990 0.000 1.000
#> SRR2061424 1 0.000 1.000 1.000 0.000
#> SRR2061423 2 0.000 0.990 0.000 1.000
#> SRR2061422 1 0.000 1.000 1.000 0.000
#> SRR2061421 1 0.000 1.000 1.000 0.000
#> SRR2061420 1 0.000 1.000 1.000 0.000
#> SRR2061419 1 0.000 1.000 1.000 0.000
#> SRR2061418 1 0.000 1.000 1.000 0.000
#> SRR2061417 1 0.000 1.000 1.000 0.000
#> SRR2061415 1 0.000 1.000 1.000 0.000
#> SRR2061416 1 0.000 1.000 1.000 0.000
#> SRR2061414 1 0.000 1.000 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0237 0.9250 0.000 0.996 0.004
#> SRR2061467 2 0.0237 0.9250 0.000 0.996 0.004
#> SRR2061466 2 0.0237 0.9250 0.000 0.996 0.004
#> SRR2061464 3 0.6204 0.0234 0.000 0.424 0.576
#> SRR2061465 2 0.0237 0.9250 0.000 0.996 0.004
#> SRR2061463 3 0.5760 0.3029 0.000 0.328 0.672
#> SRR2061462 3 0.4555 0.5303 0.000 0.200 0.800
#> SRR2061460 3 0.6302 0.2122 0.480 0.000 0.520
#> SRR2061459 3 0.6302 0.2122 0.480 0.000 0.520
#> SRR2061461 3 0.2356 0.6343 0.072 0.000 0.928
#> SRR2061458 3 0.6302 0.2122 0.480 0.000 0.520
#> SRR2061457 3 0.6302 0.2122 0.480 0.000 0.520
#> SRR2061481 3 0.3192 0.5933 0.000 0.112 0.888
#> SRR2061488 2 0.1163 0.9167 0.000 0.972 0.028
#> SRR2061456 3 0.6302 0.2122 0.480 0.000 0.520
#> SRR2061487 2 0.1163 0.9167 0.000 0.972 0.028
#> SRR2061485 2 0.1163 0.9167 0.000 0.972 0.028
#> SRR2061486 2 0.1163 0.9167 0.000 0.972 0.028
#> SRR2061484 2 0.1163 0.9167 0.000 0.972 0.028
#> SRR2061482 3 0.3192 0.5933 0.000 0.112 0.888
#> SRR2061480 3 0.3192 0.5933 0.000 0.112 0.888
#> SRR2061483 2 0.1163 0.9167 0.000 0.972 0.028
#> SRR2061478 1 0.4002 0.8458 0.840 0.000 0.160
#> SRR2061477 1 0.4002 0.8458 0.840 0.000 0.160
#> SRR2061475 1 0.4002 0.8458 0.840 0.000 0.160
#> SRR2061474 1 0.3816 0.8547 0.852 0.000 0.148
#> SRR2061476 1 0.4002 0.8458 0.840 0.000 0.160
#> SRR2061473 1 0.4002 0.8458 0.840 0.000 0.160
#> SRR2061472 1 0.4002 0.8458 0.840 0.000 0.160
#> SRR2061470 2 0.0237 0.9250 0.000 0.996 0.004
#> SRR2061469 2 0.0237 0.9250 0.000 0.996 0.004
#> SRR2061455 3 0.6302 0.2122 0.480 0.000 0.520
#> SRR2061454 3 0.6302 0.2122 0.480 0.000 0.520
#> SRR2061452 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061453 3 0.6302 0.2122 0.480 0.000 0.520
#> SRR2061450 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061451 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061448 2 0.2537 0.8766 0.000 0.920 0.080
#> SRR2061471 1 0.3816 0.8547 0.852 0.000 0.148
#> SRR2061449 2 0.2448 0.8799 0.000 0.924 0.076
#> SRR2061447 2 0.2448 0.8799 0.000 0.924 0.076
#> SRR2061446 2 0.5859 0.5344 0.000 0.656 0.344
#> SRR2061444 2 0.5988 0.4917 0.000 0.632 0.368
#> SRR2061443 3 0.4539 0.5878 0.016 0.148 0.836
#> SRR2061442 3 0.5058 0.5920 0.244 0.000 0.756
#> SRR2061441 3 0.4353 0.5804 0.008 0.156 0.836
#> SRR2061445 2 0.6192 0.3859 0.000 0.580 0.420
#> SRR2061439 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061440 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061437 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061438 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061435 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061436 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061433 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061434 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061432 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061431 2 0.0000 0.9253 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.9253 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.9253 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.9253 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.9253 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.9253 0.000 1.000 0.000
#> SRR2061425 3 0.4452 0.5438 0.000 0.192 0.808
#> SRR2061424 3 0.4121 0.6295 0.168 0.000 0.832
#> SRR2061423 3 0.4605 0.5291 0.000 0.204 0.796
#> SRR2061422 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061421 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061420 3 0.5254 0.5810 0.264 0.000 0.736
#> SRR2061419 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061418 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061417 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061415 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061416 1 0.0000 0.9445 1.000 0.000 0.000
#> SRR2061414 1 0.0000 0.9445 1.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.2011 0.886 0.000 0.920 0.000 0.080
#> SRR2061467 2 0.2149 0.886 0.000 0.912 0.000 0.088
#> SRR2061466 2 0.2149 0.886 0.000 0.912 0.000 0.088
#> SRR2061464 3 0.4257 0.782 0.000 0.140 0.812 0.048
#> SRR2061465 2 0.2149 0.886 0.000 0.912 0.000 0.088
#> SRR2061463 3 0.3634 0.815 0.000 0.096 0.856 0.048
#> SRR2061462 3 0.3004 0.827 0.000 0.060 0.892 0.048
#> SRR2061460 4 0.7262 0.725 0.252 0.000 0.208 0.540
#> SRR2061459 4 0.7325 0.733 0.264 0.000 0.208 0.528
#> SRR2061461 4 0.5808 0.254 0.032 0.000 0.424 0.544
#> SRR2061458 4 0.7325 0.733 0.264 0.000 0.208 0.528
#> SRR2061457 4 0.7325 0.733 0.264 0.000 0.208 0.528
#> SRR2061481 3 0.2124 0.829 0.000 0.040 0.932 0.028
#> SRR2061488 2 0.1356 0.900 0.000 0.960 0.008 0.032
#> SRR2061456 4 0.7325 0.733 0.264 0.000 0.208 0.528
#> SRR2061487 2 0.1356 0.900 0.000 0.960 0.008 0.032
#> SRR2061485 2 0.1635 0.898 0.000 0.948 0.008 0.044
#> SRR2061486 2 0.1356 0.900 0.000 0.960 0.008 0.032
#> SRR2061484 2 0.1635 0.898 0.000 0.948 0.008 0.044
#> SRR2061482 3 0.2124 0.829 0.000 0.040 0.932 0.028
#> SRR2061480 3 0.2124 0.829 0.000 0.040 0.932 0.028
#> SRR2061483 2 0.1635 0.898 0.000 0.948 0.008 0.044
#> SRR2061478 4 0.4866 0.508 0.404 0.000 0.000 0.596
#> SRR2061477 4 0.4948 0.463 0.440 0.000 0.000 0.560
#> SRR2061475 4 0.4948 0.463 0.440 0.000 0.000 0.560
#> SRR2061474 1 0.4948 -0.132 0.560 0.000 0.000 0.440
#> SRR2061476 4 0.4948 0.463 0.440 0.000 0.000 0.560
#> SRR2061473 4 0.4948 0.463 0.440 0.000 0.000 0.560
#> SRR2061472 4 0.4948 0.463 0.440 0.000 0.000 0.560
#> SRR2061470 2 0.2011 0.886 0.000 0.920 0.000 0.080
#> SRR2061469 2 0.2011 0.886 0.000 0.920 0.000 0.080
#> SRR2061455 4 0.7325 0.733 0.264 0.000 0.208 0.528
#> SRR2061454 4 0.7325 0.733 0.264 0.000 0.208 0.528
#> SRR2061452 1 0.0524 0.916 0.988 0.000 0.008 0.004
#> SRR2061453 4 0.7325 0.733 0.264 0.000 0.208 0.528
#> SRR2061450 1 0.0524 0.916 0.988 0.000 0.008 0.004
#> SRR2061451 1 0.0524 0.916 0.988 0.000 0.008 0.004
#> SRR2061448 2 0.5833 0.591 0.000 0.692 0.212 0.096
#> SRR2061471 1 0.4948 -0.132 0.560 0.000 0.000 0.440
#> SRR2061449 2 0.5833 0.591 0.000 0.692 0.212 0.096
#> SRR2061447 2 0.5833 0.591 0.000 0.692 0.212 0.096
#> SRR2061446 3 0.6698 0.434 0.000 0.340 0.556 0.104
#> SRR2061444 3 0.6669 0.450 0.000 0.332 0.564 0.104
#> SRR2061443 3 0.1674 0.822 0.012 0.032 0.952 0.004
#> SRR2061442 3 0.5325 0.535 0.068 0.000 0.728 0.204
#> SRR2061441 3 0.1489 0.828 0.000 0.044 0.952 0.004
#> SRR2061445 3 0.6399 0.553 0.000 0.276 0.620 0.104
#> SRR2061439 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061436 1 0.0524 0.916 0.988 0.000 0.008 0.004
#> SRR2061433 1 0.0336 0.918 0.992 0.000 0.008 0.000
#> SRR2061434 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.1022 0.900 0.000 0.968 0.000 0.032
#> SRR2061429 2 0.1022 0.900 0.000 0.968 0.000 0.032
#> SRR2061430 2 0.1022 0.900 0.000 0.968 0.000 0.032
#> SRR2061428 2 0.1211 0.900 0.000 0.960 0.000 0.040
#> SRR2061426 2 0.1211 0.900 0.000 0.960 0.000 0.040
#> SRR2061427 2 0.1211 0.900 0.000 0.960 0.000 0.040
#> SRR2061425 3 0.1474 0.830 0.000 0.052 0.948 0.000
#> SRR2061424 3 0.2926 0.758 0.048 0.000 0.896 0.056
#> SRR2061423 3 0.2546 0.829 0.000 0.060 0.912 0.028
#> SRR2061422 1 0.3219 0.624 0.836 0.000 0.000 0.164
#> SRR2061421 1 0.0524 0.916 0.988 0.000 0.008 0.004
#> SRR2061420 3 0.5585 0.505 0.084 0.000 0.712 0.204
#> SRR2061419 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061415 1 0.0524 0.916 0.988 0.000 0.008 0.004
#> SRR2061416 1 0.0000 0.920 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.920 1.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.336 0.827 0.000 0.832 0.132 0.036 0.000
#> SRR2061467 2 0.336 0.827 0.000 0.832 0.132 0.036 0.000
#> SRR2061466 2 0.336 0.827 0.000 0.832 0.132 0.036 0.000
#> SRR2061464 5 0.361 0.813 0.000 0.056 0.052 0.040 0.852
#> SRR2061465 2 0.336 0.827 0.000 0.832 0.132 0.036 0.000
#> SRR2061463 5 0.332 0.820 0.000 0.040 0.052 0.040 0.868
#> SRR2061462 5 0.290 0.824 0.000 0.020 0.052 0.040 0.888
#> SRR2061460 4 0.369 0.908 0.104 0.000 0.000 0.820 0.076
#> SRR2061459 4 0.401 0.948 0.136 0.000 0.000 0.792 0.072
#> SRR2061461 4 0.344 0.717 0.004 0.000 0.012 0.808 0.176
#> SRR2061458 4 0.429 0.944 0.136 0.000 0.008 0.784 0.072
#> SRR2061457 4 0.401 0.948 0.136 0.000 0.000 0.792 0.072
#> SRR2061481 5 0.187 0.828 0.000 0.008 0.028 0.028 0.936
#> SRR2061488 2 0.284 0.844 0.000 0.884 0.072 0.036 0.008
#> SRR2061456 4 0.401 0.948 0.136 0.000 0.000 0.792 0.072
#> SRR2061487 2 0.284 0.844 0.000 0.884 0.072 0.036 0.008
#> SRR2061485 2 0.337 0.839 0.000 0.852 0.088 0.052 0.008
#> SRR2061486 2 0.284 0.844 0.000 0.884 0.072 0.036 0.008
#> SRR2061484 2 0.337 0.839 0.000 0.852 0.088 0.052 0.008
#> SRR2061482 5 0.187 0.828 0.000 0.008 0.028 0.028 0.936
#> SRR2061480 5 0.187 0.828 0.000 0.008 0.028 0.028 0.936
#> SRR2061483 2 0.337 0.839 0.000 0.852 0.088 0.052 0.008
#> SRR2061478 3 0.660 0.889 0.264 0.000 0.464 0.272 0.000
#> SRR2061477 3 0.660 0.950 0.296 0.000 0.460 0.244 0.000
#> SRR2061475 3 0.658 0.951 0.296 0.000 0.464 0.240 0.000
#> SRR2061474 3 0.640 0.885 0.348 0.000 0.472 0.180 0.000
#> SRR2061476 3 0.658 0.951 0.296 0.000 0.464 0.240 0.000
#> SRR2061473 3 0.658 0.951 0.296 0.000 0.464 0.240 0.000
#> SRR2061472 3 0.658 0.951 0.296 0.000 0.464 0.240 0.000
#> SRR2061470 2 0.336 0.827 0.000 0.832 0.132 0.036 0.000
#> SRR2061469 2 0.336 0.827 0.000 0.832 0.132 0.036 0.000
#> SRR2061455 4 0.429 0.944 0.136 0.000 0.008 0.784 0.072
#> SRR2061454 4 0.401 0.948 0.136 0.000 0.000 0.792 0.072
#> SRR2061452 1 0.332 0.883 0.860 0.000 0.068 0.060 0.012
#> SRR2061453 4 0.401 0.948 0.136 0.000 0.000 0.792 0.072
#> SRR2061450 1 0.332 0.883 0.860 0.000 0.068 0.060 0.012
#> SRR2061451 1 0.332 0.883 0.860 0.000 0.068 0.060 0.012
#> SRR2061448 2 0.547 0.594 0.000 0.656 0.192 0.000 0.152
#> SRR2061471 3 0.640 0.885 0.348 0.000 0.472 0.180 0.000
#> SRR2061449 2 0.547 0.594 0.000 0.656 0.192 0.000 0.152
#> SRR2061447 2 0.547 0.594 0.000 0.656 0.192 0.000 0.152
#> SRR2061446 5 0.624 0.536 0.000 0.240 0.176 0.008 0.576
#> SRR2061444 5 0.613 0.541 0.000 0.240 0.176 0.004 0.580
#> SRR2061443 5 0.166 0.826 0.008 0.004 0.024 0.016 0.948
#> SRR2061442 5 0.407 0.672 0.012 0.000 0.028 0.180 0.780
#> SRR2061441 5 0.166 0.828 0.004 0.008 0.024 0.016 0.948
#> SRR2061445 5 0.582 0.615 0.000 0.192 0.176 0.004 0.628
#> SRR2061439 1 0.158 0.911 0.944 0.000 0.032 0.024 0.000
#> SRR2061440 1 0.029 0.917 0.992 0.000 0.008 0.000 0.000
#> SRR2061437 1 0.000 0.919 1.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.029 0.917 0.992 0.000 0.008 0.000 0.000
#> SRR2061435 1 0.051 0.916 0.984 0.000 0.016 0.000 0.000
#> SRR2061436 1 0.314 0.888 0.868 0.000 0.068 0.056 0.008
#> SRR2061433 1 0.266 0.897 0.896 0.000 0.044 0.052 0.008
#> SRR2061434 1 0.051 0.916 0.984 0.000 0.016 0.000 0.000
#> SRR2061432 1 0.029 0.917 0.992 0.000 0.008 0.000 0.000
#> SRR2061431 2 0.148 0.849 0.000 0.936 0.064 0.000 0.000
#> SRR2061429 2 0.161 0.847 0.000 0.928 0.072 0.000 0.000
#> SRR2061430 2 0.161 0.847 0.000 0.928 0.072 0.000 0.000
#> SRR2061428 2 0.194 0.852 0.000 0.924 0.056 0.020 0.000
#> SRR2061426 2 0.194 0.852 0.000 0.924 0.056 0.020 0.000
#> SRR2061427 2 0.194 0.852 0.000 0.924 0.056 0.020 0.000
#> SRR2061425 5 0.151 0.829 0.000 0.012 0.024 0.012 0.952
#> SRR2061424 5 0.321 0.757 0.012 0.000 0.024 0.108 0.856
#> SRR2061423 5 0.201 0.830 0.000 0.020 0.044 0.008 0.928
#> SRR2061422 1 0.352 0.743 0.836 0.000 0.040 0.116 0.008
#> SRR2061421 1 0.333 0.882 0.856 0.000 0.076 0.060 0.008
#> SRR2061420 5 0.534 0.624 0.080 0.000 0.032 0.176 0.712
#> SRR2061419 1 0.000 0.919 1.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.149 0.912 0.948 0.000 0.032 0.020 0.000
#> SRR2061417 1 0.029 0.917 0.992 0.000 0.008 0.000 0.000
#> SRR2061415 1 0.333 0.882 0.856 0.000 0.076 0.060 0.008
#> SRR2061416 1 0.000 0.919 1.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.029 0.917 0.992 0.000 0.008 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.4402 0.676 0.000 0.716 0.084 0.004 0.000 0.196
#> SRR2061467 2 0.4282 0.676 0.000 0.732 0.084 0.004 0.000 0.180
#> SRR2061466 2 0.4282 0.676 0.000 0.732 0.084 0.004 0.000 0.180
#> SRR2061464 5 0.4644 0.675 0.000 0.016 0.200 0.028 0.724 0.032
#> SRR2061465 2 0.4282 0.676 0.000 0.732 0.084 0.004 0.000 0.180
#> SRR2061463 5 0.4460 0.689 0.000 0.008 0.200 0.028 0.732 0.032
#> SRR2061462 5 0.4214 0.699 0.000 0.000 0.200 0.028 0.740 0.032
#> SRR2061460 4 0.1418 0.953 0.032 0.000 0.000 0.944 0.024 0.000
#> SRR2061459 4 0.1765 0.976 0.052 0.000 0.000 0.924 0.024 0.000
#> SRR2061461 4 0.1973 0.882 0.004 0.000 0.012 0.916 0.064 0.004
#> SRR2061458 4 0.2123 0.972 0.052 0.000 0.012 0.912 0.024 0.000
#> SRR2061457 4 0.1765 0.976 0.052 0.000 0.000 0.924 0.024 0.000
#> SRR2061481 5 0.2711 0.793 0.000 0.008 0.076 0.008 0.880 0.028
#> SRR2061488 2 0.3268 0.681 0.000 0.824 0.100 0.000 0.000 0.076
#> SRR2061456 4 0.1765 0.976 0.052 0.000 0.000 0.924 0.024 0.000
#> SRR2061487 2 0.3268 0.681 0.000 0.824 0.100 0.000 0.000 0.076
#> SRR2061485 2 0.2944 0.674 0.000 0.856 0.068 0.004 0.000 0.072
#> SRR2061486 2 0.3268 0.681 0.000 0.824 0.100 0.000 0.000 0.076
#> SRR2061484 2 0.2944 0.674 0.000 0.856 0.068 0.004 0.000 0.072
#> SRR2061482 5 0.2711 0.793 0.000 0.008 0.076 0.008 0.880 0.028
#> SRR2061480 5 0.2711 0.793 0.000 0.008 0.076 0.008 0.880 0.028
#> SRR2061483 2 0.2944 0.674 0.000 0.856 0.068 0.004 0.000 0.072
#> SRR2061478 6 0.5246 0.917 0.148 0.000 0.000 0.256 0.000 0.596
#> SRR2061477 6 0.5330 0.964 0.176 0.000 0.000 0.232 0.000 0.592
#> SRR2061475 6 0.5309 0.965 0.176 0.000 0.000 0.228 0.000 0.596
#> SRR2061474 6 0.5357 0.919 0.208 0.000 0.004 0.180 0.000 0.608
#> SRR2061476 6 0.5309 0.965 0.176 0.000 0.000 0.228 0.000 0.596
#> SRR2061473 6 0.5309 0.965 0.176 0.000 0.000 0.228 0.000 0.596
#> SRR2061472 6 0.5309 0.965 0.176 0.000 0.000 0.228 0.000 0.596
#> SRR2061470 2 0.4402 0.676 0.000 0.716 0.084 0.004 0.000 0.196
#> SRR2061469 2 0.4402 0.676 0.000 0.716 0.084 0.004 0.000 0.196
#> SRR2061455 4 0.2123 0.972 0.052 0.000 0.012 0.912 0.024 0.000
#> SRR2061454 4 0.1765 0.976 0.052 0.000 0.000 0.924 0.024 0.000
#> SRR2061452 1 0.4367 0.764 0.696 0.000 0.248 0.008 0.000 0.048
#> SRR2061453 4 0.1765 0.976 0.052 0.000 0.000 0.924 0.024 0.000
#> SRR2061450 1 0.4367 0.764 0.696 0.000 0.248 0.008 0.000 0.048
#> SRR2061451 1 0.4367 0.764 0.696 0.000 0.248 0.008 0.000 0.048
#> SRR2061448 3 0.5171 0.567 0.000 0.408 0.512 0.004 0.076 0.000
#> SRR2061471 6 0.5357 0.919 0.208 0.000 0.004 0.180 0.000 0.608
#> SRR2061449 3 0.5171 0.567 0.000 0.408 0.512 0.004 0.076 0.000
#> SRR2061447 3 0.5171 0.567 0.000 0.408 0.512 0.004 0.076 0.000
#> SRR2061446 3 0.6440 0.610 0.000 0.204 0.452 0.012 0.320 0.012
#> SRR2061444 3 0.6345 0.608 0.000 0.200 0.456 0.012 0.324 0.008
#> SRR2061443 5 0.0713 0.797 0.000 0.000 0.000 0.000 0.972 0.028
#> SRR2061442 5 0.3384 0.700 0.028 0.000 0.000 0.116 0.828 0.028
#> SRR2061441 5 0.0713 0.797 0.000 0.000 0.000 0.000 0.972 0.028
#> SRR2061445 3 0.6189 0.436 0.000 0.140 0.444 0.012 0.392 0.012
#> SRR2061439 1 0.1382 0.865 0.948 0.000 0.036 0.008 0.000 0.008
#> SRR2061440 1 0.0000 0.872 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.872 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.872 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061435 1 0.0363 0.871 0.988 0.000 0.012 0.000 0.000 0.000
#> SRR2061436 1 0.4209 0.778 0.716 0.000 0.232 0.008 0.000 0.044
#> SRR2061433 1 0.3024 0.831 0.844 0.000 0.116 0.008 0.000 0.032
#> SRR2061434 1 0.0363 0.871 0.988 0.000 0.012 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.872 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.3277 0.641 0.000 0.792 0.188 0.004 0.000 0.016
#> SRR2061429 2 0.3454 0.600 0.000 0.760 0.224 0.004 0.000 0.012
#> SRR2061430 2 0.3454 0.600 0.000 0.760 0.224 0.004 0.000 0.012
#> SRR2061428 2 0.2847 0.659 0.000 0.852 0.120 0.012 0.000 0.016
#> SRR2061426 2 0.2847 0.659 0.000 0.852 0.120 0.012 0.000 0.016
#> SRR2061427 2 0.2847 0.659 0.000 0.852 0.120 0.012 0.000 0.016
#> SRR2061425 5 0.0632 0.798 0.000 0.000 0.000 0.000 0.976 0.024
#> SRR2061424 5 0.1845 0.770 0.000 0.000 0.000 0.052 0.920 0.028
#> SRR2061423 5 0.3166 0.731 0.000 0.000 0.156 0.004 0.816 0.024
#> SRR2061422 1 0.4380 0.729 0.752 0.000 0.132 0.096 0.000 0.020
#> SRR2061421 1 0.4190 0.763 0.692 0.000 0.260 0.000 0.000 0.048
#> SRR2061420 5 0.5751 0.473 0.220 0.000 0.012 0.116 0.624 0.028
#> SRR2061419 1 0.0000 0.872 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.1382 0.865 0.948 0.000 0.036 0.008 0.000 0.008
#> SRR2061417 1 0.0000 0.872 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.4190 0.763 0.692 0.000 0.260 0.000 0.000 0.048
#> SRR2061416 1 0.0000 0.872 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.872 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
ATC:skmeans**
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"]
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 14886 rows and 74 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 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.996 0.998 0.5042 0.496 0.496
#> 3 3 0.749 0.794 0.839 0.2097 0.855 0.708
#> 4 4 0.827 0.894 0.941 0.1364 0.836 0.608
#> 5 5 0.893 0.931 0.931 0.0675 0.924 0.767
#> 6 6 0.844 0.899 0.927 0.0408 0.994 0.978
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 1.000 0.000 1.000
#> SRR2061467 2 0.000 1.000 0.000 1.000
#> SRR2061466 2 0.000 1.000 0.000 1.000
#> SRR2061464 2 0.000 1.000 0.000 1.000
#> SRR2061465 2 0.000 1.000 0.000 1.000
#> SRR2061463 2 0.000 1.000 0.000 1.000
#> SRR2061462 2 0.000 1.000 0.000 1.000
#> SRR2061460 1 0.000 0.997 1.000 0.000
#> SRR2061459 1 0.000 0.997 1.000 0.000
#> SRR2061461 1 0.000 0.997 1.000 0.000
#> SRR2061458 1 0.000 0.997 1.000 0.000
#> SRR2061457 1 0.000 0.997 1.000 0.000
#> SRR2061481 2 0.000 1.000 0.000 1.000
#> SRR2061488 2 0.000 1.000 0.000 1.000
#> SRR2061456 1 0.000 0.997 1.000 0.000
#> SRR2061487 2 0.000 1.000 0.000 1.000
#> SRR2061485 2 0.000 1.000 0.000 1.000
#> SRR2061486 2 0.000 1.000 0.000 1.000
#> SRR2061484 2 0.000 1.000 0.000 1.000
#> SRR2061482 2 0.000 1.000 0.000 1.000
#> SRR2061480 2 0.000 1.000 0.000 1.000
#> SRR2061483 2 0.000 1.000 0.000 1.000
#> SRR2061478 1 0.000 0.997 1.000 0.000
#> SRR2061477 1 0.000 0.997 1.000 0.000
#> SRR2061475 1 0.000 0.997 1.000 0.000
#> SRR2061474 1 0.000 0.997 1.000 0.000
#> SRR2061476 1 0.000 0.997 1.000 0.000
#> SRR2061473 1 0.000 0.997 1.000 0.000
#> SRR2061472 1 0.000 0.997 1.000 0.000
#> SRR2061470 2 0.000 1.000 0.000 1.000
#> SRR2061469 2 0.000 1.000 0.000 1.000
#> SRR2061455 1 0.000 0.997 1.000 0.000
#> SRR2061454 1 0.000 0.997 1.000 0.000
#> SRR2061452 1 0.000 0.997 1.000 0.000
#> SRR2061453 1 0.000 0.997 1.000 0.000
#> SRR2061450 1 0.000 0.997 1.000 0.000
#> SRR2061451 1 0.000 0.997 1.000 0.000
#> SRR2061448 2 0.000 1.000 0.000 1.000
#> SRR2061471 1 0.000 0.997 1.000 0.000
#> SRR2061449 2 0.000 1.000 0.000 1.000
#> SRR2061447 2 0.000 1.000 0.000 1.000
#> SRR2061446 2 0.000 1.000 0.000 1.000
#> SRR2061444 2 0.000 1.000 0.000 1.000
#> SRR2061443 2 0.000 1.000 0.000 1.000
#> SRR2061442 1 0.000 0.997 1.000 0.000
#> SRR2061441 2 0.000 1.000 0.000 1.000
#> SRR2061445 2 0.000 1.000 0.000 1.000
#> SRR2061439 1 0.000 0.997 1.000 0.000
#> SRR2061440 1 0.000 0.997 1.000 0.000
#> SRR2061437 1 0.000 0.997 1.000 0.000
#> SRR2061438 1 0.000 0.997 1.000 0.000
#> SRR2061435 1 0.000 0.997 1.000 0.000
#> SRR2061436 1 0.000 0.997 1.000 0.000
#> SRR2061433 1 0.000 0.997 1.000 0.000
#> SRR2061434 1 0.000 0.997 1.000 0.000
#> SRR2061432 1 0.000 0.997 1.000 0.000
#> SRR2061431 2 0.000 1.000 0.000 1.000
#> SRR2061429 2 0.000 1.000 0.000 1.000
#> SRR2061430 2 0.000 1.000 0.000 1.000
#> SRR2061428 2 0.000 1.000 0.000 1.000
#> SRR2061426 2 0.000 1.000 0.000 1.000
#> SRR2061427 2 0.000 1.000 0.000 1.000
#> SRR2061425 2 0.000 1.000 0.000 1.000
#> SRR2061424 1 0.552 0.853 0.872 0.128
#> SRR2061423 2 0.000 1.000 0.000 1.000
#> SRR2061422 1 0.000 0.997 1.000 0.000
#> SRR2061421 1 0.000 0.997 1.000 0.000
#> SRR2061420 1 0.000 0.997 1.000 0.000
#> SRR2061419 1 0.000 0.997 1.000 0.000
#> SRR2061418 1 0.000 0.997 1.000 0.000
#> SRR2061417 1 0.000 0.997 1.000 0.000
#> SRR2061415 1 0.000 0.997 1.000 0.000
#> SRR2061416 1 0.000 0.997 1.000 0.000
#> SRR2061414 1 0.000 0.997 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061467 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061466 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061464 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061465 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061463 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061462 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061460 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061459 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061461 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061458 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061457 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061481 2 0.593 0.701 0.356 0.644 0.000
#> SRR2061488 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061456 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061487 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061485 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061486 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061484 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061482 2 0.593 0.701 0.356 0.644 0.000
#> SRR2061480 2 0.593 0.701 0.356 0.644 0.000
#> SRR2061483 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061478 3 0.604 0.213 0.380 0.000 0.620
#> SRR2061477 3 0.604 0.213 0.380 0.000 0.620
#> SRR2061475 3 0.604 0.213 0.380 0.000 0.620
#> SRR2061474 3 0.604 0.213 0.380 0.000 0.620
#> SRR2061476 3 0.604 0.213 0.380 0.000 0.620
#> SRR2061473 3 0.604 0.213 0.380 0.000 0.620
#> SRR2061472 3 0.604 0.213 0.380 0.000 0.620
#> SRR2061470 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061469 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061455 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061454 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061452 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061453 3 0.000 0.669 0.000 0.000 1.000
#> SRR2061450 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061451 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061448 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061471 3 0.604 0.213 0.380 0.000 0.620
#> SRR2061449 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061447 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061446 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061444 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061443 2 0.595 0.698 0.360 0.640 0.000
#> SRR2061442 1 0.375 0.497 0.856 0.000 0.144
#> SRR2061441 2 0.595 0.698 0.360 0.640 0.000
#> SRR2061445 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061439 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061440 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061437 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061438 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061435 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061436 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061433 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061434 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061432 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061431 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061429 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061430 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061428 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061426 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061427 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061425 2 0.595 0.698 0.360 0.640 0.000
#> SRR2061424 1 0.000 0.282 1.000 0.000 0.000
#> SRR2061423 2 0.000 0.945 0.000 1.000 0.000
#> SRR2061422 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061421 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061420 1 0.593 0.927 0.644 0.000 0.356
#> SRR2061419 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061418 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061417 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061415 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061416 1 0.595 0.934 0.640 0.000 0.360
#> SRR2061414 1 0.595 0.934 0.640 0.000 0.360
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061467 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061466 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061464 2 0.2589 0.8601 0.000 0.884 0.116 0.000
#> SRR2061465 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061463 2 0.2589 0.8601 0.000 0.884 0.116 0.000
#> SRR2061462 2 0.2589 0.8601 0.000 0.884 0.116 0.000
#> SRR2061460 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061459 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061461 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061458 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061457 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061481 3 0.1975 0.9023 0.000 0.048 0.936 0.016
#> SRR2061488 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061456 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061487 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061485 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061486 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061484 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061482 3 0.1975 0.9023 0.000 0.048 0.936 0.016
#> SRR2061480 3 0.1975 0.9023 0.000 0.048 0.936 0.016
#> SRR2061483 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061478 1 0.5783 0.7172 0.708 0.000 0.120 0.172
#> SRR2061477 1 0.5783 0.7172 0.708 0.000 0.120 0.172
#> SRR2061475 1 0.5783 0.7172 0.708 0.000 0.120 0.172
#> SRR2061474 1 0.5783 0.7172 0.708 0.000 0.120 0.172
#> SRR2061476 1 0.5783 0.7172 0.708 0.000 0.120 0.172
#> SRR2061473 1 0.5783 0.7172 0.708 0.000 0.120 0.172
#> SRR2061472 1 0.5783 0.7172 0.708 0.000 0.120 0.172
#> SRR2061470 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061469 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061455 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061454 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061452 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061453 4 0.0592 1.0000 0.016 0.000 0.000 0.984
#> SRR2061450 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061448 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061471 1 0.5783 0.7172 0.708 0.000 0.120 0.172
#> SRR2061449 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061447 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061446 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061444 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061443 3 0.2647 0.8983 0.000 0.120 0.880 0.000
#> SRR2061442 1 0.4999 -0.0313 0.508 0.000 0.492 0.000
#> SRR2061441 3 0.2647 0.8983 0.000 0.120 0.880 0.000
#> SRR2061445 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061439 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061429 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061430 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061428 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061426 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061427 2 0.0000 0.9728 0.000 1.000 0.000 0.000
#> SRR2061425 3 0.2647 0.8983 0.000 0.120 0.880 0.000
#> SRR2061424 3 0.2647 0.7946 0.120 0.000 0.880 0.000
#> SRR2061423 2 0.4477 0.5197 0.000 0.688 0.312 0.000
#> SRR2061422 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061420 1 0.0921 0.8751 0.972 0.000 0.028 0.000
#> SRR2061419 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061415 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.8964 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.8964 1.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.0000 0.960 0.000 1.000 0.000 0.00 0.000
#> SRR2061467 2 0.0000 0.960 0.000 1.000 0.000 0.00 0.000
#> SRR2061466 2 0.0000 0.960 0.000 1.000 0.000 0.00 0.000
#> SRR2061464 2 0.3432 0.806 0.000 0.828 0.040 0.00 0.132
#> SRR2061465 2 0.0000 0.960 0.000 1.000 0.000 0.00 0.000
#> SRR2061463 2 0.3432 0.806 0.000 0.828 0.040 0.00 0.132
#> SRR2061462 2 0.3432 0.806 0.000 0.828 0.040 0.00 0.132
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061481 5 0.4211 0.738 0.000 0.004 0.360 0.00 0.636
#> SRR2061488 2 0.0290 0.958 0.000 0.992 0.008 0.00 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061487 2 0.0290 0.958 0.000 0.992 0.008 0.00 0.000
#> SRR2061485 2 0.0290 0.958 0.000 0.992 0.008 0.00 0.000
#> SRR2061486 2 0.0290 0.958 0.000 0.992 0.008 0.00 0.000
#> SRR2061484 2 0.0290 0.958 0.000 0.992 0.008 0.00 0.000
#> SRR2061482 5 0.4211 0.738 0.000 0.004 0.360 0.00 0.636
#> SRR2061480 5 0.4211 0.738 0.000 0.004 0.360 0.00 0.636
#> SRR2061483 2 0.0290 0.958 0.000 0.992 0.008 0.00 0.000
#> SRR2061478 3 0.4181 1.000 0.268 0.000 0.712 0.02 0.000
#> SRR2061477 3 0.4181 1.000 0.268 0.000 0.712 0.02 0.000
#> SRR2061475 3 0.4181 1.000 0.268 0.000 0.712 0.02 0.000
#> SRR2061474 3 0.4181 1.000 0.268 0.000 0.712 0.02 0.000
#> SRR2061476 3 0.4181 1.000 0.268 0.000 0.712 0.02 0.000
#> SRR2061473 3 0.4181 1.000 0.268 0.000 0.712 0.02 0.000
#> SRR2061472 3 0.4181 1.000 0.268 0.000 0.712 0.02 0.000
#> SRR2061470 2 0.0000 0.960 0.000 1.000 0.000 0.00 0.000
#> SRR2061469 2 0.0000 0.960 0.000 1.000 0.000 0.00 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061452 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.00 0.000
#> SRR2061450 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061451 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061448 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061471 3 0.4181 1.000 0.268 0.000 0.712 0.02 0.000
#> SRR2061449 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061447 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061446 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061444 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061443 5 0.0000 0.812 0.000 0.000 0.000 0.00 1.000
#> SRR2061442 5 0.4306 0.423 0.328 0.000 0.012 0.00 0.660
#> SRR2061441 5 0.0000 0.812 0.000 0.000 0.000 0.00 1.000
#> SRR2061445 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061439 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061440 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061437 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061438 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061435 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061436 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061433 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061434 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061432 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061431 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061429 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061430 2 0.0324 0.960 0.000 0.992 0.004 0.00 0.004
#> SRR2061428 2 0.0162 0.960 0.000 0.996 0.000 0.00 0.004
#> SRR2061426 2 0.0162 0.960 0.000 0.996 0.000 0.00 0.004
#> SRR2061427 2 0.0162 0.960 0.000 0.996 0.000 0.00 0.004
#> SRR2061425 5 0.0000 0.812 0.000 0.000 0.000 0.00 1.000
#> SRR2061424 5 0.0566 0.808 0.004 0.000 0.012 0.00 0.984
#> SRR2061423 2 0.4359 0.360 0.000 0.584 0.004 0.00 0.412
#> SRR2061422 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061421 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061420 1 0.3890 0.593 0.736 0.000 0.012 0.00 0.252
#> SRR2061419 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061418 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061417 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061415 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061416 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
#> SRR2061414 1 0.0000 0.981 1.000 0.000 0.000 0.00 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.1141 0.882 0.000 0.948 0.052 0.000 0.000 0.000
#> SRR2061467 2 0.1204 0.882 0.000 0.944 0.056 0.000 0.000 0.000
#> SRR2061466 2 0.1204 0.882 0.000 0.944 0.056 0.000 0.000 0.000
#> SRR2061464 2 0.4882 0.547 0.000 0.628 0.308 0.000 0.028 0.036
#> SRR2061465 2 0.1204 0.882 0.000 0.944 0.056 0.000 0.000 0.000
#> SRR2061463 2 0.4882 0.547 0.000 0.628 0.308 0.000 0.028 0.036
#> SRR2061462 2 0.4882 0.547 0.000 0.628 0.308 0.000 0.028 0.036
#> SRR2061460 4 0.0000 0.999 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061459 4 0.0000 0.999 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061461 4 0.0146 0.997 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR2061458 4 0.0146 0.997 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR2061457 4 0.0000 0.999 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061481 3 0.2214 1.000 0.000 0.000 0.888 0.000 0.096 0.016
#> SRR2061488 2 0.2006 0.867 0.000 0.892 0.104 0.000 0.000 0.004
#> SRR2061456 4 0.0000 0.999 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061487 2 0.2006 0.867 0.000 0.892 0.104 0.000 0.000 0.004
#> SRR2061485 2 0.2006 0.867 0.000 0.892 0.104 0.000 0.000 0.004
#> SRR2061486 2 0.2006 0.867 0.000 0.892 0.104 0.000 0.000 0.004
#> SRR2061484 2 0.2006 0.867 0.000 0.892 0.104 0.000 0.000 0.004
#> SRR2061482 3 0.2214 1.000 0.000 0.000 0.888 0.000 0.096 0.016
#> SRR2061480 3 0.2214 1.000 0.000 0.000 0.888 0.000 0.096 0.016
#> SRR2061483 2 0.2006 0.867 0.000 0.892 0.104 0.000 0.000 0.004
#> SRR2061478 6 0.2003 1.000 0.116 0.000 0.000 0.000 0.000 0.884
#> SRR2061477 6 0.2003 1.000 0.116 0.000 0.000 0.000 0.000 0.884
#> SRR2061475 6 0.2003 1.000 0.116 0.000 0.000 0.000 0.000 0.884
#> SRR2061474 6 0.2003 1.000 0.116 0.000 0.000 0.000 0.000 0.884
#> SRR2061476 6 0.2003 1.000 0.116 0.000 0.000 0.000 0.000 0.884
#> SRR2061473 6 0.2003 1.000 0.116 0.000 0.000 0.000 0.000 0.884
#> SRR2061472 6 0.2003 1.000 0.116 0.000 0.000 0.000 0.000 0.884
#> SRR2061470 2 0.1141 0.882 0.000 0.948 0.052 0.000 0.000 0.000
#> SRR2061469 2 0.1141 0.882 0.000 0.948 0.052 0.000 0.000 0.000
#> SRR2061455 4 0.0146 0.997 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR2061454 4 0.0000 0.999 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061452 1 0.0547 0.967 0.980 0.000 0.020 0.000 0.000 0.000
#> SRR2061453 4 0.0000 0.999 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2061450 1 0.0458 0.968 0.984 0.000 0.016 0.000 0.000 0.000
#> SRR2061451 1 0.0458 0.968 0.984 0.000 0.016 0.000 0.000 0.000
#> SRR2061448 2 0.1644 0.872 0.000 0.932 0.028 0.000 0.000 0.040
#> SRR2061471 6 0.2003 1.000 0.116 0.000 0.000 0.000 0.000 0.884
#> SRR2061449 2 0.1644 0.872 0.000 0.932 0.028 0.000 0.000 0.040
#> SRR2061447 2 0.1644 0.872 0.000 0.932 0.028 0.000 0.000 0.040
#> SRR2061446 2 0.1644 0.872 0.000 0.932 0.028 0.000 0.000 0.040
#> SRR2061444 2 0.1644 0.872 0.000 0.932 0.028 0.000 0.000 0.040
#> SRR2061443 5 0.0260 0.880 0.000 0.000 0.008 0.000 0.992 0.000
#> SRR2061442 5 0.3481 0.616 0.192 0.000 0.000 0.000 0.776 0.032
#> SRR2061441 5 0.0820 0.879 0.000 0.000 0.012 0.000 0.972 0.016
#> SRR2061445 2 0.1644 0.872 0.000 0.932 0.028 0.000 0.000 0.040
#> SRR2061439 1 0.0146 0.968 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061440 1 0.0146 0.968 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061437 1 0.0000 0.969 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061438 1 0.0146 0.968 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2061435 1 0.0547 0.967 0.980 0.000 0.020 0.000 0.000 0.000
#> SRR2061436 1 0.0458 0.968 0.984 0.000 0.016 0.000 0.000 0.000
#> SRR2061433 1 0.0000 0.969 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061434 1 0.0547 0.967 0.980 0.000 0.020 0.000 0.000 0.000
#> SRR2061432 1 0.0000 0.969 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061431 2 0.1418 0.875 0.000 0.944 0.024 0.000 0.000 0.032
#> SRR2061429 2 0.1572 0.873 0.000 0.936 0.028 0.000 0.000 0.036
#> SRR2061430 2 0.1572 0.873 0.000 0.936 0.028 0.000 0.000 0.036
#> SRR2061428 2 0.0363 0.882 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR2061426 2 0.0363 0.882 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR2061427 2 0.0363 0.882 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR2061425 5 0.0820 0.879 0.000 0.000 0.012 0.000 0.972 0.016
#> SRR2061424 5 0.0790 0.866 0.000 0.000 0.000 0.000 0.968 0.032
#> SRR2061423 2 0.5175 0.141 0.000 0.496 0.024 0.000 0.440 0.040
#> SRR2061422 1 0.0547 0.967 0.980 0.000 0.020 0.000 0.000 0.000
#> SRR2061421 1 0.0547 0.967 0.980 0.000 0.020 0.000 0.000 0.000
#> SRR2061420 1 0.4389 0.267 0.596 0.000 0.000 0.000 0.372 0.032
#> SRR2061419 1 0.0000 0.969 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 0.969 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 0.969 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061415 1 0.0547 0.967 0.980 0.000 0.020 0.000 0.000 0.000
#> SRR2061416 1 0.0000 0.969 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 0.969 1.000 0.000 0.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two
samples to be in a same group.
consensus_heatmap(res, k = 2)

consensus_heatmap(res, k = 3)

consensus_heatmap(res, k = 4)

consensus_heatmap(res, k = 5)

consensus_heatmap(res, k = 6)

Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)

membership_heatmap(res, k = 3)

membership_heatmap(res, k = 4)

membership_heatmap(res, k = 5)

membership_heatmap(res, k = 6)

As soon as we have had the classes for columns, we can look for signatures
which are significantly different between classes which can be candidate marks
for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)

get_signatures(res, k = 3)

get_signatures(res, k = 4)

get_signatures(res, k = 5)

get_signatures(res, k = 6)

Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)

get_signatures(res, k = 3, scale_rows = FALSE)

get_signatures(res, k = 4, scale_rows = FALSE)

get_signatures(res, k = 5, scale_rows = FALSE)

get_signatures(res, k = 6, scale_rows = FALSE)

Compare the overlap of signatures from different k:
compare_signatures(res)

get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
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.
ATC:pam*
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"]
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 14886 rows and 74 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:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or k-1.
The detailed explanations of these statistics can be found in the cola
vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)

The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.975 0.991 0.4951 0.502 0.502
#> 3 3 1.000 0.985 0.993 0.3072 0.795 0.614
#> 4 4 0.922 0.874 0.945 0.1461 0.895 0.709
#> 5 5 1.000 0.999 1.000 0.0572 0.944 0.792
#> 6 6 0.934 0.948 0.957 0.0467 0.964 0.832
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 5
There is also optional best \(k\) = 2 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.000 0.9774 0.000 1.000
#> SRR2061467 2 0.000 0.9774 0.000 1.000
#> SRR2061466 2 0.000 0.9774 0.000 1.000
#> SRR2061464 2 0.000 0.9774 0.000 1.000
#> SRR2061465 2 0.000 0.9774 0.000 1.000
#> SRR2061463 2 0.000 0.9774 0.000 1.000
#> SRR2061462 2 0.000 0.9774 0.000 1.000
#> SRR2061460 1 0.000 1.0000 1.000 0.000
#> SRR2061459 1 0.000 1.0000 1.000 0.000
#> SRR2061461 1 0.000 1.0000 1.000 0.000
#> SRR2061458 1 0.000 1.0000 1.000 0.000
#> SRR2061457 1 0.000 1.0000 1.000 0.000
#> SRR2061481 2 0.000 0.9774 0.000 1.000
#> SRR2061488 2 0.000 0.9774 0.000 1.000
#> SRR2061456 1 0.000 1.0000 1.000 0.000
#> SRR2061487 2 0.000 0.9774 0.000 1.000
#> SRR2061485 2 0.000 0.9774 0.000 1.000
#> SRR2061486 2 0.000 0.9774 0.000 1.000
#> SRR2061484 2 0.000 0.9774 0.000 1.000
#> SRR2061482 2 0.999 0.0813 0.484 0.516
#> SRR2061480 2 0.745 0.7268 0.212 0.788
#> SRR2061483 2 0.000 0.9774 0.000 1.000
#> SRR2061478 1 0.000 1.0000 1.000 0.000
#> SRR2061477 1 0.000 1.0000 1.000 0.000
#> SRR2061475 1 0.000 1.0000 1.000 0.000
#> SRR2061474 1 0.000 1.0000 1.000 0.000
#> SRR2061476 1 0.000 1.0000 1.000 0.000
#> SRR2061473 1 0.000 1.0000 1.000 0.000
#> SRR2061472 1 0.000 1.0000 1.000 0.000
#> SRR2061470 2 0.000 0.9774 0.000 1.000
#> SRR2061469 2 0.000 0.9774 0.000 1.000
#> SRR2061455 1 0.000 1.0000 1.000 0.000
#> SRR2061454 1 0.000 1.0000 1.000 0.000
#> SRR2061452 1 0.000 1.0000 1.000 0.000
#> SRR2061453 1 0.000 1.0000 1.000 0.000
#> SRR2061450 1 0.000 1.0000 1.000 0.000
#> SRR2061451 1 0.000 1.0000 1.000 0.000
#> SRR2061448 2 0.000 0.9774 0.000 1.000
#> SRR2061471 1 0.000 1.0000 1.000 0.000
#> SRR2061449 2 0.000 0.9774 0.000 1.000
#> SRR2061447 2 0.000 0.9774 0.000 1.000
#> SRR2061446 2 0.000 0.9774 0.000 1.000
#> SRR2061444 2 0.000 0.9774 0.000 1.000
#> SRR2061443 1 0.000 1.0000 1.000 0.000
#> SRR2061442 1 0.000 1.0000 1.000 0.000
#> SRR2061441 1 0.000 1.0000 1.000 0.000
#> SRR2061445 2 0.000 0.9774 0.000 1.000
#> SRR2061439 1 0.000 1.0000 1.000 0.000
#> SRR2061440 1 0.000 1.0000 1.000 0.000
#> SRR2061437 1 0.000 1.0000 1.000 0.000
#> SRR2061438 1 0.000 1.0000 1.000 0.000
#> SRR2061435 1 0.000 1.0000 1.000 0.000
#> SRR2061436 1 0.000 1.0000 1.000 0.000
#> SRR2061433 1 0.000 1.0000 1.000 0.000
#> SRR2061434 1 0.000 1.0000 1.000 0.000
#> SRR2061432 1 0.000 1.0000 1.000 0.000
#> SRR2061431 2 0.000 0.9774 0.000 1.000
#> SRR2061429 2 0.000 0.9774 0.000 1.000
#> SRR2061430 2 0.000 0.9774 0.000 1.000
#> SRR2061428 2 0.000 0.9774 0.000 1.000
#> SRR2061426 2 0.000 0.9774 0.000 1.000
#> SRR2061427 2 0.000 0.9774 0.000 1.000
#> SRR2061425 2 0.000 0.9774 0.000 1.000
#> SRR2061424 1 0.000 1.0000 1.000 0.000
#> SRR2061423 2 0.000 0.9774 0.000 1.000
#> SRR2061422 1 0.000 1.0000 1.000 0.000
#> SRR2061421 1 0.000 1.0000 1.000 0.000
#> SRR2061420 1 0.000 1.0000 1.000 0.000
#> SRR2061419 1 0.000 1.0000 1.000 0.000
#> SRR2061418 1 0.000 1.0000 1.000 0.000
#> SRR2061417 1 0.000 1.0000 1.000 0.000
#> SRR2061415 1 0.000 1.0000 1.000 0.000
#> SRR2061416 1 0.000 1.0000 1.000 0.000
#> SRR2061414 1 0.000 1.0000 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 1.000 0.000 1 0.000
#> SRR2061467 2 0.0000 1.000 0.000 1 0.000
#> SRR2061466 2 0.0000 1.000 0.000 1 0.000
#> SRR2061464 3 0.0000 0.993 0.000 0 1.000
#> SRR2061465 2 0.0000 1.000 0.000 1 0.000
#> SRR2061463 3 0.0000 0.993 0.000 0 1.000
#> SRR2061462 3 0.0000 0.993 0.000 0 1.000
#> SRR2061460 3 0.2796 0.890 0.092 0 0.908
#> SRR2061459 1 0.0000 0.987 1.000 0 0.000
#> SRR2061461 3 0.0237 0.990 0.004 0 0.996
#> SRR2061458 1 0.3412 0.868 0.876 0 0.124
#> SRR2061457 1 0.3116 0.886 0.892 0 0.108
#> SRR2061481 3 0.0000 0.993 0.000 0 1.000
#> SRR2061488 2 0.0000 1.000 0.000 1 0.000
#> SRR2061456 1 0.0000 0.987 1.000 0 0.000
#> SRR2061487 2 0.0000 1.000 0.000 1 0.000
#> SRR2061485 2 0.0000 1.000 0.000 1 0.000
#> SRR2061486 2 0.0000 1.000 0.000 1 0.000
#> SRR2061484 2 0.0000 1.000 0.000 1 0.000
#> SRR2061482 3 0.0000 0.993 0.000 0 1.000
#> SRR2061480 3 0.0000 0.993 0.000 0 1.000
#> SRR2061483 2 0.0000 1.000 0.000 1 0.000
#> SRR2061478 1 0.0000 0.987 1.000 0 0.000
#> SRR2061477 1 0.0000 0.987 1.000 0 0.000
#> SRR2061475 1 0.0000 0.987 1.000 0 0.000
#> SRR2061474 1 0.0000 0.987 1.000 0 0.000
#> SRR2061476 1 0.0000 0.987 1.000 0 0.000
#> SRR2061473 1 0.0000 0.987 1.000 0 0.000
#> SRR2061472 1 0.0000 0.987 1.000 0 0.000
#> SRR2061470 2 0.0000 1.000 0.000 1 0.000
#> SRR2061469 2 0.0000 1.000 0.000 1 0.000
#> SRR2061455 1 0.3686 0.849 0.860 0 0.140
#> SRR2061454 1 0.1964 0.939 0.944 0 0.056
#> SRR2061452 1 0.0000 0.987 1.000 0 0.000
#> SRR2061453 1 0.0000 0.987 1.000 0 0.000
#> SRR2061450 1 0.0000 0.987 1.000 0 0.000
#> SRR2061451 1 0.0000 0.987 1.000 0 0.000
#> SRR2061448 2 0.0000 1.000 0.000 1 0.000
#> SRR2061471 1 0.0000 0.987 1.000 0 0.000
#> SRR2061449 2 0.0000 1.000 0.000 1 0.000
#> SRR2061447 2 0.0000 1.000 0.000 1 0.000
#> SRR2061446 3 0.0000 0.993 0.000 0 1.000
#> SRR2061444 3 0.0000 0.993 0.000 0 1.000
#> SRR2061443 3 0.0000 0.993 0.000 0 1.000
#> SRR2061442 3 0.0000 0.993 0.000 0 1.000
#> SRR2061441 3 0.0000 0.993 0.000 0 1.000
#> SRR2061445 3 0.0000 0.993 0.000 0 1.000
#> SRR2061439 1 0.0000 0.987 1.000 0 0.000
#> SRR2061440 1 0.0000 0.987 1.000 0 0.000
#> SRR2061437 1 0.0000 0.987 1.000 0 0.000
#> SRR2061438 1 0.0000 0.987 1.000 0 0.000
#> SRR2061435 1 0.0000 0.987 1.000 0 0.000
#> SRR2061436 1 0.0000 0.987 1.000 0 0.000
#> SRR2061433 1 0.0000 0.987 1.000 0 0.000
#> SRR2061434 1 0.0000 0.987 1.000 0 0.000
#> SRR2061432 1 0.0000 0.987 1.000 0 0.000
#> SRR2061431 2 0.0000 1.000 0.000 1 0.000
#> SRR2061429 2 0.0000 1.000 0.000 1 0.000
#> SRR2061430 2 0.0000 1.000 0.000 1 0.000
#> SRR2061428 2 0.0000 1.000 0.000 1 0.000
#> SRR2061426 2 0.0000 1.000 0.000 1 0.000
#> SRR2061427 2 0.0000 1.000 0.000 1 0.000
#> SRR2061425 3 0.0000 0.993 0.000 0 1.000
#> SRR2061424 3 0.0000 0.993 0.000 0 1.000
#> SRR2061423 3 0.0000 0.993 0.000 0 1.000
#> SRR2061422 1 0.0000 0.987 1.000 0 0.000
#> SRR2061421 1 0.0000 0.987 1.000 0 0.000
#> SRR2061420 3 0.0000 0.993 0.000 0 1.000
#> SRR2061419 1 0.0000 0.987 1.000 0 0.000
#> SRR2061418 1 0.0000 0.987 1.000 0 0.000
#> SRR2061417 1 0.0000 0.987 1.000 0 0.000
#> SRR2061415 1 0.0000 0.987 1.000 0 0.000
#> SRR2061416 1 0.0000 0.987 1.000 0 0.000
#> SRR2061414 1 0.0000 0.987 1.000 0 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061467 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061466 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061464 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061465 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061463 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061462 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061460 4 0.4776 0.383 0.000 0 0.376 0.624
#> SRR2061459 4 0.0707 0.789 0.020 0 0.000 0.980
#> SRR2061461 4 0.4776 0.383 0.000 0 0.376 0.624
#> SRR2061458 4 0.4776 0.446 0.376 0 0.000 0.624
#> SRR2061457 4 0.0188 0.794 0.004 0 0.000 0.996
#> SRR2061481 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061488 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061456 4 0.0000 0.794 0.000 0 0.000 1.000
#> SRR2061487 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061485 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061486 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061484 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061482 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061480 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061483 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061478 4 0.0000 0.794 0.000 0 0.000 1.000
#> SRR2061477 1 0.4843 0.477 0.604 0 0.000 0.396
#> SRR2061475 1 0.4843 0.477 0.604 0 0.000 0.396
#> SRR2061474 1 0.4776 0.506 0.624 0 0.000 0.376
#> SRR2061476 1 0.4843 0.477 0.604 0 0.000 0.396
#> SRR2061473 1 0.4843 0.477 0.604 0 0.000 0.396
#> SRR2061472 4 0.3688 0.559 0.208 0 0.000 0.792
#> SRR2061470 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061469 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061455 4 0.4776 0.446 0.376 0 0.000 0.624
#> SRR2061454 4 0.0000 0.794 0.000 0 0.000 1.000
#> SRR2061452 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061453 4 0.0000 0.794 0.000 0 0.000 1.000
#> SRR2061450 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061451 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061448 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061471 1 0.4776 0.506 0.624 0 0.000 0.376
#> SRR2061449 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061447 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061446 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061444 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061443 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061442 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061441 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061445 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061439 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061440 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061437 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061438 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061435 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061436 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061433 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061434 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061432 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061431 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061429 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061430 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061428 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061426 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061427 2 0.0000 1.000 0.000 1 0.000 0.000
#> SRR2061425 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061424 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061423 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061422 1 0.0188 0.885 0.996 0 0.000 0.004
#> SRR2061421 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061420 3 0.0000 1.000 0.000 0 1.000 0.000
#> SRR2061419 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061418 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061417 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061415 1 0.0188 0.885 0.996 0 0.000 0.004
#> SRR2061416 1 0.0000 0.888 1.000 0 0.000 0.000
#> SRR2061414 1 0.0000 0.888 1.000 0 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061467 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061466 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061464 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061465 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061463 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061462 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061460 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061459 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061461 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061458 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061457 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061481 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061488 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061456 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061487 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061485 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061486 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061484 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061482 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061480 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061483 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061478 3 0.0000 1.000 0.000 0 1.000 0 0
#> SRR2061477 3 0.0000 1.000 0.000 0 1.000 0 0
#> SRR2061475 3 0.0000 1.000 0.000 0 1.000 0 0
#> SRR2061474 3 0.0000 1.000 0.000 0 1.000 0 0
#> SRR2061476 3 0.0000 1.000 0.000 0 1.000 0 0
#> SRR2061473 3 0.0000 1.000 0.000 0 1.000 0 0
#> SRR2061472 3 0.0000 1.000 0.000 0 1.000 0 0
#> SRR2061470 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061469 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061455 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061454 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061452 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061453 4 0.0000 1.000 0.000 0 0.000 1 0
#> SRR2061450 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061451 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061448 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061471 3 0.0000 1.000 0.000 0 1.000 0 0
#> SRR2061449 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061447 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061446 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061444 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061443 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061442 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061441 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061445 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061439 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061440 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061437 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061438 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061435 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061436 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061433 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061434 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061432 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061431 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061429 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061430 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061428 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061426 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061427 2 0.0000 1.000 0.000 1 0.000 0 0
#> SRR2061425 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061424 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061423 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061422 1 0.0290 0.991 0.992 0 0.008 0 0
#> SRR2061421 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061420 5 0.0000 1.000 0.000 0 0.000 0 1
#> SRR2061419 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061418 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061417 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061415 1 0.0703 0.976 0.976 0 0.024 0 0
#> SRR2061416 1 0.0000 0.998 1.000 0 0.000 0 0
#> SRR2061414 1 0.0000 0.998 1.000 0 0.000 0 0
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.2003 0.957 0.000 0.884 0.116 0 0.000 0.000
#> SRR2061467 2 0.2003 0.957 0.000 0.884 0.116 0 0.000 0.000
#> SRR2061466 2 0.2003 0.957 0.000 0.884 0.116 0 0.000 0.000
#> SRR2061464 5 0.2357 0.924 0.000 0.116 0.012 0 0.872 0.000
#> SRR2061465 2 0.2003 0.957 0.000 0.884 0.116 0 0.000 0.000
#> SRR2061463 5 0.2003 0.928 0.000 0.116 0.000 0 0.884 0.000
#> SRR2061462 5 0.2003 0.928 0.000 0.116 0.000 0 0.884 0.000
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061481 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061488 3 0.0363 0.907 0.000 0.012 0.988 0 0.000 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061487 3 0.0363 0.907 0.000 0.012 0.988 0 0.000 0.000
#> SRR2061485 3 0.3330 0.519 0.000 0.284 0.716 0 0.000 0.000
#> SRR2061486 3 0.0458 0.905 0.000 0.016 0.984 0 0.000 0.000
#> SRR2061484 2 0.3515 0.659 0.000 0.676 0.324 0 0.000 0.000
#> SRR2061482 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061480 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061483 3 0.2941 0.656 0.000 0.220 0.780 0 0.000 0.000
#> SRR2061478 6 0.0000 1.000 0.000 0.000 0.000 0 0.000 1.000
#> SRR2061477 6 0.0000 1.000 0.000 0.000 0.000 0 0.000 1.000
#> SRR2061475 6 0.0000 1.000 0.000 0.000 0.000 0 0.000 1.000
#> SRR2061474 6 0.0000 1.000 0.000 0.000 0.000 0 0.000 1.000
#> SRR2061476 6 0.0000 1.000 0.000 0.000 0.000 0 0.000 1.000
#> SRR2061473 6 0.0000 1.000 0.000 0.000 0.000 0 0.000 1.000
#> SRR2061472 6 0.0000 1.000 0.000 0.000 0.000 0 0.000 1.000
#> SRR2061470 2 0.2003 0.957 0.000 0.884 0.116 0 0.000 0.000
#> SRR2061469 2 0.2003 0.957 0.000 0.884 0.116 0 0.000 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061452 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> SRR2061450 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061451 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061448 3 0.2003 0.829 0.000 0.116 0.884 0 0.000 0.000
#> SRR2061471 6 0.0000 1.000 0.000 0.000 0.000 0 0.000 1.000
#> SRR2061449 3 0.2003 0.829 0.000 0.116 0.884 0 0.000 0.000
#> SRR2061447 3 0.2003 0.829 0.000 0.116 0.884 0 0.000 0.000
#> SRR2061446 5 0.2843 0.905 0.000 0.116 0.036 0 0.848 0.000
#> SRR2061444 5 0.2357 0.924 0.000 0.116 0.012 0 0.872 0.000
#> SRR2061443 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061442 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061441 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061445 5 0.2357 0.924 0.000 0.116 0.012 0 0.872 0.000
#> SRR2061439 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061440 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061437 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061438 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061435 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061436 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061433 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061434 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061432 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061431 3 0.0000 0.908 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061429 3 0.0000 0.908 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061430 3 0.0000 0.908 0.000 0.000 1.000 0 0.000 0.000
#> SRR2061428 3 0.0363 0.907 0.000 0.012 0.988 0 0.000 0.000
#> SRR2061426 3 0.0363 0.907 0.000 0.012 0.988 0 0.000 0.000
#> SRR2061427 3 0.0363 0.903 0.000 0.012 0.988 0 0.000 0.000
#> SRR2061425 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061424 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061423 5 0.2003 0.928 0.000 0.116 0.000 0 0.884 0.000
#> SRR2061422 1 0.0260 0.991 0.992 0.000 0.000 0 0.000 0.008
#> SRR2061421 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061420 5 0.0000 0.946 0.000 0.000 0.000 0 1.000 0.000
#> SRR2061419 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061418 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061417 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061415 1 0.0632 0.975 0.976 0.000 0.000 0 0.000 0.024
#> SRR2061416 1 0.0000 0.998 1.000 0.000 0.000 0 0.000 0.000
#> SRR2061414 1 0.0000 0.998 1.000 0.000 0.000 0 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.
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.
ATC:mclust**
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"]
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 14886 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)

The plots are:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or k-1.
The detailed explanations of these statistics can be found in the cola
vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)

The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.990 0.991 0.3624 0.641 0.641
#> 3 3 0.712 0.664 0.801 0.7594 0.740 0.595
#> 4 4 1.000 0.965 0.982 0.1444 0.766 0.474
#> 5 5 0.890 0.933 0.916 0.0493 0.973 0.903
#> 6 6 0.950 0.930 0.956 0.0648 0.926 0.711
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 1 0.1184 0.991 0.984 0.016
#> SRR2061467 1 0.1184 0.991 0.984 0.016
#> SRR2061466 1 0.1184 0.991 0.984 0.016
#> SRR2061464 1 0.1184 0.991 0.984 0.016
#> SRR2061465 1 0.1184 0.991 0.984 0.016
#> SRR2061463 1 0.1184 0.991 0.984 0.016
#> SRR2061462 1 0.1184 0.991 0.984 0.016
#> SRR2061460 1 0.0000 0.991 1.000 0.000
#> SRR2061459 1 0.0000 0.991 1.000 0.000
#> SRR2061461 1 0.0000 0.991 1.000 0.000
#> SRR2061458 1 0.0000 0.991 1.000 0.000
#> SRR2061457 1 0.0000 0.991 1.000 0.000
#> SRR2061481 2 0.0000 0.992 0.000 1.000
#> SRR2061488 2 0.0000 0.992 0.000 1.000
#> SRR2061456 1 0.0000 0.991 1.000 0.000
#> SRR2061487 2 0.0000 0.992 0.000 1.000
#> SRR2061485 2 0.0000 0.992 0.000 1.000
#> SRR2061486 2 0.0000 0.992 0.000 1.000
#> SRR2061484 2 0.0000 0.992 0.000 1.000
#> SRR2061482 2 0.0000 0.992 0.000 1.000
#> SRR2061480 2 0.0000 0.992 0.000 1.000
#> SRR2061483 2 0.0000 0.992 0.000 1.000
#> SRR2061478 2 0.1184 0.991 0.016 0.984
#> SRR2061477 2 0.1184 0.991 0.016 0.984
#> SRR2061475 2 0.1184 0.991 0.016 0.984
#> SRR2061474 2 0.1184 0.991 0.016 0.984
#> SRR2061476 2 0.1184 0.991 0.016 0.984
#> SRR2061473 2 0.1184 0.991 0.016 0.984
#> SRR2061472 2 0.1184 0.991 0.016 0.984
#> SRR2061470 1 0.1184 0.991 0.984 0.016
#> SRR2061469 1 0.1184 0.991 0.984 0.016
#> SRR2061455 1 0.0000 0.991 1.000 0.000
#> SRR2061454 1 0.0000 0.991 1.000 0.000
#> SRR2061452 1 0.0000 0.991 1.000 0.000
#> SRR2061453 1 0.0000 0.991 1.000 0.000
#> SRR2061450 1 0.0000 0.991 1.000 0.000
#> SRR2061451 1 0.0000 0.991 1.000 0.000
#> SRR2061448 1 0.1184 0.991 0.984 0.016
#> SRR2061471 2 0.1184 0.991 0.016 0.984
#> SRR2061449 1 0.1184 0.991 0.984 0.016
#> SRR2061447 1 0.1184 0.991 0.984 0.016
#> SRR2061446 1 0.1184 0.991 0.984 0.016
#> SRR2061444 1 0.1184 0.991 0.984 0.016
#> SRR2061443 1 0.1184 0.991 0.984 0.016
#> SRR2061442 1 0.1184 0.991 0.984 0.016
#> SRR2061441 1 0.1184 0.991 0.984 0.016
#> SRR2061445 1 0.1184 0.991 0.984 0.016
#> SRR2061439 1 0.0000 0.991 1.000 0.000
#> SRR2061440 1 0.0000 0.991 1.000 0.000
#> SRR2061437 1 0.0000 0.991 1.000 0.000
#> SRR2061438 1 0.0000 0.991 1.000 0.000
#> SRR2061435 1 0.0000 0.991 1.000 0.000
#> SRR2061436 1 0.0000 0.991 1.000 0.000
#> SRR2061433 1 0.0000 0.991 1.000 0.000
#> SRR2061434 1 0.0000 0.991 1.000 0.000
#> SRR2061432 1 0.0000 0.991 1.000 0.000
#> SRR2061431 1 0.1184 0.991 0.984 0.016
#> SRR2061429 1 0.1184 0.991 0.984 0.016
#> SRR2061430 1 0.1184 0.991 0.984 0.016
#> SRR2061428 1 0.1184 0.991 0.984 0.016
#> SRR2061426 1 0.1184 0.991 0.984 0.016
#> SRR2061427 1 0.2043 0.980 0.968 0.032
#> SRR2061425 1 0.1184 0.991 0.984 0.016
#> SRR2061424 1 0.1184 0.991 0.984 0.016
#> SRR2061423 1 0.1184 0.991 0.984 0.016
#> SRR2061422 1 0.0000 0.991 1.000 0.000
#> SRR2061421 1 0.0938 0.983 0.988 0.012
#> SRR2061420 1 0.1184 0.991 0.984 0.016
#> SRR2061419 1 0.0000 0.991 1.000 0.000
#> SRR2061418 1 0.0000 0.991 1.000 0.000
#> SRR2061417 1 0.0000 0.991 1.000 0.000
#> SRR2061415 1 0.2043 0.965 0.968 0.032
#> SRR2061416 1 0.0000 0.991 1.000 0.000
#> SRR2061414 1 0.0000 0.991 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.7382 0.5854 0.456 0.512 0.032
#> SRR2061467 2 0.7382 0.5854 0.456 0.512 0.032
#> SRR2061466 2 0.7382 0.5854 0.456 0.512 0.032
#> SRR2061464 2 0.7382 0.5854 0.456 0.512 0.032
#> SRR2061465 2 0.7382 0.5854 0.456 0.512 0.032
#> SRR2061463 2 0.8033 0.5910 0.424 0.512 0.064
#> SRR2061462 2 0.8033 0.5910 0.424 0.512 0.064
#> SRR2061460 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061459 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061461 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061458 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061457 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061481 3 0.0237 0.9964 0.004 0.000 0.996
#> SRR2061488 3 0.0475 0.9940 0.004 0.004 0.992
#> SRR2061456 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061487 3 0.0475 0.9940 0.004 0.004 0.992
#> SRR2061485 3 0.0237 0.9964 0.004 0.000 0.996
#> SRR2061486 3 0.0475 0.9940 0.004 0.004 0.992
#> SRR2061484 3 0.0237 0.9964 0.004 0.000 0.996
#> SRR2061482 3 0.0237 0.9964 0.004 0.000 0.996
#> SRR2061480 3 0.0237 0.9964 0.004 0.000 0.996
#> SRR2061483 3 0.0237 0.9964 0.004 0.000 0.996
#> SRR2061478 3 0.0000 0.9965 0.000 0.000 1.000
#> SRR2061477 3 0.0000 0.9965 0.000 0.000 1.000
#> SRR2061475 3 0.0000 0.9965 0.000 0.000 1.000
#> SRR2061474 3 0.0000 0.9965 0.000 0.000 1.000
#> SRR2061476 3 0.0000 0.9965 0.000 0.000 1.000
#> SRR2061473 3 0.0000 0.9965 0.000 0.000 1.000
#> SRR2061472 3 0.0000 0.9965 0.000 0.000 1.000
#> SRR2061470 2 0.7382 0.5854 0.456 0.512 0.032
#> SRR2061469 2 0.7382 0.5854 0.456 0.512 0.032
#> SRR2061455 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061454 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061452 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061453 2 0.1411 0.6059 0.000 0.964 0.036
#> SRR2061450 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061451 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061448 1 0.2918 0.5108 0.924 0.044 0.032
#> SRR2061471 3 0.0000 0.9965 0.000 0.000 1.000
#> SRR2061449 1 0.2918 0.5108 0.924 0.044 0.032
#> SRR2061447 1 0.3134 0.5000 0.916 0.052 0.032
#> SRR2061446 1 0.1289 0.5529 0.968 0.000 0.032
#> SRR2061444 1 0.2313 0.5328 0.944 0.024 0.032
#> SRR2061443 1 0.1289 0.5529 0.968 0.000 0.032
#> SRR2061442 1 0.1289 0.5529 0.968 0.000 0.032
#> SRR2061441 1 0.1289 0.5529 0.968 0.000 0.032
#> SRR2061445 1 0.1289 0.5529 0.968 0.000 0.032
#> SRR2061439 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061440 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061437 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061438 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061435 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061436 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061433 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061434 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061432 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061431 1 0.6183 0.0689 0.732 0.236 0.032
#> SRR2061429 1 0.6855 -0.1971 0.652 0.316 0.032
#> SRR2061430 1 0.3623 0.4686 0.896 0.072 0.032
#> SRR2061428 1 0.2031 0.5405 0.952 0.016 0.032
#> SRR2061426 1 0.3028 0.5056 0.920 0.048 0.032
#> SRR2061427 1 0.2031 0.5405 0.952 0.016 0.032
#> SRR2061425 1 0.1289 0.5529 0.968 0.000 0.032
#> SRR2061424 1 0.1289 0.5529 0.968 0.000 0.032
#> SRR2061423 1 0.1289 0.5529 0.968 0.000 0.032
#> SRR2061422 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061421 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061420 1 0.1399 0.5543 0.968 0.004 0.028
#> SRR2061419 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061418 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061417 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061415 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061416 1 0.6225 0.6242 0.568 0.432 0.000
#> SRR2061414 1 0.6225 0.6242 0.568 0.432 0.000
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0469 0.953 0.000 0.988 0.000 0.012
#> SRR2061467 2 0.0469 0.953 0.000 0.988 0.000 0.012
#> SRR2061466 2 0.0469 0.953 0.000 0.988 0.000 0.012
#> SRR2061464 2 0.4134 0.690 0.000 0.740 0.000 0.260
#> SRR2061465 2 0.0469 0.953 0.000 0.988 0.000 0.012
#> SRR2061463 2 0.4134 0.690 0.000 0.740 0.000 0.260
#> SRR2061462 2 0.4134 0.690 0.000 0.740 0.000 0.260
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061481 3 0.0817 0.982 0.000 0.024 0.976 0.000
#> SRR2061488 3 0.0921 0.981 0.000 0.028 0.972 0.000
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061487 3 0.0921 0.981 0.000 0.028 0.972 0.000
#> SRR2061485 3 0.0921 0.981 0.000 0.028 0.972 0.000
#> SRR2061486 3 0.0921 0.981 0.000 0.028 0.972 0.000
#> SRR2061484 3 0.0921 0.981 0.000 0.028 0.972 0.000
#> SRR2061482 3 0.0817 0.982 0.000 0.024 0.976 0.000
#> SRR2061480 3 0.0817 0.982 0.000 0.024 0.976 0.000
#> SRR2061483 3 0.0921 0.981 0.000 0.028 0.972 0.000
#> SRR2061478 3 0.0000 0.980 0.000 0.000 1.000 0.000
#> SRR2061477 3 0.0000 0.980 0.000 0.000 1.000 0.000
#> SRR2061475 3 0.0000 0.980 0.000 0.000 1.000 0.000
#> SRR2061474 3 0.0000 0.980 0.000 0.000 1.000 0.000
#> SRR2061476 3 0.0000 0.980 0.000 0.000 1.000 0.000
#> SRR2061473 3 0.0000 0.980 0.000 0.000 1.000 0.000
#> SRR2061472 3 0.0000 0.980 0.000 0.000 1.000 0.000
#> SRR2061470 2 0.0469 0.953 0.000 0.988 0.000 0.012
#> SRR2061469 2 0.0469 0.953 0.000 0.988 0.000 0.012
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061452 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> SRR2061450 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061451 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061448 2 0.0000 0.956 0.000 1.000 0.000 0.000
#> SRR2061471 3 0.0000 0.980 0.000 0.000 1.000 0.000
#> SRR2061449 2 0.0000 0.956 0.000 1.000 0.000 0.000
#> SRR2061447 2 0.0000 0.956 0.000 1.000 0.000 0.000
#> SRR2061446 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061444 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061443 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061442 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061441 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061445 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061439 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061440 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061437 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061438 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061435 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061436 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061433 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061434 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061432 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061431 2 0.0000 0.956 0.000 1.000 0.000 0.000
#> SRR2061429 2 0.0921 0.941 0.000 0.972 0.000 0.028
#> SRR2061430 2 0.0000 0.956 0.000 1.000 0.000 0.000
#> SRR2061428 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061426 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061427 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061425 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061424 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061423 2 0.0188 0.957 0.004 0.996 0.000 0.000
#> SRR2061422 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061421 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061420 2 0.3610 0.745 0.200 0.800 0.000 0.000
#> SRR2061419 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061418 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061417 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061415 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061416 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR2061414 1 0.0000 1.000 1.000 0.000 0.000 0.000
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.3508 0.820 0.000 0.748 0.252 0 0.000
#> SRR2061467 2 0.3508 0.820 0.000 0.748 0.252 0 0.000
#> SRR2061466 2 0.3508 0.820 0.000 0.748 0.252 0 0.000
#> SRR2061464 2 0.3143 0.829 0.000 0.796 0.204 0 0.000
#> SRR2061465 2 0.3508 0.820 0.000 0.748 0.252 0 0.000
#> SRR2061463 2 0.3177 0.827 0.000 0.792 0.208 0 0.000
#> SRR2061462 2 0.3177 0.827 0.000 0.792 0.208 0 0.000
#> SRR2061460 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061459 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061461 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061458 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061457 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061481 3 0.3837 0.982 0.000 0.000 0.692 0 0.308
#> SRR2061488 3 0.4484 0.961 0.000 0.024 0.668 0 0.308
#> SRR2061456 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061487 3 0.4484 0.961 0.000 0.024 0.668 0 0.308
#> SRR2061485 3 0.3837 0.982 0.000 0.000 0.692 0 0.308
#> SRR2061486 3 0.4400 0.966 0.000 0.020 0.672 0 0.308
#> SRR2061484 3 0.3837 0.982 0.000 0.000 0.692 0 0.308
#> SRR2061482 3 0.3837 0.982 0.000 0.000 0.692 0 0.308
#> SRR2061480 3 0.3837 0.982 0.000 0.000 0.692 0 0.308
#> SRR2061483 3 0.3837 0.982 0.000 0.000 0.692 0 0.308
#> SRR2061478 5 0.0000 1.000 0.000 0.000 0.000 0 1.000
#> SRR2061477 5 0.0000 1.000 0.000 0.000 0.000 0 1.000
#> SRR2061475 5 0.0000 1.000 0.000 0.000 0.000 0 1.000
#> SRR2061474 5 0.0000 1.000 0.000 0.000 0.000 0 1.000
#> SRR2061476 5 0.0000 1.000 0.000 0.000 0.000 0 1.000
#> SRR2061473 5 0.0000 1.000 0.000 0.000 0.000 0 1.000
#> SRR2061472 5 0.0000 1.000 0.000 0.000 0.000 0 1.000
#> SRR2061470 2 0.3508 0.820 0.000 0.748 0.252 0 0.000
#> SRR2061469 2 0.3508 0.820 0.000 0.748 0.252 0 0.000
#> SRR2061455 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061454 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061452 1 0.0290 0.989 0.992 0.000 0.008 0 0.000
#> SRR2061453 4 0.0000 1.000 0.000 0.000 0.000 1 0.000
#> SRR2061450 1 0.0290 0.989 0.992 0.000 0.008 0 0.000
#> SRR2061451 1 0.0290 0.989 0.992 0.000 0.008 0 0.000
#> SRR2061448 2 0.1121 0.883 0.000 0.956 0.044 0 0.000
#> SRR2061471 5 0.0000 1.000 0.000 0.000 0.000 0 1.000
#> SRR2061449 2 0.1121 0.883 0.000 0.956 0.044 0 0.000
#> SRR2061447 2 0.1121 0.883 0.000 0.956 0.044 0 0.000
#> SRR2061446 2 0.1638 0.871 0.004 0.932 0.064 0 0.000
#> SRR2061444 2 0.1043 0.884 0.000 0.960 0.040 0 0.000
#> SRR2061443 2 0.1764 0.870 0.008 0.928 0.064 0 0.000
#> SRR2061442 2 0.1857 0.870 0.008 0.928 0.060 0 0.004
#> SRR2061441 2 0.1764 0.870 0.008 0.928 0.064 0 0.000
#> SRR2061445 2 0.1764 0.870 0.008 0.928 0.064 0 0.000
#> SRR2061439 1 0.1408 0.945 0.948 0.044 0.008 0 0.000
#> SRR2061440 1 0.1408 0.945 0.948 0.044 0.008 0 0.000
#> SRR2061437 1 0.0000 0.989 1.000 0.000 0.000 0 0.000
#> SRR2061438 1 0.0162 0.987 0.996 0.004 0.000 0 0.000
#> SRR2061435 1 0.0510 0.987 0.984 0.000 0.016 0 0.000
#> SRR2061436 1 0.0290 0.989 0.992 0.000 0.008 0 0.000
#> SRR2061433 1 0.0000 0.989 1.000 0.000 0.000 0 0.000
#> SRR2061434 1 0.0510 0.987 0.984 0.000 0.016 0 0.000
#> SRR2061432 1 0.0000 0.989 1.000 0.000 0.000 0 0.000
#> SRR2061431 2 0.1270 0.883 0.000 0.948 0.052 0 0.000
#> SRR2061429 2 0.1121 0.883 0.000 0.956 0.044 0 0.000
#> SRR2061430 2 0.1197 0.883 0.000 0.952 0.048 0 0.000
#> SRR2061428 2 0.1041 0.880 0.000 0.964 0.032 0 0.004
#> SRR2061426 2 0.0290 0.883 0.000 0.992 0.008 0 0.000
#> SRR2061427 2 0.1124 0.880 0.000 0.960 0.036 0 0.004
#> SRR2061425 2 0.1764 0.870 0.008 0.928 0.064 0 0.000
#> SRR2061424 2 0.1857 0.870 0.008 0.928 0.060 0 0.004
#> SRR2061423 2 0.1638 0.871 0.004 0.932 0.064 0 0.000
#> SRR2061422 1 0.0510 0.987 0.984 0.000 0.016 0 0.000
#> SRR2061421 1 0.0510 0.987 0.984 0.000 0.016 0 0.000
#> SRR2061420 2 0.4794 0.427 0.344 0.624 0.032 0 0.000
#> SRR2061419 1 0.0000 0.989 1.000 0.000 0.000 0 0.000
#> SRR2061418 1 0.0000 0.989 1.000 0.000 0.000 0 0.000
#> SRR2061417 1 0.0162 0.989 0.996 0.000 0.004 0 0.000
#> SRR2061415 1 0.0510 0.987 0.984 0.000 0.016 0 0.000
#> SRR2061416 1 0.0000 0.989 1.000 0.000 0.000 0 0.000
#> SRR2061414 1 0.0290 0.988 0.992 0.000 0.008 0 0.000
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.0000 0.8354 0.000 1.000 0.000 0 0.000 0
#> SRR2061467 2 0.0000 0.8354 0.000 1.000 0.000 0 0.000 0
#> SRR2061466 2 0.0000 0.8354 0.000 1.000 0.000 0 0.000 0
#> SRR2061464 2 0.0363 0.8360 0.000 0.988 0.000 0 0.012 0
#> SRR2061465 2 0.0000 0.8354 0.000 1.000 0.000 0 0.000 0
#> SRR2061463 2 0.0363 0.8360 0.000 0.988 0.000 0 0.012 0
#> SRR2061462 2 0.0363 0.8360 0.000 0.988 0.000 0 0.012 0
#> SRR2061460 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061459 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061461 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061458 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061457 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061481 3 0.0000 0.9981 0.000 0.000 1.000 0 0.000 0
#> SRR2061488 3 0.0146 0.9961 0.000 0.004 0.996 0 0.000 0
#> SRR2061456 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061487 3 0.0146 0.9961 0.000 0.004 0.996 0 0.000 0
#> SRR2061485 3 0.0000 0.9981 0.000 0.000 1.000 0 0.000 0
#> SRR2061486 3 0.0146 0.9961 0.000 0.004 0.996 0 0.000 0
#> SRR2061484 3 0.0000 0.9981 0.000 0.000 1.000 0 0.000 0
#> SRR2061482 3 0.0000 0.9981 0.000 0.000 1.000 0 0.000 0
#> SRR2061480 3 0.0000 0.9981 0.000 0.000 1.000 0 0.000 0
#> SRR2061483 3 0.0000 0.9981 0.000 0.000 1.000 0 0.000 0
#> SRR2061478 6 0.0000 1.0000 0.000 0.000 0.000 0 0.000 1
#> SRR2061477 6 0.0000 1.0000 0.000 0.000 0.000 0 0.000 1
#> SRR2061475 6 0.0000 1.0000 0.000 0.000 0.000 0 0.000 1
#> SRR2061474 6 0.0000 1.0000 0.000 0.000 0.000 0 0.000 1
#> SRR2061476 6 0.0000 1.0000 0.000 0.000 0.000 0 0.000 1
#> SRR2061473 6 0.0000 1.0000 0.000 0.000 0.000 0 0.000 1
#> SRR2061472 6 0.0000 1.0000 0.000 0.000 0.000 0 0.000 1
#> SRR2061470 2 0.0000 0.8354 0.000 1.000 0.000 0 0.000 0
#> SRR2061469 2 0.0000 0.8354 0.000 1.000 0.000 0 0.000 0
#> SRR2061455 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061454 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061452 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061453 4 0.0000 1.0000 0.000 0.000 0.000 1 0.000 0
#> SRR2061450 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061451 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061448 2 0.3464 0.7551 0.000 0.688 0.000 0 0.312 0
#> SRR2061471 6 0.0000 1.0000 0.000 0.000 0.000 0 0.000 1
#> SRR2061449 2 0.3309 0.7879 0.000 0.720 0.000 0 0.280 0
#> SRR2061447 2 0.3288 0.7910 0.000 0.724 0.000 0 0.276 0
#> SRR2061446 5 0.0260 0.9947 0.000 0.008 0.000 0 0.992 0
#> SRR2061444 2 0.3351 0.7811 0.000 0.712 0.000 0 0.288 0
#> SRR2061443 5 0.0146 0.9993 0.000 0.004 0.000 0 0.996 0
#> SRR2061442 5 0.0146 0.9993 0.000 0.004 0.000 0 0.996 0
#> SRR2061441 5 0.0146 0.9993 0.000 0.004 0.000 0 0.996 0
#> SRR2061445 5 0.0146 0.9993 0.000 0.004 0.000 0 0.996 0
#> SRR2061439 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061440 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061437 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061438 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061435 1 0.0146 0.9721 0.996 0.000 0.000 0 0.004 0
#> SRR2061436 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061433 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061434 1 0.0146 0.9721 0.996 0.000 0.000 0 0.004 0
#> SRR2061432 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061431 2 0.2793 0.8229 0.000 0.800 0.000 0 0.200 0
#> SRR2061429 2 0.2664 0.8264 0.000 0.816 0.000 0 0.184 0
#> SRR2061430 2 0.3198 0.7994 0.000 0.740 0.000 0 0.260 0
#> SRR2061428 2 0.3674 0.7875 0.000 0.716 0.016 0 0.268 0
#> SRR2061426 2 0.3023 0.8128 0.000 0.768 0.000 0 0.232 0
#> SRR2061427 2 0.4789 0.7147 0.000 0.640 0.092 0 0.268 0
#> SRR2061425 5 0.0146 0.9993 0.000 0.004 0.000 0 0.996 0
#> SRR2061424 5 0.0146 0.9993 0.000 0.004 0.000 0 0.996 0
#> SRR2061423 5 0.0146 0.9993 0.000 0.004 0.000 0 0.996 0
#> SRR2061422 1 0.0146 0.9721 0.996 0.000 0.000 0 0.004 0
#> SRR2061421 1 0.0146 0.9721 0.996 0.000 0.000 0 0.004 0
#> SRR2061420 1 0.3868 0.0224 0.504 0.000 0.000 0 0.496 0
#> SRR2061419 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061418 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061417 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061415 1 0.0146 0.9721 0.996 0.000 0.000 0 0.004 0
#> SRR2061416 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
#> SRR2061414 1 0.0000 0.9738 1.000 0.000 0.000 0 0.000 0
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.
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.
ATC:NMF**
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"]
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 14886 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)

The plots are:
- The first row: a plot of the ECDF (empirical cumulative distribution
function) curves of the consensus matrix for each
k
and the heatmap of
predicted classes for each k
.
- The second row: heatmaps of the consensus matrix for each
k
.
- The third row: heatmaps of the membership matrix for each
k
.
- The fouth row: heatmaps of the signatures for each
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:
- ECDF curves of the consensus matrix for each
k
;
- 1-PAC. The PAC
score
measures the proportion of the ambiguous subgrouping.
- Mean silhouette score.
- Concordance. The mean probability of fiting the consensus class ids in all
partitions.
- Area increased. Denote \(A_k\) as the area under the ECDF curve for current
k
, the area increased is defined as \(A_k - A_{k-1}\).
- Rand index. The percent of pairs of samples that are both in a same cluster
or both are not in a same cluster in the partition of k and k-1.
- Jaccard index. The ratio of pairs of samples are both in a same cluster in
the partition of k and k-1 and the pairs of samples are both in a same
cluster in the partition k or 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.969 0.987 0.4953 0.502 0.502
#> 3 3 0.793 0.826 0.912 0.3037 0.786 0.596
#> 4 4 0.665 0.650 0.842 0.1349 0.818 0.529
#> 5 5 0.678 0.553 0.760 0.0546 0.894 0.627
#> 6 6 0.709 0.693 0.802 0.0224 0.862 0.512
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
- All \(k\) with Jaccard index larger than 0.95 are removed because increasing
\(k\) does not provide enough extra information. If all \(k\) are removed, it is
marked as no subgroup is detected.
- For all \(k\) with 1-PAC score larger than 0.9, the maximal \(k\) is taken as
the best \(k\), and other \(k\) are marked as optional \(k\).
- If it does not fit the second rule. The \(k\) with the maximal vote of the
highest 1-PAC score, highest mean silhouette, and highest concordance is
taken as the best \(k\).
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.
show/hide code output
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR2061468 2 0.0000 0.975 0.000 1.000
#> SRR2061467 2 0.0000 0.975 0.000 1.000
#> SRR2061466 2 0.0000 0.975 0.000 1.000
#> SRR2061464 2 0.0000 0.975 0.000 1.000
#> SRR2061465 2 0.0000 0.975 0.000 1.000
#> SRR2061463 2 0.0000 0.975 0.000 1.000
#> SRR2061462 2 0.0000 0.975 0.000 1.000
#> SRR2061460 1 0.0000 0.995 1.000 0.000
#> SRR2061459 1 0.0000 0.995 1.000 0.000
#> SRR2061461 1 0.0000 0.995 1.000 0.000
#> SRR2061458 1 0.0000 0.995 1.000 0.000
#> SRR2061457 1 0.0000 0.995 1.000 0.000
#> SRR2061481 2 0.4022 0.899 0.080 0.920
#> SRR2061488 2 0.0000 0.975 0.000 1.000
#> SRR2061456 1 0.0000 0.995 1.000 0.000
#> SRR2061487 2 0.0000 0.975 0.000 1.000
#> SRR2061485 2 0.0000 0.975 0.000 1.000
#> SRR2061486 2 0.0000 0.975 0.000 1.000
#> SRR2061484 2 0.0000 0.975 0.000 1.000
#> SRR2061482 2 0.9248 0.502 0.340 0.660
#> SRR2061480 2 0.9209 0.511 0.336 0.664
#> SRR2061483 2 0.0000 0.975 0.000 1.000
#> SRR2061478 1 0.0000 0.995 1.000 0.000
#> SRR2061477 1 0.0000 0.995 1.000 0.000
#> SRR2061475 1 0.0000 0.995 1.000 0.000
#> SRR2061474 1 0.0000 0.995 1.000 0.000
#> SRR2061476 1 0.0000 0.995 1.000 0.000
#> SRR2061473 1 0.0000 0.995 1.000 0.000
#> SRR2061472 1 0.0000 0.995 1.000 0.000
#> SRR2061470 2 0.0000 0.975 0.000 1.000
#> SRR2061469 2 0.0000 0.975 0.000 1.000
#> SRR2061455 1 0.0000 0.995 1.000 0.000
#> SRR2061454 1 0.0000 0.995 1.000 0.000
#> SRR2061452 1 0.0000 0.995 1.000 0.000
#> SRR2061453 1 0.0000 0.995 1.000 0.000
#> SRR2061450 1 0.0000 0.995 1.000 0.000
#> SRR2061451 1 0.0000 0.995 1.000 0.000
#> SRR2061448 2 0.0000 0.975 0.000 1.000
#> SRR2061471 1 0.0000 0.995 1.000 0.000
#> SRR2061449 2 0.0000 0.975 0.000 1.000
#> SRR2061447 2 0.0000 0.975 0.000 1.000
#> SRR2061446 2 0.0000 0.975 0.000 1.000
#> SRR2061444 2 0.0000 0.975 0.000 1.000
#> SRR2061443 1 0.0672 0.987 0.992 0.008
#> SRR2061442 1 0.0000 0.995 1.000 0.000
#> SRR2061441 1 0.7056 0.752 0.808 0.192
#> SRR2061445 2 0.0000 0.975 0.000 1.000
#> SRR2061439 1 0.0000 0.995 1.000 0.000
#> SRR2061440 1 0.0000 0.995 1.000 0.000
#> SRR2061437 1 0.0000 0.995 1.000 0.000
#> SRR2061438 1 0.0000 0.995 1.000 0.000
#> SRR2061435 1 0.0000 0.995 1.000 0.000
#> SRR2061436 1 0.0000 0.995 1.000 0.000
#> SRR2061433 1 0.0000 0.995 1.000 0.000
#> SRR2061434 1 0.0000 0.995 1.000 0.000
#> SRR2061432 1 0.0000 0.995 1.000 0.000
#> SRR2061431 2 0.0000 0.975 0.000 1.000
#> SRR2061429 2 0.0000 0.975 0.000 1.000
#> SRR2061430 2 0.0000 0.975 0.000 1.000
#> SRR2061428 2 0.0000 0.975 0.000 1.000
#> SRR2061426 2 0.0000 0.975 0.000 1.000
#> SRR2061427 2 0.0000 0.975 0.000 1.000
#> SRR2061425 2 0.0672 0.968 0.008 0.992
#> SRR2061424 1 0.0000 0.995 1.000 0.000
#> SRR2061423 2 0.0000 0.975 0.000 1.000
#> SRR2061422 1 0.0000 0.995 1.000 0.000
#> SRR2061421 1 0.0000 0.995 1.000 0.000
#> SRR2061420 1 0.0000 0.995 1.000 0.000
#> SRR2061419 1 0.0000 0.995 1.000 0.000
#> SRR2061418 1 0.0000 0.995 1.000 0.000
#> SRR2061417 1 0.0000 0.995 1.000 0.000
#> SRR2061415 1 0.0000 0.995 1.000 0.000
#> SRR2061416 1 0.0000 0.995 1.000 0.000
#> SRR2061414 1 0.0000 0.995 1.000 0.000
show/hide code output
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR2061468 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061467 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061466 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061464 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061465 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061463 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061462 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061460 3 0.5968 0.511 0.364 0.000 0.636
#> SRR2061459 3 0.5948 0.518 0.360 0.000 0.640
#> SRR2061461 1 0.5529 0.605 0.704 0.000 0.296
#> SRR2061458 1 0.5560 0.597 0.700 0.000 0.300
#> SRR2061457 3 0.6079 0.458 0.388 0.000 0.612
#> SRR2061481 3 0.1964 0.758 0.000 0.056 0.944
#> SRR2061488 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061456 3 0.5785 0.559 0.332 0.000 0.668
#> SRR2061487 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061485 2 0.2448 0.922 0.000 0.924 0.076
#> SRR2061486 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061484 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061482 3 0.1753 0.765 0.000 0.048 0.952
#> SRR2061480 3 0.1753 0.765 0.000 0.048 0.952
#> SRR2061483 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061478 3 0.0237 0.793 0.004 0.000 0.996
#> SRR2061477 3 0.0237 0.793 0.004 0.000 0.996
#> SRR2061475 3 0.0237 0.793 0.004 0.000 0.996
#> SRR2061474 3 0.3412 0.753 0.124 0.000 0.876
#> SRR2061476 3 0.0237 0.793 0.004 0.000 0.996
#> SRR2061473 3 0.0237 0.793 0.004 0.000 0.996
#> SRR2061472 3 0.0237 0.793 0.004 0.000 0.996
#> SRR2061470 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061469 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061455 1 0.5560 0.597 0.700 0.000 0.300
#> SRR2061454 3 0.6026 0.487 0.376 0.000 0.624
#> SRR2061452 1 0.3551 0.824 0.868 0.000 0.132
#> SRR2061453 3 0.6225 0.330 0.432 0.000 0.568
#> SRR2061450 1 0.3192 0.837 0.888 0.000 0.112
#> SRR2061451 1 0.3267 0.835 0.884 0.000 0.116
#> SRR2061448 2 0.2096 0.950 0.052 0.944 0.004
#> SRR2061471 3 0.3038 0.763 0.104 0.000 0.896
#> SRR2061449 2 0.0237 0.985 0.004 0.996 0.000
#> SRR2061447 2 0.0237 0.985 0.004 0.996 0.000
#> SRR2061446 2 0.1878 0.956 0.044 0.952 0.004
#> SRR2061444 2 0.1525 0.965 0.032 0.964 0.004
#> SRR2061443 1 0.0475 0.840 0.992 0.004 0.004
#> SRR2061442 1 0.0000 0.845 1.000 0.000 0.000
#> SRR2061441 1 0.2772 0.756 0.916 0.080 0.004
#> SRR2061445 2 0.3112 0.908 0.096 0.900 0.004
#> SRR2061439 1 0.1031 0.855 0.976 0.000 0.024
#> SRR2061440 1 0.0000 0.845 1.000 0.000 0.000
#> SRR2061437 1 0.0747 0.852 0.984 0.000 0.016
#> SRR2061438 1 0.0237 0.843 0.996 0.000 0.004
#> SRR2061435 1 0.3686 0.818 0.860 0.000 0.140
#> SRR2061436 1 0.3267 0.835 0.884 0.000 0.116
#> SRR2061433 1 0.1643 0.858 0.956 0.000 0.044
#> SRR2061434 1 0.3267 0.835 0.884 0.000 0.116
#> SRR2061432 1 0.1031 0.855 0.976 0.000 0.024
#> SRR2061431 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061429 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061430 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061428 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061426 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061427 2 0.0000 0.988 0.000 1.000 0.000
#> SRR2061425 1 0.6521 -0.124 0.504 0.492 0.004
#> SRR2061424 1 0.0237 0.843 0.996 0.000 0.004
#> SRR2061423 2 0.1163 0.971 0.028 0.972 0.000
#> SRR2061422 1 0.4654 0.746 0.792 0.000 0.208
#> SRR2061421 1 0.4702 0.741 0.788 0.000 0.212
#> SRR2061420 1 0.0237 0.843 0.996 0.000 0.004
#> SRR2061419 1 0.1529 0.858 0.960 0.000 0.040
#> SRR2061418 1 0.1411 0.857 0.964 0.000 0.036
#> SRR2061417 1 0.1860 0.857 0.948 0.000 0.052
#> SRR2061415 1 0.5497 0.613 0.708 0.000 0.292
#> SRR2061416 1 0.1529 0.858 0.960 0.000 0.040
#> SRR2061414 1 0.1860 0.857 0.948 0.000 0.052
show/hide code output
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR2061468 2 0.0000 0.8641 0.000 1.000 0.000 0.000
#> SRR2061467 2 0.0188 0.8642 0.004 0.996 0.000 0.000
#> SRR2061466 2 0.0188 0.8642 0.004 0.996 0.000 0.000
#> SRR2061464 2 0.4675 0.6551 0.020 0.736 0.000 0.244
#> SRR2061465 2 0.0188 0.8642 0.004 0.996 0.000 0.000
#> SRR2061463 2 0.4690 0.6368 0.016 0.724 0.000 0.260
#> SRR2061462 2 0.5062 0.6073 0.024 0.692 0.000 0.284
#> SRR2061460 4 0.0188 0.7353 0.000 0.000 0.004 0.996
#> SRR2061459 4 0.0469 0.7355 0.000 0.000 0.012 0.988
#> SRR2061461 4 0.0188 0.7353 0.000 0.000 0.004 0.996
#> SRR2061458 4 0.0188 0.7353 0.000 0.000 0.004 0.996
#> SRR2061457 4 0.0336 0.7357 0.000 0.000 0.008 0.992
#> SRR2061481 3 0.0524 0.8055 0.004 0.008 0.988 0.000
#> SRR2061488 2 0.4072 0.5874 0.000 0.748 0.252 0.000
#> SRR2061456 4 0.0592 0.7346 0.000 0.000 0.016 0.984
#> SRR2061487 2 0.2345 0.7941 0.000 0.900 0.100 0.000
#> SRR2061485 3 0.4872 0.4026 0.004 0.356 0.640 0.000
#> SRR2061486 2 0.3172 0.7285 0.000 0.840 0.160 0.000
#> SRR2061484 3 0.5168 0.0683 0.004 0.492 0.504 0.000
#> SRR2061482 3 0.0376 0.8067 0.004 0.004 0.992 0.000
#> SRR2061480 3 0.0376 0.8067 0.004 0.004 0.992 0.000
#> SRR2061483 3 0.5165 0.0973 0.004 0.484 0.512 0.000
#> SRR2061478 3 0.0469 0.8086 0.000 0.000 0.988 0.012
#> SRR2061477 3 0.0592 0.8077 0.000 0.000 0.984 0.016
#> SRR2061475 3 0.0469 0.8086 0.000 0.000 0.988 0.012
#> SRR2061474 3 0.5172 0.1922 0.008 0.000 0.588 0.404
#> SRR2061476 3 0.1211 0.7954 0.000 0.000 0.960 0.040
#> SRR2061473 3 0.0921 0.8030 0.000 0.000 0.972 0.028
#> SRR2061472 3 0.0469 0.8086 0.000 0.000 0.988 0.012
#> SRR2061470 2 0.0188 0.8641 0.004 0.996 0.000 0.000
#> SRR2061469 2 0.0000 0.8641 0.000 1.000 0.000 0.000
#> SRR2061455 4 0.0188 0.7353 0.000 0.000 0.004 0.996
#> SRR2061454 4 0.0469 0.7355 0.000 0.000 0.012 0.988
#> SRR2061452 4 0.4990 0.4974 0.352 0.000 0.008 0.640
#> SRR2061453 4 0.0592 0.7352 0.000 0.000 0.016 0.984
#> SRR2061450 1 0.5168 -0.1332 0.504 0.000 0.004 0.492
#> SRR2061451 4 0.5161 0.1573 0.476 0.000 0.004 0.520
#> SRR2061448 2 0.4624 0.5612 0.340 0.660 0.000 0.000
#> SRR2061471 3 0.4560 0.4606 0.004 0.000 0.700 0.296
#> SRR2061449 2 0.0469 0.8628 0.012 0.988 0.000 0.000
#> SRR2061447 2 0.0469 0.8631 0.012 0.988 0.000 0.000
#> SRR2061446 2 0.5000 0.2503 0.496 0.504 0.000 0.000
#> SRR2061444 2 0.2973 0.7800 0.144 0.856 0.000 0.000
#> SRR2061443 1 0.0376 0.7258 0.992 0.000 0.004 0.004
#> SRR2061442 1 0.0779 0.7313 0.980 0.000 0.004 0.016
#> SRR2061441 1 0.1296 0.7112 0.964 0.028 0.004 0.004
#> SRR2061445 1 0.4535 0.3187 0.704 0.292 0.004 0.000
#> SRR2061439 1 0.3219 0.7140 0.836 0.000 0.000 0.164
#> SRR2061440 1 0.1867 0.7382 0.928 0.000 0.000 0.072
#> SRR2061437 1 0.3266 0.7124 0.832 0.000 0.000 0.168
#> SRR2061438 1 0.1867 0.7383 0.928 0.000 0.000 0.072
#> SRR2061435 4 0.4567 0.6073 0.276 0.000 0.008 0.716
#> SRR2061436 4 0.5158 0.1655 0.472 0.000 0.004 0.524
#> SRR2061433 1 0.4483 0.5846 0.712 0.000 0.004 0.284
#> SRR2061434 4 0.4905 0.4718 0.364 0.000 0.004 0.632
#> SRR2061432 1 0.4222 0.6111 0.728 0.000 0.000 0.272
#> SRR2061431 2 0.0000 0.8641 0.000 1.000 0.000 0.000
#> SRR2061429 2 0.0188 0.8641 0.004 0.996 0.000 0.000
#> SRR2061430 2 0.0188 0.8641 0.004 0.996 0.000 0.000
#> SRR2061428 2 0.0592 0.8615 0.016 0.984 0.000 0.000
#> SRR2061426 2 0.0188 0.8642 0.004 0.996 0.000 0.000
#> SRR2061427 2 0.1109 0.8563 0.028 0.968 0.004 0.000
#> SRR2061425 1 0.2266 0.6552 0.912 0.084 0.004 0.000
#> SRR2061424 1 0.0657 0.7298 0.984 0.000 0.004 0.012
#> SRR2061423 2 0.4188 0.6985 0.244 0.752 0.004 0.000
#> SRR2061422 4 0.4764 0.6494 0.220 0.000 0.032 0.748
#> SRR2061421 4 0.4706 0.6325 0.248 0.000 0.020 0.732
#> SRR2061420 1 0.1022 0.7267 0.968 0.000 0.000 0.032
#> SRR2061419 1 0.4655 0.5263 0.684 0.000 0.004 0.312
#> SRR2061418 1 0.3908 0.6773 0.784 0.000 0.004 0.212
#> SRR2061417 1 0.4907 0.2126 0.580 0.000 0.000 0.420
#> SRR2061415 4 0.4867 0.6414 0.232 0.000 0.032 0.736
#> SRR2061416 1 0.4103 0.6326 0.744 0.000 0.000 0.256
#> SRR2061414 4 0.4989 0.1715 0.472 0.000 0.000 0.528
show/hide code output
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR2061468 2 0.0290 0.8965 0.000 0.992 0.000 0.000 0.008
#> SRR2061467 2 0.0794 0.8941 0.000 0.972 0.000 0.000 0.028
#> SRR2061466 2 0.0794 0.8941 0.000 0.972 0.000 0.000 0.028
#> SRR2061464 5 0.7498 0.4087 0.088 0.156 0.000 0.268 0.488
#> SRR2061465 2 0.0963 0.8921 0.000 0.964 0.000 0.000 0.036
#> SRR2061463 5 0.6777 0.4057 0.032 0.136 0.000 0.324 0.508
#> SRR2061462 5 0.6432 0.3984 0.020 0.116 0.000 0.344 0.520
#> SRR2061460 4 0.1270 0.5889 0.000 0.000 0.000 0.948 0.052
#> SRR2061459 4 0.1124 0.5995 0.000 0.000 0.004 0.960 0.036
#> SRR2061461 4 0.2304 0.5410 0.008 0.000 0.000 0.892 0.100
#> SRR2061458 4 0.1282 0.6420 0.004 0.000 0.000 0.952 0.044
#> SRR2061457 4 0.0162 0.6277 0.000 0.000 0.000 0.996 0.004
#> SRR2061481 3 0.1106 0.7795 0.024 0.000 0.964 0.000 0.012
#> SRR2061488 2 0.3055 0.8145 0.000 0.840 0.144 0.000 0.016
#> SRR2061456 4 0.0693 0.6244 0.000 0.000 0.008 0.980 0.012
#> SRR2061487 2 0.1444 0.8884 0.000 0.948 0.040 0.000 0.012
#> SRR2061485 3 0.5122 -0.1782 0.004 0.472 0.496 0.000 0.028
#> SRR2061486 2 0.2124 0.8602 0.000 0.900 0.096 0.000 0.004
#> SRR2061484 2 0.4449 0.6083 0.004 0.688 0.288 0.000 0.020
#> SRR2061482 3 0.1364 0.7741 0.036 0.000 0.952 0.000 0.012
#> SRR2061480 3 0.1012 0.7808 0.020 0.000 0.968 0.000 0.012
#> SRR2061483 2 0.5061 0.3567 0.008 0.572 0.396 0.000 0.024
#> SRR2061478 3 0.0794 0.7983 0.000 0.000 0.972 0.028 0.000
#> SRR2061477 3 0.1671 0.7988 0.000 0.000 0.924 0.076 0.000
#> SRR2061475 3 0.1121 0.8025 0.000 0.000 0.956 0.044 0.000
#> SRR2061474 3 0.5989 0.2184 0.000 0.000 0.536 0.336 0.128
#> SRR2061476 3 0.2124 0.7949 0.000 0.000 0.900 0.096 0.004
#> SRR2061473 3 0.2124 0.7948 0.000 0.000 0.900 0.096 0.004
#> SRR2061472 3 0.1671 0.8015 0.000 0.000 0.924 0.076 0.000
#> SRR2061470 2 0.0000 0.8965 0.000 1.000 0.000 0.000 0.000
#> SRR2061469 2 0.0162 0.8965 0.000 0.996 0.000 0.000 0.004
#> SRR2061455 4 0.1357 0.6435 0.004 0.000 0.000 0.948 0.048
#> SRR2061454 4 0.0324 0.6281 0.000 0.000 0.004 0.992 0.004
#> SRR2061452 4 0.5351 0.5587 0.060 0.000 0.000 0.560 0.380
#> SRR2061453 4 0.0865 0.6432 0.000 0.000 0.004 0.972 0.024
#> SRR2061450 4 0.6672 0.2246 0.232 0.000 0.000 0.392 0.376
#> SRR2061451 4 0.6377 0.3793 0.168 0.000 0.000 0.452 0.380
#> SRR2061448 2 0.3399 0.8036 0.168 0.812 0.000 0.000 0.020
#> SRR2061471 3 0.5446 0.4350 0.000 0.000 0.628 0.272 0.100
#> SRR2061449 2 0.1211 0.8897 0.024 0.960 0.000 0.000 0.016
#> SRR2061447 2 0.1579 0.8832 0.032 0.944 0.000 0.000 0.024
#> SRR2061446 2 0.4573 0.6736 0.256 0.700 0.000 0.000 0.044
#> SRR2061444 2 0.2377 0.8454 0.128 0.872 0.000 0.000 0.000
#> SRR2061443 5 0.4664 0.2886 0.436 0.008 0.004 0.000 0.552
#> SRR2061442 1 0.4443 -0.2733 0.524 0.000 0.000 0.004 0.472
#> SRR2061441 5 0.5206 0.3393 0.416 0.036 0.004 0.000 0.544
#> SRR2061445 1 0.5535 -0.0758 0.536 0.392 0.000 0.000 0.072
#> SRR2061439 1 0.5913 0.4579 0.524 0.000 0.000 0.112 0.364
#> SRR2061440 1 0.5019 0.4916 0.632 0.000 0.000 0.052 0.316
#> SRR2061437 1 0.5996 0.4483 0.512 0.000 0.000 0.120 0.368
#> SRR2061438 1 0.3849 0.4090 0.752 0.000 0.000 0.016 0.232
#> SRR2061435 4 0.4302 0.6218 0.004 0.000 0.004 0.648 0.344
#> SRR2061436 4 0.5541 0.5395 0.076 0.000 0.000 0.552 0.372
#> SRR2061433 1 0.6598 0.2966 0.412 0.000 0.000 0.212 0.376
#> SRR2061434 4 0.4800 0.5929 0.028 0.000 0.000 0.604 0.368
#> SRR2061432 5 0.6823 -0.4501 0.336 0.000 0.000 0.320 0.344
#> SRR2061431 2 0.0162 0.8959 0.000 0.996 0.000 0.000 0.004
#> SRR2061429 2 0.0992 0.8912 0.008 0.968 0.000 0.000 0.024
#> SRR2061430 2 0.0290 0.8953 0.000 0.992 0.000 0.000 0.008
#> SRR2061428 2 0.1792 0.8703 0.000 0.916 0.000 0.000 0.084
#> SRR2061426 2 0.0794 0.8941 0.000 0.972 0.000 0.000 0.028
#> SRR2061427 2 0.2843 0.8244 0.008 0.848 0.000 0.000 0.144
#> SRR2061425 5 0.5854 0.3608 0.408 0.060 0.016 0.000 0.516
#> SRR2061424 1 0.4533 -0.3415 0.544 0.000 0.008 0.000 0.448
#> SRR2061423 5 0.5862 0.3847 0.344 0.112 0.000 0.000 0.544
#> SRR2061422 4 0.4317 0.6275 0.004 0.000 0.008 0.668 0.320
#> SRR2061421 4 0.4478 0.6133 0.008 0.000 0.004 0.628 0.360
#> SRR2061420 1 0.2719 0.0808 0.852 0.000 0.000 0.004 0.144
#> SRR2061419 5 0.6802 -0.4696 0.328 0.000 0.000 0.300 0.372
#> SRR2061418 1 0.6372 0.3812 0.456 0.000 0.000 0.168 0.376
#> SRR2061417 4 0.6463 0.3867 0.192 0.000 0.000 0.464 0.344
#> SRR2061415 4 0.4402 0.6176 0.000 0.000 0.012 0.636 0.352
#> SRR2061416 1 0.6593 0.3003 0.420 0.000 0.000 0.212 0.368
#> SRR2061414 4 0.5901 0.5268 0.116 0.000 0.000 0.540 0.344
show/hide code output
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR2061468 2 0.0405 0.88937 0.000 0.988 0.000 0.000 0.004 0.008
#> SRR2061467 2 0.0951 0.88825 0.000 0.968 0.004 0.000 0.020 0.008
#> SRR2061466 2 0.1413 0.88415 0.000 0.948 0.004 0.004 0.036 0.008
#> SRR2061464 4 0.6182 0.07927 0.000 0.028 0.116 0.484 0.364 0.008
#> SRR2061465 2 0.1598 0.88261 0.000 0.940 0.004 0.008 0.040 0.008
#> SRR2061463 4 0.5174 0.12006 0.000 0.012 0.040 0.508 0.432 0.008
#> SRR2061462 4 0.5015 0.14904 0.000 0.008 0.036 0.528 0.420 0.008
#> SRR2061460 4 0.3777 0.71216 0.216 0.000 0.020 0.752 0.012 0.000
#> SRR2061459 4 0.4198 0.68945 0.316 0.000 0.024 0.656 0.004 0.000
#> SRR2061461 4 0.4055 0.67010 0.140 0.000 0.040 0.780 0.040 0.000
#> SRR2061458 4 0.4025 0.68178 0.232 0.000 0.048 0.720 0.000 0.000
#> SRR2061457 4 0.3634 0.70106 0.296 0.000 0.008 0.696 0.000 0.000
#> SRR2061481 6 0.1267 0.82361 0.000 0.000 0.000 0.000 0.060 0.940
#> SRR2061488 2 0.2700 0.80912 0.000 0.836 0.004 0.004 0.000 0.156
#> SRR2061456 4 0.3861 0.66010 0.352 0.000 0.008 0.640 0.000 0.000
#> SRR2061487 2 0.1531 0.87158 0.000 0.928 0.004 0.000 0.000 0.068
#> SRR2061485 2 0.4269 0.55998 0.000 0.636 0.004 0.004 0.016 0.340
#> SRR2061486 2 0.1588 0.87072 0.000 0.924 0.000 0.004 0.000 0.072
#> SRR2061484 2 0.3302 0.73311 0.000 0.760 0.000 0.004 0.004 0.232
#> SRR2061482 6 0.1714 0.80752 0.000 0.000 0.000 0.000 0.092 0.908
#> SRR2061480 6 0.1387 0.82120 0.000 0.000 0.000 0.000 0.068 0.932
#> SRR2061483 2 0.3875 0.65813 0.000 0.700 0.000 0.004 0.016 0.280
#> SRR2061478 6 0.0881 0.83540 0.012 0.000 0.008 0.008 0.000 0.972
#> SRR2061477 6 0.2100 0.83610 0.112 0.000 0.000 0.004 0.000 0.884
#> SRR2061475 6 0.2062 0.84789 0.088 0.000 0.004 0.008 0.000 0.900
#> SRR2061474 1 0.4208 -0.00272 0.536 0.000 0.008 0.004 0.000 0.452
#> SRR2061476 6 0.2766 0.81336 0.140 0.000 0.008 0.008 0.000 0.844
#> SRR2061473 6 0.2512 0.83453 0.116 0.000 0.008 0.008 0.000 0.868
#> SRR2061472 6 0.1841 0.85146 0.064 0.000 0.008 0.008 0.000 0.920
#> SRR2061470 2 0.0405 0.88966 0.000 0.988 0.004 0.000 0.000 0.008
#> SRR2061469 2 0.0405 0.88937 0.000 0.988 0.000 0.000 0.004 0.008
#> SRR2061455 4 0.4142 0.67896 0.232 0.000 0.056 0.712 0.000 0.000
#> SRR2061454 4 0.3499 0.68807 0.320 0.000 0.000 0.680 0.000 0.000
#> SRR2061452 1 0.2258 0.69844 0.896 0.000 0.044 0.060 0.000 0.000
#> SRR2061453 4 0.3817 0.52898 0.432 0.000 0.000 0.568 0.000 0.000
#> SRR2061450 1 0.1829 0.70238 0.920 0.000 0.056 0.024 0.000 0.000
#> SRR2061451 1 0.1261 0.70943 0.952 0.000 0.024 0.024 0.000 0.000
#> SRR2061448 2 0.2616 0.84321 0.008 0.888 0.064 0.008 0.032 0.000
#> SRR2061471 6 0.4158 0.29984 0.416 0.000 0.008 0.004 0.000 0.572
#> SRR2061449 2 0.0436 0.88817 0.004 0.988 0.004 0.004 0.000 0.000
#> SRR2061447 2 0.0551 0.88806 0.004 0.984 0.004 0.008 0.000 0.000
#> SRR2061446 2 0.3476 0.83737 0.028 0.848 0.064 0.020 0.040 0.000
#> SRR2061444 2 0.1007 0.88848 0.004 0.968 0.008 0.004 0.016 0.000
#> SRR2061443 5 0.1565 0.91262 0.008 0.000 0.032 0.008 0.944 0.008
#> SRR2061442 5 0.2735 0.87279 0.036 0.000 0.068 0.012 0.880 0.004
#> SRR2061441 5 0.0909 0.91600 0.000 0.000 0.020 0.012 0.968 0.000
#> SRR2061445 2 0.7138 0.39095 0.048 0.512 0.232 0.060 0.148 0.000
#> SRR2061439 1 0.4238 0.36628 0.636 0.000 0.340 0.008 0.016 0.000
#> SRR2061440 3 0.5379 0.12188 0.432 0.000 0.480 0.012 0.076 0.000
#> SRR2061437 1 0.3903 0.44972 0.680 0.000 0.304 0.012 0.004 0.000
#> SRR2061438 3 0.5659 0.58812 0.208 0.000 0.620 0.036 0.136 0.000
#> SRR2061435 1 0.2402 0.67627 0.868 0.000 0.012 0.120 0.000 0.000
#> SRR2061436 1 0.1644 0.70540 0.920 0.000 0.004 0.076 0.000 0.000
#> SRR2061433 1 0.2778 0.65999 0.824 0.000 0.168 0.008 0.000 0.000
#> SRR2061434 1 0.2163 0.69489 0.892 0.000 0.016 0.092 0.000 0.000
#> SRR2061432 1 0.3957 0.56023 0.696 0.000 0.280 0.020 0.004 0.000
#> SRR2061431 2 0.0000 0.88871 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2061429 2 0.0909 0.88619 0.000 0.968 0.020 0.012 0.000 0.000
#> SRR2061430 2 0.0146 0.88876 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR2061428 2 0.1985 0.87251 0.000 0.916 0.008 0.008 0.064 0.004
#> SRR2061426 2 0.1147 0.88697 0.000 0.960 0.004 0.004 0.028 0.004
#> SRR2061427 2 0.4601 0.60633 0.000 0.668 0.032 0.016 0.280 0.004
#> SRR2061425 5 0.0713 0.91938 0.000 0.000 0.028 0.000 0.972 0.000
#> SRR2061424 5 0.3392 0.83268 0.024 0.000 0.108 0.024 0.836 0.008
#> SRR2061423 5 0.0603 0.90520 0.000 0.000 0.004 0.016 0.980 0.000
#> SRR2061422 1 0.4251 0.57151 0.748 0.000 0.092 0.152 0.008 0.000
#> SRR2061421 1 0.2506 0.69277 0.880 0.000 0.052 0.068 0.000 0.000
#> SRR2061420 3 0.5037 0.25875 0.036 0.000 0.636 0.044 0.284 0.000
#> SRR2061419 1 0.2653 0.67810 0.844 0.000 0.144 0.012 0.000 0.000
#> SRR2061418 1 0.3721 0.53785 0.728 0.000 0.252 0.016 0.004 0.000
#> SRR2061417 1 0.3979 0.62002 0.720 0.000 0.244 0.032 0.004 0.000
#> SRR2061415 1 0.2331 0.69437 0.888 0.000 0.032 0.080 0.000 0.000
#> SRR2061416 1 0.3245 0.58698 0.764 0.000 0.228 0.008 0.000 0.000
#> SRR2061414 1 0.3551 0.66509 0.772 0.000 0.192 0.036 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.
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.
Session info
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