Date: 2019-12-25 23:37:28 CET, cola version: 1.3.2
Document is loading...
All available functions which can be applied to this res_list
object:
res_list
#> A 'ConsensusPartitionList' object with 24 methods.
#> On a matrix with 17171 rows and 84 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] 17171 84
The density distribution for each sample is visualized as in one column in the following heatmap. The clustering is based on the distance which is the Kolmogorov-Smirnov statistic between two distributions.
library(ComplexHeatmap)
densityHeatmap(mat, ylab = "value", cluster_columns = TRUE, show_column_names = FALSE,
mc.cores = 4)
Folowing table shows the best k
(number of partitions) for each combination
of top-value methods and partition methods. Clicking on the method name in
the table goes to the section for a single combination of methods.
The cola vignette explains the definition of the metrics used for determining the best number of partitions.
suggest_best_k(res_list)
The best k | 1-PAC | Mean silhouette | Concordance | Optional k | ||
---|---|---|---|---|---|---|
SD:pam | 6 | 1.000 | 0.964 | 0.975 | ** | 3,4 |
CV:hclust | 2 | 1.000 | 1.000 | 1.000 | ** | |
CV:skmeans | 3 | 1.000 | 1.000 | 1.000 | ** | 2 |
MAD:hclust | 6 | 1.000 | 0.962 | 0.985 | ** | 4,5 |
MAD:kmeans | 3 | 1.000 | 0.986 | 0.950 | ** | |
MAD:pam | 6 | 1.000 | 0.979 | 0.991 | ** | 2,3,5 |
ATC:kmeans | 3 | 1.000 | 0.993 | 0.997 | ** | |
ATC:skmeans | 5 | 1.000 | 0.994 | 0.988 | ** | 2,3 |
ATC:pam | 6 | 1.000 | 0.975 | 0.991 | ** | 2,3,4,5 |
CV:pam | 6 | 0.982 | 0.933 | 0.969 | ** | 2,3,4 |
MAD:NMF | 6 | 0.975 | 0.927 | 0.968 | ** | 3,4 |
MAD:skmeans | 6 | 0.966 | 0.905 | 0.939 | ** | 3,4,5 |
SD:NMF | 4 | 0.961 | 0.956 | 0.968 | ** | 3 |
ATC:mclust | 6 | 0.936 | 0.958 | 0.955 | * | 3,4,5 |
SD:hclust | 6 | 0.931 | 0.908 | 0.952 | * | 2 |
MAD:mclust | 6 | 0.931 | 0.816 | 0.909 | * | 3,5 |
SD:mclust | 6 | 0.921 | 0.917 | 0.944 | * | 3,4 |
CV:NMF | 4 | 0.917 | 0.941 | 0.943 | * | 2,3 |
SD:skmeans | 6 | 0.915 | 0.896 | 0.924 | * | 3,4,5 |
ATC:NMF | 5 | 0.903 | 0.925 | 0.940 | * | 2,3,4 |
CV:mclust | 5 | 0.900 | 0.761 | 0.912 | * | 4 |
ATC:hclust | 3 | 0.896 | 0.903 | 0.956 | ||
SD:kmeans | 3 | 0.706 | 0.980 | 0.933 | ||
CV:kmeans | 3 | 0.668 | 0.962 | 0.915 |
**: 1-PAC > 0.95, *: 1-PAC > 0.9
Cumulative distribution function curves of consensus matrix for all methods.
collect_plots(res_list, fun = plot_ecdf)
Consensus heatmaps for all methods. (What is a consensus heatmap?)
collect_plots(res_list, k = 2, fun = consensus_heatmap, mc.cores = 4)
collect_plots(res_list, k = 3, fun = consensus_heatmap, mc.cores = 4)
collect_plots(res_list, k = 4, fun = consensus_heatmap, mc.cores = 4)
collect_plots(res_list, k = 5, fun = consensus_heatmap, mc.cores = 4)
collect_plots(res_list, k = 6, fun = consensus_heatmap, mc.cores = 4)
Membership heatmaps for all methods. (What is a membership heatmap?)
collect_plots(res_list, k = 2, fun = membership_heatmap, mc.cores = 4)
collect_plots(res_list, k = 3, fun = membership_heatmap, mc.cores = 4)
collect_plots(res_list, k = 4, fun = membership_heatmap, mc.cores = 4)
collect_plots(res_list, k = 5, fun = membership_heatmap, mc.cores = 4)
collect_plots(res_list, k = 6, fun = membership_heatmap, mc.cores = 4)
Signature heatmaps for all methods. (What is a signature heatmap?)
Note in following heatmaps, rows are scaled.
collect_plots(res_list, k = 2, fun = get_signatures, mc.cores = 4)
collect_plots(res_list, k = 3, fun = get_signatures, mc.cores = 4)
collect_plots(res_list, k = 4, fun = get_signatures, mc.cores = 4)
collect_plots(res_list, k = 5, fun = get_signatures, mc.cores = 4)
collect_plots(res_list, k = 6, fun = get_signatures, mc.cores = 4)
The statistics used for measuring the stability of consensus partitioning. (How are they defined?)
get_stats(res_list, k = 2)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 2 0.651 0.823 0.923 0.445 0.577 0.577
#> CV:NMF 2 0.946 0.936 0.971 0.426 0.587 0.587
#> MAD:NMF 2 0.561 0.755 0.897 0.475 0.501 0.501
#> ATC:NMF 2 1.000 0.962 0.986 0.442 0.559 0.559
#> SD:skmeans 2 0.522 0.802 0.901 0.448 0.550 0.550
#> CV:skmeans 2 1.000 0.981 0.993 0.394 0.609 0.609
#> MAD:skmeans 2 0.352 0.868 0.914 0.476 0.535 0.535
#> ATC:skmeans 2 0.950 0.961 0.982 0.496 0.504 0.504
#> SD:mclust 2 0.501 0.859 0.879 0.452 0.523 0.523
#> CV:mclust 2 0.408 0.487 0.715 0.442 0.517 0.517
#> MAD:mclust 2 0.801 0.921 0.939 0.450 0.523 0.523
#> ATC:mclust 2 0.788 0.945 0.972 0.422 0.598 0.598
#> SD:kmeans 2 0.495 0.819 0.833 0.394 0.620 0.620
#> CV:kmeans 2 0.501 0.865 0.892 0.399 0.620 0.620
#> MAD:kmeans 2 0.357 0.744 0.787 0.403 0.620 0.620
#> ATC:kmeans 2 0.529 0.886 0.906 0.452 0.542 0.542
#> SD:pam 2 0.494 0.737 0.777 0.383 0.633 0.633
#> CV:pam 2 1.000 0.966 0.969 0.380 0.620 0.620
#> MAD:pam 2 1.000 0.974 0.991 0.411 0.587 0.587
#> ATC:pam 2 1.000 0.955 0.983 0.439 0.567 0.567
#> SD:hclust 2 1.000 1.000 1.000 0.380 0.620 0.620
#> CV:hclust 2 1.000 1.000 1.000 0.380 0.620 0.620
#> MAD:hclust 2 0.542 0.808 0.874 0.419 0.620 0.620
#> ATC:hclust 2 0.855 0.903 0.953 0.465 0.512 0.512
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 1.000 0.978 0.991 0.4537 0.697 0.510
#> CV:NMF 3 1.000 0.965 0.984 0.5177 0.703 0.519
#> MAD:NMF 3 1.000 0.956 0.983 0.3779 0.679 0.450
#> ATC:NMF 3 1.000 0.986 0.995 0.4812 0.745 0.559
#> SD:skmeans 3 1.000 0.964 0.985 0.4477 0.674 0.471
#> CV:skmeans 3 1.000 1.000 1.000 0.6475 0.730 0.561
#> MAD:skmeans 3 0.964 0.940 0.976 0.3796 0.734 0.535
#> ATC:skmeans 3 1.000 0.974 0.983 0.3382 0.739 0.527
#> SD:mclust 3 1.000 0.998 0.998 0.4329 0.770 0.583
#> CV:mclust 3 0.779 0.890 0.942 0.4141 0.753 0.558
#> MAD:mclust 3 1.000 1.000 1.000 0.4413 0.770 0.583
#> ATC:mclust 3 0.934 0.971 0.985 0.5378 0.759 0.597
#> SD:kmeans 3 0.706 0.980 0.933 0.5355 0.736 0.575
#> CV:kmeans 3 0.668 0.962 0.915 0.5025 0.731 0.567
#> MAD:kmeans 3 1.000 0.986 0.950 0.5303 0.736 0.575
#> ATC:kmeans 3 1.000 0.993 0.997 0.4441 0.727 0.531
#> SD:pam 3 1.000 0.994 0.997 0.6609 0.729 0.573
#> CV:pam 3 1.000 0.949 0.980 0.6704 0.680 0.511
#> MAD:pam 3 1.000 0.975 0.991 0.5576 0.771 0.609
#> ATC:pam 3 1.000 0.981 0.991 0.4233 0.788 0.634
#> SD:hclust 3 0.826 0.862 0.930 0.7077 0.736 0.575
#> CV:hclust 3 1.000 0.994 0.993 0.0883 0.970 0.952
#> MAD:hclust 3 0.872 0.960 0.975 0.5715 0.717 0.544
#> ATC:hclust 3 0.896 0.903 0.956 0.4168 0.825 0.659
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.961 0.956 0.968 0.0636 0.957 0.879
#> CV:NMF 4 0.917 0.941 0.943 0.0715 0.961 0.891
#> MAD:NMF 4 0.900 0.907 0.939 0.0749 0.944 0.840
#> ATC:NMF 4 1.000 0.976 0.986 0.0776 0.948 0.851
#> SD:skmeans 4 0.903 0.960 0.962 0.1363 0.908 0.743
#> CV:skmeans 4 0.871 0.938 0.921 0.1415 0.893 0.695
#> MAD:skmeans 4 1.000 0.993 0.997 0.1205 0.907 0.735
#> ATC:skmeans 4 0.875 0.889 0.923 0.1135 0.913 0.746
#> SD:mclust 4 1.000 0.979 0.993 0.0463 0.961 0.891
#> CV:mclust 4 0.991 0.972 0.961 0.1009 0.961 0.891
#> MAD:mclust 4 0.881 0.954 0.957 0.0624 0.961 0.891
#> ATC:mclust 4 1.000 0.985 0.990 0.1257 0.908 0.743
#> SD:kmeans 4 0.802 0.575 0.858 0.1567 0.989 0.969
#> CV:kmeans 4 0.824 0.822 0.859 0.1493 0.977 0.935
#> MAD:kmeans 4 0.831 0.868 0.888 0.1405 1.000 1.000
#> ATC:kmeans 4 0.878 0.901 0.920 0.1117 0.907 0.736
#> SD:pam 4 1.000 0.995 0.998 0.0566 0.960 0.891
#> CV:pam 4 1.000 0.970 0.989 0.0606 0.952 0.869
#> MAD:pam 4 0.872 0.945 0.960 0.0695 0.961 0.891
#> ATC:pam 4 1.000 0.966 0.974 0.1908 0.858 0.633
#> SD:hclust 4 0.865 0.942 0.900 0.0914 0.908 0.743
#> CV:hclust 4 0.623 0.677 0.839 0.3966 0.965 0.941
#> MAD:hclust 4 1.000 0.997 0.994 0.1130 0.927 0.785
#> ATC:hclust 4 0.894 0.937 0.951 0.0839 0.927 0.785
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.886 0.723 0.911 0.0655 0.989 0.966
#> CV:NMF 5 0.835 0.664 0.858 0.0937 0.989 0.966
#> MAD:NMF 5 0.894 0.872 0.923 0.0691 0.919 0.736
#> ATC:NMF 5 0.903 0.925 0.940 0.0381 0.963 0.880
#> SD:skmeans 5 0.906 0.730 0.874 0.0570 0.966 0.870
#> CV:skmeans 5 0.848 0.910 0.917 0.0594 0.961 0.843
#> MAD:skmeans 5 0.903 0.953 0.941 0.0483 0.970 0.887
#> ATC:skmeans 5 1.000 0.994 0.988 0.0728 0.940 0.775
#> SD:mclust 5 0.893 0.922 0.935 0.1126 0.924 0.768
#> CV:mclust 5 0.900 0.761 0.912 0.0783 0.969 0.903
#> MAD:mclust 5 0.933 0.895 0.957 0.1096 0.901 0.697
#> ATC:mclust 5 1.000 0.993 0.997 0.0054 0.984 0.942
#> SD:kmeans 5 0.770 0.782 0.766 0.0716 0.904 0.727
#> CV:kmeans 5 0.769 0.740 0.811 0.0889 0.892 0.684
#> MAD:kmeans 5 0.780 0.856 0.849 0.0783 0.908 0.743
#> ATC:kmeans 5 0.796 0.706 0.863 0.0600 0.994 0.978
#> SD:pam 5 0.882 0.895 0.942 0.1660 0.888 0.657
#> CV:pam 5 0.895 0.824 0.930 0.1664 0.890 0.663
#> MAD:pam 5 1.000 0.980 0.991 0.1418 0.886 0.650
#> ATC:pam 5 1.000 0.993 0.997 0.0552 0.952 0.813
#> SD:hclust 5 0.889 0.891 0.902 0.0755 0.970 0.887
#> CV:hclust 5 0.805 0.895 0.950 0.2512 0.708 0.477
#> MAD:hclust 5 1.000 0.987 0.995 0.0412 0.972 0.894
#> ATC:hclust 5 0.959 0.932 0.973 0.0388 0.995 0.981
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.885 0.933 0.926 0.0502 0.885 0.632
#> CV:NMF 6 0.819 0.688 0.826 0.0625 0.841 0.502
#> MAD:NMF 6 0.975 0.927 0.968 0.0376 0.987 0.944
#> ATC:NMF 6 0.852 0.700 0.879 0.0626 0.956 0.846
#> SD:skmeans 6 0.915 0.896 0.924 0.0504 0.919 0.665
#> CV:skmeans 6 0.894 0.838 0.915 0.0411 0.986 0.935
#> MAD:skmeans 6 0.966 0.905 0.939 0.0609 0.940 0.746
#> ATC:skmeans 6 0.943 0.909 0.929 0.0247 1.000 1.000
#> SD:mclust 6 0.921 0.917 0.944 0.0774 0.915 0.678
#> CV:mclust 6 0.811 0.714 0.832 0.0622 0.898 0.646
#> MAD:mclust 6 0.931 0.816 0.909 0.0634 0.940 0.744
#> ATC:mclust 6 0.936 0.958 0.955 0.0461 0.964 0.865
#> SD:kmeans 6 0.758 0.688 0.792 0.0569 0.962 0.857
#> CV:kmeans 6 0.727 0.767 0.810 0.0548 0.921 0.702
#> MAD:kmeans 6 0.775 0.730 0.787 0.0522 0.953 0.823
#> ATC:kmeans 6 0.804 0.739 0.808 0.0397 0.942 0.787
#> SD:pam 6 1.000 0.964 0.975 0.0510 0.924 0.675
#> CV:pam 6 0.982 0.933 0.969 0.0510 0.938 0.727
#> MAD:pam 6 1.000 0.979 0.991 0.0541 0.930 0.696
#> ATC:pam 6 1.000 0.975 0.991 0.0512 0.920 0.658
#> SD:hclust 6 0.931 0.908 0.952 0.0513 0.966 0.854
#> CV:hclust 6 0.866 0.734 0.861 0.0582 0.977 0.916
#> MAD:hclust 6 1.000 0.962 0.985 0.0392 0.966 0.855
#> ATC:hclust 6 0.893 0.899 0.926 0.0496 0.972 0.892
Following heatmap plots the partition for each combination of methods and the lightness correspond to the silhouette scores for samples in each method. On top the consensus subgroup is inferred from all methods by taking the mean silhouette scores as weight.
collect_stats(res_list, k = 2)
collect_stats(res_list, k = 3)
collect_stats(res_list, k = 4)
collect_stats(res_list, k = 5)
collect_stats(res_list, k = 6)
Collect partitions from all methods:
collect_classes(res_list, k = 2)
collect_classes(res_list, k = 3)
collect_classes(res_list, k = 4)
collect_classes(res_list, k = 5)
collect_classes(res_list, k = 6)
Overlap of top rows from different top-row methods:
top_rows_overlap(res_list, top_n = 1000, method = "euler")
top_rows_overlap(res_list, top_n = 2000, method = "euler")
top_rows_overlap(res_list, top_n = 3000, method = "euler")
top_rows_overlap(res_list, top_n = 4000, method = "euler")
top_rows_overlap(res_list, top_n = 5000, method = "euler")
Also visualize the correspondance of rankings between different top-row methods:
top_rows_overlap(res_list, top_n = 1000, method = "correspondance")
top_rows_overlap(res_list, top_n = 2000, method = "correspondance")
top_rows_overlap(res_list, top_n = 3000, method = "correspondance")
top_rows_overlap(res_list, top_n = 4000, method = "correspondance")
top_rows_overlap(res_list, top_n = 5000, method = "correspondance")
Heatmaps of the top rows:
top_rows_heatmap(res_list, top_n = 1000)
top_rows_heatmap(res_list, top_n = 2000)
top_rows_heatmap(res_list, top_n = 3000)
top_rows_heatmap(res_list, top_n = 4000)
top_rows_heatmap(res_list, top_n = 5000)
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "hclust"]
# you can also extract it by
# res = res_list["SD:hclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 1.000 1.000 0.3801 0.620 0.620
#> 3 3 0.826 0.862 0.930 0.7077 0.736 0.575
#> 4 4 0.865 0.942 0.900 0.0914 0.908 0.743
#> 5 5 0.889 0.891 0.902 0.0755 0.970 0.887
#> 6 6 0.931 0.908 0.952 0.0513 0.966 0.854
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0 1 0 1
#> SRR901150 1 0 1 1 0
#> SRR901151 1 0 1 1 0
#> SRR901152 1 0 1 1 0
#> SRR1382100 2 0 1 0 1
#> SRR901154 1 0 1 1 0
#> SRR901155 1 0 1 1 0
#> SRR901156 1 0 1 1 0
#> SRR901157 2 0 1 0 1
#> SRR901158 1 0 1 1 0
#> SRR901159 1 0 1 1 0
#> SRR901160 1 0 1 1 0
#> SRR901161 2 0 1 0 1
#> SRR901162 1 0 1 1 0
#> SRR901163 1 0 1 1 0
#> SRR901164 1 0 1 1 0
#> SRR901165 2 0 1 0 1
#> SRR901166 1 0 1 1 0
#> SRR901167 1 0 1 1 0
#> SRR901168 1 0 1 1 0
#> SRR901169 2 0 1 0 1
#> SRR901170 1 0 1 1 0
#> SRR901171 1 0 1 1 0
#> SRR901172 1 0 1 1 0
#> SRR901173 2 0 1 0 1
#> SRR901174 1 0 1 1 0
#> SRR901175 1 0 1 1 0
#> SRR901176 1 0 1 1 0
#> SRR901177 2 0 1 0 1
#> SRR901178 1 0 1 1 0
#> SRR901179 1 0 1 1 0
#> SRR901180 1 0 1 1 0
#> SRR901181 2 0 1 0 1
#> SRR901182 1 0 1 1 0
#> SRR901183 1 0 1 1 0
#> SRR901184 1 0 1 1 0
#> SRR901185 2 0 1 0 1
#> SRR901187 1 0 1 1 0
#> SRR901186 1 0 1 1 0
#> SRR901188 1 0 1 1 0
#> SRR901189 2 0 1 0 1
#> SRR901190 1 0 1 1 0
#> SRR901191 1 0 1 1 0
#> SRR901192 1 0 1 1 0
#> SRR901193 2 0 1 0 1
#> SRR901194 1 0 1 1 0
#> SRR901195 1 0 1 1 0
#> SRR901196 1 0 1 1 0
#> SRR901197 2 0 1 0 1
#> SRR901198 1 0 1 1 0
#> SRR901199 1 0 1 1 0
#> SRR901200 1 0 1 1 0
#> SRR901201 2 0 1 0 1
#> SRR901202 1 0 1 1 0
#> SRR901203 1 0 1 1 0
#> SRR901204 1 0 1 1 0
#> SRR901205 2 0 1 0 1
#> SRR901206 1 0 1 1 0
#> SRR901207 1 0 1 1 0
#> SRR901208 1 0 1 1 0
#> SRR901209 2 0 1 0 1
#> SRR901211 1 0 1 1 0
#> SRR901210 1 0 1 1 0
#> SRR901212 1 0 1 1 0
#> SRR901213 2 0 1 0 1
#> SRR901214 1 0 1 1 0
#> SRR901215 1 0 1 1 0
#> SRR901216 1 0 1 1 0
#> SRR901217 2 0 1 0 1
#> SRR901218 1 0 1 1 0
#> SRR901219 1 0 1 1 0
#> SRR901220 1 0 1 1 0
#> SRR901221 2 0 1 0 1
#> SRR901222 1 0 1 1 0
#> SRR901223 1 0 1 1 0
#> SRR901224 1 0 1 1 0
#> SRR901225 2 0 1 0 1
#> SRR901226 1 0 1 1 0
#> SRR901227 1 0 1 1 0
#> SRR901229 2 0 1 0 1
#> SRR901228 1 0 1 1 0
#> SRR901230 1 0 1 1 0
#> SRR901231 1 0 1 1 0
#> SRR901232 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.000 1.000 0.000 0.000 1
#> SRR901150 1 0.000 1.000 1.000 0.000 0
#> SRR901151 1 0.000 1.000 1.000 0.000 0
#> SRR901152 1 0.000 1.000 1.000 0.000 0
#> SRR1382100 3 0.000 1.000 0.000 0.000 1
#> SRR901154 2 0.116 0.845 0.028 0.972 0
#> SRR901155 2 0.116 0.845 0.028 0.972 0
#> SRR901156 2 0.116 0.845 0.028 0.972 0
#> SRR901157 3 0.000 1.000 0.000 0.000 1
#> SRR901158 1 0.000 1.000 1.000 0.000 0
#> SRR901159 1 0.000 1.000 1.000 0.000 0
#> SRR901160 1 0.000 1.000 1.000 0.000 0
#> SRR901161 3 0.000 1.000 0.000 0.000 1
#> SRR901162 2 0.630 0.372 0.476 0.524 0
#> SRR901163 2 0.630 0.372 0.476 0.524 0
#> SRR901164 2 0.000 0.835 0.000 1.000 0
#> SRR901165 3 0.000 1.000 0.000 0.000 1
#> SRR901166 1 0.000 1.000 1.000 0.000 0
#> SRR901167 1 0.000 1.000 1.000 0.000 0
#> SRR901168 1 0.000 1.000 1.000 0.000 0
#> SRR901169 3 0.000 1.000 0.000 0.000 1
#> SRR901170 2 0.000 0.835 0.000 1.000 0
#> SRR901171 2 0.000 0.835 0.000 1.000 0
#> SRR901172 2 0.000 0.835 0.000 1.000 0
#> SRR901173 3 0.000 1.000 0.000 0.000 1
#> SRR901174 1 0.000 1.000 1.000 0.000 0
#> SRR901175 1 0.000 1.000 1.000 0.000 0
#> SRR901176 2 0.000 0.835 0.000 1.000 0
#> SRR901177 3 0.000 1.000 0.000 0.000 1
#> SRR901178 2 0.116 0.845 0.028 0.972 0
#> SRR901179 2 0.116 0.845 0.028 0.972 0
#> SRR901180 2 0.116 0.845 0.028 0.972 0
#> SRR901181 3 0.000 1.000 0.000 0.000 1
#> SRR901182 1 0.000 1.000 1.000 0.000 0
#> SRR901183 1 0.000 1.000 1.000 0.000 0
#> SRR901184 1 0.000 1.000 1.000 0.000 0
#> SRR901185 3 0.000 1.000 0.000 0.000 1
#> SRR901187 2 0.116 0.845 0.028 0.972 0
#> SRR901186 2 0.116 0.845 0.028 0.972 0
#> SRR901188 2 0.116 0.845 0.028 0.972 0
#> SRR901189 3 0.000 1.000 0.000 0.000 1
#> SRR901190 1 0.000 1.000 1.000 0.000 0
#> SRR901191 1 0.000 1.000 1.000 0.000 0
#> SRR901192 1 0.000 1.000 1.000 0.000 0
#> SRR901193 3 0.000 1.000 0.000 0.000 1
#> SRR901194 2 0.116 0.845 0.028 0.972 0
#> SRR901195 2 0.116 0.845 0.028 0.972 0
#> SRR901196 2 0.116 0.845 0.028 0.972 0
#> SRR901197 3 0.000 1.000 0.000 0.000 1
#> SRR901198 1 0.000 1.000 1.000 0.000 0
#> SRR901199 1 0.000 1.000 1.000 0.000 0
#> SRR901200 1 0.000 1.000 1.000 0.000 0
#> SRR901201 3 0.000 1.000 0.000 0.000 1
#> SRR901202 2 0.116 0.845 0.028 0.972 0
#> SRR901203 2 0.116 0.845 0.028 0.972 0
#> SRR901204 2 0.116 0.845 0.028 0.972 0
#> SRR901205 3 0.000 1.000 0.000 0.000 1
#> SRR901206 1 0.000 1.000 1.000 0.000 0
#> SRR901207 1 0.000 1.000 1.000 0.000 0
#> SRR901208 1 0.000 1.000 1.000 0.000 0
#> SRR901209 3 0.000 1.000 0.000 0.000 1
#> SRR901211 2 0.116 0.845 0.028 0.972 0
#> SRR901210 2 0.116 0.845 0.028 0.972 0
#> SRR901212 2 0.116 0.845 0.028 0.972 0
#> SRR901213 3 0.000 1.000 0.000 0.000 1
#> SRR901214 2 0.000 0.835 0.000 1.000 0
#> SRR901215 2 0.000 0.835 0.000 1.000 0
#> SRR901216 2 0.000 0.835 0.000 1.000 0
#> SRR901217 3 0.000 1.000 0.000 0.000 1
#> SRR901218 2 0.630 0.372 0.476 0.524 0
#> SRR901219 2 0.630 0.372 0.476 0.524 0
#> SRR901220 2 0.630 0.372 0.476 0.524 0
#> SRR901221 3 0.000 1.000 0.000 0.000 1
#> SRR901222 2 0.271 0.799 0.088 0.912 0
#> SRR901223 2 0.271 0.799 0.088 0.912 0
#> SRR901224 2 0.000 0.835 0.000 1.000 0
#> SRR901225 3 0.000 1.000 0.000 0.000 1
#> SRR901226 2 0.630 0.372 0.476 0.524 0
#> SRR901227 2 0.630 0.372 0.476 0.524 0
#> SRR901229 3 0.000 1.000 0.000 0.000 1
#> SRR901228 2 0.630 0.372 0.476 0.524 0
#> SRR901230 2 0.630 0.372 0.476 0.524 0
#> SRR901231 2 0.630 0.372 0.476 0.524 0
#> SRR901232 2 0.630 0.372 0.476 0.524 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0000 0.781 0.000 0.000 1.000 0.000
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901154 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901155 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901156 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901157 3 0.0000 0.781 0.000 0.000 1.000 0.000
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901161 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901162 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901163 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901164 2 0.0592 0.933 0.000 0.984 0.000 0.016
#> SRR901165 3 0.0469 0.784 0.000 0.000 0.988 0.012
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901169 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901170 2 0.0000 0.947 0.000 1.000 0.000 0.000
#> SRR901171 2 0.0000 0.947 0.000 1.000 0.000 0.000
#> SRR901172 2 0.0000 0.947 0.000 1.000 0.000 0.000
#> SRR901173 3 0.0000 0.781 0.000 0.000 1.000 0.000
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901176 2 0.0592 0.933 0.000 0.984 0.000 0.016
#> SRR901177 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901178 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901179 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901180 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901181 3 0.0000 0.781 0.000 0.000 1.000 0.000
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901185 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901187 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901186 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901188 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901189 3 0.0000 0.781 0.000 0.000 1.000 0.000
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901193 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901194 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901195 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901196 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901197 3 0.0000 0.781 0.000 0.000 1.000 0.000
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901201 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901202 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901203 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901204 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901205 3 0.0000 0.781 0.000 0.000 1.000 0.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901209 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901211 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901210 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901212 2 0.0921 0.966 0.028 0.972 0.000 0.000
#> SRR901213 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901214 2 0.0000 0.947 0.000 1.000 0.000 0.000
#> SRR901215 2 0.0000 0.947 0.000 1.000 0.000 0.000
#> SRR901216 2 0.0000 0.947 0.000 1.000 0.000 0.000
#> SRR901217 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901218 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901219 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901220 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901221 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901222 2 0.2408 0.810 0.000 0.896 0.000 0.104
#> SRR901223 2 0.2408 0.810 0.000 0.896 0.000 0.104
#> SRR901224 2 0.0592 0.933 0.000 0.984 0.000 0.016
#> SRR901225 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901226 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901227 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901229 3 0.4830 0.873 0.000 0.000 0.608 0.392
#> SRR901228 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901230 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901231 4 0.5613 1.000 0.028 0.380 0.000 0.592
#> SRR901232 4 0.5613 1.000 0.028 0.380 0.000 0.592
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0000 0.942 0 0.000 0.000 0.000 1.000
#> SRR901150 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901154 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901155 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901156 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901157 5 0.0000 0.942 0 0.000 0.000 0.000 1.000
#> SRR901158 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901162 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901163 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901164 2 0.4182 0.628 0 0.600 0.000 0.400 0.000
#> SRR901165 5 0.4171 0.344 0 0.000 0.396 0.000 0.604
#> SRR901166 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901169 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901170 2 0.3913 0.680 0 0.676 0.000 0.324 0.000
#> SRR901171 2 0.3913 0.680 0 0.676 0.000 0.324 0.000
#> SRR901172 2 0.3913 0.680 0 0.676 0.000 0.324 0.000
#> SRR901173 5 0.0000 0.942 0 0.000 0.000 0.000 1.000
#> SRR901174 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901176 2 0.4182 0.628 0 0.600 0.000 0.400 0.000
#> SRR901177 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901178 2 0.0162 0.767 0 0.996 0.000 0.004 0.000
#> SRR901179 2 0.0162 0.767 0 0.996 0.000 0.004 0.000
#> SRR901180 2 0.0162 0.767 0 0.996 0.000 0.004 0.000
#> SRR901181 5 0.0000 0.942 0 0.000 0.000 0.000 1.000
#> SRR901182 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901187 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901186 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901188 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901189 5 0.0000 0.942 0 0.000 0.000 0.000 1.000
#> SRR901190 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901194 2 0.0162 0.767 0 0.996 0.000 0.004 0.000
#> SRR901195 2 0.0162 0.767 0 0.996 0.000 0.004 0.000
#> SRR901196 2 0.0162 0.767 0 0.996 0.000 0.004 0.000
#> SRR901197 5 0.0000 0.942 0 0.000 0.000 0.000 1.000
#> SRR901198 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901202 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901203 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901204 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901205 5 0.0000 0.942 0 0.000 0.000 0.000 1.000
#> SRR901206 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901211 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901210 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901212 2 0.0000 0.766 0 1.000 0.000 0.000 0.000
#> SRR901213 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901214 2 0.3913 0.680 0 0.676 0.000 0.324 0.000
#> SRR901215 2 0.3913 0.680 0 0.676 0.000 0.324 0.000
#> SRR901216 2 0.3913 0.680 0 0.676 0.000 0.324 0.000
#> SRR901217 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901218 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901219 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901220 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901221 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901222 2 0.4304 0.557 0 0.516 0.000 0.484 0.000
#> SRR901223 2 0.4304 0.557 0 0.516 0.000 0.484 0.000
#> SRR901224 2 0.4182 0.628 0 0.600 0.000 0.400 0.000
#> SRR901225 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901226 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901227 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901229 3 0.0000 1.000 0 0.000 1.000 0.000 0.000
#> SRR901228 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901230 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901231 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
#> SRR901232 4 0.4182 1.000 0 0.400 0.000 0.600 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 0.928 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901150 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901154 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901155 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901156 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901157 5 0.0000 0.928 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901158 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901162 4 0.2378 0.865 0.000 0.152 0.000 0.848 0.000 0.000
#> SRR901163 4 0.2378 0.865 0.000 0.152 0.000 0.848 0.000 0.000
#> SRR901164 6 0.0146 0.824 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR901165 5 0.4047 0.362 0.000 0.000 0.384 0.012 0.604 0.000
#> SRR901166 1 0.1010 0.971 0.960 0.000 0.000 0.036 0.000 0.004
#> SRR901167 1 0.1010 0.971 0.960 0.000 0.000 0.036 0.000 0.004
#> SRR901168 1 0.1010 0.971 0.960 0.000 0.000 0.036 0.000 0.004
#> SRR901169 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901170 2 0.3741 0.550 0.000 0.672 0.000 0.008 0.000 0.320
#> SRR901171 2 0.3741 0.550 0.000 0.672 0.000 0.008 0.000 0.320
#> SRR901172 2 0.3741 0.550 0.000 0.672 0.000 0.008 0.000 0.320
#> SRR901173 5 0.0000 0.928 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901174 1 0.1010 0.971 0.960 0.000 0.000 0.036 0.000 0.004
#> SRR901175 1 0.1010 0.971 0.960 0.000 0.000 0.036 0.000 0.004
#> SRR901176 6 0.0146 0.824 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR901177 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901178 2 0.0000 0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901179 2 0.0000 0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901180 2 0.0000 0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901181 5 0.0000 0.928 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901182 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901187 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901186 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901188 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901189 5 0.0000 0.928 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901190 1 0.0935 0.973 0.964 0.000 0.000 0.032 0.000 0.004
#> SRR901191 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901194 2 0.0000 0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901195 2 0.0000 0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901196 2 0.0000 0.890 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901197 5 0.0000 0.928 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901198 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901202 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901203 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901204 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901205 5 0.0000 0.928 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901206 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.990 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901211 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901210 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901212 2 0.0146 0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901213 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901214 2 0.3741 0.550 0.000 0.672 0.000 0.008 0.000 0.320
#> SRR901215 2 0.3741 0.550 0.000 0.672 0.000 0.008 0.000 0.320
#> SRR901216 2 0.3741 0.550 0.000 0.672 0.000 0.008 0.000 0.320
#> SRR901217 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901218 4 0.1141 0.968 0.000 0.052 0.000 0.948 0.000 0.000
#> SRR901219 4 0.1141 0.968 0.000 0.052 0.000 0.948 0.000 0.000
#> SRR901220 4 0.1141 0.968 0.000 0.052 0.000 0.948 0.000 0.000
#> SRR901221 3 0.0363 0.989 0.000 0.000 0.988 0.012 0.000 0.000
#> SRR901222 6 0.4368 0.740 0.000 0.204 0.000 0.088 0.000 0.708
#> SRR901223 6 0.4368 0.740 0.000 0.204 0.000 0.088 0.000 0.708
#> SRR901224 6 0.0146 0.824 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR901225 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901226 4 0.1075 0.969 0.000 0.048 0.000 0.952 0.000 0.000
#> SRR901227 4 0.1075 0.969 0.000 0.048 0.000 0.952 0.000 0.000
#> SRR901229 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901228 4 0.1075 0.969 0.000 0.048 0.000 0.952 0.000 0.000
#> SRR901230 4 0.1075 0.969 0.000 0.048 0.000 0.952 0.000 0.000
#> SRR901231 4 0.1075 0.969 0.000 0.048 0.000 0.952 0.000 0.000
#> SRR901232 4 0.1075 0.969 0.000 0.048 0.000 0.952 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "kmeans"]
# you can also extract it by
# res = res_list["SD:kmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.495 0.819 0.833 0.3937 0.620 0.620
#> 3 3 0.706 0.980 0.933 0.5355 0.736 0.575
#> 4 4 0.802 0.575 0.858 0.1567 0.989 0.969
#> 5 5 0.770 0.782 0.766 0.0716 0.904 0.727
#> 6 6 0.758 0.688 0.792 0.0569 0.962 0.857
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.000 1.000 0.000 1.000
#> SRR901150 1 0.278 0.686 0.952 0.048
#> SRR901151 1 0.278 0.686 0.952 0.048
#> SRR901152 1 0.278 0.686 0.952 0.048
#> SRR1382100 2 0.000 1.000 0.000 1.000
#> SRR901154 1 0.909 0.800 0.676 0.324
#> SRR901155 1 0.909 0.800 0.676 0.324
#> SRR901156 1 0.909 0.800 0.676 0.324
#> SRR901157 2 0.000 1.000 0.000 1.000
#> SRR901158 1 0.278 0.686 0.952 0.048
#> SRR901159 1 0.278 0.686 0.952 0.048
#> SRR901160 1 0.278 0.686 0.952 0.048
#> SRR901161 2 0.000 1.000 0.000 1.000
#> SRR901162 1 0.909 0.800 0.676 0.324
#> SRR901163 1 0.909 0.800 0.676 0.324
#> SRR901164 1 0.909 0.800 0.676 0.324
#> SRR901165 2 0.000 1.000 0.000 1.000
#> SRR901166 1 0.278 0.686 0.952 0.048
#> SRR901167 1 0.278 0.686 0.952 0.048
#> SRR901168 1 0.278 0.686 0.952 0.048
#> SRR901169 2 0.000 1.000 0.000 1.000
#> SRR901170 1 0.909 0.800 0.676 0.324
#> SRR901171 1 0.909 0.800 0.676 0.324
#> SRR901172 1 0.909 0.800 0.676 0.324
#> SRR901173 2 0.000 1.000 0.000 1.000
#> SRR901174 1 0.278 0.686 0.952 0.048
#> SRR901175 1 0.278 0.686 0.952 0.048
#> SRR901176 1 0.909 0.800 0.676 0.324
#> SRR901177 2 0.000 1.000 0.000 1.000
#> SRR901178 1 0.909 0.800 0.676 0.324
#> SRR901179 1 0.909 0.800 0.676 0.324
#> SRR901180 1 0.909 0.800 0.676 0.324
#> SRR901181 2 0.000 1.000 0.000 1.000
#> SRR901182 1 0.278 0.686 0.952 0.048
#> SRR901183 1 0.278 0.686 0.952 0.048
#> SRR901184 1 0.278 0.686 0.952 0.048
#> SRR901185 2 0.000 1.000 0.000 1.000
#> SRR901187 1 0.909 0.800 0.676 0.324
#> SRR901186 1 0.909 0.800 0.676 0.324
#> SRR901188 1 0.909 0.800 0.676 0.324
#> SRR901189 2 0.000 1.000 0.000 1.000
#> SRR901190 1 0.278 0.686 0.952 0.048
#> SRR901191 1 0.278 0.686 0.952 0.048
#> SRR901192 1 0.278 0.686 0.952 0.048
#> SRR901193 2 0.000 1.000 0.000 1.000
#> SRR901194 1 0.909 0.800 0.676 0.324
#> SRR901195 1 0.909 0.800 0.676 0.324
#> SRR901196 1 0.909 0.800 0.676 0.324
#> SRR901197 2 0.000 1.000 0.000 1.000
#> SRR901198 1 0.278 0.686 0.952 0.048
#> SRR901199 1 0.278 0.686 0.952 0.048
#> SRR901200 1 0.278 0.686 0.952 0.048
#> SRR901201 2 0.000 1.000 0.000 1.000
#> SRR901202 1 0.909 0.800 0.676 0.324
#> SRR901203 1 0.909 0.800 0.676 0.324
#> SRR901204 1 0.909 0.800 0.676 0.324
#> SRR901205 2 0.000 1.000 0.000 1.000
#> SRR901206 1 0.278 0.686 0.952 0.048
#> SRR901207 1 0.278 0.686 0.952 0.048
#> SRR901208 1 0.278 0.686 0.952 0.048
#> SRR901209 2 0.000 1.000 0.000 1.000
#> SRR901211 1 0.909 0.800 0.676 0.324
#> SRR901210 1 0.909 0.800 0.676 0.324
#> SRR901212 1 0.909 0.800 0.676 0.324
#> SRR901213 2 0.000 1.000 0.000 1.000
#> SRR901214 1 0.909 0.800 0.676 0.324
#> SRR901215 1 0.909 0.800 0.676 0.324
#> SRR901216 1 0.909 0.800 0.676 0.324
#> SRR901217 2 0.000 1.000 0.000 1.000
#> SRR901218 1 0.909 0.800 0.676 0.324
#> SRR901219 1 0.909 0.800 0.676 0.324
#> SRR901220 1 0.909 0.800 0.676 0.324
#> SRR901221 2 0.000 1.000 0.000 1.000
#> SRR901222 1 0.909 0.800 0.676 0.324
#> SRR901223 1 0.909 0.800 0.676 0.324
#> SRR901224 1 0.909 0.800 0.676 0.324
#> SRR901225 2 0.000 1.000 0.000 1.000
#> SRR901226 1 0.909 0.800 0.676 0.324
#> SRR901227 1 0.909 0.800 0.676 0.324
#> SRR901229 2 0.000 1.000 0.000 1.000
#> SRR901228 1 0.909 0.800 0.676 0.324
#> SRR901230 1 0.909 0.800 0.676 0.324
#> SRR901231 1 0.909 0.800 0.676 0.324
#> SRR901232 1 0.909 0.800 0.676 0.324
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.5467 0.941 0.112 0.072 0.816
#> SRR901150 1 0.4786 0.977 0.844 0.112 0.044
#> SRR901151 1 0.4786 0.977 0.844 0.112 0.044
#> SRR901152 1 0.4786 0.977 0.844 0.112 0.044
#> SRR1382100 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901154 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901155 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901156 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901157 3 0.5467 0.941 0.112 0.072 0.816
#> SRR901158 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901159 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901160 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901161 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901162 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901163 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901164 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901165 3 0.5467 0.941 0.112 0.072 0.816
#> SRR901166 1 0.4994 0.975 0.836 0.112 0.052
#> SRR901167 1 0.4994 0.975 0.836 0.112 0.052
#> SRR901168 1 0.4994 0.975 0.836 0.112 0.052
#> SRR901169 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901170 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901171 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901172 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901173 3 0.5467 0.941 0.112 0.072 0.816
#> SRR901174 1 0.4994 0.975 0.836 0.112 0.052
#> SRR901175 1 0.4994 0.975 0.836 0.112 0.052
#> SRR901176 2 0.0424 0.985 0.000 0.992 0.008
#> SRR901177 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901178 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901179 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901180 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901181 3 0.5467 0.941 0.112 0.072 0.816
#> SRR901182 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901183 1 0.3607 0.982 0.880 0.112 0.008
#> SRR901184 1 0.3607 0.982 0.880 0.112 0.008
#> SRR901185 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901187 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901186 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901188 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901189 3 0.5467 0.941 0.112 0.072 0.816
#> SRR901190 1 0.4786 0.977 0.844 0.112 0.044
#> SRR901191 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901192 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901193 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901194 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901195 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901196 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901197 3 0.5467 0.941 0.112 0.072 0.816
#> SRR901198 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901199 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901200 1 0.3192 0.984 0.888 0.112 0.000
#> SRR901201 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901202 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901203 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901204 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901205 3 0.5467 0.941 0.112 0.072 0.816
#> SRR901206 1 0.3607 0.982 0.880 0.112 0.008
#> SRR901207 1 0.3425 0.983 0.884 0.112 0.004
#> SRR901208 1 0.3607 0.982 0.880 0.112 0.008
#> SRR901209 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901211 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901210 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901212 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901213 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901214 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901215 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901216 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901217 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901218 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901219 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901220 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901221 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901222 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901223 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901224 2 0.0000 0.990 0.000 1.000 0.000
#> SRR901225 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901226 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901227 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901229 3 0.2066 0.964 0.000 0.060 0.940
#> SRR901228 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901230 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901231 2 0.0592 0.995 0.012 0.988 0.000
#> SRR901232 2 0.0592 0.995 0.012 0.988 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.4594 0.8566 0.000 0.008 0.712 0.280
#> SRR901150 1 0.2983 0.9202 0.880 0.008 0.004 0.108
#> SRR901151 1 0.2983 0.9202 0.880 0.008 0.004 0.108
#> SRR901152 1 0.2983 0.9202 0.880 0.008 0.004 0.108
#> SRR1382100 3 0.0524 0.9134 0.004 0.008 0.988 0.000
#> SRR901154 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901155 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901156 2 0.4817 0.1657 0.000 0.612 0.000 0.388
#> SRR901157 3 0.4594 0.8566 0.000 0.008 0.712 0.280
#> SRR901158 1 0.0336 0.9411 0.992 0.008 0.000 0.000
#> SRR901159 1 0.0336 0.9411 0.992 0.008 0.000 0.000
#> SRR901160 1 0.0336 0.9411 0.992 0.008 0.000 0.000
#> SRR901161 3 0.0336 0.9136 0.000 0.008 0.992 0.000
#> SRR901162 2 0.0592 0.2903 0.000 0.984 0.000 0.016
#> SRR901163 2 0.0592 0.2903 0.000 0.984 0.000 0.016
#> SRR901164 2 0.4955 -0.3585 0.000 0.556 0.000 0.444
#> SRR901165 3 0.4594 0.8566 0.000 0.008 0.712 0.280
#> SRR901166 1 0.4228 0.8691 0.760 0.008 0.000 0.232
#> SRR901167 1 0.4295 0.8646 0.752 0.008 0.000 0.240
#> SRR901168 1 0.4262 0.8669 0.756 0.008 0.000 0.236
#> SRR901169 3 0.0524 0.9134 0.004 0.008 0.988 0.000
#> SRR901170 2 0.4855 -0.0045 0.000 0.600 0.000 0.400
#> SRR901171 2 0.4855 -0.0045 0.000 0.600 0.000 0.400
#> SRR901172 2 0.4855 -0.0045 0.000 0.600 0.000 0.400
#> SRR901173 3 0.4594 0.8566 0.000 0.008 0.712 0.280
#> SRR901174 1 0.4295 0.8646 0.752 0.008 0.000 0.240
#> SRR901175 1 0.3972 0.8848 0.788 0.008 0.000 0.204
#> SRR901176 4 0.4996 0.0000 0.000 0.484 0.000 0.516
#> SRR901177 3 0.0524 0.9134 0.004 0.008 0.988 0.000
#> SRR901178 2 0.4134 0.3228 0.000 0.740 0.000 0.260
#> SRR901179 2 0.4830 0.1458 0.000 0.608 0.000 0.392
#> SRR901180 2 0.4855 -0.0045 0.000 0.600 0.000 0.400
#> SRR901181 3 0.4594 0.8566 0.000 0.008 0.712 0.280
#> SRR901182 1 0.0712 0.9410 0.984 0.008 0.004 0.004
#> SRR901183 1 0.1151 0.9358 0.968 0.008 0.000 0.024
#> SRR901184 1 0.1151 0.9358 0.968 0.008 0.000 0.024
#> SRR901185 3 0.0336 0.9136 0.000 0.008 0.992 0.000
#> SRR901187 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901186 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901188 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901189 3 0.4594 0.8566 0.000 0.008 0.712 0.280
#> SRR901190 1 0.3249 0.9115 0.852 0.008 0.000 0.140
#> SRR901191 1 0.0336 0.9411 0.992 0.008 0.000 0.000
#> SRR901192 1 0.0336 0.9411 0.992 0.008 0.000 0.000
#> SRR901193 3 0.0336 0.9136 0.000 0.008 0.992 0.000
#> SRR901194 2 0.4564 0.3607 0.000 0.672 0.000 0.328
#> SRR901195 2 0.4564 0.3607 0.000 0.672 0.000 0.328
#> SRR901196 2 0.4855 -0.0045 0.000 0.600 0.000 0.400
#> SRR901197 3 0.4594 0.8566 0.000 0.008 0.712 0.280
#> SRR901198 1 0.0712 0.9410 0.984 0.008 0.004 0.004
#> SRR901199 1 0.0712 0.9410 0.984 0.008 0.004 0.004
#> SRR901200 1 0.0712 0.9410 0.984 0.008 0.004 0.004
#> SRR901201 3 0.0336 0.9136 0.000 0.008 0.992 0.000
#> SRR901202 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901203 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901204 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901205 3 0.4594 0.8566 0.000 0.008 0.712 0.280
#> SRR901206 1 0.1339 0.9357 0.964 0.008 0.004 0.024
#> SRR901207 1 0.0859 0.9400 0.980 0.008 0.004 0.008
#> SRR901208 1 0.1339 0.9357 0.964 0.008 0.004 0.024
#> SRR901209 3 0.0524 0.9134 0.004 0.008 0.988 0.000
#> SRR901211 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901210 2 0.4543 0.3761 0.000 0.676 0.000 0.324
#> SRR901212 2 0.4761 0.2260 0.000 0.628 0.000 0.372
#> SRR901213 3 0.0524 0.9134 0.004 0.008 0.988 0.000
#> SRR901214 2 0.4643 -0.0136 0.000 0.656 0.000 0.344
#> SRR901215 2 0.4643 -0.0136 0.000 0.656 0.000 0.344
#> SRR901216 2 0.4643 -0.0136 0.000 0.656 0.000 0.344
#> SRR901217 3 0.0524 0.9134 0.004 0.008 0.988 0.000
#> SRR901218 2 0.0000 0.2943 0.000 1.000 0.000 0.000
#> SRR901219 2 0.0000 0.2943 0.000 1.000 0.000 0.000
#> SRR901220 2 0.0469 0.2922 0.000 0.988 0.000 0.012
#> SRR901221 3 0.0672 0.9132 0.008 0.008 0.984 0.000
#> SRR901222 2 0.4431 0.3237 0.000 0.696 0.000 0.304
#> SRR901223 2 0.4277 0.3137 0.000 0.720 0.000 0.280
#> SRR901224 2 0.4916 -0.3724 0.000 0.576 0.000 0.424
#> SRR901225 3 0.0336 0.9136 0.000 0.008 0.992 0.000
#> SRR901226 2 0.0000 0.2943 0.000 1.000 0.000 0.000
#> SRR901227 2 0.0000 0.2943 0.000 1.000 0.000 0.000
#> SRR901229 3 0.0336 0.9136 0.000 0.008 0.992 0.000
#> SRR901228 2 0.0000 0.2943 0.000 1.000 0.000 0.000
#> SRR901230 2 0.0000 0.2943 0.000 1.000 0.000 0.000
#> SRR901231 2 0.0000 0.2943 0.000 1.000 0.000 0.000
#> SRR901232 2 0.0000 0.2943 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 3 0.4273 0.754 0.000 0.000 0.552 0.000 NA
#> SRR901150 1 0.3926 0.857 0.808 0.008 0.000 0.052 NA
#> SRR901151 1 0.3994 0.857 0.804 0.008 0.000 0.056 NA
#> SRR901152 1 0.3948 0.857 0.808 0.008 0.000 0.056 NA
#> SRR1382100 3 0.0880 0.848 0.000 0.000 0.968 0.032 NA
#> SRR901154 2 0.0566 0.703 0.000 0.984 0.000 0.004 NA
#> SRR901155 2 0.0566 0.703 0.000 0.984 0.000 0.004 NA
#> SRR901156 2 0.2189 0.719 0.000 0.904 0.000 0.084 NA
#> SRR901157 3 0.4273 0.754 0.000 0.000 0.552 0.000 NA
#> SRR901158 1 0.0579 0.889 0.984 0.008 0.000 0.008 NA
#> SRR901159 1 0.0579 0.889 0.984 0.008 0.000 0.008 NA
#> SRR901160 1 0.0579 0.889 0.984 0.008 0.000 0.008 NA
#> SRR901161 3 0.0290 0.849 0.000 0.000 0.992 0.008 NA
#> SRR901162 4 0.4446 0.990 0.000 0.476 0.000 0.520 NA
#> SRR901163 4 0.4446 0.990 0.000 0.476 0.000 0.520 NA
#> SRR901164 2 0.6156 0.517 0.000 0.560 0.000 0.216 NA
#> SRR901165 3 0.5101 0.753 0.008 0.000 0.552 0.024 NA
#> SRR901166 1 0.5815 0.758 0.592 0.008 0.000 0.096 NA
#> SRR901167 1 0.6006 0.739 0.564 0.008 0.000 0.108 NA
#> SRR901168 1 0.5935 0.747 0.576 0.008 0.000 0.104 NA
#> SRR901169 3 0.0880 0.848 0.000 0.000 0.968 0.032 NA
#> SRR901170 2 0.4113 0.693 0.000 0.784 0.000 0.140 NA
#> SRR901171 2 0.4334 0.686 0.000 0.768 0.000 0.140 NA
#> SRR901172 2 0.4113 0.693 0.000 0.784 0.000 0.140 NA
#> SRR901173 3 0.4273 0.754 0.000 0.000 0.552 0.000 NA
#> SRR901174 1 0.5992 0.742 0.568 0.008 0.000 0.108 NA
#> SRR901175 1 0.5550 0.781 0.636 0.008 0.000 0.088 NA
#> SRR901176 2 0.6736 0.333 0.000 0.412 0.000 0.276 NA
#> SRR901177 3 0.0703 0.849 0.000 0.000 0.976 0.024 NA
#> SRR901178 2 0.4819 0.323 0.000 0.716 0.000 0.192 NA
#> SRR901179 2 0.3767 0.704 0.000 0.812 0.000 0.120 NA
#> SRR901180 2 0.4807 0.664 0.000 0.728 0.000 0.140 NA
#> SRR901181 3 0.4273 0.754 0.000 0.000 0.552 0.000 NA
#> SRR901182 1 0.0693 0.889 0.980 0.008 0.000 0.012 NA
#> SRR901183 1 0.1988 0.877 0.928 0.008 0.000 0.048 NA
#> SRR901184 1 0.2060 0.876 0.924 0.008 0.000 0.052 NA
#> SRR901185 3 0.0290 0.849 0.000 0.000 0.992 0.008 NA
#> SRR901187 2 0.0162 0.713 0.000 0.996 0.000 0.004 NA
#> SRR901186 2 0.0000 0.711 0.000 1.000 0.000 0.000 NA
#> SRR901188 2 0.0162 0.707 0.000 0.996 0.000 0.004 NA
#> SRR901189 3 0.4273 0.754 0.000 0.000 0.552 0.000 NA
#> SRR901190 1 0.4802 0.821 0.720 0.008 0.000 0.060 NA
#> SRR901191 1 0.0579 0.889 0.984 0.008 0.000 0.008 NA
#> SRR901192 1 0.0579 0.889 0.984 0.008 0.000 0.008 NA
#> SRR901193 3 0.0290 0.849 0.000 0.000 0.992 0.008 NA
#> SRR901194 2 0.0404 0.715 0.000 0.988 0.000 0.012 NA
#> SRR901195 2 0.0566 0.715 0.000 0.984 0.000 0.012 NA
#> SRR901196 2 0.4113 0.693 0.000 0.784 0.000 0.140 NA
#> SRR901197 3 0.4273 0.754 0.000 0.000 0.552 0.000 NA
#> SRR901198 1 0.0693 0.889 0.980 0.008 0.000 0.012 NA
#> SRR901199 1 0.0693 0.889 0.980 0.008 0.000 0.012 NA
#> SRR901200 1 0.0693 0.889 0.980 0.008 0.000 0.012 NA
#> SRR901201 3 0.0290 0.849 0.000 0.000 0.992 0.008 NA
#> SRR901202 2 0.0000 0.711 0.000 1.000 0.000 0.000 NA
#> SRR901203 2 0.0324 0.707 0.000 0.992 0.000 0.004 NA
#> SRR901204 2 0.0162 0.710 0.000 0.996 0.000 0.000 NA
#> SRR901205 3 0.4950 0.753 0.008 0.000 0.552 0.016 NA
#> SRR901206 1 0.2456 0.876 0.904 0.008 0.000 0.064 NA
#> SRR901207 1 0.2011 0.882 0.928 0.008 0.000 0.044 NA
#> SRR901208 1 0.2456 0.876 0.904 0.008 0.000 0.064 NA
#> SRR901209 3 0.0703 0.849 0.000 0.000 0.976 0.024 NA
#> SRR901211 2 0.0324 0.707 0.000 0.992 0.000 0.004 NA
#> SRR901210 2 0.0162 0.710 0.000 0.996 0.000 0.000 NA
#> SRR901212 2 0.1608 0.719 0.000 0.928 0.000 0.072 NA
#> SRR901213 3 0.1043 0.848 0.000 0.000 0.960 0.040 NA
#> SRR901214 2 0.5797 0.500 0.000 0.592 0.000 0.276 NA
#> SRR901215 2 0.5797 0.500 0.000 0.592 0.000 0.276 NA
#> SRR901216 2 0.5797 0.500 0.000 0.592 0.000 0.276 NA
#> SRR901217 3 0.0703 0.848 0.000 0.000 0.976 0.024 NA
#> SRR901218 4 0.4297 0.997 0.000 0.472 0.000 0.528 NA
#> SRR901219 4 0.4297 0.997 0.000 0.472 0.000 0.528 NA
#> SRR901220 4 0.4297 0.997 0.000 0.472 0.000 0.528 NA
#> SRR901221 3 0.1121 0.847 0.000 0.000 0.956 0.044 NA
#> SRR901222 2 0.4183 0.573 0.000 0.780 0.000 0.084 NA
#> SRR901223 2 0.4971 0.357 0.000 0.712 0.000 0.144 NA
#> SRR901224 2 0.6380 0.468 0.000 0.516 0.000 0.260 NA
#> SRR901225 3 0.0000 0.849 0.000 0.000 1.000 0.000 NA
#> SRR901226 4 0.4297 0.997 0.000 0.472 0.000 0.528 NA
#> SRR901227 4 0.4297 0.997 0.000 0.472 0.000 0.528 NA
#> SRR901229 3 0.0000 0.849 0.000 0.000 1.000 0.000 NA
#> SRR901228 4 0.4297 0.997 0.000 0.472 0.000 0.528 NA
#> SRR901230 4 0.4297 0.997 0.000 0.472 0.000 0.528 NA
#> SRR901231 4 0.4443 0.995 0.000 0.472 0.000 0.524 NA
#> SRR901232 4 0.4443 0.995 0.000 0.472 0.000 0.524 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0622 0.9730 0.000 0.000 0.000 0.008 0.980 0.012
#> SRR901150 1 0.4352 0.7879 0.752 0.000 0.108 0.016 0.000 0.124
#> SRR901151 1 0.4352 0.7879 0.752 0.000 0.108 0.016 0.000 0.124
#> SRR901152 1 0.4391 0.7877 0.748 0.000 0.108 0.016 0.000 0.128
#> SRR1382100 3 0.5320 0.9243 0.000 0.000 0.560 0.020 0.352 0.068
#> SRR901154 2 0.2517 0.6256 0.000 0.876 0.016 0.100 0.000 0.008
#> SRR901155 2 0.2517 0.6256 0.000 0.876 0.016 0.100 0.000 0.008
#> SRR901156 2 0.1364 0.5787 0.000 0.952 0.016 0.020 0.000 0.012
#> SRR901157 5 0.0000 0.9753 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901158 1 0.0000 0.8364 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.8364 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.8364 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.3756 0.9510 0.000 0.000 0.644 0.000 0.352 0.004
#> SRR901162 4 0.3229 0.9782 0.000 0.172 0.020 0.804 0.000 0.004
#> SRR901163 4 0.3229 0.9782 0.000 0.172 0.020 0.804 0.000 0.004
#> SRR901164 2 0.5566 -0.5915 0.000 0.492 0.068 0.028 0.000 0.412
#> SRR901165 5 0.1807 0.9390 0.000 0.000 0.000 0.020 0.920 0.060
#> SRR901166 1 0.5140 0.6516 0.520 0.000 0.088 0.000 0.000 0.392
#> SRR901167 1 0.5152 0.6442 0.512 0.000 0.088 0.000 0.000 0.400
#> SRR901168 1 0.5152 0.6442 0.512 0.000 0.088 0.000 0.000 0.400
#> SRR901169 3 0.5320 0.9243 0.000 0.000 0.560 0.020 0.352 0.068
#> SRR901170 2 0.3315 0.3663 0.000 0.780 0.020 0.000 0.000 0.200
#> SRR901171 2 0.3665 0.2748 0.000 0.728 0.020 0.000 0.000 0.252
#> SRR901172 2 0.3315 0.3663 0.000 0.780 0.020 0.000 0.000 0.200
#> SRR901173 5 0.0622 0.9730 0.000 0.000 0.000 0.008 0.980 0.012
#> SRR901174 1 0.5217 0.6447 0.512 0.000 0.096 0.000 0.000 0.392
#> SRR901175 1 0.5291 0.6836 0.552 0.000 0.120 0.000 0.000 0.328
#> SRR901176 6 0.5637 0.0000 0.000 0.348 0.068 0.040 0.000 0.544
#> SRR901177 3 0.4371 0.9452 0.000 0.000 0.620 0.016 0.352 0.012
#> SRR901178 2 0.6362 0.1493 0.000 0.444 0.024 0.328 0.000 0.204
#> SRR901179 2 0.2948 0.4059 0.000 0.804 0.008 0.000 0.000 0.188
#> SRR901180 2 0.3940 0.0479 0.000 0.652 0.008 0.004 0.000 0.336
#> SRR901181 5 0.0000 0.9753 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901182 1 0.1410 0.8332 0.944 0.000 0.044 0.004 0.000 0.008
#> SRR901183 1 0.2052 0.8201 0.912 0.000 0.028 0.056 0.000 0.004
#> SRR901184 1 0.2307 0.8178 0.896 0.000 0.032 0.068 0.000 0.004
#> SRR901185 3 0.3756 0.9510 0.000 0.000 0.644 0.000 0.352 0.004
#> SRR901187 2 0.2070 0.6331 0.000 0.892 0.008 0.100 0.000 0.000
#> SRR901186 2 0.1958 0.6330 0.000 0.896 0.004 0.100 0.000 0.000
#> SRR901188 2 0.2070 0.6323 0.000 0.892 0.008 0.100 0.000 0.000
#> SRR901189 5 0.0000 0.9753 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901190 1 0.4992 0.7308 0.624 0.000 0.116 0.000 0.000 0.260
#> SRR901191 1 0.0146 0.8365 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR901192 1 0.0146 0.8365 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR901193 3 0.3620 0.9515 0.000 0.000 0.648 0.000 0.352 0.000
#> SRR901194 2 0.2070 0.6327 0.000 0.896 0.012 0.092 0.000 0.000
#> SRR901195 2 0.2356 0.6297 0.000 0.884 0.016 0.096 0.000 0.004
#> SRR901196 2 0.3384 0.3241 0.000 0.760 0.008 0.004 0.000 0.228
#> SRR901197 5 0.0000 0.9753 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901198 1 0.1410 0.8332 0.944 0.000 0.044 0.004 0.000 0.008
#> SRR901199 1 0.1523 0.8327 0.940 0.000 0.044 0.008 0.000 0.008
#> SRR901200 1 0.1410 0.8332 0.944 0.000 0.044 0.004 0.000 0.008
#> SRR901201 3 0.3756 0.9510 0.000 0.000 0.644 0.000 0.352 0.004
#> SRR901202 2 0.1958 0.6328 0.000 0.896 0.004 0.100 0.000 0.000
#> SRR901203 2 0.2170 0.6317 0.000 0.888 0.012 0.100 0.000 0.000
#> SRR901204 2 0.2170 0.6317 0.000 0.888 0.012 0.100 0.000 0.000
#> SRR901205 5 0.1616 0.9480 0.000 0.000 0.000 0.020 0.932 0.048
#> SRR901206 1 0.2814 0.8143 0.864 0.000 0.052 0.080 0.000 0.004
#> SRR901207 1 0.2009 0.8295 0.916 0.000 0.040 0.040 0.000 0.004
#> SRR901208 1 0.2814 0.8143 0.864 0.000 0.052 0.080 0.000 0.004
#> SRR901209 3 0.4278 0.9462 0.000 0.000 0.624 0.016 0.352 0.008
#> SRR901211 2 0.2170 0.6320 0.000 0.888 0.012 0.100 0.000 0.000
#> SRR901210 2 0.1958 0.6331 0.000 0.896 0.004 0.100 0.000 0.000
#> SRR901212 2 0.1088 0.5876 0.000 0.960 0.016 0.024 0.000 0.000
#> SRR901213 3 0.5364 0.9297 0.000 0.000 0.560 0.028 0.352 0.060
#> SRR901214 2 0.5891 -0.2425 0.000 0.492 0.012 0.152 0.000 0.344
#> SRR901215 2 0.5891 -0.2425 0.000 0.492 0.012 0.152 0.000 0.344
#> SRR901216 2 0.5891 -0.2425 0.000 0.492 0.012 0.152 0.000 0.344
#> SRR901217 3 0.5172 0.9324 0.000 0.000 0.572 0.020 0.352 0.056
#> SRR901218 4 0.2955 0.9860 0.000 0.172 0.008 0.816 0.000 0.004
#> SRR901219 4 0.2845 0.9869 0.000 0.172 0.004 0.820 0.000 0.004
#> SRR901220 4 0.2845 0.9869 0.000 0.172 0.004 0.820 0.000 0.004
#> SRR901221 3 0.5483 0.9205 0.000 0.000 0.548 0.024 0.352 0.076
#> SRR901222 2 0.6164 0.2279 0.000 0.552 0.044 0.164 0.000 0.240
#> SRR901223 2 0.6696 0.0641 0.000 0.456 0.052 0.268 0.000 0.224
#> SRR901224 2 0.5995 -0.6417 0.000 0.460 0.068 0.060 0.000 0.412
#> SRR901225 3 0.4089 0.9515 0.000 0.000 0.632 0.004 0.352 0.012
#> SRR901226 4 0.2703 0.9868 0.000 0.172 0.004 0.824 0.000 0.000
#> SRR901227 4 0.2562 0.9873 0.000 0.172 0.000 0.828 0.000 0.000
#> SRR901229 3 0.4089 0.9515 0.000 0.000 0.632 0.004 0.352 0.012
#> SRR901228 4 0.3053 0.9828 0.000 0.172 0.012 0.812 0.000 0.004
#> SRR901230 4 0.3053 0.9828 0.000 0.172 0.012 0.812 0.000 0.004
#> SRR901231 4 0.3065 0.9853 0.000 0.172 0.008 0.812 0.000 0.008
#> SRR901232 4 0.2845 0.9863 0.000 0.172 0.004 0.820 0.000 0.004
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "skmeans"]
# you can also extract it by
# res = res_list["SD:skmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.522 0.802 0.901 0.4483 0.550 0.550
#> 3 3 1.000 0.964 0.985 0.4477 0.674 0.471
#> 4 4 0.903 0.960 0.962 0.1363 0.908 0.743
#> 5 5 0.906 0.730 0.874 0.0570 0.966 0.870
#> 6 6 0.915 0.896 0.924 0.0504 0.919 0.665
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0000 0.9205 0.000 1.000
#> SRR901150 1 0.0672 0.8647 0.992 0.008
#> SRR901151 1 0.0672 0.8647 0.992 0.008
#> SRR901152 1 0.0672 0.8647 0.992 0.008
#> SRR1382100 2 0.0000 0.9205 0.000 1.000
#> SRR901154 1 0.6801 0.8163 0.820 0.180
#> SRR901155 1 0.6801 0.8163 0.820 0.180
#> SRR901156 1 0.7139 0.8015 0.804 0.196
#> SRR901157 2 0.0000 0.9205 0.000 1.000
#> SRR901158 1 0.0672 0.8647 0.992 0.008
#> SRR901159 1 0.0672 0.8647 0.992 0.008
#> SRR901160 1 0.0672 0.8647 0.992 0.008
#> SRR901161 2 0.0000 0.9205 0.000 1.000
#> SRR901162 1 0.0000 0.8634 1.000 0.000
#> SRR901163 1 0.0000 0.8634 1.000 0.000
#> SRR901164 1 0.9635 0.5198 0.612 0.388
#> SRR901165 2 0.0000 0.9205 0.000 1.000
#> SRR901166 1 0.0672 0.8647 0.992 0.008
#> SRR901167 1 0.0672 0.8647 0.992 0.008
#> SRR901168 1 0.0672 0.8647 0.992 0.008
#> SRR901169 2 0.0000 0.9205 0.000 1.000
#> SRR901170 2 0.9881 0.0468 0.436 0.564
#> SRR901171 2 0.9881 0.0468 0.436 0.564
#> SRR901172 2 0.9850 0.0792 0.428 0.572
#> SRR901173 2 0.0000 0.9205 0.000 1.000
#> SRR901174 1 0.0672 0.8647 0.992 0.008
#> SRR901175 1 0.0672 0.8647 0.992 0.008
#> SRR901176 2 0.9686 0.1946 0.396 0.604
#> SRR901177 2 0.0000 0.9205 0.000 1.000
#> SRR901178 1 0.6801 0.8163 0.820 0.180
#> SRR901179 1 0.9580 0.5373 0.620 0.380
#> SRR901180 1 0.9580 0.5373 0.620 0.380
#> SRR901181 2 0.0000 0.9205 0.000 1.000
#> SRR901182 1 0.0672 0.8647 0.992 0.008
#> SRR901183 1 0.0672 0.8647 0.992 0.008
#> SRR901184 1 0.0672 0.8647 0.992 0.008
#> SRR901185 2 0.0000 0.9205 0.000 1.000
#> SRR901187 1 0.9580 0.5373 0.620 0.380
#> SRR901186 1 0.9580 0.5373 0.620 0.380
#> SRR901188 1 0.6801 0.8163 0.820 0.180
#> SRR901189 2 0.0000 0.9205 0.000 1.000
#> SRR901190 1 0.0672 0.8647 0.992 0.008
#> SRR901191 1 0.0672 0.8647 0.992 0.008
#> SRR901192 1 0.0672 0.8647 0.992 0.008
#> SRR901193 2 0.0000 0.9205 0.000 1.000
#> SRR901194 1 0.6801 0.8163 0.820 0.180
#> SRR901195 1 0.6801 0.8163 0.820 0.180
#> SRR901196 1 0.9580 0.5373 0.620 0.380
#> SRR901197 2 0.0000 0.9205 0.000 1.000
#> SRR901198 1 0.0672 0.8647 0.992 0.008
#> SRR901199 1 0.0672 0.8647 0.992 0.008
#> SRR901200 1 0.0672 0.8647 0.992 0.008
#> SRR901201 2 0.0000 0.9205 0.000 1.000
#> SRR901202 1 0.6801 0.8163 0.820 0.180
#> SRR901203 1 0.6801 0.8163 0.820 0.180
#> SRR901204 1 0.6801 0.8163 0.820 0.180
#> SRR901205 2 0.0000 0.9205 0.000 1.000
#> SRR901206 1 0.0672 0.8647 0.992 0.008
#> SRR901207 1 0.0672 0.8647 0.992 0.008
#> SRR901208 1 0.0672 0.8647 0.992 0.008
#> SRR901209 2 0.0000 0.9205 0.000 1.000
#> SRR901211 1 0.6801 0.8163 0.820 0.180
#> SRR901210 1 0.6801 0.8163 0.820 0.180
#> SRR901212 1 0.9635 0.5198 0.612 0.388
#> SRR901213 2 0.0000 0.9205 0.000 1.000
#> SRR901214 2 0.0672 0.9141 0.008 0.992
#> SRR901215 2 0.0672 0.9141 0.008 0.992
#> SRR901216 2 0.0672 0.9141 0.008 0.992
#> SRR901217 2 0.0000 0.9205 0.000 1.000
#> SRR901218 1 0.6801 0.8163 0.820 0.180
#> SRR901219 1 0.6801 0.8163 0.820 0.180
#> SRR901220 1 0.0000 0.8634 1.000 0.000
#> SRR901221 2 0.0000 0.9205 0.000 1.000
#> SRR901222 1 0.6801 0.8163 0.820 0.180
#> SRR901223 1 0.4022 0.8473 0.920 0.080
#> SRR901224 1 0.9580 0.5373 0.620 0.380
#> SRR901225 2 0.0000 0.9205 0.000 1.000
#> SRR901226 1 0.0000 0.8634 1.000 0.000
#> SRR901227 1 0.0000 0.8634 1.000 0.000
#> SRR901229 2 0.0000 0.9205 0.000 1.000
#> SRR901228 1 0.0000 0.8634 1.000 0.000
#> SRR901230 1 0.0000 0.8634 1.000 0.000
#> SRR901231 1 0.6801 0.8163 0.820 0.180
#> SRR901232 1 0.6801 0.8163 0.820 0.180
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.000 1.000 0.000 0.000 1
#> SRR901150 1 0.000 1.000 1.000 0.000 0
#> SRR901151 1 0.000 1.000 1.000 0.000 0
#> SRR901152 1 0.000 1.000 1.000 0.000 0
#> SRR1382100 3 0.000 1.000 0.000 0.000 1
#> SRR901154 2 0.000 0.967 0.000 1.000 0
#> SRR901155 2 0.000 0.967 0.000 1.000 0
#> SRR901156 2 0.000 0.967 0.000 1.000 0
#> SRR901157 3 0.000 1.000 0.000 0.000 1
#> SRR901158 1 0.000 1.000 1.000 0.000 0
#> SRR901159 1 0.000 1.000 1.000 0.000 0
#> SRR901160 1 0.000 1.000 1.000 0.000 0
#> SRR901161 3 0.000 1.000 0.000 0.000 1
#> SRR901162 2 0.000 0.967 0.000 1.000 0
#> SRR901163 2 0.514 0.675 0.252 0.748 0
#> SRR901164 2 0.000 0.967 0.000 1.000 0
#> SRR901165 3 0.000 1.000 0.000 0.000 1
#> SRR901166 1 0.000 1.000 1.000 0.000 0
#> SRR901167 1 0.000 1.000 1.000 0.000 0
#> SRR901168 1 0.000 1.000 1.000 0.000 0
#> SRR901169 3 0.000 1.000 0.000 0.000 1
#> SRR901170 2 0.000 0.967 0.000 1.000 0
#> SRR901171 2 0.000 0.967 0.000 1.000 0
#> SRR901172 2 0.000 0.967 0.000 1.000 0
#> SRR901173 3 0.000 1.000 0.000 0.000 1
#> SRR901174 1 0.000 1.000 1.000 0.000 0
#> SRR901175 1 0.000 1.000 1.000 0.000 0
#> SRR901176 2 0.619 0.285 0.420 0.580 0
#> SRR901177 3 0.000 1.000 0.000 0.000 1
#> SRR901178 2 0.000 0.967 0.000 1.000 0
#> SRR901179 2 0.000 0.967 0.000 1.000 0
#> SRR901180 2 0.000 0.967 0.000 1.000 0
#> SRR901181 3 0.000 1.000 0.000 0.000 1
#> SRR901182 1 0.000 1.000 1.000 0.000 0
#> SRR901183 1 0.000 1.000 1.000 0.000 0
#> SRR901184 1 0.000 1.000 1.000 0.000 0
#> SRR901185 3 0.000 1.000 0.000 0.000 1
#> SRR901187 2 0.000 0.967 0.000 1.000 0
#> SRR901186 2 0.000 0.967 0.000 1.000 0
#> SRR901188 2 0.000 0.967 0.000 1.000 0
#> SRR901189 3 0.000 1.000 0.000 0.000 1
#> SRR901190 1 0.000 1.000 1.000 0.000 0
#> SRR901191 1 0.000 1.000 1.000 0.000 0
#> SRR901192 1 0.000 1.000 1.000 0.000 0
#> SRR901193 3 0.000 1.000 0.000 0.000 1
#> SRR901194 2 0.000 0.967 0.000 1.000 0
#> SRR901195 2 0.000 0.967 0.000 1.000 0
#> SRR901196 2 0.000 0.967 0.000 1.000 0
#> SRR901197 3 0.000 1.000 0.000 0.000 1
#> SRR901198 1 0.000 1.000 1.000 0.000 0
#> SRR901199 1 0.000 1.000 1.000 0.000 0
#> SRR901200 1 0.000 1.000 1.000 0.000 0
#> SRR901201 3 0.000 1.000 0.000 0.000 1
#> SRR901202 2 0.000 0.967 0.000 1.000 0
#> SRR901203 2 0.000 0.967 0.000 1.000 0
#> SRR901204 2 0.000 0.967 0.000 1.000 0
#> SRR901205 3 0.000 1.000 0.000 0.000 1
#> SRR901206 1 0.000 1.000 1.000 0.000 0
#> SRR901207 1 0.000 1.000 1.000 0.000 0
#> SRR901208 1 0.000 1.000 1.000 0.000 0
#> SRR901209 3 0.000 1.000 0.000 0.000 1
#> SRR901211 2 0.000 0.967 0.000 1.000 0
#> SRR901210 2 0.000 0.967 0.000 1.000 0
#> SRR901212 2 0.000 0.967 0.000 1.000 0
#> SRR901213 3 0.000 1.000 0.000 0.000 1
#> SRR901214 2 0.000 0.967 0.000 1.000 0
#> SRR901215 2 0.000 0.967 0.000 1.000 0
#> SRR901216 2 0.000 0.967 0.000 1.000 0
#> SRR901217 3 0.000 1.000 0.000 0.000 1
#> SRR901218 2 0.000 0.967 0.000 1.000 0
#> SRR901219 2 0.000 0.967 0.000 1.000 0
#> SRR901220 2 0.000 0.967 0.000 1.000 0
#> SRR901221 3 0.000 1.000 0.000 0.000 1
#> SRR901222 2 0.000 0.967 0.000 1.000 0
#> SRR901223 2 0.000 0.967 0.000 1.000 0
#> SRR901224 2 0.000 0.967 0.000 1.000 0
#> SRR901225 3 0.000 1.000 0.000 0.000 1
#> SRR901226 2 0.000 0.967 0.000 1.000 0
#> SRR901227 2 0.568 0.562 0.316 0.684 0
#> SRR901229 3 0.000 1.000 0.000 0.000 1
#> SRR901228 2 0.518 0.669 0.256 0.744 0
#> SRR901230 2 0.000 0.967 0.000 1.000 0
#> SRR901231 2 0.000 0.967 0.000 1.000 0
#> SRR901232 2 0.000 0.967 0.000 1.000 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901150 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901151 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901152 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901154 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901155 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901156 2 0.1637 0.894 0.00 0.940 0 0.060
#> SRR901157 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901158 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901159 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901160 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901162 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901163 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901164 2 0.0000 0.879 0.00 1.000 0 0.000
#> SRR901165 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901166 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901167 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901168 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901169 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901170 2 0.0000 0.879 0.00 1.000 0 0.000
#> SRR901171 2 0.0000 0.879 0.00 1.000 0 0.000
#> SRR901172 2 0.0000 0.879 0.00 1.000 0 0.000
#> SRR901173 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901174 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901175 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901176 2 0.0707 0.869 0.02 0.980 0 0.000
#> SRR901177 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901178 2 0.3266 0.900 0.00 0.832 0 0.168
#> SRR901179 2 0.2647 0.903 0.00 0.880 0 0.120
#> SRR901180 2 0.0000 0.879 0.00 1.000 0 0.000
#> SRR901181 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901182 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901183 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901184 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901185 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901187 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901186 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901188 2 0.3400 0.896 0.00 0.820 0 0.180
#> SRR901189 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901190 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901191 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901192 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901194 2 0.3123 0.903 0.00 0.844 0 0.156
#> SRR901195 2 0.3123 0.903 0.00 0.844 0 0.156
#> SRR901196 2 0.0000 0.879 0.00 1.000 0 0.000
#> SRR901197 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901198 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901199 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901200 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901202 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901203 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901204 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901205 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901206 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901207 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901208 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901209 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901211 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901210 2 0.3356 0.899 0.00 0.824 0 0.176
#> SRR901212 2 0.2973 0.904 0.00 0.856 0 0.144
#> SRR901213 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901214 2 0.0592 0.876 0.00 0.984 0 0.016
#> SRR901215 2 0.0592 0.876 0.00 0.984 0 0.016
#> SRR901216 2 0.0592 0.876 0.00 0.984 0 0.016
#> SRR901217 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901218 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901219 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901220 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901221 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901222 2 0.3123 0.903 0.00 0.844 0 0.156
#> SRR901223 2 0.4697 0.664 0.00 0.644 0 0.356
#> SRR901224 2 0.0336 0.878 0.00 0.992 0 0.008
#> SRR901225 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901226 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901227 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901229 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901228 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901230 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901231 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901232 4 0.0000 1.000 0.00 0.000 0 1.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 3 0.0000 0.688 0.000 0.000 1.000 0.000 0.000
#> SRR901150 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901154 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901155 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901156 2 0.0162 0.644 0.000 0.996 0.000 0.004 0.000
#> SRR901157 3 0.0000 0.688 0.000 0.000 1.000 0.000 0.000
#> SRR901158 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901162 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901163 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901164 5 0.4307 0.960 0.000 0.500 0.000 0.000 0.500
#> SRR901165 3 0.0000 0.688 0.000 0.000 1.000 0.000 0.000
#> SRR901166 1 0.0162 0.997 0.996 0.000 0.000 0.000 0.004
#> SRR901167 1 0.0290 0.994 0.992 0.000 0.000 0.000 0.008
#> SRR901168 1 0.0162 0.997 0.996 0.000 0.000 0.000 0.004
#> SRR901169 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901170 2 0.3796 -0.184 0.000 0.700 0.000 0.000 0.300
#> SRR901171 2 0.3857 -0.239 0.000 0.688 0.000 0.000 0.312
#> SRR901172 2 0.3796 -0.184 0.000 0.700 0.000 0.000 0.300
#> SRR901173 3 0.0000 0.688 0.000 0.000 1.000 0.000 0.000
#> SRR901174 1 0.0290 0.994 0.992 0.000 0.000 0.000 0.008
#> SRR901175 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901176 5 0.4658 0.956 0.000 0.484 0.012 0.000 0.504
#> SRR901177 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901178 2 0.6392 -0.383 0.000 0.512 0.000 0.220 0.268
#> SRR901179 2 0.3419 0.348 0.000 0.804 0.000 0.016 0.180
#> SRR901180 2 0.4307 -0.963 0.000 0.504 0.000 0.000 0.496
#> SRR901181 3 0.0000 0.688 0.000 0.000 1.000 0.000 0.000
#> SRR901182 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901187 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901186 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901188 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901189 3 0.0000 0.688 0.000 0.000 1.000 0.000 0.000
#> SRR901190 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901194 2 0.0794 0.672 0.000 0.972 0.000 0.028 0.000
#> SRR901195 2 0.0794 0.672 0.000 0.972 0.000 0.028 0.000
#> SRR901196 2 0.3876 -0.260 0.000 0.684 0.000 0.000 0.316
#> SRR901197 3 0.0000 0.688 0.000 0.000 1.000 0.000 0.000
#> SRR901198 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901202 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901203 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901204 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901205 3 0.0000 0.688 0.000 0.000 1.000 0.000 0.000
#> SRR901206 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901211 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901210 2 0.0880 0.674 0.000 0.968 0.000 0.032 0.000
#> SRR901212 2 0.0609 0.664 0.000 0.980 0.000 0.020 0.000
#> SRR901213 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901214 5 0.4659 0.980 0.000 0.492 0.000 0.012 0.496
#> SRR901215 5 0.4659 0.980 0.000 0.492 0.000 0.012 0.496
#> SRR901216 5 0.4659 0.980 0.000 0.492 0.000 0.012 0.496
#> SRR901217 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901218 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901219 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901220 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901221 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901222 2 0.5433 -0.205 0.000 0.620 0.000 0.092 0.288
#> SRR901223 2 0.6038 -0.045 0.000 0.576 0.000 0.240 0.184
#> SRR901224 2 0.4307 -0.970 0.000 0.500 0.000 0.000 0.500
#> SRR901225 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901226 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901227 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901229 3 0.4307 0.822 0.000 0.000 0.504 0.000 0.496
#> SRR901228 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901230 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901231 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901232 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.2340 0.995 0.000 0.000 0.148 0.000 0.852 0.000
#> SRR901150 1 0.0520 0.973 0.984 0.000 0.000 0.000 0.008 0.008
#> SRR901151 1 0.0520 0.973 0.984 0.000 0.000 0.000 0.008 0.008
#> SRR901152 1 0.0520 0.973 0.984 0.000 0.000 0.000 0.008 0.008
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901154 2 0.0146 0.952 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR901155 2 0.0146 0.952 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR901156 2 0.0146 0.952 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR901157 5 0.2340 0.995 0.000 0.000 0.148 0.000 0.852 0.000
#> SRR901158 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901162 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901163 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901164 6 0.2618 0.709 0.000 0.052 0.000 0.000 0.076 0.872
#> SRR901165 5 0.2631 0.961 0.000 0.000 0.180 0.000 0.820 0.000
#> SRR901166 1 0.2328 0.927 0.892 0.000 0.000 0.000 0.056 0.052
#> SRR901167 1 0.2390 0.925 0.888 0.000 0.000 0.000 0.056 0.056
#> SRR901168 1 0.2328 0.927 0.892 0.000 0.000 0.000 0.056 0.052
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901170 6 0.4057 0.430 0.000 0.436 0.000 0.000 0.008 0.556
#> SRR901171 6 0.3965 0.503 0.000 0.388 0.000 0.000 0.008 0.604
#> SRR901172 6 0.4057 0.430 0.000 0.436 0.000 0.000 0.008 0.556
#> SRR901173 5 0.2340 0.995 0.000 0.000 0.148 0.000 0.852 0.000
#> SRR901174 1 0.2390 0.925 0.888 0.000 0.000 0.000 0.056 0.056
#> SRR901175 1 0.1657 0.948 0.928 0.000 0.000 0.000 0.056 0.016
#> SRR901176 6 0.1858 0.676 0.000 0.012 0.000 0.000 0.076 0.912
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901178 6 0.5472 0.562 0.000 0.180 0.000 0.256 0.000 0.564
#> SRR901179 2 0.3823 -0.169 0.000 0.564 0.000 0.000 0.000 0.436
#> SRR901180 6 0.2048 0.722 0.000 0.120 0.000 0.000 0.000 0.880
#> SRR901181 5 0.2340 0.995 0.000 0.000 0.148 0.000 0.852 0.000
#> SRR901182 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901187 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901186 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901188 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901189 5 0.2340 0.995 0.000 0.000 0.148 0.000 0.852 0.000
#> SRR901190 1 0.1500 0.952 0.936 0.000 0.000 0.000 0.052 0.012
#> SRR901191 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901194 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901195 2 0.0146 0.951 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR901196 6 0.3810 0.452 0.000 0.428 0.000 0.000 0.000 0.572
#> SRR901197 5 0.2340 0.995 0.000 0.000 0.148 0.000 0.852 0.000
#> SRR901198 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901202 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901203 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901204 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901205 5 0.2340 0.995 0.000 0.000 0.148 0.000 0.852 0.000
#> SRR901206 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901211 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901210 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901212 2 0.0000 0.955 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901214 6 0.2009 0.730 0.000 0.084 0.000 0.008 0.004 0.904
#> SRR901215 6 0.2009 0.730 0.000 0.084 0.000 0.008 0.004 0.904
#> SRR901216 6 0.2009 0.730 0.000 0.084 0.000 0.008 0.004 0.904
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901218 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.008 0.000
#> SRR901219 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.008 0.000
#> SRR901220 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.008 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901222 6 0.6111 0.348 0.000 0.368 0.000 0.060 0.084 0.488
#> SRR901223 6 0.7012 0.270 0.000 0.340 0.000 0.188 0.084 0.388
#> SRR901224 6 0.2618 0.709 0.000 0.052 0.000 0.000 0.076 0.872
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901226 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901227 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901228 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901230 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901231 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901232 4 0.0000 0.998 0.000 0.000 0.000 1.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "pam"]
# you can also extract it by
# res = res_list["SD:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.494 0.737 0.777 0.3834 0.633 0.633
#> 3 3 1.000 0.994 0.997 0.6609 0.729 0.573
#> 4 4 1.000 0.995 0.998 0.0566 0.960 0.891
#> 5 5 0.882 0.895 0.942 0.1660 0.888 0.657
#> 6 6 1.000 0.964 0.975 0.0510 0.924 0.675
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4
There is also optional best \(k\) = 3 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.994 0.999 0.456 0.544
#> SRR901150 1 0.994 0.586 0.544 0.456
#> SRR901151 1 0.994 0.586 0.544 0.456
#> SRR901152 1 0.994 0.586 0.544 0.456
#> SRR1382100 2 0.994 0.999 0.456 0.544
#> SRR901154 1 0.000 0.695 1.000 0.000
#> SRR901155 1 0.000 0.695 1.000 0.000
#> SRR901156 1 0.000 0.695 1.000 0.000
#> SRR901157 2 0.994 0.999 0.456 0.544
#> SRR901158 1 0.994 0.586 0.544 0.456
#> SRR901159 1 0.994 0.586 0.544 0.456
#> SRR901160 1 0.994 0.586 0.544 0.456
#> SRR901161 2 0.994 0.999 0.456 0.544
#> SRR901162 1 0.000 0.695 1.000 0.000
#> SRR901163 1 0.000 0.695 1.000 0.000
#> SRR901164 1 0.000 0.695 1.000 0.000
#> SRR901165 2 0.994 0.999 0.456 0.544
#> SRR901166 1 0.994 0.586 0.544 0.456
#> SRR901167 1 0.983 0.588 0.576 0.424
#> SRR901168 1 0.994 0.586 0.544 0.456
#> SRR901169 2 0.994 0.999 0.456 0.544
#> SRR901170 1 0.000 0.695 1.000 0.000
#> SRR901171 1 0.000 0.695 1.000 0.000
#> SRR901172 1 0.000 0.695 1.000 0.000
#> SRR901173 1 0.000 0.695 1.000 0.000
#> SRR901174 1 0.994 0.586 0.544 0.456
#> SRR901175 1 0.994 0.586 0.544 0.456
#> SRR901176 1 0.000 0.695 1.000 0.000
#> SRR901177 2 0.994 0.999 0.456 0.544
#> SRR901178 1 0.000 0.695 1.000 0.000
#> SRR901179 1 0.000 0.695 1.000 0.000
#> SRR901180 1 0.000 0.695 1.000 0.000
#> SRR901181 2 0.994 0.999 0.456 0.544
#> SRR901182 1 0.994 0.586 0.544 0.456
#> SRR901183 1 0.994 0.586 0.544 0.456
#> SRR901184 1 0.994 0.586 0.544 0.456
#> SRR901185 2 0.994 0.999 0.456 0.544
#> SRR901187 1 0.000 0.695 1.000 0.000
#> SRR901186 1 0.000 0.695 1.000 0.000
#> SRR901188 1 0.000 0.695 1.000 0.000
#> SRR901189 2 0.994 0.999 0.456 0.544
#> SRR901190 1 0.994 0.586 0.544 0.456
#> SRR901191 1 0.994 0.586 0.544 0.456
#> SRR901192 1 0.994 0.586 0.544 0.456
#> SRR901193 2 0.994 0.999 0.456 0.544
#> SRR901194 1 0.000 0.695 1.000 0.000
#> SRR901195 1 0.000 0.695 1.000 0.000
#> SRR901196 1 0.000 0.695 1.000 0.000
#> SRR901197 2 0.996 0.987 0.464 0.536
#> SRR901198 1 0.994 0.586 0.544 0.456
#> SRR901199 1 0.994 0.586 0.544 0.456
#> SRR901200 1 0.994 0.586 0.544 0.456
#> SRR901201 2 0.994 0.999 0.456 0.544
#> SRR901202 1 0.000 0.695 1.000 0.000
#> SRR901203 1 0.000 0.695 1.000 0.000
#> SRR901204 1 0.000 0.695 1.000 0.000
#> SRR901205 2 0.994 0.999 0.456 0.544
#> SRR901206 1 0.994 0.586 0.544 0.456
#> SRR901207 1 0.994 0.586 0.544 0.456
#> SRR901208 1 0.994 0.586 0.544 0.456
#> SRR901209 2 0.994 0.999 0.456 0.544
#> SRR901211 1 0.000 0.695 1.000 0.000
#> SRR901210 1 0.000 0.695 1.000 0.000
#> SRR901212 1 0.000 0.695 1.000 0.000
#> SRR901213 2 0.994 0.999 0.456 0.544
#> SRR901214 1 0.000 0.695 1.000 0.000
#> SRR901215 1 0.000 0.695 1.000 0.000
#> SRR901216 1 0.000 0.695 1.000 0.000
#> SRR901217 2 0.994 0.999 0.456 0.544
#> SRR901218 1 0.000 0.695 1.000 0.000
#> SRR901219 1 0.000 0.695 1.000 0.000
#> SRR901220 1 0.000 0.695 1.000 0.000
#> SRR901221 2 0.994 0.999 0.456 0.544
#> SRR901222 1 0.000 0.695 1.000 0.000
#> SRR901223 1 0.000 0.695 1.000 0.000
#> SRR901224 1 0.000 0.695 1.000 0.000
#> SRR901225 2 0.994 0.999 0.456 0.544
#> SRR901226 1 0.000 0.695 1.000 0.000
#> SRR901227 1 0.000 0.695 1.000 0.000
#> SRR901229 2 0.994 0.999 0.456 0.544
#> SRR901228 1 0.000 0.695 1.000 0.000
#> SRR901230 1 0.000 0.695 1.000 0.000
#> SRR901231 1 0.000 0.695 1.000 0.000
#> SRR901232 1 0.000 0.695 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.103 0.971 0.00 0.024 0.976
#> SRR901150 1 0.000 0.992 1.00 0.000 0.000
#> SRR901151 1 0.000 0.992 1.00 0.000 0.000
#> SRR901152 1 0.000 0.992 1.00 0.000 0.000
#> SRR1382100 3 0.000 0.995 0.00 0.000 1.000
#> SRR901154 2 0.000 1.000 0.00 1.000 0.000
#> SRR901155 2 0.000 1.000 0.00 1.000 0.000
#> SRR901156 2 0.000 1.000 0.00 1.000 0.000
#> SRR901157 3 0.000 0.995 0.00 0.000 1.000
#> SRR901158 1 0.000 0.992 1.00 0.000 0.000
#> SRR901159 1 0.000 0.992 1.00 0.000 0.000
#> SRR901160 1 0.000 0.992 1.00 0.000 0.000
#> SRR901161 3 0.000 0.995 0.00 0.000 1.000
#> SRR901162 2 0.000 1.000 0.00 1.000 0.000
#> SRR901163 2 0.000 1.000 0.00 1.000 0.000
#> SRR901164 2 0.000 1.000 0.00 1.000 0.000
#> SRR901165 3 0.000 0.995 0.00 0.000 1.000
#> SRR901166 1 0.000 0.992 1.00 0.000 0.000
#> SRR901167 1 0.369 0.818 0.86 0.140 0.000
#> SRR901168 1 0.000 0.992 1.00 0.000 0.000
#> SRR901169 3 0.000 0.995 0.00 0.000 1.000
#> SRR901170 2 0.000 1.000 0.00 1.000 0.000
#> SRR901171 2 0.000 1.000 0.00 1.000 0.000
#> SRR901172 2 0.000 1.000 0.00 1.000 0.000
#> SRR901173 2 0.000 1.000 0.00 1.000 0.000
#> SRR901174 1 0.000 0.992 1.00 0.000 0.000
#> SRR901175 1 0.000 0.992 1.00 0.000 0.000
#> SRR901176 2 0.000 1.000 0.00 1.000 0.000
#> SRR901177 3 0.000 0.995 0.00 0.000 1.000
#> SRR901178 2 0.000 1.000 0.00 1.000 0.000
#> SRR901179 2 0.000 1.000 0.00 1.000 0.000
#> SRR901180 2 0.000 1.000 0.00 1.000 0.000
#> SRR901181 3 0.000 0.995 0.00 0.000 1.000
#> SRR901182 1 0.000 0.992 1.00 0.000 0.000
#> SRR901183 1 0.000 0.992 1.00 0.000 0.000
#> SRR901184 1 0.000 0.992 1.00 0.000 0.000
#> SRR901185 3 0.000 0.995 0.00 0.000 1.000
#> SRR901187 2 0.000 1.000 0.00 1.000 0.000
#> SRR901186 2 0.000 1.000 0.00 1.000 0.000
#> SRR901188 2 0.000 1.000 0.00 1.000 0.000
#> SRR901189 3 0.000 0.995 0.00 0.000 1.000
#> SRR901190 1 0.000 0.992 1.00 0.000 0.000
#> SRR901191 1 0.000 0.992 1.00 0.000 0.000
#> SRR901192 1 0.000 0.992 1.00 0.000 0.000
#> SRR901193 3 0.000 0.995 0.00 0.000 1.000
#> SRR901194 2 0.000 1.000 0.00 1.000 0.000
#> SRR901195 2 0.000 1.000 0.00 1.000 0.000
#> SRR901196 2 0.000 1.000 0.00 1.000 0.000
#> SRR901197 3 0.175 0.943 0.00 0.048 0.952
#> SRR901198 1 0.000 0.992 1.00 0.000 0.000
#> SRR901199 1 0.000 0.992 1.00 0.000 0.000
#> SRR901200 1 0.000 0.992 1.00 0.000 0.000
#> SRR901201 3 0.000 0.995 0.00 0.000 1.000
#> SRR901202 2 0.000 1.000 0.00 1.000 0.000
#> SRR901203 2 0.000 1.000 0.00 1.000 0.000
#> SRR901204 2 0.000 1.000 0.00 1.000 0.000
#> SRR901205 3 0.000 0.995 0.00 0.000 1.000
#> SRR901206 1 0.000 0.992 1.00 0.000 0.000
#> SRR901207 1 0.000 0.992 1.00 0.000 0.000
#> SRR901208 1 0.000 0.992 1.00 0.000 0.000
#> SRR901209 3 0.000 0.995 0.00 0.000 1.000
#> SRR901211 2 0.000 1.000 0.00 1.000 0.000
#> SRR901210 2 0.000 1.000 0.00 1.000 0.000
#> SRR901212 2 0.000 1.000 0.00 1.000 0.000
#> SRR901213 3 0.000 0.995 0.00 0.000 1.000
#> SRR901214 2 0.000 1.000 0.00 1.000 0.000
#> SRR901215 2 0.000 1.000 0.00 1.000 0.000
#> SRR901216 2 0.000 1.000 0.00 1.000 0.000
#> SRR901217 3 0.000 0.995 0.00 0.000 1.000
#> SRR901218 2 0.000 1.000 0.00 1.000 0.000
#> SRR901219 2 0.000 1.000 0.00 1.000 0.000
#> SRR901220 2 0.000 1.000 0.00 1.000 0.000
#> SRR901221 3 0.000 0.995 0.00 0.000 1.000
#> SRR901222 2 0.000 1.000 0.00 1.000 0.000
#> SRR901223 2 0.000 1.000 0.00 1.000 0.000
#> SRR901224 2 0.000 1.000 0.00 1.000 0.000
#> SRR901225 3 0.000 0.995 0.00 0.000 1.000
#> SRR901226 2 0.000 1.000 0.00 1.000 0.000
#> SRR901227 2 0.000 1.000 0.00 1.000 0.000
#> SRR901229 3 0.000 0.995 0.00 0.000 1.000
#> SRR901228 2 0.000 1.000 0.00 1.000 0.000
#> SRR901230 2 0.000 1.000 0.00 1.000 0.000
#> SRR901231 2 0.000 1.000 0.00 1.000 0.000
#> SRR901232 2 0.000 1.000 0.00 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.000 1.000 0.00 0.00 0 1
#> SRR901150 1 0.000 0.991 1.00 0.00 0 0
#> SRR901151 1 0.000 0.991 1.00 0.00 0 0
#> SRR901152 1 0.000 0.991 1.00 0.00 0 0
#> SRR1382100 3 0.000 1.000 0.00 0.00 1 0
#> SRR901154 2 0.000 1.000 0.00 1.00 0 0
#> SRR901155 2 0.000 1.000 0.00 1.00 0 0
#> SRR901156 2 0.000 1.000 0.00 1.00 0 0
#> SRR901157 4 0.000 1.000 0.00 0.00 0 1
#> SRR901158 1 0.000 0.991 1.00 0.00 0 0
#> SRR901159 1 0.000 0.991 1.00 0.00 0 0
#> SRR901160 1 0.000 0.991 1.00 0.00 0 0
#> SRR901161 3 0.000 1.000 0.00 0.00 1 0
#> SRR901162 2 0.000 1.000 0.00 1.00 0 0
#> SRR901163 2 0.000 1.000 0.00 1.00 0 0
#> SRR901164 2 0.000 1.000 0.00 1.00 0 0
#> SRR901165 4 0.000 1.000 0.00 0.00 0 1
#> SRR901166 1 0.000 0.991 1.00 0.00 0 0
#> SRR901167 1 0.292 0.782 0.86 0.14 0 0
#> SRR901168 1 0.000 0.991 1.00 0.00 0 0
#> SRR901169 3 0.000 1.000 0.00 0.00 1 0
#> SRR901170 2 0.000 1.000 0.00 1.00 0 0
#> SRR901171 2 0.000 1.000 0.00 1.00 0 0
#> SRR901172 2 0.000 1.000 0.00 1.00 0 0
#> SRR901173 4 0.000 1.000 0.00 0.00 0 1
#> SRR901174 1 0.000 0.991 1.00 0.00 0 0
#> SRR901175 1 0.000 0.991 1.00 0.00 0 0
#> SRR901176 2 0.000 1.000 0.00 1.00 0 0
#> SRR901177 3 0.000 1.000 0.00 0.00 1 0
#> SRR901178 2 0.000 1.000 0.00 1.00 0 0
#> SRR901179 2 0.000 1.000 0.00 1.00 0 0
#> SRR901180 2 0.000 1.000 0.00 1.00 0 0
#> SRR901181 4 0.000 1.000 0.00 0.00 0 1
#> SRR901182 1 0.000 0.991 1.00 0.00 0 0
#> SRR901183 1 0.000 0.991 1.00 0.00 0 0
#> SRR901184 1 0.000 0.991 1.00 0.00 0 0
#> SRR901185 3 0.000 1.000 0.00 0.00 1 0
#> SRR901187 2 0.000 1.000 0.00 1.00 0 0
#> SRR901186 2 0.000 1.000 0.00 1.00 0 0
#> SRR901188 2 0.000 1.000 0.00 1.00 0 0
#> SRR901189 4 0.000 1.000 0.00 0.00 0 1
#> SRR901190 1 0.000 0.991 1.00 0.00 0 0
#> SRR901191 1 0.000 0.991 1.00 0.00 0 0
#> SRR901192 1 0.000 0.991 1.00 0.00 0 0
#> SRR901193 3 0.000 1.000 0.00 0.00 1 0
#> SRR901194 2 0.000 1.000 0.00 1.00 0 0
#> SRR901195 2 0.000 1.000 0.00 1.00 0 0
#> SRR901196 2 0.000 1.000 0.00 1.00 0 0
#> SRR901197 4 0.000 1.000 0.00 0.00 0 1
#> SRR901198 1 0.000 0.991 1.00 0.00 0 0
#> SRR901199 1 0.000 0.991 1.00 0.00 0 0
#> SRR901200 1 0.000 0.991 1.00 0.00 0 0
#> SRR901201 3 0.000 1.000 0.00 0.00 1 0
#> SRR901202 2 0.000 1.000 0.00 1.00 0 0
#> SRR901203 2 0.000 1.000 0.00 1.00 0 0
#> SRR901204 2 0.000 1.000 0.00 1.00 0 0
#> SRR901205 4 0.000 1.000 0.00 0.00 0 1
#> SRR901206 1 0.000 0.991 1.00 0.00 0 0
#> SRR901207 1 0.000 0.991 1.00 0.00 0 0
#> SRR901208 1 0.000 0.991 1.00 0.00 0 0
#> SRR901209 3 0.000 1.000 0.00 0.00 1 0
#> SRR901211 2 0.000 1.000 0.00 1.00 0 0
#> SRR901210 2 0.000 1.000 0.00 1.00 0 0
#> SRR901212 2 0.000 1.000 0.00 1.00 0 0
#> SRR901213 3 0.000 1.000 0.00 0.00 1 0
#> SRR901214 2 0.000 1.000 0.00 1.00 0 0
#> SRR901215 2 0.000 1.000 0.00 1.00 0 0
#> SRR901216 2 0.000 1.000 0.00 1.00 0 0
#> SRR901217 3 0.000 1.000 0.00 0.00 1 0
#> SRR901218 2 0.000 1.000 0.00 1.00 0 0
#> SRR901219 2 0.000 1.000 0.00 1.00 0 0
#> SRR901220 2 0.000 1.000 0.00 1.00 0 0
#> SRR901221 3 0.000 1.000 0.00 0.00 1 0
#> SRR901222 2 0.000 1.000 0.00 1.00 0 0
#> SRR901223 2 0.000 1.000 0.00 1.00 0 0
#> SRR901224 2 0.000 1.000 0.00 1.00 0 0
#> SRR901225 3 0.000 1.000 0.00 0.00 1 0
#> SRR901226 2 0.000 1.000 0.00 1.00 0 0
#> SRR901227 2 0.000 1.000 0.00 1.00 0 0
#> SRR901229 3 0.000 1.000 0.00 0.00 1 0
#> SRR901228 2 0.000 1.000 0.00 1.00 0 0
#> SRR901230 2 0.000 1.000 0.00 1.00 0 0
#> SRR901231 2 0.000 1.000 0.00 1.00 0 0
#> SRR901232 2 0.000 1.000 0.00 1.00 0 0
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901150 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901151 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901152 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901154 4 0.3480 0.720 0.000 0.248 0 0.752 0
#> SRR901155 4 0.3452 0.722 0.000 0.244 0 0.756 0
#> SRR901156 2 0.0000 0.818 0.000 1.000 0 0.000 0
#> SRR901157 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901158 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901159 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901160 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901162 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901163 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901164 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901165 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901166 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901167 1 0.2377 0.828 0.872 0.000 0 0.128 0
#> SRR901168 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901170 2 0.0000 0.818 0.000 1.000 0 0.000 0
#> SRR901171 2 0.3274 0.828 0.000 0.780 0 0.220 0
#> SRR901172 2 0.0000 0.818 0.000 1.000 0 0.000 0
#> SRR901173 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901174 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901175 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901176 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901178 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901179 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901180 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901181 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901182 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901183 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901184 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901187 2 0.0510 0.809 0.000 0.984 0 0.016 0
#> SRR901186 2 0.0000 0.818 0.000 1.000 0 0.000 0
#> SRR901188 4 0.3452 0.722 0.000 0.244 0 0.756 0
#> SRR901189 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901190 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901191 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901192 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901194 2 0.0162 0.819 0.000 0.996 0 0.004 0
#> SRR901195 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901196 2 0.3109 0.829 0.000 0.800 0 0.200 0
#> SRR901197 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901198 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901199 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901200 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901202 2 0.0000 0.818 0.000 1.000 0 0.000 0
#> SRR901203 2 0.3003 0.598 0.000 0.812 0 0.188 0
#> SRR901204 2 0.0000 0.818 0.000 1.000 0 0.000 0
#> SRR901205 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901206 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901207 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901208 1 0.0000 0.993 1.000 0.000 0 0.000 0
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901211 4 0.3452 0.722 0.000 0.244 0 0.756 0
#> SRR901210 2 0.0000 0.818 0.000 1.000 0 0.000 0
#> SRR901212 2 0.0000 0.818 0.000 1.000 0 0.000 0
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901214 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901215 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901216 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901218 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901219 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901220 4 0.3452 0.722 0.000 0.244 0 0.756 0
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901222 4 0.4283 -0.263 0.000 0.456 0 0.544 0
#> SRR901223 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901224 2 0.3452 0.824 0.000 0.756 0 0.244 0
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901226 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901227 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901228 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901230 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901231 4 0.0000 0.862 0.000 0.000 0 1.000 0
#> SRR901232 4 0.0000 0.862 0.000 0.000 0 1.000 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901150 1 0.0291 0.986 0.992 0.004 0 0.004 0 0.000
#> SRR901151 1 0.0405 0.984 0.988 0.004 0 0.008 0 0.000
#> SRR901152 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901154 2 0.0260 0.993 0.000 0.992 0 0.008 0 0.000
#> SRR901155 2 0.0260 0.993 0.000 0.992 0 0.008 0 0.000
#> SRR901156 2 0.0260 0.994 0.000 0.992 0 0.000 0 0.008
#> SRR901157 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901158 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901159 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901160 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901162 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901163 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901164 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901165 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901166 1 0.1265 0.964 0.948 0.008 0 0.044 0 0.000
#> SRR901167 1 0.1410 0.961 0.944 0.008 0 0.044 0 0.004
#> SRR901168 1 0.1265 0.964 0.948 0.008 0 0.044 0 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901170 6 0.2597 0.773 0.000 0.176 0 0.000 0 0.824
#> SRR901171 6 0.0146 0.921 0.000 0.004 0 0.000 0 0.996
#> SRR901172 6 0.2996 0.706 0.000 0.228 0 0.000 0 0.772
#> SRR901173 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901174 1 0.1265 0.964 0.948 0.008 0 0.044 0 0.000
#> SRR901175 1 0.1265 0.964 0.948 0.008 0 0.044 0 0.000
#> SRR901176 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901178 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901179 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901180 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901181 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901182 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901183 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901184 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901187 2 0.0260 0.993 0.000 0.992 0 0.008 0 0.000
#> SRR901186 2 0.0260 0.994 0.000 0.992 0 0.000 0 0.008
#> SRR901188 2 0.0260 0.993 0.000 0.992 0 0.008 0 0.000
#> SRR901189 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901190 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901191 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901192 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901194 2 0.0363 0.991 0.000 0.988 0 0.000 0 0.012
#> SRR901195 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901196 6 0.0146 0.921 0.000 0.004 0 0.000 0 0.996
#> SRR901197 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901198 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901199 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901200 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901202 2 0.0260 0.994 0.000 0.992 0 0.000 0 0.008
#> SRR901203 2 0.0260 0.993 0.000 0.992 0 0.008 0 0.000
#> SRR901204 2 0.0260 0.994 0.000 0.992 0 0.000 0 0.008
#> SRR901205 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901206 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901207 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901208 1 0.0000 0.989 1.000 0.000 0 0.000 0 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901211 2 0.0260 0.993 0.000 0.992 0 0.008 0 0.000
#> SRR901210 2 0.0260 0.994 0.000 0.992 0 0.000 0 0.008
#> SRR901212 2 0.0260 0.994 0.000 0.992 0 0.000 0 0.008
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901214 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901215 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901216 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901218 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901219 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901220 4 0.1007 0.936 0.000 0.044 0 0.956 0 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901222 6 0.3351 0.590 0.000 0.000 0 0.288 0 0.712
#> SRR901223 6 0.3634 0.453 0.000 0.000 0 0.356 0 0.644
#> SRR901224 6 0.0000 0.923 0.000 0.000 0 0.000 0 1.000
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901226 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901227 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901228 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901230 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901231 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
#> SRR901232 4 0.1007 0.994 0.000 0.000 0 0.956 0 0.044
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "mclust"]
# you can also extract it by
# res = res_list["SD:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.501 0.859 0.879 0.4522 0.523 0.523
#> 3 3 1.000 0.998 0.998 0.4329 0.770 0.583
#> 4 4 1.000 0.979 0.993 0.0463 0.961 0.891
#> 5 5 0.893 0.922 0.935 0.1126 0.924 0.768
#> 6 6 0.921 0.917 0.944 0.0774 0.915 0.678
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4
There is also optional best \(k\) = 3 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 1 0.000 0.735 1.000 0.000
#> SRR901150 1 0.839 0.905 0.732 0.268
#> SRR901151 1 0.839 0.905 0.732 0.268
#> SRR901152 1 0.839 0.905 0.732 0.268
#> SRR1382100 2 0.861 0.711 0.284 0.716
#> SRR901154 2 0.000 0.906 0.000 1.000
#> SRR901155 2 0.000 0.906 0.000 1.000
#> SRR901156 2 0.000 0.906 0.000 1.000
#> SRR901157 1 0.000 0.735 1.000 0.000
#> SRR901158 1 0.839 0.905 0.732 0.268
#> SRR901159 1 0.839 0.905 0.732 0.268
#> SRR901160 1 0.839 0.905 0.732 0.268
#> SRR901161 2 0.861 0.711 0.284 0.716
#> SRR901162 2 0.000 0.906 0.000 1.000
#> SRR901163 2 0.000 0.906 0.000 1.000
#> SRR901164 2 0.000 0.906 0.000 1.000
#> SRR901165 1 0.000 0.735 1.000 0.000
#> SRR901166 1 0.839 0.905 0.732 0.268
#> SRR901167 1 0.839 0.905 0.732 0.268
#> SRR901168 1 0.839 0.905 0.732 0.268
#> SRR901169 2 0.861 0.711 0.284 0.716
#> SRR901170 2 0.000 0.906 0.000 1.000
#> SRR901171 2 0.000 0.906 0.000 1.000
#> SRR901172 2 0.000 0.906 0.000 1.000
#> SRR901173 1 0.000 0.735 1.000 0.000
#> SRR901174 1 0.839 0.905 0.732 0.268
#> SRR901175 1 0.839 0.905 0.732 0.268
#> SRR901176 1 0.839 0.905 0.732 0.268
#> SRR901177 2 0.861 0.711 0.284 0.716
#> SRR901178 2 0.000 0.906 0.000 1.000
#> SRR901179 2 0.000 0.906 0.000 1.000
#> SRR901180 2 0.000 0.906 0.000 1.000
#> SRR901181 1 0.000 0.735 1.000 0.000
#> SRR901182 1 0.839 0.905 0.732 0.268
#> SRR901183 1 0.839 0.905 0.732 0.268
#> SRR901184 1 0.839 0.905 0.732 0.268
#> SRR901185 2 0.861 0.711 0.284 0.716
#> SRR901187 2 0.000 0.906 0.000 1.000
#> SRR901186 2 0.000 0.906 0.000 1.000
#> SRR901188 2 0.000 0.906 0.000 1.000
#> SRR901189 1 0.000 0.735 1.000 0.000
#> SRR901190 1 0.839 0.905 0.732 0.268
#> SRR901191 1 0.839 0.905 0.732 0.268
#> SRR901192 1 0.839 0.905 0.732 0.268
#> SRR901193 2 0.861 0.711 0.284 0.716
#> SRR901194 2 0.000 0.906 0.000 1.000
#> SRR901195 2 0.000 0.906 0.000 1.000
#> SRR901196 2 0.000 0.906 0.000 1.000
#> SRR901197 1 0.000 0.735 1.000 0.000
#> SRR901198 1 0.839 0.905 0.732 0.268
#> SRR901199 1 0.839 0.905 0.732 0.268
#> SRR901200 1 0.839 0.905 0.732 0.268
#> SRR901201 2 0.861 0.711 0.284 0.716
#> SRR901202 2 0.000 0.906 0.000 1.000
#> SRR901203 2 0.000 0.906 0.000 1.000
#> SRR901204 2 0.000 0.906 0.000 1.000
#> SRR901205 1 0.000 0.735 1.000 0.000
#> SRR901206 1 0.839 0.905 0.732 0.268
#> SRR901207 1 0.839 0.905 0.732 0.268
#> SRR901208 1 0.839 0.905 0.732 0.268
#> SRR901209 2 0.861 0.711 0.284 0.716
#> SRR901211 2 0.000 0.906 0.000 1.000
#> SRR901210 2 0.000 0.906 0.000 1.000
#> SRR901212 2 0.000 0.906 0.000 1.000
#> SRR901213 2 0.861 0.711 0.284 0.716
#> SRR901214 2 0.000 0.906 0.000 1.000
#> SRR901215 2 0.000 0.906 0.000 1.000
#> SRR901216 2 0.000 0.906 0.000 1.000
#> SRR901217 2 0.861 0.711 0.284 0.716
#> SRR901218 2 0.000 0.906 0.000 1.000
#> SRR901219 2 0.000 0.906 0.000 1.000
#> SRR901220 2 0.000 0.906 0.000 1.000
#> SRR901221 2 0.861 0.711 0.284 0.716
#> SRR901222 2 0.000 0.906 0.000 1.000
#> SRR901223 2 0.000 0.906 0.000 1.000
#> SRR901224 2 0.000 0.906 0.000 1.000
#> SRR901225 2 0.861 0.711 0.284 0.716
#> SRR901226 2 0.000 0.906 0.000 1.000
#> SRR901227 2 0.000 0.906 0.000 1.000
#> SRR901229 2 0.861 0.711 0.284 0.716
#> SRR901228 2 0.000 0.906 0.000 1.000
#> SRR901230 2 0.000 0.906 0.000 1.000
#> SRR901231 2 0.000 0.906 0.000 1.000
#> SRR901232 2 0.000 0.906 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.0747 0.989 0.016 0 0.984
#> SRR901150 1 0.0000 1.000 1.000 0 0.000
#> SRR901151 1 0.0000 1.000 1.000 0 0.000
#> SRR901152 1 0.0000 1.000 1.000 0 0.000
#> SRR1382100 3 0.0000 0.994 0.000 0 1.000
#> SRR901154 2 0.0000 1.000 0.000 1 0.000
#> SRR901155 2 0.0000 1.000 0.000 1 0.000
#> SRR901156 2 0.0000 1.000 0.000 1 0.000
#> SRR901157 3 0.0747 0.989 0.016 0 0.984
#> SRR901158 1 0.0000 1.000 1.000 0 0.000
#> SRR901159 1 0.0000 1.000 1.000 0 0.000
#> SRR901160 1 0.0000 1.000 1.000 0 0.000
#> SRR901161 3 0.0000 0.994 0.000 0 1.000
#> SRR901162 2 0.0000 1.000 0.000 1 0.000
#> SRR901163 2 0.0000 1.000 0.000 1 0.000
#> SRR901164 2 0.0000 1.000 0.000 1 0.000
#> SRR901165 3 0.0747 0.989 0.016 0 0.984
#> SRR901166 1 0.0000 1.000 1.000 0 0.000
#> SRR901167 1 0.0000 1.000 1.000 0 0.000
#> SRR901168 1 0.0000 1.000 1.000 0 0.000
#> SRR901169 3 0.0000 0.994 0.000 0 1.000
#> SRR901170 2 0.0000 1.000 0.000 1 0.000
#> SRR901171 2 0.0000 1.000 0.000 1 0.000
#> SRR901172 2 0.0000 1.000 0.000 1 0.000
#> SRR901173 3 0.0747 0.989 0.016 0 0.984
#> SRR901174 1 0.0000 1.000 1.000 0 0.000
#> SRR901175 1 0.0000 1.000 1.000 0 0.000
#> SRR901176 1 0.0000 1.000 1.000 0 0.000
#> SRR901177 3 0.0000 0.994 0.000 0 1.000
#> SRR901178 2 0.0000 1.000 0.000 1 0.000
#> SRR901179 2 0.0000 1.000 0.000 1 0.000
#> SRR901180 2 0.0000 1.000 0.000 1 0.000
#> SRR901181 3 0.0747 0.989 0.016 0 0.984
#> SRR901182 1 0.0000 1.000 1.000 0 0.000
#> SRR901183 1 0.0000 1.000 1.000 0 0.000
#> SRR901184 1 0.0000 1.000 1.000 0 0.000
#> SRR901185 3 0.0000 0.994 0.000 0 1.000
#> SRR901187 2 0.0000 1.000 0.000 1 0.000
#> SRR901186 2 0.0000 1.000 0.000 1 0.000
#> SRR901188 2 0.0000 1.000 0.000 1 0.000
#> SRR901189 3 0.0747 0.989 0.016 0 0.984
#> SRR901190 1 0.0000 1.000 1.000 0 0.000
#> SRR901191 1 0.0000 1.000 1.000 0 0.000
#> SRR901192 1 0.0000 1.000 1.000 0 0.000
#> SRR901193 3 0.0000 0.994 0.000 0 1.000
#> SRR901194 2 0.0000 1.000 0.000 1 0.000
#> SRR901195 2 0.0000 1.000 0.000 1 0.000
#> SRR901196 2 0.0000 1.000 0.000 1 0.000
#> SRR901197 3 0.0747 0.989 0.016 0 0.984
#> SRR901198 1 0.0000 1.000 1.000 0 0.000
#> SRR901199 1 0.0000 1.000 1.000 0 0.000
#> SRR901200 1 0.0000 1.000 1.000 0 0.000
#> SRR901201 3 0.0000 0.994 0.000 0 1.000
#> SRR901202 2 0.0000 1.000 0.000 1 0.000
#> SRR901203 2 0.0000 1.000 0.000 1 0.000
#> SRR901204 2 0.0000 1.000 0.000 1 0.000
#> SRR901205 3 0.0747 0.989 0.016 0 0.984
#> SRR901206 1 0.0000 1.000 1.000 0 0.000
#> SRR901207 1 0.0000 1.000 1.000 0 0.000
#> SRR901208 1 0.0000 1.000 1.000 0 0.000
#> SRR901209 3 0.0000 0.994 0.000 0 1.000
#> SRR901211 2 0.0000 1.000 0.000 1 0.000
#> SRR901210 2 0.0000 1.000 0.000 1 0.000
#> SRR901212 2 0.0000 1.000 0.000 1 0.000
#> SRR901213 3 0.0000 0.994 0.000 0 1.000
#> SRR901214 2 0.0000 1.000 0.000 1 0.000
#> SRR901215 2 0.0000 1.000 0.000 1 0.000
#> SRR901216 2 0.0000 1.000 0.000 1 0.000
#> SRR901217 3 0.0000 0.994 0.000 0 1.000
#> SRR901218 2 0.0000 1.000 0.000 1 0.000
#> SRR901219 2 0.0000 1.000 0.000 1 0.000
#> SRR901220 2 0.0000 1.000 0.000 1 0.000
#> SRR901221 3 0.0000 0.994 0.000 0 1.000
#> SRR901222 2 0.0000 1.000 0.000 1 0.000
#> SRR901223 2 0.0000 1.000 0.000 1 0.000
#> SRR901224 2 0.0000 1.000 0.000 1 0.000
#> SRR901225 3 0.0000 0.994 0.000 0 1.000
#> SRR901226 2 0.0000 1.000 0.000 1 0.000
#> SRR901227 2 0.0000 1.000 0.000 1 0.000
#> SRR901229 3 0.0000 0.994 0.000 0 1.000
#> SRR901228 2 0.0000 1.000 0.000 1 0.000
#> SRR901230 2 0.0000 1.000 0.000 1 0.000
#> SRR901231 2 0.0000 1.000 0.000 1 0.000
#> SRR901232 2 0.0000 1.000 0.000 1 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.0000 0.925 0.000 0.000 0.000 1.000
#> SRR901150 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901154 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901155 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901156 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901157 4 0.0000 0.925 0.000 0.000 0.000 1.000
#> SRR901158 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901162 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901163 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901164 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901165 4 0.0188 0.922 0.000 0.000 0.004 0.996
#> SRR901166 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901167 1 0.2149 0.874 0.912 0.088 0.000 0.000
#> SRR901168 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901170 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901171 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901172 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901173 4 0.0000 0.925 0.000 0.000 0.000 1.000
#> SRR901174 1 0.2149 0.874 0.912 0.088 0.000 0.000
#> SRR901175 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901176 4 0.4843 0.344 0.000 0.396 0.000 0.604
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901178 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901179 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901180 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901181 4 0.0000 0.925 0.000 0.000 0.000 1.000
#> SRR901182 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901187 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901186 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901188 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901189 4 0.0000 0.925 0.000 0.000 0.000 1.000
#> SRR901190 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901194 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901195 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901196 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901197 4 0.0000 0.925 0.000 0.000 0.000 1.000
#> SRR901198 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901202 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901203 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901204 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901205 4 0.0000 0.925 0.000 0.000 0.000 1.000
#> SRR901206 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901211 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901210 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901212 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901214 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901215 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901216 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901218 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901219 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901220 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901222 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901223 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901224 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901226 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901227 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901228 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901230 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901231 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> SRR901232 2 0.0000 1.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.000 1.000 0.000 0.000 0 0.000 1.000
#> SRR901150 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901151 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901152 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR1382100 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901154 2 0.366 0.810 0.000 0.724 0 0.276 0.000
#> SRR901155 2 0.324 0.832 0.000 0.784 0 0.216 0.000
#> SRR901156 2 0.213 0.841 0.000 0.892 0 0.108 0.000
#> SRR901157 5 0.000 1.000 0.000 0.000 0 0.000 1.000
#> SRR901158 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901159 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901160 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901161 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901162 4 0.000 1.000 0.000 0.000 0 1.000 0.000
#> SRR901163 4 0.000 1.000 0.000 0.000 0 1.000 0.000
#> SRR901164 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901165 5 0.000 1.000 0.000 0.000 0 0.000 1.000
#> SRR901166 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901167 1 0.029 0.993 0.992 0.000 0 0.000 0.008
#> SRR901168 1 0.029 0.993 0.992 0.000 0 0.000 0.008
#> SRR901169 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901170 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901171 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901172 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901173 5 0.000 1.000 0.000 0.000 0 0.000 1.000
#> SRR901174 1 0.029 0.993 0.992 0.000 0 0.000 0.008
#> SRR901175 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901176 2 0.411 0.629 0.024 0.732 0 0.000 0.244
#> SRR901177 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901178 2 0.375 0.800 0.000 0.708 0 0.292 0.000
#> SRR901179 2 0.167 0.836 0.000 0.924 0 0.076 0.000
#> SRR901180 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901181 5 0.000 1.000 0.000 0.000 0 0.000 1.000
#> SRR901182 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901183 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901184 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901185 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901187 2 0.161 0.836 0.000 0.928 0 0.072 0.000
#> SRR901186 2 0.327 0.830 0.000 0.780 0 0.220 0.000
#> SRR901188 2 0.375 0.800 0.000 0.708 0 0.292 0.000
#> SRR901189 5 0.000 1.000 0.000 0.000 0 0.000 1.000
#> SRR901190 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901191 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901192 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901193 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901194 2 0.238 0.842 0.000 0.872 0 0.128 0.000
#> SRR901195 2 0.324 0.833 0.000 0.784 0 0.216 0.000
#> SRR901196 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901197 5 0.000 1.000 0.000 0.000 0 0.000 1.000
#> SRR901198 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901199 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901200 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901201 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901202 2 0.281 0.842 0.000 0.832 0 0.168 0.000
#> SRR901203 2 0.375 0.800 0.000 0.708 0 0.292 0.000
#> SRR901204 2 0.368 0.808 0.000 0.720 0 0.280 0.000
#> SRR901205 5 0.000 1.000 0.000 0.000 0 0.000 1.000
#> SRR901206 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901207 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901208 1 0.000 0.999 1.000 0.000 0 0.000 0.000
#> SRR901209 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901211 2 0.375 0.800 0.000 0.708 0 0.292 0.000
#> SRR901210 2 0.375 0.800 0.000 0.708 0 0.292 0.000
#> SRR901212 2 0.196 0.840 0.000 0.904 0 0.096 0.000
#> SRR901213 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901214 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901215 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901216 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901217 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901218 2 0.400 0.749 0.000 0.656 0 0.344 0.000
#> SRR901219 2 0.397 0.759 0.000 0.664 0 0.336 0.000
#> SRR901220 2 0.384 0.787 0.000 0.692 0 0.308 0.000
#> SRR901221 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901222 2 0.273 0.841 0.000 0.840 0 0.160 0.000
#> SRR901223 2 0.359 0.815 0.000 0.736 0 0.264 0.000
#> SRR901224 2 0.000 0.815 0.000 1.000 0 0.000 0.000
#> SRR901225 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901226 4 0.000 1.000 0.000 0.000 0 1.000 0.000
#> SRR901227 4 0.000 1.000 0.000 0.000 0 1.000 0.000
#> SRR901229 3 0.000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901228 4 0.000 1.000 0.000 0.000 0 1.000 0.000
#> SRR901230 4 0.000 1.000 0.000 0.000 0 1.000 0.000
#> SRR901231 2 0.426 0.601 0.000 0.564 0 0.436 0.000
#> SRR901232 4 0.000 1.000 0.000 0.000 0 1.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 0.997 0.000 0.000 0 0.000 1.000 0.000
#> SRR901150 1 0.0260 0.991 0.992 0.000 0 0.008 0.000 0.000
#> SRR901151 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901154 2 0.2538 0.871 0.000 0.860 0 0.016 0.000 0.124
#> SRR901155 2 0.2135 0.864 0.000 0.872 0 0.000 0.000 0.128
#> SRR901156 6 0.3592 0.542 0.000 0.344 0 0.000 0.000 0.656
#> SRR901157 5 0.0000 0.997 0.000 0.000 0 0.000 1.000 0.000
#> SRR901158 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901162 4 0.0713 0.939 0.000 0.028 0 0.972 0.000 0.000
#> SRR901163 4 0.0713 0.939 0.000 0.028 0 0.972 0.000 0.000
#> SRR901164 6 0.0713 0.894 0.000 0.028 0 0.000 0.000 0.972
#> SRR901165 5 0.0632 0.981 0.000 0.000 0 0.000 0.976 0.024
#> SRR901166 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901167 1 0.1074 0.965 0.960 0.000 0 0.028 0.000 0.012
#> SRR901168 1 0.0146 0.994 0.996 0.000 0 0.004 0.000 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901170 6 0.0790 0.895 0.000 0.032 0 0.000 0.000 0.968
#> SRR901171 6 0.0790 0.895 0.000 0.032 0 0.000 0.000 0.968
#> SRR901172 6 0.0790 0.895 0.000 0.032 0 0.000 0.000 0.968
#> SRR901173 5 0.0000 0.997 0.000 0.000 0 0.000 1.000 0.000
#> SRR901174 1 0.0909 0.970 0.968 0.000 0 0.020 0.000 0.012
#> SRR901175 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901176 6 0.2715 0.760 0.000 0.012 0 0.028 0.088 0.872
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901178 2 0.1245 0.858 0.000 0.952 0 0.016 0.000 0.032
#> SRR901179 6 0.2996 0.751 0.000 0.228 0 0.000 0.000 0.772
#> SRR901180 6 0.0790 0.895 0.000 0.032 0 0.000 0.000 0.968
#> SRR901181 5 0.0000 0.997 0.000 0.000 0 0.000 1.000 0.000
#> SRR901182 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901187 6 0.2933 0.778 0.000 0.200 0 0.004 0.000 0.796
#> SRR901186 6 0.4204 0.626 0.000 0.252 0 0.052 0.000 0.696
#> SRR901188 2 0.1686 0.838 0.000 0.924 0 0.064 0.000 0.012
#> SRR901189 5 0.0000 0.997 0.000 0.000 0 0.000 1.000 0.000
#> SRR901190 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901194 2 0.2527 0.831 0.000 0.832 0 0.000 0.000 0.168
#> SRR901195 2 0.2260 0.856 0.000 0.860 0 0.000 0.000 0.140
#> SRR901196 6 0.0790 0.895 0.000 0.032 0 0.000 0.000 0.968
#> SRR901197 5 0.0000 0.997 0.000 0.000 0 0.000 1.000 0.000
#> SRR901198 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901202 2 0.4072 0.145 0.000 0.544 0 0.008 0.000 0.448
#> SRR901203 2 0.2860 0.875 0.000 0.852 0 0.048 0.000 0.100
#> SRR901204 2 0.3041 0.868 0.000 0.832 0 0.040 0.000 0.128
#> SRR901205 5 0.0000 0.997 0.000 0.000 0 0.000 1.000 0.000
#> SRR901206 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.996 1.000 0.000 0 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901211 2 0.2119 0.855 0.000 0.904 0 0.060 0.000 0.036
#> SRR901210 2 0.2795 0.876 0.000 0.856 0 0.044 0.000 0.100
#> SRR901212 6 0.3488 0.759 0.000 0.184 0 0.036 0.000 0.780
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901214 6 0.0713 0.894 0.000 0.028 0 0.000 0.000 0.972
#> SRR901215 6 0.0713 0.894 0.000 0.028 0 0.000 0.000 0.972
#> SRR901216 6 0.0713 0.894 0.000 0.028 0 0.000 0.000 0.972
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901218 2 0.1556 0.823 0.000 0.920 0 0.080 0.000 0.000
#> SRR901219 2 0.1556 0.823 0.000 0.920 0 0.080 0.000 0.000
#> SRR901220 2 0.1913 0.832 0.000 0.908 0 0.080 0.000 0.012
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901222 2 0.2416 0.843 0.000 0.844 0 0.000 0.000 0.156
#> SRR901223 2 0.1700 0.870 0.000 0.916 0 0.004 0.000 0.080
#> SRR901224 6 0.0713 0.894 0.000 0.028 0 0.000 0.000 0.972
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901226 4 0.0865 0.938 0.000 0.036 0 0.964 0.000 0.000
#> SRR901227 4 0.0713 0.939 0.000 0.028 0 0.972 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901228 4 0.0713 0.939 0.000 0.028 0 0.972 0.000 0.000
#> SRR901230 4 0.1584 0.925 0.000 0.064 0 0.928 0.000 0.008
#> SRR901231 4 0.3852 0.583 0.000 0.324 0 0.664 0.000 0.012
#> SRR901232 4 0.1387 0.927 0.000 0.068 0 0.932 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "NMF"]
# you can also extract it by
# res = res_list["SD:NMF"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.651 0.823 0.923 0.4449 0.577 0.577
#> 3 3 1.000 0.978 0.991 0.4537 0.697 0.510
#> 4 4 0.961 0.956 0.968 0.0636 0.957 0.879
#> 5 5 0.886 0.723 0.911 0.0655 0.989 0.966
#> 6 6 0.885 0.933 0.926 0.0502 0.885 0.632
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 3
There is also optional best \(k\) = 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0000 0.951 0.000 1.000
#> SRR901150 1 0.0000 0.895 1.000 0.000
#> SRR901151 1 0.0000 0.895 1.000 0.000
#> SRR901152 1 0.0000 0.895 1.000 0.000
#> SRR1382100 2 0.0000 0.951 0.000 1.000
#> SRR901154 1 0.0000 0.895 1.000 0.000
#> SRR901155 1 0.0000 0.895 1.000 0.000
#> SRR901156 1 0.7219 0.753 0.800 0.200
#> SRR901157 2 0.0000 0.951 0.000 1.000
#> SRR901158 1 0.0000 0.895 1.000 0.000
#> SRR901159 1 0.0000 0.895 1.000 0.000
#> SRR901160 1 0.0000 0.895 1.000 0.000
#> SRR901161 2 0.0000 0.951 0.000 1.000
#> SRR901162 1 0.0000 0.895 1.000 0.000
#> SRR901163 1 0.0000 0.895 1.000 0.000
#> SRR901164 1 0.9686 0.458 0.604 0.396
#> SRR901165 2 0.0000 0.951 0.000 1.000
#> SRR901166 1 0.0000 0.895 1.000 0.000
#> SRR901167 1 0.0000 0.895 1.000 0.000
#> SRR901168 1 0.0000 0.895 1.000 0.000
#> SRR901169 2 0.0000 0.951 0.000 1.000
#> SRR901170 1 1.0000 0.160 0.500 0.500
#> SRR901171 1 1.0000 0.160 0.500 0.500
#> SRR901172 2 0.9686 0.208 0.396 0.604
#> SRR901173 2 0.0000 0.951 0.000 1.000
#> SRR901174 1 0.0000 0.895 1.000 0.000
#> SRR901175 1 0.0000 0.895 1.000 0.000
#> SRR901176 1 0.6801 0.773 0.820 0.180
#> SRR901177 2 0.0000 0.951 0.000 1.000
#> SRR901178 1 0.7950 0.707 0.760 0.240
#> SRR901179 1 0.9129 0.583 0.672 0.328
#> SRR901180 1 0.9710 0.449 0.600 0.400
#> SRR901181 2 0.0000 0.951 0.000 1.000
#> SRR901182 1 0.0000 0.895 1.000 0.000
#> SRR901183 1 0.0000 0.895 1.000 0.000
#> SRR901184 1 0.0000 0.895 1.000 0.000
#> SRR901185 2 0.0000 0.951 0.000 1.000
#> SRR901187 1 0.9710 0.449 0.600 0.400
#> SRR901186 1 0.9686 0.458 0.604 0.396
#> SRR901188 1 0.1184 0.888 0.984 0.016
#> SRR901189 2 0.0000 0.951 0.000 1.000
#> SRR901190 1 0.0000 0.895 1.000 0.000
#> SRR901191 1 0.0000 0.895 1.000 0.000
#> SRR901192 1 0.0000 0.895 1.000 0.000
#> SRR901193 2 0.0000 0.951 0.000 1.000
#> SRR901194 1 0.0672 0.892 0.992 0.008
#> SRR901195 1 0.0000 0.895 1.000 0.000
#> SRR901196 1 0.9710 0.449 0.600 0.400
#> SRR901197 2 0.0000 0.951 0.000 1.000
#> SRR901198 1 0.0000 0.895 1.000 0.000
#> SRR901199 1 0.0000 0.895 1.000 0.000
#> SRR901200 1 0.0000 0.895 1.000 0.000
#> SRR901201 2 0.0000 0.951 0.000 1.000
#> SRR901202 1 0.6801 0.773 0.820 0.180
#> SRR901203 1 0.2043 0.880 0.968 0.032
#> SRR901204 1 0.1843 0.882 0.972 0.028
#> SRR901205 2 0.0000 0.951 0.000 1.000
#> SRR901206 1 0.0000 0.895 1.000 0.000
#> SRR901207 1 0.0000 0.895 1.000 0.000
#> SRR901208 1 0.0000 0.895 1.000 0.000
#> SRR901209 2 0.0000 0.951 0.000 1.000
#> SRR901211 1 0.0000 0.895 1.000 0.000
#> SRR901210 1 0.0672 0.892 0.992 0.008
#> SRR901212 1 0.9754 0.431 0.592 0.408
#> SRR901213 2 0.0000 0.951 0.000 1.000
#> SRR901214 2 0.1843 0.925 0.028 0.972
#> SRR901215 2 0.9552 0.275 0.376 0.624
#> SRR901216 2 0.6531 0.745 0.168 0.832
#> SRR901217 2 0.0000 0.951 0.000 1.000
#> SRR901218 1 0.5178 0.826 0.884 0.116
#> SRR901219 1 0.0000 0.895 1.000 0.000
#> SRR901220 1 0.0000 0.895 1.000 0.000
#> SRR901221 2 0.0000 0.951 0.000 1.000
#> SRR901222 1 0.0000 0.895 1.000 0.000
#> SRR901223 1 0.0000 0.895 1.000 0.000
#> SRR901224 1 0.6801 0.773 0.820 0.180
#> SRR901225 2 0.0000 0.951 0.000 1.000
#> SRR901226 1 0.0000 0.895 1.000 0.000
#> SRR901227 1 0.0000 0.895 1.000 0.000
#> SRR901229 2 0.0000 0.951 0.000 1.000
#> SRR901228 1 0.0000 0.895 1.000 0.000
#> SRR901230 1 0.9393 0.535 0.644 0.356
#> SRR901231 1 0.5946 0.805 0.856 0.144
#> SRR901232 1 0.5178 0.826 0.884 0.116
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.0592 0.985 0.012 0.000 0.988
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000
#> SRR1382100 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901154 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901155 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901156 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901157 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901161 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901162 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901163 2 0.0237 0.978 0.004 0.996 0.000
#> SRR901164 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901165 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901169 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901170 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901171 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901172 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901173 3 0.2625 0.909 0.084 0.000 0.916
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901176 2 0.4235 0.784 0.176 0.824 0.000
#> SRR901177 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901178 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901179 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901180 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901181 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901185 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901187 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901186 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901188 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901189 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901193 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901194 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901195 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901196 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901197 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901201 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901202 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901203 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901204 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901205 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901209 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901211 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901210 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901212 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901213 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901214 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901215 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901216 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901217 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901218 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901219 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901220 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901221 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901222 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901223 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901224 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901225 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901226 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901227 2 0.6111 0.356 0.396 0.604 0.000
#> SRR901229 3 0.0000 0.995 0.000 0.000 1.000
#> SRR901228 2 0.3192 0.868 0.112 0.888 0.000
#> SRR901230 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901231 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901232 2 0.0000 0.982 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.2530 0.9679 0.000 0.000 0.112 0.888
#> SRR901150 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901154 2 0.0188 0.9611 0.004 0.996 0.000 0.000
#> SRR901155 2 0.0000 0.9619 0.000 1.000 0.000 0.000
#> SRR901156 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901157 4 0.2530 0.9679 0.000 0.000 0.112 0.888
#> SRR901158 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901162 2 0.1637 0.9383 0.000 0.940 0.000 0.060
#> SRR901163 2 0.2840 0.9045 0.044 0.900 0.000 0.056
#> SRR901164 2 0.0336 0.9608 0.000 0.992 0.000 0.008
#> SRR901165 4 0.3123 0.9274 0.000 0.000 0.156 0.844
#> SRR901166 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901167 1 0.1474 0.9459 0.948 0.000 0.000 0.052
#> SRR901168 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901169 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901170 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901171 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901172 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901173 4 0.2675 0.9590 0.008 0.000 0.100 0.892
#> SRR901174 1 0.2281 0.8983 0.904 0.000 0.000 0.096
#> SRR901175 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901176 4 0.3182 0.8208 0.028 0.096 0.000 0.876
#> SRR901177 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901178 2 0.1118 0.9494 0.000 0.964 0.000 0.036
#> SRR901179 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901180 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901181 4 0.2530 0.9679 0.000 0.000 0.112 0.888
#> SRR901182 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901187 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901186 2 0.0707 0.9556 0.000 0.980 0.000 0.020
#> SRR901188 2 0.0469 0.9590 0.000 0.988 0.000 0.012
#> SRR901189 4 0.2530 0.9679 0.000 0.000 0.112 0.888
#> SRR901190 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901194 2 0.0000 0.9619 0.000 1.000 0.000 0.000
#> SRR901195 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901196 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901197 4 0.2530 0.9679 0.000 0.000 0.112 0.888
#> SRR901198 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901202 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901203 2 0.0188 0.9612 0.000 0.996 0.000 0.004
#> SRR901204 2 0.0000 0.9619 0.000 1.000 0.000 0.000
#> SRR901205 4 0.2469 0.9661 0.000 0.000 0.108 0.892
#> SRR901206 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.9933 1.000 0.000 0.000 0.000
#> SRR901209 3 0.1022 0.9651 0.000 0.000 0.968 0.032
#> SRR901211 2 0.0188 0.9612 0.000 0.996 0.000 0.004
#> SRR901210 2 0.0000 0.9619 0.000 1.000 0.000 0.000
#> SRR901212 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901213 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901214 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901215 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901216 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901217 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901218 2 0.1557 0.9399 0.000 0.944 0.000 0.056
#> SRR901219 2 0.1557 0.9399 0.000 0.944 0.000 0.056
#> SRR901220 2 0.1474 0.9419 0.000 0.948 0.000 0.052
#> SRR901221 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901222 2 0.0188 0.9622 0.000 0.996 0.000 0.004
#> SRR901223 2 0.0188 0.9612 0.000 0.996 0.000 0.004
#> SRR901224 2 0.0336 0.9608 0.000 0.992 0.000 0.008
#> SRR901225 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901226 2 0.1557 0.9399 0.000 0.944 0.000 0.056
#> SRR901227 2 0.6276 0.0812 0.464 0.480 0.000 0.056
#> SRR901229 3 0.0000 0.9971 0.000 0.000 1.000 0.000
#> SRR901228 2 0.4696 0.7735 0.148 0.792 0.004 0.056
#> SRR901230 2 0.2926 0.9036 0.000 0.896 0.048 0.056
#> SRR901231 2 0.1557 0.9399 0.000 0.944 0.000 0.056
#> SRR901232 2 0.1557 0.9399 0.000 0.944 0.000 0.056
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0703 0.95972 0.000 0.000 0.024 0.000 0.976
#> SRR901150 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0162 0.97540 0.996 0.000 0.000 0.004 0.000
#> SRR901152 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0162 0.99718 0.000 0.000 0.996 0.004 0.000
#> SRR901154 2 0.0162 0.74167 0.000 0.996 0.000 0.004 0.000
#> SRR901155 2 0.0000 0.74121 0.000 1.000 0.000 0.000 0.000
#> SRR901156 2 0.0162 0.74106 0.000 0.996 0.000 0.000 0.004
#> SRR901157 5 0.0703 0.95972 0.000 0.000 0.024 0.000 0.976
#> SRR901158 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901162 2 0.4804 0.01611 0.024 0.624 0.000 0.348 0.004
#> SRR901163 2 0.6473 -0.74865 0.160 0.452 0.000 0.384 0.004
#> SRR901164 2 0.4473 0.23972 0.000 0.656 0.000 0.324 0.020
#> SRR901165 5 0.1195 0.95324 0.000 0.000 0.028 0.012 0.960
#> SRR901166 1 0.0162 0.97540 0.996 0.000 0.000 0.004 0.000
#> SRR901167 1 0.3106 0.82355 0.844 0.000 0.000 0.132 0.024
#> SRR901168 1 0.0671 0.96243 0.980 0.000 0.000 0.016 0.004
#> SRR901169 3 0.0162 0.99718 0.000 0.000 0.996 0.004 0.000
#> SRR901170 2 0.0162 0.74106 0.000 0.996 0.000 0.000 0.004
#> SRR901171 2 0.0451 0.73755 0.000 0.988 0.000 0.008 0.004
#> SRR901172 2 0.0324 0.74034 0.000 0.992 0.000 0.004 0.004
#> SRR901173 5 0.0609 0.95801 0.000 0.000 0.020 0.000 0.980
#> SRR901174 1 0.4588 0.66829 0.720 0.000 0.000 0.220 0.060
#> SRR901175 1 0.0162 0.97540 0.996 0.000 0.000 0.004 0.000
#> SRR901176 5 0.4905 0.65763 0.000 0.040 0.000 0.336 0.624
#> SRR901177 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901178 2 0.0794 0.72967 0.000 0.972 0.000 0.028 0.000
#> SRR901179 2 0.0000 0.74121 0.000 1.000 0.000 0.000 0.000
#> SRR901180 2 0.0671 0.73211 0.000 0.980 0.000 0.016 0.004
#> SRR901181 5 0.0865 0.95866 0.000 0.000 0.024 0.004 0.972
#> SRR901182 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901187 2 0.0290 0.74161 0.000 0.992 0.000 0.008 0.000
#> SRR901186 2 0.1704 0.68533 0.000 0.928 0.000 0.068 0.004
#> SRR901188 2 0.0566 0.73838 0.000 0.984 0.000 0.012 0.004
#> SRR901189 5 0.0703 0.95972 0.000 0.000 0.024 0.000 0.976
#> SRR901190 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901194 2 0.0162 0.74152 0.000 0.996 0.000 0.000 0.004
#> SRR901195 2 0.0162 0.74152 0.000 0.996 0.000 0.000 0.004
#> SRR901196 2 0.0451 0.73755 0.000 0.988 0.000 0.008 0.004
#> SRR901197 5 0.0771 0.95719 0.000 0.000 0.020 0.004 0.976
#> SRR901198 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901202 2 0.0162 0.74106 0.000 0.996 0.000 0.000 0.004
#> SRR901203 2 0.0451 0.73913 0.000 0.988 0.000 0.008 0.004
#> SRR901204 2 0.0162 0.74152 0.000 0.996 0.000 0.000 0.004
#> SRR901205 5 0.0703 0.95972 0.000 0.000 0.024 0.000 0.976
#> SRR901206 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.97789 1.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0162 0.99665 0.000 0.000 0.996 0.004 0.000
#> SRR901211 2 0.0324 0.74104 0.000 0.992 0.000 0.004 0.004
#> SRR901210 2 0.0162 0.74152 0.000 0.996 0.000 0.000 0.004
#> SRR901212 2 0.0162 0.74133 0.000 0.996 0.000 0.004 0.000
#> SRR901213 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901214 2 0.4728 0.24825 0.000 0.664 0.000 0.040 0.296
#> SRR901215 2 0.1357 0.71305 0.000 0.948 0.000 0.048 0.004
#> SRR901216 2 0.4316 0.49777 0.000 0.772 0.000 0.120 0.108
#> SRR901217 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901218 2 0.4150 0.01490 0.000 0.612 0.000 0.388 0.000
#> SRR901219 2 0.4150 0.01490 0.000 0.612 0.000 0.388 0.000
#> SRR901220 2 0.3752 0.30757 0.000 0.708 0.000 0.292 0.000
#> SRR901221 3 0.0162 0.99718 0.000 0.000 0.996 0.004 0.000
#> SRR901222 2 0.0290 0.74080 0.000 0.992 0.000 0.008 0.000
#> SRR901223 2 0.0880 0.73091 0.000 0.968 0.000 0.032 0.000
#> SRR901224 2 0.4575 0.22899 0.000 0.648 0.000 0.328 0.024
#> SRR901225 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901226 2 0.4161 -0.00264 0.000 0.608 0.000 0.392 0.000
#> SRR901227 4 0.6684 0.00000 0.236 0.372 0.000 0.392 0.000
#> SRR901229 3 0.0000 0.99889 0.000 0.000 1.000 0.000 0.000
#> SRR901228 2 0.6575 -0.82555 0.176 0.428 0.004 0.392 0.000
#> SRR901230 2 0.5766 -0.29933 0.000 0.516 0.092 0.392 0.000
#> SRR901231 2 0.4150 0.01490 0.000 0.612 0.000 0.388 0.000
#> SRR901232 2 0.4150 0.01490 0.000 0.612 0.000 0.388 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0146 0.991 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR901150 1 0.0146 0.993 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR901151 1 0.0146 0.993 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR901152 1 0.0146 0.993 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901154 2 0.0146 0.953 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901155 2 0.0405 0.951 0.000 0.988 0.000 0.008 0.000 0.004
#> SRR901156 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901157 5 0.0000 0.993 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901158 1 0.0146 0.992 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR901159 1 0.0405 0.991 0.988 0.000 0.000 0.004 0.000 0.008
#> SRR901160 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901162 4 0.3867 0.936 0.000 0.328 0.000 0.660 0.000 0.012
#> SRR901163 4 0.4204 0.927 0.036 0.272 0.000 0.688 0.000 0.004
#> SRR901164 6 0.2941 0.565 0.000 0.220 0.000 0.000 0.000 0.780
#> SRR901165 5 0.1074 0.957 0.000 0.000 0.028 0.000 0.960 0.012
#> SRR901166 1 0.0146 0.993 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR901167 6 0.4107 0.304 0.452 0.000 0.000 0.004 0.004 0.540
#> SRR901168 1 0.0405 0.986 0.988 0.000 0.000 0.004 0.000 0.008
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901170 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901171 2 0.0937 0.932 0.000 0.960 0.000 0.000 0.000 0.040
#> SRR901172 2 0.0146 0.952 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR901173 5 0.0146 0.991 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR901174 6 0.4366 0.334 0.440 0.000 0.000 0.004 0.016 0.540
#> SRR901175 1 0.0146 0.993 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR901176 6 0.2034 0.532 0.004 0.060 0.000 0.000 0.024 0.912
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901178 2 0.1663 0.871 0.000 0.912 0.000 0.088 0.000 0.000
#> SRR901179 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901180 2 0.1267 0.913 0.000 0.940 0.000 0.000 0.000 0.060
#> SRR901181 5 0.0000 0.993 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901182 1 0.0363 0.989 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR901183 1 0.0363 0.989 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR901184 1 0.0260 0.991 0.992 0.000 0.000 0.000 0.000 0.008
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901187 2 0.0291 0.953 0.000 0.992 0.000 0.000 0.004 0.004
#> SRR901186 2 0.1333 0.918 0.000 0.944 0.000 0.008 0.000 0.048
#> SRR901188 2 0.1049 0.931 0.000 0.960 0.000 0.032 0.000 0.008
#> SRR901189 5 0.0000 0.993 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901190 1 0.0146 0.993 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR901191 1 0.0146 0.993 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR901192 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901194 2 0.0260 0.952 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR901195 2 0.0146 0.953 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR901196 2 0.1007 0.925 0.000 0.956 0.000 0.000 0.000 0.044
#> SRR901197 5 0.0000 0.993 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901198 1 0.0363 0.989 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR901199 1 0.0363 0.989 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR901200 1 0.0363 0.989 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901202 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901203 2 0.0363 0.951 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR901204 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901205 5 0.0000 0.993 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901206 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0146 0.997 0.000 0.000 0.996 0.004 0.000 0.000
#> SRR901211 2 0.0508 0.949 0.000 0.984 0.000 0.004 0.000 0.012
#> SRR901210 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901212 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901214 2 0.3438 0.772 0.000 0.820 0.000 0.120 0.012 0.048
#> SRR901215 2 0.1984 0.895 0.000 0.912 0.000 0.056 0.000 0.032
#> SRR901216 2 0.2979 0.797 0.000 0.840 0.000 0.116 0.000 0.044
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901218 4 0.3464 0.953 0.000 0.312 0.000 0.688 0.000 0.000
#> SRR901219 4 0.3464 0.953 0.000 0.312 0.000 0.688 0.000 0.000
#> SRR901220 4 0.3782 0.894 0.000 0.360 0.000 0.636 0.000 0.004
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901222 2 0.0717 0.948 0.000 0.976 0.000 0.008 0.000 0.016
#> SRR901223 2 0.2003 0.907 0.000 0.912 0.000 0.044 0.000 0.044
#> SRR901224 6 0.2793 0.577 0.000 0.200 0.000 0.000 0.000 0.800
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901226 4 0.3428 0.953 0.000 0.304 0.000 0.696 0.000 0.000
#> SRR901227 4 0.4271 0.885 0.060 0.244 0.000 0.696 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901228 4 0.4168 0.907 0.048 0.256 0.000 0.696 0.000 0.000
#> SRR901230 4 0.3710 0.947 0.000 0.292 0.012 0.696 0.000 0.000
#> SRR901231 4 0.3464 0.953 0.000 0.312 0.000 0.688 0.000 0.000
#> SRR901232 4 0.3446 0.954 0.000 0.308 0.000 0.692 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "hclust"]
# you can also extract it by
# res = res_list["CV:hclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 1.000 1.000 0.3801 0.620 0.620
#> 3 3 1.000 0.994 0.993 0.0883 0.970 0.952
#> 4 4 0.623 0.677 0.839 0.3966 0.965 0.941
#> 5 5 0.805 0.895 0.950 0.2512 0.708 0.477
#> 6 6 0.866 0.734 0.861 0.0582 0.977 0.916
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0 1 0 1
#> SRR901150 1 0 1 1 0
#> SRR901151 1 0 1 1 0
#> SRR901152 1 0 1 1 0
#> SRR1382100 2 0 1 0 1
#> SRR901154 1 0 1 1 0
#> SRR901155 1 0 1 1 0
#> SRR901156 1 0 1 1 0
#> SRR901157 2 0 1 0 1
#> SRR901158 1 0 1 1 0
#> SRR901159 1 0 1 1 0
#> SRR901160 1 0 1 1 0
#> SRR901161 2 0 1 0 1
#> SRR901162 1 0 1 1 0
#> SRR901163 1 0 1 1 0
#> SRR901164 1 0 1 1 0
#> SRR901165 2 0 1 0 1
#> SRR901166 1 0 1 1 0
#> SRR901167 1 0 1 1 0
#> SRR901168 1 0 1 1 0
#> SRR901169 2 0 1 0 1
#> SRR901170 1 0 1 1 0
#> SRR901171 1 0 1 1 0
#> SRR901172 1 0 1 1 0
#> SRR901173 2 0 1 0 1
#> SRR901174 1 0 1 1 0
#> SRR901175 1 0 1 1 0
#> SRR901176 1 0 1 1 0
#> SRR901177 2 0 1 0 1
#> SRR901178 1 0 1 1 0
#> SRR901179 1 0 1 1 0
#> SRR901180 1 0 1 1 0
#> SRR901181 2 0 1 0 1
#> SRR901182 1 0 1 1 0
#> SRR901183 1 0 1 1 0
#> SRR901184 1 0 1 1 0
#> SRR901185 2 0 1 0 1
#> SRR901187 1 0 1 1 0
#> SRR901186 1 0 1 1 0
#> SRR901188 1 0 1 1 0
#> SRR901189 2 0 1 0 1
#> SRR901190 1 0 1 1 0
#> SRR901191 1 0 1 1 0
#> SRR901192 1 0 1 1 0
#> SRR901193 2 0 1 0 1
#> SRR901194 1 0 1 1 0
#> SRR901195 1 0 1 1 0
#> SRR901196 1 0 1 1 0
#> SRR901197 2 0 1 0 1
#> SRR901198 1 0 1 1 0
#> SRR901199 1 0 1 1 0
#> SRR901200 1 0 1 1 0
#> SRR901201 2 0 1 0 1
#> SRR901202 1 0 1 1 0
#> SRR901203 1 0 1 1 0
#> SRR901204 1 0 1 1 0
#> SRR901205 2 0 1 0 1
#> SRR901206 1 0 1 1 0
#> SRR901207 1 0 1 1 0
#> SRR901208 1 0 1 1 0
#> SRR901209 2 0 1 0 1
#> SRR901211 1 0 1 1 0
#> SRR901210 1 0 1 1 0
#> SRR901212 1 0 1 1 0
#> SRR901213 2 0 1 0 1
#> SRR901214 1 0 1 1 0
#> SRR901215 1 0 1 1 0
#> SRR901216 1 0 1 1 0
#> SRR901217 2 0 1 0 1
#> SRR901218 1 0 1 1 0
#> SRR901219 1 0 1 1 0
#> SRR901220 1 0 1 1 0
#> SRR901221 2 0 1 0 1
#> SRR901222 1 0 1 1 0
#> SRR901223 1 0 1 1 0
#> SRR901224 1 0 1 1 0
#> SRR901225 2 0 1 0 1
#> SRR901226 1 0 1 1 0
#> SRR901227 1 0 1 1 0
#> SRR901229 2 0 1 0 1
#> SRR901228 1 0 1 1 0
#> SRR901230 1 0 1 1 0
#> SRR901231 1 0 1 1 0
#> SRR901232 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 1 0.0747 1.000 0.984 0.000 0.016
#> SRR901150 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901151 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901152 2 0.0000 0.993 0.000 1.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901154 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901155 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901156 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901157 1 0.0747 1.000 0.984 0.000 0.016
#> SRR901158 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901159 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901160 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901162 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901163 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901164 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901165 1 0.0747 1.000 0.984 0.000 0.016
#> SRR901166 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901167 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901168 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901170 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901171 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901172 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901173 1 0.0747 1.000 0.984 0.000 0.016
#> SRR901174 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901175 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901176 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901178 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901179 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901180 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901181 1 0.0747 1.000 0.984 0.000 0.016
#> SRR901182 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901183 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901184 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901187 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901186 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901188 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901189 1 0.0747 1.000 0.984 0.000 0.016
#> SRR901190 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901191 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901192 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901194 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901195 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901196 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901197 1 0.0747 1.000 0.984 0.000 0.016
#> SRR901198 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901199 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901200 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901202 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901203 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901204 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901205 1 0.0747 1.000 0.984 0.000 0.016
#> SRR901206 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901207 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901208 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901211 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901210 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901212 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901214 2 0.0592 0.992 0.012 0.988 0.000
#> SRR901215 2 0.0592 0.992 0.012 0.988 0.000
#> SRR901216 2 0.0592 0.992 0.012 0.988 0.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901218 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901219 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901220 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901222 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901223 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901224 2 0.0747 0.992 0.016 0.984 0.000
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901226 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901227 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901228 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901230 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901231 2 0.0000 0.993 0.000 1.000 0.000
#> SRR901232 2 0.0000 0.993 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.000 1.000 0.000 0.000 0 1
#> SRR901150 2 0.497 0.602 0.456 0.544 0 0
#> SRR901151 2 0.497 0.602 0.456 0.544 0 0
#> SRR901152 2 0.497 0.602 0.456 0.544 0 0
#> SRR1382100 3 0.000 1.000 0.000 0.000 1 0
#> SRR901154 2 0.000 0.636 0.000 1.000 0 0
#> SRR901155 2 0.000 0.636 0.000 1.000 0 0
#> SRR901156 2 0.000 0.636 0.000 1.000 0 0
#> SRR901157 4 0.000 1.000 0.000 0.000 0 1
#> SRR901158 2 0.497 0.602 0.456 0.544 0 0
#> SRR901159 2 0.497 0.602 0.456 0.544 0 0
#> SRR901160 2 0.497 0.602 0.456 0.544 0 0
#> SRR901161 3 0.000 1.000 0.000 0.000 1 0
#> SRR901162 2 0.312 0.669 0.156 0.844 0 0
#> SRR901163 2 0.312 0.669 0.156 0.844 0 0
#> SRR901164 1 0.452 0.992 0.680 0.320 0 0
#> SRR901165 4 0.000 1.000 0.000 0.000 0 1
#> SRR901166 2 0.492 0.613 0.428 0.572 0 0
#> SRR901167 2 0.492 0.613 0.428 0.572 0 0
#> SRR901168 2 0.492 0.613 0.428 0.572 0 0
#> SRR901169 3 0.000 1.000 0.000 0.000 1 0
#> SRR901170 2 0.000 0.636 0.000 1.000 0 0
#> SRR901171 2 0.000 0.636 0.000 1.000 0 0
#> SRR901172 2 0.000 0.636 0.000 1.000 0 0
#> SRR901173 4 0.000 1.000 0.000 0.000 0 1
#> SRR901174 2 0.492 0.613 0.428 0.572 0 0
#> SRR901175 2 0.492 0.613 0.428 0.572 0 0
#> SRR901176 1 0.450 0.992 0.684 0.316 0 0
#> SRR901177 3 0.000 1.000 0.000 0.000 1 0
#> SRR901178 2 0.000 0.636 0.000 1.000 0 0
#> SRR901179 2 0.000 0.636 0.000 1.000 0 0
#> SRR901180 2 0.000 0.636 0.000 1.000 0 0
#> SRR901181 4 0.000 1.000 0.000 0.000 0 1
#> SRR901182 2 0.497 0.602 0.456 0.544 0 0
#> SRR901183 2 0.497 0.602 0.456 0.544 0 0
#> SRR901184 2 0.497 0.602 0.456 0.544 0 0
#> SRR901185 3 0.000 1.000 0.000 0.000 1 0
#> SRR901187 2 0.000 0.636 0.000 1.000 0 0
#> SRR901186 2 0.000 0.636 0.000 1.000 0 0
#> SRR901188 2 0.000 0.636 0.000 1.000 0 0
#> SRR901189 4 0.000 1.000 0.000 0.000 0 1
#> SRR901190 2 0.492 0.613 0.428 0.572 0 0
#> SRR901191 2 0.497 0.602 0.456 0.544 0 0
#> SRR901192 2 0.497 0.602 0.456 0.544 0 0
#> SRR901193 3 0.000 1.000 0.000 0.000 1 0
#> SRR901194 2 0.000 0.636 0.000 1.000 0 0
#> SRR901195 2 0.000 0.636 0.000 1.000 0 0
#> SRR901196 2 0.000 0.636 0.000 1.000 0 0
#> SRR901197 4 0.000 1.000 0.000 0.000 0 1
#> SRR901198 2 0.497 0.602 0.456 0.544 0 0
#> SRR901199 2 0.497 0.602 0.456 0.544 0 0
#> SRR901200 2 0.497 0.602 0.456 0.544 0 0
#> SRR901201 3 0.000 1.000 0.000 0.000 1 0
#> SRR901202 2 0.000 0.636 0.000 1.000 0 0
#> SRR901203 2 0.000 0.636 0.000 1.000 0 0
#> SRR901204 2 0.000 0.636 0.000 1.000 0 0
#> SRR901205 4 0.000 1.000 0.000 0.000 0 1
#> SRR901206 2 0.497 0.602 0.456 0.544 0 0
#> SRR901207 2 0.497 0.602 0.456 0.544 0 0
#> SRR901208 2 0.497 0.602 0.456 0.544 0 0
#> SRR901209 3 0.000 1.000 0.000 0.000 1 0
#> SRR901211 2 0.000 0.636 0.000 1.000 0 0
#> SRR901210 2 0.000 0.636 0.000 1.000 0 0
#> SRR901212 2 0.000 0.636 0.000 1.000 0 0
#> SRR901213 3 0.000 1.000 0.000 0.000 1 0
#> SRR901214 2 0.487 -0.220 0.404 0.596 0 0
#> SRR901215 2 0.487 -0.220 0.404 0.596 0 0
#> SRR901216 2 0.487 -0.220 0.404 0.596 0 0
#> SRR901217 3 0.000 1.000 0.000 0.000 1 0
#> SRR901218 2 0.270 0.668 0.124 0.876 0 0
#> SRR901219 2 0.270 0.668 0.124 0.876 0 0
#> SRR901220 2 0.270 0.668 0.124 0.876 0 0
#> SRR901221 3 0.000 1.000 0.000 0.000 1 0
#> SRR901222 2 0.384 0.154 0.224 0.776 0 0
#> SRR901223 2 0.384 0.154 0.224 0.776 0 0
#> SRR901224 2 0.497 -0.407 0.456 0.544 0 0
#> SRR901225 3 0.000 1.000 0.000 0.000 1 0
#> SRR901226 2 0.312 0.669 0.156 0.844 0 0
#> SRR901227 2 0.312 0.669 0.156 0.844 0 0
#> SRR901229 3 0.000 1.000 0.000 0.000 1 0
#> SRR901228 2 0.312 0.669 0.156 0.844 0 0
#> SRR901230 2 0.312 0.669 0.156 0.844 0 0
#> SRR901231 2 0.270 0.668 0.124 0.876 0 0
#> SRR901232 2 0.270 0.668 0.124 0.876 0 0
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901150 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901151 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901152 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901154 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901155 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901156 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901157 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901158 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901159 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901160 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901162 2 0.2690 0.780 0.156 0.844 0 0.000 0
#> SRR901163 2 0.2690 0.780 0.156 0.844 0 0.000 0
#> SRR901164 4 0.0000 0.404 0.000 0.000 0 1.000 0
#> SRR901165 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901166 1 0.1410 0.952 0.940 0.000 0 0.060 0
#> SRR901167 1 0.1410 0.952 0.940 0.000 0 0.060 0
#> SRR901168 1 0.1410 0.952 0.940 0.000 0 0.060 0
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901170 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901171 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901172 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901173 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901174 1 0.1410 0.952 0.940 0.000 0 0.060 0
#> SRR901175 1 0.1410 0.952 0.940 0.000 0 0.060 0
#> SRR901176 4 0.0162 0.402 0.004 0.000 0 0.996 0
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901178 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901179 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901180 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901181 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901182 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901183 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901184 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901187 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901186 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901188 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901189 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901190 1 0.1410 0.952 0.940 0.000 0 0.060 0
#> SRR901191 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901192 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901194 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901195 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901196 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901197 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901198 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901199 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901200 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901202 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901203 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901204 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901205 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901206 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901207 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901208 1 0.0000 0.984 1.000 0.000 0 0.000 0
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901211 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901210 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901212 2 0.0000 0.892 0.000 1.000 0 0.000 0
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901214 4 0.4546 0.625 0.008 0.460 0 0.532 0
#> SRR901215 4 0.4546 0.625 0.008 0.460 0 0.532 0
#> SRR901216 4 0.4546 0.625 0.008 0.460 0 0.532 0
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901218 2 0.2329 0.814 0.124 0.876 0 0.000 0
#> SRR901219 2 0.2329 0.814 0.124 0.876 0 0.000 0
#> SRR901220 2 0.2329 0.814 0.124 0.876 0 0.000 0
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901222 2 0.3534 0.434 0.000 0.744 0 0.256 0
#> SRR901223 2 0.3534 0.434 0.000 0.744 0 0.256 0
#> SRR901224 4 0.4030 0.676 0.000 0.352 0 0.648 0
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901226 2 0.2690 0.780 0.156 0.844 0 0.000 0
#> SRR901227 2 0.2690 0.780 0.156 0.844 0 0.000 0
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901228 2 0.2690 0.780 0.156 0.844 0 0.000 0
#> SRR901230 2 0.2690 0.780 0.156 0.844 0 0.000 0
#> SRR901231 2 0.2329 0.814 0.124 0.876 0 0.000 0
#> SRR901232 2 0.2329 0.814 0.124 0.876 0 0.000 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 0.999 0.000 0.000 0.00 0.000 1.000 0.000
#> SRR901150 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901154 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901155 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901156 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901157 5 0.0000 0.999 0.000 0.000 0.00 0.000 1.000 0.000
#> SRR901158 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901162 2 0.0865 0.435 0.000 0.964 0.00 0.000 0.000 0.036
#> SRR901163 2 0.0865 0.435 0.000 0.964 0.00 0.000 0.000 0.036
#> SRR901164 4 0.0000 0.672 0.000 0.000 0.00 1.000 0.000 0.000
#> SRR901165 5 0.0146 0.997 0.000 0.000 0.00 0.000 0.996 0.004
#> SRR901166 1 0.4147 0.738 0.716 0.000 0.00 0.060 0.000 0.224
#> SRR901167 1 0.4147 0.738 0.716 0.000 0.00 0.060 0.000 0.224
#> SRR901168 1 0.4147 0.738 0.716 0.000 0.00 0.060 0.000 0.224
#> SRR901169 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901170 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901171 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901172 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901173 5 0.0000 0.999 0.000 0.000 0.00 0.000 1.000 0.000
#> SRR901174 1 0.4147 0.738 0.716 0.000 0.00 0.060 0.000 0.224
#> SRR901175 1 0.4147 0.738 0.716 0.000 0.00 0.060 0.000 0.224
#> SRR901176 4 0.0146 0.671 0.000 0.000 0.00 0.996 0.000 0.004
#> SRR901177 3 0.2793 0.837 0.000 0.000 0.80 0.000 0.000 0.200
#> SRR901178 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901179 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901180 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901181 5 0.0000 0.999 0.000 0.000 0.00 0.000 1.000 0.000
#> SRR901182 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901187 2 0.3737 0.628 0.000 0.608 0.00 0.000 0.000 0.392
#> SRR901186 2 0.3737 0.628 0.000 0.608 0.00 0.000 0.000 0.392
#> SRR901188 2 0.3737 0.628 0.000 0.608 0.00 0.000 0.000 0.392
#> SRR901189 5 0.0000 0.999 0.000 0.000 0.00 0.000 1.000 0.000
#> SRR901190 1 0.1411 0.893 0.936 0.000 0.00 0.060 0.000 0.004
#> SRR901191 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901194 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901195 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901196 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901197 5 0.0000 0.999 0.000 0.000 0.00 0.000 1.000 0.000
#> SRR901198 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901202 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901203 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901204 2 0.3782 0.628 0.000 0.588 0.00 0.000 0.000 0.412
#> SRR901205 5 0.0146 0.997 0.000 0.000 0.00 0.000 0.996 0.004
#> SRR901206 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.934 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901209 3 0.2793 0.837 0.000 0.000 0.80 0.000 0.000 0.200
#> SRR901211 2 0.3737 0.628 0.000 0.608 0.00 0.000 0.000 0.392
#> SRR901210 2 0.3737 0.628 0.000 0.608 0.00 0.000 0.000 0.392
#> SRR901212 2 0.3737 0.628 0.000 0.608 0.00 0.000 0.000 0.392
#> SRR901213 3 0.2454 0.866 0.000 0.000 0.84 0.000 0.000 0.160
#> SRR901214 6 0.5472 0.518 0.000 0.124 0.00 0.412 0.000 0.464
#> SRR901215 6 0.5472 0.518 0.000 0.124 0.00 0.412 0.000 0.464
#> SRR901216 6 0.5472 0.518 0.000 0.124 0.00 0.412 0.000 0.464
#> SRR901217 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901218 2 0.0000 0.459 0.000 1.000 0.00 0.000 0.000 0.000
#> SRR901219 2 0.0000 0.459 0.000 1.000 0.00 0.000 0.000 0.000
#> SRR901220 2 0.0000 0.459 0.000 1.000 0.00 0.000 0.000 0.000
#> SRR901221 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901222 6 0.5529 0.208 0.000 0.412 0.00 0.132 0.000 0.456
#> SRR901223 6 0.5529 0.208 0.000 0.412 0.00 0.132 0.000 0.456
#> SRR901224 4 0.4325 -0.346 0.000 0.020 0.00 0.524 0.000 0.456
#> SRR901225 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901226 2 0.0865 0.435 0.000 0.964 0.00 0.000 0.000 0.036
#> SRR901227 2 0.0865 0.435 0.000 0.964 0.00 0.000 0.000 0.036
#> SRR901229 3 0.0000 0.959 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901228 2 0.0865 0.435 0.000 0.964 0.00 0.000 0.000 0.036
#> SRR901230 2 0.0865 0.435 0.000 0.964 0.00 0.000 0.000 0.036
#> SRR901231 2 0.0000 0.459 0.000 1.000 0.00 0.000 0.000 0.000
#> SRR901232 2 0.0000 0.459 0.000 1.000 0.00 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "kmeans"]
# you can also extract it by
# res = res_list["CV:kmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.501 0.865 0.892 0.3990 0.620 0.620
#> 3 3 0.668 0.962 0.915 0.5025 0.731 0.567
#> 4 4 0.824 0.822 0.859 0.1493 0.977 0.935
#> 5 5 0.769 0.740 0.811 0.0889 0.892 0.684
#> 6 6 0.727 0.767 0.810 0.0548 0.921 0.702
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.327 0.851 0.060 0.940
#> SRR901150 1 0.795 0.811 0.760 0.240
#> SRR901151 1 0.795 0.811 0.760 0.240
#> SRR901152 1 0.795 0.811 0.760 0.240
#> SRR1382100 2 0.795 0.907 0.240 0.760
#> SRR901154 1 0.000 0.886 1.000 0.000
#> SRR901155 1 0.000 0.886 1.000 0.000
#> SRR901156 1 0.000 0.886 1.000 0.000
#> SRR901157 2 0.327 0.851 0.060 0.940
#> SRR901158 1 0.795 0.811 0.760 0.240
#> SRR901159 1 0.795 0.811 0.760 0.240
#> SRR901160 1 0.795 0.811 0.760 0.240
#> SRR901161 2 0.795 0.907 0.240 0.760
#> SRR901162 1 0.000 0.886 1.000 0.000
#> SRR901163 1 0.000 0.886 1.000 0.000
#> SRR901164 1 0.000 0.886 1.000 0.000
#> SRR901165 2 0.343 0.853 0.064 0.936
#> SRR901166 1 0.795 0.811 0.760 0.240
#> SRR901167 1 0.795 0.811 0.760 0.240
#> SRR901168 1 0.795 0.811 0.760 0.240
#> SRR901169 2 0.795 0.907 0.240 0.760
#> SRR901170 1 0.000 0.886 1.000 0.000
#> SRR901171 1 0.000 0.886 1.000 0.000
#> SRR901172 1 0.000 0.886 1.000 0.000
#> SRR901173 2 0.327 0.851 0.060 0.940
#> SRR901174 1 0.795 0.811 0.760 0.240
#> SRR901175 1 0.795 0.811 0.760 0.240
#> SRR901176 1 0.680 0.822 0.820 0.180
#> SRR901177 2 0.795 0.907 0.240 0.760
#> SRR901178 1 0.000 0.886 1.000 0.000
#> SRR901179 1 0.000 0.886 1.000 0.000
#> SRR901180 1 0.000 0.886 1.000 0.000
#> SRR901181 2 0.343 0.853 0.064 0.936
#> SRR901182 1 0.795 0.811 0.760 0.240
#> SRR901183 1 0.795 0.811 0.760 0.240
#> SRR901184 1 0.795 0.811 0.760 0.240
#> SRR901185 2 0.795 0.907 0.240 0.760
#> SRR901187 1 0.000 0.886 1.000 0.000
#> SRR901186 1 0.000 0.886 1.000 0.000
#> SRR901188 1 0.000 0.886 1.000 0.000
#> SRR901189 2 0.327 0.851 0.060 0.940
#> SRR901190 1 0.795 0.811 0.760 0.240
#> SRR901191 1 0.795 0.811 0.760 0.240
#> SRR901192 1 0.795 0.811 0.760 0.240
#> SRR901193 2 0.795 0.907 0.240 0.760
#> SRR901194 1 0.000 0.886 1.000 0.000
#> SRR901195 1 0.000 0.886 1.000 0.000
#> SRR901196 1 0.000 0.886 1.000 0.000
#> SRR901197 2 0.327 0.851 0.060 0.940
#> SRR901198 1 0.795 0.811 0.760 0.240
#> SRR901199 1 0.795 0.811 0.760 0.240
#> SRR901200 1 0.795 0.811 0.760 0.240
#> SRR901201 2 0.795 0.907 0.240 0.760
#> SRR901202 1 0.000 0.886 1.000 0.000
#> SRR901203 1 0.000 0.886 1.000 0.000
#> SRR901204 1 0.000 0.886 1.000 0.000
#> SRR901205 2 0.343 0.853 0.064 0.936
#> SRR901206 1 0.795 0.811 0.760 0.240
#> SRR901207 1 0.795 0.811 0.760 0.240
#> SRR901208 1 0.795 0.811 0.760 0.240
#> SRR901209 2 0.795 0.907 0.240 0.760
#> SRR901211 1 0.000 0.886 1.000 0.000
#> SRR901210 1 0.000 0.886 1.000 0.000
#> SRR901212 1 0.000 0.886 1.000 0.000
#> SRR901213 2 0.795 0.907 0.240 0.760
#> SRR901214 1 0.000 0.886 1.000 0.000
#> SRR901215 1 0.000 0.886 1.000 0.000
#> SRR901216 1 0.000 0.886 1.000 0.000
#> SRR901217 2 0.795 0.907 0.240 0.760
#> SRR901218 1 0.000 0.886 1.000 0.000
#> SRR901219 1 0.000 0.886 1.000 0.000
#> SRR901220 1 0.000 0.886 1.000 0.000
#> SRR901221 2 0.795 0.907 0.240 0.760
#> SRR901222 1 0.000 0.886 1.000 0.000
#> SRR901223 1 0.000 0.886 1.000 0.000
#> SRR901224 1 0.000 0.886 1.000 0.000
#> SRR901225 2 0.795 0.907 0.240 0.760
#> SRR901226 1 0.000 0.886 1.000 0.000
#> SRR901227 1 0.000 0.886 1.000 0.000
#> SRR901229 2 0.795 0.907 0.240 0.760
#> SRR901228 1 0.000 0.886 1.000 0.000
#> SRR901230 1 0.000 0.886 1.000 0.000
#> SRR901231 1 0.000 0.886 1.000 0.000
#> SRR901232 1 0.000 0.886 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.7524 0.816 0.116 0.196 0.688
#> SRR901150 1 0.0237 0.983 0.996 0.000 0.004
#> SRR901151 1 0.0237 0.983 0.996 0.000 0.004
#> SRR901152 1 0.0237 0.983 0.996 0.000 0.004
#> SRR1382100 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901154 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901155 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901156 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901157 3 0.7524 0.816 0.116 0.196 0.688
#> SRR901158 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901159 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901160 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901161 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901162 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901163 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901164 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901165 3 0.4504 0.877 0.000 0.196 0.804
#> SRR901166 1 0.0237 0.983 0.996 0.000 0.004
#> SRR901167 1 0.0237 0.983 0.996 0.000 0.004
#> SRR901168 1 0.0237 0.983 0.996 0.000 0.004
#> SRR901169 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901170 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901171 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901172 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901173 3 0.7524 0.816 0.116 0.196 0.688
#> SRR901174 1 0.0237 0.983 0.996 0.000 0.004
#> SRR901175 1 0.0237 0.983 0.996 0.000 0.004
#> SRR901176 1 0.5517 0.503 0.728 0.268 0.004
#> SRR901177 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901178 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901179 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901180 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901181 3 0.5219 0.872 0.016 0.196 0.788
#> SRR901182 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901183 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901184 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901185 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901187 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901186 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901188 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901189 3 0.7524 0.816 0.116 0.196 0.688
#> SRR901190 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901191 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901192 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901193 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901194 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901195 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901196 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901197 3 0.7524 0.816 0.116 0.196 0.688
#> SRR901198 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901199 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901200 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901201 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901202 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901203 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901204 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901205 3 0.4504 0.877 0.000 0.196 0.804
#> SRR901206 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901207 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901208 1 0.0000 0.984 1.000 0.000 0.000
#> SRR901209 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901211 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901210 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901212 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901213 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901214 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901215 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901216 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901217 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901218 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901219 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901220 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901221 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901222 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901223 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901224 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901225 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901226 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901227 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901229 3 0.0237 0.923 0.000 0.004 0.996
#> SRR901228 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901230 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901231 2 0.4452 1.000 0.192 0.808 0.000
#> SRR901232 2 0.4452 1.000 0.192 0.808 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.6750 0.996 0.092 0.000 0.436 0.472
#> SRR901150 1 0.2399 0.944 0.920 0.048 0.000 0.032
#> SRR901151 1 0.2300 0.946 0.924 0.048 0.000 0.028
#> SRR901152 1 0.2300 0.946 0.924 0.048 0.000 0.028
#> SRR1382100 3 0.0592 0.815 0.016 0.000 0.984 0.000
#> SRR901154 2 0.0188 0.886 0.000 0.996 0.000 0.004
#> SRR901155 2 0.0000 0.887 0.000 1.000 0.000 0.000
#> SRR901156 2 0.0921 0.884 0.000 0.972 0.000 0.028
#> SRR901157 4 0.6797 0.997 0.096 0.000 0.436 0.468
#> SRR901158 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901159 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901160 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901161 3 0.0188 0.817 0.004 0.000 0.996 0.000
#> SRR901162 2 0.3942 0.839 0.000 0.764 0.000 0.236
#> SRR901163 2 0.3942 0.839 0.000 0.764 0.000 0.236
#> SRR901164 2 0.3266 0.819 0.000 0.832 0.000 0.168
#> SRR901165 3 0.5493 -0.660 0.016 0.000 0.528 0.456
#> SRR901166 1 0.3439 0.916 0.868 0.048 0.000 0.084
#> SRR901167 1 0.3634 0.909 0.856 0.048 0.000 0.096
#> SRR901168 1 0.3570 0.911 0.860 0.048 0.000 0.092
#> SRR901169 3 0.0592 0.815 0.016 0.000 0.984 0.000
#> SRR901170 2 0.1557 0.880 0.000 0.944 0.000 0.056
#> SRR901171 2 0.1557 0.880 0.000 0.944 0.000 0.056
#> SRR901172 2 0.1557 0.880 0.000 0.944 0.000 0.056
#> SRR901173 4 0.6750 0.996 0.092 0.000 0.436 0.472
#> SRR901174 1 0.3634 0.909 0.856 0.048 0.000 0.096
#> SRR901175 1 0.2399 0.944 0.920 0.048 0.000 0.032
#> SRR901176 1 0.7688 0.265 0.440 0.328 0.000 0.232
#> SRR901177 3 0.0188 0.817 0.004 0.000 0.996 0.000
#> SRR901178 2 0.2814 0.883 0.000 0.868 0.000 0.132
#> SRR901179 2 0.1637 0.876 0.000 0.940 0.000 0.060
#> SRR901180 2 0.2469 0.860 0.000 0.892 0.000 0.108
#> SRR901181 3 0.5691 -0.750 0.024 0.000 0.508 0.468
#> SRR901182 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901183 1 0.2197 0.944 0.928 0.048 0.000 0.024
#> SRR901184 1 0.2197 0.944 0.928 0.048 0.000 0.024
#> SRR901185 3 0.0000 0.817 0.000 0.000 1.000 0.000
#> SRR901187 2 0.0000 0.887 0.000 1.000 0.000 0.000
#> SRR901186 2 0.0707 0.884 0.000 0.980 0.000 0.020
#> SRR901188 2 0.0000 0.887 0.000 1.000 0.000 0.000
#> SRR901189 4 0.6797 0.997 0.096 0.000 0.436 0.468
#> SRR901190 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901191 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901192 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901193 3 0.0188 0.818 0.004 0.000 0.996 0.000
#> SRR901194 2 0.1557 0.877 0.000 0.944 0.000 0.056
#> SRR901195 2 0.2011 0.869 0.000 0.920 0.000 0.080
#> SRR901196 2 0.2281 0.863 0.000 0.904 0.000 0.096
#> SRR901197 4 0.6797 0.997 0.096 0.000 0.436 0.468
#> SRR901198 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901199 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901200 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901201 3 0.0000 0.817 0.000 0.000 1.000 0.000
#> SRR901202 2 0.0188 0.886 0.000 0.996 0.000 0.004
#> SRR901203 2 0.0817 0.883 0.000 0.976 0.000 0.024
#> SRR901204 2 0.1211 0.881 0.000 0.960 0.000 0.040
#> SRR901205 3 0.5590 -0.664 0.020 0.000 0.524 0.456
#> SRR901206 1 0.2197 0.944 0.928 0.048 0.000 0.024
#> SRR901207 1 0.1389 0.953 0.952 0.048 0.000 0.000
#> SRR901208 1 0.2197 0.944 0.928 0.048 0.000 0.024
#> SRR901209 3 0.0336 0.815 0.008 0.000 0.992 0.000
#> SRR901211 2 0.0188 0.886 0.000 0.996 0.000 0.004
#> SRR901210 2 0.0188 0.886 0.000 0.996 0.000 0.004
#> SRR901212 2 0.0000 0.887 0.000 1.000 0.000 0.000
#> SRR901213 3 0.0817 0.814 0.024 0.000 0.976 0.000
#> SRR901214 2 0.4008 0.856 0.000 0.756 0.000 0.244
#> SRR901215 2 0.4008 0.856 0.000 0.756 0.000 0.244
#> SRR901216 2 0.4008 0.856 0.000 0.756 0.000 0.244
#> SRR901217 3 0.0592 0.815 0.016 0.000 0.984 0.000
#> SRR901218 2 0.4134 0.831 0.000 0.740 0.000 0.260
#> SRR901219 2 0.4134 0.831 0.000 0.740 0.000 0.260
#> SRR901220 2 0.4134 0.831 0.000 0.740 0.000 0.260
#> SRR901221 3 0.0707 0.814 0.020 0.000 0.980 0.000
#> SRR901222 2 0.3266 0.873 0.000 0.832 0.000 0.168
#> SRR901223 2 0.3311 0.872 0.000 0.828 0.000 0.172
#> SRR901224 2 0.4431 0.813 0.000 0.696 0.000 0.304
#> SRR901225 3 0.0188 0.817 0.004 0.000 0.996 0.000
#> SRR901226 2 0.4193 0.828 0.000 0.732 0.000 0.268
#> SRR901227 2 0.4193 0.828 0.000 0.732 0.000 0.268
#> SRR901229 3 0.0336 0.816 0.008 0.000 0.992 0.000
#> SRR901228 2 0.4164 0.829 0.000 0.736 0.000 0.264
#> SRR901230 2 0.4164 0.829 0.000 0.736 0.000 0.264
#> SRR901231 2 0.4164 0.829 0.000 0.736 0.000 0.264
#> SRR901232 2 0.4222 0.827 0.000 0.728 0.000 0.272
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0404 0.98741 0.012 0.000 0.000 0.000 0.988
#> SRR901150 1 0.2338 0.93319 0.916 0.016 0.032 0.036 0.000
#> SRR901151 1 0.1908 0.94080 0.936 0.016 0.024 0.024 0.000
#> SRR901152 1 0.1908 0.94080 0.936 0.016 0.024 0.024 0.000
#> SRR1382100 3 0.5290 0.93969 0.000 0.000 0.624 0.076 0.300
#> SRR901154 2 0.2011 0.61032 0.000 0.908 0.004 0.088 0.000
#> SRR901155 2 0.1638 0.61507 0.000 0.932 0.004 0.064 0.000
#> SRR901156 2 0.1205 0.62723 0.000 0.956 0.004 0.040 0.000
#> SRR901157 5 0.0404 0.98741 0.012 0.000 0.000 0.000 0.988
#> SRR901158 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901159 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901160 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901161 3 0.3796 0.96046 0.000 0.000 0.700 0.000 0.300
#> SRR901162 2 0.4907 -0.55751 0.000 0.488 0.024 0.488 0.000
#> SRR901163 2 0.4907 -0.55751 0.000 0.488 0.024 0.488 0.000
#> SRR901164 2 0.6037 0.39949 0.000 0.620 0.196 0.172 0.012
#> SRR901165 5 0.0727 0.97666 0.004 0.000 0.012 0.004 0.980
#> SRR901166 1 0.3781 0.88431 0.828 0.016 0.048 0.108 0.000
#> SRR901167 1 0.4679 0.84038 0.768 0.024 0.072 0.136 0.000
#> SRR901168 1 0.4514 0.85007 0.780 0.024 0.064 0.132 0.000
#> SRR901169 3 0.5237 0.94130 0.000 0.000 0.628 0.072 0.300
#> SRR901170 2 0.2201 0.62229 0.000 0.920 0.032 0.040 0.008
#> SRR901171 2 0.2201 0.62229 0.000 0.920 0.032 0.040 0.008
#> SRR901172 2 0.2201 0.62229 0.000 0.920 0.032 0.040 0.008
#> SRR901173 5 0.0404 0.98741 0.012 0.000 0.000 0.000 0.988
#> SRR901174 1 0.4679 0.84038 0.768 0.024 0.072 0.136 0.000
#> SRR901175 1 0.2721 0.92418 0.896 0.016 0.036 0.052 0.000
#> SRR901176 2 0.8900 0.05768 0.236 0.272 0.228 0.252 0.012
#> SRR901177 3 0.3796 0.96046 0.000 0.000 0.700 0.000 0.300
#> SRR901178 2 0.4435 0.50185 0.000 0.776 0.092 0.124 0.008
#> SRR901179 2 0.3076 0.60579 0.000 0.868 0.088 0.036 0.008
#> SRR901180 2 0.4140 0.56861 0.000 0.800 0.124 0.064 0.012
#> SRR901181 5 0.0404 0.97814 0.000 0.000 0.012 0.000 0.988
#> SRR901182 1 0.0671 0.95194 0.980 0.016 0.004 0.000 0.000
#> SRR901183 1 0.1891 0.93803 0.936 0.016 0.032 0.016 0.000
#> SRR901184 1 0.1891 0.93803 0.936 0.016 0.032 0.016 0.000
#> SRR901185 3 0.3949 0.95995 0.000 0.000 0.696 0.004 0.300
#> SRR901187 2 0.1544 0.61481 0.000 0.932 0.000 0.068 0.000
#> SRR901186 2 0.2674 0.58223 0.000 0.868 0.012 0.120 0.000
#> SRR901188 2 0.1892 0.61384 0.000 0.916 0.004 0.080 0.000
#> SRR901189 5 0.0404 0.98741 0.012 0.000 0.000 0.000 0.988
#> SRR901190 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901191 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901192 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901193 3 0.3949 0.95995 0.000 0.000 0.696 0.004 0.300
#> SRR901194 2 0.1992 0.62496 0.000 0.924 0.044 0.032 0.000
#> SRR901195 2 0.2813 0.60980 0.000 0.880 0.084 0.032 0.004
#> SRR901196 2 0.3698 0.58937 0.000 0.832 0.104 0.052 0.012
#> SRR901197 5 0.0404 0.98741 0.012 0.000 0.000 0.000 0.988
#> SRR901198 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901199 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901200 1 0.0510 0.95271 0.984 0.016 0.000 0.000 0.000
#> SRR901201 3 0.3949 0.95995 0.000 0.000 0.696 0.004 0.300
#> SRR901202 2 0.1851 0.61102 0.000 0.912 0.000 0.088 0.000
#> SRR901203 2 0.3060 0.56456 0.000 0.848 0.024 0.128 0.000
#> SRR901204 2 0.3262 0.57524 0.000 0.840 0.036 0.124 0.000
#> SRR901205 5 0.0981 0.97273 0.008 0.000 0.012 0.008 0.972
#> SRR901206 1 0.1891 0.93803 0.936 0.016 0.032 0.016 0.000
#> SRR901207 1 0.0912 0.95039 0.972 0.016 0.012 0.000 0.000
#> SRR901208 1 0.1891 0.93803 0.936 0.016 0.032 0.016 0.000
#> SRR901209 3 0.4102 0.95911 0.004 0.000 0.692 0.004 0.300
#> SRR901211 2 0.1851 0.61102 0.000 0.912 0.000 0.088 0.000
#> SRR901210 2 0.1851 0.61102 0.000 0.912 0.000 0.088 0.000
#> SRR901212 2 0.1478 0.61515 0.000 0.936 0.000 0.064 0.000
#> SRR901213 3 0.5290 0.94168 0.000 0.000 0.624 0.076 0.300
#> SRR901214 2 0.5602 0.03107 0.000 0.596 0.072 0.324 0.008
#> SRR901215 2 0.5602 0.03107 0.000 0.596 0.072 0.324 0.008
#> SRR901216 2 0.5602 0.03107 0.000 0.596 0.072 0.324 0.008
#> SRR901217 3 0.5237 0.94130 0.000 0.000 0.628 0.072 0.300
#> SRR901218 4 0.4210 0.95426 0.000 0.412 0.000 0.588 0.000
#> SRR901219 4 0.4210 0.95426 0.000 0.412 0.000 0.588 0.000
#> SRR901220 4 0.4210 0.95426 0.000 0.412 0.000 0.588 0.000
#> SRR901221 3 0.5391 0.93676 0.000 0.000 0.616 0.084 0.300
#> SRR901222 2 0.5330 -0.00411 0.000 0.620 0.064 0.312 0.004
#> SRR901223 2 0.5424 -0.12902 0.000 0.596 0.064 0.336 0.004
#> SRR901224 2 0.6816 0.14075 0.000 0.456 0.196 0.336 0.012
#> SRR901225 3 0.4443 0.95684 0.008 0.000 0.680 0.012 0.300
#> SRR901226 4 0.4101 0.92982 0.000 0.372 0.000 0.628 0.000
#> SRR901227 4 0.4138 0.94482 0.000 0.384 0.000 0.616 0.000
#> SRR901229 3 0.4443 0.95684 0.008 0.000 0.680 0.012 0.300
#> SRR901228 4 0.4182 0.95976 0.000 0.400 0.000 0.600 0.000
#> SRR901230 4 0.4182 0.95976 0.000 0.400 0.000 0.600 0.000
#> SRR901231 4 0.4201 0.95742 0.000 0.408 0.000 0.592 0.000
#> SRR901232 4 0.4045 0.89964 0.000 0.356 0.000 0.644 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0777 0.9721 0.024 0.000 0.000 0.000 0.972 0.004
#> SRR901150 1 0.3828 0.7267 0.724 0.008 0.016 0.000 0.000 0.252
#> SRR901151 1 0.3288 0.7747 0.800 0.008 0.016 0.000 0.000 0.176
#> SRR901152 1 0.3354 0.7706 0.792 0.008 0.016 0.000 0.000 0.184
#> SRR1382100 3 0.4690 0.9283 0.000 0.056 0.708 0.000 0.204 0.032
#> SRR901154 2 0.3895 0.8090 0.000 0.696 0.004 0.284 0.000 0.016
#> SRR901155 2 0.3772 0.8113 0.000 0.692 0.004 0.296 0.000 0.008
#> SRR901156 2 0.3628 0.8143 0.000 0.720 0.004 0.268 0.000 0.008
#> SRR901157 5 0.0632 0.9721 0.024 0.000 0.000 0.000 0.976 0.000
#> SRR901158 1 0.0146 0.8437 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR901159 1 0.0146 0.8437 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR901160 1 0.0146 0.8437 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR901161 3 0.3640 0.9428 0.000 0.004 0.764 0.000 0.204 0.028
#> SRR901162 4 0.5263 0.5093 0.000 0.160 0.068 0.704 0.016 0.052
#> SRR901163 4 0.5230 0.5142 0.000 0.156 0.068 0.708 0.016 0.052
#> SRR901164 2 0.6535 0.0130 0.000 0.432 0.056 0.144 0.000 0.368
#> SRR901165 5 0.2116 0.9333 0.000 0.036 0.024 0.000 0.916 0.024
#> SRR901166 1 0.3789 0.5961 0.584 0.000 0.000 0.000 0.000 0.416
#> SRR901167 1 0.3847 0.5427 0.544 0.000 0.000 0.000 0.000 0.456
#> SRR901168 1 0.3838 0.5541 0.552 0.000 0.000 0.000 0.000 0.448
#> SRR901169 3 0.4690 0.9283 0.000 0.056 0.708 0.000 0.204 0.032
#> SRR901170 2 0.4361 0.8020 0.000 0.700 0.016 0.248 0.000 0.036
#> SRR901171 2 0.4361 0.8020 0.000 0.700 0.016 0.248 0.000 0.036
#> SRR901172 2 0.4361 0.8020 0.000 0.700 0.016 0.248 0.000 0.036
#> SRR901173 5 0.0777 0.9721 0.024 0.000 0.000 0.000 0.972 0.004
#> SRR901174 1 0.3851 0.5363 0.540 0.000 0.000 0.000 0.000 0.460
#> SRR901175 1 0.3468 0.7141 0.712 0.004 0.000 0.000 0.000 0.284
#> SRR901176 6 0.6073 0.4347 0.124 0.132 0.048 0.044 0.000 0.652
#> SRR901177 3 0.3986 0.9394 0.000 0.012 0.748 0.000 0.204 0.036
#> SRR901178 2 0.6576 0.4926 0.000 0.448 0.056 0.360 0.004 0.132
#> SRR901179 2 0.6114 0.7082 0.000 0.584 0.056 0.232 0.004 0.124
#> SRR901180 2 0.6450 0.6026 0.000 0.548 0.060 0.208 0.004 0.180
#> SRR901181 5 0.0717 0.9604 0.008 0.000 0.016 0.000 0.976 0.000
#> SRR901182 1 0.0653 0.8398 0.980 0.004 0.004 0.000 0.000 0.012
#> SRR901183 1 0.3036 0.7960 0.868 0.028 0.044 0.000 0.004 0.056
#> SRR901184 1 0.3240 0.7924 0.856 0.032 0.052 0.000 0.004 0.056
#> SRR901185 3 0.3485 0.9429 0.000 0.004 0.772 0.000 0.204 0.020
#> SRR901187 2 0.3390 0.8130 0.000 0.704 0.000 0.296 0.000 0.000
#> SRR901186 2 0.5204 0.7457 0.000 0.652 0.044 0.256 0.008 0.040
#> SRR901188 2 0.4139 0.8112 0.000 0.688 0.016 0.284 0.004 0.008
#> SRR901189 5 0.0632 0.9721 0.024 0.000 0.000 0.000 0.976 0.000
#> SRR901190 1 0.1080 0.8405 0.960 0.004 0.004 0.000 0.000 0.032
#> SRR901191 1 0.0000 0.8438 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.8438 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.3401 0.9436 0.000 0.004 0.776 0.000 0.204 0.016
#> SRR901194 2 0.5032 0.7814 0.000 0.672 0.032 0.236 0.004 0.056
#> SRR901195 2 0.6161 0.6987 0.000 0.576 0.052 0.232 0.004 0.136
#> SRR901196 2 0.6304 0.6683 0.000 0.564 0.056 0.220 0.004 0.156
#> SRR901197 5 0.0632 0.9721 0.024 0.000 0.000 0.000 0.976 0.000
#> SRR901198 1 0.0000 0.8438 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0146 0.8436 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0146 0.8436 0.996 0.004 0.000 0.000 0.000 0.000
#> SRR901201 3 0.3401 0.9436 0.000 0.004 0.776 0.000 0.204 0.016
#> SRR901202 2 0.3330 0.8131 0.000 0.716 0.000 0.284 0.000 0.000
#> SRR901203 2 0.5738 0.7116 0.000 0.624 0.068 0.244 0.012 0.052
#> SRR901204 2 0.5807 0.7104 0.000 0.628 0.072 0.228 0.012 0.060
#> SRR901205 5 0.2188 0.9304 0.000 0.036 0.020 0.000 0.912 0.032
#> SRR901206 1 0.3300 0.7930 0.852 0.032 0.052 0.000 0.004 0.060
#> SRR901207 1 0.1767 0.8308 0.932 0.012 0.036 0.000 0.000 0.020
#> SRR901208 1 0.3300 0.7930 0.852 0.032 0.052 0.000 0.004 0.060
#> SRR901209 3 0.4117 0.9359 0.000 0.012 0.740 0.000 0.204 0.044
#> SRR901211 2 0.3575 0.8111 0.000 0.708 0.000 0.284 0.000 0.008
#> SRR901210 2 0.3575 0.8111 0.000 0.708 0.000 0.284 0.000 0.008
#> SRR901212 2 0.3528 0.8127 0.000 0.700 0.004 0.296 0.000 0.000
#> SRR901213 3 0.5117 0.9219 0.000 0.060 0.680 0.000 0.204 0.056
#> SRR901214 4 0.5612 0.4425 0.000 0.168 0.044 0.640 0.000 0.148
#> SRR901215 4 0.5612 0.4425 0.000 0.168 0.044 0.640 0.000 0.148
#> SRR901216 4 0.5612 0.4425 0.000 0.168 0.044 0.640 0.000 0.148
#> SRR901217 3 0.4690 0.9283 0.000 0.056 0.708 0.000 0.204 0.032
#> SRR901218 4 0.0696 0.7855 0.000 0.004 0.008 0.980 0.004 0.004
#> SRR901219 4 0.0696 0.7855 0.000 0.004 0.008 0.980 0.004 0.004
#> SRR901220 4 0.0696 0.7855 0.000 0.004 0.008 0.980 0.004 0.004
#> SRR901221 3 0.4878 0.9241 0.000 0.060 0.696 0.000 0.204 0.040
#> SRR901222 4 0.4896 0.5682 0.000 0.136 0.036 0.724 0.004 0.100
#> SRR901223 4 0.4615 0.6022 0.000 0.104 0.036 0.752 0.004 0.104
#> SRR901224 6 0.6938 0.0497 0.000 0.192 0.060 0.360 0.004 0.384
#> SRR901225 3 0.3485 0.9422 0.000 0.004 0.772 0.000 0.204 0.020
#> SRR901226 4 0.0146 0.7846 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR901227 4 0.0146 0.7846 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR901229 3 0.3564 0.9421 0.000 0.004 0.768 0.000 0.204 0.024
#> SRR901228 4 0.0291 0.7863 0.000 0.004 0.000 0.992 0.004 0.000
#> SRR901230 4 0.0146 0.7866 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR901231 4 0.0146 0.7866 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR901232 4 0.0146 0.7823 0.000 0.004 0.000 0.996 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "skmeans"]
# you can also extract it by
# res = res_list["CV:skmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.981 0.993 0.3935 0.609 0.609
#> 3 3 1.000 1.000 1.000 0.6475 0.730 0.561
#> 4 4 0.871 0.938 0.921 0.1415 0.893 0.695
#> 5 5 0.848 0.910 0.917 0.0594 0.961 0.843
#> 6 6 0.894 0.838 0.915 0.0411 0.986 0.935
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.000 0.989 0.000 1.000
#> SRR901150 1 0.000 0.993 1.000 0.000
#> SRR901151 1 0.000 0.993 1.000 0.000
#> SRR901152 1 0.000 0.993 1.000 0.000
#> SRR1382100 2 0.000 0.989 0.000 1.000
#> SRR901154 1 0.000 0.993 1.000 0.000
#> SRR901155 1 0.000 0.993 1.000 0.000
#> SRR901156 1 0.000 0.993 1.000 0.000
#> SRR901157 2 0.000 0.989 0.000 1.000
#> SRR901158 1 0.000 0.993 1.000 0.000
#> SRR901159 1 0.000 0.993 1.000 0.000
#> SRR901160 1 0.000 0.993 1.000 0.000
#> SRR901161 2 0.000 0.989 0.000 1.000
#> SRR901162 1 0.000 0.993 1.000 0.000
#> SRR901163 1 0.000 0.993 1.000 0.000
#> SRR901164 1 0.966 0.340 0.608 0.392
#> SRR901165 2 0.000 0.989 0.000 1.000
#> SRR901166 1 0.000 0.993 1.000 0.000
#> SRR901167 1 0.000 0.993 1.000 0.000
#> SRR901168 1 0.000 0.993 1.000 0.000
#> SRR901169 2 0.000 0.989 0.000 1.000
#> SRR901170 1 0.000 0.993 1.000 0.000
#> SRR901171 1 0.000 0.993 1.000 0.000
#> SRR901172 1 0.000 0.993 1.000 0.000
#> SRR901173 2 0.000 0.989 0.000 1.000
#> SRR901174 1 0.000 0.993 1.000 0.000
#> SRR901175 1 0.000 0.993 1.000 0.000
#> SRR901176 2 0.781 0.694 0.232 0.768
#> SRR901177 2 0.000 0.989 0.000 1.000
#> SRR901178 1 0.000 0.993 1.000 0.000
#> SRR901179 1 0.000 0.993 1.000 0.000
#> SRR901180 1 0.000 0.993 1.000 0.000
#> SRR901181 2 0.000 0.989 0.000 1.000
#> SRR901182 1 0.000 0.993 1.000 0.000
#> SRR901183 1 0.000 0.993 1.000 0.000
#> SRR901184 1 0.000 0.993 1.000 0.000
#> SRR901185 2 0.000 0.989 0.000 1.000
#> SRR901187 1 0.000 0.993 1.000 0.000
#> SRR901186 1 0.000 0.993 1.000 0.000
#> SRR901188 1 0.000 0.993 1.000 0.000
#> SRR901189 2 0.000 0.989 0.000 1.000
#> SRR901190 1 0.000 0.993 1.000 0.000
#> SRR901191 1 0.000 0.993 1.000 0.000
#> SRR901192 1 0.000 0.993 1.000 0.000
#> SRR901193 2 0.000 0.989 0.000 1.000
#> SRR901194 1 0.000 0.993 1.000 0.000
#> SRR901195 1 0.000 0.993 1.000 0.000
#> SRR901196 1 0.000 0.993 1.000 0.000
#> SRR901197 2 0.000 0.989 0.000 1.000
#> SRR901198 1 0.000 0.993 1.000 0.000
#> SRR901199 1 0.000 0.993 1.000 0.000
#> SRR901200 1 0.000 0.993 1.000 0.000
#> SRR901201 2 0.000 0.989 0.000 1.000
#> SRR901202 1 0.000 0.993 1.000 0.000
#> SRR901203 1 0.000 0.993 1.000 0.000
#> SRR901204 1 0.000 0.993 1.000 0.000
#> SRR901205 2 0.000 0.989 0.000 1.000
#> SRR901206 1 0.000 0.993 1.000 0.000
#> SRR901207 1 0.000 0.993 1.000 0.000
#> SRR901208 1 0.000 0.993 1.000 0.000
#> SRR901209 2 0.000 0.989 0.000 1.000
#> SRR901211 1 0.000 0.993 1.000 0.000
#> SRR901210 1 0.000 0.993 1.000 0.000
#> SRR901212 1 0.000 0.993 1.000 0.000
#> SRR901213 2 0.000 0.989 0.000 1.000
#> SRR901214 1 0.000 0.993 1.000 0.000
#> SRR901215 1 0.000 0.993 1.000 0.000
#> SRR901216 1 0.000 0.993 1.000 0.000
#> SRR901217 2 0.000 0.989 0.000 1.000
#> SRR901218 1 0.000 0.993 1.000 0.000
#> SRR901219 1 0.000 0.993 1.000 0.000
#> SRR901220 1 0.000 0.993 1.000 0.000
#> SRR901221 2 0.000 0.989 0.000 1.000
#> SRR901222 1 0.000 0.993 1.000 0.000
#> SRR901223 1 0.000 0.993 1.000 0.000
#> SRR901224 1 0.000 0.993 1.000 0.000
#> SRR901225 2 0.000 0.989 0.000 1.000
#> SRR901226 1 0.000 0.993 1.000 0.000
#> SRR901227 1 0.000 0.993 1.000 0.000
#> SRR901229 2 0.000 0.989 0.000 1.000
#> SRR901228 1 0.000 0.993 1.000 0.000
#> SRR901230 1 0.000 0.993 1.000 0.000
#> SRR901231 1 0.000 0.993 1.000 0.000
#> SRR901232 1 0.000 0.993 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0 1 0 0 1
#> SRR901150 1 0 1 1 0 0
#> SRR901151 1 0 1 1 0 0
#> SRR901152 1 0 1 1 0 0
#> SRR1382100 3 0 1 0 0 1
#> SRR901154 2 0 1 0 1 0
#> SRR901155 2 0 1 0 1 0
#> SRR901156 2 0 1 0 1 0
#> SRR901157 3 0 1 0 0 1
#> SRR901158 1 0 1 1 0 0
#> SRR901159 1 0 1 1 0 0
#> SRR901160 1 0 1 1 0 0
#> SRR901161 3 0 1 0 0 1
#> SRR901162 2 0 1 0 1 0
#> SRR901163 2 0 1 0 1 0
#> SRR901164 2 0 1 0 1 0
#> SRR901165 3 0 1 0 0 1
#> SRR901166 1 0 1 1 0 0
#> SRR901167 1 0 1 1 0 0
#> SRR901168 1 0 1 1 0 0
#> SRR901169 3 0 1 0 0 1
#> SRR901170 2 0 1 0 1 0
#> SRR901171 2 0 1 0 1 0
#> SRR901172 2 0 1 0 1 0
#> SRR901173 3 0 1 0 0 1
#> SRR901174 1 0 1 1 0 0
#> SRR901175 1 0 1 1 0 0
#> SRR901176 1 0 1 1 0 0
#> SRR901177 3 0 1 0 0 1
#> SRR901178 2 0 1 0 1 0
#> SRR901179 2 0 1 0 1 0
#> SRR901180 2 0 1 0 1 0
#> SRR901181 3 0 1 0 0 1
#> SRR901182 1 0 1 1 0 0
#> SRR901183 1 0 1 1 0 0
#> SRR901184 1 0 1 1 0 0
#> SRR901185 3 0 1 0 0 1
#> SRR901187 2 0 1 0 1 0
#> SRR901186 2 0 1 0 1 0
#> SRR901188 2 0 1 0 1 0
#> SRR901189 3 0 1 0 0 1
#> SRR901190 1 0 1 1 0 0
#> SRR901191 1 0 1 1 0 0
#> SRR901192 1 0 1 1 0 0
#> SRR901193 3 0 1 0 0 1
#> SRR901194 2 0 1 0 1 0
#> SRR901195 2 0 1 0 1 0
#> SRR901196 2 0 1 0 1 0
#> SRR901197 3 0 1 0 0 1
#> SRR901198 1 0 1 1 0 0
#> SRR901199 1 0 1 1 0 0
#> SRR901200 1 0 1 1 0 0
#> SRR901201 3 0 1 0 0 1
#> SRR901202 2 0 1 0 1 0
#> SRR901203 2 0 1 0 1 0
#> SRR901204 2 0 1 0 1 0
#> SRR901205 3 0 1 0 0 1
#> SRR901206 1 0 1 1 0 0
#> SRR901207 1 0 1 1 0 0
#> SRR901208 1 0 1 1 0 0
#> SRR901209 3 0 1 0 0 1
#> SRR901211 2 0 1 0 1 0
#> SRR901210 2 0 1 0 1 0
#> SRR901212 2 0 1 0 1 0
#> SRR901213 3 0 1 0 0 1
#> SRR901214 2 0 1 0 1 0
#> SRR901215 2 0 1 0 1 0
#> SRR901216 2 0 1 0 1 0
#> SRR901217 3 0 1 0 0 1
#> SRR901218 2 0 1 0 1 0
#> SRR901219 2 0 1 0 1 0
#> SRR901220 2 0 1 0 1 0
#> SRR901221 3 0 1 0 0 1
#> SRR901222 2 0 1 0 1 0
#> SRR901223 2 0 1 0 1 0
#> SRR901224 2 0 1 0 1 0
#> SRR901225 3 0 1 0 0 1
#> SRR901226 2 0 1 0 1 0
#> SRR901227 2 0 1 0 1 0
#> SRR901229 3 0 1 0 0 1
#> SRR901228 2 0 1 0 1 0
#> SRR901230 2 0 1 0 1 0
#> SRR901231 2 0 1 0 1 0
#> SRR901232 2 0 1 0 1 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0000 0.900 0.000 0.000 1.000 0.000
#> SRR901150 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901154 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901155 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901156 2 0.0707 0.962 0.000 0.980 0.000 0.020
#> SRR901157 3 0.0000 0.900 0.000 0.000 1.000 0.000
#> SRR901158 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901161 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901162 4 0.4985 0.507 0.000 0.468 0.000 0.532
#> SRR901163 4 0.4985 0.507 0.000 0.468 0.000 0.532
#> SRR901164 2 0.0707 0.948 0.000 0.980 0.000 0.020
#> SRR901165 3 0.0000 0.900 0.000 0.000 1.000 0.000
#> SRR901166 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901167 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901168 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901169 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901170 2 0.0817 0.950 0.000 0.976 0.000 0.024
#> SRR901171 2 0.0817 0.950 0.000 0.976 0.000 0.024
#> SRR901172 2 0.0817 0.950 0.000 0.976 0.000 0.024
#> SRR901173 3 0.0000 0.900 0.000 0.000 1.000 0.000
#> SRR901174 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901175 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901176 1 0.5220 0.756 0.756 0.036 0.188 0.020
#> SRR901177 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901178 2 0.2408 0.841 0.000 0.896 0.000 0.104
#> SRR901179 2 0.0469 0.953 0.000 0.988 0.000 0.012
#> SRR901180 2 0.0707 0.948 0.000 0.980 0.000 0.020
#> SRR901181 3 0.0000 0.900 0.000 0.000 1.000 0.000
#> SRR901182 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901185 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901187 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901186 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901188 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901189 3 0.0000 0.900 0.000 0.000 1.000 0.000
#> SRR901190 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901193 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901194 2 0.0000 0.958 0.000 1.000 0.000 0.000
#> SRR901195 2 0.0000 0.958 0.000 1.000 0.000 0.000
#> SRR901196 2 0.0707 0.948 0.000 0.980 0.000 0.020
#> SRR901197 3 0.0000 0.900 0.000 0.000 1.000 0.000
#> SRR901198 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901201 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901202 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901203 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901204 2 0.1022 0.962 0.000 0.968 0.000 0.032
#> SRR901205 3 0.0000 0.900 0.000 0.000 1.000 0.000
#> SRR901206 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> SRR901209 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901211 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901210 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901212 2 0.1118 0.963 0.000 0.964 0.000 0.036
#> SRR901213 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901214 4 0.3801 0.903 0.000 0.220 0.000 0.780
#> SRR901215 4 0.3801 0.903 0.000 0.220 0.000 0.780
#> SRR901216 4 0.3801 0.903 0.000 0.220 0.000 0.780
#> SRR901217 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901218 4 0.3688 0.932 0.000 0.208 0.000 0.792
#> SRR901219 4 0.3688 0.932 0.000 0.208 0.000 0.792
#> SRR901220 4 0.3688 0.932 0.000 0.208 0.000 0.792
#> SRR901221 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901222 4 0.3975 0.912 0.000 0.240 0.000 0.760
#> SRR901223 4 0.3942 0.915 0.000 0.236 0.000 0.764
#> SRR901224 4 0.4103 0.887 0.000 0.256 0.000 0.744
#> SRR901225 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901226 4 0.3688 0.932 0.000 0.208 0.000 0.792
#> SRR901227 4 0.3688 0.932 0.000 0.208 0.000 0.792
#> SRR901229 3 0.3486 0.940 0.000 0.000 0.812 0.188
#> SRR901228 4 0.3688 0.932 0.000 0.208 0.000 0.792
#> SRR901230 4 0.3688 0.932 0.000 0.208 0.000 0.792
#> SRR901231 4 0.3688 0.932 0.000 0.208 0.000 0.792
#> SRR901232 4 0.3688 0.932 0.000 0.208 0.000 0.792
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.2966 0.954 0.000 0.000 0.184 0.000 0.816
#> SRR901150 1 0.0162 0.993 0.996 0.000 0.000 0.000 0.004
#> SRR901151 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901154 2 0.1043 0.905 0.000 0.960 0.000 0.040 0.000
#> SRR901155 2 0.0794 0.906 0.000 0.972 0.000 0.028 0.000
#> SRR901156 2 0.0510 0.906 0.000 0.984 0.000 0.016 0.000
#> SRR901157 5 0.2966 0.954 0.000 0.000 0.184 0.000 0.816
#> SRR901158 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901162 4 0.4126 0.509 0.000 0.380 0.000 0.620 0.000
#> SRR901163 4 0.4126 0.509 0.000 0.380 0.000 0.620 0.000
#> SRR901164 2 0.4936 0.707 0.000 0.712 0.000 0.116 0.172
#> SRR901165 5 0.2966 0.954 0.000 0.000 0.184 0.000 0.816
#> SRR901166 1 0.0609 0.984 0.980 0.000 0.000 0.000 0.020
#> SRR901167 1 0.0898 0.979 0.972 0.000 0.000 0.008 0.020
#> SRR901168 1 0.0898 0.979 0.972 0.000 0.000 0.008 0.020
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901170 2 0.2505 0.853 0.000 0.888 0.000 0.092 0.020
#> SRR901171 2 0.2616 0.847 0.000 0.880 0.000 0.100 0.020
#> SRR901172 2 0.2505 0.853 0.000 0.888 0.000 0.092 0.020
#> SRR901173 5 0.2966 0.954 0.000 0.000 0.184 0.000 0.816
#> SRR901174 1 0.1106 0.972 0.964 0.000 0.000 0.012 0.024
#> SRR901175 1 0.0290 0.991 0.992 0.000 0.000 0.000 0.008
#> SRR901176 5 0.3110 0.638 0.004 0.028 0.000 0.112 0.856
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901178 2 0.3281 0.811 0.000 0.848 0.000 0.092 0.060
#> SRR901179 2 0.1965 0.885 0.000 0.924 0.000 0.024 0.052
#> SRR901180 2 0.3857 0.807 0.000 0.808 0.000 0.108 0.084
#> SRR901181 5 0.2966 0.954 0.000 0.000 0.184 0.000 0.816
#> SRR901182 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901187 2 0.0794 0.906 0.000 0.972 0.000 0.028 0.000
#> SRR901186 2 0.1544 0.889 0.000 0.932 0.000 0.068 0.000
#> SRR901188 2 0.1121 0.903 0.000 0.956 0.000 0.044 0.000
#> SRR901189 5 0.2966 0.954 0.000 0.000 0.184 0.000 0.816
#> SRR901190 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901194 2 0.1408 0.894 0.000 0.948 0.000 0.008 0.044
#> SRR901195 2 0.1282 0.894 0.000 0.952 0.000 0.004 0.044
#> SRR901196 2 0.3517 0.826 0.000 0.832 0.000 0.100 0.068
#> SRR901197 5 0.2966 0.954 0.000 0.000 0.184 0.000 0.816
#> SRR901198 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901202 2 0.1043 0.905 0.000 0.960 0.000 0.040 0.000
#> SRR901203 2 0.1608 0.887 0.000 0.928 0.000 0.072 0.000
#> SRR901204 2 0.1768 0.887 0.000 0.924 0.000 0.072 0.004
#> SRR901205 5 0.2966 0.954 0.000 0.000 0.184 0.000 0.816
#> SRR901206 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.995 1.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901211 2 0.1043 0.905 0.000 0.960 0.000 0.040 0.000
#> SRR901210 2 0.1043 0.905 0.000 0.960 0.000 0.040 0.000
#> SRR901212 2 0.0794 0.906 0.000 0.972 0.000 0.028 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901214 4 0.3955 0.733 0.000 0.084 0.000 0.800 0.116
#> SRR901215 4 0.3955 0.733 0.000 0.084 0.000 0.800 0.116
#> SRR901216 4 0.3955 0.733 0.000 0.084 0.000 0.800 0.116
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901218 4 0.2605 0.858 0.000 0.148 0.000 0.852 0.000
#> SRR901219 4 0.2605 0.858 0.000 0.148 0.000 0.852 0.000
#> SRR901220 4 0.2605 0.858 0.000 0.148 0.000 0.852 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901222 4 0.4725 0.807 0.000 0.200 0.000 0.720 0.080
#> SRR901223 4 0.4541 0.825 0.000 0.172 0.000 0.744 0.084
#> SRR901224 4 0.4971 0.674 0.000 0.116 0.000 0.708 0.176
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901226 4 0.2179 0.850 0.000 0.112 0.000 0.888 0.000
#> SRR901227 4 0.2179 0.850 0.000 0.112 0.000 0.888 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901228 4 0.2230 0.852 0.000 0.116 0.000 0.884 0.000
#> SRR901230 4 0.2280 0.853 0.000 0.120 0.000 0.880 0.000
#> SRR901231 4 0.2605 0.858 0.000 0.148 0.000 0.852 0.000
#> SRR901232 4 0.2230 0.848 0.000 0.116 0.000 0.884 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0937 1.000 0.000 0.000 0.04 0.000 0.960 0.000
#> SRR901150 1 0.1958 0.898 0.896 0.000 0.00 0.000 0.004 0.100
#> SRR901151 1 0.0935 0.937 0.964 0.000 0.00 0.000 0.004 0.032
#> SRR901152 1 0.0858 0.939 0.968 0.000 0.00 0.000 0.004 0.028
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901154 2 0.0508 0.873 0.000 0.984 0.00 0.004 0.000 0.012
#> SRR901155 2 0.0146 0.874 0.000 0.996 0.00 0.004 0.000 0.000
#> SRR901156 2 0.0146 0.874 0.000 0.996 0.00 0.004 0.000 0.000
#> SRR901157 5 0.0937 1.000 0.000 0.000 0.04 0.000 0.960 0.000
#> SRR901158 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901162 4 0.4668 0.530 0.000 0.144 0.00 0.724 0.020 0.112
#> SRR901163 4 0.4625 0.532 0.000 0.144 0.00 0.728 0.020 0.108
#> SRR901164 6 0.2902 0.671 0.000 0.196 0.00 0.000 0.004 0.800
#> SRR901165 5 0.0937 1.000 0.000 0.000 0.04 0.000 0.960 0.000
#> SRR901166 1 0.2915 0.828 0.808 0.000 0.00 0.000 0.008 0.184
#> SRR901167 1 0.3245 0.782 0.764 0.000 0.00 0.000 0.008 0.228
#> SRR901168 1 0.3012 0.816 0.796 0.000 0.00 0.000 0.008 0.196
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901170 2 0.1007 0.860 0.000 0.956 0.00 0.000 0.000 0.044
#> SRR901171 2 0.1007 0.860 0.000 0.956 0.00 0.000 0.000 0.044
#> SRR901172 2 0.1007 0.860 0.000 0.956 0.00 0.000 0.000 0.044
#> SRR901173 5 0.0937 1.000 0.000 0.000 0.04 0.000 0.960 0.000
#> SRR901174 1 0.3373 0.757 0.744 0.000 0.00 0.000 0.008 0.248
#> SRR901175 1 0.1531 0.918 0.928 0.000 0.00 0.000 0.004 0.068
#> SRR901176 6 0.2146 0.710 0.000 0.004 0.00 0.000 0.116 0.880
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901178 2 0.5956 0.305 0.000 0.524 0.00 0.256 0.012 0.208
#> SRR901179 2 0.3043 0.756 0.000 0.792 0.00 0.000 0.008 0.200
#> SRR901180 2 0.3945 0.465 0.000 0.612 0.00 0.000 0.008 0.380
#> SRR901181 5 0.0937 1.000 0.000 0.000 0.04 0.000 0.960 0.000
#> SRR901182 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901183 1 0.0260 0.948 0.992 0.000 0.00 0.000 0.000 0.008
#> SRR901184 1 0.0260 0.948 0.992 0.000 0.00 0.000 0.000 0.008
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901187 2 0.0146 0.874 0.000 0.996 0.00 0.004 0.000 0.000
#> SRR901186 2 0.2502 0.815 0.000 0.884 0.00 0.020 0.012 0.084
#> SRR901188 2 0.0692 0.870 0.000 0.976 0.00 0.004 0.000 0.020
#> SRR901189 5 0.0937 1.000 0.000 0.000 0.04 0.000 0.960 0.000
#> SRR901190 1 0.0146 0.949 0.996 0.000 0.00 0.000 0.000 0.004
#> SRR901191 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901194 2 0.2773 0.794 0.000 0.836 0.00 0.004 0.008 0.152
#> SRR901195 2 0.3089 0.764 0.000 0.800 0.00 0.004 0.008 0.188
#> SRR901196 2 0.3245 0.732 0.000 0.764 0.00 0.000 0.008 0.228
#> SRR901197 5 0.0937 1.000 0.000 0.000 0.04 0.000 0.960 0.000
#> SRR901198 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901202 2 0.0508 0.873 0.000 0.984 0.00 0.004 0.000 0.012
#> SRR901203 2 0.3117 0.797 0.000 0.848 0.00 0.032 0.020 0.100
#> SRR901204 2 0.3467 0.790 0.000 0.820 0.00 0.032 0.024 0.124
#> SRR901205 5 0.0937 1.000 0.000 0.000 0.04 0.000 0.960 0.000
#> SRR901206 1 0.0260 0.948 0.992 0.000 0.00 0.000 0.000 0.008
#> SRR901207 1 0.0000 0.950 1.000 0.000 0.00 0.000 0.000 0.000
#> SRR901208 1 0.0260 0.948 0.992 0.000 0.00 0.000 0.000 0.008
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901211 2 0.0508 0.873 0.000 0.984 0.00 0.004 0.000 0.012
#> SRR901210 2 0.0508 0.873 0.000 0.984 0.00 0.004 0.000 0.012
#> SRR901212 2 0.0146 0.874 0.000 0.996 0.00 0.004 0.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901214 4 0.4564 0.148 0.000 0.020 0.00 0.500 0.008 0.472
#> SRR901215 4 0.4564 0.148 0.000 0.020 0.00 0.500 0.008 0.472
#> SRR901216 4 0.4564 0.148 0.000 0.020 0.00 0.500 0.008 0.472
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901218 4 0.0603 0.778 0.000 0.016 0.00 0.980 0.004 0.000
#> SRR901219 4 0.0603 0.778 0.000 0.016 0.00 0.980 0.004 0.000
#> SRR901220 4 0.0603 0.778 0.000 0.016 0.00 0.980 0.004 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901222 4 0.4603 0.522 0.000 0.060 0.00 0.672 0.008 0.260
#> SRR901223 4 0.4130 0.554 0.000 0.028 0.00 0.700 0.008 0.264
#> SRR901224 6 0.3053 0.638 0.000 0.012 0.00 0.172 0.004 0.812
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901226 4 0.0000 0.778 0.000 0.000 0.00 1.000 0.000 0.000
#> SRR901227 4 0.0000 0.778 0.000 0.000 0.00 1.000 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> SRR901228 4 0.0000 0.778 0.000 0.000 0.00 1.000 0.000 0.000
#> SRR901230 4 0.0146 0.778 0.000 0.004 0.00 0.996 0.000 0.000
#> SRR901231 4 0.0458 0.778 0.000 0.016 0.00 0.984 0.000 0.000
#> SRR901232 4 0.0000 0.778 0.000 0.000 0.00 1.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "pam"]
# you can also extract it by
# res = res_list["CV:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.966 0.969 0.3804 0.620 0.620
#> 3 3 1.000 0.949 0.980 0.6704 0.680 0.511
#> 4 4 1.000 0.970 0.989 0.0606 0.952 0.869
#> 5 5 0.895 0.824 0.930 0.1664 0.890 0.663
#> 6 6 0.982 0.933 0.969 0.0510 0.938 0.727
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4
There is also optional best \(k\) = 2 3 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0376 0.936 0.004 0.996
#> SRR901150 1 0.3114 0.963 0.944 0.056
#> SRR901151 1 0.3114 0.963 0.944 0.056
#> SRR901152 1 0.3114 0.963 0.944 0.056
#> SRR1382100 2 0.3114 0.975 0.056 0.944
#> SRR901154 1 0.0000 0.977 1.000 0.000
#> SRR901155 1 0.0000 0.977 1.000 0.000
#> SRR901156 1 0.0000 0.977 1.000 0.000
#> SRR901157 2 0.0000 0.936 0.000 1.000
#> SRR901158 1 0.3114 0.963 0.944 0.056
#> SRR901159 1 0.3114 0.963 0.944 0.056
#> SRR901160 1 0.3114 0.963 0.944 0.056
#> SRR901161 2 0.3114 0.975 0.056 0.944
#> SRR901162 1 0.0000 0.977 1.000 0.000
#> SRR901163 1 0.0000 0.977 1.000 0.000
#> SRR901164 1 0.0000 0.977 1.000 0.000
#> SRR901165 2 0.2603 0.968 0.044 0.956
#> SRR901166 1 0.3114 0.963 0.944 0.056
#> SRR901167 1 0.3114 0.963 0.944 0.056
#> SRR901168 1 0.3114 0.963 0.944 0.056
#> SRR901169 2 0.3114 0.975 0.056 0.944
#> SRR901170 1 0.0000 0.977 1.000 0.000
#> SRR901171 1 0.0000 0.977 1.000 0.000
#> SRR901172 1 0.0000 0.977 1.000 0.000
#> SRR901173 2 0.3879 0.959 0.076 0.924
#> SRR901174 1 0.3114 0.963 0.944 0.056
#> SRR901175 1 0.3114 0.963 0.944 0.056
#> SRR901176 1 0.0000 0.977 1.000 0.000
#> SRR901177 2 0.3114 0.975 0.056 0.944
#> SRR901178 1 0.0000 0.977 1.000 0.000
#> SRR901179 1 0.0000 0.977 1.000 0.000
#> SRR901180 1 0.0000 0.977 1.000 0.000
#> SRR901181 2 0.3114 0.975 0.056 0.944
#> SRR901182 1 0.3114 0.963 0.944 0.056
#> SRR901183 1 0.3114 0.963 0.944 0.056
#> SRR901184 1 0.3114 0.963 0.944 0.056
#> SRR901185 2 0.3114 0.975 0.056 0.944
#> SRR901187 1 0.0000 0.977 1.000 0.000
#> SRR901186 1 0.0000 0.977 1.000 0.000
#> SRR901188 1 0.0000 0.977 1.000 0.000
#> SRR901189 2 0.0000 0.936 0.000 1.000
#> SRR901190 1 0.3114 0.963 0.944 0.056
#> SRR901191 1 0.3114 0.963 0.944 0.056
#> SRR901192 1 0.3114 0.963 0.944 0.056
#> SRR901193 2 0.3114 0.975 0.056 0.944
#> SRR901194 1 0.0000 0.977 1.000 0.000
#> SRR901195 1 0.0000 0.977 1.000 0.000
#> SRR901196 1 0.0000 0.977 1.000 0.000
#> SRR901197 2 0.8661 0.595 0.288 0.712
#> SRR901198 1 0.3114 0.963 0.944 0.056
#> SRR901199 1 0.3114 0.963 0.944 0.056
#> SRR901200 1 0.3114 0.963 0.944 0.056
#> SRR901201 2 0.3114 0.975 0.056 0.944
#> SRR901202 1 0.0000 0.977 1.000 0.000
#> SRR901203 1 0.0000 0.977 1.000 0.000
#> SRR901204 1 0.0000 0.977 1.000 0.000
#> SRR901205 2 0.3114 0.975 0.056 0.944
#> SRR901206 1 0.3114 0.963 0.944 0.056
#> SRR901207 1 0.3114 0.963 0.944 0.056
#> SRR901208 1 0.3114 0.963 0.944 0.056
#> SRR901209 2 0.3114 0.975 0.056 0.944
#> SRR901211 1 0.0000 0.977 1.000 0.000
#> SRR901210 1 0.0000 0.977 1.000 0.000
#> SRR901212 1 0.0000 0.977 1.000 0.000
#> SRR901213 2 0.3114 0.975 0.056 0.944
#> SRR901214 1 0.0000 0.977 1.000 0.000
#> SRR901215 1 0.0000 0.977 1.000 0.000
#> SRR901216 1 0.0000 0.977 1.000 0.000
#> SRR901217 2 0.3114 0.975 0.056 0.944
#> SRR901218 1 0.0000 0.977 1.000 0.000
#> SRR901219 1 0.0000 0.977 1.000 0.000
#> SRR901220 1 0.0000 0.977 1.000 0.000
#> SRR901221 2 0.3114 0.975 0.056 0.944
#> SRR901222 1 0.0000 0.977 1.000 0.000
#> SRR901223 1 0.0000 0.977 1.000 0.000
#> SRR901224 1 0.0000 0.977 1.000 0.000
#> SRR901225 2 0.3114 0.975 0.056 0.944
#> SRR901226 1 0.0000 0.977 1.000 0.000
#> SRR901227 1 0.1414 0.972 0.980 0.020
#> SRR901229 2 0.3114 0.975 0.056 0.944
#> SRR901228 1 0.2603 0.966 0.956 0.044
#> SRR901230 1 0.0376 0.976 0.996 0.004
#> SRR901231 1 0.0000 0.977 1.000 0.000
#> SRR901232 1 0.0000 0.977 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 1 0.1289 0.936 0.968 0.000 0.032
#> SRR901150 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901151 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901152 1 0.0000 0.958 1.000 0.000 0.000
#> SRR1382100 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901154 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901155 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901156 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901157 1 0.1529 0.929 0.960 0.000 0.040
#> SRR901158 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901159 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901160 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901161 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901162 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901163 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901164 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901165 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901166 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901167 1 0.4654 0.720 0.792 0.208 0.000
#> SRR901168 1 0.1411 0.928 0.964 0.036 0.000
#> SRR901169 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901170 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901171 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901172 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901173 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901174 1 0.0592 0.949 0.988 0.012 0.000
#> SRR901175 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901176 2 0.6244 0.192 0.440 0.560 0.000
#> SRR901177 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901178 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901179 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901180 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901181 3 0.1529 0.957 0.040 0.000 0.960
#> SRR901182 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901183 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901184 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901185 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901187 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901186 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901188 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901189 1 0.6299 0.109 0.524 0.000 0.476
#> SRR901190 1 0.1860 0.912 0.948 0.052 0.000
#> SRR901191 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901192 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901193 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901194 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901195 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901196 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901197 1 0.4002 0.779 0.840 0.160 0.000
#> SRR901198 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901199 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901200 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901201 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901202 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901203 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901204 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901205 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901206 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901207 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901208 1 0.0000 0.958 1.000 0.000 0.000
#> SRR901209 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901211 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901210 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901212 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901213 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901214 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901215 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901216 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901217 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901218 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901219 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901220 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901221 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901222 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901223 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901224 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901225 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901226 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901227 2 0.3879 0.809 0.152 0.848 0.000
#> SRR901229 3 0.0000 0.997 0.000 0.000 1.000
#> SRR901228 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901230 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901231 2 0.0000 0.983 0.000 1.000 0.000
#> SRR901232 2 0.0000 0.983 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.000 1.000 0.000 0.000 0 1
#> SRR901150 1 0.000 0.976 1.000 0.000 0 0
#> SRR901151 1 0.000 0.976 1.000 0.000 0 0
#> SRR901152 1 0.000 0.976 1.000 0.000 0 0
#> SRR1382100 3 0.000 1.000 0.000 0.000 1 0
#> SRR901154 2 0.000 0.984 0.000 1.000 0 0
#> SRR901155 2 0.000 0.984 0.000 1.000 0 0
#> SRR901156 2 0.000 0.984 0.000 1.000 0 0
#> SRR901157 4 0.000 1.000 0.000 0.000 0 1
#> SRR901158 1 0.000 0.976 1.000 0.000 0 0
#> SRR901159 1 0.000 0.976 1.000 0.000 0 0
#> SRR901160 1 0.000 0.976 1.000 0.000 0 0
#> SRR901161 3 0.000 1.000 0.000 0.000 1 0
#> SRR901162 2 0.000 0.984 0.000 1.000 0 0
#> SRR901163 2 0.000 0.984 0.000 1.000 0 0
#> SRR901164 2 0.000 0.984 0.000 1.000 0 0
#> SRR901165 4 0.000 1.000 0.000 0.000 0 1
#> SRR901166 1 0.000 0.976 1.000 0.000 0 0
#> SRR901167 1 0.380 0.668 0.780 0.220 0 0
#> SRR901168 1 0.179 0.900 0.932 0.068 0 0
#> SRR901169 3 0.000 1.000 0.000 0.000 1 0
#> SRR901170 2 0.000 0.984 0.000 1.000 0 0
#> SRR901171 2 0.000 0.984 0.000 1.000 0 0
#> SRR901172 2 0.000 0.984 0.000 1.000 0 0
#> SRR901173 4 0.000 1.000 0.000 0.000 0 1
#> SRR901174 1 0.121 0.935 0.960 0.040 0 0
#> SRR901175 1 0.000 0.976 1.000 0.000 0 0
#> SRR901176 2 0.492 0.227 0.428 0.572 0 0
#> SRR901177 3 0.000 1.000 0.000 0.000 1 0
#> SRR901178 2 0.000 0.984 0.000 1.000 0 0
#> SRR901179 2 0.000 0.984 0.000 1.000 0 0
#> SRR901180 2 0.000 0.984 0.000 1.000 0 0
#> SRR901181 4 0.000 1.000 0.000 0.000 0 1
#> SRR901182 1 0.000 0.976 1.000 0.000 0 0
#> SRR901183 1 0.000 0.976 1.000 0.000 0 0
#> SRR901184 1 0.000 0.976 1.000 0.000 0 0
#> SRR901185 3 0.000 1.000 0.000 0.000 1 0
#> SRR901187 2 0.000 0.984 0.000 1.000 0 0
#> SRR901186 2 0.000 0.984 0.000 1.000 0 0
#> SRR901188 2 0.000 0.984 0.000 1.000 0 0
#> SRR901189 4 0.000 1.000 0.000 0.000 0 1
#> SRR901190 1 0.147 0.920 0.948 0.052 0 0
#> SRR901191 1 0.000 0.976 1.000 0.000 0 0
#> SRR901192 1 0.000 0.976 1.000 0.000 0 0
#> SRR901193 3 0.000 1.000 0.000 0.000 1 0
#> SRR901194 2 0.000 0.984 0.000 1.000 0 0
#> SRR901195 2 0.000 0.984 0.000 1.000 0 0
#> SRR901196 2 0.000 0.984 0.000 1.000 0 0
#> SRR901197 4 0.000 1.000 0.000 0.000 0 1
#> SRR901198 1 0.000 0.976 1.000 0.000 0 0
#> SRR901199 1 0.000 0.976 1.000 0.000 0 0
#> SRR901200 1 0.000 0.976 1.000 0.000 0 0
#> SRR901201 3 0.000 1.000 0.000 0.000 1 0
#> SRR901202 2 0.000 0.984 0.000 1.000 0 0
#> SRR901203 2 0.000 0.984 0.000 1.000 0 0
#> SRR901204 2 0.000 0.984 0.000 1.000 0 0
#> SRR901205 4 0.000 1.000 0.000 0.000 0 1
#> SRR901206 1 0.000 0.976 1.000 0.000 0 0
#> SRR901207 1 0.000 0.976 1.000 0.000 0 0
#> SRR901208 1 0.000 0.976 1.000 0.000 0 0
#> SRR901209 3 0.000 1.000 0.000 0.000 1 0
#> SRR901211 2 0.000 0.984 0.000 1.000 0 0
#> SRR901210 2 0.000 0.984 0.000 1.000 0 0
#> SRR901212 2 0.000 0.984 0.000 1.000 0 0
#> SRR901213 3 0.000 1.000 0.000 0.000 1 0
#> SRR901214 2 0.000 0.984 0.000 1.000 0 0
#> SRR901215 2 0.000 0.984 0.000 1.000 0 0
#> SRR901216 2 0.000 0.984 0.000 1.000 0 0
#> SRR901217 3 0.000 1.000 0.000 0.000 1 0
#> SRR901218 2 0.000 0.984 0.000 1.000 0 0
#> SRR901219 2 0.000 0.984 0.000 1.000 0 0
#> SRR901220 2 0.000 0.984 0.000 1.000 0 0
#> SRR901221 3 0.000 1.000 0.000 0.000 1 0
#> SRR901222 2 0.000 0.984 0.000 1.000 0 0
#> SRR901223 2 0.000 0.984 0.000 1.000 0 0
#> SRR901224 2 0.000 0.984 0.000 1.000 0 0
#> SRR901225 3 0.000 1.000 0.000 0.000 1 0
#> SRR901226 2 0.000 0.984 0.000 1.000 0 0
#> SRR901227 2 0.241 0.863 0.104 0.896 0 0
#> SRR901229 3 0.000 1.000 0.000 0.000 1 0
#> SRR901228 2 0.000 0.984 0.000 1.000 0 0
#> SRR901230 2 0.000 0.984 0.000 1.000 0 0
#> SRR901231 2 0.000 0.984 0.000 1.000 0 0
#> SRR901232 2 0.000 0.984 0.000 1.000 0 0
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0000 1.0000 0.000 0.000 0 0.000 1
#> SRR901150 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901151 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901152 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR1382100 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901154 2 0.4283 -0.0468 0.000 0.544 0 0.456 0
#> SRR901155 4 0.4294 0.1927 0.000 0.468 0 0.532 0
#> SRR901156 2 0.0000 0.7934 0.000 1.000 0 0.000 0
#> SRR901157 5 0.0000 1.0000 0.000 0.000 0 0.000 1
#> SRR901158 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901159 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901160 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901161 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901162 4 0.3074 0.6854 0.000 0.196 0 0.804 0
#> SRR901163 4 0.0510 0.8500 0.000 0.016 0 0.984 0
#> SRR901164 2 0.0963 0.7855 0.000 0.964 0 0.036 0
#> SRR901165 5 0.0000 1.0000 0.000 0.000 0 0.000 1
#> SRR901166 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901167 1 0.4024 0.6840 0.752 0.220 0 0.028 0
#> SRR901168 1 0.1774 0.9159 0.932 0.052 0 0.016 0
#> SRR901169 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901170 2 0.0000 0.7934 0.000 1.000 0 0.000 0
#> SRR901171 2 0.0000 0.7934 0.000 1.000 0 0.000 0
#> SRR901172 2 0.0000 0.7934 0.000 1.000 0 0.000 0
#> SRR901173 5 0.0000 1.0000 0.000 0.000 0 0.000 1
#> SRR901174 1 0.2660 0.8353 0.864 0.128 0 0.008 0
#> SRR901175 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901176 2 0.4982 0.2215 0.412 0.556 0 0.032 0
#> SRR901177 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901178 2 0.4268 0.3110 0.000 0.556 0 0.444 0
#> SRR901179 2 0.0880 0.7871 0.000 0.968 0 0.032 0
#> SRR901180 2 0.1043 0.7836 0.000 0.960 0 0.040 0
#> SRR901181 5 0.0000 1.0000 0.000 0.000 0 0.000 1
#> SRR901182 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901183 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901184 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901185 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901187 2 0.2891 0.6374 0.000 0.824 0 0.176 0
#> SRR901186 2 0.0510 0.7894 0.000 0.984 0 0.016 0
#> SRR901188 4 0.4297 0.1826 0.000 0.472 0 0.528 0
#> SRR901189 5 0.0000 1.0000 0.000 0.000 0 0.000 1
#> SRR901190 1 0.0703 0.9538 0.976 0.024 0 0.000 0
#> SRR901191 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901192 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901193 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901194 2 0.0000 0.7934 0.000 1.000 0 0.000 0
#> SRR901195 2 0.0609 0.7910 0.000 0.980 0 0.020 0
#> SRR901196 2 0.0000 0.7934 0.000 1.000 0 0.000 0
#> SRR901197 5 0.0000 1.0000 0.000 0.000 0 0.000 1
#> SRR901198 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901199 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901200 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901201 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901202 2 0.2020 0.7262 0.000 0.900 0 0.100 0
#> SRR901203 2 0.0963 0.7790 0.000 0.964 0 0.036 0
#> SRR901204 2 0.0000 0.7934 0.000 1.000 0 0.000 0
#> SRR901205 5 0.0000 1.0000 0.000 0.000 0 0.000 1
#> SRR901206 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901207 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901208 1 0.0000 0.9753 1.000 0.000 0 0.000 0
#> SRR901209 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901211 4 0.4294 0.1927 0.000 0.468 0 0.532 0
#> SRR901210 2 0.1341 0.7644 0.000 0.944 0 0.056 0
#> SRR901212 2 0.0290 0.7921 0.000 0.992 0 0.008 0
#> SRR901213 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901214 2 0.4294 0.2659 0.000 0.532 0 0.468 0
#> SRR901215 2 0.4306 0.2087 0.000 0.508 0 0.492 0
#> SRR901216 2 0.4297 0.2573 0.000 0.528 0 0.472 0
#> SRR901217 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901218 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901219 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901220 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901221 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901222 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901223 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901224 2 0.4283 0.2900 0.000 0.544 0 0.456 0
#> SRR901225 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901226 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901227 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901229 3 0.0000 1.0000 0.000 0.000 1 0.000 0
#> SRR901228 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901230 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901231 4 0.0000 0.8618 0.000 0.000 0 1.000 0
#> SRR901232 4 0.0000 0.8618 0.000 0.000 0 1.000 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901150 1 0.0260 0.970 0.992 0.000 0 0.000 0 0.008
#> SRR901151 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901152 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901154 2 0.0260 0.977 0.000 0.992 0 0.008 0 0.000
#> SRR901155 2 0.0260 0.977 0.000 0.992 0 0.008 0 0.000
#> SRR901156 2 0.0260 0.973 0.000 0.992 0 0.000 0 0.008
#> SRR901157 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901158 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901159 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901160 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901162 4 0.3857 0.145 0.000 0.468 0 0.532 0 0.000
#> SRR901163 4 0.0260 0.946 0.000 0.008 0 0.992 0 0.000
#> SRR901164 6 0.0622 0.906 0.000 0.012 0 0.008 0 0.980
#> SRR901165 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901166 1 0.0260 0.970 0.992 0.000 0 0.000 0 0.008
#> SRR901167 1 0.3560 0.658 0.732 0.004 0 0.008 0 0.256
#> SRR901168 1 0.1349 0.928 0.940 0.000 0 0.004 0 0.056
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901170 2 0.1204 0.929 0.000 0.944 0 0.000 0 0.056
#> SRR901171 6 0.3823 0.249 0.000 0.436 0 0.000 0 0.564
#> SRR901172 2 0.2562 0.773 0.000 0.828 0 0.000 0 0.172
#> SRR901173 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901174 1 0.2668 0.802 0.828 0.000 0 0.004 0 0.168
#> SRR901175 1 0.0260 0.970 0.992 0.000 0 0.000 0 0.008
#> SRR901176 6 0.0405 0.902 0.000 0.004 0 0.008 0 0.988
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901178 6 0.0622 0.906 0.000 0.012 0 0.008 0 0.980
#> SRR901179 6 0.0622 0.906 0.000 0.012 0 0.008 0 0.980
#> SRR901180 6 0.0622 0.906 0.000 0.012 0 0.008 0 0.980
#> SRR901181 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901182 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901183 1 0.0363 0.969 0.988 0.000 0 0.000 0 0.012
#> SRR901184 1 0.0363 0.969 0.988 0.000 0 0.000 0 0.012
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901187 2 0.0260 0.977 0.000 0.992 0 0.008 0 0.000
#> SRR901186 2 0.0000 0.974 0.000 1.000 0 0.000 0 0.000
#> SRR901188 2 0.0260 0.977 0.000 0.992 0 0.008 0 0.000
#> SRR901189 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901190 1 0.0520 0.967 0.984 0.008 0 0.000 0 0.008
#> SRR901191 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901192 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901194 6 0.3023 0.690 0.000 0.232 0 0.000 0 0.768
#> SRR901195 6 0.0622 0.906 0.000 0.012 0 0.008 0 0.980
#> SRR901196 6 0.0547 0.900 0.000 0.020 0 0.000 0 0.980
#> SRR901197 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901198 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901199 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901200 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901202 2 0.0260 0.977 0.000 0.992 0 0.008 0 0.000
#> SRR901203 2 0.0000 0.974 0.000 1.000 0 0.000 0 0.000
#> SRR901204 2 0.0000 0.974 0.000 1.000 0 0.000 0 0.000
#> SRR901205 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901206 1 0.0363 0.969 0.988 0.000 0 0.000 0 0.012
#> SRR901207 1 0.0000 0.973 1.000 0.000 0 0.000 0 0.000
#> SRR901208 1 0.0363 0.969 0.988 0.000 0 0.000 0 0.012
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901211 2 0.0260 0.977 0.000 0.992 0 0.008 0 0.000
#> SRR901210 2 0.0260 0.977 0.000 0.992 0 0.008 0 0.000
#> SRR901212 2 0.0260 0.973 0.000 0.992 0 0.000 0 0.008
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901214 6 0.0547 0.900 0.000 0.000 0 0.020 0 0.980
#> SRR901215 6 0.3221 0.634 0.000 0.000 0 0.264 0 0.736
#> SRR901216 6 0.1204 0.879 0.000 0.000 0 0.056 0 0.944
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901218 4 0.0000 0.951 0.000 0.000 0 1.000 0 0.000
#> SRR901219 4 0.0000 0.951 0.000 0.000 0 1.000 0 0.000
#> SRR901220 4 0.0363 0.943 0.000 0.012 0 0.988 0 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901222 4 0.0458 0.941 0.000 0.000 0 0.984 0 0.016
#> SRR901223 4 0.0458 0.941 0.000 0.000 0 0.984 0 0.016
#> SRR901224 6 0.0603 0.903 0.000 0.004 0 0.016 0 0.980
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901226 4 0.0000 0.951 0.000 0.000 0 1.000 0 0.000
#> SRR901227 4 0.0000 0.951 0.000 0.000 0 1.000 0 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901228 4 0.0000 0.951 0.000 0.000 0 1.000 0 0.000
#> SRR901230 4 0.0000 0.951 0.000 0.000 0 1.000 0 0.000
#> SRR901231 4 0.0000 0.951 0.000 0.000 0 1.000 0 0.000
#> SRR901232 4 0.0000 0.951 0.000 0.000 0 1.000 0 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "mclust"]
# you can also extract it by
# res = res_list["CV:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.408 0.487 0.715 0.4415 0.517 0.517
#> 3 3 0.779 0.890 0.942 0.4141 0.753 0.558
#> 4 4 0.991 0.972 0.961 0.1009 0.961 0.891
#> 5 5 0.900 0.761 0.912 0.0783 0.969 0.903
#> 6 6 0.811 0.714 0.832 0.0622 0.898 0.646
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 4
There is also optional best \(k\) = 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 1 0.999 0.392 0.520 0.480
#> SRR901150 1 0.000 0.731 1.000 0.000
#> SRR901151 1 0.000 0.731 1.000 0.000
#> SRR901152 1 0.000 0.731 1.000 0.000
#> SRR1382100 2 0.978 -0.309 0.412 0.588
#> SRR901154 2 0.999 0.649 0.480 0.520
#> SRR901155 2 0.999 0.649 0.480 0.520
#> SRR901156 2 0.999 0.649 0.480 0.520
#> SRR901157 1 0.999 0.392 0.520 0.480
#> SRR901158 1 0.000 0.731 1.000 0.000
#> SRR901159 1 0.000 0.731 1.000 0.000
#> SRR901160 1 0.000 0.731 1.000 0.000
#> SRR901161 2 0.978 -0.309 0.412 0.588
#> SRR901162 2 0.999 0.649 0.480 0.520
#> SRR901163 2 0.999 0.649 0.480 0.520
#> SRR901164 2 0.999 0.649 0.480 0.520
#> SRR901165 1 0.999 0.392 0.520 0.480
#> SRR901166 1 0.000 0.731 1.000 0.000
#> SRR901167 1 0.000 0.731 1.000 0.000
#> SRR901168 1 0.000 0.731 1.000 0.000
#> SRR901169 2 0.978 -0.309 0.412 0.588
#> SRR901170 2 0.999 0.649 0.480 0.520
#> SRR901171 2 0.999 0.649 0.480 0.520
#> SRR901172 2 0.999 0.649 0.480 0.520
#> SRR901173 1 0.999 0.392 0.520 0.480
#> SRR901174 1 0.000 0.731 1.000 0.000
#> SRR901175 1 0.000 0.731 1.000 0.000
#> SRR901176 1 0.000 0.731 1.000 0.000
#> SRR901177 2 0.978 -0.309 0.412 0.588
#> SRR901178 2 0.999 0.649 0.480 0.520
#> SRR901179 2 0.999 0.649 0.480 0.520
#> SRR901180 2 0.999 0.649 0.480 0.520
#> SRR901181 1 0.999 0.392 0.520 0.480
#> SRR901182 1 0.000 0.731 1.000 0.000
#> SRR901183 1 0.000 0.731 1.000 0.000
#> SRR901184 1 0.000 0.731 1.000 0.000
#> SRR901185 2 0.978 -0.309 0.412 0.588
#> SRR901187 2 0.999 0.649 0.480 0.520
#> SRR901186 2 0.999 0.649 0.480 0.520
#> SRR901188 2 0.999 0.649 0.480 0.520
#> SRR901189 1 0.999 0.392 0.520 0.480
#> SRR901190 1 0.000 0.731 1.000 0.000
#> SRR901191 1 0.000 0.731 1.000 0.000
#> SRR901192 1 0.000 0.731 1.000 0.000
#> SRR901193 2 0.978 -0.309 0.412 0.588
#> SRR901194 2 0.999 0.649 0.480 0.520
#> SRR901195 2 0.999 0.649 0.480 0.520
#> SRR901196 2 0.999 0.649 0.480 0.520
#> SRR901197 1 0.999 0.392 0.520 0.480
#> SRR901198 1 0.000 0.731 1.000 0.000
#> SRR901199 1 0.000 0.731 1.000 0.000
#> SRR901200 1 0.000 0.731 1.000 0.000
#> SRR901201 2 0.978 -0.309 0.412 0.588
#> SRR901202 2 0.999 0.649 0.480 0.520
#> SRR901203 2 0.999 0.649 0.480 0.520
#> SRR901204 2 0.999 0.649 0.480 0.520
#> SRR901205 1 0.999 0.392 0.520 0.480
#> SRR901206 1 0.000 0.731 1.000 0.000
#> SRR901207 1 0.000 0.731 1.000 0.000
#> SRR901208 1 0.000 0.731 1.000 0.000
#> SRR901209 2 0.978 -0.309 0.412 0.588
#> SRR901211 2 0.999 0.649 0.480 0.520
#> SRR901210 2 0.999 0.649 0.480 0.520
#> SRR901212 2 0.999 0.649 0.480 0.520
#> SRR901213 2 0.978 -0.309 0.412 0.588
#> SRR901214 2 0.999 0.649 0.480 0.520
#> SRR901215 2 0.999 0.649 0.480 0.520
#> SRR901216 2 0.999 0.649 0.480 0.520
#> SRR901217 2 0.978 -0.309 0.412 0.588
#> SRR901218 2 0.999 0.649 0.480 0.520
#> SRR901219 2 0.999 0.649 0.480 0.520
#> SRR901220 2 0.999 0.649 0.480 0.520
#> SRR901221 2 0.978 -0.309 0.412 0.588
#> SRR901222 2 0.999 0.649 0.480 0.520
#> SRR901223 2 0.999 0.649 0.480 0.520
#> SRR901224 1 0.961 -0.399 0.616 0.384
#> SRR901225 2 0.978 -0.309 0.412 0.588
#> SRR901226 2 0.999 0.649 0.480 0.520
#> SRR901227 2 0.999 0.649 0.480 0.520
#> SRR901229 2 0.978 -0.309 0.412 0.588
#> SRR901228 2 0.999 0.649 0.480 0.520
#> SRR901230 2 0.999 0.649 0.480 0.520
#> SRR901231 2 0.999 0.649 0.480 0.520
#> SRR901232 2 0.999 0.649 0.480 0.520
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.8719 0.613 0.128 0.324 0.548
#> SRR901150 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901151 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901152 1 0.0000 0.948 1.000 0.000 0.000
#> SRR1382100 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901154 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901155 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901156 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901157 3 0.8719 0.613 0.128 0.324 0.548
#> SRR901158 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901159 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901160 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901161 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901162 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901163 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901164 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901165 3 0.8719 0.613 0.128 0.324 0.548
#> SRR901166 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901167 1 0.3686 0.807 0.860 0.000 0.140
#> SRR901168 1 0.3686 0.807 0.860 0.000 0.140
#> SRR901169 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901170 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901171 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901172 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901173 3 0.8719 0.613 0.128 0.324 0.548
#> SRR901174 1 0.3686 0.807 0.860 0.000 0.140
#> SRR901175 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901176 1 0.9974 -0.278 0.368 0.324 0.308
#> SRR901177 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901178 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901179 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901180 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901181 3 0.8719 0.613 0.128 0.324 0.548
#> SRR901182 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901183 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901184 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901185 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901187 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901186 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901188 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901189 3 0.8719 0.613 0.128 0.324 0.548
#> SRR901190 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901191 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901192 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901193 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901194 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901195 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901196 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901197 3 0.8719 0.613 0.128 0.324 0.548
#> SRR901198 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901199 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901200 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901201 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901202 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901203 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901204 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901205 3 0.8719 0.613 0.128 0.324 0.548
#> SRR901206 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901207 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901208 1 0.0000 0.948 1.000 0.000 0.000
#> SRR901209 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901211 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901210 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901212 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901213 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901214 2 0.0424 0.985 0.000 0.992 0.008
#> SRR901215 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901216 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901217 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901218 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901219 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901220 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901221 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901222 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901223 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901224 2 0.4346 0.712 0.000 0.816 0.184
#> SRR901225 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901226 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901227 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901229 3 0.0000 0.794 0.000 0.000 1.000
#> SRR901228 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901230 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901231 2 0.0000 0.994 0.000 1.000 0.000
#> SRR901232 2 0.0000 0.994 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.2662 0.961 0.016 0.000 0.084 0.900
#> SRR901150 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901154 2 0.1867 0.959 0.000 0.928 0.000 0.072
#> SRR901155 2 0.1637 0.962 0.000 0.940 0.000 0.060
#> SRR901156 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> SRR901157 4 0.2662 0.961 0.016 0.000 0.084 0.900
#> SRR901158 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901162 2 0.2081 0.954 0.000 0.916 0.000 0.084
#> SRR901163 2 0.2081 0.954 0.000 0.916 0.000 0.084
#> SRR901164 2 0.0592 0.963 0.000 0.984 0.000 0.016
#> SRR901165 4 0.2662 0.961 0.016 0.000 0.084 0.900
#> SRR901166 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901167 1 0.1209 0.959 0.964 0.000 0.032 0.004
#> SRR901168 1 0.1209 0.959 0.964 0.000 0.032 0.004
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901170 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> SRR901171 2 0.0336 0.966 0.000 0.992 0.000 0.008
#> SRR901172 2 0.0336 0.966 0.000 0.992 0.000 0.008
#> SRR901173 4 0.2662 0.961 0.016 0.000 0.084 0.900
#> SRR901174 1 0.1209 0.959 0.964 0.000 0.032 0.004
#> SRR901175 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901176 4 0.5219 0.692 0.244 0.000 0.044 0.712
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901178 2 0.0000 0.967 0.000 1.000 0.000 0.000
#> SRR901179 2 0.1867 0.958 0.000 0.928 0.000 0.072
#> SRR901180 2 0.0336 0.966 0.000 0.992 0.000 0.008
#> SRR901181 4 0.2662 0.961 0.016 0.000 0.084 0.900
#> SRR901182 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901187 2 0.0000 0.967 0.000 1.000 0.000 0.000
#> SRR901186 2 0.2081 0.954 0.000 0.916 0.000 0.084
#> SRR901188 2 0.1940 0.957 0.000 0.924 0.000 0.076
#> SRR901189 4 0.2662 0.961 0.016 0.000 0.084 0.900
#> SRR901190 1 0.0188 0.991 0.996 0.000 0.000 0.004
#> SRR901191 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901194 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> SRR901195 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> SRR901196 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> SRR901197 4 0.2662 0.961 0.016 0.000 0.084 0.900
#> SRR901198 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901202 2 0.1792 0.959 0.000 0.932 0.000 0.068
#> SRR901203 2 0.2081 0.954 0.000 0.916 0.000 0.084
#> SRR901204 2 0.2081 0.954 0.000 0.916 0.000 0.084
#> SRR901205 4 0.2796 0.954 0.016 0.000 0.092 0.892
#> SRR901206 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901211 2 0.1940 0.957 0.000 0.924 0.000 0.076
#> SRR901210 2 0.1940 0.957 0.000 0.924 0.000 0.076
#> SRR901212 2 0.0592 0.967 0.000 0.984 0.000 0.016
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901214 2 0.0592 0.963 0.000 0.984 0.000 0.016
#> SRR901215 2 0.0592 0.963 0.000 0.984 0.000 0.016
#> SRR901216 2 0.0592 0.963 0.000 0.984 0.000 0.016
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901218 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> SRR901219 2 0.0000 0.967 0.000 1.000 0.000 0.000
#> SRR901220 2 0.0469 0.967 0.000 0.988 0.000 0.012
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901222 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> SRR901223 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> SRR901224 2 0.0804 0.960 0.000 0.980 0.008 0.012
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901226 2 0.2011 0.955 0.000 0.920 0.000 0.080
#> SRR901227 2 0.1940 0.957 0.000 0.924 0.000 0.076
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> SRR901228 2 0.1940 0.957 0.000 0.924 0.000 0.076
#> SRR901230 2 0.1474 0.962 0.000 0.948 0.000 0.052
#> SRR901231 2 0.0000 0.967 0.000 1.000 0.000 0.000
#> SRR901232 2 0.2081 0.954 0.000 0.916 0.000 0.084
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0000 0.928 0.000 0.000 0 0.000 1.000
#> SRR901150 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901151 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901152 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901154 2 0.0162 0.749 0.000 0.996 0 0.004 0.000
#> SRR901155 2 0.0000 0.750 0.000 1.000 0 0.000 0.000
#> SRR901156 2 0.0000 0.750 0.000 1.000 0 0.000 0.000
#> SRR901157 5 0.0000 0.928 0.000 0.000 0 0.000 1.000
#> SRR901158 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901159 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901160 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901162 4 0.4171 0.921 0.000 0.396 0 0.604 0.000
#> SRR901163 4 0.4294 0.838 0.000 0.468 0 0.532 0.000
#> SRR901164 2 0.3966 0.402 0.000 0.664 0 0.336 0.000
#> SRR901165 5 0.0000 0.928 0.000 0.000 0 0.000 1.000
#> SRR901166 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901167 1 0.1894 0.927 0.920 0.000 0 0.072 0.008
#> SRR901168 1 0.1894 0.927 0.920 0.000 0 0.072 0.008
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901170 2 0.0510 0.744 0.000 0.984 0 0.016 0.000
#> SRR901171 2 0.1121 0.729 0.000 0.956 0 0.044 0.000
#> SRR901172 2 0.1121 0.729 0.000 0.956 0 0.044 0.000
#> SRR901173 5 0.0000 0.928 0.000 0.000 0 0.000 1.000
#> SRR901174 1 0.1830 0.930 0.924 0.000 0 0.068 0.008
#> SRR901175 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901176 5 0.5673 0.164 0.420 0.000 0 0.080 0.500
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901178 2 0.0963 0.728 0.000 0.964 0 0.036 0.000
#> SRR901179 2 0.0162 0.749 0.000 0.996 0 0.004 0.000
#> SRR901180 2 0.1792 0.696 0.000 0.916 0 0.084 0.000
#> SRR901181 5 0.0000 0.928 0.000 0.000 0 0.000 1.000
#> SRR901182 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901183 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901184 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901187 2 0.0000 0.750 0.000 1.000 0 0.000 0.000
#> SRR901186 2 0.2891 0.540 0.000 0.824 0 0.176 0.000
#> SRR901188 2 0.1270 0.713 0.000 0.948 0 0.052 0.000
#> SRR901189 5 0.0000 0.928 0.000 0.000 0 0.000 1.000
#> SRR901190 1 0.0579 0.978 0.984 0.000 0 0.008 0.008
#> SRR901191 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901192 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901194 2 0.0000 0.750 0.000 1.000 0 0.000 0.000
#> SRR901195 2 0.0000 0.750 0.000 1.000 0 0.000 0.000
#> SRR901196 2 0.1965 0.684 0.000 0.904 0 0.096 0.000
#> SRR901197 5 0.0000 0.928 0.000 0.000 0 0.000 1.000
#> SRR901198 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901199 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901200 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901202 2 0.0162 0.749 0.000 0.996 0 0.004 0.000
#> SRR901203 2 0.2852 0.547 0.000 0.828 0 0.172 0.000
#> SRR901204 2 0.2852 0.547 0.000 0.828 0 0.172 0.000
#> SRR901205 5 0.0000 0.928 0.000 0.000 0 0.000 1.000
#> SRR901206 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901207 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901208 1 0.0000 0.989 1.000 0.000 0 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901211 2 0.1270 0.713 0.000 0.948 0 0.052 0.000
#> SRR901210 2 0.0404 0.746 0.000 0.988 0 0.012 0.000
#> SRR901212 2 0.0000 0.750 0.000 1.000 0 0.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901214 2 0.4114 0.364 0.000 0.624 0 0.376 0.000
#> SRR901215 2 0.4114 0.364 0.000 0.624 0 0.376 0.000
#> SRR901216 2 0.4114 0.364 0.000 0.624 0 0.376 0.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901218 2 0.0290 0.748 0.000 0.992 0 0.008 0.000
#> SRR901219 2 0.1270 0.715 0.000 0.948 0 0.052 0.000
#> SRR901220 2 0.0290 0.748 0.000 0.992 0 0.008 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901222 2 0.0000 0.750 0.000 1.000 0 0.000 0.000
#> SRR901223 2 0.0609 0.744 0.000 0.980 0 0.020 0.000
#> SRR901224 2 0.4251 0.355 0.000 0.624 0 0.372 0.004
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901226 2 0.4302 -0.761 0.000 0.520 0 0.480 0.000
#> SRR901227 2 0.4302 -0.761 0.000 0.520 0 0.480 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0.000
#> SRR901228 2 0.4302 -0.761 0.000 0.520 0 0.480 0.000
#> SRR901230 2 0.4291 -0.724 0.000 0.536 0 0.464 0.000
#> SRR901231 2 0.1270 0.715 0.000 0.948 0 0.052 0.000
#> SRR901232 4 0.4182 0.924 0.000 0.400 0 0.600 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 0.99892 0.000 0.000 0 0.000 1.000 0.000
#> SRR901150 1 0.1444 0.91951 0.928 0.000 0 0.000 0.000 0.072
#> SRR901151 1 0.0363 0.94804 0.988 0.000 0 0.000 0.000 0.012
#> SRR901152 1 0.1444 0.91951 0.928 0.000 0 0.000 0.000 0.072
#> SRR1382100 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901154 2 0.3695 0.40877 0.000 0.624 0 0.376 0.000 0.000
#> SRR901155 2 0.3695 0.40877 0.000 0.624 0 0.376 0.000 0.000
#> SRR901156 2 0.3684 0.41516 0.000 0.628 0 0.372 0.000 0.000
#> SRR901157 5 0.0000 0.99892 0.000 0.000 0 0.000 1.000 0.000
#> SRR901158 1 0.0000 0.94997 1.000 0.000 0 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.94997 1.000 0.000 0 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.94997 1.000 0.000 0 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901162 6 0.3866 0.41845 0.000 0.000 0 0.484 0.000 0.516
#> SRR901163 6 0.5470 0.41334 0.000 0.136 0 0.348 0.000 0.516
#> SRR901164 2 0.0363 0.65466 0.000 0.988 0 0.012 0.000 0.000
#> SRR901165 5 0.0000 0.99892 0.000 0.000 0 0.000 1.000 0.000
#> SRR901166 1 0.0146 0.94965 0.996 0.000 0 0.000 0.000 0.004
#> SRR901167 1 0.3672 0.71809 0.688 0.008 0 0.000 0.000 0.304
#> SRR901168 1 0.3349 0.77976 0.748 0.008 0 0.000 0.000 0.244
#> SRR901169 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901170 2 0.1814 0.66432 0.000 0.900 0 0.100 0.000 0.000
#> SRR901171 2 0.1327 0.67786 0.000 0.936 0 0.064 0.000 0.000
#> SRR901172 2 0.1267 0.67680 0.000 0.940 0 0.060 0.000 0.000
#> SRR901173 5 0.0000 0.99892 0.000 0.000 0 0.000 1.000 0.000
#> SRR901174 1 0.3690 0.71360 0.684 0.008 0 0.000 0.000 0.308
#> SRR901175 1 0.0632 0.94371 0.976 0.000 0 0.000 0.000 0.024
#> SRR901176 6 0.5540 -0.42292 0.104 0.008 0 0.000 0.412 0.476
#> SRR901177 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901178 4 0.3426 0.61121 0.000 0.276 0 0.720 0.000 0.004
#> SRR901179 2 0.3647 0.43894 0.000 0.640 0 0.360 0.000 0.000
#> SRR901180 2 0.1327 0.67786 0.000 0.936 0 0.064 0.000 0.000
#> SRR901181 5 0.0000 0.99892 0.000 0.000 0 0.000 1.000 0.000
#> SRR901182 1 0.0000 0.94997 1.000 0.000 0 0.000 0.000 0.000
#> SRR901183 1 0.0260 0.94849 0.992 0.000 0 0.000 0.000 0.008
#> SRR901184 1 0.0260 0.94849 0.992 0.000 0 0.000 0.000 0.008
#> SRR901185 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901187 2 0.3578 0.46487 0.000 0.660 0 0.340 0.000 0.000
#> SRR901186 4 0.5673 0.00741 0.000 0.396 0 0.448 0.000 0.156
#> SRR901188 4 0.3405 0.61356 0.000 0.272 0 0.724 0.000 0.004
#> SRR901189 5 0.0000 0.99892 0.000 0.000 0 0.000 1.000 0.000
#> SRR901190 1 0.2300 0.87104 0.856 0.000 0 0.000 0.000 0.144
#> SRR901191 1 0.0000 0.94997 1.000 0.000 0 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.94997 1.000 0.000 0 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901194 2 0.3684 0.41516 0.000 0.628 0 0.372 0.000 0.000
#> SRR901195 4 0.3867 0.12216 0.000 0.488 0 0.512 0.000 0.000
#> SRR901196 2 0.1327 0.67786 0.000 0.936 0 0.064 0.000 0.000
#> SRR901197 5 0.0000 0.99892 0.000 0.000 0 0.000 1.000 0.000
#> SRR901198 1 0.0000 0.94997 1.000 0.000 0 0.000 0.000 0.000
#> SRR901199 1 0.0260 0.94899 0.992 0.000 0 0.000 0.000 0.008
#> SRR901200 1 0.0363 0.94804 0.988 0.000 0 0.000 0.000 0.012
#> SRR901201 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901202 2 0.3695 0.40877 0.000 0.624 0 0.376 0.000 0.000
#> SRR901203 4 0.4954 0.35969 0.000 0.232 0 0.640 0.000 0.128
#> SRR901204 4 0.5519 0.45922 0.000 0.332 0 0.520 0.000 0.148
#> SRR901205 5 0.0260 0.99241 0.000 0.000 0 0.000 0.992 0.008
#> SRR901206 1 0.0260 0.94849 0.992 0.000 0 0.000 0.000 0.008
#> SRR901207 1 0.0000 0.94997 1.000 0.000 0 0.000 0.000 0.000
#> SRR901208 1 0.0260 0.94849 0.992 0.000 0 0.000 0.000 0.008
#> SRR901209 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901211 4 0.3490 0.61729 0.000 0.268 0 0.724 0.000 0.008
#> SRR901210 4 0.3727 0.42821 0.000 0.388 0 0.612 0.000 0.000
#> SRR901212 2 0.3634 0.44394 0.000 0.644 0 0.356 0.000 0.000
#> SRR901213 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901214 2 0.0000 0.64878 0.000 1.000 0 0.000 0.000 0.000
#> SRR901215 2 0.0000 0.64878 0.000 1.000 0 0.000 0.000 0.000
#> SRR901216 2 0.0000 0.64878 0.000 1.000 0 0.000 0.000 0.000
#> SRR901217 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901218 4 0.2527 0.61476 0.000 0.168 0 0.832 0.000 0.000
#> SRR901219 4 0.2527 0.61476 0.000 0.168 0 0.832 0.000 0.000
#> SRR901220 4 0.2793 0.62681 0.000 0.200 0 0.800 0.000 0.000
#> SRR901221 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901222 4 0.3817 0.32972 0.000 0.432 0 0.568 0.000 0.000
#> SRR901223 4 0.2902 0.62335 0.000 0.196 0 0.800 0.000 0.004
#> SRR901224 2 0.1049 0.63448 0.000 0.960 0 0.008 0.000 0.032
#> SRR901225 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901226 4 0.5658 -0.09378 0.000 0.156 0 0.464 0.000 0.380
#> SRR901227 6 0.5634 0.28593 0.000 0.164 0 0.336 0.000 0.500
#> SRR901229 3 0.0000 1.00000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901228 4 0.5666 0.08222 0.000 0.164 0 0.484 0.000 0.352
#> SRR901230 4 0.5549 0.18804 0.000 0.164 0 0.532 0.000 0.304
#> SRR901231 4 0.2527 0.61476 0.000 0.168 0 0.832 0.000 0.000
#> SRR901232 6 0.5457 0.41600 0.000 0.132 0 0.356 0.000 0.512
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "NMF"]
# you can also extract it by
# res = res_list["CV:NMF"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.946 0.936 0.971 0.4259 0.587 0.587
#> 3 3 1.000 0.965 0.984 0.5177 0.703 0.519
#> 4 4 0.917 0.941 0.943 0.0715 0.961 0.891
#> 5 5 0.835 0.664 0.858 0.0937 0.989 0.966
#> 6 6 0.819 0.688 0.826 0.0625 0.841 0.502
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0000 0.980 0.000 1.000
#> SRR901150 1 0.0000 0.966 1.000 0.000
#> SRR901151 1 0.0000 0.966 1.000 0.000
#> SRR901152 1 0.0000 0.966 1.000 0.000
#> SRR1382100 2 0.0000 0.980 0.000 1.000
#> SRR901154 1 0.0000 0.966 1.000 0.000
#> SRR901155 1 0.0000 0.966 1.000 0.000
#> SRR901156 1 0.0000 0.966 1.000 0.000
#> SRR901157 2 0.0000 0.980 0.000 1.000
#> SRR901158 1 0.0000 0.966 1.000 0.000
#> SRR901159 1 0.0000 0.966 1.000 0.000
#> SRR901160 1 0.0000 0.966 1.000 0.000
#> SRR901161 2 0.0000 0.980 0.000 1.000
#> SRR901162 1 0.1633 0.952 0.976 0.024
#> SRR901163 1 0.2603 0.937 0.956 0.044
#> SRR901164 1 0.7139 0.767 0.804 0.196
#> SRR901165 2 0.0000 0.980 0.000 1.000
#> SRR901166 1 0.0000 0.966 1.000 0.000
#> SRR901167 1 0.0000 0.966 1.000 0.000
#> SRR901168 1 0.0000 0.966 1.000 0.000
#> SRR901169 2 0.0000 0.980 0.000 1.000
#> SRR901170 1 0.9881 0.271 0.564 0.436
#> SRR901171 1 0.9661 0.395 0.608 0.392
#> SRR901172 2 0.7745 0.695 0.228 0.772
#> SRR901173 2 0.0000 0.980 0.000 1.000
#> SRR901174 1 0.0000 0.966 1.000 0.000
#> SRR901175 1 0.0000 0.966 1.000 0.000
#> SRR901176 1 0.0000 0.966 1.000 0.000
#> SRR901177 2 0.0000 0.980 0.000 1.000
#> SRR901178 1 0.0672 0.962 0.992 0.008
#> SRR901179 1 0.0000 0.966 1.000 0.000
#> SRR901180 1 0.0938 0.959 0.988 0.012
#> SRR901181 2 0.0000 0.980 0.000 1.000
#> SRR901182 1 0.0000 0.966 1.000 0.000
#> SRR901183 1 0.0000 0.966 1.000 0.000
#> SRR901184 1 0.0000 0.966 1.000 0.000
#> SRR901185 2 0.0000 0.980 0.000 1.000
#> SRR901187 1 0.4022 0.903 0.920 0.080
#> SRR901186 1 0.4562 0.887 0.904 0.096
#> SRR901188 1 0.0000 0.966 1.000 0.000
#> SRR901189 2 0.0000 0.980 0.000 1.000
#> SRR901190 1 0.0000 0.966 1.000 0.000
#> SRR901191 1 0.0000 0.966 1.000 0.000
#> SRR901192 1 0.0000 0.966 1.000 0.000
#> SRR901193 2 0.0000 0.980 0.000 1.000
#> SRR901194 1 0.0000 0.966 1.000 0.000
#> SRR901195 1 0.0000 0.966 1.000 0.000
#> SRR901196 1 0.4161 0.901 0.916 0.084
#> SRR901197 2 0.0000 0.980 0.000 1.000
#> SRR901198 1 0.0000 0.966 1.000 0.000
#> SRR901199 1 0.0000 0.966 1.000 0.000
#> SRR901200 1 0.0000 0.966 1.000 0.000
#> SRR901201 2 0.0000 0.980 0.000 1.000
#> SRR901202 1 0.0000 0.966 1.000 0.000
#> SRR901203 1 0.0000 0.966 1.000 0.000
#> SRR901204 1 0.2236 0.943 0.964 0.036
#> SRR901205 2 0.0000 0.980 0.000 1.000
#> SRR901206 1 0.0000 0.966 1.000 0.000
#> SRR901207 1 0.0000 0.966 1.000 0.000
#> SRR901208 1 0.0000 0.966 1.000 0.000
#> SRR901209 2 0.0000 0.980 0.000 1.000
#> SRR901211 1 0.0000 0.966 1.000 0.000
#> SRR901210 1 0.0000 0.966 1.000 0.000
#> SRR901212 1 0.4161 0.904 0.916 0.084
#> SRR901213 2 0.0000 0.980 0.000 1.000
#> SRR901214 2 0.0672 0.973 0.008 0.992
#> SRR901215 1 0.8909 0.584 0.692 0.308
#> SRR901216 2 0.7139 0.746 0.196 0.804
#> SRR901217 2 0.0000 0.980 0.000 1.000
#> SRR901218 1 0.0000 0.966 1.000 0.000
#> SRR901219 1 0.0000 0.966 1.000 0.000
#> SRR901220 1 0.0000 0.966 1.000 0.000
#> SRR901221 2 0.0000 0.980 0.000 1.000
#> SRR901222 1 0.0000 0.966 1.000 0.000
#> SRR901223 1 0.0000 0.966 1.000 0.000
#> SRR901224 1 0.0000 0.966 1.000 0.000
#> SRR901225 2 0.0000 0.980 0.000 1.000
#> SRR901226 1 0.4939 0.877 0.892 0.108
#> SRR901227 1 0.0000 0.966 1.000 0.000
#> SRR901229 2 0.0000 0.980 0.000 1.000
#> SRR901228 1 0.0000 0.966 1.000 0.000
#> SRR901230 1 0.0938 0.960 0.988 0.012
#> SRR901231 1 0.1633 0.952 0.976 0.024
#> SRR901232 1 0.1414 0.955 0.980 0.020
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.5760 0.569 0.328 0.000 0.672
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000
#> SRR1382100 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901154 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901155 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901156 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901157 3 0.3816 0.815 0.148 0.000 0.852
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901161 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901162 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901163 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901164 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901165 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901169 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901170 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901171 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901172 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901173 3 0.6267 0.273 0.452 0.000 0.548
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901176 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901177 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901178 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901179 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901180 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901181 3 0.0747 0.927 0.016 0.000 0.984
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901185 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901187 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901186 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901188 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901189 3 0.1031 0.922 0.024 0.000 0.976
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901193 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901194 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901195 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901196 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901197 3 0.5529 0.624 0.296 0.000 0.704
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901201 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901202 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901203 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901204 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901205 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901209 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901211 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901210 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901212 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901213 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901214 2 0.2165 0.932 0.000 0.936 0.064
#> SRR901215 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901216 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901217 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901218 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901219 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901220 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901221 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901222 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901223 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901224 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901225 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901226 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901227 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901229 3 0.0000 0.936 0.000 0.000 1.000
#> SRR901228 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901230 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901231 2 0.0000 0.998 0.000 1.000 0.000
#> SRR901232 2 0.0000 0.998 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.4617 0.917 0.032 0.000 0.204 0.764
#> SRR901150 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.0188 0.990 0.000 0.000 0.996 0.004
#> SRR901154 2 0.0804 0.949 0.012 0.980 0.000 0.008
#> SRR901155 2 0.0000 0.954 0.000 1.000 0.000 0.000
#> SRR901156 2 0.0000 0.954 0.000 1.000 0.000 0.000
#> SRR901157 4 0.4194 0.923 0.008 0.000 0.228 0.764
#> SRR901158 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901161 3 0.0188 0.990 0.000 0.000 0.996 0.004
#> SRR901162 2 0.4756 0.805 0.020 0.744 0.004 0.232
#> SRR901163 2 0.3257 0.893 0.000 0.844 0.004 0.152
#> SRR901164 2 0.0188 0.953 0.000 0.996 0.000 0.004
#> SRR901165 4 0.3942 0.920 0.000 0.000 0.236 0.764
#> SRR901166 1 0.0592 0.965 0.984 0.000 0.000 0.016
#> SRR901167 1 0.2868 0.849 0.864 0.000 0.000 0.136
#> SRR901168 1 0.2081 0.906 0.916 0.000 0.000 0.084
#> SRR901169 3 0.0188 0.990 0.000 0.000 0.996 0.004
#> SRR901170 2 0.0188 0.953 0.000 0.996 0.000 0.004
#> SRR901171 2 0.0188 0.953 0.000 0.996 0.000 0.004
#> SRR901172 2 0.0188 0.953 0.000 0.996 0.000 0.004
#> SRR901173 4 0.4669 0.912 0.036 0.000 0.200 0.764
#> SRR901174 1 0.4072 0.682 0.748 0.000 0.000 0.252
#> SRR901175 1 0.0336 0.971 0.992 0.000 0.000 0.008
#> SRR901176 4 0.5051 0.686 0.100 0.132 0.000 0.768
#> SRR901177 3 0.0188 0.990 0.000 0.000 0.996 0.004
#> SRR901178 2 0.0188 0.954 0.000 0.996 0.000 0.004
#> SRR901179 2 0.0000 0.954 0.000 1.000 0.000 0.000
#> SRR901180 2 0.0188 0.953 0.000 0.996 0.000 0.004
#> SRR901181 4 0.3942 0.920 0.000 0.000 0.236 0.764
#> SRR901182 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.989 0.000 0.000 1.000 0.000
#> SRR901187 2 0.0000 0.954 0.000 1.000 0.000 0.000
#> SRR901186 2 0.4139 0.828 0.024 0.800 0.000 0.176
#> SRR901188 2 0.0707 0.952 0.000 0.980 0.000 0.020
#> SRR901189 4 0.3942 0.920 0.000 0.000 0.236 0.764
#> SRR901190 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901193 3 0.0188 0.990 0.000 0.000 0.996 0.004
#> SRR901194 2 0.0000 0.954 0.000 1.000 0.000 0.000
#> SRR901195 2 0.0000 0.954 0.000 1.000 0.000 0.000
#> SRR901196 2 0.0188 0.953 0.000 0.996 0.000 0.004
#> SRR901197 4 0.4562 0.920 0.028 0.000 0.208 0.764
#> SRR901198 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901201 3 0.0188 0.990 0.000 0.000 0.996 0.004
#> SRR901202 2 0.0188 0.954 0.000 0.996 0.000 0.004
#> SRR901203 2 0.4035 0.832 0.020 0.804 0.000 0.176
#> SRR901204 2 0.3448 0.850 0.000 0.828 0.004 0.168
#> SRR901205 4 0.4103 0.871 0.000 0.000 0.256 0.744
#> SRR901206 1 0.0188 0.974 0.996 0.000 0.000 0.004
#> SRR901207 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> SRR901209 3 0.1716 0.911 0.000 0.000 0.936 0.064
#> SRR901211 2 0.2281 0.906 0.000 0.904 0.000 0.096
#> SRR901210 2 0.2011 0.917 0.000 0.920 0.000 0.080
#> SRR901212 2 0.0000 0.954 0.000 1.000 0.000 0.000
#> SRR901213 3 0.0000 0.989 0.000 0.000 1.000 0.000
#> SRR901214 2 0.1302 0.946 0.000 0.956 0.000 0.044
#> SRR901215 2 0.0469 0.954 0.000 0.988 0.000 0.012
#> SRR901216 2 0.0592 0.953 0.000 0.984 0.000 0.016
#> SRR901217 3 0.0000 0.989 0.000 0.000 1.000 0.000
#> SRR901218 2 0.1867 0.936 0.000 0.928 0.000 0.072
#> SRR901219 2 0.1867 0.936 0.000 0.928 0.000 0.072
#> SRR901220 2 0.1867 0.936 0.000 0.928 0.000 0.072
#> SRR901221 3 0.0188 0.990 0.000 0.000 0.996 0.004
#> SRR901222 2 0.0188 0.954 0.000 0.996 0.000 0.004
#> SRR901223 2 0.0592 0.952 0.000 0.984 0.000 0.016
#> SRR901224 2 0.0336 0.953 0.000 0.992 0.000 0.008
#> SRR901225 3 0.0000 0.989 0.000 0.000 1.000 0.000
#> SRR901226 2 0.2053 0.934 0.000 0.924 0.004 0.072
#> SRR901227 2 0.3329 0.904 0.044 0.880 0.004 0.072
#> SRR901229 3 0.0000 0.989 0.000 0.000 1.000 0.000
#> SRR901228 2 0.2238 0.933 0.004 0.920 0.004 0.072
#> SRR901230 2 0.2053 0.934 0.000 0.924 0.004 0.072
#> SRR901231 2 0.1867 0.936 0.000 0.928 0.000 0.072
#> SRR901232 2 0.2125 0.933 0.000 0.920 0.004 0.076
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0510 0.9716 0.000 0.000 0.016 0.000 0.984
#> SRR901150 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901154 2 0.0794 0.5762 0.000 0.972 0.000 0.028 0.000
#> SRR901155 2 0.0290 0.5824 0.000 0.992 0.000 0.008 0.000
#> SRR901156 2 0.0451 0.5824 0.000 0.988 0.000 0.008 0.004
#> SRR901157 5 0.0510 0.9716 0.000 0.000 0.016 0.000 0.984
#> SRR901158 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901162 4 0.3807 0.0000 0.000 0.240 0.000 0.748 0.012
#> SRR901163 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
#> SRR901164 2 0.3366 0.4142 0.000 0.784 0.000 0.212 0.004
#> SRR901165 5 0.0510 0.9716 0.000 0.000 0.016 0.000 0.984
#> SRR901166 1 0.0794 0.9339 0.972 0.000 0.000 0.028 0.000
#> SRR901167 1 0.6151 0.5059 0.604 0.012 0.000 0.208 0.176
#> SRR901168 1 0.3242 0.7957 0.816 0.000 0.000 0.172 0.012
#> SRR901169 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901170 2 0.1282 0.5701 0.000 0.952 0.000 0.044 0.004
#> SRR901171 2 0.2389 0.5203 0.000 0.880 0.000 0.116 0.004
#> SRR901172 2 0.0865 0.5789 0.000 0.972 0.000 0.024 0.004
#> SRR901173 5 0.0510 0.9716 0.000 0.000 0.016 0.000 0.984
#> SRR901174 1 0.6312 0.3211 0.524 0.000 0.000 0.200 0.276
#> SRR901175 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901176 5 0.4010 0.7559 0.000 0.032 0.000 0.208 0.760
#> SRR901177 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901178 2 0.2074 0.5395 0.000 0.896 0.000 0.104 0.000
#> SRR901179 2 0.0324 0.5832 0.000 0.992 0.000 0.004 0.004
#> SRR901180 2 0.2286 0.5271 0.000 0.888 0.000 0.108 0.004
#> SRR901181 5 0.0510 0.9716 0.000 0.000 0.016 0.000 0.984
#> SRR901182 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901187 2 0.0404 0.5819 0.000 0.988 0.000 0.012 0.000
#> SRR901186 2 0.4470 0.0152 0.000 0.616 0.000 0.372 0.012
#> SRR901188 2 0.0963 0.5756 0.000 0.964 0.000 0.036 0.000
#> SRR901189 5 0.0510 0.9716 0.000 0.000 0.016 0.000 0.984
#> SRR901190 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901194 2 0.0162 0.5830 0.000 0.996 0.000 0.004 0.000
#> SRR901195 2 0.1041 0.5766 0.000 0.964 0.000 0.032 0.004
#> SRR901196 2 0.2439 0.5185 0.000 0.876 0.000 0.120 0.004
#> SRR901197 5 0.0510 0.9716 0.000 0.000 0.016 0.000 0.984
#> SRR901198 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901202 2 0.0609 0.5805 0.000 0.980 0.000 0.020 0.000
#> SRR901203 2 0.4470 0.0152 0.000 0.616 0.000 0.372 0.012
#> SRR901204 2 0.4457 0.0231 0.000 0.620 0.000 0.368 0.012
#> SRR901205 5 0.0609 0.9682 0.000 0.000 0.020 0.000 0.980
#> SRR901206 1 0.0162 0.9510 0.996 0.000 0.000 0.004 0.000
#> SRR901207 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.9537 1.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901211 2 0.2864 0.4602 0.000 0.852 0.000 0.136 0.012
#> SRR901210 2 0.2763 0.4413 0.000 0.848 0.000 0.148 0.004
#> SRR901212 2 0.0290 0.5827 0.000 0.992 0.000 0.008 0.000
#> SRR901213 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901214 2 0.4590 0.1584 0.000 0.568 0.000 0.420 0.012
#> SRR901215 2 0.4235 0.1745 0.000 0.576 0.000 0.424 0.000
#> SRR901216 2 0.4227 0.1778 0.000 0.580 0.000 0.420 0.000
#> SRR901217 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901218 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
#> SRR901219 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
#> SRR901220 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
#> SRR901221 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901222 2 0.2648 0.5022 0.000 0.848 0.000 0.152 0.000
#> SRR901223 2 0.4074 0.2555 0.000 0.636 0.000 0.364 0.000
#> SRR901224 2 0.4104 0.3914 0.000 0.748 0.000 0.220 0.032
#> SRR901225 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901226 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
#> SRR901227 2 0.5216 0.0319 0.044 0.520 0.000 0.436 0.000
#> SRR901229 3 0.0000 1.0000 0.000 0.000 1.000 0.000 0.000
#> SRR901228 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
#> SRR901230 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
#> SRR901231 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
#> SRR901232 2 0.4256 0.1641 0.000 0.564 0.000 0.436 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0146 0.9990 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR901150 1 0.0146 0.9583 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR901151 1 0.0146 0.9583 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR901152 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901154 2 0.5894 0.5149 0.000 0.472 0.000 0.244 0.000 0.284
#> SRR901155 2 0.6054 0.5274 0.000 0.412 0.000 0.304 0.000 0.284
#> SRR901156 2 0.5854 0.3153 0.000 0.416 0.000 0.192 0.000 0.392
#> SRR901157 5 0.0146 0.9990 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR901158 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901162 4 0.4132 0.6411 0.000 0.136 0.000 0.756 0.004 0.104
#> SRR901163 4 0.2149 0.7550 0.000 0.004 0.000 0.888 0.004 0.104
#> SRR901164 6 0.2822 0.2513 0.000 0.040 0.000 0.108 0.000 0.852
#> SRR901165 5 0.0146 0.9990 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR901166 1 0.2969 0.7441 0.776 0.000 0.000 0.000 0.000 0.224
#> SRR901167 6 0.4813 0.1585 0.248 0.000 0.000 0.000 0.104 0.648
#> SRR901168 1 0.4258 0.3362 0.516 0.000 0.000 0.000 0.016 0.468
#> SRR901169 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901170 6 0.5503 -0.1958 0.000 0.416 0.000 0.128 0.000 0.456
#> SRR901171 6 0.5347 -0.1360 0.000 0.412 0.000 0.108 0.000 0.480
#> SRR901172 6 0.5558 -0.2223 0.000 0.416 0.000 0.136 0.000 0.448
#> SRR901173 5 0.0146 0.9990 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR901174 6 0.5446 0.0369 0.256 0.000 0.000 0.000 0.176 0.568
#> SRR901175 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901176 6 0.3512 0.0881 0.000 0.008 0.000 0.000 0.272 0.720
#> SRR901177 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901178 4 0.5130 0.0670 0.000 0.252 0.000 0.612 0.000 0.136
#> SRR901179 2 0.5925 0.3795 0.000 0.416 0.000 0.212 0.000 0.372
#> SRR901180 6 0.5350 -0.1398 0.000 0.416 0.000 0.108 0.000 0.476
#> SRR901181 5 0.0146 0.9990 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR901182 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0146 0.9956 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR901187 2 0.6046 0.5292 0.000 0.416 0.000 0.304 0.000 0.280
#> SRR901186 2 0.0458 0.2611 0.000 0.984 0.000 0.000 0.000 0.016
#> SRR901188 4 0.4967 -0.3328 0.000 0.420 0.000 0.512 0.000 0.068
#> SRR901189 5 0.0146 0.9990 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR901190 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901194 2 0.6048 0.5289 0.000 0.416 0.000 0.296 0.000 0.288
#> SRR901195 6 0.5658 -0.2815 0.000 0.416 0.000 0.152 0.000 0.432
#> SRR901196 6 0.5350 -0.1398 0.000 0.416 0.000 0.108 0.000 0.476
#> SRR901197 5 0.0146 0.9990 0.000 0.000 0.004 0.000 0.996 0.000
#> SRR901198 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901202 2 0.6031 0.5324 0.000 0.424 0.000 0.296 0.000 0.280
#> SRR901203 2 0.2053 0.2737 0.000 0.888 0.000 0.000 0.004 0.108
#> SRR901204 2 0.2701 0.2816 0.000 0.864 0.000 0.028 0.004 0.104
#> SRR901205 5 0.0405 0.9929 0.000 0.008 0.004 0.000 0.988 0.000
#> SRR901206 1 0.1910 0.8724 0.892 0.108 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.9607 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901211 2 0.4318 0.4148 0.000 0.728 0.000 0.132 0.000 0.140
#> SRR901210 2 0.3674 0.3287 0.000 0.716 0.000 0.016 0.000 0.268
#> SRR901212 2 0.6048 0.5289 0.000 0.416 0.000 0.296 0.000 0.288
#> SRR901213 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901214 4 0.0146 0.8615 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR901215 4 0.0547 0.8537 0.000 0.000 0.000 0.980 0.000 0.020
#> SRR901216 4 0.0363 0.8581 0.000 0.000 0.000 0.988 0.000 0.012
#> SRR901217 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901218 4 0.0000 0.8636 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901219 4 0.0000 0.8636 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901220 4 0.0000 0.8636 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901221 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901222 4 0.4968 0.1421 0.000 0.248 0.000 0.632 0.000 0.120
#> SRR901223 4 0.1168 0.8260 0.000 0.016 0.000 0.956 0.000 0.028
#> SRR901224 6 0.2357 0.2612 0.000 0.012 0.000 0.116 0.000 0.872
#> SRR901225 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901226 4 0.0146 0.8612 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR901227 4 0.0000 0.8636 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901229 3 0.0000 0.9996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901228 4 0.0000 0.8636 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901230 4 0.0000 0.8636 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901231 4 0.0000 0.8636 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901232 4 0.0000 0.8636 0.000 0.000 0.000 1.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "hclust"]
# you can also extract it by
# res = res_list["MAD:hclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.542 0.808 0.874 0.4194 0.620 0.620
#> 3 3 0.872 0.960 0.975 0.5715 0.717 0.544
#> 4 4 1.000 0.997 0.994 0.1130 0.927 0.785
#> 5 5 1.000 0.987 0.995 0.0412 0.972 0.894
#> 6 6 1.000 0.962 0.985 0.0392 0.966 0.855
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 4 5
There is also optional best \(k\) = 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.000 1.000 0.000 1.000
#> SRR901150 1 0.000 0.794 1.000 0.000
#> SRR901151 1 0.000 0.794 1.000 0.000
#> SRR901152 1 0.000 0.794 1.000 0.000
#> SRR1382100 2 0.000 1.000 0.000 1.000
#> SRR901154 1 0.946 0.686 0.636 0.364
#> SRR901155 1 0.946 0.686 0.636 0.364
#> SRR901156 1 0.946 0.686 0.636 0.364
#> SRR901157 2 0.000 1.000 0.000 1.000
#> SRR901158 1 0.000 0.794 1.000 0.000
#> SRR901159 1 0.000 0.794 1.000 0.000
#> SRR901160 1 0.000 0.794 1.000 0.000
#> SRR901161 2 0.000 1.000 0.000 1.000
#> SRR901162 1 0.000 0.794 1.000 0.000
#> SRR901163 1 0.000 0.794 1.000 0.000
#> SRR901164 1 0.946 0.686 0.636 0.364
#> SRR901165 2 0.000 1.000 0.000 1.000
#> SRR901166 1 0.000 0.794 1.000 0.000
#> SRR901167 1 0.000 0.794 1.000 0.000
#> SRR901168 1 0.000 0.794 1.000 0.000
#> SRR901169 2 0.000 1.000 0.000 1.000
#> SRR901170 1 0.946 0.686 0.636 0.364
#> SRR901171 1 0.946 0.686 0.636 0.364
#> SRR901172 1 0.946 0.686 0.636 0.364
#> SRR901173 2 0.000 1.000 0.000 1.000
#> SRR901174 1 0.000 0.794 1.000 0.000
#> SRR901175 1 0.000 0.794 1.000 0.000
#> SRR901176 1 0.946 0.686 0.636 0.364
#> SRR901177 2 0.000 1.000 0.000 1.000
#> SRR901178 1 0.946 0.686 0.636 0.364
#> SRR901179 1 0.946 0.686 0.636 0.364
#> SRR901180 1 0.946 0.686 0.636 0.364
#> SRR901181 2 0.000 1.000 0.000 1.000
#> SRR901182 1 0.000 0.794 1.000 0.000
#> SRR901183 1 0.000 0.794 1.000 0.000
#> SRR901184 1 0.000 0.794 1.000 0.000
#> SRR901185 2 0.000 1.000 0.000 1.000
#> SRR901187 1 0.946 0.686 0.636 0.364
#> SRR901186 1 0.946 0.686 0.636 0.364
#> SRR901188 1 0.946 0.686 0.636 0.364
#> SRR901189 2 0.000 1.000 0.000 1.000
#> SRR901190 1 0.000 0.794 1.000 0.000
#> SRR901191 1 0.000 0.794 1.000 0.000
#> SRR901192 1 0.000 0.794 1.000 0.000
#> SRR901193 2 0.000 1.000 0.000 1.000
#> SRR901194 1 0.946 0.686 0.636 0.364
#> SRR901195 1 0.946 0.686 0.636 0.364
#> SRR901196 1 0.946 0.686 0.636 0.364
#> SRR901197 2 0.000 1.000 0.000 1.000
#> SRR901198 1 0.000 0.794 1.000 0.000
#> SRR901199 1 0.000 0.794 1.000 0.000
#> SRR901200 1 0.000 0.794 1.000 0.000
#> SRR901201 2 0.000 1.000 0.000 1.000
#> SRR901202 1 0.946 0.686 0.636 0.364
#> SRR901203 1 0.946 0.686 0.636 0.364
#> SRR901204 1 0.946 0.686 0.636 0.364
#> SRR901205 2 0.000 1.000 0.000 1.000
#> SRR901206 1 0.000 0.794 1.000 0.000
#> SRR901207 1 0.000 0.794 1.000 0.000
#> SRR901208 1 0.000 0.794 1.000 0.000
#> SRR901209 2 0.000 1.000 0.000 1.000
#> SRR901211 1 0.946 0.686 0.636 0.364
#> SRR901210 1 0.946 0.686 0.636 0.364
#> SRR901212 1 0.946 0.686 0.636 0.364
#> SRR901213 2 0.000 1.000 0.000 1.000
#> SRR901214 1 0.946 0.686 0.636 0.364
#> SRR901215 1 0.946 0.686 0.636 0.364
#> SRR901216 1 0.946 0.686 0.636 0.364
#> SRR901217 2 0.000 1.000 0.000 1.000
#> SRR901218 1 0.000 0.794 1.000 0.000
#> SRR901219 1 0.000 0.794 1.000 0.000
#> SRR901220 1 0.000 0.794 1.000 0.000
#> SRR901221 2 0.000 1.000 0.000 1.000
#> SRR901222 1 0.946 0.686 0.636 0.364
#> SRR901223 1 0.946 0.686 0.636 0.364
#> SRR901224 1 0.946 0.686 0.636 0.364
#> SRR901225 2 0.000 1.000 0.000 1.000
#> SRR901226 1 0.000 0.794 1.000 0.000
#> SRR901227 1 0.000 0.794 1.000 0.000
#> SRR901229 2 0.000 1.000 0.000 1.000
#> SRR901228 1 0.000 0.794 1.000 0.000
#> SRR901230 1 0.000 0.794 1.000 0.000
#> SRR901231 1 0.000 0.794 1.000 0.000
#> SRR901232 1 0.000 0.794 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.000 1.000 0.000 0.000 1
#> SRR901150 1 0.000 0.930 1.000 0.000 0
#> SRR901151 1 0.000 0.930 1.000 0.000 0
#> SRR901152 1 0.000 0.930 1.000 0.000 0
#> SRR1382100 3 0.000 1.000 0.000 0.000 1
#> SRR901154 2 0.000 1.000 0.000 1.000 0
#> SRR901155 2 0.000 1.000 0.000 1.000 0
#> SRR901156 2 0.000 1.000 0.000 1.000 0
#> SRR901157 3 0.000 1.000 0.000 0.000 1
#> SRR901158 1 0.000 0.930 1.000 0.000 0
#> SRR901159 1 0.000 0.930 1.000 0.000 0
#> SRR901160 1 0.000 0.930 1.000 0.000 0
#> SRR901161 3 0.000 1.000 0.000 0.000 1
#> SRR901162 1 0.440 0.838 0.812 0.188 0
#> SRR901163 1 0.440 0.838 0.812 0.188 0
#> SRR901164 2 0.000 1.000 0.000 1.000 0
#> SRR901165 3 0.000 1.000 0.000 0.000 1
#> SRR901166 1 0.000 0.930 1.000 0.000 0
#> SRR901167 1 0.000 0.930 1.000 0.000 0
#> SRR901168 1 0.000 0.930 1.000 0.000 0
#> SRR901169 3 0.000 1.000 0.000 0.000 1
#> SRR901170 2 0.000 1.000 0.000 1.000 0
#> SRR901171 2 0.000 1.000 0.000 1.000 0
#> SRR901172 2 0.000 1.000 0.000 1.000 0
#> SRR901173 3 0.000 1.000 0.000 0.000 1
#> SRR901174 1 0.000 0.930 1.000 0.000 0
#> SRR901175 1 0.000 0.930 1.000 0.000 0
#> SRR901176 2 0.000 1.000 0.000 1.000 0
#> SRR901177 3 0.000 1.000 0.000 0.000 1
#> SRR901178 2 0.000 1.000 0.000 1.000 0
#> SRR901179 2 0.000 1.000 0.000 1.000 0
#> SRR901180 2 0.000 1.000 0.000 1.000 0
#> SRR901181 3 0.000 1.000 0.000 0.000 1
#> SRR901182 1 0.000 0.930 1.000 0.000 0
#> SRR901183 1 0.000 0.930 1.000 0.000 0
#> SRR901184 1 0.000 0.930 1.000 0.000 0
#> SRR901185 3 0.000 1.000 0.000 0.000 1
#> SRR901187 2 0.000 1.000 0.000 1.000 0
#> SRR901186 2 0.000 1.000 0.000 1.000 0
#> SRR901188 2 0.000 1.000 0.000 1.000 0
#> SRR901189 3 0.000 1.000 0.000 0.000 1
#> SRR901190 1 0.000 0.930 1.000 0.000 0
#> SRR901191 1 0.000 0.930 1.000 0.000 0
#> SRR901192 1 0.000 0.930 1.000 0.000 0
#> SRR901193 3 0.000 1.000 0.000 0.000 1
#> SRR901194 2 0.000 1.000 0.000 1.000 0
#> SRR901195 2 0.000 1.000 0.000 1.000 0
#> SRR901196 2 0.000 1.000 0.000 1.000 0
#> SRR901197 3 0.000 1.000 0.000 0.000 1
#> SRR901198 1 0.000 0.930 1.000 0.000 0
#> SRR901199 1 0.000 0.930 1.000 0.000 0
#> SRR901200 1 0.000 0.930 1.000 0.000 0
#> SRR901201 3 0.000 1.000 0.000 0.000 1
#> SRR901202 2 0.000 1.000 0.000 1.000 0
#> SRR901203 2 0.000 1.000 0.000 1.000 0
#> SRR901204 2 0.000 1.000 0.000 1.000 0
#> SRR901205 3 0.000 1.000 0.000 0.000 1
#> SRR901206 1 0.000 0.930 1.000 0.000 0
#> SRR901207 1 0.000 0.930 1.000 0.000 0
#> SRR901208 1 0.000 0.930 1.000 0.000 0
#> SRR901209 3 0.000 1.000 0.000 0.000 1
#> SRR901211 2 0.000 1.000 0.000 1.000 0
#> SRR901210 2 0.000 1.000 0.000 1.000 0
#> SRR901212 2 0.000 1.000 0.000 1.000 0
#> SRR901213 3 0.000 1.000 0.000 0.000 1
#> SRR901214 2 0.000 1.000 0.000 1.000 0
#> SRR901215 2 0.000 1.000 0.000 1.000 0
#> SRR901216 2 0.000 1.000 0.000 1.000 0
#> SRR901217 3 0.000 1.000 0.000 0.000 1
#> SRR901218 1 0.445 0.834 0.808 0.192 0
#> SRR901219 1 0.445 0.834 0.808 0.192 0
#> SRR901220 1 0.445 0.834 0.808 0.192 0
#> SRR901221 3 0.000 1.000 0.000 0.000 1
#> SRR901222 2 0.000 1.000 0.000 1.000 0
#> SRR901223 2 0.000 1.000 0.000 1.000 0
#> SRR901224 2 0.000 1.000 0.000 1.000 0
#> SRR901225 3 0.000 1.000 0.000 0.000 1
#> SRR901226 1 0.440 0.838 0.812 0.188 0
#> SRR901227 1 0.440 0.838 0.812 0.188 0
#> SRR901229 3 0.000 1.000 0.000 0.000 1
#> SRR901228 1 0.440 0.838 0.812 0.188 0
#> SRR901230 1 0.440 0.838 0.812 0.188 0
#> SRR901231 1 0.440 0.838 0.812 0.188 0
#> SRR901232 1 0.440 0.838 0.812 0.188 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0817 0.987 0 0.000 0.976 0.024
#> SRR901150 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901154 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901155 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901156 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901157 3 0.0817 0.987 0 0.000 0.976 0.024
#> SRR901158 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901162 4 0.0817 0.997 0 0.024 0.000 0.976
#> SRR901163 4 0.0817 0.997 0 0.024 0.000 0.976
#> SRR901164 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901165 3 0.0817 0.987 0 0.000 0.976 0.024
#> SRR901166 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901169 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901170 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901171 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901172 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901173 3 0.0817 0.987 0 0.000 0.976 0.024
#> SRR901174 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901176 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901177 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901178 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901179 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901180 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901181 3 0.0817 0.987 0 0.000 0.976 0.024
#> SRR901182 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901187 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901186 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901188 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901189 3 0.0817 0.987 0 0.000 0.976 0.024
#> SRR901190 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901194 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901195 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901196 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901197 3 0.0817 0.987 0 0.000 0.976 0.024
#> SRR901198 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901202 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901203 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901204 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901205 3 0.0817 0.987 0 0.000 0.976 0.024
#> SRR901206 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1 0.000 0.000 0.000
#> SRR901209 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901211 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901210 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901212 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901213 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901214 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901215 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901216 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901217 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901218 4 0.1022 0.993 0 0.032 0.000 0.968
#> SRR901219 4 0.1022 0.993 0 0.032 0.000 0.968
#> SRR901220 4 0.1022 0.993 0 0.032 0.000 0.968
#> SRR901221 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901222 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901223 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901224 2 0.0000 1.000 0 1.000 0.000 0.000
#> SRR901225 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901226 4 0.0817 0.997 0 0.024 0.000 0.976
#> SRR901227 4 0.0817 0.997 0 0.024 0.000 0.976
#> SRR901229 3 0.0000 0.992 0 0.000 1.000 0.000
#> SRR901228 4 0.0817 0.997 0 0.024 0.000 0.976
#> SRR901230 4 0.0817 0.997 0 0.024 0.000 0.976
#> SRR901231 4 0.0817 0.997 0 0.024 0.000 0.976
#> SRR901232 4 0.0817 0.997 0 0.024 0.000 0.976
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.000 1.000 0 0.000 0.0 0.000 1.0
#> SRR901150 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901151 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901152 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR1382100 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901154 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901155 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901156 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901157 5 0.000 1.000 0 0.000 0.0 0.000 1.0
#> SRR901158 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901159 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901160 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901161 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901162 4 0.000 0.996 0 0.000 0.0 1.000 0.0
#> SRR901163 4 0.000 0.996 0 0.000 0.0 1.000 0.0
#> SRR901164 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901165 3 0.418 0.333 0 0.000 0.6 0.000 0.4
#> SRR901166 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901167 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901168 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901169 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901170 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901171 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901172 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901173 5 0.000 1.000 0 0.000 0.0 0.000 1.0
#> SRR901174 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901175 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901176 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901177 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901178 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901179 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901180 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901181 5 0.000 1.000 0 0.000 0.0 0.000 1.0
#> SRR901182 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901183 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901184 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901185 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901187 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901186 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901188 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901189 5 0.000 1.000 0 0.000 0.0 0.000 1.0
#> SRR901190 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901191 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901192 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901193 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901194 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901195 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901196 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901197 5 0.000 1.000 0 0.000 0.0 0.000 1.0
#> SRR901198 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901199 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901200 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901201 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901202 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901203 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901204 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901205 5 0.000 1.000 0 0.000 0.0 0.000 1.0
#> SRR901206 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901207 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901208 1 0.000 1.000 1 0.000 0.0 0.000 0.0
#> SRR901209 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901211 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901210 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901212 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901213 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901214 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901215 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901216 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901217 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901218 4 0.029 0.990 0 0.008 0.0 0.992 0.0
#> SRR901219 4 0.029 0.990 0 0.008 0.0 0.992 0.0
#> SRR901220 4 0.029 0.990 0 0.008 0.0 0.992 0.0
#> SRR901221 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901222 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901223 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901224 2 0.000 1.000 0 1.000 0.0 0.000 0.0
#> SRR901225 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901226 4 0.000 0.996 0 0.000 0.0 1.000 0.0
#> SRR901227 4 0.000 0.996 0 0.000 0.0 1.000 0.0
#> SRR901229 3 0.000 0.969 0 0.000 1.0 0.000 0.0
#> SRR901228 4 0.000 0.996 0 0.000 0.0 1.000 0.0
#> SRR901230 4 0.000 0.996 0 0.000 0.0 1.000 0.0
#> SRR901231 4 0.000 0.996 0 0.000 0.0 1.000 0.0
#> SRR901232 4 0.000 0.996 0 0.000 0.0 1.000 0.0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 1.000 0 0.000 0.0 0.000 1.0 0.000
#> SRR901150 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901151 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901152 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR1382100 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901154 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901155 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901156 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901157 5 0.0000 1.000 0 0.000 0.0 0.000 1.0 0.000
#> SRR901158 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901159 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901160 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901161 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901162 4 0.0000 0.996 0 0.000 0.0 1.000 0.0 0.000
#> SRR901163 4 0.0000 0.996 0 0.000 0.0 1.000 0.0 0.000
#> SRR901164 6 0.0000 0.678 0 0.000 0.0 0.000 0.0 1.000
#> SRR901165 3 0.3756 0.333 0 0.000 0.6 0.000 0.4 0.000
#> SRR901166 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901167 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901168 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901169 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901170 2 0.0146 0.995 0 0.996 0.0 0.000 0.0 0.004
#> SRR901171 2 0.0146 0.995 0 0.996 0.0 0.000 0.0 0.004
#> SRR901172 2 0.0146 0.995 0 0.996 0.0 0.000 0.0 0.004
#> SRR901173 5 0.0000 1.000 0 0.000 0.0 0.000 1.0 0.000
#> SRR901174 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901175 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901176 6 0.0000 0.678 0 0.000 0.0 0.000 0.0 1.000
#> SRR901177 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901178 2 0.0260 0.992 0 0.992 0.0 0.000 0.0 0.008
#> SRR901179 2 0.0260 0.992 0 0.992 0.0 0.000 0.0 0.008
#> SRR901180 2 0.0260 0.992 0 0.992 0.0 0.000 0.0 0.008
#> SRR901181 5 0.0000 1.000 0 0.000 0.0 0.000 1.0 0.000
#> SRR901182 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901183 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901184 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901185 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901187 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901186 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901188 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901189 5 0.0000 1.000 0 0.000 0.0 0.000 1.0 0.000
#> SRR901190 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901191 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901192 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901193 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901194 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901195 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901196 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901197 5 0.0000 1.000 0 0.000 0.0 0.000 1.0 0.000
#> SRR901198 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901199 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901200 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901201 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901202 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901203 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901204 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901205 5 0.0000 1.000 0 0.000 0.0 0.000 1.0 0.000
#> SRR901206 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901207 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901208 1 0.0000 1.000 1 0.000 0.0 0.000 0.0 0.000
#> SRR901209 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901211 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901210 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901212 2 0.0000 0.996 0 1.000 0.0 0.000 0.0 0.000
#> SRR901213 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901214 2 0.0363 0.990 0 0.988 0.0 0.000 0.0 0.012
#> SRR901215 2 0.0363 0.990 0 0.988 0.0 0.000 0.0 0.012
#> SRR901216 2 0.0363 0.990 0 0.988 0.0 0.000 0.0 0.012
#> SRR901217 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901218 4 0.0260 0.990 0 0.008 0.0 0.992 0.0 0.000
#> SRR901219 4 0.0260 0.990 0 0.008 0.0 0.992 0.0 0.000
#> SRR901220 4 0.0260 0.990 0 0.008 0.0 0.992 0.0 0.000
#> SRR901221 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901222 6 0.3747 0.506 0 0.396 0.0 0.000 0.0 0.604
#> SRR901223 6 0.3747 0.506 0 0.396 0.0 0.000 0.0 0.604
#> SRR901224 6 0.0000 0.678 0 0.000 0.0 0.000 0.0 1.000
#> SRR901225 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901226 4 0.0000 0.996 0 0.000 0.0 1.000 0.0 0.000
#> SRR901227 4 0.0000 0.996 0 0.000 0.0 1.000 0.0 0.000
#> SRR901229 3 0.0000 0.967 0 0.000 1.0 0.000 0.0 0.000
#> SRR901228 4 0.0000 0.996 0 0.000 0.0 1.000 0.0 0.000
#> SRR901230 4 0.0000 0.996 0 0.000 0.0 1.000 0.0 0.000
#> SRR901231 4 0.0000 0.996 0 0.000 0.0 1.000 0.0 0.000
#> SRR901232 4 0.0000 0.996 0 0.000 0.0 1.000 0.0 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "kmeans"]
# you can also extract it by
# res = res_list["MAD:kmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.357 0.744 0.787 0.4026 0.620 0.620
#> 3 3 1.000 0.986 0.950 0.5303 0.736 0.575
#> 4 4 0.831 0.868 0.888 0.1405 1.000 1.000
#> 5 5 0.780 0.856 0.849 0.0783 0.908 0.743
#> 6 6 0.775 0.730 0.787 0.0522 0.953 0.823
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.000 1.000 0.000 1.000
#> SRR901150 1 0.469 0.584 0.900 0.100
#> SRR901151 1 0.469 0.584 0.900 0.100
#> SRR901152 1 0.469 0.584 0.900 0.100
#> SRR1382100 2 0.000 1.000 0.000 1.000
#> SRR901154 1 0.952 0.709 0.628 0.372
#> SRR901155 1 0.952 0.709 0.628 0.372
#> SRR901156 1 0.961 0.701 0.616 0.384
#> SRR901157 2 0.000 1.000 0.000 1.000
#> SRR901158 1 0.469 0.584 0.900 0.100
#> SRR901159 1 0.469 0.584 0.900 0.100
#> SRR901160 1 0.469 0.584 0.900 0.100
#> SRR901161 2 0.000 1.000 0.000 1.000
#> SRR901162 1 0.952 0.709 0.628 0.372
#> SRR901163 1 0.975 0.687 0.592 0.408
#> SRR901164 1 0.963 0.698 0.612 0.388
#> SRR901165 2 0.000 1.000 0.000 1.000
#> SRR901166 1 0.469 0.584 0.900 0.100
#> SRR901167 1 0.469 0.584 0.900 0.100
#> SRR901168 1 0.469 0.584 0.900 0.100
#> SRR901169 2 0.000 1.000 0.000 1.000
#> SRR901170 1 0.963 0.698 0.612 0.388
#> SRR901171 1 0.963 0.698 0.612 0.388
#> SRR901172 1 0.963 0.698 0.612 0.388
#> SRR901173 2 0.000 1.000 0.000 1.000
#> SRR901174 1 0.469 0.584 0.900 0.100
#> SRR901175 1 0.469 0.584 0.900 0.100
#> SRR901176 1 0.963 0.698 0.612 0.388
#> SRR901177 2 0.000 1.000 0.000 1.000
#> SRR901178 1 0.952 0.709 0.628 0.372
#> SRR901179 1 0.963 0.698 0.612 0.388
#> SRR901180 1 0.963 0.698 0.612 0.388
#> SRR901181 2 0.000 1.000 0.000 1.000
#> SRR901182 1 0.469 0.584 0.900 0.100
#> SRR901183 1 0.469 0.584 0.900 0.100
#> SRR901184 1 0.469 0.584 0.900 0.100
#> SRR901185 2 0.000 1.000 0.000 1.000
#> SRR901187 1 0.963 0.698 0.612 0.388
#> SRR901186 1 0.963 0.698 0.612 0.388
#> SRR901188 1 0.952 0.709 0.628 0.372
#> SRR901189 2 0.000 1.000 0.000 1.000
#> SRR901190 1 0.469 0.584 0.900 0.100
#> SRR901191 1 0.469 0.584 0.900 0.100
#> SRR901192 1 0.469 0.584 0.900 0.100
#> SRR901193 2 0.000 1.000 0.000 1.000
#> SRR901194 1 0.952 0.709 0.628 0.372
#> SRR901195 1 0.952 0.709 0.628 0.372
#> SRR901196 1 0.963 0.698 0.612 0.388
#> SRR901197 2 0.000 1.000 0.000 1.000
#> SRR901198 1 0.469 0.584 0.900 0.100
#> SRR901199 1 0.469 0.584 0.900 0.100
#> SRR901200 1 0.469 0.584 0.900 0.100
#> SRR901201 2 0.000 1.000 0.000 1.000
#> SRR901202 1 0.952 0.709 0.628 0.372
#> SRR901203 1 0.952 0.709 0.628 0.372
#> SRR901204 1 0.952 0.709 0.628 0.372
#> SRR901205 2 0.000 1.000 0.000 1.000
#> SRR901206 1 0.469 0.584 0.900 0.100
#> SRR901207 1 0.469 0.584 0.900 0.100
#> SRR901208 1 0.469 0.584 0.900 0.100
#> SRR901209 2 0.000 1.000 0.000 1.000
#> SRR901211 1 0.952 0.709 0.628 0.372
#> SRR901210 1 0.952 0.709 0.628 0.372
#> SRR901212 1 0.963 0.698 0.612 0.388
#> SRR901213 2 0.000 1.000 0.000 1.000
#> SRR901214 1 0.963 0.698 0.612 0.388
#> SRR901215 1 0.963 0.698 0.612 0.388
#> SRR901216 1 0.963 0.698 0.612 0.388
#> SRR901217 2 0.000 1.000 0.000 1.000
#> SRR901218 1 0.952 0.709 0.628 0.372
#> SRR901219 1 0.952 0.709 0.628 0.372
#> SRR901220 1 0.952 0.709 0.628 0.372
#> SRR901221 2 0.000 1.000 0.000 1.000
#> SRR901222 1 0.952 0.709 0.628 0.372
#> SRR901223 1 0.952 0.709 0.628 0.372
#> SRR901224 1 0.961 0.701 0.616 0.384
#> SRR901225 2 0.000 1.000 0.000 1.000
#> SRR901226 1 0.971 0.693 0.600 0.400
#> SRR901227 1 0.981 0.677 0.580 0.420
#> SRR901229 2 0.000 1.000 0.000 1.000
#> SRR901228 1 0.983 0.674 0.576 0.424
#> SRR901230 1 0.983 0.674 0.576 0.424
#> SRR901231 1 0.952 0.709 0.628 0.372
#> SRR901232 1 0.952 0.709 0.628 0.372
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.4369 0.960 0.096 0.040 0.864
#> SRR901150 1 0.3207 0.987 0.904 0.084 0.012
#> SRR901151 1 0.3207 0.987 0.904 0.084 0.012
#> SRR901152 1 0.3207 0.987 0.904 0.084 0.012
#> SRR1382100 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901154 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901155 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901156 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901157 3 0.4369 0.960 0.096 0.040 0.864
#> SRR901158 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901159 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901160 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901161 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901162 2 0.0424 0.993 0.000 0.992 0.008
#> SRR901163 2 0.0747 0.988 0.000 0.984 0.016
#> SRR901164 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901165 3 0.4369 0.960 0.096 0.040 0.864
#> SRR901166 1 0.3765 0.983 0.888 0.084 0.028
#> SRR901167 1 0.3765 0.983 0.888 0.084 0.028
#> SRR901168 1 0.3765 0.983 0.888 0.084 0.028
#> SRR901169 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901170 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901171 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901172 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901173 3 0.4289 0.958 0.092 0.040 0.868
#> SRR901174 1 0.3765 0.983 0.888 0.084 0.028
#> SRR901175 1 0.3765 0.983 0.888 0.084 0.028
#> SRR901176 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901177 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901178 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901179 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901180 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901181 3 0.4369 0.960 0.096 0.040 0.864
#> SRR901182 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901183 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901184 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901185 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901187 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901186 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901188 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901189 3 0.4369 0.960 0.096 0.040 0.864
#> SRR901190 1 0.3637 0.984 0.892 0.084 0.024
#> SRR901191 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901192 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901193 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901194 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901195 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901196 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901197 3 0.4289 0.958 0.092 0.040 0.868
#> SRR901198 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901199 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901200 1 0.3207 0.989 0.904 0.084 0.012
#> SRR901201 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901202 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901203 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901204 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901205 3 0.4369 0.960 0.096 0.040 0.864
#> SRR901206 1 0.2625 0.989 0.916 0.084 0.000
#> SRR901207 1 0.2625 0.989 0.916 0.084 0.000
#> SRR901208 1 0.2625 0.989 0.916 0.084 0.000
#> SRR901209 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901211 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901210 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901212 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901213 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901214 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901215 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901216 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901217 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901218 2 0.0424 0.993 0.000 0.992 0.008
#> SRR901219 2 0.0424 0.993 0.000 0.992 0.008
#> SRR901220 2 0.0424 0.993 0.000 0.992 0.008
#> SRR901221 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901222 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901223 2 0.0000 0.996 0.000 1.000 0.000
#> SRR901224 2 0.0237 0.996 0.000 0.996 0.004
#> SRR901225 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901226 2 0.0424 0.993 0.000 0.992 0.008
#> SRR901227 2 0.0747 0.988 0.000 0.984 0.016
#> SRR901229 3 0.2116 0.976 0.012 0.040 0.948
#> SRR901228 2 0.0983 0.986 0.004 0.980 0.016
#> SRR901230 2 0.0661 0.992 0.004 0.988 0.008
#> SRR901231 2 0.0424 0.993 0.000 0.992 0.008
#> SRR901232 2 0.0424 0.993 0.000 0.992 0.008
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0000 0.847 0.000 0.000 1.0 0.000
#> SRR901150 1 0.2773 0.936 0.880 0.004 0.0 0.116
#> SRR901151 1 0.2773 0.936 0.880 0.004 0.0 0.116
#> SRR901152 1 0.2714 0.936 0.884 0.004 0.0 0.112
#> SRR1382100 3 0.4560 0.908 0.004 0.000 0.7 0.296
#> SRR901154 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901155 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901156 2 0.1389 0.870 0.000 0.952 0.0 0.048
#> SRR901157 3 0.0000 0.847 0.000 0.000 1.0 0.000
#> SRR901158 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901159 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901160 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901161 3 0.4406 0.908 0.000 0.000 0.7 0.300
#> SRR901162 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901163 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901164 2 0.2530 0.840 0.000 0.888 0.0 0.112
#> SRR901165 3 0.0000 0.847 0.000 0.000 1.0 0.000
#> SRR901166 1 0.3710 0.908 0.804 0.004 0.0 0.192
#> SRR901167 1 0.3710 0.908 0.804 0.004 0.0 0.192
#> SRR901168 1 0.3710 0.908 0.804 0.004 0.0 0.192
#> SRR901169 3 0.4560 0.908 0.004 0.000 0.7 0.296
#> SRR901170 2 0.1389 0.870 0.000 0.952 0.0 0.048
#> SRR901171 2 0.1389 0.870 0.000 0.952 0.0 0.048
#> SRR901172 2 0.1389 0.870 0.000 0.952 0.0 0.048
#> SRR901173 3 0.0000 0.847 0.000 0.000 1.0 0.000
#> SRR901174 1 0.3710 0.908 0.804 0.004 0.0 0.192
#> SRR901175 1 0.3583 0.913 0.816 0.004 0.0 0.180
#> SRR901176 2 0.2814 0.828 0.000 0.868 0.0 0.132
#> SRR901177 3 0.4406 0.908 0.000 0.000 0.7 0.300
#> SRR901178 2 0.0469 0.874 0.000 0.988 0.0 0.012
#> SRR901179 2 0.1389 0.870 0.000 0.952 0.0 0.048
#> SRR901180 2 0.1389 0.870 0.000 0.952 0.0 0.048
#> SRR901181 3 0.0000 0.847 0.000 0.000 1.0 0.000
#> SRR901182 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901183 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901184 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901185 3 0.4406 0.908 0.000 0.000 0.7 0.300
#> SRR901187 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901186 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901188 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901189 3 0.0000 0.847 0.000 0.000 1.0 0.000
#> SRR901190 1 0.3208 0.926 0.848 0.004 0.0 0.148
#> SRR901191 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901192 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901193 3 0.4406 0.908 0.000 0.000 0.7 0.300
#> SRR901194 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901195 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901196 2 0.1389 0.870 0.000 0.952 0.0 0.048
#> SRR901197 3 0.0000 0.847 0.000 0.000 1.0 0.000
#> SRR901198 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901199 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901200 1 0.0188 0.948 0.996 0.004 0.0 0.000
#> SRR901201 3 0.4406 0.908 0.000 0.000 0.7 0.300
#> SRR901202 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901203 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901204 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901205 3 0.0000 0.847 0.000 0.000 1.0 0.000
#> SRR901206 1 0.1743 0.946 0.940 0.004 0.0 0.056
#> SRR901207 1 0.1743 0.946 0.940 0.004 0.0 0.056
#> SRR901208 1 0.1743 0.946 0.940 0.004 0.0 0.056
#> SRR901209 3 0.4406 0.908 0.000 0.000 0.7 0.300
#> SRR901211 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901210 2 0.0000 0.876 0.000 1.000 0.0 0.000
#> SRR901212 2 0.1211 0.872 0.000 0.960 0.0 0.040
#> SRR901213 3 0.4560 0.908 0.004 0.000 0.7 0.296
#> SRR901214 2 0.1637 0.871 0.000 0.940 0.0 0.060
#> SRR901215 2 0.1637 0.871 0.000 0.940 0.0 0.060
#> SRR901216 2 0.1637 0.871 0.000 0.940 0.0 0.060
#> SRR901217 3 0.4560 0.908 0.004 0.000 0.7 0.296
#> SRR901218 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901219 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901220 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901221 3 0.4560 0.908 0.004 0.000 0.7 0.296
#> SRR901222 2 0.1302 0.866 0.000 0.956 0.0 0.044
#> SRR901223 2 0.1557 0.866 0.000 0.944 0.0 0.056
#> SRR901224 2 0.2530 0.840 0.000 0.888 0.0 0.112
#> SRR901225 3 0.4406 0.908 0.000 0.000 0.7 0.300
#> SRR901226 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901227 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901229 3 0.4406 0.908 0.000 0.000 0.7 0.300
#> SRR901228 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901230 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901231 2 0.4843 0.691 0.000 0.604 0.0 0.396
#> SRR901232 2 0.4843 0.691 0.000 0.604 0.0 0.396
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 3 0.4403 0.744 0.000 0.004 0.560 0.436 NA
#> SRR901150 1 0.3435 0.889 0.820 0.004 0.000 0.020 NA
#> SRR901151 1 0.3435 0.889 0.820 0.004 0.000 0.020 NA
#> SRR901152 1 0.3154 0.892 0.836 0.004 0.000 0.012 NA
#> SRR1382100 3 0.1124 0.844 0.000 0.004 0.960 0.000 NA
#> SRR901154 2 0.0404 0.845 0.000 0.988 0.000 0.000 NA
#> SRR901155 2 0.0404 0.845 0.000 0.988 0.000 0.000 NA
#> SRR901156 2 0.1851 0.848 0.000 0.912 0.000 0.000 NA
#> SRR901157 3 0.4651 0.744 0.000 0.004 0.560 0.428 NA
#> SRR901158 1 0.0162 0.910 0.996 0.004 0.000 0.000 NA
#> SRR901159 1 0.0162 0.910 0.996 0.004 0.000 0.000 NA
#> SRR901160 1 0.0162 0.910 0.996 0.004 0.000 0.000 NA
#> SRR901161 3 0.0324 0.845 0.004 0.004 0.992 0.000 NA
#> SRR901162 4 0.6523 0.994 0.000 0.268 0.000 0.484 NA
#> SRR901163 4 0.6523 0.994 0.000 0.268 0.000 0.484 NA
#> SRR901164 2 0.4444 0.713 0.000 0.624 0.000 0.012 NA
#> SRR901165 3 0.4981 0.746 0.000 0.004 0.560 0.412 NA
#> SRR901166 1 0.4491 0.834 0.692 0.004 0.000 0.024 NA
#> SRR901167 1 0.4513 0.831 0.688 0.004 0.000 0.024 NA
#> SRR901168 1 0.4491 0.834 0.692 0.004 0.000 0.024 NA
#> SRR901169 3 0.1124 0.844 0.000 0.004 0.960 0.000 NA
#> SRR901170 2 0.2773 0.838 0.000 0.836 0.000 0.000 NA
#> SRR901171 2 0.2929 0.835 0.000 0.820 0.000 0.000 NA
#> SRR901172 2 0.2773 0.838 0.000 0.836 0.000 0.000 NA
#> SRR901173 3 0.4403 0.744 0.000 0.004 0.560 0.436 NA
#> SRR901174 1 0.4644 0.832 0.688 0.004 0.004 0.024 NA
#> SRR901175 1 0.4575 0.839 0.700 0.004 0.004 0.024 NA
#> SRR901176 2 0.4527 0.684 0.000 0.596 0.000 0.012 NA
#> SRR901177 3 0.0932 0.845 0.004 0.004 0.972 0.000 NA
#> SRR901178 2 0.3317 0.809 0.000 0.840 0.000 0.044 NA
#> SRR901179 2 0.2929 0.835 0.000 0.820 0.000 0.000 NA
#> SRR901180 2 0.3177 0.826 0.000 0.792 0.000 0.000 NA
#> SRR901181 3 0.4651 0.744 0.000 0.004 0.560 0.428 NA
#> SRR901182 1 0.1173 0.906 0.964 0.004 0.000 0.020 NA
#> SRR901183 1 0.0451 0.909 0.988 0.004 0.000 0.000 NA
#> SRR901184 1 0.0451 0.909 0.988 0.004 0.000 0.000 NA
#> SRR901185 3 0.0162 0.845 0.000 0.004 0.996 0.000 NA
#> SRR901187 2 0.0000 0.848 0.000 1.000 0.000 0.000 NA
#> SRR901186 2 0.0000 0.848 0.000 1.000 0.000 0.000 NA
#> SRR901188 2 0.0290 0.845 0.000 0.992 0.000 0.000 NA
#> SRR901189 3 0.4651 0.744 0.000 0.004 0.560 0.428 NA
#> SRR901190 1 0.4089 0.860 0.744 0.004 0.004 0.012 NA
#> SRR901191 1 0.0324 0.910 0.992 0.004 0.000 0.000 NA
#> SRR901192 1 0.0324 0.910 0.992 0.004 0.000 0.000 NA
#> SRR901193 3 0.0162 0.845 0.000 0.004 0.996 0.000 NA
#> SRR901194 2 0.0290 0.845 0.000 0.992 0.000 0.000 NA
#> SRR901195 2 0.0290 0.845 0.000 0.992 0.000 0.000 NA
#> SRR901196 2 0.2773 0.838 0.000 0.836 0.000 0.000 NA
#> SRR901197 3 0.4651 0.744 0.000 0.004 0.560 0.428 NA
#> SRR901198 1 0.1173 0.906 0.964 0.004 0.000 0.020 NA
#> SRR901199 1 0.1267 0.906 0.960 0.004 0.000 0.024 NA
#> SRR901200 1 0.1267 0.906 0.960 0.004 0.000 0.024 NA
#> SRR901201 3 0.0162 0.845 0.000 0.004 0.996 0.000 NA
#> SRR901202 2 0.0000 0.848 0.000 1.000 0.000 0.000 NA
#> SRR901203 2 0.0000 0.848 0.000 1.000 0.000 0.000 NA
#> SRR901204 2 0.0000 0.848 0.000 1.000 0.000 0.000 NA
#> SRR901205 3 0.4545 0.744 0.000 0.004 0.560 0.432 NA
#> SRR901206 1 0.2172 0.908 0.916 0.004 0.000 0.020 NA
#> SRR901207 1 0.2172 0.908 0.916 0.004 0.000 0.020 NA
#> SRR901208 1 0.2172 0.908 0.916 0.004 0.000 0.020 NA
#> SRR901209 3 0.0486 0.845 0.004 0.004 0.988 0.000 NA
#> SRR901211 2 0.0290 0.845 0.000 0.992 0.000 0.000 NA
#> SRR901210 2 0.0000 0.848 0.000 1.000 0.000 0.000 NA
#> SRR901212 2 0.1608 0.849 0.000 0.928 0.000 0.000 NA
#> SRR901213 3 0.1357 0.843 0.000 0.004 0.948 0.000 NA
#> SRR901214 2 0.4223 0.792 0.000 0.724 0.000 0.028 NA
#> SRR901215 2 0.4223 0.792 0.000 0.724 0.000 0.028 NA
#> SRR901216 2 0.4223 0.792 0.000 0.724 0.000 0.028 NA
#> SRR901217 3 0.0671 0.845 0.000 0.004 0.980 0.000 NA
#> SRR901218 4 0.6555 0.994 0.000 0.268 0.000 0.476 NA
#> SRR901219 4 0.6555 0.994 0.000 0.268 0.000 0.476 NA
#> SRR901220 4 0.6555 0.994 0.000 0.268 0.000 0.476 NA
#> SRR901221 3 0.1357 0.843 0.000 0.004 0.948 0.000 NA
#> SRR901222 2 0.3690 0.742 0.000 0.764 0.000 0.012 NA
#> SRR901223 2 0.4163 0.697 0.000 0.740 0.000 0.032 NA
#> SRR901224 2 0.4444 0.713 0.000 0.624 0.000 0.012 NA
#> SRR901225 3 0.0324 0.845 0.000 0.004 0.992 0.000 NA
#> SRR901226 4 0.6540 0.993 0.000 0.268 0.000 0.480 NA
#> SRR901227 4 0.6540 0.993 0.000 0.268 0.000 0.480 NA
#> SRR901229 3 0.0324 0.845 0.000 0.004 0.992 0.000 NA
#> SRR901228 4 0.6571 0.990 0.000 0.268 0.000 0.472 NA
#> SRR901230 4 0.6571 0.990 0.000 0.268 0.000 0.472 NA
#> SRR901231 4 0.6555 0.994 0.000 0.268 0.000 0.476 NA
#> SRR901232 4 0.6555 0.994 0.000 0.268 0.000 0.476 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.4032 0.9824 0.000 0.000 0.420 0.000 0.572 0.008
#> SRR901150 1 0.4632 -0.0613 0.680 0.000 0.000 0.012 0.060 0.248
#> SRR901151 1 0.4632 -0.0613 0.680 0.000 0.000 0.012 0.060 0.248
#> SRR901152 1 0.4616 -0.0140 0.688 0.000 0.000 0.012 0.064 0.236
#> SRR1382100 3 0.1225 0.9538 0.000 0.000 0.952 0.012 0.000 0.036
#> SRR901154 2 0.2485 0.7741 0.000 0.892 0.000 0.056 0.040 0.012
#> SRR901155 2 0.2485 0.7741 0.000 0.892 0.000 0.056 0.040 0.012
#> SRR901156 2 0.1297 0.7823 0.000 0.948 0.000 0.000 0.040 0.012
#> SRR901157 5 0.3797 0.9836 0.000 0.000 0.420 0.000 0.580 0.000
#> SRR901158 1 0.0260 0.6696 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR901159 1 0.0363 0.6692 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR901160 1 0.0260 0.6696 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR901161 3 0.0146 0.9700 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR901162 4 0.1845 0.9811 0.000 0.072 0.000 0.916 0.004 0.008
#> SRR901163 4 0.1845 0.9811 0.000 0.072 0.000 0.916 0.004 0.008
#> SRR901164 2 0.6294 0.5709 0.000 0.448 0.000 0.024 0.184 0.344
#> SRR901165 5 0.5151 0.9269 0.000 0.000 0.420 0.008 0.508 0.064
#> SRR901166 6 0.3869 1.0000 0.500 0.000 0.000 0.000 0.000 0.500
#> SRR901167 1 0.3869 -1.0000 0.500 0.000 0.000 0.000 0.000 0.500
#> SRR901168 6 0.3869 1.0000 0.500 0.000 0.000 0.000 0.000 0.500
#> SRR901169 3 0.1225 0.9538 0.000 0.000 0.952 0.012 0.000 0.036
#> SRR901170 2 0.3854 0.7615 0.000 0.772 0.000 0.000 0.092 0.136
#> SRR901171 2 0.4085 0.7549 0.000 0.748 0.000 0.000 0.096 0.156
#> SRR901172 2 0.3854 0.7615 0.000 0.772 0.000 0.000 0.092 0.136
#> SRR901173 5 0.4032 0.9824 0.000 0.000 0.420 0.000 0.572 0.008
#> SRR901174 6 0.3869 1.0000 0.500 0.000 0.000 0.000 0.000 0.500
#> SRR901175 1 0.4184 -0.9417 0.500 0.000 0.000 0.000 0.012 0.488
#> SRR901176 2 0.6327 0.5403 0.000 0.416 0.000 0.024 0.184 0.376
#> SRR901177 3 0.0914 0.9630 0.000 0.000 0.968 0.016 0.000 0.016
#> SRR901178 2 0.5984 0.6960 0.000 0.620 0.000 0.160 0.092 0.128
#> SRR901179 2 0.3694 0.7643 0.000 0.784 0.000 0.000 0.076 0.140
#> SRR901180 2 0.4403 0.7388 0.000 0.708 0.000 0.000 0.096 0.196
#> SRR901181 5 0.3797 0.9836 0.000 0.000 0.420 0.000 0.580 0.000
#> SRR901182 1 0.1787 0.6356 0.920 0.000 0.000 0.004 0.068 0.008
#> SRR901183 1 0.0405 0.6678 0.988 0.000 0.000 0.004 0.008 0.000
#> SRR901184 1 0.0405 0.6678 0.988 0.000 0.000 0.004 0.008 0.000
#> SRR901185 3 0.0000 0.9698 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901187 2 0.1606 0.7856 0.000 0.932 0.000 0.056 0.004 0.008
#> SRR901186 2 0.1606 0.7856 0.000 0.932 0.000 0.056 0.004 0.008
#> SRR901188 2 0.1471 0.7811 0.000 0.932 0.000 0.064 0.004 0.000
#> SRR901189 5 0.3797 0.9836 0.000 0.000 0.420 0.000 0.580 0.000
#> SRR901190 1 0.4254 -0.6908 0.576 0.000 0.000 0.000 0.020 0.404
#> SRR901191 1 0.0146 0.6695 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR901192 1 0.0146 0.6695 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR901193 3 0.0000 0.9698 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901194 2 0.1267 0.7832 0.000 0.940 0.000 0.060 0.000 0.000
#> SRR901195 2 0.1267 0.7832 0.000 0.940 0.000 0.060 0.000 0.000
#> SRR901196 2 0.3534 0.7657 0.000 0.800 0.000 0.000 0.076 0.124
#> SRR901197 5 0.3797 0.9836 0.000 0.000 0.420 0.000 0.580 0.000
#> SRR901198 1 0.2001 0.6313 0.912 0.000 0.000 0.012 0.068 0.008
#> SRR901199 1 0.2001 0.6313 0.912 0.000 0.000 0.012 0.068 0.008
#> SRR901200 1 0.2001 0.6313 0.912 0.000 0.000 0.012 0.068 0.008
#> SRR901201 3 0.0000 0.9698 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901202 2 0.1204 0.7843 0.000 0.944 0.000 0.056 0.000 0.000
#> SRR901203 2 0.1204 0.7843 0.000 0.944 0.000 0.056 0.000 0.000
#> SRR901204 2 0.1204 0.7843 0.000 0.944 0.000 0.056 0.000 0.000
#> SRR901205 5 0.4415 0.9733 0.000 0.000 0.420 0.004 0.556 0.020
#> SRR901206 1 0.2771 0.5663 0.868 0.000 0.000 0.004 0.060 0.068
#> SRR901207 1 0.2771 0.5663 0.868 0.000 0.000 0.004 0.060 0.068
#> SRR901208 1 0.2771 0.5663 0.868 0.000 0.000 0.004 0.060 0.068
#> SRR901209 3 0.0291 0.9691 0.000 0.000 0.992 0.004 0.000 0.004
#> SRR901211 2 0.1411 0.7833 0.000 0.936 0.000 0.060 0.004 0.000
#> SRR901210 2 0.1349 0.7843 0.000 0.940 0.000 0.056 0.004 0.000
#> SRR901212 2 0.0665 0.7878 0.000 0.980 0.000 0.004 0.008 0.008
#> SRR901213 3 0.1480 0.9493 0.000 0.000 0.940 0.020 0.000 0.040
#> SRR901214 2 0.5728 0.6800 0.000 0.596 0.000 0.040 0.108 0.256
#> SRR901215 2 0.5728 0.6800 0.000 0.596 0.000 0.040 0.108 0.256
#> SRR901216 2 0.5728 0.6800 0.000 0.596 0.000 0.040 0.108 0.256
#> SRR901217 3 0.0603 0.9659 0.000 0.000 0.980 0.004 0.000 0.016
#> SRR901218 4 0.2239 0.9801 0.000 0.072 0.000 0.900 0.020 0.008
#> SRR901219 4 0.2239 0.9801 0.000 0.072 0.000 0.900 0.020 0.008
#> SRR901220 4 0.2239 0.9801 0.000 0.072 0.000 0.900 0.020 0.008
#> SRR901221 3 0.1549 0.9463 0.000 0.000 0.936 0.020 0.000 0.044
#> SRR901222 2 0.6356 0.6186 0.000 0.552 0.000 0.088 0.120 0.240
#> SRR901223 2 0.6758 0.5572 0.000 0.512 0.000 0.156 0.112 0.220
#> SRR901224 2 0.6358 0.5671 0.000 0.444 0.000 0.028 0.184 0.344
#> SRR901225 3 0.0146 0.9701 0.000 0.000 0.996 0.004 0.000 0.000
#> SRR901226 4 0.1845 0.9807 0.000 0.072 0.000 0.916 0.004 0.008
#> SRR901227 4 0.1845 0.9807 0.000 0.072 0.000 0.916 0.004 0.008
#> SRR901229 3 0.0146 0.9701 0.000 0.000 0.996 0.004 0.000 0.000
#> SRR901228 4 0.2422 0.9727 0.000 0.072 0.000 0.892 0.024 0.012
#> SRR901230 4 0.2422 0.9727 0.000 0.072 0.000 0.892 0.024 0.012
#> SRR901231 4 0.2239 0.9801 0.000 0.072 0.000 0.900 0.020 0.008
#> SRR901232 4 0.1946 0.9816 0.000 0.072 0.000 0.912 0.012 0.004
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "skmeans"]
# you can also extract it by
# res = res_list["MAD:skmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.352 0.868 0.914 0.4763 0.535 0.535
#> 3 3 0.964 0.940 0.976 0.3796 0.734 0.535
#> 4 4 1.000 0.993 0.997 0.1205 0.907 0.735
#> 5 5 0.903 0.953 0.941 0.0483 0.970 0.887
#> 6 6 0.966 0.905 0.939 0.0609 0.940 0.746
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.494 0.854 0.108 0.892
#> SRR901150 1 0.000 0.967 1.000 0.000
#> SRR901151 1 0.000 0.967 1.000 0.000
#> SRR901152 1 0.000 0.967 1.000 0.000
#> SRR1382100 2 0.494 0.854 0.108 0.892
#> SRR901154 2 0.730 0.788 0.204 0.796
#> SRR901155 2 0.730 0.788 0.204 0.796
#> SRR901156 2 0.722 0.791 0.200 0.800
#> SRR901157 2 0.494 0.854 0.108 0.892
#> SRR901158 1 0.000 0.967 1.000 0.000
#> SRR901159 1 0.000 0.967 1.000 0.000
#> SRR901160 1 0.000 0.967 1.000 0.000
#> SRR901161 2 0.494 0.854 0.108 0.892
#> SRR901162 1 0.494 0.886 0.892 0.108
#> SRR901163 1 0.494 0.886 0.892 0.108
#> SRR901164 2 0.000 0.857 0.000 1.000
#> SRR901165 2 0.494 0.854 0.108 0.892
#> SRR901166 1 0.000 0.967 1.000 0.000
#> SRR901167 1 0.000 0.967 1.000 0.000
#> SRR901168 1 0.000 0.967 1.000 0.000
#> SRR901169 2 0.494 0.854 0.108 0.892
#> SRR901170 2 0.000 0.857 0.000 1.000
#> SRR901171 2 0.000 0.857 0.000 1.000
#> SRR901172 2 0.000 0.857 0.000 1.000
#> SRR901173 2 0.494 0.854 0.108 0.892
#> SRR901174 1 0.000 0.967 1.000 0.000
#> SRR901175 1 0.000 0.967 1.000 0.000
#> SRR901176 2 0.000 0.857 0.000 1.000
#> SRR901177 2 0.494 0.854 0.108 0.892
#> SRR901178 2 0.722 0.791 0.200 0.800
#> SRR901179 2 0.295 0.851 0.052 0.948
#> SRR901180 2 0.000 0.857 0.000 1.000
#> SRR901181 2 0.494 0.854 0.108 0.892
#> SRR901182 1 0.000 0.967 1.000 0.000
#> SRR901183 1 0.000 0.967 1.000 0.000
#> SRR901184 1 0.000 0.967 1.000 0.000
#> SRR901185 2 0.494 0.854 0.108 0.892
#> SRR901187 2 0.000 0.857 0.000 1.000
#> SRR901186 2 0.260 0.853 0.044 0.956
#> SRR901188 2 0.730 0.788 0.204 0.796
#> SRR901189 2 0.494 0.854 0.108 0.892
#> SRR901190 1 0.000 0.967 1.000 0.000
#> SRR901191 1 0.000 0.967 1.000 0.000
#> SRR901192 1 0.000 0.967 1.000 0.000
#> SRR901193 2 0.494 0.854 0.108 0.892
#> SRR901194 2 0.730 0.788 0.204 0.796
#> SRR901195 2 0.730 0.788 0.204 0.796
#> SRR901196 2 0.000 0.857 0.000 1.000
#> SRR901197 2 0.494 0.854 0.108 0.892
#> SRR901198 1 0.000 0.967 1.000 0.000
#> SRR901199 1 0.000 0.967 1.000 0.000
#> SRR901200 1 0.000 0.967 1.000 0.000
#> SRR901201 2 0.494 0.854 0.108 0.892
#> SRR901202 2 0.722 0.791 0.200 0.800
#> SRR901203 2 0.730 0.788 0.204 0.796
#> SRR901204 2 0.730 0.788 0.204 0.796
#> SRR901205 2 0.494 0.854 0.108 0.892
#> SRR901206 1 0.000 0.967 1.000 0.000
#> SRR901207 1 0.000 0.967 1.000 0.000
#> SRR901208 1 0.000 0.967 1.000 0.000
#> SRR901209 2 0.494 0.854 0.108 0.892
#> SRR901211 2 0.730 0.788 0.204 0.796
#> SRR901210 2 0.730 0.788 0.204 0.796
#> SRR901212 2 0.000 0.857 0.000 1.000
#> SRR901213 2 0.494 0.854 0.108 0.892
#> SRR901214 2 0.000 0.857 0.000 1.000
#> SRR901215 2 0.000 0.857 0.000 1.000
#> SRR901216 2 0.000 0.857 0.000 1.000
#> SRR901217 2 0.494 0.854 0.108 0.892
#> SRR901218 2 0.730 0.788 0.204 0.796
#> SRR901219 2 0.730 0.788 0.204 0.796
#> SRR901220 1 0.494 0.886 0.892 0.108
#> SRR901221 2 0.494 0.854 0.108 0.892
#> SRR901222 2 0.730 0.788 0.204 0.796
#> SRR901223 2 0.988 0.324 0.436 0.564
#> SRR901224 2 0.714 0.793 0.196 0.804
#> SRR901225 2 0.494 0.854 0.108 0.892
#> SRR901226 1 0.494 0.886 0.892 0.108
#> SRR901227 1 0.494 0.886 0.892 0.108
#> SRR901229 2 0.494 0.854 0.108 0.892
#> SRR901228 1 0.494 0.886 0.892 0.108
#> SRR901230 1 0.518 0.880 0.884 0.116
#> SRR901231 2 0.730 0.788 0.204 0.796
#> SRR901232 2 0.730 0.788 0.204 0.796
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.000 1.000 0.000 0.000 1
#> SRR901150 1 0.000 0.972 1.000 0.000 0
#> SRR901151 1 0.000 0.972 1.000 0.000 0
#> SRR901152 1 0.000 0.972 1.000 0.000 0
#> SRR1382100 3 0.000 1.000 0.000 0.000 1
#> SRR901154 2 0.000 0.958 0.000 1.000 0
#> SRR901155 2 0.000 0.958 0.000 1.000 0
#> SRR901156 2 0.000 0.958 0.000 1.000 0
#> SRR901157 3 0.000 1.000 0.000 0.000 1
#> SRR901158 1 0.000 0.972 1.000 0.000 0
#> SRR901159 1 0.000 0.972 1.000 0.000 0
#> SRR901160 1 0.000 0.972 1.000 0.000 0
#> SRR901161 3 0.000 1.000 0.000 0.000 1
#> SRR901162 2 0.613 0.333 0.400 0.600 0
#> SRR901163 1 0.470 0.734 0.788 0.212 0
#> SRR901164 2 0.000 0.958 0.000 1.000 0
#> SRR901165 3 0.000 1.000 0.000 0.000 1
#> SRR901166 1 0.000 0.972 1.000 0.000 0
#> SRR901167 1 0.000 0.972 1.000 0.000 0
#> SRR901168 1 0.000 0.972 1.000 0.000 0
#> SRR901169 3 0.000 1.000 0.000 0.000 1
#> SRR901170 2 0.000 0.958 0.000 1.000 0
#> SRR901171 2 0.000 0.958 0.000 1.000 0
#> SRR901172 2 0.000 0.958 0.000 1.000 0
#> SRR901173 3 0.000 1.000 0.000 0.000 1
#> SRR901174 1 0.000 0.972 1.000 0.000 0
#> SRR901175 1 0.000 0.972 1.000 0.000 0
#> SRR901176 2 0.455 0.729 0.200 0.800 0
#> SRR901177 3 0.000 1.000 0.000 0.000 1
#> SRR901178 2 0.000 0.958 0.000 1.000 0
#> SRR901179 2 0.000 0.958 0.000 1.000 0
#> SRR901180 2 0.000 0.958 0.000 1.000 0
#> SRR901181 3 0.000 1.000 0.000 0.000 1
#> SRR901182 1 0.000 0.972 1.000 0.000 0
#> SRR901183 1 0.000 0.972 1.000 0.000 0
#> SRR901184 1 0.000 0.972 1.000 0.000 0
#> SRR901185 3 0.000 1.000 0.000 0.000 1
#> SRR901187 2 0.000 0.958 0.000 1.000 0
#> SRR901186 2 0.000 0.958 0.000 1.000 0
#> SRR901188 2 0.000 0.958 0.000 1.000 0
#> SRR901189 3 0.000 1.000 0.000 0.000 1
#> SRR901190 1 0.000 0.972 1.000 0.000 0
#> SRR901191 1 0.000 0.972 1.000 0.000 0
#> SRR901192 1 0.000 0.972 1.000 0.000 0
#> SRR901193 3 0.000 1.000 0.000 0.000 1
#> SRR901194 2 0.000 0.958 0.000 1.000 0
#> SRR901195 2 0.000 0.958 0.000 1.000 0
#> SRR901196 2 0.000 0.958 0.000 1.000 0
#> SRR901197 3 0.000 1.000 0.000 0.000 1
#> SRR901198 1 0.000 0.972 1.000 0.000 0
#> SRR901199 1 0.000 0.972 1.000 0.000 0
#> SRR901200 1 0.000 0.972 1.000 0.000 0
#> SRR901201 3 0.000 1.000 0.000 0.000 1
#> SRR901202 2 0.000 0.958 0.000 1.000 0
#> SRR901203 2 0.000 0.958 0.000 1.000 0
#> SRR901204 2 0.000 0.958 0.000 1.000 0
#> SRR901205 3 0.000 1.000 0.000 0.000 1
#> SRR901206 1 0.000 0.972 1.000 0.000 0
#> SRR901207 1 0.000 0.972 1.000 0.000 0
#> SRR901208 1 0.000 0.972 1.000 0.000 0
#> SRR901209 3 0.000 1.000 0.000 0.000 1
#> SRR901211 2 0.000 0.958 0.000 1.000 0
#> SRR901210 2 0.000 0.958 0.000 1.000 0
#> SRR901212 2 0.000 0.958 0.000 1.000 0
#> SRR901213 3 0.000 1.000 0.000 0.000 1
#> SRR901214 2 0.000 0.958 0.000 1.000 0
#> SRR901215 2 0.000 0.958 0.000 1.000 0
#> SRR901216 2 0.000 0.958 0.000 1.000 0
#> SRR901217 3 0.000 1.000 0.000 0.000 1
#> SRR901218 2 0.000 0.958 0.000 1.000 0
#> SRR901219 2 0.000 0.958 0.000 1.000 0
#> SRR901220 2 0.000 0.958 0.000 1.000 0
#> SRR901221 3 0.000 1.000 0.000 0.000 1
#> SRR901222 2 0.000 0.958 0.000 1.000 0
#> SRR901223 2 0.000 0.958 0.000 1.000 0
#> SRR901224 2 0.000 0.958 0.000 1.000 0
#> SRR901225 3 0.000 1.000 0.000 0.000 1
#> SRR901226 2 0.613 0.333 0.400 0.600 0
#> SRR901227 1 0.455 0.752 0.800 0.200 0
#> SRR901229 3 0.000 1.000 0.000 0.000 1
#> SRR901228 1 0.455 0.752 0.800 0.200 0
#> SRR901230 2 0.613 0.333 0.400 0.600 0
#> SRR901231 2 0.000 0.958 0.000 1.000 0
#> SRR901232 2 0.000 0.958 0.000 1.000 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901150 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901151 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901152 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901154 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901155 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901156 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901157 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901158 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901159 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901160 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901162 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901163 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901164 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901165 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901166 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901167 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901168 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901169 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901170 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901171 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901172 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901173 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901174 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901175 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901176 2 0.1211 0.948 0.04 0.960 0 0.000
#> SRR901177 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901178 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901179 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901180 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901181 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901182 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901183 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901184 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901185 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901187 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901186 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901188 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901189 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901190 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901191 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901192 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901194 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901195 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901196 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901197 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901198 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901199 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901200 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901202 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901203 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901204 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901205 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901206 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901207 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901208 1 0.0000 1.000 1.00 0.000 0 0.000
#> SRR901209 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901211 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901210 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901212 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901213 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901214 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901215 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901216 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901217 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901218 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901219 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901220 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901221 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901222 2 0.0188 0.990 0.00 0.996 0 0.004
#> SRR901223 2 0.3569 0.763 0.00 0.804 0 0.196
#> SRR901224 2 0.0000 0.989 0.00 1.000 0 0.000
#> SRR901225 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901226 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901227 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901229 3 0.0000 1.000 0.00 0.000 1 0.000
#> SRR901228 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901230 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901231 4 0.0000 1.000 0.00 0.000 0 1.000
#> SRR901232 4 0.0000 1.000 0.00 0.000 0 1.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.3395 0.957 0.000 0.000 0.236 0.000 0.764
#> SRR901150 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901154 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901155 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901156 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901157 5 0.3395 0.957 0.000 0.000 0.236 0.000 0.764
#> SRR901158 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901162 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901163 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901164 2 0.3366 0.862 0.000 0.768 0.000 0.000 0.232
#> SRR901165 5 0.4291 0.575 0.000 0.000 0.464 0.000 0.536
#> SRR901166 1 0.0162 0.997 0.996 0.000 0.000 0.000 0.004
#> SRR901167 1 0.0162 0.997 0.996 0.000 0.000 0.000 0.004
#> SRR901168 1 0.0162 0.997 0.996 0.000 0.000 0.000 0.004
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901170 2 0.2179 0.903 0.000 0.888 0.000 0.000 0.112
#> SRR901171 2 0.2230 0.902 0.000 0.884 0.000 0.000 0.116
#> SRR901172 2 0.2179 0.903 0.000 0.888 0.000 0.000 0.112
#> SRR901173 5 0.3395 0.957 0.000 0.000 0.236 0.000 0.764
#> SRR901174 1 0.0162 0.997 0.996 0.000 0.000 0.000 0.004
#> SRR901175 1 0.0162 0.997 0.996 0.000 0.000 0.000 0.004
#> SRR901176 2 0.4060 0.737 0.000 0.640 0.000 0.000 0.360
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901178 2 0.2951 0.897 0.000 0.860 0.000 0.028 0.112
#> SRR901179 2 0.2230 0.902 0.000 0.884 0.000 0.000 0.116
#> SRR901180 2 0.3143 0.875 0.000 0.796 0.000 0.000 0.204
#> SRR901181 5 0.3395 0.957 0.000 0.000 0.236 0.000 0.764
#> SRR901182 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901187 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901186 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901188 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901189 5 0.3395 0.957 0.000 0.000 0.236 0.000 0.764
#> SRR901190 1 0.0162 0.997 0.996 0.000 0.000 0.000 0.004
#> SRR901191 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901194 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901195 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901196 2 0.2230 0.902 0.000 0.884 0.000 0.000 0.116
#> SRR901197 5 0.3395 0.957 0.000 0.000 0.236 0.000 0.764
#> SRR901198 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901202 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901203 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901204 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901205 5 0.3395 0.957 0.000 0.000 0.236 0.000 0.764
#> SRR901206 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.999 1.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901211 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901210 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901212 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901214 2 0.3366 0.862 0.000 0.768 0.000 0.000 0.232
#> SRR901215 2 0.3366 0.862 0.000 0.768 0.000 0.000 0.232
#> SRR901216 2 0.3366 0.862 0.000 0.768 0.000 0.000 0.232
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901218 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901219 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901220 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901222 2 0.2377 0.882 0.000 0.872 0.000 0.000 0.128
#> SRR901223 2 0.4676 0.763 0.000 0.740 0.000 0.140 0.120
#> SRR901224 2 0.3366 0.862 0.000 0.768 0.000 0.000 0.232
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901226 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901227 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000
#> SRR901228 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901230 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901231 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> SRR901232 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.1204 0.956 0.000 0.000 0.056 0.000 0.944 0.000
#> SRR901150 1 0.0260 0.991 0.992 0.008 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0260 0.991 0.992 0.008 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0260 0.991 0.992 0.008 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901154 2 0.3765 0.917 0.000 0.596 0.000 0.000 0.000 0.404
#> SRR901155 2 0.3765 0.917 0.000 0.596 0.000 0.000 0.000 0.404
#> SRR901156 2 0.3765 0.917 0.000 0.596 0.000 0.000 0.000 0.404
#> SRR901157 5 0.1204 0.956 0.000 0.000 0.056 0.000 0.944 0.000
#> SRR901158 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901162 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901163 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901164 6 0.4463 0.715 0.000 0.376 0.000 0.000 0.036 0.588
#> SRR901165 5 0.3563 0.578 0.000 0.000 0.336 0.000 0.664 0.000
#> SRR901166 1 0.0909 0.980 0.968 0.020 0.000 0.000 0.012 0.000
#> SRR901167 1 0.0909 0.980 0.968 0.020 0.000 0.000 0.012 0.000
#> SRR901168 1 0.0909 0.980 0.968 0.020 0.000 0.000 0.012 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901170 6 0.0363 0.612 0.000 0.012 0.000 0.000 0.000 0.988
#> SRR901171 6 0.0000 0.623 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR901172 6 0.0363 0.612 0.000 0.012 0.000 0.000 0.000 0.988
#> SRR901173 5 0.1204 0.956 0.000 0.000 0.056 0.000 0.944 0.000
#> SRR901174 1 0.0909 0.980 0.968 0.020 0.000 0.000 0.012 0.000
#> SRR901175 1 0.0725 0.984 0.976 0.012 0.000 0.000 0.012 0.000
#> SRR901176 6 0.4482 0.708 0.000 0.384 0.000 0.000 0.036 0.580
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901178 6 0.1983 0.616 0.000 0.020 0.000 0.072 0.000 0.908
#> SRR901179 6 0.0547 0.601 0.000 0.020 0.000 0.000 0.000 0.980
#> SRR901180 6 0.2941 0.719 0.000 0.220 0.000 0.000 0.000 0.780
#> SRR901181 5 0.1204 0.956 0.000 0.000 0.056 0.000 0.944 0.000
#> SRR901182 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901187 2 0.3782 0.916 0.000 0.588 0.000 0.000 0.000 0.412
#> SRR901186 2 0.3774 0.919 0.000 0.592 0.000 0.000 0.000 0.408
#> SRR901188 2 0.3774 0.919 0.000 0.592 0.000 0.000 0.000 0.408
#> SRR901189 5 0.1204 0.956 0.000 0.000 0.056 0.000 0.944 0.000
#> SRR901190 1 0.0508 0.988 0.984 0.012 0.000 0.000 0.004 0.000
#> SRR901191 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901194 2 0.3774 0.919 0.000 0.592 0.000 0.000 0.000 0.408
#> SRR901195 2 0.3765 0.917 0.000 0.596 0.000 0.000 0.000 0.404
#> SRR901196 6 0.0632 0.595 0.000 0.024 0.000 0.000 0.000 0.976
#> SRR901197 5 0.1204 0.956 0.000 0.000 0.056 0.000 0.944 0.000
#> SRR901198 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901202 2 0.3774 0.919 0.000 0.592 0.000 0.000 0.000 0.408
#> SRR901203 2 0.3774 0.919 0.000 0.592 0.000 0.000 0.000 0.408
#> SRR901204 2 0.3774 0.919 0.000 0.592 0.000 0.000 0.000 0.408
#> SRR901205 5 0.1204 0.956 0.000 0.000 0.056 0.000 0.944 0.000
#> SRR901206 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901211 2 0.3774 0.919 0.000 0.592 0.000 0.000 0.000 0.408
#> SRR901210 2 0.3774 0.919 0.000 0.592 0.000 0.000 0.000 0.408
#> SRR901212 2 0.3782 0.916 0.000 0.588 0.000 0.000 0.000 0.412
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901214 6 0.3819 0.727 0.000 0.372 0.000 0.000 0.004 0.624
#> SRR901215 6 0.3819 0.727 0.000 0.372 0.000 0.000 0.004 0.624
#> SRR901216 6 0.3819 0.727 0.000 0.372 0.000 0.000 0.004 0.624
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901218 4 0.0622 0.990 0.000 0.012 0.000 0.980 0.008 0.000
#> SRR901219 4 0.0622 0.990 0.000 0.012 0.000 0.980 0.008 0.000
#> SRR901220 4 0.0622 0.990 0.000 0.012 0.000 0.980 0.008 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901222 2 0.2066 0.270 0.000 0.908 0.000 0.000 0.040 0.052
#> SRR901223 2 0.2713 0.248 0.000 0.884 0.000 0.040 0.040 0.036
#> SRR901224 6 0.4463 0.715 0.000 0.376 0.000 0.000 0.036 0.588
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901226 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901227 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901228 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901230 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR901231 4 0.0508 0.991 0.000 0.012 0.000 0.984 0.004 0.000
#> SRR901232 4 0.0508 0.991 0.000 0.012 0.000 0.984 0.004 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "pam"]
# you can also extract it by
# res = res_list["MAD:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.974 0.991 0.4115 0.587 0.587
#> 3 3 1.000 0.975 0.991 0.5576 0.771 0.609
#> 4 4 0.872 0.945 0.960 0.0695 0.961 0.891
#> 5 5 1.000 0.980 0.991 0.1418 0.886 0.650
#> 6 6 1.000 0.979 0.991 0.0541 0.930 0.696
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 5
There is also optional best \(k\) = 2 3 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0376 0.9912 0.004 0.996
#> SRR901150 1 0.0000 0.9784 1.000 0.000
#> SRR901151 1 0.0000 0.9784 1.000 0.000
#> SRR901152 1 0.0000 0.9784 1.000 0.000
#> SRR1382100 2 0.0000 0.9947 0.000 1.000
#> SRR901154 2 0.0000 0.9947 0.000 1.000
#> SRR901155 2 0.0000 0.9947 0.000 1.000
#> SRR901156 2 0.0000 0.9947 0.000 1.000
#> SRR901157 2 0.0000 0.9947 0.000 1.000
#> SRR901158 1 0.0000 0.9784 1.000 0.000
#> SRR901159 1 0.0000 0.9784 1.000 0.000
#> SRR901160 1 0.0000 0.9784 1.000 0.000
#> SRR901161 2 0.0000 0.9947 0.000 1.000
#> SRR901162 2 0.0000 0.9947 0.000 1.000
#> SRR901163 2 0.0376 0.9912 0.004 0.996
#> SRR901164 2 0.0000 0.9947 0.000 1.000
#> SRR901165 2 0.4298 0.9005 0.088 0.912
#> SRR901166 1 0.0000 0.9784 1.000 0.000
#> SRR901167 1 0.0000 0.9784 1.000 0.000
#> SRR901168 1 0.0000 0.9784 1.000 0.000
#> SRR901169 2 0.0000 0.9947 0.000 1.000
#> SRR901170 2 0.0000 0.9947 0.000 1.000
#> SRR901171 2 0.0000 0.9947 0.000 1.000
#> SRR901172 2 0.0000 0.9947 0.000 1.000
#> SRR901173 2 0.0000 0.9947 0.000 1.000
#> SRR901174 1 0.0000 0.9784 1.000 0.000
#> SRR901175 1 0.0000 0.9784 1.000 0.000
#> SRR901176 2 0.0000 0.9947 0.000 1.000
#> SRR901177 2 0.0000 0.9947 0.000 1.000
#> SRR901178 2 0.0000 0.9947 0.000 1.000
#> SRR901179 2 0.0000 0.9947 0.000 1.000
#> SRR901180 2 0.0000 0.9947 0.000 1.000
#> SRR901181 2 0.0000 0.9947 0.000 1.000
#> SRR901182 1 0.0000 0.9784 1.000 0.000
#> SRR901183 1 0.0000 0.9784 1.000 0.000
#> SRR901184 1 0.0000 0.9784 1.000 0.000
#> SRR901185 2 0.0000 0.9947 0.000 1.000
#> SRR901187 2 0.0000 0.9947 0.000 1.000
#> SRR901186 2 0.0000 0.9947 0.000 1.000
#> SRR901188 2 0.0000 0.9947 0.000 1.000
#> SRR901189 2 0.0376 0.9912 0.004 0.996
#> SRR901190 1 0.0000 0.9784 1.000 0.000
#> SRR901191 1 0.0000 0.9784 1.000 0.000
#> SRR901192 1 0.0000 0.9784 1.000 0.000
#> SRR901193 2 0.0000 0.9947 0.000 1.000
#> SRR901194 2 0.0000 0.9947 0.000 1.000
#> SRR901195 2 0.0000 0.9947 0.000 1.000
#> SRR901196 2 0.0000 0.9947 0.000 1.000
#> SRR901197 2 0.0000 0.9947 0.000 1.000
#> SRR901198 1 0.0000 0.9784 1.000 0.000
#> SRR901199 1 0.0000 0.9784 1.000 0.000
#> SRR901200 1 0.0000 0.9784 1.000 0.000
#> SRR901201 2 0.0000 0.9947 0.000 1.000
#> SRR901202 2 0.0000 0.9947 0.000 1.000
#> SRR901203 2 0.0000 0.9947 0.000 1.000
#> SRR901204 2 0.0000 0.9947 0.000 1.000
#> SRR901205 2 0.0000 0.9947 0.000 1.000
#> SRR901206 1 0.0000 0.9784 1.000 0.000
#> SRR901207 1 0.0000 0.9784 1.000 0.000
#> SRR901208 1 0.0000 0.9784 1.000 0.000
#> SRR901209 2 0.0000 0.9947 0.000 1.000
#> SRR901211 2 0.0000 0.9947 0.000 1.000
#> SRR901210 2 0.0000 0.9947 0.000 1.000
#> SRR901212 2 0.0000 0.9947 0.000 1.000
#> SRR901213 2 0.0000 0.9947 0.000 1.000
#> SRR901214 2 0.0000 0.9947 0.000 1.000
#> SRR901215 2 0.0000 0.9947 0.000 1.000
#> SRR901216 2 0.0000 0.9947 0.000 1.000
#> SRR901217 2 0.0000 0.9947 0.000 1.000
#> SRR901218 2 0.0000 0.9947 0.000 1.000
#> SRR901219 2 0.0000 0.9947 0.000 1.000
#> SRR901220 2 0.0000 0.9947 0.000 1.000
#> SRR901221 2 0.0000 0.9947 0.000 1.000
#> SRR901222 2 0.0000 0.9947 0.000 1.000
#> SRR901223 2 0.0000 0.9947 0.000 1.000
#> SRR901224 2 0.0000 0.9947 0.000 1.000
#> SRR901225 2 0.0000 0.9947 0.000 1.000
#> SRR901226 2 0.0000 0.9947 0.000 1.000
#> SRR901227 1 0.9996 0.0289 0.512 0.488
#> SRR901229 2 0.0000 0.9947 0.000 1.000
#> SRR901228 2 0.7219 0.7442 0.200 0.800
#> SRR901230 2 0.0376 0.9912 0.004 0.996
#> SRR901231 2 0.0000 0.9947 0.000 1.000
#> SRR901232 2 0.0000 0.9947 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.103 0.966 0.000 0.024 0.976
#> SRR901150 1 0.000 0.978 1.000 0.000 0.000
#> SRR901151 1 0.000 0.978 1.000 0.000 0.000
#> SRR901152 1 0.000 0.978 1.000 0.000 0.000
#> SRR1382100 3 0.000 0.991 0.000 0.000 1.000
#> SRR901154 2 0.000 0.994 0.000 1.000 0.000
#> SRR901155 2 0.000 0.994 0.000 1.000 0.000
#> SRR901156 2 0.000 0.994 0.000 1.000 0.000
#> SRR901157 3 0.000 0.991 0.000 0.000 1.000
#> SRR901158 1 0.000 0.978 1.000 0.000 0.000
#> SRR901159 1 0.000 0.978 1.000 0.000 0.000
#> SRR901160 1 0.000 0.978 1.000 0.000 0.000
#> SRR901161 3 0.000 0.991 0.000 0.000 1.000
#> SRR901162 2 0.000 0.994 0.000 1.000 0.000
#> SRR901163 2 0.000 0.994 0.000 1.000 0.000
#> SRR901164 2 0.000 0.994 0.000 1.000 0.000
#> SRR901165 3 0.000 0.991 0.000 0.000 1.000
#> SRR901166 1 0.000 0.978 1.000 0.000 0.000
#> SRR901167 1 0.000 0.978 1.000 0.000 0.000
#> SRR901168 1 0.000 0.978 1.000 0.000 0.000
#> SRR901169 3 0.000 0.991 0.000 0.000 1.000
#> SRR901170 2 0.000 0.994 0.000 1.000 0.000
#> SRR901171 2 0.000 0.994 0.000 1.000 0.000
#> SRR901172 2 0.000 0.994 0.000 1.000 0.000
#> SRR901173 2 0.000 0.994 0.000 1.000 0.000
#> SRR901174 1 0.000 0.978 1.000 0.000 0.000
#> SRR901175 1 0.000 0.978 1.000 0.000 0.000
#> SRR901176 2 0.000 0.994 0.000 1.000 0.000
#> SRR901177 3 0.000 0.991 0.000 0.000 1.000
#> SRR901178 2 0.000 0.994 0.000 1.000 0.000
#> SRR901179 2 0.000 0.994 0.000 1.000 0.000
#> SRR901180 2 0.000 0.994 0.000 1.000 0.000
#> SRR901181 3 0.000 0.991 0.000 0.000 1.000
#> SRR901182 1 0.000 0.978 1.000 0.000 0.000
#> SRR901183 1 0.000 0.978 1.000 0.000 0.000
#> SRR901184 1 0.000 0.978 1.000 0.000 0.000
#> SRR901185 3 0.000 0.991 0.000 0.000 1.000
#> SRR901187 2 0.000 0.994 0.000 1.000 0.000
#> SRR901186 2 0.000 0.994 0.000 1.000 0.000
#> SRR901188 2 0.000 0.994 0.000 1.000 0.000
#> SRR901189 3 0.000 0.991 0.000 0.000 1.000
#> SRR901190 1 0.000 0.978 1.000 0.000 0.000
#> SRR901191 1 0.000 0.978 1.000 0.000 0.000
#> SRR901192 1 0.000 0.978 1.000 0.000 0.000
#> SRR901193 3 0.000 0.991 0.000 0.000 1.000
#> SRR901194 2 0.000 0.994 0.000 1.000 0.000
#> SRR901195 2 0.000 0.994 0.000 1.000 0.000
#> SRR901196 2 0.000 0.994 0.000 1.000 0.000
#> SRR901197 3 0.334 0.852 0.000 0.120 0.880
#> SRR901198 1 0.000 0.978 1.000 0.000 0.000
#> SRR901199 1 0.000 0.978 1.000 0.000 0.000
#> SRR901200 1 0.000 0.978 1.000 0.000 0.000
#> SRR901201 3 0.000 0.991 0.000 0.000 1.000
#> SRR901202 2 0.000 0.994 0.000 1.000 0.000
#> SRR901203 2 0.000 0.994 0.000 1.000 0.000
#> SRR901204 2 0.000 0.994 0.000 1.000 0.000
#> SRR901205 3 0.000 0.991 0.000 0.000 1.000
#> SRR901206 1 0.000 0.978 1.000 0.000 0.000
#> SRR901207 1 0.000 0.978 1.000 0.000 0.000
#> SRR901208 1 0.000 0.978 1.000 0.000 0.000
#> SRR901209 3 0.000 0.991 0.000 0.000 1.000
#> SRR901211 2 0.000 0.994 0.000 1.000 0.000
#> SRR901210 2 0.000 0.994 0.000 1.000 0.000
#> SRR901212 2 0.000 0.994 0.000 1.000 0.000
#> SRR901213 3 0.000 0.991 0.000 0.000 1.000
#> SRR901214 2 0.000 0.994 0.000 1.000 0.000
#> SRR901215 2 0.000 0.994 0.000 1.000 0.000
#> SRR901216 2 0.000 0.994 0.000 1.000 0.000
#> SRR901217 3 0.000 0.991 0.000 0.000 1.000
#> SRR901218 2 0.000 0.994 0.000 1.000 0.000
#> SRR901219 2 0.000 0.994 0.000 1.000 0.000
#> SRR901220 2 0.000 0.994 0.000 1.000 0.000
#> SRR901221 3 0.000 0.991 0.000 0.000 1.000
#> SRR901222 2 0.000 0.994 0.000 1.000 0.000
#> SRR901223 2 0.000 0.994 0.000 1.000 0.000
#> SRR901224 2 0.000 0.994 0.000 1.000 0.000
#> SRR901225 3 0.000 0.991 0.000 0.000 1.000
#> SRR901226 2 0.000 0.994 0.000 1.000 0.000
#> SRR901227 1 0.618 0.276 0.584 0.416 0.000
#> SRR901229 3 0.000 0.991 0.000 0.000 1.000
#> SRR901228 2 0.470 0.723 0.212 0.788 0.000
#> SRR901230 2 0.000 0.994 0.000 1.000 0.000
#> SRR901231 2 0.000 0.994 0.000 1.000 0.000
#> SRR901232 2 0.000 0.994 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.2647 0.9712 0.000 0.000 0.12 0.880
#> SRR901150 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901151 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901152 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR1382100 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901154 2 0.0336 0.9511 0.000 0.992 0.00 0.008
#> SRR901155 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901156 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901157 4 0.2647 0.9712 0.000 0.000 0.12 0.880
#> SRR901158 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901159 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901160 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901161 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901162 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901163 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901164 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901165 4 0.2647 0.9712 0.000 0.000 0.12 0.880
#> SRR901166 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901167 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901168 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901169 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901170 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901171 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901172 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901173 4 0.2647 0.8105 0.000 0.120 0.00 0.880
#> SRR901174 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901175 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901176 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901177 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901178 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901179 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901180 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901181 4 0.2647 0.9712 0.000 0.000 0.12 0.880
#> SRR901182 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901183 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901184 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901185 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901187 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901186 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901188 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901189 4 0.2647 0.9712 0.000 0.000 0.12 0.880
#> SRR901190 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901191 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901192 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901193 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901194 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901195 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901196 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901197 4 0.2647 0.9712 0.000 0.000 0.12 0.880
#> SRR901198 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901199 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901200 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901201 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901202 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901203 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901204 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901205 4 0.2647 0.9712 0.000 0.000 0.12 0.880
#> SRR901206 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901207 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901208 1 0.0000 0.9695 1.000 0.000 0.00 0.000
#> SRR901209 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901211 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901210 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901212 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901213 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901214 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901215 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901216 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901217 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901218 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901219 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901220 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901221 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901222 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901223 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901224 2 0.0000 0.9532 0.000 1.000 0.00 0.000
#> SRR901225 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901226 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901227 1 0.7037 -0.0278 0.464 0.416 0.00 0.120
#> SRR901229 3 0.0000 1.0000 0.000 0.000 1.00 0.000
#> SRR901228 2 0.5568 0.7413 0.152 0.728 0.00 0.120
#> SRR901230 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901231 2 0.2647 0.9160 0.000 0.880 0.00 0.120
#> SRR901232 2 0.2647 0.9160 0.000 0.880 0.00 0.120
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901150 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901151 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901152 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR1382100 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901154 4 0.4045 0.456 0 0.356 0 0.644 0
#> SRR901155 4 0.0880 0.942 0 0.032 0 0.968 0
#> SRR901156 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901157 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901158 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901159 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901160 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901161 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901162 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901163 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901164 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901165 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901166 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901167 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901168 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901169 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901170 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901171 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901172 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901173 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901174 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901175 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901176 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901177 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901178 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901179 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901180 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901181 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901182 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901183 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901184 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901185 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901187 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901186 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901188 4 0.0880 0.942 0 0.032 0 0.968 0
#> SRR901189 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901190 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901191 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901192 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901193 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901194 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901195 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901196 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901197 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901198 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901199 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901200 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901201 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901202 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901203 2 0.2471 0.839 0 0.864 0 0.136 0
#> SRR901204 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901205 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901206 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901207 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901208 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901209 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901211 4 0.0880 0.942 0 0.032 0 0.968 0
#> SRR901210 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901212 2 0.0000 0.989 0 1.000 0 0.000 0
#> SRR901213 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901214 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901215 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901216 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901217 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901218 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901219 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901220 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901221 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901222 2 0.1478 0.929 0 0.936 0 0.064 0
#> SRR901223 4 0.0794 0.943 0 0.028 0 0.972 0
#> SRR901224 2 0.0162 0.988 0 0.996 0 0.004 0
#> SRR901225 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901226 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901227 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901229 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901228 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901230 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901231 4 0.0000 0.959 0 0.000 0 1.000 0
#> SRR901232 4 0.0000 0.959 0 0.000 0 1.000 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> SRR901150 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901151 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901152 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901154 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901155 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901156 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901157 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> SRR901158 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901159 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901160 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901162 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901163 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901164 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901165 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> SRR901166 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901167 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901168 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901169 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901170 6 0.3563 0.530 0 0.336 0 0.000 0 0.664
#> SRR901171 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901172 6 0.2854 0.740 0 0.208 0 0.000 0 0.792
#> SRR901173 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> SRR901174 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901175 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901176 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901177 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901178 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901179 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901180 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901181 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> SRR901182 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901183 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901184 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901185 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901187 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901186 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901188 2 0.0146 0.995 0 0.996 0 0.004 0 0.000
#> SRR901189 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> SRR901190 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901191 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901192 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901194 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901195 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901196 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901197 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> SRR901198 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901199 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901200 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901202 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901203 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901204 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901205 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> SRR901206 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901207 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901208 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> SRR901209 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901211 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901210 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901212 2 0.0000 1.000 0 1.000 0 0.000 0 0.000
#> SRR901213 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901214 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901215 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901216 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901217 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901218 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901219 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901220 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901221 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901222 6 0.0790 0.921 0 0.000 0 0.032 0 0.968
#> SRR901223 6 0.2697 0.759 0 0.000 0 0.188 0 0.812
#> SRR901224 6 0.0000 0.944 0 0.000 0 0.000 0 1.000
#> SRR901225 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901226 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901227 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901229 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> SRR901228 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901230 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901231 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
#> SRR901232 4 0.0000 1.000 0 0.000 0 1.000 0 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "mclust"]
# you can also extract it by
# res = res_list["MAD:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.801 0.921 0.939 0.4499 0.523 0.523
#> 3 3 1.000 1.000 1.000 0.4413 0.770 0.583
#> 4 4 0.881 0.954 0.957 0.0624 0.961 0.891
#> 5 5 0.933 0.895 0.957 0.1096 0.901 0.697
#> 6 6 0.931 0.816 0.909 0.0634 0.940 0.744
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 5
There is also optional best \(k\) = 3 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 1 0.827 0.707 0.740 0.260
#> SRR901150 1 0.373 0.906 0.928 0.072
#> SRR901151 1 0.373 0.906 0.928 0.072
#> SRR901152 1 0.373 0.906 0.928 0.072
#> SRR1382100 2 0.373 0.933 0.072 0.928
#> SRR901154 2 0.000 0.978 0.000 1.000
#> SRR901155 2 0.000 0.978 0.000 1.000
#> SRR901156 2 0.000 0.978 0.000 1.000
#> SRR901157 1 0.827 0.707 0.740 0.260
#> SRR901158 1 0.373 0.906 0.928 0.072
#> SRR901159 1 0.373 0.906 0.928 0.072
#> SRR901160 1 0.373 0.906 0.928 0.072
#> SRR901161 2 0.373 0.933 0.072 0.928
#> SRR901162 2 0.000 0.978 0.000 1.000
#> SRR901163 2 0.000 0.978 0.000 1.000
#> SRR901164 2 0.000 0.978 0.000 1.000
#> SRR901165 1 0.827 0.707 0.740 0.260
#> SRR901166 1 0.373 0.906 0.928 0.072
#> SRR901167 1 0.595 0.869 0.856 0.144
#> SRR901168 1 0.373 0.906 0.928 0.072
#> SRR901169 2 0.373 0.933 0.072 0.928
#> SRR901170 2 0.000 0.978 0.000 1.000
#> SRR901171 2 0.000 0.978 0.000 1.000
#> SRR901172 2 0.000 0.978 0.000 1.000
#> SRR901173 1 0.827 0.707 0.740 0.260
#> SRR901174 1 0.595 0.869 0.856 0.144
#> SRR901175 1 0.373 0.906 0.928 0.072
#> SRR901176 1 0.917 0.692 0.668 0.332
#> SRR901177 2 0.373 0.933 0.072 0.928
#> SRR901178 2 0.000 0.978 0.000 1.000
#> SRR901179 2 0.000 0.978 0.000 1.000
#> SRR901180 2 0.000 0.978 0.000 1.000
#> SRR901181 1 0.827 0.707 0.740 0.260
#> SRR901182 1 0.373 0.906 0.928 0.072
#> SRR901183 1 0.373 0.906 0.928 0.072
#> SRR901184 1 0.373 0.906 0.928 0.072
#> SRR901185 2 0.373 0.933 0.072 0.928
#> SRR901187 2 0.000 0.978 0.000 1.000
#> SRR901186 2 0.000 0.978 0.000 1.000
#> SRR901188 2 0.000 0.978 0.000 1.000
#> SRR901189 1 0.827 0.707 0.740 0.260
#> SRR901190 1 0.373 0.906 0.928 0.072
#> SRR901191 1 0.373 0.906 0.928 0.072
#> SRR901192 1 0.373 0.906 0.928 0.072
#> SRR901193 2 0.373 0.933 0.072 0.928
#> SRR901194 2 0.000 0.978 0.000 1.000
#> SRR901195 2 0.000 0.978 0.000 1.000
#> SRR901196 2 0.000 0.978 0.000 1.000
#> SRR901197 1 0.827 0.707 0.740 0.260
#> SRR901198 1 0.373 0.906 0.928 0.072
#> SRR901199 1 0.373 0.906 0.928 0.072
#> SRR901200 1 0.373 0.906 0.928 0.072
#> SRR901201 2 0.373 0.933 0.072 0.928
#> SRR901202 2 0.000 0.978 0.000 1.000
#> SRR901203 2 0.000 0.978 0.000 1.000
#> SRR901204 2 0.000 0.978 0.000 1.000
#> SRR901205 1 0.827 0.707 0.740 0.260
#> SRR901206 1 0.373 0.906 0.928 0.072
#> SRR901207 1 0.373 0.906 0.928 0.072
#> SRR901208 1 0.373 0.906 0.928 0.072
#> SRR901209 2 0.373 0.933 0.072 0.928
#> SRR901211 2 0.000 0.978 0.000 1.000
#> SRR901210 2 0.000 0.978 0.000 1.000
#> SRR901212 2 0.000 0.978 0.000 1.000
#> SRR901213 2 0.373 0.933 0.072 0.928
#> SRR901214 2 0.000 0.978 0.000 1.000
#> SRR901215 2 0.000 0.978 0.000 1.000
#> SRR901216 2 0.000 0.978 0.000 1.000
#> SRR901217 2 0.373 0.933 0.072 0.928
#> SRR901218 2 0.000 0.978 0.000 1.000
#> SRR901219 2 0.000 0.978 0.000 1.000
#> SRR901220 2 0.000 0.978 0.000 1.000
#> SRR901221 2 0.373 0.933 0.072 0.928
#> SRR901222 2 0.000 0.978 0.000 1.000
#> SRR901223 2 0.000 0.978 0.000 1.000
#> SRR901224 2 0.000 0.978 0.000 1.000
#> SRR901225 2 0.373 0.933 0.072 0.928
#> SRR901226 2 0.000 0.978 0.000 1.000
#> SRR901227 2 0.000 0.978 0.000 1.000
#> SRR901229 2 0.373 0.933 0.072 0.928
#> SRR901228 2 0.000 0.978 0.000 1.000
#> SRR901230 2 0.000 0.978 0.000 1.000
#> SRR901231 2 0.000 0.978 0.000 1.000
#> SRR901232 2 0.000 0.978 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0 1 0 0 1
#> SRR901150 1 0 1 1 0 0
#> SRR901151 1 0 1 1 0 0
#> SRR901152 1 0 1 1 0 0
#> SRR1382100 3 0 1 0 0 1
#> SRR901154 2 0 1 0 1 0
#> SRR901155 2 0 1 0 1 0
#> SRR901156 2 0 1 0 1 0
#> SRR901157 3 0 1 0 0 1
#> SRR901158 1 0 1 1 0 0
#> SRR901159 1 0 1 1 0 0
#> SRR901160 1 0 1 1 0 0
#> SRR901161 3 0 1 0 0 1
#> SRR901162 2 0 1 0 1 0
#> SRR901163 2 0 1 0 1 0
#> SRR901164 2 0 1 0 1 0
#> SRR901165 3 0 1 0 0 1
#> SRR901166 1 0 1 1 0 0
#> SRR901167 1 0 1 1 0 0
#> SRR901168 1 0 1 1 0 0
#> SRR901169 3 0 1 0 0 1
#> SRR901170 2 0 1 0 1 0
#> SRR901171 2 0 1 0 1 0
#> SRR901172 2 0 1 0 1 0
#> SRR901173 3 0 1 0 0 1
#> SRR901174 1 0 1 1 0 0
#> SRR901175 1 0 1 1 0 0
#> SRR901176 1 0 1 1 0 0
#> SRR901177 3 0 1 0 0 1
#> SRR901178 2 0 1 0 1 0
#> SRR901179 2 0 1 0 1 0
#> SRR901180 2 0 1 0 1 0
#> SRR901181 3 0 1 0 0 1
#> SRR901182 1 0 1 1 0 0
#> SRR901183 1 0 1 1 0 0
#> SRR901184 1 0 1 1 0 0
#> SRR901185 3 0 1 0 0 1
#> SRR901187 2 0 1 0 1 0
#> SRR901186 2 0 1 0 1 0
#> SRR901188 2 0 1 0 1 0
#> SRR901189 3 0 1 0 0 1
#> SRR901190 1 0 1 1 0 0
#> SRR901191 1 0 1 1 0 0
#> SRR901192 1 0 1 1 0 0
#> SRR901193 3 0 1 0 0 1
#> SRR901194 2 0 1 0 1 0
#> SRR901195 2 0 1 0 1 0
#> SRR901196 2 0 1 0 1 0
#> SRR901197 3 0 1 0 0 1
#> SRR901198 1 0 1 1 0 0
#> SRR901199 1 0 1 1 0 0
#> SRR901200 1 0 1 1 0 0
#> SRR901201 3 0 1 0 0 1
#> SRR901202 2 0 1 0 1 0
#> SRR901203 2 0 1 0 1 0
#> SRR901204 2 0 1 0 1 0
#> SRR901205 3 0 1 0 0 1
#> SRR901206 1 0 1 1 0 0
#> SRR901207 1 0 1 1 0 0
#> SRR901208 1 0 1 1 0 0
#> SRR901209 3 0 1 0 0 1
#> SRR901211 2 0 1 0 1 0
#> SRR901210 2 0 1 0 1 0
#> SRR901212 2 0 1 0 1 0
#> SRR901213 3 0 1 0 0 1
#> SRR901214 2 0 1 0 1 0
#> SRR901215 2 0 1 0 1 0
#> SRR901216 2 0 1 0 1 0
#> SRR901217 3 0 1 0 0 1
#> SRR901218 2 0 1 0 1 0
#> SRR901219 2 0 1 0 1 0
#> SRR901220 2 0 1 0 1 0
#> SRR901221 3 0 1 0 0 1
#> SRR901222 2 0 1 0 1 0
#> SRR901223 2 0 1 0 1 0
#> SRR901224 2 0 1 0 1 0
#> SRR901225 3 0 1 0 0 1
#> SRR901226 2 0 1 0 1 0
#> SRR901227 2 0 1 0 1 0
#> SRR901229 3 0 1 0 0 1
#> SRR901228 2 0 1 0 1 0
#> SRR901230 2 0 1 0 1 0
#> SRR901231 2 0 1 0 1 0
#> SRR901232 2 0 1 0 1 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.2921 0.914 0.000 0.000 0.14 0.860
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901154 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901155 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901156 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901157 4 0.2921 0.914 0.000 0.000 0.14 0.860
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901162 2 0.3024 0.900 0.000 0.852 0.00 0.148
#> SRR901163 2 0.3024 0.900 0.000 0.852 0.00 0.148
#> SRR901164 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901165 4 0.2921 0.914 0.000 0.000 0.14 0.860
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901170 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901171 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901172 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901173 4 0.2921 0.914 0.000 0.000 0.14 0.860
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901176 4 0.7621 0.376 0.236 0.296 0.00 0.468
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901178 2 0.2216 0.923 0.000 0.908 0.00 0.092
#> SRR901179 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901180 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901181 4 0.2921 0.914 0.000 0.000 0.14 0.860
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901187 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901186 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901188 2 0.2921 0.904 0.000 0.860 0.00 0.140
#> SRR901189 4 0.2921 0.914 0.000 0.000 0.14 0.860
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901194 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901195 2 0.0188 0.951 0.000 0.996 0.00 0.004
#> SRR901196 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901197 4 0.2921 0.914 0.000 0.000 0.14 0.860
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901202 2 0.0188 0.951 0.000 0.996 0.00 0.004
#> SRR901203 2 0.0188 0.951 0.000 0.996 0.00 0.004
#> SRR901204 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901205 4 0.2921 0.914 0.000 0.000 0.14 0.860
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.00 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901211 2 0.1637 0.935 0.000 0.940 0.00 0.060
#> SRR901210 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901212 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901214 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901215 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901216 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901218 2 0.2921 0.904 0.000 0.860 0.00 0.140
#> SRR901219 2 0.2921 0.904 0.000 0.860 0.00 0.140
#> SRR901220 2 0.2921 0.904 0.000 0.860 0.00 0.140
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901222 2 0.0000 0.952 0.000 1.000 0.00 0.000
#> SRR901223 2 0.0188 0.951 0.000 0.996 0.00 0.004
#> SRR901224 2 0.1118 0.930 0.000 0.964 0.00 0.036
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901226 2 0.3024 0.900 0.000 0.852 0.00 0.148
#> SRR901227 2 0.3024 0.900 0.000 0.852 0.00 0.148
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.00 0.000
#> SRR901228 2 0.3024 0.900 0.000 0.852 0.00 0.148
#> SRR901230 2 0.3024 0.900 0.000 0.852 0.00 0.148
#> SRR901231 2 0.2973 0.902 0.000 0.856 0.00 0.144
#> SRR901232 2 0.3024 0.900 0.000 0.852 0.00 0.148
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0000 1.000 0 0.000 0 0.000 1.000
#> SRR901150 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901151 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901152 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901154 2 0.4045 0.446 0 0.644 0 0.356 0.000
#> SRR901155 2 0.3983 0.483 0 0.660 0 0.340 0.000
#> SRR901156 2 0.0162 0.900 0 0.996 0 0.004 0.000
#> SRR901157 5 0.0000 1.000 0 0.000 0 0.000 1.000
#> SRR901158 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901159 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901160 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901161 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901162 4 0.0000 0.798 0 0.000 0 1.000 0.000
#> SRR901163 4 0.0000 0.798 0 0.000 0 1.000 0.000
#> SRR901164 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901165 5 0.0000 1.000 0 0.000 0 0.000 1.000
#> SRR901166 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901167 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901168 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901169 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901170 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901171 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901172 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901173 5 0.0000 1.000 0 0.000 0 0.000 1.000
#> SRR901174 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901175 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901176 2 0.2813 0.731 0 0.832 0 0.000 0.168
#> SRR901177 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901178 2 0.2966 0.754 0 0.816 0 0.184 0.000
#> SRR901179 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901180 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901181 5 0.0000 1.000 0 0.000 0 0.000 1.000
#> SRR901182 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901183 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901184 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901185 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901187 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901186 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901188 2 0.4074 0.425 0 0.636 0 0.364 0.000
#> SRR901189 5 0.0000 1.000 0 0.000 0 0.000 1.000
#> SRR901190 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901191 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901192 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901193 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901194 2 0.0510 0.897 0 0.984 0 0.016 0.000
#> SRR901195 2 0.0609 0.895 0 0.980 0 0.020 0.000
#> SRR901196 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901197 5 0.0000 1.000 0 0.000 0 0.000 1.000
#> SRR901198 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901199 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901200 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901201 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901202 2 0.0510 0.897 0 0.984 0 0.016 0.000
#> SRR901203 2 0.2074 0.840 0 0.896 0 0.104 0.000
#> SRR901204 2 0.0703 0.893 0 0.976 0 0.024 0.000
#> SRR901205 5 0.0000 1.000 0 0.000 0 0.000 1.000
#> SRR901206 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901207 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901208 1 0.0000 1.000 1 0.000 0 0.000 0.000
#> SRR901209 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901211 2 0.4060 0.436 0 0.640 0 0.360 0.000
#> SRR901210 2 0.1965 0.846 0 0.904 0 0.096 0.000
#> SRR901212 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901213 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901214 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901215 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901216 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901217 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901218 4 0.4171 0.380 0 0.396 0 0.604 0.000
#> SRR901219 4 0.4161 0.390 0 0.392 0 0.608 0.000
#> SRR901220 4 0.4171 0.380 0 0.396 0 0.604 0.000
#> SRR901221 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901222 2 0.1478 0.870 0 0.936 0 0.064 0.000
#> SRR901223 2 0.2813 0.774 0 0.832 0 0.168 0.000
#> SRR901224 2 0.0000 0.900 0 1.000 0 0.000 0.000
#> SRR901225 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901226 4 0.0000 0.798 0 0.000 0 1.000 0.000
#> SRR901227 4 0.0000 0.798 0 0.000 0 1.000 0.000
#> SRR901229 3 0.0000 1.000 0 0.000 1 0.000 0.000
#> SRR901228 4 0.0000 0.798 0 0.000 0 1.000 0.000
#> SRR901230 4 0.0000 0.798 0 0.000 0 1.000 0.000
#> SRR901231 4 0.2773 0.724 0 0.164 0 0.836 0.000
#> SRR901232 4 0.0000 0.798 0 0.000 0 1.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 1.000 0.000 0.000 0 0.000 1.000 0.000
#> SRR901150 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901154 2 0.0935 0.773 0.000 0.964 0 0.004 0.000 0.032
#> SRR901155 2 0.0790 0.775 0.000 0.968 0 0.000 0.000 0.032
#> SRR901156 2 0.3860 -0.421 0.000 0.528 0 0.000 0.000 0.472
#> SRR901157 5 0.0000 1.000 0.000 0.000 0 0.000 1.000 0.000
#> SRR901158 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901162 4 0.0000 0.845 0.000 0.000 0 1.000 0.000 0.000
#> SRR901163 4 0.0000 0.845 0.000 0.000 0 1.000 0.000 0.000
#> SRR901164 6 0.1075 0.618 0.000 0.048 0 0.000 0.000 0.952
#> SRR901165 5 0.0000 1.000 0.000 0.000 0 0.000 1.000 0.000
#> SRR901166 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901167 1 0.0363 0.990 0.988 0.000 0 0.000 0.000 0.012
#> SRR901168 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901170 6 0.3592 0.761 0.000 0.344 0 0.000 0.000 0.656
#> SRR901171 6 0.3592 0.761 0.000 0.344 0 0.000 0.000 0.656
#> SRR901172 6 0.3592 0.761 0.000 0.344 0 0.000 0.000 0.656
#> SRR901173 5 0.0000 1.000 0.000 0.000 0 0.000 1.000 0.000
#> SRR901174 1 0.0363 0.990 0.988 0.000 0 0.000 0.000 0.012
#> SRR901175 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901176 6 0.3710 0.164 0.000 0.012 0 0.000 0.292 0.696
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901178 2 0.0717 0.753 0.000 0.976 0 0.008 0.000 0.016
#> SRR901179 6 0.3592 0.761 0.000 0.344 0 0.000 0.000 0.656
#> SRR901180 6 0.3151 0.724 0.000 0.252 0 0.000 0.000 0.748
#> SRR901181 5 0.0000 1.000 0.000 0.000 0 0.000 1.000 0.000
#> SRR901182 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901187 6 0.3860 0.513 0.000 0.472 0 0.000 0.000 0.528
#> SRR901186 2 0.3804 -0.262 0.000 0.576 0 0.000 0.000 0.424
#> SRR901188 2 0.4405 -0.409 0.000 0.504 0 0.472 0.000 0.024
#> SRR901189 5 0.0000 1.000 0.000 0.000 0 0.000 1.000 0.000
#> SRR901190 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901194 2 0.0865 0.774 0.000 0.964 0 0.000 0.000 0.036
#> SRR901195 2 0.0865 0.774 0.000 0.964 0 0.000 0.000 0.036
#> SRR901196 6 0.1075 0.618 0.000 0.048 0 0.000 0.000 0.952
#> SRR901197 5 0.0000 1.000 0.000 0.000 0 0.000 1.000 0.000
#> SRR901198 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901202 2 0.3756 -0.180 0.000 0.600 0 0.000 0.000 0.400
#> SRR901203 2 0.0790 0.775 0.000 0.968 0 0.000 0.000 0.032
#> SRR901204 2 0.0865 0.774 0.000 0.964 0 0.000 0.000 0.036
#> SRR901205 5 0.0000 1.000 0.000 0.000 0 0.000 1.000 0.000
#> SRR901206 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.999 1.000 0.000 0 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901211 2 0.1411 0.706 0.000 0.936 0 0.060 0.000 0.004
#> SRR901210 2 0.0790 0.775 0.000 0.968 0 0.000 0.000 0.032
#> SRR901212 6 0.3765 0.669 0.000 0.404 0 0.000 0.000 0.596
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901214 6 0.3592 0.761 0.000 0.344 0 0.000 0.000 0.656
#> SRR901215 6 0.3592 0.761 0.000 0.344 0 0.000 0.000 0.656
#> SRR901216 6 0.3592 0.761 0.000 0.344 0 0.000 0.000 0.656
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901218 4 0.4544 0.496 0.000 0.416 0 0.548 0.000 0.036
#> SRR901219 4 0.4544 0.496 0.000 0.416 0 0.548 0.000 0.036
#> SRR901220 4 0.4544 0.496 0.000 0.416 0 0.548 0.000 0.036
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901222 2 0.0865 0.774 0.000 0.964 0 0.000 0.000 0.036
#> SRR901223 2 0.0146 0.756 0.000 0.996 0 0.000 0.000 0.004
#> SRR901224 6 0.1075 0.618 0.000 0.048 0 0.000 0.000 0.952
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901226 4 0.0000 0.845 0.000 0.000 0 1.000 0.000 0.000
#> SRR901227 4 0.0000 0.845 0.000 0.000 0 1.000 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> SRR901228 4 0.0000 0.845 0.000 0.000 0 1.000 0.000 0.000
#> SRR901230 4 0.0000 0.845 0.000 0.000 0 1.000 0.000 0.000
#> SRR901231 4 0.2294 0.807 0.000 0.072 0 0.892 0.000 0.036
#> SRR901232 4 0.0146 0.844 0.000 0.004 0 0.996 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "NMF"]
# you can also extract it by
# res = res_list["MAD:NMF"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.561 0.755 0.897 0.4754 0.501 0.501
#> 3 3 1.000 0.956 0.983 0.3779 0.679 0.450
#> 4 4 0.900 0.907 0.939 0.0749 0.944 0.840
#> 5 5 0.894 0.872 0.923 0.0691 0.919 0.736
#> 6 6 0.975 0.927 0.968 0.0376 0.987 0.944
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4
There is also optional best \(k\) = 3 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0000 0.850 0.000 1.000
#> SRR901150 1 0.0000 0.898 1.000 0.000
#> SRR901151 1 0.0000 0.898 1.000 0.000
#> SRR901152 1 0.0000 0.898 1.000 0.000
#> SRR1382100 2 0.0000 0.850 0.000 1.000
#> SRR901154 1 0.9087 0.420 0.676 0.324
#> SRR901155 1 0.8608 0.509 0.716 0.284
#> SRR901156 2 0.8267 0.705 0.260 0.740
#> SRR901157 2 0.0000 0.850 0.000 1.000
#> SRR901158 1 0.0000 0.898 1.000 0.000
#> SRR901159 1 0.0000 0.898 1.000 0.000
#> SRR901160 1 0.0000 0.898 1.000 0.000
#> SRR901161 2 0.0000 0.850 0.000 1.000
#> SRR901162 1 0.0938 0.889 0.988 0.012
#> SRR901163 1 0.0000 0.898 1.000 0.000
#> SRR901164 2 0.7376 0.756 0.208 0.792
#> SRR901165 2 0.0000 0.850 0.000 1.000
#> SRR901166 1 0.0000 0.898 1.000 0.000
#> SRR901167 1 0.0000 0.898 1.000 0.000
#> SRR901168 1 0.0000 0.898 1.000 0.000
#> SRR901169 2 0.0000 0.850 0.000 1.000
#> SRR901170 2 0.2043 0.842 0.032 0.968
#> SRR901171 2 0.3584 0.829 0.068 0.932
#> SRR901172 2 0.0000 0.850 0.000 1.000
#> SRR901173 2 0.0000 0.850 0.000 1.000
#> SRR901174 1 0.0000 0.898 1.000 0.000
#> SRR901175 1 0.0000 0.898 1.000 0.000
#> SRR901176 2 0.9522 0.528 0.372 0.628
#> SRR901177 2 0.0000 0.850 0.000 1.000
#> SRR901178 2 0.8016 0.722 0.244 0.756
#> SRR901179 2 0.7299 0.759 0.204 0.796
#> SRR901180 2 0.7219 0.762 0.200 0.800
#> SRR901181 2 0.0000 0.850 0.000 1.000
#> SRR901182 1 0.0000 0.898 1.000 0.000
#> SRR901183 1 0.0000 0.898 1.000 0.000
#> SRR901184 1 0.0000 0.898 1.000 0.000
#> SRR901185 2 0.0000 0.850 0.000 1.000
#> SRR901187 2 0.6973 0.770 0.188 0.812
#> SRR901186 2 0.7219 0.762 0.200 0.800
#> SRR901188 1 1.0000 -0.192 0.500 0.500
#> SRR901189 2 0.0000 0.850 0.000 1.000
#> SRR901190 1 0.0000 0.898 1.000 0.000
#> SRR901191 1 0.0000 0.898 1.000 0.000
#> SRR901192 1 0.0000 0.898 1.000 0.000
#> SRR901193 2 0.0000 0.850 0.000 1.000
#> SRR901194 1 0.9998 -0.162 0.508 0.492
#> SRR901195 1 0.9661 0.226 0.608 0.392
#> SRR901196 2 0.7056 0.767 0.192 0.808
#> SRR901197 2 0.0000 0.850 0.000 1.000
#> SRR901198 1 0.0000 0.898 1.000 0.000
#> SRR901199 1 0.0000 0.898 1.000 0.000
#> SRR901200 1 0.0000 0.898 1.000 0.000
#> SRR901201 2 0.0000 0.850 0.000 1.000
#> SRR901202 2 0.7950 0.726 0.240 0.760
#> SRR901203 2 0.9686 0.476 0.396 0.604
#> SRR901204 2 0.9944 0.310 0.456 0.544
#> SRR901205 2 0.0000 0.850 0.000 1.000
#> SRR901206 1 0.0000 0.898 1.000 0.000
#> SRR901207 1 0.0000 0.898 1.000 0.000
#> SRR901208 1 0.0000 0.898 1.000 0.000
#> SRR901209 2 0.0000 0.850 0.000 1.000
#> SRR901211 1 0.9988 -0.117 0.520 0.480
#> SRR901210 2 0.9580 0.512 0.380 0.620
#> SRR901212 2 0.2236 0.840 0.036 0.964
#> SRR901213 2 0.0000 0.850 0.000 1.000
#> SRR901214 2 0.0000 0.850 0.000 1.000
#> SRR901215 2 0.0000 0.850 0.000 1.000
#> SRR901216 2 0.0000 0.850 0.000 1.000
#> SRR901217 2 0.0000 0.850 0.000 1.000
#> SRR901218 2 0.9710 0.466 0.400 0.600
#> SRR901219 1 0.9358 0.348 0.648 0.352
#> SRR901220 1 0.0000 0.898 1.000 0.000
#> SRR901221 2 0.0000 0.850 0.000 1.000
#> SRR901222 2 0.9970 0.271 0.468 0.532
#> SRR901223 1 0.1184 0.885 0.984 0.016
#> SRR901224 2 0.9608 0.503 0.384 0.616
#> SRR901225 2 0.0000 0.850 0.000 1.000
#> SRR901226 1 0.2236 0.867 0.964 0.036
#> SRR901227 1 0.0000 0.898 1.000 0.000
#> SRR901229 2 0.0000 0.850 0.000 1.000
#> SRR901228 1 0.0000 0.898 1.000 0.000
#> SRR901230 2 0.8813 0.653 0.300 0.700
#> SRR901231 2 0.8267 0.704 0.260 0.740
#> SRR901232 2 0.8955 0.634 0.312 0.688
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.000 1.000 0.000 0.000 1.000
#> SRR901150 1 0.000 0.960 1.000 0.000 0.000
#> SRR901151 1 0.000 0.960 1.000 0.000 0.000
#> SRR901152 1 0.000 0.960 1.000 0.000 0.000
#> SRR1382100 3 0.000 1.000 0.000 0.000 1.000
#> SRR901154 2 0.000 0.983 0.000 1.000 0.000
#> SRR901155 2 0.000 0.983 0.000 1.000 0.000
#> SRR901156 2 0.000 0.983 0.000 1.000 0.000
#> SRR901157 3 0.000 1.000 0.000 0.000 1.000
#> SRR901158 1 0.000 0.960 1.000 0.000 0.000
#> SRR901159 1 0.000 0.960 1.000 0.000 0.000
#> SRR901160 1 0.000 0.960 1.000 0.000 0.000
#> SRR901161 3 0.000 1.000 0.000 0.000 1.000
#> SRR901162 2 0.000 0.983 0.000 1.000 0.000
#> SRR901163 1 0.628 0.182 0.540 0.460 0.000
#> SRR901164 2 0.000 0.983 0.000 1.000 0.000
#> SRR901165 3 0.000 1.000 0.000 0.000 1.000
#> SRR901166 1 0.000 0.960 1.000 0.000 0.000
#> SRR901167 1 0.000 0.960 1.000 0.000 0.000
#> SRR901168 1 0.000 0.960 1.000 0.000 0.000
#> SRR901169 3 0.000 1.000 0.000 0.000 1.000
#> SRR901170 2 0.000 0.983 0.000 1.000 0.000
#> SRR901171 2 0.000 0.983 0.000 1.000 0.000
#> SRR901172 2 0.000 0.983 0.000 1.000 0.000
#> SRR901173 3 0.000 1.000 0.000 0.000 1.000
#> SRR901174 1 0.000 0.960 1.000 0.000 0.000
#> SRR901175 1 0.000 0.960 1.000 0.000 0.000
#> SRR901176 2 0.445 0.746 0.192 0.808 0.000
#> SRR901177 3 0.000 1.000 0.000 0.000 1.000
#> SRR901178 2 0.000 0.983 0.000 1.000 0.000
#> SRR901179 2 0.000 0.983 0.000 1.000 0.000
#> SRR901180 2 0.000 0.983 0.000 1.000 0.000
#> SRR901181 3 0.000 1.000 0.000 0.000 1.000
#> SRR901182 1 0.000 0.960 1.000 0.000 0.000
#> SRR901183 1 0.000 0.960 1.000 0.000 0.000
#> SRR901184 1 0.000 0.960 1.000 0.000 0.000
#> SRR901185 3 0.000 1.000 0.000 0.000 1.000
#> SRR901187 2 0.000 0.983 0.000 1.000 0.000
#> SRR901186 2 0.000 0.983 0.000 1.000 0.000
#> SRR901188 2 0.000 0.983 0.000 1.000 0.000
#> SRR901189 3 0.000 1.000 0.000 0.000 1.000
#> SRR901190 1 0.000 0.960 1.000 0.000 0.000
#> SRR901191 1 0.000 0.960 1.000 0.000 0.000
#> SRR901192 1 0.000 0.960 1.000 0.000 0.000
#> SRR901193 3 0.000 1.000 0.000 0.000 1.000
#> SRR901194 2 0.000 0.983 0.000 1.000 0.000
#> SRR901195 2 0.000 0.983 0.000 1.000 0.000
#> SRR901196 2 0.000 0.983 0.000 1.000 0.000
#> SRR901197 3 0.000 1.000 0.000 0.000 1.000
#> SRR901198 1 0.000 0.960 1.000 0.000 0.000
#> SRR901199 1 0.000 0.960 1.000 0.000 0.000
#> SRR901200 1 0.000 0.960 1.000 0.000 0.000
#> SRR901201 3 0.000 1.000 0.000 0.000 1.000
#> SRR901202 2 0.000 0.983 0.000 1.000 0.000
#> SRR901203 2 0.000 0.983 0.000 1.000 0.000
#> SRR901204 2 0.000 0.983 0.000 1.000 0.000
#> SRR901205 3 0.000 1.000 0.000 0.000 1.000
#> SRR901206 1 0.000 0.960 1.000 0.000 0.000
#> SRR901207 1 0.000 0.960 1.000 0.000 0.000
#> SRR901208 1 0.000 0.960 1.000 0.000 0.000
#> SRR901209 3 0.000 1.000 0.000 0.000 1.000
#> SRR901211 2 0.000 0.983 0.000 1.000 0.000
#> SRR901210 2 0.000 0.983 0.000 1.000 0.000
#> SRR901212 2 0.000 0.983 0.000 1.000 0.000
#> SRR901213 3 0.000 1.000 0.000 0.000 1.000
#> SRR901214 2 0.000 0.983 0.000 1.000 0.000
#> SRR901215 2 0.000 0.983 0.000 1.000 0.000
#> SRR901216 2 0.000 0.983 0.000 1.000 0.000
#> SRR901217 3 0.000 1.000 0.000 0.000 1.000
#> SRR901218 2 0.000 0.983 0.000 1.000 0.000
#> SRR901219 2 0.000 0.983 0.000 1.000 0.000
#> SRR901220 2 0.000 0.983 0.000 1.000 0.000
#> SRR901221 3 0.000 1.000 0.000 0.000 1.000
#> SRR901222 2 0.000 0.983 0.000 1.000 0.000
#> SRR901223 2 0.000 0.983 0.000 1.000 0.000
#> SRR901224 2 0.000 0.983 0.000 1.000 0.000
#> SRR901225 3 0.000 1.000 0.000 0.000 1.000
#> SRR901226 2 0.000 0.983 0.000 1.000 0.000
#> SRR901227 1 0.460 0.746 0.796 0.204 0.000
#> SRR901229 3 0.000 1.000 0.000 0.000 1.000
#> SRR901228 1 0.455 0.751 0.800 0.200 0.000
#> SRR901230 2 0.645 0.367 0.008 0.608 0.384
#> SRR901231 2 0.000 0.983 0.000 1.000 0.000
#> SRR901232 2 0.000 0.983 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 4 0.0336 0.923 0.000 0.000 0.008 0.992
#> SRR901150 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.3528 0.942 0.000 0.000 0.808 0.192
#> SRR901154 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901155 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901156 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901157 4 0.0336 0.923 0.000 0.000 0.008 0.992
#> SRR901158 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901161 3 0.3569 0.942 0.000 0.000 0.804 0.196
#> SRR901162 2 0.3791 0.820 0.004 0.796 0.200 0.000
#> SRR901163 1 0.7591 0.140 0.444 0.352 0.204 0.000
#> SRR901164 2 0.0469 0.954 0.000 0.988 0.000 0.012
#> SRR901165 4 0.3219 0.715 0.000 0.000 0.164 0.836
#> SRR901166 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901167 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901168 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901169 3 0.3528 0.942 0.000 0.000 0.808 0.192
#> SRR901170 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901171 2 0.0336 0.955 0.000 0.992 0.000 0.008
#> SRR901172 2 0.0336 0.955 0.000 0.992 0.000 0.008
#> SRR901173 4 0.0336 0.923 0.000 0.000 0.008 0.992
#> SRR901174 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901175 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901176 4 0.3688 0.637 0.000 0.208 0.000 0.792
#> SRR901177 3 0.3610 0.939 0.000 0.000 0.800 0.200
#> SRR901178 2 0.1389 0.933 0.000 0.952 0.048 0.000
#> SRR901179 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901180 2 0.0336 0.955 0.000 0.992 0.000 0.008
#> SRR901181 4 0.0469 0.923 0.000 0.000 0.012 0.988
#> SRR901182 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901185 3 0.3569 0.942 0.000 0.000 0.804 0.196
#> SRR901187 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901186 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901188 2 0.1389 0.933 0.000 0.952 0.048 0.000
#> SRR901189 4 0.0469 0.923 0.000 0.000 0.012 0.988
#> SRR901190 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901193 3 0.3610 0.939 0.000 0.000 0.800 0.200
#> SRR901194 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901195 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901196 2 0.0336 0.955 0.000 0.992 0.000 0.008
#> SRR901197 4 0.0336 0.923 0.000 0.000 0.008 0.992
#> SRR901198 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901201 3 0.3610 0.939 0.000 0.000 0.800 0.200
#> SRR901202 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901203 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901204 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901205 4 0.0469 0.923 0.000 0.000 0.012 0.988
#> SRR901206 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> SRR901209 3 0.3569 0.942 0.000 0.000 0.804 0.196
#> SRR901211 2 0.0188 0.956 0.000 0.996 0.004 0.000
#> SRR901210 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901212 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901213 3 0.3528 0.942 0.000 0.000 0.808 0.192
#> SRR901214 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901215 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901216 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901217 3 0.3528 0.942 0.000 0.000 0.808 0.192
#> SRR901218 2 0.3444 0.838 0.000 0.816 0.184 0.000
#> SRR901219 2 0.3266 0.851 0.000 0.832 0.168 0.000
#> SRR901220 2 0.3172 0.857 0.000 0.840 0.160 0.000
#> SRR901221 3 0.3569 0.942 0.000 0.000 0.804 0.196
#> SRR901222 2 0.0188 0.957 0.000 0.996 0.000 0.004
#> SRR901223 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901224 2 0.0707 0.948 0.000 0.980 0.000 0.020
#> SRR901225 3 0.3311 0.921 0.000 0.000 0.828 0.172
#> SRR901226 2 0.3870 0.812 0.004 0.788 0.208 0.000
#> SRR901227 1 0.5448 0.668 0.724 0.080 0.196 0.000
#> SRR901229 3 0.3486 0.939 0.000 0.000 0.812 0.188
#> SRR901228 1 0.5491 0.634 0.688 0.052 0.260 0.000
#> SRR901230 3 0.4008 0.322 0.000 0.244 0.756 0.000
#> SRR901231 2 0.3400 0.841 0.000 0.820 0.180 0.000
#> SRR901232 2 0.3610 0.824 0.000 0.800 0.200 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0510 0.9442 0.000 0.000 0.016 0.000 0.984
#> SRR901150 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901154 2 0.0162 0.9065 0.000 0.996 0.000 0.004 0.000
#> SRR901155 2 0.0162 0.9065 0.000 0.996 0.000 0.004 0.000
#> SRR901156 2 0.0162 0.9065 0.000 0.996 0.000 0.004 0.000
#> SRR901157 5 0.0510 0.9442 0.000 0.000 0.016 0.000 0.984
#> SRR901158 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901162 4 0.5333 0.7336 0.068 0.300 0.004 0.628 0.000
#> SRR901163 4 0.5569 0.6436 0.228 0.136 0.000 0.636 0.000
#> SRR901164 2 0.3990 0.5201 0.000 0.688 0.000 0.308 0.004
#> SRR901165 5 0.2653 0.8728 0.000 0.000 0.096 0.024 0.880
#> SRR901166 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901167 1 0.0566 0.9832 0.984 0.000 0.000 0.004 0.012
#> SRR901168 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901169 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901170 2 0.0162 0.9065 0.000 0.996 0.000 0.004 0.000
#> SRR901171 2 0.0162 0.9065 0.000 0.996 0.000 0.004 0.000
#> SRR901172 2 0.0000 0.9064 0.000 1.000 0.000 0.000 0.000
#> SRR901173 5 0.0671 0.9427 0.000 0.000 0.016 0.004 0.980
#> SRR901174 1 0.1764 0.9262 0.928 0.000 0.000 0.064 0.008
#> SRR901175 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901176 5 0.5617 0.5958 0.000 0.072 0.004 0.364 0.560
#> SRR901177 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901178 2 0.0609 0.8961 0.000 0.980 0.000 0.020 0.000
#> SRR901179 2 0.0162 0.9065 0.000 0.996 0.000 0.004 0.000
#> SRR901180 2 0.0162 0.9065 0.000 0.996 0.000 0.004 0.000
#> SRR901181 5 0.0510 0.9442 0.000 0.000 0.016 0.000 0.984
#> SRR901182 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901187 2 0.0290 0.9030 0.000 0.992 0.000 0.008 0.000
#> SRR901186 2 0.0290 0.9030 0.000 0.992 0.000 0.008 0.000
#> SRR901188 2 0.0794 0.8873 0.000 0.972 0.000 0.028 0.000
#> SRR901189 5 0.0510 0.9442 0.000 0.000 0.016 0.000 0.984
#> SRR901190 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0162 0.9952 0.000 0.000 0.996 0.000 0.004
#> SRR901194 2 0.0000 0.9064 0.000 1.000 0.000 0.000 0.000
#> SRR901195 2 0.0000 0.9064 0.000 1.000 0.000 0.000 0.000
#> SRR901196 2 0.0000 0.9064 0.000 1.000 0.000 0.000 0.000
#> SRR901197 5 0.0510 0.9442 0.000 0.000 0.016 0.000 0.984
#> SRR901198 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901202 2 0.0000 0.9064 0.000 1.000 0.000 0.000 0.000
#> SRR901203 2 0.0162 0.9053 0.000 0.996 0.000 0.004 0.000
#> SRR901204 2 0.0000 0.9064 0.000 1.000 0.000 0.000 0.000
#> SRR901205 5 0.0510 0.9442 0.000 0.000 0.016 0.000 0.984
#> SRR901206 1 0.0162 0.9927 0.996 0.000 0.000 0.004 0.000
#> SRR901207 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.9959 1.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901211 2 0.0162 0.9057 0.000 0.996 0.000 0.004 0.000
#> SRR901210 2 0.0000 0.9064 0.000 1.000 0.000 0.000 0.000
#> SRR901212 2 0.0000 0.9064 0.000 1.000 0.000 0.000 0.000
#> SRR901213 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901214 2 0.5320 0.0873 0.000 0.524 0.000 0.052 0.424
#> SRR901215 2 0.0404 0.9017 0.000 0.988 0.000 0.012 0.000
#> SRR901216 2 0.4469 0.5745 0.000 0.756 0.000 0.096 0.148
#> SRR901217 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901218 4 0.4088 0.6958 0.000 0.368 0.000 0.632 0.000
#> SRR901219 4 0.4101 0.6911 0.000 0.372 0.000 0.628 0.000
#> SRR901220 2 0.4291 -0.3449 0.000 0.536 0.000 0.464 0.000
#> SRR901221 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901222 2 0.0162 0.9065 0.000 0.996 0.000 0.004 0.000
#> SRR901223 2 0.0510 0.9006 0.000 0.984 0.000 0.016 0.000
#> SRR901224 2 0.4047 0.5024 0.000 0.676 0.000 0.320 0.004
#> SRR901225 3 0.0162 0.9958 0.000 0.000 0.996 0.004 0.000
#> SRR901226 4 0.5176 0.7329 0.040 0.312 0.012 0.636 0.000
#> SRR901227 4 0.4955 0.5063 0.328 0.036 0.004 0.632 0.000
#> SRR901229 3 0.0000 0.9993 0.000 0.000 1.000 0.000 0.000
#> SRR901228 4 0.4618 0.4488 0.344 0.004 0.016 0.636 0.000
#> SRR901230 4 0.5581 0.5801 0.000 0.140 0.224 0.636 0.000
#> SRR901231 4 0.4219 0.6135 0.000 0.416 0.000 0.584 0.000
#> SRR901232 4 0.4225 0.6993 0.000 0.364 0.004 0.632 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 0.984 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901150 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901154 2 0.0291 0.939 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR901155 2 0.0508 0.939 0.000 0.984 0.000 0.012 0.000 0.004
#> SRR901156 2 0.0000 0.939 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR901157 5 0.0000 0.984 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901158 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901162 4 0.1615 0.907 0.004 0.064 0.000 0.928 0.000 0.004
#> SRR901163 4 0.1036 0.940 0.008 0.024 0.000 0.964 0.000 0.004
#> SRR901164 2 0.3672 0.486 0.000 0.632 0.000 0.000 0.000 0.368
#> SRR901165 5 0.2151 0.894 0.000 0.000 0.048 0.016 0.912 0.024
#> SRR901166 1 0.0458 0.975 0.984 0.000 0.000 0.016 0.000 0.000
#> SRR901167 1 0.2250 0.884 0.888 0.000 0.000 0.020 0.000 0.092
#> SRR901168 1 0.0458 0.975 0.984 0.000 0.000 0.016 0.000 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901170 2 0.0146 0.938 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR901171 2 0.0547 0.933 0.000 0.980 0.000 0.000 0.000 0.020
#> SRR901172 2 0.0146 0.938 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR901173 5 0.0000 0.984 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901174 1 0.2869 0.816 0.832 0.000 0.000 0.020 0.000 0.148
#> SRR901175 1 0.0260 0.980 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR901176 6 0.0405 0.000 0.000 0.008 0.000 0.000 0.004 0.988
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901178 2 0.1531 0.901 0.000 0.928 0.000 0.068 0.000 0.004
#> SRR901179 2 0.0291 0.939 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR901180 2 0.1141 0.917 0.000 0.948 0.000 0.000 0.000 0.052
#> SRR901181 5 0.0000 0.984 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901182 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901187 2 0.0603 0.936 0.000 0.980 0.000 0.016 0.000 0.004
#> SRR901186 2 0.0291 0.939 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR901188 2 0.0858 0.930 0.000 0.968 0.000 0.028 0.000 0.004
#> SRR901189 5 0.0000 0.984 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901190 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901194 2 0.0405 0.939 0.000 0.988 0.000 0.008 0.000 0.004
#> SRR901195 2 0.0291 0.939 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR901196 2 0.0260 0.937 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR901197 5 0.0000 0.984 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR901198 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901202 2 0.0405 0.939 0.000 0.988 0.000 0.008 0.000 0.004
#> SRR901203 2 0.0405 0.939 0.000 0.988 0.000 0.008 0.000 0.004
#> SRR901204 2 0.0291 0.939 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR901205 5 0.0260 0.979 0.000 0.000 0.000 0.008 0.992 0.000
#> SRR901206 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901211 2 0.0405 0.939 0.000 0.988 0.000 0.008 0.000 0.004
#> SRR901210 2 0.0291 0.939 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR901212 2 0.0146 0.940 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901214 2 0.3647 0.806 0.000 0.812 0.000 0.104 0.016 0.068
#> SRR901215 2 0.2052 0.902 0.000 0.912 0.000 0.028 0.004 0.056
#> SRR901216 2 0.3047 0.850 0.000 0.852 0.000 0.080 0.008 0.060
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901218 4 0.0777 0.939 0.000 0.024 0.000 0.972 0.004 0.000
#> SRR901219 4 0.0713 0.939 0.000 0.028 0.000 0.972 0.000 0.000
#> SRR901220 4 0.3081 0.640 0.000 0.220 0.000 0.776 0.000 0.004
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901222 2 0.1082 0.924 0.000 0.956 0.000 0.004 0.000 0.040
#> SRR901223 2 0.1913 0.892 0.000 0.908 0.000 0.012 0.000 0.080
#> SRR901224 2 0.3833 0.296 0.000 0.556 0.000 0.000 0.000 0.444
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901226 4 0.0806 0.939 0.008 0.020 0.000 0.972 0.000 0.000
#> SRR901227 4 0.0713 0.916 0.028 0.000 0.000 0.972 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR901228 4 0.0713 0.916 0.028 0.000 0.000 0.972 0.000 0.000
#> SRR901230 4 0.0870 0.932 0.004 0.012 0.012 0.972 0.000 0.000
#> SRR901231 4 0.1152 0.927 0.000 0.044 0.000 0.952 0.000 0.004
#> SRR901232 4 0.0777 0.941 0.004 0.024 0.000 0.972 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "hclust"]
# you can also extract it by
# res = res_list["ATC:hclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.855 0.903 0.953 0.4651 0.512 0.512
#> 3 3 0.896 0.903 0.956 0.4168 0.825 0.659
#> 4 4 0.894 0.937 0.951 0.0839 0.927 0.785
#> 5 5 0.959 0.932 0.973 0.0388 0.995 0.981
#> 6 6 0.893 0.899 0.926 0.0496 0.972 0.892
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0000 0.983 0.000 1.000
#> SRR901150 1 0.0000 0.895 1.000 0.000
#> SRR901151 1 0.0000 0.895 1.000 0.000
#> SRR901152 1 0.0000 0.895 1.000 0.000
#> SRR1382100 2 0.0000 0.983 0.000 1.000
#> SRR901154 2 0.1184 0.986 0.016 0.984
#> SRR901155 2 0.1184 0.986 0.016 0.984
#> SRR901156 2 0.1184 0.986 0.016 0.984
#> SRR901157 2 0.0000 0.983 0.000 1.000
#> SRR901158 1 0.0000 0.895 1.000 0.000
#> SRR901159 1 0.0000 0.895 1.000 0.000
#> SRR901160 1 0.0000 0.895 1.000 0.000
#> SRR901161 2 0.0000 0.983 0.000 1.000
#> SRR901162 1 0.8608 0.653 0.716 0.284
#> SRR901163 1 0.8608 0.653 0.716 0.284
#> SRR901164 2 0.1184 0.986 0.016 0.984
#> SRR901165 2 0.0000 0.983 0.000 1.000
#> SRR901166 1 0.0000 0.895 1.000 0.000
#> SRR901167 1 0.0000 0.895 1.000 0.000
#> SRR901168 1 0.0000 0.895 1.000 0.000
#> SRR901169 2 0.0000 0.983 0.000 1.000
#> SRR901170 2 0.1184 0.986 0.016 0.984
#> SRR901171 2 0.1184 0.986 0.016 0.984
#> SRR901172 2 0.1184 0.986 0.016 0.984
#> SRR901173 2 0.0000 0.983 0.000 1.000
#> SRR901174 1 0.0000 0.895 1.000 0.000
#> SRR901175 1 0.0000 0.895 1.000 0.000
#> SRR901176 2 0.1184 0.986 0.016 0.984
#> SRR901177 2 0.0000 0.983 0.000 1.000
#> SRR901178 2 0.1184 0.986 0.016 0.984
#> SRR901179 2 0.1184 0.986 0.016 0.984
#> SRR901180 2 0.1184 0.986 0.016 0.984
#> SRR901181 2 0.0000 0.983 0.000 1.000
#> SRR901182 1 0.0000 0.895 1.000 0.000
#> SRR901183 1 0.0000 0.895 1.000 0.000
#> SRR901184 1 0.0000 0.895 1.000 0.000
#> SRR901185 2 0.0000 0.983 0.000 1.000
#> SRR901187 2 0.1184 0.986 0.016 0.984
#> SRR901186 2 0.1184 0.986 0.016 0.984
#> SRR901188 2 0.1184 0.986 0.016 0.984
#> SRR901189 2 0.0000 0.983 0.000 1.000
#> SRR901190 1 0.0000 0.895 1.000 0.000
#> SRR901191 1 0.0000 0.895 1.000 0.000
#> SRR901192 1 0.0000 0.895 1.000 0.000
#> SRR901193 2 0.0000 0.983 0.000 1.000
#> SRR901194 2 0.1184 0.986 0.016 0.984
#> SRR901195 2 0.1184 0.986 0.016 0.984
#> SRR901196 2 0.1184 0.986 0.016 0.984
#> SRR901197 2 0.0000 0.983 0.000 1.000
#> SRR901198 1 0.0000 0.895 1.000 0.000
#> SRR901199 1 0.0000 0.895 1.000 0.000
#> SRR901200 1 0.0000 0.895 1.000 0.000
#> SRR901201 2 0.0000 0.983 0.000 1.000
#> SRR901202 2 0.1184 0.986 0.016 0.984
#> SRR901203 2 0.1184 0.986 0.016 0.984
#> SRR901204 2 0.1184 0.986 0.016 0.984
#> SRR901205 2 0.0000 0.983 0.000 1.000
#> SRR901206 1 0.0000 0.895 1.000 0.000
#> SRR901207 1 0.0000 0.895 1.000 0.000
#> SRR901208 1 0.0000 0.895 1.000 0.000
#> SRR901209 2 0.0000 0.983 0.000 1.000
#> SRR901211 2 0.1184 0.986 0.016 0.984
#> SRR901210 2 0.1184 0.986 0.016 0.984
#> SRR901212 2 0.1184 0.986 0.016 0.984
#> SRR901213 2 0.0000 0.983 0.000 1.000
#> SRR901214 2 0.1184 0.986 0.016 0.984
#> SRR901215 2 0.1184 0.986 0.016 0.984
#> SRR901216 2 0.1184 0.986 0.016 0.984
#> SRR901217 2 0.0000 0.983 0.000 1.000
#> SRR901218 1 0.9933 0.319 0.548 0.452
#> SRR901219 1 0.9933 0.319 0.548 0.452
#> SRR901220 1 0.8861 0.624 0.696 0.304
#> SRR901221 2 0.0000 0.983 0.000 1.000
#> SRR901222 2 0.5842 0.830 0.140 0.860
#> SRR901223 2 0.5842 0.830 0.140 0.860
#> SRR901224 2 0.1184 0.986 0.016 0.984
#> SRR901225 2 0.0000 0.983 0.000 1.000
#> SRR901226 1 0.8608 0.653 0.716 0.284
#> SRR901227 1 0.8608 0.653 0.716 0.284
#> SRR901229 2 0.0000 0.983 0.000 1.000
#> SRR901228 1 0.0376 0.893 0.996 0.004
#> SRR901230 1 0.0376 0.893 0.996 0.004
#> SRR901231 1 0.9933 0.319 0.548 0.452
#> SRR901232 1 0.9933 0.319 0.548 0.452
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.0000 1.000 0.000 0.000 1
#> SRR901150 1 0.0000 0.885 1.000 0.000 0
#> SRR901151 1 0.0000 0.885 1.000 0.000 0
#> SRR901152 1 0.0000 0.885 1.000 0.000 0
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1
#> SRR901154 2 0.0000 0.989 0.000 1.000 0
#> SRR901155 2 0.0000 0.989 0.000 1.000 0
#> SRR901156 2 0.0000 0.989 0.000 1.000 0
#> SRR901157 3 0.0000 1.000 0.000 0.000 1
#> SRR901158 1 0.0000 0.885 1.000 0.000 0
#> SRR901159 1 0.0000 0.885 1.000 0.000 0
#> SRR901160 1 0.0000 0.885 1.000 0.000 0
#> SRR901161 3 0.0000 1.000 0.000 0.000 1
#> SRR901162 1 0.5560 0.634 0.700 0.300 0
#> SRR901163 1 0.5560 0.634 0.700 0.300 0
#> SRR901164 2 0.0000 0.989 0.000 1.000 0
#> SRR901165 3 0.0000 1.000 0.000 0.000 1
#> SRR901166 1 0.0000 0.885 1.000 0.000 0
#> SRR901167 1 0.0747 0.879 0.984 0.016 0
#> SRR901168 1 0.0000 0.885 1.000 0.000 0
#> SRR901169 3 0.0000 1.000 0.000 0.000 1
#> SRR901170 2 0.0000 0.989 0.000 1.000 0
#> SRR901171 2 0.0000 0.989 0.000 1.000 0
#> SRR901172 2 0.0000 0.989 0.000 1.000 0
#> SRR901173 3 0.0000 1.000 0.000 0.000 1
#> SRR901174 1 0.0747 0.879 0.984 0.016 0
#> SRR901175 1 0.0000 0.885 1.000 0.000 0
#> SRR901176 2 0.0000 0.989 0.000 1.000 0
#> SRR901177 3 0.0000 1.000 0.000 0.000 1
#> SRR901178 2 0.0000 0.989 0.000 1.000 0
#> SRR901179 2 0.0000 0.989 0.000 1.000 0
#> SRR901180 2 0.0000 0.989 0.000 1.000 0
#> SRR901181 3 0.0000 1.000 0.000 0.000 1
#> SRR901182 1 0.0000 0.885 1.000 0.000 0
#> SRR901183 1 0.0000 0.885 1.000 0.000 0
#> SRR901184 1 0.0000 0.885 1.000 0.000 0
#> SRR901185 3 0.0000 1.000 0.000 0.000 1
#> SRR901187 2 0.0000 0.989 0.000 1.000 0
#> SRR901186 2 0.0000 0.989 0.000 1.000 0
#> SRR901188 2 0.0000 0.989 0.000 1.000 0
#> SRR901189 3 0.0000 1.000 0.000 0.000 1
#> SRR901190 1 0.0000 0.885 1.000 0.000 0
#> SRR901191 1 0.0000 0.885 1.000 0.000 0
#> SRR901192 1 0.0000 0.885 1.000 0.000 0
#> SRR901193 3 0.0000 1.000 0.000 0.000 1
#> SRR901194 2 0.0000 0.989 0.000 1.000 0
#> SRR901195 2 0.0000 0.989 0.000 1.000 0
#> SRR901196 2 0.0000 0.989 0.000 1.000 0
#> SRR901197 3 0.0000 1.000 0.000 0.000 1
#> SRR901198 1 0.0000 0.885 1.000 0.000 0
#> SRR901199 1 0.0000 0.885 1.000 0.000 0
#> SRR901200 1 0.0000 0.885 1.000 0.000 0
#> SRR901201 3 0.0000 1.000 0.000 0.000 1
#> SRR901202 2 0.0000 0.989 0.000 1.000 0
#> SRR901203 2 0.0000 0.989 0.000 1.000 0
#> SRR901204 2 0.0000 0.989 0.000 1.000 0
#> SRR901205 3 0.0000 1.000 0.000 0.000 1
#> SRR901206 1 0.0000 0.885 1.000 0.000 0
#> SRR901207 1 0.0000 0.885 1.000 0.000 0
#> SRR901208 1 0.0000 0.885 1.000 0.000 0
#> SRR901209 3 0.0000 1.000 0.000 0.000 1
#> SRR901211 2 0.0000 0.989 0.000 1.000 0
#> SRR901210 2 0.0000 0.989 0.000 1.000 0
#> SRR901212 2 0.0000 0.989 0.000 1.000 0
#> SRR901213 3 0.0000 1.000 0.000 0.000 1
#> SRR901214 2 0.0000 0.989 0.000 1.000 0
#> SRR901215 2 0.0000 0.989 0.000 1.000 0
#> SRR901216 2 0.0000 0.989 0.000 1.000 0
#> SRR901217 3 0.0000 1.000 0.000 0.000 1
#> SRR901218 1 0.6291 0.300 0.532 0.468 0
#> SRR901219 1 0.6291 0.300 0.532 0.468 0
#> SRR901220 1 0.5706 0.604 0.680 0.320 0
#> SRR901221 3 0.0000 1.000 0.000 0.000 1
#> SRR901222 2 0.3412 0.835 0.124 0.876 0
#> SRR901223 2 0.3412 0.835 0.124 0.876 0
#> SRR901224 2 0.0000 0.989 0.000 1.000 0
#> SRR901225 3 0.0000 1.000 0.000 0.000 1
#> SRR901226 1 0.5560 0.634 0.700 0.300 0
#> SRR901227 1 0.5560 0.634 0.700 0.300 0
#> SRR901229 3 0.0000 1.000 0.000 0.000 1
#> SRR901228 1 0.0892 0.877 0.980 0.020 0
#> SRR901230 1 0.0892 0.877 0.980 0.020 0
#> SRR901231 1 0.6291 0.300 0.532 0.468 0
#> SRR901232 1 0.6291 0.300 0.532 0.468 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901150 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901151 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901152 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901154 2 0.0188 0.981 0.000 0.996 0 0.004
#> SRR901155 2 0.0188 0.981 0.000 0.996 0 0.004
#> SRR901156 2 0.0188 0.981 0.000 0.996 0 0.004
#> SRR901157 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901158 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901159 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901160 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901162 4 0.4277 0.803 0.000 0.280 0 0.720
#> SRR901163 4 0.4277 0.803 0.000 0.280 0 0.720
#> SRR901164 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901165 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901166 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901167 1 0.4431 0.632 0.696 0.000 0 0.304
#> SRR901168 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901170 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901171 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901172 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901173 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901174 1 0.4431 0.632 0.696 0.000 0 0.304
#> SRR901175 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901176 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901178 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901179 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901180 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901181 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901182 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901183 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901184 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901187 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901186 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901188 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901189 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901190 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901191 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901192 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901194 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901195 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901196 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901197 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901198 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901199 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901200 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901202 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901203 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901204 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901205 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901206 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901207 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901208 1 0.0000 0.973 1.000 0.000 0 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901211 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901210 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901212 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901214 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901215 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901216 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901218 4 0.4981 0.654 0.000 0.464 0 0.536
#> SRR901219 4 0.4981 0.654 0.000 0.464 0 0.536
#> SRR901220 4 0.4406 0.795 0.000 0.300 0 0.700
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901222 2 0.2760 0.776 0.000 0.872 0 0.128
#> SRR901223 2 0.2760 0.776 0.000 0.872 0 0.128
#> SRR901224 2 0.0000 0.986 0.000 1.000 0 0.000
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901226 4 0.4277 0.803 0.000 0.280 0 0.720
#> SRR901227 4 0.4277 0.803 0.000 0.280 0 0.720
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901228 4 0.0000 0.605 0.000 0.000 0 1.000
#> SRR901230 4 0.0000 0.605 0.000 0.000 0 1.000
#> SRR901231 4 0.4981 0.654 0.000 0.464 0 0.536
#> SRR901232 4 0.4981 0.654 0.000 0.464 0 0.536
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901150 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901151 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901152 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901154 2 0.0880 0.937 0.000 0.968 0 0.032 0
#> SRR901155 2 0.0880 0.937 0.000 0.968 0 0.032 0
#> SRR901156 2 0.0880 0.937 0.000 0.968 0 0.032 0
#> SRR901157 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901158 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901159 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901160 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901162 4 0.0000 0.813 0.000 0.000 0 1.000 0
#> SRR901163 4 0.0000 0.813 0.000 0.000 0 1.000 0
#> SRR901164 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901165 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901166 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901167 1 0.3816 0.596 0.696 0.000 0 0.304 0
#> SRR901168 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901170 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901171 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901172 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901173 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901174 1 0.3816 0.596 0.696 0.000 0 0.304 0
#> SRR901175 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901176 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901178 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901179 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901180 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901181 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901182 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901183 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901184 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901187 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901186 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901188 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901189 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901190 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901191 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901192 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901194 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901195 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901196 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901197 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901198 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901199 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901200 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901202 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901203 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901204 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901205 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901206 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901207 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901208 1 0.0000 0.970 1.000 0.000 0 0.000 0
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901211 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901210 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901212 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901214 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901215 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901216 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901218 4 0.2966 0.786 0.000 0.184 0 0.816 0
#> SRR901219 4 0.2966 0.786 0.000 0.184 0 0.816 0
#> SRR901220 4 0.0609 0.817 0.000 0.020 0 0.980 0
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901222 2 0.4150 0.287 0.000 0.612 0 0.388 0
#> SRR901223 2 0.4150 0.287 0.000 0.612 0 0.388 0
#> SRR901224 2 0.0000 0.965 0.000 1.000 0 0.000 0
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901226 4 0.0000 0.813 0.000 0.000 0 1.000 0
#> SRR901227 4 0.0000 0.813 0.000 0.000 0 1.000 0
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901228 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901230 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901231 4 0.2966 0.786 0.000 0.184 0 0.816 0
#> SRR901232 4 0.2966 0.786 0.000 0.184 0 0.816 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.2941 1.000 0.000 0.000 0.220 0.000 0.780 0
#> SRR901150 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901151 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901152 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR1382100 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901154 2 0.3586 0.795 0.000 0.756 0.000 0.028 0.216 0
#> SRR901155 2 0.3586 0.795 0.000 0.756 0.000 0.028 0.216 0
#> SRR901156 2 0.3586 0.795 0.000 0.756 0.000 0.028 0.216 0
#> SRR901157 5 0.2941 1.000 0.000 0.000 0.220 0.000 0.780 0
#> SRR901158 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901159 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901160 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901161 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901162 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0
#> SRR901163 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0
#> SRR901164 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901165 3 0.1387 0.904 0.000 0.000 0.932 0.000 0.068 0
#> SRR901166 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901167 1 0.3428 0.596 0.696 0.000 0.000 0.304 0.000 0
#> SRR901168 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901169 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901170 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901171 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901172 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901173 5 0.2941 1.000 0.000 0.000 0.220 0.000 0.780 0
#> SRR901174 1 0.3428 0.596 0.696 0.000 0.000 0.304 0.000 0
#> SRR901175 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901176 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901177 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901178 2 0.1141 0.875 0.000 0.948 0.000 0.000 0.052 0
#> SRR901179 2 0.0000 0.881 0.000 1.000 0.000 0.000 0.000 0
#> SRR901180 2 0.0000 0.881 0.000 1.000 0.000 0.000 0.000 0
#> SRR901181 5 0.2941 1.000 0.000 0.000 0.220 0.000 0.780 0
#> SRR901182 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901183 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901184 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901185 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901187 2 0.0000 0.881 0.000 1.000 0.000 0.000 0.000 0
#> SRR901186 2 0.0000 0.881 0.000 1.000 0.000 0.000 0.000 0
#> SRR901188 2 0.2416 0.854 0.000 0.844 0.000 0.000 0.156 0
#> SRR901189 5 0.2941 1.000 0.000 0.000 0.220 0.000 0.780 0
#> SRR901190 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901191 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901192 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901193 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901194 2 0.2416 0.854 0.000 0.844 0.000 0.000 0.156 0
#> SRR901195 2 0.2416 0.854 0.000 0.844 0.000 0.000 0.156 0
#> SRR901196 2 0.0000 0.881 0.000 1.000 0.000 0.000 0.000 0
#> SRR901197 5 0.2941 1.000 0.000 0.000 0.220 0.000 0.780 0
#> SRR901198 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901199 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901200 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901201 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901202 2 0.2416 0.854 0.000 0.844 0.000 0.000 0.156 0
#> SRR901203 2 0.2416 0.854 0.000 0.844 0.000 0.000 0.156 0
#> SRR901204 2 0.2416 0.854 0.000 0.844 0.000 0.000 0.156 0
#> SRR901205 5 0.2941 1.000 0.000 0.000 0.220 0.000 0.780 0
#> SRR901206 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901207 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901208 1 0.0000 0.970 1.000 0.000 0.000 0.000 0.000 0
#> SRR901209 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901211 2 0.2416 0.854 0.000 0.844 0.000 0.000 0.156 0
#> SRR901210 2 0.2416 0.854 0.000 0.844 0.000 0.000 0.156 0
#> SRR901212 2 0.0000 0.881 0.000 1.000 0.000 0.000 0.000 0
#> SRR901213 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901214 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901215 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901216 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901217 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901218 4 0.2664 0.837 0.000 0.000 0.000 0.816 0.184 0
#> SRR901219 4 0.2664 0.837 0.000 0.000 0.000 0.816 0.184 0
#> SRR901220 4 0.0547 0.863 0.000 0.000 0.000 0.980 0.020 0
#> SRR901221 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901222 2 0.5816 0.112 0.000 0.428 0.000 0.388 0.184 0
#> SRR901223 2 0.5816 0.112 0.000 0.428 0.000 0.388 0.184 0
#> SRR901224 2 0.0146 0.880 0.000 0.996 0.000 0.000 0.004 0
#> SRR901225 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901226 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0
#> SRR901227 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0
#> SRR901229 3 0.0000 0.993 0.000 0.000 1.000 0.000 0.000 0
#> SRR901228 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1
#> SRR901230 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1
#> SRR901231 4 0.2664 0.837 0.000 0.000 0.000 0.816 0.184 0
#> SRR901232 4 0.2664 0.837 0.000 0.000 0.000 0.816 0.184 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.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "kmeans"]
# you can also extract it by
# res = res_list["ATC:kmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.529 0.886 0.906 0.4521 0.542 0.542
#> 3 3 1.000 0.993 0.997 0.4441 0.727 0.531
#> 4 4 0.878 0.901 0.920 0.1117 0.907 0.736
#> 5 5 0.796 0.706 0.863 0.0600 0.994 0.978
#> 6 6 0.804 0.739 0.808 0.0397 0.942 0.787
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0938 0.839 0.012 0.988
#> SRR901150 1 0.0000 0.999 1.000 0.000
#> SRR901151 1 0.0000 0.999 1.000 0.000
#> SRR901152 1 0.0000 0.999 1.000 0.000
#> SRR1382100 2 0.0938 0.839 0.012 0.988
#> SRR901154 2 0.9909 0.494 0.444 0.556
#> SRR901155 2 0.9909 0.494 0.444 0.556
#> SRR901156 2 0.6973 0.874 0.188 0.812
#> SRR901157 2 0.0938 0.839 0.012 0.988
#> SRR901158 1 0.0000 0.999 1.000 0.000
#> SRR901159 1 0.0000 0.999 1.000 0.000
#> SRR901160 1 0.0000 0.999 1.000 0.000
#> SRR901161 2 0.0938 0.839 0.012 0.988
#> SRR901162 2 0.9933 0.485 0.452 0.548
#> SRR901163 1 0.0000 0.999 1.000 0.000
#> SRR901164 2 0.6801 0.875 0.180 0.820
#> SRR901165 2 0.0938 0.839 0.012 0.988
#> SRR901166 1 0.0000 0.999 1.000 0.000
#> SRR901167 1 0.0000 0.999 1.000 0.000
#> SRR901168 1 0.0000 0.999 1.000 0.000
#> SRR901169 2 0.0938 0.839 0.012 0.988
#> SRR901170 2 0.6887 0.875 0.184 0.816
#> SRR901171 2 0.6887 0.875 0.184 0.816
#> SRR901172 2 0.6801 0.875 0.180 0.820
#> SRR901173 2 0.0000 0.838 0.000 1.000
#> SRR901174 1 0.0000 0.999 1.000 0.000
#> SRR901175 1 0.0000 0.999 1.000 0.000
#> SRR901176 2 0.6973 0.874 0.188 0.812
#> SRR901177 2 0.0938 0.839 0.012 0.988
#> SRR901178 2 0.6973 0.874 0.188 0.812
#> SRR901179 2 0.6973 0.874 0.188 0.812
#> SRR901180 2 0.6887 0.875 0.184 0.816
#> SRR901181 2 0.0938 0.839 0.012 0.988
#> SRR901182 1 0.0000 0.999 1.000 0.000
#> SRR901183 1 0.0000 0.999 1.000 0.000
#> SRR901184 1 0.0000 0.999 1.000 0.000
#> SRR901185 2 0.0938 0.839 0.012 0.988
#> SRR901187 2 0.6973 0.874 0.188 0.812
#> SRR901186 2 0.6973 0.874 0.188 0.812
#> SRR901188 2 0.6973 0.874 0.188 0.812
#> SRR901189 2 0.0938 0.839 0.012 0.988
#> SRR901190 1 0.0000 0.999 1.000 0.000
#> SRR901191 1 0.0000 0.999 1.000 0.000
#> SRR901192 1 0.0000 0.999 1.000 0.000
#> SRR901193 2 0.0938 0.839 0.012 0.988
#> SRR901194 2 0.6973 0.874 0.188 0.812
#> SRR901195 2 0.6973 0.874 0.188 0.812
#> SRR901196 2 0.6887 0.875 0.184 0.816
#> SRR901197 2 0.0000 0.838 0.000 1.000
#> SRR901198 1 0.0000 0.999 1.000 0.000
#> SRR901199 1 0.0000 0.999 1.000 0.000
#> SRR901200 1 0.0000 0.999 1.000 0.000
#> SRR901201 2 0.0938 0.839 0.012 0.988
#> SRR901202 2 0.6973 0.874 0.188 0.812
#> SRR901203 2 0.6973 0.874 0.188 0.812
#> SRR901204 2 0.6973 0.874 0.188 0.812
#> SRR901205 2 0.0938 0.839 0.012 0.988
#> SRR901206 1 0.0000 0.999 1.000 0.000
#> SRR901207 1 0.0000 0.999 1.000 0.000
#> SRR901208 1 0.0000 0.999 1.000 0.000
#> SRR901209 2 0.0938 0.839 0.012 0.988
#> SRR901211 2 0.6973 0.874 0.188 0.812
#> SRR901210 2 0.6973 0.874 0.188 0.812
#> SRR901212 2 0.6973 0.874 0.188 0.812
#> SRR901213 2 0.0938 0.839 0.012 0.988
#> SRR901214 2 0.6887 0.875 0.184 0.816
#> SRR901215 2 0.6887 0.875 0.184 0.816
#> SRR901216 2 0.6887 0.875 0.184 0.816
#> SRR901217 2 0.0938 0.839 0.012 0.988
#> SRR901218 2 0.6973 0.874 0.188 0.812
#> SRR901219 2 0.9909 0.494 0.444 0.556
#> SRR901220 1 0.0938 0.985 0.988 0.012
#> SRR901221 2 0.0938 0.839 0.012 0.988
#> SRR901222 2 0.6973 0.874 0.188 0.812
#> SRR901223 2 0.9909 0.494 0.444 0.556
#> SRR901224 2 0.6973 0.874 0.188 0.812
#> SRR901225 2 0.0938 0.839 0.012 0.988
#> SRR901226 1 0.0000 0.999 1.000 0.000
#> SRR901227 1 0.0000 0.999 1.000 0.000
#> SRR901229 2 0.0938 0.839 0.012 0.988
#> SRR901228 1 0.0000 0.999 1.000 0.000
#> SRR901230 1 0.0000 0.999 1.000 0.000
#> SRR901231 2 0.6973 0.874 0.188 0.812
#> SRR901232 2 0.6973 0.874 0.188 0.812
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.0000 1.000 0.000 0.000 1
#> SRR901150 1 0.0000 0.997 1.000 0.000 0
#> SRR901151 1 0.0000 0.997 1.000 0.000 0
#> SRR901152 1 0.0000 0.997 1.000 0.000 0
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1
#> SRR901154 2 0.0000 0.994 0.000 1.000 0
#> SRR901155 2 0.0000 0.994 0.000 1.000 0
#> SRR901156 2 0.0000 0.994 0.000 1.000 0
#> SRR901157 3 0.0000 1.000 0.000 0.000 1
#> SRR901158 1 0.0000 0.997 1.000 0.000 0
#> SRR901159 1 0.0000 0.997 1.000 0.000 0
#> SRR901160 1 0.0000 0.997 1.000 0.000 0
#> SRR901161 3 0.0000 1.000 0.000 0.000 1
#> SRR901162 2 0.0000 0.994 0.000 1.000 0
#> SRR901163 2 0.0000 0.994 0.000 1.000 0
#> SRR901164 2 0.0000 0.994 0.000 1.000 0
#> SRR901165 3 0.0000 1.000 0.000 0.000 1
#> SRR901166 1 0.0000 0.997 1.000 0.000 0
#> SRR901167 1 0.0000 0.997 1.000 0.000 0
#> SRR901168 1 0.0000 0.997 1.000 0.000 0
#> SRR901169 3 0.0000 1.000 0.000 0.000 1
#> SRR901170 2 0.0000 0.994 0.000 1.000 0
#> SRR901171 2 0.0000 0.994 0.000 1.000 0
#> SRR901172 2 0.0000 0.994 0.000 1.000 0
#> SRR901173 3 0.0000 1.000 0.000 0.000 1
#> SRR901174 1 0.0000 0.997 1.000 0.000 0
#> SRR901175 1 0.0000 0.997 1.000 0.000 0
#> SRR901176 2 0.0000 0.994 0.000 1.000 0
#> SRR901177 3 0.0000 1.000 0.000 0.000 1
#> SRR901178 2 0.0000 0.994 0.000 1.000 0
#> SRR901179 2 0.0000 0.994 0.000 1.000 0
#> SRR901180 2 0.0000 0.994 0.000 1.000 0
#> SRR901181 3 0.0000 1.000 0.000 0.000 1
#> SRR901182 1 0.0000 0.997 1.000 0.000 0
#> SRR901183 1 0.0000 0.997 1.000 0.000 0
#> SRR901184 1 0.0000 0.997 1.000 0.000 0
#> SRR901185 3 0.0000 1.000 0.000 0.000 1
#> SRR901187 2 0.0000 0.994 0.000 1.000 0
#> SRR901186 2 0.0000 0.994 0.000 1.000 0
#> SRR901188 2 0.0000 0.994 0.000 1.000 0
#> SRR901189 3 0.0000 1.000 0.000 0.000 1
#> SRR901190 1 0.0000 0.997 1.000 0.000 0
#> SRR901191 1 0.0000 0.997 1.000 0.000 0
#> SRR901192 1 0.0000 0.997 1.000 0.000 0
#> SRR901193 3 0.0000 1.000 0.000 0.000 1
#> SRR901194 2 0.0000 0.994 0.000 1.000 0
#> SRR901195 2 0.0000 0.994 0.000 1.000 0
#> SRR901196 2 0.0000 0.994 0.000 1.000 0
#> SRR901197 3 0.0000 1.000 0.000 0.000 1
#> SRR901198 1 0.0000 0.997 1.000 0.000 0
#> SRR901199 1 0.0000 0.997 1.000 0.000 0
#> SRR901200 1 0.0000 0.997 1.000 0.000 0
#> SRR901201 3 0.0000 1.000 0.000 0.000 1
#> SRR901202 2 0.0000 0.994 0.000 1.000 0
#> SRR901203 2 0.0000 0.994 0.000 1.000 0
#> SRR901204 2 0.0000 0.994 0.000 1.000 0
#> SRR901205 3 0.0000 1.000 0.000 0.000 1
#> SRR901206 1 0.0000 0.997 1.000 0.000 0
#> SRR901207 1 0.0000 0.997 1.000 0.000 0
#> SRR901208 1 0.0000 0.997 1.000 0.000 0
#> SRR901209 3 0.0000 1.000 0.000 0.000 1
#> SRR901211 2 0.0000 0.994 0.000 1.000 0
#> SRR901210 2 0.0000 0.994 0.000 1.000 0
#> SRR901212 2 0.0000 0.994 0.000 1.000 0
#> SRR901213 3 0.0000 1.000 0.000 0.000 1
#> SRR901214 2 0.0000 0.994 0.000 1.000 0
#> SRR901215 2 0.0000 0.994 0.000 1.000 0
#> SRR901216 2 0.0000 0.994 0.000 1.000 0
#> SRR901217 3 0.0000 1.000 0.000 0.000 1
#> SRR901218 2 0.0000 0.994 0.000 1.000 0
#> SRR901219 2 0.0000 0.994 0.000 1.000 0
#> SRR901220 2 0.0000 0.994 0.000 1.000 0
#> SRR901221 3 0.0000 1.000 0.000 0.000 1
#> SRR901222 2 0.0000 0.994 0.000 1.000 0
#> SRR901223 2 0.0000 0.994 0.000 1.000 0
#> SRR901224 2 0.0000 0.994 0.000 1.000 0
#> SRR901225 3 0.0000 1.000 0.000 0.000 1
#> SRR901226 2 0.0000 0.994 0.000 1.000 0
#> SRR901227 1 0.0592 0.985 0.988 0.012 0
#> SRR901229 3 0.0000 1.000 0.000 0.000 1
#> SRR901228 1 0.1529 0.953 0.960 0.040 0
#> SRR901230 2 0.4750 0.723 0.216 0.784 0
#> SRR901231 2 0.0000 0.994 0.000 1.000 0
#> SRR901232 2 0.0000 0.994 0.000 1.000 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.5590 0.812 0.000 0.064 0.692 0.244
#> SRR901150 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901154 2 0.4250 0.577 0.000 0.724 0.000 0.276
#> SRR901155 2 0.4250 0.577 0.000 0.724 0.000 0.276
#> SRR901156 2 0.1118 0.924 0.000 0.964 0.000 0.036
#> SRR901157 3 0.5590 0.812 0.000 0.064 0.692 0.244
#> SRR901158 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901162 4 0.4008 0.883 0.000 0.244 0.000 0.756
#> SRR901163 4 0.4008 0.883 0.000 0.244 0.000 0.756
#> SRR901164 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901165 3 0.3801 0.849 0.000 0.000 0.780 0.220
#> SRR901166 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901167 1 0.2760 0.844 0.872 0.000 0.000 0.128
#> SRR901168 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901169 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901170 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901171 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901172 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901173 3 0.5590 0.812 0.000 0.064 0.692 0.244
#> SRR901174 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901175 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901176 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901177 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901178 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901179 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901180 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901181 3 0.4008 0.841 0.000 0.000 0.756 0.244
#> SRR901182 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901187 2 0.0469 0.927 0.000 0.988 0.000 0.012
#> SRR901186 2 0.0469 0.927 0.000 0.988 0.000 0.012
#> SRR901188 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901189 3 0.5590 0.812 0.000 0.064 0.692 0.244
#> SRR901190 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901194 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901195 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901196 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901197 3 0.5590 0.812 0.000 0.064 0.692 0.244
#> SRR901198 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901202 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901203 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901204 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901205 3 0.4008 0.841 0.000 0.000 0.756 0.244
#> SRR901206 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 0.994 1.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901211 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901210 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901212 2 0.0469 0.927 0.000 0.988 0.000 0.012
#> SRR901213 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901214 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901215 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901216 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901217 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901218 4 0.4008 0.883 0.000 0.244 0.000 0.756
#> SRR901219 4 0.4008 0.883 0.000 0.244 0.000 0.756
#> SRR901220 4 0.4008 0.883 0.000 0.244 0.000 0.756
#> SRR901221 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901222 2 0.1716 0.916 0.000 0.936 0.000 0.064
#> SRR901223 2 0.4250 0.577 0.000 0.724 0.000 0.276
#> SRR901224 2 0.0000 0.926 0.000 1.000 0.000 0.000
#> SRR901225 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901226 4 0.4008 0.883 0.000 0.244 0.000 0.756
#> SRR901227 4 0.4155 0.604 0.240 0.004 0.000 0.756
#> SRR901229 3 0.0000 0.907 0.000 0.000 1.000 0.000
#> SRR901228 4 0.4387 0.614 0.236 0.012 0.000 0.752
#> SRR901230 4 0.4745 0.856 0.036 0.208 0.000 0.756
#> SRR901231 4 0.4790 0.658 0.000 0.380 0.000 0.620
#> SRR901232 4 0.4008 0.883 0.000 0.244 0.000 0.756
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 3 0.4627 -0.439 0.000 0.012 0.544 0.000 0.444
#> SRR901150 1 0.0000 0.915 1.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 0.915 1.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0162 0.914 0.996 0.000 0.000 0.000 0.004
#> SRR1382100 3 0.0162 0.691 0.000 0.000 0.996 0.004 0.000
#> SRR901154 2 0.6424 0.453 0.000 0.508 0.000 0.252 0.240
#> SRR901155 2 0.6424 0.453 0.000 0.508 0.000 0.252 0.240
#> SRR901156 2 0.2930 0.837 0.000 0.832 0.000 0.004 0.164
#> SRR901157 3 0.4627 -0.439 0.000 0.012 0.544 0.000 0.444
#> SRR901158 1 0.3177 0.882 0.792 0.000 0.000 0.000 0.208
#> SRR901159 1 0.3177 0.882 0.792 0.000 0.000 0.000 0.208
#> SRR901160 1 0.0609 0.915 0.980 0.000 0.000 0.000 0.020
#> SRR901161 3 0.0000 0.692 0.000 0.000 1.000 0.000 0.000
#> SRR901162 4 0.3401 0.898 0.000 0.064 0.000 0.840 0.096
#> SRR901163 4 0.3176 0.899 0.000 0.064 0.000 0.856 0.080
#> SRR901164 2 0.1043 0.848 0.000 0.960 0.000 0.000 0.040
#> SRR901165 3 0.4941 -0.110 0.000 0.000 0.628 0.044 0.328
#> SRR901166 1 0.2127 0.903 0.892 0.000 0.000 0.000 0.108
#> SRR901167 1 0.5398 0.745 0.648 0.000 0.000 0.112 0.240
#> SRR901168 1 0.2127 0.903 0.892 0.000 0.000 0.000 0.108
#> SRR901169 3 0.0000 0.692 0.000 0.000 1.000 0.000 0.000
#> SRR901170 2 0.0510 0.852 0.000 0.984 0.000 0.000 0.016
#> SRR901171 2 0.0510 0.852 0.000 0.984 0.000 0.000 0.016
#> SRR901172 2 0.0510 0.852 0.000 0.984 0.000 0.000 0.016
#> SRR901173 5 0.6269 0.000 0.000 0.148 0.408 0.000 0.444
#> SRR901174 1 0.3424 0.859 0.760 0.000 0.000 0.000 0.240
#> SRR901175 1 0.0162 0.914 0.996 0.000 0.000 0.000 0.004
#> SRR901176 2 0.0880 0.851 0.000 0.968 0.000 0.000 0.032
#> SRR901177 3 0.0000 0.692 0.000 0.000 1.000 0.000 0.000
#> SRR901178 2 0.2771 0.841 0.000 0.860 0.000 0.012 0.128
#> SRR901179 2 0.0290 0.854 0.000 0.992 0.000 0.000 0.008
#> SRR901180 2 0.0510 0.852 0.000 0.984 0.000 0.000 0.016
#> SRR901181 3 0.4242 -0.322 0.000 0.000 0.572 0.000 0.428
#> SRR901182 1 0.0703 0.915 0.976 0.000 0.000 0.000 0.024
#> SRR901183 1 0.3210 0.881 0.788 0.000 0.000 0.000 0.212
#> SRR901184 1 0.3210 0.881 0.788 0.000 0.000 0.000 0.212
#> SRR901185 3 0.0000 0.692 0.000 0.000 1.000 0.000 0.000
#> SRR901187 2 0.0880 0.857 0.000 0.968 0.000 0.000 0.032
#> SRR901186 2 0.0963 0.857 0.000 0.964 0.000 0.000 0.036
#> SRR901188 2 0.4170 0.802 0.000 0.760 0.000 0.048 0.192
#> SRR901189 3 0.4627 -0.439 0.000 0.012 0.544 0.000 0.444
#> SRR901190 1 0.0162 0.914 0.996 0.000 0.000 0.000 0.004
#> SRR901191 1 0.3210 0.881 0.788 0.000 0.000 0.000 0.212
#> SRR901192 1 0.2561 0.900 0.856 0.000 0.000 0.000 0.144
#> SRR901193 3 0.0000 0.692 0.000 0.000 1.000 0.000 0.000
#> SRR901194 2 0.3427 0.826 0.000 0.796 0.000 0.012 0.192
#> SRR901195 2 0.3427 0.826 0.000 0.796 0.000 0.012 0.192
#> SRR901196 2 0.0510 0.852 0.000 0.984 0.000 0.000 0.016
#> SRR901197 3 0.5450 -0.664 0.000 0.060 0.496 0.000 0.444
#> SRR901198 1 0.0703 0.915 0.976 0.000 0.000 0.000 0.024
#> SRR901199 1 0.0162 0.914 0.996 0.000 0.000 0.000 0.004
#> SRR901200 1 0.0162 0.914 0.996 0.000 0.000 0.000 0.004
#> SRR901201 3 0.0000 0.692 0.000 0.000 1.000 0.000 0.000
#> SRR901202 2 0.3427 0.826 0.000 0.796 0.000 0.012 0.192
#> SRR901203 2 0.3527 0.824 0.000 0.792 0.000 0.016 0.192
#> SRR901204 2 0.3427 0.826 0.000 0.796 0.000 0.012 0.192
#> SRR901205 3 0.4242 -0.322 0.000 0.000 0.572 0.000 0.428
#> SRR901206 1 0.3452 0.867 0.756 0.000 0.000 0.000 0.244
#> SRR901207 1 0.0609 0.915 0.980 0.000 0.000 0.000 0.020
#> SRR901208 1 0.0609 0.915 0.980 0.000 0.000 0.000 0.020
#> SRR901209 3 0.0000 0.692 0.000 0.000 1.000 0.000 0.000
#> SRR901211 2 0.3954 0.811 0.000 0.772 0.000 0.036 0.192
#> SRR901210 2 0.3527 0.824 0.000 0.792 0.000 0.016 0.192
#> SRR901212 2 0.0963 0.857 0.000 0.964 0.000 0.000 0.036
#> SRR901213 3 0.0290 0.689 0.000 0.000 0.992 0.008 0.000
#> SRR901214 2 0.0510 0.852 0.000 0.984 0.000 0.000 0.016
#> SRR901215 2 0.0510 0.852 0.000 0.984 0.000 0.000 0.016
#> SRR901216 2 0.0510 0.852 0.000 0.984 0.000 0.000 0.016
#> SRR901217 3 0.0000 0.692 0.000 0.000 1.000 0.000 0.000
#> SRR901218 4 0.3346 0.898 0.000 0.064 0.000 0.844 0.092
#> SRR901219 4 0.3346 0.898 0.000 0.064 0.000 0.844 0.092
#> SRR901220 4 0.3116 0.899 0.000 0.064 0.000 0.860 0.076
#> SRR901221 3 0.1341 0.657 0.000 0.000 0.944 0.056 0.000
#> SRR901222 2 0.4325 0.787 0.000 0.724 0.000 0.036 0.240
#> SRR901223 2 0.6441 0.444 0.000 0.504 0.000 0.256 0.240
#> SRR901224 2 0.1410 0.841 0.000 0.940 0.000 0.000 0.060
#> SRR901225 3 0.1341 0.657 0.000 0.000 0.944 0.056 0.000
#> SRR901226 4 0.1845 0.864 0.000 0.056 0.000 0.928 0.016
#> SRR901227 4 0.1914 0.811 0.060 0.000 0.000 0.924 0.016
#> SRR901229 3 0.0404 0.687 0.000 0.000 0.988 0.012 0.000
#> SRR901228 4 0.2588 0.796 0.060 0.000 0.000 0.892 0.048
#> SRR901230 4 0.2804 0.844 0.016 0.044 0.000 0.892 0.048
#> SRR901231 4 0.5605 0.664 0.000 0.192 0.000 0.640 0.168
#> SRR901232 4 0.3517 0.891 0.000 0.068 0.000 0.832 0.100
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.4713 0.9070 0.000 0.012 0.400 0.000 0.560 NA
#> SRR901150 1 0.0820 0.8290 0.972 0.000 0.000 0.000 0.016 NA
#> SRR901151 1 0.0458 0.8317 0.984 0.000 0.000 0.000 0.016 NA
#> SRR901152 1 0.0820 0.8290 0.972 0.000 0.000 0.000 0.016 NA
#> SRR1382100 3 0.0260 0.9087 0.000 0.000 0.992 0.000 0.000 NA
#> SRR901154 4 0.7221 -0.0843 0.000 0.328 0.000 0.380 0.132 NA
#> SRR901155 4 0.7221 -0.0843 0.000 0.328 0.000 0.380 0.132 NA
#> SRR901156 2 0.4810 0.7166 0.000 0.692 0.000 0.008 0.140 NA
#> SRR901157 5 0.4713 0.9070 0.000 0.012 0.400 0.000 0.560 NA
#> SRR901158 1 0.3756 0.7723 0.600 0.000 0.000 0.000 0.000 NA
#> SRR901159 1 0.3756 0.7723 0.600 0.000 0.000 0.000 0.000 NA
#> SRR901160 1 0.1387 0.8350 0.932 0.000 0.000 0.000 0.000 NA
#> SRR901161 3 0.0000 0.9125 0.000 0.000 1.000 0.000 0.000 NA
#> SRR901162 4 0.0405 0.7387 0.000 0.008 0.000 0.988 0.000 NA
#> SRR901163 4 0.1116 0.7359 0.000 0.008 0.000 0.960 0.004 NA
#> SRR901164 2 0.1720 0.7751 0.000 0.928 0.000 0.000 0.040 NA
#> SRR901165 3 0.5715 -0.6256 0.000 0.000 0.484 0.004 0.364 NA
#> SRR901166 1 0.3825 0.7954 0.768 0.000 0.000 0.000 0.072 NA
#> SRR901167 1 0.6273 0.6178 0.472 0.000 0.000 0.056 0.108 NA
#> SRR901168 1 0.3825 0.7954 0.768 0.000 0.000 0.000 0.072 NA
#> SRR901169 3 0.0000 0.9125 0.000 0.000 1.000 0.000 0.000 NA
#> SRR901170 2 0.0458 0.7948 0.000 0.984 0.000 0.000 0.016 NA
#> SRR901171 2 0.0458 0.7948 0.000 0.984 0.000 0.000 0.016 NA
#> SRR901172 2 0.0458 0.7948 0.000 0.984 0.000 0.000 0.016 NA
#> SRR901173 5 0.5173 0.7494 0.000 0.128 0.276 0.000 0.596 NA
#> SRR901174 1 0.5147 0.7220 0.568 0.000 0.000 0.000 0.104 NA
#> SRR901175 1 0.0508 0.8292 0.984 0.000 0.000 0.000 0.004 NA
#> SRR901176 2 0.1575 0.7786 0.000 0.936 0.000 0.000 0.032 NA
#> SRR901177 3 0.0000 0.9125 0.000 0.000 1.000 0.000 0.000 NA
#> SRR901178 2 0.4218 0.7508 0.000 0.776 0.000 0.116 0.072 NA
#> SRR901179 2 0.0260 0.7966 0.000 0.992 0.000 0.000 0.008 NA
#> SRR901180 2 0.0458 0.7948 0.000 0.984 0.000 0.000 0.016 NA
#> SRR901181 5 0.3797 0.8850 0.000 0.000 0.420 0.000 0.580 NA
#> SRR901182 1 0.1387 0.8350 0.932 0.000 0.000 0.000 0.000 NA
#> SRR901183 1 0.3797 0.7630 0.580 0.000 0.000 0.000 0.000 NA
#> SRR901184 1 0.3782 0.7668 0.588 0.000 0.000 0.000 0.000 NA
#> SRR901185 3 0.0000 0.9125 0.000 0.000 1.000 0.000 0.000 NA
#> SRR901187 2 0.1738 0.7973 0.000 0.928 0.000 0.004 0.052 NA
#> SRR901186 2 0.1826 0.7971 0.000 0.924 0.000 0.004 0.052 NA
#> SRR901188 2 0.6248 0.6045 0.000 0.576 0.000 0.216 0.104 NA
#> SRR901189 5 0.4713 0.9070 0.000 0.012 0.400 0.000 0.560 NA
#> SRR901190 1 0.0508 0.8292 0.984 0.000 0.000 0.000 0.004 NA
#> SRR901191 1 0.3774 0.7687 0.592 0.000 0.000 0.000 0.000 NA
#> SRR901192 1 0.3309 0.8040 0.720 0.000 0.000 0.000 0.000 NA
#> SRR901193 3 0.0000 0.9125 0.000 0.000 1.000 0.000 0.000 NA
#> SRR901194 2 0.5820 0.6855 0.000 0.640 0.000 0.152 0.104 NA
#> SRR901195 2 0.5820 0.6855 0.000 0.640 0.000 0.152 0.104 NA
#> SRR901196 2 0.0363 0.7968 0.000 0.988 0.000 0.000 0.012 NA
#> SRR901197 5 0.4712 0.8536 0.000 0.060 0.344 0.000 0.596 NA
#> SRR901198 1 0.1387 0.8350 0.932 0.000 0.000 0.000 0.000 NA
#> SRR901199 1 0.0146 0.8312 0.996 0.000 0.000 0.000 0.004 NA
#> SRR901200 1 0.0146 0.8312 0.996 0.000 0.000 0.000 0.004 NA
#> SRR901201 3 0.0000 0.9125 0.000 0.000 1.000 0.000 0.000 NA
#> SRR901202 2 0.5820 0.6855 0.000 0.640 0.000 0.152 0.104 NA
#> SRR901203 2 0.5820 0.6855 0.000 0.640 0.000 0.152 0.104 NA
#> SRR901204 2 0.5820 0.6855 0.000 0.640 0.000 0.152 0.104 NA
#> SRR901205 5 0.3797 0.8850 0.000 0.000 0.420 0.000 0.580 NA
#> SRR901206 1 0.3851 0.7438 0.540 0.000 0.000 0.000 0.000 NA
#> SRR901207 1 0.1387 0.8350 0.932 0.000 0.000 0.000 0.000 NA
#> SRR901208 1 0.1387 0.8350 0.932 0.000 0.000 0.000 0.000 NA
#> SRR901209 3 0.0000 0.9125 0.000 0.000 1.000 0.000 0.000 NA
#> SRR901211 2 0.6106 0.6380 0.000 0.600 0.000 0.192 0.104 NA
#> SRR901210 2 0.5820 0.6855 0.000 0.640 0.000 0.152 0.104 NA
#> SRR901212 2 0.1826 0.7971 0.000 0.924 0.000 0.004 0.052 NA
#> SRR901213 3 0.0405 0.9068 0.000 0.000 0.988 0.004 0.000 NA
#> SRR901214 2 0.0972 0.7895 0.000 0.964 0.000 0.000 0.028 NA
#> SRR901215 2 0.0972 0.7895 0.000 0.964 0.000 0.000 0.028 NA
#> SRR901216 2 0.0972 0.7895 0.000 0.964 0.000 0.000 0.028 NA
#> SRR901217 3 0.0000 0.9125 0.000 0.000 1.000 0.000 0.000 NA
#> SRR901218 4 0.0779 0.7383 0.000 0.008 0.000 0.976 0.008 NA
#> SRR901219 4 0.0779 0.7383 0.000 0.008 0.000 0.976 0.008 NA
#> SRR901220 4 0.1036 0.7360 0.000 0.008 0.000 0.964 0.004 NA
#> SRR901221 3 0.2100 0.8008 0.000 0.000 0.884 0.004 0.000 NA
#> SRR901222 2 0.6813 0.5564 0.000 0.516 0.000 0.188 0.140 NA
#> SRR901223 4 0.7220 -0.0252 0.000 0.304 0.000 0.400 0.140 NA
#> SRR901224 2 0.2376 0.7503 0.000 0.888 0.000 0.000 0.044 NA
#> SRR901225 3 0.2100 0.8008 0.000 0.000 0.884 0.004 0.000 NA
#> SRR901226 4 0.3635 0.6729 0.000 0.008 0.000 0.804 0.068 NA
#> SRR901227 4 0.3677 0.6647 0.008 0.000 0.000 0.800 0.068 NA
#> SRR901229 3 0.0405 0.9061 0.000 0.000 0.988 0.004 0.000 NA
#> SRR901228 4 0.4700 0.6256 0.008 0.000 0.000 0.700 0.112 NA
#> SRR901230 4 0.4670 0.6364 0.000 0.008 0.000 0.704 0.112 NA
#> SRR901231 4 0.4727 0.5955 0.000 0.104 0.000 0.744 0.072 NA
#> SRR901232 4 0.1230 0.7330 0.000 0.008 0.000 0.956 0.008 NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "skmeans"]
# you can also extract it by
# res = res_list["ATC:skmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.950 0.961 0.982 0.4961 0.504 0.504
#> 3 3 1.000 0.974 0.983 0.3382 0.739 0.527
#> 4 4 0.875 0.889 0.923 0.1135 0.913 0.746
#> 5 5 1.000 0.994 0.988 0.0728 0.940 0.775
#> 6 6 0.943 0.909 0.929 0.0247 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.000 0.979 0.000 1.000
#> SRR901150 1 0.000 0.984 1.000 0.000
#> SRR901151 1 0.000 0.984 1.000 0.000
#> SRR901152 1 0.000 0.984 1.000 0.000
#> SRR1382100 2 0.000 0.979 0.000 1.000
#> SRR901154 1 0.722 0.754 0.800 0.200
#> SRR901155 1 0.722 0.754 0.800 0.200
#> SRR901156 2 0.000 0.979 0.000 1.000
#> SRR901157 2 0.000 0.979 0.000 1.000
#> SRR901158 1 0.000 0.984 1.000 0.000
#> SRR901159 1 0.000 0.984 1.000 0.000
#> SRR901160 1 0.000 0.984 1.000 0.000
#> SRR901161 2 0.000 0.979 0.000 1.000
#> SRR901162 1 0.000 0.984 1.000 0.000
#> SRR901163 1 0.000 0.984 1.000 0.000
#> SRR901164 2 0.000 0.979 0.000 1.000
#> SRR901165 2 0.000 0.979 0.000 1.000
#> SRR901166 1 0.000 0.984 1.000 0.000
#> SRR901167 1 0.000 0.984 1.000 0.000
#> SRR901168 1 0.000 0.984 1.000 0.000
#> SRR901169 2 0.000 0.979 0.000 1.000
#> SRR901170 2 0.000 0.979 0.000 1.000
#> SRR901171 2 0.000 0.979 0.000 1.000
#> SRR901172 2 0.000 0.979 0.000 1.000
#> SRR901173 2 0.000 0.979 0.000 1.000
#> SRR901174 1 0.000 0.984 1.000 0.000
#> SRR901175 1 0.000 0.984 1.000 0.000
#> SRR901176 2 0.000 0.979 0.000 1.000
#> SRR901177 2 0.000 0.979 0.000 1.000
#> SRR901178 2 0.000 0.979 0.000 1.000
#> SRR901179 2 0.000 0.979 0.000 1.000
#> SRR901180 2 0.000 0.979 0.000 1.000
#> SRR901181 2 0.000 0.979 0.000 1.000
#> SRR901182 1 0.000 0.984 1.000 0.000
#> SRR901183 1 0.000 0.984 1.000 0.000
#> SRR901184 1 0.000 0.984 1.000 0.000
#> SRR901185 2 0.000 0.979 0.000 1.000
#> SRR901187 2 0.000 0.979 0.000 1.000
#> SRR901186 2 0.000 0.979 0.000 1.000
#> SRR901188 2 0.706 0.765 0.192 0.808
#> SRR901189 2 0.000 0.979 0.000 1.000
#> SRR901190 1 0.000 0.984 1.000 0.000
#> SRR901191 1 0.000 0.984 1.000 0.000
#> SRR901192 1 0.000 0.984 1.000 0.000
#> SRR901193 2 0.000 0.979 0.000 1.000
#> SRR901194 2 0.000 0.979 0.000 1.000
#> SRR901195 2 0.000 0.979 0.000 1.000
#> SRR901196 2 0.000 0.979 0.000 1.000
#> SRR901197 2 0.000 0.979 0.000 1.000
#> SRR901198 1 0.000 0.984 1.000 0.000
#> SRR901199 1 0.000 0.984 1.000 0.000
#> SRR901200 1 0.000 0.984 1.000 0.000
#> SRR901201 2 0.000 0.979 0.000 1.000
#> SRR901202 2 0.000 0.979 0.000 1.000
#> SRR901203 2 0.000 0.979 0.000 1.000
#> SRR901204 2 0.000 0.979 0.000 1.000
#> SRR901205 2 0.000 0.979 0.000 1.000
#> SRR901206 1 0.000 0.984 1.000 0.000
#> SRR901207 1 0.000 0.984 1.000 0.000
#> SRR901208 1 0.000 0.984 1.000 0.000
#> SRR901209 2 0.000 0.979 0.000 1.000
#> SRR901211 2 0.844 0.636 0.272 0.728
#> SRR901210 2 0.000 0.979 0.000 1.000
#> SRR901212 2 0.000 0.979 0.000 1.000
#> SRR901213 2 0.000 0.979 0.000 1.000
#> SRR901214 2 0.000 0.979 0.000 1.000
#> SRR901215 2 0.000 0.979 0.000 1.000
#> SRR901216 2 0.000 0.979 0.000 1.000
#> SRR901217 2 0.000 0.979 0.000 1.000
#> SRR901218 1 0.204 0.956 0.968 0.032
#> SRR901219 1 0.000 0.984 1.000 0.000
#> SRR901220 1 0.000 0.984 1.000 0.000
#> SRR901221 2 0.000 0.979 0.000 1.000
#> SRR901222 2 0.697 0.770 0.188 0.812
#> SRR901223 1 0.506 0.871 0.888 0.112
#> SRR901224 2 0.000 0.979 0.000 1.000
#> SRR901225 2 0.000 0.979 0.000 1.000
#> SRR901226 1 0.000 0.984 1.000 0.000
#> SRR901227 1 0.000 0.984 1.000 0.000
#> SRR901229 2 0.000 0.979 0.000 1.000
#> SRR901228 1 0.000 0.984 1.000 0.000
#> SRR901230 1 0.000 0.984 1.000 0.000
#> SRR901231 2 0.861 0.614 0.284 0.716
#> SRR901232 1 0.000 0.984 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901154 2 0.2796 0.894 0.092 0.908 0.000
#> SRR901155 2 0.3267 0.873 0.116 0.884 0.000
#> SRR901156 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901157 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901162 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901163 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901164 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901165 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901170 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901171 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901172 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901173 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901176 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901178 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901179 2 0.0892 0.950 0.000 0.980 0.020
#> SRR901180 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901181 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901187 2 0.0892 0.950 0.000 0.980 0.020
#> SRR901186 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901188 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901189 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901194 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901195 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901196 2 0.2448 0.930 0.000 0.924 0.076
#> SRR901197 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901202 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901203 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901204 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901205 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901211 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901210 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901212 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901214 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901215 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901216 2 0.2537 0.929 0.000 0.920 0.080
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901218 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901219 2 0.3340 0.869 0.120 0.880 0.000
#> SRR901220 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901222 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901223 2 0.3340 0.869 0.120 0.880 0.000
#> SRR901224 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901226 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901227 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901228 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901230 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901231 2 0.0000 0.954 0.000 1.000 0.000
#> SRR901232 2 0.3116 0.881 0.108 0.892 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901150 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901154 2 0.4866 0.676 0.000 0.596 0 0.404
#> SRR901155 2 0.4866 0.676 0.000 0.596 0 0.404
#> SRR901156 2 0.0188 0.836 0.000 0.996 0 0.004
#> SRR901157 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901158 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901162 4 0.3486 0.768 0.188 0.000 0 0.812
#> SRR901163 4 0.4661 0.701 0.348 0.000 0 0.652
#> SRR901164 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901165 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901170 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901171 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901172 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901173 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901174 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901176 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901178 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901179 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901180 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901181 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901182 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901187 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901186 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901188 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901189 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901190 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901194 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901195 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901196 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901197 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901198 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901202 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901203 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901204 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901205 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901211 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901210 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901212 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901214 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901215 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901216 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901218 4 0.0000 0.693 0.000 0.000 0 1.000
#> SRR901219 4 0.0000 0.693 0.000 0.000 0 1.000
#> SRR901220 4 0.3528 0.768 0.192 0.000 0 0.808
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901222 2 0.4661 0.734 0.000 0.652 0 0.348
#> SRR901223 2 0.4866 0.676 0.000 0.596 0 0.404
#> SRR901224 2 0.0000 0.837 0.000 1.000 0 0.000
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901226 4 0.4661 0.701 0.348 0.000 0 0.652
#> SRR901227 4 0.4661 0.701 0.348 0.000 0 0.652
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000
#> SRR901228 4 0.4661 0.701 0.348 0.000 0 0.652
#> SRR901230 4 0.4661 0.701 0.348 0.000 0 0.652
#> SRR901231 4 0.0000 0.693 0.000 0.000 0 1.000
#> SRR901232 4 0.0000 0.693 0.000 0.000 0 1.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 3 0.1043 0.977 0.000 0.000 0.96 0.000 0.040
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR1382100 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901154 5 0.1121 0.992 0.000 0.044 0.00 0.000 0.956
#> SRR901155 5 0.1121 0.992 0.000 0.044 0.00 0.000 0.956
#> SRR901156 5 0.1410 0.988 0.000 0.060 0.00 0.000 0.940
#> SRR901157 3 0.1043 0.977 0.000 0.000 0.96 0.000 0.040
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901161 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901162 4 0.0000 0.995 0.000 0.000 0.00 1.000 0.000
#> SRR901163 4 0.0000 0.995 0.000 0.000 0.00 1.000 0.000
#> SRR901164 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901165 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901169 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901170 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901171 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901172 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901173 3 0.1043 0.977 0.000 0.000 0.96 0.000 0.040
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901176 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901177 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901178 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901179 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901180 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901181 3 0.1043 0.977 0.000 0.000 0.96 0.000 0.040
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901185 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901187 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901186 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901188 5 0.1197 0.993 0.000 0.048 0.00 0.000 0.952
#> SRR901189 3 0.1043 0.977 0.000 0.000 0.96 0.000 0.040
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901193 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901194 5 0.1341 0.993 0.000 0.056 0.00 0.000 0.944
#> SRR901195 5 0.1341 0.993 0.000 0.056 0.00 0.000 0.944
#> SRR901196 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901197 3 0.1043 0.977 0.000 0.000 0.96 0.000 0.040
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901201 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901202 5 0.1341 0.993 0.000 0.056 0.00 0.000 0.944
#> SRR901203 5 0.1341 0.993 0.000 0.056 0.00 0.000 0.944
#> SRR901204 5 0.1341 0.993 0.000 0.056 0.00 0.000 0.944
#> SRR901205 3 0.1043 0.977 0.000 0.000 0.96 0.000 0.040
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.00 0.000 0.000
#> SRR901209 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901211 5 0.1197 0.993 0.000 0.048 0.00 0.000 0.952
#> SRR901210 5 0.1270 0.993 0.000 0.052 0.00 0.000 0.948
#> SRR901212 2 0.0162 0.996 0.000 0.996 0.00 0.000 0.004
#> SRR901213 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901214 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901215 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901216 2 0.0000 0.999 0.000 1.000 0.00 0.000 0.000
#> SRR901217 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901218 4 0.0290 0.994 0.000 0.000 0.00 0.992 0.008
#> SRR901219 4 0.0290 0.994 0.000 0.000 0.00 0.992 0.008
#> SRR901220 4 0.0290 0.994 0.000 0.000 0.00 0.992 0.008
#> SRR901221 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901222 5 0.1121 0.992 0.000 0.044 0.00 0.000 0.956
#> SRR901223 5 0.1121 0.992 0.000 0.044 0.00 0.000 0.956
#> SRR901224 2 0.0162 0.996 0.000 0.996 0.00 0.000 0.004
#> SRR901225 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901226 4 0.0162 0.994 0.000 0.000 0.00 0.996 0.004
#> SRR901227 4 0.0324 0.992 0.004 0.000 0.00 0.992 0.004
#> SRR901229 3 0.0000 0.989 0.000 0.000 1.00 0.000 0.000
#> SRR901228 4 0.0162 0.994 0.000 0.000 0.00 0.996 0.004
#> SRR901230 4 0.0162 0.994 0.000 0.000 0.00 0.996 0.004
#> SRR901231 4 0.0510 0.989 0.000 0.000 0.00 0.984 0.016
#> SRR901232 4 0.0290 0.994 0.000 0.000 0.00 0.992 0.008
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 3 0.3797 0.692 0.000 0.000 0.58 0.000 NA 0.000
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR1382100 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901154 2 0.0000 0.876 0.000 1.000 0.00 0.000 NA 0.000
#> SRR901155 2 0.0000 0.876 0.000 1.000 0.00 0.000 NA 0.000
#> SRR901156 2 0.0146 0.874 0.000 0.996 0.00 0.000 NA 0.000
#> SRR901157 3 0.3797 0.692 0.000 0.000 0.58 0.000 NA 0.000
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901161 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901162 4 0.0547 0.880 0.000 0.000 0.00 0.980 NA 0.000
#> SRR901163 4 0.0547 0.880 0.000 0.000 0.00 0.980 NA 0.000
#> SRR901164 6 0.0865 0.962 0.000 0.000 0.00 0.000 NA 0.964
#> SRR901165 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901169 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901170 6 0.0000 0.977 0.000 0.000 0.00 0.000 NA 1.000
#> SRR901171 6 0.0000 0.977 0.000 0.000 0.00 0.000 NA 1.000
#> SRR901172 6 0.0000 0.977 0.000 0.000 0.00 0.000 NA 1.000
#> SRR901173 3 0.3797 0.692 0.000 0.000 0.58 0.000 NA 0.000
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901176 6 0.0865 0.962 0.000 0.000 0.00 0.000 NA 0.964
#> SRR901177 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901178 6 0.0547 0.972 0.000 0.000 0.00 0.000 NA 0.980
#> SRR901179 6 0.0000 0.977 0.000 0.000 0.00 0.000 NA 1.000
#> SRR901180 6 0.0000 0.977 0.000 0.000 0.00 0.000 NA 1.000
#> SRR901181 3 0.3797 0.692 0.000 0.000 0.58 0.000 NA 0.000
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901185 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901187 6 0.0508 0.973 0.000 0.004 0.00 0.000 NA 0.984
#> SRR901186 6 0.0891 0.964 0.000 0.008 0.00 0.000 NA 0.968
#> SRR901188 2 0.2823 0.923 0.000 0.796 0.00 0.000 NA 0.000
#> SRR901189 3 0.3797 0.692 0.000 0.000 0.58 0.000 NA 0.000
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901193 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901194 2 0.2823 0.923 0.000 0.796 0.00 0.000 NA 0.000
#> SRR901195 2 0.2823 0.923 0.000 0.796 0.00 0.000 NA 0.000
#> SRR901196 6 0.0363 0.974 0.000 0.000 0.00 0.000 NA 0.988
#> SRR901197 3 0.3797 0.692 0.000 0.000 0.58 0.000 NA 0.000
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901201 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901202 2 0.2793 0.923 0.000 0.800 0.00 0.000 NA 0.000
#> SRR901203 2 0.2793 0.923 0.000 0.800 0.00 0.000 NA 0.000
#> SRR901204 2 0.2793 0.923 0.000 0.800 0.00 0.000 NA 0.000
#> SRR901205 3 0.3797 0.692 0.000 0.000 0.58 0.000 NA 0.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.00 0.000 NA 0.000
#> SRR901209 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901211 2 0.2823 0.923 0.000 0.796 0.00 0.000 NA 0.000
#> SRR901210 2 0.2793 0.923 0.000 0.800 0.00 0.000 NA 0.000
#> SRR901212 6 0.0820 0.966 0.000 0.016 0.00 0.000 NA 0.972
#> SRR901213 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901214 6 0.0000 0.977 0.000 0.000 0.00 0.000 NA 1.000
#> SRR901215 6 0.0000 0.977 0.000 0.000 0.00 0.000 NA 1.000
#> SRR901216 6 0.0000 0.977 0.000 0.000 0.00 0.000 NA 1.000
#> SRR901217 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901218 4 0.1267 0.873 0.000 0.000 0.00 0.940 NA 0.000
#> SRR901219 4 0.1141 0.871 0.000 0.000 0.00 0.948 NA 0.000
#> SRR901220 4 0.0000 0.879 0.000 0.000 0.00 1.000 NA 0.000
#> SRR901221 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901222 2 0.0000 0.876 0.000 1.000 0.00 0.000 NA 0.000
#> SRR901223 2 0.0000 0.876 0.000 1.000 0.00 0.000 NA 0.000
#> SRR901224 6 0.3319 0.810 0.000 0.164 0.00 0.000 NA 0.800
#> SRR901225 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901226 4 0.3309 0.832 0.000 0.000 0.00 0.720 NA 0.000
#> SRR901227 4 0.3426 0.831 0.004 0.000 0.00 0.720 NA 0.000
#> SRR901229 3 0.0000 0.862 0.000 0.000 1.00 0.000 NA 0.000
#> SRR901228 4 0.3309 0.832 0.000 0.000 0.00 0.720 NA 0.000
#> SRR901230 4 0.3309 0.832 0.000 0.000 0.00 0.720 NA 0.000
#> SRR901231 4 0.3221 0.697 0.000 0.000 0.00 0.736 NA 0.000
#> SRR901232 4 0.1327 0.868 0.000 0.000 0.00 0.936 NA 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "pam"]
# you can also extract it by
# res = res_list["ATC:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1 0.955 0.983 0.4395 0.567 0.567
#> 3 3 1 0.981 0.991 0.4233 0.788 0.634
#> 4 4 1 0.966 0.974 0.1908 0.858 0.633
#> 5 5 1 0.993 0.997 0.0552 0.952 0.813
#> 6 6 1 0.975 0.991 0.0512 0.920 0.658
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0000 0.980 0.000 1.000
#> SRR901150 1 0.0000 0.986 1.000 0.000
#> SRR901151 1 0.0000 0.986 1.000 0.000
#> SRR901152 1 0.0000 0.986 1.000 0.000
#> SRR1382100 2 0.0000 0.980 0.000 1.000
#> SRR901154 2 0.0000 0.980 0.000 1.000
#> SRR901155 2 0.0000 0.980 0.000 1.000
#> SRR901156 2 0.0000 0.980 0.000 1.000
#> SRR901157 2 0.0000 0.980 0.000 1.000
#> SRR901158 1 0.0000 0.986 1.000 0.000
#> SRR901159 1 0.0000 0.986 1.000 0.000
#> SRR901160 1 0.0000 0.986 1.000 0.000
#> SRR901161 2 0.0000 0.980 0.000 1.000
#> SRR901162 2 0.0000 0.980 0.000 1.000
#> SRR901163 2 0.9522 0.413 0.372 0.628
#> SRR901164 2 0.0000 0.980 0.000 1.000
#> SRR901165 2 0.0000 0.980 0.000 1.000
#> SRR901166 1 0.0000 0.986 1.000 0.000
#> SRR901167 1 0.0000 0.986 1.000 0.000
#> SRR901168 1 0.0000 0.986 1.000 0.000
#> SRR901169 2 0.0000 0.980 0.000 1.000
#> SRR901170 2 0.0000 0.980 0.000 1.000
#> SRR901171 2 0.0000 0.980 0.000 1.000
#> SRR901172 2 0.0000 0.980 0.000 1.000
#> SRR901173 2 0.0000 0.980 0.000 1.000
#> SRR901174 1 0.0000 0.986 1.000 0.000
#> SRR901175 1 0.0000 0.986 1.000 0.000
#> SRR901176 2 0.0000 0.980 0.000 1.000
#> SRR901177 2 0.0000 0.980 0.000 1.000
#> SRR901178 2 0.0000 0.980 0.000 1.000
#> SRR901179 2 0.0000 0.980 0.000 1.000
#> SRR901180 2 0.0000 0.980 0.000 1.000
#> SRR901181 2 0.0000 0.980 0.000 1.000
#> SRR901182 1 0.0000 0.986 1.000 0.000
#> SRR901183 1 0.0000 0.986 1.000 0.000
#> SRR901184 1 0.0000 0.986 1.000 0.000
#> SRR901185 2 0.0000 0.980 0.000 1.000
#> SRR901187 2 0.0000 0.980 0.000 1.000
#> SRR901186 2 0.0000 0.980 0.000 1.000
#> SRR901188 2 0.0000 0.980 0.000 1.000
#> SRR901189 2 0.0000 0.980 0.000 1.000
#> SRR901190 1 0.0000 0.986 1.000 0.000
#> SRR901191 1 0.0000 0.986 1.000 0.000
#> SRR901192 1 0.0000 0.986 1.000 0.000
#> SRR901193 2 0.0000 0.980 0.000 1.000
#> SRR901194 2 0.0000 0.980 0.000 1.000
#> SRR901195 2 0.0000 0.980 0.000 1.000
#> SRR901196 2 0.0000 0.980 0.000 1.000
#> SRR901197 2 0.0000 0.980 0.000 1.000
#> SRR901198 1 0.0000 0.986 1.000 0.000
#> SRR901199 1 0.0000 0.986 1.000 0.000
#> SRR901200 1 0.0000 0.986 1.000 0.000
#> SRR901201 2 0.0000 0.980 0.000 1.000
#> SRR901202 2 0.0000 0.980 0.000 1.000
#> SRR901203 2 0.0000 0.980 0.000 1.000
#> SRR901204 2 0.0000 0.980 0.000 1.000
#> SRR901205 2 0.0000 0.980 0.000 1.000
#> SRR901206 1 0.0000 0.986 1.000 0.000
#> SRR901207 1 0.0000 0.986 1.000 0.000
#> SRR901208 1 0.0000 0.986 1.000 0.000
#> SRR901209 2 0.0000 0.980 0.000 1.000
#> SRR901211 2 0.0000 0.980 0.000 1.000
#> SRR901210 2 0.0000 0.980 0.000 1.000
#> SRR901212 2 0.0000 0.980 0.000 1.000
#> SRR901213 2 0.0000 0.980 0.000 1.000
#> SRR901214 2 0.0000 0.980 0.000 1.000
#> SRR901215 2 0.0000 0.980 0.000 1.000
#> SRR901216 2 0.0000 0.980 0.000 1.000
#> SRR901217 2 0.0000 0.980 0.000 1.000
#> SRR901218 2 0.0000 0.980 0.000 1.000
#> SRR901219 2 0.0000 0.980 0.000 1.000
#> SRR901220 2 0.9522 0.413 0.372 0.628
#> SRR901221 2 0.0000 0.980 0.000 1.000
#> SRR901222 2 0.0000 0.980 0.000 1.000
#> SRR901223 2 0.0000 0.980 0.000 1.000
#> SRR901224 2 0.0000 0.980 0.000 1.000
#> SRR901225 2 0.0000 0.980 0.000 1.000
#> SRR901226 2 0.9608 0.382 0.384 0.616
#> SRR901227 1 0.0000 0.986 1.000 0.000
#> SRR901229 2 0.0000 0.980 0.000 1.000
#> SRR901228 1 0.0672 0.979 0.992 0.008
#> SRR901230 1 0.9000 0.517 0.684 0.316
#> SRR901231 2 0.0000 0.980 0.000 1.000
#> SRR901232 2 0.0000 0.980 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 2 0.4235 0.794 0.000 0.824 0.176
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901154 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901155 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901156 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901157 2 0.0747 0.969 0.000 0.984 0.016
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901162 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901163 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901164 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901165 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901170 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901171 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901172 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901173 2 0.0747 0.969 0.000 0.984 0.016
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901176 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901177 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901178 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901179 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901180 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901181 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901187 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901186 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901188 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901189 2 0.4504 0.767 0.000 0.804 0.196
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901194 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901195 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901196 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901197 2 0.2796 0.896 0.000 0.908 0.092
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901202 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901203 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901204 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901205 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901211 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901210 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901212 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901213 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901214 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901215 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901216 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901218 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901219 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901220 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901222 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901223 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901224 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901225 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901226 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901227 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1.000
#> SRR901228 1 0.0424 0.990 0.992 0.008 0.000
#> SRR901230 2 0.5098 0.677 0.248 0.752 0.000
#> SRR901231 2 0.0000 0.982 0.000 1.000 0.000
#> SRR901232 2 0.0000 0.982 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 2 0.4998 0.703 0.000 0.748 0.200 0.052
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901154 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901155 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901156 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901157 2 0.3716 0.837 0.000 0.852 0.096 0.052
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901162 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901163 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901164 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901165 3 0.1474 0.963 0.000 0.000 0.948 0.052
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901169 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901170 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901171 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901172 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901173 2 0.1474 0.919 0.000 0.948 0.000 0.052
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901176 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901177 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901178 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901179 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901180 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901181 3 0.1474 0.963 0.000 0.000 0.948 0.052
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901187 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901186 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901188 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901189 2 0.6055 0.354 0.000 0.576 0.372 0.052
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901194 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901195 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901196 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901197 2 0.1474 0.919 0.000 0.948 0.000 0.052
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901202 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901203 2 0.3569 0.727 0.000 0.804 0.000 0.196
#> SRR901204 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901205 3 0.1474 0.963 0.000 0.000 0.948 0.052
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901211 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901210 2 0.0817 0.938 0.000 0.976 0.000 0.024
#> SRR901212 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901213 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901214 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901215 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901216 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901217 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901218 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901219 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901220 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901221 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901222 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901223 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901224 2 0.0000 0.957 0.000 1.000 0.000 0.000
#> SRR901225 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901226 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901227 4 0.1733 0.963 0.028 0.024 0.000 0.948
#> SRR901229 3 0.0000 0.992 0.000 0.000 1.000 0.000
#> SRR901228 4 0.1724 0.974 0.020 0.032 0.000 0.948
#> SRR901230 4 0.1576 0.992 0.004 0.048 0.000 0.948
#> SRR901231 4 0.1474 0.996 0.000 0.052 0.000 0.948
#> SRR901232 4 0.1474 0.996 0.000 0.052 0.000 0.948
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901150 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901151 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901152 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR1382100 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901154 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901155 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901156 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901157 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901158 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901159 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901160 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901161 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901162 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901163 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901164 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901165 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901166 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901167 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901168 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901169 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901170 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901171 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901172 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901173 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901174 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901175 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901176 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901177 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901178 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901179 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901180 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901181 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901182 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901183 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901184 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901185 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901187 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901186 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901188 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901189 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901190 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901191 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901192 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901193 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901194 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901195 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901196 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901197 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901198 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901199 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901200 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901201 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901202 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901203 2 0.3210 0.726 0 0.788 0 0.212 0
#> SRR901204 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901205 5 0.0000 1.000 0 0.000 0 0.000 1
#> SRR901206 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901207 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901208 1 0.0000 1.000 1 0.000 0 0.000 0
#> SRR901209 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901211 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901210 2 0.0703 0.963 0 0.976 0 0.024 0
#> SRR901212 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901213 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901214 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901215 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901216 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901217 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901218 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901219 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901220 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901221 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901222 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901223 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901224 2 0.0000 0.988 0 1.000 0 0.000 0
#> SRR901225 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901226 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901227 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901229 3 0.0000 1.000 0 0.000 1 0.000 0
#> SRR901228 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901230 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901231 4 0.0000 1.000 0 0.000 0 1.000 0
#> SRR901232 4 0.0000 1.000 0 0.000 0 1.000 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901150 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901154 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901155 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901156 2 0.0146 0.963 0.000 0.996 0 0.000 0 0.004
#> SRR901157 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901158 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901162 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901163 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901164 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901165 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901167 4 0.3607 0.466 0.348 0.000 0 0.652 0 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901170 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901171 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901172 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901173 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901174 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901176 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901178 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901179 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901180 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901181 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901182 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901187 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901186 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901188 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901189 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901190 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901194 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901195 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901196 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901197 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901198 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901202 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901203 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901204 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901205 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901211 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901210 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901212 2 0.3706 0.390 0.000 0.620 0 0.000 0 0.380
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901214 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901215 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901216 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901218 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901219 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901220 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901222 2 0.0000 0.966 0.000 1.000 0 0.000 0 0.000
#> SRR901223 2 0.0458 0.955 0.000 0.984 0 0.016 0 0.000
#> SRR901224 6 0.0000 1.000 0.000 0.000 0 0.000 0 1.000
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901226 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901227 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> SRR901228 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901230 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
#> SRR901231 2 0.0458 0.955 0.000 0.984 0 0.016 0 0.000
#> SRR901232 4 0.0000 0.953 0.000 0.000 0 1.000 0 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "mclust"]
# you can also extract it by
# res = res_list["ATC:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.788 0.945 0.972 0.4216 0.598 0.598
#> 3 3 0.934 0.971 0.985 0.5378 0.759 0.597
#> 4 4 1.000 0.985 0.990 0.1257 0.908 0.743
#> 5 5 1.000 0.993 0.997 0.0054 0.984 0.942
#> 6 6 0.936 0.958 0.955 0.0461 0.964 0.865
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.000 0.960 0.000 1.000
#> SRR901150 1 0.000 1.000 1.000 0.000
#> SRR901151 1 0.000 1.000 1.000 0.000
#> SRR901152 1 0.000 1.000 1.000 0.000
#> SRR1382100 2 0.000 0.960 0.000 1.000
#> SRR901154 2 0.000 0.960 0.000 1.000
#> SRR901155 2 0.000 0.960 0.000 1.000
#> SRR901156 2 0.000 0.960 0.000 1.000
#> SRR901157 2 0.000 0.960 0.000 1.000
#> SRR901158 1 0.000 1.000 1.000 0.000
#> SRR901159 1 0.000 1.000 1.000 0.000
#> SRR901160 1 0.000 1.000 1.000 0.000
#> SRR901161 2 0.000 0.960 0.000 1.000
#> SRR901162 2 0.781 0.743 0.232 0.768
#> SRR901163 2 0.781 0.743 0.232 0.768
#> SRR901164 2 0.000 0.960 0.000 1.000
#> SRR901165 2 0.000 0.960 0.000 1.000
#> SRR901166 1 0.000 1.000 1.000 0.000
#> SRR901167 1 0.000 1.000 1.000 0.000
#> SRR901168 1 0.000 1.000 1.000 0.000
#> SRR901169 2 0.000 0.960 0.000 1.000
#> SRR901170 2 0.000 0.960 0.000 1.000
#> SRR901171 2 0.000 0.960 0.000 1.000
#> SRR901172 2 0.000 0.960 0.000 1.000
#> SRR901173 2 0.000 0.960 0.000 1.000
#> SRR901174 1 0.000 1.000 1.000 0.000
#> SRR901175 1 0.000 1.000 1.000 0.000
#> SRR901176 2 0.000 0.960 0.000 1.000
#> SRR901177 2 0.000 0.960 0.000 1.000
#> SRR901178 2 0.000 0.960 0.000 1.000
#> SRR901179 2 0.000 0.960 0.000 1.000
#> SRR901180 2 0.000 0.960 0.000 1.000
#> SRR901181 2 0.000 0.960 0.000 1.000
#> SRR901182 1 0.000 1.000 1.000 0.000
#> SRR901183 1 0.000 1.000 1.000 0.000
#> SRR901184 1 0.000 1.000 1.000 0.000
#> SRR901185 2 0.000 0.960 0.000 1.000
#> SRR901187 2 0.000 0.960 0.000 1.000
#> SRR901186 2 0.000 0.960 0.000 1.000
#> SRR901188 2 0.000 0.960 0.000 1.000
#> SRR901189 2 0.000 0.960 0.000 1.000
#> SRR901190 1 0.000 1.000 1.000 0.000
#> SRR901191 1 0.000 1.000 1.000 0.000
#> SRR901192 1 0.000 1.000 1.000 0.000
#> SRR901193 2 0.000 0.960 0.000 1.000
#> SRR901194 2 0.000 0.960 0.000 1.000
#> SRR901195 2 0.000 0.960 0.000 1.000
#> SRR901196 2 0.000 0.960 0.000 1.000
#> SRR901197 2 0.000 0.960 0.000 1.000
#> SRR901198 1 0.000 1.000 1.000 0.000
#> SRR901199 1 0.000 1.000 1.000 0.000
#> SRR901200 1 0.000 1.000 1.000 0.000
#> SRR901201 2 0.000 0.960 0.000 1.000
#> SRR901202 2 0.000 0.960 0.000 1.000
#> SRR901203 2 0.000 0.960 0.000 1.000
#> SRR901204 2 0.000 0.960 0.000 1.000
#> SRR901205 2 0.000 0.960 0.000 1.000
#> SRR901206 1 0.000 1.000 1.000 0.000
#> SRR901207 1 0.000 1.000 1.000 0.000
#> SRR901208 1 0.000 1.000 1.000 0.000
#> SRR901209 2 0.000 0.960 0.000 1.000
#> SRR901211 2 0.000 0.960 0.000 1.000
#> SRR901210 2 0.000 0.960 0.000 1.000
#> SRR901212 2 0.000 0.960 0.000 1.000
#> SRR901213 2 0.000 0.960 0.000 1.000
#> SRR901214 2 0.000 0.960 0.000 1.000
#> SRR901215 2 0.000 0.960 0.000 1.000
#> SRR901216 2 0.000 0.960 0.000 1.000
#> SRR901217 2 0.000 0.960 0.000 1.000
#> SRR901218 2 0.781 0.743 0.232 0.768
#> SRR901219 2 0.781 0.743 0.232 0.768
#> SRR901220 2 0.781 0.743 0.232 0.768
#> SRR901221 2 0.000 0.960 0.000 1.000
#> SRR901222 2 0.000 0.960 0.000 1.000
#> SRR901223 2 0.000 0.960 0.000 1.000
#> SRR901224 2 0.000 0.960 0.000 1.000
#> SRR901225 2 0.000 0.960 0.000 1.000
#> SRR901226 2 0.781 0.743 0.232 0.768
#> SRR901227 2 0.781 0.743 0.232 0.768
#> SRR901229 2 0.000 0.960 0.000 1.000
#> SRR901228 2 0.781 0.743 0.232 0.768
#> SRR901230 2 0.781 0.743 0.232 0.768
#> SRR901231 2 0.000 0.960 0.000 1.000
#> SRR901232 2 0.781 0.743 0.232 0.768
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.000 1.000 0 0.000 1.000
#> SRR901150 1 0.000 1.000 1 0.000 0.000
#> SRR901151 1 0.000 1.000 1 0.000 0.000
#> SRR901152 1 0.000 1.000 1 0.000 0.000
#> SRR1382100 3 0.000 1.000 0 0.000 1.000
#> SRR901154 2 0.000 0.967 0 1.000 0.000
#> SRR901155 2 0.000 0.967 0 1.000 0.000
#> SRR901156 2 0.000 0.967 0 1.000 0.000
#> SRR901157 3 0.000 1.000 0 0.000 1.000
#> SRR901158 1 0.000 1.000 1 0.000 0.000
#> SRR901159 1 0.000 1.000 1 0.000 0.000
#> SRR901160 1 0.000 1.000 1 0.000 0.000
#> SRR901161 3 0.000 1.000 0 0.000 1.000
#> SRR901162 2 0.440 0.799 0 0.812 0.188
#> SRR901163 2 0.440 0.799 0 0.812 0.188
#> SRR901164 2 0.000 0.967 0 1.000 0.000
#> SRR901165 3 0.000 1.000 0 0.000 1.000
#> SRR901166 1 0.000 1.000 1 0.000 0.000
#> SRR901167 1 0.000 1.000 1 0.000 0.000
#> SRR901168 1 0.000 1.000 1 0.000 0.000
#> SRR901169 3 0.000 1.000 0 0.000 1.000
#> SRR901170 2 0.000 0.967 0 1.000 0.000
#> SRR901171 2 0.000 0.967 0 1.000 0.000
#> SRR901172 2 0.000 0.967 0 1.000 0.000
#> SRR901173 3 0.000 1.000 0 0.000 1.000
#> SRR901174 1 0.000 1.000 1 0.000 0.000
#> SRR901175 1 0.000 1.000 1 0.000 0.000
#> SRR901176 2 0.000 0.967 0 1.000 0.000
#> SRR901177 3 0.000 1.000 0 0.000 1.000
#> SRR901178 2 0.000 0.967 0 1.000 0.000
#> SRR901179 2 0.000 0.967 0 1.000 0.000
#> SRR901180 2 0.000 0.967 0 1.000 0.000
#> SRR901181 3 0.000 1.000 0 0.000 1.000
#> SRR901182 1 0.000 1.000 1 0.000 0.000
#> SRR901183 1 0.000 1.000 1 0.000 0.000
#> SRR901184 1 0.000 1.000 1 0.000 0.000
#> SRR901185 3 0.000 1.000 0 0.000 1.000
#> SRR901187 2 0.000 0.967 0 1.000 0.000
#> SRR901186 2 0.000 0.967 0 1.000 0.000
#> SRR901188 2 0.000 0.967 0 1.000 0.000
#> SRR901189 3 0.000 1.000 0 0.000 1.000
#> SRR901190 1 0.000 1.000 1 0.000 0.000
#> SRR901191 1 0.000 1.000 1 0.000 0.000
#> SRR901192 1 0.000 1.000 1 0.000 0.000
#> SRR901193 3 0.000 1.000 0 0.000 1.000
#> SRR901194 2 0.000 0.967 0 1.000 0.000
#> SRR901195 2 0.000 0.967 0 1.000 0.000
#> SRR901196 2 0.000 0.967 0 1.000 0.000
#> SRR901197 3 0.000 1.000 0 0.000 1.000
#> SRR901198 1 0.000 1.000 1 0.000 0.000
#> SRR901199 1 0.000 1.000 1 0.000 0.000
#> SRR901200 1 0.000 1.000 1 0.000 0.000
#> SRR901201 3 0.000 1.000 0 0.000 1.000
#> SRR901202 2 0.000 0.967 0 1.000 0.000
#> SRR901203 2 0.000 0.967 0 1.000 0.000
#> SRR901204 2 0.000 0.967 0 1.000 0.000
#> SRR901205 3 0.000 1.000 0 0.000 1.000
#> SRR901206 1 0.000 1.000 1 0.000 0.000
#> SRR901207 1 0.000 1.000 1 0.000 0.000
#> SRR901208 1 0.000 1.000 1 0.000 0.000
#> SRR901209 3 0.000 1.000 0 0.000 1.000
#> SRR901211 2 0.000 0.967 0 1.000 0.000
#> SRR901210 2 0.000 0.967 0 1.000 0.000
#> SRR901212 2 0.000 0.967 0 1.000 0.000
#> SRR901213 3 0.000 1.000 0 0.000 1.000
#> SRR901214 2 0.000 0.967 0 1.000 0.000
#> SRR901215 2 0.000 0.967 0 1.000 0.000
#> SRR901216 2 0.000 0.967 0 1.000 0.000
#> SRR901217 3 0.000 1.000 0 0.000 1.000
#> SRR901218 2 0.000 0.967 0 1.000 0.000
#> SRR901219 2 0.000 0.967 0 1.000 0.000
#> SRR901220 2 0.000 0.967 0 1.000 0.000
#> SRR901221 3 0.000 1.000 0 0.000 1.000
#> SRR901222 2 0.000 0.967 0 1.000 0.000
#> SRR901223 2 0.000 0.967 0 1.000 0.000
#> SRR901224 2 0.000 0.967 0 1.000 0.000
#> SRR901225 3 0.000 1.000 0 0.000 1.000
#> SRR901226 2 0.440 0.799 0 0.812 0.188
#> SRR901227 2 0.440 0.799 0 0.812 0.188
#> SRR901229 3 0.000 1.000 0 0.000 1.000
#> SRR901228 2 0.480 0.758 0 0.780 0.220
#> SRR901230 2 0.480 0.758 0 0.780 0.220
#> SRR901231 2 0.000 0.967 0 1.000 0.000
#> SRR901232 2 0.236 0.911 0 0.928 0.072
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901150 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901151 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901152 1 0.0000 1.000 1 0.000 0 0.000
#> SRR1382100 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901154 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901155 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901156 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901157 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901158 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901159 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901160 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901161 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901162 4 0.0592 0.920 0 0.016 0 0.984
#> SRR901163 4 0.0592 0.920 0 0.016 0 0.984
#> SRR901164 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901165 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901166 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901167 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901168 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901169 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901170 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901171 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901172 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901173 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901174 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901175 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901176 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901177 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901178 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901179 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901180 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901181 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901182 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901183 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901184 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901185 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901187 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901186 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901188 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901189 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901190 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901191 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901192 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901193 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901194 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901195 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901196 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901197 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901198 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901199 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901200 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901201 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901202 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901203 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901204 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901205 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901206 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901207 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901208 1 0.0000 1.000 1 0.000 0 0.000
#> SRR901209 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901211 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901210 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901212 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901213 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901214 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901215 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901216 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901217 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901218 4 0.2814 0.877 0 0.132 0 0.868
#> SRR901219 4 0.3444 0.840 0 0.184 0 0.816
#> SRR901220 4 0.3486 0.836 0 0.188 0 0.812
#> SRR901221 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901222 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901223 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901224 2 0.0000 1.000 0 1.000 0 0.000
#> SRR901225 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901226 4 0.0592 0.920 0 0.016 0 0.984
#> SRR901227 4 0.0592 0.920 0 0.016 0 0.984
#> SRR901229 3 0.0000 1.000 0 0.000 1 0.000
#> SRR901228 4 0.0000 0.908 0 0.000 0 1.000
#> SRR901230 4 0.0000 0.908 0 0.000 0 1.000
#> SRR901231 4 0.4008 0.763 0 0.244 0 0.756
#> SRR901232 4 0.0592 0.920 0 0.016 0 0.984
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901150 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901151 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901152 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR1382100 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901154 2 0.0290 0.992 0.000 0.992 0 0.008 0
#> SRR901155 2 0.0290 0.992 0.000 0.992 0 0.008 0
#> SRR901156 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901157 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901158 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901159 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901160 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901161 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901162 4 0.0162 0.970 0.000 0.004 0 0.996 0
#> SRR901163 4 0.0162 0.970 0.000 0.004 0 0.996 0
#> SRR901164 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901165 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901166 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901167 1 0.0510 0.983 0.984 0.000 0 0.016 0
#> SRR901168 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901169 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901170 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901171 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901172 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901173 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901174 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901175 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901176 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901177 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901178 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901179 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901180 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901181 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901182 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901183 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901184 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901185 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901187 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901186 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901188 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901189 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901190 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901191 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901192 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901193 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901194 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901195 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901196 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901197 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901198 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901199 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901200 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901201 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901202 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901203 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901204 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901205 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901206 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901207 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901208 1 0.0000 0.999 1.000 0.000 0 0.000 0
#> SRR901209 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901211 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901210 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901212 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901213 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901214 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901215 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901216 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901217 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901218 4 0.1544 0.885 0.000 0.068 0 0.932 0
#> SRR901219 4 0.1197 0.919 0.000 0.048 0 0.952 0
#> SRR901220 4 0.0162 0.970 0.000 0.004 0 0.996 0
#> SRR901221 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901222 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901223 2 0.0162 0.994 0.000 0.996 0 0.004 0
#> SRR901224 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901225 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901226 4 0.0162 0.970 0.000 0.004 0 0.996 0
#> SRR901227 4 0.0162 0.970 0.000 0.004 0 0.996 0
#> SRR901229 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> SRR901228 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901230 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> SRR901231 2 0.0162 0.996 0.000 0.996 0 0.004 0
#> SRR901232 4 0.0162 0.970 0.000 0.004 0 0.996 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 3 0.3390 0.762 0.000 0.000 0.704 0.000 0.296 0
#> SRR901150 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901151 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901152 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR1382100 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901154 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901155 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901156 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901157 3 0.3390 0.762 0.000 0.000 0.704 0.000 0.296 0
#> SRR901158 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901159 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901160 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901161 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901162 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0
#> SRR901163 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0
#> SRR901164 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901165 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901166 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901167 1 0.1074 0.959 0.960 0.000 0.000 0.028 0.012 0
#> SRR901168 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901169 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901170 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901171 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901172 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901173 3 0.3390 0.762 0.000 0.000 0.704 0.000 0.296 0
#> SRR901174 1 0.0458 0.985 0.984 0.000 0.000 0.000 0.016 0
#> SRR901175 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901176 2 0.0260 0.992 0.000 0.992 0.000 0.000 0.008 0
#> SRR901177 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901178 2 0.0146 0.994 0.000 0.996 0.000 0.000 0.004 0
#> SRR901179 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901180 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901181 3 0.3390 0.762 0.000 0.000 0.704 0.000 0.296 0
#> SRR901182 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901183 1 0.0146 0.995 0.996 0.000 0.000 0.000 0.004 0
#> SRR901184 1 0.0146 0.995 0.996 0.000 0.000 0.000 0.004 0
#> SRR901185 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901187 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901186 2 0.0260 0.992 0.000 0.992 0.000 0.000 0.008 0
#> SRR901188 2 0.0260 0.992 0.000 0.992 0.000 0.000 0.008 0
#> SRR901189 3 0.3390 0.762 0.000 0.000 0.704 0.000 0.296 0
#> SRR901190 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901191 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901192 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901193 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901194 5 0.3464 1.000 0.000 0.312 0.000 0.000 0.688 0
#> SRR901195 5 0.3464 1.000 0.000 0.312 0.000 0.000 0.688 0
#> SRR901196 2 0.0363 0.988 0.000 0.988 0.000 0.000 0.012 0
#> SRR901197 3 0.3390 0.762 0.000 0.000 0.704 0.000 0.296 0
#> SRR901198 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901199 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901200 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901201 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901202 2 0.0260 0.992 0.000 0.992 0.000 0.000 0.008 0
#> SRR901203 2 0.0260 0.992 0.000 0.992 0.000 0.000 0.008 0
#> SRR901204 5 0.3464 1.000 0.000 0.312 0.000 0.000 0.688 0
#> SRR901205 3 0.3390 0.762 0.000 0.000 0.704 0.000 0.296 0
#> SRR901206 1 0.0146 0.995 0.996 0.000 0.000 0.000 0.004 0
#> SRR901207 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901208 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000 0
#> SRR901209 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901211 5 0.3464 1.000 0.000 0.312 0.000 0.000 0.688 0
#> SRR901210 5 0.3464 1.000 0.000 0.312 0.000 0.000 0.688 0
#> SRR901212 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901213 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901214 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901215 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901216 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901217 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901218 4 0.0363 0.981 0.000 0.012 0.000 0.988 0.000 0
#> SRR901219 4 0.0508 0.973 0.000 0.012 0.000 0.984 0.004 0
#> SRR901220 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0
#> SRR901221 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901222 2 0.0260 0.992 0.000 0.992 0.000 0.000 0.008 0
#> SRR901223 2 0.0260 0.992 0.000 0.992 0.000 0.000 0.008 0
#> SRR901224 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000 0
#> SRR901225 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901226 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0
#> SRR901227 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000 0
#> SRR901229 3 0.0000 0.892 0.000 0.000 1.000 0.000 0.000 0
#> SRR901228 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1
#> SRR901230 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1
#> SRR901231 2 0.0405 0.989 0.000 0.988 0.000 0.004 0.008 0
#> SRR901232 4 0.0000 0.993 0.000 0.000 0.000 1.000 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.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "NMF"]
# you can also extract it by
# res = res_list["ATC:NMF"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 17171 rows and 84 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 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.962 0.986 0.4423 0.559 0.559
#> 3 3 1.000 0.986 0.995 0.4812 0.745 0.559
#> 4 4 1.000 0.976 0.986 0.0776 0.948 0.851
#> 5 5 0.903 0.925 0.940 0.0381 0.963 0.880
#> 6 6 0.852 0.700 0.879 0.0626 0.956 0.846
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2 3 4
There is also optional best \(k\) = 2 3 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> SRR901149 2 0.0000 0.989 0.000 1.000
#> SRR901150 1 0.0000 0.979 1.000 0.000
#> SRR901151 1 0.0000 0.979 1.000 0.000
#> SRR901152 1 0.0000 0.979 1.000 0.000
#> SRR1382100 2 0.0000 0.989 0.000 1.000
#> SRR901154 2 0.0672 0.981 0.008 0.992
#> SRR901155 2 0.3114 0.934 0.056 0.944
#> SRR901156 2 0.0000 0.989 0.000 1.000
#> SRR901157 2 0.0000 0.989 0.000 1.000
#> SRR901158 1 0.0000 0.979 1.000 0.000
#> SRR901159 1 0.0000 0.979 1.000 0.000
#> SRR901160 1 0.0000 0.979 1.000 0.000
#> SRR901161 2 0.0000 0.989 0.000 1.000
#> SRR901162 2 0.1414 0.970 0.020 0.980
#> SRR901163 1 0.9970 0.101 0.532 0.468
#> SRR901164 2 0.0000 0.989 0.000 1.000
#> SRR901165 2 0.0000 0.989 0.000 1.000
#> SRR901166 1 0.0000 0.979 1.000 0.000
#> SRR901167 1 0.0000 0.979 1.000 0.000
#> SRR901168 1 0.0000 0.979 1.000 0.000
#> SRR901169 2 0.0000 0.989 0.000 1.000
#> SRR901170 2 0.0000 0.989 0.000 1.000
#> SRR901171 2 0.0000 0.989 0.000 1.000
#> SRR901172 2 0.0000 0.989 0.000 1.000
#> SRR901173 2 0.0000 0.989 0.000 1.000
#> SRR901174 1 0.0000 0.979 1.000 0.000
#> SRR901175 1 0.0000 0.979 1.000 0.000
#> SRR901176 2 0.0000 0.989 0.000 1.000
#> SRR901177 2 0.0000 0.989 0.000 1.000
#> SRR901178 2 0.0000 0.989 0.000 1.000
#> SRR901179 2 0.0000 0.989 0.000 1.000
#> SRR901180 2 0.0000 0.989 0.000 1.000
#> SRR901181 2 0.0000 0.989 0.000 1.000
#> SRR901182 1 0.0000 0.979 1.000 0.000
#> SRR901183 1 0.0000 0.979 1.000 0.000
#> SRR901184 1 0.0000 0.979 1.000 0.000
#> SRR901185 2 0.0000 0.989 0.000 1.000
#> SRR901187 2 0.0000 0.989 0.000 1.000
#> SRR901186 2 0.0000 0.989 0.000 1.000
#> SRR901188 2 0.0000 0.989 0.000 1.000
#> SRR901189 2 0.0000 0.989 0.000 1.000
#> SRR901190 1 0.0000 0.979 1.000 0.000
#> SRR901191 1 0.0000 0.979 1.000 0.000
#> SRR901192 1 0.0000 0.979 1.000 0.000
#> SRR901193 2 0.0000 0.989 0.000 1.000
#> SRR901194 2 0.0000 0.989 0.000 1.000
#> SRR901195 2 0.0000 0.989 0.000 1.000
#> SRR901196 2 0.0000 0.989 0.000 1.000
#> SRR901197 2 0.0000 0.989 0.000 1.000
#> SRR901198 1 0.0000 0.979 1.000 0.000
#> SRR901199 1 0.0000 0.979 1.000 0.000
#> SRR901200 1 0.0000 0.979 1.000 0.000
#> SRR901201 2 0.0000 0.989 0.000 1.000
#> SRR901202 2 0.0000 0.989 0.000 1.000
#> SRR901203 2 0.0000 0.989 0.000 1.000
#> SRR901204 2 0.0000 0.989 0.000 1.000
#> SRR901205 2 0.0000 0.989 0.000 1.000
#> SRR901206 1 0.0000 0.979 1.000 0.000
#> SRR901207 1 0.0000 0.979 1.000 0.000
#> SRR901208 1 0.0000 0.979 1.000 0.000
#> SRR901209 2 0.0000 0.989 0.000 1.000
#> SRR901211 2 0.0000 0.989 0.000 1.000
#> SRR901210 2 0.0000 0.989 0.000 1.000
#> SRR901212 2 0.0000 0.989 0.000 1.000
#> SRR901213 2 0.0000 0.989 0.000 1.000
#> SRR901214 2 0.0000 0.989 0.000 1.000
#> SRR901215 2 0.0000 0.989 0.000 1.000
#> SRR901216 2 0.0000 0.989 0.000 1.000
#> SRR901217 2 0.0000 0.989 0.000 1.000
#> SRR901218 2 0.0000 0.989 0.000 1.000
#> SRR901219 2 0.0000 0.989 0.000 1.000
#> SRR901220 1 0.0938 0.969 0.988 0.012
#> SRR901221 2 0.0000 0.989 0.000 1.000
#> SRR901222 2 0.0000 0.989 0.000 1.000
#> SRR901223 2 0.4022 0.907 0.080 0.920
#> SRR901224 2 0.0000 0.989 0.000 1.000
#> SRR901225 2 0.0000 0.989 0.000 1.000
#> SRR901226 2 0.9944 0.138 0.456 0.544
#> SRR901227 1 0.0000 0.979 1.000 0.000
#> SRR901229 2 0.0000 0.989 0.000 1.000
#> SRR901228 1 0.2948 0.929 0.948 0.052
#> SRR901230 2 0.0000 0.989 0.000 1.000
#> SRR901231 2 0.0000 0.989 0.000 1.000
#> SRR901232 2 0.0000 0.989 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> SRR901149 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000
#> SRR1382100 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901154 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901155 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901156 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901157 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901161 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901162 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901163 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901164 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901165 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901169 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901170 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901171 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901172 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901173 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901176 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901177 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901178 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901179 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901180 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901181 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901185 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901187 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901186 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901188 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901189 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901193 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901194 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901195 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901196 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901197 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901201 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901202 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901203 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901204 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901205 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901209 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901211 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901210 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901212 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901213 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901214 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901215 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901216 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901217 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901218 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901219 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901220 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901221 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901222 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901223 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901224 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901225 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901226 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901227 1 0.0000 1.000 1.000 0.000 0.000
#> SRR901229 3 0.0000 0.978 0.000 0.000 1.000
#> SRR901228 1 0.0237 0.995 0.996 0.004 0.000
#> SRR901230 3 0.6180 0.288 0.000 0.416 0.584
#> SRR901231 2 0.0000 1.000 0.000 1.000 0.000
#> SRR901232 2 0.0000 1.000 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> SRR901149 3 0.0336 0.993 0.000 0.000 0.992 0.008
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901154 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901155 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901156 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901157 3 0.0336 0.993 0.000 0.000 0.992 0.008
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901162 2 0.3528 0.771 0.000 0.808 0.000 0.192
#> SRR901163 4 0.2831 0.886 0.004 0.120 0.000 0.876
#> SRR901164 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901165 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901169 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901170 2 0.0000 0.974 0.000 1.000 0.000 0.000
#> SRR901171 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901172 2 0.0469 0.971 0.000 0.988 0.000 0.012
#> SRR901173 3 0.0707 0.985 0.000 0.000 0.980 0.020
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901176 2 0.0592 0.969 0.000 0.984 0.000 0.016
#> SRR901177 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901178 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901179 2 0.0000 0.974 0.000 1.000 0.000 0.000
#> SRR901180 2 0.0188 0.973 0.000 0.996 0.000 0.004
#> SRR901181 3 0.0336 0.993 0.000 0.000 0.992 0.008
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901187 2 0.0000 0.974 0.000 1.000 0.000 0.000
#> SRR901186 2 0.0469 0.971 0.000 0.988 0.000 0.012
#> SRR901188 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901189 3 0.0336 0.993 0.000 0.000 0.992 0.008
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901193 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901194 2 0.0592 0.969 0.000 0.984 0.000 0.016
#> SRR901195 2 0.0592 0.969 0.000 0.984 0.000 0.016
#> SRR901196 2 0.0592 0.969 0.000 0.984 0.000 0.016
#> SRR901197 3 0.0817 0.981 0.000 0.000 0.976 0.024
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901202 2 0.0469 0.971 0.000 0.988 0.000 0.012
#> SRR901203 2 0.0188 0.973 0.000 0.996 0.000 0.004
#> SRR901204 2 0.0469 0.971 0.000 0.988 0.000 0.012
#> SRR901205 3 0.0336 0.993 0.000 0.000 0.992 0.008
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901211 2 0.0469 0.971 0.000 0.988 0.000 0.012
#> SRR901210 2 0.0469 0.971 0.000 0.988 0.000 0.012
#> SRR901212 2 0.0336 0.972 0.000 0.992 0.000 0.008
#> SRR901213 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901214 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901215 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901216 2 0.0336 0.972 0.000 0.992 0.000 0.008
#> SRR901217 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901218 4 0.1474 0.950 0.000 0.052 0.000 0.948
#> SRR901219 2 0.4008 0.687 0.000 0.756 0.000 0.244
#> SRR901220 2 0.2281 0.892 0.000 0.904 0.000 0.096
#> SRR901221 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901222 2 0.0000 0.974 0.000 1.000 0.000 0.000
#> SRR901223 2 0.0000 0.974 0.000 1.000 0.000 0.000
#> SRR901224 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901225 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901226 4 0.0921 0.960 0.000 0.028 0.000 0.972
#> SRR901227 4 0.1624 0.949 0.028 0.020 0.000 0.952
#> SRR901229 3 0.0000 0.996 0.000 0.000 1.000 0.000
#> SRR901228 4 0.0967 0.957 0.004 0.016 0.004 0.976
#> SRR901230 4 0.0927 0.956 0.000 0.016 0.008 0.976
#> SRR901231 2 0.0188 0.974 0.000 0.996 0.000 0.004
#> SRR901232 2 0.2281 0.892 0.000 0.904 0.000 0.096
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> SRR901149 5 0.3586 0.930 0.000 0.000 0.264 0.000 0.736
#> SRR901150 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901151 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901152 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR1382100 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901154 2 0.2583 0.886 0.000 0.864 0.000 0.004 0.132
#> SRR901155 2 0.2488 0.892 0.000 0.872 0.000 0.004 0.124
#> SRR901156 2 0.2536 0.889 0.000 0.868 0.000 0.004 0.128
#> SRR901157 5 0.3508 0.931 0.000 0.000 0.252 0.000 0.748
#> SRR901158 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901160 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901161 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901162 2 0.2769 0.889 0.000 0.876 0.000 0.032 0.092
#> SRR901163 2 0.4867 0.726 0.008 0.728 0.000 0.184 0.080
#> SRR901164 2 0.1704 0.916 0.000 0.928 0.000 0.004 0.068
#> SRR901165 3 0.0794 0.920 0.000 0.000 0.972 0.000 0.028
#> SRR901166 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901167 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901168 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901169 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901170 2 0.2280 0.896 0.000 0.880 0.000 0.000 0.120
#> SRR901171 2 0.3048 0.854 0.000 0.820 0.000 0.004 0.176
#> SRR901172 2 0.3461 0.802 0.000 0.772 0.000 0.004 0.224
#> SRR901173 5 0.3074 0.882 0.000 0.000 0.196 0.000 0.804
#> SRR901174 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901175 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901176 2 0.2389 0.895 0.000 0.880 0.000 0.004 0.116
#> SRR901177 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901178 2 0.1809 0.915 0.000 0.928 0.000 0.012 0.060
#> SRR901179 2 0.1121 0.924 0.000 0.956 0.000 0.000 0.044
#> SRR901180 2 0.0771 0.929 0.000 0.976 0.000 0.004 0.020
#> SRR901181 5 0.4088 0.796 0.000 0.000 0.368 0.000 0.632
#> SRR901182 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901187 2 0.0290 0.929 0.000 0.992 0.000 0.000 0.008
#> SRR901186 2 0.1205 0.924 0.000 0.956 0.000 0.004 0.040
#> SRR901188 2 0.1571 0.917 0.000 0.936 0.000 0.004 0.060
#> SRR901189 5 0.3661 0.922 0.000 0.000 0.276 0.000 0.724
#> SRR901190 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901191 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0162 0.949 0.000 0.000 0.996 0.000 0.004
#> SRR901194 2 0.1571 0.919 0.000 0.936 0.000 0.004 0.060
#> SRR901195 2 0.1430 0.921 0.000 0.944 0.000 0.004 0.052
#> SRR901196 2 0.0771 0.929 0.000 0.976 0.000 0.004 0.020
#> SRR901197 5 0.3395 0.923 0.000 0.000 0.236 0.000 0.764
#> SRR901198 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901200 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901201 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901202 2 0.0771 0.929 0.000 0.976 0.000 0.004 0.020
#> SRR901203 2 0.0324 0.929 0.000 0.992 0.000 0.004 0.004
#> SRR901204 2 0.0451 0.928 0.000 0.988 0.000 0.004 0.008
#> SRR901205 3 0.4242 -0.302 0.000 0.000 0.572 0.000 0.428
#> SRR901206 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901208 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> SRR901209 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901211 2 0.1571 0.919 0.000 0.936 0.000 0.004 0.060
#> SRR901210 2 0.0566 0.929 0.000 0.984 0.000 0.004 0.012
#> SRR901212 2 0.0671 0.929 0.000 0.980 0.000 0.004 0.016
#> SRR901213 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901214 2 0.1701 0.925 0.000 0.936 0.000 0.016 0.048
#> SRR901215 2 0.1082 0.928 0.000 0.964 0.000 0.008 0.028
#> SRR901216 2 0.1668 0.926 0.000 0.940 0.000 0.032 0.028
#> SRR901217 3 0.0162 0.949 0.000 0.000 0.996 0.000 0.004
#> SRR901218 4 0.1341 0.912 0.000 0.056 0.000 0.944 0.000
#> SRR901219 2 0.2914 0.885 0.000 0.872 0.000 0.076 0.052
#> SRR901220 2 0.2221 0.910 0.000 0.912 0.000 0.036 0.052
#> SRR901221 3 0.0000 0.952 0.000 0.000 1.000 0.000 0.000
#> SRR901222 2 0.0880 0.927 0.000 0.968 0.000 0.000 0.032
#> SRR901223 2 0.0880 0.928 0.000 0.968 0.000 0.000 0.032
#> SRR901224 2 0.2583 0.887 0.000 0.864 0.000 0.004 0.132
#> SRR901225 3 0.0290 0.946 0.000 0.000 0.992 0.000 0.008
#> SRR901226 4 0.0671 0.957 0.000 0.016 0.000 0.980 0.004
#> SRR901227 4 0.1041 0.938 0.032 0.004 0.000 0.964 0.000
#> SRR901229 3 0.0162 0.949 0.000 0.000 0.996 0.000 0.004
#> SRR901228 4 0.0324 0.958 0.000 0.004 0.000 0.992 0.004
#> SRR901230 4 0.0324 0.958 0.000 0.004 0.000 0.992 0.004
#> SRR901231 2 0.2068 0.905 0.000 0.904 0.000 0.004 0.092
#> SRR901232 2 0.2653 0.892 0.000 0.880 0.000 0.024 0.096
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> SRR901149 5 0.2331 0.9024 0.000 0.000 0.080 0.000 0.888 0.032
#> SRR901150 1 0.0508 0.9804 0.984 0.000 0.000 0.000 0.004 0.012
#> SRR901151 1 0.0405 0.9812 0.988 0.000 0.000 0.000 0.004 0.008
#> SRR901152 1 0.0508 0.9804 0.984 0.000 0.000 0.000 0.004 0.012
#> SRR1382100 3 0.0458 0.9824 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR901154 2 0.3122 0.5471 0.000 0.816 0.000 0.004 0.020 0.160
#> SRR901155 2 0.2692 0.5634 0.000 0.840 0.000 0.000 0.012 0.148
#> SRR901156 2 0.2872 0.5627 0.000 0.836 0.000 0.000 0.024 0.140
#> SRR901157 5 0.1398 0.9019 0.000 0.000 0.052 0.000 0.940 0.008
#> SRR901158 1 0.0000 0.9825 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901159 1 0.0146 0.9815 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR901160 1 0.0146 0.9815 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR901161 3 0.0260 0.9839 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR901162 6 0.5722 0.7684 0.000 0.376 0.004 0.128 0.004 0.488
#> SRR901163 4 0.6199 0.2174 0.028 0.192 0.004 0.564 0.004 0.208
#> SRR901164 2 0.2357 0.5775 0.000 0.872 0.000 0.000 0.012 0.116
#> SRR901165 3 0.1745 0.9367 0.000 0.000 0.924 0.000 0.020 0.056
#> SRR901166 1 0.1082 0.9667 0.956 0.000 0.000 0.000 0.004 0.040
#> SRR901167 1 0.2941 0.8704 0.848 0.004 0.000 0.012 0.012 0.124
#> SRR901168 1 0.1296 0.9616 0.948 0.000 0.000 0.004 0.004 0.044
#> SRR901169 3 0.0146 0.9841 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR901170 2 0.2867 0.5701 0.000 0.848 0.000 0.000 0.040 0.112
#> SRR901171 2 0.3475 0.5357 0.000 0.800 0.000 0.000 0.060 0.140
#> SRR901172 2 0.4237 0.4591 0.000 0.736 0.000 0.000 0.144 0.120
#> SRR901173 5 0.1933 0.8732 0.000 0.004 0.032 0.000 0.920 0.044
#> SRR901174 1 0.1531 0.9469 0.928 0.000 0.000 0.000 0.004 0.068
#> SRR901175 1 0.0777 0.9759 0.972 0.000 0.000 0.000 0.004 0.024
#> SRR901176 2 0.3582 0.4921 0.000 0.768 0.000 0.000 0.036 0.196
#> SRR901177 3 0.0547 0.9812 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR901178 2 0.3409 0.1032 0.000 0.700 0.000 0.000 0.000 0.300
#> SRR901179 2 0.1049 0.6009 0.000 0.960 0.000 0.000 0.008 0.032
#> SRR901180 2 0.0260 0.5960 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR901181 5 0.2431 0.8749 0.000 0.000 0.132 0.000 0.860 0.008
#> SRR901182 1 0.0000 0.9825 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901183 1 0.0000 0.9825 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901184 1 0.0000 0.9825 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901185 3 0.0363 0.9823 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR901187 2 0.3101 0.3073 0.000 0.756 0.000 0.000 0.000 0.244
#> SRR901186 2 0.3737 -0.3170 0.000 0.608 0.000 0.000 0.000 0.392
#> SRR901188 2 0.3634 -0.1526 0.000 0.644 0.000 0.000 0.000 0.356
#> SRR901189 5 0.1556 0.9032 0.000 0.000 0.080 0.000 0.920 0.000
#> SRR901190 1 0.0692 0.9777 0.976 0.000 0.000 0.000 0.004 0.020
#> SRR901191 1 0.0000 0.9825 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901192 1 0.0000 0.9825 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901193 3 0.0458 0.9811 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR901194 2 0.3647 -0.1729 0.000 0.640 0.000 0.000 0.000 0.360
#> SRR901195 2 0.3076 0.3083 0.000 0.760 0.000 0.000 0.000 0.240
#> SRR901196 2 0.2100 0.5289 0.000 0.884 0.000 0.000 0.004 0.112
#> SRR901197 5 0.1461 0.8951 0.000 0.000 0.044 0.000 0.940 0.016
#> SRR901198 1 0.0000 0.9825 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901199 1 0.0508 0.9804 0.984 0.000 0.000 0.000 0.004 0.012
#> SRR901200 1 0.0508 0.9804 0.984 0.000 0.000 0.000 0.004 0.012
#> SRR901201 3 0.0146 0.9835 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR901202 2 0.0603 0.5939 0.000 0.980 0.000 0.000 0.004 0.016
#> SRR901203 2 0.1267 0.5712 0.000 0.940 0.000 0.000 0.000 0.060
#> SRR901204 2 0.0713 0.5902 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR901205 5 0.3670 0.6972 0.000 0.000 0.284 0.000 0.704 0.012
#> SRR901206 1 0.0000 0.9825 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR901207 1 0.0146 0.9815 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR901208 1 0.0146 0.9815 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR901209 3 0.0146 0.9839 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR901211 2 0.3409 0.1143 0.000 0.700 0.000 0.000 0.000 0.300
#> SRR901210 2 0.1700 0.5584 0.000 0.916 0.000 0.000 0.004 0.080
#> SRR901212 2 0.2092 0.5150 0.000 0.876 0.000 0.000 0.000 0.124
#> SRR901213 3 0.0458 0.9824 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR901214 2 0.6228 -0.3824 0.000 0.520 0.000 0.032 0.256 0.192
#> SRR901215 2 0.4088 -0.2862 0.000 0.616 0.000 0.016 0.000 0.368
#> SRR901216 2 0.5136 -0.0755 0.000 0.640 0.000 0.228 0.008 0.124
#> SRR901217 3 0.0458 0.9810 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR901218 4 0.1649 0.8361 0.000 0.036 0.000 0.932 0.000 0.032
#> SRR901219 2 0.5771 -0.5201 0.000 0.476 0.000 0.336 0.000 0.188
#> SRR901220 2 0.3345 0.3861 0.000 0.788 0.000 0.028 0.000 0.184
#> SRR901221 3 0.0547 0.9812 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR901222 2 0.1297 0.5999 0.000 0.948 0.000 0.000 0.012 0.040
#> SRR901223 2 0.1349 0.5994 0.000 0.940 0.000 0.000 0.004 0.056
#> SRR901224 2 0.3175 0.5448 0.000 0.808 0.000 0.000 0.028 0.164
#> SRR901225 3 0.0820 0.9763 0.000 0.000 0.972 0.000 0.012 0.016
#> SRR901226 4 0.0713 0.8572 0.000 0.000 0.000 0.972 0.000 0.028
#> SRR901227 4 0.1370 0.8378 0.036 0.000 0.000 0.948 0.004 0.012
#> SRR901229 3 0.0363 0.9823 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR901228 4 0.0632 0.8476 0.000 0.000 0.000 0.976 0.000 0.024
#> SRR901230 4 0.0260 0.8543 0.000 0.000 0.000 0.992 0.000 0.008
#> SRR901231 6 0.4405 0.7274 0.000 0.472 0.000 0.024 0.000 0.504
#> SRR901232 6 0.5216 0.8262 0.000 0.424 0.000 0.092 0.000 0.484
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#>
#> Matrix products: default
#> BLAS: /usr/lib64/libblas.so.3.4.2
#> LAPACK: /usr/lib64/liblapack.so.3.4.2
#>
#> locale:
#> [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8
#> [4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
#> [7] LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C
#> [10] LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
#>
#> attached base packages:
#> [1] grid stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] genefilter_1.66.0 ComplexHeatmap_2.3.1 markdown_1.1 knitr_1.26
#> [5] GetoptLong_0.1.7 cola_1.3.2
#>
#> loaded via a namespace (and not attached):
#> [1] circlize_0.4.8 shape_1.4.4 xfun_0.11 slam_0.1-46
#> [5] lattice_0.20-38 splines_3.6.0 colorspace_1.4-1 vctrs_0.2.0
#> [9] stats4_3.6.0 blob_1.2.0 XML_3.98-1.20 survival_2.44-1.1
#> [13] rlang_0.4.2 pillar_1.4.2 DBI_1.0.0 BiocGenerics_0.30.0
#> [17] bit64_0.9-7 RColorBrewer_1.1-2 matrixStats_0.55.0 stringr_1.4.0
#> [21] GlobalOptions_0.1.1 evaluate_0.14 memoise_1.1.0 Biobase_2.44.0
#> [25] IRanges_2.18.3 parallel_3.6.0 AnnotationDbi_1.46.1 highr_0.8
#> [29] Rcpp_1.0.3 xtable_1.8-4 backports_1.1.5 S4Vectors_0.22.1
#> [33] annotate_1.62.0 skmeans_0.2-11 bit_1.1-14 microbenchmark_1.4-7
#> [37] brew_1.0-6 impute_1.58.0 rjson_0.2.20 png_0.1-7
#> [41] digest_0.6.23 stringi_1.4.3 polyclip_1.10-0 clue_0.3-57
#> [45] tools_3.6.0 bitops_1.0-6 magrittr_1.5 eulerr_6.0.0
#> [49] RCurl_1.95-4.12 RSQLite_2.1.4 tibble_2.1.3 cluster_2.1.0
#> [53] crayon_1.3.4 pkgconfig_2.0.3 zeallot_0.1.0 Matrix_1.2-17
#> [57] xml2_1.2.2 httr_1.4.1 R6_2.4.1 mclust_5.4.5
#> [61] compiler_3.6.0