Date: 2019-12-25 20:50:32 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 16250 rows and 98 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, anno = anno)
Dimension of the input matrix:
mat = get_matrix(res_list)
dim(mat)
#> [1] 16250 98
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, top_annotation = HeatmapAnnotation(df = get_anno(res_list),
col = get_anno_col(res_list)), ylab = "value", cluster_columns = TRUE, show_column_names = FALSE,
mc.cores = 4)
Folowing table shows the best k
(number of partitions) for each combination
of top-value methods and partition methods. Clicking on the method name in
the table goes to the section for a single combination of methods.
The cola vignette explains the definition of the metrics used for determining the best number of partitions.
suggest_best_k(res_list)
The best k | 1-PAC | Mean silhouette | Concordance | Optional k | ||
---|---|---|---|---|---|---|
CV:kmeans | 2 | 1.000 | 0.989 | 0.996 | ** | |
MAD:hclust | 2 | 1.000 | 0.992 | 0.997 | ** | |
MAD:kmeans | 2 | 1.000 | 0.990 | 0.991 | ** | |
MAD:pam | 3 | 1.000 | 0.973 | 0.990 | ** | 2 |
ATC:kmeans | 2 | 1.000 | 0.976 | 0.989 | ** | |
SD:NMF | 4 | 0.969 | 0.931 | 0.964 | ** | 3 |
MAD:skmeans | 6 | 0.955 | 0.880 | 0.932 | ** | 2,3,4,5 |
MAD:NMF | 3 | 0.947 | 0.948 | 0.977 | * | 2 |
ATC:hclust | 3 | 0.946 | 0.933 | 0.968 | * | 2 |
CV:skmeans | 4 | 0.946 | 0.962 | 0.978 | * | 2 |
MAD:mclust | 6 | 0.935 | 0.903 | 0.949 | * | 2,3,4,5 |
ATC:pam | 6 | 0.922 | 0.879 | 0.934 | * | 2,3,4 |
SD:pam | 6 | 0.920 | 0.879 | 0.947 | * | 5 |
CV:hclust | 2 | 0.917 | 0.956 | 0.978 | * | |
ATC:NMF | 3 | 0.914 | 0.907 | 0.958 | * | 2 |
SD:skmeans | 6 | 0.910 | 0.837 | 0.906 | * | 2,3 |
CV:mclust | 3 | 0.907 | 0.911 | 0.940 | * | |
ATC:skmeans | 6 | 0.906 | 0.910 | 0.922 | * | 2,3,4 |
SD:mclust | 3 | 0.901 | 0.913 | 0.963 | * | |
CV:NMF | 4 | 0.837 | 0.876 | 0.938 | ||
ATC:mclust | 3 | 0.812 | 0.900 | 0.955 | ||
CV:pam | 2 | 0.719 | 0.910 | 0.954 | ||
SD:kmeans | 3 | 0.672 | 0.868 | 0.894 | ||
SD:hclust | 2 | 0.600 | 0.825 | 0.889 |
**: 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.854 0.909 0.961 0.486 0.525 0.525
#> CV:NMF 2 0.607 0.883 0.937 0.478 0.520 0.520
#> MAD:NMF 2 1.000 0.976 0.990 0.504 0.497 0.497
#> ATC:NMF 2 0.979 0.964 0.984 0.504 0.497 0.497
#> SD:skmeans 2 1.000 0.964 0.970 0.505 0.495 0.495
#> CV:skmeans 2 1.000 0.974 0.989 0.495 0.505 0.505
#> MAD:skmeans 2 1.000 1.000 1.000 0.506 0.495 0.495
#> ATC:skmeans 2 1.000 0.978 0.990 0.505 0.495 0.495
#> SD:mclust 2 0.580 0.937 0.951 0.463 0.512 0.512
#> CV:mclust 2 0.408 0.853 0.900 0.461 0.495 0.495
#> MAD:mclust 2 1.000 0.998 0.997 0.504 0.495 0.495
#> ATC:mclust 2 0.667 0.900 0.943 0.430 0.597 0.597
#> SD:kmeans 2 0.406 0.413 0.788 0.498 0.502 0.502
#> CV:kmeans 2 1.000 0.989 0.996 0.487 0.512 0.512
#> MAD:kmeans 2 1.000 0.990 0.991 0.505 0.495 0.495
#> ATC:kmeans 2 1.000 0.976 0.989 0.502 0.500 0.500
#> SD:pam 2 0.547 0.886 0.930 0.502 0.497 0.497
#> CV:pam 2 0.719 0.910 0.954 0.480 0.508 0.508
#> MAD:pam 2 1.000 0.993 0.997 0.505 0.495 0.495
#> ATC:pam 2 1.000 0.967 0.987 0.502 0.500 0.500
#> SD:hclust 2 0.600 0.825 0.889 0.469 0.512 0.512
#> CV:hclust 2 0.917 0.956 0.978 0.486 0.508 0.508
#> MAD:hclust 2 1.000 0.992 0.997 0.506 0.495 0.495
#> ATC:hclust 2 1.000 0.999 1.000 0.506 0.495 0.495
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 0.957 0.954 0.981 0.3837 0.650 0.418
#> CV:NMF 3 0.537 0.632 0.786 0.3068 0.854 0.728
#> MAD:NMF 3 0.947 0.948 0.977 0.3269 0.778 0.579
#> ATC:NMF 3 0.914 0.907 0.958 0.3020 0.801 0.617
#> SD:skmeans 3 0.985 0.937 0.976 0.3310 0.713 0.482
#> CV:skmeans 3 0.683 0.846 0.827 0.3055 0.793 0.603
#> MAD:skmeans 3 1.000 0.953 0.981 0.3090 0.787 0.593
#> ATC:skmeans 3 1.000 0.971 0.988 0.2961 0.817 0.643
#> SD:mclust 3 0.901 0.913 0.963 0.2355 0.823 0.688
#> CV:mclust 3 0.907 0.911 0.940 0.3508 0.863 0.730
#> MAD:mclust 3 1.000 0.971 0.989 0.0503 0.559 0.374
#> ATC:mclust 3 0.812 0.900 0.955 0.4178 0.783 0.639
#> SD:kmeans 3 0.672 0.868 0.894 0.3193 0.695 0.463
#> CV:kmeans 3 0.671 0.595 0.747 0.2582 0.972 0.945
#> MAD:kmeans 3 0.692 0.704 0.860 0.2831 0.815 0.641
#> ATC:kmeans 3 0.753 0.789 0.856 0.2738 0.838 0.679
#> SD:pam 3 0.885 0.941 0.970 0.3303 0.743 0.527
#> CV:pam 3 0.823 0.783 0.907 0.3846 0.642 0.403
#> MAD:pam 3 1.000 0.973 0.990 0.2618 0.842 0.689
#> ATC:pam 3 0.921 0.915 0.964 0.2889 0.852 0.704
#> SD:hclust 3 0.514 0.743 0.840 0.3219 0.828 0.665
#> CV:hclust 3 0.747 0.818 0.852 0.1555 0.969 0.939
#> MAD:hclust 3 0.706 0.820 0.853 0.2288 0.879 0.758
#> ATC:hclust 3 0.946 0.933 0.968 0.2132 0.886 0.769
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.969 0.931 0.964 0.0951 0.900 0.711
#> CV:NMF 4 0.837 0.876 0.938 0.1957 0.791 0.521
#> MAD:NMF 4 0.797 0.831 0.867 0.0843 0.913 0.751
#> ATC:NMF 4 0.619 0.532 0.775 0.0834 0.968 0.911
#> SD:skmeans 4 0.900 0.739 0.810 0.1096 0.890 0.681
#> CV:skmeans 4 0.946 0.962 0.978 0.1598 0.901 0.710
#> MAD:skmeans 4 0.953 0.965 0.984 0.1318 0.877 0.657
#> ATC:skmeans 4 1.000 0.979 0.991 0.1386 0.870 0.645
#> SD:mclust 4 0.667 0.761 0.850 0.2141 0.887 0.745
#> CV:mclust 4 0.781 0.923 0.913 0.1870 0.854 0.620
#> MAD:mclust 4 0.901 0.929 0.965 0.3318 0.816 0.615
#> ATC:mclust 4 0.709 0.822 0.888 0.1608 0.904 0.759
#> SD:kmeans 4 0.635 0.633 0.744 0.1148 0.941 0.825
#> CV:kmeans 4 0.675 0.790 0.791 0.1542 0.742 0.481
#> MAD:kmeans 4 0.697 0.771 0.824 0.1379 0.821 0.544
#> ATC:kmeans 4 0.805 0.924 0.916 0.1438 0.865 0.636
#> SD:pam 4 0.685 0.787 0.828 0.1062 0.902 0.713
#> CV:pam 4 0.822 0.812 0.914 0.0849 0.927 0.791
#> MAD:pam 4 0.861 0.839 0.905 0.1709 0.868 0.644
#> ATC:pam 4 0.951 0.935 0.973 0.1425 0.879 0.670
#> SD:hclust 4 0.636 0.723 0.842 0.0735 0.972 0.917
#> CV:hclust 4 0.673 0.833 0.865 0.1383 0.928 0.849
#> MAD:hclust 4 0.846 0.929 0.953 0.1787 0.886 0.702
#> ATC:hclust 4 0.854 0.882 0.939 0.1914 0.875 0.671
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.799 0.809 0.882 0.0669 0.928 0.742
#> CV:NMF 5 0.734 0.735 0.855 0.0540 0.951 0.817
#> MAD:NMF 5 0.756 0.778 0.838 0.0731 0.905 0.683
#> ATC:NMF 5 0.598 0.595 0.748 0.0690 0.848 0.574
#> SD:skmeans 5 0.898 0.811 0.909 0.0671 0.882 0.592
#> CV:skmeans 5 0.897 0.847 0.916 0.0464 0.974 0.898
#> MAD:skmeans 5 0.925 0.949 0.955 0.0597 0.931 0.739
#> ATC:skmeans 5 0.930 0.804 0.909 0.0378 0.991 0.963
#> SD:mclust 5 0.820 0.865 0.916 0.1224 0.854 0.581
#> CV:mclust 5 0.782 0.868 0.863 0.0533 0.922 0.701
#> MAD:mclust 5 0.906 0.930 0.947 0.1218 0.905 0.686
#> ATC:mclust 5 0.776 0.807 0.856 0.1044 0.870 0.606
#> SD:kmeans 5 0.683 0.623 0.758 0.0688 0.855 0.548
#> CV:kmeans 5 0.655 0.812 0.803 0.0800 0.970 0.884
#> MAD:kmeans 5 0.794 0.689 0.816 0.0672 0.954 0.821
#> ATC:kmeans 5 0.857 0.852 0.875 0.0577 1.000 1.000
#> SD:pam 5 0.920 0.902 0.955 0.0872 0.922 0.701
#> CV:pam 5 0.738 0.700 0.869 0.0479 0.962 0.871
#> MAD:pam 5 0.802 0.786 0.873 0.0552 0.919 0.697
#> ATC:pam 5 0.823 0.779 0.854 0.0613 0.926 0.726
#> SD:hclust 5 0.699 0.706 0.805 0.0627 0.939 0.810
#> CV:hclust 5 0.700 0.721 0.838 0.1300 0.918 0.796
#> MAD:hclust 5 0.852 0.931 0.910 0.0624 0.939 0.778
#> ATC:hclust 5 0.857 0.840 0.920 0.0258 0.985 0.942
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.673 0.566 0.766 0.0426 0.963 0.839
#> CV:NMF 6 0.697 0.612 0.766 0.0364 0.975 0.894
#> MAD:NMF 6 0.631 0.530 0.736 0.0508 0.969 0.865
#> ATC:NMF 6 0.576 0.507 0.694 0.0455 0.930 0.723
#> SD:skmeans 6 0.910 0.837 0.906 0.0504 0.922 0.648
#> CV:skmeans 6 0.841 0.822 0.886 0.0406 0.953 0.796
#> MAD:skmeans 6 0.955 0.880 0.932 0.0522 0.932 0.686
#> ATC:skmeans 6 0.906 0.910 0.922 0.0407 0.942 0.768
#> SD:mclust 6 0.892 0.841 0.909 0.0571 0.920 0.666
#> CV:mclust 6 0.830 0.762 0.831 0.0362 0.968 0.852
#> MAD:mclust 6 0.935 0.903 0.949 0.0536 0.955 0.780
#> ATC:mclust 6 0.776 0.721 0.812 0.0468 0.935 0.719
#> SD:kmeans 6 0.805 0.683 0.799 0.0422 0.932 0.697
#> CV:kmeans 6 0.707 0.762 0.793 0.0476 0.990 0.959
#> MAD:kmeans 6 0.826 0.765 0.823 0.0391 0.909 0.614
#> ATC:kmeans 6 0.840 0.747 0.798 0.0384 1.000 1.000
#> SD:pam 6 0.920 0.879 0.947 0.0217 0.944 0.741
#> CV:pam 6 0.869 0.814 0.922 0.0384 0.918 0.705
#> MAD:pam 6 0.876 0.804 0.909 0.0480 0.965 0.834
#> ATC:pam 6 0.922 0.879 0.934 0.0482 0.924 0.671
#> SD:hclust 6 0.706 0.748 0.828 0.0772 0.908 0.680
#> CV:hclust 6 0.712 0.734 0.825 0.0213 0.972 0.915
#> MAD:hclust 6 0.862 0.899 0.908 0.0369 0.976 0.889
#> ATC:hclust 6 0.892 0.806 0.895 0.0342 0.990 0.957
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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res_list, k = 2)
#> n dose(p) time(p) k
#> SD:NMF 93 1.10e-10 0.826 2
#> CV:NMF 97 3.25e-15 0.254 2
#> MAD:NMF 97 6.52e-01 0.974 2
#> ATC:NMF 98 4.80e-01 0.988 2
#> SD:skmeans 98 1.00e+00 1.000 2
#> CV:skmeans 98 3.00e-16 0.464 2
#> MAD:skmeans 98 1.00e+00 1.000 2
#> ATC:skmeans 98 9.89e-01 0.989 2
#> SD:mclust 98 2.95e-15 0.303 2
#> CV:mclust 98 4.18e-21 0.990 2
#> MAD:mclust 98 1.00e+00 1.000 2
#> ATC:mclust 97 1.02e-03 0.390 2
#> SD:kmeans 51 7.00e-08 0.492 2
#> CV:kmeans 98 1.23e-15 0.167 2
#> MAD:kmeans 98 1.00e+00 1.000 2
#> ATC:kmeans 97 5.96e-01 0.899 2
#> SD:pam 95 7.61e-01 0.935 2
#> CV:pam 95 3.58e-16 0.248 2
#> MAD:pam 98 9.89e-01 0.989 2
#> ATC:pam 95 7.61e-01 0.935 2
#> SD:hclust 98 2.39e-01 0.302 2
#> CV:hclust 98 6.50e-16 0.156 2
#> MAD:hclust 98 1.00e+00 1.000 2
#> ATC:hclust 98 1.00e+00 1.000 2
test_to_known_factors(res_list, k = 3)
#> n dose(p) time(p) k
#> SD:NMF 97 1.47e-11 3.18e-01 3
#> CV:NMF 89 8.74e-17 1.51e-05 3
#> MAD:NMF 96 7.14e-11 3.77e-01 3
#> ATC:NMF 94 8.47e-10 4.44e-01 3
#> SD:skmeans 93 3.00e-11 2.30e-01 3
#> CV:skmeans 96 1.11e-13 6.38e-01 3
#> MAD:skmeans 95 4.45e-09 4.81e-01 3
#> ATC:skmeans 96 2.70e-08 5.05e-01 3
#> SD:mclust 97 7.93e-12 4.87e-02 3
#> CV:mclust 95 2.54e-18 1.00e+00 3
#> MAD:mclust 98 1.95e-10 2.33e-02 3
#> ATC:mclust 97 1.28e-10 1.14e-01 3
#> SD:kmeans 96 2.11e-10 9.85e-02 3
#> CV:kmeans 73 6.01e-14 1.00e-01 3
#> MAD:kmeans 81 5.94e-08 2.80e-02 3
#> ATC:kmeans 95 1.44e-08 5.71e-01 3
#> SD:pam 98 2.49e-10 2.57e-01 3
#> CV:pam 82 6.67e-13 9.16e-01 3
#> MAD:pam 97 7.77e-07 7.73e-01 3
#> ATC:pam 95 1.66e-07 7.73e-01 3
#> SD:hclust 92 3.20e-08 6.56e-03 3
#> CV:hclust 95 8.79e-14 2.04e-03 3
#> MAD:hclust 91 1.32e-05 2.77e-01 3
#> ATC:hclust 94 4.39e-06 8.38e-01 3
test_to_known_factors(res_list, k = 4)
#> n dose(p) time(p) k
#> SD:NMF 96 4.30e-15 7.01e-04 4
#> CV:NMF 95 1.31e-14 2.22e-04 4
#> MAD:NMF 94 1.30e-12 6.22e-04 4
#> ATC:NMF 58 3.19e-06 1.11e-01 4
#> SD:skmeans 83 4.27e-11 7.65e-01 4
#> CV:skmeans 98 1.71e-15 1.05e-04 4
#> MAD:skmeans 97 5.84e-12 8.53e-01 4
#> ATC:skmeans 98 2.56e-11 6.85e-01 4
#> SD:mclust 85 1.51e-12 1.27e-03 4
#> CV:mclust 97 5.56e-20 4.34e-03 4
#> MAD:mclust 98 4.66e-11 6.70e-05 4
#> ATC:mclust 94 9.40e-13 1.33e-02 4
#> SD:kmeans 76 1.59e-06 1.26e-02 4
#> CV:kmeans 89 3.37e-13 1.89e-05 4
#> MAD:kmeans 94 4.28e-11 6.68e-01 4
#> ATC:kmeans 98 7.21e-11 6.91e-01 4
#> SD:pam 98 1.01e-09 2.31e-05 4
#> CV:pam 89 1.99e-13 2.02e-04 4
#> MAD:pam 95 6.03e-08 4.44e-05 4
#> ATC:pam 95 1.70e-10 8.35e-01 4
#> SD:hclust 82 2.98e-10 1.96e-05 4
#> CV:hclust 96 7.53e-17 1.58e-06 4
#> MAD:hclust 98 8.37e-08 9.47e-02 4
#> ATC:hclust 91 3.30e-12 8.68e-01 4
test_to_known_factors(res_list, k = 5)
#> n dose(p) time(p) k
#> SD:NMF 92 7.04e-16 1.61e-06 5
#> CV:NMF 88 2.84e-13 5.84e-04 5
#> MAD:NMF 88 2.00e-12 1.60e-05 5
#> ATC:NMF 72 2.29e-06 9.24e-05 5
#> SD:skmeans 83 8.01e-11 2.19e-07 5
#> CV:skmeans 94 3.12e-17 3.55e-05 5
#> MAD:skmeans 97 7.57e-11 9.09e-05 5
#> ATC:skmeans 89 5.33e-09 4.12e-01 5
#> SD:mclust 94 6.73e-12 3.99e-08 5
#> CV:mclust 94 9.28e-24 1.65e-05 5
#> MAD:mclust 98 3.52e-10 1.85e-05 5
#> ATC:mclust 95 1.32e-11 5.67e-02 5
#> SD:kmeans 60 9.57e-12 1.95e-03 5
#> CV:kmeans 96 2.48e-14 4.08e-08 5
#> MAD:kmeans 81 3.18e-11 1.52e-01 5
#> ATC:kmeans 97 1.79e-11 7.43e-01 5
#> SD:pam 95 2.34e-08 3.46e-09 5
#> CV:pam 81 1.86e-10 1.54e-07 5
#> MAD:pam 91 8.91e-06 5.35e-08 5
#> ATC:pam 89 4.85e-10 5.26e-02 5
#> SD:hclust 78 5.51e-11 4.05e-09 5
#> CV:hclust 91 4.70e-16 1.90e-06 5
#> MAD:hclust 98 3.14e-09 3.05e-05 5
#> ATC:hclust 86 1.47e-10 2.13e-01 5
test_to_known_factors(res_list, k = 6)
#> n dose(p) time(p) k
#> SD:NMF 74 1.20e-15 1.90e-07 6
#> CV:NMF 78 1.46e-12 2.22e-04 6
#> MAD:NMF 64 2.43e-11 2.00e-06 6
#> ATC:NMF 62 3.10e-07 1.74e-05 6
#> SD:skmeans 94 1.02e-15 5.91e-11 6
#> CV:skmeans 95 3.71e-20 1.18e-04 6
#> MAD:skmeans 96 2.97e-10 1.38e-08 6
#> ATC:skmeans 98 3.11e-11 1.68e-03 6
#> SD:mclust 92 1.71e-13 5.56e-08 6
#> CV:mclust 88 2.09e-23 1.96e-05 6
#> MAD:mclust 95 6.18e-11 6.10e-07 6
#> ATC:mclust 87 7.28e-11 1.11e-03 6
#> SD:kmeans 73 1.15e-13 2.91e-08 6
#> CV:kmeans 96 2.48e-14 4.08e-08 6
#> MAD:kmeans 88 1.56e-11 6.03e-05 6
#> ATC:kmeans 95 1.54e-11 7.89e-01 6
#> SD:pam 95 1.62e-08 1.39e-11 6
#> CV:pam 86 4.23e-14 3.89e-09 6
#> MAD:pam 91 5.86e-11 2.93e-06 6
#> ATC:pam 93 1.39e-07 1.84e-04 6
#> SD:hclust 86 6.60e-12 3.88e-08 6
#> CV:hclust 93 1.06e-15 7.65e-10 6
#> MAD:hclust 98 5.27e-10 2.58e-06 6
#> ATC:hclust 87 8.71e-10 2.01e-01 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.600 0.825 0.889 0.4688 0.512 0.512
#> 3 3 0.514 0.743 0.840 0.3219 0.828 0.665
#> 4 4 0.636 0.723 0.842 0.0735 0.972 0.917
#> 5 5 0.699 0.706 0.805 0.0627 0.939 0.810
#> 6 6 0.706 0.748 0.828 0.0772 0.908 0.680
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
#> GSM241451 2 0.9866 0.549 0.432 0.568
#> GSM241452 1 0.0376 0.974 0.996 0.004
#> GSM241453 2 0.9866 0.549 0.432 0.568
#> GSM241454 1 0.0376 0.974 0.996 0.004
#> GSM241455 2 0.9866 0.549 0.432 0.568
#> GSM241456 1 0.0376 0.974 0.996 0.004
#> GSM241457 2 0.0000 0.805 0.000 1.000
#> GSM241458 1 0.0000 0.973 1.000 0.000
#> GSM241459 2 0.0000 0.805 0.000 1.000
#> GSM241460 1 0.0000 0.973 1.000 0.000
#> GSM241461 2 0.0000 0.805 0.000 1.000
#> GSM241462 1 0.0000 0.973 1.000 0.000
#> GSM241463 2 0.9866 0.549 0.432 0.568
#> GSM241464 1 0.0376 0.974 0.996 0.004
#> GSM241465 2 0.9866 0.549 0.432 0.568
#> GSM241466 1 0.0376 0.974 0.996 0.004
#> GSM241467 1 0.0376 0.974 0.996 0.004
#> GSM241468 2 0.9866 0.549 0.432 0.568
#> GSM241469 1 0.0376 0.974 0.996 0.004
#> GSM241470 2 0.9866 0.549 0.432 0.568
#> GSM241471 2 0.9866 0.549 0.432 0.568
#> GSM241472 1 0.0376 0.974 0.996 0.004
#> GSM241473 2 0.9866 0.549 0.432 0.568
#> GSM241474 1 0.0376 0.974 0.996 0.004
#> GSM241475 2 0.9866 0.549 0.432 0.568
#> GSM241476 1 0.0376 0.974 0.996 0.004
#> GSM241477 2 0.9866 0.549 0.432 0.568
#> GSM241478 2 0.9866 0.549 0.432 0.568
#> GSM241479 1 0.0376 0.974 0.996 0.004
#> GSM241480 1 0.0376 0.974 0.996 0.004
#> GSM241481 2 0.0000 0.805 0.000 1.000
#> GSM241482 1 0.0000 0.973 1.000 0.000
#> GSM241483 2 0.0000 0.805 0.000 1.000
#> GSM241484 1 0.0000 0.973 1.000 0.000
#> GSM241485 1 0.0000 0.973 1.000 0.000
#> GSM241486 2 0.0000 0.805 0.000 1.000
#> GSM241487 2 0.9866 0.549 0.432 0.568
#> GSM241488 2 0.9866 0.549 0.432 0.568
#> GSM241489 1 0.0376 0.974 0.996 0.004
#> GSM241490 1 0.0376 0.974 0.996 0.004
#> GSM241491 2 0.9866 0.549 0.432 0.568
#> GSM241492 1 0.0376 0.974 0.996 0.004
#> GSM241493 2 0.9866 0.549 0.432 0.568
#> GSM241494 1 0.0376 0.974 0.996 0.004
#> GSM241495 2 0.9866 0.549 0.432 0.568
#> GSM241496 2 0.9866 0.549 0.432 0.568
#> GSM241497 1 0.0376 0.974 0.996 0.004
#> GSM241498 1 0.0376 0.974 0.996 0.004
#> GSM241499 1 0.0000 0.973 1.000 0.000
#> GSM241500 2 0.0000 0.805 0.000 1.000
#> GSM241501 2 0.0000 0.805 0.000 1.000
#> GSM241502 2 0.0000 0.805 0.000 1.000
#> GSM241503 1 0.0000 0.973 1.000 0.000
#> GSM241504 1 0.0000 0.973 1.000 0.000
#> GSM241505 1 0.0000 0.973 1.000 0.000
#> GSM241506 2 0.0000 0.805 0.000 1.000
#> GSM241507 1 0.0000 0.973 1.000 0.000
#> GSM241508 2 0.0000 0.805 0.000 1.000
#> GSM241509 2 0.0000 0.805 0.000 1.000
#> GSM241510 2 0.0000 0.805 0.000 1.000
#> GSM241511 1 0.0000 0.973 1.000 0.000
#> GSM241512 1 0.2603 0.937 0.956 0.044
#> GSM241513 2 0.4431 0.835 0.092 0.908
#> GSM241514 1 0.6438 0.770 0.836 0.164
#> GSM241515 2 0.4431 0.835 0.092 0.908
#> GSM241516 1 0.6438 0.770 0.836 0.164
#> GSM241517 2 0.4431 0.835 0.092 0.908
#> GSM241518 2 0.4431 0.835 0.092 0.908
#> GSM241519 2 0.4431 0.835 0.092 0.908
#> GSM241520 2 0.4431 0.835 0.092 0.908
#> GSM241521 2 0.4431 0.835 0.092 0.908
#> GSM241522 1 0.6247 0.781 0.844 0.156
#> GSM241523 2 0.4431 0.835 0.092 0.908
#> GSM241524 2 0.4431 0.835 0.092 0.908
#> GSM241525 1 0.3431 0.922 0.936 0.064
#> GSM241526 2 0.4431 0.835 0.092 0.908
#> GSM241527 1 0.3431 0.922 0.936 0.064
#> GSM241528 2 0.4431 0.835 0.092 0.908
#> GSM241529 2 0.4431 0.835 0.092 0.908
#> GSM241530 1 0.3431 0.922 0.936 0.064
#> GSM241531 1 0.0000 0.973 1.000 0.000
#> GSM241532 2 0.0000 0.805 0.000 1.000
#> GSM241533 2 0.0000 0.805 0.000 1.000
#> GSM241534 2 0.0000 0.805 0.000 1.000
#> GSM241535 1 0.2603 0.937 0.956 0.044
#> GSM241536 1 0.0000 0.973 1.000 0.000
#> GSM241537 2 0.4562 0.833 0.096 0.904
#> GSM241538 2 0.4562 0.833 0.096 0.904
#> GSM241539 2 0.4562 0.833 0.096 0.904
#> GSM241540 2 0.4562 0.833 0.096 0.904
#> GSM241541 2 0.4562 0.833 0.096 0.904
#> GSM241542 2 0.4562 0.833 0.096 0.904
#> GSM241543 2 0.4431 0.835 0.092 0.908
#> GSM241544 2 0.4431 0.835 0.092 0.908
#> GSM241545 2 0.4431 0.835 0.092 0.908
#> GSM241546 2 0.4431 0.835 0.092 0.908
#> GSM241547 2 0.4431 0.835 0.092 0.908
#> GSM241548 2 0.4431 0.835 0.092 0.908
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241452 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241453 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241454 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241455 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241456 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241457 2 0.0000 0.5236 0.000 1.000 0.000
#> GSM241458 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.5236 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241461 2 0.0000 0.5236 0.000 1.000 0.000
#> GSM241462 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241463 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241464 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241465 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241466 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241467 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241468 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241469 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241470 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241471 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241472 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241473 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241474 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241475 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241476 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241477 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241478 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241479 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241480 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241481 2 0.0000 0.5236 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241483 2 0.0000 0.5236 0.000 1.000 0.000
#> GSM241484 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241486 2 0.0000 0.5236 0.000 1.000 0.000
#> GSM241487 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241488 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241489 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241490 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241491 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241492 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241493 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241494 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241495 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241496 2 0.7807 0.5735 0.432 0.516 0.052
#> GSM241497 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241498 1 0.0237 0.9380 0.996 0.004 0.000
#> GSM241499 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241500 2 0.0000 0.5236 0.000 1.000 0.000
#> GSM241501 2 0.0000 0.5236 0.000 1.000 0.000
#> GSM241502 2 0.0237 0.5204 0.000 0.996 0.004
#> GSM241503 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241504 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241505 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241506 2 0.0237 0.5204 0.000 0.996 0.004
#> GSM241507 1 0.0000 0.9374 1.000 0.000 0.000
#> GSM241508 2 0.2066 0.4791 0.000 0.940 0.060
#> GSM241509 2 0.4931 0.2863 0.000 0.768 0.232
#> GSM241510 2 0.4346 0.3620 0.000 0.816 0.184
#> GSM241511 1 0.1031 0.9214 0.976 0.000 0.024
#> GSM241512 1 0.3851 0.8282 0.860 0.004 0.136
#> GSM241513 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241514 1 0.4974 0.6777 0.764 0.000 0.236
#> GSM241515 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241516 1 0.4974 0.6777 0.764 0.000 0.236
#> GSM241517 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241518 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241519 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241520 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241521 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241522 1 0.4887 0.6888 0.772 0.000 0.228
#> GSM241523 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241524 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241525 1 0.4172 0.8061 0.840 0.004 0.156
#> GSM241526 3 0.5882 0.5368 0.000 0.348 0.652
#> GSM241527 1 0.4172 0.8061 0.840 0.004 0.156
#> GSM241528 3 0.5882 0.5368 0.000 0.348 0.652
#> GSM241529 3 0.5882 0.5368 0.000 0.348 0.652
#> GSM241530 1 0.4172 0.8061 0.840 0.004 0.156
#> GSM241531 1 0.2878 0.8587 0.904 0.000 0.096
#> GSM241532 2 0.5835 0.0536 0.000 0.660 0.340
#> GSM241533 2 0.5835 0.0536 0.000 0.660 0.340
#> GSM241534 2 0.5835 0.0536 0.000 0.660 0.340
#> GSM241535 1 0.3851 0.8282 0.860 0.004 0.136
#> GSM241536 1 0.2878 0.8587 0.904 0.000 0.096
#> GSM241537 3 0.0000 0.8273 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.8273 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.8273 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.8273 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.8273 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.8273 0.000 0.000 1.000
#> GSM241543 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241544 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241545 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241546 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241547 3 0.4002 0.8973 0.000 0.160 0.840
#> GSM241548 3 0.4002 0.8973 0.000 0.160 0.840
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241452 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241453 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241454 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241455 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241456 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241457 2 0.0000 0.4407 0.000 1.000 0.000 0.000
#> GSM241458 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241459 2 0.0000 0.4407 0.000 1.000 0.000 0.000
#> GSM241460 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241461 2 0.0000 0.4407 0.000 1.000 0.000 0.000
#> GSM241462 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241463 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241464 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241465 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241466 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241468 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241469 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241470 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241471 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241472 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241473 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241474 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241475 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241476 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241477 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241478 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241479 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.4407 0.000 1.000 0.000 0.000
#> GSM241482 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241483 2 0.0000 0.4407 0.000 1.000 0.000 0.000
#> GSM241484 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241485 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241486 2 0.0000 0.4407 0.000 1.000 0.000 0.000
#> GSM241487 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241488 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241489 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241491 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241492 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241493 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241494 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241495 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241496 2 0.6257 0.5714 0.436 0.508 0.056 0.000
#> GSM241497 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.9242 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241500 2 0.0000 0.4407 0.000 1.000 0.000 0.000
#> GSM241501 2 0.0000 0.4407 0.000 1.000 0.000 0.000
#> GSM241502 2 0.0188 0.4372 0.000 0.996 0.000 0.004
#> GSM241503 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241504 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241505 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241506 2 0.0188 0.4372 0.000 0.996 0.000 0.004
#> GSM241507 1 0.0336 0.9235 0.992 0.000 0.000 0.008
#> GSM241508 2 0.1637 0.3723 0.000 0.940 0.000 0.060
#> GSM241509 2 0.3907 0.0764 0.000 0.768 0.000 0.232
#> GSM241510 2 0.3444 0.1755 0.000 0.816 0.000 0.184
#> GSM241511 1 0.1302 0.9013 0.956 0.000 0.000 0.044
#> GSM241512 1 0.4595 0.7646 0.776 0.000 0.040 0.184
#> GSM241513 3 0.0707 0.9745 0.000 0.000 0.980 0.020
#> GSM241514 1 0.3942 0.6822 0.764 0.000 0.236 0.000
#> GSM241515 3 0.0707 0.9745 0.000 0.000 0.980 0.020
#> GSM241516 1 0.3942 0.6822 0.764 0.000 0.236 0.000
#> GSM241517 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241518 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241519 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241520 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241521 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241522 1 0.3873 0.6934 0.772 0.000 0.228 0.000
#> GSM241523 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241524 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241525 1 0.4776 0.7634 0.776 0.000 0.060 0.164
#> GSM241526 4 0.7895 0.5000 0.004 0.316 0.248 0.432
#> GSM241527 1 0.4776 0.7634 0.776 0.000 0.060 0.164
#> GSM241528 4 0.7895 0.5000 0.004 0.316 0.248 0.432
#> GSM241529 4 0.7895 0.5000 0.004 0.316 0.248 0.432
#> GSM241530 1 0.4776 0.7634 0.776 0.000 0.060 0.164
#> GSM241531 1 0.3528 0.7831 0.808 0.000 0.000 0.192
#> GSM241532 2 0.4624 -0.1685 0.000 0.660 0.000 0.340
#> GSM241533 2 0.4624 -0.1685 0.000 0.660 0.000 0.340
#> GSM241534 2 0.4624 -0.1685 0.000 0.660 0.000 0.340
#> GSM241535 1 0.4595 0.7646 0.776 0.000 0.040 0.184
#> GSM241536 1 0.3528 0.7831 0.808 0.000 0.000 0.192
#> GSM241537 4 0.3266 0.7588 0.000 0.000 0.168 0.832
#> GSM241538 4 0.3266 0.7588 0.000 0.000 0.168 0.832
#> GSM241539 4 0.3266 0.7588 0.000 0.000 0.168 0.832
#> GSM241540 4 0.3266 0.7588 0.000 0.000 0.168 0.832
#> GSM241541 4 0.3266 0.7588 0.000 0.000 0.168 0.832
#> GSM241542 4 0.3266 0.7588 0.000 0.000 0.168 0.832
#> GSM241543 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241544 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241545 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241546 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241547 3 0.0000 0.9962 0.000 0.000 1.000 0.000
#> GSM241548 3 0.0000 0.9962 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241457 2 0.4306 -0.294 0.000 0.508 0.000 0.000 0.492
#> GSM241458 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241459 2 0.4306 -0.294 0.000 0.508 0.000 0.000 0.492
#> GSM241460 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241461 2 0.4306 -0.294 0.000 0.508 0.000 0.000 0.492
#> GSM241462 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241463 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241471 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241478 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241481 2 0.4306 -0.294 0.000 0.508 0.000 0.000 0.492
#> GSM241482 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241483 2 0.4306 -0.294 0.000 0.508 0.000 0.000 0.492
#> GSM241484 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241485 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241486 2 0.4306 -0.294 0.000 0.508 0.000 0.000 0.492
#> GSM241487 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241488 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241496 2 0.4256 0.792 0.436 0.564 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.843 1.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241500 5 0.4262 0.373 0.000 0.440 0.000 0.000 0.560
#> GSM241501 5 0.4287 0.337 0.000 0.460 0.000 0.000 0.540
#> GSM241502 5 0.4283 0.346 0.000 0.456 0.000 0.000 0.544
#> GSM241503 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241504 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241505 1 0.0324 0.842 0.992 0.004 0.000 0.004 0.000
#> GSM241506 5 0.4283 0.346 0.000 0.456 0.000 0.000 0.544
#> GSM241507 1 0.2389 0.764 0.880 0.004 0.000 0.116 0.000
#> GSM241508 5 0.3684 0.564 0.000 0.280 0.000 0.000 0.720
#> GSM241509 5 0.2127 0.632 0.000 0.108 0.000 0.000 0.892
#> GSM241510 5 0.2690 0.639 0.000 0.156 0.000 0.000 0.844
#> GSM241511 1 0.3086 0.716 0.816 0.004 0.000 0.180 0.000
#> GSM241512 1 0.5365 0.435 0.528 0.056 0.000 0.416 0.000
#> GSM241513 3 0.1877 0.918 0.000 0.064 0.924 0.012 0.000
#> GSM241514 1 0.3395 0.635 0.764 0.000 0.236 0.000 0.000
#> GSM241515 3 0.1877 0.918 0.000 0.064 0.924 0.012 0.000
#> GSM241516 1 0.3395 0.635 0.764 0.000 0.236 0.000 0.000
#> GSM241517 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241518 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241519 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241520 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241521 3 0.0609 0.970 0.000 0.020 0.980 0.000 0.000
#> GSM241522 1 0.3336 0.644 0.772 0.000 0.228 0.000 0.000
#> GSM241523 3 0.0609 0.970 0.000 0.020 0.980 0.000 0.000
#> GSM241524 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241525 1 0.5088 0.432 0.528 0.036 0.000 0.436 0.000
#> GSM241526 5 0.6304 0.359 0.004 0.064 0.168 0.108 0.656
#> GSM241527 1 0.5088 0.432 0.528 0.036 0.000 0.436 0.000
#> GSM241528 5 0.6304 0.359 0.004 0.064 0.168 0.108 0.656
#> GSM241529 5 0.6304 0.359 0.004 0.064 0.168 0.108 0.656
#> GSM241530 1 0.5088 0.432 0.528 0.036 0.000 0.436 0.000
#> GSM241531 1 0.4841 0.460 0.560 0.024 0.000 0.416 0.000
#> GSM241532 5 0.0000 0.588 0.000 0.000 0.000 0.000 1.000
#> GSM241533 5 0.0000 0.588 0.000 0.000 0.000 0.000 1.000
#> GSM241534 5 0.0000 0.588 0.000 0.000 0.000 0.000 1.000
#> GSM241535 1 0.5365 0.435 0.528 0.056 0.000 0.416 0.000
#> GSM241536 1 0.4841 0.460 0.560 0.024 0.000 0.416 0.000
#> GSM241537 4 0.4359 1.000 0.000 0.412 0.000 0.584 0.004
#> GSM241538 4 0.4359 1.000 0.000 0.412 0.000 0.584 0.004
#> GSM241539 4 0.4359 1.000 0.000 0.412 0.000 0.584 0.004
#> GSM241540 4 0.4359 1.000 0.000 0.412 0.000 0.584 0.004
#> GSM241541 4 0.4359 1.000 0.000 0.412 0.000 0.584 0.004
#> GSM241542 4 0.4359 1.000 0.000 0.412 0.000 0.584 0.004
#> GSM241543 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241544 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241545 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241546 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241547 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
#> GSM241548 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 2 0.2219 0.2747 0.000 0.864 0.000 0.000 0.136 0.000
#> GSM241458 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241459 2 0.2219 0.2747 0.000 0.864 0.000 0.000 0.136 0.000
#> GSM241460 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241461 2 0.2219 0.2747 0.000 0.864 0.000 0.000 0.136 0.000
#> GSM241462 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241463 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241464 1 0.0146 0.9053 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM241465 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241471 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241478 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 2 0.2219 0.2747 0.000 0.864 0.000 0.000 0.136 0.000
#> GSM241482 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241483 2 0.2219 0.2747 0.000 0.864 0.000 0.000 0.136 0.000
#> GSM241484 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241485 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241486 2 0.2219 0.2747 0.000 0.864 0.000 0.000 0.136 0.000
#> GSM241487 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241488 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241492 1 0.0146 0.9053 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM241493 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241496 2 0.3634 0.7228 0.356 0.644 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.9087 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241500 2 0.2823 0.1280 0.000 0.796 0.000 0.000 0.204 0.000
#> GSM241501 2 0.2664 0.1810 0.000 0.816 0.000 0.000 0.184 0.000
#> GSM241502 2 0.2697 0.1720 0.000 0.812 0.000 0.000 0.188 0.000
#> GSM241503 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241504 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241505 1 0.2219 0.8626 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM241506 2 0.2697 0.1720 0.000 0.812 0.000 0.000 0.188 0.000
#> GSM241507 6 0.5561 0.0811 0.428 0.000 0.000 0.000 0.136 0.436
#> GSM241508 2 0.3684 -0.3833 0.000 0.628 0.000 0.000 0.372 0.000
#> GSM241509 5 0.3843 0.6787 0.000 0.452 0.000 0.000 0.548 0.000
#> GSM241510 5 0.3869 0.6023 0.000 0.500 0.000 0.000 0.500 0.000
#> GSM241511 6 0.4934 0.5043 0.256 0.000 0.000 0.000 0.112 0.632
#> GSM241512 6 0.0260 0.7787 0.000 0.008 0.000 0.000 0.000 0.992
#> GSM241513 3 0.1901 0.8984 0.000 0.028 0.924 0.008 0.000 0.040
#> GSM241514 1 0.3050 0.6751 0.764 0.000 0.236 0.000 0.000 0.000
#> GSM241515 3 0.1901 0.8984 0.000 0.028 0.924 0.008 0.000 0.040
#> GSM241516 1 0.3050 0.6751 0.764 0.000 0.236 0.000 0.000 0.000
#> GSM241517 3 0.0000 0.9431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241518 3 0.1814 0.9297 0.000 0.000 0.900 0.000 0.100 0.000
#> GSM241519 3 0.0000 0.9431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241520 3 0.1814 0.9297 0.000 0.000 0.900 0.000 0.100 0.000
#> GSM241521 3 0.0547 0.9344 0.000 0.020 0.980 0.000 0.000 0.000
#> GSM241522 1 0.2996 0.6848 0.772 0.000 0.228 0.000 0.000 0.000
#> GSM241523 3 0.0547 0.9344 0.000 0.020 0.980 0.000 0.000 0.000
#> GSM241524 3 0.1814 0.9297 0.000 0.000 0.900 0.000 0.100 0.000
#> GSM241525 6 0.1918 0.7737 0.000 0.008 0.000 0.000 0.088 0.904
#> GSM241526 5 0.5998 0.6124 0.000 0.152 0.168 0.008 0.620 0.052
#> GSM241527 6 0.1918 0.7737 0.000 0.008 0.000 0.000 0.088 0.904
#> GSM241528 5 0.5998 0.6124 0.000 0.152 0.168 0.008 0.620 0.052
#> GSM241529 5 0.5998 0.6124 0.000 0.152 0.168 0.008 0.620 0.052
#> GSM241530 6 0.1918 0.7737 0.000 0.008 0.000 0.000 0.088 0.904
#> GSM241531 6 0.1257 0.7711 0.028 0.000 0.000 0.000 0.020 0.952
#> GSM241532 5 0.3563 0.7551 0.000 0.336 0.000 0.000 0.664 0.000
#> GSM241533 5 0.3563 0.7551 0.000 0.336 0.000 0.000 0.664 0.000
#> GSM241534 5 0.3563 0.7551 0.000 0.336 0.000 0.000 0.664 0.000
#> GSM241535 6 0.0260 0.7787 0.000 0.008 0.000 0.000 0.000 0.992
#> GSM241536 6 0.1257 0.7711 0.028 0.000 0.000 0.000 0.020 0.952
#> GSM241537 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241538 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241539 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241540 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241541 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241542 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241543 3 0.0000 0.9431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241544 3 0.1814 0.9297 0.000 0.000 0.900 0.000 0.100 0.000
#> GSM241545 3 0.0000 0.9431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241546 3 0.1814 0.9297 0.000 0.000 0.900 0.000 0.100 0.000
#> GSM241547 3 0.0000 0.9431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241548 3 0.1814 0.9297 0.000 0.000 0.900 0.000 0.100 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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> SD:hclust 98 2.39e-01 3.02e-01 2
#> SD:hclust 92 3.20e-08 6.56e-03 3
#> SD:hclust 82 2.98e-10 1.96e-05 4
#> SD:hclust 78 5.51e-11 4.05e-09 5
#> SD:hclust 86 6.60e-12 3.88e-08 6
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 16250 rows and 98 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.406 0.413 0.788 0.4981 0.502 0.502
#> 3 3 0.672 0.868 0.894 0.3193 0.695 0.463
#> 4 4 0.635 0.633 0.744 0.1148 0.941 0.825
#> 5 5 0.683 0.623 0.758 0.0688 0.855 0.548
#> 6 6 0.805 0.683 0.799 0.0422 0.932 0.697
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 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
#> GSM241451 1 0.998 0.18826 0.528 0.472
#> GSM241452 1 0.000 0.66305 1.000 0.000
#> GSM241453 1 0.998 0.18826 0.528 0.472
#> GSM241454 1 0.000 0.66305 1.000 0.000
#> GSM241455 1 0.997 0.19543 0.532 0.468
#> GSM241456 1 0.000 0.66305 1.000 0.000
#> GSM241457 2 0.983 0.07657 0.424 0.576
#> GSM241458 1 0.000 0.66305 1.000 0.000
#> GSM241459 2 0.983 0.07657 0.424 0.576
#> GSM241460 1 0.000 0.66305 1.000 0.000
#> GSM241461 2 0.971 0.13310 0.400 0.600
#> GSM241462 1 0.000 0.66305 1.000 0.000
#> GSM241463 1 0.997 0.19543 0.532 0.468
#> GSM241464 1 0.000 0.66305 1.000 0.000
#> GSM241465 1 0.998 0.18826 0.528 0.472
#> GSM241466 1 0.000 0.66305 1.000 0.000
#> GSM241467 1 0.000 0.66305 1.000 0.000
#> GSM241468 1 0.997 0.19543 0.532 0.468
#> GSM241469 1 0.000 0.66305 1.000 0.000
#> GSM241470 1 0.998 0.18826 0.528 0.472
#> GSM241471 1 0.998 0.18826 0.528 0.472
#> GSM241472 1 0.000 0.66305 1.000 0.000
#> GSM241473 1 0.997 0.19543 0.532 0.468
#> GSM241474 1 0.000 0.66305 1.000 0.000
#> GSM241475 1 0.997 0.19543 0.532 0.468
#> GSM241476 1 0.000 0.66305 1.000 0.000
#> GSM241477 1 0.998 0.18826 0.528 0.472
#> GSM241478 1 0.997 0.19543 0.532 0.468
#> GSM241479 1 0.000 0.66305 1.000 0.000
#> GSM241480 1 0.000 0.66305 1.000 0.000
#> GSM241481 2 0.983 0.07657 0.424 0.576
#> GSM241482 1 0.000 0.66305 1.000 0.000
#> GSM241483 2 0.978 0.10583 0.412 0.588
#> GSM241484 1 0.000 0.66305 1.000 0.000
#> GSM241485 1 0.000 0.66305 1.000 0.000
#> GSM241486 2 0.971 0.13310 0.400 0.600
#> GSM241487 2 0.983 0.07657 0.424 0.576
#> GSM241488 1 0.997 0.19543 0.532 0.468
#> GSM241489 1 0.000 0.66305 1.000 0.000
#> GSM241490 1 0.000 0.66305 1.000 0.000
#> GSM241491 1 0.998 0.18826 0.528 0.472
#> GSM241492 1 0.000 0.66305 1.000 0.000
#> GSM241493 1 0.997 0.19543 0.532 0.468
#> GSM241494 1 0.000 0.66305 1.000 0.000
#> GSM241495 1 0.998 0.18826 0.528 0.472
#> GSM241496 1 0.997 0.19543 0.532 0.468
#> GSM241497 1 0.000 0.66305 1.000 0.000
#> GSM241498 1 0.000 0.66305 1.000 0.000
#> GSM241499 1 0.000 0.66305 1.000 0.000
#> GSM241500 2 0.895 0.28788 0.312 0.688
#> GSM241501 2 0.958 0.17328 0.380 0.620
#> GSM241502 2 0.958 0.17328 0.380 0.620
#> GSM241503 1 0.000 0.66305 1.000 0.000
#> GSM241504 1 0.000 0.66305 1.000 0.000
#> GSM241505 1 0.000 0.66305 1.000 0.000
#> GSM241506 2 0.929 0.23646 0.344 0.656
#> GSM241507 1 0.000 0.66305 1.000 0.000
#> GSM241508 2 0.163 0.62540 0.024 0.976
#> GSM241509 2 0.000 0.64263 0.000 1.000
#> GSM241510 2 0.000 0.64263 0.000 1.000
#> GSM241511 1 0.952 0.12188 0.628 0.372
#> GSM241512 1 0.978 0.04642 0.588 0.412
#> GSM241513 2 0.000 0.64263 0.000 1.000
#> GSM241514 1 0.999 -0.11579 0.516 0.484
#> GSM241515 2 0.000 0.64263 0.000 1.000
#> GSM241516 2 0.998 0.16746 0.476 0.524
#> GSM241517 2 0.000 0.64263 0.000 1.000
#> GSM241518 2 0.995 0.19786 0.460 0.540
#> GSM241519 2 0.000 0.64263 0.000 1.000
#> GSM241520 2 0.998 0.17557 0.472 0.528
#> GSM241521 2 0.000 0.64263 0.000 1.000
#> GSM241522 1 0.000 0.66305 1.000 0.000
#> GSM241523 2 0.000 0.64263 0.000 1.000
#> GSM241524 1 0.988 -0.00422 0.564 0.436
#> GSM241525 1 0.973 0.06271 0.596 0.404
#> GSM241526 2 0.000 0.64263 0.000 1.000
#> GSM241527 2 0.995 0.19786 0.460 0.540
#> GSM241528 2 0.000 0.64263 0.000 1.000
#> GSM241529 2 0.000 0.64263 0.000 1.000
#> GSM241530 1 0.994 -0.05501 0.544 0.456
#> GSM241531 1 0.978 0.04642 0.588 0.412
#> GSM241532 2 0.000 0.64263 0.000 1.000
#> GSM241533 2 0.000 0.64263 0.000 1.000
#> GSM241534 2 0.000 0.64263 0.000 1.000
#> GSM241535 2 0.995 0.19786 0.460 0.540
#> GSM241536 1 0.971 0.07046 0.600 0.400
#> GSM241537 2 0.000 0.64263 0.000 1.000
#> GSM241538 2 0.995 0.19786 0.460 0.540
#> GSM241539 2 0.000 0.64263 0.000 1.000
#> GSM241540 2 0.995 0.19786 0.460 0.540
#> GSM241541 2 0.000 0.64263 0.000 1.000
#> GSM241542 2 0.995 0.19786 0.460 0.540
#> GSM241543 2 0.000 0.64263 0.000 1.000
#> GSM241544 2 0.995 0.19786 0.460 0.540
#> GSM241545 2 0.000 0.64263 0.000 1.000
#> GSM241546 2 0.995 0.19786 0.460 0.540
#> GSM241547 2 0.000 0.64263 0.000 1.000
#> GSM241548 2 0.995 0.19786 0.460 0.540
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241452 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241453 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241454 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241455 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241456 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241457 2 0.1774 0.849 0.024 0.960 0.016
#> GSM241458 1 0.0424 0.920 0.992 0.000 0.008
#> GSM241459 2 0.1774 0.849 0.024 0.960 0.016
#> GSM241460 1 0.0592 0.920 0.988 0.012 0.000
#> GSM241461 2 0.1774 0.849 0.024 0.960 0.016
#> GSM241462 1 0.0424 0.920 0.992 0.000 0.008
#> GSM241463 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241464 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241465 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241466 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241467 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241468 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241469 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241470 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241471 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241472 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241473 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241474 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241475 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241476 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241477 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241478 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241479 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241480 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241481 2 0.1774 0.849 0.024 0.960 0.016
#> GSM241482 1 0.0000 0.921 1.000 0.000 0.000
#> GSM241483 2 0.1774 0.849 0.024 0.960 0.016
#> GSM241484 1 0.0424 0.920 0.992 0.000 0.008
#> GSM241485 1 0.0661 0.920 0.988 0.004 0.008
#> GSM241486 2 0.1774 0.849 0.024 0.960 0.016
#> GSM241487 2 0.5413 0.884 0.164 0.800 0.036
#> GSM241488 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241489 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241490 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241491 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241492 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241493 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241494 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241495 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241496 2 0.5635 0.887 0.180 0.784 0.036
#> GSM241497 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241498 1 0.1751 0.929 0.960 0.012 0.028
#> GSM241499 1 0.1163 0.915 0.972 0.000 0.028
#> GSM241500 2 0.1905 0.835 0.016 0.956 0.028
#> GSM241501 2 0.1781 0.844 0.020 0.960 0.020
#> GSM241502 2 0.1919 0.847 0.024 0.956 0.020
#> GSM241503 1 0.1163 0.915 0.972 0.000 0.028
#> GSM241504 1 0.1163 0.915 0.972 0.000 0.028
#> GSM241505 1 0.1163 0.915 0.972 0.000 0.028
#> GSM241506 2 0.1919 0.847 0.024 0.956 0.020
#> GSM241507 1 0.1163 0.915 0.972 0.000 0.028
#> GSM241508 2 0.1905 0.835 0.016 0.956 0.028
#> GSM241509 2 0.1163 0.819 0.000 0.972 0.028
#> GSM241510 2 0.1163 0.819 0.000 0.972 0.028
#> GSM241511 1 0.4411 0.800 0.844 0.016 0.140
#> GSM241512 1 0.6422 0.582 0.660 0.016 0.324
#> GSM241513 3 0.2448 0.906 0.000 0.076 0.924
#> GSM241514 3 0.2096 0.901 0.052 0.004 0.944
#> GSM241515 3 0.2448 0.906 0.000 0.076 0.924
#> GSM241516 3 0.2096 0.901 0.052 0.004 0.944
#> GSM241517 3 0.4346 0.822 0.000 0.184 0.816
#> GSM241518 3 0.1765 0.905 0.040 0.004 0.956
#> GSM241519 3 0.4346 0.822 0.000 0.184 0.816
#> GSM241520 3 0.1765 0.905 0.040 0.004 0.956
#> GSM241521 2 0.6008 0.388 0.000 0.628 0.372
#> GSM241522 1 0.2356 0.905 0.928 0.000 0.072
#> GSM241523 3 0.4291 0.826 0.000 0.180 0.820
#> GSM241524 3 0.2096 0.901 0.052 0.004 0.944
#> GSM241525 1 0.5356 0.762 0.784 0.020 0.196
#> GSM241526 3 0.2711 0.903 0.000 0.088 0.912
#> GSM241527 3 0.2527 0.899 0.044 0.020 0.936
#> GSM241528 3 0.3412 0.884 0.000 0.124 0.876
#> GSM241529 3 0.3412 0.884 0.000 0.124 0.876
#> GSM241530 1 0.7069 0.177 0.508 0.020 0.472
#> GSM241531 1 0.6161 0.617 0.708 0.020 0.272
#> GSM241532 3 0.5497 0.743 0.000 0.292 0.708
#> GSM241533 3 0.5497 0.743 0.000 0.292 0.708
#> GSM241534 3 0.5497 0.743 0.000 0.292 0.708
#> GSM241535 3 0.2527 0.899 0.044 0.020 0.936
#> GSM241536 1 0.4921 0.765 0.816 0.020 0.164
#> GSM241537 3 0.2537 0.906 0.000 0.080 0.920
#> GSM241538 3 0.1919 0.906 0.024 0.020 0.956
#> GSM241539 3 0.2537 0.906 0.000 0.080 0.920
#> GSM241540 3 0.2527 0.899 0.044 0.020 0.936
#> GSM241541 3 0.2537 0.906 0.000 0.080 0.920
#> GSM241542 3 0.1919 0.906 0.024 0.020 0.956
#> GSM241543 3 0.2448 0.906 0.000 0.076 0.924
#> GSM241544 3 0.1878 0.904 0.044 0.004 0.952
#> GSM241545 3 0.2448 0.906 0.000 0.076 0.924
#> GSM241546 3 0.2096 0.901 0.052 0.004 0.944
#> GSM241547 3 0.2448 0.906 0.000 0.076 0.924
#> GSM241548 3 0.1399 0.906 0.028 0.004 0.968
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241452 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241453 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241454 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241455 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241456 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241457 2 0.4331 0.710 0.000 0.712 0.000 0.288
#> GSM241458 1 0.3402 0.780 0.832 0.000 0.004 0.164
#> GSM241459 2 0.4331 0.710 0.000 0.712 0.000 0.288
#> GSM241460 1 0.2773 0.839 0.900 0.072 0.000 0.028
#> GSM241461 2 0.4431 0.702 0.000 0.696 0.000 0.304
#> GSM241462 1 0.3402 0.780 0.832 0.000 0.004 0.164
#> GSM241463 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241464 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241465 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241466 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241467 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241468 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241469 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241470 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241471 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241472 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241473 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241474 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241475 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241476 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241477 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241478 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241479 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241480 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241481 2 0.4331 0.710 0.000 0.712 0.000 0.288
#> GSM241482 1 0.2973 0.789 0.856 0.000 0.000 0.144
#> GSM241483 2 0.4331 0.710 0.000 0.712 0.000 0.288
#> GSM241484 1 0.3402 0.780 0.832 0.000 0.004 0.164
#> GSM241485 1 0.3380 0.794 0.852 0.008 0.004 0.136
#> GSM241486 2 0.4431 0.702 0.000 0.696 0.000 0.304
#> GSM241487 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241488 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241489 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241490 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241491 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241492 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241493 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241494 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241495 2 0.1474 0.814 0.052 0.948 0.000 0.000
#> GSM241496 2 0.1557 0.813 0.056 0.944 0.000 0.000
#> GSM241497 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241498 1 0.2466 0.851 0.900 0.096 0.004 0.000
#> GSM241499 1 0.3831 0.759 0.792 0.000 0.004 0.204
#> GSM241500 2 0.4585 0.682 0.000 0.668 0.000 0.332
#> GSM241501 2 0.4564 0.685 0.000 0.672 0.000 0.328
#> GSM241502 2 0.4564 0.685 0.000 0.672 0.000 0.328
#> GSM241503 1 0.3831 0.759 0.792 0.000 0.004 0.204
#> GSM241504 1 0.3831 0.759 0.792 0.000 0.004 0.204
#> GSM241505 1 0.3831 0.759 0.792 0.000 0.004 0.204
#> GSM241506 2 0.4585 0.682 0.000 0.668 0.000 0.332
#> GSM241507 1 0.3831 0.759 0.792 0.000 0.004 0.204
#> GSM241508 2 0.4585 0.682 0.000 0.668 0.000 0.332
#> GSM241509 2 0.4955 0.534 0.000 0.556 0.000 0.444
#> GSM241510 2 0.4967 0.520 0.000 0.548 0.000 0.452
#> GSM241511 1 0.6474 0.575 0.624 0.000 0.120 0.256
#> GSM241512 1 0.7351 0.326 0.524 0.000 0.264 0.212
#> GSM241513 3 0.3088 0.576 0.000 0.008 0.864 0.128
#> GSM241514 3 0.1706 0.587 0.036 0.000 0.948 0.016
#> GSM241515 3 0.3088 0.576 0.000 0.008 0.864 0.128
#> GSM241516 3 0.2227 0.580 0.036 0.000 0.928 0.036
#> GSM241517 3 0.5763 0.437 0.000 0.156 0.712 0.132
#> GSM241518 3 0.0524 0.603 0.004 0.000 0.988 0.008
#> GSM241519 3 0.6478 0.350 0.000 0.236 0.632 0.132
#> GSM241520 3 0.1356 0.594 0.032 0.000 0.960 0.008
#> GSM241521 3 0.6875 0.178 0.000 0.368 0.520 0.112
#> GSM241522 1 0.2586 0.785 0.900 0.004 0.092 0.004
#> GSM241523 3 0.6478 0.350 0.000 0.236 0.632 0.132
#> GSM241524 3 0.1677 0.586 0.040 0.000 0.948 0.012
#> GSM241525 1 0.6881 0.485 0.592 0.000 0.172 0.236
#> GSM241526 4 0.5657 0.111 0.000 0.024 0.436 0.540
#> GSM241527 3 0.6155 -0.030 0.052 0.000 0.536 0.412
#> GSM241528 4 0.6953 0.231 0.000 0.128 0.336 0.536
#> GSM241529 4 0.6024 0.173 0.000 0.044 0.416 0.540
#> GSM241530 4 0.7402 0.195 0.192 0.000 0.308 0.500
#> GSM241531 4 0.7200 0.221 0.220 0.000 0.228 0.552
#> GSM241532 4 0.5352 0.478 0.000 0.092 0.168 0.740
#> GSM241533 4 0.5352 0.478 0.000 0.092 0.168 0.740
#> GSM241534 4 0.5352 0.478 0.000 0.092 0.168 0.740
#> GSM241535 3 0.6155 -0.030 0.052 0.000 0.536 0.412
#> GSM241536 1 0.6474 0.575 0.624 0.000 0.120 0.256
#> GSM241537 3 0.5277 0.073 0.000 0.008 0.532 0.460
#> GSM241538 3 0.4624 0.186 0.000 0.000 0.660 0.340
#> GSM241539 3 0.5277 0.073 0.000 0.008 0.532 0.460
#> GSM241540 3 0.4624 0.186 0.000 0.000 0.660 0.340
#> GSM241541 3 0.5277 0.073 0.000 0.008 0.532 0.460
#> GSM241542 3 0.4605 0.188 0.000 0.000 0.664 0.336
#> GSM241543 3 0.2976 0.577 0.000 0.008 0.872 0.120
#> GSM241544 3 0.0188 0.604 0.004 0.000 0.996 0.000
#> GSM241545 3 0.2976 0.577 0.000 0.008 0.872 0.120
#> GSM241546 3 0.0188 0.604 0.004 0.000 0.996 0.000
#> GSM241547 3 0.2976 0.577 0.000 0.008 0.872 0.120
#> GSM241548 3 0.0188 0.604 0.004 0.000 0.996 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241452 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241453 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241454 1 0.2230 0.789 0.884 0.116 0.000 0.000 0.000
#> GSM241455 2 0.0290 0.996 0.008 0.992 0.000 0.000 0.000
#> GSM241456 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241457 5 0.4305 0.310 0.000 0.488 0.000 0.000 0.512
#> GSM241458 1 0.3999 0.486 0.656 0.000 0.000 0.344 0.000
#> GSM241459 5 0.4305 0.310 0.000 0.488 0.000 0.000 0.512
#> GSM241460 1 0.1043 0.744 0.960 0.040 0.000 0.000 0.000
#> GSM241461 5 0.4283 0.363 0.000 0.456 0.000 0.000 0.544
#> GSM241462 1 0.3999 0.486 0.656 0.000 0.000 0.344 0.000
#> GSM241463 2 0.0451 0.993 0.008 0.988 0.000 0.004 0.000
#> GSM241464 1 0.2439 0.788 0.876 0.120 0.000 0.004 0.000
#> GSM241465 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241466 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241467 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241468 2 0.0290 0.996 0.008 0.992 0.000 0.000 0.000
#> GSM241469 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241470 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241471 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241472 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241473 2 0.0290 0.996 0.008 0.992 0.000 0.000 0.000
#> GSM241474 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241475 2 0.0290 0.996 0.008 0.992 0.000 0.000 0.000
#> GSM241476 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241477 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241478 2 0.0290 0.996 0.008 0.992 0.000 0.000 0.000
#> GSM241479 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241480 1 0.2230 0.789 0.884 0.116 0.000 0.000 0.000
#> GSM241481 5 0.4305 0.310 0.000 0.488 0.000 0.000 0.512
#> GSM241482 1 0.3949 0.498 0.668 0.000 0.000 0.332 0.000
#> GSM241483 5 0.4304 0.317 0.000 0.484 0.000 0.000 0.516
#> GSM241484 1 0.3999 0.486 0.656 0.000 0.000 0.344 0.000
#> GSM241485 1 0.3752 0.530 0.708 0.000 0.000 0.292 0.000
#> GSM241486 5 0.4283 0.363 0.000 0.456 0.000 0.000 0.544
#> GSM241487 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241488 2 0.0290 0.996 0.008 0.992 0.000 0.000 0.000
#> GSM241489 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241490 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241491 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241492 1 0.2439 0.788 0.876 0.120 0.000 0.004 0.000
#> GSM241493 2 0.0290 0.996 0.008 0.992 0.000 0.000 0.000
#> GSM241494 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241495 2 0.0162 0.996 0.004 0.996 0.000 0.000 0.000
#> GSM241496 2 0.0290 0.996 0.008 0.992 0.000 0.000 0.000
#> GSM241497 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241498 1 0.2280 0.791 0.880 0.120 0.000 0.000 0.000
#> GSM241499 1 0.4192 0.407 0.596 0.000 0.000 0.404 0.000
#> GSM241500 5 0.4249 0.390 0.000 0.432 0.000 0.000 0.568
#> GSM241501 5 0.4256 0.387 0.000 0.436 0.000 0.000 0.564
#> GSM241502 5 0.4256 0.387 0.000 0.436 0.000 0.000 0.564
#> GSM241503 1 0.4192 0.407 0.596 0.000 0.000 0.404 0.000
#> GSM241504 1 0.4192 0.407 0.596 0.000 0.000 0.404 0.000
#> GSM241505 1 0.4192 0.407 0.596 0.000 0.000 0.404 0.000
#> GSM241506 5 0.4249 0.390 0.000 0.432 0.000 0.000 0.568
#> GSM241507 1 0.4192 0.407 0.596 0.000 0.000 0.404 0.000
#> GSM241508 5 0.4249 0.390 0.000 0.432 0.000 0.000 0.568
#> GSM241509 5 0.3086 0.486 0.000 0.180 0.000 0.004 0.816
#> GSM241510 5 0.3318 0.485 0.000 0.180 0.000 0.012 0.808
#> GSM241511 4 0.4196 0.204 0.356 0.000 0.004 0.640 0.000
#> GSM241512 4 0.5382 0.481 0.260 0.000 0.100 0.640 0.000
#> GSM241513 3 0.1732 0.818 0.000 0.000 0.920 0.000 0.080
#> GSM241514 3 0.2597 0.797 0.000 0.004 0.872 0.120 0.004
#> GSM241515 3 0.1732 0.818 0.000 0.000 0.920 0.000 0.080
#> GSM241516 3 0.3817 0.619 0.000 0.004 0.740 0.252 0.004
#> GSM241517 3 0.3535 0.778 0.000 0.088 0.832 0.000 0.080
#> GSM241518 3 0.2339 0.812 0.000 0.004 0.892 0.100 0.004
#> GSM241519 3 0.3898 0.756 0.000 0.116 0.804 0.000 0.080
#> GSM241520 3 0.2339 0.812 0.000 0.004 0.892 0.100 0.004
#> GSM241521 3 0.4444 0.688 0.000 0.180 0.748 0.000 0.072
#> GSM241522 1 0.4986 0.554 0.744 0.024 0.144 0.088 0.000
#> GSM241523 3 0.3849 0.760 0.000 0.112 0.808 0.000 0.080
#> GSM241524 3 0.2445 0.808 0.000 0.004 0.884 0.108 0.004
#> GSM241525 4 0.5254 0.479 0.272 0.000 0.084 0.644 0.000
#> GSM241526 5 0.6421 -0.140 0.000 0.004 0.180 0.300 0.516
#> GSM241527 4 0.5879 0.560 0.004 0.000 0.176 0.620 0.200
#> GSM241528 5 0.6899 -0.119 0.000 0.040 0.144 0.300 0.516
#> GSM241529 5 0.6505 -0.137 0.000 0.008 0.176 0.300 0.516
#> GSM241530 4 0.5082 0.584 0.008 0.000 0.108 0.716 0.168
#> GSM241531 4 0.3935 0.559 0.140 0.000 0.016 0.808 0.036
#> GSM241532 5 0.1173 0.329 0.000 0.004 0.012 0.020 0.964
#> GSM241533 5 0.3511 0.181 0.000 0.004 0.012 0.184 0.800
#> GSM241534 5 0.2166 0.293 0.000 0.004 0.012 0.072 0.912
#> GSM241535 4 0.5880 0.553 0.000 0.000 0.172 0.600 0.228
#> GSM241536 4 0.3861 0.379 0.284 0.000 0.004 0.712 0.000
#> GSM241537 5 0.6742 -0.248 0.000 0.000 0.288 0.300 0.412
#> GSM241538 4 0.6402 0.465 0.000 0.000 0.276 0.508 0.216
#> GSM241539 5 0.6742 -0.248 0.000 0.000 0.288 0.300 0.412
#> GSM241540 4 0.6371 0.474 0.000 0.000 0.268 0.516 0.216
#> GSM241541 5 0.6742 -0.241 0.000 0.000 0.300 0.288 0.412
#> GSM241542 4 0.6445 0.448 0.000 0.000 0.288 0.496 0.216
#> GSM241543 3 0.2130 0.817 0.000 0.000 0.908 0.012 0.080
#> GSM241544 3 0.2439 0.806 0.000 0.004 0.876 0.120 0.000
#> GSM241545 3 0.2130 0.817 0.000 0.000 0.908 0.012 0.080
#> GSM241546 3 0.2439 0.806 0.000 0.004 0.876 0.120 0.000
#> GSM241547 3 0.2130 0.817 0.000 0.000 0.908 0.012 0.080
#> GSM241548 3 0.2497 0.810 0.000 0.004 0.880 0.112 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241457 5 0.3482 0.81840 0.000 0.316 0.000 0.000 0.684 0.000
#> GSM241458 1 0.3867 0.00319 0.512 0.000 0.000 0.000 0.000 0.488
#> GSM241459 5 0.3482 0.81840 0.000 0.316 0.000 0.000 0.684 0.000
#> GSM241460 1 0.0858 0.79336 0.968 0.000 0.000 0.004 0.000 0.028
#> GSM241461 5 0.3288 0.84691 0.000 0.276 0.000 0.000 0.724 0.000
#> GSM241462 1 0.3867 0.00319 0.512 0.000 0.000 0.000 0.000 0.488
#> GSM241463 2 0.1340 0.98641 0.040 0.948 0.000 0.004 0.008 0.000
#> GSM241464 1 0.1210 0.82961 0.960 0.020 0.000 0.008 0.008 0.004
#> GSM241465 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0692 0.83996 0.976 0.020 0.000 0.004 0.000 0.000
#> GSM241468 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0692 0.83996 0.976 0.020 0.000 0.004 0.000 0.000
#> GSM241473 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0692 0.83996 0.976 0.020 0.000 0.004 0.000 0.000
#> GSM241475 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241481 5 0.3482 0.81840 0.000 0.316 0.000 0.000 0.684 0.000
#> GSM241482 1 0.3867 0.00319 0.512 0.000 0.000 0.000 0.000 0.488
#> GSM241483 5 0.3482 0.81840 0.000 0.316 0.000 0.000 0.684 0.000
#> GSM241484 1 0.3867 0.00319 0.512 0.000 0.000 0.000 0.000 0.488
#> GSM241485 1 0.3823 0.13401 0.564 0.000 0.000 0.000 0.000 0.436
#> GSM241486 5 0.3288 0.84691 0.000 0.276 0.000 0.000 0.724 0.000
#> GSM241487 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0692 0.83996 0.976 0.020 0.000 0.004 0.000 0.000
#> GSM241490 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241491 2 0.1196 0.98973 0.040 0.952 0.000 0.000 0.008 0.000
#> GSM241492 1 0.1210 0.82961 0.960 0.020 0.000 0.008 0.008 0.004
#> GSM241493 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0692 0.83996 0.976 0.020 0.000 0.004 0.000 0.000
#> GSM241495 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0937 0.99855 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0547 0.84078 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM241499 6 0.3737 0.29879 0.392 0.000 0.000 0.000 0.000 0.608
#> GSM241500 5 0.2883 0.83496 0.000 0.212 0.000 0.000 0.788 0.000
#> GSM241501 5 0.3126 0.84880 0.000 0.248 0.000 0.000 0.752 0.000
#> GSM241502 5 0.3126 0.84880 0.000 0.248 0.000 0.000 0.752 0.000
#> GSM241503 6 0.3737 0.29879 0.392 0.000 0.000 0.000 0.000 0.608
#> GSM241504 6 0.3737 0.29879 0.392 0.000 0.000 0.000 0.000 0.608
#> GSM241505 6 0.3737 0.29879 0.392 0.000 0.000 0.000 0.000 0.608
#> GSM241506 5 0.2912 0.83728 0.000 0.216 0.000 0.000 0.784 0.000
#> GSM241507 6 0.3737 0.29879 0.392 0.000 0.000 0.000 0.000 0.608
#> GSM241508 5 0.2883 0.83496 0.000 0.212 0.000 0.000 0.788 0.000
#> GSM241509 5 0.3805 0.56529 0.000 0.040 0.000 0.136 0.796 0.028
#> GSM241510 5 0.3883 0.55703 0.000 0.040 0.000 0.144 0.788 0.028
#> GSM241511 6 0.2170 0.49796 0.100 0.000 0.000 0.000 0.012 0.888
#> GSM241512 6 0.5973 0.38254 0.056 0.024 0.088 0.052 0.080 0.700
#> GSM241513 3 0.4630 0.82702 0.000 0.012 0.752 0.124 0.088 0.024
#> GSM241514 3 0.0622 0.80906 0.000 0.000 0.980 0.008 0.000 0.012
#> GSM241515 3 0.4630 0.82702 0.000 0.012 0.752 0.124 0.088 0.024
#> GSM241516 3 0.4248 0.52725 0.000 0.000 0.752 0.020 0.060 0.168
#> GSM241517 3 0.5027 0.82185 0.000 0.032 0.732 0.124 0.088 0.024
#> GSM241518 3 0.0508 0.81423 0.000 0.000 0.984 0.004 0.000 0.012
#> GSM241519 3 0.5185 0.81799 0.000 0.044 0.724 0.120 0.088 0.024
#> GSM241520 3 0.0363 0.81278 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM241521 3 0.5225 0.81473 0.000 0.052 0.724 0.112 0.088 0.024
#> GSM241522 1 0.3903 0.43987 0.680 0.004 0.304 0.000 0.000 0.012
#> GSM241523 3 0.5185 0.81799 0.000 0.044 0.724 0.120 0.088 0.024
#> GSM241524 3 0.0508 0.81104 0.000 0.000 0.984 0.004 0.000 0.012
#> GSM241525 6 0.7758 0.24300 0.160 0.024 0.072 0.112 0.104 0.528
#> GSM241526 4 0.5147 0.64794 0.000 0.024 0.040 0.708 0.176 0.052
#> GSM241527 6 0.7169 -0.18814 0.000 0.024 0.092 0.324 0.116 0.444
#> GSM241528 4 0.5147 0.64794 0.000 0.024 0.040 0.708 0.176 0.052
#> GSM241529 4 0.5147 0.64794 0.000 0.024 0.040 0.708 0.176 0.052
#> GSM241530 6 0.7014 -0.13323 0.000 0.024 0.080 0.304 0.116 0.476
#> GSM241531 6 0.3317 0.40062 0.012 0.000 0.000 0.072 0.080 0.836
#> GSM241532 5 0.4579 0.02745 0.000 0.008 0.000 0.380 0.584 0.028
#> GSM241533 4 0.4607 0.40752 0.000 0.008 0.000 0.572 0.392 0.028
#> GSM241534 4 0.4697 0.23730 0.000 0.008 0.000 0.500 0.464 0.028
#> GSM241535 6 0.6839 -0.30589 0.000 0.024 0.052 0.400 0.116 0.408
#> GSM241536 6 0.2326 0.47290 0.060 0.000 0.000 0.028 0.012 0.900
#> GSM241537 4 0.1921 0.65061 0.000 0.000 0.032 0.916 0.000 0.052
#> GSM241538 4 0.6191 0.41575 0.000 0.000 0.116 0.556 0.068 0.260
#> GSM241539 4 0.1921 0.65061 0.000 0.000 0.032 0.916 0.000 0.052
#> GSM241540 4 0.6332 0.39498 0.000 0.000 0.120 0.540 0.076 0.264
#> GSM241541 4 0.1408 0.64513 0.000 0.000 0.036 0.944 0.000 0.020
#> GSM241542 4 0.6156 0.41795 0.000 0.000 0.112 0.560 0.068 0.260
#> GSM241543 3 0.4975 0.82249 0.000 0.008 0.720 0.148 0.088 0.036
#> GSM241544 3 0.1485 0.80539 0.000 0.000 0.944 0.028 0.004 0.024
#> GSM241545 3 0.4975 0.82249 0.000 0.008 0.720 0.148 0.088 0.036
#> GSM241546 3 0.1485 0.80539 0.000 0.000 0.944 0.028 0.004 0.024
#> GSM241547 3 0.4975 0.82249 0.000 0.008 0.720 0.148 0.088 0.036
#> GSM241548 3 0.1552 0.80683 0.000 0.000 0.940 0.036 0.004 0.020
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds
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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> SD:kmeans 51 7.00e-08 4.92e-01 2
#> SD:kmeans 96 2.11e-10 9.85e-02 3
#> SD:kmeans 76 1.59e-06 1.26e-02 4
#> SD:kmeans 60 9.57e-12 1.95e-03 5
#> SD:kmeans 73 1.15e-13 2.91e-08 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.964 0.970 0.5054 0.495 0.495
#> 3 3 0.985 0.937 0.976 0.3310 0.713 0.482
#> 4 4 0.900 0.739 0.810 0.1096 0.890 0.681
#> 5 5 0.898 0.811 0.909 0.0671 0.882 0.592
#> 6 6 0.910 0.837 0.906 0.0504 0.922 0.648
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
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
#> GSM241451 2 0.358 0.962 0.068 0.932
#> GSM241452 1 0.000 0.970 1.000 0.000
#> GSM241453 2 0.358 0.962 0.068 0.932
#> GSM241454 1 0.000 0.970 1.000 0.000
#> GSM241455 2 0.358 0.962 0.068 0.932
#> GSM241456 1 0.000 0.970 1.000 0.000
#> GSM241457 2 0.358 0.962 0.068 0.932
#> GSM241458 1 0.000 0.970 1.000 0.000
#> GSM241459 2 0.358 0.962 0.068 0.932
#> GSM241460 1 0.000 0.970 1.000 0.000
#> GSM241461 2 0.358 0.962 0.068 0.932
#> GSM241462 1 0.000 0.970 1.000 0.000
#> GSM241463 2 0.358 0.962 0.068 0.932
#> GSM241464 1 0.000 0.970 1.000 0.000
#> GSM241465 2 0.358 0.962 0.068 0.932
#> GSM241466 1 0.000 0.970 1.000 0.000
#> GSM241467 1 0.000 0.970 1.000 0.000
#> GSM241468 2 0.358 0.962 0.068 0.932
#> GSM241469 1 0.000 0.970 1.000 0.000
#> GSM241470 2 0.358 0.962 0.068 0.932
#> GSM241471 2 0.358 0.962 0.068 0.932
#> GSM241472 1 0.000 0.970 1.000 0.000
#> GSM241473 2 0.358 0.962 0.068 0.932
#> GSM241474 1 0.000 0.970 1.000 0.000
#> GSM241475 2 0.358 0.962 0.068 0.932
#> GSM241476 1 0.000 0.970 1.000 0.000
#> GSM241477 2 0.358 0.962 0.068 0.932
#> GSM241478 2 0.358 0.962 0.068 0.932
#> GSM241479 1 0.000 0.970 1.000 0.000
#> GSM241480 1 0.000 0.970 1.000 0.000
#> GSM241481 2 0.358 0.962 0.068 0.932
#> GSM241482 1 0.000 0.970 1.000 0.000
#> GSM241483 2 0.358 0.962 0.068 0.932
#> GSM241484 1 0.000 0.970 1.000 0.000
#> GSM241485 1 0.000 0.970 1.000 0.000
#> GSM241486 2 0.358 0.962 0.068 0.932
#> GSM241487 2 0.358 0.962 0.068 0.932
#> GSM241488 2 0.358 0.962 0.068 0.932
#> GSM241489 1 0.000 0.970 1.000 0.000
#> GSM241490 1 0.000 0.970 1.000 0.000
#> GSM241491 2 0.358 0.962 0.068 0.932
#> GSM241492 1 0.000 0.970 1.000 0.000
#> GSM241493 2 0.358 0.962 0.068 0.932
#> GSM241494 1 0.000 0.970 1.000 0.000
#> GSM241495 2 0.358 0.962 0.068 0.932
#> GSM241496 2 0.358 0.962 0.068 0.932
#> GSM241497 1 0.000 0.970 1.000 0.000
#> GSM241498 1 0.000 0.970 1.000 0.000
#> GSM241499 1 0.000 0.970 1.000 0.000
#> GSM241500 2 0.000 0.964 0.000 1.000
#> GSM241501 2 0.000 0.964 0.000 1.000
#> GSM241502 2 0.000 0.964 0.000 1.000
#> GSM241503 1 0.000 0.970 1.000 0.000
#> GSM241504 1 0.000 0.970 1.000 0.000
#> GSM241505 1 0.000 0.970 1.000 0.000
#> GSM241506 2 0.000 0.964 0.000 1.000
#> GSM241507 1 0.000 0.970 1.000 0.000
#> GSM241508 2 0.000 0.964 0.000 1.000
#> GSM241509 2 0.000 0.964 0.000 1.000
#> GSM241510 2 0.000 0.964 0.000 1.000
#> GSM241511 1 0.358 0.956 0.932 0.068
#> GSM241512 1 0.358 0.956 0.932 0.068
#> GSM241513 2 0.000 0.964 0.000 1.000
#> GSM241514 1 0.358 0.956 0.932 0.068
#> GSM241515 2 0.000 0.964 0.000 1.000
#> GSM241516 1 0.358 0.956 0.932 0.068
#> GSM241517 2 0.000 0.964 0.000 1.000
#> GSM241518 1 0.358 0.956 0.932 0.068
#> GSM241519 2 0.000 0.964 0.000 1.000
#> GSM241520 1 0.358 0.956 0.932 0.068
#> GSM241521 2 0.000 0.964 0.000 1.000
#> GSM241522 1 0.327 0.958 0.940 0.060
#> GSM241523 2 0.000 0.964 0.000 1.000
#> GSM241524 1 0.358 0.956 0.932 0.068
#> GSM241525 1 0.358 0.956 0.932 0.068
#> GSM241526 2 0.000 0.964 0.000 1.000
#> GSM241527 1 0.358 0.956 0.932 0.068
#> GSM241528 2 0.000 0.964 0.000 1.000
#> GSM241529 2 0.000 0.964 0.000 1.000
#> GSM241530 1 0.358 0.956 0.932 0.068
#> GSM241531 1 0.358 0.956 0.932 0.068
#> GSM241532 2 0.000 0.964 0.000 1.000
#> GSM241533 2 0.000 0.964 0.000 1.000
#> GSM241534 2 0.000 0.964 0.000 1.000
#> GSM241535 1 0.358 0.956 0.932 0.068
#> GSM241536 1 0.358 0.956 0.932 0.068
#> GSM241537 2 0.000 0.964 0.000 1.000
#> GSM241538 1 0.358 0.956 0.932 0.068
#> GSM241539 2 0.000 0.964 0.000 1.000
#> GSM241540 1 0.358 0.956 0.932 0.068
#> GSM241541 2 0.000 0.964 0.000 1.000
#> GSM241542 1 0.358 0.956 0.932 0.068
#> GSM241543 2 0.000 0.964 0.000 1.000
#> GSM241544 1 0.358 0.956 0.932 0.068
#> GSM241545 2 0.000 0.964 0.000 1.000
#> GSM241546 1 0.358 0.956 0.932 0.068
#> GSM241547 2 0.000 0.964 0.000 1.000
#> GSM241548 1 0.358 0.956 0.932 0.068
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241457 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241458 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241461 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241462 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241463 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241464 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241465 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241481 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241483 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241484 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241486 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241487 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241488 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241491 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241492 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241493 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241499 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241500 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241501 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241502 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241503 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241504 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241505 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241506 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241507 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241508 2 0.0000 0.9874 0.000 1.000 0.000
#> GSM241509 2 0.5882 0.4432 0.000 0.652 0.348
#> GSM241510 3 0.6045 0.3727 0.000 0.380 0.620
#> GSM241511 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241512 3 0.6252 0.1910 0.444 0.000 0.556
#> GSM241513 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241514 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241515 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241516 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241517 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241518 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241519 3 0.0237 0.9465 0.000 0.004 0.996
#> GSM241520 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241521 3 0.6302 0.0854 0.000 0.480 0.520
#> GSM241522 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241523 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241524 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241525 1 0.2625 0.8978 0.916 0.000 0.084
#> GSM241526 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241528 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241529 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241530 3 0.5363 0.5993 0.276 0.000 0.724
#> GSM241531 1 0.5785 0.4856 0.668 0.000 0.332
#> GSM241532 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241533 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241534 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241535 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241536 1 0.0000 0.9868 1.000 0.000 0.000
#> GSM241537 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241544 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241545 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241546 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241547 3 0.0000 0.9499 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.9499 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241457 2 0.1867 0.945045 0.000 0.928 0.000 0.072
#> GSM241458 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241459 2 0.1867 0.945045 0.000 0.928 0.000 0.072
#> GSM241460 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241461 2 0.1867 0.945045 0.000 0.928 0.000 0.072
#> GSM241462 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241481 2 0.1867 0.945045 0.000 0.928 0.000 0.072
#> GSM241482 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241483 2 0.1867 0.945045 0.000 0.928 0.000 0.072
#> GSM241484 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241486 2 0.1867 0.945045 0.000 0.928 0.000 0.072
#> GSM241487 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241488 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.966340 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.979453 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0336 0.974109 0.992 0.000 0.008 0.000
#> GSM241500 2 0.2868 0.894714 0.000 0.864 0.000 0.136
#> GSM241501 2 0.2011 0.940920 0.000 0.920 0.000 0.080
#> GSM241502 2 0.2011 0.940920 0.000 0.920 0.000 0.080
#> GSM241503 1 0.0336 0.974109 0.992 0.000 0.008 0.000
#> GSM241504 1 0.0336 0.974109 0.992 0.000 0.008 0.000
#> GSM241505 1 0.0336 0.974109 0.992 0.000 0.008 0.000
#> GSM241506 2 0.2868 0.894714 0.000 0.864 0.000 0.136
#> GSM241507 1 0.0336 0.974109 0.992 0.000 0.008 0.000
#> GSM241508 2 0.2921 0.890461 0.000 0.860 0.000 0.140
#> GSM241509 4 0.6520 0.470962 0.000 0.084 0.364 0.552
#> GSM241510 4 0.4948 0.505242 0.000 0.000 0.440 0.560
#> GSM241511 3 0.4996 0.000763 0.484 0.000 0.516 0.000
#> GSM241512 3 0.0336 0.529242 0.008 0.000 0.992 0.000
#> GSM241513 4 0.2011 0.574382 0.000 0.000 0.080 0.920
#> GSM241514 3 0.4948 0.440520 0.000 0.000 0.560 0.440
#> GSM241515 4 0.2011 0.574382 0.000 0.000 0.080 0.920
#> GSM241516 3 0.4916 0.446076 0.000 0.000 0.576 0.424
#> GSM241517 4 0.2224 0.581227 0.000 0.032 0.040 0.928
#> GSM241518 3 0.4961 0.437507 0.000 0.000 0.552 0.448
#> GSM241519 4 0.2224 0.581227 0.000 0.032 0.040 0.928
#> GSM241520 3 0.4961 0.437507 0.000 0.000 0.552 0.448
#> GSM241521 4 0.2227 0.579200 0.000 0.036 0.036 0.928
#> GSM241522 1 0.5512 -0.027777 0.496 0.000 0.488 0.016
#> GSM241523 4 0.2224 0.581227 0.000 0.032 0.040 0.928
#> GSM241524 3 0.4948 0.440520 0.000 0.000 0.560 0.440
#> GSM241525 3 0.1792 0.501710 0.068 0.000 0.932 0.000
#> GSM241526 4 0.4948 0.505242 0.000 0.000 0.440 0.560
#> GSM241527 3 0.0000 0.529421 0.000 0.000 1.000 0.000
#> GSM241528 4 0.4948 0.505242 0.000 0.000 0.440 0.560
#> GSM241529 4 0.4948 0.505242 0.000 0.000 0.440 0.560
#> GSM241530 3 0.1211 0.520332 0.040 0.000 0.960 0.000
#> GSM241531 3 0.1211 0.520332 0.040 0.000 0.960 0.000
#> GSM241532 4 0.4948 0.505242 0.000 0.000 0.440 0.560
#> GSM241533 4 0.4948 0.505242 0.000 0.000 0.440 0.560
#> GSM241534 4 0.4948 0.505242 0.000 0.000 0.440 0.560
#> GSM241535 3 0.0000 0.529421 0.000 0.000 1.000 0.000
#> GSM241536 3 0.3569 0.454653 0.196 0.000 0.804 0.000
#> GSM241537 3 0.4994 -0.475691 0.000 0.000 0.520 0.480
#> GSM241538 3 0.0336 0.525198 0.000 0.000 0.992 0.008
#> GSM241539 3 0.4994 -0.475691 0.000 0.000 0.520 0.480
#> GSM241540 3 0.0000 0.529421 0.000 0.000 1.000 0.000
#> GSM241541 3 0.4994 -0.475691 0.000 0.000 0.520 0.480
#> GSM241542 3 0.0336 0.525198 0.000 0.000 0.992 0.008
#> GSM241543 4 0.2011 0.574382 0.000 0.000 0.080 0.920
#> GSM241544 3 0.4961 0.437507 0.000 0.000 0.552 0.448
#> GSM241545 4 0.2011 0.574382 0.000 0.000 0.080 0.920
#> GSM241546 3 0.4961 0.437507 0.000 0.000 0.552 0.448
#> GSM241547 4 0.2011 0.574382 0.000 0.000 0.080 0.920
#> GSM241548 3 0.4961 0.437507 0.000 0.000 0.552 0.448
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.3109 0.796 0.000 0.200 0.000 0.000 0.800
#> GSM241458 1 0.1732 0.869 0.920 0.000 0.000 0.080 0.000
#> GSM241459 5 0.3109 0.796 0.000 0.200 0.000 0.000 0.800
#> GSM241460 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.1908 0.871 0.000 0.092 0.000 0.000 0.908
#> GSM241462 1 0.1965 0.860 0.904 0.000 0.000 0.096 0.000
#> GSM241463 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.3109 0.796 0.000 0.200 0.000 0.000 0.800
#> GSM241482 1 0.0703 0.895 0.976 0.000 0.000 0.024 0.000
#> GSM241483 5 0.2561 0.840 0.000 0.144 0.000 0.000 0.856
#> GSM241484 1 0.1908 0.862 0.908 0.000 0.000 0.092 0.000
#> GSM241485 1 0.1908 0.862 0.908 0.000 0.000 0.092 0.000
#> GSM241486 5 0.1908 0.871 0.000 0.092 0.000 0.000 0.908
#> GSM241487 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.4273 0.498 0.552 0.000 0.000 0.448 0.000
#> GSM241500 5 0.0794 0.890 0.000 0.028 0.000 0.000 0.972
#> GSM241501 5 0.0880 0.890 0.000 0.032 0.000 0.000 0.968
#> GSM241502 5 0.0880 0.890 0.000 0.032 0.000 0.000 0.968
#> GSM241503 1 0.4273 0.498 0.552 0.000 0.000 0.448 0.000
#> GSM241504 1 0.4273 0.498 0.552 0.000 0.000 0.448 0.000
#> GSM241505 1 0.4273 0.498 0.552 0.000 0.000 0.448 0.000
#> GSM241506 5 0.0794 0.890 0.000 0.028 0.000 0.000 0.972
#> GSM241507 1 0.4273 0.498 0.552 0.000 0.000 0.448 0.000
#> GSM241508 5 0.0794 0.890 0.000 0.028 0.000 0.000 0.972
#> GSM241509 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000
#> GSM241510 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000
#> GSM241511 4 0.0000 0.711 0.000 0.000 0.000 1.000 0.000
#> GSM241512 4 0.0000 0.711 0.000 0.000 0.000 1.000 0.000
#> GSM241513 3 0.0162 0.939 0.000 0.000 0.996 0.000 0.004
#> GSM241514 3 0.1341 0.902 0.000 0.000 0.944 0.056 0.000
#> GSM241515 3 0.0162 0.939 0.000 0.000 0.996 0.000 0.004
#> GSM241516 4 0.4278 0.355 0.000 0.000 0.452 0.548 0.000
#> GSM241517 3 0.0290 0.937 0.000 0.000 0.992 0.000 0.008
#> GSM241518 3 0.0609 0.936 0.000 0.000 0.980 0.020 0.000
#> GSM241519 3 0.0162 0.939 0.000 0.000 0.996 0.000 0.004
#> GSM241520 3 0.0609 0.936 0.000 0.000 0.980 0.020 0.000
#> GSM241521 3 0.1502 0.877 0.000 0.056 0.940 0.000 0.004
#> GSM241522 1 0.3355 0.768 0.804 0.000 0.012 0.184 0.000
#> GSM241523 3 0.0162 0.939 0.000 0.000 0.996 0.000 0.004
#> GSM241524 3 0.0609 0.936 0.000 0.000 0.980 0.020 0.000
#> GSM241525 4 0.0000 0.711 0.000 0.000 0.000 1.000 0.000
#> GSM241526 4 0.4829 0.142 0.000 0.000 0.020 0.496 0.484
#> GSM241527 4 0.0703 0.713 0.000 0.000 0.000 0.976 0.024
#> GSM241528 5 0.4829 -0.209 0.000 0.000 0.020 0.484 0.496
#> GSM241529 4 0.4829 0.142 0.000 0.000 0.020 0.496 0.484
#> GSM241530 4 0.0703 0.713 0.000 0.000 0.000 0.976 0.024
#> GSM241531 4 0.0000 0.711 0.000 0.000 0.000 1.000 0.000
#> GSM241532 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000
#> GSM241533 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000
#> GSM241534 5 0.0000 0.879 0.000 0.000 0.000 0.000 1.000
#> GSM241535 4 0.0703 0.713 0.000 0.000 0.000 0.976 0.024
#> GSM241536 4 0.0000 0.711 0.000 0.000 0.000 1.000 0.000
#> GSM241537 4 0.5019 0.398 0.000 0.000 0.436 0.532 0.032
#> GSM241538 4 0.4855 0.409 0.000 0.000 0.424 0.552 0.024
#> GSM241539 4 0.5019 0.398 0.000 0.000 0.436 0.532 0.032
#> GSM241540 4 0.4768 0.462 0.000 0.000 0.384 0.592 0.024
#> GSM241541 3 0.5019 -0.227 0.000 0.000 0.532 0.436 0.032
#> GSM241542 4 0.4855 0.409 0.000 0.000 0.424 0.552 0.024
#> GSM241543 3 0.0162 0.939 0.000 0.000 0.996 0.000 0.004
#> GSM241544 3 0.0609 0.936 0.000 0.000 0.980 0.020 0.000
#> GSM241545 3 0.0162 0.939 0.000 0.000 0.996 0.000 0.004
#> GSM241546 3 0.0609 0.936 0.000 0.000 0.980 0.020 0.000
#> GSM241547 3 0.0162 0.939 0.000 0.000 0.996 0.000 0.004
#> GSM241548 3 0.0609 0.936 0.000 0.000 0.980 0.020 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.0632 0.949 0.000 0.024 0.000 0.000 0.976 0.000
#> GSM241458 6 0.3288 0.737 0.276 0.000 0.000 0.000 0.000 0.724
#> GSM241459 5 0.0632 0.949 0.000 0.024 0.000 0.000 0.976 0.000
#> GSM241460 1 0.2969 0.635 0.776 0.000 0.000 0.000 0.000 0.224
#> GSM241461 5 0.0458 0.954 0.000 0.016 0.000 0.000 0.984 0.000
#> GSM241462 6 0.3221 0.751 0.264 0.000 0.000 0.000 0.000 0.736
#> GSM241463 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.0632 0.949 0.000 0.024 0.000 0.000 0.976 0.000
#> GSM241482 6 0.3371 0.712 0.292 0.000 0.000 0.000 0.000 0.708
#> GSM241483 5 0.0458 0.954 0.000 0.016 0.000 0.000 0.984 0.000
#> GSM241484 6 0.3221 0.750 0.264 0.000 0.000 0.000 0.000 0.736
#> GSM241485 6 0.3266 0.742 0.272 0.000 0.000 0.000 0.000 0.728
#> GSM241486 5 0.0458 0.954 0.000 0.016 0.000 0.000 0.984 0.000
#> GSM241487 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.962 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 6 0.1007 0.847 0.044 0.000 0.000 0.000 0.000 0.956
#> GSM241500 5 0.0000 0.956 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241501 5 0.0000 0.956 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241502 5 0.0000 0.956 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241503 6 0.1007 0.847 0.044 0.000 0.000 0.000 0.000 0.956
#> GSM241504 6 0.1007 0.847 0.044 0.000 0.000 0.000 0.000 0.956
#> GSM241505 6 0.1007 0.847 0.044 0.000 0.000 0.000 0.000 0.956
#> GSM241506 5 0.0000 0.956 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241507 6 0.1007 0.847 0.044 0.000 0.000 0.000 0.000 0.956
#> GSM241508 5 0.0000 0.956 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241509 5 0.0000 0.956 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241510 5 0.0146 0.955 0.000 0.000 0.000 0.004 0.996 0.000
#> GSM241511 6 0.0458 0.816 0.000 0.000 0.000 0.016 0.000 0.984
#> GSM241512 6 0.1714 0.749 0.000 0.000 0.000 0.092 0.000 0.908
#> GSM241513 3 0.0000 0.805 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241514 3 0.3974 0.745 0.000 0.000 0.680 0.296 0.000 0.024
#> GSM241515 3 0.1714 0.709 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM241516 4 0.4602 -0.259 0.000 0.000 0.384 0.572 0.000 0.044
#> GSM241517 3 0.0458 0.791 0.000 0.000 0.984 0.016 0.000 0.000
#> GSM241518 3 0.3778 0.759 0.000 0.000 0.696 0.288 0.000 0.016
#> GSM241519 3 0.0000 0.805 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241520 3 0.3778 0.759 0.000 0.000 0.696 0.288 0.000 0.016
#> GSM241521 3 0.0000 0.805 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241522 1 0.5593 0.443 0.592 0.000 0.044 0.288 0.000 0.076
#> GSM241523 3 0.0000 0.805 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241524 3 0.3778 0.759 0.000 0.000 0.696 0.288 0.000 0.016
#> GSM241525 4 0.3684 0.516 0.000 0.000 0.000 0.628 0.000 0.372
#> GSM241526 4 0.4130 0.698 0.000 0.000 0.264 0.700 0.028 0.008
#> GSM241527 4 0.3266 0.644 0.000 0.000 0.000 0.728 0.000 0.272
#> GSM241528 4 0.4130 0.698 0.000 0.000 0.264 0.700 0.028 0.008
#> GSM241529 4 0.4130 0.698 0.000 0.000 0.264 0.700 0.028 0.008
#> GSM241530 4 0.3330 0.634 0.000 0.000 0.000 0.716 0.000 0.284
#> GSM241531 6 0.0865 0.804 0.000 0.000 0.000 0.036 0.000 0.964
#> GSM241532 5 0.1204 0.913 0.000 0.000 0.000 0.056 0.944 0.000
#> GSM241533 4 0.3864 0.040 0.000 0.000 0.000 0.520 0.480 0.000
#> GSM241534 5 0.3607 0.415 0.000 0.000 0.000 0.348 0.652 0.000
#> GSM241535 4 0.3101 0.663 0.000 0.000 0.000 0.756 0.000 0.244
#> GSM241536 6 0.0458 0.816 0.000 0.000 0.000 0.016 0.000 0.984
#> GSM241537 4 0.3351 0.689 0.000 0.000 0.288 0.712 0.000 0.000
#> GSM241538 4 0.0547 0.656 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM241539 4 0.3351 0.689 0.000 0.000 0.288 0.712 0.000 0.000
#> GSM241540 4 0.0547 0.656 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM241541 4 0.3446 0.673 0.000 0.000 0.308 0.692 0.000 0.000
#> GSM241542 4 0.0547 0.656 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM241543 3 0.0000 0.805 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241544 3 0.3778 0.759 0.000 0.000 0.696 0.288 0.000 0.016
#> GSM241545 3 0.0000 0.805 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241546 3 0.3778 0.759 0.000 0.000 0.696 0.288 0.000 0.016
#> GSM241547 3 0.0000 0.805 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241548 3 0.3778 0.759 0.000 0.000 0.696 0.288 0.000 0.016
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> SD:skmeans 98 1.00e+00 1.00e+00 2
#> SD:skmeans 93 3.00e-11 2.30e-01 3
#> SD:skmeans 83 4.27e-11 7.65e-01 4
#> SD:skmeans 83 8.01e-11 2.19e-07 5
#> SD:skmeans 94 1.02e-15 5.91e-11 6
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 16250 rows and 98 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.547 0.886 0.930 0.5016 0.497 0.497
#> 3 3 0.885 0.941 0.970 0.3303 0.743 0.527
#> 4 4 0.685 0.787 0.828 0.1062 0.902 0.713
#> 5 5 0.920 0.902 0.955 0.0872 0.922 0.701
#> 6 6 0.920 0.879 0.947 0.0217 0.944 0.741
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] 5
There is also optional best \(k\) = 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM241451 2 0.6343 0.885 0.160 0.840
#> GSM241452 1 0.0000 0.937 1.000 0.000
#> GSM241453 2 0.6343 0.885 0.160 0.840
#> GSM241454 1 0.0000 0.937 1.000 0.000
#> GSM241455 2 0.6343 0.885 0.160 0.840
#> GSM241456 1 0.0000 0.937 1.000 0.000
#> GSM241457 2 0.6343 0.885 0.160 0.840
#> GSM241458 1 0.0000 0.937 1.000 0.000
#> GSM241459 2 0.6343 0.885 0.160 0.840
#> GSM241460 1 0.0000 0.937 1.000 0.000
#> GSM241461 2 0.6343 0.885 0.160 0.840
#> GSM241462 1 0.0000 0.937 1.000 0.000
#> GSM241463 2 0.6343 0.885 0.160 0.840
#> GSM241464 1 0.0000 0.937 1.000 0.000
#> GSM241465 2 0.6343 0.885 0.160 0.840
#> GSM241466 1 0.0000 0.937 1.000 0.000
#> GSM241467 1 0.0000 0.937 1.000 0.000
#> GSM241468 2 0.6343 0.885 0.160 0.840
#> GSM241469 1 0.0000 0.937 1.000 0.000
#> GSM241470 2 0.6343 0.885 0.160 0.840
#> GSM241471 2 0.6343 0.885 0.160 0.840
#> GSM241472 1 0.0000 0.937 1.000 0.000
#> GSM241473 2 0.6343 0.885 0.160 0.840
#> GSM241474 1 0.0000 0.937 1.000 0.000
#> GSM241475 2 0.6343 0.885 0.160 0.840
#> GSM241476 1 0.0000 0.937 1.000 0.000
#> GSM241477 2 0.6343 0.885 0.160 0.840
#> GSM241478 2 0.6343 0.885 0.160 0.840
#> GSM241479 1 0.0000 0.937 1.000 0.000
#> GSM241480 1 0.0000 0.937 1.000 0.000
#> GSM241481 2 0.6343 0.885 0.160 0.840
#> GSM241482 1 0.0000 0.937 1.000 0.000
#> GSM241483 2 0.6343 0.885 0.160 0.840
#> GSM241484 1 0.0000 0.937 1.000 0.000
#> GSM241485 1 0.0000 0.937 1.000 0.000
#> GSM241486 2 0.6343 0.885 0.160 0.840
#> GSM241487 2 0.0000 0.904 0.000 1.000
#> GSM241488 2 0.6343 0.885 0.160 0.840
#> GSM241489 1 0.0000 0.937 1.000 0.000
#> GSM241490 1 0.0000 0.937 1.000 0.000
#> GSM241491 2 0.6343 0.885 0.160 0.840
#> GSM241492 1 0.0000 0.937 1.000 0.000
#> GSM241493 2 0.6343 0.885 0.160 0.840
#> GSM241494 1 0.0000 0.937 1.000 0.000
#> GSM241495 2 0.6343 0.885 0.160 0.840
#> GSM241496 2 0.6343 0.885 0.160 0.840
#> GSM241497 1 0.0000 0.937 1.000 0.000
#> GSM241498 1 0.0000 0.937 1.000 0.000
#> GSM241499 1 0.0000 0.937 1.000 0.000
#> GSM241500 2 0.0000 0.904 0.000 1.000
#> GSM241501 2 0.0000 0.904 0.000 1.000
#> GSM241502 2 0.3879 0.897 0.076 0.924
#> GSM241503 1 0.0000 0.937 1.000 0.000
#> GSM241504 1 0.0000 0.937 1.000 0.000
#> GSM241505 1 0.0000 0.937 1.000 0.000
#> GSM241506 2 0.0000 0.904 0.000 1.000
#> GSM241507 1 0.0000 0.937 1.000 0.000
#> GSM241508 2 0.0000 0.904 0.000 1.000
#> GSM241509 2 0.0000 0.904 0.000 1.000
#> GSM241510 2 0.0000 0.904 0.000 1.000
#> GSM241511 1 0.5059 0.872 0.888 0.112
#> GSM241512 1 0.7219 0.809 0.800 0.200
#> GSM241513 2 0.0000 0.904 0.000 1.000
#> GSM241514 1 0.6343 0.840 0.840 0.160
#> GSM241515 2 0.0000 0.904 0.000 1.000
#> GSM241516 1 0.6343 0.840 0.840 0.160
#> GSM241517 2 0.0000 0.904 0.000 1.000
#> GSM241518 1 0.9850 0.417 0.572 0.428
#> GSM241519 2 0.0000 0.904 0.000 1.000
#> GSM241520 1 0.0672 0.934 0.992 0.008
#> GSM241521 2 0.0000 0.904 0.000 1.000
#> GSM241522 1 0.0000 0.937 1.000 0.000
#> GSM241523 2 0.0000 0.904 0.000 1.000
#> GSM241524 1 0.0672 0.934 0.992 0.008
#> GSM241525 1 0.0376 0.936 0.996 0.004
#> GSM241526 2 0.0000 0.904 0.000 1.000
#> GSM241527 1 0.6343 0.840 0.840 0.160
#> GSM241528 2 0.0000 0.904 0.000 1.000
#> GSM241529 2 0.0000 0.904 0.000 1.000
#> GSM241530 1 0.6247 0.843 0.844 0.156
#> GSM241531 1 0.6343 0.840 0.840 0.160
#> GSM241532 2 0.0000 0.904 0.000 1.000
#> GSM241533 2 0.0000 0.904 0.000 1.000
#> GSM241534 2 0.0000 0.904 0.000 1.000
#> GSM241535 2 0.2043 0.886 0.032 0.968
#> GSM241536 1 0.6247 0.843 0.844 0.156
#> GSM241537 2 0.0000 0.904 0.000 1.000
#> GSM241538 2 0.9775 0.121 0.412 0.588
#> GSM241539 2 0.0000 0.904 0.000 1.000
#> GSM241540 1 0.6343 0.840 0.840 0.160
#> GSM241541 2 0.0000 0.904 0.000 1.000
#> GSM241542 2 0.2043 0.886 0.032 0.968
#> GSM241543 2 0.0000 0.904 0.000 1.000
#> GSM241544 1 0.6343 0.840 0.840 0.160
#> GSM241545 2 0.0000 0.904 0.000 1.000
#> GSM241546 1 0.6343 0.840 0.840 0.160
#> GSM241547 2 0.0000 0.904 0.000 1.000
#> GSM241548 1 0.9710 0.487 0.600 0.400
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241452 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241454 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241456 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241457 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241458 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241460 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241461 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241462 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241463 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241464 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241465 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241466 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241467 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241469 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241472 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241474 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241476 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241479 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241480 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241481 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241482 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241483 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241484 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241485 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241486 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241487 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241488 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241489 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241490 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241491 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241492 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241493 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241494 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241497 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241498 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241499 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241500 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241501 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241502 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241503 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241504 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241505 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241506 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241507 1 0.0000 1.000 1.000 0.000 0.000
#> GSM241508 2 0.0000 0.951 0.000 1.000 0.000
#> GSM241509 2 0.1643 0.925 0.000 0.956 0.044
#> GSM241510 2 0.4842 0.769 0.000 0.776 0.224
#> GSM241511 3 0.4002 0.798 0.160 0.000 0.840
#> GSM241512 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241513 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241514 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241515 3 0.1163 0.936 0.000 0.028 0.972
#> GSM241516 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241517 2 0.4605 0.795 0.000 0.796 0.204
#> GSM241518 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241519 2 0.4235 0.825 0.000 0.824 0.176
#> GSM241520 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241521 2 0.4235 0.825 0.000 0.824 0.176
#> GSM241522 3 0.4974 0.696 0.236 0.000 0.764
#> GSM241523 2 0.4235 0.825 0.000 0.824 0.176
#> GSM241524 3 0.0747 0.948 0.016 0.000 0.984
#> GSM241525 3 0.4605 0.743 0.204 0.000 0.796
#> GSM241526 2 0.5016 0.745 0.000 0.760 0.240
#> GSM241527 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241528 2 0.4062 0.835 0.000 0.836 0.164
#> GSM241529 2 0.4399 0.813 0.000 0.812 0.188
#> GSM241530 3 0.0592 0.951 0.012 0.000 0.988
#> GSM241531 3 0.0592 0.951 0.012 0.000 0.988
#> GSM241532 2 0.4555 0.799 0.000 0.800 0.200
#> GSM241533 3 0.4842 0.685 0.000 0.224 0.776
#> GSM241534 3 0.4796 0.692 0.000 0.220 0.780
#> GSM241535 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241536 3 0.0592 0.951 0.012 0.000 0.988
#> GSM241537 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241544 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241545 3 0.0237 0.955 0.000 0.004 0.996
#> GSM241546 3 0.0000 0.958 0.000 0.000 1.000
#> GSM241547 3 0.0424 0.953 0.000 0.008 0.992
#> GSM241548 3 0.0000 0.958 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241457 4 0.4898 0.780 0.000 0.416 0.000 0.584
#> GSM241458 1 0.4522 0.718 0.680 0.000 0.000 0.320
#> GSM241459 4 0.4898 0.780 0.000 0.416 0.000 0.584
#> GSM241460 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241461 4 0.4898 0.780 0.000 0.416 0.000 0.584
#> GSM241462 1 0.4040 0.760 0.752 0.000 0.000 0.248
#> GSM241463 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241481 4 0.4916 0.770 0.000 0.424 0.000 0.576
#> GSM241482 1 0.0188 0.885 0.996 0.000 0.000 0.004
#> GSM241483 4 0.4898 0.780 0.000 0.416 0.000 0.584
#> GSM241484 1 0.4790 0.676 0.620 0.000 0.000 0.380
#> GSM241485 1 0.4040 0.760 0.752 0.000 0.000 0.248
#> GSM241486 4 0.4898 0.780 0.000 0.416 0.000 0.584
#> GSM241487 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241488 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.935 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.886 1.000 0.000 0.000 0.000
#> GSM241499 1 0.4790 0.676 0.620 0.000 0.000 0.380
#> GSM241500 4 0.4888 0.780 0.000 0.412 0.000 0.588
#> GSM241501 4 0.4898 0.780 0.000 0.416 0.000 0.584
#> GSM241502 4 0.4898 0.780 0.000 0.416 0.000 0.584
#> GSM241503 1 0.4790 0.676 0.620 0.000 0.000 0.380
#> GSM241504 1 0.4790 0.676 0.620 0.000 0.000 0.380
#> GSM241505 1 0.4790 0.676 0.620 0.000 0.000 0.380
#> GSM241506 4 0.4898 0.780 0.000 0.416 0.000 0.584
#> GSM241507 1 0.4790 0.676 0.620 0.000 0.000 0.380
#> GSM241508 4 0.4888 0.780 0.000 0.412 0.000 0.588
#> GSM241509 4 0.5527 0.764 0.000 0.356 0.028 0.616
#> GSM241510 4 0.6709 0.671 0.000 0.212 0.172 0.616
#> GSM241511 3 0.4804 0.692 0.000 0.000 0.616 0.384
#> GSM241512 3 0.4454 0.727 0.000 0.000 0.692 0.308
#> GSM241513 3 0.3726 0.639 0.000 0.212 0.788 0.000
#> GSM241514 3 0.3726 0.758 0.212 0.000 0.788 0.000
#> GSM241515 3 0.3726 0.639 0.000 0.212 0.788 0.000
#> GSM241516 3 0.3764 0.756 0.216 0.000 0.784 0.000
#> GSM241517 2 0.3649 0.657 0.000 0.796 0.204 0.000
#> GSM241518 3 0.3726 0.758 0.212 0.000 0.788 0.000
#> GSM241519 2 0.3311 0.703 0.000 0.828 0.172 0.000
#> GSM241520 3 0.3726 0.758 0.212 0.000 0.788 0.000
#> GSM241521 2 0.3311 0.703 0.000 0.828 0.172 0.000
#> GSM241522 3 0.4804 0.555 0.384 0.000 0.616 0.000
#> GSM241523 2 0.3400 0.693 0.000 0.820 0.180 0.000
#> GSM241524 3 0.3942 0.743 0.236 0.000 0.764 0.000
#> GSM241525 3 0.4804 0.692 0.000 0.000 0.616 0.384
#> GSM241526 4 0.5573 0.519 0.000 0.028 0.368 0.604
#> GSM241527 3 0.4804 0.692 0.000 0.000 0.616 0.384
#> GSM241528 4 0.6591 0.649 0.000 0.424 0.080 0.496
#> GSM241529 4 0.6933 0.662 0.000 0.300 0.140 0.560
#> GSM241530 3 0.4804 0.692 0.000 0.000 0.616 0.384
#> GSM241531 3 0.4804 0.692 0.000 0.000 0.616 0.384
#> GSM241532 4 0.5189 0.519 0.000 0.012 0.372 0.616
#> GSM241533 4 0.5174 0.520 0.000 0.012 0.368 0.620
#> GSM241534 4 0.4790 0.501 0.000 0.000 0.380 0.620
#> GSM241535 3 0.2647 0.753 0.000 0.000 0.880 0.120
#> GSM241536 3 0.4804 0.692 0.000 0.000 0.616 0.384
#> GSM241537 3 0.1022 0.756 0.000 0.000 0.968 0.032
#> GSM241538 3 0.0188 0.768 0.000 0.000 0.996 0.004
#> GSM241539 3 0.1022 0.756 0.000 0.000 0.968 0.032
#> GSM241540 3 0.0921 0.770 0.000 0.000 0.972 0.028
#> GSM241541 3 0.1022 0.756 0.000 0.000 0.968 0.032
#> GSM241542 3 0.0188 0.768 0.000 0.000 0.996 0.004
#> GSM241543 3 0.3726 0.639 0.000 0.212 0.788 0.000
#> GSM241544 3 0.3610 0.762 0.200 0.000 0.800 0.000
#> GSM241545 3 0.3726 0.639 0.000 0.212 0.788 0.000
#> GSM241546 3 0.3610 0.762 0.200 0.000 0.800 0.000
#> GSM241547 3 0.0469 0.766 0.000 0.012 0.988 0.000
#> GSM241548 3 0.0000 0.768 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.0404 0.942 0.000 0.012 0.000 0.000 0.988
#> GSM241458 4 0.2605 0.806 0.148 0.000 0.000 0.852 0.000
#> GSM241459 5 0.0404 0.942 0.000 0.012 0.000 0.000 0.988
#> GSM241460 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241462 4 0.3109 0.739 0.200 0.000 0.000 0.800 0.000
#> GSM241463 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.1732 0.889 0.000 0.080 0.000 0.000 0.920
#> GSM241482 1 0.2179 0.855 0.888 0.000 0.000 0.112 0.000
#> GSM241483 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241484 4 0.0510 0.927 0.016 0.000 0.000 0.984 0.000
#> GSM241485 1 0.4161 0.296 0.608 0.000 0.000 0.392 0.000
#> GSM241486 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241487 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM241499 4 0.0510 0.927 0.016 0.000 0.000 0.984 0.000
#> GSM241500 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241501 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241502 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241503 4 0.0510 0.927 0.016 0.000 0.000 0.984 0.000
#> GSM241504 4 0.0510 0.927 0.016 0.000 0.000 0.984 0.000
#> GSM241505 4 0.0510 0.927 0.016 0.000 0.000 0.984 0.000
#> GSM241506 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241507 4 0.0510 0.927 0.016 0.000 0.000 0.984 0.000
#> GSM241508 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241509 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241510 5 0.0290 0.944 0.000 0.008 0.000 0.000 0.992
#> GSM241511 4 0.0000 0.925 0.000 0.000 0.000 1.000 0.000
#> GSM241512 3 0.3336 0.672 0.000 0.000 0.772 0.228 0.000
#> GSM241513 3 0.0404 0.954 0.000 0.012 0.988 0.000 0.000
#> GSM241514 3 0.0404 0.955 0.012 0.000 0.988 0.000 0.000
#> GSM241515 3 0.0404 0.954 0.000 0.012 0.988 0.000 0.000
#> GSM241516 3 0.0510 0.953 0.016 0.000 0.984 0.000 0.000
#> GSM241517 2 0.3684 0.665 0.000 0.720 0.280 0.000 0.000
#> GSM241518 3 0.0404 0.955 0.012 0.000 0.988 0.000 0.000
#> GSM241519 2 0.3684 0.665 0.000 0.720 0.280 0.000 0.000
#> GSM241520 3 0.0290 0.957 0.008 0.000 0.992 0.000 0.000
#> GSM241521 2 0.3684 0.665 0.000 0.720 0.280 0.000 0.000
#> GSM241522 3 0.3999 0.465 0.344 0.000 0.656 0.000 0.000
#> GSM241523 2 0.3684 0.665 0.000 0.720 0.280 0.000 0.000
#> GSM241524 3 0.0290 0.957 0.008 0.000 0.992 0.000 0.000
#> GSM241525 4 0.0000 0.925 0.000 0.000 0.000 1.000 0.000
#> GSM241526 5 0.4444 0.633 0.000 0.012 0.264 0.016 0.708
#> GSM241527 4 0.2230 0.830 0.000 0.000 0.116 0.884 0.000
#> GSM241528 5 0.4901 0.727 0.000 0.184 0.068 0.016 0.732
#> GSM241529 5 0.5154 0.626 0.000 0.052 0.252 0.016 0.680
#> GSM241530 4 0.0000 0.925 0.000 0.000 0.000 1.000 0.000
#> GSM241531 4 0.0000 0.925 0.000 0.000 0.000 1.000 0.000
#> GSM241532 5 0.0000 0.939 0.000 0.000 0.000 0.000 1.000
#> GSM241533 5 0.0000 0.939 0.000 0.000 0.000 0.000 1.000
#> GSM241534 5 0.0000 0.939 0.000 0.000 0.000 0.000 1.000
#> GSM241535 4 0.4446 0.307 0.000 0.000 0.400 0.592 0.008
#> GSM241536 4 0.0000 0.925 0.000 0.000 0.000 1.000 0.000
#> GSM241537 3 0.0290 0.956 0.000 0.000 0.992 0.000 0.008
#> GSM241538 3 0.0798 0.949 0.000 0.000 0.976 0.016 0.008
#> GSM241539 3 0.0290 0.956 0.000 0.000 0.992 0.000 0.008
#> GSM241540 3 0.0798 0.949 0.000 0.000 0.976 0.016 0.008
#> GSM241541 3 0.0290 0.956 0.000 0.000 0.992 0.000 0.008
#> GSM241542 3 0.0798 0.949 0.000 0.000 0.976 0.016 0.008
#> GSM241543 3 0.0290 0.956 0.000 0.008 0.992 0.000 0.000
#> GSM241544 3 0.0000 0.957 0.000 0.000 1.000 0.000 0.000
#> GSM241545 3 0.0290 0.956 0.000 0.008 0.992 0.000 0.000
#> GSM241546 3 0.0162 0.957 0.004 0.000 0.996 0.000 0.000
#> GSM241547 3 0.0290 0.956 0.000 0.008 0.992 0.000 0.000
#> GSM241548 3 0.0000 0.957 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.0146 0.931 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM241458 6 0.1714 0.857 0.092 0.000 0.000 0.000 0.000 0.908
#> GSM241459 5 0.0146 0.931 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM241460 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241462 6 0.2793 0.727 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM241463 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.1075 0.899 0.000 0.048 0.000 0.000 0.952 0.000
#> GSM241482 1 0.2048 0.833 0.880 0.000 0.000 0.000 0.000 0.120
#> GSM241483 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241484 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241485 1 0.3737 0.290 0.608 0.000 0.000 0.000 0.000 0.392
#> GSM241486 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241487 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.916 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241500 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241501 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241502 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241503 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241504 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241505 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241506 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241507 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241508 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241509 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241510 5 0.0000 0.933 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241511 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241512 6 0.2912 0.711 0.000 0.000 0.216 0.000 0.000 0.784
#> GSM241513 2 0.3672 0.513 0.000 0.632 0.368 0.000 0.000 0.000
#> GSM241514 3 0.0000 0.931 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241515 2 0.3672 0.513 0.000 0.632 0.368 0.000 0.000 0.000
#> GSM241516 1 0.3672 0.332 0.632 0.000 0.368 0.000 0.000 0.000
#> GSM241517 2 0.3240 0.710 0.000 0.752 0.244 0.004 0.000 0.000
#> GSM241518 3 0.3737 0.335 0.392 0.000 0.608 0.000 0.000 0.000
#> GSM241519 2 0.3101 0.713 0.000 0.756 0.244 0.000 0.000 0.000
#> GSM241520 3 0.0000 0.931 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241521 2 0.3101 0.713 0.000 0.756 0.244 0.000 0.000 0.000
#> GSM241522 1 0.2092 0.819 0.876 0.000 0.124 0.000 0.000 0.000
#> GSM241523 2 0.3101 0.713 0.000 0.756 0.244 0.000 0.000 0.000
#> GSM241524 3 0.0000 0.931 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241525 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241526 5 0.4619 0.587 0.000 0.000 0.244 0.088 0.668 0.000
#> GSM241527 6 0.3103 0.816 0.000 0.000 0.064 0.100 0.000 0.836
#> GSM241528 5 0.4704 0.693 0.000 0.172 0.060 0.044 0.724 0.000
#> GSM241529 5 0.5268 0.559 0.000 0.068 0.240 0.044 0.648 0.000
#> GSM241530 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241531 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241532 5 0.0937 0.914 0.000 0.000 0.000 0.040 0.960 0.000
#> GSM241533 5 0.1141 0.908 0.000 0.000 0.000 0.052 0.948 0.000
#> GSM241534 5 0.1141 0.908 0.000 0.000 0.000 0.052 0.948 0.000
#> GSM241535 4 0.0547 0.958 0.000 0.000 0.020 0.980 0.000 0.000
#> GSM241536 6 0.0000 0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241537 4 0.0000 0.961 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241538 4 0.1007 0.953 0.000 0.000 0.044 0.956 0.000 0.000
#> GSM241539 4 0.0000 0.961 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241540 4 0.1556 0.924 0.000 0.000 0.080 0.920 0.000 0.000
#> GSM241541 4 0.0000 0.961 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241542 4 0.1007 0.953 0.000 0.000 0.044 0.956 0.000 0.000
#> GSM241543 3 0.0000 0.931 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241544 3 0.0000 0.931 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241545 3 0.0000 0.931 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241546 3 0.0000 0.931 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241547 3 0.0865 0.897 0.000 0.000 0.964 0.036 0.000 0.000
#> GSM241548 3 0.0363 0.921 0.000 0.000 0.988 0.012 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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> SD:pam 95 7.61e-01 9.35e-01 2
#> SD:pam 98 2.49e-10 2.57e-01 3
#> SD:pam 98 1.01e-09 2.31e-05 4
#> SD:pam 95 2.34e-08 3.46e-09 5
#> SD:pam 95 1.62e-08 1.39e-11 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.580 0.937 0.951 0.4625 0.512 0.512
#> 3 3 0.901 0.913 0.963 0.2355 0.823 0.688
#> 4 4 0.667 0.761 0.850 0.2141 0.887 0.745
#> 5 5 0.820 0.865 0.916 0.1224 0.854 0.581
#> 6 6 0.892 0.841 0.909 0.0571 0.920 0.666
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
#> GSM241451 1 0.1414 0.911 0.980 0.020
#> GSM241452 1 0.5737 0.925 0.864 0.136
#> GSM241453 1 0.1414 0.911 0.980 0.020
#> GSM241454 1 0.5737 0.925 0.864 0.136
#> GSM241455 1 0.1414 0.911 0.980 0.020
#> GSM241456 1 0.5737 0.925 0.864 0.136
#> GSM241457 2 0.7602 0.694 0.220 0.780
#> GSM241458 1 0.6148 0.919 0.848 0.152
#> GSM241459 2 0.7453 0.708 0.212 0.788
#> GSM241460 1 0.5737 0.925 0.864 0.136
#> GSM241461 2 0.5519 0.837 0.128 0.872
#> GSM241462 1 0.6623 0.900 0.828 0.172
#> GSM241463 1 0.1414 0.911 0.980 0.020
#> GSM241464 1 0.6148 0.919 0.848 0.152
#> GSM241465 1 0.1414 0.911 0.980 0.020
#> GSM241466 1 0.5737 0.925 0.864 0.136
#> GSM241467 1 0.5737 0.925 0.864 0.136
#> GSM241468 1 0.1414 0.911 0.980 0.020
#> GSM241469 1 0.5737 0.925 0.864 0.136
#> GSM241470 1 0.1414 0.911 0.980 0.020
#> GSM241471 1 0.1414 0.911 0.980 0.020
#> GSM241472 1 0.5737 0.925 0.864 0.136
#> GSM241473 1 0.1414 0.911 0.980 0.020
#> GSM241474 1 0.5737 0.925 0.864 0.136
#> GSM241475 1 0.1414 0.911 0.980 0.020
#> GSM241476 1 0.5737 0.925 0.864 0.136
#> GSM241477 1 0.1414 0.911 0.980 0.020
#> GSM241478 1 0.1414 0.911 0.980 0.020
#> GSM241479 1 0.5737 0.925 0.864 0.136
#> GSM241480 1 0.5737 0.925 0.864 0.136
#> GSM241481 2 0.7674 0.687 0.224 0.776
#> GSM241482 1 0.6148 0.919 0.848 0.152
#> GSM241483 2 0.5519 0.837 0.128 0.872
#> GSM241484 1 0.6148 0.919 0.848 0.152
#> GSM241485 1 0.6148 0.919 0.848 0.152
#> GSM241486 2 0.5294 0.847 0.120 0.880
#> GSM241487 2 0.5737 0.825 0.136 0.864
#> GSM241488 1 0.1414 0.911 0.980 0.020
#> GSM241489 1 0.6148 0.919 0.848 0.152
#> GSM241490 2 0.1414 0.958 0.020 0.980
#> GSM241491 1 0.1414 0.911 0.980 0.020
#> GSM241492 1 0.6148 0.919 0.848 0.152
#> GSM241493 1 0.1414 0.911 0.980 0.020
#> GSM241494 1 0.5737 0.925 0.864 0.136
#> GSM241495 1 0.1414 0.911 0.980 0.020
#> GSM241496 1 0.1414 0.911 0.980 0.020
#> GSM241497 1 0.6148 0.919 0.848 0.152
#> GSM241498 1 0.5737 0.925 0.864 0.136
#> GSM241499 2 0.0376 0.973 0.004 0.996
#> GSM241500 2 0.0000 0.976 0.000 1.000
#> GSM241501 2 0.0000 0.976 0.000 1.000
#> GSM241502 2 0.0000 0.976 0.000 1.000
#> GSM241503 2 0.0376 0.973 0.004 0.996
#> GSM241504 2 0.0376 0.973 0.004 0.996
#> GSM241505 2 0.0376 0.973 0.004 0.996
#> GSM241506 2 0.0000 0.976 0.000 1.000
#> GSM241507 2 0.0376 0.973 0.004 0.996
#> GSM241508 2 0.0000 0.976 0.000 1.000
#> GSM241509 2 0.0000 0.976 0.000 1.000
#> GSM241510 2 0.0000 0.976 0.000 1.000
#> GSM241511 2 0.0000 0.976 0.000 1.000
#> GSM241512 2 0.0000 0.976 0.000 1.000
#> GSM241513 2 0.0000 0.976 0.000 1.000
#> GSM241514 2 0.0000 0.976 0.000 1.000
#> GSM241515 2 0.0000 0.976 0.000 1.000
#> GSM241516 2 0.0000 0.976 0.000 1.000
#> GSM241517 2 0.0000 0.976 0.000 1.000
#> GSM241518 2 0.0000 0.976 0.000 1.000
#> GSM241519 2 0.0000 0.976 0.000 1.000
#> GSM241520 2 0.0000 0.976 0.000 1.000
#> GSM241521 2 0.0000 0.976 0.000 1.000
#> GSM241522 2 0.0376 0.973 0.004 0.996
#> GSM241523 2 0.0000 0.976 0.000 1.000
#> GSM241524 2 0.0000 0.976 0.000 1.000
#> GSM241525 2 0.0000 0.976 0.000 1.000
#> GSM241526 2 0.0000 0.976 0.000 1.000
#> GSM241527 2 0.0000 0.976 0.000 1.000
#> GSM241528 2 0.0000 0.976 0.000 1.000
#> GSM241529 2 0.0000 0.976 0.000 1.000
#> GSM241530 2 0.0000 0.976 0.000 1.000
#> GSM241531 2 0.0000 0.976 0.000 1.000
#> GSM241532 2 0.0000 0.976 0.000 1.000
#> GSM241533 2 0.0000 0.976 0.000 1.000
#> GSM241534 2 0.0000 0.976 0.000 1.000
#> GSM241535 2 0.0000 0.976 0.000 1.000
#> GSM241536 2 0.0000 0.976 0.000 1.000
#> GSM241537 2 0.0000 0.976 0.000 1.000
#> GSM241538 2 0.0000 0.976 0.000 1.000
#> GSM241539 2 0.0000 0.976 0.000 1.000
#> GSM241540 2 0.0000 0.976 0.000 1.000
#> GSM241541 2 0.0000 0.976 0.000 1.000
#> GSM241542 2 0.0000 0.976 0.000 1.000
#> GSM241543 2 0.0000 0.976 0.000 1.000
#> GSM241544 2 0.0000 0.976 0.000 1.000
#> GSM241545 2 0.0000 0.976 0.000 1.000
#> GSM241546 2 0.0000 0.976 0.000 1.000
#> GSM241547 2 0.0000 0.976 0.000 1.000
#> GSM241548 2 0.0000 0.976 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241457 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241458 3 0.5948 0.503 0.360 0.000 0.640
#> GSM241459 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241460 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241461 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241462 3 0.5948 0.503 0.360 0.000 0.640
#> GSM241463 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241464 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241465 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241481 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241482 3 0.5948 0.503 0.360 0.000 0.640
#> GSM241483 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241484 3 0.5948 0.503 0.360 0.000 0.640
#> GSM241485 1 0.4002 0.758 0.840 0.000 0.160
#> GSM241486 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241487 2 0.6062 0.398 0.000 0.616 0.384
#> GSM241488 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241491 2 0.0424 0.960 0.000 0.992 0.008
#> GSM241492 1 0.0424 0.977 0.992 0.000 0.008
#> GSM241493 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.969 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.987 1.000 0.000 0.000
#> GSM241499 3 0.5882 0.527 0.348 0.000 0.652
#> GSM241500 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241501 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241502 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241503 3 0.5882 0.527 0.348 0.000 0.652
#> GSM241504 3 0.5497 0.622 0.292 0.000 0.708
#> GSM241505 3 0.5497 0.622 0.292 0.000 0.708
#> GSM241506 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241507 3 0.5497 0.622 0.292 0.000 0.708
#> GSM241508 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241509 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241510 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241511 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241512 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241513 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241514 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241515 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241516 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241517 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241518 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241519 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241520 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241521 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241522 3 0.0592 0.936 0.012 0.000 0.988
#> GSM241523 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241524 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241525 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241526 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241528 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241529 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241530 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241531 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241532 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241533 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241534 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241535 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241536 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241537 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241544 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241545 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241546 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241547 3 0.0000 0.945 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.945 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241452 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241453 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241454 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241455 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241456 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241457 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241458 3 0.728 0.5283 0.236 0.000 0.540 0.224
#> GSM241459 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241460 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241461 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241462 3 0.671 0.4721 0.360 0.000 0.540 0.100
#> GSM241463 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241464 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241465 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241466 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241467 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241468 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241469 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241470 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241471 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241472 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241473 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241474 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241475 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241476 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241477 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241478 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241479 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241480 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241481 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241482 3 0.671 0.4721 0.360 0.000 0.540 0.100
#> GSM241483 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241484 3 0.679 0.4765 0.352 0.000 0.540 0.108
#> GSM241485 1 0.591 0.4733 0.680 0.000 0.228 0.092
#> GSM241486 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241487 2 0.733 0.2842 0.000 0.532 0.236 0.232
#> GSM241488 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241489 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241490 1 0.692 0.0767 0.528 0.000 0.120 0.352
#> GSM241491 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241492 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241493 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241494 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241495 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241496 2 0.000 0.9718 0.000 1.000 0.000 0.000
#> GSM241497 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241498 1 0.000 0.9487 1.000 0.000 0.000 0.000
#> GSM241499 3 0.674 0.5679 0.104 0.000 0.544 0.352
#> GSM241500 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241501 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241502 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241503 3 0.674 0.5679 0.104 0.000 0.544 0.352
#> GSM241504 3 0.674 0.5679 0.104 0.000 0.544 0.352
#> GSM241505 3 0.674 0.5679 0.104 0.000 0.544 0.352
#> GSM241506 3 0.499 0.4748 0.000 0.000 0.524 0.476
#> GSM241507 3 0.674 0.5679 0.104 0.000 0.544 0.352
#> GSM241508 4 0.000 0.9249 0.000 0.000 0.000 1.000
#> GSM241509 4 0.500 -0.4729 0.000 0.000 0.496 0.504
#> GSM241510 3 0.499 0.4748 0.000 0.000 0.524 0.476
#> GSM241511 3 0.470 0.6401 0.000 0.000 0.644 0.356
#> GSM241512 3 0.470 0.6401 0.000 0.000 0.644 0.356
#> GSM241513 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241514 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241515 3 0.265 0.7342 0.000 0.000 0.880 0.120
#> GSM241516 3 0.265 0.7342 0.000 0.000 0.880 0.120
#> GSM241517 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241518 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241519 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241520 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241521 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241522 3 0.467 0.6893 0.104 0.000 0.796 0.100
#> GSM241523 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241524 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241525 3 0.470 0.6401 0.000 0.000 0.644 0.356
#> GSM241526 3 0.410 0.6507 0.000 0.000 0.744 0.256
#> GSM241527 3 0.470 0.6401 0.000 0.000 0.644 0.356
#> GSM241528 3 0.445 0.6307 0.000 0.000 0.692 0.308
#> GSM241529 3 0.499 0.4748 0.000 0.000 0.524 0.476
#> GSM241530 3 0.470 0.6401 0.000 0.000 0.644 0.356
#> GSM241531 3 0.470 0.6401 0.000 0.000 0.644 0.356
#> GSM241532 3 0.499 0.4748 0.000 0.000 0.524 0.476
#> GSM241533 3 0.499 0.4748 0.000 0.000 0.524 0.476
#> GSM241534 3 0.499 0.4748 0.000 0.000 0.524 0.476
#> GSM241535 3 0.470 0.6401 0.000 0.000 0.644 0.356
#> GSM241536 3 0.470 0.6401 0.000 0.000 0.644 0.356
#> GSM241537 3 0.265 0.7342 0.000 0.000 0.880 0.120
#> GSM241538 3 0.265 0.7342 0.000 0.000 0.880 0.120
#> GSM241539 3 0.265 0.7342 0.000 0.000 0.880 0.120
#> GSM241540 3 0.312 0.7297 0.000 0.000 0.844 0.156
#> GSM241541 3 0.265 0.7342 0.000 0.000 0.880 0.120
#> GSM241542 3 0.265 0.7342 0.000 0.000 0.880 0.120
#> GSM241543 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241544 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241545 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241546 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241547 3 0.000 0.7165 0.000 0.000 1.000 0.000
#> GSM241548 3 0.000 0.7165 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.0963 0.9032 0.036 0.000 0.000 0.000 0.964
#> GSM241458 4 0.3274 0.7556 0.220 0.000 0.000 0.780 0.000
#> GSM241459 5 0.0963 0.9032 0.036 0.000 0.000 0.000 0.964
#> GSM241460 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.0963 0.9032 0.036 0.000 0.000 0.000 0.964
#> GSM241462 4 0.3305 0.7521 0.224 0.000 0.000 0.776 0.000
#> GSM241463 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241471 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241476 1 0.0324 0.9914 0.992 0.000 0.004 0.004 0.000
#> GSM241477 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241478 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.0963 0.9032 0.036 0.000 0.000 0.000 0.964
#> GSM241482 4 0.3305 0.7521 0.224 0.000 0.000 0.776 0.000
#> GSM241483 5 0.0963 0.9032 0.036 0.000 0.000 0.000 0.964
#> GSM241484 4 0.3519 0.7567 0.216 0.008 0.000 0.776 0.000
#> GSM241485 4 0.4294 0.3155 0.468 0.000 0.000 0.532 0.000
#> GSM241486 5 0.0963 0.9032 0.036 0.000 0.000 0.000 0.964
#> GSM241487 2 0.7652 0.0723 0.036 0.464 0.060 0.348 0.092
#> GSM241488 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241490 4 0.5230 0.2950 0.452 0.000 0.044 0.504 0.000
#> GSM241491 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241496 2 0.0963 0.9650 0.036 0.964 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.9995 1.000 0.000 0.000 0.000 0.000
#> GSM241499 4 0.3920 0.7845 0.148 0.012 0.036 0.804 0.000
#> GSM241500 5 0.0000 0.8976 0.000 0.000 0.000 0.000 1.000
#> GSM241501 5 0.0000 0.8976 0.000 0.000 0.000 0.000 1.000
#> GSM241502 5 0.0000 0.8976 0.000 0.000 0.000 0.000 1.000
#> GSM241503 4 0.3920 0.7845 0.148 0.012 0.036 0.804 0.000
#> GSM241504 4 0.3920 0.7845 0.148 0.012 0.036 0.804 0.000
#> GSM241505 4 0.3920 0.7845 0.148 0.012 0.036 0.804 0.000
#> GSM241506 5 0.3551 0.7034 0.000 0.000 0.008 0.220 0.772
#> GSM241507 4 0.3920 0.7845 0.148 0.012 0.036 0.804 0.000
#> GSM241508 5 0.0000 0.8976 0.000 0.000 0.000 0.000 1.000
#> GSM241509 5 0.3388 0.7534 0.000 0.000 0.008 0.200 0.792
#> GSM241510 5 0.4183 0.5505 0.000 0.000 0.008 0.324 0.668
#> GSM241511 4 0.1522 0.8252 0.000 0.012 0.044 0.944 0.000
#> GSM241512 4 0.1410 0.8256 0.000 0.000 0.060 0.940 0.000
#> GSM241513 3 0.0510 0.9433 0.000 0.000 0.984 0.016 0.000
#> GSM241514 3 0.4242 0.1943 0.000 0.000 0.572 0.428 0.000
#> GSM241515 4 0.3550 0.7219 0.000 0.000 0.236 0.760 0.004
#> GSM241516 4 0.2561 0.7981 0.000 0.000 0.144 0.856 0.000
#> GSM241517 3 0.0000 0.9553 0.000 0.000 1.000 0.000 0.000
#> GSM241518 3 0.0404 0.9545 0.000 0.000 0.988 0.012 0.000
#> GSM241519 3 0.0000 0.9553 0.000 0.000 1.000 0.000 0.000
#> GSM241520 3 0.0404 0.9545 0.000 0.000 0.988 0.012 0.000
#> GSM241521 3 0.0000 0.9553 0.000 0.000 1.000 0.000 0.000
#> GSM241522 4 0.5460 0.7046 0.148 0.000 0.196 0.656 0.000
#> GSM241523 3 0.0000 0.9553 0.000 0.000 1.000 0.000 0.000
#> GSM241524 3 0.0404 0.9545 0.000 0.000 0.988 0.012 0.000
#> GSM241525 4 0.0404 0.8251 0.000 0.000 0.012 0.988 0.000
#> GSM241526 4 0.3359 0.7547 0.000 0.000 0.020 0.816 0.164
#> GSM241527 4 0.0609 0.8255 0.000 0.000 0.020 0.980 0.000
#> GSM241528 4 0.3476 0.7435 0.000 0.000 0.020 0.804 0.176
#> GSM241529 4 0.3242 0.7486 0.000 0.000 0.012 0.816 0.172
#> GSM241530 4 0.0404 0.8251 0.000 0.000 0.012 0.988 0.000
#> GSM241531 4 0.0693 0.8237 0.000 0.012 0.008 0.980 0.000
#> GSM241532 4 0.2798 0.7664 0.000 0.000 0.008 0.852 0.140
#> GSM241533 4 0.2798 0.7664 0.000 0.000 0.008 0.852 0.140
#> GSM241534 4 0.2798 0.7664 0.000 0.000 0.008 0.852 0.140
#> GSM241535 4 0.0703 0.8254 0.000 0.000 0.024 0.976 0.000
#> GSM241536 4 0.0693 0.8237 0.000 0.012 0.008 0.980 0.000
#> GSM241537 4 0.2812 0.8112 0.000 0.024 0.096 0.876 0.004
#> GSM241538 4 0.2642 0.8114 0.000 0.024 0.084 0.888 0.004
#> GSM241539 4 0.2812 0.8112 0.000 0.024 0.096 0.876 0.004
#> GSM241540 4 0.2482 0.8124 0.000 0.024 0.084 0.892 0.000
#> GSM241541 4 0.3606 0.7631 0.000 0.024 0.164 0.808 0.004
#> GSM241542 4 0.2812 0.8068 0.000 0.024 0.096 0.876 0.004
#> GSM241543 3 0.0000 0.9553 0.000 0.000 1.000 0.000 0.000
#> GSM241544 3 0.0404 0.9545 0.000 0.000 0.988 0.012 0.000
#> GSM241545 3 0.0000 0.9553 0.000 0.000 1.000 0.000 0.000
#> GSM241546 3 0.0404 0.9545 0.000 0.000 0.988 0.012 0.000
#> GSM241547 3 0.0000 0.9553 0.000 0.000 1.000 0.000 0.000
#> GSM241548 3 0.0404 0.9545 0.000 0.000 0.988 0.012 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241458 6 0.0000 0.9537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241459 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241460 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241462 6 0.0000 0.9537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241463 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0603 0.9564 0.000 0.980 0.000 0.004 0.016 0.000
#> GSM241466 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241482 6 0.0000 0.9537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241483 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241484 6 0.0000 0.9537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241485 6 0.3563 0.4867 0.336 0.000 0.000 0.000 0.000 0.664
#> GSM241486 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241487 2 0.4445 0.4076 0.000 0.656 0.000 0.288 0.056 0.000
#> GSM241488 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.3844 0.4367 0.676 0.000 0.008 0.004 0.000 0.312
#> GSM241491 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.9755 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.9791 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 6 0.0000 0.9537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241500 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241501 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241502 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241503 6 0.0000 0.9537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241504 6 0.0146 0.9521 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM241505 6 0.0146 0.9521 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM241506 4 0.2003 0.5531 0.000 0.000 0.000 0.884 0.116 0.000
#> GSM241507 6 0.0146 0.9521 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM241508 5 0.3351 1.0000 0.000 0.000 0.000 0.288 0.712 0.000
#> GSM241509 4 0.3175 0.2391 0.000 0.000 0.000 0.744 0.256 0.000
#> GSM241510 4 0.1204 0.6314 0.000 0.000 0.000 0.944 0.056 0.000
#> GSM241511 4 0.3578 0.6107 0.000 0.000 0.000 0.660 0.000 0.340
#> GSM241512 4 0.4265 0.5743 0.000 0.000 0.300 0.660 0.000 0.040
#> GSM241513 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241514 3 0.3847 -0.0724 0.000 0.000 0.544 0.456 0.000 0.000
#> GSM241515 4 0.3634 0.5040 0.000 0.000 0.356 0.644 0.000 0.000
#> GSM241516 4 0.3578 0.5298 0.000 0.000 0.340 0.660 0.000 0.000
#> GSM241517 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241518 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241519 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241520 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241521 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241522 4 0.5324 0.2574 0.000 0.000 0.428 0.468 0.000 0.104
#> GSM241523 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241524 3 0.0547 0.9165 0.000 0.000 0.980 0.020 0.000 0.000
#> GSM241525 4 0.4118 0.6301 0.000 0.000 0.028 0.660 0.000 0.312
#> GSM241526 4 0.1204 0.6314 0.000 0.000 0.000 0.944 0.056 0.000
#> GSM241527 4 0.4118 0.6301 0.000 0.000 0.028 0.660 0.000 0.312
#> GSM241528 4 0.1204 0.6314 0.000 0.000 0.000 0.944 0.056 0.000
#> GSM241529 4 0.1204 0.6314 0.000 0.000 0.000 0.944 0.056 0.000
#> GSM241530 4 0.4118 0.6301 0.000 0.000 0.028 0.660 0.000 0.312
#> GSM241531 4 0.3578 0.6107 0.000 0.000 0.000 0.660 0.000 0.340
#> GSM241532 4 0.0790 0.6454 0.000 0.000 0.000 0.968 0.032 0.000
#> GSM241533 4 0.0146 0.6594 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM241534 4 0.0146 0.6594 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM241535 4 0.4118 0.6301 0.000 0.000 0.028 0.660 0.000 0.312
#> GSM241536 4 0.3578 0.6107 0.000 0.000 0.000 0.660 0.000 0.340
#> GSM241537 4 0.3351 0.7027 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM241538 4 0.3351 0.7027 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM241539 4 0.3351 0.7027 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM241540 4 0.3936 0.7021 0.000 0.000 0.000 0.688 0.288 0.024
#> GSM241541 4 0.3351 0.7027 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM241542 4 0.3351 0.7027 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM241543 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241544 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241545 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241546 3 0.3076 0.5894 0.000 0.000 0.760 0.240 0.000 0.000
#> GSM241547 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241548 3 0.0000 0.9341 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> SD:mclust 98 2.95e-15 3.03e-01 2
#> SD:mclust 97 7.93e-12 4.87e-02 3
#> SD:mclust 85 1.51e-12 1.27e-03 4
#> SD:mclust 94 6.73e-12 3.99e-08 5
#> SD:mclust 92 1.71e-13 5.56e-08 6
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 16250 rows and 98 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.854 0.909 0.961 0.4860 0.525 0.525
#> 3 3 0.957 0.954 0.981 0.3837 0.650 0.418
#> 4 4 0.969 0.931 0.964 0.0951 0.900 0.711
#> 5 5 0.799 0.809 0.882 0.0669 0.928 0.742
#> 6 6 0.673 0.566 0.766 0.0426 0.963 0.839
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
#> GSM241451 1 0.0938 0.937 0.988 0.012
#> GSM241452 1 0.0000 0.944 1.000 0.000
#> GSM241453 1 0.0938 0.937 0.988 0.012
#> GSM241454 1 0.0000 0.944 1.000 0.000
#> GSM241455 1 0.0000 0.944 1.000 0.000
#> GSM241456 1 0.0000 0.944 1.000 0.000
#> GSM241457 1 0.8955 0.574 0.688 0.312
#> GSM241458 1 0.0000 0.944 1.000 0.000
#> GSM241459 1 0.6623 0.790 0.828 0.172
#> GSM241460 1 0.0000 0.944 1.000 0.000
#> GSM241461 2 0.4939 0.868 0.108 0.892
#> GSM241462 1 0.0000 0.944 1.000 0.000
#> GSM241463 1 0.0000 0.944 1.000 0.000
#> GSM241464 1 0.0000 0.944 1.000 0.000
#> GSM241465 1 0.3431 0.899 0.936 0.064
#> GSM241466 1 0.0000 0.944 1.000 0.000
#> GSM241467 1 0.0000 0.944 1.000 0.000
#> GSM241468 1 0.0000 0.944 1.000 0.000
#> GSM241469 1 0.0000 0.944 1.000 0.000
#> GSM241470 1 0.0376 0.941 0.996 0.004
#> GSM241471 1 0.0000 0.944 1.000 0.000
#> GSM241472 1 0.0000 0.944 1.000 0.000
#> GSM241473 1 0.0000 0.944 1.000 0.000
#> GSM241474 1 0.0000 0.944 1.000 0.000
#> GSM241475 1 0.0000 0.944 1.000 0.000
#> GSM241476 1 0.0000 0.944 1.000 0.000
#> GSM241477 1 0.0938 0.937 0.988 0.012
#> GSM241478 1 0.0000 0.944 1.000 0.000
#> GSM241479 1 0.0000 0.944 1.000 0.000
#> GSM241480 1 0.0000 0.944 1.000 0.000
#> GSM241481 1 0.6712 0.785 0.824 0.176
#> GSM241482 1 0.0000 0.944 1.000 0.000
#> GSM241483 2 0.9393 0.407 0.356 0.644
#> GSM241484 1 0.0000 0.944 1.000 0.000
#> GSM241485 1 0.0000 0.944 1.000 0.000
#> GSM241486 2 0.3114 0.929 0.056 0.944
#> GSM241487 1 0.9552 0.437 0.624 0.376
#> GSM241488 1 0.0000 0.944 1.000 0.000
#> GSM241489 1 0.0000 0.944 1.000 0.000
#> GSM241490 1 0.0000 0.944 1.000 0.000
#> GSM241491 1 0.3431 0.899 0.936 0.064
#> GSM241492 1 0.0000 0.944 1.000 0.000
#> GSM241493 1 0.0000 0.944 1.000 0.000
#> GSM241494 1 0.0000 0.944 1.000 0.000
#> GSM241495 1 0.3114 0.906 0.944 0.056
#> GSM241496 1 0.0000 0.944 1.000 0.000
#> GSM241497 1 0.0000 0.944 1.000 0.000
#> GSM241498 1 0.0000 0.944 1.000 0.000
#> GSM241499 1 0.0000 0.944 1.000 0.000
#> GSM241500 2 0.0000 0.983 0.000 1.000
#> GSM241501 2 0.0000 0.983 0.000 1.000
#> GSM241502 2 0.0000 0.983 0.000 1.000
#> GSM241503 1 0.0000 0.944 1.000 0.000
#> GSM241504 1 0.0000 0.944 1.000 0.000
#> GSM241505 1 0.0000 0.944 1.000 0.000
#> GSM241506 2 0.0000 0.983 0.000 1.000
#> GSM241507 1 0.0000 0.944 1.000 0.000
#> GSM241508 2 0.0000 0.983 0.000 1.000
#> GSM241509 2 0.0000 0.983 0.000 1.000
#> GSM241510 2 0.0000 0.983 0.000 1.000
#> GSM241511 1 0.0000 0.944 1.000 0.000
#> GSM241512 1 0.4690 0.865 0.900 0.100
#> GSM241513 2 0.0000 0.983 0.000 1.000
#> GSM241514 1 0.7950 0.695 0.760 0.240
#> GSM241515 2 0.0000 0.983 0.000 1.000
#> GSM241516 1 0.9850 0.313 0.572 0.428
#> GSM241517 2 0.0000 0.983 0.000 1.000
#> GSM241518 2 0.0376 0.980 0.004 0.996
#> GSM241519 2 0.0000 0.983 0.000 1.000
#> GSM241520 1 0.9427 0.486 0.640 0.360
#> GSM241521 2 0.0000 0.983 0.000 1.000
#> GSM241522 1 0.0000 0.944 1.000 0.000
#> GSM241523 2 0.0000 0.983 0.000 1.000
#> GSM241524 1 0.0000 0.944 1.000 0.000
#> GSM241525 1 0.3114 0.904 0.944 0.056
#> GSM241526 2 0.0000 0.983 0.000 1.000
#> GSM241527 2 0.0376 0.980 0.004 0.996
#> GSM241528 2 0.0000 0.983 0.000 1.000
#> GSM241529 2 0.0000 0.983 0.000 1.000
#> GSM241530 1 0.9988 0.144 0.520 0.480
#> GSM241531 1 0.9129 0.545 0.672 0.328
#> GSM241532 2 0.0000 0.983 0.000 1.000
#> GSM241533 2 0.0000 0.983 0.000 1.000
#> GSM241534 2 0.0000 0.983 0.000 1.000
#> GSM241535 2 0.0000 0.983 0.000 1.000
#> GSM241536 1 0.1414 0.931 0.980 0.020
#> GSM241537 2 0.0000 0.983 0.000 1.000
#> GSM241538 2 0.0000 0.983 0.000 1.000
#> GSM241539 2 0.0000 0.983 0.000 1.000
#> GSM241540 2 0.0000 0.983 0.000 1.000
#> GSM241541 2 0.0000 0.983 0.000 1.000
#> GSM241542 2 0.0000 0.983 0.000 1.000
#> GSM241543 2 0.0000 0.983 0.000 1.000
#> GSM241544 2 0.0000 0.983 0.000 1.000
#> GSM241545 2 0.0000 0.983 0.000 1.000
#> GSM241546 2 0.2603 0.941 0.044 0.956
#> GSM241547 2 0.0000 0.983 0.000 1.000
#> GSM241548 2 0.0000 0.983 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241457 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241458 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241461 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241462 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241463 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241464 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241465 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241481 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241483 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241484 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241486 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241487 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241488 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241491 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241492 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241493 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241499 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241500 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241501 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241502 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241503 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241504 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241505 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241506 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241507 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241508 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241509 2 0.0000 0.986 0.000 1.000 0.000
#> GSM241510 2 0.4291 0.773 0.000 0.820 0.180
#> GSM241511 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241512 1 0.6204 0.271 0.576 0.000 0.424
#> GSM241513 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241514 3 0.0424 0.968 0.008 0.000 0.992
#> GSM241515 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241516 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241517 3 0.0424 0.968 0.000 0.008 0.992
#> GSM241518 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241519 3 0.5497 0.590 0.000 0.292 0.708
#> GSM241520 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241521 2 0.4974 0.684 0.000 0.764 0.236
#> GSM241522 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241523 3 0.5621 0.558 0.000 0.308 0.692
#> GSM241524 1 0.4002 0.805 0.840 0.000 0.160
#> GSM241525 1 0.3816 0.820 0.852 0.000 0.148
#> GSM241526 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241528 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241529 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241530 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241531 3 0.3192 0.856 0.112 0.000 0.888
#> GSM241532 3 0.0237 0.972 0.000 0.004 0.996
#> GSM241533 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241534 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241535 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241536 1 0.0000 0.978 1.000 0.000 0.000
#> GSM241537 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241544 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241545 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241546 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241547 3 0.0000 0.975 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.975 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0469 0.975 0.000 0.988 0.012 0.000
#> GSM241452 1 0.0188 0.960 0.996 0.000 0.004 0.000
#> GSM241453 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0921 0.971 0.000 0.972 0.028 0.000
#> GSM241456 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241457 2 0.0524 0.974 0.000 0.988 0.004 0.008
#> GSM241458 1 0.0188 0.959 0.996 0.000 0.004 0.000
#> GSM241459 2 0.0524 0.974 0.000 0.988 0.004 0.008
#> GSM241460 1 0.0188 0.959 0.996 0.000 0.004 0.000
#> GSM241461 2 0.0524 0.974 0.000 0.988 0.004 0.008
#> GSM241462 1 0.0657 0.950 0.984 0.004 0.012 0.000
#> GSM241463 2 0.1474 0.960 0.000 0.948 0.052 0.000
#> GSM241464 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241465 2 0.0469 0.975 0.000 0.988 0.012 0.000
#> GSM241466 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0188 0.960 0.996 0.000 0.004 0.000
#> GSM241470 2 0.1211 0.966 0.000 0.960 0.040 0.000
#> GSM241471 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0469 0.975 0.000 0.988 0.012 0.000
#> GSM241474 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0469 0.975 0.000 0.988 0.012 0.000
#> GSM241476 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.975 0.000 1.000 0.000 0.000
#> GSM241478 2 0.1557 0.957 0.000 0.944 0.056 0.000
#> GSM241479 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0524 0.974 0.000 0.988 0.004 0.008
#> GSM241482 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241483 2 0.0524 0.974 0.000 0.988 0.004 0.008
#> GSM241484 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241485 1 0.0469 0.953 0.988 0.000 0.012 0.000
#> GSM241486 2 0.0524 0.974 0.000 0.988 0.004 0.008
#> GSM241487 2 0.0921 0.971 0.000 0.972 0.028 0.000
#> GSM241488 2 0.1474 0.960 0.000 0.948 0.052 0.000
#> GSM241489 1 0.0188 0.960 0.996 0.000 0.004 0.000
#> GSM241490 1 0.0188 0.960 0.996 0.000 0.004 0.000
#> GSM241491 2 0.1474 0.960 0.000 0.948 0.052 0.000
#> GSM241492 1 0.0188 0.959 0.996 0.000 0.004 0.000
#> GSM241493 2 0.0817 0.972 0.000 0.976 0.024 0.000
#> GSM241494 1 0.0188 0.960 0.996 0.000 0.004 0.000
#> GSM241495 2 0.1302 0.964 0.000 0.956 0.044 0.000
#> GSM241496 2 0.2149 0.930 0.000 0.912 0.088 0.000
#> GSM241497 1 0.0188 0.960 0.996 0.000 0.004 0.000
#> GSM241498 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241500 2 0.0779 0.971 0.000 0.980 0.004 0.016
#> GSM241501 2 0.0524 0.974 0.000 0.988 0.004 0.008
#> GSM241502 2 0.0524 0.974 0.000 0.988 0.004 0.008
#> GSM241503 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241506 2 0.1398 0.956 0.000 0.956 0.004 0.040
#> GSM241507 1 0.0000 0.961 1.000 0.000 0.000 0.000
#> GSM241508 2 0.0779 0.971 0.000 0.980 0.004 0.016
#> GSM241509 2 0.2831 0.871 0.000 0.876 0.004 0.120
#> GSM241510 4 0.2216 0.866 0.000 0.092 0.000 0.908
#> GSM241511 1 0.0188 0.959 0.996 0.000 0.000 0.004
#> GSM241512 1 0.4998 0.037 0.512 0.000 0.000 0.488
#> GSM241513 3 0.0817 0.963 0.000 0.000 0.976 0.024
#> GSM241514 3 0.2943 0.887 0.076 0.000 0.892 0.032
#> GSM241515 3 0.3649 0.773 0.000 0.000 0.796 0.204
#> GSM241516 1 0.7253 0.250 0.520 0.000 0.172 0.308
#> GSM241517 3 0.1042 0.961 0.000 0.008 0.972 0.020
#> GSM241518 3 0.0707 0.964 0.000 0.000 0.980 0.020
#> GSM241519 3 0.1059 0.957 0.000 0.016 0.972 0.012
#> GSM241520 3 0.0592 0.963 0.000 0.000 0.984 0.016
#> GSM241521 3 0.0895 0.948 0.000 0.020 0.976 0.004
#> GSM241522 1 0.3873 0.693 0.772 0.000 0.228 0.000
#> GSM241523 3 0.0657 0.953 0.000 0.012 0.984 0.004
#> GSM241524 3 0.0895 0.951 0.020 0.000 0.976 0.004
#> GSM241525 4 0.4193 0.625 0.268 0.000 0.000 0.732
#> GSM241526 4 0.0336 0.952 0.000 0.000 0.008 0.992
#> GSM241527 4 0.0336 0.952 0.000 0.000 0.008 0.992
#> GSM241528 4 0.0336 0.952 0.000 0.000 0.008 0.992
#> GSM241529 4 0.0336 0.952 0.000 0.000 0.008 0.992
#> GSM241530 4 0.0804 0.946 0.012 0.000 0.008 0.980
#> GSM241531 4 0.1452 0.926 0.036 0.000 0.008 0.956
#> GSM241532 4 0.0188 0.948 0.000 0.004 0.000 0.996
#> GSM241533 4 0.0000 0.950 0.000 0.000 0.000 1.000
#> GSM241534 4 0.0000 0.950 0.000 0.000 0.000 1.000
#> GSM241535 4 0.0336 0.952 0.000 0.000 0.008 0.992
#> GSM241536 1 0.0336 0.956 0.992 0.000 0.000 0.008
#> GSM241537 4 0.0592 0.950 0.000 0.000 0.016 0.984
#> GSM241538 4 0.0592 0.950 0.000 0.000 0.016 0.984
#> GSM241539 4 0.0469 0.952 0.000 0.000 0.012 0.988
#> GSM241540 4 0.0592 0.950 0.000 0.000 0.016 0.984
#> GSM241541 4 0.2760 0.843 0.000 0.000 0.128 0.872
#> GSM241542 4 0.2149 0.889 0.000 0.000 0.088 0.912
#> GSM241543 3 0.0707 0.964 0.000 0.000 0.980 0.020
#> GSM241544 3 0.1211 0.956 0.000 0.000 0.960 0.040
#> GSM241545 3 0.0707 0.964 0.000 0.000 0.980 0.020
#> GSM241546 3 0.1637 0.942 0.000 0.000 0.940 0.060
#> GSM241547 3 0.0921 0.962 0.000 0.000 0.972 0.028
#> GSM241548 3 0.1389 0.951 0.000 0.000 0.952 0.048
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.4060 0.6391 0.000 0.640 0.000 0.000 0.360
#> GSM241452 1 0.0960 0.8514 0.972 0.004 0.008 0.000 0.016
#> GSM241453 2 0.4074 0.6329 0.000 0.636 0.000 0.000 0.364
#> GSM241454 1 0.0162 0.8554 0.996 0.004 0.000 0.000 0.000
#> GSM241455 2 0.0963 0.7997 0.000 0.964 0.000 0.000 0.036
#> GSM241456 1 0.0693 0.8553 0.980 0.008 0.000 0.000 0.012
#> GSM241457 5 0.1965 0.9330 0.000 0.096 0.000 0.000 0.904
#> GSM241458 1 0.3857 0.7032 0.688 0.312 0.000 0.000 0.000
#> GSM241459 5 0.1851 0.9341 0.000 0.088 0.000 0.000 0.912
#> GSM241460 1 0.3983 0.6747 0.660 0.340 0.000 0.000 0.000
#> GSM241461 5 0.1608 0.9254 0.000 0.072 0.000 0.000 0.928
#> GSM241462 1 0.4150 0.6093 0.612 0.388 0.000 0.000 0.000
#> GSM241463 2 0.0566 0.7586 0.012 0.984 0.000 0.000 0.004
#> GSM241464 1 0.3561 0.7397 0.740 0.260 0.000 0.000 0.000
#> GSM241465 2 0.3039 0.8055 0.000 0.808 0.000 0.000 0.192
#> GSM241466 1 0.0671 0.8532 0.980 0.004 0.000 0.000 0.016
#> GSM241467 1 0.0324 0.8555 0.992 0.004 0.000 0.000 0.004
#> GSM241468 2 0.3949 0.6868 0.000 0.668 0.000 0.000 0.332
#> GSM241469 1 0.1569 0.8445 0.944 0.004 0.008 0.000 0.044
#> GSM241470 2 0.3039 0.8062 0.000 0.808 0.000 0.000 0.192
#> GSM241471 2 0.4015 0.6604 0.000 0.652 0.000 0.000 0.348
#> GSM241472 1 0.0290 0.8558 0.992 0.008 0.000 0.000 0.000
#> GSM241473 2 0.2230 0.8176 0.000 0.884 0.000 0.000 0.116
#> GSM241474 1 0.3861 0.7237 0.712 0.284 0.000 0.000 0.004
#> GSM241475 2 0.2280 0.8190 0.000 0.880 0.000 0.000 0.120
#> GSM241476 1 0.0771 0.8528 0.976 0.004 0.000 0.000 0.020
#> GSM241477 2 0.3895 0.6967 0.000 0.680 0.000 0.000 0.320
#> GSM241478 2 0.0613 0.7796 0.004 0.984 0.004 0.000 0.008
#> GSM241479 1 0.1116 0.8497 0.964 0.004 0.004 0.000 0.028
#> GSM241480 1 0.0566 0.8551 0.984 0.004 0.000 0.000 0.012
#> GSM241481 5 0.1908 0.9348 0.000 0.092 0.000 0.000 0.908
#> GSM241482 1 0.3774 0.7174 0.704 0.296 0.000 0.000 0.000
#> GSM241483 5 0.1908 0.9348 0.000 0.092 0.000 0.000 0.908
#> GSM241484 1 0.2648 0.8113 0.848 0.152 0.000 0.000 0.000
#> GSM241485 1 0.4126 0.6217 0.620 0.380 0.000 0.000 0.000
#> GSM241486 5 0.1270 0.9090 0.000 0.052 0.000 0.000 0.948
#> GSM241487 2 0.3480 0.7706 0.000 0.752 0.000 0.000 0.248
#> GSM241488 2 0.1282 0.8018 0.004 0.952 0.000 0.000 0.044
#> GSM241489 1 0.0932 0.8565 0.972 0.020 0.004 0.000 0.004
#> GSM241490 1 0.1243 0.8481 0.960 0.004 0.008 0.000 0.028
#> GSM241491 2 0.1043 0.8028 0.000 0.960 0.000 0.000 0.040
#> GSM241492 1 0.3913 0.6909 0.676 0.324 0.000 0.000 0.000
#> GSM241493 2 0.1671 0.8141 0.000 0.924 0.000 0.000 0.076
#> GSM241494 1 0.0960 0.8514 0.972 0.004 0.008 0.000 0.016
#> GSM241495 2 0.3305 0.7888 0.000 0.776 0.000 0.000 0.224
#> GSM241496 2 0.1281 0.7962 0.000 0.956 0.012 0.000 0.032
#> GSM241497 1 0.1087 0.8525 0.968 0.008 0.008 0.000 0.016
#> GSM241498 1 0.0693 0.8548 0.980 0.008 0.000 0.000 0.012
#> GSM241499 1 0.1965 0.8357 0.904 0.096 0.000 0.000 0.000
#> GSM241500 5 0.1792 0.9329 0.000 0.084 0.000 0.000 0.916
#> GSM241501 5 0.2020 0.9299 0.000 0.100 0.000 0.000 0.900
#> GSM241502 5 0.1908 0.9348 0.000 0.092 0.000 0.000 0.908
#> GSM241503 1 0.0609 0.8547 0.980 0.020 0.000 0.000 0.000
#> GSM241504 1 0.0703 0.8546 0.976 0.024 0.000 0.000 0.000
#> GSM241505 1 0.0609 0.8547 0.980 0.020 0.000 0.000 0.000
#> GSM241506 5 0.2124 0.9312 0.000 0.096 0.000 0.004 0.900
#> GSM241507 1 0.0703 0.8543 0.976 0.024 0.000 0.000 0.000
#> GSM241508 5 0.2020 0.9299 0.000 0.100 0.000 0.000 0.900
#> GSM241509 5 0.1012 0.8675 0.000 0.012 0.000 0.020 0.968
#> GSM241510 5 0.4182 0.4523 0.000 0.004 0.000 0.352 0.644
#> GSM241511 1 0.2921 0.7907 0.856 0.020 0.000 0.124 0.000
#> GSM241512 4 0.4300 -0.0695 0.476 0.000 0.000 0.524 0.000
#> GSM241513 3 0.1012 0.9128 0.000 0.020 0.968 0.012 0.000
#> GSM241514 3 0.2670 0.8399 0.088 0.004 0.888 0.004 0.016
#> GSM241515 3 0.3579 0.8326 0.000 0.072 0.828 0.100 0.000
#> GSM241516 1 0.4854 0.4262 0.636 0.004 0.336 0.008 0.016
#> GSM241517 3 0.4547 0.3767 0.000 0.400 0.588 0.012 0.000
#> GSM241518 3 0.0566 0.9132 0.000 0.004 0.984 0.012 0.000
#> GSM241519 3 0.3336 0.7190 0.000 0.228 0.772 0.000 0.000
#> GSM241520 3 0.0324 0.9130 0.004 0.004 0.992 0.000 0.000
#> GSM241521 3 0.2852 0.7921 0.000 0.172 0.828 0.000 0.000
#> GSM241522 1 0.5271 0.2854 0.568 0.004 0.384 0.000 0.044
#> GSM241523 3 0.0794 0.9094 0.000 0.028 0.972 0.000 0.000
#> GSM241524 3 0.0771 0.9068 0.020 0.000 0.976 0.000 0.004
#> GSM241525 1 0.4587 0.3688 0.604 0.004 0.004 0.384 0.004
#> GSM241526 4 0.0000 0.9422 0.000 0.000 0.000 1.000 0.000
#> GSM241527 4 0.0000 0.9422 0.000 0.000 0.000 1.000 0.000
#> GSM241528 4 0.0609 0.9298 0.000 0.020 0.000 0.980 0.000
#> GSM241529 4 0.0000 0.9422 0.000 0.000 0.000 1.000 0.000
#> GSM241530 4 0.0671 0.9318 0.016 0.000 0.000 0.980 0.004
#> GSM241531 4 0.0290 0.9382 0.008 0.000 0.000 0.992 0.000
#> GSM241532 4 0.0510 0.9354 0.000 0.000 0.000 0.984 0.016
#> GSM241533 4 0.0290 0.9398 0.000 0.000 0.000 0.992 0.008
#> GSM241534 4 0.0609 0.9341 0.000 0.000 0.000 0.980 0.020
#> GSM241535 4 0.0000 0.9422 0.000 0.000 0.000 1.000 0.000
#> GSM241536 1 0.4555 0.5051 0.636 0.020 0.000 0.344 0.000
#> GSM241537 4 0.0000 0.9422 0.000 0.000 0.000 1.000 0.000
#> GSM241538 4 0.0000 0.9422 0.000 0.000 0.000 1.000 0.000
#> GSM241539 4 0.0000 0.9422 0.000 0.000 0.000 1.000 0.000
#> GSM241540 4 0.0000 0.9422 0.000 0.000 0.000 1.000 0.000
#> GSM241541 4 0.2179 0.8361 0.000 0.000 0.112 0.888 0.000
#> GSM241542 4 0.1732 0.8765 0.000 0.000 0.080 0.920 0.000
#> GSM241543 3 0.0451 0.9140 0.000 0.008 0.988 0.004 0.000
#> GSM241544 3 0.0510 0.9099 0.016 0.000 0.984 0.000 0.000
#> GSM241545 3 0.0451 0.9140 0.000 0.008 0.988 0.004 0.000
#> GSM241546 3 0.1173 0.9011 0.020 0.004 0.964 0.000 0.012
#> GSM241547 3 0.0807 0.9137 0.000 0.012 0.976 0.012 0.000
#> GSM241548 3 0.0404 0.9129 0.000 0.000 0.988 0.012 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.4288 0.63872 0.000 0.716 0.004 0.000 0.216 0.064
#> GSM241452 1 0.3103 0.50421 0.836 0.008 0.004 0.000 0.020 0.132
#> GSM241453 2 0.4085 0.62705 0.000 0.704 0.000 0.000 0.252 0.044
#> GSM241454 1 0.1814 0.46671 0.900 0.000 0.000 0.000 0.000 0.100
#> GSM241455 2 0.1124 0.78920 0.000 0.956 0.000 0.000 0.008 0.036
#> GSM241456 1 0.3626 0.50457 0.812 0.012 0.000 0.000 0.092 0.084
#> GSM241457 5 0.3959 0.85340 0.040 0.112 0.000 0.000 0.796 0.052
#> GSM241458 1 0.5983 0.00697 0.432 0.324 0.000 0.000 0.000 0.244
#> GSM241459 5 0.2169 0.90172 0.008 0.080 0.000 0.000 0.900 0.012
#> GSM241460 1 0.5917 0.00383 0.404 0.388 0.000 0.000 0.000 0.208
#> GSM241461 5 0.3231 0.88081 0.052 0.076 0.000 0.000 0.848 0.024
#> GSM241462 2 0.5883 -0.17659 0.360 0.436 0.000 0.000 0.000 0.204
#> GSM241463 2 0.1802 0.78437 0.000 0.916 0.000 0.000 0.012 0.072
#> GSM241464 1 0.6331 0.30429 0.544 0.180 0.000 0.000 0.056 0.220
#> GSM241465 2 0.2983 0.76781 0.000 0.832 0.000 0.000 0.136 0.032
#> GSM241466 1 0.1926 0.51239 0.912 0.000 0.000 0.000 0.020 0.068
#> GSM241467 1 0.2282 0.52230 0.888 0.000 0.000 0.000 0.024 0.088
#> GSM241468 2 0.5649 0.65043 0.036 0.620 0.000 0.000 0.212 0.132
#> GSM241469 1 0.4298 0.45526 0.740 0.000 0.004 0.000 0.116 0.140
#> GSM241470 2 0.1888 0.78662 0.000 0.916 0.004 0.000 0.068 0.012
#> GSM241471 2 0.3950 0.67064 0.000 0.720 0.000 0.000 0.240 0.040
#> GSM241472 1 0.3381 0.51136 0.828 0.024 0.000 0.000 0.032 0.116
#> GSM241473 2 0.3752 0.76187 0.008 0.796 0.000 0.000 0.080 0.116
#> GSM241474 1 0.6289 0.28532 0.572 0.176 0.000 0.000 0.076 0.176
#> GSM241475 2 0.3022 0.78516 0.016 0.864 0.004 0.000 0.044 0.072
#> GSM241476 1 0.3250 0.51643 0.840 0.004 0.004 0.000 0.076 0.076
#> GSM241477 2 0.3014 0.72436 0.000 0.804 0.000 0.000 0.184 0.012
#> GSM241478 2 0.1555 0.78384 0.012 0.940 0.008 0.000 0.000 0.040
#> GSM241479 1 0.2968 0.51040 0.852 0.000 0.004 0.000 0.052 0.092
#> GSM241480 1 0.1501 0.48238 0.924 0.000 0.000 0.000 0.000 0.076
#> GSM241481 5 0.3469 0.87801 0.032 0.104 0.000 0.000 0.828 0.036
#> GSM241482 1 0.5987 0.01109 0.436 0.312 0.000 0.000 0.000 0.252
#> GSM241483 5 0.1908 0.89823 0.000 0.096 0.000 0.000 0.900 0.004
#> GSM241484 1 0.5691 0.05900 0.520 0.204 0.000 0.000 0.000 0.276
#> GSM241485 2 0.5878 -0.16565 0.356 0.440 0.000 0.000 0.000 0.204
#> GSM241486 5 0.2475 0.89239 0.036 0.060 0.000 0.000 0.892 0.012
#> GSM241487 2 0.2826 0.77260 0.000 0.856 0.008 0.000 0.112 0.024
#> GSM241488 2 0.2957 0.75839 0.028 0.868 0.008 0.000 0.016 0.080
#> GSM241489 1 0.4656 0.48408 0.740 0.048 0.004 0.000 0.052 0.156
#> GSM241490 1 0.2747 0.51002 0.860 0.000 0.004 0.000 0.028 0.108
#> GSM241491 2 0.3023 0.76109 0.000 0.836 0.000 0.000 0.044 0.120
#> GSM241492 1 0.6625 0.20270 0.468 0.256 0.000 0.000 0.048 0.228
#> GSM241493 2 0.1829 0.79275 0.008 0.928 0.000 0.000 0.028 0.036
#> GSM241494 1 0.1788 0.51666 0.916 0.000 0.004 0.000 0.004 0.076
#> GSM241495 2 0.3497 0.76121 0.000 0.832 0.036 0.000 0.084 0.048
#> GSM241496 2 0.2586 0.78244 0.016 0.892 0.016 0.000 0.012 0.064
#> GSM241497 1 0.2940 0.51236 0.856 0.012 0.004 0.000 0.020 0.108
#> GSM241498 1 0.2620 0.51813 0.884 0.012 0.004 0.000 0.024 0.076
#> GSM241499 1 0.5366 0.08897 0.568 0.148 0.000 0.000 0.000 0.284
#> GSM241500 5 0.2314 0.90187 0.008 0.072 0.000 0.012 0.900 0.008
#> GSM241501 5 0.2275 0.89960 0.008 0.096 0.000 0.000 0.888 0.008
#> GSM241502 5 0.3192 0.89052 0.000 0.088 0.000 0.024 0.848 0.040
#> GSM241503 1 0.3936 0.21643 0.688 0.024 0.000 0.000 0.000 0.288
#> GSM241504 1 0.4883 -0.06211 0.588 0.016 0.000 0.040 0.000 0.356
#> GSM241505 1 0.4291 0.03541 0.620 0.008 0.000 0.016 0.000 0.356
#> GSM241506 5 0.4580 0.82683 0.004 0.080 0.000 0.068 0.764 0.084
#> GSM241507 1 0.4186 0.19020 0.656 0.032 0.000 0.000 0.000 0.312
#> GSM241508 5 0.2361 0.89543 0.000 0.088 0.000 0.000 0.884 0.028
#> GSM241509 5 0.2294 0.81076 0.000 0.000 0.000 0.072 0.892 0.036
#> GSM241510 5 0.3947 0.64450 0.000 0.004 0.000 0.228 0.732 0.036
#> GSM241511 1 0.6251 -0.31649 0.532 0.052 0.000 0.140 0.000 0.276
#> GSM241512 4 0.6783 -0.67804 0.268 0.044 0.000 0.400 0.000 0.288
#> GSM241513 3 0.1268 0.83950 0.000 0.008 0.952 0.004 0.000 0.036
#> GSM241514 3 0.3416 0.74766 0.140 0.000 0.804 0.000 0.000 0.056
#> GSM241515 3 0.5628 0.68857 0.000 0.116 0.672 0.092 0.004 0.116
#> GSM241516 3 0.7101 0.00394 0.328 0.000 0.368 0.064 0.004 0.236
#> GSM241517 3 0.3522 0.76023 0.000 0.172 0.784 0.000 0.000 0.044
#> GSM241518 3 0.2956 0.81039 0.052 0.004 0.860 0.000 0.004 0.080
#> GSM241519 3 0.3686 0.71084 0.000 0.220 0.748 0.000 0.000 0.032
#> GSM241520 3 0.0972 0.84367 0.008 0.000 0.964 0.000 0.000 0.028
#> GSM241521 3 0.3892 0.71058 0.000 0.212 0.740 0.000 0.000 0.048
#> GSM241522 1 0.5841 0.11945 0.532 0.000 0.200 0.000 0.008 0.260
#> GSM241523 3 0.3481 0.76594 0.000 0.160 0.792 0.000 0.000 0.048
#> GSM241524 3 0.2563 0.81838 0.052 0.000 0.876 0.000 0.000 0.072
#> GSM241525 1 0.5898 -0.37876 0.416 0.000 0.000 0.380 0.000 0.204
#> GSM241526 4 0.1700 0.73045 0.000 0.004 0.000 0.916 0.000 0.080
#> GSM241527 4 0.1910 0.72325 0.000 0.000 0.000 0.892 0.000 0.108
#> GSM241528 4 0.3649 0.66020 0.000 0.112 0.000 0.800 0.004 0.084
#> GSM241529 4 0.2485 0.72361 0.000 0.024 0.000 0.884 0.008 0.084
#> GSM241530 4 0.3235 0.67187 0.052 0.000 0.000 0.820 0.000 0.128
#> GSM241531 4 0.3042 0.67328 0.032 0.000 0.000 0.836 0.004 0.128
#> GSM241532 4 0.3602 0.64717 0.000 0.000 0.000 0.784 0.160 0.056
#> GSM241533 4 0.1863 0.73520 0.000 0.000 0.000 0.920 0.044 0.036
#> GSM241534 4 0.3864 0.60624 0.000 0.000 0.000 0.744 0.208 0.048
#> GSM241535 4 0.1075 0.73719 0.000 0.000 0.000 0.952 0.000 0.048
#> GSM241536 6 0.6606 0.00000 0.328 0.024 0.000 0.300 0.000 0.348
#> GSM241537 4 0.2196 0.72965 0.000 0.000 0.004 0.884 0.004 0.108
#> GSM241538 4 0.3065 0.71301 0.000 0.000 0.052 0.844 0.004 0.100
#> GSM241539 4 0.2053 0.73030 0.000 0.000 0.000 0.888 0.004 0.108
#> GSM241540 4 0.4010 0.69170 0.016 0.000 0.052 0.780 0.004 0.148
#> GSM241541 4 0.4770 0.55509 0.000 0.000 0.224 0.672 0.004 0.100
#> GSM241542 4 0.4844 0.56756 0.000 0.000 0.204 0.672 0.004 0.120
#> GSM241543 3 0.1003 0.84264 0.000 0.016 0.964 0.000 0.000 0.020
#> GSM241544 3 0.0972 0.84332 0.008 0.000 0.964 0.000 0.000 0.028
#> GSM241545 3 0.1003 0.84264 0.000 0.016 0.964 0.000 0.000 0.020
#> GSM241546 3 0.1713 0.83744 0.028 0.000 0.928 0.000 0.000 0.044
#> GSM241547 3 0.1116 0.84239 0.000 0.008 0.960 0.004 0.000 0.028
#> GSM241548 3 0.1010 0.83984 0.004 0.000 0.960 0.000 0.000 0.036
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> SD:NMF 93 1.10e-10 8.26e-01 2
#> SD:NMF 97 1.47e-11 3.18e-01 3
#> SD:NMF 96 4.30e-15 7.01e-04 4
#> SD:NMF 92 7.04e-16 1.61e-06 5
#> SD:NMF 74 1.20e-15 1.90e-07 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.917 0.956 0.978 0.4863 0.508 0.508
#> 3 3 0.747 0.818 0.852 0.1555 0.969 0.939
#> 4 4 0.673 0.833 0.865 0.1383 0.928 0.849
#> 5 5 0.700 0.721 0.838 0.1300 0.918 0.796
#> 6 6 0.712 0.734 0.825 0.0213 0.972 0.915
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
#> GSM241451 1 0.0000 0.990 1.000 0.000
#> GSM241452 1 0.0000 0.990 1.000 0.000
#> GSM241453 1 0.0000 0.990 1.000 0.000
#> GSM241454 1 0.0000 0.990 1.000 0.000
#> GSM241455 1 0.0000 0.990 1.000 0.000
#> GSM241456 1 0.0000 0.990 1.000 0.000
#> GSM241457 1 0.0000 0.990 1.000 0.000
#> GSM241458 1 0.0000 0.990 1.000 0.000
#> GSM241459 1 0.0000 0.990 1.000 0.000
#> GSM241460 1 0.0000 0.990 1.000 0.000
#> GSM241461 1 0.0000 0.990 1.000 0.000
#> GSM241462 1 0.0000 0.990 1.000 0.000
#> GSM241463 1 0.0000 0.990 1.000 0.000
#> GSM241464 1 0.0000 0.990 1.000 0.000
#> GSM241465 1 0.0000 0.990 1.000 0.000
#> GSM241466 1 0.0000 0.990 1.000 0.000
#> GSM241467 1 0.0000 0.990 1.000 0.000
#> GSM241468 1 0.0000 0.990 1.000 0.000
#> GSM241469 1 0.0000 0.990 1.000 0.000
#> GSM241470 1 0.0000 0.990 1.000 0.000
#> GSM241471 1 0.0000 0.990 1.000 0.000
#> GSM241472 1 0.0000 0.990 1.000 0.000
#> GSM241473 1 0.0000 0.990 1.000 0.000
#> GSM241474 1 0.0000 0.990 1.000 0.000
#> GSM241475 1 0.0000 0.990 1.000 0.000
#> GSM241476 1 0.0000 0.990 1.000 0.000
#> GSM241477 1 0.0000 0.990 1.000 0.000
#> GSM241478 1 0.0000 0.990 1.000 0.000
#> GSM241479 1 0.0000 0.990 1.000 0.000
#> GSM241480 1 0.0000 0.990 1.000 0.000
#> GSM241481 1 0.0000 0.990 1.000 0.000
#> GSM241482 1 0.0000 0.990 1.000 0.000
#> GSM241483 1 0.0376 0.987 0.996 0.004
#> GSM241484 1 0.0000 0.990 1.000 0.000
#> GSM241485 1 0.0000 0.990 1.000 0.000
#> GSM241486 1 0.0000 0.990 1.000 0.000
#> GSM241487 1 0.0000 0.990 1.000 0.000
#> GSM241488 1 0.0938 0.982 0.988 0.012
#> GSM241489 1 0.0000 0.990 1.000 0.000
#> GSM241490 1 0.0000 0.990 1.000 0.000
#> GSM241491 1 0.0000 0.990 1.000 0.000
#> GSM241492 1 0.0000 0.990 1.000 0.000
#> GSM241493 1 0.0000 0.990 1.000 0.000
#> GSM241494 1 0.0000 0.990 1.000 0.000
#> GSM241495 1 0.0000 0.990 1.000 0.000
#> GSM241496 1 0.0938 0.982 0.988 0.012
#> GSM241497 1 0.0938 0.982 0.988 0.012
#> GSM241498 1 0.0000 0.990 1.000 0.000
#> GSM241499 1 0.2778 0.949 0.952 0.048
#> GSM241500 1 0.0938 0.982 0.988 0.012
#> GSM241501 1 0.0938 0.982 0.988 0.012
#> GSM241502 1 0.0938 0.982 0.988 0.012
#> GSM241503 1 0.2778 0.949 0.952 0.048
#> GSM241504 1 0.2778 0.949 0.952 0.048
#> GSM241505 1 0.2778 0.949 0.952 0.048
#> GSM241506 1 0.0938 0.982 0.988 0.012
#> GSM241507 2 0.7883 0.726 0.236 0.764
#> GSM241508 1 0.8207 0.635 0.744 0.256
#> GSM241509 2 0.0376 0.957 0.004 0.996
#> GSM241510 2 0.9000 0.573 0.316 0.684
#> GSM241511 2 0.7883 0.726 0.236 0.764
#> GSM241512 2 0.0376 0.957 0.004 0.996
#> GSM241513 2 0.2948 0.934 0.052 0.948
#> GSM241514 2 0.2948 0.934 0.052 0.948
#> GSM241515 2 0.2948 0.934 0.052 0.948
#> GSM241516 2 0.2948 0.934 0.052 0.948
#> GSM241517 2 0.0672 0.956 0.008 0.992
#> GSM241518 2 0.0672 0.956 0.008 0.992
#> GSM241519 2 0.0000 0.958 0.000 1.000
#> GSM241520 2 0.0000 0.958 0.000 1.000
#> GSM241521 2 0.4815 0.893 0.104 0.896
#> GSM241522 2 0.4815 0.893 0.104 0.896
#> GSM241523 2 0.2423 0.941 0.040 0.960
#> GSM241524 2 0.2423 0.941 0.040 0.960
#> GSM241525 2 0.0000 0.958 0.000 1.000
#> GSM241526 2 0.0000 0.958 0.000 1.000
#> GSM241527 2 0.0000 0.958 0.000 1.000
#> GSM241528 2 0.0000 0.958 0.000 1.000
#> GSM241529 2 0.0000 0.958 0.000 1.000
#> GSM241530 2 0.0000 0.958 0.000 1.000
#> GSM241531 2 0.6438 0.822 0.164 0.836
#> GSM241532 2 0.0938 0.954 0.012 0.988
#> GSM241533 2 0.0000 0.958 0.000 1.000
#> GSM241534 2 0.0000 0.958 0.000 1.000
#> GSM241535 2 0.0000 0.958 0.000 1.000
#> GSM241536 2 0.6438 0.822 0.164 0.836
#> GSM241537 2 0.0000 0.958 0.000 1.000
#> GSM241538 2 0.0000 0.958 0.000 1.000
#> GSM241539 2 0.0000 0.958 0.000 1.000
#> GSM241540 2 0.0000 0.958 0.000 1.000
#> GSM241541 2 0.0000 0.958 0.000 1.000
#> GSM241542 2 0.0000 0.958 0.000 1.000
#> GSM241543 2 0.0000 0.958 0.000 1.000
#> GSM241544 2 0.0000 0.958 0.000 1.000
#> GSM241545 2 0.0000 0.958 0.000 1.000
#> GSM241546 2 0.0000 0.958 0.000 1.000
#> GSM241547 2 0.0000 0.958 0.000 1.000
#> GSM241548 2 0.0000 0.958 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241452 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241453 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241454 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241455 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241456 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241457 2 0.2448 0.904 0.076 0.924 0.000
#> GSM241458 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241459 2 0.2448 0.904 0.076 0.924 0.000
#> GSM241460 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241461 2 0.3267 0.875 0.116 0.884 0.000
#> GSM241462 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241463 2 0.0237 0.933 0.004 0.996 0.000
#> GSM241464 2 0.0237 0.933 0.004 0.996 0.000
#> GSM241465 2 0.2165 0.911 0.064 0.936 0.000
#> GSM241466 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241467 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241468 2 0.2711 0.898 0.088 0.912 0.000
#> GSM241469 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241470 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241471 2 0.2448 0.904 0.076 0.924 0.000
#> GSM241472 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241473 2 0.2448 0.904 0.076 0.924 0.000
#> GSM241474 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241475 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241476 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241477 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241478 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241479 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241480 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241481 2 0.2448 0.904 0.076 0.924 0.000
#> GSM241482 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241483 2 0.1289 0.930 0.032 0.968 0.000
#> GSM241484 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241485 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241486 2 0.3267 0.875 0.116 0.884 0.000
#> GSM241487 2 0.2165 0.911 0.064 0.936 0.000
#> GSM241488 2 0.1031 0.931 0.024 0.976 0.000
#> GSM241489 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241490 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241491 2 0.0237 0.933 0.004 0.996 0.000
#> GSM241492 2 0.0237 0.933 0.004 0.996 0.000
#> GSM241493 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241494 2 0.1964 0.932 0.056 0.944 0.000
#> GSM241495 2 0.1411 0.928 0.036 0.964 0.000
#> GSM241496 2 0.1031 0.931 0.024 0.976 0.000
#> GSM241497 2 0.2165 0.927 0.064 0.936 0.000
#> GSM241498 2 0.1860 0.932 0.052 0.948 0.000
#> GSM241499 2 0.2959 0.903 0.100 0.900 0.000
#> GSM241500 2 0.2537 0.907 0.080 0.920 0.000
#> GSM241501 2 0.2537 0.907 0.080 0.920 0.000
#> GSM241502 2 0.2165 0.914 0.064 0.936 0.000
#> GSM241503 2 0.2959 0.903 0.100 0.900 0.000
#> GSM241504 2 0.2959 0.903 0.100 0.900 0.000
#> GSM241505 2 0.2959 0.903 0.100 0.900 0.000
#> GSM241506 2 0.2537 0.907 0.080 0.920 0.000
#> GSM241507 1 0.9042 0.907 0.544 0.176 0.280
#> GSM241508 2 0.8265 0.422 0.180 0.636 0.184
#> GSM241509 3 0.1289 0.710 0.032 0.000 0.968
#> GSM241510 3 0.9187 -0.423 0.196 0.272 0.532
#> GSM241511 1 0.9042 0.907 0.544 0.176 0.280
#> GSM241512 3 0.1289 0.710 0.032 0.000 0.968
#> GSM241513 3 0.7442 0.691 0.348 0.048 0.604
#> GSM241514 3 0.7442 0.691 0.348 0.048 0.604
#> GSM241515 3 0.7442 0.691 0.348 0.048 0.604
#> GSM241516 3 0.7442 0.691 0.348 0.048 0.604
#> GSM241517 3 0.6033 0.726 0.336 0.004 0.660
#> GSM241518 3 0.6033 0.726 0.336 0.004 0.660
#> GSM241519 3 0.5760 0.730 0.328 0.000 0.672
#> GSM241520 3 0.5760 0.730 0.328 0.000 0.672
#> GSM241521 3 0.8408 0.618 0.344 0.100 0.556
#> GSM241522 3 0.8408 0.618 0.344 0.100 0.556
#> GSM241523 3 0.7128 0.703 0.344 0.036 0.620
#> GSM241524 3 0.7128 0.703 0.344 0.036 0.620
#> GSM241525 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241526 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241528 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241529 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241530 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241531 1 0.8470 0.902 0.552 0.104 0.344
#> GSM241532 3 0.4784 0.380 0.200 0.004 0.796
#> GSM241533 3 0.3482 0.540 0.128 0.000 0.872
#> GSM241534 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241535 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241536 1 0.8470 0.902 0.552 0.104 0.344
#> GSM241537 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.705 0.000 0.000 1.000
#> GSM241543 3 0.5760 0.730 0.328 0.000 0.672
#> GSM241544 3 0.5760 0.730 0.328 0.000 0.672
#> GSM241545 3 0.5760 0.730 0.328 0.000 0.672
#> GSM241546 3 0.5760 0.730 0.328 0.000 0.672
#> GSM241547 3 0.5760 0.730 0.328 0.000 0.672
#> GSM241548 3 0.5760 0.730 0.328 0.000 0.672
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241452 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241453 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241454 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241455 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241456 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241457 2 0.2281 0.816 0.096 0.904 0.000 0.000
#> GSM241458 2 0.2281 0.839 0.096 0.904 0.000 0.000
#> GSM241459 2 0.2281 0.816 0.096 0.904 0.000 0.000
#> GSM241460 2 0.2281 0.839 0.096 0.904 0.000 0.000
#> GSM241461 2 0.5252 0.634 0.336 0.644 0.020 0.000
#> GSM241462 2 0.2281 0.839 0.096 0.904 0.000 0.000
#> GSM241463 2 0.0188 0.843 0.004 0.996 0.000 0.000
#> GSM241464 2 0.0188 0.843 0.004 0.996 0.000 0.000
#> GSM241465 2 0.1940 0.824 0.076 0.924 0.000 0.000
#> GSM241466 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241467 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241468 2 0.3688 0.768 0.208 0.792 0.000 0.000
#> GSM241469 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241470 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241471 2 0.2345 0.815 0.100 0.900 0.000 0.000
#> GSM241472 2 0.2281 0.839 0.096 0.904 0.000 0.000
#> GSM241473 2 0.2345 0.815 0.100 0.900 0.000 0.000
#> GSM241474 2 0.2281 0.839 0.096 0.904 0.000 0.000
#> GSM241475 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241476 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241477 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241478 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241479 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241480 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241481 2 0.2281 0.816 0.096 0.904 0.000 0.000
#> GSM241482 2 0.2281 0.839 0.096 0.904 0.000 0.000
#> GSM241483 2 0.4095 0.781 0.192 0.792 0.016 0.000
#> GSM241484 2 0.2408 0.840 0.104 0.896 0.000 0.000
#> GSM241485 2 0.2281 0.839 0.096 0.904 0.000 0.000
#> GSM241486 2 0.5252 0.634 0.336 0.644 0.020 0.000
#> GSM241487 2 0.1940 0.824 0.076 0.924 0.000 0.000
#> GSM241488 2 0.3763 0.802 0.144 0.832 0.024 0.000
#> GSM241489 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241490 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241491 2 0.0188 0.843 0.004 0.996 0.000 0.000
#> GSM241492 2 0.0188 0.843 0.004 0.996 0.000 0.000
#> GSM241493 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241494 2 0.2408 0.840 0.104 0.896 0.000 0.000
#> GSM241495 2 0.2814 0.808 0.132 0.868 0.000 0.000
#> GSM241496 2 0.3763 0.802 0.144 0.832 0.024 0.000
#> GSM241497 2 0.3552 0.829 0.128 0.848 0.024 0.000
#> GSM241498 2 0.2704 0.839 0.124 0.876 0.000 0.000
#> GSM241499 2 0.4004 0.806 0.164 0.812 0.024 0.000
#> GSM241500 2 0.4993 0.706 0.260 0.712 0.028 0.000
#> GSM241501 2 0.4993 0.706 0.260 0.712 0.028 0.000
#> GSM241502 2 0.4775 0.729 0.232 0.740 0.028 0.000
#> GSM241503 2 0.4004 0.806 0.164 0.812 0.024 0.000
#> GSM241504 2 0.4004 0.806 0.164 0.812 0.024 0.000
#> GSM241505 2 0.4004 0.806 0.164 0.812 0.024 0.000
#> GSM241506 2 0.4993 0.706 0.260 0.712 0.028 0.000
#> GSM241507 1 0.7097 0.902 0.596 0.168 0.008 0.228
#> GSM241508 2 0.7705 0.323 0.248 0.536 0.016 0.200
#> GSM241509 4 0.3024 0.841 0.000 0.000 0.148 0.852
#> GSM241510 4 0.7154 -0.188 0.160 0.248 0.008 0.584
#> GSM241511 1 0.7097 0.902 0.596 0.168 0.008 0.228
#> GSM241512 4 0.3024 0.841 0.000 0.000 0.148 0.852
#> GSM241513 3 0.1843 0.932 0.016 0.028 0.948 0.008
#> GSM241514 3 0.1843 0.932 0.016 0.028 0.948 0.008
#> GSM241515 3 0.1843 0.932 0.016 0.028 0.948 0.008
#> GSM241516 3 0.1843 0.932 0.016 0.028 0.948 0.008
#> GSM241517 3 0.1488 0.943 0.012 0.000 0.956 0.032
#> GSM241518 3 0.1488 0.943 0.012 0.000 0.956 0.032
#> GSM241519 3 0.0921 0.946 0.000 0.000 0.972 0.028
#> GSM241520 3 0.0921 0.946 0.000 0.000 0.972 0.028
#> GSM241521 3 0.2706 0.858 0.020 0.080 0.900 0.000
#> GSM241522 3 0.2706 0.858 0.020 0.080 0.900 0.000
#> GSM241523 3 0.1191 0.938 0.004 0.024 0.968 0.004
#> GSM241524 3 0.1191 0.938 0.004 0.024 0.968 0.004
#> GSM241525 4 0.1867 0.911 0.000 0.000 0.072 0.928
#> GSM241526 4 0.1867 0.911 0.000 0.000 0.072 0.928
#> GSM241527 4 0.1867 0.911 0.000 0.000 0.072 0.928
#> GSM241528 4 0.1867 0.911 0.000 0.000 0.072 0.928
#> GSM241529 4 0.1867 0.911 0.000 0.000 0.072 0.928
#> GSM241530 4 0.1867 0.911 0.000 0.000 0.072 0.928
#> GSM241531 1 0.6764 0.893 0.596 0.100 0.008 0.296
#> GSM241532 4 0.3142 0.649 0.132 0.000 0.008 0.860
#> GSM241533 4 0.2773 0.762 0.072 0.000 0.028 0.900
#> GSM241534 4 0.1867 0.911 0.000 0.000 0.072 0.928
#> GSM241535 4 0.1867 0.911 0.000 0.000 0.072 0.928
#> GSM241536 1 0.6764 0.893 0.596 0.100 0.008 0.296
#> GSM241537 4 0.2596 0.907 0.024 0.000 0.068 0.908
#> GSM241538 4 0.2596 0.907 0.024 0.000 0.068 0.908
#> GSM241539 4 0.2596 0.907 0.024 0.000 0.068 0.908
#> GSM241540 4 0.2596 0.907 0.024 0.000 0.068 0.908
#> GSM241541 4 0.2596 0.907 0.024 0.000 0.068 0.908
#> GSM241542 4 0.2596 0.907 0.024 0.000 0.068 0.908
#> GSM241543 3 0.1022 0.946 0.000 0.000 0.968 0.032
#> GSM241544 3 0.1022 0.946 0.000 0.000 0.968 0.032
#> GSM241545 3 0.1022 0.946 0.000 0.000 0.968 0.032
#> GSM241546 3 0.1022 0.946 0.000 0.000 0.968 0.032
#> GSM241547 3 0.1022 0.946 0.000 0.000 0.968 0.032
#> GSM241548 3 0.1022 0.946 0.000 0.000 0.968 0.032
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 1 0.4227 0.586 0.580 0.000 0.000 0.000 0.420
#> GSM241452 1 0.0609 0.637 0.980 0.000 0.000 0.000 0.020
#> GSM241453 1 0.4227 0.586 0.580 0.000 0.000 0.000 0.420
#> GSM241454 1 0.0000 0.643 1.000 0.000 0.000 0.000 0.000
#> GSM241455 1 0.4227 0.588 0.580 0.000 0.000 0.000 0.420
#> GSM241456 1 0.0609 0.637 0.980 0.000 0.000 0.000 0.020
#> GSM241457 1 0.4297 0.574 0.528 0.000 0.000 0.000 0.472
#> GSM241458 1 0.3480 0.684 0.752 0.000 0.000 0.000 0.248
#> GSM241459 1 0.4297 0.574 0.528 0.000 0.000 0.000 0.472
#> GSM241460 1 0.3480 0.684 0.752 0.000 0.000 0.000 0.248
#> GSM241461 5 0.3480 0.777 0.248 0.000 0.000 0.000 0.752
#> GSM241462 1 0.3480 0.684 0.752 0.000 0.000 0.000 0.248
#> GSM241463 1 0.3983 0.674 0.660 0.000 0.000 0.000 0.340
#> GSM241464 1 0.3983 0.674 0.660 0.000 0.000 0.000 0.340
#> GSM241465 1 0.4242 0.628 0.572 0.000 0.000 0.000 0.428
#> GSM241466 1 0.0000 0.643 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0162 0.644 0.996 0.000 0.000 0.000 0.004
#> GSM241468 1 0.4210 0.407 0.588 0.000 0.000 0.000 0.412
#> GSM241469 1 0.0609 0.637 0.980 0.000 0.000 0.000 0.020
#> GSM241470 1 0.4227 0.586 0.580 0.000 0.000 0.000 0.420
#> GSM241471 1 0.4300 0.570 0.524 0.000 0.000 0.000 0.476
#> GSM241472 1 0.3336 0.690 0.772 0.000 0.000 0.000 0.228
#> GSM241473 1 0.4300 0.570 0.524 0.000 0.000 0.000 0.476
#> GSM241474 1 0.3336 0.690 0.772 0.000 0.000 0.000 0.228
#> GSM241475 1 0.4227 0.586 0.580 0.000 0.000 0.000 0.420
#> GSM241476 1 0.0609 0.637 0.980 0.000 0.000 0.000 0.020
#> GSM241477 1 0.4227 0.586 0.580 0.000 0.000 0.000 0.420
#> GSM241478 1 0.4227 0.588 0.580 0.000 0.000 0.000 0.420
#> GSM241479 1 0.0609 0.637 0.980 0.000 0.000 0.000 0.020
#> GSM241480 1 0.0000 0.643 1.000 0.000 0.000 0.000 0.000
#> GSM241481 1 0.4297 0.574 0.528 0.000 0.000 0.000 0.472
#> GSM241482 1 0.3480 0.684 0.752 0.000 0.000 0.000 0.248
#> GSM241483 5 0.4449 0.390 0.484 0.004 0.000 0.000 0.512
#> GSM241484 1 0.2280 0.678 0.880 0.000 0.000 0.000 0.120
#> GSM241485 1 0.3480 0.684 0.752 0.000 0.000 0.000 0.248
#> GSM241486 5 0.3480 0.777 0.248 0.000 0.000 0.000 0.752
#> GSM241487 1 0.4242 0.628 0.572 0.000 0.000 0.000 0.428
#> GSM241488 1 0.4016 0.327 0.716 0.012 0.000 0.000 0.272
#> GSM241489 1 0.0609 0.641 0.980 0.000 0.000 0.000 0.020
#> GSM241490 1 0.0404 0.641 0.988 0.000 0.000 0.000 0.012
#> GSM241491 1 0.3983 0.674 0.660 0.000 0.000 0.000 0.340
#> GSM241492 1 0.3983 0.674 0.660 0.000 0.000 0.000 0.340
#> GSM241493 1 0.4227 0.586 0.580 0.000 0.000 0.000 0.420
#> GSM241494 1 0.2377 0.682 0.872 0.000 0.000 0.000 0.128
#> GSM241495 1 0.4227 0.586 0.580 0.000 0.000 0.000 0.420
#> GSM241496 1 0.4016 0.327 0.716 0.012 0.000 0.000 0.272
#> GSM241497 1 0.2006 0.557 0.916 0.012 0.000 0.000 0.072
#> GSM241498 1 0.0609 0.637 0.980 0.000 0.000 0.000 0.020
#> GSM241499 1 0.2654 0.521 0.888 0.048 0.000 0.000 0.064
#> GSM241500 5 0.4288 0.836 0.324 0.012 0.000 0.000 0.664
#> GSM241501 5 0.4288 0.836 0.324 0.012 0.000 0.000 0.664
#> GSM241502 5 0.4444 0.807 0.364 0.012 0.000 0.000 0.624
#> GSM241503 1 0.2654 0.521 0.888 0.048 0.000 0.000 0.064
#> GSM241504 1 0.2654 0.521 0.888 0.048 0.000 0.000 0.064
#> GSM241505 1 0.2654 0.521 0.888 0.048 0.000 0.000 0.064
#> GSM241506 5 0.4288 0.836 0.324 0.012 0.000 0.000 0.664
#> GSM241507 2 0.2249 0.911 0.096 0.896 0.000 0.000 0.008
#> GSM241508 5 0.7234 0.454 0.276 0.236 0.000 0.032 0.456
#> GSM241509 4 0.3073 0.832 0.000 0.052 0.076 0.868 0.004
#> GSM241510 4 0.8043 -0.139 0.196 0.344 0.000 0.352 0.108
#> GSM241511 2 0.2249 0.911 0.096 0.896 0.000 0.000 0.008
#> GSM241512 4 0.3073 0.832 0.000 0.052 0.076 0.868 0.004
#> GSM241513 3 0.2374 0.934 0.000 0.020 0.912 0.016 0.052
#> GSM241514 3 0.2374 0.934 0.000 0.020 0.912 0.016 0.052
#> GSM241515 3 0.2374 0.934 0.000 0.020 0.912 0.016 0.052
#> GSM241516 3 0.2374 0.934 0.000 0.020 0.912 0.016 0.052
#> GSM241517 3 0.1087 0.945 0.000 0.008 0.968 0.016 0.008
#> GSM241518 3 0.1087 0.945 0.000 0.008 0.968 0.016 0.008
#> GSM241519 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000
#> GSM241520 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000
#> GSM241521 3 0.3209 0.879 0.052 0.024 0.872 0.000 0.052
#> GSM241522 3 0.3209 0.879 0.052 0.024 0.872 0.000 0.052
#> GSM241523 3 0.1444 0.943 0.000 0.012 0.948 0.000 0.040
#> GSM241524 3 0.1444 0.943 0.000 0.012 0.948 0.000 0.040
#> GSM241525 4 0.2011 0.874 0.000 0.088 0.004 0.908 0.000
#> GSM241526 4 0.2011 0.874 0.000 0.088 0.004 0.908 0.000
#> GSM241527 4 0.2011 0.874 0.000 0.088 0.004 0.908 0.000
#> GSM241528 4 0.2011 0.874 0.000 0.088 0.004 0.908 0.000
#> GSM241529 4 0.2011 0.874 0.000 0.088 0.004 0.908 0.000
#> GSM241530 4 0.2011 0.874 0.000 0.088 0.004 0.908 0.000
#> GSM241531 2 0.0880 0.916 0.032 0.968 0.000 0.000 0.000
#> GSM241532 4 0.4235 0.446 0.000 0.424 0.000 0.576 0.000
#> GSM241533 4 0.3741 0.717 0.000 0.264 0.004 0.732 0.000
#> GSM241534 4 0.1892 0.874 0.000 0.080 0.004 0.916 0.000
#> GSM241535 4 0.1892 0.874 0.000 0.080 0.004 0.916 0.000
#> GSM241536 2 0.0880 0.916 0.032 0.968 0.000 0.000 0.000
#> GSM241537 4 0.0880 0.851 0.000 0.032 0.000 0.968 0.000
#> GSM241538 4 0.0880 0.851 0.000 0.032 0.000 0.968 0.000
#> GSM241539 4 0.0880 0.851 0.000 0.032 0.000 0.968 0.000
#> GSM241540 4 0.0880 0.851 0.000 0.032 0.000 0.968 0.000
#> GSM241541 4 0.0880 0.851 0.000 0.032 0.000 0.968 0.000
#> GSM241542 4 0.0880 0.851 0.000 0.032 0.000 0.968 0.000
#> GSM241543 3 0.0162 0.949 0.000 0.000 0.996 0.004 0.000
#> GSM241544 3 0.0162 0.949 0.000 0.000 0.996 0.004 0.000
#> GSM241545 3 0.0162 0.949 0.000 0.000 0.996 0.004 0.000
#> GSM241546 3 0.0162 0.949 0.000 0.000 0.996 0.004 0.000
#> GSM241547 3 0.0162 0.949 0.000 0.000 0.996 0.004 0.000
#> GSM241548 3 0.0162 0.949 0.000 0.000 0.996 0.004 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 1 0.3797 0.6015 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241452 1 0.0547 0.6477 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM241453 1 0.3797 0.6015 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241454 1 0.0000 0.6532 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 1 0.3797 0.6030 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241456 1 0.0547 0.6477 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM241457 1 0.3860 0.5846 0.528 0.000 0.000 0.000 0.472 0.000
#> GSM241458 1 0.3126 0.6891 0.752 0.000 0.000 0.000 0.248 0.000
#> GSM241459 1 0.3860 0.5846 0.528 0.000 0.000 0.000 0.472 0.000
#> GSM241460 1 0.3126 0.6891 0.752 0.000 0.000 0.000 0.248 0.000
#> GSM241461 5 0.3126 0.8231 0.248 0.000 0.000 0.000 0.752 0.000
#> GSM241462 1 0.3126 0.6891 0.752 0.000 0.000 0.000 0.248 0.000
#> GSM241463 1 0.3578 0.6802 0.660 0.000 0.000 0.000 0.340 0.000
#> GSM241464 1 0.3578 0.6802 0.660 0.000 0.000 0.000 0.340 0.000
#> GSM241465 1 0.3810 0.6366 0.572 0.000 0.000 0.000 0.428 0.000
#> GSM241466 1 0.0000 0.6532 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0146 0.6541 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM241468 1 0.3782 0.4435 0.588 0.000 0.000 0.000 0.412 0.000
#> GSM241469 1 0.0547 0.6477 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM241470 1 0.3797 0.6015 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241471 1 0.3862 0.5817 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM241472 1 0.2996 0.6949 0.772 0.000 0.000 0.000 0.228 0.000
#> GSM241473 1 0.3862 0.5817 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM241474 1 0.2996 0.6949 0.772 0.000 0.000 0.000 0.228 0.000
#> GSM241475 1 0.3797 0.6015 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241476 1 0.0547 0.6477 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM241477 1 0.3797 0.6015 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241478 1 0.3797 0.6030 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241479 1 0.0547 0.6477 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM241480 1 0.0000 0.6532 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 1 0.3860 0.5846 0.528 0.000 0.000 0.000 0.472 0.000
#> GSM241482 1 0.3126 0.6891 0.752 0.000 0.000 0.000 0.248 0.000
#> GSM241483 1 0.4757 -0.3561 0.484 0.048 0.000 0.000 0.468 0.000
#> GSM241484 1 0.2048 0.6856 0.880 0.000 0.000 0.000 0.120 0.000
#> GSM241485 1 0.3126 0.6891 0.752 0.000 0.000 0.000 0.248 0.000
#> GSM241486 5 0.3126 0.8231 0.248 0.000 0.000 0.000 0.752 0.000
#> GSM241487 1 0.3810 0.6366 0.572 0.000 0.000 0.000 0.428 0.000
#> GSM241488 1 0.4117 0.3970 0.716 0.056 0.000 0.000 0.228 0.000
#> GSM241489 1 0.0547 0.6513 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM241490 1 0.0363 0.6513 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM241491 1 0.3578 0.6802 0.660 0.000 0.000 0.000 0.340 0.000
#> GSM241492 1 0.3578 0.6802 0.660 0.000 0.000 0.000 0.340 0.000
#> GSM241493 1 0.3797 0.6015 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241494 1 0.2135 0.6888 0.872 0.000 0.000 0.000 0.128 0.000
#> GSM241495 1 0.3797 0.6015 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM241496 1 0.4117 0.3970 0.716 0.056 0.000 0.000 0.228 0.000
#> GSM241497 1 0.1908 0.5840 0.916 0.056 0.000 0.000 0.028 0.000
#> GSM241498 1 0.0547 0.6477 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM241499 1 0.2594 0.5507 0.888 0.056 0.000 0.000 0.020 0.036
#> GSM241500 5 0.3852 0.8701 0.324 0.012 0.000 0.000 0.664 0.000
#> GSM241501 5 0.3852 0.8701 0.324 0.012 0.000 0.000 0.664 0.000
#> GSM241502 5 0.4717 0.7956 0.364 0.056 0.000 0.000 0.580 0.000
#> GSM241503 1 0.2594 0.5507 0.888 0.056 0.000 0.000 0.020 0.036
#> GSM241504 1 0.2594 0.5507 0.888 0.056 0.000 0.000 0.020 0.036
#> GSM241505 1 0.2594 0.5507 0.888 0.056 0.000 0.000 0.020 0.036
#> GSM241506 5 0.3852 0.8701 0.324 0.012 0.000 0.000 0.664 0.000
#> GSM241507 6 0.1584 0.9038 0.064 0.000 0.000 0.000 0.008 0.928
#> GSM241508 5 0.6950 0.5268 0.276 0.000 0.000 0.104 0.456 0.164
#> GSM241509 4 0.2044 0.8233 0.000 0.004 0.076 0.908 0.004 0.008
#> GSM241510 4 0.7131 0.0495 0.196 0.000 0.000 0.424 0.108 0.272
#> GSM241511 6 0.1584 0.9038 0.064 0.000 0.000 0.000 0.008 0.928
#> GSM241512 4 0.2044 0.8233 0.000 0.004 0.076 0.908 0.004 0.008
#> GSM241513 3 0.2170 0.9281 0.000 0.056 0.912 0.016 0.008 0.008
#> GSM241514 3 0.2170 0.9281 0.000 0.056 0.912 0.016 0.008 0.008
#> GSM241515 3 0.2170 0.9281 0.000 0.056 0.912 0.016 0.008 0.008
#> GSM241516 3 0.2170 0.9281 0.000 0.056 0.912 0.016 0.008 0.008
#> GSM241517 3 0.0976 0.9381 0.000 0.000 0.968 0.016 0.008 0.008
#> GSM241518 3 0.0976 0.9381 0.000 0.000 0.968 0.016 0.008 0.008
#> GSM241519 3 0.0632 0.9416 0.000 0.000 0.976 0.000 0.000 0.024
#> GSM241520 3 0.0632 0.9416 0.000 0.000 0.976 0.000 0.000 0.024
#> GSM241521 3 0.2937 0.8759 0.052 0.056 0.872 0.000 0.008 0.012
#> GSM241522 3 0.2937 0.8759 0.052 0.056 0.872 0.000 0.008 0.012
#> GSM241523 3 0.1219 0.9370 0.000 0.048 0.948 0.000 0.004 0.000
#> GSM241524 3 0.1219 0.9370 0.000 0.048 0.948 0.000 0.004 0.000
#> GSM241525 4 0.0000 0.8806 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241526 4 0.0000 0.8806 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241527 4 0.0000 0.8806 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241528 4 0.0000 0.8806 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241529 4 0.0000 0.8806 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241530 4 0.0000 0.8806 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241531 6 0.0790 0.9030 0.000 0.000 0.000 0.032 0.000 0.968
#> GSM241532 4 0.3578 0.5135 0.000 0.000 0.000 0.660 0.000 0.340
#> GSM241533 4 0.2597 0.7412 0.000 0.000 0.000 0.824 0.000 0.176
#> GSM241534 4 0.0405 0.8773 0.000 0.004 0.000 0.988 0.000 0.008
#> GSM241535 4 0.0405 0.8773 0.000 0.004 0.000 0.988 0.000 0.008
#> GSM241536 6 0.0790 0.9030 0.000 0.000 0.000 0.032 0.000 0.968
#> GSM241537 2 0.1204 1.0000 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM241538 2 0.1204 1.0000 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM241539 2 0.1204 1.0000 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM241540 2 0.1204 1.0000 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM241541 2 0.1204 1.0000 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM241542 2 0.1204 1.0000 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM241543 3 0.0777 0.9412 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM241544 3 0.0777 0.9412 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM241545 3 0.0777 0.9412 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM241546 3 0.0777 0.9412 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM241547 3 0.0777 0.9412 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM241548 3 0.0777 0.9412 0.000 0.004 0.972 0.000 0.000 0.024
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> CV:hclust 98 6.50e-16 1.56e-01 2
#> CV:hclust 95 8.79e-14 2.04e-03 3
#> CV:hclust 96 7.53e-17 1.58e-06 4
#> CV:hclust 91 4.70e-16 1.90e-06 5
#> CV:hclust 93 1.06e-15 7.65e-10 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.989 0.996 0.4868 0.512 0.512
#> 3 3 0.671 0.595 0.747 0.2582 0.972 0.945
#> 4 4 0.675 0.790 0.791 0.1542 0.742 0.481
#> 5 5 0.655 0.812 0.803 0.0800 0.970 0.884
#> 6 6 0.707 0.762 0.793 0.0476 0.990 0.959
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
#> GSM241451 1 0.000 1.000 1.00 0.00
#> GSM241452 1 0.000 1.000 1.00 0.00
#> GSM241453 1 0.000 1.000 1.00 0.00
#> GSM241454 1 0.000 1.000 1.00 0.00
#> GSM241455 1 0.000 1.000 1.00 0.00
#> GSM241456 1 0.000 1.000 1.00 0.00
#> GSM241457 1 0.000 1.000 1.00 0.00
#> GSM241458 1 0.000 1.000 1.00 0.00
#> GSM241459 1 0.000 1.000 1.00 0.00
#> GSM241460 1 0.000 1.000 1.00 0.00
#> GSM241461 1 0.000 1.000 1.00 0.00
#> GSM241462 1 0.000 1.000 1.00 0.00
#> GSM241463 1 0.000 1.000 1.00 0.00
#> GSM241464 1 0.000 1.000 1.00 0.00
#> GSM241465 1 0.000 1.000 1.00 0.00
#> GSM241466 1 0.000 1.000 1.00 0.00
#> GSM241467 1 0.000 1.000 1.00 0.00
#> GSM241468 1 0.000 1.000 1.00 0.00
#> GSM241469 1 0.000 1.000 1.00 0.00
#> GSM241470 1 0.000 1.000 1.00 0.00
#> GSM241471 1 0.000 1.000 1.00 0.00
#> GSM241472 1 0.000 1.000 1.00 0.00
#> GSM241473 1 0.000 1.000 1.00 0.00
#> GSM241474 1 0.000 1.000 1.00 0.00
#> GSM241475 1 0.000 1.000 1.00 0.00
#> GSM241476 1 0.000 1.000 1.00 0.00
#> GSM241477 1 0.000 1.000 1.00 0.00
#> GSM241478 1 0.000 1.000 1.00 0.00
#> GSM241479 1 0.000 1.000 1.00 0.00
#> GSM241480 1 0.000 1.000 1.00 0.00
#> GSM241481 1 0.000 1.000 1.00 0.00
#> GSM241482 1 0.000 1.000 1.00 0.00
#> GSM241483 1 0.000 1.000 1.00 0.00
#> GSM241484 1 0.000 1.000 1.00 0.00
#> GSM241485 1 0.000 1.000 1.00 0.00
#> GSM241486 1 0.000 1.000 1.00 0.00
#> GSM241487 1 0.000 1.000 1.00 0.00
#> GSM241488 1 0.000 1.000 1.00 0.00
#> GSM241489 1 0.000 1.000 1.00 0.00
#> GSM241490 1 0.000 1.000 1.00 0.00
#> GSM241491 1 0.000 1.000 1.00 0.00
#> GSM241492 1 0.000 1.000 1.00 0.00
#> GSM241493 1 0.000 1.000 1.00 0.00
#> GSM241494 1 0.000 1.000 1.00 0.00
#> GSM241495 1 0.000 1.000 1.00 0.00
#> GSM241496 1 0.000 1.000 1.00 0.00
#> GSM241497 1 0.000 1.000 1.00 0.00
#> GSM241498 1 0.000 1.000 1.00 0.00
#> GSM241499 1 0.000 1.000 1.00 0.00
#> GSM241500 1 0.000 1.000 1.00 0.00
#> GSM241501 1 0.000 1.000 1.00 0.00
#> GSM241502 1 0.000 1.000 1.00 0.00
#> GSM241503 1 0.000 1.000 1.00 0.00
#> GSM241504 1 0.000 1.000 1.00 0.00
#> GSM241505 1 0.000 1.000 1.00 0.00
#> GSM241506 1 0.000 1.000 1.00 0.00
#> GSM241507 1 0.000 1.000 1.00 0.00
#> GSM241508 1 0.000 1.000 1.00 0.00
#> GSM241509 2 0.000 0.989 0.00 1.00
#> GSM241510 2 0.000 0.989 0.00 1.00
#> GSM241511 2 0.000 0.989 0.00 1.00
#> GSM241512 2 0.000 0.989 0.00 1.00
#> GSM241513 2 0.000 0.989 0.00 1.00
#> GSM241514 2 0.000 0.989 0.00 1.00
#> GSM241515 2 0.000 0.989 0.00 1.00
#> GSM241516 2 0.000 0.989 0.00 1.00
#> GSM241517 2 0.000 0.989 0.00 1.00
#> GSM241518 2 0.000 0.989 0.00 1.00
#> GSM241519 2 0.000 0.989 0.00 1.00
#> GSM241520 2 0.000 0.989 0.00 1.00
#> GSM241521 2 0.529 0.861 0.12 0.88
#> GSM241522 2 0.904 0.536 0.32 0.68
#> GSM241523 2 0.000 0.989 0.00 1.00
#> GSM241524 2 0.000 0.989 0.00 1.00
#> GSM241525 2 0.000 0.989 0.00 1.00
#> GSM241526 2 0.000 0.989 0.00 1.00
#> GSM241527 2 0.000 0.989 0.00 1.00
#> GSM241528 2 0.000 0.989 0.00 1.00
#> GSM241529 2 0.000 0.989 0.00 1.00
#> GSM241530 2 0.000 0.989 0.00 1.00
#> GSM241531 2 0.000 0.989 0.00 1.00
#> GSM241532 2 0.000 0.989 0.00 1.00
#> GSM241533 2 0.000 0.989 0.00 1.00
#> GSM241534 2 0.000 0.989 0.00 1.00
#> GSM241535 2 0.000 0.989 0.00 1.00
#> GSM241536 2 0.000 0.989 0.00 1.00
#> GSM241537 2 0.000 0.989 0.00 1.00
#> GSM241538 2 0.000 0.989 0.00 1.00
#> GSM241539 2 0.000 0.989 0.00 1.00
#> GSM241540 2 0.000 0.989 0.00 1.00
#> GSM241541 2 0.000 0.989 0.00 1.00
#> GSM241542 2 0.000 0.989 0.00 1.00
#> GSM241543 2 0.000 0.989 0.00 1.00
#> GSM241544 2 0.000 0.989 0.00 1.00
#> GSM241545 2 0.000 0.989 0.00 1.00
#> GSM241546 2 0.000 0.989 0.00 1.00
#> GSM241547 2 0.000 0.989 0.00 1.00
#> GSM241548 2 0.000 0.989 0.00 1.00
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.1529 0.705 0.040 0.960 0.000
#> GSM241452 2 0.5650 0.694 0.312 0.688 0.000
#> GSM241453 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241454 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241455 2 0.1031 0.710 0.024 0.976 0.000
#> GSM241456 2 0.5497 0.698 0.292 0.708 0.000
#> GSM241457 2 0.0000 0.714 0.000 1.000 0.000
#> GSM241458 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241459 2 0.0000 0.714 0.000 1.000 0.000
#> GSM241460 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241461 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241462 2 0.5497 0.698 0.292 0.708 0.000
#> GSM241463 2 0.0000 0.714 0.000 1.000 0.000
#> GSM241464 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241465 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241466 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241467 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241468 2 0.0000 0.714 0.000 1.000 0.000
#> GSM241469 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241470 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241471 2 0.0000 0.714 0.000 1.000 0.000
#> GSM241472 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241473 2 0.0000 0.714 0.000 1.000 0.000
#> GSM241474 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241475 2 0.1529 0.705 0.040 0.960 0.000
#> GSM241476 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241477 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241478 2 0.1529 0.705 0.040 0.960 0.000
#> GSM241479 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241480 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241481 2 0.0000 0.714 0.000 1.000 0.000
#> GSM241482 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241483 2 0.1163 0.708 0.028 0.972 0.000
#> GSM241484 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241485 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241486 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241487 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241488 2 0.0892 0.712 0.020 0.980 0.000
#> GSM241489 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241490 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241491 2 0.0000 0.714 0.000 1.000 0.000
#> GSM241492 2 0.5465 0.699 0.288 0.712 0.000
#> GSM241493 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241494 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241495 2 0.1411 0.705 0.036 0.964 0.000
#> GSM241496 2 0.1753 0.704 0.048 0.952 0.000
#> GSM241497 2 0.5678 0.692 0.316 0.684 0.000
#> GSM241498 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241499 2 0.5560 0.696 0.300 0.700 0.000
#> GSM241500 2 0.5810 0.232 0.336 0.664 0.000
#> GSM241501 2 0.2959 0.648 0.100 0.900 0.000
#> GSM241502 2 0.5178 0.392 0.256 0.744 0.000
#> GSM241503 2 0.6307 0.416 0.488 0.512 0.000
#> GSM241504 2 0.6308 0.405 0.492 0.508 0.000
#> GSM241505 1 0.6280 -0.515 0.540 0.460 0.000
#> GSM241506 2 0.5810 0.232 0.336 0.664 0.000
#> GSM241507 2 0.5650 0.684 0.312 0.688 0.000
#> GSM241508 2 0.4002 0.547 0.160 0.840 0.000
#> GSM241509 3 0.5465 0.612 0.288 0.000 0.712
#> GSM241510 3 0.7842 0.498 0.328 0.072 0.600
#> GSM241511 3 0.7107 0.530 0.340 0.036 0.624
#> GSM241512 3 0.5650 0.611 0.312 0.000 0.688
#> GSM241513 3 0.6140 0.485 0.404 0.000 0.596
#> GSM241514 3 0.6140 0.485 0.404 0.000 0.596
#> GSM241515 3 0.6168 0.487 0.412 0.000 0.588
#> GSM241516 3 0.6180 0.485 0.416 0.000 0.584
#> GSM241517 3 0.7487 0.418 0.408 0.040 0.552
#> GSM241518 3 0.6140 0.485 0.404 0.000 0.596
#> GSM241519 3 0.6140 0.485 0.404 0.000 0.596
#> GSM241520 3 0.6140 0.485 0.404 0.000 0.596
#> GSM241521 1 0.9615 -0.172 0.456 0.220 0.324
#> GSM241522 1 0.7391 0.185 0.696 0.108 0.196
#> GSM241523 3 0.6140 0.485 0.404 0.000 0.596
#> GSM241524 3 0.6140 0.485 0.404 0.000 0.596
#> GSM241525 3 0.5529 0.609 0.296 0.000 0.704
#> GSM241526 3 0.5431 0.611 0.284 0.000 0.716
#> GSM241527 3 0.5431 0.611 0.284 0.000 0.716
#> GSM241528 3 0.5529 0.609 0.296 0.000 0.704
#> GSM241529 3 0.5529 0.609 0.296 0.000 0.704
#> GSM241530 3 0.5529 0.609 0.296 0.000 0.704
#> GSM241531 3 0.5529 0.609 0.296 0.000 0.704
#> GSM241532 3 0.5529 0.609 0.296 0.000 0.704
#> GSM241533 3 0.5497 0.609 0.292 0.000 0.708
#> GSM241534 3 0.5431 0.611 0.284 0.000 0.716
#> GSM241535 3 0.5431 0.611 0.284 0.000 0.716
#> GSM241536 3 0.5529 0.609 0.296 0.000 0.704
#> GSM241537 3 0.0000 0.604 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.604 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.604 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.604 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.604 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.604 0.000 0.000 1.000
#> GSM241543 3 0.5988 0.473 0.368 0.000 0.632
#> GSM241544 3 0.5988 0.473 0.368 0.000 0.632
#> GSM241545 3 0.5988 0.473 0.368 0.000 0.632
#> GSM241546 3 0.5988 0.473 0.368 0.000 0.632
#> GSM241547 3 0.5988 0.473 0.368 0.000 0.632
#> GSM241548 3 0.5988 0.473 0.368 0.000 0.632
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.5178 0.862 0.392 0.600 0.004 0.004
#> GSM241452 1 0.1545 0.874 0.952 0.040 0.000 0.008
#> GSM241453 2 0.4991 0.864 0.388 0.608 0.004 0.000
#> GSM241454 1 0.0524 0.891 0.988 0.008 0.000 0.004
#> GSM241455 2 0.5183 0.858 0.408 0.584 0.000 0.008
#> GSM241456 1 0.0188 0.891 0.996 0.004 0.000 0.000
#> GSM241457 2 0.5964 0.832 0.424 0.536 0.000 0.040
#> GSM241458 1 0.1388 0.879 0.960 0.012 0.000 0.028
#> GSM241459 2 0.5888 0.835 0.424 0.540 0.000 0.036
#> GSM241460 1 0.1510 0.876 0.956 0.016 0.000 0.028
#> GSM241461 2 0.5400 0.858 0.372 0.608 0.000 0.020
#> GSM241462 1 0.0672 0.889 0.984 0.008 0.000 0.008
#> GSM241463 2 0.5901 0.828 0.432 0.532 0.000 0.036
#> GSM241464 1 0.1610 0.869 0.952 0.016 0.000 0.032
#> GSM241465 2 0.5161 0.859 0.400 0.592 0.000 0.008
#> GSM241466 1 0.0188 0.890 0.996 0.004 0.000 0.000
#> GSM241467 1 0.0657 0.886 0.984 0.004 0.000 0.012
#> GSM241468 2 0.5750 0.827 0.440 0.532 0.000 0.028
#> GSM241469 1 0.1356 0.880 0.960 0.032 0.000 0.008
#> GSM241470 2 0.5165 0.863 0.388 0.604 0.004 0.004
#> GSM241471 2 0.5833 0.824 0.440 0.528 0.000 0.032
#> GSM241472 1 0.1109 0.878 0.968 0.004 0.000 0.028
#> GSM241473 2 0.5833 0.824 0.440 0.528 0.000 0.032
#> GSM241474 1 0.1256 0.875 0.964 0.008 0.000 0.028
#> GSM241475 2 0.5178 0.862 0.392 0.600 0.004 0.004
#> GSM241476 1 0.1151 0.885 0.968 0.024 0.000 0.008
#> GSM241477 2 0.4817 0.864 0.388 0.612 0.000 0.000
#> GSM241478 2 0.5311 0.861 0.392 0.596 0.004 0.008
#> GSM241479 1 0.1151 0.885 0.968 0.024 0.000 0.008
#> GSM241480 1 0.0524 0.891 0.988 0.008 0.000 0.004
#> GSM241481 2 0.5888 0.835 0.424 0.540 0.000 0.036
#> GSM241482 1 0.1388 0.879 0.960 0.012 0.000 0.028
#> GSM241483 2 0.5391 0.862 0.380 0.604 0.004 0.012
#> GSM241484 1 0.0336 0.890 0.992 0.008 0.000 0.000
#> GSM241485 1 0.0336 0.890 0.992 0.008 0.000 0.000
#> GSM241486 2 0.5400 0.858 0.372 0.608 0.000 0.020
#> GSM241487 2 0.4950 0.862 0.376 0.620 0.004 0.000
#> GSM241488 2 0.5212 0.858 0.404 0.588 0.004 0.004
#> GSM241489 1 0.1356 0.880 0.960 0.032 0.000 0.008
#> GSM241490 1 0.1356 0.880 0.960 0.032 0.000 0.008
#> GSM241491 2 0.5901 0.828 0.432 0.532 0.000 0.036
#> GSM241492 1 0.1356 0.873 0.960 0.008 0.000 0.032
#> GSM241493 2 0.5165 0.863 0.388 0.604 0.004 0.004
#> GSM241494 1 0.0188 0.891 0.996 0.000 0.000 0.004
#> GSM241495 2 0.5165 0.863 0.388 0.604 0.004 0.004
#> GSM241496 2 0.5178 0.862 0.392 0.600 0.004 0.004
#> GSM241497 1 0.1545 0.874 0.952 0.040 0.000 0.008
#> GSM241498 1 0.1356 0.880 0.960 0.032 0.000 0.008
#> GSM241499 1 0.3852 0.724 0.808 0.180 0.000 0.012
#> GSM241500 2 0.4239 0.424 0.028 0.808 0.004 0.160
#> GSM241501 2 0.4718 0.694 0.216 0.756 0.004 0.024
#> GSM241502 2 0.4965 0.558 0.100 0.784 0.004 0.112
#> GSM241503 1 0.5496 0.613 0.704 0.232 0.000 0.064
#> GSM241504 1 0.5753 0.579 0.680 0.248 0.000 0.072
#> GSM241505 1 0.6164 0.546 0.656 0.240 0.000 0.104
#> GSM241506 2 0.4886 0.301 0.028 0.744 0.004 0.224
#> GSM241507 1 0.3668 0.698 0.808 0.188 0.000 0.004
#> GSM241508 2 0.4864 0.655 0.172 0.768 0.000 0.060
#> GSM241509 4 0.2635 0.780 0.000 0.020 0.076 0.904
#> GSM241510 4 0.5393 0.702 0.000 0.268 0.044 0.688
#> GSM241511 4 0.6936 0.680 0.076 0.220 0.052 0.652
#> GSM241512 4 0.5293 0.757 0.000 0.152 0.100 0.748
#> GSM241513 3 0.2546 0.892 0.000 0.060 0.912 0.028
#> GSM241514 3 0.2197 0.897 0.000 0.048 0.928 0.024
#> GSM241515 3 0.2546 0.892 0.000 0.060 0.912 0.028
#> GSM241516 3 0.2984 0.875 0.000 0.084 0.888 0.028
#> GSM241517 3 0.2742 0.888 0.000 0.076 0.900 0.024
#> GSM241518 3 0.2546 0.895 0.000 0.060 0.912 0.028
#> GSM241519 3 0.1833 0.900 0.000 0.032 0.944 0.024
#> GSM241520 3 0.1520 0.900 0.000 0.020 0.956 0.024
#> GSM241521 3 0.5215 0.585 0.004 0.296 0.680 0.020
#> GSM241522 3 0.7926 0.296 0.348 0.144 0.480 0.028
#> GSM241523 3 0.1520 0.900 0.000 0.020 0.956 0.024
#> GSM241524 3 0.1406 0.900 0.000 0.016 0.960 0.024
#> GSM241525 4 0.4731 0.766 0.000 0.160 0.060 0.780
#> GSM241526 4 0.2996 0.785 0.000 0.044 0.064 0.892
#> GSM241527 4 0.3164 0.785 0.000 0.052 0.064 0.884
#> GSM241528 4 0.4614 0.774 0.000 0.144 0.064 0.792
#> GSM241529 4 0.3885 0.783 0.000 0.092 0.064 0.844
#> GSM241530 4 0.4440 0.775 0.000 0.136 0.060 0.804
#> GSM241531 4 0.4820 0.765 0.000 0.168 0.060 0.772
#> GSM241532 4 0.2413 0.782 0.000 0.020 0.064 0.916
#> GSM241533 4 0.2179 0.781 0.000 0.012 0.064 0.924
#> GSM241534 4 0.2124 0.774 0.000 0.008 0.068 0.924
#> GSM241535 4 0.2124 0.774 0.000 0.008 0.068 0.924
#> GSM241536 4 0.4907 0.764 0.000 0.176 0.060 0.764
#> GSM241537 4 0.7148 0.437 0.000 0.140 0.364 0.496
#> GSM241538 4 0.7148 0.437 0.000 0.140 0.364 0.496
#> GSM241539 4 0.7148 0.437 0.000 0.140 0.364 0.496
#> GSM241540 4 0.7148 0.437 0.000 0.140 0.364 0.496
#> GSM241541 4 0.7210 0.433 0.000 0.148 0.360 0.492
#> GSM241542 4 0.7210 0.433 0.000 0.148 0.360 0.492
#> GSM241543 3 0.0657 0.892 0.000 0.012 0.984 0.004
#> GSM241544 3 0.0657 0.892 0.000 0.012 0.984 0.004
#> GSM241545 3 0.0657 0.892 0.000 0.012 0.984 0.004
#> GSM241546 3 0.0657 0.892 0.000 0.012 0.984 0.004
#> GSM241547 3 0.0895 0.890 0.000 0.020 0.976 0.004
#> GSM241548 3 0.0779 0.891 0.000 0.016 0.980 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0609 0.877 0.020 0.980 0.000 0.000 0.000
#> GSM241452 1 0.3123 0.862 0.812 0.184 0.000 0.004 0.000
#> GSM241453 2 0.0510 0.877 0.016 0.984 0.000 0.000 0.000
#> GSM241454 1 0.3013 0.867 0.832 0.160 0.000 0.000 0.008
#> GSM241455 2 0.2067 0.869 0.032 0.920 0.000 0.000 0.048
#> GSM241456 1 0.3163 0.867 0.824 0.164 0.000 0.000 0.012
#> GSM241457 2 0.3551 0.828 0.044 0.820 0.000 0.000 0.136
#> GSM241458 1 0.5480 0.807 0.656 0.168 0.000 0.000 0.176
#> GSM241459 2 0.3460 0.833 0.044 0.828 0.000 0.000 0.128
#> GSM241460 1 0.5513 0.804 0.652 0.168 0.000 0.000 0.180
#> GSM241461 2 0.2770 0.837 0.008 0.864 0.004 0.000 0.124
#> GSM241462 1 0.4444 0.857 0.756 0.156 0.000 0.000 0.088
#> GSM241463 2 0.4065 0.786 0.048 0.772 0.000 0.000 0.180
#> GSM241464 1 0.5805 0.759 0.612 0.172 0.000 0.000 0.216
#> GSM241465 2 0.1915 0.868 0.032 0.928 0.000 0.000 0.040
#> GSM241466 1 0.3804 0.862 0.796 0.160 0.000 0.000 0.044
#> GSM241467 1 0.4258 0.854 0.768 0.160 0.000 0.000 0.072
#> GSM241468 2 0.2830 0.848 0.044 0.876 0.000 0.000 0.080
#> GSM241469 1 0.3123 0.862 0.812 0.184 0.000 0.004 0.000
#> GSM241470 2 0.0609 0.877 0.020 0.980 0.000 0.000 0.000
#> GSM241471 2 0.3365 0.829 0.044 0.836 0.000 0.000 0.120
#> GSM241472 1 0.5271 0.809 0.680 0.168 0.000 0.000 0.152
#> GSM241473 2 0.3365 0.829 0.044 0.836 0.000 0.000 0.120
#> GSM241474 1 0.5307 0.806 0.676 0.168 0.000 0.000 0.156
#> GSM241475 2 0.0609 0.877 0.020 0.980 0.000 0.000 0.000
#> GSM241476 1 0.2929 0.864 0.820 0.180 0.000 0.000 0.000
#> GSM241477 2 0.0510 0.877 0.016 0.984 0.000 0.000 0.000
#> GSM241478 2 0.0992 0.875 0.024 0.968 0.000 0.000 0.008
#> GSM241479 1 0.3123 0.862 0.812 0.184 0.000 0.004 0.000
#> GSM241480 1 0.3013 0.867 0.832 0.160 0.000 0.000 0.008
#> GSM241481 2 0.3460 0.833 0.044 0.828 0.000 0.000 0.128
#> GSM241482 1 0.5480 0.807 0.656 0.168 0.000 0.000 0.176
#> GSM241483 2 0.1310 0.875 0.020 0.956 0.000 0.000 0.024
#> GSM241484 1 0.3944 0.865 0.788 0.160 0.000 0.000 0.052
#> GSM241485 1 0.4199 0.864 0.772 0.160 0.000 0.000 0.068
#> GSM241486 2 0.2770 0.837 0.008 0.864 0.004 0.000 0.124
#> GSM241487 2 0.0510 0.877 0.016 0.984 0.000 0.000 0.000
#> GSM241488 2 0.0703 0.875 0.024 0.976 0.000 0.000 0.000
#> GSM241489 1 0.2966 0.862 0.816 0.184 0.000 0.000 0.000
#> GSM241490 1 0.3123 0.862 0.812 0.184 0.000 0.004 0.000
#> GSM241491 2 0.3953 0.797 0.048 0.784 0.000 0.000 0.168
#> GSM241492 1 0.5747 0.768 0.620 0.168 0.000 0.000 0.212
#> GSM241493 2 0.0609 0.877 0.020 0.980 0.000 0.000 0.000
#> GSM241494 1 0.3359 0.867 0.816 0.164 0.000 0.000 0.020
#> GSM241495 2 0.0609 0.877 0.020 0.980 0.000 0.000 0.000
#> GSM241496 2 0.0794 0.874 0.028 0.972 0.000 0.000 0.000
#> GSM241497 1 0.3123 0.862 0.812 0.184 0.000 0.004 0.000
#> GSM241498 1 0.3123 0.862 0.812 0.184 0.000 0.004 0.000
#> GSM241499 1 0.3423 0.818 0.844 0.108 0.000 0.008 0.040
#> GSM241500 2 0.5895 0.647 0.104 0.692 0.004 0.052 0.148
#> GSM241501 2 0.4349 0.747 0.088 0.788 0.000 0.012 0.112
#> GSM241502 2 0.5692 0.661 0.108 0.704 0.000 0.056 0.132
#> GSM241503 1 0.4469 0.718 0.796 0.072 0.000 0.040 0.092
#> GSM241504 1 0.4729 0.649 0.780 0.048 0.000 0.080 0.092
#> GSM241505 1 0.4622 0.641 0.784 0.036 0.000 0.088 0.092
#> GSM241506 2 0.7544 0.372 0.112 0.532 0.004 0.184 0.168
#> GSM241507 1 0.4031 0.743 0.796 0.048 0.000 0.008 0.148
#> GSM241508 2 0.5401 0.699 0.100 0.708 0.008 0.012 0.172
#> GSM241509 4 0.2955 0.749 0.004 0.008 0.008 0.864 0.116
#> GSM241510 4 0.5657 0.645 0.084 0.028 0.008 0.696 0.184
#> GSM241511 4 0.6144 0.523 0.200 0.008 0.004 0.612 0.176
#> GSM241512 4 0.3564 0.786 0.040 0.004 0.020 0.852 0.084
#> GSM241513 3 0.4353 0.845 0.052 0.008 0.812 0.036 0.092
#> GSM241514 3 0.3978 0.856 0.044 0.004 0.832 0.036 0.084
#> GSM241515 3 0.4353 0.845 0.052 0.008 0.812 0.036 0.092
#> GSM241516 3 0.4818 0.821 0.056 0.008 0.776 0.036 0.124
#> GSM241517 3 0.4802 0.836 0.056 0.012 0.780 0.032 0.120
#> GSM241518 3 0.4370 0.850 0.048 0.004 0.804 0.036 0.108
#> GSM241519 3 0.2344 0.874 0.020 0.004 0.920 0.028 0.028
#> GSM241520 3 0.1329 0.874 0.008 0.000 0.956 0.032 0.004
#> GSM241521 3 0.6177 0.706 0.052 0.104 0.700 0.032 0.112
#> GSM241522 1 0.6959 -0.208 0.452 0.016 0.396 0.020 0.116
#> GSM241523 3 0.1966 0.875 0.016 0.004 0.936 0.028 0.016
#> GSM241524 3 0.1202 0.874 0.004 0.000 0.960 0.032 0.004
#> GSM241525 4 0.3090 0.794 0.052 0.000 0.000 0.860 0.088
#> GSM241526 4 0.1329 0.793 0.008 0.000 0.004 0.956 0.032
#> GSM241527 4 0.1442 0.794 0.012 0.000 0.004 0.952 0.032
#> GSM241528 4 0.2369 0.808 0.032 0.000 0.004 0.908 0.056
#> GSM241529 4 0.1739 0.803 0.024 0.000 0.004 0.940 0.032
#> GSM241530 4 0.2713 0.804 0.036 0.000 0.004 0.888 0.072
#> GSM241531 4 0.3849 0.772 0.068 0.000 0.008 0.820 0.104
#> GSM241532 4 0.3294 0.756 0.024 0.000 0.008 0.844 0.124
#> GSM241533 4 0.2295 0.753 0.004 0.000 0.008 0.900 0.088
#> GSM241534 4 0.1952 0.737 0.000 0.000 0.004 0.912 0.084
#> GSM241535 4 0.1768 0.748 0.000 0.000 0.004 0.924 0.072
#> GSM241536 4 0.3888 0.770 0.064 0.000 0.008 0.816 0.112
#> GSM241537 5 0.6461 0.989 0.000 0.000 0.184 0.372 0.444
#> GSM241538 5 0.6461 0.989 0.000 0.000 0.184 0.372 0.444
#> GSM241539 5 0.6461 0.989 0.000 0.000 0.184 0.372 0.444
#> GSM241540 5 0.6461 0.989 0.000 0.000 0.184 0.372 0.444
#> GSM241541 5 0.6439 0.979 0.000 0.000 0.184 0.356 0.460
#> GSM241542 5 0.6439 0.979 0.000 0.000 0.184 0.356 0.460
#> GSM241543 3 0.1569 0.857 0.008 0.000 0.944 0.004 0.044
#> GSM241544 3 0.1644 0.856 0.008 0.000 0.940 0.004 0.048
#> GSM241545 3 0.1569 0.857 0.008 0.000 0.944 0.004 0.044
#> GSM241546 3 0.1644 0.856 0.008 0.000 0.940 0.004 0.048
#> GSM241547 3 0.1901 0.852 0.012 0.000 0.928 0.004 0.056
#> GSM241548 3 0.1830 0.854 0.012 0.000 0.932 0.004 0.052
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.1610 0.831 0.084 0.916 0.000 0.000 NA 0.000
#> GSM241452 1 0.1349 0.821 0.940 0.056 0.000 0.000 NA 0.000
#> GSM241453 2 0.1610 0.831 0.084 0.916 0.000 0.000 NA 0.000
#> GSM241454 1 0.0622 0.829 0.980 0.012 0.000 0.000 NA 0.000
#> GSM241455 2 0.3047 0.826 0.080 0.852 0.000 0.000 NA 0.008
#> GSM241456 1 0.1151 0.829 0.956 0.032 0.000 0.000 NA 0.000
#> GSM241457 2 0.5683 0.740 0.116 0.604 0.000 0.000 NA 0.036
#> GSM241458 1 0.3852 0.727 0.664 0.012 0.000 0.000 NA 0.000
#> GSM241459 2 0.5703 0.741 0.116 0.600 0.000 0.000 NA 0.036
#> GSM241460 1 0.3883 0.721 0.656 0.012 0.000 0.000 NA 0.000
#> GSM241461 2 0.4670 0.754 0.036 0.728 0.000 0.000 NA 0.072
#> GSM241462 1 0.3133 0.792 0.780 0.000 0.000 0.000 NA 0.008
#> GSM241463 2 0.6038 0.677 0.120 0.556 0.000 0.000 NA 0.048
#> GSM241464 1 0.5183 0.608 0.540 0.028 0.000 0.000 NA 0.040
#> GSM241465 2 0.3214 0.824 0.084 0.840 0.000 0.000 NA 0.008
#> GSM241466 1 0.2234 0.812 0.872 0.004 0.000 0.000 NA 0.000
#> GSM241467 1 0.2772 0.796 0.816 0.004 0.000 0.000 NA 0.000
#> GSM241468 2 0.4450 0.785 0.128 0.732 0.000 0.000 NA 0.008
#> GSM241469 1 0.1075 0.824 0.952 0.048 0.000 0.000 NA 0.000
#> GSM241470 2 0.1610 0.831 0.084 0.916 0.000 0.000 NA 0.000
#> GSM241471 2 0.5172 0.742 0.128 0.636 0.000 0.000 NA 0.008
#> GSM241472 1 0.3766 0.730 0.684 0.012 0.000 0.000 NA 0.000
#> GSM241473 2 0.5172 0.742 0.128 0.636 0.000 0.000 NA 0.008
#> GSM241474 1 0.3802 0.725 0.676 0.012 0.000 0.000 NA 0.000
#> GSM241475 2 0.1610 0.831 0.084 0.916 0.000 0.000 NA 0.000
#> GSM241476 1 0.0937 0.826 0.960 0.040 0.000 0.000 NA 0.000
#> GSM241477 2 0.1753 0.831 0.084 0.912 0.000 0.000 NA 0.000
#> GSM241478 2 0.2009 0.829 0.084 0.904 0.000 0.000 NA 0.004
#> GSM241479 1 0.0937 0.826 0.960 0.040 0.000 0.000 NA 0.000
#> GSM241480 1 0.0622 0.829 0.980 0.012 0.000 0.000 NA 0.000
#> GSM241481 2 0.5663 0.743 0.116 0.608 0.000 0.000 NA 0.036
#> GSM241482 1 0.3852 0.727 0.664 0.012 0.000 0.000 NA 0.000
#> GSM241483 2 0.3882 0.810 0.084 0.800 0.000 0.000 NA 0.024
#> GSM241484 1 0.1444 0.827 0.928 0.000 0.000 0.000 NA 0.000
#> GSM241485 1 0.3147 0.811 0.816 0.016 0.000 0.000 NA 0.008
#> GSM241486 2 0.4601 0.750 0.032 0.732 0.000 0.000 NA 0.072
#> GSM241487 2 0.1753 0.831 0.084 0.912 0.000 0.000 NA 0.000
#> GSM241488 2 0.2121 0.828 0.096 0.892 0.000 0.000 NA 0.000
#> GSM241489 1 0.1152 0.824 0.952 0.044 0.000 0.000 NA 0.000
#> GSM241490 1 0.1007 0.825 0.956 0.044 0.000 0.000 NA 0.000
#> GSM241491 2 0.5838 0.702 0.120 0.584 0.000 0.000 NA 0.040
#> GSM241492 1 0.4727 0.644 0.580 0.012 0.000 0.000 NA 0.032
#> GSM241493 2 0.1610 0.831 0.084 0.916 0.000 0.000 NA 0.000
#> GSM241494 1 0.1564 0.830 0.936 0.024 0.000 0.000 NA 0.000
#> GSM241495 2 0.1610 0.831 0.084 0.916 0.000 0.000 NA 0.000
#> GSM241496 2 0.1858 0.828 0.092 0.904 0.000 0.000 NA 0.000
#> GSM241497 1 0.1349 0.821 0.940 0.056 0.000 0.000 NA 0.000
#> GSM241498 1 0.1075 0.824 0.952 0.048 0.000 0.000 NA 0.000
#> GSM241499 1 0.3503 0.751 0.820 0.032 0.000 0.012 NA 0.008
#> GSM241500 2 0.4702 0.647 0.000 0.724 0.008 0.032 NA 0.048
#> GSM241501 2 0.3548 0.721 0.008 0.816 0.004 0.004 NA 0.036
#> GSM241502 2 0.4796 0.652 0.016 0.728 0.008 0.024 NA 0.036
#> GSM241503 1 0.5113 0.662 0.708 0.052 0.000 0.068 NA 0.008
#> GSM241504 1 0.5668 0.608 0.664 0.044 0.000 0.108 NA 0.016
#> GSM241505 1 0.5668 0.606 0.664 0.044 0.000 0.108 NA 0.016
#> GSM241506 2 0.6350 0.375 0.000 0.548 0.008 0.152 NA 0.044
#> GSM241507 1 0.5466 0.667 0.612 0.016 0.000 0.064 NA 0.020
#> GSM241508 2 0.5968 0.599 0.012 0.592 0.012 0.024 NA 0.084
#> GSM241509 4 0.4470 0.717 0.000 0.020 0.016 0.760 NA 0.144
#> GSM241510 4 0.5931 0.582 0.000 0.072 0.012 0.616 NA 0.068
#> GSM241511 4 0.6069 0.545 0.040 0.020 0.016 0.608 NA 0.056
#> GSM241512 4 0.2993 0.753 0.000 0.012 0.032 0.876 NA 0.036
#> GSM241513 3 0.3856 0.778 0.000 0.012 0.808 0.020 NA 0.044
#> GSM241514 3 0.3446 0.788 0.000 0.004 0.832 0.020 NA 0.040
#> GSM241515 3 0.3936 0.776 0.000 0.012 0.804 0.024 NA 0.044
#> GSM241516 3 0.4330 0.762 0.000 0.012 0.780 0.040 NA 0.048
#> GSM241517 3 0.4415 0.769 0.000 0.012 0.764 0.020 NA 0.068
#> GSM241518 3 0.4224 0.775 0.000 0.008 0.776 0.020 NA 0.064
#> GSM241519 3 0.1989 0.804 0.000 0.004 0.916 0.000 NA 0.028
#> GSM241520 3 0.1536 0.802 0.000 0.004 0.940 0.000 NA 0.040
#> GSM241521 3 0.4657 0.730 0.000 0.076 0.756 0.012 NA 0.036
#> GSM241522 3 0.7433 0.150 0.372 0.028 0.404 0.040 NA 0.032
#> GSM241523 3 0.1268 0.806 0.000 0.004 0.952 0.000 NA 0.008
#> GSM241524 3 0.0858 0.803 0.000 0.004 0.968 0.000 NA 0.028
#> GSM241525 4 0.3660 0.737 0.016 0.008 0.020 0.832 NA 0.024
#> GSM241526 4 0.3841 0.752 0.000 0.008 0.020 0.812 NA 0.092
#> GSM241527 4 0.3668 0.752 0.000 0.008 0.020 0.824 NA 0.092
#> GSM241528 4 0.3523 0.761 0.000 0.008 0.020 0.836 NA 0.060
#> GSM241529 4 0.3847 0.753 0.000 0.008 0.020 0.812 NA 0.088
#> GSM241530 4 0.2954 0.755 0.000 0.008 0.020 0.872 NA 0.032
#> GSM241531 4 0.4241 0.676 0.004 0.004 0.008 0.748 NA 0.048
#> GSM241532 4 0.4523 0.711 0.000 0.000 0.008 0.724 NA 0.144
#> GSM241533 4 0.3732 0.728 0.000 0.000 0.000 0.780 NA 0.144
#> GSM241534 4 0.3459 0.717 0.000 0.000 0.004 0.792 NA 0.172
#> GSM241535 4 0.2773 0.735 0.000 0.000 0.004 0.836 NA 0.152
#> GSM241536 4 0.4281 0.667 0.000 0.004 0.008 0.732 NA 0.052
#> GSM241537 6 0.3767 0.990 0.000 0.000 0.088 0.132 NA 0.780
#> GSM241538 6 0.3767 0.990 0.000 0.000 0.088 0.132 NA 0.780
#> GSM241539 6 0.4047 0.989 0.000 0.004 0.088 0.132 NA 0.772
#> GSM241540 6 0.4047 0.989 0.000 0.004 0.088 0.132 NA 0.772
#> GSM241541 6 0.3595 0.983 0.000 0.000 0.084 0.120 NA 0.796
#> GSM241542 6 0.3595 0.983 0.000 0.000 0.084 0.120 NA 0.796
#> GSM241543 3 0.2538 0.767 0.000 0.000 0.860 0.000 NA 0.124
#> GSM241544 3 0.2538 0.767 0.000 0.000 0.860 0.000 NA 0.124
#> GSM241545 3 0.2538 0.767 0.000 0.000 0.860 0.000 NA 0.124
#> GSM241546 3 0.2538 0.767 0.000 0.000 0.860 0.000 NA 0.124
#> GSM241547 3 0.3062 0.758 0.000 0.000 0.824 0.000 NA 0.144
#> GSM241548 3 0.3023 0.760 0.000 0.000 0.828 0.000 NA 0.140
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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> CV:kmeans 98 1.23e-15 1.67e-01 2
#> CV:kmeans 73 6.01e-14 1.00e-01 3
#> CV:kmeans 89 3.37e-13 1.89e-05 4
#> CV:kmeans 96 2.48e-14 4.08e-08 5
#> CV:kmeans 96 2.48e-14 4.08e-08 6
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 16250 rows and 98 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 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.974 0.989 0.4952 0.505 0.505
#> 3 3 0.683 0.846 0.827 0.3055 0.793 0.603
#> 4 4 0.946 0.962 0.978 0.1598 0.901 0.710
#> 5 5 0.897 0.847 0.916 0.0464 0.974 0.898
#> 6 6 0.841 0.822 0.886 0.0406 0.953 0.796
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM241451 1 0.0000 0.989 1.000 0.000
#> GSM241452 1 0.0000 0.989 1.000 0.000
#> GSM241453 1 0.0000 0.989 1.000 0.000
#> GSM241454 1 0.0000 0.989 1.000 0.000
#> GSM241455 1 0.0000 0.989 1.000 0.000
#> GSM241456 1 0.0000 0.989 1.000 0.000
#> GSM241457 1 0.0000 0.989 1.000 0.000
#> GSM241458 1 0.0000 0.989 1.000 0.000
#> GSM241459 1 0.0000 0.989 1.000 0.000
#> GSM241460 1 0.0000 0.989 1.000 0.000
#> GSM241461 1 0.0000 0.989 1.000 0.000
#> GSM241462 1 0.0000 0.989 1.000 0.000
#> GSM241463 1 0.0000 0.989 1.000 0.000
#> GSM241464 1 0.0000 0.989 1.000 0.000
#> GSM241465 1 0.0000 0.989 1.000 0.000
#> GSM241466 1 0.0000 0.989 1.000 0.000
#> GSM241467 1 0.0000 0.989 1.000 0.000
#> GSM241468 1 0.0000 0.989 1.000 0.000
#> GSM241469 1 0.0000 0.989 1.000 0.000
#> GSM241470 1 0.0000 0.989 1.000 0.000
#> GSM241471 1 0.0000 0.989 1.000 0.000
#> GSM241472 1 0.0000 0.989 1.000 0.000
#> GSM241473 1 0.0000 0.989 1.000 0.000
#> GSM241474 1 0.0000 0.989 1.000 0.000
#> GSM241475 1 0.0000 0.989 1.000 0.000
#> GSM241476 1 0.0000 0.989 1.000 0.000
#> GSM241477 1 0.0000 0.989 1.000 0.000
#> GSM241478 1 0.0000 0.989 1.000 0.000
#> GSM241479 1 0.0000 0.989 1.000 0.000
#> GSM241480 1 0.0000 0.989 1.000 0.000
#> GSM241481 1 0.0000 0.989 1.000 0.000
#> GSM241482 1 0.0000 0.989 1.000 0.000
#> GSM241483 1 0.0000 0.989 1.000 0.000
#> GSM241484 1 0.0000 0.989 1.000 0.000
#> GSM241485 1 0.0000 0.989 1.000 0.000
#> GSM241486 1 0.0000 0.989 1.000 0.000
#> GSM241487 1 0.0000 0.989 1.000 0.000
#> GSM241488 1 0.0000 0.989 1.000 0.000
#> GSM241489 1 0.0000 0.989 1.000 0.000
#> GSM241490 1 0.0000 0.989 1.000 0.000
#> GSM241491 1 0.0000 0.989 1.000 0.000
#> GSM241492 1 0.0000 0.989 1.000 0.000
#> GSM241493 1 0.0000 0.989 1.000 0.000
#> GSM241494 1 0.0000 0.989 1.000 0.000
#> GSM241495 1 0.0000 0.989 1.000 0.000
#> GSM241496 1 0.0000 0.989 1.000 0.000
#> GSM241497 1 0.0000 0.989 1.000 0.000
#> GSM241498 1 0.0000 0.989 1.000 0.000
#> GSM241499 1 0.0000 0.989 1.000 0.000
#> GSM241500 2 0.8207 0.656 0.256 0.744
#> GSM241501 1 0.0000 0.989 1.000 0.000
#> GSM241502 1 0.7883 0.690 0.764 0.236
#> GSM241503 1 0.0938 0.979 0.988 0.012
#> GSM241504 1 0.1184 0.975 0.984 0.016
#> GSM241505 1 0.1843 0.963 0.972 0.028
#> GSM241506 2 0.8016 0.677 0.244 0.756
#> GSM241507 1 0.0000 0.989 1.000 0.000
#> GSM241508 1 0.8713 0.584 0.708 0.292
#> GSM241509 2 0.0000 0.987 0.000 1.000
#> GSM241510 2 0.0000 0.987 0.000 1.000
#> GSM241511 2 0.0000 0.987 0.000 1.000
#> GSM241512 2 0.0000 0.987 0.000 1.000
#> GSM241513 2 0.0000 0.987 0.000 1.000
#> GSM241514 2 0.0000 0.987 0.000 1.000
#> GSM241515 2 0.0000 0.987 0.000 1.000
#> GSM241516 2 0.0000 0.987 0.000 1.000
#> GSM241517 2 0.0000 0.987 0.000 1.000
#> GSM241518 2 0.0000 0.987 0.000 1.000
#> GSM241519 2 0.0000 0.987 0.000 1.000
#> GSM241520 2 0.0000 0.987 0.000 1.000
#> GSM241521 2 0.0000 0.987 0.000 1.000
#> GSM241522 2 0.0000 0.987 0.000 1.000
#> GSM241523 2 0.0000 0.987 0.000 1.000
#> GSM241524 2 0.0000 0.987 0.000 1.000
#> GSM241525 2 0.0000 0.987 0.000 1.000
#> GSM241526 2 0.0000 0.987 0.000 1.000
#> GSM241527 2 0.0000 0.987 0.000 1.000
#> GSM241528 2 0.0000 0.987 0.000 1.000
#> GSM241529 2 0.0000 0.987 0.000 1.000
#> GSM241530 2 0.0000 0.987 0.000 1.000
#> GSM241531 2 0.0000 0.987 0.000 1.000
#> GSM241532 2 0.0000 0.987 0.000 1.000
#> GSM241533 2 0.0000 0.987 0.000 1.000
#> GSM241534 2 0.0000 0.987 0.000 1.000
#> GSM241535 2 0.0000 0.987 0.000 1.000
#> GSM241536 2 0.0000 0.987 0.000 1.000
#> GSM241537 2 0.0000 0.987 0.000 1.000
#> GSM241538 2 0.0000 0.987 0.000 1.000
#> GSM241539 2 0.0000 0.987 0.000 1.000
#> GSM241540 2 0.0000 0.987 0.000 1.000
#> GSM241541 2 0.0000 0.987 0.000 1.000
#> GSM241542 2 0.0000 0.987 0.000 1.000
#> GSM241543 2 0.0000 0.987 0.000 1.000
#> GSM241544 2 0.0000 0.987 0.000 1.000
#> GSM241545 2 0.0000 0.987 0.000 1.000
#> GSM241546 2 0.0000 0.987 0.000 1.000
#> GSM241547 2 0.0000 0.987 0.000 1.000
#> GSM241548 2 0.0000 0.987 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.000 0.909 0.000 1.000 0.000
#> GSM241452 1 0.601 0.921 0.628 0.372 0.000
#> GSM241453 2 0.000 0.909 0.000 1.000 0.000
#> GSM241454 1 0.601 0.921 0.628 0.372 0.000
#> GSM241455 2 0.000 0.909 0.000 1.000 0.000
#> GSM241456 1 0.601 0.921 0.628 0.372 0.000
#> GSM241457 2 0.000 0.909 0.000 1.000 0.000
#> GSM241458 1 0.601 0.921 0.628 0.372 0.000
#> GSM241459 2 0.000 0.909 0.000 1.000 0.000
#> GSM241460 1 0.601 0.921 0.628 0.372 0.000
#> GSM241461 2 0.000 0.909 0.000 1.000 0.000
#> GSM241462 1 0.601 0.921 0.628 0.372 0.000
#> GSM241463 2 0.000 0.909 0.000 1.000 0.000
#> GSM241464 1 0.601 0.921 0.628 0.372 0.000
#> GSM241465 2 0.000 0.909 0.000 1.000 0.000
#> GSM241466 1 0.601 0.921 0.628 0.372 0.000
#> GSM241467 1 0.601 0.921 0.628 0.372 0.000
#> GSM241468 2 0.000 0.909 0.000 1.000 0.000
#> GSM241469 1 0.601 0.921 0.628 0.372 0.000
#> GSM241470 2 0.000 0.909 0.000 1.000 0.000
#> GSM241471 2 0.000 0.909 0.000 1.000 0.000
#> GSM241472 1 0.601 0.921 0.628 0.372 0.000
#> GSM241473 2 0.000 0.909 0.000 1.000 0.000
#> GSM241474 1 0.601 0.921 0.628 0.372 0.000
#> GSM241475 2 0.000 0.909 0.000 1.000 0.000
#> GSM241476 1 0.601 0.921 0.628 0.372 0.000
#> GSM241477 2 0.000 0.909 0.000 1.000 0.000
#> GSM241478 2 0.000 0.909 0.000 1.000 0.000
#> GSM241479 1 0.601 0.921 0.628 0.372 0.000
#> GSM241480 1 0.601 0.921 0.628 0.372 0.000
#> GSM241481 2 0.000 0.909 0.000 1.000 0.000
#> GSM241482 1 0.601 0.921 0.628 0.372 0.000
#> GSM241483 2 0.000 0.909 0.000 1.000 0.000
#> GSM241484 1 0.601 0.921 0.628 0.372 0.000
#> GSM241485 1 0.601 0.921 0.628 0.372 0.000
#> GSM241486 2 0.000 0.909 0.000 1.000 0.000
#> GSM241487 2 0.000 0.909 0.000 1.000 0.000
#> GSM241488 2 0.000 0.909 0.000 1.000 0.000
#> GSM241489 1 0.601 0.921 0.628 0.372 0.000
#> GSM241490 1 0.601 0.921 0.628 0.372 0.000
#> GSM241491 2 0.000 0.909 0.000 1.000 0.000
#> GSM241492 1 0.601 0.921 0.628 0.372 0.000
#> GSM241493 2 0.000 0.909 0.000 1.000 0.000
#> GSM241494 1 0.601 0.921 0.628 0.372 0.000
#> GSM241495 2 0.000 0.909 0.000 1.000 0.000
#> GSM241496 2 0.000 0.909 0.000 1.000 0.000
#> GSM241497 1 0.601 0.921 0.628 0.372 0.000
#> GSM241498 1 0.601 0.921 0.628 0.372 0.000
#> GSM241499 1 0.601 0.921 0.628 0.372 0.000
#> GSM241500 2 0.601 0.510 0.000 0.628 0.372
#> GSM241501 2 0.412 0.718 0.000 0.832 0.168
#> GSM241502 2 0.440 0.696 0.000 0.812 0.188
#> GSM241503 1 0.835 0.675 0.628 0.188 0.184
#> GSM241504 1 0.786 0.558 0.628 0.088 0.284
#> GSM241505 1 0.786 0.558 0.628 0.088 0.284
#> GSM241506 2 0.604 0.498 0.000 0.620 0.380
#> GSM241507 1 0.601 0.921 0.628 0.372 0.000
#> GSM241508 2 0.601 0.510 0.000 0.628 0.372
#> GSM241509 3 0.271 0.831 0.088 0.000 0.912
#> GSM241510 3 0.000 0.810 0.000 0.000 1.000
#> GSM241511 3 0.000 0.810 0.000 0.000 1.000
#> GSM241512 3 0.280 0.832 0.092 0.000 0.908
#> GSM241513 3 0.601 0.858 0.372 0.000 0.628
#> GSM241514 3 0.601 0.858 0.372 0.000 0.628
#> GSM241515 3 0.601 0.858 0.372 0.000 0.628
#> GSM241516 3 0.601 0.858 0.372 0.000 0.628
#> GSM241517 3 0.601 0.858 0.372 0.000 0.628
#> GSM241518 3 0.601 0.858 0.372 0.000 0.628
#> GSM241519 3 0.601 0.858 0.372 0.000 0.628
#> GSM241520 3 0.601 0.858 0.372 0.000 0.628
#> GSM241521 3 0.601 0.858 0.372 0.000 0.628
#> GSM241522 1 0.525 -0.323 0.736 0.000 0.264
#> GSM241523 3 0.601 0.858 0.372 0.000 0.628
#> GSM241524 3 0.601 0.858 0.372 0.000 0.628
#> GSM241525 3 0.000 0.810 0.000 0.000 1.000
#> GSM241526 3 0.000 0.810 0.000 0.000 1.000
#> GSM241527 3 0.000 0.810 0.000 0.000 1.000
#> GSM241528 3 0.000 0.810 0.000 0.000 1.000
#> GSM241529 3 0.000 0.810 0.000 0.000 1.000
#> GSM241530 3 0.000 0.810 0.000 0.000 1.000
#> GSM241531 3 0.000 0.810 0.000 0.000 1.000
#> GSM241532 3 0.000 0.810 0.000 0.000 1.000
#> GSM241533 3 0.000 0.810 0.000 0.000 1.000
#> GSM241534 3 0.000 0.810 0.000 0.000 1.000
#> GSM241535 3 0.000 0.810 0.000 0.000 1.000
#> GSM241536 3 0.000 0.810 0.000 0.000 1.000
#> GSM241537 3 0.525 0.861 0.264 0.000 0.736
#> GSM241538 3 0.525 0.861 0.264 0.000 0.736
#> GSM241539 3 0.525 0.861 0.264 0.000 0.736
#> GSM241540 3 0.525 0.861 0.264 0.000 0.736
#> GSM241541 3 0.525 0.861 0.264 0.000 0.736
#> GSM241542 3 0.525 0.861 0.264 0.000 0.736
#> GSM241543 3 0.601 0.858 0.372 0.000 0.628
#> GSM241544 3 0.601 0.858 0.372 0.000 0.628
#> GSM241545 3 0.601 0.858 0.372 0.000 0.628
#> GSM241546 3 0.601 0.858 0.372 0.000 0.628
#> GSM241547 3 0.601 0.858 0.372 0.000 0.628
#> GSM241548 3 0.601 0.858 0.372 0.000 0.628
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241453 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241455 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241457 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241458 1 0.0188 0.991 0.996 0.004 0.000 0.000
#> GSM241459 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241460 1 0.0188 0.991 0.996 0.004 0.000 0.000
#> GSM241461 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241462 1 0.0188 0.991 0.996 0.004 0.000 0.000
#> GSM241463 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241465 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241467 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241468 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241470 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241473 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241475 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241477 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241480 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241481 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241482 1 0.0188 0.991 0.996 0.004 0.000 0.000
#> GSM241483 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241484 1 0.0188 0.991 0.996 0.004 0.000 0.000
#> GSM241485 1 0.0188 0.991 0.996 0.004 0.000 0.000
#> GSM241486 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241487 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241488 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241490 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241491 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241493 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241495 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.982 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241498 1 0.0336 0.992 0.992 0.008 0.000 0.000
#> GSM241499 1 0.0188 0.986 0.996 0.000 0.000 0.004
#> GSM241500 2 0.4356 0.616 0.000 0.708 0.000 0.292
#> GSM241501 2 0.0188 0.978 0.000 0.996 0.000 0.004
#> GSM241502 2 0.2469 0.880 0.000 0.892 0.000 0.108
#> GSM241503 1 0.0592 0.978 0.984 0.000 0.000 0.016
#> GSM241504 1 0.1867 0.926 0.928 0.000 0.000 0.072
#> GSM241505 1 0.1867 0.926 0.928 0.000 0.000 0.072
#> GSM241506 4 0.3610 0.721 0.000 0.200 0.000 0.800
#> GSM241507 1 0.0188 0.986 0.996 0.000 0.000 0.004
#> GSM241508 2 0.2081 0.908 0.000 0.916 0.000 0.084
#> GSM241509 4 0.0336 0.937 0.000 0.000 0.008 0.992
#> GSM241510 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241511 4 0.0336 0.934 0.008 0.000 0.000 0.992
#> GSM241512 4 0.1474 0.917 0.000 0.000 0.052 0.948
#> GSM241513 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241514 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241515 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241516 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241517 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241518 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241519 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241520 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241521 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241522 3 0.0188 0.995 0.000 0.000 0.996 0.004
#> GSM241523 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241524 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241525 4 0.0000 0.936 0.000 0.000 0.000 1.000
#> GSM241526 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241527 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241528 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241529 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241530 4 0.0000 0.936 0.000 0.000 0.000 1.000
#> GSM241531 4 0.0188 0.935 0.004 0.000 0.000 0.996
#> GSM241532 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241533 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241534 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241535 4 0.0188 0.938 0.000 0.000 0.004 0.996
#> GSM241536 4 0.0336 0.934 0.008 0.000 0.000 0.992
#> GSM241537 4 0.3266 0.842 0.000 0.000 0.168 0.832
#> GSM241538 4 0.3266 0.842 0.000 0.000 0.168 0.832
#> GSM241539 4 0.3266 0.842 0.000 0.000 0.168 0.832
#> GSM241540 4 0.3266 0.842 0.000 0.000 0.168 0.832
#> GSM241541 4 0.3266 0.842 0.000 0.000 0.168 0.832
#> GSM241542 4 0.3266 0.842 0.000 0.000 0.168 0.832
#> GSM241543 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241544 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241545 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241546 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241547 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM241548 3 0.0000 1.000 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241452 1 0.0404 0.930 0.988 0.012 0.000 0.000 0.000
#> GSM241453 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241454 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241455 2 0.0162 0.903 0.000 0.996 0.000 0.000 0.004
#> GSM241456 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241457 2 0.1792 0.838 0.000 0.916 0.000 0.000 0.084
#> GSM241458 1 0.0798 0.929 0.976 0.008 0.000 0.000 0.016
#> GSM241459 2 0.1792 0.838 0.000 0.916 0.000 0.000 0.084
#> GSM241460 1 0.1018 0.927 0.968 0.016 0.000 0.000 0.016
#> GSM241461 2 0.4305 -0.352 0.000 0.512 0.000 0.000 0.488
#> GSM241462 1 0.1168 0.926 0.960 0.008 0.000 0.000 0.032
#> GSM241463 2 0.0290 0.901 0.000 0.992 0.000 0.000 0.008
#> GSM241464 1 0.1300 0.919 0.956 0.028 0.000 0.000 0.016
#> GSM241465 2 0.0404 0.900 0.000 0.988 0.000 0.000 0.012
#> GSM241466 1 0.0798 0.929 0.976 0.008 0.000 0.000 0.016
#> GSM241467 1 0.0798 0.929 0.976 0.008 0.000 0.000 0.016
#> GSM241468 2 0.0404 0.900 0.000 0.988 0.000 0.000 0.012
#> GSM241469 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241470 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241471 2 0.0404 0.900 0.000 0.988 0.000 0.000 0.012
#> GSM241472 1 0.0798 0.929 0.976 0.008 0.000 0.000 0.016
#> GSM241473 2 0.0404 0.900 0.000 0.988 0.000 0.000 0.012
#> GSM241474 1 0.1018 0.927 0.968 0.016 0.000 0.000 0.016
#> GSM241475 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241476 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241477 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241478 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241479 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241480 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241481 2 0.1792 0.838 0.000 0.916 0.000 0.000 0.084
#> GSM241482 1 0.0798 0.929 0.976 0.008 0.000 0.000 0.016
#> GSM241483 2 0.3242 0.631 0.000 0.784 0.000 0.000 0.216
#> GSM241484 1 0.0579 0.929 0.984 0.008 0.000 0.000 0.008
#> GSM241485 1 0.1168 0.926 0.960 0.008 0.000 0.000 0.032
#> GSM241486 2 0.4306 -0.353 0.000 0.508 0.000 0.000 0.492
#> GSM241487 2 0.0290 0.903 0.000 0.992 0.000 0.000 0.008
#> GSM241488 2 0.0290 0.904 0.000 0.992 0.000 0.000 0.008
#> GSM241489 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241490 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241491 2 0.0290 0.901 0.000 0.992 0.000 0.000 0.008
#> GSM241492 1 0.1117 0.925 0.964 0.020 0.000 0.000 0.016
#> GSM241493 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241494 1 0.0798 0.929 0.976 0.008 0.000 0.000 0.016
#> GSM241495 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241496 2 0.0404 0.904 0.000 0.988 0.000 0.000 0.012
#> GSM241497 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241498 1 0.0290 0.931 0.992 0.008 0.000 0.000 0.000
#> GSM241499 1 0.3707 0.695 0.716 0.000 0.000 0.000 0.284
#> GSM241500 5 0.5480 0.731 0.000 0.176 0.000 0.168 0.656
#> GSM241501 5 0.4375 0.491 0.000 0.420 0.000 0.004 0.576
#> GSM241502 5 0.5210 0.731 0.000 0.184 0.000 0.132 0.684
#> GSM241503 1 0.4367 0.581 0.620 0.000 0.000 0.008 0.372
#> GSM241504 1 0.4505 0.558 0.604 0.000 0.000 0.012 0.384
#> GSM241505 1 0.4482 0.570 0.612 0.000 0.000 0.012 0.376
#> GSM241506 5 0.4302 0.576 0.000 0.048 0.000 0.208 0.744
#> GSM241507 1 0.3816 0.691 0.696 0.000 0.000 0.000 0.304
#> GSM241508 5 0.4708 0.458 0.000 0.436 0.000 0.016 0.548
#> GSM241509 4 0.0404 0.871 0.000 0.000 0.000 0.988 0.012
#> GSM241510 4 0.2966 0.739 0.000 0.000 0.000 0.816 0.184
#> GSM241511 4 0.4046 0.668 0.008 0.000 0.000 0.696 0.296
#> GSM241512 4 0.0324 0.872 0.000 0.000 0.004 0.992 0.004
#> GSM241513 3 0.0703 0.981 0.000 0.000 0.976 0.000 0.024
#> GSM241514 3 0.0703 0.981 0.000 0.000 0.976 0.000 0.024
#> GSM241515 3 0.0865 0.979 0.000 0.000 0.972 0.004 0.024
#> GSM241516 3 0.0865 0.979 0.000 0.000 0.972 0.004 0.024
#> GSM241517 3 0.0703 0.981 0.000 0.000 0.976 0.000 0.024
#> GSM241518 3 0.0703 0.981 0.000 0.000 0.976 0.000 0.024
#> GSM241519 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241520 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241521 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241522 3 0.1168 0.958 0.008 0.000 0.960 0.000 0.032
#> GSM241523 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241524 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241525 4 0.2471 0.830 0.000 0.000 0.000 0.864 0.136
#> GSM241526 4 0.1792 0.855 0.000 0.000 0.000 0.916 0.084
#> GSM241527 4 0.1792 0.855 0.000 0.000 0.000 0.916 0.084
#> GSM241528 4 0.1851 0.853 0.000 0.000 0.000 0.912 0.088
#> GSM241529 4 0.1851 0.853 0.000 0.000 0.000 0.912 0.088
#> GSM241530 4 0.2127 0.844 0.000 0.000 0.000 0.892 0.108
#> GSM241531 4 0.3582 0.748 0.008 0.000 0.000 0.768 0.224
#> GSM241532 4 0.1410 0.859 0.000 0.000 0.000 0.940 0.060
#> GSM241533 4 0.0404 0.871 0.000 0.000 0.000 0.988 0.012
#> GSM241534 4 0.0000 0.871 0.000 0.000 0.000 1.000 0.000
#> GSM241535 4 0.0000 0.871 0.000 0.000 0.000 1.000 0.000
#> GSM241536 4 0.3700 0.731 0.008 0.000 0.000 0.752 0.240
#> GSM241537 4 0.2597 0.845 0.000 0.000 0.092 0.884 0.024
#> GSM241538 4 0.2597 0.845 0.000 0.000 0.092 0.884 0.024
#> GSM241539 4 0.2597 0.845 0.000 0.000 0.092 0.884 0.024
#> GSM241540 4 0.2597 0.845 0.000 0.000 0.092 0.884 0.024
#> GSM241541 4 0.2597 0.845 0.000 0.000 0.092 0.884 0.024
#> GSM241542 4 0.2597 0.845 0.000 0.000 0.092 0.884 0.024
#> GSM241543 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241544 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241545 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241546 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241547 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM241548 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0405 0.93286 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM241452 1 0.2020 0.91559 0.896 0.008 0.000 0.000 0.000 0.096
#> GSM241453 2 0.0260 0.93330 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM241454 1 0.1714 0.92080 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241455 2 0.0622 0.93317 0.000 0.980 0.000 0.000 0.008 0.012
#> GSM241456 1 0.1714 0.92080 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241457 2 0.3141 0.83880 0.004 0.836 0.000 0.000 0.112 0.048
#> GSM241458 1 0.0632 0.91084 0.976 0.000 0.000 0.000 0.000 0.024
#> GSM241459 2 0.3185 0.83428 0.004 0.832 0.000 0.000 0.116 0.048
#> GSM241460 1 0.1003 0.90425 0.964 0.004 0.000 0.000 0.004 0.028
#> GSM241461 5 0.3789 0.58665 0.000 0.332 0.000 0.000 0.660 0.008
#> GSM241462 1 0.1444 0.87821 0.928 0.000 0.000 0.000 0.000 0.072
#> GSM241463 2 0.1760 0.91767 0.004 0.928 0.000 0.000 0.020 0.048
#> GSM241464 1 0.1760 0.86962 0.928 0.020 0.000 0.000 0.004 0.048
#> GSM241465 2 0.1092 0.92847 0.000 0.960 0.000 0.000 0.020 0.020
#> GSM241466 1 0.0146 0.91568 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM241467 1 0.0363 0.91370 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM241468 2 0.1218 0.92700 0.004 0.956 0.000 0.000 0.012 0.028
#> GSM241469 1 0.1765 0.91975 0.904 0.000 0.000 0.000 0.000 0.096
#> GSM241470 2 0.0405 0.93286 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM241471 2 0.1693 0.91842 0.004 0.932 0.000 0.000 0.020 0.044
#> GSM241472 1 0.0547 0.91116 0.980 0.000 0.000 0.000 0.000 0.020
#> GSM241473 2 0.1693 0.91842 0.004 0.932 0.000 0.000 0.020 0.044
#> GSM241474 1 0.0922 0.90486 0.968 0.004 0.000 0.000 0.004 0.024
#> GSM241475 2 0.0405 0.93286 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM241476 1 0.1714 0.92080 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241477 2 0.0146 0.93385 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM241478 2 0.0508 0.93195 0.000 0.984 0.000 0.000 0.004 0.012
#> GSM241479 1 0.1714 0.92080 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241480 1 0.1714 0.92080 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241481 2 0.3141 0.83880 0.004 0.836 0.000 0.000 0.112 0.048
#> GSM241482 1 0.0632 0.91084 0.976 0.000 0.000 0.000 0.000 0.024
#> GSM241483 2 0.4020 0.56705 0.000 0.692 0.000 0.000 0.276 0.032
#> GSM241484 1 0.2048 0.89585 0.880 0.000 0.000 0.000 0.000 0.120
#> GSM241485 1 0.1387 0.88221 0.932 0.000 0.000 0.000 0.000 0.068
#> GSM241486 5 0.3758 0.60173 0.000 0.324 0.000 0.000 0.668 0.008
#> GSM241487 2 0.0717 0.93174 0.000 0.976 0.000 0.000 0.016 0.008
#> GSM241488 2 0.0405 0.93386 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM241489 1 0.1714 0.92080 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241490 1 0.1714 0.92080 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241491 2 0.1760 0.91767 0.004 0.928 0.000 0.000 0.020 0.048
#> GSM241492 1 0.1410 0.88645 0.944 0.008 0.000 0.000 0.004 0.044
#> GSM241493 2 0.0405 0.93286 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM241494 1 0.0000 0.91633 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0405 0.93286 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM241496 2 0.0405 0.93286 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM241497 1 0.1765 0.91975 0.904 0.000 0.000 0.000 0.000 0.096
#> GSM241498 1 0.1765 0.91975 0.904 0.000 0.000 0.000 0.000 0.096
#> GSM241499 6 0.3266 0.66752 0.272 0.000 0.000 0.000 0.000 0.728
#> GSM241500 5 0.1958 0.72703 0.000 0.004 0.000 0.100 0.896 0.000
#> GSM241501 5 0.2178 0.77129 0.000 0.132 0.000 0.000 0.868 0.000
#> GSM241502 5 0.2563 0.74802 0.000 0.040 0.000 0.068 0.884 0.008
#> GSM241503 6 0.3977 0.73056 0.200 0.000 0.000 0.016 0.032 0.752
#> GSM241504 6 0.3906 0.73221 0.180 0.000 0.000 0.020 0.032 0.768
#> GSM241505 6 0.3906 0.73221 0.180 0.000 0.000 0.020 0.032 0.768
#> GSM241506 5 0.2586 0.70671 0.000 0.000 0.000 0.100 0.868 0.032
#> GSM241507 6 0.3652 0.65535 0.324 0.000 0.000 0.000 0.004 0.672
#> GSM241508 5 0.3771 0.75649 0.000 0.132 0.000 0.032 0.800 0.036
#> GSM241509 4 0.0790 0.80534 0.000 0.000 0.000 0.968 0.032 0.000
#> GSM241510 4 0.4150 0.50262 0.000 0.000 0.000 0.652 0.320 0.028
#> GSM241511 6 0.3714 0.37129 0.000 0.000 0.000 0.340 0.004 0.656
#> GSM241512 4 0.0820 0.80310 0.000 0.000 0.000 0.972 0.012 0.016
#> GSM241513 3 0.3942 0.83277 0.000 0.000 0.780 0.008 0.092 0.120
#> GSM241514 3 0.3808 0.83607 0.000 0.000 0.792 0.008 0.088 0.112
#> GSM241515 3 0.4294 0.81795 0.000 0.000 0.760 0.020 0.092 0.128
#> GSM241516 3 0.4401 0.81034 0.000 0.000 0.756 0.028 0.088 0.128
#> GSM241517 3 0.3984 0.83014 0.000 0.000 0.776 0.008 0.092 0.124
#> GSM241518 3 0.3900 0.83497 0.000 0.000 0.784 0.008 0.092 0.116
#> GSM241519 3 0.0291 0.91209 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM241520 3 0.0000 0.91261 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241521 3 0.0291 0.91209 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM241522 3 0.2006 0.82901 0.004 0.000 0.892 0.000 0.000 0.104
#> GSM241523 3 0.0291 0.91209 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM241524 3 0.0000 0.91261 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241525 4 0.3563 0.73029 0.000 0.000 0.000 0.796 0.072 0.132
#> GSM241526 4 0.2776 0.78240 0.000 0.000 0.000 0.860 0.088 0.052
#> GSM241527 4 0.2685 0.78279 0.000 0.000 0.000 0.868 0.072 0.060
#> GSM241528 4 0.2776 0.78240 0.000 0.000 0.000 0.860 0.088 0.052
#> GSM241529 4 0.2776 0.78240 0.000 0.000 0.000 0.860 0.088 0.052
#> GSM241530 4 0.3017 0.77084 0.000 0.000 0.000 0.844 0.072 0.084
#> GSM241531 4 0.3997 -0.13218 0.000 0.000 0.000 0.508 0.004 0.488
#> GSM241532 4 0.2983 0.74161 0.000 0.000 0.000 0.832 0.136 0.032
#> GSM241533 4 0.0790 0.80514 0.000 0.000 0.000 0.968 0.032 0.000
#> GSM241534 4 0.0713 0.80547 0.000 0.000 0.000 0.972 0.028 0.000
#> GSM241535 4 0.0363 0.80305 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM241536 6 0.3999 -0.00996 0.000 0.000 0.000 0.496 0.004 0.500
#> GSM241537 4 0.3656 0.75947 0.000 0.000 0.008 0.804 0.076 0.112
#> GSM241538 4 0.3656 0.75947 0.000 0.000 0.008 0.804 0.076 0.112
#> GSM241539 4 0.3656 0.75947 0.000 0.000 0.008 0.804 0.076 0.112
#> GSM241540 4 0.3656 0.75947 0.000 0.000 0.008 0.804 0.076 0.112
#> GSM241541 4 0.3708 0.75666 0.000 0.000 0.008 0.800 0.080 0.112
#> GSM241542 4 0.3708 0.75666 0.000 0.000 0.008 0.800 0.080 0.112
#> GSM241543 3 0.0000 0.91261 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241544 3 0.0000 0.91261 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241545 3 0.0000 0.91261 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241546 3 0.0000 0.91261 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241547 3 0.0291 0.91209 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM241548 3 0.0000 0.91261 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> CV:skmeans 98 3.00e-16 4.64e-01 2
#> CV:skmeans 96 1.11e-13 6.38e-01 3
#> CV:skmeans 98 1.71e-15 1.05e-04 4
#> CV:skmeans 94 3.12e-17 3.55e-05 5
#> CV:skmeans 95 3.71e-20 1.18e-04 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.719 0.910 0.954 0.4798 0.508 0.508
#> 3 3 0.823 0.783 0.907 0.3846 0.642 0.403
#> 4 4 0.822 0.812 0.914 0.0849 0.927 0.791
#> 5 5 0.738 0.700 0.869 0.0479 0.962 0.871
#> 6 6 0.869 0.814 0.922 0.0384 0.918 0.705
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
#> GSM241451 1 0.000 0.972 1.000 0.000
#> GSM241452 1 0.000 0.972 1.000 0.000
#> GSM241453 1 0.000 0.972 1.000 0.000
#> GSM241454 1 0.000 0.972 1.000 0.000
#> GSM241455 1 0.000 0.972 1.000 0.000
#> GSM241456 1 0.000 0.972 1.000 0.000
#> GSM241457 1 0.000 0.972 1.000 0.000
#> GSM241458 1 0.000 0.972 1.000 0.000
#> GSM241459 1 0.000 0.972 1.000 0.000
#> GSM241460 1 0.000 0.972 1.000 0.000
#> GSM241461 1 0.000 0.972 1.000 0.000
#> GSM241462 1 0.000 0.972 1.000 0.000
#> GSM241463 1 0.000 0.972 1.000 0.000
#> GSM241464 1 0.000 0.972 1.000 0.000
#> GSM241465 1 0.000 0.972 1.000 0.000
#> GSM241466 1 0.000 0.972 1.000 0.000
#> GSM241467 1 0.000 0.972 1.000 0.000
#> GSM241468 1 0.000 0.972 1.000 0.000
#> GSM241469 1 0.000 0.972 1.000 0.000
#> GSM241470 1 0.000 0.972 1.000 0.000
#> GSM241471 1 0.000 0.972 1.000 0.000
#> GSM241472 1 0.000 0.972 1.000 0.000
#> GSM241473 1 0.000 0.972 1.000 0.000
#> GSM241474 1 0.000 0.972 1.000 0.000
#> GSM241475 1 0.000 0.972 1.000 0.000
#> GSM241476 1 0.000 0.972 1.000 0.000
#> GSM241477 1 0.000 0.972 1.000 0.000
#> GSM241478 1 0.000 0.972 1.000 0.000
#> GSM241479 1 0.000 0.972 1.000 0.000
#> GSM241480 1 0.000 0.972 1.000 0.000
#> GSM241481 1 0.000 0.972 1.000 0.000
#> GSM241482 1 0.000 0.972 1.000 0.000
#> GSM241483 1 0.000 0.972 1.000 0.000
#> GSM241484 1 0.000 0.972 1.000 0.000
#> GSM241485 1 0.000 0.972 1.000 0.000
#> GSM241486 1 0.000 0.972 1.000 0.000
#> GSM241487 1 0.000 0.972 1.000 0.000
#> GSM241488 1 0.000 0.972 1.000 0.000
#> GSM241489 1 0.000 0.972 1.000 0.000
#> GSM241490 1 0.443 0.877 0.908 0.092
#> GSM241491 1 0.000 0.972 1.000 0.000
#> GSM241492 1 0.000 0.972 1.000 0.000
#> GSM241493 1 0.000 0.972 1.000 0.000
#> GSM241494 1 0.000 0.972 1.000 0.000
#> GSM241495 1 0.000 0.972 1.000 0.000
#> GSM241496 1 0.000 0.972 1.000 0.000
#> GSM241497 1 0.000 0.972 1.000 0.000
#> GSM241498 1 0.000 0.972 1.000 0.000
#> GSM241499 1 0.000 0.972 1.000 0.000
#> GSM241500 1 0.662 0.758 0.828 0.172
#> GSM241501 1 0.000 0.972 1.000 0.000
#> GSM241502 1 0.000 0.972 1.000 0.000
#> GSM241503 1 0.000 0.972 1.000 0.000
#> GSM241504 1 0.563 0.822 0.868 0.132
#> GSM241505 1 0.929 0.480 0.656 0.344
#> GSM241506 1 0.985 0.104 0.572 0.428
#> GSM241507 1 0.814 0.636 0.748 0.252
#> GSM241508 2 0.980 0.421 0.416 0.584
#> GSM241509 2 0.000 0.919 0.000 1.000
#> GSM241510 2 0.644 0.849 0.164 0.836
#> GSM241511 2 0.644 0.849 0.164 0.836
#> GSM241512 2 0.000 0.919 0.000 1.000
#> GSM241513 2 0.644 0.849 0.164 0.836
#> GSM241514 2 0.000 0.919 0.000 1.000
#> GSM241515 2 0.644 0.849 0.164 0.836
#> GSM241516 2 0.644 0.849 0.164 0.836
#> GSM241517 2 0.714 0.819 0.196 0.804
#> GSM241518 2 0.644 0.849 0.164 0.836
#> GSM241519 2 0.753 0.796 0.216 0.784
#> GSM241520 2 0.482 0.884 0.104 0.896
#> GSM241521 2 0.886 0.664 0.304 0.696
#> GSM241522 2 0.644 0.849 0.164 0.836
#> GSM241523 2 0.753 0.796 0.216 0.784
#> GSM241524 2 0.000 0.919 0.000 1.000
#> GSM241525 2 0.163 0.911 0.024 0.976
#> GSM241526 2 0.260 0.905 0.044 0.956
#> GSM241527 2 0.000 0.919 0.000 1.000
#> GSM241528 2 0.311 0.899 0.056 0.944
#> GSM241529 2 0.278 0.903 0.048 0.952
#> GSM241530 2 0.000 0.919 0.000 1.000
#> GSM241531 2 0.000 0.919 0.000 1.000
#> GSM241532 2 0.000 0.919 0.000 1.000
#> GSM241533 2 0.000 0.919 0.000 1.000
#> GSM241534 2 0.000 0.919 0.000 1.000
#> GSM241535 2 0.000 0.919 0.000 1.000
#> GSM241536 2 0.000 0.919 0.000 1.000
#> GSM241537 2 0.000 0.919 0.000 1.000
#> GSM241538 2 0.000 0.919 0.000 1.000
#> GSM241539 2 0.000 0.919 0.000 1.000
#> GSM241540 2 0.000 0.919 0.000 1.000
#> GSM241541 2 0.000 0.919 0.000 1.000
#> GSM241542 2 0.000 0.919 0.000 1.000
#> GSM241543 2 0.000 0.919 0.000 1.000
#> GSM241544 2 0.000 0.919 0.000 1.000
#> GSM241545 2 0.644 0.849 0.164 0.836
#> GSM241546 2 0.000 0.919 0.000 1.000
#> GSM241547 2 0.506 0.880 0.112 0.888
#> GSM241548 2 0.000 0.919 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241452 1 0.0747 0.935 0.984 0.000 0.016
#> GSM241453 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241454 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241455 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241456 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241457 3 0.9707 -0.664 0.228 0.340 0.432
#> GSM241458 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241459 2 0.9910 0.445 0.344 0.384 0.272
#> GSM241460 1 0.0829 0.935 0.984 0.004 0.012
#> GSM241461 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241462 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241463 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241464 1 0.0424 0.942 0.992 0.000 0.008
#> GSM241465 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241466 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241468 2 0.9182 0.676 0.204 0.536 0.260
#> GSM241469 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241470 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241471 2 0.7248 0.818 0.028 0.536 0.436
#> GSM241472 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241473 2 0.7346 0.816 0.032 0.536 0.432
#> GSM241474 1 0.0237 0.944 0.996 0.004 0.000
#> GSM241475 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241476 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241477 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241478 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241479 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241481 2 0.7542 0.811 0.040 0.528 0.432
#> GSM241482 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241483 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241484 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241486 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241487 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241488 2 0.7438 0.814 0.036 0.536 0.428
#> GSM241489 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241491 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241492 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241493 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241494 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241495 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241496 2 0.6919 0.823 0.016 0.536 0.448
#> GSM241497 1 0.0237 0.944 0.996 0.004 0.000
#> GSM241498 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241499 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241500 2 0.6641 0.819 0.008 0.544 0.448
#> GSM241501 2 0.6786 0.821 0.012 0.540 0.448
#> GSM241502 2 0.6786 0.821 0.012 0.540 0.448
#> GSM241503 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241504 1 0.1031 0.928 0.976 0.000 0.024
#> GSM241505 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241506 2 0.6260 0.814 0.000 0.552 0.448
#> GSM241507 1 0.0000 0.947 1.000 0.000 0.000
#> GSM241508 2 0.6225 0.808 0.000 0.568 0.432
#> GSM241509 3 0.6280 0.948 0.000 0.460 0.540
#> GSM241510 2 0.0237 0.326 0.004 0.996 0.000
#> GSM241511 1 0.6286 0.136 0.536 0.464 0.000
#> GSM241512 3 0.6286 0.947 0.000 0.464 0.536
#> GSM241513 2 0.0237 0.326 0.004 0.996 0.000
#> GSM241514 3 0.6500 0.946 0.004 0.464 0.532
#> GSM241515 2 0.0237 0.326 0.004 0.996 0.000
#> GSM241516 1 0.6286 0.136 0.536 0.464 0.000
#> GSM241517 2 0.0000 0.331 0.000 1.000 0.000
#> GSM241518 2 0.0237 0.326 0.004 0.996 0.000
#> GSM241519 2 0.0000 0.331 0.000 1.000 0.000
#> GSM241520 2 0.4784 -0.323 0.004 0.796 0.200
#> GSM241521 2 0.2448 0.451 0.000 0.924 0.076
#> GSM241522 1 0.6286 0.136 0.536 0.464 0.000
#> GSM241523 2 0.0237 0.323 0.000 0.996 0.004
#> GSM241524 3 0.6505 0.943 0.004 0.468 0.528
#> GSM241525 3 0.6912 0.938 0.016 0.444 0.540
#> GSM241526 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241527 3 0.6280 0.948 0.000 0.460 0.540
#> GSM241528 3 0.6095 0.870 0.000 0.392 0.608
#> GSM241529 3 0.6260 0.941 0.000 0.448 0.552
#> GSM241530 3 0.6280 0.948 0.000 0.460 0.540
#> GSM241531 3 0.6495 0.947 0.004 0.460 0.536
#> GSM241532 3 0.6280 0.948 0.000 0.460 0.540
#> GSM241533 3 0.6280 0.948 0.000 0.460 0.540
#> GSM241534 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241535 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241536 3 0.6280 0.948 0.000 0.460 0.540
#> GSM241537 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241538 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241539 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241540 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241541 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241542 3 0.6260 0.947 0.000 0.448 0.552
#> GSM241543 3 0.6286 0.947 0.000 0.464 0.536
#> GSM241544 3 0.6286 0.947 0.000 0.464 0.536
#> GSM241545 2 0.0237 0.323 0.000 0.996 0.004
#> GSM241546 3 0.6500 0.946 0.004 0.464 0.532
#> GSM241547 2 0.3816 -0.139 0.000 0.852 0.148
#> GSM241548 3 0.6286 0.947 0.000 0.464 0.536
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0592 0.9431 0.984 0.016 0.000 0.000
#> GSM241453 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241457 2 0.4008 0.6111 0.244 0.756 0.000 0.000
#> GSM241458 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241459 2 0.4746 0.4436 0.368 0.632 0.000 0.000
#> GSM241460 1 0.0336 0.9506 0.992 0.008 0.000 0.000
#> GSM241461 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241462 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241468 2 0.3610 0.6970 0.200 0.800 0.000 0.000
#> GSM241469 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0469 0.8701 0.012 0.988 0.000 0.000
#> GSM241472 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0592 0.8677 0.016 0.984 0.000 0.000
#> GSM241474 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0921 0.8594 0.028 0.972 0.000 0.000
#> GSM241482 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241483 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241484 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241486 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241487 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241488 2 0.1022 0.8564 0.032 0.968 0.000 0.000
#> GSM241489 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0188 0.9540 0.996 0.004 0.000 0.000
#> GSM241498 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241500 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241501 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241502 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241503 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241504 1 0.0817 0.9350 0.976 0.024 0.000 0.000
#> GSM241505 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241506 2 0.0000 0.8764 0.000 1.000 0.000 0.000
#> GSM241507 1 0.0000 0.9575 1.000 0.000 0.000 0.000
#> GSM241508 2 0.0592 0.8671 0.000 0.984 0.016 0.000
#> GSM241509 4 0.3610 0.7920 0.000 0.000 0.200 0.800
#> GSM241510 2 0.5327 0.5999 0.000 0.720 0.220 0.060
#> GSM241511 1 0.3801 0.6616 0.780 0.000 0.220 0.000
#> GSM241512 4 0.4967 0.4127 0.000 0.000 0.452 0.548
#> GSM241513 2 0.4999 0.1138 0.000 0.508 0.492 0.000
#> GSM241514 3 0.0000 0.9558 0.000 0.000 1.000 0.000
#> GSM241515 2 0.4999 0.1138 0.000 0.508 0.492 0.000
#> GSM241516 1 0.4989 0.0849 0.528 0.000 0.472 0.000
#> GSM241517 2 0.3801 0.6578 0.000 0.780 0.220 0.000
#> GSM241518 2 0.4999 0.1138 0.000 0.508 0.492 0.000
#> GSM241519 2 0.4933 0.2806 0.000 0.568 0.432 0.000
#> GSM241520 3 0.0000 0.9558 0.000 0.000 1.000 0.000
#> GSM241521 2 0.4817 0.3802 0.000 0.612 0.388 0.000
#> GSM241522 1 0.4933 0.2095 0.568 0.000 0.432 0.000
#> GSM241523 3 0.4072 0.5967 0.000 0.252 0.748 0.000
#> GSM241524 3 0.0000 0.9558 0.000 0.000 1.000 0.000
#> GSM241525 4 0.6823 0.5808 0.196 0.000 0.200 0.604
#> GSM241526 4 0.0000 0.7967 0.000 0.000 0.000 1.000
#> GSM241527 4 0.4134 0.7576 0.000 0.000 0.260 0.740
#> GSM241528 4 0.6823 0.5505 0.000 0.196 0.200 0.604
#> GSM241529 4 0.4755 0.7654 0.000 0.040 0.200 0.760
#> GSM241530 4 0.5147 0.7620 0.060 0.000 0.200 0.740
#> GSM241531 4 0.3801 0.7833 0.000 0.000 0.220 0.780
#> GSM241532 4 0.3649 0.7908 0.000 0.000 0.204 0.796
#> GSM241533 4 0.3610 0.7920 0.000 0.000 0.200 0.800
#> GSM241534 4 0.0000 0.7967 0.000 0.000 0.000 1.000
#> GSM241535 4 0.0592 0.8027 0.000 0.000 0.016 0.984
#> GSM241536 4 0.3764 0.7855 0.000 0.000 0.216 0.784
#> GSM241537 4 0.0000 0.7967 0.000 0.000 0.000 1.000
#> GSM241538 4 0.1792 0.7898 0.000 0.000 0.068 0.932
#> GSM241539 4 0.0707 0.7982 0.000 0.000 0.020 0.980
#> GSM241540 4 0.2011 0.7886 0.000 0.000 0.080 0.920
#> GSM241541 4 0.0000 0.7967 0.000 0.000 0.000 1.000
#> GSM241542 4 0.2011 0.7886 0.000 0.000 0.080 0.920
#> GSM241543 3 0.0000 0.9558 0.000 0.000 1.000 0.000
#> GSM241544 3 0.0000 0.9558 0.000 0.000 1.000 0.000
#> GSM241545 3 0.0000 0.9558 0.000 0.000 1.000 0.000
#> GSM241546 3 0.0000 0.9558 0.000 0.000 1.000 0.000
#> GSM241547 3 0.0000 0.9558 0.000 0.000 1.000 0.000
#> GSM241548 3 0.0000 0.9558 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0510 0.918977 0.984 0.016 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241457 2 0.1908 0.759555 0.092 0.908 0.000 0.000 0.000
#> GSM241458 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241459 2 0.3424 0.603496 0.240 0.760 0.000 0.000 0.000
#> GSM241460 1 0.0290 0.927025 0.992 0.008 0.000 0.000 0.000
#> GSM241461 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241462 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.0290 0.927025 0.992 0.008 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.3109 0.651851 0.200 0.800 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0404 0.818216 0.012 0.988 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0510 0.816314 0.016 0.984 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241481 2 0.0510 0.816314 0.016 0.984 0.000 0.000 0.000
#> GSM241482 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241483 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241484 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241486 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241487 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241488 2 0.0880 0.806327 0.032 0.968 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.823045 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0162 0.930466 0.996 0.004 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241500 2 0.3534 0.611209 0.000 0.744 0.000 0.256 0.000
#> GSM241501 2 0.3480 0.620404 0.000 0.752 0.000 0.248 0.000
#> GSM241502 2 0.3508 0.615956 0.000 0.748 0.000 0.252 0.000
#> GSM241503 1 0.2230 0.809740 0.884 0.000 0.000 0.116 0.000
#> GSM241504 1 0.4114 0.585384 0.732 0.024 0.000 0.244 0.000
#> GSM241505 1 0.3452 0.617120 0.756 0.000 0.000 0.244 0.000
#> GSM241506 2 0.3480 0.620404 0.000 0.752 0.000 0.248 0.000
#> GSM241507 1 0.0000 0.933587 1.000 0.000 0.000 0.000 0.000
#> GSM241508 2 0.3861 0.597078 0.000 0.728 0.008 0.264 0.000
#> GSM241509 4 0.2280 0.581650 0.000 0.000 0.120 0.880 0.000
#> GSM241510 4 0.7640 0.346000 0.000 0.136 0.120 0.480 0.264
#> GSM241511 4 0.8257 0.278216 0.280 0.000 0.120 0.336 0.264
#> GSM241512 4 0.7735 0.407040 0.144 0.000 0.124 0.468 0.264
#> GSM241513 2 0.8097 0.097357 0.000 0.404 0.208 0.124 0.264
#> GSM241514 3 0.5158 0.476525 0.000 0.000 0.656 0.080 0.264
#> GSM241515 2 0.8296 -0.193787 0.000 0.308 0.124 0.304 0.264
#> GSM241516 1 0.7542 0.065858 0.492 0.000 0.120 0.124 0.264
#> GSM241517 2 0.7098 0.308285 0.000 0.536 0.120 0.080 0.264
#> GSM241518 2 0.8780 0.078185 0.052 0.388 0.208 0.088 0.264
#> GSM241519 2 0.7383 0.030707 0.000 0.408 0.344 0.040 0.208
#> GSM241520 3 0.0000 0.903062 0.000 0.000 1.000 0.000 0.000
#> GSM241521 2 0.7752 0.255527 0.000 0.492 0.172 0.192 0.144
#> GSM241522 1 0.7704 0.000173 0.448 0.000 0.208 0.080 0.264
#> GSM241523 3 0.3395 0.568347 0.000 0.236 0.764 0.000 0.000
#> GSM241524 3 0.0609 0.885656 0.000 0.000 0.980 0.020 0.000
#> GSM241525 4 0.2648 0.524679 0.152 0.000 0.000 0.848 0.000
#> GSM241526 4 0.1732 0.504672 0.000 0.000 0.000 0.920 0.080
#> GSM241527 4 0.2020 0.531585 0.000 0.000 0.000 0.900 0.100
#> GSM241528 4 0.2561 0.498086 0.000 0.144 0.000 0.856 0.000
#> GSM241529 4 0.0000 0.574604 0.000 0.000 0.000 1.000 0.000
#> GSM241530 4 0.2648 0.524679 0.152 0.000 0.000 0.848 0.000
#> GSM241531 4 0.5620 0.460717 0.000 0.000 0.120 0.616 0.264
#> GSM241532 4 0.3134 0.577474 0.000 0.000 0.120 0.848 0.032
#> GSM241533 4 0.0000 0.574604 0.000 0.000 0.000 1.000 0.000
#> GSM241534 4 0.3932 -0.043254 0.000 0.000 0.000 0.672 0.328
#> GSM241535 4 0.3895 -0.020879 0.000 0.000 0.000 0.680 0.320
#> GSM241536 4 0.5620 0.460717 0.000 0.000 0.120 0.616 0.264
#> GSM241537 5 0.3586 0.706006 0.000 0.000 0.000 0.264 0.736
#> GSM241538 5 0.3561 0.708754 0.000 0.000 0.000 0.260 0.740
#> GSM241539 5 0.0000 0.728757 0.000 0.000 0.000 0.000 1.000
#> GSM241540 5 0.0000 0.728757 0.000 0.000 0.000 0.000 1.000
#> GSM241541 5 0.3586 0.706006 0.000 0.000 0.000 0.264 0.736
#> GSM241542 5 0.0000 0.728757 0.000 0.000 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.903062 0.000 0.000 1.000 0.000 0.000
#> GSM241544 3 0.0000 0.903062 0.000 0.000 1.000 0.000 0.000
#> GSM241545 3 0.0000 0.903062 0.000 0.000 1.000 0.000 0.000
#> GSM241546 3 0.0000 0.903062 0.000 0.000 1.000 0.000 0.000
#> GSM241547 3 0.0000 0.903062 0.000 0.000 1.000 0.000 0.000
#> GSM241548 3 0.0000 0.903062 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241452 1 0.0458 0.950 0.984 0.016 0.000 0.000 0 0.000
#> GSM241453 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241454 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241455 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241456 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241457 2 0.1204 0.879 0.056 0.944 0.000 0.000 0 0.000
#> GSM241458 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241459 2 0.2969 0.659 0.224 0.776 0.000 0.000 0 0.000
#> GSM241460 1 0.0146 0.965 0.996 0.004 0.000 0.000 0 0.000
#> GSM241461 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241462 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241463 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241464 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241465 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241466 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241467 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241468 2 0.2793 0.685 0.200 0.800 0.000 0.000 0 0.000
#> GSM241469 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241470 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241471 2 0.0363 0.915 0.012 0.988 0.000 0.000 0 0.000
#> GSM241472 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241473 2 0.0458 0.913 0.016 0.984 0.000 0.000 0 0.000
#> GSM241474 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241475 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241476 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241477 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241478 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241479 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241480 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241481 2 0.0458 0.913 0.016 0.984 0.000 0.000 0 0.000
#> GSM241482 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241483 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241484 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241485 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241486 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241487 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241488 2 0.0790 0.899 0.032 0.968 0.000 0.000 0 0.000
#> GSM241489 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241490 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241491 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241492 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241493 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241494 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241495 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241496 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241497 1 0.0146 0.966 0.996 0.004 0.000 0.000 0 0.000
#> GSM241498 1 0.0000 0.970 1.000 0.000 0.000 0.000 0 0.000
#> GSM241499 1 0.2793 0.709 0.800 0.000 0.000 0.000 0 0.200
#> GSM241500 2 0.1910 0.821 0.000 0.892 0.000 0.000 0 0.108
#> GSM241501 2 0.0000 0.922 0.000 1.000 0.000 0.000 0 0.000
#> GSM241502 2 0.0547 0.910 0.000 0.980 0.000 0.000 0 0.020
#> GSM241503 6 0.3774 0.349 0.408 0.000 0.000 0.000 0 0.592
#> GSM241504 6 0.4263 0.408 0.376 0.024 0.000 0.000 0 0.600
#> GSM241505 6 0.3747 0.376 0.396 0.000 0.000 0.000 0 0.604
#> GSM241506 2 0.1267 0.874 0.000 0.940 0.000 0.000 0 0.060
#> GSM241507 6 0.3446 0.513 0.308 0.000 0.000 0.000 0 0.692
#> GSM241508 2 0.3765 0.268 0.000 0.596 0.000 0.000 0 0.404
#> GSM241509 4 0.3446 0.612 0.000 0.000 0.000 0.692 0 0.308
#> GSM241510 6 0.0713 0.626 0.000 0.000 0.000 0.028 0 0.972
#> GSM241511 6 0.0000 0.633 0.000 0.000 0.000 0.000 0 1.000
#> GSM241512 6 0.0000 0.633 0.000 0.000 0.000 0.000 0 1.000
#> GSM241513 6 0.4829 0.216 0.000 0.424 0.056 0.000 0 0.520
#> GSM241514 3 0.3607 0.453 0.000 0.000 0.652 0.000 0 0.348
#> GSM241515 6 0.3890 0.316 0.000 0.400 0.004 0.000 0 0.596
#> GSM241516 6 0.0632 0.633 0.024 0.000 0.000 0.000 0 0.976
#> GSM241517 6 0.3833 0.208 0.000 0.444 0.000 0.000 0 0.556
#> GSM241518 6 0.4062 0.561 0.160 0.064 0.012 0.000 0 0.764
#> GSM241519 2 0.4258 0.122 0.000 0.516 0.468 0.016 0 0.000
#> GSM241520 3 0.0000 0.897 0.000 0.000 1.000 0.000 0 0.000
#> GSM241521 2 0.5123 0.459 0.000 0.628 0.184 0.000 0 0.188
#> GSM241522 1 0.4524 0.201 0.560 0.000 0.036 0.000 0 0.404
#> GSM241523 3 0.3126 0.561 0.000 0.248 0.752 0.000 0 0.000
#> GSM241524 3 0.1387 0.844 0.000 0.000 0.932 0.000 0 0.068
#> GSM241525 4 0.3867 0.686 0.052 0.000 0.000 0.748 0 0.200
#> GSM241526 4 0.0000 0.886 0.000 0.000 0.000 1.000 0 0.000
#> GSM241527 4 0.0713 0.892 0.000 0.000 0.000 0.972 0 0.028
#> GSM241528 4 0.0713 0.892 0.000 0.000 0.000 0.972 0 0.028
#> GSM241529 4 0.0632 0.892 0.000 0.000 0.000 0.976 0 0.024
#> GSM241530 4 0.0713 0.892 0.000 0.000 0.000 0.972 0 0.028
#> GSM241531 6 0.0000 0.633 0.000 0.000 0.000 0.000 0 1.000
#> GSM241532 6 0.2793 0.464 0.000 0.000 0.000 0.200 0 0.800
#> GSM241533 4 0.1910 0.848 0.000 0.000 0.000 0.892 0 0.108
#> GSM241534 4 0.1910 0.848 0.000 0.000 0.000 0.892 0 0.108
#> GSM241535 4 0.0000 0.886 0.000 0.000 0.000 1.000 0 0.000
#> GSM241536 6 0.0632 0.628 0.000 0.000 0.000 0.024 0 0.976
#> GSM241537 5 0.0000 1.000 0.000 0.000 0.000 0.000 1 0.000
#> GSM241538 5 0.0000 1.000 0.000 0.000 0.000 0.000 1 0.000
#> GSM241539 5 0.0000 1.000 0.000 0.000 0.000 0.000 1 0.000
#> GSM241540 5 0.0000 1.000 0.000 0.000 0.000 0.000 1 0.000
#> GSM241541 5 0.0000 1.000 0.000 0.000 0.000 0.000 1 0.000
#> GSM241542 5 0.0000 1.000 0.000 0.000 0.000 0.000 1 0.000
#> GSM241543 3 0.0000 0.897 0.000 0.000 1.000 0.000 0 0.000
#> GSM241544 3 0.0000 0.897 0.000 0.000 1.000 0.000 0 0.000
#> GSM241545 3 0.0000 0.897 0.000 0.000 1.000 0.000 0 0.000
#> GSM241546 3 0.0000 0.897 0.000 0.000 1.000 0.000 0 0.000
#> GSM241547 3 0.0000 0.897 0.000 0.000 1.000 0.000 0 0.000
#> GSM241548 3 0.0000 0.897 0.000 0.000 1.000 0.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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> CV:pam 95 3.58e-16 2.48e-01 2
#> CV:pam 82 6.67e-13 9.16e-01 3
#> CV:pam 89 1.99e-13 2.02e-04 4
#> CV:pam 81 1.86e-10 1.54e-07 5
#> CV:pam 86 4.23e-14 3.89e-09 6
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 16250 rows and 98 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 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.408 0.853 0.900 0.4614 0.495 0.495
#> 3 3 0.907 0.911 0.940 0.3508 0.863 0.730
#> 4 4 0.781 0.923 0.913 0.1870 0.854 0.620
#> 5 5 0.782 0.868 0.863 0.0533 0.922 0.701
#> 6 6 0.830 0.762 0.831 0.0362 0.968 0.852
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
#> GSM241451 1 0.0000 0.814 1.000 0.000
#> GSM241452 1 0.8081 0.825 0.752 0.248
#> GSM241453 1 0.0000 0.814 1.000 0.000
#> GSM241454 1 0.8081 0.825 0.752 0.248
#> GSM241455 1 0.0000 0.814 1.000 0.000
#> GSM241456 1 0.8081 0.825 0.752 0.248
#> GSM241457 1 0.0938 0.816 0.988 0.012
#> GSM241458 1 0.8081 0.825 0.752 0.248
#> GSM241459 1 0.0000 0.814 1.000 0.000
#> GSM241460 1 0.8081 0.825 0.752 0.248
#> GSM241461 1 0.6531 0.690 0.832 0.168
#> GSM241462 1 0.8081 0.825 0.752 0.248
#> GSM241463 1 0.0000 0.814 1.000 0.000
#> GSM241464 1 0.7883 0.825 0.764 0.236
#> GSM241465 1 0.0000 0.814 1.000 0.000
#> GSM241466 1 0.8081 0.825 0.752 0.248
#> GSM241467 1 0.8081 0.825 0.752 0.248
#> GSM241468 1 0.0000 0.814 1.000 0.000
#> GSM241469 1 0.8081 0.825 0.752 0.248
#> GSM241470 1 0.0000 0.814 1.000 0.000
#> GSM241471 1 0.0000 0.814 1.000 0.000
#> GSM241472 1 0.8081 0.825 0.752 0.248
#> GSM241473 1 0.0000 0.814 1.000 0.000
#> GSM241474 1 0.8081 0.825 0.752 0.248
#> GSM241475 1 0.0000 0.814 1.000 0.000
#> GSM241476 1 0.8081 0.825 0.752 0.248
#> GSM241477 1 0.0000 0.814 1.000 0.000
#> GSM241478 1 0.0000 0.814 1.000 0.000
#> GSM241479 1 0.8081 0.825 0.752 0.248
#> GSM241480 1 0.8081 0.825 0.752 0.248
#> GSM241481 1 0.0000 0.814 1.000 0.000
#> GSM241482 1 0.8081 0.825 0.752 0.248
#> GSM241483 1 0.0000 0.814 1.000 0.000
#> GSM241484 1 0.8081 0.825 0.752 0.248
#> GSM241485 1 0.8081 0.825 0.752 0.248
#> GSM241486 1 0.6973 0.664 0.812 0.188
#> GSM241487 1 0.7219 0.646 0.800 0.200
#> GSM241488 1 0.7528 0.825 0.784 0.216
#> GSM241489 1 0.8081 0.825 0.752 0.248
#> GSM241490 1 0.8081 0.825 0.752 0.248
#> GSM241491 1 0.0000 0.814 1.000 0.000
#> GSM241492 1 0.8081 0.825 0.752 0.248
#> GSM241493 1 0.0000 0.814 1.000 0.000
#> GSM241494 1 0.8081 0.825 0.752 0.248
#> GSM241495 1 0.0000 0.814 1.000 0.000
#> GSM241496 1 0.8081 0.825 0.752 0.248
#> GSM241497 1 0.8081 0.825 0.752 0.248
#> GSM241498 1 0.8081 0.825 0.752 0.248
#> GSM241499 2 0.2423 0.906 0.040 0.960
#> GSM241500 2 0.0376 0.925 0.004 0.996
#> GSM241501 2 0.9580 0.513 0.380 0.620
#> GSM241502 2 0.2423 0.906 0.040 0.960
#> GSM241503 2 0.1414 0.922 0.020 0.980
#> GSM241504 2 0.1184 0.920 0.016 0.984
#> GSM241505 2 0.0376 0.925 0.004 0.996
#> GSM241506 2 0.0672 0.924 0.008 0.992
#> GSM241507 2 0.2423 0.906 0.040 0.960
#> GSM241508 2 0.0376 0.925 0.004 0.996
#> GSM241509 2 0.0000 0.926 0.000 1.000
#> GSM241510 2 0.0000 0.926 0.000 1.000
#> GSM241511 2 0.0000 0.926 0.000 1.000
#> GSM241512 2 0.0000 0.926 0.000 1.000
#> GSM241513 2 0.5737 0.860 0.136 0.864
#> GSM241514 2 0.5737 0.860 0.136 0.864
#> GSM241515 2 0.4022 0.894 0.080 0.920
#> GSM241516 2 0.0000 0.926 0.000 1.000
#> GSM241517 2 0.5842 0.856 0.140 0.860
#> GSM241518 2 0.5737 0.860 0.136 0.864
#> GSM241519 2 0.5737 0.860 0.136 0.864
#> GSM241520 2 0.5737 0.860 0.136 0.864
#> GSM241521 2 0.5842 0.856 0.140 0.860
#> GSM241522 2 0.5842 0.856 0.140 0.860
#> GSM241523 2 0.5737 0.860 0.136 0.864
#> GSM241524 2 0.5737 0.860 0.136 0.864
#> GSM241525 2 0.0000 0.926 0.000 1.000
#> GSM241526 2 0.0000 0.926 0.000 1.000
#> GSM241527 2 0.0000 0.926 0.000 1.000
#> GSM241528 2 0.0000 0.926 0.000 1.000
#> GSM241529 2 0.0000 0.926 0.000 1.000
#> GSM241530 2 0.0000 0.926 0.000 1.000
#> GSM241531 2 0.0000 0.926 0.000 1.000
#> GSM241532 2 0.0000 0.926 0.000 1.000
#> GSM241533 2 0.0000 0.926 0.000 1.000
#> GSM241534 2 0.0000 0.926 0.000 1.000
#> GSM241535 2 0.0000 0.926 0.000 1.000
#> GSM241536 2 0.0000 0.926 0.000 1.000
#> GSM241537 2 0.0000 0.926 0.000 1.000
#> GSM241538 2 0.0000 0.926 0.000 1.000
#> GSM241539 2 0.0000 0.926 0.000 1.000
#> GSM241540 2 0.0000 0.926 0.000 1.000
#> GSM241541 2 0.0000 0.926 0.000 1.000
#> GSM241542 2 0.0000 0.926 0.000 1.000
#> GSM241543 2 0.5737 0.860 0.136 0.864
#> GSM241544 2 0.5737 0.860 0.136 0.864
#> GSM241545 2 0.5737 0.860 0.136 0.864
#> GSM241546 2 0.5737 0.860 0.136 0.864
#> GSM241547 2 0.5737 0.860 0.136 0.864
#> GSM241548 2 0.5737 0.860 0.136 0.864
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.3116 0.918 0.108 0.892 0.000
#> GSM241452 1 0.1753 0.955 0.952 0.048 0.000
#> GSM241453 2 0.1964 0.947 0.056 0.944 0.000
#> GSM241454 1 0.1289 0.959 0.968 0.032 0.000
#> GSM241455 2 0.2066 0.947 0.060 0.940 0.000
#> GSM241456 1 0.1289 0.959 0.968 0.032 0.000
#> GSM241457 2 0.2384 0.944 0.056 0.936 0.008
#> GSM241458 1 0.1529 0.941 0.960 0.040 0.000
#> GSM241459 2 0.1964 0.947 0.056 0.944 0.000
#> GSM241460 1 0.1878 0.938 0.952 0.044 0.004
#> GSM241461 2 0.2846 0.934 0.056 0.924 0.020
#> GSM241462 1 0.0237 0.941 0.996 0.004 0.000
#> GSM241463 2 0.2066 0.947 0.060 0.940 0.000
#> GSM241464 2 0.6305 0.119 0.484 0.516 0.000
#> GSM241465 2 0.2200 0.946 0.056 0.940 0.004
#> GSM241466 1 0.1289 0.959 0.968 0.032 0.000
#> GSM241467 1 0.2261 0.946 0.932 0.068 0.000
#> GSM241468 2 0.3619 0.890 0.136 0.864 0.000
#> GSM241469 1 0.1753 0.956 0.952 0.048 0.000
#> GSM241470 2 0.3038 0.921 0.104 0.896 0.000
#> GSM241471 2 0.1964 0.947 0.056 0.944 0.000
#> GSM241472 1 0.2356 0.944 0.928 0.072 0.000
#> GSM241473 2 0.2066 0.947 0.060 0.940 0.000
#> GSM241474 1 0.2356 0.944 0.928 0.072 0.000
#> GSM241475 2 0.2165 0.947 0.064 0.936 0.000
#> GSM241476 1 0.1289 0.959 0.968 0.032 0.000
#> GSM241477 2 0.1964 0.947 0.056 0.944 0.000
#> GSM241478 2 0.2711 0.933 0.088 0.912 0.000
#> GSM241479 1 0.1289 0.959 0.968 0.032 0.000
#> GSM241480 1 0.1289 0.959 0.968 0.032 0.000
#> GSM241481 2 0.1964 0.947 0.056 0.944 0.000
#> GSM241482 1 0.1529 0.941 0.960 0.040 0.000
#> GSM241483 2 0.1964 0.947 0.056 0.944 0.000
#> GSM241484 1 0.0000 0.937 1.000 0.000 0.000
#> GSM241485 1 0.1289 0.959 0.968 0.032 0.000
#> GSM241486 2 0.2846 0.934 0.056 0.924 0.020
#> GSM241487 2 0.3500 0.809 0.004 0.880 0.116
#> GSM241488 2 0.5070 0.770 0.224 0.772 0.004
#> GSM241489 1 0.1860 0.955 0.948 0.052 0.000
#> GSM241490 1 0.6393 0.716 0.764 0.088 0.148
#> GSM241491 2 0.2066 0.947 0.060 0.940 0.000
#> GSM241492 1 0.4291 0.813 0.820 0.180 0.000
#> GSM241493 2 0.2165 0.947 0.064 0.936 0.000
#> GSM241494 1 0.1289 0.959 0.968 0.032 0.000
#> GSM241495 2 0.2261 0.945 0.068 0.932 0.000
#> GSM241496 3 0.9713 -0.172 0.220 0.376 0.404
#> GSM241497 1 0.2902 0.944 0.920 0.064 0.016
#> GSM241498 1 0.1411 0.958 0.964 0.036 0.000
#> GSM241499 3 0.7890 0.189 0.432 0.056 0.512
#> GSM241500 3 0.1964 0.921 0.000 0.056 0.944
#> GSM241501 3 0.2261 0.911 0.000 0.068 0.932
#> GSM241502 3 0.2356 0.908 0.000 0.072 0.928
#> GSM241503 3 0.3237 0.922 0.032 0.056 0.912
#> GSM241504 3 0.3237 0.922 0.032 0.056 0.912
#> GSM241505 3 0.3237 0.922 0.032 0.056 0.912
#> GSM241506 3 0.1860 0.924 0.000 0.052 0.948
#> GSM241507 3 0.3237 0.922 0.032 0.056 0.912
#> GSM241508 3 0.1964 0.921 0.000 0.056 0.944
#> GSM241509 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241510 3 0.0424 0.954 0.000 0.008 0.992
#> GSM241511 3 0.3237 0.922 0.032 0.056 0.912
#> GSM241512 3 0.1411 0.947 0.000 0.036 0.964
#> GSM241513 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241514 3 0.1411 0.947 0.000 0.036 0.964
#> GSM241515 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241516 3 0.1411 0.947 0.000 0.036 0.964
#> GSM241517 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241518 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241519 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241520 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241521 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241522 3 0.1411 0.947 0.000 0.036 0.964
#> GSM241523 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241524 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241525 3 0.2446 0.935 0.012 0.052 0.936
#> GSM241526 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241527 3 0.1411 0.947 0.000 0.036 0.964
#> GSM241528 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241529 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241530 3 0.2280 0.937 0.008 0.052 0.940
#> GSM241531 3 0.2446 0.935 0.012 0.052 0.936
#> GSM241532 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241533 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241534 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241535 3 0.1411 0.947 0.000 0.036 0.964
#> GSM241536 3 0.3112 0.924 0.028 0.056 0.916
#> GSM241537 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241544 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241545 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241546 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241547 3 0.0000 0.957 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.957 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241452 1 0.3801 0.945 0.780 0.220 0.000 0.000
#> GSM241453 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241454 1 0.3266 0.950 0.832 0.168 0.000 0.000
#> GSM241455 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241456 1 0.3444 0.952 0.816 0.184 0.000 0.000
#> GSM241457 2 0.1022 0.964 0.032 0.968 0.000 0.000
#> GSM241458 1 0.3342 0.885 0.868 0.100 0.000 0.032
#> GSM241459 2 0.1022 0.964 0.032 0.968 0.000 0.000
#> GSM241460 1 0.2408 0.909 0.896 0.104 0.000 0.000
#> GSM241461 2 0.1302 0.938 0.000 0.956 0.000 0.044
#> GSM241462 1 0.2589 0.919 0.884 0.116 0.000 0.000
#> GSM241463 2 0.0188 0.976 0.004 0.996 0.000 0.000
#> GSM241464 2 0.1022 0.955 0.032 0.968 0.000 0.000
#> GSM241465 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241466 1 0.3400 0.952 0.820 0.180 0.000 0.000
#> GSM241467 1 0.3444 0.952 0.816 0.184 0.000 0.000
#> GSM241468 2 0.1022 0.964 0.032 0.968 0.000 0.000
#> GSM241469 1 0.3764 0.947 0.784 0.216 0.000 0.000
#> GSM241470 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241471 2 0.1022 0.964 0.032 0.968 0.000 0.000
#> GSM241472 1 0.3444 0.952 0.816 0.184 0.000 0.000
#> GSM241473 2 0.1022 0.964 0.032 0.968 0.000 0.000
#> GSM241474 1 0.3444 0.952 0.816 0.184 0.000 0.000
#> GSM241475 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241476 1 0.3726 0.948 0.788 0.212 0.000 0.000
#> GSM241477 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241479 1 0.3444 0.952 0.816 0.184 0.000 0.000
#> GSM241480 1 0.3266 0.950 0.832 0.168 0.000 0.000
#> GSM241481 2 0.1022 0.964 0.032 0.968 0.000 0.000
#> GSM241482 1 0.2345 0.906 0.900 0.100 0.000 0.000
#> GSM241483 2 0.0188 0.976 0.004 0.996 0.000 0.000
#> GSM241484 1 0.2345 0.906 0.900 0.100 0.000 0.000
#> GSM241485 1 0.3219 0.949 0.836 0.164 0.000 0.000
#> GSM241486 2 0.1302 0.938 0.000 0.956 0.000 0.044
#> GSM241487 2 0.2926 0.866 0.000 0.896 0.056 0.048
#> GSM241488 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241489 1 0.3764 0.947 0.784 0.216 0.000 0.000
#> GSM241490 1 0.3831 0.946 0.792 0.204 0.000 0.004
#> GSM241491 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241492 1 0.4277 0.846 0.720 0.280 0.000 0.000
#> GSM241493 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241494 1 0.3764 0.947 0.784 0.216 0.000 0.000
#> GSM241495 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.977 0.000 1.000 0.000 0.000
#> GSM241497 1 0.3801 0.945 0.780 0.220 0.000 0.000
#> GSM241498 1 0.3764 0.947 0.784 0.216 0.000 0.000
#> GSM241499 4 0.5054 0.724 0.328 0.008 0.004 0.660
#> GSM241500 3 0.3301 0.906 0.048 0.000 0.876 0.076
#> GSM241501 3 0.3521 0.907 0.032 0.016 0.876 0.076
#> GSM241502 3 0.3521 0.907 0.032 0.016 0.876 0.076
#> GSM241503 4 0.4761 0.737 0.332 0.000 0.004 0.664
#> GSM241504 4 0.3626 0.876 0.184 0.000 0.004 0.812
#> GSM241505 4 0.3626 0.876 0.184 0.000 0.004 0.812
#> GSM241506 3 0.5898 0.432 0.048 0.000 0.604 0.348
#> GSM241507 4 0.3626 0.876 0.184 0.000 0.004 0.812
#> GSM241508 3 0.3370 0.903 0.048 0.000 0.872 0.080
#> GSM241509 4 0.4206 0.826 0.048 0.000 0.136 0.816
#> GSM241510 4 0.4257 0.822 0.048 0.000 0.140 0.812
#> GSM241511 4 0.4004 0.876 0.164 0.000 0.024 0.812
#> GSM241512 4 0.4356 0.836 0.064 0.000 0.124 0.812
#> GSM241513 3 0.1854 0.934 0.012 0.000 0.940 0.048
#> GSM241514 3 0.1975 0.933 0.016 0.000 0.936 0.048
#> GSM241515 3 0.2926 0.919 0.048 0.000 0.896 0.056
#> GSM241516 3 0.4010 0.871 0.064 0.000 0.836 0.100
#> GSM241517 3 0.1854 0.934 0.012 0.000 0.940 0.048
#> GSM241518 3 0.1854 0.934 0.012 0.000 0.940 0.048
#> GSM241519 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241520 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241521 3 0.1854 0.931 0.000 0.012 0.940 0.048
#> GSM241522 3 0.2287 0.928 0.004 0.012 0.924 0.060
#> GSM241523 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241524 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241525 4 0.3082 0.902 0.084 0.000 0.032 0.884
#> GSM241526 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241527 4 0.0469 0.925 0.012 0.000 0.000 0.988
#> GSM241528 4 0.2840 0.896 0.044 0.000 0.056 0.900
#> GSM241529 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241530 4 0.1305 0.923 0.036 0.000 0.004 0.960
#> GSM241531 4 0.1118 0.923 0.036 0.000 0.000 0.964
#> GSM241532 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241533 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241534 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241535 4 0.0469 0.925 0.012 0.000 0.000 0.988
#> GSM241536 4 0.1474 0.921 0.052 0.000 0.000 0.948
#> GSM241537 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241538 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241539 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241540 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241541 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241542 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241544 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241545 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241546 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241547 3 0.0000 0.933 0.000 0.000 1.000 0.000
#> GSM241548 3 0.0000 0.933 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241452 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241454 1 0.0162 0.964 0.996 0.000 0.000 0.000 0.004
#> GSM241455 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241456 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241457 2 0.3653 0.944 0.124 0.828 0.000 0.036 0.012
#> GSM241458 1 0.1410 0.941 0.940 0.000 0.000 0.000 0.060
#> GSM241459 2 0.2865 0.976 0.132 0.856 0.000 0.004 0.008
#> GSM241460 1 0.1410 0.941 0.940 0.000 0.000 0.000 0.060
#> GSM241461 2 0.4218 0.933 0.128 0.804 0.004 0.040 0.024
#> GSM241462 1 0.1341 0.942 0.944 0.000 0.000 0.000 0.056
#> GSM241463 2 0.2583 0.979 0.132 0.864 0.000 0.000 0.004
#> GSM241464 2 0.3521 0.882 0.232 0.764 0.000 0.000 0.004
#> GSM241465 2 0.2818 0.977 0.132 0.856 0.000 0.000 0.012
#> GSM241466 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241469 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241471 2 0.2583 0.979 0.132 0.864 0.000 0.000 0.004
#> GSM241472 1 0.0162 0.964 0.996 0.000 0.000 0.000 0.004
#> GSM241473 2 0.2583 0.979 0.132 0.864 0.000 0.000 0.004
#> GSM241474 1 0.0324 0.962 0.992 0.004 0.000 0.000 0.004
#> GSM241475 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241476 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241478 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241479 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241481 2 0.2976 0.976 0.132 0.852 0.000 0.004 0.012
#> GSM241482 1 0.1410 0.941 0.940 0.000 0.000 0.000 0.060
#> GSM241483 2 0.2753 0.978 0.136 0.856 0.000 0.000 0.008
#> GSM241484 1 0.1341 0.942 0.944 0.000 0.000 0.000 0.056
#> GSM241485 1 0.1270 0.945 0.948 0.000 0.000 0.000 0.052
#> GSM241486 2 0.4263 0.934 0.132 0.800 0.004 0.040 0.024
#> GSM241487 2 0.3972 0.943 0.124 0.820 0.024 0.008 0.024
#> GSM241488 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241489 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0579 0.959 0.984 0.000 0.000 0.008 0.008
#> GSM241491 2 0.2583 0.979 0.132 0.864 0.000 0.000 0.004
#> GSM241492 1 0.4268 0.303 0.648 0.344 0.000 0.000 0.008
#> GSM241493 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241494 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.2629 0.979 0.136 0.860 0.000 0.000 0.004
#> GSM241496 2 0.3124 0.970 0.136 0.844 0.016 0.000 0.004
#> GSM241497 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.965 1.000 0.000 0.000 0.000 0.000
#> GSM241499 5 0.3386 0.710 0.020 0.084 0.016 0.016 0.864
#> GSM241500 5 0.5389 0.694 0.000 0.044 0.224 0.044 0.688
#> GSM241501 5 0.6157 0.684 0.036 0.052 0.220 0.032 0.660
#> GSM241502 5 0.6272 0.662 0.056 0.068 0.216 0.012 0.648
#> GSM241503 5 0.3386 0.710 0.020 0.084 0.016 0.016 0.864
#> GSM241504 5 0.3164 0.714 0.012 0.076 0.016 0.020 0.876
#> GSM241505 5 0.3164 0.714 0.012 0.076 0.016 0.020 0.876
#> GSM241506 5 0.5211 0.709 0.000 0.044 0.200 0.044 0.712
#> GSM241507 5 0.3164 0.714 0.012 0.076 0.016 0.020 0.876
#> GSM241508 5 0.5389 0.694 0.000 0.044 0.224 0.044 0.688
#> GSM241509 4 0.5329 0.514 0.000 0.036 0.044 0.684 0.236
#> GSM241510 5 0.5862 0.448 0.000 0.044 0.032 0.372 0.552
#> GSM241511 5 0.5484 0.689 0.000 0.076 0.032 0.200 0.692
#> GSM241512 5 0.4865 0.656 0.000 0.004 0.048 0.268 0.680
#> GSM241513 3 0.3301 0.829 0.000 0.008 0.856 0.048 0.088
#> GSM241514 5 0.5187 0.586 0.000 0.004 0.336 0.048 0.612
#> GSM241515 3 0.5466 0.148 0.000 0.008 0.572 0.052 0.368
#> GSM241516 5 0.5154 0.679 0.000 0.016 0.252 0.052 0.680
#> GSM241517 3 0.3412 0.826 0.000 0.012 0.852 0.048 0.088
#> GSM241518 3 0.3062 0.838 0.000 0.004 0.868 0.048 0.080
#> GSM241519 3 0.0404 0.911 0.000 0.000 0.988 0.012 0.000
#> GSM241520 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
#> GSM241521 3 0.2744 0.855 0.024 0.004 0.900 0.048 0.024
#> GSM241522 5 0.6208 0.354 0.044 0.000 0.432 0.048 0.476
#> GSM241523 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
#> GSM241524 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
#> GSM241525 5 0.5701 0.624 0.000 0.060 0.032 0.268 0.640
#> GSM241526 4 0.0451 0.938 0.000 0.008 0.000 0.988 0.004
#> GSM241527 4 0.0404 0.937 0.000 0.000 0.000 0.988 0.012
#> GSM241528 5 0.5880 0.716 0.000 0.036 0.104 0.196 0.664
#> GSM241529 4 0.0671 0.936 0.000 0.016 0.000 0.980 0.004
#> GSM241530 4 0.3906 0.605 0.000 0.016 0.000 0.744 0.240
#> GSM241531 4 0.2036 0.894 0.000 0.056 0.000 0.920 0.024
#> GSM241532 4 0.0579 0.936 0.000 0.008 0.000 0.984 0.008
#> GSM241533 4 0.0579 0.936 0.000 0.008 0.000 0.984 0.008
#> GSM241534 4 0.0579 0.936 0.000 0.008 0.000 0.984 0.008
#> GSM241535 4 0.0510 0.935 0.000 0.000 0.000 0.984 0.016
#> GSM241536 4 0.2554 0.871 0.000 0.072 0.000 0.892 0.036
#> GSM241537 4 0.0000 0.940 0.000 0.000 0.000 1.000 0.000
#> GSM241538 4 0.0000 0.940 0.000 0.000 0.000 1.000 0.000
#> GSM241539 4 0.0000 0.940 0.000 0.000 0.000 1.000 0.000
#> GSM241540 4 0.0000 0.940 0.000 0.000 0.000 1.000 0.000
#> GSM241541 4 0.0000 0.940 0.000 0.000 0.000 1.000 0.000
#> GSM241542 4 0.0000 0.940 0.000 0.000 0.000 1.000 0.000
#> GSM241543 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
#> GSM241544 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
#> GSM241545 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
#> GSM241546 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
#> GSM241547 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
#> GSM241548 3 0.0000 0.918 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.4060 0.7830 0.032 0.684 0.000 0.000 0.000 0.284
#> GSM241452 1 0.1367 0.9332 0.944 0.044 0.000 0.000 0.000 0.012
#> GSM241453 2 0.0935 0.8733 0.032 0.964 0.000 0.000 0.000 0.004
#> GSM241454 1 0.1333 0.9330 0.944 0.048 0.000 0.000 0.000 0.008
#> GSM241455 2 0.0935 0.8733 0.032 0.964 0.000 0.000 0.000 0.004
#> GSM241456 1 0.1349 0.9336 0.940 0.056 0.000 0.000 0.000 0.004
#> GSM241457 2 0.2630 0.8478 0.032 0.872 0.000 0.000 0.092 0.004
#> GSM241458 1 0.3861 0.8611 0.756 0.060 0.000 0.000 0.000 0.184
#> GSM241459 2 0.2630 0.8478 0.032 0.872 0.000 0.000 0.092 0.004
#> GSM241460 1 0.3819 0.8751 0.764 0.064 0.000 0.000 0.000 0.172
#> GSM241461 2 0.2544 0.8017 0.004 0.852 0.000 0.000 0.140 0.004
#> GSM241462 1 0.3295 0.8797 0.816 0.056 0.000 0.000 0.000 0.128
#> GSM241463 2 0.0935 0.8733 0.032 0.964 0.000 0.000 0.000 0.004
#> GSM241464 2 0.5088 0.7218 0.168 0.632 0.000 0.000 0.000 0.200
#> GSM241465 2 0.1116 0.8717 0.028 0.960 0.000 0.000 0.008 0.004
#> GSM241466 1 0.1349 0.9336 0.940 0.056 0.000 0.000 0.000 0.004
#> GSM241467 1 0.2389 0.9243 0.888 0.060 0.000 0.000 0.000 0.052
#> GSM241468 2 0.3427 0.8440 0.032 0.804 0.000 0.000 0.008 0.156
#> GSM241469 1 0.1434 0.9338 0.940 0.048 0.000 0.000 0.000 0.012
#> GSM241470 2 0.4060 0.7830 0.032 0.684 0.000 0.000 0.000 0.284
#> GSM241471 2 0.1049 0.8726 0.032 0.960 0.000 0.000 0.008 0.000
#> GSM241472 1 0.2740 0.9164 0.864 0.060 0.000 0.000 0.000 0.076
#> GSM241473 2 0.1049 0.8726 0.032 0.960 0.000 0.000 0.008 0.000
#> GSM241474 1 0.2799 0.9146 0.860 0.064 0.000 0.000 0.000 0.076
#> GSM241475 2 0.2384 0.8624 0.032 0.884 0.000 0.000 0.000 0.084
#> GSM241476 1 0.1333 0.9330 0.944 0.048 0.000 0.000 0.000 0.008
#> GSM241477 2 0.1194 0.8720 0.032 0.956 0.000 0.000 0.008 0.004
#> GSM241478 2 0.3888 0.8007 0.032 0.716 0.000 0.000 0.000 0.252
#> GSM241479 1 0.1196 0.9302 0.952 0.040 0.000 0.000 0.000 0.008
#> GSM241480 1 0.1333 0.9330 0.944 0.048 0.000 0.000 0.000 0.008
#> GSM241481 2 0.2630 0.8478 0.032 0.872 0.000 0.000 0.092 0.004
#> GSM241482 1 0.3803 0.8626 0.760 0.056 0.000 0.000 0.000 0.184
#> GSM241483 2 0.2630 0.8478 0.032 0.872 0.000 0.000 0.092 0.004
#> GSM241484 1 0.3083 0.8745 0.828 0.040 0.000 0.000 0.000 0.132
#> GSM241485 1 0.2999 0.8900 0.840 0.048 0.000 0.000 0.000 0.112
#> GSM241486 2 0.2402 0.7977 0.000 0.856 0.000 0.000 0.140 0.004
#> GSM241487 2 0.1531 0.8350 0.000 0.928 0.000 0.000 0.068 0.004
#> GSM241488 2 0.4344 0.7301 0.032 0.612 0.000 0.000 0.000 0.356
#> GSM241489 1 0.2325 0.9257 0.892 0.060 0.000 0.000 0.000 0.048
#> GSM241490 1 0.1075 0.9336 0.952 0.048 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0935 0.8733 0.032 0.964 0.000 0.000 0.000 0.004
#> GSM241492 1 0.4757 0.6942 0.676 0.144 0.000 0.000 0.000 0.180
#> GSM241493 2 0.3062 0.8456 0.032 0.824 0.000 0.000 0.000 0.144
#> GSM241494 1 0.1829 0.9310 0.920 0.056 0.000 0.000 0.000 0.024
#> GSM241495 2 0.4020 0.7877 0.032 0.692 0.000 0.000 0.000 0.276
#> GSM241496 2 0.4582 0.7218 0.032 0.604 0.000 0.000 0.008 0.356
#> GSM241497 1 0.2257 0.9227 0.904 0.040 0.000 0.000 0.008 0.048
#> GSM241498 1 0.1265 0.9318 0.948 0.044 0.000 0.000 0.000 0.008
#> GSM241499 5 0.3860 0.6448 0.000 0.000 0.000 0.000 0.528 0.472
#> GSM241500 5 0.3236 0.5057 0.000 0.024 0.180 0.000 0.796 0.000
#> GSM241501 5 0.3071 0.5012 0.000 0.016 0.180 0.000 0.804 0.000
#> GSM241502 5 0.3523 0.4970 0.000 0.040 0.180 0.000 0.780 0.000
#> GSM241503 5 0.3860 0.6448 0.000 0.000 0.000 0.000 0.528 0.472
#> GSM241504 5 0.3860 0.6444 0.000 0.000 0.000 0.000 0.528 0.472
#> GSM241505 5 0.3860 0.6444 0.000 0.000 0.000 0.000 0.528 0.472
#> GSM241506 5 0.4398 0.5248 0.004 0.024 0.152 0.048 0.764 0.008
#> GSM241507 5 0.3857 0.6448 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM241508 5 0.3236 0.5057 0.000 0.024 0.180 0.000 0.796 0.000
#> GSM241509 4 0.5239 0.6488 0.024 0.012 0.040 0.712 0.176 0.036
#> GSM241510 4 0.5510 0.2444 0.004 0.024 0.012 0.532 0.392 0.036
#> GSM241511 5 0.6348 0.4270 0.012 0.000 0.000 0.260 0.388 0.340
#> GSM241512 4 0.6324 0.0939 0.008 0.004 0.088 0.476 0.380 0.044
#> GSM241513 3 0.3706 0.7670 0.008 0.004 0.808 0.048 0.128 0.004
#> GSM241514 3 0.4946 0.4203 0.008 0.004 0.624 0.048 0.312 0.004
#> GSM241515 3 0.5351 0.2266 0.008 0.004 0.516 0.060 0.408 0.004
#> GSM241516 5 0.6626 0.1770 0.008 0.004 0.360 0.072 0.468 0.088
#> GSM241517 3 0.3664 0.7697 0.008 0.004 0.812 0.048 0.124 0.004
#> GSM241518 3 0.3664 0.7697 0.008 0.004 0.812 0.048 0.124 0.004
#> GSM241519 3 0.1285 0.8230 0.000 0.004 0.944 0.000 0.052 0.000
#> GSM241520 3 0.1152 0.8171 0.000 0.004 0.952 0.000 0.000 0.044
#> GSM241521 3 0.3309 0.7886 0.008 0.008 0.848 0.048 0.084 0.004
#> GSM241522 3 0.7219 -0.1905 0.008 0.008 0.396 0.048 0.300 0.240
#> GSM241523 3 0.1152 0.8241 0.000 0.004 0.952 0.000 0.044 0.000
#> GSM241524 3 0.1152 0.8171 0.000 0.004 0.952 0.000 0.000 0.044
#> GSM241525 5 0.6398 0.3662 0.012 0.000 0.000 0.296 0.368 0.324
#> GSM241526 4 0.0862 0.8713 0.008 0.000 0.000 0.972 0.016 0.004
#> GSM241527 4 0.0870 0.8707 0.004 0.000 0.000 0.972 0.012 0.012
#> GSM241528 4 0.6686 -0.0498 0.024 0.012 0.084 0.436 0.408 0.036
#> GSM241529 4 0.0862 0.8713 0.008 0.000 0.000 0.972 0.016 0.004
#> GSM241530 4 0.3275 0.7680 0.012 0.000 0.000 0.836 0.100 0.052
#> GSM241531 4 0.1836 0.8505 0.012 0.004 0.000 0.928 0.008 0.048
#> GSM241532 4 0.0777 0.8706 0.004 0.000 0.000 0.972 0.024 0.000
#> GSM241533 4 0.0777 0.8706 0.004 0.000 0.000 0.972 0.024 0.000
#> GSM241534 4 0.0363 0.8715 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM241535 4 0.0653 0.8719 0.004 0.000 0.000 0.980 0.012 0.004
#> GSM241536 4 0.2002 0.8477 0.012 0.004 0.000 0.920 0.012 0.052
#> GSM241537 4 0.0146 0.8708 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241538 4 0.0146 0.8708 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241539 4 0.0146 0.8708 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241540 4 0.0146 0.8708 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241541 4 0.0146 0.8708 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241542 4 0.0146 0.8708 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241543 3 0.0000 0.8250 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241544 3 0.1007 0.8176 0.000 0.000 0.956 0.000 0.000 0.044
#> GSM241545 3 0.0000 0.8250 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241546 3 0.1007 0.8176 0.000 0.000 0.956 0.000 0.000 0.044
#> GSM241547 3 0.1075 0.8235 0.000 0.000 0.952 0.000 0.048 0.000
#> GSM241548 3 0.0000 0.8250 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> CV:mclust 98 4.18e-21 9.90e-01 2
#> CV:mclust 95 2.54e-18 1.00e+00 3
#> CV:mclust 97 5.56e-20 4.34e-03 4
#> CV:mclust 94 9.28e-24 1.65e-05 5
#> CV:mclust 88 2.09e-23 1.96e-05 6
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 16250 rows and 98 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.607 0.883 0.937 0.4779 0.520 0.520
#> 3 3 0.537 0.632 0.786 0.3068 0.854 0.728
#> 4 4 0.837 0.876 0.938 0.1957 0.791 0.521
#> 5 5 0.734 0.735 0.855 0.0540 0.951 0.817
#> 6 6 0.697 0.612 0.766 0.0364 0.975 0.894
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM241451 1 0.0000 0.944 1.000 0.000
#> GSM241452 1 0.0000 0.944 1.000 0.000
#> GSM241453 1 0.0000 0.944 1.000 0.000
#> GSM241454 1 0.0000 0.944 1.000 0.000
#> GSM241455 1 0.0000 0.944 1.000 0.000
#> GSM241456 1 0.0000 0.944 1.000 0.000
#> GSM241457 1 0.7219 0.777 0.800 0.200
#> GSM241458 1 0.5629 0.846 0.868 0.132
#> GSM241459 1 0.7219 0.777 0.800 0.200
#> GSM241460 1 0.7219 0.777 0.800 0.200
#> GSM241461 1 0.6343 0.820 0.840 0.160
#> GSM241462 1 0.0000 0.944 1.000 0.000
#> GSM241463 1 0.0000 0.944 1.000 0.000
#> GSM241464 1 0.0000 0.944 1.000 0.000
#> GSM241465 1 0.0672 0.940 0.992 0.008
#> GSM241466 1 0.0000 0.944 1.000 0.000
#> GSM241467 1 0.0000 0.944 1.000 0.000
#> GSM241468 1 0.0000 0.944 1.000 0.000
#> GSM241469 1 0.0000 0.944 1.000 0.000
#> GSM241470 1 0.0000 0.944 1.000 0.000
#> GSM241471 1 0.0376 0.943 0.996 0.004
#> GSM241472 1 0.0000 0.944 1.000 0.000
#> GSM241473 1 0.0376 0.943 0.996 0.004
#> GSM241474 1 0.0000 0.944 1.000 0.000
#> GSM241475 1 0.0000 0.944 1.000 0.000
#> GSM241476 1 0.0000 0.944 1.000 0.000
#> GSM241477 1 0.0000 0.944 1.000 0.000
#> GSM241478 1 0.0000 0.944 1.000 0.000
#> GSM241479 1 0.0000 0.944 1.000 0.000
#> GSM241480 1 0.0000 0.944 1.000 0.000
#> GSM241481 1 0.6148 0.828 0.848 0.152
#> GSM241482 1 0.0376 0.942 0.996 0.004
#> GSM241483 1 0.0376 0.943 0.996 0.004
#> GSM241484 1 0.0000 0.944 1.000 0.000
#> GSM241485 1 0.0000 0.944 1.000 0.000
#> GSM241486 1 0.0376 0.943 0.996 0.004
#> GSM241487 1 0.0376 0.943 0.996 0.004
#> GSM241488 1 0.0000 0.944 1.000 0.000
#> GSM241489 1 0.0000 0.944 1.000 0.000
#> GSM241490 1 0.0000 0.944 1.000 0.000
#> GSM241491 1 0.0000 0.944 1.000 0.000
#> GSM241492 1 0.0000 0.944 1.000 0.000
#> GSM241493 1 0.0000 0.944 1.000 0.000
#> GSM241494 1 0.0000 0.944 1.000 0.000
#> GSM241495 1 0.0000 0.944 1.000 0.000
#> GSM241496 1 0.0000 0.944 1.000 0.000
#> GSM241497 1 0.0000 0.944 1.000 0.000
#> GSM241498 1 0.0000 0.944 1.000 0.000
#> GSM241499 1 0.0000 0.944 1.000 0.000
#> GSM241500 1 0.8955 0.633 0.688 0.312
#> GSM241501 1 0.2603 0.917 0.956 0.044
#> GSM241502 1 0.3431 0.892 0.936 0.064
#> GSM241503 1 0.0376 0.942 0.996 0.004
#> GSM241504 1 0.6438 0.818 0.836 0.164
#> GSM241505 1 0.5519 0.857 0.872 0.128
#> GSM241506 1 0.9522 0.517 0.628 0.372
#> GSM241507 1 0.7219 0.777 0.800 0.200
#> GSM241508 1 0.7219 0.777 0.800 0.200
#> GSM241509 2 0.6148 0.850 0.152 0.848
#> GSM241510 2 0.0000 0.904 0.000 1.000
#> GSM241511 2 0.9795 0.159 0.416 0.584
#> GSM241512 2 0.7219 0.826 0.200 0.800
#> GSM241513 2 0.0000 0.904 0.000 1.000
#> GSM241514 2 0.7219 0.826 0.200 0.800
#> GSM241515 2 0.0000 0.904 0.000 1.000
#> GSM241516 2 0.0000 0.904 0.000 1.000
#> GSM241517 2 0.2236 0.884 0.036 0.964
#> GSM241518 2 0.6148 0.850 0.152 0.848
#> GSM241519 2 0.7219 0.826 0.200 0.800
#> GSM241520 2 0.7219 0.826 0.200 0.800
#> GSM241521 1 0.7219 0.715 0.800 0.200
#> GSM241522 1 0.7219 0.715 0.800 0.200
#> GSM241523 2 0.7219 0.826 0.200 0.800
#> GSM241524 2 0.7219 0.826 0.200 0.800
#> GSM241525 2 0.1184 0.896 0.016 0.984
#> GSM241526 2 0.0000 0.904 0.000 1.000
#> GSM241527 2 0.0000 0.904 0.000 1.000
#> GSM241528 2 0.0000 0.904 0.000 1.000
#> GSM241529 2 0.0000 0.904 0.000 1.000
#> GSM241530 2 0.0000 0.904 0.000 1.000
#> GSM241531 2 0.0000 0.904 0.000 1.000
#> GSM241532 2 0.0000 0.904 0.000 1.000
#> GSM241533 2 0.0000 0.904 0.000 1.000
#> GSM241534 2 0.0000 0.904 0.000 1.000
#> GSM241535 2 0.0000 0.904 0.000 1.000
#> GSM241536 2 0.0000 0.904 0.000 1.000
#> GSM241537 2 0.0000 0.904 0.000 1.000
#> GSM241538 2 0.0000 0.904 0.000 1.000
#> GSM241539 2 0.0000 0.904 0.000 1.000
#> GSM241540 2 0.0000 0.904 0.000 1.000
#> GSM241541 2 0.0000 0.904 0.000 1.000
#> GSM241542 2 0.0000 0.904 0.000 1.000
#> GSM241543 2 0.7219 0.826 0.200 0.800
#> GSM241544 2 0.7219 0.826 0.200 0.800
#> GSM241545 2 0.7219 0.826 0.200 0.800
#> GSM241546 2 0.7219 0.826 0.200 0.800
#> GSM241547 2 0.7219 0.826 0.200 0.800
#> GSM241548 2 0.7219 0.826 0.200 0.800
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 1 0.6235 0.6348 0.564 0.436 0.000
#> GSM241452 1 0.0237 0.6841 0.996 0.004 0.000
#> GSM241453 1 0.6244 0.6355 0.560 0.440 0.000
#> GSM241454 1 0.0000 0.6834 1.000 0.000 0.000
#> GSM241455 1 0.6225 0.6413 0.568 0.432 0.000
#> GSM241456 1 0.0237 0.6841 0.996 0.004 0.000
#> GSM241457 1 0.6451 0.6415 0.560 0.436 0.004
#> GSM241458 1 0.2749 0.6663 0.924 0.012 0.064
#> GSM241459 1 0.6398 0.6487 0.580 0.416 0.004
#> GSM241460 1 0.5470 0.6153 0.796 0.036 0.168
#> GSM241461 1 0.6476 0.6341 0.548 0.448 0.004
#> GSM241462 1 0.0661 0.6832 0.988 0.004 0.008
#> GSM241463 1 0.6260 0.6375 0.552 0.448 0.000
#> GSM241464 1 0.3116 0.6850 0.892 0.108 0.000
#> GSM241465 1 0.6267 0.6347 0.548 0.452 0.000
#> GSM241466 1 0.0237 0.6846 0.996 0.004 0.000
#> GSM241467 1 0.0237 0.6846 0.996 0.004 0.000
#> GSM241468 1 0.6111 0.6542 0.604 0.396 0.000
#> GSM241469 1 0.0237 0.6841 0.996 0.004 0.000
#> GSM241470 1 0.6235 0.6348 0.564 0.436 0.000
#> GSM241471 1 0.6244 0.6424 0.560 0.440 0.000
#> GSM241472 1 0.0424 0.6857 0.992 0.008 0.000
#> GSM241473 1 0.6244 0.6424 0.560 0.440 0.000
#> GSM241474 1 0.1411 0.6880 0.964 0.036 0.000
#> GSM241475 1 0.6192 0.6455 0.580 0.420 0.000
#> GSM241476 1 0.0000 0.6834 1.000 0.000 0.000
#> GSM241477 1 0.6252 0.6394 0.556 0.444 0.000
#> GSM241478 1 0.6180 0.6392 0.584 0.416 0.000
#> GSM241479 1 0.0000 0.6834 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.6834 1.000 0.000 0.000
#> GSM241481 1 0.6244 0.6424 0.560 0.440 0.000
#> GSM241482 1 0.1267 0.6777 0.972 0.004 0.024
#> GSM241483 1 0.6260 0.6375 0.552 0.448 0.000
#> GSM241484 1 0.1031 0.6763 0.976 0.000 0.024
#> GSM241485 1 0.0000 0.6834 1.000 0.000 0.000
#> GSM241486 1 0.6280 0.6280 0.540 0.460 0.000
#> GSM241487 1 0.6286 0.6239 0.536 0.464 0.000
#> GSM241488 1 0.6215 0.6384 0.572 0.428 0.000
#> GSM241489 1 0.0237 0.6841 0.996 0.004 0.000
#> GSM241490 1 0.0000 0.6834 1.000 0.000 0.000
#> GSM241491 1 0.6267 0.6347 0.548 0.452 0.000
#> GSM241492 1 0.1753 0.6878 0.952 0.048 0.000
#> GSM241493 1 0.6204 0.6434 0.576 0.424 0.000
#> GSM241494 1 0.0000 0.6834 1.000 0.000 0.000
#> GSM241495 1 0.6252 0.6300 0.556 0.444 0.000
#> GSM241496 2 0.6267 -0.3780 0.452 0.548 0.000
#> GSM241497 1 0.1289 0.6618 0.968 0.032 0.000
#> GSM241498 1 0.0237 0.6841 0.996 0.004 0.000
#> GSM241499 1 0.1031 0.6763 0.976 0.000 0.024
#> GSM241500 2 0.9544 -0.3972 0.364 0.440 0.196
#> GSM241501 1 0.6274 0.6314 0.544 0.456 0.000
#> GSM241502 1 0.8363 0.5661 0.504 0.412 0.084
#> GSM241503 1 0.0424 0.6816 0.992 0.000 0.008
#> GSM241504 1 0.5560 0.3965 0.700 0.000 0.300
#> GSM241505 1 0.5291 0.3755 0.732 0.000 0.268
#> GSM241506 3 0.9690 -0.0706 0.324 0.232 0.444
#> GSM241507 1 0.5623 0.4810 0.716 0.004 0.280
#> GSM241508 1 0.9959 0.3007 0.376 0.324 0.300
#> GSM241509 3 0.4555 0.6101 0.000 0.200 0.800
#> GSM241510 3 0.3551 0.7444 0.000 0.132 0.868
#> GSM241511 3 0.4702 0.6335 0.212 0.000 0.788
#> GSM241512 3 0.4399 0.6352 0.188 0.000 0.812
#> GSM241513 2 0.5138 0.5698 0.000 0.748 0.252
#> GSM241514 2 0.9258 0.5315 0.204 0.524 0.272
#> GSM241515 3 0.6192 0.1238 0.000 0.420 0.580
#> GSM241516 3 0.4521 0.6591 0.004 0.180 0.816
#> GSM241517 2 0.2066 0.5725 0.000 0.940 0.060
#> GSM241518 2 0.7034 0.5715 0.048 0.668 0.284
#> GSM241519 2 0.2297 0.5961 0.020 0.944 0.036
#> GSM241520 2 0.8728 0.5932 0.200 0.592 0.208
#> GSM241521 2 0.1170 0.5812 0.008 0.976 0.016
#> GSM241522 2 0.6305 0.3917 0.484 0.516 0.000
#> GSM241523 2 0.3590 0.6128 0.028 0.896 0.076
#> GSM241524 2 0.8749 0.5404 0.300 0.560 0.140
#> GSM241525 3 0.4750 0.6297 0.216 0.000 0.784
#> GSM241526 3 0.0000 0.8608 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.8608 0.000 0.000 1.000
#> GSM241528 3 0.2448 0.8038 0.000 0.076 0.924
#> GSM241529 3 0.0000 0.8608 0.000 0.000 1.000
#> GSM241530 3 0.1411 0.8381 0.036 0.000 0.964
#> GSM241531 3 0.0000 0.8608 0.000 0.000 1.000
#> GSM241532 3 0.1031 0.8522 0.000 0.024 0.976
#> GSM241533 3 0.0237 0.8605 0.000 0.004 0.996
#> GSM241534 3 0.0592 0.8580 0.000 0.012 0.988
#> GSM241535 3 0.0000 0.8608 0.000 0.000 1.000
#> GSM241536 3 0.0237 0.8590 0.004 0.000 0.996
#> GSM241537 3 0.0424 0.8599 0.000 0.008 0.992
#> GSM241538 3 0.0000 0.8608 0.000 0.000 1.000
#> GSM241539 3 0.0424 0.8599 0.000 0.008 0.992
#> GSM241540 3 0.0000 0.8608 0.000 0.000 1.000
#> GSM241541 3 0.1031 0.8505 0.000 0.024 0.976
#> GSM241542 3 0.0424 0.8599 0.000 0.008 0.992
#> GSM241543 2 0.7145 0.6268 0.072 0.692 0.236
#> GSM241544 2 0.8987 0.5640 0.192 0.560 0.248
#> GSM241545 2 0.6025 0.6202 0.028 0.740 0.232
#> GSM241546 2 0.9125 0.5457 0.192 0.540 0.268
#> GSM241547 2 0.4931 0.6046 0.000 0.768 0.232
#> GSM241548 2 0.7295 0.6140 0.072 0.676 0.252
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.1022 0.931 0.032 0.968 0.000 0.000
#> GSM241452 1 0.0524 0.907 0.988 0.004 0.008 0.000
#> GSM241453 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.908 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0188 0.943 0.004 0.996 0.000 0.000
#> GSM241456 1 0.0469 0.907 0.988 0.012 0.000 0.000
#> GSM241457 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241458 1 0.4731 0.804 0.800 0.100 0.004 0.096
#> GSM241459 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241460 1 0.6686 0.612 0.620 0.200 0.000 0.180
#> GSM241461 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241462 1 0.0336 0.907 0.992 0.000 0.008 0.000
#> GSM241463 2 0.2760 0.842 0.000 0.872 0.128 0.000
#> GSM241464 1 0.7448 0.196 0.452 0.372 0.176 0.000
#> GSM241465 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0469 0.906 0.988 0.012 0.000 0.000
#> GSM241467 1 0.1211 0.893 0.960 0.040 0.000 0.000
#> GSM241468 2 0.0592 0.938 0.016 0.984 0.000 0.000
#> GSM241469 1 0.0376 0.908 0.992 0.004 0.004 0.000
#> GSM241470 2 0.0779 0.939 0.016 0.980 0.004 0.000
#> GSM241471 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241472 1 0.2216 0.856 0.908 0.092 0.000 0.000
#> GSM241473 2 0.0188 0.943 0.004 0.996 0.000 0.000
#> GSM241474 1 0.3610 0.748 0.800 0.200 0.000 0.000
#> GSM241475 2 0.0336 0.942 0.008 0.992 0.000 0.000
#> GSM241476 1 0.0000 0.908 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241478 2 0.1118 0.928 0.036 0.964 0.000 0.000
#> GSM241479 1 0.0188 0.908 0.996 0.000 0.004 0.000
#> GSM241480 1 0.0000 0.908 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241482 1 0.1610 0.896 0.952 0.032 0.000 0.016
#> GSM241483 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241484 1 0.0336 0.906 0.992 0.000 0.000 0.008
#> GSM241485 1 0.0000 0.908 1.000 0.000 0.000 0.000
#> GSM241486 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241487 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241488 2 0.3842 0.824 0.036 0.836 0.128 0.000
#> GSM241489 1 0.0336 0.907 0.992 0.000 0.008 0.000
#> GSM241490 1 0.0188 0.908 0.996 0.000 0.004 0.000
#> GSM241491 2 0.3311 0.792 0.000 0.828 0.172 0.000
#> GSM241492 1 0.7058 0.502 0.572 0.228 0.200 0.000
#> GSM241493 2 0.0707 0.938 0.020 0.980 0.000 0.000
#> GSM241494 1 0.0188 0.908 0.996 0.000 0.004 0.000
#> GSM241495 2 0.0336 0.942 0.008 0.992 0.000 0.000
#> GSM241496 2 0.4444 0.799 0.120 0.808 0.072 0.000
#> GSM241497 1 0.0469 0.906 0.988 0.000 0.012 0.000
#> GSM241498 1 0.0188 0.908 0.996 0.000 0.004 0.000
#> GSM241499 1 0.0336 0.906 0.992 0.000 0.000 0.008
#> GSM241500 2 0.0921 0.927 0.000 0.972 0.000 0.028
#> GSM241501 2 0.0000 0.944 0.000 1.000 0.000 0.000
#> GSM241502 2 0.2593 0.852 0.004 0.892 0.000 0.104
#> GSM241503 1 0.0188 0.908 0.996 0.000 0.004 0.000
#> GSM241504 1 0.2011 0.867 0.920 0.000 0.000 0.080
#> GSM241505 1 0.1302 0.890 0.956 0.000 0.000 0.044
#> GSM241506 4 0.5212 0.319 0.008 0.420 0.000 0.572
#> GSM241507 1 0.3831 0.745 0.792 0.004 0.000 0.204
#> GSM241508 2 0.2469 0.863 0.000 0.892 0.000 0.108
#> GSM241509 4 0.3610 0.766 0.000 0.200 0.000 0.800
#> GSM241510 4 0.1022 0.913 0.000 0.032 0.000 0.968
#> GSM241511 4 0.0592 0.918 0.016 0.000 0.000 0.984
#> GSM241512 4 0.3649 0.746 0.204 0.000 0.000 0.796
#> GSM241513 3 0.0524 0.974 0.000 0.004 0.988 0.008
#> GSM241514 3 0.0188 0.975 0.000 0.000 0.996 0.004
#> GSM241515 3 0.1474 0.940 0.000 0.000 0.948 0.052
#> GSM241516 3 0.3681 0.781 0.008 0.000 0.816 0.176
#> GSM241517 2 0.4992 0.153 0.000 0.524 0.476 0.000
#> GSM241518 3 0.0336 0.974 0.000 0.000 0.992 0.008
#> GSM241519 3 0.0592 0.968 0.000 0.016 0.984 0.000
#> GSM241520 3 0.0188 0.973 0.004 0.000 0.996 0.000
#> GSM241521 3 0.0707 0.965 0.000 0.020 0.980 0.000
#> GSM241522 1 0.4500 0.546 0.684 0.000 0.316 0.000
#> GSM241523 3 0.0188 0.974 0.000 0.004 0.996 0.000
#> GSM241524 3 0.1302 0.937 0.044 0.000 0.956 0.000
#> GSM241525 4 0.1940 0.870 0.076 0.000 0.000 0.924
#> GSM241526 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241527 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241528 4 0.2281 0.865 0.000 0.096 0.000 0.904
#> GSM241529 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241530 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241531 4 0.0188 0.925 0.004 0.000 0.000 0.996
#> GSM241532 4 0.0469 0.922 0.000 0.012 0.000 0.988
#> GSM241533 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241534 4 0.0707 0.919 0.000 0.020 0.000 0.980
#> GSM241535 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241536 4 0.0188 0.925 0.004 0.000 0.000 0.996
#> GSM241537 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241538 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241539 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241540 4 0.0000 0.926 0.000 0.000 0.000 1.000
#> GSM241541 4 0.3400 0.759 0.000 0.000 0.180 0.820
#> GSM241542 4 0.3486 0.749 0.000 0.000 0.188 0.812
#> GSM241543 3 0.0188 0.975 0.000 0.000 0.996 0.004
#> GSM241544 3 0.0000 0.974 0.000 0.000 1.000 0.000
#> GSM241545 3 0.0188 0.975 0.000 0.000 0.996 0.004
#> GSM241546 3 0.0000 0.974 0.000 0.000 1.000 0.000
#> GSM241547 3 0.0336 0.974 0.000 0.000 0.992 0.008
#> GSM241548 3 0.0188 0.975 0.000 0.000 0.996 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.3895 0.7086 0.000 0.680 0.000 0.000 0.320
#> GSM241452 5 0.3913 0.5181 0.324 0.000 0.000 0.000 0.676
#> GSM241453 2 0.2424 0.8100 0.000 0.868 0.000 0.000 0.132
#> GSM241454 1 0.0880 0.7897 0.968 0.000 0.000 0.000 0.032
#> GSM241455 2 0.3521 0.7593 0.004 0.764 0.000 0.000 0.232
#> GSM241456 1 0.3039 0.7017 0.836 0.012 0.000 0.000 0.152
#> GSM241457 2 0.2077 0.8076 0.040 0.920 0.000 0.000 0.040
#> GSM241458 1 0.2046 0.7648 0.916 0.068 0.000 0.000 0.016
#> GSM241459 2 0.1893 0.8122 0.048 0.928 0.000 0.000 0.024
#> GSM241460 1 0.3115 0.6931 0.852 0.112 0.000 0.000 0.036
#> GSM241461 2 0.1671 0.8042 0.000 0.924 0.000 0.000 0.076
#> GSM241462 1 0.0992 0.7989 0.968 0.024 0.000 0.000 0.008
#> GSM241463 2 0.5499 0.7171 0.040 0.712 0.104 0.000 0.144
#> GSM241464 1 0.7076 0.2869 0.576 0.180 0.132 0.000 0.112
#> GSM241465 2 0.1444 0.8179 0.012 0.948 0.000 0.000 0.040
#> GSM241466 1 0.0703 0.7983 0.976 0.024 0.000 0.000 0.000
#> GSM241467 1 0.0703 0.7983 0.976 0.024 0.000 0.000 0.000
#> GSM241468 2 0.2439 0.7588 0.120 0.876 0.000 0.000 0.004
#> GSM241469 1 0.3074 0.6549 0.804 0.000 0.000 0.000 0.196
#> GSM241470 2 0.3242 0.7656 0.000 0.784 0.000 0.000 0.216
#> GSM241471 2 0.2209 0.8031 0.056 0.912 0.000 0.000 0.032
#> GSM241472 1 0.1197 0.7891 0.952 0.048 0.000 0.000 0.000
#> GSM241473 2 0.2569 0.7921 0.068 0.892 0.000 0.000 0.040
#> GSM241474 1 0.2470 0.7281 0.884 0.104 0.000 0.000 0.012
#> GSM241475 2 0.3480 0.7548 0.000 0.752 0.000 0.000 0.248
#> GSM241476 1 0.2230 0.7461 0.884 0.000 0.000 0.000 0.116
#> GSM241477 2 0.0963 0.8203 0.000 0.964 0.000 0.000 0.036
#> GSM241478 2 0.3534 0.7514 0.000 0.744 0.000 0.000 0.256
#> GSM241479 1 0.3837 0.4104 0.692 0.000 0.000 0.000 0.308
#> GSM241480 1 0.0880 0.7897 0.968 0.000 0.000 0.000 0.032
#> GSM241481 2 0.1216 0.8180 0.020 0.960 0.000 0.000 0.020
#> GSM241482 1 0.1043 0.7930 0.960 0.040 0.000 0.000 0.000
#> GSM241483 2 0.1410 0.8101 0.000 0.940 0.000 0.000 0.060
#> GSM241484 1 0.0162 0.7968 0.996 0.000 0.000 0.000 0.004
#> GSM241485 1 0.1671 0.7761 0.924 0.000 0.000 0.000 0.076
#> GSM241486 2 0.2338 0.7848 0.000 0.884 0.000 0.004 0.112
#> GSM241487 2 0.3002 0.8091 0.004 0.872 0.048 0.000 0.076
#> GSM241488 2 0.6324 0.5692 0.024 0.596 0.144 0.000 0.236
#> GSM241489 1 0.1410 0.7804 0.940 0.000 0.000 0.000 0.060
#> GSM241490 1 0.0162 0.7968 0.996 0.000 0.000 0.000 0.004
#> GSM241491 2 0.5328 0.6933 0.036 0.720 0.160 0.000 0.084
#> GSM241492 1 0.6247 0.3776 0.624 0.144 0.200 0.000 0.032
#> GSM241493 2 0.2773 0.7983 0.000 0.836 0.000 0.000 0.164
#> GSM241494 1 0.0451 0.7984 0.988 0.008 0.000 0.000 0.004
#> GSM241495 2 0.1908 0.8197 0.000 0.908 0.000 0.000 0.092
#> GSM241496 5 0.3586 0.4689 0.000 0.076 0.096 0.000 0.828
#> GSM241497 5 0.4713 0.3991 0.440 0.000 0.016 0.000 0.544
#> GSM241498 1 0.3508 0.5756 0.748 0.000 0.000 0.000 0.252
#> GSM241499 1 0.1197 0.7823 0.952 0.000 0.000 0.000 0.048
#> GSM241500 2 0.4219 0.6872 0.000 0.780 0.000 0.104 0.116
#> GSM241501 2 0.3276 0.7571 0.000 0.836 0.000 0.032 0.132
#> GSM241502 5 0.5651 0.3007 0.000 0.248 0.000 0.132 0.620
#> GSM241503 5 0.4552 0.3326 0.468 0.000 0.000 0.008 0.524
#> GSM241504 1 0.2426 0.7454 0.900 0.000 0.000 0.064 0.036
#> GSM241505 1 0.2946 0.7095 0.868 0.000 0.000 0.088 0.044
#> GSM241506 2 0.5964 0.0619 0.000 0.464 0.000 0.428 0.108
#> GSM241507 1 0.3061 0.6742 0.844 0.020 0.000 0.136 0.000
#> GSM241508 2 0.1522 0.8160 0.012 0.944 0.000 0.000 0.044
#> GSM241509 4 0.5567 0.5121 0.000 0.160 0.000 0.644 0.196
#> GSM241510 4 0.2006 0.8176 0.000 0.072 0.000 0.916 0.012
#> GSM241511 4 0.4607 0.5940 0.228 0.004 0.000 0.720 0.048
#> GSM241512 4 0.3783 0.6407 0.008 0.000 0.000 0.740 0.252
#> GSM241513 3 0.1341 0.8902 0.000 0.000 0.944 0.000 0.056
#> GSM241514 3 0.1121 0.9019 0.000 0.000 0.956 0.000 0.044
#> GSM241515 3 0.2423 0.8619 0.000 0.000 0.896 0.024 0.080
#> GSM241516 3 0.3071 0.8458 0.012 0.000 0.872 0.036 0.080
#> GSM241517 3 0.4428 0.5787 0.000 0.268 0.700 0.000 0.032
#> GSM241518 3 0.1991 0.8773 0.000 0.004 0.916 0.004 0.076
#> GSM241519 3 0.2661 0.8652 0.000 0.056 0.888 0.000 0.056
#> GSM241520 3 0.2280 0.8685 0.000 0.000 0.880 0.000 0.120
#> GSM241521 3 0.2193 0.8778 0.000 0.060 0.912 0.000 0.028
#> GSM241522 1 0.5399 -0.0549 0.496 0.000 0.448 0.000 0.056
#> GSM241523 3 0.1831 0.8885 0.000 0.004 0.920 0.000 0.076
#> GSM241524 3 0.3669 0.7934 0.056 0.000 0.816 0.000 0.128
#> GSM241525 4 0.3731 0.7090 0.040 0.000 0.000 0.800 0.160
#> GSM241526 4 0.0794 0.8522 0.000 0.000 0.000 0.972 0.028
#> GSM241527 4 0.0290 0.8558 0.000 0.000 0.000 0.992 0.008
#> GSM241528 4 0.1043 0.8491 0.000 0.000 0.000 0.960 0.040
#> GSM241529 4 0.0703 0.8531 0.000 0.000 0.000 0.976 0.024
#> GSM241530 4 0.0404 0.8554 0.000 0.000 0.000 0.988 0.012
#> GSM241531 4 0.1430 0.8469 0.004 0.000 0.000 0.944 0.052
#> GSM241532 4 0.0451 0.8564 0.000 0.004 0.000 0.988 0.008
#> GSM241533 4 0.0404 0.8556 0.000 0.000 0.000 0.988 0.012
#> GSM241534 4 0.0703 0.8536 0.000 0.000 0.000 0.976 0.024
#> GSM241535 4 0.0162 0.8559 0.000 0.000 0.000 0.996 0.004
#> GSM241536 4 0.0609 0.8546 0.000 0.000 0.000 0.980 0.020
#> GSM241537 4 0.3239 0.8109 0.000 0.000 0.068 0.852 0.080
#> GSM241538 4 0.3301 0.8089 0.000 0.000 0.072 0.848 0.080
#> GSM241539 4 0.3301 0.8089 0.000 0.000 0.072 0.848 0.080
#> GSM241540 4 0.3301 0.8089 0.000 0.000 0.072 0.848 0.080
#> GSM241541 4 0.5547 0.4264 0.000 0.000 0.356 0.564 0.080
#> GSM241542 4 0.4987 0.6515 0.000 0.000 0.236 0.684 0.080
#> GSM241543 3 0.1270 0.8987 0.000 0.000 0.948 0.000 0.052
#> GSM241544 3 0.1270 0.8986 0.000 0.000 0.948 0.000 0.052
#> GSM241545 3 0.0880 0.9035 0.000 0.000 0.968 0.000 0.032
#> GSM241546 3 0.0794 0.9041 0.000 0.000 0.972 0.000 0.028
#> GSM241547 3 0.0794 0.9002 0.000 0.000 0.972 0.000 0.028
#> GSM241548 3 0.0162 0.9041 0.000 0.000 0.996 0.000 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.4648 0.39360 0.004 0.584 0.000 0.000 0.372 NA
#> GSM241452 5 0.4452 0.20964 0.312 0.004 0.000 0.000 0.644 NA
#> GSM241453 2 0.2658 0.65705 0.000 0.864 0.000 0.000 0.100 NA
#> GSM241454 1 0.2030 0.71903 0.908 0.000 0.000 0.000 0.064 NA
#> GSM241455 2 0.4415 0.57430 0.004 0.724 0.000 0.000 0.104 NA
#> GSM241456 1 0.4078 0.61782 0.748 0.004 0.000 0.000 0.180 NA
#> GSM241457 2 0.3766 0.66597 0.040 0.748 0.000 0.000 0.000 NA
#> GSM241458 1 0.3235 0.70013 0.848 0.060 0.004 0.000 0.012 NA
#> GSM241459 2 0.4684 0.61564 0.052 0.640 0.000 0.000 0.008 NA
#> GSM241460 1 0.4167 0.63315 0.776 0.096 0.000 0.000 0.024 NA
#> GSM241461 2 0.4850 0.51858 0.024 0.524 0.000 0.000 0.020 NA
#> GSM241462 1 0.4085 0.66777 0.784 0.076 0.000 0.000 0.028 NA
#> GSM241463 2 0.5477 0.46454 0.032 0.596 0.008 0.000 0.056 NA
#> GSM241464 1 0.7411 0.13129 0.436 0.192 0.024 0.000 0.084 NA
#> GSM241465 2 0.2302 0.68873 0.008 0.872 0.000 0.000 0.000 NA
#> GSM241466 1 0.1167 0.73884 0.960 0.008 0.000 0.000 0.020 NA
#> GSM241467 1 0.1138 0.73932 0.960 0.024 0.000 0.000 0.012 NA
#> GSM241468 2 0.4986 0.63363 0.108 0.700 0.000 0.000 0.032 NA
#> GSM241469 1 0.4651 0.48635 0.652 0.004 0.000 0.000 0.280 NA
#> GSM241470 2 0.3094 0.63128 0.000 0.824 0.000 0.000 0.140 NA
#> GSM241471 2 0.3530 0.67323 0.056 0.792 0.000 0.000 0.000 NA
#> GSM241472 1 0.1168 0.73602 0.956 0.028 0.000 0.000 0.000 NA
#> GSM241473 2 0.4022 0.65664 0.088 0.764 0.000 0.000 0.004 NA
#> GSM241474 1 0.2862 0.69907 0.864 0.080 0.000 0.000 0.008 NA
#> GSM241475 2 0.4033 0.56515 0.000 0.724 0.000 0.000 0.224 NA
#> GSM241476 1 0.3450 0.63837 0.780 0.000 0.000 0.000 0.188 NA
#> GSM241477 2 0.0909 0.68283 0.000 0.968 0.000 0.000 0.020 NA
#> GSM241478 2 0.5324 0.38158 0.000 0.540 0.000 0.000 0.340 NA
#> GSM241479 1 0.4711 0.38955 0.608 0.000 0.000 0.000 0.328 NA
#> GSM241480 1 0.2145 0.71624 0.900 0.000 0.000 0.000 0.072 NA
#> GSM241481 2 0.3766 0.66331 0.040 0.748 0.000 0.000 0.000 NA
#> GSM241482 1 0.2119 0.72805 0.912 0.036 0.000 0.000 0.008 NA
#> GSM241483 2 0.4004 0.59537 0.000 0.620 0.000 0.000 0.012 NA
#> GSM241484 1 0.1225 0.73482 0.952 0.000 0.000 0.000 0.012 NA
#> GSM241485 1 0.3562 0.71258 0.828 0.032 0.000 0.000 0.064 NA
#> GSM241486 2 0.5043 0.45880 0.016 0.476 0.000 0.000 0.040 NA
#> GSM241487 2 0.1552 0.68257 0.000 0.940 0.020 0.000 0.004 NA
#> GSM241488 2 0.6469 0.33743 0.024 0.556 0.100 0.000 0.264 NA
#> GSM241489 1 0.4008 0.65036 0.768 0.012 0.004 0.000 0.172 NA
#> GSM241490 1 0.2179 0.72267 0.900 0.000 0.000 0.000 0.064 NA
#> GSM241491 2 0.5762 0.49613 0.028 0.612 0.060 0.000 0.032 NA
#> GSM241492 1 0.6907 0.34376 0.548 0.128 0.084 0.000 0.032 NA
#> GSM241493 2 0.2624 0.64425 0.000 0.856 0.000 0.000 0.124 NA
#> GSM241494 1 0.0363 0.73559 0.988 0.000 0.000 0.000 0.012 NA
#> GSM241495 2 0.2094 0.66436 0.000 0.900 0.000 0.000 0.080 NA
#> GSM241496 5 0.5124 0.10616 0.004 0.288 0.044 0.000 0.632 NA
#> GSM241497 5 0.4691 -0.14600 0.464 0.008 0.004 0.000 0.504 NA
#> GSM241498 1 0.4738 0.39089 0.600 0.000 0.000 0.000 0.336 NA
#> GSM241499 1 0.3328 0.70311 0.832 0.004 0.000 0.008 0.112 NA
#> GSM241500 2 0.5282 0.50142 0.000 0.528 0.000 0.064 0.016 NA
#> GSM241501 2 0.4686 0.62164 0.000 0.676 0.000 0.016 0.056 NA
#> GSM241502 5 0.7077 0.04845 0.000 0.220 0.000 0.092 0.424 NA
#> GSM241503 1 0.4708 0.00157 0.496 0.004 0.000 0.016 0.472 NA
#> GSM241504 1 0.4186 0.61278 0.772 0.000 0.000 0.132 0.068 NA
#> GSM241505 1 0.4866 0.55192 0.716 0.000 0.000 0.160 0.080 NA
#> GSM241506 4 0.6139 0.33724 0.000 0.260 0.000 0.548 0.044 NA
#> GSM241507 1 0.3039 0.71688 0.868 0.008 0.000 0.040 0.020 NA
#> GSM241508 2 0.3957 0.65328 0.004 0.696 0.000 0.020 0.000 NA
#> GSM241509 4 0.6783 0.24999 0.000 0.088 0.000 0.444 0.140 NA
#> GSM241510 4 0.4444 0.62903 0.000 0.072 0.000 0.700 0.004 NA
#> GSM241511 4 0.4640 0.55576 0.240 0.000 0.000 0.684 0.012 NA
#> GSM241512 4 0.5099 0.55472 0.008 0.000 0.000 0.644 0.228 NA
#> GSM241513 3 0.1995 0.81324 0.000 0.000 0.912 0.000 0.036 NA
#> GSM241514 3 0.2767 0.79960 0.004 0.000 0.868 0.000 0.072 NA
#> GSM241515 3 0.4022 0.77031 0.000 0.020 0.804 0.016 0.064 NA
#> GSM241516 3 0.4589 0.73163 0.028 0.000 0.768 0.024 0.072 NA
#> GSM241517 3 0.5998 0.29470 0.000 0.316 0.492 0.000 0.012 NA
#> GSM241518 3 0.3206 0.77543 0.000 0.000 0.816 0.004 0.028 NA
#> GSM241519 3 0.5073 0.62923 0.000 0.180 0.692 0.000 0.044 NA
#> GSM241520 3 0.2022 0.81163 0.000 0.008 0.916 0.000 0.052 NA
#> GSM241521 3 0.2215 0.79803 0.000 0.076 0.900 0.000 0.012 NA
#> GSM241522 3 0.5740 0.07219 0.408 0.000 0.484 0.000 0.068 NA
#> GSM241523 3 0.4381 0.67999 0.000 0.136 0.748 0.000 0.100 NA
#> GSM241524 3 0.3080 0.76930 0.024 0.008 0.848 0.000 0.112 NA
#> GSM241525 4 0.3889 0.67313 0.028 0.004 0.000 0.772 0.180 NA
#> GSM241526 4 0.1577 0.77751 0.000 0.008 0.000 0.940 0.036 NA
#> GSM241527 4 0.1092 0.78348 0.000 0.000 0.000 0.960 0.020 NA
#> GSM241528 4 0.3726 0.71240 0.000 0.072 0.000 0.812 0.092 NA
#> GSM241529 4 0.1887 0.77382 0.000 0.012 0.000 0.924 0.048 NA
#> GSM241530 4 0.1644 0.77636 0.000 0.004 0.000 0.932 0.052 NA
#> GSM241531 4 0.1913 0.78223 0.016 0.000 0.000 0.924 0.016 NA
#> GSM241532 4 0.1007 0.78536 0.000 0.000 0.000 0.956 0.000 NA
#> GSM241533 4 0.0547 0.78491 0.000 0.000 0.000 0.980 0.000 NA
#> GSM241534 4 0.1471 0.77956 0.000 0.000 0.000 0.932 0.004 NA
#> GSM241535 4 0.0520 0.78449 0.000 0.000 0.000 0.984 0.008 NA
#> GSM241536 4 0.1483 0.78249 0.012 0.000 0.000 0.944 0.008 NA
#> GSM241537 4 0.3982 0.73623 0.000 0.000 0.032 0.792 0.060 NA
#> GSM241538 4 0.4425 0.72355 0.000 0.000 0.056 0.764 0.064 NA
#> GSM241539 4 0.4242 0.72925 0.000 0.000 0.044 0.776 0.064 NA
#> GSM241540 4 0.4483 0.72153 0.000 0.000 0.060 0.760 0.064 NA
#> GSM241541 4 0.6151 0.53044 0.000 0.000 0.220 0.576 0.064 NA
#> GSM241542 4 0.6084 0.55442 0.000 0.000 0.208 0.588 0.064 NA
#> GSM241543 3 0.0870 0.82471 0.000 0.012 0.972 0.000 0.012 NA
#> GSM241544 3 0.0717 0.82628 0.000 0.000 0.976 0.000 0.016 NA
#> GSM241545 3 0.0146 0.82697 0.000 0.000 0.996 0.000 0.004 NA
#> GSM241546 3 0.0717 0.82894 0.000 0.000 0.976 0.000 0.016 NA
#> GSM241547 3 0.0622 0.82800 0.000 0.000 0.980 0.000 0.008 NA
#> GSM241548 3 0.0405 0.82822 0.000 0.000 0.988 0.000 0.004 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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> CV:NMF 97 3.25e-15 2.54e-01 2
#> CV:NMF 89 8.74e-17 1.51e-05 3
#> CV:NMF 95 1.31e-14 2.22e-04 4
#> CV:NMF 88 2.84e-13 5.84e-04 5
#> CV:NMF 78 1.46e-12 2.22e-04 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.992 0.997 0.5056 0.495 0.495
#> 3 3 0.706 0.820 0.853 0.2288 0.879 0.758
#> 4 4 0.846 0.929 0.953 0.1787 0.886 0.702
#> 5 5 0.852 0.931 0.910 0.0624 0.939 0.778
#> 6 6 0.862 0.899 0.908 0.0369 0.976 0.889
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
#> GSM241451 2 0.000 1.000 0.000 1.000
#> GSM241452 1 0.000 0.994 1.000 0.000
#> GSM241453 2 0.000 1.000 0.000 1.000
#> GSM241454 1 0.000 0.994 1.000 0.000
#> GSM241455 2 0.000 1.000 0.000 1.000
#> GSM241456 1 0.000 0.994 1.000 0.000
#> GSM241457 2 0.000 1.000 0.000 1.000
#> GSM241458 1 0.000 0.994 1.000 0.000
#> GSM241459 2 0.000 1.000 0.000 1.000
#> GSM241460 1 0.000 0.994 1.000 0.000
#> GSM241461 2 0.000 1.000 0.000 1.000
#> GSM241462 1 0.000 0.994 1.000 0.000
#> GSM241463 2 0.000 1.000 0.000 1.000
#> GSM241464 1 0.000 0.994 1.000 0.000
#> GSM241465 2 0.000 1.000 0.000 1.000
#> GSM241466 1 0.000 0.994 1.000 0.000
#> GSM241467 1 0.000 0.994 1.000 0.000
#> GSM241468 2 0.000 1.000 0.000 1.000
#> GSM241469 1 0.000 0.994 1.000 0.000
#> GSM241470 2 0.000 1.000 0.000 1.000
#> GSM241471 2 0.000 1.000 0.000 1.000
#> GSM241472 1 0.000 0.994 1.000 0.000
#> GSM241473 2 0.000 1.000 0.000 1.000
#> GSM241474 1 0.000 0.994 1.000 0.000
#> GSM241475 2 0.000 1.000 0.000 1.000
#> GSM241476 1 0.000 0.994 1.000 0.000
#> GSM241477 2 0.000 1.000 0.000 1.000
#> GSM241478 2 0.000 1.000 0.000 1.000
#> GSM241479 1 0.000 0.994 1.000 0.000
#> GSM241480 1 0.000 0.994 1.000 0.000
#> GSM241481 2 0.000 1.000 0.000 1.000
#> GSM241482 1 0.000 0.994 1.000 0.000
#> GSM241483 2 0.000 1.000 0.000 1.000
#> GSM241484 1 0.000 0.994 1.000 0.000
#> GSM241485 1 0.000 0.994 1.000 0.000
#> GSM241486 2 0.000 1.000 0.000 1.000
#> GSM241487 2 0.000 1.000 0.000 1.000
#> GSM241488 2 0.000 1.000 0.000 1.000
#> GSM241489 1 0.000 0.994 1.000 0.000
#> GSM241490 1 0.000 0.994 1.000 0.000
#> GSM241491 2 0.000 1.000 0.000 1.000
#> GSM241492 1 0.000 0.994 1.000 0.000
#> GSM241493 2 0.000 1.000 0.000 1.000
#> GSM241494 1 0.000 0.994 1.000 0.000
#> GSM241495 2 0.000 1.000 0.000 1.000
#> GSM241496 2 0.000 1.000 0.000 1.000
#> GSM241497 1 0.000 0.994 1.000 0.000
#> GSM241498 1 0.000 0.994 1.000 0.000
#> GSM241499 1 0.000 0.994 1.000 0.000
#> GSM241500 2 0.000 1.000 0.000 1.000
#> GSM241501 2 0.000 1.000 0.000 1.000
#> GSM241502 2 0.000 1.000 0.000 1.000
#> GSM241503 1 0.000 0.994 1.000 0.000
#> GSM241504 1 0.000 0.994 1.000 0.000
#> GSM241505 1 0.000 0.994 1.000 0.000
#> GSM241506 2 0.000 1.000 0.000 1.000
#> GSM241507 1 0.000 0.994 1.000 0.000
#> GSM241508 2 0.000 1.000 0.000 1.000
#> GSM241509 2 0.000 1.000 0.000 1.000
#> GSM241510 2 0.000 1.000 0.000 1.000
#> GSM241511 1 0.000 0.994 1.000 0.000
#> GSM241512 1 0.000 0.994 1.000 0.000
#> GSM241513 2 0.000 1.000 0.000 1.000
#> GSM241514 1 0.000 0.994 1.000 0.000
#> GSM241515 2 0.000 1.000 0.000 1.000
#> GSM241516 1 0.000 0.994 1.000 0.000
#> GSM241517 2 0.000 1.000 0.000 1.000
#> GSM241518 1 0.000 0.994 1.000 0.000
#> GSM241519 2 0.000 1.000 0.000 1.000
#> GSM241520 1 0.000 0.994 1.000 0.000
#> GSM241521 2 0.000 1.000 0.000 1.000
#> GSM241522 1 0.000 0.994 1.000 0.000
#> GSM241523 2 0.000 1.000 0.000 1.000
#> GSM241524 1 0.000 0.994 1.000 0.000
#> GSM241525 1 0.000 0.994 1.000 0.000
#> GSM241526 2 0.000 1.000 0.000 1.000
#> GSM241527 1 0.000 0.994 1.000 0.000
#> GSM241528 2 0.000 1.000 0.000 1.000
#> GSM241529 2 0.000 1.000 0.000 1.000
#> GSM241530 1 0.000 0.994 1.000 0.000
#> GSM241531 1 0.000 0.994 1.000 0.000
#> GSM241532 2 0.000 1.000 0.000 1.000
#> GSM241533 2 0.000 1.000 0.000 1.000
#> GSM241534 2 0.000 1.000 0.000 1.000
#> GSM241535 1 0.000 0.994 1.000 0.000
#> GSM241536 1 0.000 0.994 1.000 0.000
#> GSM241537 2 0.000 1.000 0.000 1.000
#> GSM241538 1 0.000 0.994 1.000 0.000
#> GSM241539 2 0.000 1.000 0.000 1.000
#> GSM241540 1 0.000 0.994 1.000 0.000
#> GSM241541 2 0.000 1.000 0.000 1.000
#> GSM241542 1 0.886 0.563 0.696 0.304
#> GSM241543 2 0.000 1.000 0.000 1.000
#> GSM241544 1 0.000 0.994 1.000 0.000
#> GSM241545 2 0.000 1.000 0.000 1.000
#> GSM241546 1 0.000 0.994 1.000 0.000
#> GSM241547 2 0.000 1.000 0.000 1.000
#> GSM241548 1 0.000 0.994 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.334 0.846 0.000 0.880 0.120
#> GSM241452 1 0.000 0.895 1.000 0.000 0.000
#> GSM241453 2 0.334 0.846 0.000 0.880 0.120
#> GSM241454 1 0.000 0.895 1.000 0.000 0.000
#> GSM241455 2 0.334 0.846 0.000 0.880 0.120
#> GSM241456 1 0.000 0.895 1.000 0.000 0.000
#> GSM241457 2 0.000 0.811 0.000 1.000 0.000
#> GSM241458 1 0.000 0.895 1.000 0.000 0.000
#> GSM241459 2 0.000 0.811 0.000 1.000 0.000
#> GSM241460 1 0.000 0.895 1.000 0.000 0.000
#> GSM241461 2 0.000 0.811 0.000 1.000 0.000
#> GSM241462 1 0.000 0.895 1.000 0.000 0.000
#> GSM241463 2 0.334 0.846 0.000 0.880 0.120
#> GSM241464 1 0.000 0.895 1.000 0.000 0.000
#> GSM241465 2 0.334 0.846 0.000 0.880 0.120
#> GSM241466 1 0.000 0.895 1.000 0.000 0.000
#> GSM241467 1 0.000 0.895 1.000 0.000 0.000
#> GSM241468 2 0.334 0.846 0.000 0.880 0.120
#> GSM241469 1 0.000 0.895 1.000 0.000 0.000
#> GSM241470 2 0.334 0.846 0.000 0.880 0.120
#> GSM241471 2 0.334 0.846 0.000 0.880 0.120
#> GSM241472 1 0.000 0.895 1.000 0.000 0.000
#> GSM241473 2 0.334 0.846 0.000 0.880 0.120
#> GSM241474 1 0.000 0.895 1.000 0.000 0.000
#> GSM241475 2 0.334 0.846 0.000 0.880 0.120
#> GSM241476 1 0.000 0.895 1.000 0.000 0.000
#> GSM241477 2 0.334 0.846 0.000 0.880 0.120
#> GSM241478 2 0.334 0.846 0.000 0.880 0.120
#> GSM241479 1 0.000 0.895 1.000 0.000 0.000
#> GSM241480 1 0.000 0.895 1.000 0.000 0.000
#> GSM241481 2 0.000 0.811 0.000 1.000 0.000
#> GSM241482 1 0.000 0.895 1.000 0.000 0.000
#> GSM241483 2 0.000 0.811 0.000 1.000 0.000
#> GSM241484 1 0.000 0.895 1.000 0.000 0.000
#> GSM241485 1 0.000 0.895 1.000 0.000 0.000
#> GSM241486 2 0.000 0.811 0.000 1.000 0.000
#> GSM241487 2 0.334 0.846 0.000 0.880 0.120
#> GSM241488 2 0.334 0.846 0.000 0.880 0.120
#> GSM241489 1 0.000 0.895 1.000 0.000 0.000
#> GSM241490 1 0.000 0.895 1.000 0.000 0.000
#> GSM241491 2 0.334 0.846 0.000 0.880 0.120
#> GSM241492 1 0.000 0.895 1.000 0.000 0.000
#> GSM241493 2 0.334 0.846 0.000 0.880 0.120
#> GSM241494 1 0.000 0.895 1.000 0.000 0.000
#> GSM241495 2 0.334 0.846 0.000 0.880 0.120
#> GSM241496 2 0.334 0.846 0.000 0.880 0.120
#> GSM241497 1 0.000 0.895 1.000 0.000 0.000
#> GSM241498 1 0.000 0.895 1.000 0.000 0.000
#> GSM241499 1 0.000 0.895 1.000 0.000 0.000
#> GSM241500 2 0.000 0.811 0.000 1.000 0.000
#> GSM241501 2 0.000 0.811 0.000 1.000 0.000
#> GSM241502 2 0.000 0.811 0.000 1.000 0.000
#> GSM241503 1 0.000 0.895 1.000 0.000 0.000
#> GSM241504 1 0.000 0.895 1.000 0.000 0.000
#> GSM241505 1 0.000 0.895 1.000 0.000 0.000
#> GSM241506 2 0.000 0.811 0.000 1.000 0.000
#> GSM241507 1 0.000 0.895 1.000 0.000 0.000
#> GSM241508 2 0.484 0.479 0.000 0.776 0.224
#> GSM241509 2 0.493 0.460 0.000 0.768 0.232
#> GSM241510 2 0.493 0.460 0.000 0.768 0.232
#> GSM241511 1 0.186 0.881 0.948 0.000 0.052
#> GSM241512 1 0.576 0.781 0.672 0.000 0.328
#> GSM241513 3 0.576 0.903 0.000 0.328 0.672
#> GSM241514 1 0.576 0.781 0.672 0.000 0.328
#> GSM241515 3 0.576 0.903 0.000 0.328 0.672
#> GSM241516 1 0.576 0.781 0.672 0.000 0.328
#> GSM241517 3 0.576 0.903 0.000 0.328 0.672
#> GSM241518 1 0.576 0.781 0.672 0.000 0.328
#> GSM241519 3 0.576 0.903 0.000 0.328 0.672
#> GSM241520 1 0.576 0.781 0.672 0.000 0.328
#> GSM241521 3 0.576 0.903 0.000 0.328 0.672
#> GSM241522 1 0.576 0.781 0.672 0.000 0.328
#> GSM241523 3 0.576 0.903 0.000 0.328 0.672
#> GSM241524 1 0.576 0.781 0.672 0.000 0.328
#> GSM241525 1 0.576 0.781 0.672 0.000 0.328
#> GSM241526 3 0.583 0.888 0.000 0.340 0.660
#> GSM241527 1 0.576 0.781 0.672 0.000 0.328
#> GSM241528 3 0.583 0.888 0.000 0.340 0.660
#> GSM241529 3 0.583 0.888 0.000 0.340 0.660
#> GSM241530 1 0.576 0.781 0.672 0.000 0.328
#> GSM241531 1 0.186 0.881 0.948 0.000 0.052
#> GSM241532 2 0.493 0.460 0.000 0.768 0.232
#> GSM241533 2 0.493 0.460 0.000 0.768 0.232
#> GSM241534 2 0.493 0.460 0.000 0.768 0.232
#> GSM241535 1 0.576 0.781 0.672 0.000 0.328
#> GSM241536 1 0.186 0.881 0.948 0.000 0.052
#> GSM241537 3 0.576 0.903 0.000 0.328 0.672
#> GSM241538 1 0.576 0.781 0.672 0.000 0.328
#> GSM241539 3 0.576 0.903 0.000 0.328 0.672
#> GSM241540 1 0.576 0.781 0.672 0.000 0.328
#> GSM241541 3 0.576 0.903 0.000 0.328 0.672
#> GSM241542 3 0.599 -0.307 0.368 0.000 0.632
#> GSM241543 3 0.576 0.903 0.000 0.328 0.672
#> GSM241544 1 0.576 0.781 0.672 0.000 0.328
#> GSM241545 3 0.576 0.903 0.000 0.328 0.672
#> GSM241546 1 0.576 0.781 0.672 0.000 0.328
#> GSM241547 3 0.576 0.903 0.000 0.328 0.672
#> GSM241548 1 0.576 0.781 0.672 0.000 0.328
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241452 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241453 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241454 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241455 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241456 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241457 2 0.0000 0.865 0.000 1.000 0.000 0.000
#> GSM241458 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241459 2 0.0000 0.865 0.000 1.000 0.000 0.000
#> GSM241460 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241461 2 0.0000 0.865 0.000 1.000 0.000 0.000
#> GSM241462 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241463 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241464 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241465 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241466 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241468 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241469 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241470 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241471 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241472 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241473 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241474 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241475 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241476 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241477 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241478 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241479 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.865 0.000 1.000 0.000 0.000
#> GSM241482 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241483 2 0.0000 0.865 0.000 1.000 0.000 0.000
#> GSM241484 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241486 2 0.0000 0.865 0.000 1.000 0.000 0.000
#> GSM241487 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241488 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241489 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241491 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241492 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241493 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241494 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241495 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241496 2 0.2647 0.892 0.000 0.880 0.000 0.120
#> GSM241497 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241500 2 0.1022 0.859 0.000 0.968 0.000 0.032
#> GSM241501 2 0.1022 0.859 0.000 0.968 0.000 0.032
#> GSM241502 2 0.1022 0.859 0.000 0.968 0.000 0.032
#> GSM241503 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.990 1.000 0.000 0.000 0.000
#> GSM241506 2 0.1022 0.859 0.000 0.968 0.000 0.032
#> GSM241507 1 0.0921 0.967 0.972 0.000 0.028 0.000
#> GSM241508 2 0.4103 0.657 0.000 0.744 0.000 0.256
#> GSM241509 2 0.4164 0.646 0.000 0.736 0.000 0.264
#> GSM241510 2 0.4164 0.646 0.000 0.736 0.000 0.264
#> GSM241511 1 0.2281 0.902 0.904 0.000 0.096 0.000
#> GSM241512 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241513 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241514 3 0.0188 0.976 0.004 0.000 0.996 0.000
#> GSM241515 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241516 3 0.0188 0.976 0.004 0.000 0.996 0.000
#> GSM241517 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241518 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241519 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241520 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241521 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241522 3 0.0188 0.976 0.004 0.000 0.996 0.000
#> GSM241523 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241524 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241525 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241526 4 0.0469 0.987 0.000 0.012 0.000 0.988
#> GSM241527 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241528 4 0.0469 0.987 0.000 0.012 0.000 0.988
#> GSM241529 4 0.0469 0.987 0.000 0.012 0.000 0.988
#> GSM241530 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241531 1 0.2281 0.902 0.904 0.000 0.096 0.000
#> GSM241532 2 0.4164 0.646 0.000 0.736 0.000 0.264
#> GSM241533 2 0.4164 0.646 0.000 0.736 0.000 0.264
#> GSM241534 2 0.4164 0.646 0.000 0.736 0.000 0.264
#> GSM241535 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241536 1 0.2281 0.902 0.904 0.000 0.096 0.000
#> GSM241537 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241539 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241541 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241542 3 0.4431 0.532 0.000 0.000 0.696 0.304
#> GSM241543 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241544 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241545 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241546 3 0.0000 0.979 0.000 0.000 1.000 0.000
#> GSM241547 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.979 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.3586 0.825 0.000 0.264 0.000 0.000 0.736
#> GSM241458 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241459 5 0.3586 0.825 0.000 0.264 0.000 0.000 0.736
#> GSM241460 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.3586 0.825 0.000 0.264 0.000 0.000 0.736
#> GSM241462 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.3586 0.825 0.000 0.264 0.000 0.000 0.736
#> GSM241482 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241483 5 0.3586 0.825 0.000 0.264 0.000 0.000 0.736
#> GSM241484 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241486 5 0.3586 0.825 0.000 0.264 0.000 0.000 0.736
#> GSM241487 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.980 1.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.0794 0.966 0.972 0.000 0.000 0.000 0.028
#> GSM241500 5 0.4192 0.839 0.000 0.232 0.000 0.032 0.736
#> GSM241501 5 0.4192 0.839 0.000 0.232 0.000 0.032 0.736
#> GSM241502 5 0.4192 0.839 0.000 0.232 0.000 0.032 0.736
#> GSM241503 1 0.0794 0.966 0.972 0.000 0.000 0.000 0.028
#> GSM241504 1 0.0794 0.966 0.972 0.000 0.000 0.000 0.028
#> GSM241505 1 0.0794 0.966 0.972 0.000 0.000 0.000 0.028
#> GSM241506 5 0.4192 0.839 0.000 0.232 0.000 0.032 0.736
#> GSM241507 1 0.2305 0.914 0.896 0.000 0.012 0.000 0.092
#> GSM241508 5 0.3728 0.730 0.000 0.008 0.000 0.244 0.748
#> GSM241509 5 0.3508 0.723 0.000 0.000 0.000 0.252 0.748
#> GSM241510 5 0.3508 0.723 0.000 0.000 0.000 0.252 0.748
#> GSM241511 1 0.3579 0.852 0.828 0.000 0.072 0.000 0.100
#> GSM241512 3 0.0703 0.973 0.000 0.000 0.976 0.000 0.024
#> GSM241513 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241514 3 0.0162 0.974 0.004 0.000 0.996 0.000 0.000
#> GSM241515 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241516 3 0.0162 0.974 0.004 0.000 0.996 0.000 0.000
#> GSM241517 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241518 3 0.0162 0.974 0.000 0.000 0.996 0.000 0.004
#> GSM241519 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241520 3 0.0162 0.974 0.000 0.000 0.996 0.000 0.004
#> GSM241521 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241522 3 0.0162 0.974 0.004 0.000 0.996 0.000 0.000
#> GSM241523 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241524 3 0.0162 0.974 0.000 0.000 0.996 0.000 0.004
#> GSM241525 3 0.0703 0.973 0.000 0.000 0.976 0.000 0.024
#> GSM241526 4 0.2813 0.925 0.000 0.108 0.000 0.868 0.024
#> GSM241527 3 0.0703 0.973 0.000 0.000 0.976 0.000 0.024
#> GSM241528 4 0.2813 0.925 0.000 0.108 0.000 0.868 0.024
#> GSM241529 4 0.2813 0.925 0.000 0.108 0.000 0.868 0.024
#> GSM241530 3 0.0703 0.973 0.000 0.000 0.976 0.000 0.024
#> GSM241531 1 0.3579 0.852 0.828 0.000 0.072 0.000 0.100
#> GSM241532 5 0.3508 0.723 0.000 0.000 0.000 0.252 0.748
#> GSM241533 5 0.3508 0.723 0.000 0.000 0.000 0.252 0.748
#> GSM241534 5 0.3508 0.723 0.000 0.000 0.000 0.252 0.748
#> GSM241535 3 0.0703 0.973 0.000 0.000 0.976 0.000 0.024
#> GSM241536 1 0.3579 0.852 0.828 0.000 0.072 0.000 0.100
#> GSM241537 4 0.2605 0.762 0.000 0.000 0.000 0.852 0.148
#> GSM241538 3 0.0609 0.973 0.000 0.000 0.980 0.000 0.020
#> GSM241539 4 0.2605 0.762 0.000 0.000 0.000 0.852 0.148
#> GSM241540 3 0.0609 0.973 0.000 0.000 0.980 0.000 0.020
#> GSM241541 4 0.2605 0.762 0.000 0.000 0.000 0.852 0.148
#> GSM241542 3 0.5125 0.702 0.000 0.000 0.696 0.156 0.148
#> GSM241543 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241544 3 0.0162 0.974 0.000 0.000 0.996 0.000 0.004
#> GSM241545 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241546 3 0.0162 0.974 0.000 0.000 0.996 0.000 0.004
#> GSM241547 4 0.2280 0.937 0.000 0.120 0.000 0.880 0.000
#> GSM241548 3 0.0162 0.974 0.000 0.000 0.996 0.000 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.3023 0.841 0.000 0.232 0.000 0.000 0.768 0.000
#> GSM241458 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241459 5 0.3023 0.841 0.000 0.232 0.000 0.000 0.768 0.000
#> GSM241460 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.3023 0.841 0.000 0.232 0.000 0.000 0.768 0.000
#> GSM241462 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.3023 0.841 0.000 0.232 0.000 0.000 0.768 0.000
#> GSM241482 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241483 5 0.3023 0.841 0.000 0.232 0.000 0.000 0.768 0.000
#> GSM241484 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241486 5 0.3023 0.841 0.000 0.232 0.000 0.000 0.768 0.000
#> GSM241487 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.946 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.3547 0.537 0.668 0.000 0.000 0.000 0.000 0.332
#> GSM241500 5 0.2793 0.847 0.000 0.200 0.000 0.000 0.800 0.000
#> GSM241501 5 0.2793 0.847 0.000 0.200 0.000 0.000 0.800 0.000
#> GSM241502 5 0.2793 0.847 0.000 0.200 0.000 0.000 0.800 0.000
#> GSM241503 1 0.3547 0.537 0.668 0.000 0.000 0.000 0.000 0.332
#> GSM241504 1 0.3547 0.537 0.668 0.000 0.000 0.000 0.000 0.332
#> GSM241505 1 0.3547 0.537 0.668 0.000 0.000 0.000 0.000 0.332
#> GSM241506 5 0.2793 0.847 0.000 0.200 0.000 0.000 0.800 0.000
#> GSM241507 6 0.2100 0.841 0.112 0.000 0.000 0.004 0.000 0.884
#> GSM241508 5 0.2762 0.750 0.000 0.000 0.196 0.000 0.804 0.000
#> GSM241509 5 0.2823 0.748 0.000 0.000 0.204 0.000 0.796 0.000
#> GSM241510 5 0.2823 0.748 0.000 0.000 0.204 0.000 0.796 0.000
#> GSM241511 6 0.1141 0.947 0.000 0.000 0.000 0.052 0.000 0.948
#> GSM241512 4 0.1007 0.935 0.000 0.000 0.000 0.956 0.000 0.044
#> GSM241513 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241514 4 0.0146 0.942 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241515 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241516 4 0.0146 0.942 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241517 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241518 4 0.1141 0.934 0.000 0.000 0.000 0.948 0.000 0.052
#> GSM241519 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241520 4 0.1141 0.934 0.000 0.000 0.000 0.948 0.000 0.052
#> GSM241521 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241522 4 0.0146 0.942 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM241523 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241524 4 0.1141 0.934 0.000 0.000 0.000 0.948 0.000 0.052
#> GSM241525 4 0.0865 0.939 0.000 0.000 0.000 0.964 0.000 0.036
#> GSM241526 3 0.2822 0.903 0.000 0.108 0.852 0.000 0.040 0.000
#> GSM241527 4 0.0865 0.939 0.000 0.000 0.000 0.964 0.000 0.036
#> GSM241528 3 0.2822 0.903 0.000 0.108 0.852 0.000 0.040 0.000
#> GSM241529 3 0.2822 0.903 0.000 0.108 0.852 0.000 0.040 0.000
#> GSM241530 4 0.0865 0.939 0.000 0.000 0.000 0.964 0.000 0.036
#> GSM241531 6 0.1141 0.947 0.000 0.000 0.000 0.052 0.000 0.948
#> GSM241532 5 0.2823 0.748 0.000 0.000 0.204 0.000 0.796 0.000
#> GSM241533 5 0.2823 0.748 0.000 0.000 0.204 0.000 0.796 0.000
#> GSM241534 5 0.2823 0.748 0.000 0.000 0.204 0.000 0.796 0.000
#> GSM241535 4 0.1007 0.935 0.000 0.000 0.000 0.956 0.000 0.044
#> GSM241536 6 0.1141 0.947 0.000 0.000 0.000 0.052 0.000 0.948
#> GSM241537 3 0.2562 0.687 0.000 0.000 0.828 0.000 0.172 0.000
#> GSM241538 4 0.0790 0.940 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM241539 3 0.2562 0.687 0.000 0.000 0.828 0.000 0.172 0.000
#> GSM241540 4 0.0790 0.940 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM241541 3 0.2562 0.687 0.000 0.000 0.828 0.000 0.172 0.000
#> GSM241542 4 0.5564 0.607 0.000 0.000 0.132 0.648 0.172 0.048
#> GSM241543 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241544 4 0.1141 0.934 0.000 0.000 0.000 0.948 0.000 0.052
#> GSM241545 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241546 4 0.1141 0.934 0.000 0.000 0.000 0.948 0.000 0.052
#> GSM241547 3 0.2048 0.923 0.000 0.120 0.880 0.000 0.000 0.000
#> GSM241548 4 0.1141 0.934 0.000 0.000 0.000 0.948 0.000 0.052
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> MAD:hclust 98 1.00e+00 1.00e+00 2
#> MAD:hclust 91 1.32e-05 2.77e-01 3
#> MAD:hclust 98 8.37e-08 9.47e-02 4
#> MAD:hclust 98 3.14e-09 3.05e-05 5
#> MAD:hclust 98 5.27e-10 2.58e-06 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.990 0.991 0.5053 0.495 0.495
#> 3 3 0.692 0.704 0.860 0.2831 0.815 0.641
#> 4 4 0.697 0.771 0.824 0.1379 0.821 0.544
#> 5 5 0.794 0.689 0.816 0.0672 0.954 0.821
#> 6 6 0.826 0.765 0.823 0.0391 0.909 0.614
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
#> GSM241451 2 0.1414 0.991 0.020 0.980
#> GSM241452 1 0.0000 0.992 1.000 0.000
#> GSM241453 2 0.1414 0.991 0.020 0.980
#> GSM241454 1 0.0000 0.992 1.000 0.000
#> GSM241455 2 0.1414 0.991 0.020 0.980
#> GSM241456 1 0.0000 0.992 1.000 0.000
#> GSM241457 2 0.1414 0.991 0.020 0.980
#> GSM241458 1 0.0000 0.992 1.000 0.000
#> GSM241459 2 0.1414 0.991 0.020 0.980
#> GSM241460 1 0.0000 0.992 1.000 0.000
#> GSM241461 2 0.1414 0.991 0.020 0.980
#> GSM241462 1 0.0000 0.992 1.000 0.000
#> GSM241463 2 0.1414 0.991 0.020 0.980
#> GSM241464 1 0.0000 0.992 1.000 0.000
#> GSM241465 2 0.1414 0.991 0.020 0.980
#> GSM241466 1 0.0000 0.992 1.000 0.000
#> GSM241467 1 0.0000 0.992 1.000 0.000
#> GSM241468 2 0.1414 0.991 0.020 0.980
#> GSM241469 1 0.0000 0.992 1.000 0.000
#> GSM241470 2 0.1414 0.991 0.020 0.980
#> GSM241471 2 0.1414 0.991 0.020 0.980
#> GSM241472 1 0.0000 0.992 1.000 0.000
#> GSM241473 2 0.1414 0.991 0.020 0.980
#> GSM241474 1 0.0000 0.992 1.000 0.000
#> GSM241475 2 0.1414 0.991 0.020 0.980
#> GSM241476 1 0.0000 0.992 1.000 0.000
#> GSM241477 2 0.1414 0.991 0.020 0.980
#> GSM241478 2 0.1414 0.991 0.020 0.980
#> GSM241479 1 0.0000 0.992 1.000 0.000
#> GSM241480 1 0.0000 0.992 1.000 0.000
#> GSM241481 2 0.1414 0.991 0.020 0.980
#> GSM241482 1 0.0000 0.992 1.000 0.000
#> GSM241483 2 0.1414 0.991 0.020 0.980
#> GSM241484 1 0.0000 0.992 1.000 0.000
#> GSM241485 1 0.0000 0.992 1.000 0.000
#> GSM241486 2 0.1414 0.991 0.020 0.980
#> GSM241487 2 0.1414 0.991 0.020 0.980
#> GSM241488 2 0.1414 0.991 0.020 0.980
#> GSM241489 1 0.0000 0.992 1.000 0.000
#> GSM241490 1 0.0000 0.992 1.000 0.000
#> GSM241491 2 0.1414 0.991 0.020 0.980
#> GSM241492 1 0.0000 0.992 1.000 0.000
#> GSM241493 2 0.1414 0.991 0.020 0.980
#> GSM241494 1 0.0000 0.992 1.000 0.000
#> GSM241495 2 0.1414 0.991 0.020 0.980
#> GSM241496 2 0.1414 0.991 0.020 0.980
#> GSM241497 1 0.0000 0.992 1.000 0.000
#> GSM241498 1 0.0000 0.992 1.000 0.000
#> GSM241499 1 0.0000 0.992 1.000 0.000
#> GSM241500 2 0.1184 0.991 0.016 0.984
#> GSM241501 2 0.1414 0.991 0.020 0.980
#> GSM241502 2 0.1414 0.991 0.020 0.980
#> GSM241503 1 0.0000 0.992 1.000 0.000
#> GSM241504 1 0.0000 0.992 1.000 0.000
#> GSM241505 1 0.0000 0.992 1.000 0.000
#> GSM241506 2 0.1414 0.991 0.020 0.980
#> GSM241507 1 0.0000 0.992 1.000 0.000
#> GSM241508 2 0.0000 0.988 0.000 1.000
#> GSM241509 2 0.0000 0.988 0.000 1.000
#> GSM241510 2 0.0000 0.988 0.000 1.000
#> GSM241511 1 0.1414 0.987 0.980 0.020
#> GSM241512 1 0.1414 0.987 0.980 0.020
#> GSM241513 2 0.0000 0.988 0.000 1.000
#> GSM241514 1 0.1414 0.987 0.980 0.020
#> GSM241515 2 0.0000 0.988 0.000 1.000
#> GSM241516 1 0.1414 0.987 0.980 0.020
#> GSM241517 2 0.0000 0.988 0.000 1.000
#> GSM241518 1 0.1414 0.987 0.980 0.020
#> GSM241519 2 0.0000 0.988 0.000 1.000
#> GSM241520 1 0.1414 0.987 0.980 0.020
#> GSM241521 2 0.0000 0.988 0.000 1.000
#> GSM241522 1 0.0000 0.992 1.000 0.000
#> GSM241523 2 0.0000 0.988 0.000 1.000
#> GSM241524 1 0.1414 0.987 0.980 0.020
#> GSM241525 1 0.0672 0.990 0.992 0.008
#> GSM241526 2 0.0000 0.988 0.000 1.000
#> GSM241527 1 0.1414 0.987 0.980 0.020
#> GSM241528 2 0.0000 0.988 0.000 1.000
#> GSM241529 2 0.0000 0.988 0.000 1.000
#> GSM241530 1 0.1414 0.987 0.980 0.020
#> GSM241531 1 0.1414 0.987 0.980 0.020
#> GSM241532 2 0.0000 0.988 0.000 1.000
#> GSM241533 2 0.0000 0.988 0.000 1.000
#> GSM241534 2 0.0000 0.988 0.000 1.000
#> GSM241535 1 0.1414 0.987 0.980 0.020
#> GSM241536 1 0.1414 0.987 0.980 0.020
#> GSM241537 2 0.0000 0.988 0.000 1.000
#> GSM241538 1 0.1414 0.987 0.980 0.020
#> GSM241539 2 0.0000 0.988 0.000 1.000
#> GSM241540 1 0.1414 0.987 0.980 0.020
#> GSM241541 2 0.0000 0.988 0.000 1.000
#> GSM241542 1 0.1414 0.987 0.980 0.020
#> GSM241543 2 0.0000 0.988 0.000 1.000
#> GSM241544 1 0.1414 0.987 0.980 0.020
#> GSM241545 2 0.0000 0.988 0.000 1.000
#> GSM241546 1 0.1414 0.987 0.980 0.020
#> GSM241547 2 0.0000 0.988 0.000 1.000
#> GSM241548 1 0.1414 0.987 0.980 0.020
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241452 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241453 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241454 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241455 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241456 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241457 2 0.2165 0.8487 0.000 0.936 0.064
#> GSM241458 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241459 2 0.2165 0.8487 0.000 0.936 0.064
#> GSM241460 1 0.2400 0.8722 0.932 0.004 0.064
#> GSM241461 2 0.2261 0.8491 0.000 0.932 0.068
#> GSM241462 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241463 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241464 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241465 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241466 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241467 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241468 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241469 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241470 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241472 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241473 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241474 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241475 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241476 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241477 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241479 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241480 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241481 2 0.2165 0.8487 0.000 0.936 0.064
#> GSM241482 1 0.2165 0.8729 0.936 0.000 0.064
#> GSM241483 2 0.2261 0.8491 0.000 0.932 0.068
#> GSM241484 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241485 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241486 2 0.2261 0.8491 0.000 0.932 0.068
#> GSM241487 2 0.0237 0.8633 0.000 0.996 0.004
#> GSM241488 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241489 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241490 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241491 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241492 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241493 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241494 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241495 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.8648 0.000 1.000 0.000
#> GSM241497 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241498 1 0.0237 0.8909 0.996 0.004 0.000
#> GSM241499 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241500 2 0.2261 0.8491 0.000 0.932 0.068
#> GSM241501 2 0.2261 0.8491 0.000 0.932 0.068
#> GSM241502 2 0.2261 0.8491 0.000 0.932 0.068
#> GSM241503 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241504 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241505 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241506 2 0.2261 0.8491 0.000 0.932 0.068
#> GSM241507 1 0.2261 0.8725 0.932 0.000 0.068
#> GSM241508 2 0.2261 0.8491 0.000 0.932 0.068
#> GSM241509 2 0.4291 0.7718 0.000 0.820 0.180
#> GSM241510 2 0.5397 0.6543 0.000 0.720 0.280
#> GSM241511 1 0.5178 0.7399 0.744 0.000 0.256
#> GSM241512 1 0.6267 0.2416 0.548 0.000 0.452
#> GSM241513 3 0.5733 0.4935 0.000 0.324 0.676
#> GSM241514 1 0.6252 0.2561 0.556 0.000 0.444
#> GSM241515 3 0.5706 0.5013 0.000 0.320 0.680
#> GSM241516 1 0.6252 0.2561 0.556 0.000 0.444
#> GSM241517 2 0.6062 0.3510 0.000 0.616 0.384
#> GSM241518 3 0.4047 0.6640 0.148 0.004 0.848
#> GSM241519 2 0.6008 0.3790 0.000 0.628 0.372
#> GSM241520 3 0.5623 0.5070 0.280 0.004 0.716
#> GSM241521 2 0.2796 0.8015 0.000 0.908 0.092
#> GSM241522 1 0.0424 0.8867 0.992 0.000 0.008
#> GSM241523 2 0.6045 0.3605 0.000 0.620 0.380
#> GSM241524 1 0.6252 0.2561 0.556 0.000 0.444
#> GSM241525 1 0.4504 0.7324 0.804 0.000 0.196
#> GSM241526 2 0.6307 0.0567 0.000 0.512 0.488
#> GSM241527 3 0.6274 0.0308 0.456 0.000 0.544
#> GSM241528 2 0.6252 0.2089 0.000 0.556 0.444
#> GSM241529 2 0.6307 0.0567 0.000 0.512 0.488
#> GSM241530 1 0.4842 0.6977 0.776 0.000 0.224
#> GSM241531 1 0.5216 0.7354 0.740 0.000 0.260
#> GSM241532 2 0.6267 0.3280 0.000 0.548 0.452
#> GSM241533 3 0.6280 -0.1058 0.000 0.460 0.540
#> GSM241534 3 0.6280 -0.1058 0.000 0.460 0.540
#> GSM241535 3 0.3551 0.6726 0.132 0.000 0.868
#> GSM241536 1 0.5178 0.7399 0.744 0.000 0.256
#> GSM241537 3 0.3482 0.6551 0.000 0.128 0.872
#> GSM241538 3 0.3551 0.6726 0.132 0.000 0.868
#> GSM241539 3 0.3482 0.6551 0.000 0.128 0.872
#> GSM241540 3 0.5905 0.3522 0.352 0.000 0.648
#> GSM241541 3 0.4796 0.5966 0.000 0.220 0.780
#> GSM241542 3 0.3715 0.6748 0.128 0.004 0.868
#> GSM241543 3 0.5706 0.5013 0.000 0.320 0.680
#> GSM241544 3 0.5178 0.5441 0.256 0.000 0.744
#> GSM241545 3 0.5706 0.5013 0.000 0.320 0.680
#> GSM241546 3 0.6302 -0.0507 0.480 0.000 0.520
#> GSM241547 3 0.5706 0.5013 0.000 0.320 0.680
#> GSM241548 3 0.3784 0.6744 0.132 0.004 0.864
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241452 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241453 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241454 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241455 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241456 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241457 2 0.0000 0.747 0.000 1.000 0.000 0.000
#> GSM241458 1 0.3444 0.849 0.816 0.000 0.184 0.000
#> GSM241459 2 0.0000 0.747 0.000 1.000 0.000 0.000
#> GSM241460 1 0.1867 0.890 0.928 0.000 0.072 0.000
#> GSM241461 2 0.0376 0.743 0.000 0.992 0.004 0.004
#> GSM241462 1 0.3626 0.848 0.812 0.000 0.184 0.004
#> GSM241463 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241464 1 0.0188 0.915 0.996 0.000 0.000 0.004
#> GSM241465 2 0.5593 0.850 0.000 0.708 0.212 0.080
#> GSM241466 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241468 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241469 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241470 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241471 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241472 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241473 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241474 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241475 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241476 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241477 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241478 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241479 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.747 0.000 1.000 0.000 0.000
#> GSM241482 1 0.3444 0.849 0.816 0.000 0.184 0.000
#> GSM241483 2 0.0188 0.745 0.000 0.996 0.004 0.000
#> GSM241484 1 0.3486 0.847 0.812 0.000 0.188 0.000
#> GSM241485 1 0.3306 0.860 0.840 0.000 0.156 0.004
#> GSM241486 2 0.0376 0.743 0.000 0.992 0.004 0.004
#> GSM241487 2 0.5593 0.850 0.000 0.708 0.212 0.080
#> GSM241488 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241489 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241491 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241492 1 0.0188 0.915 0.996 0.000 0.000 0.004
#> GSM241493 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241494 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241495 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241496 2 0.5771 0.852 0.004 0.704 0.212 0.080
#> GSM241497 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.916 1.000 0.000 0.000 0.000
#> GSM241499 1 0.3569 0.842 0.804 0.000 0.196 0.000
#> GSM241500 2 0.0895 0.730 0.000 0.976 0.004 0.020
#> GSM241501 2 0.0376 0.743 0.000 0.992 0.004 0.004
#> GSM241502 2 0.0657 0.737 0.000 0.984 0.004 0.012
#> GSM241503 1 0.3569 0.842 0.804 0.000 0.196 0.000
#> GSM241504 1 0.3569 0.842 0.804 0.000 0.196 0.000
#> GSM241505 1 0.3569 0.842 0.804 0.000 0.196 0.000
#> GSM241506 2 0.0895 0.730 0.000 0.976 0.004 0.020
#> GSM241507 1 0.3569 0.842 0.804 0.000 0.196 0.000
#> GSM241508 2 0.0895 0.730 0.000 0.976 0.004 0.020
#> GSM241509 4 0.5137 0.573 0.000 0.452 0.004 0.544
#> GSM241510 4 0.5119 0.588 0.000 0.440 0.004 0.556
#> GSM241511 3 0.4356 0.481 0.292 0.000 0.708 0.000
#> GSM241512 3 0.7085 0.756 0.200 0.000 0.568 0.232
#> GSM241513 4 0.2623 0.694 0.000 0.028 0.064 0.908
#> GSM241514 3 0.7220 0.758 0.212 0.000 0.548 0.240
#> GSM241515 4 0.2623 0.694 0.000 0.028 0.064 0.908
#> GSM241516 3 0.7324 0.754 0.228 0.000 0.532 0.240
#> GSM241517 4 0.5889 0.687 0.000 0.100 0.212 0.688
#> GSM241518 3 0.6121 0.699 0.060 0.000 0.588 0.352
#> GSM241519 4 0.5889 0.687 0.000 0.100 0.212 0.688
#> GSM241520 3 0.6501 0.725 0.096 0.000 0.588 0.316
#> GSM241521 4 0.7026 0.509 0.000 0.180 0.248 0.572
#> GSM241522 1 0.3400 0.668 0.820 0.000 0.180 0.000
#> GSM241523 4 0.5889 0.687 0.000 0.100 0.212 0.688
#> GSM241524 3 0.6897 0.759 0.160 0.000 0.584 0.256
#> GSM241525 3 0.5582 0.496 0.400 0.000 0.576 0.024
#> GSM241526 4 0.2773 0.732 0.000 0.116 0.004 0.880
#> GSM241527 3 0.6801 0.759 0.124 0.000 0.568 0.308
#> GSM241528 4 0.5080 0.701 0.000 0.092 0.144 0.764
#> GSM241529 4 0.4318 0.735 0.000 0.116 0.068 0.816
#> GSM241530 3 0.6280 0.589 0.344 0.000 0.584 0.072
#> GSM241531 3 0.4356 0.481 0.292 0.000 0.708 0.000
#> GSM241532 4 0.4991 0.641 0.000 0.388 0.004 0.608
#> GSM241533 4 0.4978 0.645 0.000 0.384 0.004 0.612
#> GSM241534 4 0.4978 0.645 0.000 0.384 0.004 0.612
#> GSM241535 3 0.5097 0.659 0.004 0.000 0.568 0.428
#> GSM241536 3 0.4356 0.481 0.292 0.000 0.708 0.000
#> GSM241537 4 0.1940 0.570 0.000 0.000 0.076 0.924
#> GSM241538 3 0.5147 0.637 0.004 0.000 0.536 0.460
#> GSM241539 4 0.1940 0.570 0.000 0.000 0.076 0.924
#> GSM241540 3 0.6794 0.756 0.116 0.000 0.556 0.328
#> GSM241541 4 0.1489 0.621 0.000 0.004 0.044 0.952
#> GSM241542 3 0.5151 0.632 0.004 0.000 0.532 0.464
#> GSM241543 4 0.2845 0.687 0.000 0.028 0.076 0.896
#> GSM241544 3 0.6412 0.724 0.088 0.000 0.592 0.320
#> GSM241545 4 0.2845 0.687 0.000 0.028 0.076 0.896
#> GSM241546 3 0.6883 0.759 0.156 0.000 0.584 0.260
#> GSM241547 4 0.2845 0.687 0.000 0.028 0.076 0.896
#> GSM241548 3 0.5172 0.635 0.008 0.000 0.588 0.404
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241457 2 0.4302 -0.174 0.000 0.520 0.000 0.000 0.480
#> GSM241458 1 0.5804 0.711 0.648 0.000 0.056 0.048 0.248
#> GSM241459 2 0.4302 -0.174 0.000 0.520 0.000 0.000 0.480
#> GSM241460 1 0.0671 0.854 0.980 0.000 0.000 0.016 0.004
#> GSM241461 2 0.4307 -0.227 0.000 0.504 0.000 0.000 0.496
#> GSM241462 1 0.5879 0.712 0.648 0.000 0.060 0.052 0.240
#> GSM241463 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241465 2 0.0162 0.810 0.000 0.996 0.000 0.000 0.004
#> GSM241466 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241467 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241480 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241481 2 0.4302 -0.174 0.000 0.520 0.000 0.000 0.480
#> GSM241482 1 0.5599 0.719 0.660 0.000 0.056 0.036 0.248
#> GSM241483 2 0.4302 -0.174 0.000 0.520 0.000 0.000 0.480
#> GSM241484 1 0.5804 0.711 0.648 0.000 0.056 0.048 0.248
#> GSM241485 1 0.5180 0.750 0.724 0.000 0.044 0.052 0.180
#> GSM241486 2 0.4307 -0.227 0.000 0.504 0.000 0.000 0.496
#> GSM241487 2 0.0162 0.810 0.000 0.996 0.000 0.000 0.004
#> GSM241488 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241490 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.814 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241498 1 0.0162 0.862 0.996 0.004 0.000 0.000 0.000
#> GSM241499 1 0.6171 0.668 0.592 0.000 0.060 0.052 0.296
#> GSM241500 5 0.4818 0.277 0.000 0.460 0.020 0.000 0.520
#> GSM241501 5 0.4650 0.250 0.000 0.468 0.012 0.000 0.520
#> GSM241502 5 0.4738 0.265 0.000 0.464 0.016 0.000 0.520
#> GSM241503 1 0.6171 0.668 0.592 0.000 0.060 0.052 0.296
#> GSM241504 1 0.6171 0.668 0.592 0.000 0.060 0.052 0.296
#> GSM241505 1 0.6171 0.668 0.592 0.000 0.060 0.052 0.296
#> GSM241506 5 0.4818 0.277 0.000 0.460 0.020 0.000 0.520
#> GSM241507 1 0.6171 0.668 0.592 0.000 0.060 0.052 0.296
#> GSM241508 5 0.4818 0.277 0.000 0.460 0.020 0.000 0.520
#> GSM241509 5 0.4733 0.397 0.000 0.028 0.348 0.000 0.624
#> GSM241510 5 0.4733 0.397 0.000 0.028 0.348 0.000 0.624
#> GSM241511 4 0.6191 0.597 0.048 0.000 0.060 0.576 0.316
#> GSM241512 4 0.3428 0.812 0.052 0.000 0.008 0.848 0.092
#> GSM241513 3 0.2846 0.855 0.000 0.052 0.888 0.048 0.012
#> GSM241514 4 0.3673 0.829 0.040 0.000 0.060 0.848 0.052
#> GSM241515 3 0.2450 0.858 0.000 0.052 0.900 0.048 0.000
#> GSM241516 4 0.3388 0.830 0.056 0.000 0.040 0.864 0.040
#> GSM241517 3 0.2424 0.832 0.000 0.132 0.868 0.000 0.000
#> GSM241518 4 0.3567 0.815 0.004 0.000 0.112 0.832 0.052
#> GSM241519 3 0.2424 0.832 0.000 0.132 0.868 0.000 0.000
#> GSM241520 4 0.3640 0.817 0.008 0.000 0.108 0.832 0.052
#> GSM241521 3 0.2813 0.793 0.000 0.168 0.832 0.000 0.000
#> GSM241522 1 0.4644 0.461 0.680 0.000 0.000 0.280 0.040
#> GSM241523 3 0.3101 0.844 0.000 0.100 0.864 0.024 0.012
#> GSM241524 4 0.3714 0.824 0.024 0.000 0.084 0.840 0.052
#> GSM241525 4 0.4086 0.794 0.080 0.000 0.012 0.808 0.100
#> GSM241526 3 0.5218 0.802 0.000 0.072 0.736 0.048 0.144
#> GSM241527 4 0.2925 0.822 0.016 0.000 0.036 0.884 0.064
#> GSM241528 3 0.5325 0.790 0.000 0.112 0.720 0.028 0.140
#> GSM241529 3 0.5262 0.799 0.000 0.080 0.732 0.044 0.144
#> GSM241530 4 0.3576 0.808 0.048 0.000 0.012 0.840 0.100
#> GSM241531 4 0.5979 0.604 0.032 0.000 0.064 0.588 0.316
#> GSM241532 5 0.4607 0.340 0.000 0.004 0.368 0.012 0.616
#> GSM241533 5 0.5024 0.251 0.000 0.004 0.396 0.028 0.572
#> GSM241534 5 0.4644 0.324 0.000 0.004 0.380 0.012 0.604
#> GSM241535 4 0.3055 0.812 0.000 0.000 0.064 0.864 0.072
#> GSM241536 4 0.6152 0.601 0.044 0.000 0.064 0.584 0.308
#> GSM241537 3 0.4221 0.793 0.000 0.000 0.780 0.108 0.112
#> GSM241538 4 0.2450 0.820 0.000 0.000 0.076 0.896 0.028
#> GSM241539 3 0.4221 0.793 0.000 0.000 0.780 0.108 0.112
#> GSM241540 4 0.2590 0.825 0.012 0.000 0.060 0.900 0.028
#> GSM241541 3 0.4221 0.793 0.000 0.000 0.780 0.108 0.112
#> GSM241542 4 0.1956 0.821 0.000 0.000 0.076 0.916 0.008
#> GSM241543 3 0.2766 0.851 0.000 0.040 0.892 0.056 0.012
#> GSM241544 4 0.3536 0.821 0.008 0.000 0.100 0.840 0.052
#> GSM241545 3 0.2766 0.851 0.000 0.040 0.892 0.056 0.012
#> GSM241546 4 0.3597 0.826 0.024 0.000 0.076 0.848 0.052
#> GSM241547 3 0.2370 0.855 0.000 0.040 0.904 0.056 0.000
#> GSM241548 4 0.3459 0.813 0.000 0.000 0.116 0.832 0.052
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0363 0.98887 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM241456 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.4410 0.62233 0.000 0.412 0.000 0.000 0.560 0.028
#> GSM241458 6 0.3979 0.62292 0.456 0.000 0.000 0.000 0.004 0.540
#> GSM241459 5 0.4410 0.62233 0.000 0.412 0.000 0.000 0.560 0.028
#> GSM241460 1 0.0405 0.91838 0.988 0.000 0.004 0.000 0.008 0.000
#> GSM241461 5 0.4300 0.67439 0.000 0.364 0.000 0.000 0.608 0.028
#> GSM241462 6 0.4250 0.61722 0.456 0.000 0.000 0.000 0.016 0.528
#> GSM241463 2 0.0363 0.98887 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM241464 1 0.0665 0.91008 0.980 0.000 0.004 0.000 0.008 0.008
#> GSM241465 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0291 0.92089 0.992 0.000 0.004 0.000 0.004 0.000
#> GSM241468 2 0.0146 0.99410 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM241469 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0291 0.92089 0.992 0.000 0.004 0.000 0.004 0.000
#> GSM241473 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0291 0.92089 0.992 0.000 0.004 0.000 0.004 0.000
#> GSM241475 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0363 0.98887 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM241479 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.4410 0.62233 0.000 0.412 0.000 0.000 0.560 0.028
#> GSM241482 6 0.3979 0.62292 0.456 0.000 0.000 0.000 0.004 0.540
#> GSM241483 5 0.4403 0.62763 0.000 0.408 0.000 0.000 0.564 0.028
#> GSM241484 6 0.3979 0.62292 0.456 0.000 0.000 0.000 0.004 0.540
#> GSM241485 1 0.4199 -0.37415 0.568 0.000 0.000 0.000 0.016 0.416
#> GSM241486 5 0.4300 0.67439 0.000 0.364 0.000 0.000 0.608 0.028
#> GSM241487 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0146 0.99410 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM241489 1 0.0291 0.92089 0.992 0.000 0.004 0.000 0.004 0.000
#> GSM241490 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0363 0.98887 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM241492 1 0.0665 0.91008 0.980 0.000 0.004 0.000 0.008 0.008
#> GSM241493 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.99607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0146 0.99410 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM241497 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.92387 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 6 0.3742 0.73219 0.348 0.000 0.000 0.004 0.000 0.648
#> GSM241500 5 0.3816 0.71755 0.000 0.296 0.016 0.000 0.688 0.000
#> GSM241501 5 0.3672 0.71523 0.000 0.304 0.008 0.000 0.688 0.000
#> GSM241502 5 0.3672 0.71523 0.000 0.304 0.008 0.000 0.688 0.000
#> GSM241503 6 0.3833 0.73339 0.344 0.000 0.000 0.008 0.000 0.648
#> GSM241504 6 0.3969 0.73230 0.344 0.000 0.000 0.008 0.004 0.644
#> GSM241505 6 0.3833 0.73339 0.344 0.000 0.000 0.008 0.000 0.648
#> GSM241506 5 0.4060 0.71621 0.000 0.296 0.016 0.000 0.680 0.008
#> GSM241507 6 0.3742 0.73219 0.348 0.000 0.000 0.004 0.000 0.648
#> GSM241508 5 0.3816 0.71755 0.000 0.296 0.016 0.000 0.688 0.000
#> GSM241509 5 0.3488 0.43644 0.000 0.000 0.216 0.004 0.764 0.016
#> GSM241510 5 0.3488 0.43644 0.000 0.000 0.216 0.004 0.764 0.016
#> GSM241511 6 0.3411 0.29510 0.008 0.000 0.000 0.232 0.004 0.756
#> GSM241512 4 0.3806 0.72629 0.008 0.000 0.004 0.736 0.012 0.240
#> GSM241513 3 0.1148 0.84346 0.000 0.016 0.960 0.004 0.020 0.000
#> GSM241514 4 0.3561 0.79327 0.016 0.000 0.020 0.808 0.148 0.008
#> GSM241515 3 0.0748 0.84668 0.000 0.016 0.976 0.004 0.004 0.000
#> GSM241516 4 0.3322 0.79486 0.024 0.000 0.012 0.836 0.116 0.012
#> GSM241517 3 0.0935 0.84381 0.000 0.032 0.964 0.000 0.004 0.000
#> GSM241518 4 0.4308 0.77548 0.000 0.000 0.088 0.740 0.164 0.008
#> GSM241519 3 0.0935 0.84381 0.000 0.032 0.964 0.000 0.004 0.000
#> GSM241520 4 0.4154 0.77415 0.000 0.000 0.096 0.740 0.164 0.000
#> GSM241521 3 0.1411 0.82299 0.000 0.060 0.936 0.000 0.004 0.000
#> GSM241522 1 0.5432 0.03540 0.500 0.000 0.000 0.376 0.124 0.000
#> GSM241523 3 0.1176 0.84128 0.000 0.020 0.956 0.000 0.024 0.000
#> GSM241524 4 0.3691 0.79145 0.004 0.000 0.060 0.788 0.148 0.000
#> GSM241525 4 0.3861 0.73233 0.028 0.000 0.000 0.744 0.008 0.220
#> GSM241526 3 0.5417 0.73238 0.000 0.004 0.656 0.024 0.168 0.148
#> GSM241527 4 0.3243 0.74546 0.000 0.000 0.004 0.780 0.008 0.208
#> GSM241528 3 0.5540 0.73142 0.000 0.020 0.652 0.012 0.168 0.148
#> GSM241529 3 0.5417 0.73238 0.000 0.004 0.656 0.024 0.168 0.148
#> GSM241530 4 0.3578 0.73849 0.008 0.000 0.004 0.760 0.008 0.220
#> GSM241531 6 0.4090 -0.00768 0.004 0.000 0.000 0.384 0.008 0.604
#> GSM241532 5 0.5477 0.19221 0.000 0.000 0.264 0.004 0.576 0.156
#> GSM241533 5 0.5686 0.16630 0.000 0.000 0.268 0.012 0.564 0.156
#> GSM241534 5 0.5477 0.19221 0.000 0.000 0.264 0.004 0.576 0.156
#> GSM241535 4 0.3806 0.73598 0.000 0.000 0.008 0.752 0.028 0.212
#> GSM241536 6 0.3704 0.28866 0.008 0.000 0.000 0.232 0.016 0.744
#> GSM241537 3 0.5386 0.75633 0.000 0.000 0.664 0.044 0.116 0.176
#> GSM241538 4 0.3178 0.77123 0.000 0.000 0.012 0.832 0.028 0.128
#> GSM241539 3 0.5386 0.75633 0.000 0.000 0.664 0.044 0.116 0.176
#> GSM241540 4 0.2871 0.77619 0.000 0.000 0.008 0.852 0.024 0.116
#> GSM241541 3 0.5203 0.76411 0.000 0.000 0.684 0.044 0.104 0.168
#> GSM241542 4 0.3150 0.77660 0.000 0.000 0.016 0.844 0.036 0.104
#> GSM241543 3 0.1490 0.83861 0.000 0.004 0.948 0.016 0.024 0.008
#> GSM241544 4 0.3608 0.79167 0.000 0.000 0.064 0.788 0.148 0.000
#> GSM241545 3 0.1490 0.83861 0.000 0.004 0.948 0.016 0.024 0.008
#> GSM241546 4 0.3447 0.79520 0.004 0.000 0.044 0.804 0.148 0.000
#> GSM241547 3 0.0767 0.84610 0.000 0.004 0.976 0.012 0.000 0.008
#> GSM241548 4 0.4120 0.77525 0.000 0.000 0.096 0.744 0.160 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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> MAD:kmeans 98 1.00e+00 1.00e+00 2
#> MAD:kmeans 81 5.94e-08 2.80e-02 3
#> MAD:kmeans 94 4.28e-11 6.68e-01 4
#> MAD:kmeans 81 3.18e-11 1.52e-01 5
#> MAD:kmeans 88 1.56e-11 6.03e-05 6
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 16250 rows and 98 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 1.000 1.000 1.000 0.5056 0.495 0.495
#> 3 3 1.000 0.953 0.981 0.3090 0.787 0.593
#> 4 4 0.953 0.965 0.984 0.1318 0.877 0.657
#> 5 5 0.925 0.949 0.955 0.0597 0.931 0.739
#> 6 6 0.955 0.880 0.932 0.0522 0.932 0.686
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
#> GSM241451 2 0 1 0 1
#> GSM241452 1 0 1 1 0
#> GSM241453 2 0 1 0 1
#> GSM241454 1 0 1 1 0
#> GSM241455 2 0 1 0 1
#> GSM241456 1 0 1 1 0
#> GSM241457 2 0 1 0 1
#> GSM241458 1 0 1 1 0
#> GSM241459 2 0 1 0 1
#> GSM241460 1 0 1 1 0
#> GSM241461 2 0 1 0 1
#> GSM241462 1 0 1 1 0
#> GSM241463 2 0 1 0 1
#> GSM241464 1 0 1 1 0
#> GSM241465 2 0 1 0 1
#> GSM241466 1 0 1 1 0
#> GSM241467 1 0 1 1 0
#> GSM241468 2 0 1 0 1
#> GSM241469 1 0 1 1 0
#> GSM241470 2 0 1 0 1
#> GSM241471 2 0 1 0 1
#> GSM241472 1 0 1 1 0
#> GSM241473 2 0 1 0 1
#> GSM241474 1 0 1 1 0
#> GSM241475 2 0 1 0 1
#> GSM241476 1 0 1 1 0
#> GSM241477 2 0 1 0 1
#> GSM241478 2 0 1 0 1
#> GSM241479 1 0 1 1 0
#> GSM241480 1 0 1 1 0
#> GSM241481 2 0 1 0 1
#> GSM241482 1 0 1 1 0
#> GSM241483 2 0 1 0 1
#> GSM241484 1 0 1 1 0
#> GSM241485 1 0 1 1 0
#> GSM241486 2 0 1 0 1
#> GSM241487 2 0 1 0 1
#> GSM241488 2 0 1 0 1
#> GSM241489 1 0 1 1 0
#> GSM241490 1 0 1 1 0
#> GSM241491 2 0 1 0 1
#> GSM241492 1 0 1 1 0
#> GSM241493 2 0 1 0 1
#> GSM241494 1 0 1 1 0
#> GSM241495 2 0 1 0 1
#> GSM241496 2 0 1 0 1
#> GSM241497 1 0 1 1 0
#> GSM241498 1 0 1 1 0
#> GSM241499 1 0 1 1 0
#> GSM241500 2 0 1 0 1
#> GSM241501 2 0 1 0 1
#> GSM241502 2 0 1 0 1
#> GSM241503 1 0 1 1 0
#> GSM241504 1 0 1 1 0
#> GSM241505 1 0 1 1 0
#> GSM241506 2 0 1 0 1
#> GSM241507 1 0 1 1 0
#> GSM241508 2 0 1 0 1
#> GSM241509 2 0 1 0 1
#> GSM241510 2 0 1 0 1
#> GSM241511 1 0 1 1 0
#> GSM241512 1 0 1 1 0
#> GSM241513 2 0 1 0 1
#> GSM241514 1 0 1 1 0
#> GSM241515 2 0 1 0 1
#> GSM241516 1 0 1 1 0
#> GSM241517 2 0 1 0 1
#> GSM241518 1 0 1 1 0
#> GSM241519 2 0 1 0 1
#> GSM241520 1 0 1 1 0
#> GSM241521 2 0 1 0 1
#> GSM241522 1 0 1 1 0
#> GSM241523 2 0 1 0 1
#> GSM241524 1 0 1 1 0
#> GSM241525 1 0 1 1 0
#> GSM241526 2 0 1 0 1
#> GSM241527 1 0 1 1 0
#> GSM241528 2 0 1 0 1
#> GSM241529 2 0 1 0 1
#> GSM241530 1 0 1 1 0
#> GSM241531 1 0 1 1 0
#> GSM241532 2 0 1 0 1
#> GSM241533 2 0 1 0 1
#> GSM241534 2 0 1 0 1
#> GSM241535 1 0 1 1 0
#> GSM241536 1 0 1 1 0
#> GSM241537 2 0 1 0 1
#> GSM241538 1 0 1 1 0
#> GSM241539 2 0 1 0 1
#> GSM241540 1 0 1 1 0
#> GSM241541 2 0 1 0 1
#> GSM241542 1 0 1 1 0
#> GSM241543 2 0 1 0 1
#> GSM241544 1 0 1 1 0
#> GSM241545 2 0 1 0 1
#> GSM241546 1 0 1 1 0
#> GSM241547 2 0 1 0 1
#> GSM241548 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241453 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241455 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241457 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241458 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241459 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241461 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241462 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241463 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241464 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241465 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241468 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241470 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241471 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241473 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241475 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241477 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241478 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241481 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241483 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241484 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241486 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241487 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241488 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241491 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241492 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241493 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241495 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241496 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241499 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241500 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241501 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241502 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241503 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241504 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241505 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241506 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241507 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241508 2 0.0000 1.0000 0.000 1.000 0.000
#> GSM241509 3 0.2796 0.8957 0.000 0.092 0.908
#> GSM241510 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241511 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241512 1 0.0747 0.9639 0.984 0.000 0.016
#> GSM241513 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241514 1 0.0747 0.9639 0.984 0.000 0.016
#> GSM241515 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241516 1 0.0747 0.9639 0.984 0.000 0.016
#> GSM241517 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241518 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241519 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241520 3 0.2537 0.8916 0.080 0.000 0.920
#> GSM241521 3 0.6274 0.1682 0.000 0.456 0.544
#> GSM241522 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241523 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241524 1 0.0747 0.9639 0.984 0.000 0.016
#> GSM241525 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241526 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241527 1 0.6267 0.2016 0.548 0.000 0.452
#> GSM241528 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241529 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241530 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241531 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241532 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241533 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241534 3 0.0747 0.9664 0.000 0.016 0.984
#> GSM241535 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241536 1 0.0000 0.9748 1.000 0.000 0.000
#> GSM241537 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241540 1 0.6305 0.0949 0.516 0.000 0.484
#> GSM241541 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241544 3 0.0237 0.9662 0.004 0.000 0.996
#> GSM241545 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241546 1 0.1031 0.9573 0.976 0.000 0.024
#> GSM241547 3 0.0000 0.9685 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.9685 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241457 2 0.0188 0.960 0.000 0.996 0.000 0.004
#> GSM241458 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241459 2 0.0188 0.960 0.000 0.996 0.000 0.004
#> GSM241460 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241461 2 0.0188 0.960 0.000 0.996 0.000 0.004
#> GSM241462 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0188 0.960 0.000 0.996 0.000 0.004
#> GSM241482 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241483 2 0.0188 0.960 0.000 0.996 0.000 0.004
#> GSM241484 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241486 2 0.0188 0.960 0.000 0.996 0.000 0.004
#> GSM241487 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241488 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.962 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241500 2 0.3649 0.783 0.000 0.796 0.000 0.204
#> GSM241501 2 0.3649 0.783 0.000 0.796 0.000 0.204
#> GSM241502 2 0.3649 0.783 0.000 0.796 0.000 0.204
#> GSM241503 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241506 2 0.3649 0.783 0.000 0.796 0.000 0.204
#> GSM241507 1 0.0000 0.984 1.000 0.000 0.000 0.000
#> GSM241508 2 0.3649 0.783 0.000 0.796 0.000 0.204
#> GSM241509 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241510 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241511 3 0.0188 0.996 0.004 0.000 0.996 0.000
#> GSM241512 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241513 4 0.0188 0.997 0.000 0.000 0.004 0.996
#> GSM241514 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241515 4 0.0188 0.997 0.000 0.000 0.004 0.996
#> GSM241516 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241517 4 0.0188 0.996 0.000 0.004 0.000 0.996
#> GSM241518 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241519 4 0.0188 0.996 0.000 0.004 0.000 0.996
#> GSM241520 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241521 4 0.0188 0.996 0.000 0.004 0.000 0.996
#> GSM241522 1 0.4981 0.132 0.536 0.000 0.464 0.000
#> GSM241523 4 0.0188 0.996 0.000 0.004 0.000 0.996
#> GSM241524 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241525 3 0.0188 0.996 0.004 0.000 0.996 0.000
#> GSM241526 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241528 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241529 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241530 3 0.0188 0.996 0.004 0.000 0.996 0.000
#> GSM241531 3 0.0188 0.996 0.004 0.000 0.996 0.000
#> GSM241532 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241533 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241534 4 0.0000 0.997 0.000 0.000 0.000 1.000
#> GSM241535 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241536 3 0.0188 0.996 0.004 0.000 0.996 0.000
#> GSM241537 4 0.0188 0.997 0.000 0.000 0.004 0.996
#> GSM241538 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241539 4 0.0188 0.997 0.000 0.000 0.004 0.996
#> GSM241540 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241541 4 0.0188 0.997 0.000 0.000 0.004 0.996
#> GSM241542 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241543 4 0.0188 0.997 0.000 0.000 0.004 0.996
#> GSM241544 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241545 4 0.0188 0.997 0.000 0.000 0.004 0.996
#> GSM241546 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM241547 4 0.0188 0.997 0.000 0.000 0.004 0.996
#> GSM241548 3 0.0000 0.999 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.252 0.9099 0.000 0.140 0.000 0.000 0.860
#> GSM241458 1 0.154 0.9344 0.932 0.000 0.000 0.000 0.068
#> GSM241459 5 0.252 0.9099 0.000 0.140 0.000 0.000 0.860
#> GSM241460 1 0.154 0.9344 0.932 0.000 0.000 0.000 0.068
#> GSM241461 5 0.242 0.9142 0.000 0.132 0.000 0.000 0.868
#> GSM241462 1 0.154 0.9344 0.932 0.000 0.000 0.000 0.068
#> GSM241463 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.252 0.9099 0.000 0.140 0.000 0.000 0.860
#> GSM241482 1 0.154 0.9344 0.932 0.000 0.000 0.000 0.068
#> GSM241483 5 0.247 0.9123 0.000 0.136 0.000 0.000 0.864
#> GSM241484 1 0.154 0.9344 0.932 0.000 0.000 0.000 0.068
#> GSM241485 1 0.154 0.9344 0.932 0.000 0.000 0.000 0.068
#> GSM241486 5 0.242 0.9142 0.000 0.132 0.000 0.000 0.868
#> GSM241487 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241488 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.000 1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.000 0.9516 1.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.242 0.9014 0.868 0.000 0.000 0.000 0.132
#> GSM241500 5 0.298 0.9334 0.000 0.076 0.056 0.000 0.868
#> GSM241501 5 0.298 0.9334 0.000 0.076 0.056 0.000 0.868
#> GSM241502 5 0.298 0.9334 0.000 0.076 0.056 0.000 0.868
#> GSM241503 1 0.242 0.9014 0.868 0.000 0.000 0.000 0.132
#> GSM241504 1 0.242 0.9014 0.868 0.000 0.000 0.000 0.132
#> GSM241505 1 0.242 0.9014 0.868 0.000 0.000 0.000 0.132
#> GSM241506 5 0.298 0.9334 0.000 0.076 0.056 0.000 0.868
#> GSM241507 1 0.242 0.9014 0.868 0.000 0.000 0.000 0.132
#> GSM241508 5 0.298 0.9334 0.000 0.076 0.056 0.000 0.868
#> GSM241509 5 0.242 0.8892 0.000 0.000 0.132 0.000 0.868
#> GSM241510 5 0.242 0.8892 0.000 0.000 0.132 0.000 0.868
#> GSM241511 4 0.242 0.9142 0.000 0.000 0.000 0.868 0.132
#> GSM241512 4 0.154 0.9525 0.000 0.000 0.000 0.932 0.068
#> GSM241513 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241514 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241515 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241516 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241517 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241518 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241519 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241520 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241521 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241522 1 0.431 0.0586 0.508 0.000 0.000 0.492 0.000
#> GSM241523 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241524 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241525 4 0.148 0.9541 0.000 0.000 0.000 0.936 0.064
#> GSM241526 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241527 4 0.148 0.9541 0.000 0.000 0.000 0.936 0.064
#> GSM241528 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241529 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241530 4 0.148 0.9541 0.000 0.000 0.000 0.936 0.064
#> GSM241531 4 0.242 0.9142 0.000 0.000 0.000 0.868 0.132
#> GSM241532 5 0.242 0.8892 0.000 0.000 0.132 0.000 0.868
#> GSM241533 5 0.242 0.8892 0.000 0.000 0.132 0.000 0.868
#> GSM241534 5 0.242 0.8892 0.000 0.000 0.132 0.000 0.868
#> GSM241535 4 0.148 0.9541 0.000 0.000 0.000 0.936 0.064
#> GSM241536 4 0.242 0.9142 0.000 0.000 0.000 0.868 0.132
#> GSM241537 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241538 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241539 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241540 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241541 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241542 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241543 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241544 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241545 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241546 4 0.000 0.9664 0.000 0.000 0.000 1.000 0.000
#> GSM241547 3 0.000 1.0000 0.000 0.000 1.000 0.000 0.000
#> GSM241548 4 0.000 0.9664 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
#> GSM241451 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241453 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241455 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241457 5 0.1327 0.945 0.000 0.064 0.000 0.000 0.936 0.000
#> GSM241458 6 0.0547 0.529 0.020 0.000 0.000 0.000 0.000 0.980
#> GSM241459 5 0.1327 0.945 0.000 0.064 0.000 0.000 0.936 0.000
#> GSM241460 6 0.2527 0.107 0.168 0.000 0.000 0.000 0.000 0.832
#> GSM241461 5 0.0937 0.958 0.000 0.040 0.000 0.000 0.960 0.000
#> GSM241462 6 0.0000 0.559 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241463 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.3747 0.995 0.604 0.000 0.000 0.000 0.000 0.396
#> GSM241465 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241467 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241468 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241470 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241473 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241475 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241477 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241480 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241481 5 0.1327 0.945 0.000 0.064 0.000 0.000 0.936 0.000
#> GSM241482 6 0.0790 0.505 0.032 0.000 0.000 0.000 0.000 0.968
#> GSM241483 5 0.1141 0.952 0.000 0.052 0.000 0.000 0.948 0.000
#> GSM241484 6 0.0000 0.559 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241485 6 0.0260 0.549 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM241486 5 0.0937 0.958 0.000 0.040 0.000 0.000 0.960 0.000
#> GSM241487 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241490 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241491 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.3747 0.995 0.604 0.000 0.000 0.000 0.000 0.396
#> GSM241493 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241495 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241498 1 0.3756 0.999 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM241499 6 0.3607 0.717 0.348 0.000 0.000 0.000 0.000 0.652
#> GSM241500 5 0.0405 0.965 0.000 0.004 0.008 0.000 0.988 0.000
#> GSM241501 5 0.0520 0.965 0.000 0.008 0.008 0.000 0.984 0.000
#> GSM241502 5 0.0520 0.965 0.000 0.008 0.008 0.000 0.984 0.000
#> GSM241503 6 0.3847 0.714 0.348 0.000 0.000 0.008 0.000 0.644
#> GSM241504 6 0.3861 0.712 0.352 0.000 0.000 0.008 0.000 0.640
#> GSM241505 6 0.3861 0.712 0.352 0.000 0.000 0.008 0.000 0.640
#> GSM241506 5 0.0551 0.964 0.004 0.004 0.008 0.000 0.984 0.000
#> GSM241507 6 0.3607 0.717 0.348 0.000 0.000 0.000 0.000 0.652
#> GSM241508 5 0.0405 0.965 0.000 0.004 0.008 0.000 0.988 0.000
#> GSM241509 5 0.0508 0.962 0.004 0.000 0.012 0.000 0.984 0.000
#> GSM241510 5 0.0508 0.962 0.004 0.000 0.012 0.000 0.984 0.000
#> GSM241511 6 0.4530 0.669 0.356 0.000 0.000 0.044 0.000 0.600
#> GSM241512 4 0.6094 0.286 0.356 0.000 0.000 0.448 0.012 0.184
#> GSM241513 3 0.0000 0.979 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241514 4 0.0146 0.829 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM241515 3 0.0146 0.978 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM241516 4 0.0405 0.829 0.000 0.000 0.000 0.988 0.008 0.004
#> GSM241517 3 0.0000 0.979 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241518 4 0.0603 0.824 0.004 0.000 0.016 0.980 0.000 0.000
#> GSM241519 3 0.0000 0.979 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241520 4 0.0508 0.826 0.004 0.000 0.012 0.984 0.000 0.000
#> GSM241521 3 0.0000 0.979 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241522 4 0.3743 0.543 0.252 0.000 0.000 0.724 0.000 0.024
#> GSM241523 3 0.0000 0.979 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241524 4 0.0146 0.829 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM241525 4 0.5171 0.521 0.356 0.000 0.000 0.564 0.012 0.068
#> GSM241526 3 0.1864 0.954 0.040 0.000 0.924 0.004 0.032 0.000
#> GSM241527 4 0.4299 0.581 0.356 0.000 0.000 0.620 0.012 0.012
#> GSM241528 3 0.1864 0.954 0.040 0.000 0.924 0.004 0.032 0.000
#> GSM241529 3 0.1864 0.954 0.040 0.000 0.924 0.004 0.032 0.000
#> GSM241530 4 0.5171 0.521 0.356 0.000 0.000 0.564 0.012 0.068
#> GSM241531 6 0.4858 0.660 0.356 0.000 0.000 0.044 0.012 0.588
#> GSM241532 5 0.1564 0.941 0.040 0.000 0.024 0.000 0.936 0.000
#> GSM241533 5 0.1788 0.936 0.040 0.000 0.028 0.004 0.928 0.000
#> GSM241534 5 0.1708 0.939 0.040 0.000 0.024 0.004 0.932 0.000
#> GSM241535 4 0.5134 0.522 0.360 0.000 0.000 0.564 0.012 0.064
#> GSM241536 6 0.4530 0.669 0.356 0.000 0.000 0.044 0.000 0.600
#> GSM241537 3 0.1226 0.968 0.040 0.000 0.952 0.004 0.004 0.000
#> GSM241538 4 0.0622 0.827 0.008 0.000 0.000 0.980 0.012 0.000
#> GSM241539 3 0.1226 0.968 0.040 0.000 0.952 0.004 0.004 0.000
#> GSM241540 4 0.0622 0.827 0.008 0.000 0.000 0.980 0.012 0.000
#> GSM241541 3 0.1010 0.970 0.036 0.000 0.960 0.004 0.000 0.000
#> GSM241542 4 0.0508 0.828 0.004 0.000 0.000 0.984 0.012 0.000
#> GSM241543 3 0.0000 0.979 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241544 4 0.0146 0.829 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM241545 3 0.0000 0.979 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241546 4 0.0146 0.829 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM241547 3 0.0000 0.979 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241548 4 0.0508 0.826 0.004 0.000 0.012 0.984 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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> MAD:skmeans 98 1.00e+00 1.00e+00 2
#> MAD:skmeans 95 4.45e-09 4.81e-01 3
#> MAD:skmeans 97 5.84e-12 8.53e-01 4
#> MAD:skmeans 97 7.57e-11 9.09e-05 5
#> MAD:skmeans 96 2.97e-10 1.38e-08 6
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 16250 rows and 98 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 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.993 0.997 0.5054 0.495 0.495
#> 3 3 1.000 0.973 0.990 0.2618 0.842 0.689
#> 4 4 0.861 0.839 0.905 0.1709 0.868 0.644
#> 5 5 0.802 0.786 0.873 0.0552 0.919 0.697
#> 6 6 0.876 0.804 0.909 0.0480 0.965 0.834
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
#> GSM241451 2 0.000 0.995 0.000 1.000
#> GSM241452 1 0.000 0.998 1.000 0.000
#> GSM241453 2 0.000 0.995 0.000 1.000
#> GSM241454 1 0.000 0.998 1.000 0.000
#> GSM241455 2 0.000 0.995 0.000 1.000
#> GSM241456 1 0.000 0.998 1.000 0.000
#> GSM241457 2 0.000 0.995 0.000 1.000
#> GSM241458 1 0.000 0.998 1.000 0.000
#> GSM241459 2 0.000 0.995 0.000 1.000
#> GSM241460 1 0.000 0.998 1.000 0.000
#> GSM241461 2 0.000 0.995 0.000 1.000
#> GSM241462 1 0.000 0.998 1.000 0.000
#> GSM241463 2 0.000 0.995 0.000 1.000
#> GSM241464 1 0.000 0.998 1.000 0.000
#> GSM241465 2 0.000 0.995 0.000 1.000
#> GSM241466 1 0.000 0.998 1.000 0.000
#> GSM241467 1 0.000 0.998 1.000 0.000
#> GSM241468 2 0.000 0.995 0.000 1.000
#> GSM241469 1 0.000 0.998 1.000 0.000
#> GSM241470 2 0.000 0.995 0.000 1.000
#> GSM241471 2 0.000 0.995 0.000 1.000
#> GSM241472 1 0.000 0.998 1.000 0.000
#> GSM241473 2 0.000 0.995 0.000 1.000
#> GSM241474 1 0.000 0.998 1.000 0.000
#> GSM241475 2 0.000 0.995 0.000 1.000
#> GSM241476 1 0.000 0.998 1.000 0.000
#> GSM241477 2 0.000 0.995 0.000 1.000
#> GSM241478 2 0.000 0.995 0.000 1.000
#> GSM241479 1 0.000 0.998 1.000 0.000
#> GSM241480 1 0.000 0.998 1.000 0.000
#> GSM241481 2 0.000 0.995 0.000 1.000
#> GSM241482 1 0.000 0.998 1.000 0.000
#> GSM241483 2 0.000 0.995 0.000 1.000
#> GSM241484 1 0.000 0.998 1.000 0.000
#> GSM241485 1 0.000 0.998 1.000 0.000
#> GSM241486 2 0.000 0.995 0.000 1.000
#> GSM241487 2 0.000 0.995 0.000 1.000
#> GSM241488 2 0.000 0.995 0.000 1.000
#> GSM241489 1 0.000 0.998 1.000 0.000
#> GSM241490 1 0.000 0.998 1.000 0.000
#> GSM241491 2 0.000 0.995 0.000 1.000
#> GSM241492 1 0.000 0.998 1.000 0.000
#> GSM241493 2 0.000 0.995 0.000 1.000
#> GSM241494 1 0.000 0.998 1.000 0.000
#> GSM241495 2 0.000 0.995 0.000 1.000
#> GSM241496 2 0.000 0.995 0.000 1.000
#> GSM241497 1 0.000 0.998 1.000 0.000
#> GSM241498 1 0.000 0.998 1.000 0.000
#> GSM241499 1 0.000 0.998 1.000 0.000
#> GSM241500 2 0.000 0.995 0.000 1.000
#> GSM241501 2 0.000 0.995 0.000 1.000
#> GSM241502 2 0.000 0.995 0.000 1.000
#> GSM241503 1 0.000 0.998 1.000 0.000
#> GSM241504 1 0.000 0.998 1.000 0.000
#> GSM241505 1 0.000 0.998 1.000 0.000
#> GSM241506 2 0.000 0.995 0.000 1.000
#> GSM241507 1 0.000 0.998 1.000 0.000
#> GSM241508 2 0.000 0.995 0.000 1.000
#> GSM241509 2 0.000 0.995 0.000 1.000
#> GSM241510 2 0.000 0.995 0.000 1.000
#> GSM241511 1 0.000 0.998 1.000 0.000
#> GSM241512 1 0.000 0.998 1.000 0.000
#> GSM241513 2 0.000 0.995 0.000 1.000
#> GSM241514 1 0.000 0.998 1.000 0.000
#> GSM241515 2 0.000 0.995 0.000 1.000
#> GSM241516 1 0.000 0.998 1.000 0.000
#> GSM241517 2 0.000 0.995 0.000 1.000
#> GSM241518 1 0.000 0.998 1.000 0.000
#> GSM241519 2 0.000 0.995 0.000 1.000
#> GSM241520 1 0.000 0.998 1.000 0.000
#> GSM241521 2 0.000 0.995 0.000 1.000
#> GSM241522 1 0.000 0.998 1.000 0.000
#> GSM241523 2 0.000 0.995 0.000 1.000
#> GSM241524 1 0.000 0.998 1.000 0.000
#> GSM241525 1 0.000 0.998 1.000 0.000
#> GSM241526 2 0.000 0.995 0.000 1.000
#> GSM241527 1 0.000 0.998 1.000 0.000
#> GSM241528 2 0.000 0.995 0.000 1.000
#> GSM241529 2 0.000 0.995 0.000 1.000
#> GSM241530 1 0.000 0.998 1.000 0.000
#> GSM241531 1 0.000 0.998 1.000 0.000
#> GSM241532 2 0.000 0.995 0.000 1.000
#> GSM241533 2 0.000 0.995 0.000 1.000
#> GSM241534 2 0.000 0.995 0.000 1.000
#> GSM241535 2 0.781 0.697 0.232 0.768
#> GSM241536 1 0.000 0.998 1.000 0.000
#> GSM241537 2 0.000 0.995 0.000 1.000
#> GSM241538 1 0.000 0.998 1.000 0.000
#> GSM241539 2 0.000 0.995 0.000 1.000
#> GSM241540 1 0.000 0.998 1.000 0.000
#> GSM241541 2 0.000 0.995 0.000 1.000
#> GSM241542 1 0.373 0.922 0.928 0.072
#> GSM241543 2 0.000 0.995 0.000 1.000
#> GSM241544 1 0.000 0.998 1.000 0.000
#> GSM241545 2 0.000 0.995 0.000 1.000
#> GSM241546 1 0.000 0.998 1.000 0.000
#> GSM241547 2 0.000 0.995 0.000 1.000
#> GSM241548 1 0.000 0.998 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241457 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241458 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241461 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241462 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241463 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241464 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241465 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241481 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241483 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241484 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241486 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241487 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241488 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241491 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241492 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241493 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241499 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241500 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241501 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241502 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241503 1 0.0424 0.9886 0.992 0.000 0.008
#> GSM241504 1 0.2261 0.9290 0.932 0.000 0.068
#> GSM241505 1 0.1964 0.9425 0.944 0.000 0.056
#> GSM241506 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241507 1 0.0000 0.9953 1.000 0.000 0.000
#> GSM241508 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241509 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241510 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241511 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241512 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241513 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241514 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241515 2 0.2711 0.9032 0.000 0.912 0.088
#> GSM241516 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241517 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241518 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241519 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241520 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241521 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241522 3 0.2711 0.8769 0.088 0.000 0.912
#> GSM241523 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241524 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241525 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241526 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241527 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241528 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241529 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241530 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241531 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241532 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241533 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241534 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241535 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241536 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241537 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241539 3 0.6307 0.0314 0.000 0.488 0.512
#> GSM241540 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241541 2 0.2959 0.8892 0.000 0.900 0.100
#> GSM241542 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241543 2 0.3116 0.8769 0.000 0.892 0.108
#> GSM241544 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241545 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241546 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM241547 2 0.0000 0.9933 0.000 1.000 0.000
#> GSM241548 3 0.0000 0.9683 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241452 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241453 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241454 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241455 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241456 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241457 4 0.1211 0.700 0.000 0.040 0.000 0.960
#> GSM241458 1 0.0921 0.976 0.972 0.000 0.028 0.000
#> GSM241459 4 0.1211 0.700 0.000 0.040 0.000 0.960
#> GSM241460 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241461 4 0.0707 0.717 0.000 0.020 0.000 0.980
#> GSM241462 1 0.0921 0.976 0.972 0.000 0.028 0.000
#> GSM241463 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241464 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241465 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241466 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241468 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241469 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241470 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241471 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241472 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241473 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241474 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241475 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241476 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241477 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241478 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241479 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241481 4 0.1211 0.700 0.000 0.040 0.000 0.960
#> GSM241482 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241483 4 0.1118 0.704 0.000 0.036 0.000 0.964
#> GSM241484 1 0.0921 0.976 0.972 0.000 0.028 0.000
#> GSM241485 1 0.0921 0.976 0.972 0.000 0.028 0.000
#> GSM241486 4 0.0707 0.717 0.000 0.020 0.000 0.980
#> GSM241487 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241488 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241489 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241491 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241492 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241493 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241494 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241495 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241496 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241497 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0921 0.976 0.972 0.000 0.028 0.000
#> GSM241500 4 0.0000 0.721 0.000 0.000 0.000 1.000
#> GSM241501 4 0.1211 0.700 0.000 0.040 0.000 0.960
#> GSM241502 4 0.0707 0.717 0.000 0.020 0.000 0.980
#> GSM241503 1 0.1118 0.972 0.964 0.000 0.036 0.000
#> GSM241504 1 0.1474 0.960 0.948 0.000 0.052 0.000
#> GSM241505 1 0.2011 0.933 0.920 0.000 0.080 0.000
#> GSM241506 4 0.0707 0.717 0.000 0.020 0.000 0.980
#> GSM241507 1 0.0921 0.976 0.972 0.000 0.028 0.000
#> GSM241508 4 0.0000 0.721 0.000 0.000 0.000 1.000
#> GSM241509 4 0.4605 0.686 0.000 0.336 0.000 0.664
#> GSM241510 4 0.4134 0.700 0.000 0.260 0.000 0.740
#> GSM241511 3 0.0000 0.908 0.000 0.000 1.000 0.000
#> GSM241512 3 0.0000 0.908 0.000 0.000 1.000 0.000
#> GSM241513 2 0.6399 0.555 0.000 0.620 0.276 0.104
#> GSM241514 3 0.0921 0.905 0.028 0.000 0.972 0.000
#> GSM241515 3 0.4617 0.661 0.000 0.204 0.764 0.032
#> GSM241516 3 0.0921 0.905 0.028 0.000 0.972 0.000
#> GSM241517 2 0.1474 0.535 0.000 0.948 0.000 0.052
#> GSM241518 3 0.0921 0.905 0.028 0.000 0.972 0.000
#> GSM241519 2 0.1474 0.536 0.000 0.948 0.000 0.052
#> GSM241520 3 0.0921 0.905 0.028 0.000 0.972 0.000
#> GSM241521 2 0.4790 0.875 0.000 0.620 0.000 0.380
#> GSM241522 3 0.2408 0.841 0.104 0.000 0.896 0.000
#> GSM241523 2 0.4679 0.852 0.000 0.648 0.000 0.352
#> GSM241524 3 0.0921 0.905 0.028 0.000 0.972 0.000
#> GSM241525 3 0.0000 0.908 0.000 0.000 1.000 0.000
#> GSM241526 4 0.4790 0.669 0.000 0.380 0.000 0.620
#> GSM241527 3 0.0000 0.908 0.000 0.000 1.000 0.000
#> GSM241528 4 0.4713 0.679 0.000 0.360 0.000 0.640
#> GSM241529 4 0.4679 0.679 0.000 0.352 0.000 0.648
#> GSM241530 3 0.0000 0.908 0.000 0.000 1.000 0.000
#> GSM241531 3 0.0000 0.908 0.000 0.000 1.000 0.000
#> GSM241532 4 0.4790 0.669 0.000 0.380 0.000 0.620
#> GSM241533 4 0.4790 0.669 0.000 0.380 0.000 0.620
#> GSM241534 4 0.4790 0.669 0.000 0.380 0.000 0.620
#> GSM241535 3 0.2345 0.848 0.000 0.100 0.900 0.000
#> GSM241536 3 0.0000 0.908 0.000 0.000 1.000 0.000
#> GSM241537 3 0.5860 0.514 0.000 0.380 0.580 0.040
#> GSM241538 3 0.0921 0.906 0.000 0.028 0.972 0.000
#> GSM241539 3 0.5860 0.514 0.000 0.380 0.580 0.040
#> GSM241540 3 0.0921 0.906 0.000 0.028 0.972 0.000
#> GSM241541 3 0.7538 0.202 0.000 0.384 0.428 0.188
#> GSM241542 3 0.0921 0.906 0.000 0.028 0.972 0.000
#> GSM241543 2 0.1209 0.463 0.000 0.964 0.032 0.004
#> GSM241544 3 0.0000 0.908 0.000 0.000 1.000 0.000
#> GSM241545 2 0.1510 0.513 0.000 0.956 0.016 0.028
#> GSM241546 3 0.0921 0.905 0.028 0.000 0.972 0.000
#> GSM241547 2 0.0469 0.458 0.000 0.988 0.000 0.012
#> GSM241548 3 0.0921 0.906 0.000 0.028 0.972 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.5375 0.690 0.000 0.368 0.000 0.064 0.568
#> GSM241458 4 0.3561 0.726 0.260 0.000 0.000 0.740 0.000
#> GSM241459 5 0.5375 0.690 0.000 0.368 0.000 0.064 0.568
#> GSM241460 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.5180 0.738 0.000 0.312 0.000 0.064 0.624
#> GSM241462 4 0.4015 0.574 0.348 0.000 0.000 0.652 0.000
#> GSM241463 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.5375 0.690 0.000 0.368 0.000 0.064 0.568
#> GSM241482 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241483 5 0.5353 0.698 0.000 0.360 0.000 0.064 0.576
#> GSM241484 4 0.1792 0.891 0.084 0.000 0.000 0.916 0.000
#> GSM241485 1 0.4088 0.244 0.632 0.000 0.000 0.368 0.000
#> GSM241486 5 0.5180 0.738 0.000 0.312 0.000 0.064 0.624
#> GSM241487 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.891 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.977 1.000 0.000 0.000 0.000 0.000
#> GSM241499 4 0.1792 0.891 0.084 0.000 0.000 0.916 0.000
#> GSM241500 5 0.4914 0.749 0.000 0.260 0.000 0.064 0.676
#> GSM241501 5 0.5316 0.709 0.000 0.348 0.000 0.064 0.588
#> GSM241502 5 0.5180 0.738 0.000 0.312 0.000 0.064 0.624
#> GSM241503 4 0.1792 0.891 0.084 0.000 0.000 0.916 0.000
#> GSM241504 4 0.2006 0.892 0.072 0.000 0.012 0.916 0.000
#> GSM241505 4 0.1956 0.892 0.076 0.000 0.008 0.916 0.000
#> GSM241506 5 0.5180 0.738 0.000 0.312 0.000 0.064 0.624
#> GSM241507 4 0.1792 0.891 0.084 0.000 0.000 0.916 0.000
#> GSM241508 5 0.4914 0.749 0.000 0.260 0.000 0.064 0.676
#> GSM241509 5 0.1877 0.700 0.000 0.012 0.000 0.064 0.924
#> GSM241510 5 0.2992 0.724 0.000 0.068 0.000 0.064 0.868
#> GSM241511 4 0.1792 0.861 0.000 0.000 0.084 0.916 0.000
#> GSM241512 3 0.3730 0.493 0.000 0.000 0.712 0.288 0.000
#> GSM241513 2 0.3789 0.686 0.000 0.768 0.212 0.020 0.000
#> GSM241514 3 0.3730 0.675 0.288 0.000 0.712 0.000 0.000
#> GSM241515 2 0.4138 0.590 0.000 0.708 0.276 0.016 0.000
#> GSM241516 3 0.3730 0.675 0.288 0.000 0.712 0.000 0.000
#> GSM241517 2 0.4106 0.645 0.000 0.724 0.000 0.020 0.256
#> GSM241518 3 0.3730 0.675 0.288 0.000 0.712 0.000 0.000
#> GSM241519 2 0.4054 0.654 0.000 0.732 0.000 0.020 0.248
#> GSM241520 3 0.3730 0.675 0.288 0.000 0.712 0.000 0.000
#> GSM241521 2 0.0510 0.882 0.000 0.984 0.000 0.016 0.000
#> GSM241522 3 0.3730 0.675 0.288 0.000 0.712 0.000 0.000
#> GSM241523 2 0.0898 0.875 0.000 0.972 0.000 0.020 0.008
#> GSM241524 3 0.3730 0.675 0.288 0.000 0.712 0.000 0.000
#> GSM241525 4 0.2074 0.849 0.000 0.000 0.104 0.896 0.000
#> GSM241526 5 0.0290 0.676 0.000 0.000 0.000 0.008 0.992
#> GSM241527 3 0.4161 0.280 0.000 0.000 0.608 0.392 0.000
#> GSM241528 5 0.1408 0.683 0.000 0.044 0.000 0.008 0.948
#> GSM241529 5 0.0290 0.676 0.000 0.000 0.000 0.008 0.992
#> GSM241530 4 0.2377 0.827 0.000 0.000 0.128 0.872 0.000
#> GSM241531 4 0.1792 0.861 0.000 0.000 0.084 0.916 0.000
#> GSM241532 5 0.0000 0.679 0.000 0.000 0.000 0.000 1.000
#> GSM241533 5 0.0000 0.679 0.000 0.000 0.000 0.000 1.000
#> GSM241534 5 0.0000 0.679 0.000 0.000 0.000 0.000 1.000
#> GSM241535 3 0.2249 0.688 0.000 0.000 0.896 0.008 0.096
#> GSM241536 4 0.1792 0.861 0.000 0.000 0.084 0.916 0.000
#> GSM241537 3 0.4497 0.339 0.000 0.000 0.568 0.008 0.424
#> GSM241538 3 0.0000 0.738 0.000 0.000 1.000 0.000 0.000
#> GSM241539 3 0.4497 0.339 0.000 0.000 0.568 0.008 0.424
#> GSM241540 3 0.0000 0.738 0.000 0.000 1.000 0.000 0.000
#> GSM241541 5 0.4568 0.291 0.000 0.020 0.288 0.008 0.684
#> GSM241542 3 0.0000 0.738 0.000 0.000 1.000 0.000 0.000
#> GSM241543 2 0.6019 0.470 0.000 0.576 0.084 0.020 0.320
#> GSM241544 3 0.0000 0.738 0.000 0.000 1.000 0.000 0.000
#> GSM241545 2 0.4260 0.642 0.000 0.720 0.004 0.020 0.256
#> GSM241546 3 0.0000 0.738 0.000 0.000 1.000 0.000 0.000
#> GSM241547 2 0.4585 0.522 0.000 0.628 0.000 0.020 0.352
#> GSM241548 3 0.0000 0.738 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.2178 0.7580 0.000 0.132 0.000 0.000 0.868 0.000
#> GSM241458 6 0.2762 0.7377 0.196 0.000 0.000 0.000 0.000 0.804
#> GSM241459 5 0.2631 0.7114 0.000 0.180 0.000 0.000 0.820 0.000
#> GSM241460 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.0713 0.8117 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM241462 6 0.3531 0.5307 0.328 0.000 0.000 0.000 0.000 0.672
#> GSM241463 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.2597 0.7161 0.000 0.176 0.000 0.000 0.824 0.000
#> GSM241482 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241483 5 0.1501 0.7984 0.000 0.076 0.000 0.000 0.924 0.000
#> GSM241484 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241485 1 0.3672 0.3477 0.632 0.000 0.000 0.000 0.000 0.368
#> GSM241486 5 0.0713 0.8117 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM241487 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.8844 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.9794 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241500 5 0.0000 0.8012 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241501 5 0.0713 0.8117 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM241502 5 0.1714 0.7872 0.000 0.092 0.000 0.000 0.908 0.000
#> GSM241503 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241504 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241505 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241506 5 0.1387 0.8034 0.000 0.068 0.000 0.000 0.932 0.000
#> GSM241507 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241508 5 0.0260 0.8057 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM241509 5 0.0865 0.7905 0.000 0.000 0.000 0.036 0.964 0.000
#> GSM241510 5 0.0865 0.7905 0.000 0.000 0.000 0.036 0.964 0.000
#> GSM241511 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241512 3 0.2854 0.7321 0.000 0.000 0.792 0.000 0.000 0.208
#> GSM241513 2 0.4493 0.5618 0.000 0.636 0.052 0.312 0.000 0.000
#> GSM241514 3 0.0000 0.8745 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241515 2 0.4843 0.5342 0.000 0.616 0.084 0.300 0.000 0.000
#> GSM241516 3 0.0260 0.8726 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM241517 2 0.3841 0.5092 0.000 0.616 0.000 0.380 0.004 0.000
#> GSM241518 3 0.0260 0.8726 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM241519 2 0.4319 0.5294 0.000 0.620 0.000 0.348 0.032 0.000
#> GSM241520 3 0.0000 0.8745 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241521 2 0.3101 0.6935 0.000 0.756 0.000 0.244 0.000 0.000
#> GSM241522 3 0.0632 0.8640 0.024 0.000 0.976 0.000 0.000 0.000
#> GSM241523 2 0.3464 0.6174 0.000 0.688 0.000 0.312 0.000 0.000
#> GSM241524 3 0.0000 0.8745 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241525 6 0.0547 0.9242 0.000 0.000 0.020 0.000 0.000 0.980
#> GSM241526 4 0.3126 0.6307 0.000 0.000 0.000 0.752 0.248 0.000
#> GSM241527 3 0.3717 0.4288 0.000 0.000 0.616 0.000 0.000 0.384
#> GSM241528 4 0.5672 0.4480 0.000 0.212 0.000 0.528 0.260 0.000
#> GSM241529 4 0.3371 0.5662 0.000 0.000 0.000 0.708 0.292 0.000
#> GSM241530 6 0.1007 0.9035 0.000 0.000 0.044 0.000 0.000 0.956
#> GSM241531 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241532 5 0.3817 0.1476 0.000 0.000 0.000 0.432 0.568 0.000
#> GSM241533 5 0.3851 0.0674 0.000 0.000 0.000 0.460 0.540 0.000
#> GSM241534 5 0.3851 0.0674 0.000 0.000 0.000 0.460 0.540 0.000
#> GSM241535 3 0.4649 0.5294 0.000 0.000 0.572 0.380 0.000 0.048
#> GSM241536 6 0.0000 0.9374 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241537 4 0.0713 0.7496 0.000 0.000 0.000 0.972 0.028 0.000
#> GSM241538 3 0.2996 0.7780 0.000 0.000 0.772 0.228 0.000 0.000
#> GSM241539 4 0.0713 0.7496 0.000 0.000 0.000 0.972 0.028 0.000
#> GSM241540 3 0.2823 0.7905 0.000 0.000 0.796 0.204 0.000 0.000
#> GSM241541 4 0.0713 0.7496 0.000 0.000 0.000 0.972 0.028 0.000
#> GSM241542 3 0.2996 0.7780 0.000 0.000 0.772 0.228 0.000 0.000
#> GSM241543 4 0.3349 0.6294 0.000 0.008 0.244 0.748 0.000 0.000
#> GSM241544 3 0.0000 0.8745 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241545 2 0.3955 0.4958 0.000 0.608 0.008 0.384 0.000 0.000
#> GSM241546 3 0.0000 0.8745 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241547 4 0.3076 0.5542 0.000 0.240 0.000 0.760 0.000 0.000
#> GSM241548 3 0.0000 0.8745 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> MAD:pam 98 9.89e-01 9.89e-01 2
#> MAD:pam 97 7.77e-07 7.73e-01 3
#> MAD:pam 95 6.03e-08 4.44e-05 4
#> MAD:pam 91 8.91e-06 5.35e-08 5
#> MAD:pam 91 5.86e-11 2.93e-06 6
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 16250 rows and 98 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 1.000 0.998 0.997 0.5040 0.495 0.495
#> 3 3 1.000 0.971 0.989 0.0503 0.559 0.374
#> 4 4 0.901 0.929 0.965 0.3318 0.816 0.615
#> 5 5 0.906 0.930 0.947 0.1218 0.905 0.686
#> 6 6 0.935 0.903 0.949 0.0536 0.955 0.780
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
#> GSM241451 2 0.0000 1.000 0.000 1.000
#> GSM241452 1 0.0000 0.994 1.000 0.000
#> GSM241453 2 0.0000 1.000 0.000 1.000
#> GSM241454 1 0.0000 0.994 1.000 0.000
#> GSM241455 2 0.0000 1.000 0.000 1.000
#> GSM241456 1 0.0000 0.994 1.000 0.000
#> GSM241457 2 0.0000 1.000 0.000 1.000
#> GSM241458 1 0.0672 0.997 0.992 0.008
#> GSM241459 2 0.0000 1.000 0.000 1.000
#> GSM241460 1 0.0000 0.994 1.000 0.000
#> GSM241461 2 0.0000 1.000 0.000 1.000
#> GSM241462 1 0.0672 0.997 0.992 0.008
#> GSM241463 2 0.0000 1.000 0.000 1.000
#> GSM241464 1 0.0672 0.997 0.992 0.008
#> GSM241465 2 0.0000 1.000 0.000 1.000
#> GSM241466 1 0.0000 0.994 1.000 0.000
#> GSM241467 1 0.0000 0.994 1.000 0.000
#> GSM241468 2 0.0000 1.000 0.000 1.000
#> GSM241469 1 0.0000 0.994 1.000 0.000
#> GSM241470 2 0.0000 1.000 0.000 1.000
#> GSM241471 2 0.0000 1.000 0.000 1.000
#> GSM241472 1 0.0000 0.994 1.000 0.000
#> GSM241473 2 0.0000 1.000 0.000 1.000
#> GSM241474 1 0.0000 0.994 1.000 0.000
#> GSM241475 2 0.0000 1.000 0.000 1.000
#> GSM241476 1 0.0000 0.994 1.000 0.000
#> GSM241477 2 0.0000 1.000 0.000 1.000
#> GSM241478 2 0.0000 1.000 0.000 1.000
#> GSM241479 1 0.0000 0.994 1.000 0.000
#> GSM241480 1 0.0000 0.994 1.000 0.000
#> GSM241481 2 0.0000 1.000 0.000 1.000
#> GSM241482 1 0.0672 0.997 0.992 0.008
#> GSM241483 2 0.0000 1.000 0.000 1.000
#> GSM241484 1 0.0672 0.997 0.992 0.008
#> GSM241485 1 0.0672 0.997 0.992 0.008
#> GSM241486 2 0.0000 1.000 0.000 1.000
#> GSM241487 2 0.0000 1.000 0.000 1.000
#> GSM241488 2 0.0000 1.000 0.000 1.000
#> GSM241489 1 0.0672 0.997 0.992 0.008
#> GSM241490 1 0.0000 0.994 1.000 0.000
#> GSM241491 2 0.0000 1.000 0.000 1.000
#> GSM241492 1 0.0672 0.997 0.992 0.008
#> GSM241493 2 0.0000 1.000 0.000 1.000
#> GSM241494 1 0.0000 0.994 1.000 0.000
#> GSM241495 2 0.0000 1.000 0.000 1.000
#> GSM241496 2 0.0000 1.000 0.000 1.000
#> GSM241497 1 0.0376 0.996 0.996 0.004
#> GSM241498 1 0.0000 0.994 1.000 0.000
#> GSM241499 1 0.0672 0.997 0.992 0.008
#> GSM241500 2 0.0000 1.000 0.000 1.000
#> GSM241501 2 0.0000 1.000 0.000 1.000
#> GSM241502 2 0.0000 1.000 0.000 1.000
#> GSM241503 1 0.0672 0.997 0.992 0.008
#> GSM241504 1 0.0672 0.997 0.992 0.008
#> GSM241505 1 0.0672 0.997 0.992 0.008
#> GSM241506 2 0.0000 1.000 0.000 1.000
#> GSM241507 1 0.0672 0.997 0.992 0.008
#> GSM241508 2 0.0000 1.000 0.000 1.000
#> GSM241509 2 0.0000 1.000 0.000 1.000
#> GSM241510 2 0.0000 1.000 0.000 1.000
#> GSM241511 1 0.0672 0.997 0.992 0.008
#> GSM241512 1 0.0672 0.997 0.992 0.008
#> GSM241513 2 0.0000 1.000 0.000 1.000
#> GSM241514 1 0.0672 0.997 0.992 0.008
#> GSM241515 2 0.0000 1.000 0.000 1.000
#> GSM241516 1 0.0672 0.997 0.992 0.008
#> GSM241517 2 0.0000 1.000 0.000 1.000
#> GSM241518 1 0.0672 0.997 0.992 0.008
#> GSM241519 2 0.0000 1.000 0.000 1.000
#> GSM241520 1 0.0672 0.997 0.992 0.008
#> GSM241521 2 0.0000 1.000 0.000 1.000
#> GSM241522 1 0.0672 0.997 0.992 0.008
#> GSM241523 2 0.0000 1.000 0.000 1.000
#> GSM241524 1 0.0672 0.997 0.992 0.008
#> GSM241525 1 0.0672 0.997 0.992 0.008
#> GSM241526 2 0.0000 1.000 0.000 1.000
#> GSM241527 1 0.0672 0.997 0.992 0.008
#> GSM241528 2 0.0000 1.000 0.000 1.000
#> GSM241529 2 0.0000 1.000 0.000 1.000
#> GSM241530 1 0.0672 0.997 0.992 0.008
#> GSM241531 1 0.0672 0.997 0.992 0.008
#> GSM241532 2 0.0000 1.000 0.000 1.000
#> GSM241533 2 0.0000 1.000 0.000 1.000
#> GSM241534 2 0.0000 1.000 0.000 1.000
#> GSM241535 1 0.0672 0.997 0.992 0.008
#> GSM241536 1 0.0672 0.997 0.992 0.008
#> GSM241537 2 0.0000 1.000 0.000 1.000
#> GSM241538 1 0.0672 0.997 0.992 0.008
#> GSM241539 2 0.0000 1.000 0.000 1.000
#> GSM241540 1 0.0672 0.997 0.992 0.008
#> GSM241541 2 0.0000 1.000 0.000 1.000
#> GSM241542 1 0.0672 0.997 0.992 0.008
#> GSM241543 2 0.0000 1.000 0.000 1.000
#> GSM241544 1 0.0672 0.997 0.992 0.008
#> GSM241545 2 0.0000 1.000 0.000 1.000
#> GSM241546 1 0.0672 0.997 0.992 0.008
#> GSM241547 2 0.0000 1.000 0.000 1.000
#> GSM241548 1 0.0672 0.997 0.992 0.008
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241457 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241458 3 0.1031 0.970 0.024 0.000 0.976
#> GSM241459 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241460 1 0.1289 0.931 0.968 0.000 0.032
#> GSM241461 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241462 3 0.0237 0.987 0.004 0.000 0.996
#> GSM241463 2 0.4062 0.732 0.000 0.836 0.164
#> GSM241464 3 0.4002 0.812 0.160 0.000 0.840
#> GSM241465 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241481 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241482 3 0.1163 0.966 0.028 0.000 0.972
#> GSM241483 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241484 3 0.0747 0.977 0.016 0.000 0.984
#> GSM241485 3 0.3340 0.866 0.120 0.000 0.880
#> GSM241486 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241487 2 0.0424 0.975 0.000 0.992 0.008
#> GSM241488 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241489 1 0.5327 0.572 0.728 0.000 0.272
#> GSM241490 1 0.0592 0.956 0.988 0.000 0.012
#> GSM241491 2 0.0424 0.974 0.000 0.992 0.008
#> GSM241492 3 0.5058 0.682 0.244 0.000 0.756
#> GSM241493 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.984 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241499 3 0.0237 0.987 0.004 0.000 0.996
#> GSM241500 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241501 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241502 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241503 3 0.0237 0.987 0.004 0.000 0.996
#> GSM241504 3 0.0237 0.987 0.004 0.000 0.996
#> GSM241505 3 0.0237 0.987 0.004 0.000 0.996
#> GSM241506 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241507 3 0.0237 0.987 0.004 0.000 0.996
#> GSM241508 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241509 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241510 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241511 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241512 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241513 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241514 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241515 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241516 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241517 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241518 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241519 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241520 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241521 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241522 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241523 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241524 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241525 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241526 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241528 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241529 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241530 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241531 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241532 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241533 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241534 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241535 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241536 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241537 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241544 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241545 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241546 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241547 3 0.0000 0.990 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.990 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241457 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> GSM241458 3 0.4008 0.694 0.244 0.000 0.756 0.000
#> GSM241459 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> GSM241460 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241461 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> GSM241462 3 0.3569 0.761 0.196 0.000 0.804 0.000
#> GSM241463 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0336 0.969 0.992 0.000 0.008 0.000
#> GSM241465 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241481 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> GSM241482 3 0.4008 0.694 0.244 0.000 0.756 0.000
#> GSM241483 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> GSM241484 3 0.3907 0.712 0.232 0.000 0.768 0.000
#> GSM241485 3 0.4277 0.642 0.280 0.000 0.720 0.000
#> GSM241486 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> GSM241487 2 0.4008 0.656 0.000 0.756 0.000 0.244
#> GSM241488 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241490 1 0.4406 0.530 0.700 0.000 0.300 0.000
#> GSM241491 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.985 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.977 1.000 0.000 0.000 0.000
#> GSM241499 3 0.0469 0.935 0.012 0.000 0.988 0.000
#> GSM241500 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241501 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241502 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241503 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241504 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241505 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241506 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241507 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241508 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241509 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241510 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241511 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241512 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241513 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241514 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241515 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241516 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241517 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241518 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241519 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241520 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241521 3 0.4008 0.689 0.000 0.000 0.756 0.244
#> GSM241522 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241523 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241524 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241525 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241526 3 0.4164 0.660 0.000 0.000 0.736 0.264
#> GSM241527 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241528 3 0.4164 0.660 0.000 0.000 0.736 0.264
#> GSM241529 3 0.4164 0.660 0.000 0.000 0.736 0.264
#> GSM241530 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241531 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241532 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241533 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241534 4 0.1211 0.979 0.000 0.000 0.040 0.960
#> GSM241535 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241536 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241537 3 0.0707 0.934 0.000 0.000 0.980 0.020
#> GSM241538 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241539 3 0.1389 0.915 0.000 0.000 0.952 0.048
#> GSM241540 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241541 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241542 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241543 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241544 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241545 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241546 3 0.0000 0.941 0.000 0.000 1.000 0.000
#> GSM241547 3 0.0592 0.936 0.000 0.000 0.984 0.016
#> GSM241548 3 0.0000 0.941 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.0000 0.850 0.000 0.000 0.000 0.000 1.000
#> GSM241458 3 0.1671 0.886 0.076 0.000 0.924 0.000 0.000
#> GSM241459 5 0.0000 0.850 0.000 0.000 0.000 0.000 1.000
#> GSM241460 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.0000 0.850 0.000 0.000 0.000 0.000 1.000
#> GSM241462 3 0.1671 0.886 0.076 0.000 0.924 0.000 0.000
#> GSM241463 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.1908 0.896 0.908 0.000 0.092 0.000 0.000
#> GSM241465 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.0000 0.850 0.000 0.000 0.000 0.000 1.000
#> GSM241482 3 0.1671 0.886 0.076 0.000 0.924 0.000 0.000
#> GSM241483 5 0.0000 0.850 0.000 0.000 0.000 0.000 1.000
#> GSM241484 3 0.1671 0.886 0.076 0.000 0.924 0.000 0.000
#> GSM241485 3 0.3074 0.744 0.196 0.000 0.804 0.000 0.000
#> GSM241486 5 0.0000 0.850 0.000 0.000 0.000 0.000 1.000
#> GSM241487 2 0.2017 0.896 0.000 0.912 0.000 0.008 0.080
#> GSM241488 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.1121 0.947 0.956 0.000 0.044 0.000 0.000
#> GSM241490 1 0.1270 0.943 0.948 0.000 0.052 0.000 0.000
#> GSM241491 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.1671 0.914 0.924 0.000 0.076 0.000 0.000
#> GSM241493 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.994 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM241499 3 0.0510 0.919 0.016 0.000 0.984 0.000 0.000
#> GSM241500 5 0.2179 0.869 0.000 0.000 0.000 0.112 0.888
#> GSM241501 5 0.2179 0.869 0.000 0.000 0.000 0.112 0.888
#> GSM241502 5 0.2852 0.854 0.000 0.000 0.000 0.172 0.828
#> GSM241503 3 0.0510 0.919 0.016 0.000 0.984 0.000 0.000
#> GSM241504 3 0.0510 0.919 0.016 0.000 0.984 0.000 0.000
#> GSM241505 3 0.0510 0.919 0.016 0.000 0.984 0.000 0.000
#> GSM241506 5 0.3177 0.839 0.000 0.000 0.000 0.208 0.792
#> GSM241507 3 0.0510 0.919 0.016 0.000 0.984 0.000 0.000
#> GSM241508 5 0.2179 0.869 0.000 0.000 0.000 0.112 0.888
#> GSM241509 5 0.3561 0.805 0.000 0.000 0.000 0.260 0.740
#> GSM241510 5 0.3586 0.802 0.000 0.000 0.000 0.264 0.736
#> GSM241511 3 0.0162 0.923 0.000 0.000 0.996 0.004 0.000
#> GSM241512 3 0.1792 0.934 0.000 0.000 0.916 0.084 0.000
#> GSM241513 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241514 3 0.1851 0.934 0.000 0.000 0.912 0.088 0.000
#> GSM241515 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241516 3 0.1792 0.934 0.000 0.000 0.916 0.084 0.000
#> GSM241517 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241518 3 0.2377 0.916 0.000 0.000 0.872 0.128 0.000
#> GSM241519 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241520 3 0.2377 0.916 0.000 0.000 0.872 0.128 0.000
#> GSM241521 4 0.1732 0.904 0.000 0.000 0.000 0.920 0.080
#> GSM241522 3 0.1626 0.931 0.016 0.000 0.940 0.044 0.000
#> GSM241523 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241524 3 0.2020 0.931 0.000 0.000 0.900 0.100 0.000
#> GSM241525 3 0.1270 0.933 0.000 0.000 0.948 0.052 0.000
#> GSM241526 4 0.1851 0.899 0.000 0.000 0.000 0.912 0.088
#> GSM241527 3 0.1851 0.934 0.000 0.000 0.912 0.088 0.000
#> GSM241528 4 0.1792 0.902 0.000 0.000 0.000 0.916 0.084
#> GSM241529 4 0.1851 0.899 0.000 0.000 0.000 0.912 0.088
#> GSM241530 3 0.1671 0.935 0.000 0.000 0.924 0.076 0.000
#> GSM241531 3 0.1671 0.935 0.000 0.000 0.924 0.076 0.000
#> GSM241532 5 0.3586 0.802 0.000 0.000 0.000 0.264 0.736
#> GSM241533 5 0.3586 0.802 0.000 0.000 0.000 0.264 0.736
#> GSM241534 5 0.3586 0.802 0.000 0.000 0.000 0.264 0.736
#> GSM241535 3 0.2230 0.923 0.000 0.000 0.884 0.116 0.000
#> GSM241536 3 0.0162 0.923 0.000 0.000 0.996 0.004 0.000
#> GSM241537 4 0.0404 0.949 0.000 0.000 0.000 0.988 0.012
#> GSM241538 3 0.2074 0.929 0.000 0.000 0.896 0.104 0.000
#> GSM241539 4 0.1792 0.903 0.000 0.000 0.000 0.916 0.084
#> GSM241540 3 0.2020 0.930 0.000 0.000 0.900 0.100 0.000
#> GSM241541 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241542 3 0.2732 0.885 0.000 0.000 0.840 0.160 0.000
#> GSM241543 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241544 3 0.2179 0.925 0.000 0.000 0.888 0.112 0.000
#> GSM241545 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241546 3 0.1908 0.933 0.000 0.000 0.908 0.092 0.000
#> GSM241547 4 0.0000 0.954 0.000 0.000 0.000 1.000 0.000
#> GSM241548 3 0.2424 0.913 0.000 0.000 0.868 0.132 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.0000 0.794 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241458 6 0.0405 0.881 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM241459 5 0.0000 0.794 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.0000 0.794 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241462 6 0.0405 0.881 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM241463 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.1714 0.908 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241465 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.0000 0.794 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241482 6 0.0405 0.881 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM241483 5 0.0000 0.794 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241484 6 0.0405 0.881 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM241485 6 0.2632 0.752 0.164 0.000 0.000 0.004 0.000 0.832
#> GSM241486 5 0.0000 0.794 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241487 2 0.2340 0.825 0.000 0.852 0.148 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.1141 0.946 0.948 0.000 0.000 0.000 0.000 0.052
#> GSM241490 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.1714 0.908 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM241493 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.991 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0146 0.984 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM241498 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 6 0.0146 0.881 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM241500 5 0.2003 0.816 0.000 0.000 0.116 0.000 0.884 0.000
#> GSM241501 5 0.2003 0.816 0.000 0.000 0.116 0.000 0.884 0.000
#> GSM241502 5 0.2664 0.794 0.000 0.000 0.184 0.000 0.816 0.000
#> GSM241503 6 0.0146 0.881 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM241504 6 0.1765 0.828 0.000 0.000 0.000 0.096 0.000 0.904
#> GSM241505 6 0.0146 0.881 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM241506 5 0.3023 0.769 0.000 0.000 0.232 0.000 0.768 0.000
#> GSM241507 6 0.0146 0.881 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM241508 5 0.2003 0.816 0.000 0.000 0.116 0.000 0.884 0.000
#> GSM241509 5 0.3862 0.633 0.000 0.000 0.388 0.000 0.608 0.004
#> GSM241510 5 0.3890 0.617 0.000 0.000 0.400 0.000 0.596 0.004
#> GSM241511 6 0.3843 0.246 0.000 0.000 0.000 0.452 0.000 0.548
#> GSM241512 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241513 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241514 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241515 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241516 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241517 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241518 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241519 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241520 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241521 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241522 4 0.0547 0.945 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM241523 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241524 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241525 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241526 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241527 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241528 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241529 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241530 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241531 4 0.3862 -0.113 0.000 0.000 0.000 0.524 0.000 0.476
#> GSM241532 5 0.4109 0.609 0.000 0.000 0.392 0.008 0.596 0.004
#> GSM241533 5 0.4135 0.587 0.000 0.000 0.404 0.008 0.584 0.004
#> GSM241534 5 0.4109 0.609 0.000 0.000 0.392 0.008 0.596 0.004
#> GSM241535 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241536 6 0.3810 0.313 0.000 0.000 0.000 0.428 0.000 0.572
#> GSM241537 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241538 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241539 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241540 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241541 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241542 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241543 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241544 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241545 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241546 4 0.0000 0.966 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241547 3 0.0260 1.000 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM241548 4 0.0000 0.966 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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> MAD:mclust 98 1.00e+00 1.00e+00 2
#> MAD:mclust 98 1.95e-10 2.33e-02 3
#> MAD:mclust 98 4.66e-11 6.70e-05 4
#> MAD:mclust 98 3.52e-10 1.85e-05 5
#> MAD:mclust 95 6.18e-11 6.10e-07 6
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 16250 rows and 98 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 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.976 0.990 0.5038 0.497 0.497
#> 3 3 0.947 0.948 0.977 0.3269 0.778 0.579
#> 4 4 0.797 0.831 0.867 0.0843 0.913 0.751
#> 5 5 0.756 0.778 0.838 0.0731 0.905 0.683
#> 6 6 0.631 0.530 0.736 0.0508 0.969 0.865
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
#> GSM241451 2 0.0000 0.987 0.000 1.000
#> GSM241452 1 0.0000 0.991 1.000 0.000
#> GSM241453 2 0.0000 0.987 0.000 1.000
#> GSM241454 1 0.0000 0.991 1.000 0.000
#> GSM241455 2 0.0000 0.987 0.000 1.000
#> GSM241456 1 0.0000 0.991 1.000 0.000
#> GSM241457 2 0.0000 0.987 0.000 1.000
#> GSM241458 1 0.0000 0.991 1.000 0.000
#> GSM241459 2 0.0000 0.987 0.000 1.000
#> GSM241460 1 0.0000 0.991 1.000 0.000
#> GSM241461 2 0.0000 0.987 0.000 1.000
#> GSM241462 1 0.0000 0.991 1.000 0.000
#> GSM241463 2 0.1633 0.967 0.024 0.976
#> GSM241464 1 0.0000 0.991 1.000 0.000
#> GSM241465 2 0.0000 0.987 0.000 1.000
#> GSM241466 1 0.0000 0.991 1.000 0.000
#> GSM241467 1 0.0000 0.991 1.000 0.000
#> GSM241468 2 0.2236 0.957 0.036 0.964
#> GSM241469 1 0.0000 0.991 1.000 0.000
#> GSM241470 2 0.0000 0.987 0.000 1.000
#> GSM241471 2 0.0000 0.987 0.000 1.000
#> GSM241472 1 0.0000 0.991 1.000 0.000
#> GSM241473 2 0.1414 0.971 0.020 0.980
#> GSM241474 1 0.0000 0.991 1.000 0.000
#> GSM241475 2 0.0000 0.987 0.000 1.000
#> GSM241476 1 0.0000 0.991 1.000 0.000
#> GSM241477 2 0.0000 0.987 0.000 1.000
#> GSM241478 2 0.0000 0.987 0.000 1.000
#> GSM241479 1 0.0000 0.991 1.000 0.000
#> GSM241480 1 0.0000 0.991 1.000 0.000
#> GSM241481 2 0.0000 0.987 0.000 1.000
#> GSM241482 1 0.0000 0.991 1.000 0.000
#> GSM241483 2 0.0000 0.987 0.000 1.000
#> GSM241484 1 0.0000 0.991 1.000 0.000
#> GSM241485 1 0.0000 0.991 1.000 0.000
#> GSM241486 2 0.0000 0.987 0.000 1.000
#> GSM241487 2 0.0000 0.987 0.000 1.000
#> GSM241488 2 0.2778 0.945 0.048 0.952
#> GSM241489 1 0.0000 0.991 1.000 0.000
#> GSM241490 1 0.0000 0.991 1.000 0.000
#> GSM241491 2 0.0000 0.987 0.000 1.000
#> GSM241492 1 0.0000 0.991 1.000 0.000
#> GSM241493 2 0.0000 0.987 0.000 1.000
#> GSM241494 1 0.0000 0.991 1.000 0.000
#> GSM241495 2 0.0000 0.987 0.000 1.000
#> GSM241496 2 0.0000 0.987 0.000 1.000
#> GSM241497 1 0.0000 0.991 1.000 0.000
#> GSM241498 1 0.0000 0.991 1.000 0.000
#> GSM241499 1 0.0000 0.991 1.000 0.000
#> GSM241500 2 0.0000 0.987 0.000 1.000
#> GSM241501 2 0.0000 0.987 0.000 1.000
#> GSM241502 2 0.0000 0.987 0.000 1.000
#> GSM241503 1 0.0000 0.991 1.000 0.000
#> GSM241504 1 0.0000 0.991 1.000 0.000
#> GSM241505 1 0.0000 0.991 1.000 0.000
#> GSM241506 2 0.0000 0.987 0.000 1.000
#> GSM241507 1 0.0000 0.991 1.000 0.000
#> GSM241508 2 0.0000 0.987 0.000 1.000
#> GSM241509 2 0.0000 0.987 0.000 1.000
#> GSM241510 2 0.0000 0.987 0.000 1.000
#> GSM241511 1 0.0000 0.991 1.000 0.000
#> GSM241512 1 0.0000 0.991 1.000 0.000
#> GSM241513 2 0.0000 0.987 0.000 1.000
#> GSM241514 1 0.0000 0.991 1.000 0.000
#> GSM241515 2 0.0000 0.987 0.000 1.000
#> GSM241516 1 0.0000 0.991 1.000 0.000
#> GSM241517 2 0.0000 0.987 0.000 1.000
#> GSM241518 1 0.1843 0.963 0.972 0.028
#> GSM241519 2 0.0000 0.987 0.000 1.000
#> GSM241520 1 0.0000 0.991 1.000 0.000
#> GSM241521 2 0.0000 0.987 0.000 1.000
#> GSM241522 1 0.0000 0.991 1.000 0.000
#> GSM241523 2 0.0000 0.987 0.000 1.000
#> GSM241524 1 0.0000 0.991 1.000 0.000
#> GSM241525 1 0.0000 0.991 1.000 0.000
#> GSM241526 2 0.0000 0.987 0.000 1.000
#> GSM241527 1 0.0000 0.991 1.000 0.000
#> GSM241528 2 0.0000 0.987 0.000 1.000
#> GSM241529 2 0.0000 0.987 0.000 1.000
#> GSM241530 1 0.0000 0.991 1.000 0.000
#> GSM241531 1 0.0000 0.991 1.000 0.000
#> GSM241532 2 0.0000 0.987 0.000 1.000
#> GSM241533 2 0.0000 0.987 0.000 1.000
#> GSM241534 2 0.0000 0.987 0.000 1.000
#> GSM241535 2 0.8443 0.629 0.272 0.728
#> GSM241536 1 0.0000 0.991 1.000 0.000
#> GSM241537 2 0.0000 0.987 0.000 1.000
#> GSM241538 1 0.9358 0.446 0.648 0.352
#> GSM241539 2 0.0000 0.987 0.000 1.000
#> GSM241540 1 0.0000 0.991 1.000 0.000
#> GSM241541 2 0.0000 0.987 0.000 1.000
#> GSM241542 2 0.0376 0.984 0.004 0.996
#> GSM241543 2 0.0000 0.987 0.000 1.000
#> GSM241544 1 0.0000 0.991 1.000 0.000
#> GSM241545 2 0.0000 0.987 0.000 1.000
#> GSM241546 1 0.0000 0.991 1.000 0.000
#> GSM241547 2 0.0000 0.987 0.000 1.000
#> GSM241548 2 0.7815 0.703 0.232 0.768
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.000 0.992 0.000 1.000 0.000
#> GSM241452 1 0.000 0.959 1.000 0.000 0.000
#> GSM241453 2 0.000 0.992 0.000 1.000 0.000
#> GSM241454 1 0.000 0.959 1.000 0.000 0.000
#> GSM241455 2 0.000 0.992 0.000 1.000 0.000
#> GSM241456 1 0.000 0.959 1.000 0.000 0.000
#> GSM241457 2 0.000 0.992 0.000 1.000 0.000
#> GSM241458 1 0.000 0.959 1.000 0.000 0.000
#> GSM241459 2 0.000 0.992 0.000 1.000 0.000
#> GSM241460 1 0.000 0.959 1.000 0.000 0.000
#> GSM241461 2 0.000 0.992 0.000 1.000 0.000
#> GSM241462 1 0.000 0.959 1.000 0.000 0.000
#> GSM241463 2 0.000 0.992 0.000 1.000 0.000
#> GSM241464 1 0.000 0.959 1.000 0.000 0.000
#> GSM241465 2 0.000 0.992 0.000 1.000 0.000
#> GSM241466 1 0.000 0.959 1.000 0.000 0.000
#> GSM241467 1 0.000 0.959 1.000 0.000 0.000
#> GSM241468 2 0.000 0.992 0.000 1.000 0.000
#> GSM241469 1 0.000 0.959 1.000 0.000 0.000
#> GSM241470 2 0.000 0.992 0.000 1.000 0.000
#> GSM241471 2 0.000 0.992 0.000 1.000 0.000
#> GSM241472 1 0.000 0.959 1.000 0.000 0.000
#> GSM241473 2 0.000 0.992 0.000 1.000 0.000
#> GSM241474 1 0.000 0.959 1.000 0.000 0.000
#> GSM241475 2 0.000 0.992 0.000 1.000 0.000
#> GSM241476 1 0.000 0.959 1.000 0.000 0.000
#> GSM241477 2 0.000 0.992 0.000 1.000 0.000
#> GSM241478 2 0.000 0.992 0.000 1.000 0.000
#> GSM241479 1 0.000 0.959 1.000 0.000 0.000
#> GSM241480 1 0.000 0.959 1.000 0.000 0.000
#> GSM241481 2 0.000 0.992 0.000 1.000 0.000
#> GSM241482 1 0.000 0.959 1.000 0.000 0.000
#> GSM241483 2 0.000 0.992 0.000 1.000 0.000
#> GSM241484 1 0.000 0.959 1.000 0.000 0.000
#> GSM241485 1 0.000 0.959 1.000 0.000 0.000
#> GSM241486 2 0.000 0.992 0.000 1.000 0.000
#> GSM241487 2 0.000 0.992 0.000 1.000 0.000
#> GSM241488 2 0.000 0.992 0.000 1.000 0.000
#> GSM241489 1 0.000 0.959 1.000 0.000 0.000
#> GSM241490 1 0.000 0.959 1.000 0.000 0.000
#> GSM241491 2 0.000 0.992 0.000 1.000 0.000
#> GSM241492 1 0.000 0.959 1.000 0.000 0.000
#> GSM241493 2 0.000 0.992 0.000 1.000 0.000
#> GSM241494 1 0.000 0.959 1.000 0.000 0.000
#> GSM241495 2 0.000 0.992 0.000 1.000 0.000
#> GSM241496 2 0.000 0.992 0.000 1.000 0.000
#> GSM241497 1 0.000 0.959 1.000 0.000 0.000
#> GSM241498 1 0.000 0.959 1.000 0.000 0.000
#> GSM241499 1 0.000 0.959 1.000 0.000 0.000
#> GSM241500 2 0.000 0.992 0.000 1.000 0.000
#> GSM241501 2 0.000 0.992 0.000 1.000 0.000
#> GSM241502 2 0.000 0.992 0.000 1.000 0.000
#> GSM241503 1 0.000 0.959 1.000 0.000 0.000
#> GSM241504 1 0.000 0.959 1.000 0.000 0.000
#> GSM241505 1 0.000 0.959 1.000 0.000 0.000
#> GSM241506 2 0.000 0.992 0.000 1.000 0.000
#> GSM241507 1 0.000 0.959 1.000 0.000 0.000
#> GSM241508 2 0.000 0.992 0.000 1.000 0.000
#> GSM241509 2 0.000 0.992 0.000 1.000 0.000
#> GSM241510 2 0.362 0.842 0.000 0.864 0.136
#> GSM241511 1 0.000 0.959 1.000 0.000 0.000
#> GSM241512 1 0.595 0.482 0.640 0.000 0.360
#> GSM241513 3 0.000 0.981 0.000 0.000 1.000
#> GSM241514 1 0.514 0.689 0.748 0.000 0.252
#> GSM241515 3 0.000 0.981 0.000 0.000 1.000
#> GSM241516 1 0.470 0.743 0.788 0.000 0.212
#> GSM241517 3 0.000 0.981 0.000 0.000 1.000
#> GSM241518 3 0.000 0.981 0.000 0.000 1.000
#> GSM241519 3 0.375 0.832 0.000 0.144 0.856
#> GSM241520 3 0.103 0.959 0.024 0.000 0.976
#> GSM241521 2 0.312 0.878 0.000 0.892 0.108
#> GSM241522 1 0.000 0.959 1.000 0.000 0.000
#> GSM241523 3 0.153 0.947 0.000 0.040 0.960
#> GSM241524 1 0.103 0.940 0.976 0.000 0.024
#> GSM241525 1 0.000 0.959 1.000 0.000 0.000
#> GSM241526 3 0.000 0.981 0.000 0.000 1.000
#> GSM241527 3 0.000 0.981 0.000 0.000 1.000
#> GSM241528 3 0.000 0.981 0.000 0.000 1.000
#> GSM241529 3 0.000 0.981 0.000 0.000 1.000
#> GSM241530 1 0.623 0.282 0.564 0.000 0.436
#> GSM241531 1 0.522 0.676 0.740 0.000 0.260
#> GSM241532 3 0.533 0.633 0.000 0.272 0.728
#> GSM241533 3 0.000 0.981 0.000 0.000 1.000
#> GSM241534 3 0.000 0.981 0.000 0.000 1.000
#> GSM241535 3 0.000 0.981 0.000 0.000 1.000
#> GSM241536 1 0.000 0.959 1.000 0.000 0.000
#> GSM241537 3 0.000 0.981 0.000 0.000 1.000
#> GSM241538 3 0.000 0.981 0.000 0.000 1.000
#> GSM241539 3 0.000 0.981 0.000 0.000 1.000
#> GSM241540 3 0.000 0.981 0.000 0.000 1.000
#> GSM241541 3 0.000 0.981 0.000 0.000 1.000
#> GSM241542 3 0.000 0.981 0.000 0.000 1.000
#> GSM241543 3 0.000 0.981 0.000 0.000 1.000
#> GSM241544 3 0.000 0.981 0.000 0.000 1.000
#> GSM241545 3 0.000 0.981 0.000 0.000 1.000
#> GSM241546 3 0.000 0.981 0.000 0.000 1.000
#> GSM241547 3 0.000 0.981 0.000 0.000 1.000
#> GSM241548 3 0.000 0.981 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.1022 0.853 0.000 0.968 0.000 0.032
#> GSM241452 1 0.0921 0.925 0.972 0.000 0.000 0.028
#> GSM241453 2 0.1389 0.843 0.000 0.952 0.000 0.048
#> GSM241454 1 0.0469 0.928 0.988 0.000 0.000 0.012
#> GSM241455 2 0.0817 0.855 0.000 0.976 0.000 0.024
#> GSM241456 1 0.0817 0.926 0.976 0.000 0.000 0.024
#> GSM241457 4 0.4522 0.931 0.000 0.320 0.000 0.680
#> GSM241458 1 0.1743 0.920 0.940 0.004 0.000 0.056
#> GSM241459 4 0.4500 0.931 0.000 0.316 0.000 0.684
#> GSM241460 1 0.1743 0.920 0.940 0.004 0.000 0.056
#> GSM241461 4 0.4382 0.925 0.000 0.296 0.000 0.704
#> GSM241462 1 0.2021 0.917 0.932 0.012 0.000 0.056
#> GSM241463 2 0.0469 0.853 0.000 0.988 0.000 0.012
#> GSM241464 1 0.0469 0.928 0.988 0.000 0.000 0.012
#> GSM241465 2 0.1022 0.853 0.000 0.968 0.000 0.032
#> GSM241466 1 0.0707 0.926 0.980 0.000 0.000 0.020
#> GSM241467 1 0.0336 0.928 0.992 0.000 0.000 0.008
#> GSM241468 2 0.3610 0.584 0.000 0.800 0.000 0.200
#> GSM241469 1 0.0817 0.926 0.976 0.000 0.000 0.024
#> GSM241470 2 0.0817 0.857 0.000 0.976 0.000 0.024
#> GSM241471 2 0.3123 0.685 0.000 0.844 0.000 0.156
#> GSM241472 1 0.0336 0.928 0.992 0.000 0.000 0.008
#> GSM241473 2 0.1867 0.809 0.000 0.928 0.000 0.072
#> GSM241474 1 0.1211 0.925 0.960 0.000 0.000 0.040
#> GSM241475 2 0.1022 0.852 0.000 0.968 0.000 0.032
#> GSM241476 1 0.0817 0.926 0.976 0.000 0.000 0.024
#> GSM241477 2 0.1389 0.842 0.000 0.952 0.000 0.048
#> GSM241478 2 0.0336 0.854 0.000 0.992 0.000 0.008
#> GSM241479 1 0.0817 0.926 0.976 0.000 0.000 0.024
#> GSM241480 1 0.0469 0.927 0.988 0.000 0.000 0.012
#> GSM241481 4 0.4522 0.931 0.000 0.320 0.000 0.680
#> GSM241482 1 0.1743 0.920 0.940 0.004 0.000 0.056
#> GSM241483 4 0.4585 0.919 0.000 0.332 0.000 0.668
#> GSM241484 1 0.1661 0.921 0.944 0.004 0.000 0.052
#> GSM241485 1 0.1890 0.919 0.936 0.008 0.000 0.056
#> GSM241486 4 0.4356 0.922 0.000 0.292 0.000 0.708
#> GSM241487 2 0.0707 0.857 0.000 0.980 0.000 0.020
#> GSM241488 2 0.0188 0.858 0.000 0.996 0.000 0.004
#> GSM241489 1 0.0817 0.926 0.976 0.000 0.000 0.024
#> GSM241490 1 0.0817 0.926 0.976 0.000 0.000 0.024
#> GSM241491 2 0.0592 0.856 0.000 0.984 0.000 0.016
#> GSM241492 1 0.0592 0.928 0.984 0.000 0.000 0.016
#> GSM241493 2 0.0592 0.857 0.000 0.984 0.000 0.016
#> GSM241494 1 0.0817 0.926 0.976 0.000 0.000 0.024
#> GSM241495 2 0.0336 0.857 0.000 0.992 0.000 0.008
#> GSM241496 2 0.0469 0.852 0.000 0.988 0.000 0.012
#> GSM241497 1 0.0921 0.925 0.972 0.000 0.000 0.028
#> GSM241498 1 0.0817 0.926 0.976 0.000 0.000 0.024
#> GSM241499 1 0.1743 0.920 0.940 0.004 0.000 0.056
#> GSM241500 4 0.4431 0.929 0.000 0.304 0.000 0.696
#> GSM241501 4 0.4585 0.919 0.000 0.332 0.000 0.668
#> GSM241502 4 0.4522 0.931 0.000 0.320 0.000 0.680
#> GSM241503 1 0.1474 0.923 0.948 0.000 0.000 0.052
#> GSM241504 1 0.1389 0.923 0.952 0.000 0.000 0.048
#> GSM241505 1 0.1474 0.923 0.948 0.000 0.000 0.052
#> GSM241506 4 0.5471 0.895 0.000 0.268 0.048 0.684
#> GSM241507 1 0.1474 0.923 0.948 0.000 0.000 0.052
#> GSM241508 4 0.4522 0.931 0.000 0.320 0.000 0.680
#> GSM241509 4 0.5548 0.831 0.000 0.200 0.084 0.716
#> GSM241510 4 0.5964 0.658 0.000 0.096 0.228 0.676
#> GSM241511 1 0.1661 0.921 0.944 0.004 0.000 0.052
#> GSM241512 1 0.4690 0.674 0.720 0.004 0.268 0.008
#> GSM241513 2 0.6823 0.421 0.000 0.604 0.196 0.200
#> GSM241514 1 0.4426 0.792 0.812 0.000 0.096 0.092
#> GSM241515 3 0.5250 0.787 0.000 0.068 0.736 0.196
#> GSM241516 1 0.3552 0.819 0.848 0.000 0.128 0.024
#> GSM241517 2 0.5218 0.639 0.000 0.736 0.064 0.200
#> GSM241518 3 0.4845 0.796 0.008 0.028 0.760 0.204
#> GSM241519 2 0.4485 0.677 0.000 0.772 0.028 0.200
#> GSM241520 3 0.8377 0.579 0.232 0.044 0.496 0.228
#> GSM241521 2 0.3688 0.696 0.000 0.792 0.000 0.208
#> GSM241522 1 0.1022 0.924 0.968 0.000 0.000 0.032
#> GSM241523 2 0.4524 0.673 0.000 0.768 0.028 0.204
#> GSM241524 1 0.4464 0.727 0.760 0.004 0.012 0.224
#> GSM241525 1 0.1520 0.919 0.956 0.000 0.020 0.024
#> GSM241526 3 0.0000 0.840 0.000 0.000 1.000 0.000
#> GSM241527 3 0.0336 0.839 0.008 0.000 0.992 0.000
#> GSM241528 3 0.4790 0.324 0.000 0.380 0.620 0.000
#> GSM241529 3 0.0188 0.839 0.000 0.004 0.996 0.000
#> GSM241530 1 0.5285 0.192 0.524 0.000 0.468 0.008
#> GSM241531 1 0.5517 0.389 0.568 0.000 0.412 0.020
#> GSM241532 3 0.4419 0.679 0.000 0.104 0.812 0.084
#> GSM241533 3 0.0000 0.840 0.000 0.000 1.000 0.000
#> GSM241534 3 0.2300 0.803 0.000 0.028 0.924 0.048
#> GSM241535 3 0.0000 0.840 0.000 0.000 1.000 0.000
#> GSM241536 1 0.1890 0.919 0.936 0.008 0.000 0.056
#> GSM241537 3 0.0000 0.840 0.000 0.000 1.000 0.000
#> GSM241538 3 0.0000 0.840 0.000 0.000 1.000 0.000
#> GSM241539 3 0.0000 0.840 0.000 0.000 1.000 0.000
#> GSM241540 3 0.0469 0.837 0.012 0.000 0.988 0.000
#> GSM241541 3 0.2647 0.829 0.000 0.000 0.880 0.120
#> GSM241542 3 0.0921 0.841 0.000 0.000 0.972 0.028
#> GSM241543 3 0.5218 0.784 0.000 0.064 0.736 0.200
#> GSM241544 3 0.5605 0.777 0.056 0.008 0.712 0.224
#> GSM241545 3 0.5421 0.778 0.000 0.076 0.724 0.200
#> GSM241546 3 0.6683 0.685 0.176 0.000 0.620 0.204
#> GSM241547 3 0.6650 0.677 0.000 0.176 0.624 0.200
#> GSM241548 3 0.4471 0.801 0.016 0.004 0.768 0.212
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.2329 0.841 0.000 0.876 0.000 0.000 0.124
#> GSM241452 1 0.2329 0.852 0.876 0.000 0.124 0.000 0.000
#> GSM241453 2 0.2966 0.806 0.000 0.816 0.000 0.000 0.184
#> GSM241454 1 0.0290 0.891 0.992 0.000 0.008 0.000 0.000
#> GSM241455 2 0.1043 0.834 0.000 0.960 0.000 0.000 0.040
#> GSM241456 1 0.1168 0.891 0.960 0.000 0.032 0.000 0.008
#> GSM241457 5 0.1892 0.938 0.000 0.080 0.004 0.000 0.916
#> GSM241458 1 0.2850 0.851 0.872 0.092 0.000 0.000 0.036
#> GSM241459 5 0.2115 0.942 0.000 0.068 0.008 0.008 0.916
#> GSM241460 1 0.3012 0.843 0.860 0.104 0.000 0.000 0.036
#> GSM241461 5 0.1430 0.934 0.000 0.052 0.004 0.000 0.944
#> GSM241462 1 0.3772 0.782 0.792 0.172 0.000 0.000 0.036
#> GSM241463 2 0.0609 0.792 0.000 0.980 0.000 0.000 0.020
#> GSM241464 1 0.1831 0.880 0.920 0.000 0.076 0.000 0.004
#> GSM241465 2 0.2230 0.843 0.000 0.884 0.000 0.000 0.116
#> GSM241466 1 0.0794 0.891 0.972 0.000 0.028 0.000 0.000
#> GSM241467 1 0.0794 0.891 0.972 0.000 0.028 0.000 0.000
#> GSM241468 2 0.4283 0.629 0.012 0.692 0.004 0.000 0.292
#> GSM241469 1 0.2362 0.874 0.900 0.000 0.076 0.000 0.024
#> GSM241470 2 0.2127 0.844 0.000 0.892 0.000 0.000 0.108
#> GSM241471 2 0.3913 0.601 0.000 0.676 0.000 0.000 0.324
#> GSM241472 1 0.0162 0.891 0.996 0.000 0.004 0.000 0.000
#> GSM241473 2 0.3554 0.736 0.004 0.776 0.004 0.000 0.216
#> GSM241474 1 0.0807 0.889 0.976 0.012 0.000 0.000 0.012
#> GSM241475 2 0.1792 0.845 0.000 0.916 0.000 0.000 0.084
#> GSM241476 1 0.1270 0.887 0.948 0.000 0.052 0.000 0.000
#> GSM241477 2 0.2732 0.820 0.000 0.840 0.000 0.000 0.160
#> GSM241478 2 0.0162 0.814 0.000 0.996 0.000 0.000 0.004
#> GSM241479 1 0.1697 0.884 0.932 0.000 0.060 0.000 0.008
#> GSM241480 1 0.0609 0.891 0.980 0.000 0.020 0.000 0.000
#> GSM241481 5 0.1892 0.938 0.000 0.080 0.004 0.000 0.916
#> GSM241482 1 0.2616 0.860 0.888 0.076 0.000 0.000 0.036
#> GSM241483 5 0.1952 0.938 0.000 0.084 0.000 0.004 0.912
#> GSM241484 1 0.2291 0.869 0.908 0.056 0.000 0.000 0.036
#> GSM241485 1 0.3695 0.791 0.800 0.164 0.000 0.000 0.036
#> GSM241486 5 0.1282 0.930 0.000 0.044 0.004 0.000 0.952
#> GSM241487 2 0.2074 0.845 0.000 0.896 0.000 0.000 0.104
#> GSM241488 2 0.0404 0.819 0.000 0.988 0.000 0.000 0.012
#> GSM241489 1 0.2011 0.873 0.908 0.000 0.088 0.000 0.004
#> GSM241490 1 0.2798 0.836 0.852 0.000 0.140 0.000 0.008
#> GSM241491 2 0.2069 0.844 0.000 0.912 0.012 0.000 0.076
#> GSM241492 1 0.0963 0.892 0.964 0.000 0.036 0.000 0.000
#> GSM241493 2 0.1270 0.839 0.000 0.948 0.000 0.000 0.052
#> GSM241494 1 0.1792 0.876 0.916 0.000 0.084 0.000 0.000
#> GSM241495 2 0.2124 0.845 0.000 0.900 0.004 0.000 0.096
#> GSM241496 2 0.1522 0.837 0.000 0.944 0.012 0.000 0.044
#> GSM241497 1 0.2561 0.838 0.856 0.000 0.144 0.000 0.000
#> GSM241498 1 0.1270 0.887 0.948 0.000 0.052 0.000 0.000
#> GSM241499 1 0.2554 0.862 0.892 0.072 0.000 0.000 0.036
#> GSM241500 5 0.1697 0.940 0.000 0.060 0.000 0.008 0.932
#> GSM241501 5 0.2305 0.931 0.000 0.092 0.000 0.012 0.896
#> GSM241502 5 0.2069 0.941 0.000 0.076 0.000 0.012 0.912
#> GSM241503 1 0.1386 0.884 0.952 0.016 0.000 0.000 0.032
#> GSM241504 1 0.1386 0.884 0.952 0.016 0.000 0.000 0.032
#> GSM241505 1 0.1469 0.883 0.948 0.016 0.000 0.000 0.036
#> GSM241506 5 0.2888 0.917 0.000 0.060 0.004 0.056 0.880
#> GSM241507 1 0.1661 0.881 0.940 0.024 0.000 0.000 0.036
#> GSM241508 5 0.2130 0.939 0.000 0.080 0.000 0.012 0.908
#> GSM241509 5 0.1901 0.927 0.000 0.040 0.004 0.024 0.932
#> GSM241510 5 0.4367 0.406 0.000 0.008 0.000 0.372 0.620
#> GSM241511 1 0.3011 0.860 0.884 0.048 0.000 0.032 0.036
#> GSM241512 4 0.5031 0.296 0.384 0.024 0.000 0.584 0.008
#> GSM241513 3 0.4714 0.444 0.000 0.372 0.608 0.016 0.004
#> GSM241514 3 0.3807 0.539 0.240 0.000 0.748 0.012 0.000
#> GSM241515 2 0.6415 0.285 0.000 0.548 0.252 0.192 0.008
#> GSM241516 1 0.4937 0.310 0.544 0.000 0.428 0.028 0.000
#> GSM241517 2 0.3920 0.562 0.000 0.724 0.268 0.004 0.004
#> GSM241518 3 0.1362 0.744 0.012 0.008 0.960 0.016 0.004
#> GSM241519 2 0.4009 0.482 0.000 0.684 0.312 0.000 0.004
#> GSM241520 3 0.0807 0.747 0.012 0.012 0.976 0.000 0.000
#> GSM241521 2 0.3684 0.553 0.000 0.720 0.280 0.000 0.000
#> GSM241522 1 0.4542 0.283 0.536 0.000 0.456 0.000 0.008
#> GSM241523 3 0.4350 0.361 0.000 0.408 0.588 0.000 0.004
#> GSM241524 3 0.1704 0.721 0.068 0.000 0.928 0.004 0.000
#> GSM241525 1 0.2951 0.847 0.860 0.000 0.112 0.028 0.000
#> GSM241526 4 0.0162 0.841 0.000 0.000 0.004 0.996 0.000
#> GSM241527 4 0.0451 0.841 0.004 0.000 0.008 0.988 0.000
#> GSM241528 4 0.3475 0.689 0.000 0.180 0.004 0.804 0.012
#> GSM241529 4 0.0162 0.841 0.000 0.000 0.004 0.996 0.000
#> GSM241530 4 0.2798 0.746 0.140 0.000 0.008 0.852 0.000
#> GSM241531 4 0.2583 0.764 0.132 0.000 0.000 0.864 0.004
#> GSM241532 4 0.1197 0.824 0.000 0.000 0.000 0.952 0.048
#> GSM241533 4 0.0510 0.837 0.000 0.000 0.000 0.984 0.016
#> GSM241534 4 0.0609 0.836 0.000 0.000 0.000 0.980 0.020
#> GSM241535 4 0.0290 0.841 0.000 0.000 0.008 0.992 0.000
#> GSM241536 1 0.4039 0.818 0.820 0.100 0.000 0.044 0.036
#> GSM241537 4 0.0671 0.839 0.000 0.000 0.016 0.980 0.004
#> GSM241538 4 0.3109 0.726 0.000 0.000 0.200 0.800 0.000
#> GSM241539 4 0.0404 0.840 0.000 0.000 0.012 0.988 0.000
#> GSM241540 4 0.4921 0.461 0.036 0.000 0.360 0.604 0.000
#> GSM241541 4 0.3585 0.665 0.000 0.004 0.220 0.772 0.004
#> GSM241542 4 0.4066 0.543 0.000 0.000 0.324 0.672 0.004
#> GSM241543 3 0.3912 0.673 0.000 0.208 0.768 0.020 0.004
#> GSM241544 3 0.1106 0.742 0.024 0.000 0.964 0.012 0.000
#> GSM241545 3 0.3846 0.679 0.000 0.200 0.776 0.020 0.004
#> GSM241546 3 0.2771 0.670 0.128 0.000 0.860 0.012 0.000
#> GSM241547 3 0.4763 0.466 0.000 0.360 0.616 0.020 0.004
#> GSM241548 3 0.0898 0.743 0.008 0.000 0.972 0.020 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.2918 0.7261 0.000 0.856 0.004 0.000 0.052 0.088
#> GSM241452 1 0.3181 0.5419 0.856 0.000 0.048 0.000 0.044 0.052
#> GSM241453 2 0.3516 0.7373 0.000 0.832 0.036 0.000 0.076 0.056
#> GSM241454 1 0.2442 0.4622 0.852 0.000 0.000 0.000 0.004 0.144
#> GSM241455 2 0.2925 0.7261 0.000 0.832 0.004 0.000 0.016 0.148
#> GSM241456 1 0.4821 0.4044 0.660 0.000 0.004 0.000 0.240 0.096
#> GSM241457 5 0.2903 0.8777 0.000 0.084 0.016 0.000 0.864 0.036
#> GSM241458 6 0.5153 0.4219 0.452 0.084 0.000 0.000 0.000 0.464
#> GSM241459 5 0.1398 0.8874 0.000 0.052 0.000 0.000 0.940 0.008
#> GSM241460 6 0.5547 0.6268 0.344 0.148 0.000 0.000 0.000 0.508
#> GSM241461 5 0.2221 0.8730 0.004 0.044 0.004 0.000 0.908 0.040
#> GSM241462 6 0.5719 0.6463 0.248 0.232 0.000 0.000 0.000 0.520
#> GSM241463 2 0.3453 0.7124 0.000 0.788 0.004 0.000 0.028 0.180
#> GSM241464 1 0.7286 0.1734 0.492 0.068 0.096 0.000 0.076 0.268
#> GSM241465 2 0.3511 0.7436 0.000 0.808 0.004 0.000 0.064 0.124
#> GSM241466 1 0.1901 0.5210 0.912 0.000 0.004 0.000 0.008 0.076
#> GSM241467 1 0.2703 0.5143 0.860 0.000 0.016 0.000 0.008 0.116
#> GSM241468 2 0.6748 0.3450 0.004 0.464 0.052 0.000 0.196 0.284
#> GSM241469 1 0.5003 0.3980 0.656 0.000 0.020 0.000 0.248 0.076
#> GSM241470 2 0.1980 0.7519 0.000 0.920 0.008 0.000 0.036 0.036
#> GSM241471 2 0.6389 0.4385 0.000 0.548 0.088 0.000 0.240 0.124
#> GSM241472 1 0.3516 0.4549 0.792 0.000 0.012 0.000 0.024 0.172
#> GSM241473 2 0.6436 0.5164 0.000 0.548 0.100 0.000 0.120 0.232
#> GSM241474 1 0.6433 -0.1709 0.488 0.032 0.024 0.000 0.104 0.352
#> GSM241475 2 0.2034 0.7512 0.000 0.912 0.004 0.000 0.024 0.060
#> GSM241476 1 0.3960 0.4797 0.760 0.000 0.008 0.000 0.180 0.052
#> GSM241477 2 0.4019 0.7231 0.000 0.796 0.040 0.000 0.088 0.076
#> GSM241478 2 0.2473 0.7290 0.000 0.856 0.008 0.000 0.000 0.136
#> GSM241479 1 0.2520 0.5451 0.888 0.000 0.012 0.000 0.068 0.032
#> GSM241480 1 0.1141 0.5300 0.948 0.000 0.000 0.000 0.000 0.052
#> GSM241481 5 0.2432 0.8831 0.000 0.080 0.008 0.000 0.888 0.024
#> GSM241482 1 0.4944 -0.4396 0.488 0.064 0.000 0.000 0.000 0.448
#> GSM241483 5 0.2537 0.8818 0.000 0.096 0.000 0.000 0.872 0.032
#> GSM241484 1 0.4371 -0.1092 0.580 0.028 0.000 0.000 0.000 0.392
#> GSM241485 6 0.5718 0.6516 0.252 0.228 0.000 0.000 0.000 0.520
#> GSM241486 5 0.2217 0.8644 0.004 0.036 0.004 0.000 0.908 0.048
#> GSM241487 2 0.3705 0.7053 0.000 0.792 0.008 0.000 0.056 0.144
#> GSM241488 2 0.1841 0.7434 0.000 0.920 0.008 0.000 0.008 0.064
#> GSM241489 1 0.4419 0.5244 0.776 0.004 0.060 0.000 0.080 0.080
#> GSM241490 1 0.2507 0.5439 0.892 0.000 0.060 0.000 0.028 0.020
#> GSM241491 2 0.3350 0.7445 0.000 0.828 0.012 0.000 0.048 0.112
#> GSM241492 1 0.7383 -0.0182 0.440 0.092 0.116 0.000 0.040 0.312
#> GSM241493 2 0.2039 0.7452 0.000 0.908 0.004 0.000 0.016 0.072
#> GSM241494 1 0.1340 0.5458 0.948 0.000 0.040 0.000 0.004 0.008
#> GSM241495 2 0.3051 0.7181 0.000 0.844 0.008 0.000 0.036 0.112
#> GSM241496 2 0.2575 0.7294 0.000 0.872 0.024 0.000 0.004 0.100
#> GSM241497 1 0.3361 0.5404 0.844 0.000 0.044 0.000 0.064 0.048
#> GSM241498 1 0.3063 0.5215 0.840 0.000 0.000 0.000 0.092 0.068
#> GSM241499 1 0.4829 -0.2146 0.544 0.048 0.000 0.004 0.000 0.404
#> GSM241500 5 0.1584 0.8893 0.000 0.064 0.000 0.000 0.928 0.008
#> GSM241501 5 0.2934 0.8700 0.000 0.112 0.000 0.000 0.844 0.044
#> GSM241502 5 0.2822 0.8755 0.000 0.108 0.000 0.004 0.856 0.032
#> GSM241503 1 0.4241 0.1298 0.644 0.016 0.000 0.004 0.004 0.332
#> GSM241504 1 0.4326 0.0700 0.608 0.016 0.000 0.008 0.000 0.368
#> GSM241505 1 0.3930 0.1081 0.628 0.000 0.000 0.004 0.004 0.364
#> GSM241506 5 0.3666 0.7675 0.000 0.024 0.000 0.160 0.792 0.024
#> GSM241507 1 0.3878 0.1040 0.644 0.000 0.000 0.004 0.004 0.348
#> GSM241508 5 0.3215 0.8639 0.000 0.100 0.000 0.000 0.828 0.072
#> GSM241509 5 0.2845 0.8226 0.004 0.008 0.000 0.064 0.872 0.052
#> GSM241510 5 0.5334 0.3815 0.000 0.032 0.000 0.336 0.576 0.056
#> GSM241511 1 0.5687 -0.1707 0.508 0.000 0.004 0.152 0.000 0.336
#> GSM241512 4 0.6029 -0.1546 0.300 0.000 0.000 0.424 0.000 0.276
#> GSM241513 3 0.4269 0.6202 0.000 0.220 0.724 0.020 0.000 0.036
#> GSM241514 3 0.4234 0.4741 0.372 0.000 0.608 0.000 0.004 0.016
#> GSM241515 2 0.6669 0.1411 0.000 0.472 0.304 0.076 0.000 0.148
#> GSM241516 1 0.4703 0.3559 0.644 0.000 0.300 0.008 0.004 0.044
#> GSM241517 2 0.5065 0.1614 0.000 0.532 0.396 0.004 0.000 0.068
#> GSM241518 3 0.3475 0.7364 0.144 0.004 0.816 0.008 0.008 0.020
#> GSM241519 2 0.4453 0.0495 0.000 0.528 0.444 0.000 0.000 0.028
#> GSM241520 3 0.3324 0.7512 0.164 0.008 0.808 0.000 0.004 0.016
#> GSM241521 2 0.4905 0.0892 0.000 0.528 0.408 0.000 0.000 0.064
#> GSM241522 1 0.3800 0.4511 0.764 0.000 0.192 0.000 0.008 0.036
#> GSM241523 3 0.4428 0.3194 0.000 0.388 0.580 0.000 0.000 0.032
#> GSM241524 3 0.3189 0.7112 0.236 0.000 0.760 0.000 0.000 0.004
#> GSM241525 1 0.5034 0.3180 0.660 0.000 0.024 0.252 0.004 0.060
#> GSM241526 4 0.1059 0.7575 0.000 0.000 0.004 0.964 0.016 0.016
#> GSM241527 4 0.1480 0.7578 0.020 0.000 0.000 0.940 0.000 0.040
#> GSM241528 4 0.3421 0.6268 0.000 0.200 0.004 0.780 0.004 0.012
#> GSM241529 4 0.1176 0.7573 0.000 0.000 0.000 0.956 0.020 0.024
#> GSM241530 4 0.3925 0.6293 0.200 0.000 0.000 0.744 0.000 0.056
#> GSM241531 4 0.4691 0.5226 0.108 0.000 0.000 0.672 0.000 0.220
#> GSM241532 4 0.3908 0.5827 0.000 0.000 0.004 0.724 0.244 0.028
#> GSM241533 4 0.3178 0.6678 0.000 0.000 0.004 0.804 0.176 0.016
#> GSM241534 4 0.3398 0.6261 0.000 0.000 0.004 0.768 0.216 0.012
#> GSM241535 4 0.0790 0.7587 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM241536 6 0.6297 0.2470 0.356 0.012 0.000 0.236 0.000 0.396
#> GSM241537 4 0.1088 0.7563 0.000 0.000 0.024 0.960 0.000 0.016
#> GSM241538 4 0.4164 0.6816 0.016 0.000 0.168 0.756 0.000 0.060
#> GSM241539 4 0.0951 0.7569 0.000 0.000 0.008 0.968 0.004 0.020
#> GSM241540 4 0.6526 0.4372 0.248 0.000 0.148 0.524 0.000 0.080
#> GSM241541 4 0.4138 0.4717 0.000 0.004 0.320 0.656 0.000 0.020
#> GSM241542 4 0.4389 0.4308 0.000 0.000 0.372 0.596 0.000 0.032
#> GSM241543 3 0.3543 0.6489 0.000 0.200 0.768 0.000 0.000 0.032
#> GSM241544 3 0.2743 0.7497 0.164 0.000 0.828 0.000 0.000 0.008
#> GSM241545 3 0.3630 0.6391 0.000 0.212 0.756 0.000 0.000 0.032
#> GSM241546 3 0.3374 0.7223 0.208 0.000 0.772 0.000 0.000 0.020
#> GSM241547 3 0.4278 0.6210 0.000 0.220 0.724 0.024 0.000 0.032
#> GSM241548 3 0.2708 0.7473 0.112 0.004 0.864 0.008 0.000 0.012
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> MAD:NMF 97 6.52e-01 0.974192 2
#> MAD:NMF 96 7.14e-11 0.376726 3
#> MAD:NMF 94 1.30e-12 0.000622 4
#> MAD:NMF 88 2.00e-12 0.000016 5
#> MAD:NMF 64 2.43e-11 0.000002 6
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 16250 rows and 98 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 1.000 0.999 1.000 0.5056 0.495 0.495
#> 3 3 0.946 0.933 0.968 0.2132 0.886 0.769
#> 4 4 0.854 0.882 0.939 0.1914 0.875 0.671
#> 5 5 0.857 0.840 0.920 0.0258 0.985 0.942
#> 6 6 0.892 0.806 0.895 0.0342 0.990 0.957
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
#> GSM241451 2 0.0000 1.000 0.000 1.000
#> GSM241452 1 0.0000 0.999 1.000 0.000
#> GSM241453 2 0.0000 1.000 0.000 1.000
#> GSM241454 1 0.0000 0.999 1.000 0.000
#> GSM241455 2 0.0000 1.000 0.000 1.000
#> GSM241456 1 0.0000 0.999 1.000 0.000
#> GSM241457 2 0.0000 1.000 0.000 1.000
#> GSM241458 1 0.0000 0.999 1.000 0.000
#> GSM241459 2 0.0000 1.000 0.000 1.000
#> GSM241460 1 0.0000 0.999 1.000 0.000
#> GSM241461 2 0.0000 1.000 0.000 1.000
#> GSM241462 1 0.0000 0.999 1.000 0.000
#> GSM241463 2 0.0000 1.000 0.000 1.000
#> GSM241464 1 0.0000 0.999 1.000 0.000
#> GSM241465 2 0.0000 1.000 0.000 1.000
#> GSM241466 1 0.0000 0.999 1.000 0.000
#> GSM241467 1 0.0000 0.999 1.000 0.000
#> GSM241468 2 0.0000 1.000 0.000 1.000
#> GSM241469 1 0.0000 0.999 1.000 0.000
#> GSM241470 2 0.0000 1.000 0.000 1.000
#> GSM241471 2 0.0000 1.000 0.000 1.000
#> GSM241472 1 0.0000 0.999 1.000 0.000
#> GSM241473 2 0.0000 1.000 0.000 1.000
#> GSM241474 1 0.0000 0.999 1.000 0.000
#> GSM241475 2 0.0000 1.000 0.000 1.000
#> GSM241476 1 0.0000 0.999 1.000 0.000
#> GSM241477 2 0.0000 1.000 0.000 1.000
#> GSM241478 2 0.0000 1.000 0.000 1.000
#> GSM241479 1 0.0000 0.999 1.000 0.000
#> GSM241480 1 0.0000 0.999 1.000 0.000
#> GSM241481 2 0.0000 1.000 0.000 1.000
#> GSM241482 1 0.0000 0.999 1.000 0.000
#> GSM241483 2 0.0000 1.000 0.000 1.000
#> GSM241484 1 0.0000 0.999 1.000 0.000
#> GSM241485 1 0.0000 0.999 1.000 0.000
#> GSM241486 2 0.0000 1.000 0.000 1.000
#> GSM241487 2 0.0000 1.000 0.000 1.000
#> GSM241488 2 0.0000 1.000 0.000 1.000
#> GSM241489 1 0.0000 0.999 1.000 0.000
#> GSM241490 1 0.0000 0.999 1.000 0.000
#> GSM241491 2 0.0000 1.000 0.000 1.000
#> GSM241492 1 0.0000 0.999 1.000 0.000
#> GSM241493 2 0.0000 1.000 0.000 1.000
#> GSM241494 1 0.0000 0.999 1.000 0.000
#> GSM241495 2 0.0000 1.000 0.000 1.000
#> GSM241496 2 0.0000 1.000 0.000 1.000
#> GSM241497 1 0.0000 0.999 1.000 0.000
#> GSM241498 1 0.0000 0.999 1.000 0.000
#> GSM241499 1 0.0000 0.999 1.000 0.000
#> GSM241500 2 0.0000 1.000 0.000 1.000
#> GSM241501 2 0.0000 1.000 0.000 1.000
#> GSM241502 2 0.0000 1.000 0.000 1.000
#> GSM241503 1 0.0000 0.999 1.000 0.000
#> GSM241504 1 0.0000 0.999 1.000 0.000
#> GSM241505 1 0.0000 0.999 1.000 0.000
#> GSM241506 2 0.0000 1.000 0.000 1.000
#> GSM241507 1 0.0000 0.999 1.000 0.000
#> GSM241508 2 0.0000 1.000 0.000 1.000
#> GSM241509 2 0.0000 1.000 0.000 1.000
#> GSM241510 2 0.0000 1.000 0.000 1.000
#> GSM241511 1 0.0000 0.999 1.000 0.000
#> GSM241512 1 0.0000 0.999 1.000 0.000
#> GSM241513 2 0.0000 1.000 0.000 1.000
#> GSM241514 1 0.0000 0.999 1.000 0.000
#> GSM241515 2 0.0000 1.000 0.000 1.000
#> GSM241516 1 0.0000 0.999 1.000 0.000
#> GSM241517 2 0.0000 1.000 0.000 1.000
#> GSM241518 1 0.0376 0.996 0.996 0.004
#> GSM241519 2 0.0000 1.000 0.000 1.000
#> GSM241520 1 0.0376 0.996 0.996 0.004
#> GSM241521 2 0.0000 1.000 0.000 1.000
#> GSM241522 1 0.0000 0.999 1.000 0.000
#> GSM241523 2 0.0000 1.000 0.000 1.000
#> GSM241524 1 0.0000 0.999 1.000 0.000
#> GSM241525 1 0.0000 0.999 1.000 0.000
#> GSM241526 2 0.0000 1.000 0.000 1.000
#> GSM241527 1 0.0000 0.999 1.000 0.000
#> GSM241528 2 0.0000 1.000 0.000 1.000
#> GSM241529 2 0.0000 1.000 0.000 1.000
#> GSM241530 1 0.0000 0.999 1.000 0.000
#> GSM241531 1 0.0000 0.999 1.000 0.000
#> GSM241532 2 0.0000 1.000 0.000 1.000
#> GSM241533 2 0.0000 1.000 0.000 1.000
#> GSM241534 2 0.0000 1.000 0.000 1.000
#> GSM241535 1 0.0000 0.999 1.000 0.000
#> GSM241536 1 0.0000 0.999 1.000 0.000
#> GSM241537 2 0.0000 1.000 0.000 1.000
#> GSM241538 1 0.0672 0.993 0.992 0.008
#> GSM241539 2 0.0000 1.000 0.000 1.000
#> GSM241540 1 0.0000 0.999 1.000 0.000
#> GSM241541 2 0.0000 1.000 0.000 1.000
#> GSM241542 1 0.0672 0.993 0.992 0.008
#> GSM241543 2 0.0000 1.000 0.000 1.000
#> GSM241544 1 0.0000 0.999 1.000 0.000
#> GSM241545 2 0.0000 1.000 0.000 1.000
#> GSM241546 1 0.0000 0.999 1.000 0.000
#> GSM241547 2 0.0000 1.000 0.000 1.000
#> GSM241548 1 0.0672 0.993 0.992 0.008
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241457 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241458 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241461 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241462 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241463 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241464 1 0.0592 0.958 0.988 0.000 0.012
#> GSM241465 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241481 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241483 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241484 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241486 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241487 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241488 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241491 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241492 1 0.0592 0.958 0.988 0.000 0.012
#> GSM241493 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241499 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241500 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241501 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241502 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241503 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241504 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241505 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241506 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241507 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241508 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241509 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241510 2 0.0000 0.998 0.000 1.000 0.000
#> GSM241511 3 0.0592 0.851 0.012 0.000 0.988
#> GSM241512 3 0.0592 0.851 0.012 0.000 0.988
#> GSM241513 2 0.0424 0.995 0.000 0.992 0.008
#> GSM241514 3 0.4796 0.782 0.220 0.000 0.780
#> GSM241515 2 0.0424 0.995 0.000 0.992 0.008
#> GSM241516 3 0.4796 0.782 0.220 0.000 0.780
#> GSM241517 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241518 3 0.6192 0.334 0.420 0.000 0.580
#> GSM241519 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241520 3 0.6192 0.334 0.420 0.000 0.580
#> GSM241521 2 0.0424 0.995 0.000 0.992 0.008
#> GSM241522 1 0.0000 0.970 1.000 0.000 0.000
#> GSM241523 2 0.0424 0.995 0.000 0.992 0.008
#> GSM241524 1 0.6026 0.215 0.624 0.000 0.376
#> GSM241525 1 0.5948 0.289 0.640 0.000 0.360
#> GSM241526 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241527 3 0.4842 0.779 0.224 0.000 0.776
#> GSM241528 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241529 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241530 3 0.4842 0.779 0.224 0.000 0.776
#> GSM241531 3 0.0592 0.851 0.012 0.000 0.988
#> GSM241532 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241533 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241534 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241535 3 0.0592 0.851 0.012 0.000 0.988
#> GSM241536 3 0.0592 0.851 0.012 0.000 0.988
#> GSM241537 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241538 3 0.0000 0.846 0.000 0.000 1.000
#> GSM241539 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241540 3 0.0424 0.850 0.008 0.000 0.992
#> GSM241541 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241542 3 0.0000 0.846 0.000 0.000 1.000
#> GSM241543 2 0.0424 0.995 0.000 0.992 0.008
#> GSM241544 3 0.4796 0.782 0.220 0.000 0.780
#> GSM241545 2 0.0424 0.995 0.000 0.992 0.008
#> GSM241546 3 0.4796 0.782 0.220 0.000 0.780
#> GSM241547 2 0.0237 0.997 0.000 0.996 0.004
#> GSM241548 3 0.0000 0.846 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241457 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241458 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241459 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241460 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241461 2 0.0188 0.982 0.000 0.996 0.000 0.004
#> GSM241462 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0592 0.954 0.984 0.000 0.016 0.000
#> GSM241465 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241482 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241483 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241484 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241486 2 0.0188 0.982 0.000 0.996 0.000 0.004
#> GSM241487 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241488 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0592 0.954 0.984 0.000 0.016 0.000
#> GSM241493 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241500 4 0.4989 0.309 0.000 0.472 0.000 0.528
#> GSM241501 2 0.4331 0.495 0.000 0.712 0.000 0.288
#> GSM241502 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241503 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241506 2 0.0000 0.986 0.000 1.000 0.000 0.000
#> GSM241507 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241508 4 0.4925 0.429 0.000 0.428 0.000 0.572
#> GSM241509 4 0.3726 0.809 0.000 0.212 0.000 0.788
#> GSM241510 4 0.3726 0.809 0.000 0.212 0.000 0.788
#> GSM241511 3 0.0188 0.834 0.004 0.000 0.996 0.000
#> GSM241512 3 0.0188 0.834 0.004 0.000 0.996 0.000
#> GSM241513 4 0.2704 0.876 0.000 0.124 0.000 0.876
#> GSM241514 3 0.3764 0.781 0.216 0.000 0.784 0.000
#> GSM241515 4 0.2704 0.876 0.000 0.124 0.000 0.876
#> GSM241516 3 0.3764 0.781 0.216 0.000 0.784 0.000
#> GSM241517 4 0.1637 0.885 0.000 0.060 0.000 0.940
#> GSM241518 3 0.5070 0.338 0.416 0.000 0.580 0.004
#> GSM241519 4 0.1637 0.885 0.000 0.060 0.000 0.940
#> GSM241520 3 0.5070 0.338 0.416 0.000 0.580 0.004
#> GSM241521 4 0.4040 0.771 0.000 0.248 0.000 0.752
#> GSM241522 1 0.0000 0.970 1.000 0.000 0.000 0.000
#> GSM241523 4 0.3764 0.808 0.000 0.216 0.000 0.784
#> GSM241524 1 0.4790 0.210 0.620 0.000 0.380 0.000
#> GSM241525 1 0.4730 0.284 0.636 0.000 0.364 0.000
#> GSM241526 4 0.1716 0.886 0.000 0.064 0.000 0.936
#> GSM241527 3 0.3801 0.778 0.220 0.000 0.780 0.000
#> GSM241528 4 0.1716 0.886 0.000 0.064 0.000 0.936
#> GSM241529 4 0.1716 0.886 0.000 0.064 0.000 0.936
#> GSM241530 3 0.3801 0.778 0.220 0.000 0.780 0.000
#> GSM241531 3 0.0188 0.834 0.004 0.000 0.996 0.000
#> GSM241532 4 0.0188 0.859 0.000 0.004 0.000 0.996
#> GSM241533 4 0.0188 0.859 0.000 0.004 0.000 0.996
#> GSM241534 4 0.0188 0.859 0.000 0.004 0.000 0.996
#> GSM241535 3 0.0188 0.834 0.004 0.000 0.996 0.000
#> GSM241536 3 0.0188 0.834 0.004 0.000 0.996 0.000
#> GSM241537 4 0.0188 0.859 0.000 0.004 0.000 0.996
#> GSM241538 3 0.0336 0.830 0.000 0.000 0.992 0.008
#> GSM241539 4 0.0188 0.859 0.000 0.004 0.000 0.996
#> GSM241540 3 0.0000 0.831 0.000 0.000 1.000 0.000
#> GSM241541 4 0.0188 0.859 0.000 0.004 0.000 0.996
#> GSM241542 3 0.0336 0.830 0.000 0.000 0.992 0.008
#> GSM241543 4 0.2704 0.876 0.000 0.124 0.000 0.876
#> GSM241544 3 0.3764 0.781 0.216 0.000 0.784 0.000
#> GSM241545 4 0.2704 0.876 0.000 0.124 0.000 0.876
#> GSM241546 3 0.3764 0.781 0.216 0.000 0.784 0.000
#> GSM241547 4 0.1637 0.885 0.000 0.060 0.000 0.940
#> GSM241548 3 0.0336 0.830 0.000 0.000 0.992 0.008
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241457 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241458 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241459 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241460 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241461 2 0.0162 0.9756 0.000 0.996 0.000 0.000 0.004
#> GSM241462 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.1800 0.8939 0.932 0.000 0.048 0.020 0.000
#> GSM241465 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241482 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241483 2 0.1197 0.9386 0.000 0.952 0.000 0.000 0.048
#> GSM241484 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241486 2 0.0162 0.9756 0.000 0.996 0.000 0.000 0.004
#> GSM241487 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.1800 0.8939 0.932 0.000 0.048 0.020 0.000
#> GSM241493 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.9787 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241500 5 0.4227 0.3584 0.000 0.420 0.000 0.000 0.580
#> GSM241501 2 0.3983 0.4235 0.000 0.660 0.000 0.000 0.340
#> GSM241502 2 0.1197 0.9386 0.000 0.952 0.000 0.000 0.048
#> GSM241503 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241506 2 0.1197 0.9386 0.000 0.952 0.000 0.000 0.048
#> GSM241507 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241508 5 0.4114 0.4679 0.000 0.376 0.000 0.000 0.624
#> GSM241509 5 0.2732 0.7955 0.000 0.160 0.000 0.000 0.840
#> GSM241510 5 0.2732 0.7955 0.000 0.160 0.000 0.000 0.840
#> GSM241511 4 0.0000 0.8388 0.000 0.000 0.000 1.000 0.000
#> GSM241512 4 0.0000 0.8388 0.000 0.000 0.000 1.000 0.000
#> GSM241513 5 0.1768 0.8602 0.000 0.072 0.004 0.000 0.924
#> GSM241514 3 0.6351 0.4865 0.204 0.000 0.516 0.280 0.000
#> GSM241515 5 0.1768 0.8602 0.000 0.072 0.004 0.000 0.924
#> GSM241516 3 0.6351 0.4865 0.204 0.000 0.516 0.280 0.000
#> GSM241517 5 0.0162 0.8659 0.000 0.004 0.000 0.000 0.996
#> GSM241518 3 0.4626 0.3717 0.364 0.000 0.616 0.020 0.000
#> GSM241519 5 0.0162 0.8659 0.000 0.004 0.000 0.000 0.996
#> GSM241520 3 0.4626 0.3717 0.364 0.000 0.616 0.020 0.000
#> GSM241521 5 0.3491 0.7412 0.000 0.228 0.004 0.000 0.768
#> GSM241522 1 0.0000 0.9630 1.000 0.000 0.000 0.000 0.000
#> GSM241523 5 0.3231 0.7760 0.000 0.196 0.004 0.000 0.800
#> GSM241524 1 0.6043 0.0772 0.568 0.000 0.264 0.168 0.000
#> GSM241525 1 0.4444 0.2859 0.624 0.000 0.012 0.364 0.000
#> GSM241526 5 0.0290 0.8671 0.000 0.008 0.000 0.000 0.992
#> GSM241527 4 0.3630 0.5353 0.204 0.000 0.016 0.780 0.000
#> GSM241528 5 0.0290 0.8671 0.000 0.008 0.000 0.000 0.992
#> GSM241529 5 0.0290 0.8671 0.000 0.008 0.000 0.000 0.992
#> GSM241530 4 0.3630 0.5353 0.204 0.000 0.016 0.780 0.000
#> GSM241531 4 0.0000 0.8388 0.000 0.000 0.000 1.000 0.000
#> GSM241532 5 0.1732 0.8491 0.000 0.000 0.080 0.000 0.920
#> GSM241533 5 0.1732 0.8491 0.000 0.000 0.080 0.000 0.920
#> GSM241534 5 0.1732 0.8491 0.000 0.000 0.080 0.000 0.920
#> GSM241535 4 0.0000 0.8388 0.000 0.000 0.000 1.000 0.000
#> GSM241536 4 0.0000 0.8388 0.000 0.000 0.000 1.000 0.000
#> GSM241537 5 0.1732 0.8491 0.000 0.000 0.080 0.000 0.920
#> GSM241538 3 0.2377 0.5041 0.000 0.000 0.872 0.128 0.000
#> GSM241539 5 0.1732 0.8491 0.000 0.000 0.080 0.000 0.920
#> GSM241540 3 0.4114 0.3295 0.000 0.000 0.624 0.376 0.000
#> GSM241541 5 0.1732 0.8491 0.000 0.000 0.080 0.000 0.920
#> GSM241542 3 0.2377 0.5041 0.000 0.000 0.872 0.128 0.000
#> GSM241543 5 0.1768 0.8602 0.000 0.072 0.004 0.000 0.924
#> GSM241544 3 0.6351 0.4865 0.204 0.000 0.516 0.280 0.000
#> GSM241545 5 0.1768 0.8602 0.000 0.072 0.004 0.000 0.924
#> GSM241546 3 0.6351 0.4865 0.204 0.000 0.516 0.280 0.000
#> GSM241547 5 0.0162 0.8659 0.000 0.004 0.000 0.000 0.996
#> GSM241548 3 0.2377 0.5041 0.000 0.000 0.872 0.128 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 2 0.0146 0.9748 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241458 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241459 2 0.0146 0.9748 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241460 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241461 2 0.0260 0.9724 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM241462 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.5830 -0.1495 0.488 0.000 0.000 0.228 0.284 0.000
#> GSM241465 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 2 0.0146 0.9748 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241482 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241483 2 0.1285 0.9299 0.000 0.944 0.052 0.000 0.004 0.000
#> GSM241484 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241486 2 0.0260 0.9724 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM241487 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.5830 -0.1495 0.488 0.000 0.000 0.228 0.284 0.000
#> GSM241493 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.9766 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241500 3 0.4018 0.3380 0.000 0.412 0.580 0.000 0.008 0.000
#> GSM241501 2 0.3819 0.4245 0.000 0.652 0.340 0.000 0.008 0.000
#> GSM241502 2 0.1285 0.9299 0.000 0.944 0.052 0.000 0.004 0.000
#> GSM241503 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241506 2 0.1141 0.9317 0.000 0.948 0.052 0.000 0.000 0.000
#> GSM241507 1 0.0000 0.9391 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241508 3 0.3911 0.4488 0.000 0.368 0.624 0.000 0.008 0.000
#> GSM241509 3 0.2631 0.7499 0.000 0.152 0.840 0.000 0.008 0.000
#> GSM241510 3 0.2631 0.7499 0.000 0.152 0.840 0.000 0.008 0.000
#> GSM241511 6 0.0000 0.8673 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241512 6 0.0632 0.8669 0.000 0.000 0.000 0.024 0.000 0.976
#> GSM241513 3 0.1531 0.8110 0.000 0.068 0.928 0.000 0.004 0.000
#> GSM241514 4 0.3962 0.5601 0.004 0.000 0.000 0.772 0.128 0.096
#> GSM241515 3 0.1531 0.8110 0.000 0.068 0.928 0.000 0.004 0.000
#> GSM241516 4 0.3962 0.5601 0.004 0.000 0.000 0.772 0.128 0.096
#> GSM241517 3 0.0000 0.8113 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241518 5 0.4343 0.6744 0.120 0.000 0.000 0.156 0.724 0.000
#> GSM241519 3 0.0000 0.8113 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241520 5 0.4343 0.6744 0.120 0.000 0.000 0.156 0.724 0.000
#> GSM241521 3 0.3136 0.6991 0.000 0.228 0.768 0.000 0.004 0.000
#> GSM241522 1 0.0547 0.9181 0.980 0.000 0.000 0.020 0.000 0.000
#> GSM241523 3 0.2902 0.7334 0.000 0.196 0.800 0.000 0.004 0.000
#> GSM241524 5 0.6697 0.3226 0.124 0.000 0.000 0.380 0.412 0.084
#> GSM241525 1 0.5865 -0.0816 0.476 0.000 0.000 0.228 0.000 0.296
#> GSM241526 3 0.0146 0.8127 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM241527 6 0.3508 0.6464 0.004 0.000 0.000 0.292 0.000 0.704
#> GSM241528 3 0.0146 0.8127 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM241529 3 0.0146 0.8127 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM241530 6 0.3508 0.6464 0.004 0.000 0.000 0.292 0.000 0.704
#> GSM241531 6 0.0000 0.8673 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241532 3 0.2969 0.7396 0.000 0.000 0.776 0.000 0.224 0.000
#> GSM241533 3 0.2969 0.7396 0.000 0.000 0.776 0.000 0.224 0.000
#> GSM241534 3 0.2969 0.7396 0.000 0.000 0.776 0.000 0.224 0.000
#> GSM241535 6 0.0632 0.8669 0.000 0.000 0.000 0.024 0.000 0.976
#> GSM241536 6 0.0000 0.8673 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM241537 3 0.3076 0.7268 0.000 0.000 0.760 0.000 0.240 0.000
#> GSM241538 4 0.3508 0.4324 0.000 0.000 0.000 0.704 0.292 0.004
#> GSM241539 3 0.3076 0.7268 0.000 0.000 0.760 0.000 0.240 0.000
#> GSM241540 4 0.4099 0.4174 0.000 0.000 0.000 0.708 0.048 0.244
#> GSM241541 3 0.3076 0.7268 0.000 0.000 0.760 0.000 0.240 0.000
#> GSM241542 4 0.3508 0.4324 0.000 0.000 0.000 0.704 0.292 0.004
#> GSM241543 3 0.1531 0.8110 0.000 0.068 0.928 0.000 0.004 0.000
#> GSM241544 4 0.3962 0.5601 0.004 0.000 0.000 0.772 0.128 0.096
#> GSM241545 3 0.1531 0.8110 0.000 0.068 0.928 0.000 0.004 0.000
#> GSM241546 4 0.3962 0.5601 0.004 0.000 0.000 0.772 0.128 0.096
#> GSM241547 3 0.0000 0.8113 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241548 4 0.3986 0.3840 0.000 0.000 0.000 0.532 0.464 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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> ATC:hclust 98 1.00e+00 1.000 2
#> ATC:hclust 94 4.39e-06 0.838 3
#> ATC:hclust 91 3.30e-12 0.868 4
#> ATC:hclust 86 1.47e-10 0.213 5
#> ATC:hclust 87 8.71e-10 0.201 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.976 0.989 0.5018 0.500 0.500
#> 3 3 0.753 0.789 0.856 0.2738 0.838 0.679
#> 4 4 0.805 0.924 0.916 0.1438 0.865 0.636
#> 5 5 0.857 0.852 0.875 0.0577 1.000 1.000
#> 6 6 0.840 0.747 0.798 0.0384 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] 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
#> GSM241451 2 0.000 0.980 0.000 1.000
#> GSM241452 1 0.000 1.000 1.000 0.000
#> GSM241453 2 0.000 0.980 0.000 1.000
#> GSM241454 1 0.000 1.000 1.000 0.000
#> GSM241455 2 0.000 0.980 0.000 1.000
#> GSM241456 1 0.000 1.000 1.000 0.000
#> GSM241457 2 0.000 0.980 0.000 1.000
#> GSM241458 1 0.000 1.000 1.000 0.000
#> GSM241459 2 0.000 0.980 0.000 1.000
#> GSM241460 1 0.000 1.000 1.000 0.000
#> GSM241461 2 0.000 0.980 0.000 1.000
#> GSM241462 1 0.000 1.000 1.000 0.000
#> GSM241463 2 0.000 0.980 0.000 1.000
#> GSM241464 1 0.000 1.000 1.000 0.000
#> GSM241465 2 0.000 0.980 0.000 1.000
#> GSM241466 1 0.000 1.000 1.000 0.000
#> GSM241467 1 0.000 1.000 1.000 0.000
#> GSM241468 2 0.000 0.980 0.000 1.000
#> GSM241469 1 0.000 1.000 1.000 0.000
#> GSM241470 2 0.000 0.980 0.000 1.000
#> GSM241471 2 0.000 0.980 0.000 1.000
#> GSM241472 1 0.000 1.000 1.000 0.000
#> GSM241473 2 0.000 0.980 0.000 1.000
#> GSM241474 1 0.000 1.000 1.000 0.000
#> GSM241475 2 0.000 0.980 0.000 1.000
#> GSM241476 1 0.000 1.000 1.000 0.000
#> GSM241477 2 0.000 0.980 0.000 1.000
#> GSM241478 2 0.000 0.980 0.000 1.000
#> GSM241479 1 0.000 1.000 1.000 0.000
#> GSM241480 1 0.000 1.000 1.000 0.000
#> GSM241481 2 0.000 0.980 0.000 1.000
#> GSM241482 1 0.000 1.000 1.000 0.000
#> GSM241483 2 0.000 0.980 0.000 1.000
#> GSM241484 1 0.000 1.000 1.000 0.000
#> GSM241485 1 0.000 1.000 1.000 0.000
#> GSM241486 2 0.000 0.980 0.000 1.000
#> GSM241487 2 0.000 0.980 0.000 1.000
#> GSM241488 2 0.000 0.980 0.000 1.000
#> GSM241489 1 0.000 1.000 1.000 0.000
#> GSM241490 1 0.000 1.000 1.000 0.000
#> GSM241491 2 0.000 0.980 0.000 1.000
#> GSM241492 1 0.000 1.000 1.000 0.000
#> GSM241493 2 0.000 0.980 0.000 1.000
#> GSM241494 1 0.000 1.000 1.000 0.000
#> GSM241495 2 0.000 0.980 0.000 1.000
#> GSM241496 2 0.000 0.980 0.000 1.000
#> GSM241497 1 0.000 1.000 1.000 0.000
#> GSM241498 1 0.000 1.000 1.000 0.000
#> GSM241499 1 0.000 1.000 1.000 0.000
#> GSM241500 2 0.000 0.980 0.000 1.000
#> GSM241501 2 0.000 0.980 0.000 1.000
#> GSM241502 2 0.000 0.980 0.000 1.000
#> GSM241503 1 0.000 1.000 1.000 0.000
#> GSM241504 1 0.000 1.000 1.000 0.000
#> GSM241505 1 0.000 1.000 1.000 0.000
#> GSM241506 2 0.000 0.980 0.000 1.000
#> GSM241507 1 0.000 1.000 1.000 0.000
#> GSM241508 2 0.000 0.980 0.000 1.000
#> GSM241509 2 0.000 0.980 0.000 1.000
#> GSM241510 2 0.000 0.980 0.000 1.000
#> GSM241511 1 0.000 1.000 1.000 0.000
#> GSM241512 1 0.000 1.000 1.000 0.000
#> GSM241513 2 0.000 0.980 0.000 1.000
#> GSM241514 1 0.000 1.000 1.000 0.000
#> GSM241515 2 0.000 0.980 0.000 1.000
#> GSM241516 1 0.000 1.000 1.000 0.000
#> GSM241517 2 0.000 0.980 0.000 1.000
#> GSM241518 2 0.943 0.465 0.360 0.640
#> GSM241519 2 0.000 0.980 0.000 1.000
#> GSM241520 1 0.000 1.000 1.000 0.000
#> GSM241521 2 0.000 0.980 0.000 1.000
#> GSM241522 1 0.000 1.000 1.000 0.000
#> GSM241523 2 0.000 0.980 0.000 1.000
#> GSM241524 1 0.000 1.000 1.000 0.000
#> GSM241525 1 0.000 1.000 1.000 0.000
#> GSM241526 2 0.000 0.980 0.000 1.000
#> GSM241527 1 0.000 1.000 1.000 0.000
#> GSM241528 2 0.000 0.980 0.000 1.000
#> GSM241529 2 0.000 0.980 0.000 1.000
#> GSM241530 1 0.000 1.000 1.000 0.000
#> GSM241531 1 0.000 1.000 1.000 0.000
#> GSM241532 2 0.000 0.980 0.000 1.000
#> GSM241533 2 0.000 0.980 0.000 1.000
#> GSM241534 2 0.000 0.980 0.000 1.000
#> GSM241535 2 0.767 0.724 0.224 0.776
#> GSM241536 1 0.000 1.000 1.000 0.000
#> GSM241537 2 0.000 0.980 0.000 1.000
#> GSM241538 2 0.767 0.724 0.224 0.776
#> GSM241539 2 0.000 0.980 0.000 1.000
#> GSM241540 1 0.000 1.000 1.000 0.000
#> GSM241541 2 0.000 0.980 0.000 1.000
#> GSM241542 2 0.000 0.980 0.000 1.000
#> GSM241543 2 0.000 0.980 0.000 1.000
#> GSM241544 1 0.000 1.000 1.000 0.000
#> GSM241545 2 0.000 0.980 0.000 1.000
#> GSM241546 1 0.000 1.000 1.000 0.000
#> GSM241547 2 0.000 0.980 0.000 1.000
#> GSM241548 2 0.767 0.724 0.224 0.776
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241457 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241458 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241459 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241460 1 0.0892 0.875 0.980 0.000 0.020
#> GSM241461 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241462 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241463 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241464 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241465 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241481 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241482 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241483 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241484 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241485 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241486 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241487 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241488 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241491 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241492 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241493 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241499 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241500 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241501 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241502 2 0.0237 0.957 0.000 0.996 0.004
#> GSM241503 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241504 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241505 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241506 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241507 1 0.1031 0.874 0.976 0.000 0.024
#> GSM241508 2 0.4605 0.561 0.000 0.796 0.204
#> GSM241509 3 0.6252 0.691 0.000 0.444 0.556
#> GSM241510 3 0.6252 0.691 0.000 0.444 0.556
#> GSM241511 1 0.6235 0.634 0.564 0.000 0.436
#> GSM241512 1 0.6192 0.635 0.580 0.000 0.420
#> GSM241513 3 0.6244 0.699 0.000 0.440 0.560
#> GSM241514 1 0.6180 0.636 0.584 0.000 0.416
#> GSM241515 3 0.6235 0.700 0.000 0.436 0.564
#> GSM241516 1 0.6180 0.636 0.584 0.000 0.416
#> GSM241517 3 0.6260 0.691 0.000 0.448 0.552
#> GSM241518 3 0.6829 0.247 0.168 0.096 0.736
#> GSM241519 2 0.6302 -0.550 0.000 0.520 0.480
#> GSM241520 1 0.6410 0.628 0.576 0.004 0.420
#> GSM241521 2 0.0000 0.959 0.000 1.000 0.000
#> GSM241522 1 0.0000 0.879 1.000 0.000 0.000
#> GSM241523 2 0.2625 0.828 0.000 0.916 0.084
#> GSM241524 1 0.6062 0.660 0.616 0.000 0.384
#> GSM241525 1 0.0237 0.879 0.996 0.000 0.004
#> GSM241526 3 0.6252 0.696 0.000 0.444 0.556
#> GSM241527 1 0.6204 0.631 0.576 0.000 0.424
#> GSM241528 3 0.6280 0.669 0.000 0.460 0.540
#> GSM241529 3 0.6260 0.691 0.000 0.448 0.552
#> GSM241530 1 0.6180 0.639 0.584 0.000 0.416
#> GSM241531 1 0.6244 0.630 0.560 0.000 0.440
#> GSM241532 3 0.6252 0.691 0.000 0.444 0.556
#> GSM241533 3 0.6244 0.696 0.000 0.440 0.560
#> GSM241534 3 0.6244 0.696 0.000 0.440 0.560
#> GSM241535 3 0.1163 0.537 0.000 0.028 0.972
#> GSM241536 1 0.6235 0.634 0.564 0.000 0.436
#> GSM241537 3 0.5760 0.663 0.000 0.328 0.672
#> GSM241538 3 0.1163 0.537 0.000 0.028 0.972
#> GSM241539 3 0.5760 0.663 0.000 0.328 0.672
#> GSM241540 3 0.6008 -0.294 0.372 0.000 0.628
#> GSM241541 3 0.6204 0.698 0.000 0.424 0.576
#> GSM241542 3 0.1163 0.537 0.000 0.028 0.972
#> GSM241543 3 0.6235 0.700 0.000 0.436 0.564
#> GSM241544 1 0.6192 0.632 0.580 0.000 0.420
#> GSM241545 3 0.6235 0.700 0.000 0.436 0.564
#> GSM241546 1 0.6180 0.636 0.584 0.000 0.416
#> GSM241547 3 0.6244 0.699 0.000 0.440 0.560
#> GSM241548 3 0.1163 0.537 0.000 0.028 0.972
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241457 2 0.2216 0.931 0.000 0.908 0.092 0.000
#> GSM241458 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241459 2 0.2216 0.931 0.000 0.908 0.092 0.000
#> GSM241460 1 0.2011 0.914 0.920 0.000 0.080 0.000
#> GSM241461 2 0.2216 0.931 0.000 0.908 0.092 0.000
#> GSM241462 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241463 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0592 0.931 0.984 0.000 0.016 0.000
#> GSM241465 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241466 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241481 2 0.2216 0.931 0.000 0.908 0.092 0.000
#> GSM241482 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241483 2 0.2216 0.931 0.000 0.908 0.092 0.000
#> GSM241484 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241485 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241486 2 0.2216 0.931 0.000 0.908 0.092 0.000
#> GSM241487 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241488 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241499 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241500 2 0.3117 0.909 0.000 0.880 0.092 0.028
#> GSM241501 2 0.2216 0.931 0.000 0.908 0.092 0.000
#> GSM241502 2 0.2216 0.931 0.000 0.908 0.092 0.000
#> GSM241503 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241504 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241505 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241506 2 0.0000 0.966 0.000 1.000 0.000 0.000
#> GSM241507 1 0.3533 0.898 0.864 0.000 0.080 0.056
#> GSM241508 4 0.5174 0.848 0.000 0.152 0.092 0.756
#> GSM241509 4 0.4426 0.905 0.000 0.092 0.096 0.812
#> GSM241510 4 0.2676 0.967 0.000 0.092 0.012 0.896
#> GSM241511 3 0.3435 0.864 0.100 0.000 0.864 0.036
#> GSM241512 3 0.3852 0.900 0.180 0.000 0.808 0.012
#> GSM241513 4 0.2401 0.968 0.000 0.092 0.004 0.904
#> GSM241514 3 0.3725 0.901 0.180 0.000 0.812 0.008
#> GSM241515 4 0.4122 0.810 0.000 0.236 0.004 0.760
#> GSM241516 3 0.3725 0.901 0.180 0.000 0.812 0.008
#> GSM241517 4 0.2676 0.966 0.000 0.092 0.012 0.896
#> GSM241518 3 0.5130 0.863 0.084 0.040 0.800 0.076
#> GSM241519 4 0.2988 0.953 0.000 0.112 0.012 0.876
#> GSM241520 3 0.4360 0.894 0.140 0.032 0.816 0.012
#> GSM241521 2 0.0188 0.963 0.000 0.996 0.000 0.004
#> GSM241522 1 0.0000 0.942 1.000 0.000 0.000 0.000
#> GSM241523 2 0.3306 0.783 0.000 0.840 0.004 0.156
#> GSM241524 3 0.3852 0.894 0.192 0.000 0.800 0.008
#> GSM241525 1 0.3764 0.713 0.816 0.000 0.172 0.012
#> GSM241526 4 0.2401 0.968 0.000 0.092 0.004 0.904
#> GSM241527 3 0.3925 0.902 0.176 0.000 0.808 0.016
#> GSM241528 4 0.2675 0.964 0.000 0.100 0.008 0.892
#> GSM241529 4 0.2216 0.968 0.000 0.092 0.000 0.908
#> GSM241530 3 0.3852 0.900 0.180 0.000 0.808 0.012
#> GSM241531 3 0.3143 0.870 0.100 0.000 0.876 0.024
#> GSM241532 4 0.2676 0.967 0.000 0.092 0.012 0.896
#> GSM241533 4 0.2401 0.968 0.000 0.092 0.004 0.904
#> GSM241534 4 0.2401 0.968 0.000 0.092 0.004 0.904
#> GSM241535 3 0.3893 0.793 0.000 0.008 0.796 0.196
#> GSM241536 3 0.4010 0.845 0.100 0.000 0.836 0.064
#> GSM241537 4 0.2593 0.958 0.000 0.080 0.016 0.904
#> GSM241538 3 0.3528 0.790 0.000 0.000 0.808 0.192
#> GSM241539 4 0.2593 0.958 0.000 0.080 0.016 0.904
#> GSM241540 3 0.4477 0.883 0.108 0.000 0.808 0.084
#> GSM241541 4 0.2480 0.966 0.000 0.088 0.008 0.904
#> GSM241542 3 0.3528 0.790 0.000 0.000 0.808 0.192
#> GSM241543 4 0.2401 0.968 0.000 0.092 0.004 0.904
#> GSM241544 3 0.3681 0.902 0.176 0.000 0.816 0.008
#> GSM241545 4 0.2401 0.968 0.000 0.092 0.004 0.904
#> GSM241546 3 0.3725 0.901 0.180 0.000 0.812 0.008
#> GSM241547 4 0.2401 0.968 0.000 0.092 0.004 0.904
#> GSM241548 3 0.3852 0.793 0.000 0.008 0.800 0.192
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241452 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241453 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241454 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241455 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241456 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241457 2 0.3752 0.770 0.000 0.708 0.000 0.000 NA
#> GSM241458 1 0.3940 0.823 0.756 0.000 0.024 0.000 NA
#> GSM241459 2 0.3730 0.772 0.000 0.712 0.000 0.000 NA
#> GSM241460 1 0.1267 0.893 0.960 0.000 0.024 0.004 NA
#> GSM241461 2 0.4339 0.730 0.000 0.652 0.000 0.012 NA
#> GSM241462 1 0.4000 0.819 0.748 0.000 0.024 0.000 NA
#> GSM241463 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241464 1 0.2158 0.853 0.920 0.000 0.052 0.008 NA
#> GSM241465 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241466 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241467 1 0.0162 0.905 0.996 0.000 0.000 0.004 NA
#> GSM241468 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241469 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241470 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241471 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241472 1 0.0162 0.905 0.996 0.000 0.000 0.004 NA
#> GSM241473 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241474 1 0.0162 0.905 0.996 0.000 0.000 0.004 NA
#> GSM241475 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241476 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241477 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241478 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241479 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241480 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241481 2 0.3730 0.772 0.000 0.712 0.000 0.000 NA
#> GSM241482 1 0.3940 0.823 0.756 0.000 0.024 0.000 NA
#> GSM241483 2 0.3816 0.763 0.000 0.696 0.000 0.000 NA
#> GSM241484 1 0.3940 0.823 0.756 0.000 0.024 0.000 NA
#> GSM241485 1 0.3970 0.821 0.752 0.000 0.024 0.000 NA
#> GSM241486 2 0.4339 0.730 0.000 0.652 0.000 0.012 NA
#> GSM241487 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241488 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241489 1 0.0162 0.905 0.996 0.000 0.000 0.004 NA
#> GSM241490 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241491 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241492 1 0.0324 0.903 0.992 0.000 0.000 0.004 NA
#> GSM241493 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241494 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241495 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241496 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241497 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241498 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241499 1 0.4000 0.819 0.748 0.000 0.024 0.000 NA
#> GSM241500 2 0.4921 0.696 0.000 0.620 0.000 0.040 NA
#> GSM241501 2 0.4323 0.734 0.000 0.656 0.000 0.012 NA
#> GSM241502 2 0.3816 0.763 0.000 0.696 0.000 0.000 NA
#> GSM241503 1 0.4000 0.819 0.748 0.000 0.024 0.000 NA
#> GSM241504 1 0.4000 0.819 0.748 0.000 0.024 0.000 NA
#> GSM241505 1 0.4000 0.819 0.748 0.000 0.024 0.000 NA
#> GSM241506 2 0.0000 0.896 0.000 1.000 0.000 0.000 NA
#> GSM241507 1 0.4029 0.816 0.744 0.000 0.024 0.000 NA
#> GSM241508 4 0.5606 0.599 0.000 0.088 0.000 0.568 NA
#> GSM241509 4 0.3124 0.872 0.000 0.016 0.004 0.844 NA
#> GSM241510 4 0.2984 0.880 0.000 0.016 0.004 0.856 NA
#> GSM241511 3 0.2912 0.851 0.028 0.000 0.876 0.008 NA
#> GSM241512 3 0.2504 0.871 0.064 0.000 0.900 0.004 NA
#> GSM241513 4 0.3357 0.870 0.000 0.016 0.012 0.836 NA
#> GSM241514 3 0.3715 0.874 0.064 0.000 0.824 0.004 NA
#> GSM241515 4 0.5570 0.721 0.000 0.168 0.012 0.676 NA
#> GSM241516 3 0.3715 0.874 0.064 0.000 0.824 0.004 NA
#> GSM241517 4 0.2331 0.891 0.000 0.016 0.008 0.908 NA
#> GSM241518 3 0.4979 0.828 0.024 0.004 0.704 0.028 NA
#> GSM241519 4 0.2521 0.890 0.000 0.024 0.008 0.900 NA
#> GSM241520 3 0.4389 0.853 0.040 0.000 0.772 0.020 NA
#> GSM241521 2 0.2149 0.839 0.000 0.916 0.000 0.036 NA
#> GSM241522 1 0.0000 0.905 1.000 0.000 0.000 0.000 NA
#> GSM241523 2 0.5113 0.581 0.000 0.700 0.008 0.208 NA
#> GSM241524 3 0.3827 0.872 0.068 0.000 0.816 0.004 NA
#> GSM241525 1 0.4747 0.486 0.676 0.000 0.284 0.004 NA
#> GSM241526 4 0.0798 0.897 0.000 0.016 0.000 0.976 NA
#> GSM241527 3 0.2519 0.871 0.060 0.000 0.900 0.004 NA
#> GSM241528 4 0.2278 0.894 0.000 0.032 0.000 0.908 NA
#> GSM241529 4 0.1914 0.896 0.000 0.016 0.000 0.924 NA
#> GSM241530 3 0.2740 0.869 0.064 0.000 0.888 0.004 NA
#> GSM241531 3 0.3077 0.849 0.028 0.000 0.864 0.008 NA
#> GSM241532 4 0.2792 0.883 0.000 0.016 0.016 0.884 NA
#> GSM241533 4 0.2861 0.883 0.000 0.016 0.024 0.884 NA
#> GSM241534 4 0.2861 0.883 0.000 0.016 0.024 0.884 NA
#> GSM241535 3 0.3615 0.830 0.000 0.000 0.808 0.036 NA
#> GSM241536 3 0.4237 0.772 0.028 0.000 0.752 0.008 NA
#> GSM241537 4 0.2949 0.880 0.000 0.012 0.036 0.880 NA
#> GSM241538 3 0.3577 0.818 0.000 0.000 0.808 0.032 NA
#> GSM241539 4 0.2949 0.880 0.000 0.012 0.036 0.880 NA
#> GSM241540 3 0.2907 0.853 0.016 0.000 0.876 0.016 NA
#> GSM241541 4 0.2674 0.885 0.000 0.012 0.032 0.896 NA
#> GSM241542 3 0.4065 0.796 0.000 0.000 0.772 0.048 NA
#> GSM241543 4 0.3357 0.870 0.000 0.016 0.012 0.836 NA
#> GSM241544 3 0.3584 0.873 0.056 0.000 0.832 0.004 NA
#> GSM241545 4 0.3357 0.870 0.000 0.016 0.012 0.836 NA
#> GSM241546 3 0.3715 0.874 0.064 0.000 0.824 0.004 NA
#> GSM241547 4 0.2507 0.890 0.000 0.016 0.012 0.900 NA
#> GSM241548 3 0.4730 0.807 0.000 0.000 0.688 0.052 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241452 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241453 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241454 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241455 2 0.0146 0.8449 0.000 0.996 0.000 0.000 0.004 NA
#> GSM241456 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241457 2 0.5184 0.6514 0.000 0.584 0.000 0.000 0.120 NA
#> GSM241458 1 0.3860 0.6280 0.528 0.000 0.000 0.000 0.000 NA
#> GSM241459 2 0.5137 0.6593 0.000 0.596 0.000 0.000 0.120 NA
#> GSM241460 1 0.0520 0.8198 0.984 0.000 0.000 0.000 0.008 NA
#> GSM241461 2 0.5463 0.6149 0.000 0.540 0.000 0.000 0.148 NA
#> GSM241462 1 0.4214 0.6273 0.528 0.000 0.004 0.000 0.008 NA
#> GSM241463 2 0.0146 0.8449 0.000 0.996 0.000 0.000 0.004 NA
#> GSM241464 1 0.2479 0.7477 0.892 0.000 0.000 0.064 0.028 NA
#> GSM241465 2 0.0405 0.8433 0.000 0.988 0.000 0.000 0.008 NA
#> GSM241466 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241467 1 0.0146 0.8222 0.996 0.000 0.000 0.000 0.004 NA
#> GSM241468 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241469 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241470 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241471 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241472 1 0.0146 0.8222 0.996 0.000 0.000 0.000 0.004 NA
#> GSM241473 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241474 1 0.0260 0.8213 0.992 0.000 0.000 0.000 0.008 NA
#> GSM241475 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241476 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241477 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241478 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241479 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241480 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241481 2 0.5137 0.6593 0.000 0.596 0.000 0.000 0.120 NA
#> GSM241482 1 0.3860 0.6280 0.528 0.000 0.000 0.000 0.000 NA
#> GSM241483 2 0.5219 0.6485 0.000 0.580 0.000 0.000 0.124 NA
#> GSM241484 1 0.3860 0.6280 0.528 0.000 0.000 0.000 0.000 NA
#> GSM241485 1 0.4214 0.6273 0.528 0.000 0.004 0.000 0.008 NA
#> GSM241486 2 0.5463 0.6149 0.000 0.540 0.000 0.000 0.148 NA
#> GSM241487 2 0.0405 0.8433 0.000 0.988 0.000 0.000 0.008 NA
#> GSM241488 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241489 1 0.0405 0.8198 0.988 0.000 0.000 0.000 0.008 NA
#> GSM241490 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241491 2 0.0146 0.8449 0.000 0.996 0.000 0.000 0.004 NA
#> GSM241492 1 0.0914 0.8101 0.968 0.000 0.000 0.000 0.016 NA
#> GSM241493 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241494 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241495 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241496 2 0.0000 0.8456 0.000 1.000 0.000 0.000 0.000 NA
#> GSM241497 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241498 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241499 1 0.3860 0.6280 0.528 0.000 0.000 0.000 0.000 NA
#> GSM241500 2 0.6749 0.5037 0.000 0.456 0.084 0.000 0.144 NA
#> GSM241501 2 0.5428 0.6143 0.000 0.540 0.000 0.000 0.140 NA
#> GSM241502 2 0.5222 0.6513 0.000 0.584 0.000 0.000 0.128 NA
#> GSM241503 1 0.3860 0.6280 0.528 0.000 0.000 0.000 0.000 NA
#> GSM241504 1 0.3860 0.6280 0.528 0.000 0.000 0.000 0.000 NA
#> GSM241505 1 0.3860 0.6280 0.528 0.000 0.000 0.000 0.000 NA
#> GSM241506 2 0.0405 0.8427 0.000 0.988 0.000 0.000 0.004 NA
#> GSM241507 1 0.3864 0.6210 0.520 0.000 0.000 0.000 0.000 NA
#> GSM241508 3 0.6413 0.4514 0.000 0.056 0.492 0.000 0.140 NA
#> GSM241509 3 0.2249 0.7785 0.000 0.004 0.900 0.000 0.032 NA
#> GSM241510 3 0.2173 0.7811 0.000 0.004 0.904 0.000 0.028 NA
#> GSM241511 4 0.3055 0.7657 0.000 0.000 0.000 0.840 0.064 NA
#> GSM241512 4 0.2146 0.7864 0.008 0.000 0.000 0.908 0.060 NA
#> GSM241513 3 0.4242 0.7503 0.000 0.004 0.572 0.000 0.412 NA
#> GSM241514 4 0.3852 0.7944 0.008 0.000 0.000 0.788 0.116 NA
#> GSM241515 3 0.5785 0.6419 0.000 0.124 0.448 0.000 0.416 NA
#> GSM241516 4 0.3852 0.7944 0.008 0.000 0.000 0.788 0.116 NA
#> GSM241517 3 0.3265 0.8055 0.000 0.004 0.748 0.000 0.248 NA
#> GSM241518 4 0.5284 0.7411 0.000 0.000 0.008 0.600 0.280 NA
#> GSM241519 3 0.3265 0.8055 0.000 0.004 0.748 0.000 0.248 NA
#> GSM241520 4 0.4522 0.7782 0.008 0.000 0.000 0.720 0.168 NA
#> GSM241521 2 0.2809 0.7171 0.000 0.824 0.004 0.000 0.168 NA
#> GSM241522 1 0.0000 0.8229 1.000 0.000 0.000 0.000 0.000 NA
#> GSM241523 2 0.5965 0.1500 0.000 0.500 0.176 0.000 0.312 NA
#> GSM241524 4 0.3947 0.7926 0.008 0.000 0.000 0.780 0.116 NA
#> GSM241525 1 0.5178 0.0571 0.508 0.000 0.000 0.424 0.052 NA
#> GSM241526 3 0.2191 0.8101 0.000 0.004 0.876 0.000 0.120 NA
#> GSM241527 4 0.2146 0.7864 0.008 0.000 0.000 0.908 0.060 NA
#> GSM241528 3 0.3533 0.8022 0.000 0.004 0.748 0.000 0.236 NA
#> GSM241529 3 0.3533 0.8022 0.000 0.004 0.748 0.000 0.236 NA
#> GSM241530 4 0.2146 0.7864 0.008 0.000 0.000 0.908 0.060 NA
#> GSM241531 4 0.3509 0.7585 0.000 0.000 0.000 0.804 0.084 NA
#> GSM241532 3 0.1623 0.7813 0.000 0.004 0.940 0.004 0.020 NA
#> GSM241533 3 0.1647 0.7813 0.000 0.004 0.940 0.008 0.016 NA
#> GSM241534 3 0.1647 0.7813 0.000 0.004 0.940 0.008 0.016 NA
#> GSM241535 4 0.4443 0.7231 0.000 0.000 0.000 0.664 0.276 NA
#> GSM241536 4 0.4586 0.6876 0.000 0.000 0.004 0.692 0.088 NA
#> GSM241537 3 0.3265 0.7639 0.000 0.004 0.824 0.008 0.140 NA
#> GSM241538 4 0.4515 0.6831 0.000 0.000 0.000 0.640 0.304 NA
#> GSM241539 3 0.3265 0.7639 0.000 0.004 0.824 0.008 0.140 NA
#> GSM241540 4 0.3488 0.7568 0.000 0.000 0.000 0.780 0.184 NA
#> GSM241541 3 0.2841 0.7790 0.000 0.004 0.860 0.008 0.108 NA
#> GSM241542 4 0.5126 0.6250 0.000 0.000 0.016 0.564 0.364 NA
#> GSM241543 3 0.4165 0.7496 0.000 0.004 0.568 0.000 0.420 NA
#> GSM241544 4 0.3936 0.7934 0.008 0.000 0.000 0.780 0.124 NA
#> GSM241545 3 0.4256 0.7484 0.000 0.004 0.564 0.000 0.420 NA
#> GSM241546 4 0.3894 0.7943 0.008 0.000 0.000 0.784 0.120 NA
#> GSM241547 3 0.3547 0.7968 0.000 0.004 0.696 0.000 0.300 NA
#> GSM241548 4 0.5405 0.7213 0.000 0.000 0.008 0.552 0.336 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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> ATC:kmeans 97 5.96e-01 0.899 2
#> ATC:kmeans 95 1.44e-08 0.571 3
#> ATC:kmeans 98 7.21e-11 0.691 4
#> ATC:kmeans 97 1.79e-11 0.743 5
#> ATC:kmeans 95 1.54e-11 0.789 6
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 16250 rows and 98 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 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.978 0.990 0.5047 0.495 0.495
#> 3 3 1.000 0.971 0.988 0.2961 0.817 0.643
#> 4 4 1.000 0.979 0.991 0.1386 0.870 0.645
#> 5 5 0.930 0.804 0.909 0.0378 0.991 0.963
#> 6 6 0.906 0.910 0.922 0.0407 0.942 0.768
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
#> GSM241451 2 0.000 0.995 0.000 1.000
#> GSM241452 1 0.000 0.984 1.000 0.000
#> GSM241453 2 0.000 0.995 0.000 1.000
#> GSM241454 1 0.000 0.984 1.000 0.000
#> GSM241455 2 0.000 0.995 0.000 1.000
#> GSM241456 1 0.000 0.984 1.000 0.000
#> GSM241457 2 0.000 0.995 0.000 1.000
#> GSM241458 1 0.000 0.984 1.000 0.000
#> GSM241459 2 0.000 0.995 0.000 1.000
#> GSM241460 1 0.000 0.984 1.000 0.000
#> GSM241461 2 0.000 0.995 0.000 1.000
#> GSM241462 1 0.000 0.984 1.000 0.000
#> GSM241463 2 0.000 0.995 0.000 1.000
#> GSM241464 1 0.000 0.984 1.000 0.000
#> GSM241465 2 0.000 0.995 0.000 1.000
#> GSM241466 1 0.000 0.984 1.000 0.000
#> GSM241467 1 0.000 0.984 1.000 0.000
#> GSM241468 2 0.000 0.995 0.000 1.000
#> GSM241469 1 0.000 0.984 1.000 0.000
#> GSM241470 2 0.000 0.995 0.000 1.000
#> GSM241471 2 0.000 0.995 0.000 1.000
#> GSM241472 1 0.000 0.984 1.000 0.000
#> GSM241473 2 0.000 0.995 0.000 1.000
#> GSM241474 1 0.000 0.984 1.000 0.000
#> GSM241475 2 0.000 0.995 0.000 1.000
#> GSM241476 1 0.000 0.984 1.000 0.000
#> GSM241477 2 0.000 0.995 0.000 1.000
#> GSM241478 2 0.000 0.995 0.000 1.000
#> GSM241479 1 0.000 0.984 1.000 0.000
#> GSM241480 1 0.000 0.984 1.000 0.000
#> GSM241481 2 0.000 0.995 0.000 1.000
#> GSM241482 1 0.000 0.984 1.000 0.000
#> GSM241483 2 0.000 0.995 0.000 1.000
#> GSM241484 1 0.000 0.984 1.000 0.000
#> GSM241485 1 0.000 0.984 1.000 0.000
#> GSM241486 2 0.000 0.995 0.000 1.000
#> GSM241487 2 0.000 0.995 0.000 1.000
#> GSM241488 2 0.000 0.995 0.000 1.000
#> GSM241489 1 0.000 0.984 1.000 0.000
#> GSM241490 1 0.000 0.984 1.000 0.000
#> GSM241491 2 0.000 0.995 0.000 1.000
#> GSM241492 1 0.000 0.984 1.000 0.000
#> GSM241493 2 0.000 0.995 0.000 1.000
#> GSM241494 1 0.000 0.984 1.000 0.000
#> GSM241495 2 0.000 0.995 0.000 1.000
#> GSM241496 2 0.000 0.995 0.000 1.000
#> GSM241497 1 0.000 0.984 1.000 0.000
#> GSM241498 1 0.000 0.984 1.000 0.000
#> GSM241499 1 0.000 0.984 1.000 0.000
#> GSM241500 2 0.000 0.995 0.000 1.000
#> GSM241501 2 0.000 0.995 0.000 1.000
#> GSM241502 2 0.000 0.995 0.000 1.000
#> GSM241503 1 0.000 0.984 1.000 0.000
#> GSM241504 1 0.000 0.984 1.000 0.000
#> GSM241505 1 0.000 0.984 1.000 0.000
#> GSM241506 2 0.000 0.995 0.000 1.000
#> GSM241507 1 0.000 0.984 1.000 0.000
#> GSM241508 2 0.000 0.995 0.000 1.000
#> GSM241509 2 0.000 0.995 0.000 1.000
#> GSM241510 2 0.000 0.995 0.000 1.000
#> GSM241511 1 0.000 0.984 1.000 0.000
#> GSM241512 1 0.000 0.984 1.000 0.000
#> GSM241513 2 0.000 0.995 0.000 1.000
#> GSM241514 1 0.000 0.984 1.000 0.000
#> GSM241515 2 0.000 0.995 0.000 1.000
#> GSM241516 1 0.000 0.984 1.000 0.000
#> GSM241517 2 0.000 0.995 0.000 1.000
#> GSM241518 1 0.430 0.899 0.912 0.088
#> GSM241519 2 0.000 0.995 0.000 1.000
#> GSM241520 1 0.000 0.984 1.000 0.000
#> GSM241521 2 0.000 0.995 0.000 1.000
#> GSM241522 1 0.000 0.984 1.000 0.000
#> GSM241523 2 0.000 0.995 0.000 1.000
#> GSM241524 1 0.000 0.984 1.000 0.000
#> GSM241525 1 0.000 0.984 1.000 0.000
#> GSM241526 2 0.000 0.995 0.000 1.000
#> GSM241527 1 0.000 0.984 1.000 0.000
#> GSM241528 2 0.000 0.995 0.000 1.000
#> GSM241529 2 0.000 0.995 0.000 1.000
#> GSM241530 1 0.000 0.984 1.000 0.000
#> GSM241531 1 0.000 0.984 1.000 0.000
#> GSM241532 2 0.000 0.995 0.000 1.000
#> GSM241533 2 0.000 0.995 0.000 1.000
#> GSM241534 2 0.000 0.995 0.000 1.000
#> GSM241535 1 0.827 0.663 0.740 0.260
#> GSM241536 1 0.000 0.984 1.000 0.000
#> GSM241537 2 0.000 0.995 0.000 1.000
#> GSM241538 1 0.722 0.760 0.800 0.200
#> GSM241539 2 0.000 0.995 0.000 1.000
#> GSM241540 1 0.000 0.984 1.000 0.000
#> GSM241541 2 0.000 0.995 0.000 1.000
#> GSM241542 2 0.775 0.694 0.228 0.772
#> GSM241543 2 0.000 0.995 0.000 1.000
#> GSM241544 1 0.000 0.984 1.000 0.000
#> GSM241545 2 0.000 0.995 0.000 1.000
#> GSM241546 1 0.000 0.984 1.000 0.000
#> GSM241547 2 0.000 0.995 0.000 1.000
#> GSM241548 1 0.722 0.760 0.800 0.200
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241457 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241458 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241461 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241462 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241463 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241464 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241465 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241481 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241483 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241484 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241486 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241487 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241488 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241491 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241492 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241493 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241499 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241500 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241501 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241502 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241503 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241504 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241505 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241506 2 0.0000 0.991 0.000 1.000 0.000
#> GSM241507 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241508 3 0.6140 0.306 0.000 0.404 0.596
#> GSM241509 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241510 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241511 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241512 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241513 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241514 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241515 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241516 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241517 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241518 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241519 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241520 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241521 2 0.4931 0.688 0.000 0.768 0.232
#> GSM241522 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241523 3 0.0424 0.977 0.000 0.008 0.992
#> GSM241524 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241525 1 0.0000 0.990 1.000 0.000 0.000
#> GSM241526 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241527 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241528 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241529 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241530 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241531 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241532 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241533 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241534 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241535 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241536 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241537 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241540 1 0.6126 0.343 0.600 0.000 0.400
#> GSM241541 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241544 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241545 3 0.0000 0.980 0.000 0.000 1.000
#> GSM241546 1 0.0237 0.988 0.996 0.000 0.004
#> GSM241547 3 0.0237 0.980 0.000 0.004 0.996
#> GSM241548 3 0.0000 0.980 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241457 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241458 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241459 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241460 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241461 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241462 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241464 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241465 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241466 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241482 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241483 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241484 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241486 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241487 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241488 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241492 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.999 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241500 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241501 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241502 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241503 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241506 2 0.0188 0.997 0.000 0.996 0.000 0.004
#> GSM241507 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241508 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241509 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241510 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241511 3 0.0188 0.951 0.004 0.000 0.996 0.000
#> GSM241512 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM241513 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241514 3 0.0188 0.951 0.004 0.000 0.996 0.000
#> GSM241515 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241516 3 0.0188 0.951 0.004 0.000 0.996 0.000
#> GSM241517 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241518 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM241519 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241520 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM241521 4 0.0188 0.995 0.000 0.004 0.000 0.996
#> GSM241522 1 0.0000 0.996 1.000 0.000 0.000 0.000
#> GSM241523 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241524 3 0.4643 0.501 0.344 0.000 0.656 0.000
#> GSM241525 1 0.2345 0.882 0.900 0.000 0.100 0.000
#> GSM241526 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM241528 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241529 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241530 3 0.3569 0.760 0.196 0.000 0.804 0.000
#> GSM241531 3 0.0188 0.951 0.004 0.000 0.996 0.000
#> GSM241532 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241533 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241534 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241535 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM241536 3 0.0188 0.951 0.004 0.000 0.996 0.000
#> GSM241537 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM241539 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM241541 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241542 3 0.3569 0.746 0.000 0.000 0.804 0.196
#> GSM241543 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241544 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM241545 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241546 3 0.0188 0.951 0.004 0.000 0.996 0.000
#> GSM241547 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.951 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241452 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241454 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241456 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241457 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241458 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241459 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241460 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241461 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241462 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241463 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241464 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.4150 0.846 0.000 0.612 0.388 0.000 0.000
#> GSM241466 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241469 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241471 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241472 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241474 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241476 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241478 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241479 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241482 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241483 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241484 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241486 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241487 2 0.4150 0.846 0.000 0.612 0.388 0.000 0.000
#> GSM241488 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241489 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241492 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241494 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241496 2 0.4201 0.851 0.000 0.592 0.408 0.000 0.000
#> GSM241497 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241500 2 0.0404 0.699 0.000 0.988 0.012 0.000 0.000
#> GSM241501 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241502 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241503 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241506 2 0.0000 0.710 0.000 1.000 0.000 0.000 0.000
#> GSM241507 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241508 3 0.4201 0.478 0.000 0.408 0.592 0.000 0.000
#> GSM241509 3 0.5382 0.907 0.000 0.072 0.592 0.000 0.336
#> GSM241510 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241511 4 0.0000 0.587 0.000 0.000 0.000 1.000 0.000
#> GSM241512 4 0.0000 0.587 0.000 0.000 0.000 1.000 0.000
#> GSM241513 3 0.4210 0.973 0.000 0.000 0.588 0.000 0.412
#> GSM241514 4 0.4242 -0.491 0.000 0.000 0.000 0.572 0.428
#> GSM241515 3 0.4210 0.973 0.000 0.000 0.588 0.000 0.412
#> GSM241516 4 0.4242 -0.491 0.000 0.000 0.000 0.572 0.428
#> GSM241517 3 0.4210 0.973 0.000 0.000 0.588 0.000 0.412
#> GSM241518 5 0.4210 1.000 0.000 0.000 0.000 0.412 0.588
#> GSM241519 3 0.4210 0.973 0.000 0.000 0.588 0.000 0.412
#> GSM241520 5 0.4210 1.000 0.000 0.000 0.000 0.412 0.588
#> GSM241521 3 0.4201 0.970 0.000 0.000 0.592 0.000 0.408
#> GSM241522 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM241523 3 0.4210 0.973 0.000 0.000 0.588 0.000 0.412
#> GSM241524 4 0.5850 -0.447 0.096 0.000 0.000 0.476 0.428
#> GSM241525 1 0.2852 0.793 0.828 0.000 0.000 0.172 0.000
#> GSM241526 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241527 4 0.0000 0.587 0.000 0.000 0.000 1.000 0.000
#> GSM241528 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241529 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241530 4 0.0510 0.570 0.016 0.000 0.000 0.984 0.000
#> GSM241531 4 0.0000 0.587 0.000 0.000 0.000 1.000 0.000
#> GSM241532 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241533 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241534 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241535 4 0.2732 0.424 0.000 0.000 0.000 0.840 0.160
#> GSM241536 4 0.0000 0.587 0.000 0.000 0.000 1.000 0.000
#> GSM241537 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241538 4 0.2852 0.415 0.000 0.000 0.000 0.828 0.172
#> GSM241539 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241540 4 0.0404 0.579 0.000 0.000 0.000 0.988 0.012
#> GSM241541 3 0.4201 0.974 0.000 0.000 0.592 0.000 0.408
#> GSM241542 4 0.3988 0.349 0.000 0.000 0.036 0.768 0.196
#> GSM241543 3 0.4210 0.973 0.000 0.000 0.588 0.000 0.412
#> GSM241544 4 0.4242 -0.491 0.000 0.000 0.000 0.572 0.428
#> GSM241545 3 0.4210 0.973 0.000 0.000 0.588 0.000 0.412
#> GSM241546 4 0.4242 -0.491 0.000 0.000 0.000 0.572 0.428
#> GSM241547 3 0.4210 0.973 0.000 0.000 0.588 0.000 0.412
#> GSM241548 5 0.4210 1.000 0.000 0.000 0.000 0.412 0.588
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.968 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241454 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241456 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.2003 0.975 0.000 0.116 0.000 0.000 0.884 0.000
#> GSM241458 1 0.1644 0.946 0.932 0.000 0.000 0.000 0.028 0.040
#> GSM241459 5 0.2003 0.975 0.000 0.116 0.000 0.000 0.884 0.000
#> GSM241460 1 0.0260 0.966 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM241461 5 0.1957 0.977 0.000 0.112 0.000 0.000 0.888 0.000
#> GSM241462 1 0.1713 0.945 0.928 0.000 0.000 0.000 0.028 0.044
#> GSM241463 2 0.1075 0.931 0.000 0.952 0.000 0.000 0.048 0.000
#> GSM241464 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.2762 0.746 0.000 0.804 0.000 0.000 0.196 0.000
#> GSM241466 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.968 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241471 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241472 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241474 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.968 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241478 2 0.0000 0.968 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.2003 0.975 0.000 0.116 0.000 0.000 0.884 0.000
#> GSM241482 1 0.1257 0.954 0.952 0.000 0.000 0.000 0.028 0.020
#> GSM241483 5 0.1957 0.977 0.000 0.112 0.000 0.000 0.888 0.000
#> GSM241484 1 0.1644 0.946 0.932 0.000 0.000 0.000 0.028 0.040
#> GSM241485 1 0.1713 0.945 0.928 0.000 0.000 0.000 0.028 0.044
#> GSM241486 5 0.1957 0.977 0.000 0.112 0.000 0.000 0.888 0.000
#> GSM241487 2 0.2793 0.740 0.000 0.800 0.000 0.000 0.200 0.000
#> GSM241488 2 0.0000 0.968 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241492 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241494 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0146 0.969 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM241496 2 0.0000 0.968 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.1713 0.945 0.928 0.000 0.000 0.000 0.028 0.044
#> GSM241500 5 0.2070 0.969 0.000 0.100 0.000 0.008 0.892 0.000
#> GSM241501 5 0.1910 0.977 0.000 0.108 0.000 0.000 0.892 0.000
#> GSM241502 5 0.1910 0.977 0.000 0.108 0.000 0.000 0.892 0.000
#> GSM241503 1 0.1713 0.945 0.928 0.000 0.000 0.000 0.028 0.044
#> GSM241504 1 0.1713 0.945 0.928 0.000 0.000 0.000 0.028 0.044
#> GSM241505 1 0.1780 0.942 0.924 0.000 0.000 0.000 0.028 0.048
#> GSM241506 5 0.1910 0.977 0.000 0.108 0.000 0.000 0.892 0.000
#> GSM241507 1 0.1845 0.940 0.920 0.000 0.000 0.000 0.028 0.052
#> GSM241508 5 0.1957 0.816 0.000 0.000 0.000 0.112 0.888 0.000
#> GSM241509 4 0.2527 0.766 0.000 0.000 0.000 0.832 0.168 0.000
#> GSM241510 4 0.0260 0.921 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM241511 6 0.0632 0.815 0.000 0.000 0.000 0.000 0.024 0.976
#> GSM241512 6 0.0858 0.829 0.000 0.000 0.028 0.000 0.004 0.968
#> GSM241513 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241514 3 0.3515 0.832 0.000 0.000 0.676 0.000 0.000 0.324
#> GSM241515 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241516 3 0.3547 0.826 0.000 0.000 0.668 0.000 0.000 0.332
#> GSM241517 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241518 3 0.2605 0.745 0.000 0.000 0.864 0.000 0.028 0.108
#> GSM241519 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241520 3 0.2358 0.751 0.000 0.000 0.876 0.000 0.016 0.108
#> GSM241521 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241522 1 0.0260 0.966 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM241523 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241524 3 0.3969 0.818 0.020 0.000 0.668 0.000 0.000 0.312
#> GSM241525 1 0.4029 0.616 0.680 0.000 0.000 0.000 0.028 0.292
#> GSM241526 4 0.0260 0.921 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM241527 6 0.1075 0.817 0.000 0.000 0.048 0.000 0.000 0.952
#> GSM241528 4 0.0260 0.921 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM241529 4 0.0260 0.921 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM241530 6 0.0665 0.830 0.004 0.000 0.008 0.000 0.008 0.980
#> GSM241531 6 0.0405 0.830 0.000 0.000 0.004 0.000 0.008 0.988
#> GSM241532 4 0.0260 0.921 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM241533 4 0.0260 0.921 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM241534 4 0.0260 0.921 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM241535 6 0.3721 0.692 0.000 0.000 0.252 0.004 0.016 0.728
#> GSM241536 6 0.0260 0.828 0.000 0.000 0.000 0.000 0.008 0.992
#> GSM241537 4 0.0000 0.922 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241538 6 0.4079 0.650 0.000 0.000 0.288 0.000 0.032 0.680
#> GSM241539 4 0.0000 0.922 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241540 6 0.1951 0.795 0.000 0.000 0.076 0.000 0.016 0.908
#> GSM241541 4 0.0000 0.922 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241542 6 0.4994 0.608 0.000 0.000 0.288 0.040 0.036 0.636
#> GSM241543 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241544 3 0.3515 0.832 0.000 0.000 0.676 0.000 0.000 0.324
#> GSM241545 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241546 3 0.3531 0.830 0.000 0.000 0.672 0.000 0.000 0.328
#> GSM241547 4 0.2889 0.912 0.000 0.000 0.108 0.848 0.044 0.000
#> GSM241548 3 0.2605 0.745 0.000 0.000 0.864 0.000 0.028 0.108
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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> ATC:skmeans 98 9.89e-01 0.98856 2
#> ATC:skmeans 96 2.70e-08 0.50459 3
#> ATC:skmeans 98 2.56e-11 0.68525 4
#> ATC:skmeans 89 5.33e-09 0.41198 5
#> ATC:skmeans 98 3.11e-11 0.00168 6
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 16250 rows and 98 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.000 0.967 0.987 0.5022 0.500 0.500
#> 3 3 0.921 0.915 0.964 0.2889 0.852 0.704
#> 4 4 0.951 0.935 0.973 0.1425 0.879 0.670
#> 5 5 0.823 0.779 0.854 0.0613 0.926 0.726
#> 6 6 0.922 0.879 0.934 0.0482 0.924 0.671
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
#> GSM241451 2 0.0000 0.975 0.000 1.000
#> GSM241452 1 0.0000 1.000 1.000 0.000
#> GSM241453 2 0.0000 0.975 0.000 1.000
#> GSM241454 1 0.0000 1.000 1.000 0.000
#> GSM241455 2 0.0000 0.975 0.000 1.000
#> GSM241456 1 0.0000 1.000 1.000 0.000
#> GSM241457 2 0.0000 0.975 0.000 1.000
#> GSM241458 1 0.0000 1.000 1.000 0.000
#> GSM241459 2 0.0000 0.975 0.000 1.000
#> GSM241460 1 0.0000 1.000 1.000 0.000
#> GSM241461 2 0.0000 0.975 0.000 1.000
#> GSM241462 1 0.0000 1.000 1.000 0.000
#> GSM241463 2 0.0000 0.975 0.000 1.000
#> GSM241464 1 0.0000 1.000 1.000 0.000
#> GSM241465 2 0.0000 0.975 0.000 1.000
#> GSM241466 1 0.0000 1.000 1.000 0.000
#> GSM241467 1 0.0000 1.000 1.000 0.000
#> GSM241468 2 0.0000 0.975 0.000 1.000
#> GSM241469 1 0.0000 1.000 1.000 0.000
#> GSM241470 2 0.0000 0.975 0.000 1.000
#> GSM241471 2 0.0000 0.975 0.000 1.000
#> GSM241472 1 0.0000 1.000 1.000 0.000
#> GSM241473 2 0.0000 0.975 0.000 1.000
#> GSM241474 1 0.0000 1.000 1.000 0.000
#> GSM241475 2 0.0000 0.975 0.000 1.000
#> GSM241476 1 0.0000 1.000 1.000 0.000
#> GSM241477 2 0.0000 0.975 0.000 1.000
#> GSM241478 2 0.0000 0.975 0.000 1.000
#> GSM241479 1 0.0000 1.000 1.000 0.000
#> GSM241480 1 0.0000 1.000 1.000 0.000
#> GSM241481 2 0.0000 0.975 0.000 1.000
#> GSM241482 1 0.0000 1.000 1.000 0.000
#> GSM241483 2 0.0000 0.975 0.000 1.000
#> GSM241484 1 0.0000 1.000 1.000 0.000
#> GSM241485 1 0.0000 1.000 1.000 0.000
#> GSM241486 2 0.0000 0.975 0.000 1.000
#> GSM241487 2 0.0000 0.975 0.000 1.000
#> GSM241488 2 0.0000 0.975 0.000 1.000
#> GSM241489 1 0.0000 1.000 1.000 0.000
#> GSM241490 1 0.0000 1.000 1.000 0.000
#> GSM241491 2 0.0000 0.975 0.000 1.000
#> GSM241492 1 0.0000 1.000 1.000 0.000
#> GSM241493 2 0.0000 0.975 0.000 1.000
#> GSM241494 1 0.0000 1.000 1.000 0.000
#> GSM241495 2 0.0000 0.975 0.000 1.000
#> GSM241496 2 0.0000 0.975 0.000 1.000
#> GSM241497 1 0.0000 1.000 1.000 0.000
#> GSM241498 1 0.0000 1.000 1.000 0.000
#> GSM241499 1 0.0000 1.000 1.000 0.000
#> GSM241500 2 0.0000 0.975 0.000 1.000
#> GSM241501 2 0.0000 0.975 0.000 1.000
#> GSM241502 2 0.0000 0.975 0.000 1.000
#> GSM241503 1 0.0000 1.000 1.000 0.000
#> GSM241504 1 0.0000 1.000 1.000 0.000
#> GSM241505 1 0.0000 1.000 1.000 0.000
#> GSM241506 2 0.0000 0.975 0.000 1.000
#> GSM241507 1 0.0000 1.000 1.000 0.000
#> GSM241508 2 0.0000 0.975 0.000 1.000
#> GSM241509 2 0.0000 0.975 0.000 1.000
#> GSM241510 2 0.0000 0.975 0.000 1.000
#> GSM241511 1 0.0000 1.000 1.000 0.000
#> GSM241512 1 0.0000 1.000 1.000 0.000
#> GSM241513 2 0.0000 0.975 0.000 1.000
#> GSM241514 1 0.0000 1.000 1.000 0.000
#> GSM241515 2 0.0000 0.975 0.000 1.000
#> GSM241516 1 0.0000 1.000 1.000 0.000
#> GSM241517 2 0.0000 0.975 0.000 1.000
#> GSM241518 2 0.9635 0.397 0.388 0.612
#> GSM241519 2 0.0000 0.975 0.000 1.000
#> GSM241520 1 0.0376 0.996 0.996 0.004
#> GSM241521 2 0.0000 0.975 0.000 1.000
#> GSM241522 1 0.0000 1.000 1.000 0.000
#> GSM241523 2 0.0000 0.975 0.000 1.000
#> GSM241524 1 0.0000 1.000 1.000 0.000
#> GSM241525 1 0.0000 1.000 1.000 0.000
#> GSM241526 2 0.0000 0.975 0.000 1.000
#> GSM241527 1 0.0000 1.000 1.000 0.000
#> GSM241528 2 0.0000 0.975 0.000 1.000
#> GSM241529 2 0.0000 0.975 0.000 1.000
#> GSM241530 1 0.0000 1.000 1.000 0.000
#> GSM241531 1 0.0000 1.000 1.000 0.000
#> GSM241532 2 0.0000 0.975 0.000 1.000
#> GSM241533 2 0.0000 0.975 0.000 1.000
#> GSM241534 2 0.0000 0.975 0.000 1.000
#> GSM241535 2 0.5946 0.823 0.144 0.856
#> GSM241536 1 0.0000 1.000 1.000 0.000
#> GSM241537 2 0.0000 0.975 0.000 1.000
#> GSM241538 2 0.9608 0.407 0.384 0.616
#> GSM241539 2 0.0000 0.975 0.000 1.000
#> GSM241540 1 0.0000 1.000 1.000 0.000
#> GSM241541 2 0.0000 0.975 0.000 1.000
#> GSM241542 2 0.0000 0.975 0.000 1.000
#> GSM241543 2 0.0000 0.975 0.000 1.000
#> GSM241544 1 0.0000 1.000 1.000 0.000
#> GSM241545 2 0.0000 0.975 0.000 1.000
#> GSM241546 1 0.0000 1.000 1.000 0.000
#> GSM241547 2 0.0000 0.975 0.000 1.000
#> GSM241548 2 0.9608 0.407 0.384 0.616
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241457 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241458 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241460 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241461 2 0.1753 0.8948 0.000 0.952 0.048
#> GSM241462 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241463 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241464 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241465 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241468 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241469 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241481 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241483 2 0.0237 0.9334 0.000 0.996 0.004
#> GSM241484 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241486 2 0.6168 0.2255 0.000 0.588 0.412
#> GSM241487 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241488 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241490 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241491 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241492 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241493 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241499 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241500 3 0.3412 0.8809 0.000 0.124 0.876
#> GSM241501 2 0.1964 0.8868 0.000 0.944 0.056
#> GSM241502 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241503 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241504 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241505 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241506 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241507 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241508 3 0.1753 0.9240 0.000 0.048 0.952
#> GSM241509 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241510 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241511 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241512 1 0.1964 0.9263 0.944 0.056 0.000
#> GSM241513 3 0.3482 0.8777 0.000 0.128 0.872
#> GSM241514 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241515 2 0.5591 0.5174 0.000 0.696 0.304
#> GSM241516 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241517 3 0.2356 0.9125 0.000 0.072 0.928
#> GSM241518 2 0.6305 0.0452 0.484 0.516 0.000
#> GSM241519 3 0.4842 0.7423 0.000 0.224 0.776
#> GSM241520 1 0.5529 0.5654 0.704 0.296 0.000
#> GSM241521 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241522 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241523 2 0.0000 0.9366 0.000 1.000 0.000
#> GSM241524 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241525 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241526 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241527 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241528 3 0.3482 0.8777 0.000 0.128 0.872
#> GSM241529 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241530 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241531 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241532 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241533 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241534 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241535 3 0.2711 0.8999 0.000 0.088 0.912
#> GSM241536 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241537 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241540 1 0.5254 0.6265 0.736 0.000 0.264
#> GSM241541 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241543 3 0.3482 0.8777 0.000 0.128 0.872
#> GSM241544 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241545 2 0.6026 0.3366 0.000 0.624 0.376
#> GSM241546 1 0.0000 0.9846 1.000 0.000 0.000
#> GSM241547 3 0.0000 0.9401 0.000 0.000 1.000
#> GSM241548 3 0.6678 0.7137 0.064 0.208 0.728
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241457 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241458 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241459 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241460 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241461 2 0.0817 0.940 0.00 0.976 0.000 0.024
#> GSM241462 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241463 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241464 1 0.2345 0.890 0.90 0.000 0.100 0.000
#> GSM241465 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241466 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241481 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241482 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241483 2 0.0188 0.957 0.00 0.996 0.000 0.004
#> GSM241484 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241485 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241486 2 0.4277 0.572 0.00 0.720 0.000 0.280
#> GSM241487 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241488 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241489 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241492 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241499 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241500 4 0.3610 0.782 0.00 0.200 0.000 0.800
#> GSM241501 2 0.0921 0.936 0.00 0.972 0.000 0.028
#> GSM241502 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241503 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241504 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241505 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241506 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241507 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241508 4 0.0336 0.920 0.00 0.008 0.000 0.992
#> GSM241509 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241510 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241511 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241512 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241513 4 0.3688 0.773 0.00 0.208 0.000 0.792
#> GSM241514 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241515 2 0.4643 0.433 0.00 0.656 0.000 0.344
#> GSM241516 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241517 4 0.0707 0.915 0.00 0.020 0.000 0.980
#> GSM241518 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241519 4 0.3764 0.731 0.00 0.216 0.000 0.784
#> GSM241520 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241521 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241522 1 0.0000 0.995 1.00 0.000 0.000 0.000
#> GSM241523 2 0.0000 0.960 0.00 1.000 0.000 0.000
#> GSM241524 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241525 1 0.1637 0.936 0.94 0.000 0.060 0.000
#> GSM241526 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241528 4 0.3688 0.773 0.00 0.208 0.000 0.792
#> GSM241529 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241530 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241531 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241532 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241533 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241534 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241535 3 0.0336 0.971 0.00 0.000 0.992 0.008
#> GSM241536 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241537 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241539 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241541 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241542 3 0.4776 0.410 0.00 0.000 0.624 0.376
#> GSM241543 4 0.3688 0.773 0.00 0.208 0.000 0.792
#> GSM241544 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241545 2 0.4817 0.307 0.00 0.612 0.000 0.388
#> GSM241546 3 0.0000 0.977 0.00 0.000 1.000 0.000
#> GSM241547 4 0.0000 0.923 0.00 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.977 0.00 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241457 2 0.4210 0.512 0.000 0.588 0.000 0.000 0.412
#> GSM241458 4 0.4291 0.627 0.464 0.000 0.000 0.536 0.000
#> GSM241459 2 0.3336 0.702 0.000 0.772 0.000 0.000 0.228
#> GSM241460 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241461 2 0.4227 0.500 0.000 0.580 0.000 0.000 0.420
#> GSM241462 4 0.4210 0.713 0.412 0.000 0.000 0.588 0.000
#> GSM241463 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241464 1 0.2020 0.809 0.900 0.000 0.100 0.000 0.000
#> GSM241465 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241481 2 0.4030 0.582 0.000 0.648 0.000 0.000 0.352
#> GSM241482 1 0.1341 0.908 0.944 0.000 0.000 0.056 0.000
#> GSM241483 2 0.4219 0.507 0.000 0.584 0.000 0.000 0.416
#> GSM241484 4 0.4210 0.713 0.412 0.000 0.000 0.588 0.000
#> GSM241485 4 0.4249 0.687 0.432 0.000 0.000 0.568 0.000
#> GSM241486 5 0.4306 -0.370 0.000 0.492 0.000 0.000 0.508
#> GSM241487 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241499 4 0.4210 0.713 0.412 0.000 0.000 0.588 0.000
#> GSM241500 5 0.0404 0.697 0.000 0.012 0.000 0.000 0.988
#> GSM241501 2 0.4227 0.500 0.000 0.580 0.000 0.000 0.420
#> GSM241502 2 0.4192 0.522 0.000 0.596 0.000 0.000 0.404
#> GSM241503 4 0.4210 0.713 0.412 0.000 0.000 0.588 0.000
#> GSM241504 4 0.4210 0.713 0.412 0.000 0.000 0.588 0.000
#> GSM241505 4 0.4210 0.713 0.412 0.000 0.000 0.588 0.000
#> GSM241506 2 0.0404 0.862 0.000 0.988 0.000 0.000 0.012
#> GSM241507 4 0.4210 0.713 0.412 0.000 0.000 0.588 0.000
#> GSM241508 5 0.0290 0.698 0.000 0.008 0.000 0.000 0.992
#> GSM241509 5 0.3424 0.752 0.000 0.000 0.000 0.240 0.760
#> GSM241510 5 0.3424 0.752 0.000 0.000 0.000 0.240 0.760
#> GSM241511 4 0.4287 0.168 0.000 0.000 0.460 0.540 0.000
#> GSM241512 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241513 5 0.4235 0.358 0.000 0.424 0.000 0.000 0.576
#> GSM241514 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241515 2 0.3966 0.332 0.000 0.664 0.000 0.000 0.336
#> GSM241516 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241517 5 0.3242 0.729 0.000 0.012 0.000 0.172 0.816
#> GSM241518 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241519 5 0.5752 0.520 0.000 0.208 0.000 0.172 0.620
#> GSM241520 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241521 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241522 1 0.0000 0.987 1.000 0.000 0.000 0.000 0.000
#> GSM241523 2 0.0000 0.869 0.000 1.000 0.000 0.000 0.000
#> GSM241524 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241525 4 0.4287 0.646 0.460 0.000 0.000 0.540 0.000
#> GSM241526 5 0.3983 0.762 0.000 0.000 0.000 0.340 0.660
#> GSM241527 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241528 5 0.0510 0.698 0.000 0.016 0.000 0.000 0.984
#> GSM241529 5 0.0000 0.699 0.000 0.000 0.000 0.000 1.000
#> GSM241530 4 0.4287 0.168 0.000 0.000 0.460 0.540 0.000
#> GSM241531 4 0.4287 0.168 0.000 0.000 0.460 0.540 0.000
#> GSM241532 5 0.4210 0.762 0.000 0.000 0.000 0.412 0.588
#> GSM241533 5 0.4210 0.762 0.000 0.000 0.000 0.412 0.588
#> GSM241534 5 0.4210 0.762 0.000 0.000 0.000 0.412 0.588
#> GSM241535 3 0.0290 0.967 0.000 0.000 0.992 0.000 0.008
#> GSM241536 4 0.4210 0.250 0.000 0.000 0.412 0.588 0.000
#> GSM241537 5 0.4210 0.762 0.000 0.000 0.000 0.412 0.588
#> GSM241538 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241539 5 0.4210 0.762 0.000 0.000 0.000 0.412 0.588
#> GSM241540 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241541 5 0.4210 0.762 0.000 0.000 0.000 0.412 0.588
#> GSM241542 3 0.4519 0.628 0.000 0.000 0.720 0.228 0.052
#> GSM241543 5 0.3966 0.487 0.000 0.336 0.000 0.000 0.664
#> GSM241544 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241545 2 0.3857 0.393 0.000 0.688 0.000 0.000 0.312
#> GSM241546 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
#> GSM241547 5 0.4210 0.762 0.000 0.000 0.000 0.412 0.588
#> GSM241548 3 0.0000 0.975 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.1327 0.872 0.000 0.064 0.000 0.000 0.936 0.000
#> GSM241458 6 0.1556 0.809 0.080 0.000 0.000 0.000 0.000 0.920
#> GSM241459 5 0.3288 0.681 0.000 0.276 0.000 0.000 0.724 0.000
#> GSM241460 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241461 5 0.1327 0.872 0.000 0.064 0.000 0.000 0.936 0.000
#> GSM241462 6 0.0713 0.842 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM241463 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241464 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241465 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241466 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.2092 0.839 0.000 0.124 0.000 0.000 0.876 0.000
#> GSM241482 1 0.3765 0.307 0.596 0.000 0.000 0.000 0.000 0.404
#> GSM241483 5 0.1327 0.872 0.000 0.064 0.000 0.000 0.936 0.000
#> GSM241484 6 0.0713 0.842 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM241485 6 0.1663 0.805 0.088 0.000 0.000 0.000 0.000 0.912
#> GSM241486 5 0.1327 0.872 0.000 0.064 0.000 0.000 0.936 0.000
#> GSM241487 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241488 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241490 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241491 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241492 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241493 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241499 6 0.0713 0.842 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM241500 5 0.1007 0.830 0.000 0.000 0.000 0.044 0.956 0.000
#> GSM241501 5 0.1327 0.872 0.000 0.064 0.000 0.000 0.936 0.000
#> GSM241502 5 0.1444 0.870 0.000 0.072 0.000 0.000 0.928 0.000
#> GSM241503 6 0.0713 0.842 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM241504 6 0.0790 0.840 0.032 0.000 0.000 0.000 0.000 0.968
#> GSM241505 6 0.0713 0.842 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM241506 2 0.3175 0.593 0.000 0.744 0.000 0.000 0.256 0.000
#> GSM241507 6 0.0713 0.842 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM241508 5 0.1007 0.830 0.000 0.000 0.000 0.044 0.956 0.000
#> GSM241509 4 0.2854 0.782 0.000 0.000 0.000 0.792 0.208 0.000
#> GSM241510 4 0.2854 0.782 0.000 0.000 0.000 0.792 0.208 0.000
#> GSM241511 6 0.3756 0.421 0.000 0.000 0.400 0.000 0.000 0.600
#> GSM241512 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241513 2 0.2318 0.886 0.000 0.904 0.000 0.048 0.020 0.028
#> GSM241514 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241515 2 0.2252 0.889 0.000 0.908 0.000 0.044 0.020 0.028
#> GSM241516 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241517 5 0.5288 0.633 0.000 0.096 0.000 0.232 0.644 0.028
#> GSM241518 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241519 5 0.5591 0.668 0.000 0.160 0.000 0.188 0.624 0.028
#> GSM241520 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241521 2 0.0000 0.966 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241522 1 0.0000 0.978 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241523 2 0.0713 0.948 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM241524 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241525 6 0.3756 0.376 0.400 0.000 0.000 0.000 0.000 0.600
#> GSM241526 4 0.1765 0.886 0.000 0.000 0.000 0.904 0.096 0.000
#> GSM241527 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241528 5 0.3610 0.791 0.000 0.100 0.000 0.052 0.820 0.028
#> GSM241529 5 0.3139 0.735 0.000 0.000 0.000 0.160 0.812 0.028
#> GSM241530 6 0.3756 0.421 0.000 0.000 0.400 0.000 0.000 0.600
#> GSM241531 6 0.3756 0.421 0.000 0.000 0.400 0.000 0.000 0.600
#> GSM241532 4 0.0547 0.921 0.000 0.000 0.000 0.980 0.020 0.000
#> GSM241533 4 0.0547 0.921 0.000 0.000 0.000 0.980 0.020 0.000
#> GSM241534 4 0.0547 0.921 0.000 0.000 0.000 0.980 0.020 0.000
#> GSM241535 3 0.2795 0.852 0.000 0.000 0.856 0.100 0.044 0.000
#> GSM241536 6 0.0713 0.822 0.000 0.000 0.028 0.000 0.000 0.972
#> GSM241537 4 0.1007 0.897 0.000 0.000 0.000 0.956 0.044 0.000
#> GSM241538 3 0.1549 0.925 0.000 0.000 0.936 0.020 0.044 0.000
#> GSM241539 4 0.1007 0.897 0.000 0.000 0.000 0.956 0.044 0.000
#> GSM241540 3 0.1007 0.936 0.000 0.000 0.956 0.000 0.044 0.000
#> GSM241541 4 0.0000 0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM241542 3 0.4173 0.601 0.000 0.000 0.688 0.268 0.044 0.000
#> GSM241543 2 0.4146 0.728 0.000 0.768 0.000 0.052 0.152 0.028
#> GSM241544 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241545 2 0.1332 0.933 0.000 0.952 0.000 0.012 0.008 0.028
#> GSM241546 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM241547 4 0.1074 0.910 0.000 0.000 0.000 0.960 0.012 0.028
#> GSM241548 3 0.0000 0.958 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> ATC:pam 95 7.61e-01 0.935256 2
#> ATC:pam 95 1.66e-07 0.773430 3
#> ATC:pam 95 1.70e-10 0.835206 4
#> ATC:pam 89 4.85e-10 0.052599 5
#> ATC:pam 93 1.39e-07 0.000184 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.667 0.900 0.943 0.4299 0.597 0.597
#> 3 3 0.812 0.900 0.955 0.4178 0.783 0.639
#> 4 4 0.709 0.822 0.888 0.1608 0.904 0.759
#> 5 5 0.776 0.807 0.856 0.1044 0.870 0.606
#> 6 6 0.776 0.721 0.812 0.0468 0.935 0.719
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
#> GSM241451 2 0.000 0.915 0.000 1.000
#> GSM241452 1 0.000 0.997 1.000 0.000
#> GSM241453 2 0.000 0.915 0.000 1.000
#> GSM241454 1 0.000 0.997 1.000 0.000
#> GSM241455 2 0.000 0.915 0.000 1.000
#> GSM241456 1 0.000 0.997 1.000 0.000
#> GSM241457 2 0.000 0.915 0.000 1.000
#> GSM241458 1 0.000 0.997 1.000 0.000
#> GSM241459 2 0.000 0.915 0.000 1.000
#> GSM241460 1 0.000 0.997 1.000 0.000
#> GSM241461 2 0.000 0.915 0.000 1.000
#> GSM241462 2 0.998 0.298 0.476 0.524
#> GSM241463 2 0.000 0.915 0.000 1.000
#> GSM241464 2 0.788 0.776 0.236 0.764
#> GSM241465 2 0.000 0.915 0.000 1.000
#> GSM241466 1 0.000 0.997 1.000 0.000
#> GSM241467 1 0.000 0.997 1.000 0.000
#> GSM241468 2 0.000 0.915 0.000 1.000
#> GSM241469 1 0.000 0.997 1.000 0.000
#> GSM241470 2 0.000 0.915 0.000 1.000
#> GSM241471 2 0.000 0.915 0.000 1.000
#> GSM241472 1 0.000 0.997 1.000 0.000
#> GSM241473 2 0.000 0.915 0.000 1.000
#> GSM241474 1 0.000 0.997 1.000 0.000
#> GSM241475 2 0.000 0.915 0.000 1.000
#> GSM241476 1 0.000 0.997 1.000 0.000
#> GSM241477 2 0.000 0.915 0.000 1.000
#> GSM241478 2 0.000 0.915 0.000 1.000
#> GSM241479 1 0.000 0.997 1.000 0.000
#> GSM241480 1 0.000 0.997 1.000 0.000
#> GSM241481 2 0.000 0.915 0.000 1.000
#> GSM241482 1 0.000 0.997 1.000 0.000
#> GSM241483 2 0.000 0.915 0.000 1.000
#> GSM241484 1 0.000 0.997 1.000 0.000
#> GSM241485 1 0.000 0.997 1.000 0.000
#> GSM241486 2 0.000 0.915 0.000 1.000
#> GSM241487 2 0.000 0.915 0.000 1.000
#> GSM241488 2 0.000 0.915 0.000 1.000
#> GSM241489 1 0.358 0.915 0.932 0.068
#> GSM241490 1 0.000 0.997 1.000 0.000
#> GSM241491 2 0.000 0.915 0.000 1.000
#> GSM241492 2 0.866 0.708 0.288 0.712
#> GSM241493 2 0.000 0.915 0.000 1.000
#> GSM241494 1 0.000 0.997 1.000 0.000
#> GSM241495 2 0.000 0.915 0.000 1.000
#> GSM241496 2 0.000 0.915 0.000 1.000
#> GSM241497 1 0.000 0.997 1.000 0.000
#> GSM241498 1 0.000 0.997 1.000 0.000
#> GSM241499 1 0.000 0.997 1.000 0.000
#> GSM241500 2 0.000 0.915 0.000 1.000
#> GSM241501 2 0.000 0.915 0.000 1.000
#> GSM241502 2 0.000 0.915 0.000 1.000
#> GSM241503 1 0.000 0.997 1.000 0.000
#> GSM241504 1 0.000 0.997 1.000 0.000
#> GSM241505 1 0.000 0.997 1.000 0.000
#> GSM241506 2 0.000 0.915 0.000 1.000
#> GSM241507 1 0.000 0.997 1.000 0.000
#> GSM241508 2 0.000 0.915 0.000 1.000
#> GSM241509 2 0.000 0.915 0.000 1.000
#> GSM241510 2 0.000 0.915 0.000 1.000
#> GSM241511 2 0.788 0.776 0.236 0.764
#> GSM241512 2 0.788 0.776 0.236 0.764
#> GSM241513 2 0.000 0.915 0.000 1.000
#> GSM241514 2 0.788 0.776 0.236 0.764
#> GSM241515 2 0.000 0.915 0.000 1.000
#> GSM241516 2 0.788 0.776 0.236 0.764
#> GSM241517 2 0.000 0.915 0.000 1.000
#> GSM241518 2 0.788 0.776 0.236 0.764
#> GSM241519 2 0.000 0.915 0.000 1.000
#> GSM241520 2 0.788 0.776 0.236 0.764
#> GSM241521 2 0.000 0.915 0.000 1.000
#> GSM241522 1 0.000 0.997 1.000 0.000
#> GSM241523 2 0.000 0.915 0.000 1.000
#> GSM241524 2 0.788 0.776 0.236 0.764
#> GSM241525 2 0.788 0.776 0.236 0.764
#> GSM241526 2 0.000 0.915 0.000 1.000
#> GSM241527 2 0.788 0.776 0.236 0.764
#> GSM241528 2 0.000 0.915 0.000 1.000
#> GSM241529 2 0.000 0.915 0.000 1.000
#> GSM241530 2 0.788 0.776 0.236 0.764
#> GSM241531 2 0.788 0.776 0.236 0.764
#> GSM241532 2 0.000 0.915 0.000 1.000
#> GSM241533 2 0.000 0.915 0.000 1.000
#> GSM241534 2 0.000 0.915 0.000 1.000
#> GSM241535 2 0.788 0.776 0.236 0.764
#> GSM241536 2 0.788 0.776 0.236 0.764
#> GSM241537 2 0.000 0.915 0.000 1.000
#> GSM241538 2 0.788 0.776 0.236 0.764
#> GSM241539 2 0.000 0.915 0.000 1.000
#> GSM241540 2 0.788 0.776 0.236 0.764
#> GSM241541 2 0.000 0.915 0.000 1.000
#> GSM241542 2 0.788 0.776 0.236 0.764
#> GSM241543 2 0.000 0.915 0.000 1.000
#> GSM241544 2 0.788 0.776 0.236 0.764
#> GSM241545 2 0.000 0.915 0.000 1.000
#> GSM241546 2 0.788 0.776 0.236 0.764
#> GSM241547 2 0.000 0.915 0.000 1.000
#> GSM241548 2 0.788 0.776 0.236 0.764
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241452 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241453 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241454 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241455 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241456 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241457 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241458 1 0.0747 0.924 0.984 0.000 0.016
#> GSM241459 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241460 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241461 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241462 3 0.6168 0.321 0.412 0.000 0.588
#> GSM241463 2 0.5621 0.529 0.000 0.692 0.308
#> GSM241464 3 0.4452 0.767 0.192 0.000 0.808
#> GSM241465 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241466 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241467 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241468 2 0.2711 0.878 0.000 0.912 0.088
#> GSM241469 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241470 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241472 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241473 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241474 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241475 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241476 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241477 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241479 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241480 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241481 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241482 1 0.0747 0.924 0.984 0.000 0.016
#> GSM241483 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241484 1 0.0747 0.924 0.984 0.000 0.016
#> GSM241485 1 0.0747 0.924 0.984 0.000 0.016
#> GSM241486 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241487 2 0.3551 0.819 0.000 0.868 0.132
#> GSM241488 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241489 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241490 1 0.0747 0.924 0.984 0.000 0.016
#> GSM241491 2 0.1643 0.921 0.000 0.956 0.044
#> GSM241492 1 0.4555 0.705 0.800 0.000 0.200
#> GSM241493 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241494 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241495 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.956 0.000 1.000 0.000
#> GSM241497 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241498 1 0.0000 0.928 1.000 0.000 0.000
#> GSM241499 1 0.0747 0.924 0.984 0.000 0.016
#> GSM241500 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241501 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241502 3 0.4399 0.789 0.000 0.188 0.812
#> GSM241503 1 0.0747 0.924 0.984 0.000 0.016
#> GSM241504 1 0.5363 0.660 0.724 0.000 0.276
#> GSM241505 1 0.5431 0.650 0.716 0.000 0.284
#> GSM241506 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241507 1 0.5760 0.587 0.672 0.000 0.328
#> GSM241508 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241509 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241510 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241511 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241512 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241513 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241514 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241515 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241516 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241517 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241518 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241519 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241520 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241521 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241522 1 0.5431 0.650 0.716 0.000 0.284
#> GSM241523 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241524 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241525 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241526 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241527 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241528 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241529 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241530 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241531 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241532 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241533 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241534 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241535 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241536 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241537 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241538 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241539 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241540 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241541 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241542 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241543 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241544 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241545 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241546 3 0.0237 0.948 0.004 0.000 0.996
#> GSM241547 3 0.0000 0.950 0.000 0.000 1.000
#> GSM241548 3 0.0000 0.950 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241452 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241453 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241454 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241456 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241457 4 0.4105 0.933 0.000 0.156 0.032 0.812
#> GSM241458 1 0.0817 0.910 0.976 0.000 0.024 0.000
#> GSM241459 4 0.4105 0.933 0.000 0.156 0.032 0.812
#> GSM241460 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241461 4 0.4105 0.933 0.000 0.156 0.032 0.812
#> GSM241462 3 0.4761 0.413 0.372 0.000 0.628 0.000
#> GSM241463 2 0.5113 0.375 0.000 0.684 0.292 0.024
#> GSM241464 3 0.4941 0.290 0.436 0.000 0.564 0.000
#> GSM241465 2 0.0921 0.922 0.000 0.972 0.000 0.028
#> GSM241466 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241469 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241471 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241472 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241474 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241476 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241478 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241479 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241481 4 0.4105 0.933 0.000 0.156 0.032 0.812
#> GSM241482 1 0.0817 0.910 0.976 0.000 0.024 0.000
#> GSM241483 4 0.4105 0.933 0.000 0.156 0.032 0.812
#> GSM241484 1 0.0817 0.910 0.976 0.000 0.024 0.000
#> GSM241485 1 0.0817 0.910 0.976 0.000 0.024 0.000
#> GSM241486 4 0.4105 0.933 0.000 0.156 0.032 0.812
#> GSM241487 2 0.3528 0.673 0.000 0.808 0.000 0.192
#> GSM241488 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241489 1 0.0188 0.916 0.996 0.000 0.004 0.000
#> GSM241490 1 0.3024 0.810 0.852 0.000 0.148 0.000
#> GSM241491 2 0.0707 0.929 0.000 0.980 0.000 0.020
#> GSM241492 1 0.2814 0.809 0.868 0.000 0.132 0.000
#> GSM241493 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241494 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241496 2 0.0000 0.950 0.000 1.000 0.000 0.000
#> GSM241497 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.918 1.000 0.000 0.000 0.000
#> GSM241499 1 0.2921 0.819 0.860 0.000 0.140 0.000
#> GSM241500 4 0.3626 0.793 0.000 0.004 0.184 0.812
#> GSM241501 4 0.4105 0.933 0.000 0.156 0.032 0.812
#> GSM241502 4 0.3626 0.793 0.000 0.004 0.184 0.812
#> GSM241503 1 0.3024 0.811 0.852 0.000 0.148 0.000
#> GSM241504 1 0.4746 0.558 0.632 0.000 0.368 0.000
#> GSM241505 1 0.4746 0.558 0.632 0.000 0.368 0.000
#> GSM241506 3 0.3837 0.688 0.000 0.000 0.776 0.224
#> GSM241507 3 0.3266 0.695 0.168 0.000 0.832 0.000
#> GSM241508 3 0.4817 0.381 0.000 0.000 0.612 0.388
#> GSM241509 3 0.3764 0.697 0.000 0.000 0.784 0.216
#> GSM241510 3 0.3764 0.697 0.000 0.000 0.784 0.216
#> GSM241511 3 0.0000 0.819 0.000 0.000 1.000 0.000
#> GSM241512 3 0.0000 0.819 0.000 0.000 1.000 0.000
#> GSM241513 3 0.3837 0.796 0.000 0.000 0.776 0.224
#> GSM241514 3 0.3486 0.792 0.000 0.000 0.812 0.188
#> GSM241515 3 0.3837 0.796 0.000 0.000 0.776 0.224
#> GSM241516 3 0.0000 0.819 0.000 0.000 1.000 0.000
#> GSM241517 3 0.3837 0.796 0.000 0.000 0.776 0.224
#> GSM241518 3 0.3528 0.793 0.000 0.000 0.808 0.192
#> GSM241519 3 0.3837 0.796 0.000 0.000 0.776 0.224
#> GSM241520 3 0.3528 0.793 0.000 0.000 0.808 0.192
#> GSM241521 3 0.4277 0.773 0.000 0.000 0.720 0.280
#> GSM241522 1 0.4746 0.558 0.632 0.000 0.368 0.000
#> GSM241523 3 0.3837 0.796 0.000 0.000 0.776 0.224
#> GSM241524 3 0.3486 0.792 0.000 0.000 0.812 0.188
#> GSM241525 3 0.0000 0.819 0.000 0.000 1.000 0.000
#> GSM241526 3 0.3764 0.697 0.000 0.000 0.784 0.216
#> GSM241527 3 0.0000 0.819 0.000 0.000 1.000 0.000
#> GSM241528 3 0.3764 0.697 0.000 0.000 0.784 0.216
#> GSM241529 3 0.3764 0.697 0.000 0.000 0.784 0.216
#> GSM241530 3 0.0000 0.819 0.000 0.000 1.000 0.000
#> GSM241531 3 0.0000 0.819 0.000 0.000 1.000 0.000
#> GSM241532 3 0.3764 0.697 0.000 0.000 0.784 0.216
#> GSM241533 3 0.3764 0.697 0.000 0.000 0.784 0.216
#> GSM241534 3 0.3764 0.697 0.000 0.000 0.784 0.216
#> GSM241535 3 0.0188 0.819 0.000 0.000 0.996 0.004
#> GSM241536 3 0.0000 0.819 0.000 0.000 1.000 0.000
#> GSM241537 3 0.2149 0.794 0.000 0.000 0.912 0.088
#> GSM241538 3 0.0188 0.819 0.000 0.000 0.996 0.004
#> GSM241539 3 0.2149 0.794 0.000 0.000 0.912 0.088
#> GSM241540 3 0.0188 0.819 0.000 0.000 0.996 0.004
#> GSM241541 3 0.1118 0.814 0.000 0.000 0.964 0.036
#> GSM241542 3 0.0592 0.818 0.000 0.000 0.984 0.016
#> GSM241543 3 0.3837 0.796 0.000 0.000 0.776 0.224
#> GSM241544 3 0.3486 0.792 0.000 0.000 0.812 0.188
#> GSM241545 3 0.3837 0.796 0.000 0.000 0.776 0.224
#> GSM241546 3 0.3486 0.792 0.000 0.000 0.812 0.188
#> GSM241547 3 0.3837 0.796 0.000 0.000 0.776 0.224
#> GSM241548 3 0.3528 0.793 0.000 0.000 0.808 0.192
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241452 1 0.0510 0.910 0.984 0.000 0.000 0.016 0.000
#> GSM241453 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241454 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241455 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241456 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241457 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241458 1 0.2463 0.895 0.888 0.000 0.004 0.100 0.008
#> GSM241459 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241460 1 0.0404 0.911 0.988 0.000 0.000 0.012 0.000
#> GSM241461 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241462 1 0.3796 0.794 0.768 0.000 0.008 0.216 0.008
#> GSM241463 2 0.5290 0.651 0.000 0.732 0.140 0.080 0.048
#> GSM241464 1 0.4251 0.586 0.672 0.000 0.012 0.316 0.000
#> GSM241465 2 0.1942 0.902 0.000 0.920 0.012 0.000 0.068
#> GSM241466 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241467 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241469 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241470 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241472 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241473 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241476 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241477 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241479 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241480 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241481 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241482 1 0.2463 0.895 0.888 0.000 0.004 0.100 0.008
#> GSM241483 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241484 1 0.2463 0.895 0.888 0.000 0.004 0.100 0.008
#> GSM241485 1 0.2463 0.895 0.888 0.000 0.004 0.100 0.008
#> GSM241486 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241487 2 0.3242 0.774 0.000 0.816 0.012 0.000 0.172
#> GSM241488 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241489 1 0.1478 0.904 0.936 0.000 0.000 0.064 0.000
#> GSM241490 1 0.2280 0.883 0.880 0.000 0.000 0.120 0.000
#> GSM241491 2 0.1597 0.919 0.000 0.940 0.012 0.000 0.048
#> GSM241492 1 0.2583 0.867 0.864 0.000 0.004 0.132 0.000
#> GSM241493 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.962 0.000 1.000 0.000 0.000 0.000
#> GSM241497 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241498 1 0.0000 0.911 1.000 0.000 0.000 0.000 0.000
#> GSM241499 1 0.3044 0.875 0.840 0.000 0.004 0.148 0.008
#> GSM241500 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241501 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241502 5 0.0290 1.000 0.000 0.000 0.008 0.000 0.992
#> GSM241503 1 0.3044 0.875 0.840 0.000 0.004 0.148 0.008
#> GSM241504 1 0.3167 0.862 0.820 0.000 0.004 0.172 0.004
#> GSM241505 1 0.3289 0.860 0.816 0.000 0.004 0.172 0.008
#> GSM241506 3 0.5742 0.464 0.000 0.000 0.508 0.088 0.404
#> GSM241507 1 0.6584 0.320 0.512 0.000 0.200 0.280 0.008
#> GSM241508 3 0.5439 0.514 0.000 0.000 0.560 0.068 0.372
#> GSM241509 3 0.4411 0.703 0.000 0.000 0.764 0.116 0.120
#> GSM241510 3 0.4411 0.703 0.000 0.000 0.764 0.116 0.120
#> GSM241511 4 0.3177 0.792 0.000 0.000 0.208 0.792 0.000
#> GSM241512 4 0.3177 0.792 0.000 0.000 0.208 0.792 0.000
#> GSM241513 3 0.4096 0.644 0.000 0.000 0.760 0.200 0.040
#> GSM241514 4 0.0703 0.728 0.000 0.000 0.024 0.976 0.000
#> GSM241515 3 0.4339 0.653 0.000 0.000 0.652 0.336 0.012
#> GSM241516 4 0.3177 0.792 0.000 0.000 0.208 0.792 0.000
#> GSM241517 3 0.3109 0.642 0.000 0.000 0.800 0.200 0.000
#> GSM241518 4 0.3143 0.610 0.000 0.000 0.204 0.796 0.000
#> GSM241519 3 0.3109 0.642 0.000 0.000 0.800 0.200 0.000
#> GSM241520 4 0.3109 0.615 0.000 0.000 0.200 0.800 0.000
#> GSM241521 3 0.5804 0.649 0.000 0.000 0.576 0.304 0.120
#> GSM241522 1 0.3086 0.858 0.816 0.000 0.000 0.180 0.004
#> GSM241523 3 0.3690 0.644 0.000 0.000 0.780 0.200 0.020
#> GSM241524 4 0.1732 0.685 0.000 0.000 0.080 0.920 0.000
#> GSM241525 4 0.3421 0.786 0.008 0.000 0.204 0.788 0.000
#> GSM241526 3 0.4269 0.703 0.000 0.000 0.776 0.116 0.108
#> GSM241527 4 0.3274 0.792 0.000 0.000 0.220 0.780 0.000
#> GSM241528 3 0.4411 0.703 0.000 0.000 0.764 0.120 0.116
#> GSM241529 3 0.4411 0.703 0.000 0.000 0.764 0.116 0.120
#> GSM241530 4 0.3177 0.792 0.000 0.000 0.208 0.792 0.000
#> GSM241531 4 0.3534 0.785 0.000 0.000 0.256 0.744 0.000
#> GSM241532 3 0.3898 0.699 0.000 0.000 0.804 0.116 0.080
#> GSM241533 3 0.3898 0.699 0.000 0.000 0.804 0.116 0.080
#> GSM241534 3 0.3898 0.699 0.000 0.000 0.804 0.116 0.080
#> GSM241535 4 0.3857 0.746 0.000 0.000 0.312 0.688 0.000
#> GSM241536 4 0.3752 0.776 0.000 0.000 0.292 0.708 0.000
#> GSM241537 3 0.3535 0.661 0.000 0.000 0.808 0.164 0.028
#> GSM241538 4 0.3876 0.743 0.000 0.000 0.316 0.684 0.000
#> GSM241539 3 0.3535 0.661 0.000 0.000 0.808 0.164 0.028
#> GSM241540 4 0.3876 0.743 0.000 0.000 0.316 0.684 0.000
#> GSM241541 3 0.2930 0.650 0.000 0.000 0.832 0.164 0.004
#> GSM241542 3 0.4262 -0.185 0.000 0.000 0.560 0.440 0.000
#> GSM241543 3 0.4021 0.645 0.000 0.000 0.764 0.200 0.036
#> GSM241544 4 0.1792 0.684 0.000 0.000 0.084 0.916 0.000
#> GSM241545 3 0.4622 0.662 0.000 0.000 0.692 0.264 0.044
#> GSM241546 4 0.0510 0.725 0.000 0.000 0.016 0.984 0.000
#> GSM241547 3 0.3109 0.642 0.000 0.000 0.800 0.200 0.000
#> GSM241548 4 0.3143 0.610 0.000 0.000 0.204 0.796 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241452 1 0.1074 0.8138 0.960 0.000 0.012 0.000 0.000 0.028
#> GSM241453 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241454 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241455 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241456 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241457 5 0.0260 0.8988 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM241458 1 0.5142 0.7161 0.624 0.000 0.204 0.000 0.000 0.172
#> GSM241459 5 0.0260 0.8988 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM241460 1 0.0858 0.8151 0.968 0.000 0.028 0.000 0.000 0.004
#> GSM241461 5 0.0000 0.9010 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241462 1 0.5546 0.6746 0.576 0.000 0.192 0.004 0.000 0.228
#> GSM241463 2 0.4626 0.7017 0.000 0.736 0.156 0.064 0.044 0.000
#> GSM241464 1 0.5287 0.5131 0.588 0.000 0.120 0.004 0.000 0.288
#> GSM241465 2 0.3130 0.8470 0.000 0.852 0.072 0.016 0.060 0.000
#> GSM241466 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241467 1 0.0000 0.8155 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241468 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241469 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241470 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241471 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241472 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241473 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241474 1 0.0000 0.8155 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241475 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241476 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241477 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241478 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241479 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241480 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241481 5 0.0260 0.8988 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM241482 1 0.5142 0.7161 0.624 0.000 0.204 0.000 0.000 0.172
#> GSM241483 5 0.0146 0.9005 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM241484 1 0.5252 0.7059 0.608 0.000 0.204 0.000 0.000 0.188
#> GSM241485 1 0.5253 0.7044 0.608 0.000 0.192 0.000 0.000 0.200
#> GSM241486 5 0.0000 0.9010 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241487 2 0.4588 0.7009 0.000 0.728 0.092 0.020 0.160 0.000
#> GSM241488 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241489 1 0.4589 0.7186 0.696 0.000 0.132 0.000 0.000 0.172
#> GSM241490 1 0.2558 0.7709 0.840 0.000 0.004 0.000 0.000 0.156
#> GSM241491 2 0.1633 0.9115 0.000 0.932 0.024 0.000 0.044 0.000
#> GSM241492 1 0.4680 0.7079 0.684 0.000 0.132 0.000 0.000 0.184
#> GSM241493 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241494 1 0.0000 0.8155 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM241495 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241496 2 0.0000 0.9572 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM241497 1 0.0937 0.8128 0.960 0.000 0.000 0.000 0.000 0.040
#> GSM241498 1 0.0146 0.8152 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM241499 1 0.5328 0.6968 0.596 0.000 0.204 0.000 0.000 0.200
#> GSM241500 5 0.0146 0.8985 0.000 0.000 0.000 0.004 0.996 0.000
#> GSM241501 5 0.0000 0.9010 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241502 5 0.0000 0.9010 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM241503 1 0.5328 0.6968 0.596 0.000 0.204 0.000 0.000 0.200
#> GSM241504 1 0.5415 0.7075 0.620 0.000 0.164 0.012 0.000 0.204
#> GSM241505 1 0.5802 0.6541 0.556 0.000 0.196 0.012 0.000 0.236
#> GSM241506 5 0.3483 0.5516 0.000 0.000 0.016 0.236 0.748 0.000
#> GSM241507 6 0.5711 0.3714 0.160 0.000 0.196 0.032 0.000 0.612
#> GSM241508 5 0.5396 -0.0636 0.000 0.000 0.116 0.396 0.488 0.000
#> GSM241509 4 0.2482 0.6619 0.000 0.000 0.000 0.848 0.148 0.004
#> GSM241510 4 0.3232 0.6454 0.000 0.000 0.020 0.812 0.160 0.008
#> GSM241511 6 0.0865 0.7707 0.000 0.000 0.000 0.036 0.000 0.964
#> GSM241512 6 0.0865 0.7707 0.000 0.000 0.000 0.036 0.000 0.964
#> GSM241513 3 0.3390 0.7744 0.000 0.000 0.704 0.296 0.000 0.000
#> GSM241514 6 0.2994 0.6244 0.000 0.000 0.208 0.004 0.000 0.788
#> GSM241515 3 0.5096 0.6930 0.000 0.000 0.600 0.316 0.012 0.072
#> GSM241516 6 0.1995 0.7578 0.000 0.000 0.052 0.036 0.000 0.912
#> GSM241517 3 0.3390 0.7744 0.000 0.000 0.704 0.296 0.000 0.000
#> GSM241518 3 0.4285 0.3800 0.000 0.000 0.644 0.036 0.000 0.320
#> GSM241519 3 0.3390 0.7744 0.000 0.000 0.704 0.296 0.000 0.000
#> GSM241520 3 0.4249 0.3733 0.000 0.000 0.640 0.032 0.000 0.328
#> GSM241521 3 0.5602 0.7077 0.000 0.004 0.620 0.256 0.052 0.068
#> GSM241522 1 0.5481 0.5624 0.520 0.000 0.140 0.000 0.000 0.340
#> GSM241523 3 0.3390 0.7744 0.000 0.000 0.704 0.296 0.000 0.000
#> GSM241524 6 0.3872 0.3119 0.000 0.000 0.392 0.004 0.000 0.604
#> GSM241525 6 0.1944 0.7495 0.024 0.000 0.016 0.036 0.000 0.924
#> GSM241526 4 0.3743 0.6421 0.000 0.000 0.032 0.792 0.152 0.024
#> GSM241527 6 0.0865 0.7707 0.000 0.000 0.000 0.036 0.000 0.964
#> GSM241528 4 0.6639 -0.0662 0.000 0.000 0.316 0.464 0.152 0.068
#> GSM241529 4 0.5361 0.4521 0.000 0.000 0.156 0.660 0.152 0.032
#> GSM241530 6 0.0865 0.7707 0.000 0.000 0.000 0.036 0.000 0.964
#> GSM241531 6 0.0937 0.7698 0.000 0.000 0.000 0.040 0.000 0.960
#> GSM241532 4 0.0508 0.6983 0.000 0.000 0.000 0.984 0.012 0.004
#> GSM241533 4 0.0508 0.6983 0.000 0.000 0.000 0.984 0.012 0.004
#> GSM241534 4 0.0508 0.6983 0.000 0.000 0.000 0.984 0.012 0.004
#> GSM241535 6 0.4925 0.1354 0.000 0.000 0.064 0.424 0.000 0.512
#> GSM241536 6 0.2384 0.7459 0.000 0.000 0.048 0.064 0.000 0.888
#> GSM241537 4 0.2520 0.6749 0.000 0.000 0.004 0.844 0.000 0.152
#> GSM241538 4 0.4899 0.0447 0.000 0.000 0.064 0.532 0.000 0.404
#> GSM241539 4 0.2520 0.6749 0.000 0.000 0.004 0.844 0.000 0.152
#> GSM241540 6 0.4936 0.1059 0.000 0.000 0.064 0.436 0.000 0.500
#> GSM241541 4 0.2730 0.6709 0.000 0.000 0.012 0.836 0.000 0.152
#> GSM241542 4 0.4422 0.5034 0.000 0.000 0.068 0.680 0.000 0.252
#> GSM241543 3 0.3390 0.7744 0.000 0.000 0.704 0.296 0.000 0.000
#> GSM241544 6 0.3508 0.5014 0.000 0.000 0.292 0.004 0.000 0.704
#> GSM241545 3 0.3729 0.7644 0.000 0.000 0.692 0.296 0.012 0.000
#> GSM241546 6 0.2772 0.6616 0.000 0.000 0.180 0.004 0.000 0.816
#> GSM241547 3 0.3464 0.7624 0.000 0.000 0.688 0.312 0.000 0.000
#> GSM241548 3 0.4621 0.3995 0.000 0.000 0.632 0.064 0.000 0.304
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)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> ATC:mclust 97 1.02e-03 0.39038 2
#> ATC:mclust 97 1.28e-10 0.11443 3
#> ATC:mclust 94 9.40e-13 0.01335 4
#> ATC:mclust 95 1.32e-11 0.05667 5
#> ATC:mclust 87 7.28e-11 0.00111 6
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 16250 rows and 98 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.979 0.964 0.984 0.5038 0.497 0.497
#> 3 3 0.914 0.907 0.958 0.3020 0.801 0.617
#> 4 4 0.619 0.532 0.775 0.0834 0.968 0.911
#> 5 5 0.598 0.595 0.748 0.0690 0.848 0.574
#> 6 6 0.576 0.507 0.694 0.0455 0.930 0.723
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
#> GSM241451 2 0.0000 0.974 0.000 1.000
#> GSM241452 1 0.0000 0.994 1.000 0.000
#> GSM241453 2 0.0000 0.974 0.000 1.000
#> GSM241454 1 0.0000 0.994 1.000 0.000
#> GSM241455 2 0.0000 0.974 0.000 1.000
#> GSM241456 1 0.0000 0.994 1.000 0.000
#> GSM241457 2 0.0000 0.974 0.000 1.000
#> GSM241458 1 0.0000 0.994 1.000 0.000
#> GSM241459 2 0.0000 0.974 0.000 1.000
#> GSM241460 1 0.0000 0.994 1.000 0.000
#> GSM241461 2 0.0000 0.974 0.000 1.000
#> GSM241462 1 0.0000 0.994 1.000 0.000
#> GSM241463 2 0.0000 0.974 0.000 1.000
#> GSM241464 1 0.0000 0.994 1.000 0.000
#> GSM241465 2 0.0000 0.974 0.000 1.000
#> GSM241466 1 0.0000 0.994 1.000 0.000
#> GSM241467 1 0.0000 0.994 1.000 0.000
#> GSM241468 1 0.7602 0.703 0.780 0.220
#> GSM241469 1 0.0000 0.994 1.000 0.000
#> GSM241470 2 0.0000 0.974 0.000 1.000
#> GSM241471 2 0.0376 0.971 0.004 0.996
#> GSM241472 1 0.0000 0.994 1.000 0.000
#> GSM241473 2 0.3431 0.919 0.064 0.936
#> GSM241474 1 0.0000 0.994 1.000 0.000
#> GSM241475 2 0.0000 0.974 0.000 1.000
#> GSM241476 1 0.0000 0.994 1.000 0.000
#> GSM241477 2 0.0000 0.974 0.000 1.000
#> GSM241478 2 0.0000 0.974 0.000 1.000
#> GSM241479 1 0.0000 0.994 1.000 0.000
#> GSM241480 1 0.0000 0.994 1.000 0.000
#> GSM241481 2 0.0000 0.974 0.000 1.000
#> GSM241482 1 0.0000 0.994 1.000 0.000
#> GSM241483 2 0.0000 0.974 0.000 1.000
#> GSM241484 1 0.0000 0.994 1.000 0.000
#> GSM241485 1 0.0000 0.994 1.000 0.000
#> GSM241486 2 0.0000 0.974 0.000 1.000
#> GSM241487 2 0.0000 0.974 0.000 1.000
#> GSM241488 2 0.9209 0.526 0.336 0.664
#> GSM241489 1 0.0000 0.994 1.000 0.000
#> GSM241490 1 0.0000 0.994 1.000 0.000
#> GSM241491 2 0.0000 0.974 0.000 1.000
#> GSM241492 1 0.0000 0.994 1.000 0.000
#> GSM241493 2 0.2778 0.934 0.048 0.952
#> GSM241494 1 0.0000 0.994 1.000 0.000
#> GSM241495 2 0.0000 0.974 0.000 1.000
#> GSM241496 2 0.7376 0.753 0.208 0.792
#> GSM241497 1 0.0000 0.994 1.000 0.000
#> GSM241498 1 0.0000 0.994 1.000 0.000
#> GSM241499 1 0.0000 0.994 1.000 0.000
#> GSM241500 2 0.0000 0.974 0.000 1.000
#> GSM241501 2 0.0000 0.974 0.000 1.000
#> GSM241502 2 0.0000 0.974 0.000 1.000
#> GSM241503 1 0.0000 0.994 1.000 0.000
#> GSM241504 1 0.0000 0.994 1.000 0.000
#> GSM241505 1 0.0000 0.994 1.000 0.000
#> GSM241506 2 0.0000 0.974 0.000 1.000
#> GSM241507 1 0.0000 0.994 1.000 0.000
#> GSM241508 2 0.0000 0.974 0.000 1.000
#> GSM241509 2 0.0000 0.974 0.000 1.000
#> GSM241510 2 0.0000 0.974 0.000 1.000
#> GSM241511 1 0.0000 0.994 1.000 0.000
#> GSM241512 1 0.0000 0.994 1.000 0.000
#> GSM241513 2 0.0000 0.974 0.000 1.000
#> GSM241514 1 0.0000 0.994 1.000 0.000
#> GSM241515 2 0.0000 0.974 0.000 1.000
#> GSM241516 1 0.0000 0.994 1.000 0.000
#> GSM241517 2 0.0000 0.974 0.000 1.000
#> GSM241518 1 0.2423 0.953 0.960 0.040
#> GSM241519 2 0.0000 0.974 0.000 1.000
#> GSM241520 1 0.0000 0.994 1.000 0.000
#> GSM241521 2 0.0000 0.974 0.000 1.000
#> GSM241522 1 0.0000 0.994 1.000 0.000
#> GSM241523 2 0.0000 0.974 0.000 1.000
#> GSM241524 1 0.0000 0.994 1.000 0.000
#> GSM241525 1 0.0000 0.994 1.000 0.000
#> GSM241526 2 0.0000 0.974 0.000 1.000
#> GSM241527 1 0.0000 0.994 1.000 0.000
#> GSM241528 2 0.0000 0.974 0.000 1.000
#> GSM241529 2 0.0000 0.974 0.000 1.000
#> GSM241530 1 0.0000 0.994 1.000 0.000
#> GSM241531 1 0.0000 0.994 1.000 0.000
#> GSM241532 2 0.0000 0.974 0.000 1.000
#> GSM241533 2 0.0000 0.974 0.000 1.000
#> GSM241534 2 0.0000 0.974 0.000 1.000
#> GSM241535 2 0.7883 0.711 0.236 0.764
#> GSM241536 1 0.0000 0.994 1.000 0.000
#> GSM241537 2 0.0000 0.974 0.000 1.000
#> GSM241538 2 0.5737 0.844 0.136 0.864
#> GSM241539 2 0.0000 0.974 0.000 1.000
#> GSM241540 1 0.0000 0.994 1.000 0.000
#> GSM241541 2 0.0000 0.974 0.000 1.000
#> GSM241542 2 0.0000 0.974 0.000 1.000
#> GSM241543 2 0.0000 0.974 0.000 1.000
#> GSM241544 1 0.0000 0.994 1.000 0.000
#> GSM241545 2 0.0000 0.974 0.000 1.000
#> GSM241546 1 0.0000 0.994 1.000 0.000
#> GSM241547 2 0.0000 0.974 0.000 1.000
#> GSM241548 2 0.8713 0.616 0.292 0.708
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM241451 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241452 1 0.0237 0.9706 0.996 0.004 0.000
#> GSM241453 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241454 1 0.0237 0.9706 0.996 0.004 0.000
#> GSM241455 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241456 1 0.0592 0.9672 0.988 0.012 0.000
#> GSM241457 2 0.0237 0.9630 0.000 0.996 0.004
#> GSM241458 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241459 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241460 1 0.0237 0.9706 0.996 0.004 0.000
#> GSM241461 2 0.0592 0.9615 0.000 0.988 0.012
#> GSM241462 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241463 2 0.0892 0.9594 0.000 0.980 0.020
#> GSM241464 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241465 2 0.0892 0.9594 0.000 0.980 0.020
#> GSM241466 1 0.0237 0.9706 0.996 0.004 0.000
#> GSM241467 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241468 2 0.0237 0.9602 0.004 0.996 0.000
#> GSM241469 1 0.0592 0.9672 0.988 0.012 0.000
#> GSM241470 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241471 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241472 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241473 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241474 1 0.0592 0.9672 0.988 0.012 0.000
#> GSM241475 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241476 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241477 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241478 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241479 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241480 1 0.0237 0.9706 0.996 0.004 0.000
#> GSM241481 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241482 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241483 2 0.0747 0.9606 0.000 0.984 0.016
#> GSM241484 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241485 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241486 2 0.0747 0.9606 0.000 0.984 0.016
#> GSM241487 2 0.0892 0.9594 0.000 0.980 0.020
#> GSM241488 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241489 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241490 1 0.0237 0.9706 0.996 0.004 0.000
#> GSM241491 2 0.0237 0.9630 0.000 0.996 0.004
#> GSM241492 1 0.0592 0.9672 0.988 0.012 0.000
#> GSM241493 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241494 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241495 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241496 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM241497 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241498 1 0.0424 0.9697 0.992 0.008 0.000
#> GSM241499 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241500 2 0.0892 0.9594 0.000 0.980 0.020
#> GSM241501 2 0.0892 0.9594 0.000 0.980 0.020
#> GSM241502 2 0.0892 0.9594 0.000 0.980 0.020
#> GSM241503 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241504 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241505 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241506 2 0.0424 0.9625 0.000 0.992 0.008
#> GSM241507 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241508 2 0.1753 0.9405 0.000 0.952 0.048
#> GSM241509 2 0.3192 0.8805 0.000 0.888 0.112
#> GSM241510 3 0.4842 0.6647 0.000 0.224 0.776
#> GSM241511 1 0.0237 0.9688 0.996 0.000 0.004
#> GSM241512 1 0.4974 0.6800 0.764 0.000 0.236
#> GSM241513 3 0.0424 0.9088 0.000 0.008 0.992
#> GSM241514 1 0.3879 0.8087 0.848 0.000 0.152
#> GSM241515 3 0.0000 0.9098 0.000 0.000 1.000
#> GSM241516 1 0.1031 0.9544 0.976 0.000 0.024
#> GSM241517 3 0.6260 0.0969 0.000 0.448 0.552
#> GSM241518 3 0.2796 0.8567 0.092 0.000 0.908
#> GSM241519 2 0.6026 0.4405 0.000 0.624 0.376
#> GSM241520 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241521 2 0.1753 0.9405 0.000 0.952 0.048
#> GSM241522 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241523 2 0.4504 0.7796 0.000 0.804 0.196
#> GSM241524 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241525 1 0.0000 0.9705 1.000 0.000 0.000
#> GSM241526 3 0.0424 0.9088 0.000 0.008 0.992
#> GSM241527 3 0.4796 0.7082 0.220 0.000 0.780
#> GSM241528 2 0.4974 0.7205 0.000 0.764 0.236
#> GSM241529 3 0.1411 0.8919 0.000 0.036 0.964
#> GSM241530 1 0.1411 0.9434 0.964 0.000 0.036
#> GSM241531 1 0.6305 0.0208 0.516 0.000 0.484
#> GSM241532 3 0.1860 0.8790 0.000 0.052 0.948
#> GSM241533 3 0.0237 0.9099 0.000 0.004 0.996
#> GSM241534 3 0.0592 0.9071 0.000 0.012 0.988
#> GSM241535 3 0.1289 0.8993 0.032 0.000 0.968
#> GSM241536 1 0.0747 0.9613 0.984 0.000 0.016
#> GSM241537 3 0.0000 0.9098 0.000 0.000 1.000
#> GSM241538 3 0.1031 0.9030 0.024 0.000 0.976
#> GSM241539 3 0.0000 0.9098 0.000 0.000 1.000
#> GSM241540 3 0.4555 0.7364 0.200 0.000 0.800
#> GSM241541 3 0.0237 0.9099 0.000 0.004 0.996
#> GSM241542 3 0.0592 0.9070 0.012 0.000 0.988
#> GSM241543 3 0.0237 0.9099 0.000 0.004 0.996
#> GSM241544 3 0.5926 0.4475 0.356 0.000 0.644
#> GSM241545 3 0.0000 0.9098 0.000 0.000 1.000
#> GSM241546 1 0.0747 0.9609 0.984 0.000 0.016
#> GSM241547 3 0.0237 0.9099 0.000 0.004 0.996
#> GSM241548 3 0.1163 0.9014 0.028 0.000 0.972
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM241451 2 0.0921 0.6371 0.000 0.972 0.000 0.028
#> GSM241452 1 0.0895 0.8780 0.976 0.004 0.000 0.020
#> GSM241453 2 0.2831 0.6168 0.000 0.876 0.004 0.120
#> GSM241454 1 0.1389 0.8787 0.952 0.000 0.000 0.048
#> GSM241455 2 0.1082 0.6267 0.004 0.972 0.004 0.020
#> GSM241456 1 0.2530 0.8605 0.896 0.004 0.000 0.100
#> GSM241457 2 0.4889 0.4066 0.000 0.636 0.004 0.360
#> GSM241458 1 0.0817 0.8764 0.976 0.000 0.000 0.024
#> GSM241459 2 0.4817 0.3709 0.000 0.612 0.000 0.388
#> GSM241460 1 0.1389 0.8806 0.952 0.000 0.000 0.048
#> GSM241461 2 0.5040 0.4027 0.000 0.628 0.008 0.364
#> GSM241462 1 0.1867 0.8654 0.928 0.000 0.000 0.072
#> GSM241463 2 0.2197 0.5876 0.000 0.916 0.004 0.080
#> GSM241464 1 0.4055 0.7912 0.832 0.060 0.000 0.108
#> GSM241465 2 0.2412 0.5604 0.000 0.908 0.008 0.084
#> GSM241466 1 0.1902 0.8744 0.932 0.000 0.004 0.064
#> GSM241467 1 0.1489 0.8780 0.952 0.004 0.000 0.044
#> GSM241468 2 0.5036 0.5089 0.024 0.696 0.000 0.280
#> GSM241469 1 0.2675 0.8615 0.892 0.008 0.000 0.100
#> GSM241470 2 0.2281 0.6298 0.000 0.904 0.000 0.096
#> GSM241471 2 0.4360 0.5416 0.008 0.744 0.000 0.248
#> GSM241472 1 0.1978 0.8745 0.928 0.004 0.000 0.068
#> GSM241473 2 0.1716 0.6388 0.000 0.936 0.000 0.064
#> GSM241474 1 0.2976 0.8585 0.872 0.008 0.000 0.120
#> GSM241475 2 0.1637 0.6156 0.000 0.940 0.000 0.060
#> GSM241476 1 0.2480 0.8656 0.904 0.008 0.000 0.088
#> GSM241477 2 0.1940 0.6377 0.000 0.924 0.000 0.076
#> GSM241478 2 0.1584 0.6282 0.012 0.952 0.000 0.036
#> GSM241479 1 0.2401 0.8660 0.904 0.004 0.000 0.092
#> GSM241480 1 0.1576 0.8775 0.948 0.000 0.004 0.048
#> GSM241481 2 0.4730 0.4075 0.000 0.636 0.000 0.364
#> GSM241482 1 0.0817 0.8766 0.976 0.000 0.000 0.024
#> GSM241483 2 0.4422 0.4172 0.000 0.736 0.008 0.256
#> GSM241484 1 0.0817 0.8764 0.976 0.000 0.000 0.024
#> GSM241485 1 0.1474 0.8717 0.948 0.000 0.000 0.052
#> GSM241486 2 0.5110 0.4012 0.000 0.636 0.012 0.352
#> GSM241487 2 0.2124 0.5842 0.000 0.924 0.008 0.068
#> GSM241488 2 0.4462 0.5514 0.064 0.804 0.000 0.132
#> GSM241489 1 0.1661 0.8726 0.944 0.004 0.000 0.052
#> GSM241490 1 0.1722 0.8786 0.944 0.000 0.008 0.048
#> GSM241491 2 0.1151 0.6260 0.000 0.968 0.008 0.024
#> GSM241492 1 0.1940 0.8653 0.924 0.000 0.000 0.076
#> GSM241493 2 0.1042 0.6382 0.008 0.972 0.000 0.020
#> GSM241494 1 0.1576 0.8778 0.948 0.004 0.000 0.048
#> GSM241495 2 0.1792 0.6379 0.000 0.932 0.000 0.068
#> GSM241496 2 0.4139 0.5718 0.040 0.816 0.000 0.144
#> GSM241497 1 0.1489 0.8762 0.952 0.004 0.000 0.044
#> GSM241498 1 0.2266 0.8681 0.912 0.004 0.000 0.084
#> GSM241499 1 0.0707 0.8766 0.980 0.000 0.000 0.020
#> GSM241500 2 0.4999 0.2584 0.000 0.660 0.012 0.328
#> GSM241501 2 0.4606 0.3864 0.000 0.724 0.012 0.264
#> GSM241502 2 0.4978 0.2532 0.000 0.664 0.012 0.324
#> GSM241503 1 0.0895 0.8768 0.976 0.000 0.004 0.020
#> GSM241504 1 0.1042 0.8768 0.972 0.000 0.020 0.008
#> GSM241505 1 0.1520 0.8752 0.956 0.000 0.020 0.024
#> GSM241506 2 0.5229 -0.0133 0.000 0.564 0.008 0.428
#> GSM241507 1 0.2002 0.8712 0.936 0.000 0.020 0.044
#> GSM241508 2 0.5883 -0.2451 0.000 0.572 0.040 0.388
#> GSM241509 4 0.7463 0.0000 0.000 0.384 0.176 0.440
#> GSM241510 3 0.7738 -0.3437 0.000 0.300 0.440 0.260
#> GSM241511 1 0.2586 0.8603 0.912 0.000 0.048 0.040
#> GSM241512 1 0.5723 0.6054 0.684 0.000 0.244 0.072
#> GSM241513 3 0.7002 0.1364 0.000 0.388 0.492 0.120
#> GSM241514 1 0.6275 0.1369 0.484 0.000 0.460 0.056
#> GSM241515 3 0.4274 0.4925 0.000 0.108 0.820 0.072
#> GSM241516 3 0.5781 -0.2166 0.480 0.000 0.492 0.028
#> GSM241517 2 0.5990 0.1021 0.000 0.688 0.124 0.188
#> GSM241518 3 0.5863 0.4690 0.180 0.000 0.700 0.120
#> GSM241519 2 0.5850 0.1268 0.000 0.700 0.116 0.184
#> GSM241520 1 0.7387 0.1253 0.468 0.004 0.384 0.144
#> GSM241521 2 0.3107 0.5702 0.000 0.884 0.036 0.080
#> GSM241522 1 0.1042 0.8770 0.972 0.000 0.020 0.008
#> GSM241523 2 0.6921 0.1177 0.000 0.580 0.260 0.160
#> GSM241524 1 0.6549 0.4530 0.612 0.000 0.268 0.120
#> GSM241525 1 0.2048 0.8641 0.928 0.000 0.064 0.008
#> GSM241526 3 0.7224 0.1040 0.000 0.216 0.548 0.236
#> GSM241527 3 0.6050 0.4193 0.232 0.000 0.668 0.100
#> GSM241528 2 0.6134 -0.1473 0.000 0.660 0.104 0.236
#> GSM241529 3 0.7571 -0.1278 0.000 0.272 0.484 0.244
#> GSM241530 1 0.4635 0.7091 0.756 0.000 0.216 0.028
#> GSM241531 1 0.6362 0.3508 0.560 0.000 0.368 0.072
#> GSM241532 3 0.7536 -0.0857 0.000 0.264 0.492 0.244
#> GSM241533 3 0.7196 0.1007 0.000 0.212 0.552 0.236
#> GSM241534 3 0.7250 0.0823 0.000 0.220 0.544 0.236
#> GSM241535 3 0.4417 0.5011 0.044 0.000 0.796 0.160
#> GSM241536 1 0.3834 0.8234 0.848 0.000 0.076 0.076
#> GSM241537 3 0.4307 0.4743 0.000 0.024 0.784 0.192
#> GSM241538 3 0.1406 0.5288 0.024 0.000 0.960 0.016
#> GSM241539 3 0.4079 0.4765 0.000 0.020 0.800 0.180
#> GSM241540 3 0.3497 0.4977 0.124 0.000 0.852 0.024
#> GSM241541 3 0.6308 0.3422 0.000 0.120 0.648 0.232
#> GSM241542 3 0.0524 0.5302 0.008 0.000 0.988 0.004
#> GSM241543 3 0.6403 0.3339 0.000 0.260 0.628 0.112
#> GSM241544 3 0.6141 0.3401 0.300 0.000 0.624 0.076
#> GSM241545 3 0.5609 0.4064 0.000 0.200 0.712 0.088
#> GSM241546 1 0.6265 0.2068 0.500 0.000 0.444 0.056
#> GSM241547 3 0.7369 0.2364 0.000 0.228 0.524 0.248
#> GSM241548 3 0.3266 0.5233 0.040 0.000 0.876 0.084
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM241451 5 0.6324 -0.4952 0.000 0.412 0.000 0.156 0.432
#> GSM241452 1 0.1270 0.8944 0.948 0.052 0.000 0.000 0.000
#> GSM241453 2 0.5541 0.6078 0.000 0.552 0.000 0.076 0.372
#> GSM241454 1 0.0404 0.8969 0.988 0.000 0.012 0.000 0.000
#> GSM241455 2 0.5629 0.6783 0.000 0.644 0.004 0.132 0.220
#> GSM241456 1 0.1405 0.8967 0.956 0.008 0.016 0.000 0.020
#> GSM241457 5 0.0798 0.6154 0.000 0.016 0.000 0.008 0.976
#> GSM241458 1 0.2304 0.8827 0.908 0.068 0.020 0.004 0.000
#> GSM241459 5 0.0807 0.6079 0.000 0.012 0.000 0.012 0.976
#> GSM241460 1 0.3218 0.8554 0.844 0.128 0.024 0.004 0.000
#> GSM241461 5 0.0955 0.5957 0.000 0.004 0.000 0.028 0.968
#> GSM241462 1 0.3786 0.8089 0.776 0.204 0.016 0.004 0.000
#> GSM241463 2 0.5455 0.6511 0.000 0.680 0.008 0.176 0.136
#> GSM241464 1 0.5730 0.5583 0.628 0.296 0.016 0.016 0.044
#> GSM241465 2 0.6380 0.5540 0.000 0.516 0.000 0.260 0.224
#> GSM241466 1 0.0566 0.8948 0.984 0.012 0.004 0.000 0.000
#> GSM241467 1 0.1270 0.8937 0.948 0.052 0.000 0.000 0.000
#> GSM241468 5 0.4614 0.2926 0.012 0.252 0.004 0.020 0.712
#> GSM241469 1 0.2569 0.8836 0.904 0.012 0.020 0.004 0.060
#> GSM241470 2 0.5415 0.5978 0.000 0.552 0.000 0.064 0.384
#> GSM241471 5 0.4223 0.3222 0.000 0.248 0.000 0.028 0.724
#> GSM241472 1 0.1673 0.8976 0.944 0.032 0.016 0.000 0.008
#> GSM241473 2 0.5697 0.4332 0.000 0.480 0.004 0.068 0.448
#> GSM241474 1 0.2961 0.8850 0.888 0.064 0.020 0.008 0.020
#> GSM241475 2 0.6733 0.4639 0.004 0.416 0.000 0.212 0.368
#> GSM241476 1 0.1059 0.8979 0.968 0.004 0.008 0.000 0.020
#> GSM241477 5 0.5658 -0.1505 0.000 0.332 0.000 0.096 0.572
#> GSM241478 2 0.5072 0.6687 0.000 0.704 0.004 0.100 0.192
#> GSM241479 1 0.1016 0.8962 0.972 0.012 0.004 0.004 0.008
#> GSM241480 1 0.0162 0.8948 0.996 0.000 0.004 0.000 0.000
#> GSM241481 5 0.0798 0.6144 0.000 0.016 0.000 0.008 0.976
#> GSM241482 1 0.2233 0.8845 0.904 0.080 0.016 0.000 0.000
#> GSM241483 5 0.3622 0.5823 0.000 0.048 0.000 0.136 0.816
#> GSM241484 1 0.1197 0.8973 0.952 0.048 0.000 0.000 0.000
#> GSM241485 1 0.3351 0.8451 0.828 0.148 0.020 0.004 0.000
#> GSM241486 5 0.1282 0.6197 0.000 0.004 0.000 0.044 0.952
#> GSM241487 2 0.6623 0.4819 0.000 0.452 0.000 0.300 0.248
#> GSM241488 2 0.4314 0.5716 0.016 0.772 0.008 0.020 0.184
#> GSM241489 1 0.3470 0.8621 0.864 0.072 0.012 0.028 0.024
#> GSM241490 1 0.1334 0.8930 0.960 0.012 0.020 0.004 0.004
#> GSM241491 2 0.5499 0.6826 0.000 0.652 0.004 0.112 0.232
#> GSM241492 1 0.4097 0.8201 0.804 0.144 0.008 0.028 0.016
#> GSM241493 2 0.5916 0.6021 0.000 0.528 0.004 0.096 0.372
#> GSM241494 1 0.1205 0.8959 0.956 0.040 0.004 0.000 0.000
#> GSM241495 2 0.5952 0.5345 0.000 0.480 0.000 0.108 0.412
#> GSM241496 2 0.4845 0.5861 0.012 0.700 0.008 0.024 0.256
#> GSM241497 1 0.1731 0.8917 0.932 0.060 0.004 0.000 0.004
#> GSM241498 1 0.0960 0.8975 0.972 0.004 0.016 0.000 0.008
#> GSM241499 1 0.1202 0.8983 0.960 0.032 0.004 0.004 0.000
#> GSM241500 5 0.3916 0.5464 0.000 0.012 0.000 0.256 0.732
#> GSM241501 5 0.4873 0.4957 0.000 0.068 0.000 0.244 0.688
#> GSM241502 5 0.5405 0.3287 0.000 0.064 0.000 0.380 0.556
#> GSM241503 1 0.0609 0.8975 0.980 0.020 0.000 0.000 0.000
#> GSM241504 1 0.0566 0.8975 0.984 0.004 0.012 0.000 0.000
#> GSM241505 1 0.1173 0.8964 0.964 0.020 0.012 0.004 0.000
#> GSM241506 5 0.5068 0.3024 0.000 0.032 0.004 0.384 0.580
#> GSM241507 1 0.2437 0.8682 0.904 0.032 0.060 0.004 0.000
#> GSM241508 4 0.5359 0.0405 0.000 0.056 0.000 0.532 0.412
#> GSM241509 4 0.4780 0.3978 0.000 0.048 0.000 0.672 0.280
#> GSM241510 4 0.4288 0.4920 0.000 0.032 0.004 0.740 0.224
#> GSM241511 1 0.3625 0.8233 0.840 0.048 0.096 0.016 0.000
#> GSM241512 1 0.5018 0.6827 0.728 0.012 0.100 0.160 0.000
#> GSM241513 3 0.7202 0.0481 0.000 0.336 0.392 0.252 0.020
#> GSM241514 3 0.3530 0.6613 0.204 0.012 0.784 0.000 0.000
#> GSM241515 3 0.5346 0.5352 0.000 0.132 0.692 0.168 0.008
#> GSM241516 3 0.4674 0.6215 0.244 0.016 0.712 0.028 0.000
#> GSM241517 4 0.7374 -0.1653 0.000 0.348 0.100 0.452 0.100
#> GSM241518 3 0.5078 0.6615 0.064 0.108 0.756 0.072 0.000
#> GSM241519 4 0.7450 -0.2492 0.000 0.348 0.068 0.432 0.152
#> GSM241520 3 0.6334 0.6082 0.124 0.208 0.628 0.036 0.004
#> GSM241521 2 0.7083 0.5771 0.000 0.528 0.048 0.224 0.200
#> GSM241522 1 0.1901 0.8765 0.928 0.012 0.056 0.004 0.000
#> GSM241523 2 0.6895 0.4384 0.000 0.588 0.188 0.140 0.084
#> GSM241524 3 0.6276 0.6077 0.232 0.100 0.628 0.032 0.008
#> GSM241525 1 0.2906 0.8522 0.880 0.028 0.080 0.012 0.000
#> GSM241526 4 0.3437 0.6082 0.000 0.032 0.044 0.860 0.064
#> GSM241527 3 0.7019 0.2744 0.208 0.020 0.448 0.324 0.000
#> GSM241528 4 0.5607 0.3532 0.000 0.228 0.000 0.632 0.140
#> GSM241529 4 0.3913 0.5988 0.000 0.032 0.036 0.824 0.108
#> GSM241530 1 0.5181 0.6944 0.724 0.020 0.152 0.104 0.000
#> GSM241531 1 0.6922 0.4088 0.568 0.060 0.204 0.168 0.000
#> GSM241532 4 0.3570 0.5881 0.000 0.044 0.004 0.828 0.124
#> GSM241533 4 0.3051 0.6005 0.000 0.000 0.028 0.852 0.120
#> GSM241534 4 0.3122 0.6019 0.000 0.004 0.024 0.852 0.120
#> GSM241535 3 0.5447 0.2096 0.008 0.044 0.532 0.416 0.000
#> GSM241536 1 0.4657 0.7578 0.764 0.068 0.148 0.020 0.000
#> GSM241537 4 0.4331 -0.0247 0.000 0.004 0.400 0.596 0.000
#> GSM241538 3 0.3031 0.6179 0.004 0.016 0.852 0.128 0.000
#> GSM241539 4 0.4794 -0.1855 0.000 0.012 0.464 0.520 0.004
#> GSM241540 3 0.3912 0.6318 0.040 0.036 0.828 0.096 0.000
#> GSM241541 4 0.3970 0.3896 0.000 0.024 0.224 0.752 0.000
#> GSM241542 3 0.3203 0.5979 0.000 0.012 0.820 0.168 0.000
#> GSM241543 3 0.6332 0.4472 0.000 0.208 0.596 0.176 0.020
#> GSM241544 3 0.3902 0.6773 0.152 0.028 0.804 0.016 0.000
#> GSM241545 3 0.4219 0.6209 0.004 0.068 0.792 0.132 0.004
#> GSM241546 3 0.3762 0.6342 0.244 0.004 0.748 0.004 0.000
#> GSM241547 4 0.6359 0.3307 0.000 0.196 0.236 0.560 0.008
#> GSM241548 3 0.3798 0.6625 0.044 0.032 0.836 0.088 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM241451 6 0.6265 -0.3160 0.000 0.176 0.032 0.004 0.256 0.532
#> GSM241452 1 0.3007 0.7771 0.836 0.012 0.140 0.004 0.008 0.000
#> GSM241453 2 0.6192 0.7690 0.000 0.476 0.008 0.004 0.232 0.280
#> GSM241454 1 0.0972 0.7896 0.964 0.008 0.028 0.000 0.000 0.000
#> GSM241455 2 0.5534 0.7730 0.000 0.596 0.004 0.004 0.176 0.220
#> GSM241456 1 0.4635 0.7385 0.708 0.036 0.044 0.000 0.212 0.000
#> GSM241457 5 0.1320 0.6046 0.000 0.016 0.000 0.000 0.948 0.036
#> GSM241458 1 0.3761 0.7316 0.764 0.196 0.032 0.008 0.000 0.000
#> GSM241459 5 0.1442 0.6060 0.000 0.012 0.004 0.000 0.944 0.040
#> GSM241460 1 0.4490 0.6050 0.604 0.360 0.032 0.004 0.000 0.000
#> GSM241461 5 0.1285 0.6095 0.000 0.004 0.000 0.000 0.944 0.052
#> GSM241462 1 0.4497 0.6012 0.600 0.368 0.012 0.020 0.000 0.000
#> GSM241463 2 0.5061 0.7437 0.000 0.644 0.008 0.004 0.088 0.256
#> GSM241464 1 0.7094 0.4975 0.448 0.268 0.184 0.004 0.096 0.000
#> GSM241465 2 0.5727 0.6698 0.000 0.456 0.000 0.004 0.144 0.396
#> GSM241466 1 0.2744 0.7918 0.876 0.012 0.052 0.000 0.060 0.000
#> GSM241467 1 0.3162 0.7949 0.856 0.040 0.064 0.000 0.040 0.000
#> GSM241468 5 0.6509 0.0208 0.024 0.316 0.008 0.004 0.480 0.168
#> GSM241469 1 0.5346 0.6727 0.612 0.020 0.096 0.000 0.272 0.000
#> GSM241470 2 0.6435 0.7388 0.000 0.444 0.016 0.004 0.248 0.288
#> GSM241471 5 0.5913 0.0614 0.000 0.280 0.004 0.000 0.496 0.220
#> GSM241472 1 0.3753 0.7907 0.808 0.084 0.020 0.000 0.088 0.000
#> GSM241473 2 0.5839 0.6829 0.000 0.524 0.000 0.008 0.284 0.184
#> GSM241474 1 0.5540 0.6760 0.608 0.172 0.008 0.004 0.208 0.000
#> GSM241475 6 0.6269 -0.4994 0.016 0.292 0.004 0.000 0.204 0.484
#> GSM241476 1 0.4323 0.7557 0.740 0.028 0.044 0.000 0.188 0.000
#> GSM241477 5 0.6190 -0.3531 0.000 0.264 0.004 0.000 0.376 0.356
#> GSM241478 2 0.5472 0.7560 0.020 0.640 0.004 0.004 0.104 0.228
#> GSM241479 1 0.3721 0.7812 0.804 0.012 0.084 0.000 0.100 0.000
#> GSM241480 1 0.1155 0.7896 0.956 0.004 0.036 0.000 0.004 0.000
#> GSM241481 5 0.1528 0.6108 0.000 0.016 0.000 0.000 0.936 0.048
#> GSM241482 1 0.3239 0.7516 0.808 0.164 0.024 0.004 0.000 0.000
#> GSM241483 5 0.4292 0.4513 0.000 0.024 0.000 0.000 0.588 0.388
#> GSM241484 1 0.1364 0.7846 0.944 0.048 0.004 0.004 0.000 0.000
#> GSM241485 1 0.4444 0.6422 0.644 0.316 0.032 0.008 0.000 0.000
#> GSM241486 5 0.1958 0.6130 0.000 0.004 0.000 0.000 0.896 0.100
#> GSM241487 6 0.5887 -0.5549 0.000 0.340 0.004 0.000 0.184 0.472
#> GSM241488 2 0.6983 0.7230 0.020 0.504 0.076 0.004 0.120 0.276
#> GSM241489 1 0.5469 0.7380 0.664 0.052 0.144 0.000 0.140 0.000
#> GSM241490 1 0.3924 0.7754 0.788 0.008 0.124 0.004 0.076 0.000
#> GSM241491 2 0.5780 0.7884 0.000 0.532 0.008 0.000 0.172 0.288
#> GSM241492 1 0.6345 0.6300 0.532 0.272 0.048 0.004 0.144 0.000
#> GSM241493 2 0.6275 0.7782 0.012 0.496 0.004 0.004 0.200 0.284
#> GSM241494 1 0.2890 0.7882 0.860 0.012 0.096 0.000 0.032 0.000
#> GSM241495 6 0.6515 -0.6476 0.000 0.336 0.016 0.004 0.248 0.396
#> GSM241496 2 0.7238 0.7237 0.016 0.468 0.080 0.004 0.168 0.264
#> GSM241497 1 0.4152 0.7727 0.772 0.028 0.140 0.000 0.060 0.000
#> GSM241498 1 0.3139 0.7901 0.852 0.020 0.048 0.000 0.080 0.000
#> GSM241499 1 0.1841 0.7804 0.920 0.064 0.008 0.008 0.000 0.000
#> GSM241500 5 0.3706 0.4206 0.000 0.000 0.000 0.000 0.620 0.380
#> GSM241501 5 0.4657 0.3516 0.000 0.032 0.004 0.000 0.508 0.456
#> GSM241502 6 0.4161 0.0111 0.000 0.016 0.000 0.004 0.348 0.632
#> GSM241503 1 0.1010 0.7844 0.960 0.036 0.000 0.004 0.000 0.000
#> GSM241504 1 0.1148 0.7786 0.960 0.016 0.020 0.004 0.000 0.000
#> GSM241505 1 0.1167 0.7792 0.960 0.020 0.012 0.008 0.000 0.000
#> GSM241506 5 0.4395 0.4478 0.000 0.016 0.000 0.008 0.580 0.396
#> GSM241507 1 0.2103 0.7657 0.916 0.024 0.020 0.040 0.000 0.000
#> GSM241508 6 0.3778 0.1480 0.000 0.016 0.000 0.000 0.288 0.696
#> GSM241509 6 0.3043 0.3937 0.000 0.012 0.000 0.012 0.148 0.828
#> GSM241510 6 0.2473 0.3925 0.000 0.000 0.000 0.008 0.136 0.856
#> GSM241511 1 0.4661 0.5380 0.688 0.048 0.024 0.240 0.000 0.000
#> GSM241512 1 0.3540 0.7101 0.812 0.020 0.036 0.132 0.000 0.000
#> GSM241513 3 0.5717 0.4983 0.000 0.124 0.608 0.028 0.004 0.236
#> GSM241514 3 0.4184 0.6557 0.124 0.000 0.752 0.120 0.004 0.000
#> GSM241515 4 0.6466 0.0341 0.000 0.036 0.248 0.480 0.000 0.236
#> GSM241516 4 0.6016 0.0903 0.192 0.004 0.320 0.480 0.004 0.000
#> GSM241517 6 0.4431 0.2745 0.000 0.136 0.100 0.004 0.012 0.748
#> GSM241518 3 0.3835 0.7191 0.028 0.016 0.804 0.132 0.000 0.020
#> GSM241519 6 0.4830 0.2903 0.000 0.116 0.168 0.000 0.016 0.700
#> GSM241520 3 0.2744 0.7186 0.068 0.024 0.884 0.016 0.004 0.004
#> GSM241521 6 0.7003 -0.3588 0.000 0.292 0.168 0.004 0.088 0.448
#> GSM241522 1 0.3444 0.7514 0.800 0.020 0.168 0.004 0.008 0.000
#> GSM241523 3 0.6019 0.3486 0.000 0.224 0.556 0.000 0.028 0.192
#> GSM241524 3 0.2747 0.6947 0.108 0.000 0.860 0.028 0.004 0.000
#> GSM241525 1 0.3562 0.7570 0.828 0.032 0.076 0.064 0.000 0.000
#> GSM241526 6 0.4087 0.2925 0.000 0.004 0.000 0.276 0.028 0.692
#> GSM241527 4 0.5479 0.4809 0.244 0.000 0.020 0.612 0.000 0.124
#> GSM241528 6 0.3399 0.4145 0.000 0.088 0.000 0.064 0.016 0.832
#> GSM241529 6 0.4660 0.2518 0.000 0.008 0.000 0.308 0.048 0.636
#> GSM241530 1 0.4561 0.3519 0.568 0.000 0.040 0.392 0.000 0.000
#> GSM241531 4 0.4243 0.4817 0.272 0.008 0.032 0.688 0.000 0.000
#> GSM241532 6 0.2358 0.4145 0.000 0.000 0.000 0.016 0.108 0.876
#> GSM241533 6 0.4154 0.4153 0.000 0.000 0.000 0.164 0.096 0.740
#> GSM241534 6 0.3985 0.4190 0.000 0.000 0.000 0.140 0.100 0.760
#> GSM241535 4 0.3522 0.6435 0.040 0.008 0.028 0.836 0.000 0.088
#> GSM241536 1 0.5741 -0.0930 0.460 0.084 0.028 0.428 0.000 0.000
#> GSM241537 4 0.3659 0.4241 0.000 0.000 0.000 0.636 0.000 0.364
#> GSM241538 4 0.1471 0.6384 0.000 0.000 0.064 0.932 0.000 0.004
#> GSM241539 4 0.3351 0.5192 0.000 0.000 0.000 0.712 0.000 0.288
#> GSM241540 4 0.2039 0.6313 0.020 0.000 0.076 0.904 0.000 0.000
#> GSM241541 6 0.4225 -0.1270 0.000 0.004 0.004 0.440 0.004 0.548
#> GSM241542 4 0.1951 0.6353 0.000 0.000 0.076 0.908 0.000 0.016
#> GSM241543 3 0.4216 0.6473 0.000 0.048 0.752 0.024 0.000 0.176
#> GSM241544 3 0.3557 0.7046 0.056 0.000 0.800 0.140 0.004 0.000
#> GSM241545 3 0.4271 0.6794 0.000 0.036 0.772 0.076 0.000 0.116
#> GSM241546 3 0.4449 0.6369 0.088 0.000 0.712 0.196 0.004 0.000
#> GSM241547 6 0.5140 -0.0756 0.000 0.052 0.396 0.016 0.000 0.536
#> GSM241548 3 0.3121 0.6878 0.004 0.000 0.796 0.192 0.000 0.008
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n dose(p) time(p) k
#> ATC:NMF 98 4.80e-01 9.88e-01 2
#> ATC:NMF 94 8.47e-10 4.44e-01 3
#> ATC:NMF 58 3.19e-06 1.11e-01 4
#> ATC:NMF 72 2.29e-06 9.24e-05 5
#> ATC:NMF 62 3.10e-07 1.74e-05 6
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