cola Report for GDS1816

Date: 2019-12-25 20:17:15 CET, cola version: 1.3.2

Document is loading...


Summary

All available functions which can be applied to this res_list object:

res_list
#> A 'ConsensusPartitionList' object with 24 methods.
#>   On a matrix with 21512 rows and 100 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] 21512   100

Density distribution

The density distribution for each sample is visualized as in one column in the following heatmap. The clustering is based on the distance which is the Kolmogorov-Smirnov statistic between two distributions.

library(ComplexHeatmap)
densityHeatmap(mat, 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)

plot of chunk density-heatmap

Suggest the best k

Folowing table shows the best k (number of partitions) for each combination of top-value methods and partition methods. Clicking on the method name in the table goes to the section for a single combination of methods.

The cola vignette explains the definition of the metrics used for determining the best number of partitions.

suggest_best_k(res_list)
The best k 1-PAC Mean silhouette Concordance
MAD:kmeans 2 1.000 0.977 0.988 **
CV:skmeans 2 0.999 0.965 0.985 **
MAD:skmeans 2 0.979 0.953 0.982 **
SD:skmeans 2 0.958 0.944 0.977 **
SD:kmeans 2 0.938 0.947 0.973 *
ATC:mclust 4 0.936 0.937 0.974 *
ATC:skmeans 3 0.936 0.945 0.976 *
CV:NMF 2 0.935 0.944 0.975 *
ATC:NMF 2 0.918 0.918 0.968 *
SD:NMF 2 0.917 0.934 0.973 *
MAD:NMF 2 0.917 0.944 0.975 *
MAD:mclust 4 0.908 0.905 0.945 *
CV:mclust 3 0.865 0.901 0.950
SD:mclust 4 0.815 0.874 0.914
MAD:pam 3 0.727 0.839 0.924
CV:kmeans 2 0.704 0.885 0.937
ATC:kmeans 2 0.625 0.870 0.928
ATC:pam 2 0.624 0.902 0.944
SD:pam 3 0.608 0.787 0.879
CV:pam 3 0.494 0.720 0.855
CV:hclust 2 0.426 0.786 0.886
ATC:hclust 2 0.344 0.688 0.802
SD:hclust 2 0.239 0.675 0.821
MAD:hclust 2 0.219 0.661 0.817

**: 1-PAC > 0.95, *: 1-PAC > 0.9

CDF of consensus matrices

Cumulative distribution function curves of consensus matrix for all methods.

collect_plots(res_list, fun = plot_ecdf)

plot of chunk collect-plots

Consensus heatmap

Consensus heatmaps for all methods. (What is a consensus heatmap?)

collect_plots(res_list, k = 2, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-1

collect_plots(res_list, k = 3, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-2

collect_plots(res_list, k = 4, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-3

collect_plots(res_list, k = 5, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-4

collect_plots(res_list, k = 6, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-5

Membership heatmap

Membership heatmaps for all methods. (What is a membership heatmap?)

collect_plots(res_list, k = 2, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-1

collect_plots(res_list, k = 3, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-2

collect_plots(res_list, k = 4, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-3

collect_plots(res_list, k = 5, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-4

collect_plots(res_list, k = 6, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-5

Signature heatmap

Signature heatmaps for all methods. (What is a signature heatmap?)

Note in following heatmaps, rows are scaled.

collect_plots(res_list, k = 2, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-1

collect_plots(res_list, k = 3, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-2

collect_plots(res_list, k = 4, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-3

collect_plots(res_list, k = 5, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-4

collect_plots(res_list, k = 6, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-5

Statistics table

The statistics used for measuring the stability of consensus partitioning. (How are they defined?)

get_stats(res_list, k = 2)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      2 0.917           0.934       0.973          0.499 0.500   0.500
#> CV:NMF      2 0.935           0.944       0.975          0.496 0.508   0.508
#> MAD:NMF     2 0.917           0.944       0.975          0.498 0.502   0.502
#> ATC:NMF     2 0.918           0.918       0.968          0.503 0.497   0.497
#> SD:skmeans  2 0.958           0.944       0.977          0.500 0.500   0.500
#> CV:skmeans  2 0.999           0.965       0.985          0.500 0.500   0.500
#> MAD:skmeans 2 0.979           0.953       0.982          0.499 0.500   0.500
#> ATC:skmeans 2 0.696           0.948       0.973          0.505 0.495   0.495
#> SD:mclust   2 0.500           0.665       0.861          0.331 0.677   0.677
#> CV:mclust   2 0.395           0.736       0.768          0.357 0.495   0.495
#> MAD:mclust  2 0.538           0.906       0.905          0.440 0.496   0.496
#> ATC:mclust  2 0.599           0.822       0.911          0.282 0.802   0.802
#> SD:kmeans   2 0.938           0.947       0.973          0.493 0.508   0.508
#> CV:kmeans   2 0.704           0.885       0.937          0.492 0.505   0.505
#> MAD:kmeans  2 1.000           0.977       0.988          0.492 0.508   0.508
#> ATC:kmeans  2 0.625           0.870       0.928          0.500 0.495   0.495
#> SD:pam      2 0.646           0.818       0.903          0.445 0.535   0.535
#> CV:pam      2 0.344           0.538       0.787          0.463 0.576   0.576
#> MAD:pam     2 0.597           0.733       0.899          0.454 0.529   0.529
#> ATC:pam     2 0.624           0.902       0.944          0.465 0.547   0.547
#> SD:hclust   2 0.239           0.675       0.821          0.438 0.529   0.529
#> CV:hclust   2 0.426           0.786       0.886          0.418 0.547   0.547
#> MAD:hclust  2 0.219           0.661       0.817          0.423 0.540   0.540
#> ATC:hclust  2 0.344           0.688       0.802          0.443 0.553   0.553
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.432           0.484       0.662          0.307 0.779   0.589
#> CV:NMF      3 0.470           0.630       0.806          0.318 0.784   0.595
#> MAD:NMF     3 0.449           0.504       0.714          0.313 0.727   0.510
#> ATC:NMF     3 0.618           0.710       0.875          0.326 0.661   0.418
#> SD:skmeans  3 0.759           0.855       0.930          0.340 0.728   0.505
#> CV:skmeans  3 0.768           0.834       0.924          0.341 0.731   0.510
#> MAD:skmeans 3 0.820           0.849       0.931          0.341 0.753   0.541
#> ATC:skmeans 3 0.936           0.945       0.976          0.326 0.706   0.475
#> SD:mclust   3 0.520           0.738       0.845          0.845 0.665   0.521
#> CV:mclust   3 0.865           0.901       0.950          0.652 0.795   0.628
#> MAD:mclust  3 0.669           0.846       0.890          0.390 0.894   0.785
#> ATC:mclust  3 0.581           0.885       0.917          1.012 0.602   0.510
#> SD:kmeans   3 0.603           0.811       0.876          0.334 0.704   0.481
#> CV:kmeans   3 0.656           0.834       0.889          0.330 0.697   0.472
#> MAD:kmeans  3 0.545           0.755       0.846          0.336 0.725   0.509
#> ATC:kmeans  3 0.732           0.856       0.929          0.326 0.699   0.466
#> SD:pam      3 0.608           0.787       0.879          0.469 0.687   0.473
#> CV:pam      3 0.494           0.720       0.855          0.401 0.634   0.431
#> MAD:pam     3 0.727           0.839       0.924          0.436 0.666   0.447
#> ATC:pam     3 0.864           0.900       0.949          0.412 0.772   0.593
#> SD:hclust   3 0.207           0.384       0.672          0.366 0.791   0.655
#> CV:hclust   3 0.297           0.657       0.801          0.368 0.890   0.804
#> MAD:hclust  3 0.248           0.351       0.653          0.409 0.835   0.738
#> ATC:hclust  3 0.369           0.598       0.723          0.269 0.906   0.834
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.602           0.586       0.754         0.1313 0.670   0.311
#> CV:NMF      4 0.531           0.507       0.763         0.1344 0.766   0.446
#> MAD:NMF     4 0.564           0.536       0.742         0.1290 0.671   0.300
#> ATC:NMF     4 0.654           0.703       0.842         0.1026 0.905   0.727
#> SD:skmeans  4 0.760           0.810       0.894         0.1227 0.845   0.576
#> CV:skmeans  4 0.564           0.587       0.791         0.1197 0.828   0.543
#> MAD:skmeans 4 0.719           0.793       0.887         0.1215 0.829   0.544
#> ATC:skmeans 4 0.720           0.699       0.843         0.0956 0.908   0.735
#> SD:mclust   4 0.815           0.874       0.914         0.2114 0.737   0.415
#> CV:mclust   4 0.529           0.282       0.691         0.1710 0.851   0.675
#> MAD:mclust  4 0.908           0.905       0.945         0.2215 0.754   0.442
#> ATC:mclust  4 0.936           0.937       0.974         0.2631 0.806   0.570
#> SD:kmeans   4 0.708           0.777       0.861         0.1295 0.823   0.532
#> CV:kmeans   4 0.604           0.577       0.782         0.1225 0.864   0.632
#> MAD:kmeans  4 0.733           0.778       0.865         0.1317 0.836   0.560
#> ATC:kmeans  4 0.534           0.536       0.741         0.0990 0.897   0.709
#> SD:pam      4 0.626           0.640       0.793         0.0930 0.908   0.748
#> CV:pam      4 0.579           0.747       0.830         0.0954 0.901   0.737
#> MAD:pam     4 0.662           0.741       0.839         0.1101 0.892   0.704
#> ATC:pam     4 0.807           0.822       0.921         0.0943 0.754   0.439
#> SD:hclust   4 0.302           0.492       0.689         0.1453 0.807   0.611
#> CV:hclust   4 0.345           0.588       0.747         0.1706 0.886   0.759
#> MAD:hclust  4 0.337           0.527       0.696         0.1696 0.761   0.568
#> ATC:hclust  4 0.530           0.668       0.803         0.2476 0.787   0.572
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.550           0.434       0.694         0.0780 0.819   0.445
#> CV:NMF      5 0.538           0.464       0.701         0.0765 0.826   0.450
#> MAD:NMF     5 0.538           0.399       0.675         0.0745 0.836   0.484
#> ATC:NMF     5 0.639           0.592       0.793         0.0831 0.780   0.362
#> SD:skmeans  5 0.635           0.574       0.743         0.0609 0.964   0.860
#> CV:skmeans  5 0.552           0.381       0.648         0.0657 0.896   0.642
#> MAD:skmeans 5 0.616           0.547       0.719         0.0615 0.976   0.904
#> ATC:skmeans 5 0.772           0.804       0.888         0.0726 0.875   0.591
#> SD:mclust   5 0.617           0.761       0.853         0.0288 0.949   0.802
#> CV:mclust   5 0.579           0.499       0.711         0.0934 0.698   0.318
#> MAD:mclust  5 0.692           0.678       0.849         0.0152 0.864   0.550
#> ATC:mclust  5 0.785           0.763       0.872         0.0631 0.964   0.877
#> SD:kmeans   5 0.685           0.658       0.770         0.0579 0.971   0.883
#> CV:kmeans   5 0.609           0.528       0.716         0.0684 0.896   0.644
#> MAD:kmeans  5 0.696           0.665       0.791         0.0609 0.960   0.843
#> ATC:kmeans  5 0.611           0.555       0.767         0.0692 0.778   0.377
#> SD:pam      5 0.602           0.589       0.753         0.0738 0.902   0.688
#> CV:pam      5 0.565           0.476       0.739         0.0776 0.943   0.820
#> MAD:pam     5 0.629           0.684       0.767         0.0615 0.959   0.855
#> ATC:pam     5 0.761           0.562       0.772         0.0750 0.891   0.643
#> SD:hclust   5 0.387           0.540       0.690         0.0763 0.911   0.734
#> CV:hclust   5 0.406           0.453       0.685         0.0911 0.921   0.786
#> MAD:hclust  5 0.434           0.568       0.697         0.0667 0.890   0.672
#> ATC:hclust  5 0.593           0.682       0.815         0.0633 0.946   0.819
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.643           0.536       0.729         0.0458 0.864   0.452
#> CV:NMF      6 0.618           0.481       0.690         0.0446 0.892   0.535
#> MAD:NMF     6 0.595           0.458       0.646         0.0467 0.844   0.401
#> ATC:NMF     6 0.637           0.474       0.694         0.0402 0.908   0.610
#> SD:skmeans  6 0.627           0.430       0.611         0.0400 0.918   0.664
#> CV:skmeans  6 0.589           0.398       0.638         0.0407 0.867   0.498
#> MAD:skmeans 6 0.614           0.429       0.637         0.0393 0.951   0.789
#> ATC:skmeans 6 0.774           0.640       0.794         0.0462 0.952   0.783
#> SD:mclust   6 0.721           0.753       0.862         0.0532 0.914   0.646
#> CV:mclust   6 0.679           0.661       0.809         0.0703 0.845   0.426
#> MAD:mclust  6 0.745           0.752       0.840         0.0664 0.925   0.690
#> ATC:mclust  6 0.887           0.833       0.924         0.0671 0.871   0.553
#> SD:kmeans   6 0.702           0.547       0.674         0.0408 0.922   0.674
#> CV:kmeans   6 0.667           0.430       0.693         0.0440 0.889   0.563
#> MAD:kmeans  6 0.699           0.462       0.639         0.0390 0.941   0.755
#> ATC:kmeans  6 0.773           0.830       0.868         0.0557 0.872   0.511
#> SD:pam      6 0.628           0.541       0.736         0.0581 0.866   0.509
#> CV:pam      6 0.594           0.404       0.661         0.0511 0.884   0.613
#> MAD:pam     6 0.684           0.515       0.720         0.0584 0.919   0.683
#> ATC:pam     6 0.890           0.871       0.933         0.0531 0.899   0.599
#> SD:hclust   6 0.523           0.514       0.701         0.0610 0.964   0.863
#> CV:hclust   6 0.473           0.528       0.698         0.0463 0.929   0.767
#> MAD:hclust  6 0.576           0.538       0.702         0.0665 0.977   0.909
#> ATC:hclust  6 0.620           0.517       0.729         0.0606 0.973   0.890

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)

plot of chunk tab-collect-stats-from-consensus-partition-list-1

collect_stats(res_list, k = 3)

plot of chunk tab-collect-stats-from-consensus-partition-list-2

collect_stats(res_list, k = 4)

plot of chunk tab-collect-stats-from-consensus-partition-list-3

collect_stats(res_list, k = 5)

plot of chunk tab-collect-stats-from-consensus-partition-list-4

collect_stats(res_list, k = 6)

plot of chunk tab-collect-stats-from-consensus-partition-list-5

Partition from all methods

Collect partitions from all methods:

collect_classes(res_list, k = 2)

plot of chunk tab-collect-classes-from-consensus-partition-list-1

collect_classes(res_list, k = 3)

plot of chunk tab-collect-classes-from-consensus-partition-list-2

collect_classes(res_list, k = 4)

plot of chunk tab-collect-classes-from-consensus-partition-list-3

collect_classes(res_list, k = 5)

plot of chunk tab-collect-classes-from-consensus-partition-list-4

collect_classes(res_list, k = 6)

plot of chunk tab-collect-classes-from-consensus-partition-list-5

Top rows overlap

Overlap of top rows from different top-row methods:

top_rows_overlap(res_list, top_n = 1000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-1

top_rows_overlap(res_list, top_n = 2000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-2

top_rows_overlap(res_list, top_n = 3000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-3

top_rows_overlap(res_list, top_n = 4000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-4

top_rows_overlap(res_list, top_n = 5000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-5

Also visualize the correspondance of rankings between different top-row methods:

top_rows_overlap(res_list, top_n = 1000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-1

top_rows_overlap(res_list, top_n = 2000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-2

top_rows_overlap(res_list, top_n = 3000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-3

top_rows_overlap(res_list, top_n = 4000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-4

top_rows_overlap(res_list, top_n = 5000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-5

Heatmaps of the top rows:

top_rows_heatmap(res_list, top_n = 1000)

plot of chunk tab-top-rows-heatmap-1

top_rows_heatmap(res_list, top_n = 2000)

plot of chunk tab-top-rows-heatmap-2

top_rows_heatmap(res_list, top_n = 3000)

plot of chunk tab-top-rows-heatmap-3

top_rows_heatmap(res_list, top_n = 4000)

plot of chunk tab-top-rows-heatmap-4

top_rows_heatmap(res_list, top_n = 5000)

plot of chunk tab-top-rows-heatmap-5

Test to known annotations

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF       97         7.18e-05      0.7381     3.31e-13   0.1495 2
#> CV:NMF       98         8.95e-05      0.6496     4.19e-14   0.1842 2
#> MAD:NMF      98         1.37e-04      0.5025     3.14e-14   0.0947 2
#> ATC:NMF      96         2.74e-02      0.0378     1.75e-03   0.2217 2
#> SD:skmeans   97         5.64e-04      0.4151     3.09e-13   0.1020 2
#> CV:skmeans   99         9.78e-04      0.4095     3.76e-12   0.1858 2
#> MAD:skmeans  97         5.64e-04      0.4151     3.09e-13   0.1020 2
#> ATC:skmeans  99         5.34e-02      0.0201     3.41e-02   0.0991 2
#> SD:mclust    68         2.02e-03      0.1868     1.59e-05   0.2470 2
#> CV:mclust    84         2.21e-02      0.1703     2.41e-10   0.4651 2
#> MAD:mclust   99         2.75e-02      0.4512     1.16e-11   0.4408 2
#> ATC:mclust   99         5.43e-02      0.5156     4.66e-04   0.5101 2
#> SD:kmeans    99         3.34e-04      0.3698     3.49e-13   0.1112 2
#> CV:kmeans    98         2.21e-04      0.4030     2.16e-13   0.1459 2
#> MAD:kmeans  100         2.77e-04      0.2984     2.66e-13   0.0975 2
#> ATC:kmeans   99         5.34e-02      0.0201     3.41e-02   0.0991 2
#> SD:pam       94         5.42e-06      0.7345     6.12e-16   0.0454 2
#> CV:pam       66         1.31e-03      0.9926     4.68e-11   0.1244 2
#> MAD:pam      83         1.94e-04      0.6970     4.28e-13   0.1590 2
#> ATC:pam      99         6.38e-05      0.8415     2.96e-13   0.0823 2
#> SD:hclust    83         4.74e-07      1.0000     4.45e-16   0.0554 2
#> CV:hclust    90         6.48e-08      1.0000     1.15e-16   0.0559 2
#> MAD:hclust   84         1.73e-06      1.0000     2.80e-16   0.0431 2
#> ATC:hclust   90         1.98e-02      0.0110     3.85e-01   0.1214 2
test_to_known_factors(res_list, k = 3)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF      52         1.69e-02      0.4368     4.61e-08   0.6141 3
#> CV:NMF      79         7.34e-05      0.1071     9.83e-13   0.4021 3
#> MAD:NMF     61         9.50e-06      0.0726     1.84e-10   0.0259 3
#> ATC:NMF     82         1.44e-06      0.0332     3.74e-11   0.0603 3
#> SD:skmeans  94         3.88e-04      0.4719     3.48e-13   0.4671 3
#> CV:skmeans  91         2.44e-05      0.4304     4.93e-14   0.3416 3
#> MAD:skmeans 92         1.86e-04      0.4102     1.35e-13   0.3788 3
#> ATC:skmeans 99         9.07e-07      0.1940     1.22e-12   0.0406 3
#> SD:mclust   93         1.62e-03      0.0534     3.99e-10   0.1784 3
#> CV:mclust   97         2.50e-04      0.0331     1.46e-11   0.0353 3
#> MAD:mclust  95         1.29e-03      0.0433     2.87e-10   0.1608 3
#> ATC:mclust  98         3.01e-06      0.4748     2.61e-17   0.1297 3
#> SD:kmeans   94         1.44e-05      0.3183     2.74e-13   0.1502 3
#> CV:kmeans   96         1.37e-05      0.1746     1.05e-13   0.1390 3
#> MAD:kmeans  93         1.41e-04      0.2491     1.94e-12   0.2283 3
#> ATC:kmeans  97         9.51e-07      0.1400     2.13e-12   0.0897 3
#> SD:pam      91         2.19e-04      0.3314     4.32e-12   0.0923 3
#> CV:pam      85         6.27e-04      0.1882     4.51e-08   0.0449 3
#> MAD:pam     94         6.47e-04      0.2784     1.32e-10   0.0607 3
#> ATC:pam     96         3.29e-03      0.4576     1.35e-09   0.1412 3
#> SD:hclust   37         3.09e-02      0.7366     3.51e-11   0.7217 3
#> CV:hclust   89         2.43e-06      0.9556     3.86e-15   0.2565 3
#> MAD:hclust  24         1.75e-01      1.0000     6.14e-06   0.7279 3
#> ATC:hclust  81         3.94e-02      0.0731     2.47e-02   0.1825 3
test_to_known_factors(res_list, k = 4)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF      78         1.01e-03      0.9927     5.54e-12   0.6043 4
#> CV:NMF      62         2.76e-03      0.2527     1.41e-11   0.1797 4
#> MAD:NMF     69         1.83e-05      0.5813     3.99e-10   0.3021 4
#> ATC:NMF     87         6.01e-06      0.2059     2.36e-14   0.1471 4
#> SD:skmeans  93         6.25e-04      0.4239     3.06e-15   0.1922 4
#> CV:skmeans  72         1.31e-05      0.0481     5.42e-14   0.0260 4
#> MAD:skmeans 93         6.25e-04      0.4239     3.06e-15   0.1922 4
#> ATC:skmeans 85         1.78e-06      0.5372     5.62e-16   0.1843 4
#> SD:mclust   98         2.89e-04      0.6454     1.37e-15   0.2386 4
#> CV:mclust   46         1.52e-04      0.2732     8.96e-08   0.1054 4
#> MAD:mclust  97         1.01e-04      0.6347     2.67e-16   0.2753 4
#> ATC:mclust  98         2.32e-06      0.1255     1.64e-15   0.0431 4
#> SD:kmeans   94         6.30e-04      0.3085     2.01e-14   0.2307 4
#> CV:kmeans   70         8.41e-05      0.1582     4.56e-12   0.1558 4
#> MAD:kmeans  93         2.66e-04      0.3308     7.45e-16   0.1535 4
#> ATC:kmeans  71         1.03e-03      0.3798     2.62e-09   0.2825 4
#> SD:pam      76         1.62e-04      0.6021     5.19e-08   0.5594 4
#> CV:pam      89         2.31e-03      0.2634     1.49e-06   0.3288 4
#> MAD:pam     85         3.11e-04      0.5061     1.05e-08   0.0238 4
#> ATC:pam     92         1.73e-05      0.1991     2.61e-15   0.0358 4
#> SD:hclust   59         1.90e-03      0.7800     6.17e-10   0.8124 4
#> CV:hclust   77         5.86e-05      0.4603     7.45e-14   0.3050 4
#> MAD:hclust  62         1.61e-04      0.4723     1.18e-10   0.2285 4
#> ATC:hclust  86         5.66e-03      0.0555     1.79e-06   0.4598 4
test_to_known_factors(res_list, k = 5)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF      44         2.78e-03       0.476     8.31e-09   0.4096 5
#> CV:NMF      48         2.44e-04       0.228     6.96e-10   0.3840 5
#> MAD:NMF     38         2.02e-01       0.693     1.89e-08   0.3341 5
#> ATC:NMF     75         6.08e-03       0.966     1.16e-10   0.3964 5
#> SD:skmeans  77         8.93e-06       0.200     2.55e-14   0.0219 5
#> CV:skmeans  40         2.93e-03       0.228     5.02e-06   0.2191 5
#> MAD:skmeans 70         2.27e-05       0.422     1.45e-12   0.1932 5
#> ATC:skmeans 95         2.61e-04       0.558     2.02e-15   0.3617 5
#> SD:mclust   90         3.47e-04       0.650     9.82e-13   0.3464 5
#> CV:mclust   59         8.03e-05       0.074     4.15e-09   0.2242 5
#> MAD:mclust  79         1.15e-04       0.231     5.81e-12   0.1496 5
#> ATC:mclust  89         8.31e-07       0.120     1.82e-17   0.1541 5
#> SD:kmeans   84         7.86e-05       0.443     2.56e-14   0.0673 5
#> CV:kmeans   66         1.02e-04       0.191     1.61e-11   0.2423 5
#> MAD:kmeans  82         9.70e-05       0.187     1.56e-15   0.0497 5
#> ATC:kmeans  69         7.22e-04       0.258     9.31e-12   0.2071 5
#> SD:pam      76         2.44e-02       0.570     8.38e-10   0.1164 5
#> CV:pam      53         5.00e-03       0.413     1.39e-03   0.6961 5
#> MAD:pam     89         4.27e-03       0.663     1.34e-08   0.1969 5
#> ATC:pam     75         1.08e-04       0.334     6.07e-12   0.2391 5
#> SD:hclust   71         4.06e-04       0.815     5.03e-14   0.3725 5
#> CV:hclust   41         4.10e-04       0.341     1.08e-07   0.3823 5
#> MAD:hclust  73         7.71e-05       0.701     1.95e-15   0.0744 5
#> ATC:hclust  85         2.05e-03       0.103     3.40e-08   0.3582 5
test_to_known_factors(res_list, k = 6)
#>               n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF       63         5.59e-02      0.8694     2.11e-11   0.1213 6
#> CV:NMF       53         7.07e-02      0.7203     8.65e-10   0.1080 6
#> MAD:NMF      51         7.90e-02      0.8392     1.49e-11   0.3598 6
#> ATC:NMF      57         2.17e-03      0.9315     1.43e-10   0.8218 6
#> SD:skmeans   56         5.12e-05      0.7821     2.75e-09   0.2266 6
#> CV:skmeans   45         7.18e-03      0.3311     6.31e-08   0.0441 6
#> MAD:skmeans  54         2.48e-05      0.1813     7.58e-09   0.1809 6
#> ATC:skmeans  72         9.22e-04      0.6769     3.37e-13   0.6042 6
#> SD:mclust    90         1.04e-04      0.3602     4.01e-11   0.2976 6
#> CV:mclust    84         2.66e-04      0.3095     4.48e-10   0.4903 6
#> MAD:mclust   93         3.34e-05      0.2292     3.99e-11   0.2657 6
#> ATC:mclust   92         4.34e-06      0.0833     9.96e-15   0.1335 6
#> SD:kmeans    66         6.63e-02      0.3465     1.49e-10   0.1512 6
#> CV:kmeans    48         2.87e-03      0.0930     5.36e-09   0.1183 6
#> MAD:kmeans   61         2.76e-03      0.3095     5.40e-10   0.2320 6
#> ATC:kmeans  100         4.95e-05      0.6295     3.66e-13   0.3836 6
#> SD:pam       74         8.01e-02      0.7609     1.48e-07   0.2209 6
#> CV:pam       42         7.25e-03      0.7464     6.80e-04   0.4629 6
#> MAD:pam      54         2.94e-02      0.5759     6.07e-05   0.0453 6
#> ATC:pam      96         2.10e-06      0.2116     4.71e-15   0.0833 6
#> SD:hclust    60         3.27e-03      0.7202     3.94e-15   0.3439 6
#> CV:hclust    69         2.07e-04      0.5955     1.65e-16   0.1259 6
#> MAD:hclust   68         1.63e-03      0.6445     4.50e-15   0.0769 6
#> ATC:hclust   51         1.69e-02      0.1213     1.94e-06   0.3816 6

Results for each method


SD:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "hclust"]
# 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 21512 rows and 100 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)

plot of chunk SD-hclust-collect-plots

The plots are:

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:

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)

plot of chunk SD-hclust-select-partition-number

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.239           0.675       0.821         0.4382 0.529   0.529
#> 3 3 0.207           0.384       0.672         0.3664 0.791   0.655
#> 4 4 0.302           0.492       0.689         0.1453 0.807   0.611
#> 5 5 0.387           0.540       0.690         0.0763 0.911   0.734
#> 6 6 0.523           0.514       0.701         0.0610 0.964   0.863

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.1843    0.79589 0.972 0.028
#> GSM97145     1  0.1414    0.79524 0.980 0.020
#> GSM97147     2  0.9170    0.66404 0.332 0.668
#> GSM97125     1  0.1414    0.79524 0.980 0.020
#> GSM97127     1  0.1843    0.79214 0.972 0.028
#> GSM97130     1  0.6973    0.68136 0.812 0.188
#> GSM97133     1  0.1184    0.79626 0.984 0.016
#> GSM97134     1  0.9775    0.18757 0.588 0.412
#> GSM97120     1  0.0376    0.79614 0.996 0.004
#> GSM97126     1  0.9795    0.16879 0.584 0.416
#> GSM97112     1  0.0938    0.79842 0.988 0.012
#> GSM97115     1  0.9044    0.46729 0.680 0.320
#> GSM97116     1  0.0672    0.79765 0.992 0.008
#> GSM97117     2  0.9635    0.57084 0.388 0.612
#> GSM97119     1  0.0672    0.79812 0.992 0.008
#> GSM97122     1  0.0672    0.79812 0.992 0.008
#> GSM97135     1  0.0672    0.79812 0.992 0.008
#> GSM97136     2  0.9754    0.45856 0.408 0.592
#> GSM97139     1  0.0000    0.79435 1.000 0.000
#> GSM97146     1  0.0000    0.79435 1.000 0.000
#> GSM97123     2  0.1843    0.78410 0.028 0.972
#> GSM97129     1  0.9775    0.18757 0.588 0.412
#> GSM97143     1  0.7528    0.65733 0.784 0.216
#> GSM97113     1  0.9933   -0.00562 0.548 0.452
#> GSM97056     1  0.0938    0.79755 0.988 0.012
#> GSM97124     1  0.1184    0.79906 0.984 0.016
#> GSM97132     1  0.8267    0.60140 0.740 0.260
#> GSM97144     1  0.7219    0.66757 0.800 0.200
#> GSM97149     1  0.0000    0.79435 1.000 0.000
#> GSM97068     1  0.9983   -0.10058 0.524 0.476
#> GSM97071     2  0.7299    0.77846 0.204 0.796
#> GSM97086     2  0.6712    0.78945 0.176 0.824
#> GSM97103     2  0.2603    0.78832 0.044 0.956
#> GSM97057     1  0.9896    0.05481 0.560 0.440
#> GSM97060     2  0.0000    0.76364 0.000 1.000
#> GSM97075     2  0.8813    0.69977 0.300 0.700
#> GSM97098     2  0.2948    0.79134 0.052 0.948
#> GSM97099     2  0.9087    0.67161 0.324 0.676
#> GSM97101     2  0.9044    0.67688 0.320 0.680
#> GSM97105     2  0.5408    0.79947 0.124 0.876
#> GSM97106     2  0.0000    0.76364 0.000 1.000
#> GSM97121     2  0.9087    0.67507 0.324 0.676
#> GSM97128     2  0.9833    0.44221 0.424 0.576
#> GSM97131     2  0.4562    0.80011 0.096 0.904
#> GSM97137     1  0.3733    0.77199 0.928 0.072
#> GSM97118     1  0.8081    0.61868 0.752 0.248
#> GSM97114     2  0.9635    0.57084 0.388 0.612
#> GSM97142     1  0.0938    0.79842 0.988 0.012
#> GSM97140     2  0.8386    0.73240 0.268 0.732
#> GSM97141     2  0.9358    0.63565 0.352 0.648
#> GSM97055     1  0.8909    0.48777 0.692 0.308
#> GSM97090     1  0.9170    0.43864 0.668 0.332
#> GSM97091     1  0.1184    0.79872 0.984 0.016
#> GSM97148     1  0.0000    0.79435 1.000 0.000
#> GSM97063     1  0.1184    0.79872 0.984 0.016
#> GSM97053     1  0.0000    0.79435 1.000 0.000
#> GSM97066     2  0.2778    0.79060 0.048 0.952
#> GSM97079     2  0.6712    0.78945 0.176 0.824
#> GSM97083     2  0.9833    0.44221 0.424 0.576
#> GSM97084     2  0.7219    0.78012 0.200 0.800
#> GSM97094     2  0.7376    0.77554 0.208 0.792
#> GSM97096     2  0.2948    0.79134 0.052 0.948
#> GSM97097     2  0.7139    0.78118 0.196 0.804
#> GSM97107     2  0.7299    0.77839 0.204 0.796
#> GSM97054     2  0.7299    0.77846 0.204 0.796
#> GSM97062     2  0.6712    0.78945 0.176 0.824
#> GSM97069     2  0.1843    0.78307 0.028 0.972
#> GSM97070     2  0.2778    0.79060 0.048 0.952
#> GSM97073     2  0.3733    0.79732 0.072 0.928
#> GSM97076     2  0.9460    0.55757 0.364 0.636
#> GSM97077     2  0.8443    0.72606 0.272 0.728
#> GSM97095     1  0.9988   -0.11366 0.520 0.480
#> GSM97102     2  0.2603    0.78832 0.044 0.956
#> GSM97109     2  0.6623    0.77711 0.172 0.828
#> GSM97110     2  0.6623    0.77711 0.172 0.828
#> GSM97074     2  0.9686    0.47313 0.396 0.604
#> GSM97085     2  0.9710    0.49580 0.400 0.600
#> GSM97059     2  0.9209    0.65480 0.336 0.664
#> GSM97072     2  0.0000    0.76364 0.000 1.000
#> GSM97078     2  0.9815    0.44974 0.420 0.580
#> GSM97067     2  0.1843    0.78307 0.028 0.972
#> GSM97087     2  0.0376    0.76637 0.004 0.996
#> GSM97111     2  0.9427    0.61998 0.360 0.640
#> GSM97064     2  0.5737    0.80022 0.136 0.864
#> GSM97065     2  0.8861    0.67617 0.304 0.696
#> GSM97081     2  0.5178    0.80395 0.116 0.884
#> GSM97082     2  0.4562    0.79923 0.096 0.904
#> GSM97088     2  0.9775    0.46593 0.412 0.588
#> GSM97100     2  0.7883    0.75665 0.236 0.764
#> GSM97104     2  0.0672    0.76945 0.008 0.992
#> GSM97108     2  0.8555    0.71910 0.280 0.720
#> GSM97050     2  0.5842    0.80097 0.140 0.860
#> GSM97080     2  0.1633    0.78041 0.024 0.976
#> GSM97089     2  0.0672    0.76981 0.008 0.992
#> GSM97092     2  0.0938    0.77312 0.012 0.988
#> GSM97093     2  0.9170    0.62025 0.332 0.668
#> GSM97058     2  0.8327    0.73564 0.264 0.736
#> GSM97051     2  0.4939    0.79952 0.108 0.892
#> GSM97052     2  0.0000    0.76364 0.000 1.000
#> GSM97061     2  0.2043    0.78587 0.032 0.968

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1   0.456    0.79943 0.860 0.060 0.080
#> GSM97145     1   0.362    0.78540 0.896 0.072 0.032
#> GSM97147     2   0.478    0.50461 0.200 0.796 0.004
#> GSM97125     1   0.350    0.78674 0.900 0.072 0.028
#> GSM97127     1   0.392    0.78020 0.884 0.080 0.036
#> GSM97130     1   0.812    0.59915 0.640 0.224 0.136
#> GSM97133     1   0.386    0.78257 0.888 0.072 0.040
#> GSM97134     2   0.831    0.07345 0.420 0.500 0.080
#> GSM97120     1   0.337    0.78616 0.908 0.052 0.040
#> GSM97126     2   0.832    0.07186 0.424 0.496 0.080
#> GSM97112     1   0.471    0.79569 0.852 0.056 0.092
#> GSM97115     1   0.902    0.27249 0.496 0.364 0.140
#> GSM97116     1   0.293    0.78551 0.924 0.036 0.040
#> GSM97117     2   0.590    0.48977 0.244 0.736 0.020
#> GSM97119     1   0.453    0.79737 0.860 0.052 0.088
#> GSM97122     1   0.453    0.79737 0.860 0.052 0.088
#> GSM97135     1   0.453    0.79737 0.860 0.052 0.088
#> GSM97136     2   0.867    0.39584 0.272 0.580 0.148
#> GSM97139     1   0.326    0.78664 0.912 0.048 0.040
#> GSM97146     1   0.253    0.77393 0.936 0.020 0.044
#> GSM97123     2   0.625   -0.70151 0.000 0.556 0.444
#> GSM97129     2   0.831    0.07345 0.420 0.500 0.080
#> GSM97143     1   0.847    0.58010 0.604 0.252 0.144
#> GSM97113     2   0.773    0.20581 0.436 0.516 0.048
#> GSM97056     1   0.438    0.79128 0.868 0.064 0.068
#> GSM97124     1   0.482    0.79736 0.848 0.064 0.088
#> GSM97132     1   0.872    0.51827 0.576 0.272 0.152
#> GSM97144     1   0.829    0.57622 0.624 0.236 0.140
#> GSM97149     1   0.253    0.77393 0.936 0.020 0.044
#> GSM97068     2   0.813    0.30047 0.356 0.564 0.080
#> GSM97071     2   0.622    0.39330 0.016 0.688 0.296
#> GSM97086     2   0.492    0.41526 0.020 0.816 0.164
#> GSM97103     2   0.675   -0.57993 0.012 0.556 0.432
#> GSM97057     2   0.757    0.16707 0.452 0.508 0.040
#> GSM97060     3   0.620    0.93164 0.000 0.424 0.576
#> GSM97075     2   0.517    0.49013 0.172 0.804 0.024
#> GSM97098     2   0.669   -0.51159 0.012 0.580 0.408
#> GSM97099     2   0.497    0.49439 0.188 0.800 0.012
#> GSM97101     2   0.520    0.49552 0.184 0.796 0.020
#> GSM97105     2   0.287    0.36469 0.008 0.916 0.076
#> GSM97106     3   0.620    0.93164 0.000 0.424 0.576
#> GSM97121     2   0.649    0.48803 0.192 0.744 0.064
#> GSM97128     2   0.923    0.21235 0.152 0.428 0.420
#> GSM97131     2   0.357    0.28642 0.004 0.876 0.120
#> GSM97137     1   0.611    0.73870 0.780 0.140 0.080
#> GSM97118     1   0.879    0.53817 0.572 0.268 0.160
#> GSM97114     2   0.590    0.48977 0.244 0.736 0.020
#> GSM97142     1   0.471    0.79569 0.852 0.056 0.092
#> GSM97140     2   0.362    0.48739 0.136 0.864 0.000
#> GSM97141     2   0.550    0.49954 0.208 0.772 0.020
#> GSM97055     1   0.948    0.32876 0.468 0.336 0.196
#> GSM97090     1   0.909    0.22949 0.480 0.376 0.144
#> GSM97091     1   0.479    0.79487 0.848 0.056 0.096
#> GSM97148     1   0.253    0.77393 0.936 0.020 0.044
#> GSM97063     1   0.479    0.79487 0.848 0.056 0.096
#> GSM97053     1   0.418    0.79971 0.876 0.052 0.072
#> GSM97066     2   0.615   -0.30884 0.004 0.640 0.356
#> GSM97079     2   0.492    0.41526 0.020 0.816 0.164
#> GSM97083     2   0.923    0.21432 0.152 0.432 0.416
#> GSM97084     2   0.594    0.40154 0.020 0.732 0.248
#> GSM97094     2   0.626    0.40057 0.032 0.724 0.244
#> GSM97096     2   0.669   -0.51159 0.012 0.580 0.408
#> GSM97097     2   0.577    0.40275 0.020 0.748 0.232
#> GSM97107     2   0.598    0.40154 0.020 0.728 0.252
#> GSM97054     2   0.622    0.39330 0.016 0.688 0.296
#> GSM97062     2   0.492    0.41526 0.020 0.816 0.164
#> GSM97069     2   0.642   -0.56906 0.004 0.572 0.424
#> GSM97070     2   0.615   -0.30884 0.004 0.640 0.356
#> GSM97073     2   0.581   -0.14119 0.004 0.692 0.304
#> GSM97076     2   0.825    0.41096 0.252 0.620 0.128
#> GSM97077     2   0.392    0.48488 0.140 0.856 0.004
#> GSM97095     2   0.804    0.30703 0.352 0.572 0.076
#> GSM97102     2   0.675   -0.57993 0.012 0.556 0.432
#> GSM97109     2   0.826   -0.02498 0.112 0.604 0.284
#> GSM97110     2   0.826   -0.02498 0.112 0.604 0.284
#> GSM97074     2   0.911    0.39781 0.244 0.548 0.208
#> GSM97085     2   0.910    0.27059 0.140 0.456 0.404
#> GSM97059     2   0.496    0.50261 0.200 0.792 0.008
#> GSM97072     2   0.625   -0.58233 0.000 0.556 0.444
#> GSM97078     2   0.919    0.21578 0.148 0.432 0.420
#> GSM97067     2   0.617   -0.35908 0.004 0.636 0.360
#> GSM97087     3   0.621    0.93227 0.000 0.428 0.572
#> GSM97111     2   0.617    0.47971 0.224 0.740 0.036
#> GSM97064     2   0.684    0.03105 0.056 0.704 0.240
#> GSM97065     2   0.748    0.42081 0.192 0.692 0.116
#> GSM97081     2   0.614   -0.00138 0.032 0.736 0.232
#> GSM97082     3   0.665    0.74343 0.008 0.456 0.536
#> GSM97088     2   0.922    0.23764 0.152 0.440 0.408
#> GSM97100     2   0.392    0.47786 0.112 0.872 0.016
#> GSM97104     3   0.623    0.90486 0.000 0.436 0.564
#> GSM97108     2   0.423    0.49012 0.148 0.844 0.008
#> GSM97050     2   0.321    0.37734 0.028 0.912 0.060
#> GSM97080     2   0.627   -0.65278 0.000 0.544 0.456
#> GSM97089     3   0.622    0.93031 0.000 0.432 0.568
#> GSM97092     3   0.627    0.90614 0.000 0.452 0.548
#> GSM97093     2   0.818    0.41133 0.208 0.640 0.152
#> GSM97058     2   0.420    0.47993 0.136 0.852 0.012
#> GSM97051     2   0.286    0.34059 0.004 0.912 0.084
#> GSM97052     3   0.621    0.93230 0.000 0.428 0.572
#> GSM97061     2   0.624   -0.68452 0.000 0.560 0.440

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1   0.382     0.7157 0.840 0.040 0.000 0.120
#> GSM97145     1   0.300     0.7162 0.892 0.064 0.000 0.044
#> GSM97147     2   0.450     0.5842 0.200 0.776 0.008 0.016
#> GSM97125     1   0.316     0.7177 0.884 0.064 0.000 0.052
#> GSM97127     1   0.297     0.7116 0.892 0.072 0.000 0.036
#> GSM97130     1   0.722     0.4410 0.576 0.124 0.016 0.284
#> GSM97133     1   0.230     0.7068 0.920 0.064 0.000 0.016
#> GSM97134     2   0.797     0.1496 0.380 0.436 0.020 0.164
#> GSM97120     1   0.191     0.7159 0.940 0.040 0.000 0.020
#> GSM97126     2   0.797     0.1491 0.380 0.436 0.020 0.164
#> GSM97112     1   0.430     0.6783 0.752 0.008 0.000 0.240
#> GSM97115     1   0.815     0.1921 0.468 0.272 0.020 0.240
#> GSM97116     1   0.172     0.7150 0.948 0.020 0.000 0.032
#> GSM97117     2   0.518     0.5658 0.252 0.716 0.020 0.012
#> GSM97119     1   0.423     0.6838 0.760 0.008 0.000 0.232
#> GSM97122     1   0.423     0.6838 0.760 0.008 0.000 0.232
#> GSM97135     1   0.423     0.6838 0.760 0.008 0.000 0.232
#> GSM97136     2   0.943     0.2866 0.220 0.428 0.172 0.180
#> GSM97139     1   0.171     0.7137 0.948 0.036 0.000 0.016
#> GSM97146     1   0.117     0.7002 0.968 0.012 0.000 0.020
#> GSM97123     3   0.537     0.6458 0.000 0.364 0.616 0.020
#> GSM97129     2   0.797     0.1496 0.380 0.436 0.020 0.164
#> GSM97143     1   0.786     0.3654 0.508 0.116 0.040 0.336
#> GSM97113     2   0.647     0.3214 0.456 0.492 0.024 0.028
#> GSM97056     1   0.420     0.6947 0.828 0.040 0.008 0.124
#> GSM97124     1   0.454     0.6867 0.752 0.020 0.000 0.228
#> GSM97132     1   0.794     0.3074 0.488 0.120 0.040 0.352
#> GSM97144     1   0.744     0.4161 0.556 0.132 0.020 0.292
#> GSM97149     1   0.130     0.7002 0.964 0.016 0.000 0.020
#> GSM97068     2   0.742     0.3497 0.328 0.524 0.012 0.136
#> GSM97071     2   0.677     0.1000 0.008 0.504 0.072 0.416
#> GSM97086     2   0.567     0.4374 0.012 0.744 0.124 0.120
#> GSM97103     3   0.544     0.6576 0.000 0.288 0.672 0.040
#> GSM97057     2   0.610     0.2916 0.472 0.492 0.012 0.024
#> GSM97060     3   0.400     0.6959 0.000 0.164 0.812 0.024
#> GSM97075     2   0.469     0.5671 0.176 0.780 0.040 0.004
#> GSM97098     3   0.569     0.6196 0.000 0.336 0.624 0.040
#> GSM97099     2   0.414     0.5747 0.196 0.788 0.016 0.000
#> GSM97101     2   0.449     0.5727 0.192 0.780 0.024 0.004
#> GSM97105     2   0.352     0.4234 0.004 0.852 0.128 0.016
#> GSM97106     3   0.409     0.6973 0.000 0.172 0.804 0.024
#> GSM97121     2   0.636     0.5562 0.192 0.700 0.060 0.048
#> GSM97128     4   0.327     0.8445 0.032 0.076 0.008 0.884
#> GSM97131     2   0.457     0.3278 0.004 0.772 0.200 0.024
#> GSM97137     1   0.575     0.6267 0.724 0.092 0.008 0.176
#> GSM97118     1   0.816     0.2796 0.472 0.128 0.048 0.352
#> GSM97114     2   0.518     0.5658 0.252 0.716 0.020 0.012
#> GSM97142     1   0.430     0.6783 0.752 0.008 0.000 0.240
#> GSM97140     2   0.421     0.5653 0.136 0.824 0.028 0.012
#> GSM97141     2   0.476     0.5779 0.216 0.756 0.020 0.008
#> GSM97055     4   0.849     0.0452 0.352 0.160 0.052 0.436
#> GSM97090     1   0.810     0.1467 0.440 0.284 0.012 0.264
#> GSM97091     1   0.460     0.6625 0.732 0.008 0.004 0.256
#> GSM97148     1   0.130     0.7002 0.964 0.016 0.000 0.020
#> GSM97063     1   0.460     0.6625 0.732 0.008 0.004 0.256
#> GSM97053     1   0.409     0.6915 0.776 0.008 0.000 0.216
#> GSM97066     3   0.672     0.3926 0.004 0.444 0.476 0.076
#> GSM97079     2   0.567     0.4374 0.012 0.744 0.124 0.120
#> GSM97083     4   0.313     0.8431 0.032 0.076 0.004 0.888
#> GSM97084     2   0.679     0.3465 0.012 0.632 0.124 0.232
#> GSM97094     2   0.710     0.3252 0.024 0.616 0.120 0.240
#> GSM97096     3   0.569     0.6196 0.000 0.336 0.624 0.040
#> GSM97097     2   0.676     0.3545 0.012 0.640 0.132 0.216
#> GSM97107     2   0.682     0.3413 0.012 0.628 0.124 0.236
#> GSM97054     2   0.677     0.1000 0.008 0.504 0.072 0.416
#> GSM97062     2   0.567     0.4374 0.012 0.744 0.124 0.120
#> GSM97069     3   0.628     0.5865 0.004 0.332 0.600 0.064
#> GSM97070     3   0.672     0.3926 0.004 0.444 0.476 0.076
#> GSM97073     2   0.694    -0.3359 0.008 0.480 0.428 0.084
#> GSM97076     2   0.897     0.3390 0.252 0.476 0.132 0.140
#> GSM97077     2   0.423     0.5627 0.140 0.820 0.032 0.008
#> GSM97095     2   0.733     0.3687 0.324 0.536 0.012 0.128
#> GSM97102     3   0.544     0.6576 0.000 0.288 0.672 0.040
#> GSM97109     2   0.790    -0.2140 0.108 0.440 0.412 0.040
#> GSM97110     2   0.790    -0.2140 0.108 0.440 0.412 0.040
#> GSM97074     2   0.964    -0.0245 0.196 0.336 0.152 0.316
#> GSM97085     4   0.487     0.8121 0.028 0.132 0.040 0.800
#> GSM97059     2   0.496     0.5816 0.200 0.760 0.020 0.020
#> GSM97072     3   0.579     0.5382 0.000 0.384 0.580 0.036
#> GSM97078     4   0.317     0.8449 0.028 0.076 0.008 0.888
#> GSM97067     3   0.660     0.4302 0.004 0.432 0.496 0.068
#> GSM97087     3   0.415     0.6986 0.000 0.168 0.804 0.028
#> GSM97111     2   0.632     0.5362 0.220 0.684 0.068 0.028
#> GSM97064     2   0.631     0.0185 0.052 0.608 0.328 0.012
#> GSM97065     2   0.850     0.3649 0.200 0.544 0.140 0.116
#> GSM97081     2   0.653    -0.1799 0.020 0.568 0.368 0.044
#> GSM97082     3   0.608     0.6589 0.008 0.192 0.696 0.104
#> GSM97088     4   0.417     0.8304 0.024 0.116 0.024 0.836
#> GSM97100     2   0.422     0.5520 0.108 0.836 0.040 0.016
#> GSM97104     3   0.365     0.7040 0.000 0.152 0.832 0.016
#> GSM97108     2   0.419     0.5693 0.152 0.816 0.024 0.008
#> GSM97050     2   0.416     0.4476 0.028 0.840 0.108 0.024
#> GSM97080     3   0.567     0.6523 0.004 0.296 0.660 0.040
#> GSM97089     3   0.419     0.6994 0.000 0.172 0.800 0.028
#> GSM97092     3   0.464     0.7036 0.000 0.228 0.748 0.024
#> GSM97093     2   0.852     0.4059 0.196 0.528 0.192 0.084
#> GSM97058     2   0.412     0.5568 0.136 0.820 0.044 0.000
#> GSM97051     2   0.384     0.4001 0.004 0.836 0.136 0.024
#> GSM97052     3   0.427     0.7049 0.000 0.188 0.788 0.024
#> GSM97061     3   0.557     0.6368 0.000 0.368 0.604 0.028

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1   0.347     0.7115 0.836 0.044 0.000 0.004 0.116
#> GSM97145     1   0.260     0.7161 0.896 0.060 0.000 0.004 0.040
#> GSM97147     2   0.336     0.6348 0.164 0.816 0.000 0.000 0.020
#> GSM97125     1   0.275     0.7175 0.888 0.060 0.000 0.004 0.048
#> GSM97127     1   0.257     0.7121 0.896 0.068 0.000 0.004 0.032
#> GSM97130     1   0.702     0.4682 0.556 0.088 0.000 0.112 0.244
#> GSM97133     1   0.197     0.7071 0.924 0.060 0.000 0.004 0.012
#> GSM97134     2   0.755     0.2076 0.360 0.428 0.016 0.040 0.156
#> GSM97120     1   0.184     0.7130 0.936 0.040 0.000 0.008 0.016
#> GSM97126     2   0.758     0.2129 0.352 0.436 0.016 0.044 0.152
#> GSM97112     1   0.348     0.6750 0.752 0.000 0.000 0.000 0.248
#> GSM97115     1   0.781     0.2050 0.452 0.256 0.000 0.104 0.188
#> GSM97116     1   0.169     0.7118 0.944 0.020 0.000 0.008 0.028
#> GSM97117     2   0.446     0.6205 0.212 0.748 0.012 0.016 0.012
#> GSM97119     1   0.342     0.6807 0.760 0.000 0.000 0.000 0.240
#> GSM97122     1   0.342     0.6807 0.760 0.000 0.000 0.000 0.240
#> GSM97135     1   0.342     0.6807 0.760 0.000 0.000 0.000 0.240
#> GSM97136     2   0.917     0.2182 0.208 0.392 0.156 0.072 0.172
#> GSM97139     1   0.165     0.7108 0.944 0.036 0.000 0.008 0.012
#> GSM97146     1   0.131     0.6989 0.960 0.016 0.000 0.012 0.012
#> GSM97123     3   0.496     0.5726 0.000 0.352 0.608 0.040 0.000
#> GSM97129     2   0.755     0.2076 0.360 0.428 0.016 0.040 0.156
#> GSM97143     1   0.734     0.3815 0.504 0.076 0.036 0.052 0.332
#> GSM97113     2   0.537     0.4003 0.420 0.540 0.008 0.024 0.008
#> GSM97056     1   0.420     0.6898 0.808 0.028 0.000 0.060 0.104
#> GSM97124     1   0.403     0.6842 0.744 0.016 0.000 0.004 0.236
#> GSM97132     1   0.767     0.3425 0.472 0.084 0.032 0.076 0.336
#> GSM97144     1   0.720     0.4480 0.536 0.096 0.000 0.120 0.248
#> GSM97149     1   0.151     0.6984 0.952 0.024 0.000 0.012 0.012
#> GSM97068     2   0.705     0.3880 0.304 0.512 0.000 0.064 0.120
#> GSM97071     4   0.622     0.7479 0.000 0.196 0.000 0.544 0.260
#> GSM97086     2   0.492    -0.2177 0.000 0.552 0.004 0.424 0.020
#> GSM97103     3   0.557     0.6886 0.000 0.164 0.700 0.100 0.036
#> GSM97057     2   0.505     0.3760 0.436 0.536 0.000 0.020 0.008
#> GSM97060     3   0.290     0.6755 0.000 0.108 0.864 0.028 0.000
#> GSM97075     2   0.378     0.6361 0.140 0.820 0.020 0.008 0.012
#> GSM97098     3   0.588     0.6641 0.000 0.220 0.656 0.084 0.040
#> GSM97099     2   0.341     0.6359 0.156 0.824 0.008 0.004 0.008
#> GSM97101     2   0.364     0.6350 0.156 0.816 0.012 0.008 0.008
#> GSM97105     2   0.314     0.5011 0.000 0.864 0.076 0.056 0.004
#> GSM97106     3   0.300     0.6757 0.000 0.116 0.856 0.028 0.000
#> GSM97121     2   0.550     0.5672 0.164 0.728 0.032 0.044 0.032
#> GSM97128     5   0.158     0.7137 0.032 0.000 0.000 0.024 0.944
#> GSM97131     2   0.447     0.4200 0.000 0.768 0.148 0.076 0.008
#> GSM97137     1   0.572     0.6270 0.700 0.068 0.000 0.080 0.152
#> GSM97118     1   0.768     0.2985 0.464 0.084 0.040 0.064 0.348
#> GSM97114     2   0.446     0.6205 0.212 0.748 0.012 0.016 0.012
#> GSM97142     1   0.348     0.6750 0.752 0.000 0.000 0.000 0.248
#> GSM97140     2   0.302     0.6219 0.104 0.868 0.004 0.012 0.012
#> GSM97141     2   0.382     0.6336 0.176 0.796 0.012 0.012 0.004
#> GSM97055     5   0.751     0.0904 0.336 0.104 0.052 0.028 0.480
#> GSM97090     1   0.793     0.1721 0.420 0.268 0.000 0.100 0.212
#> GSM97091     1   0.374     0.6595 0.732 0.000 0.004 0.000 0.264
#> GSM97148     1   0.151     0.6984 0.952 0.024 0.000 0.012 0.012
#> GSM97063     1   0.374     0.6595 0.732 0.000 0.004 0.000 0.264
#> GSM97053     1   0.331     0.6885 0.776 0.000 0.000 0.000 0.224
#> GSM97066     3   0.697     0.5459 0.000 0.284 0.504 0.180 0.032
#> GSM97079     2   0.494    -0.2604 0.000 0.536 0.004 0.440 0.020
#> GSM97083     5   0.167     0.7127 0.032 0.000 0.000 0.028 0.940
#> GSM97084     4   0.408     0.8798 0.000 0.228 0.000 0.744 0.028
#> GSM97094     4   0.464     0.8773 0.012 0.220 0.000 0.728 0.040
#> GSM97096     3   0.588     0.6641 0.000 0.220 0.656 0.084 0.040
#> GSM97097     4   0.409     0.8761 0.000 0.228 0.008 0.748 0.016
#> GSM97107     4   0.413     0.8822 0.000 0.224 0.000 0.744 0.032
#> GSM97054     4   0.622     0.7479 0.000 0.196 0.000 0.544 0.260
#> GSM97062     2   0.494    -0.2604 0.000 0.536 0.004 0.440 0.020
#> GSM97069     3   0.608     0.6457 0.000 0.220 0.628 0.128 0.024
#> GSM97070     3   0.697     0.5459 0.000 0.284 0.504 0.180 0.032
#> GSM97073     3   0.733     0.5061 0.000 0.312 0.448 0.196 0.044
#> GSM97076     2   0.940     0.0650 0.228 0.340 0.124 0.216 0.092
#> GSM97077     2   0.281     0.6281 0.108 0.872 0.008 0.000 0.012
#> GSM97095     2   0.693     0.3977 0.304 0.524 0.000 0.060 0.112
#> GSM97102     3   0.557     0.6886 0.000 0.164 0.700 0.100 0.036
#> GSM97109     3   0.778     0.3150 0.076 0.392 0.416 0.076 0.040
#> GSM97110     3   0.778     0.3150 0.076 0.392 0.416 0.076 0.040
#> GSM97074     5   0.972     0.1914 0.180 0.212 0.124 0.176 0.308
#> GSM97085     5   0.338     0.6819 0.020 0.032 0.040 0.032 0.876
#> GSM97059     2   0.368     0.6273 0.168 0.804 0.000 0.008 0.020
#> GSM97072     3   0.605     0.6245 0.000 0.228 0.604 0.160 0.008
#> GSM97078     5   0.158     0.7123 0.028 0.000 0.000 0.028 0.944
#> GSM97067     3   0.688     0.5654 0.000 0.280 0.512 0.180 0.028
#> GSM97087     3   0.312     0.6800 0.000 0.120 0.852 0.024 0.004
#> GSM97111     2   0.576     0.6023 0.188 0.700 0.052 0.024 0.036
#> GSM97064     2   0.479     0.1617 0.024 0.652 0.316 0.008 0.000
#> GSM97065     2   0.884     0.2025 0.176 0.452 0.128 0.168 0.076
#> GSM97081     2   0.646    -0.1268 0.016 0.540 0.356 0.036 0.052
#> GSM97082     3   0.498     0.6375 0.000 0.124 0.748 0.024 0.104
#> GSM97088     5   0.250     0.7068 0.020 0.020 0.016 0.028 0.916
#> GSM97100     2   0.274     0.6053 0.076 0.892 0.008 0.016 0.008
#> GSM97104     3   0.319     0.6860 0.000 0.088 0.864 0.036 0.012
#> GSM97108     2   0.355     0.6307 0.120 0.840 0.012 0.008 0.020
#> GSM97050     2   0.311     0.5345 0.008 0.880 0.064 0.036 0.012
#> GSM97080     3   0.546     0.6843 0.000 0.184 0.696 0.096 0.024
#> GSM97089     3   0.325     0.6794 0.000 0.120 0.848 0.024 0.008
#> GSM97092     3   0.369     0.6809 0.000 0.200 0.780 0.020 0.000
#> GSM97093     2   0.786     0.4470 0.176 0.532 0.180 0.036 0.076
#> GSM97058     2   0.293     0.6276 0.100 0.872 0.020 0.004 0.004
#> GSM97051     2   0.363     0.4860 0.000 0.836 0.092 0.064 0.008
#> GSM97052     3   0.311     0.6861 0.000 0.140 0.840 0.020 0.000
#> GSM97061     3   0.462     0.5977 0.000 0.340 0.636 0.024 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.4440     0.6577 0.764 0.060 0.000 0.000 0.112 0.064
#> GSM97145     1  0.2302     0.6740 0.900 0.060 0.000 0.000 0.032 0.008
#> GSM97147     2  0.3519     0.6966 0.136 0.820 0.008 0.008 0.016 0.012
#> GSM97125     1  0.2445     0.6749 0.892 0.060 0.000 0.000 0.040 0.008
#> GSM97127     1  0.2350     0.6719 0.900 0.064 0.000 0.004 0.024 0.008
#> GSM97130     1  0.7203     0.4232 0.528 0.064 0.004 0.124 0.224 0.056
#> GSM97133     1  0.2146     0.6667 0.908 0.060 0.000 0.000 0.008 0.024
#> GSM97134     2  0.7206     0.2036 0.352 0.420 0.004 0.020 0.128 0.076
#> GSM97120     1  0.2291     0.6653 0.904 0.040 0.000 0.000 0.012 0.044
#> GSM97126     2  0.7229     0.2183 0.332 0.432 0.004 0.016 0.124 0.092
#> GSM97112     1  0.3695     0.6221 0.732 0.000 0.000 0.000 0.244 0.024
#> GSM97115     1  0.8001     0.2026 0.424 0.236 0.004 0.104 0.172 0.060
#> GSM97116     1  0.3078     0.6445 0.856 0.028 0.000 0.000 0.032 0.084
#> GSM97117     2  0.4050     0.6732 0.180 0.764 0.008 0.012 0.000 0.036
#> GSM97119     1  0.3645     0.6281 0.740 0.000 0.000 0.000 0.236 0.024
#> GSM97122     1  0.3645     0.6281 0.740 0.000 0.000 0.000 0.236 0.024
#> GSM97135     1  0.3645     0.6281 0.740 0.000 0.000 0.000 0.236 0.024
#> GSM97136     2  0.8871     0.0961 0.188 0.324 0.128 0.012 0.124 0.224
#> GSM97139     1  0.2728     0.6476 0.872 0.040 0.000 0.000 0.008 0.080
#> GSM97146     1  0.3031     0.6198 0.852 0.032 0.000 0.000 0.016 0.100
#> GSM97123     3  0.5077     0.3700 0.000 0.308 0.616 0.036 0.000 0.040
#> GSM97129     2  0.7206     0.2036 0.352 0.420 0.004 0.020 0.128 0.076
#> GSM97143     1  0.6923     0.3281 0.468 0.060 0.012 0.000 0.284 0.176
#> GSM97113     2  0.5207     0.4488 0.352 0.564 0.000 0.000 0.012 0.072
#> GSM97056     1  0.5045     0.6328 0.744 0.016 0.004 0.064 0.100 0.072
#> GSM97124     1  0.3914     0.6356 0.740 0.012 0.000 0.004 0.228 0.016
#> GSM97132     1  0.7387     0.2972 0.444 0.064 0.016 0.012 0.280 0.184
#> GSM97144     1  0.7312     0.4088 0.512 0.072 0.004 0.128 0.232 0.052
#> GSM97149     1  0.3172     0.6184 0.844 0.040 0.000 0.000 0.016 0.100
#> GSM97068     2  0.7401     0.3941 0.264 0.496 0.012 0.076 0.108 0.044
#> GSM97071     4  0.4689     0.7158 0.000 0.040 0.004 0.680 0.256 0.020
#> GSM97086     2  0.4892     0.1418 0.000 0.524 0.004 0.432 0.012 0.028
#> GSM97103     3  0.4825     0.4116 0.000 0.044 0.620 0.016 0.000 0.320
#> GSM97057     2  0.5181     0.4347 0.360 0.560 0.000 0.000 0.012 0.068
#> GSM97060     3  0.1503     0.5788 0.000 0.016 0.944 0.008 0.000 0.032
#> GSM97075     2  0.3741     0.6896 0.116 0.816 0.032 0.004 0.004 0.028
#> GSM97098     3  0.5473     0.4119 0.000 0.100 0.584 0.012 0.004 0.300
#> GSM97099     2  0.3346     0.6928 0.116 0.836 0.016 0.004 0.004 0.024
#> GSM97101     2  0.3670     0.6890 0.128 0.816 0.020 0.008 0.004 0.024
#> GSM97105     2  0.3366     0.6100 0.000 0.844 0.060 0.052 0.000 0.044
#> GSM97106     3  0.1838     0.5796 0.000 0.020 0.928 0.012 0.000 0.040
#> GSM97121     2  0.5418     0.6522 0.152 0.712 0.020 0.032 0.020 0.064
#> GSM97128     5  0.0632     0.8144 0.024 0.000 0.000 0.000 0.976 0.000
#> GSM97131     2  0.5032     0.5196 0.000 0.724 0.132 0.084 0.008 0.052
#> GSM97137     1  0.6263     0.5729 0.648 0.044 0.004 0.100 0.140 0.064
#> GSM97118     1  0.7121     0.2448 0.428 0.064 0.012 0.000 0.292 0.204
#> GSM97114     2  0.4050     0.6732 0.180 0.764 0.008 0.012 0.000 0.036
#> GSM97142     1  0.3695     0.6221 0.732 0.000 0.000 0.000 0.244 0.024
#> GSM97140     2  0.3024     0.6918 0.084 0.868 0.016 0.012 0.008 0.012
#> GSM97141     2  0.3416     0.6912 0.140 0.816 0.008 0.004 0.000 0.032
#> GSM97055     5  0.7886     0.1630 0.284 0.080 0.040 0.012 0.408 0.176
#> GSM97090     1  0.8173     0.1825 0.388 0.244 0.004 0.104 0.196 0.064
#> GSM97091     1  0.3956     0.6054 0.712 0.000 0.000 0.000 0.252 0.036
#> GSM97148     1  0.3172     0.6184 0.844 0.040 0.000 0.000 0.016 0.100
#> GSM97063     1  0.3956     0.6054 0.712 0.000 0.000 0.000 0.252 0.036
#> GSM97053     1  0.3190     0.6427 0.772 0.000 0.000 0.000 0.220 0.008
#> GSM97066     6  0.4482     0.4816 0.000 0.040 0.360 0.000 0.000 0.600
#> GSM97079     2  0.4772     0.0991 0.000 0.512 0.004 0.452 0.012 0.020
#> GSM97083     5  0.0777     0.8134 0.024 0.000 0.000 0.004 0.972 0.000
#> GSM97084     4  0.1370     0.8695 0.000 0.036 0.000 0.948 0.004 0.012
#> GSM97094     4  0.1767     0.8649 0.012 0.036 0.000 0.932 0.020 0.000
#> GSM97096     3  0.5473     0.4119 0.000 0.100 0.584 0.012 0.004 0.300
#> GSM97097     4  0.1080     0.8658 0.000 0.032 0.004 0.960 0.000 0.004
#> GSM97107     4  0.1409     0.8699 0.000 0.032 0.000 0.948 0.008 0.012
#> GSM97054     4  0.4689     0.7158 0.000 0.040 0.004 0.680 0.256 0.020
#> GSM97062     2  0.4772     0.0991 0.000 0.512 0.004 0.452 0.012 0.020
#> GSM97069     3  0.4372    -0.1643 0.000 0.024 0.544 0.000 0.000 0.432
#> GSM97070     6  0.4482     0.4816 0.000 0.040 0.360 0.000 0.000 0.600
#> GSM97073     6  0.4377     0.4825 0.000 0.044 0.312 0.000 0.000 0.644
#> GSM97076     6  0.4382     0.4155 0.164 0.104 0.000 0.000 0.004 0.728
#> GSM97077     2  0.2688     0.6910 0.084 0.880 0.020 0.004 0.008 0.004
#> GSM97095     2  0.7353     0.4062 0.264 0.500 0.012 0.080 0.104 0.040
#> GSM97102     3  0.4825     0.4116 0.000 0.044 0.620 0.016 0.000 0.320
#> GSM97109     3  0.7202     0.1556 0.048 0.284 0.368 0.008 0.004 0.288
#> GSM97110     3  0.7202     0.1556 0.048 0.284 0.368 0.008 0.004 0.288
#> GSM97074     6  0.6218     0.0737 0.148 0.048 0.008 0.000 0.216 0.580
#> GSM97085     5  0.3331     0.7613 0.016 0.008 0.032 0.000 0.840 0.104
#> GSM97059     2  0.3968     0.6946 0.128 0.804 0.012 0.012 0.016 0.028
#> GSM97072     6  0.4535     0.2384 0.000 0.024 0.472 0.004 0.000 0.500
#> GSM97078     5  0.0632     0.8142 0.024 0.000 0.000 0.000 0.976 0.000
#> GSM97067     6  0.4419     0.4460 0.000 0.032 0.384 0.000 0.000 0.584
#> GSM97087     3  0.0922     0.5832 0.000 0.024 0.968 0.004 0.004 0.000
#> GSM97111     2  0.5635     0.6271 0.160 0.680 0.044 0.012 0.008 0.096
#> GSM97064     2  0.4532     0.3031 0.020 0.628 0.336 0.004 0.000 0.012
#> GSM97065     6  0.5713     0.3398 0.116 0.264 0.008 0.012 0.004 0.596
#> GSM97081     2  0.6628     0.0187 0.012 0.480 0.336 0.020 0.016 0.136
#> GSM97082     3  0.3608     0.5160 0.000 0.024 0.828 0.004 0.068 0.076
#> GSM97088     5  0.2765     0.8008 0.024 0.004 0.020 0.008 0.888 0.056
#> GSM97100     2  0.3088     0.6844 0.064 0.872 0.012 0.016 0.008 0.028
#> GSM97104     3  0.2872     0.5217 0.000 0.012 0.832 0.004 0.000 0.152
#> GSM97108     2  0.3354     0.6932 0.096 0.848 0.020 0.008 0.012 0.016
#> GSM97050     2  0.3198     0.6172 0.000 0.860 0.052 0.024 0.008 0.056
#> GSM97080     3  0.4245     0.1648 0.000 0.024 0.644 0.000 0.004 0.328
#> GSM97089     3  0.1036     0.5825 0.000 0.024 0.964 0.004 0.008 0.000
#> GSM97092     3  0.2613     0.5408 0.000 0.140 0.848 0.000 0.000 0.012
#> GSM97093     2  0.7800     0.4408 0.164 0.488 0.196 0.016 0.072 0.064
#> GSM97058     2  0.2781     0.6908 0.084 0.872 0.032 0.004 0.000 0.008
#> GSM97051     2  0.4210     0.5813 0.000 0.796 0.072 0.064 0.008 0.060
#> GSM97052     3  0.1333     0.5808 0.000 0.048 0.944 0.000 0.000 0.008
#> GSM97061     3  0.3840     0.4212 0.000 0.284 0.696 0.000 0.000 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)

plot of chunk tab-SD-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-hclust-membership-heatmap-5

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)

plot of chunk tab-SD-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-SD-hclust-get-signatures-no-scale-1

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

plot of chunk tab-SD-hclust-get-signatures-no-scale-2

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

plot of chunk tab-SD-hclust-get-signatures-no-scale-3

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

plot of chunk tab-SD-hclust-get-signatures-no-scale-4

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

plot of chunk tab-SD-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-hclust-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-SD-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-hclust-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:hclust 83         4.74e-07       1.000     4.45e-16   0.0554 2
#> SD:hclust 37         3.09e-02       0.737     3.51e-11   0.7217 3
#> SD:hclust 59         1.90e-03       0.780     6.17e-10   0.8124 4
#> SD:hclust 71         4.06e-04       0.815     5.03e-14   0.3725 5
#> SD:hclust 60         3.27e-03       0.720     3.94e-15   0.3439 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.


SD:kmeans*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "kmeans"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-kmeans-collect-plots

The plots are:

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:

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)

plot of chunk SD-kmeans-select-partition-number

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.938           0.947       0.973         0.4933 0.508   0.508
#> 3 3 0.603           0.811       0.876         0.3336 0.704   0.481
#> 4 4 0.708           0.777       0.861         0.1295 0.823   0.532
#> 5 5 0.685           0.658       0.770         0.0579 0.971   0.883
#> 6 6 0.702           0.547       0.674         0.0408 0.922   0.674

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.980 1.000 0.000
#> GSM97145     1  0.0000      0.980 1.000 0.000
#> GSM97147     1  0.0376      0.977 0.996 0.004
#> GSM97125     1  0.0000      0.980 1.000 0.000
#> GSM97127     1  0.0000      0.980 1.000 0.000
#> GSM97130     1  0.0000      0.980 1.000 0.000
#> GSM97133     1  0.0000      0.980 1.000 0.000
#> GSM97134     1  0.0000      0.980 1.000 0.000
#> GSM97120     1  0.0000      0.980 1.000 0.000
#> GSM97126     1  0.0000      0.980 1.000 0.000
#> GSM97112     1  0.0000      0.980 1.000 0.000
#> GSM97115     1  0.0000      0.980 1.000 0.000
#> GSM97116     1  0.0000      0.980 1.000 0.000
#> GSM97117     2  0.2778      0.947 0.048 0.952
#> GSM97119     1  0.0000      0.980 1.000 0.000
#> GSM97122     1  0.0000      0.980 1.000 0.000
#> GSM97135     1  0.0000      0.980 1.000 0.000
#> GSM97136     2  0.2603      0.948 0.044 0.956
#> GSM97139     1  0.0000      0.980 1.000 0.000
#> GSM97146     1  0.0000      0.980 1.000 0.000
#> GSM97123     2  0.0000      0.967 0.000 1.000
#> GSM97129     2  0.2948      0.945 0.052 0.948
#> GSM97143     1  0.0000      0.980 1.000 0.000
#> GSM97113     2  0.5059      0.889 0.112 0.888
#> GSM97056     1  0.0000      0.980 1.000 0.000
#> GSM97124     1  0.0000      0.980 1.000 0.000
#> GSM97132     1  0.0000      0.980 1.000 0.000
#> GSM97144     1  0.0000      0.980 1.000 0.000
#> GSM97149     1  0.0000      0.980 1.000 0.000
#> GSM97068     2  0.9881      0.288 0.436 0.564
#> GSM97071     2  0.0672      0.966 0.008 0.992
#> GSM97086     2  0.0672      0.966 0.008 0.992
#> GSM97103     2  0.0000      0.967 0.000 1.000
#> GSM97057     2  0.7602      0.752 0.220 0.780
#> GSM97060     2  0.0000      0.967 0.000 1.000
#> GSM97075     2  0.0376      0.967 0.004 0.996
#> GSM97098     2  0.0000      0.967 0.000 1.000
#> GSM97099     2  0.2948      0.945 0.052 0.948
#> GSM97101     2  0.2948      0.945 0.052 0.948
#> GSM97105     2  0.0672      0.966 0.008 0.992
#> GSM97106     2  0.0000      0.967 0.000 1.000
#> GSM97121     2  0.2948      0.945 0.052 0.948
#> GSM97128     1  0.8081      0.691 0.752 0.248
#> GSM97131     2  0.0000      0.967 0.000 1.000
#> GSM97137     1  0.0000      0.980 1.000 0.000
#> GSM97118     1  0.0000      0.980 1.000 0.000
#> GSM97114     2  0.8207      0.695 0.256 0.744
#> GSM97142     1  0.0000      0.980 1.000 0.000
#> GSM97140     2  0.2948      0.945 0.052 0.948
#> GSM97141     2  0.2948      0.945 0.052 0.948
#> GSM97055     1  0.0000      0.980 1.000 0.000
#> GSM97090     1  0.0000      0.980 1.000 0.000
#> GSM97091     1  0.0000      0.980 1.000 0.000
#> GSM97148     1  0.0000      0.980 1.000 0.000
#> GSM97063     1  0.0000      0.980 1.000 0.000
#> GSM97053     1  0.0000      0.980 1.000 0.000
#> GSM97066     2  0.0000      0.967 0.000 1.000
#> GSM97079     2  0.0672      0.966 0.008 0.992
#> GSM97083     1  0.0000      0.980 1.000 0.000
#> GSM97084     2  0.0672      0.966 0.008 0.992
#> GSM97094     1  0.3274      0.926 0.940 0.060
#> GSM97096     2  0.0000      0.967 0.000 1.000
#> GSM97097     2  0.0376      0.967 0.004 0.996
#> GSM97107     1  0.5629      0.846 0.868 0.132
#> GSM97054     2  0.0672      0.966 0.008 0.992
#> GSM97062     2  0.0672      0.966 0.008 0.992
#> GSM97069     2  0.0000      0.967 0.000 1.000
#> GSM97070     2  0.0000      0.967 0.000 1.000
#> GSM97073     2  0.0000      0.967 0.000 1.000
#> GSM97076     1  0.0000      0.980 1.000 0.000
#> GSM97077     2  0.0672      0.966 0.008 0.992
#> GSM97095     1  0.0672      0.974 0.992 0.008
#> GSM97102     2  0.0000      0.967 0.000 1.000
#> GSM97109     2  0.3274      0.939 0.060 0.940
#> GSM97110     2  0.2948      0.945 0.052 0.948
#> GSM97074     1  0.4161      0.910 0.916 0.084
#> GSM97085     2  0.2236      0.946 0.036 0.964
#> GSM97059     1  0.1414      0.964 0.980 0.020
#> GSM97072     2  0.0000      0.967 0.000 1.000
#> GSM97078     1  0.8144      0.687 0.748 0.252
#> GSM97067     2  0.0000      0.967 0.000 1.000
#> GSM97087     2  0.0000      0.967 0.000 1.000
#> GSM97111     2  0.2778      0.947 0.048 0.952
#> GSM97064     2  0.0000      0.967 0.000 1.000
#> GSM97065     2  0.0376      0.967 0.004 0.996
#> GSM97081     2  0.0000      0.967 0.000 1.000
#> GSM97082     2  0.0000      0.967 0.000 1.000
#> GSM97088     2  0.4815      0.878 0.104 0.896
#> GSM97100     2  0.0672      0.966 0.008 0.992
#> GSM97104     2  0.0000      0.967 0.000 1.000
#> GSM97108     2  0.2948      0.945 0.052 0.948
#> GSM97050     2  0.0672      0.966 0.008 0.992
#> GSM97080     2  0.0000      0.967 0.000 1.000
#> GSM97089     2  0.0000      0.967 0.000 1.000
#> GSM97092     2  0.0000      0.967 0.000 1.000
#> GSM97093     2  0.0376      0.967 0.004 0.996
#> GSM97058     2  0.0376      0.967 0.004 0.996
#> GSM97051     2  0.0376      0.967 0.004 0.996
#> GSM97052     2  0.0000      0.967 0.000 1.000
#> GSM97061     2  0.0000      0.967 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.2356     0.9175 0.928 0.072 0.000
#> GSM97145     1  0.1860     0.9203 0.948 0.052 0.000
#> GSM97147     2  0.1031     0.8007 0.024 0.976 0.000
#> GSM97125     1  0.0892     0.9219 0.980 0.020 0.000
#> GSM97127     1  0.2711     0.9148 0.912 0.088 0.000
#> GSM97130     1  0.4842     0.8291 0.776 0.224 0.000
#> GSM97133     1  0.2711     0.9148 0.912 0.088 0.000
#> GSM97134     1  0.4931     0.7561 0.768 0.232 0.000
#> GSM97120     1  0.2711     0.9148 0.912 0.088 0.000
#> GSM97126     1  0.3941     0.8424 0.844 0.156 0.000
#> GSM97112     1  0.0000     0.9208 1.000 0.000 0.000
#> GSM97115     2  0.1031     0.7934 0.024 0.976 0.000
#> GSM97116     1  0.2711     0.9148 0.912 0.088 0.000
#> GSM97117     2  0.5098     0.8034 0.000 0.752 0.248
#> GSM97119     1  0.0000     0.9208 1.000 0.000 0.000
#> GSM97122     1  0.0000     0.9208 1.000 0.000 0.000
#> GSM97135     1  0.0000     0.9208 1.000 0.000 0.000
#> GSM97136     3  0.2063     0.8566 0.008 0.044 0.948
#> GSM97139     1  0.2711     0.9148 0.912 0.088 0.000
#> GSM97146     1  0.2711     0.9148 0.912 0.088 0.000
#> GSM97123     3  0.5529     0.4185 0.000 0.296 0.704
#> GSM97129     2  0.4974     0.8128 0.000 0.764 0.236
#> GSM97143     1  0.0000     0.9208 1.000 0.000 0.000
#> GSM97113     2  0.4291     0.8121 0.000 0.820 0.180
#> GSM97056     1  0.2625     0.9163 0.916 0.084 0.000
#> GSM97124     1  0.0237     0.9212 0.996 0.004 0.000
#> GSM97132     1  0.1964     0.9044 0.944 0.056 0.000
#> GSM97144     1  0.4504     0.8076 0.804 0.196 0.000
#> GSM97149     1  0.2711     0.9148 0.912 0.088 0.000
#> GSM97068     2  0.0000     0.8022 0.000 1.000 0.000
#> GSM97071     2  0.7561     0.0962 0.040 0.516 0.444
#> GSM97086     2  0.2796     0.8331 0.000 0.908 0.092
#> GSM97103     2  0.6305     0.3978 0.000 0.516 0.484
#> GSM97057     2  0.1267     0.8149 0.004 0.972 0.024
#> GSM97060     3  0.0000     0.8819 0.000 0.000 1.000
#> GSM97075     2  0.5098     0.8034 0.000 0.752 0.248
#> GSM97098     3  0.5138     0.5291 0.000 0.252 0.748
#> GSM97099     2  0.4974     0.8113 0.000 0.764 0.236
#> GSM97101     2  0.4605     0.8297 0.000 0.796 0.204
#> GSM97105     2  0.3879     0.8449 0.000 0.848 0.152
#> GSM97106     3  0.3412     0.7606 0.000 0.124 0.876
#> GSM97121     2  0.3686     0.8461 0.000 0.860 0.140
#> GSM97128     3  0.9410     0.3949 0.220 0.276 0.504
#> GSM97131     2  0.4796     0.8211 0.000 0.780 0.220
#> GSM97137     1  0.3340     0.9075 0.880 0.120 0.000
#> GSM97118     1  0.1860     0.9036 0.948 0.052 0.000
#> GSM97114     2  0.5085     0.7799 0.092 0.836 0.072
#> GSM97142     1  0.0000     0.9208 1.000 0.000 0.000
#> GSM97140     2  0.3038     0.8450 0.000 0.896 0.104
#> GSM97141     2  0.4974     0.8113 0.000 0.764 0.236
#> GSM97055     1  0.0592     0.9199 0.988 0.012 0.000
#> GSM97090     2  0.3482     0.7061 0.128 0.872 0.000
#> GSM97091     1  0.0000     0.9208 1.000 0.000 0.000
#> GSM97148     1  0.2711     0.9148 0.912 0.088 0.000
#> GSM97063     1  0.0000     0.9208 1.000 0.000 0.000
#> GSM97053     1  0.0237     0.9212 0.996 0.004 0.000
#> GSM97066     3  0.0000     0.8819 0.000 0.000 1.000
#> GSM97079     2  0.3267     0.8332 0.000 0.884 0.116
#> GSM97083     1  0.5072     0.7834 0.792 0.196 0.012
#> GSM97084     2  0.3030     0.8273 0.004 0.904 0.092
#> GSM97094     2  0.5092     0.6968 0.176 0.804 0.020
#> GSM97096     3  0.0747     0.8757 0.000 0.016 0.984
#> GSM97097     2  0.5138     0.7723 0.000 0.748 0.252
#> GSM97107     2  0.5384     0.6722 0.188 0.788 0.024
#> GSM97054     2  0.2860     0.8325 0.004 0.912 0.084
#> GSM97062     2  0.3038     0.8303 0.000 0.896 0.104
#> GSM97069     3  0.0000     0.8819 0.000 0.000 1.000
#> GSM97070     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97073     3  0.0000     0.8819 0.000 0.000 1.000
#> GSM97076     1  0.8548     0.4271 0.568 0.312 0.120
#> GSM97077     2  0.3340     0.8459 0.000 0.880 0.120
#> GSM97095     2  0.0747     0.7988 0.016 0.984 0.000
#> GSM97102     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97109     2  0.5024     0.8183 0.004 0.776 0.220
#> GSM97110     2  0.4974     0.8113 0.000 0.764 0.236
#> GSM97074     3  0.7283     0.5605 0.260 0.068 0.672
#> GSM97085     3  0.2448     0.8218 0.076 0.000 0.924
#> GSM97059     2  0.0424     0.8000 0.008 0.992 0.000
#> GSM97072     3  0.0000     0.8819 0.000 0.000 1.000
#> GSM97078     3  0.9765     0.2448 0.240 0.336 0.424
#> GSM97067     3  0.0000     0.8819 0.000 0.000 1.000
#> GSM97087     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97111     2  0.5016     0.8096 0.000 0.760 0.240
#> GSM97064     2  0.5138     0.8030 0.000 0.748 0.252
#> GSM97065     2  0.6126     0.5814 0.000 0.600 0.400
#> GSM97081     3  0.1031     0.8711 0.000 0.024 0.976
#> GSM97082     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97088     3  0.5582     0.7339 0.088 0.100 0.812
#> GSM97100     2  0.2625     0.8396 0.000 0.916 0.084
#> GSM97104     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97108     2  0.3551     0.8465 0.000 0.868 0.132
#> GSM97050     2  0.4121     0.8422 0.000 0.832 0.168
#> GSM97080     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97089     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97092     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97093     2  0.5016     0.8113 0.000 0.760 0.240
#> GSM97058     2  0.4555     0.8336 0.000 0.800 0.200
#> GSM97051     2  0.3752     0.8435 0.000 0.856 0.144
#> GSM97052     3  0.0237     0.8825 0.000 0.004 0.996
#> GSM97061     3  0.3879     0.7242 0.000 0.152 0.848

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.1743     0.8497 0.940 0.056 0.000 0.004
#> GSM97145     1  0.1733     0.8550 0.948 0.024 0.000 0.028
#> GSM97147     2  0.0927     0.8955 0.008 0.976 0.000 0.016
#> GSM97125     1  0.1792     0.8547 0.932 0.000 0.000 0.068
#> GSM97127     1  0.1722     0.8497 0.944 0.048 0.000 0.008
#> GSM97130     4  0.4881     0.5991 0.196 0.048 0.000 0.756
#> GSM97133     1  0.1824     0.8454 0.936 0.060 0.000 0.004
#> GSM97134     4  0.3355     0.6202 0.160 0.004 0.000 0.836
#> GSM97120     1  0.1824     0.8454 0.936 0.060 0.000 0.004
#> GSM97126     2  0.7403    -0.1162 0.380 0.452 0.000 0.168
#> GSM97112     1  0.3400     0.8389 0.820 0.000 0.000 0.180
#> GSM97115     4  0.4836     0.6287 0.008 0.320 0.000 0.672
#> GSM97116     1  0.1743     0.8474 0.940 0.056 0.000 0.004
#> GSM97117     2  0.2156     0.9062 0.008 0.928 0.060 0.004
#> GSM97119     1  0.3400     0.8389 0.820 0.000 0.000 0.180
#> GSM97122     1  0.3400     0.8389 0.820 0.000 0.000 0.180
#> GSM97135     1  0.3400     0.8389 0.820 0.000 0.000 0.180
#> GSM97136     3  0.5560     0.5983 0.016 0.276 0.684 0.024
#> GSM97139     1  0.1743     0.8474 0.940 0.056 0.000 0.004
#> GSM97146     1  0.1743     0.8474 0.940 0.056 0.000 0.004
#> GSM97123     3  0.4049     0.7368 0.000 0.212 0.780 0.008
#> GSM97129     2  0.2317     0.9078 0.012 0.928 0.048 0.012
#> GSM97143     1  0.3400     0.8389 0.820 0.000 0.000 0.180
#> GSM97113     2  0.1109     0.8884 0.028 0.968 0.004 0.000
#> GSM97056     1  0.3533     0.7978 0.864 0.056 0.000 0.080
#> GSM97124     1  0.3400     0.8389 0.820 0.000 0.000 0.180
#> GSM97132     4  0.5000    -0.1604 0.496 0.000 0.000 0.504
#> GSM97144     4  0.3479     0.6333 0.148 0.012 0.000 0.840
#> GSM97149     1  0.1824     0.8454 0.936 0.060 0.000 0.004
#> GSM97068     2  0.2831     0.7827 0.004 0.876 0.000 0.120
#> GSM97071     4  0.2111     0.6941 0.000 0.044 0.024 0.932
#> GSM97086     4  0.4331     0.6301 0.000 0.288 0.000 0.712
#> GSM97103     3  0.4678     0.6953 0.000 0.232 0.744 0.024
#> GSM97057     2  0.0804     0.8900 0.012 0.980 0.000 0.008
#> GSM97060     3  0.0188     0.9151 0.000 0.000 0.996 0.004
#> GSM97075     2  0.2234     0.9051 0.008 0.924 0.064 0.004
#> GSM97098     3  0.2987     0.8546 0.000 0.104 0.880 0.016
#> GSM97099     2  0.1994     0.9083 0.008 0.936 0.052 0.004
#> GSM97101     2  0.1706     0.9107 0.016 0.948 0.036 0.000
#> GSM97105     2  0.2032     0.9050 0.000 0.936 0.036 0.028
#> GSM97106     3  0.0707     0.9121 0.000 0.000 0.980 0.020
#> GSM97121     2  0.1706     0.9086 0.000 0.948 0.036 0.016
#> GSM97128     4  0.2450     0.6551 0.072 0.000 0.016 0.912
#> GSM97131     2  0.4579     0.7189 0.000 0.768 0.200 0.032
#> GSM97137     1  0.4150     0.7560 0.824 0.056 0.000 0.120
#> GSM97118     4  0.4977    -0.0831 0.460 0.000 0.000 0.540
#> GSM97114     2  0.1209     0.8851 0.032 0.964 0.000 0.004
#> GSM97142     1  0.3400     0.8389 0.820 0.000 0.000 0.180
#> GSM97140     2  0.1624     0.9076 0.000 0.952 0.028 0.020
#> GSM97141     2  0.1798     0.9104 0.016 0.944 0.040 0.000
#> GSM97055     1  0.4562     0.7982 0.764 0.028 0.000 0.208
#> GSM97090     4  0.4914     0.6364 0.012 0.312 0.000 0.676
#> GSM97091     1  0.3569     0.8293 0.804 0.000 0.000 0.196
#> GSM97148     1  0.1743     0.8474 0.940 0.056 0.000 0.004
#> GSM97063     1  0.3569     0.8293 0.804 0.000 0.000 0.196
#> GSM97053     1  0.3024     0.8465 0.852 0.000 0.000 0.148
#> GSM97066     3  0.1940     0.9014 0.000 0.000 0.924 0.076
#> GSM97079     4  0.4456     0.6363 0.000 0.280 0.004 0.716
#> GSM97083     4  0.2814     0.6294 0.132 0.000 0.000 0.868
#> GSM97084     4  0.4428     0.6387 0.000 0.276 0.004 0.720
#> GSM97094     4  0.3271     0.7144 0.012 0.132 0.000 0.856
#> GSM97096     3  0.1584     0.9022 0.000 0.036 0.952 0.012
#> GSM97097     4  0.7159     0.4967 0.000 0.272 0.180 0.548
#> GSM97107     4  0.3280     0.7134 0.016 0.124 0.000 0.860
#> GSM97054     4  0.4382     0.6249 0.000 0.296 0.000 0.704
#> GSM97062     4  0.4456     0.6363 0.000 0.280 0.004 0.716
#> GSM97069     3  0.1792     0.9034 0.000 0.000 0.932 0.068
#> GSM97070     3  0.1940     0.9014 0.000 0.000 0.924 0.076
#> GSM97073     3  0.1940     0.9014 0.000 0.000 0.924 0.076
#> GSM97076     4  0.7886    -0.0575 0.364 0.228 0.004 0.404
#> GSM97077     2  0.1936     0.9043 0.000 0.940 0.028 0.032
#> GSM97095     4  0.5099     0.5517 0.008 0.380 0.000 0.612
#> GSM97102     3  0.0000     0.9153 0.000 0.000 1.000 0.000
#> GSM97109     2  0.2521     0.9024 0.028 0.924 0.032 0.016
#> GSM97110     2  0.2573     0.9042 0.024 0.920 0.044 0.012
#> GSM97074     4  0.5646     0.4256 0.056 0.000 0.272 0.672
#> GSM97085     3  0.3552     0.8243 0.024 0.000 0.848 0.128
#> GSM97059     2  0.1209     0.8845 0.004 0.964 0.000 0.032
#> GSM97072     3  0.1716     0.9053 0.000 0.000 0.936 0.064
#> GSM97078     4  0.2561     0.6580 0.068 0.004 0.016 0.912
#> GSM97067     3  0.1940     0.9014 0.000 0.000 0.924 0.076
#> GSM97087     3  0.0376     0.9156 0.000 0.004 0.992 0.004
#> GSM97111     2  0.2140     0.9088 0.008 0.932 0.052 0.008
#> GSM97064     2  0.2988     0.8694 0.000 0.876 0.112 0.012
#> GSM97065     2  0.4337     0.8261 0.016 0.836 0.072 0.076
#> GSM97081     3  0.2149     0.8747 0.000 0.088 0.912 0.000
#> GSM97082     3  0.0188     0.9151 0.000 0.000 0.996 0.004
#> GSM97088     4  0.4755     0.5690 0.040 0.000 0.200 0.760
#> GSM97100     2  0.1890     0.8900 0.000 0.936 0.008 0.056
#> GSM97104     3  0.0188     0.9151 0.000 0.000 0.996 0.004
#> GSM97108     2  0.1820     0.9077 0.000 0.944 0.036 0.020
#> GSM97050     2  0.2032     0.9050 0.000 0.936 0.036 0.028
#> GSM97080     3  0.1302     0.9098 0.000 0.000 0.956 0.044
#> GSM97089     3  0.0376     0.9156 0.000 0.004 0.992 0.004
#> GSM97092     3  0.0376     0.9156 0.000 0.004 0.992 0.004
#> GSM97093     2  0.2593     0.8740 0.000 0.892 0.104 0.004
#> GSM97058     2  0.1929     0.9067 0.000 0.940 0.036 0.024
#> GSM97051     2  0.4036     0.8202 0.000 0.836 0.088 0.076
#> GSM97052     3  0.0376     0.9156 0.000 0.004 0.992 0.004
#> GSM97061     3  0.2611     0.8666 0.000 0.096 0.896 0.008

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.2248    0.68858 0.900 0.012 0.000 0.000 0.088
#> GSM97145     1  0.4268    0.67260 0.708 0.024 0.000 0.000 0.268
#> GSM97147     2  0.1430    0.87523 0.000 0.944 0.000 0.052 0.004
#> GSM97125     1  0.3857    0.66916 0.688 0.000 0.000 0.000 0.312
#> GSM97127     1  0.1830    0.68734 0.924 0.008 0.000 0.000 0.068
#> GSM97130     4  0.5830    0.51839 0.144 0.016 0.000 0.652 0.188
#> GSM97133     1  0.0404    0.67889 0.988 0.012 0.000 0.000 0.000
#> GSM97134     4  0.5329    0.00832 0.028 0.012 0.000 0.488 0.472
#> GSM97120     1  0.0510    0.67732 0.984 0.016 0.000 0.000 0.000
#> GSM97126     2  0.5960    0.07934 0.120 0.528 0.000 0.000 0.352
#> GSM97112     1  0.4227    0.62398 0.580 0.000 0.000 0.000 0.420
#> GSM97115     4  0.5463    0.65581 0.028 0.132 0.000 0.708 0.132
#> GSM97116     1  0.0404    0.67919 0.988 0.012 0.000 0.000 0.000
#> GSM97117     2  0.0992    0.88035 0.000 0.968 0.024 0.000 0.008
#> GSM97119     1  0.4227    0.62398 0.580 0.000 0.000 0.000 0.420
#> GSM97122     1  0.4227    0.62398 0.580 0.000 0.000 0.000 0.420
#> GSM97135     1  0.4219    0.62680 0.584 0.000 0.000 0.000 0.416
#> GSM97136     3  0.6514    0.35824 0.000 0.304 0.476 0.000 0.220
#> GSM97139     1  0.0290    0.67997 0.992 0.008 0.000 0.000 0.000
#> GSM97146     1  0.0404    0.67919 0.988 0.012 0.000 0.000 0.000
#> GSM97123     3  0.4167    0.72221 0.000 0.160 0.788 0.028 0.024
#> GSM97129     2  0.1845    0.87009 0.000 0.928 0.016 0.000 0.056
#> GSM97143     1  0.4249    0.60973 0.568 0.000 0.000 0.000 0.432
#> GSM97113     2  0.0798    0.87966 0.016 0.976 0.000 0.000 0.008
#> GSM97056     1  0.2217    0.61443 0.920 0.012 0.000 0.044 0.024
#> GSM97124     1  0.4235    0.61981 0.576 0.000 0.000 0.000 0.424
#> GSM97132     5  0.6344    0.29696 0.260 0.008 0.000 0.176 0.556
#> GSM97144     4  0.4880    0.53142 0.040 0.012 0.000 0.692 0.256
#> GSM97149     1  0.0510    0.67732 0.984 0.016 0.000 0.000 0.000
#> GSM97068     2  0.4208    0.75422 0.032 0.788 0.000 0.156 0.024
#> GSM97071     4  0.4290    0.57987 0.000 0.016 0.032 0.768 0.184
#> GSM97086     4  0.1732    0.70784 0.000 0.080 0.000 0.920 0.000
#> GSM97103     3  0.6024    0.65419 0.000 0.236 0.640 0.052 0.072
#> GSM97057     2  0.2597    0.86311 0.040 0.896 0.000 0.060 0.004
#> GSM97060     3  0.2585    0.80814 0.000 0.008 0.896 0.024 0.072
#> GSM97075     2  0.0898    0.88105 0.000 0.972 0.020 0.000 0.008
#> GSM97098     3  0.4778    0.71031 0.000 0.188 0.740 0.020 0.052
#> GSM97099     2  0.0854    0.88174 0.004 0.976 0.012 0.000 0.008
#> GSM97101     2  0.0727    0.88259 0.004 0.980 0.012 0.000 0.004
#> GSM97105     2  0.2474    0.86780 0.000 0.896 0.012 0.084 0.008
#> GSM97106     3  0.3278    0.79426 0.000 0.024 0.868 0.056 0.052
#> GSM97121     2  0.1074    0.88372 0.000 0.968 0.012 0.016 0.004
#> GSM97128     5  0.4940    0.15160 0.004 0.008 0.012 0.392 0.584
#> GSM97131     2  0.6179    0.61953 0.000 0.628 0.148 0.196 0.028
#> GSM97137     1  0.4093    0.44684 0.808 0.012 0.000 0.092 0.088
#> GSM97118     5  0.5939    0.41931 0.188 0.008 0.000 0.180 0.624
#> GSM97114     2  0.0992    0.87782 0.024 0.968 0.000 0.000 0.008
#> GSM97142     1  0.4227    0.62398 0.580 0.000 0.000 0.000 0.420
#> GSM97140     2  0.1770    0.87759 0.000 0.936 0.008 0.048 0.008
#> GSM97141     2  0.0854    0.88174 0.004 0.976 0.012 0.000 0.008
#> GSM97055     5  0.5742   -0.42718 0.436 0.056 0.000 0.012 0.496
#> GSM97090     4  0.5444    0.65820 0.028 0.112 0.000 0.708 0.152
#> GSM97091     1  0.4562    0.49321 0.496 0.000 0.000 0.008 0.496
#> GSM97148     1  0.0404    0.67919 0.988 0.012 0.000 0.000 0.000
#> GSM97063     1  0.4549    0.55129 0.528 0.000 0.000 0.008 0.464
#> GSM97053     1  0.4101    0.64910 0.628 0.000 0.000 0.000 0.372
#> GSM97066     3  0.4413    0.73006 0.000 0.000 0.724 0.044 0.232
#> GSM97079     4  0.1831    0.70823 0.000 0.076 0.000 0.920 0.004
#> GSM97083     4  0.4907    0.04879 0.012 0.008 0.000 0.512 0.468
#> GSM97084     4  0.1671    0.70984 0.000 0.076 0.000 0.924 0.000
#> GSM97094     4  0.3351    0.67836 0.004 0.028 0.000 0.836 0.132
#> GSM97096     3  0.3506    0.79036 0.000 0.076 0.852 0.020 0.052
#> GSM97097     4  0.4409    0.57625 0.000 0.068 0.092 0.800 0.040
#> GSM97107     4  0.3474    0.67919 0.008 0.028 0.000 0.832 0.132
#> GSM97054     4  0.2628    0.70900 0.000 0.088 0.000 0.884 0.028
#> GSM97062     4  0.1671    0.70984 0.000 0.076 0.000 0.924 0.000
#> GSM97069     3  0.4168    0.74739 0.000 0.000 0.756 0.044 0.200
#> GSM97070     3  0.4450    0.73816 0.000 0.004 0.736 0.044 0.216
#> GSM97073     3  0.4538    0.73289 0.000 0.004 0.724 0.044 0.228
#> GSM97076     5  0.6896    0.26669 0.024 0.276 0.044 0.084 0.572
#> GSM97077     2  0.2115    0.87307 0.000 0.916 0.008 0.068 0.008
#> GSM97095     4  0.6780    0.41436 0.032 0.304 0.000 0.520 0.144
#> GSM97102     3  0.2967    0.80468 0.000 0.012 0.868 0.016 0.104
#> GSM97109     2  0.1143    0.88083 0.008 0.968 0.008 0.004 0.012
#> GSM97110     2  0.1143    0.88083 0.008 0.968 0.008 0.004 0.012
#> GSM97074     5  0.5217    0.35834 0.004 0.008 0.116 0.156 0.716
#> GSM97085     3  0.4884    0.48351 0.004 0.000 0.572 0.020 0.404
#> GSM97059     2  0.3093    0.84253 0.032 0.872 0.000 0.080 0.016
#> GSM97072     3  0.4709    0.74882 0.000 0.004 0.716 0.056 0.224
#> GSM97078     5  0.5045   -0.05167 0.004 0.008 0.012 0.456 0.520
#> GSM97067     3  0.4538    0.73147 0.000 0.004 0.724 0.044 0.228
#> GSM97087     3  0.1612    0.80786 0.000 0.012 0.948 0.016 0.024
#> GSM97111     2  0.0898    0.88105 0.000 0.972 0.020 0.000 0.008
#> GSM97064     2  0.4514    0.79683 0.000 0.780 0.132 0.064 0.024
#> GSM97065     2  0.4855    0.70913 0.000 0.760 0.060 0.040 0.140
#> GSM97081     3  0.2966    0.76854 0.000 0.136 0.848 0.000 0.016
#> GSM97082     3  0.1329    0.81071 0.000 0.008 0.956 0.004 0.032
#> GSM97088     5  0.6548    0.11335 0.004 0.008 0.140 0.360 0.488
#> GSM97100     2  0.2798    0.83544 0.000 0.852 0.000 0.140 0.008
#> GSM97104     3  0.2802    0.80482 0.000 0.008 0.876 0.016 0.100
#> GSM97108     2  0.1522    0.88086 0.000 0.944 0.012 0.044 0.000
#> GSM97050     2  0.4394    0.81205 0.000 0.788 0.084 0.112 0.016
#> GSM97080     3  0.2886    0.78327 0.000 0.000 0.844 0.008 0.148
#> GSM97089     3  0.1612    0.80786 0.000 0.012 0.948 0.016 0.024
#> GSM97092     3  0.1820    0.80588 0.000 0.020 0.940 0.020 0.020
#> GSM97093     2  0.4117    0.77439 0.000 0.788 0.164 0.028 0.020
#> GSM97058     2  0.2266    0.87426 0.000 0.912 0.016 0.064 0.008
#> GSM97051     2  0.6262    0.60974 0.000 0.608 0.148 0.220 0.024
#> GSM97052     3  0.1913    0.80535 0.000 0.024 0.936 0.020 0.020
#> GSM97061     3  0.2888    0.79091 0.000 0.056 0.888 0.036 0.020

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     5  0.3975   -0.30224 0.452 0.000 0.000 0.000 0.544 0.004
#> GSM97145     5  0.2182    0.67849 0.068 0.020 0.000 0.000 0.904 0.008
#> GSM97147     2  0.2503    0.79257 0.044 0.896 0.004 0.044 0.000 0.012
#> GSM97125     5  0.1471    0.70590 0.064 0.000 0.000 0.000 0.932 0.004
#> GSM97127     5  0.3769    0.00761 0.356 0.000 0.000 0.000 0.640 0.004
#> GSM97130     4  0.5977    0.59867 0.332 0.004 0.000 0.528 0.032 0.104
#> GSM97133     1  0.3864    0.38421 0.520 0.000 0.000 0.000 0.480 0.000
#> GSM97134     4  0.7651    0.42628 0.260 0.004 0.000 0.356 0.184 0.196
#> GSM97120     1  0.3864    0.38421 0.520 0.000 0.000 0.000 0.480 0.000
#> GSM97126     2  0.5641    0.51346 0.052 0.632 0.000 0.000 0.208 0.108
#> GSM97112     5  0.0000    0.76672 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97115     4  0.6391    0.64558 0.272 0.100 0.000 0.532 0.000 0.096
#> GSM97116     1  0.3864    0.38421 0.520 0.000 0.000 0.000 0.480 0.000
#> GSM97117     2  0.1888    0.79368 0.012 0.916 0.004 0.000 0.000 0.068
#> GSM97119     5  0.0000    0.76672 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97122     5  0.0000    0.76672 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97135     5  0.0260    0.76375 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM97136     2  0.7550   -0.15776 0.048 0.368 0.308 0.000 0.044 0.232
#> GSM97139     1  0.3864    0.38421 0.520 0.000 0.000 0.000 0.480 0.000
#> GSM97146     1  0.3864    0.38421 0.520 0.000 0.000 0.000 0.480 0.000
#> GSM97123     3  0.2056    0.68490 0.000 0.080 0.904 0.004 0.000 0.012
#> GSM97129     2  0.2633    0.77833 0.020 0.864 0.004 0.000 0.000 0.112
#> GSM97143     5  0.0603    0.75869 0.004 0.000 0.000 0.000 0.980 0.016
#> GSM97113     2  0.1769    0.79715 0.012 0.924 0.004 0.000 0.000 0.060
#> GSM97056     1  0.4428    0.35277 0.676 0.000 0.000 0.052 0.268 0.004
#> GSM97124     5  0.0508    0.76397 0.012 0.000 0.000 0.000 0.984 0.004
#> GSM97132     5  0.7389   -0.15876 0.272 0.004 0.000 0.132 0.404 0.188
#> GSM97144     4  0.6058    0.65074 0.244 0.012 0.000 0.592 0.044 0.108
#> GSM97149     1  0.3993    0.38252 0.520 0.000 0.000 0.000 0.476 0.004
#> GSM97068     2  0.5227    0.60634 0.144 0.668 0.004 0.168 0.000 0.016
#> GSM97071     4  0.4849    0.61998 0.112 0.000 0.000 0.648 0.000 0.240
#> GSM97086     4  0.1623    0.67546 0.020 0.032 0.004 0.940 0.000 0.004
#> GSM97103     3  0.7485    0.38311 0.056 0.232 0.480 0.080 0.000 0.152
#> GSM97057     2  0.3316    0.78272 0.076 0.848 0.016 0.052 0.000 0.008
#> GSM97060     3  0.2822    0.68394 0.040 0.000 0.852 0.000 0.000 0.108
#> GSM97075     2  0.1913    0.79517 0.012 0.920 0.004 0.004 0.000 0.060
#> GSM97098     3  0.6323    0.49628 0.056 0.200 0.576 0.008 0.000 0.160
#> GSM97099     2  0.2126    0.79040 0.020 0.904 0.004 0.000 0.000 0.072
#> GSM97101     2  0.1410    0.79946 0.008 0.944 0.004 0.000 0.000 0.044
#> GSM97105     2  0.3069    0.78471 0.044 0.868 0.024 0.056 0.000 0.008
#> GSM97106     3  0.2389    0.70753 0.036 0.012 0.908 0.020 0.000 0.024
#> GSM97121     2  0.1173    0.80115 0.016 0.960 0.000 0.016 0.000 0.008
#> GSM97128     1  0.7658   -0.35942 0.308 0.000 0.004 0.232 0.152 0.304
#> GSM97131     2  0.6447    0.56112 0.044 0.572 0.176 0.188 0.000 0.020
#> GSM97137     1  0.4445    0.33532 0.712 0.000 0.000 0.072 0.208 0.008
#> GSM97118     1  0.7487   -0.20017 0.308 0.000 0.000 0.132 0.300 0.260
#> GSM97114     2  0.1895    0.79419 0.016 0.912 0.000 0.000 0.000 0.072
#> GSM97142     5  0.0000    0.76672 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97140     2  0.2727    0.78952 0.044 0.888 0.020 0.040 0.000 0.008
#> GSM97141     2  0.1668    0.79602 0.008 0.928 0.004 0.000 0.000 0.060
#> GSM97055     5  0.5032    0.50055 0.096 0.052 0.004 0.012 0.740 0.096
#> GSM97090     4  0.6289    0.65437 0.272 0.068 0.000 0.556 0.008 0.096
#> GSM97091     5  0.2009    0.69006 0.068 0.000 0.000 0.000 0.908 0.024
#> GSM97148     1  0.3864    0.38421 0.520 0.000 0.000 0.000 0.480 0.000
#> GSM97063     5  0.1524    0.71516 0.060 0.000 0.000 0.000 0.932 0.008
#> GSM97053     5  0.0777    0.75139 0.024 0.000 0.000 0.000 0.972 0.004
#> GSM97066     6  0.3672    0.47788 0.000 0.000 0.368 0.000 0.000 0.632
#> GSM97079     4  0.1198    0.68612 0.012 0.020 0.004 0.960 0.000 0.004
#> GSM97083     4  0.7520    0.36514 0.304 0.000 0.004 0.320 0.116 0.256
#> GSM97084     4  0.0964    0.70016 0.012 0.016 0.000 0.968 0.000 0.004
#> GSM97094     4  0.2849    0.71141 0.084 0.016 0.000 0.872 0.008 0.020
#> GSM97096     3  0.5540    0.60495 0.056 0.112 0.676 0.008 0.000 0.148
#> GSM97097     4  0.3483    0.58974 0.052 0.016 0.068 0.844 0.000 0.020
#> GSM97107     4  0.2983    0.71206 0.088 0.016 0.000 0.864 0.008 0.024
#> GSM97054     4  0.4098    0.67613 0.092 0.060 0.008 0.800 0.000 0.040
#> GSM97062     4  0.0692    0.69292 0.000 0.020 0.004 0.976 0.000 0.000
#> GSM97069     6  0.3937    0.40601 0.004 0.000 0.424 0.000 0.000 0.572
#> GSM97070     6  0.3737    0.46588 0.000 0.000 0.392 0.000 0.000 0.608
#> GSM97073     6  0.3706    0.46604 0.000 0.000 0.380 0.000 0.000 0.620
#> GSM97076     6  0.4737    0.23004 0.016 0.280 0.004 0.004 0.032 0.664
#> GSM97077     2  0.3207    0.78395 0.044 0.860 0.028 0.060 0.000 0.008
#> GSM97095     4  0.7341    0.43555 0.276 0.288 0.000 0.332 0.000 0.104
#> GSM97102     3  0.4011    0.59900 0.060 0.000 0.736 0.000 0.000 0.204
#> GSM97109     2  0.2812    0.78148 0.032 0.876 0.016 0.004 0.000 0.072
#> GSM97110     2  0.2884    0.78128 0.036 0.872 0.016 0.004 0.000 0.072
#> GSM97074     6  0.4563    0.29442 0.116 0.000 0.016 0.044 0.056 0.768
#> GSM97085     6  0.6577    0.29378 0.120 0.000 0.280 0.012 0.064 0.524
#> GSM97059     2  0.4111    0.74051 0.100 0.788 0.016 0.088 0.000 0.008
#> GSM97072     6  0.4168    0.39439 0.016 0.000 0.400 0.000 0.000 0.584
#> GSM97078     1  0.7539   -0.41371 0.304 0.000 0.004 0.280 0.116 0.296
#> GSM97067     6  0.3737    0.46588 0.000 0.000 0.392 0.000 0.000 0.608
#> GSM97087     3  0.1692    0.70704 0.012 0.008 0.932 0.000 0.000 0.048
#> GSM97111     2  0.1982    0.79186 0.016 0.912 0.004 0.000 0.000 0.068
#> GSM97064     2  0.5509    0.63270 0.044 0.636 0.252 0.056 0.000 0.012
#> GSM97065     2  0.4289    0.32693 0.012 0.540 0.004 0.000 0.000 0.444
#> GSM97081     3  0.4887    0.57030 0.016 0.192 0.688 0.000 0.000 0.104
#> GSM97082     3  0.2520    0.68262 0.012 0.008 0.872 0.000 0.000 0.108
#> GSM97088     6  0.8232   -0.33530 0.304 0.000 0.076 0.212 0.096 0.312
#> GSM97100     2  0.3750    0.76091 0.044 0.816 0.024 0.108 0.000 0.008
#> GSM97104     3  0.3555    0.61725 0.040 0.000 0.776 0.000 0.000 0.184
#> GSM97108     2  0.2263    0.79357 0.044 0.908 0.004 0.036 0.000 0.008
#> GSM97050     2  0.5718    0.66941 0.052 0.656 0.176 0.104 0.000 0.012
#> GSM97080     3  0.4010    0.02704 0.008 0.000 0.584 0.000 0.000 0.408
#> GSM97089     3  0.1873    0.70604 0.020 0.008 0.924 0.000 0.000 0.048
#> GSM97092     3  0.0806    0.71632 0.000 0.020 0.972 0.000 0.000 0.008
#> GSM97093     2  0.4800    0.55957 0.024 0.636 0.312 0.012 0.000 0.016
#> GSM97058     2  0.3348    0.78312 0.048 0.852 0.032 0.060 0.000 0.008
#> GSM97051     2  0.6664    0.48655 0.048 0.504 0.240 0.200 0.000 0.008
#> GSM97052     3  0.1036    0.71549 0.000 0.024 0.964 0.004 0.000 0.008
#> GSM97061     3  0.1768    0.70247 0.004 0.044 0.932 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)

plot of chunk tab-SD-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-kmeans-membership-heatmap-5

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)

plot of chunk tab-SD-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-SD-kmeans-get-signatures-no-scale-1

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

plot of chunk tab-SD-kmeans-get-signatures-no-scale-2

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

plot of chunk tab-SD-kmeans-get-signatures-no-scale-3

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

plot of chunk tab-SD-kmeans-get-signatures-no-scale-4

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

plot of chunk tab-SD-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-kmeans-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-SD-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-kmeans-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:kmeans 99         3.34e-04       0.370     3.49e-13   0.1112 2
#> SD:kmeans 94         1.44e-05       0.318     2.74e-13   0.1502 3
#> SD:kmeans 94         6.30e-04       0.308     2.01e-14   0.2307 4
#> SD:kmeans 84         7.86e-05       0.443     2.56e-14   0.0673 5
#> SD:kmeans 66         6.63e-02       0.347     1.49e-10   0.1512 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.


SD:skmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "skmeans"]
# 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 21512 rows and 100 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 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)

plot of chunk SD-skmeans-collect-plots

The plots are:

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:

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)

plot of chunk SD-skmeans-select-partition-number

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.958           0.944       0.977         0.5000 0.500   0.500
#> 3 3 0.759           0.855       0.930         0.3396 0.728   0.505
#> 4 4 0.760           0.810       0.894         0.1227 0.845   0.576
#> 5 5 0.635           0.574       0.743         0.0609 0.964   0.860
#> 6 6 0.627           0.430       0.611         0.0400 0.918   0.664

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.971 1.000 0.000
#> GSM97145     1  0.0000      0.971 1.000 0.000
#> GSM97147     1  0.0000      0.971 1.000 0.000
#> GSM97125     1  0.0000      0.971 1.000 0.000
#> GSM97127     1  0.0000      0.971 1.000 0.000
#> GSM97130     1  0.0000      0.971 1.000 0.000
#> GSM97133     1  0.0000      0.971 1.000 0.000
#> GSM97134     1  0.0000      0.971 1.000 0.000
#> GSM97120     1  0.0000      0.971 1.000 0.000
#> GSM97126     1  0.0000      0.971 1.000 0.000
#> GSM97112     1  0.0000      0.971 1.000 0.000
#> GSM97115     1  0.0000      0.971 1.000 0.000
#> GSM97116     1  0.0000      0.971 1.000 0.000
#> GSM97117     2  0.0000      0.979 0.000 1.000
#> GSM97119     1  0.0000      0.971 1.000 0.000
#> GSM97122     1  0.0000      0.971 1.000 0.000
#> GSM97135     1  0.0000      0.971 1.000 0.000
#> GSM97136     2  0.1843      0.958 0.028 0.972
#> GSM97139     1  0.0000      0.971 1.000 0.000
#> GSM97146     1  0.0000      0.971 1.000 0.000
#> GSM97123     2  0.0000      0.979 0.000 1.000
#> GSM97129     2  0.2236      0.949 0.036 0.964
#> GSM97143     1  0.0000      0.971 1.000 0.000
#> GSM97113     2  0.5294      0.861 0.120 0.880
#> GSM97056     1  0.0000      0.971 1.000 0.000
#> GSM97124     1  0.0000      0.971 1.000 0.000
#> GSM97132     1  0.0000      0.971 1.000 0.000
#> GSM97144     1  0.0000      0.971 1.000 0.000
#> GSM97149     1  0.0000      0.971 1.000 0.000
#> GSM97068     1  0.9044      0.517 0.680 0.320
#> GSM97071     2  0.6247      0.809 0.156 0.844
#> GSM97086     2  0.0000      0.979 0.000 1.000
#> GSM97103     2  0.0000      0.979 0.000 1.000
#> GSM97057     2  0.7299      0.746 0.204 0.796
#> GSM97060     2  0.0000      0.979 0.000 1.000
#> GSM97075     2  0.0000      0.979 0.000 1.000
#> GSM97098     2  0.0000      0.979 0.000 1.000
#> GSM97099     2  0.0000      0.979 0.000 1.000
#> GSM97101     2  0.0000      0.979 0.000 1.000
#> GSM97105     2  0.0000      0.979 0.000 1.000
#> GSM97106     2  0.0000      0.979 0.000 1.000
#> GSM97121     2  0.0000      0.979 0.000 1.000
#> GSM97128     1  0.2603      0.932 0.956 0.044
#> GSM97131     2  0.0000      0.979 0.000 1.000
#> GSM97137     1  0.0000      0.971 1.000 0.000
#> GSM97118     1  0.0000      0.971 1.000 0.000
#> GSM97114     2  0.9635      0.366 0.388 0.612
#> GSM97142     1  0.0000      0.971 1.000 0.000
#> GSM97140     2  0.0000      0.979 0.000 1.000
#> GSM97141     2  0.0000      0.979 0.000 1.000
#> GSM97055     1  0.0000      0.971 1.000 0.000
#> GSM97090     1  0.0000      0.971 1.000 0.000
#> GSM97091     1  0.0000      0.971 1.000 0.000
#> GSM97148     1  0.0000      0.971 1.000 0.000
#> GSM97063     1  0.0000      0.971 1.000 0.000
#> GSM97053     1  0.0000      0.971 1.000 0.000
#> GSM97066     2  0.0000      0.979 0.000 1.000
#> GSM97079     2  0.0000      0.979 0.000 1.000
#> GSM97083     1  0.0000      0.971 1.000 0.000
#> GSM97084     2  0.4298      0.898 0.088 0.912
#> GSM97094     1  0.0000      0.971 1.000 0.000
#> GSM97096     2  0.0000      0.979 0.000 1.000
#> GSM97097     2  0.0000      0.979 0.000 1.000
#> GSM97107     1  0.0376      0.968 0.996 0.004
#> GSM97054     2  0.0000      0.979 0.000 1.000
#> GSM97062     2  0.0000      0.979 0.000 1.000
#> GSM97069     2  0.0000      0.979 0.000 1.000
#> GSM97070     2  0.0000      0.979 0.000 1.000
#> GSM97073     2  0.0000      0.979 0.000 1.000
#> GSM97076     1  0.0000      0.971 1.000 0.000
#> GSM97077     2  0.0000      0.979 0.000 1.000
#> GSM97095     1  0.0000      0.971 1.000 0.000
#> GSM97102     2  0.0000      0.979 0.000 1.000
#> GSM97109     2  0.2603      0.942 0.044 0.956
#> GSM97110     2  0.0376      0.976 0.004 0.996
#> GSM97074     1  0.0000      0.971 1.000 0.000
#> GSM97085     1  0.9977      0.121 0.528 0.472
#> GSM97059     1  0.0000      0.971 1.000 0.000
#> GSM97072     2  0.0000      0.979 0.000 1.000
#> GSM97078     1  0.2236      0.939 0.964 0.036
#> GSM97067     2  0.0000      0.979 0.000 1.000
#> GSM97087     2  0.0000      0.979 0.000 1.000
#> GSM97111     2  0.0000      0.979 0.000 1.000
#> GSM97064     2  0.0000      0.979 0.000 1.000
#> GSM97065     2  0.0000      0.979 0.000 1.000
#> GSM97081     2  0.0000      0.979 0.000 1.000
#> GSM97082     2  0.0000      0.979 0.000 1.000
#> GSM97088     1  0.9358      0.464 0.648 0.352
#> GSM97100     2  0.0000      0.979 0.000 1.000
#> GSM97104     2  0.0000      0.979 0.000 1.000
#> GSM97108     2  0.0000      0.979 0.000 1.000
#> GSM97050     2  0.0000      0.979 0.000 1.000
#> GSM97080     2  0.0000      0.979 0.000 1.000
#> GSM97089     2  0.0000      0.979 0.000 1.000
#> GSM97092     2  0.0000      0.979 0.000 1.000
#> GSM97093     2  0.0000      0.979 0.000 1.000
#> GSM97058     2  0.0000      0.979 0.000 1.000
#> GSM97051     2  0.0000      0.979 0.000 1.000
#> GSM97052     2  0.0000      0.979 0.000 1.000
#> GSM97061     2  0.0000      0.979 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97145     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97147     2  0.1031      0.870 0.024 0.976 0.000
#> GSM97125     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97127     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97130     1  0.1031      0.958 0.976 0.024 0.000
#> GSM97133     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97134     1  0.1031      0.958 0.976 0.024 0.000
#> GSM97120     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97126     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97112     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97115     2  0.6008      0.396 0.372 0.628 0.000
#> GSM97116     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97117     3  0.6267      0.170 0.000 0.452 0.548
#> GSM97119     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97122     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97135     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97136     3  0.1289      0.887 0.032 0.000 0.968
#> GSM97139     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97146     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97123     3  0.4291      0.734 0.000 0.180 0.820
#> GSM97129     3  0.7677      0.581 0.120 0.204 0.676
#> GSM97143     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97113     2  0.1315      0.877 0.008 0.972 0.020
#> GSM97056     1  0.0424      0.967 0.992 0.008 0.000
#> GSM97124     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97132     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97144     1  0.1031      0.958 0.976 0.024 0.000
#> GSM97149     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97068     2  0.0000      0.876 0.000 1.000 0.000
#> GSM97071     3  0.1289      0.892 0.000 0.032 0.968
#> GSM97086     2  0.3192      0.841 0.000 0.888 0.112
#> GSM97103     3  0.2066      0.872 0.000 0.060 0.940
#> GSM97057     2  0.0237      0.877 0.000 0.996 0.004
#> GSM97060     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97075     2  0.6274      0.151 0.000 0.544 0.456
#> GSM97098     3  0.1753      0.881 0.000 0.048 0.952
#> GSM97099     2  0.3551      0.816 0.000 0.868 0.132
#> GSM97101     2  0.1031      0.877 0.000 0.976 0.024
#> GSM97105     2  0.0592      0.878 0.000 0.988 0.012
#> GSM97106     3  0.1411      0.890 0.000 0.036 0.964
#> GSM97121     2  0.0592      0.878 0.000 0.988 0.012
#> GSM97128     3  0.5356      0.716 0.196 0.020 0.784
#> GSM97131     2  0.4605      0.779 0.000 0.796 0.204
#> GSM97137     1  0.0237      0.969 0.996 0.004 0.000
#> GSM97118     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97114     2  0.1289      0.869 0.032 0.968 0.000
#> GSM97142     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97140     2  0.0000      0.876 0.000 1.000 0.000
#> GSM97141     2  0.1031      0.877 0.000 0.976 0.024
#> GSM97055     1  0.0892      0.957 0.980 0.000 0.020
#> GSM97090     1  0.3816      0.828 0.852 0.148 0.000
#> GSM97091     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97148     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97063     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97053     1  0.0000      0.970 1.000 0.000 0.000
#> GSM97066     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97079     2  0.4504      0.779 0.000 0.804 0.196
#> GSM97083     1  0.1267      0.956 0.972 0.024 0.004
#> GSM97084     2  0.4346      0.790 0.000 0.816 0.184
#> GSM97094     1  0.1529      0.946 0.960 0.040 0.000
#> GSM97096     3  0.0424      0.905 0.000 0.008 0.992
#> GSM97097     2  0.5529      0.642 0.000 0.704 0.296
#> GSM97107     1  0.4602      0.830 0.852 0.040 0.108
#> GSM97054     2  0.2878      0.849 0.000 0.904 0.096
#> GSM97062     2  0.4399      0.786 0.000 0.812 0.188
#> GSM97069     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97070     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97073     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97076     1  0.3784      0.835 0.864 0.004 0.132
#> GSM97077     2  0.0237      0.877 0.000 0.996 0.004
#> GSM97095     1  0.6180      0.291 0.584 0.416 0.000
#> GSM97102     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97109     2  0.1315      0.874 0.020 0.972 0.008
#> GSM97110     2  0.1643      0.872 0.000 0.956 0.044
#> GSM97074     3  0.5517      0.627 0.268 0.004 0.728
#> GSM97085     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97059     2  0.0592      0.873 0.012 0.988 0.000
#> GSM97072     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97078     3  0.6796      0.459 0.344 0.024 0.632
#> GSM97067     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97087     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97111     2  0.2066      0.865 0.000 0.940 0.060
#> GSM97064     2  0.4555      0.779 0.000 0.800 0.200
#> GSM97065     3  0.5785      0.490 0.000 0.332 0.668
#> GSM97081     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97082     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97088     3  0.0892      0.898 0.000 0.020 0.980
#> GSM97100     2  0.0000      0.876 0.000 1.000 0.000
#> GSM97104     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97108     2  0.0424      0.878 0.000 0.992 0.008
#> GSM97050     2  0.4346      0.800 0.000 0.816 0.184
#> GSM97080     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97089     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97092     3  0.0000      0.908 0.000 0.000 1.000
#> GSM97093     2  0.5760      0.557 0.000 0.672 0.328
#> GSM97058     2  0.1031      0.877 0.000 0.976 0.024
#> GSM97051     2  0.4452      0.786 0.000 0.808 0.192
#> GSM97052     3  0.0237      0.907 0.000 0.004 0.996
#> GSM97061     3  0.2878      0.838 0.000 0.096 0.904

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.0188     0.9410 0.996 0.000 0.000 0.004
#> GSM97145     1  0.0188     0.9399 0.996 0.004 0.000 0.000
#> GSM97147     2  0.3117     0.7899 0.028 0.880 0.000 0.092
#> GSM97125     1  0.0817     0.9437 0.976 0.000 0.000 0.024
#> GSM97127     1  0.0000     0.9410 1.000 0.000 0.000 0.000
#> GSM97130     4  0.3123     0.7818 0.156 0.000 0.000 0.844
#> GSM97133     1  0.0188     0.9410 0.996 0.000 0.000 0.004
#> GSM97134     4  0.3801     0.6918 0.220 0.000 0.000 0.780
#> GSM97120     1  0.0376     0.9391 0.992 0.004 0.000 0.004
#> GSM97126     1  0.1284     0.9321 0.964 0.024 0.000 0.012
#> GSM97112     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97115     4  0.2413     0.8511 0.020 0.064 0.000 0.916
#> GSM97116     1  0.0188     0.9410 0.996 0.000 0.000 0.004
#> GSM97117     2  0.2450     0.8109 0.016 0.912 0.072 0.000
#> GSM97119     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97122     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97135     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97136     3  0.2174     0.8850 0.020 0.052 0.928 0.000
#> GSM97139     1  0.0188     0.9410 0.996 0.000 0.000 0.004
#> GSM97146     1  0.0188     0.9410 0.996 0.000 0.000 0.004
#> GSM97123     3  0.4807     0.6289 0.000 0.248 0.728 0.024
#> GSM97129     2  0.7386     0.2732 0.148 0.484 0.364 0.004
#> GSM97143     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97113     2  0.1677     0.8185 0.040 0.948 0.000 0.012
#> GSM97056     1  0.4193     0.6629 0.732 0.000 0.000 0.268
#> GSM97124     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97132     1  0.3219     0.8424 0.836 0.000 0.000 0.164
#> GSM97144     4  0.1940     0.8395 0.076 0.000 0.000 0.924
#> GSM97149     1  0.0524     0.9372 0.988 0.008 0.000 0.004
#> GSM97068     4  0.4898     0.2552 0.000 0.416 0.000 0.584
#> GSM97071     4  0.2216     0.8296 0.000 0.000 0.092 0.908
#> GSM97086     4  0.2814     0.7895 0.000 0.132 0.000 0.868
#> GSM97103     3  0.3919     0.8247 0.000 0.104 0.840 0.056
#> GSM97057     2  0.1824     0.8161 0.004 0.936 0.000 0.060
#> GSM97060     3  0.0336     0.9121 0.000 0.000 0.992 0.008
#> GSM97075     2  0.3402     0.7686 0.000 0.832 0.164 0.004
#> GSM97098     3  0.3711     0.8053 0.000 0.140 0.836 0.024
#> GSM97099     2  0.2586     0.8125 0.012 0.912 0.068 0.008
#> GSM97101     2  0.0524     0.8222 0.004 0.988 0.000 0.008
#> GSM97105     2  0.1302     0.8196 0.000 0.956 0.000 0.044
#> GSM97106     3  0.2224     0.8854 0.000 0.032 0.928 0.040
#> GSM97121     2  0.0592     0.8219 0.000 0.984 0.000 0.016
#> GSM97128     4  0.4927     0.6205 0.024 0.000 0.264 0.712
#> GSM97131     2  0.6555     0.6094 0.000 0.632 0.212 0.156
#> GSM97137     1  0.3975     0.6953 0.760 0.000 0.000 0.240
#> GSM97118     1  0.2921     0.8687 0.860 0.000 0.000 0.140
#> GSM97114     2  0.1716     0.8091 0.064 0.936 0.000 0.000
#> GSM97142     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97140     2  0.1792     0.8124 0.000 0.932 0.000 0.068
#> GSM97141     2  0.1042     0.8220 0.020 0.972 0.008 0.000
#> GSM97055     1  0.2002     0.9342 0.936 0.000 0.020 0.044
#> GSM97090     4  0.2670     0.8553 0.052 0.040 0.000 0.908
#> GSM97091     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97148     1  0.0188     0.9410 0.996 0.000 0.000 0.004
#> GSM97063     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97053     1  0.1302     0.9436 0.956 0.000 0.000 0.044
#> GSM97066     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97079     4  0.1743     0.8454 0.000 0.056 0.004 0.940
#> GSM97083     4  0.2271     0.8393 0.076 0.000 0.008 0.916
#> GSM97084     4  0.1389     0.8473 0.000 0.048 0.000 0.952
#> GSM97094     4  0.1004     0.8547 0.024 0.004 0.000 0.972
#> GSM97096     3  0.2282     0.8838 0.000 0.052 0.924 0.024
#> GSM97097     4  0.5532     0.6129 0.000 0.068 0.228 0.704
#> GSM97107     4  0.1109     0.8539 0.028 0.004 0.000 0.968
#> GSM97054     4  0.2011     0.8354 0.000 0.080 0.000 0.920
#> GSM97062     4  0.1661     0.8462 0.000 0.052 0.004 0.944
#> GSM97069     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97070     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97073     3  0.0188     0.9131 0.000 0.004 0.996 0.000
#> GSM97076     1  0.3860     0.8246 0.852 0.012 0.104 0.032
#> GSM97077     2  0.2401     0.8037 0.000 0.904 0.004 0.092
#> GSM97095     4  0.2892     0.8509 0.036 0.068 0.000 0.896
#> GSM97102     3  0.0188     0.9130 0.000 0.004 0.996 0.000
#> GSM97109     2  0.2522     0.8108 0.052 0.920 0.012 0.016
#> GSM97110     2  0.2895     0.8095 0.044 0.908 0.032 0.016
#> GSM97074     3  0.6869     0.3879 0.180 0.000 0.596 0.224
#> GSM97085     3  0.0707     0.9031 0.000 0.000 0.980 0.020
#> GSM97059     2  0.4134     0.6225 0.000 0.740 0.000 0.260
#> GSM97072     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97078     4  0.3224     0.8092 0.016 0.000 0.120 0.864
#> GSM97067     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97087     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97111     2  0.1576     0.8209 0.000 0.948 0.048 0.004
#> GSM97064     2  0.6079     0.4095 0.000 0.568 0.380 0.052
#> GSM97065     2  0.5302     0.6680 0.044 0.720 0.232 0.004
#> GSM97081     3  0.2216     0.8621 0.000 0.092 0.908 0.000
#> GSM97082     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97088     3  0.4992     0.0232 0.000 0.000 0.524 0.476
#> GSM97100     2  0.2647     0.7873 0.000 0.880 0.000 0.120
#> GSM97104     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97108     2  0.0921     0.8214 0.000 0.972 0.000 0.028
#> GSM97050     2  0.5952     0.6753 0.000 0.692 0.184 0.124
#> GSM97080     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97089     3  0.0000     0.9137 0.000 0.000 1.000 0.000
#> GSM97092     3  0.0657     0.9100 0.000 0.012 0.984 0.004
#> GSM97093     2  0.6077     0.1444 0.000 0.496 0.460 0.044
#> GSM97058     2  0.2101     0.8171 0.000 0.928 0.012 0.060
#> GSM97051     2  0.7390     0.4152 0.000 0.512 0.204 0.284
#> GSM97052     3  0.1042     0.9054 0.000 0.020 0.972 0.008
#> GSM97061     3  0.3731     0.8032 0.000 0.120 0.844 0.036

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.0880     0.7324 0.968 0.000 0.000 0.000 0.032
#> GSM97145     1  0.3530     0.7741 0.784 0.012 0.000 0.000 0.204
#> GSM97147     2  0.4776     0.6171 0.076 0.776 0.000 0.100 0.048
#> GSM97125     1  0.3579     0.7806 0.756 0.000 0.000 0.004 0.240
#> GSM97127     1  0.1851     0.7514 0.912 0.000 0.000 0.000 0.088
#> GSM97130     4  0.4877     0.5872 0.236 0.000 0.000 0.692 0.072
#> GSM97133     1  0.0162     0.7172 0.996 0.000 0.000 0.000 0.004
#> GSM97134     4  0.5952     0.3616 0.136 0.000 0.000 0.560 0.304
#> GSM97120     1  0.0324     0.7174 0.992 0.004 0.000 0.000 0.004
#> GSM97126     1  0.4666     0.7146 0.676 0.040 0.000 0.000 0.284
#> GSM97112     1  0.3838     0.7765 0.716 0.000 0.000 0.004 0.280
#> GSM97115     4  0.4480     0.6687 0.124 0.040 0.000 0.788 0.048
#> GSM97116     1  0.0162     0.7172 0.996 0.000 0.000 0.000 0.004
#> GSM97117     2  0.3996     0.6190 0.012 0.800 0.040 0.000 0.148
#> GSM97119     1  0.3861     0.7747 0.712 0.000 0.000 0.004 0.284
#> GSM97122     1  0.3838     0.7765 0.716 0.000 0.000 0.004 0.280
#> GSM97135     1  0.3838     0.7765 0.716 0.000 0.000 0.004 0.280
#> GSM97136     3  0.6063     0.2558 0.032 0.064 0.564 0.000 0.340
#> GSM97139     1  0.0000     0.7194 1.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0162     0.7172 0.996 0.000 0.000 0.000 0.004
#> GSM97123     3  0.5114     0.4967 0.000 0.188 0.720 0.024 0.068
#> GSM97129     5  0.8278     0.1567 0.092 0.308 0.192 0.016 0.392
#> GSM97143     1  0.3814     0.7776 0.720 0.000 0.000 0.004 0.276
#> GSM97113     2  0.5646     0.5895 0.144 0.700 0.020 0.008 0.128
#> GSM97056     1  0.3807     0.4138 0.748 0.000 0.000 0.240 0.012
#> GSM97124     1  0.3838     0.7765 0.716 0.000 0.000 0.004 0.280
#> GSM97132     1  0.6269     0.5173 0.508 0.000 0.000 0.168 0.324
#> GSM97144     4  0.3888     0.6520 0.056 0.000 0.000 0.796 0.148
#> GSM97149     1  0.0451     0.7114 0.988 0.004 0.000 0.000 0.008
#> GSM97068     4  0.6949     0.3277 0.160 0.280 0.000 0.520 0.040
#> GSM97071     4  0.4891     0.5499 0.000 0.004 0.068 0.704 0.224
#> GSM97086     4  0.4314     0.6079 0.000 0.124 0.004 0.780 0.092
#> GSM97103     3  0.6951     0.4151 0.000 0.140 0.580 0.084 0.196
#> GSM97057     2  0.6040     0.5819 0.152 0.688 0.008 0.088 0.064
#> GSM97060     3  0.1571     0.6832 0.000 0.000 0.936 0.004 0.060
#> GSM97075     2  0.4968     0.5576 0.000 0.712 0.136 0.000 0.152
#> GSM97098     3  0.5739     0.4913 0.000 0.148 0.664 0.016 0.172
#> GSM97099     2  0.4708     0.5797 0.012 0.744 0.048 0.004 0.192
#> GSM97101     2  0.1990     0.6598 0.008 0.920 0.000 0.004 0.068
#> GSM97105     2  0.3268     0.6578 0.000 0.856 0.004 0.080 0.060
#> GSM97106     3  0.3327     0.6391 0.000 0.028 0.864 0.036 0.072
#> GSM97121     2  0.2124     0.6702 0.000 0.916 0.000 0.028 0.056
#> GSM97128     4  0.6520     0.0915 0.008 0.000 0.148 0.432 0.412
#> GSM97131     2  0.7767     0.3239 0.000 0.472 0.232 0.184 0.112
#> GSM97137     1  0.4404     0.3451 0.704 0.000 0.000 0.264 0.032
#> GSM97118     1  0.6055     0.4694 0.472 0.000 0.000 0.120 0.408
#> GSM97114     2  0.4357     0.6019 0.104 0.768 0.000 0.000 0.128
#> GSM97142     1  0.3838     0.7765 0.716 0.000 0.000 0.004 0.280
#> GSM97140     2  0.3260     0.6578 0.000 0.856 0.004 0.084 0.056
#> GSM97141     2  0.2733     0.6446 0.012 0.872 0.004 0.000 0.112
#> GSM97055     1  0.4419     0.7204 0.644 0.000 0.008 0.004 0.344
#> GSM97090     4  0.3846     0.6777 0.128 0.004 0.004 0.816 0.048
#> GSM97091     1  0.4047     0.7524 0.676 0.000 0.000 0.004 0.320
#> GSM97148     1  0.0162     0.7172 0.996 0.000 0.000 0.000 0.004
#> GSM97063     1  0.3906     0.7708 0.704 0.000 0.000 0.004 0.292
#> GSM97053     1  0.3607     0.7819 0.752 0.000 0.000 0.004 0.244
#> GSM97066     3  0.3561     0.5913 0.000 0.000 0.740 0.000 0.260
#> GSM97079     4  0.3619     0.6524 0.000 0.040 0.008 0.828 0.124
#> GSM97083     4  0.4398     0.5922 0.040 0.000 0.000 0.720 0.240
#> GSM97084     4  0.1740     0.6943 0.000 0.012 0.000 0.932 0.056
#> GSM97094     4  0.2284     0.6948 0.004 0.004 0.000 0.896 0.096
#> GSM97096     3  0.3831     0.6317 0.000 0.044 0.812 0.008 0.136
#> GSM97097     4  0.6077     0.4669 0.000 0.040 0.152 0.656 0.152
#> GSM97107     4  0.1740     0.6962 0.012 0.000 0.000 0.932 0.056
#> GSM97054     4  0.3323     0.6667 0.000 0.100 0.000 0.844 0.056
#> GSM97062     4  0.2293     0.6826 0.000 0.016 0.000 0.900 0.084
#> GSM97069     3  0.3274     0.6196 0.000 0.000 0.780 0.000 0.220
#> GSM97070     3  0.3612     0.5886 0.000 0.000 0.732 0.000 0.268
#> GSM97073     3  0.3857     0.5636 0.000 0.000 0.688 0.000 0.312
#> GSM97076     5  0.7455     0.4241 0.328 0.040 0.112 0.032 0.488
#> GSM97077     2  0.5314     0.6121 0.000 0.736 0.056 0.120 0.088
#> GSM97095     4  0.5867     0.6503 0.124 0.068 0.008 0.708 0.092
#> GSM97102     3  0.2612     0.6740 0.000 0.008 0.868 0.000 0.124
#> GSM97109     2  0.5504     0.5340 0.092 0.680 0.004 0.012 0.212
#> GSM97110     2  0.6004     0.5063 0.084 0.644 0.016 0.016 0.240
#> GSM97074     5  0.6017     0.3339 0.024 0.000 0.260 0.100 0.616
#> GSM97085     3  0.4009     0.5124 0.000 0.000 0.684 0.004 0.312
#> GSM97059     2  0.6981     0.3216 0.148 0.524 0.000 0.280 0.048
#> GSM97072     3  0.3480     0.6106 0.000 0.000 0.752 0.000 0.248
#> GSM97078     4  0.5464     0.4281 0.004 0.000 0.068 0.596 0.332
#> GSM97067     3  0.3612     0.5896 0.000 0.000 0.732 0.000 0.268
#> GSM97087     3  0.0324     0.6781 0.000 0.004 0.992 0.000 0.004
#> GSM97111     2  0.3461     0.6311 0.004 0.812 0.016 0.000 0.168
#> GSM97064     3  0.6931    -0.0706 0.000 0.396 0.452 0.064 0.088
#> GSM97065     2  0.7744    -0.0838 0.076 0.388 0.160 0.004 0.372
#> GSM97081     3  0.3962     0.6164 0.000 0.112 0.800 0.000 0.088
#> GSM97082     3  0.1410     0.6805 0.000 0.000 0.940 0.000 0.060
#> GSM97088     3  0.6769    -0.2083 0.000 0.000 0.396 0.316 0.288
#> GSM97100     2  0.4854     0.5919 0.000 0.724 0.004 0.184 0.088
#> GSM97104     3  0.1851     0.6756 0.000 0.000 0.912 0.000 0.088
#> GSM97108     2  0.1668     0.6704 0.000 0.940 0.000 0.028 0.032
#> GSM97050     2  0.7703     0.3240 0.000 0.468 0.268 0.152 0.112
#> GSM97080     3  0.2690     0.6543 0.000 0.000 0.844 0.000 0.156
#> GSM97089     3  0.0854     0.6757 0.000 0.008 0.976 0.004 0.012
#> GSM97092     3  0.1560     0.6693 0.000 0.020 0.948 0.004 0.028
#> GSM97093     3  0.7012     0.0607 0.000 0.344 0.488 0.064 0.104
#> GSM97058     2  0.4946     0.6299 0.000 0.768 0.072 0.084 0.076
#> GSM97051     2  0.8147     0.2295 0.000 0.376 0.228 0.280 0.116
#> GSM97052     3  0.2352     0.6545 0.000 0.032 0.912 0.008 0.048
#> GSM97061     3  0.4218     0.5737 0.000 0.112 0.804 0.024 0.060

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.1918     0.6096 0.904 0.008 0.000 0.000 0.088 0.000
#> GSM97145     1  0.3855     0.6037 0.704 0.016 0.000 0.000 0.276 0.004
#> GSM97147     6  0.6226     0.1447 0.080 0.388 0.000 0.060 0.004 0.468
#> GSM97125     1  0.3742     0.5939 0.648 0.000 0.000 0.000 0.348 0.004
#> GSM97127     1  0.3056     0.6128 0.804 0.008 0.000 0.000 0.184 0.004
#> GSM97130     4  0.5753     0.4275 0.312 0.000 0.000 0.560 0.088 0.040
#> GSM97133     1  0.0508     0.5918 0.984 0.012 0.000 0.004 0.000 0.000
#> GSM97134     4  0.6148    -0.0167 0.088 0.000 0.000 0.436 0.420 0.056
#> GSM97120     1  0.1003     0.6007 0.964 0.016 0.000 0.000 0.020 0.000
#> GSM97126     1  0.6220     0.2911 0.444 0.100 0.000 0.008 0.412 0.036
#> GSM97112     1  0.3966     0.5447 0.552 0.000 0.000 0.000 0.444 0.004
#> GSM97115     4  0.6476     0.5331 0.168 0.016 0.000 0.588 0.076 0.152
#> GSM97116     1  0.0551     0.5956 0.984 0.008 0.000 0.004 0.004 0.000
#> GSM97117     2  0.3003     0.5826 0.000 0.852 0.028 0.000 0.016 0.104
#> GSM97119     1  0.3966     0.5461 0.552 0.000 0.000 0.000 0.444 0.004
#> GSM97122     1  0.3950     0.5542 0.564 0.000 0.000 0.000 0.432 0.004
#> GSM97135     1  0.3937     0.5598 0.572 0.000 0.000 0.000 0.424 0.004
#> GSM97136     3  0.7415     0.2445 0.012 0.192 0.432 0.008 0.276 0.080
#> GSM97139     1  0.0520     0.5987 0.984 0.008 0.000 0.000 0.008 0.000
#> GSM97146     1  0.0653     0.5896 0.980 0.012 0.000 0.004 0.004 0.000
#> GSM97123     3  0.5853     0.5081 0.000 0.068 0.608 0.012 0.056 0.256
#> GSM97129     2  0.8954     0.0612 0.104 0.312 0.112 0.040 0.296 0.136
#> GSM97143     1  0.4111     0.5301 0.536 0.000 0.000 0.004 0.456 0.004
#> GSM97113     2  0.5977     0.3679 0.216 0.596 0.008 0.000 0.032 0.148
#> GSM97056     1  0.4496     0.3228 0.744 0.004 0.000 0.168 0.052 0.032
#> GSM97124     1  0.4289     0.5339 0.540 0.000 0.000 0.012 0.444 0.004
#> GSM97132     5  0.6277    -0.1318 0.364 0.000 0.000 0.144 0.456 0.036
#> GSM97144     4  0.4683     0.5167 0.052 0.000 0.000 0.724 0.176 0.048
#> GSM97149     1  0.0964     0.5803 0.968 0.012 0.000 0.004 0.016 0.000
#> GSM97068     4  0.7717     0.1544 0.184 0.068 0.000 0.348 0.052 0.348
#> GSM97071     4  0.5991     0.3244 0.000 0.004 0.128 0.608 0.204 0.056
#> GSM97086     4  0.3878     0.4249 0.000 0.004 0.000 0.668 0.008 0.320
#> GSM97103     3  0.7335     0.3974 0.000 0.236 0.488 0.160 0.056 0.060
#> GSM97057     6  0.7099     0.0888 0.236 0.328 0.000 0.036 0.020 0.380
#> GSM97060     3  0.2842     0.7106 0.000 0.008 0.868 0.008 0.024 0.092
#> GSM97075     2  0.5470     0.4296 0.004 0.648 0.116 0.004 0.020 0.208
#> GSM97098     3  0.6224     0.4661 0.000 0.320 0.532 0.012 0.052 0.084
#> GSM97099     2  0.3024     0.5660 0.008 0.880 0.028 0.012 0.028 0.044
#> GSM97101     2  0.3104     0.5124 0.000 0.788 0.000 0.004 0.004 0.204
#> GSM97105     6  0.4517     0.1367 0.000 0.444 0.000 0.032 0.000 0.524
#> GSM97106     3  0.5627     0.6196 0.000 0.028 0.676 0.060 0.060 0.176
#> GSM97121     2  0.4325     0.1144 0.000 0.568 0.000 0.016 0.004 0.412
#> GSM97128     5  0.6366     0.1586 0.000 0.000 0.112 0.292 0.520 0.076
#> GSM97131     6  0.6897     0.4273 0.000 0.136 0.112 0.184 0.020 0.548
#> GSM97137     1  0.5146     0.1191 0.644 0.000 0.000 0.260 0.060 0.036
#> GSM97118     5  0.5573     0.2205 0.200 0.000 0.000 0.112 0.640 0.048
#> GSM97114     2  0.3857     0.5549 0.092 0.788 0.000 0.000 0.008 0.112
#> GSM97142     1  0.3961     0.5488 0.556 0.000 0.000 0.000 0.440 0.004
#> GSM97140     6  0.4356     0.1364 0.004 0.432 0.000 0.016 0.000 0.548
#> GSM97141     2  0.2703     0.5422 0.000 0.824 0.000 0.000 0.004 0.172
#> GSM97055     5  0.5364    -0.3603 0.424 0.028 0.028 0.000 0.508 0.012
#> GSM97090     4  0.5701     0.5401 0.188 0.000 0.000 0.640 0.080 0.092
#> GSM97091     5  0.3995    -0.5033 0.480 0.000 0.000 0.000 0.516 0.004
#> GSM97148     1  0.0767     0.5871 0.976 0.012 0.000 0.004 0.008 0.000
#> GSM97063     1  0.3986     0.5131 0.532 0.000 0.000 0.000 0.464 0.004
#> GSM97053     1  0.3672     0.5879 0.632 0.000 0.000 0.000 0.368 0.000
#> GSM97066     3  0.4137     0.6350 0.000 0.012 0.768 0.016 0.168 0.036
#> GSM97079     4  0.4465     0.5009 0.000 0.032 0.004 0.704 0.020 0.240
#> GSM97083     4  0.5278     0.1528 0.004 0.000 0.012 0.504 0.424 0.056
#> GSM97084     4  0.2402     0.5950 0.000 0.000 0.000 0.868 0.012 0.120
#> GSM97094     4  0.2375     0.6021 0.000 0.008 0.000 0.896 0.060 0.036
#> GSM97096     3  0.5840     0.5943 0.000 0.196 0.636 0.012 0.048 0.108
#> GSM97097     4  0.6223     0.4435 0.000 0.080 0.096 0.640 0.036 0.148
#> GSM97107     4  0.1622     0.6082 0.016 0.000 0.000 0.940 0.028 0.016
#> GSM97054     4  0.3758     0.4664 0.000 0.000 0.000 0.668 0.008 0.324
#> GSM97062     4  0.2980     0.5689 0.000 0.000 0.000 0.808 0.012 0.180
#> GSM97069     3  0.3178     0.6799 0.000 0.008 0.848 0.016 0.104 0.024
#> GSM97070     3  0.4002     0.6530 0.000 0.016 0.792 0.016 0.136 0.040
#> GSM97073     3  0.5001     0.6232 0.000 0.060 0.724 0.016 0.156 0.044
#> GSM97076     5  0.9419     0.1306 0.188 0.188 0.192 0.080 0.284 0.068
#> GSM97077     6  0.5450     0.4277 0.004 0.228 0.024 0.048 0.032 0.664
#> GSM97095     4  0.7260     0.4862 0.168 0.032 0.000 0.516 0.116 0.168
#> GSM97102     3  0.3540     0.7020 0.000 0.076 0.840 0.012 0.040 0.032
#> GSM97109     2  0.3512     0.5588 0.036 0.856 0.008 0.024 0.036 0.040
#> GSM97110     2  0.4690     0.5154 0.048 0.792 0.040 0.028 0.036 0.056
#> GSM97074     5  0.6832     0.2135 0.000 0.016 0.284 0.096 0.504 0.100
#> GSM97085     3  0.5459     0.3169 0.000 0.008 0.548 0.016 0.364 0.064
#> GSM97059     6  0.7218     0.2905 0.148 0.172 0.000 0.176 0.012 0.492
#> GSM97072     3  0.3873     0.6722 0.000 0.024 0.812 0.016 0.108 0.040
#> GSM97078     5  0.6415    -0.0231 0.000 0.000 0.096 0.388 0.440 0.076
#> GSM97067     3  0.4280     0.6439 0.000 0.024 0.772 0.016 0.148 0.040
#> GSM97087     3  0.3608     0.6801 0.000 0.000 0.788 0.000 0.064 0.148
#> GSM97111     2  0.2882     0.5823 0.000 0.860 0.020 0.000 0.020 0.100
#> GSM97064     6  0.6161     0.0840 0.000 0.052 0.360 0.020 0.056 0.512
#> GSM97065     2  0.7146     0.2867 0.024 0.540 0.216 0.016 0.124 0.080
#> GSM97081     3  0.4991     0.6409 0.000 0.136 0.712 0.000 0.048 0.104
#> GSM97082     3  0.2401     0.7158 0.000 0.004 0.892 0.000 0.044 0.060
#> GSM97088     5  0.7140     0.1455 0.000 0.000 0.268 0.236 0.404 0.092
#> GSM97100     6  0.5029     0.3767 0.000 0.276 0.000 0.112 0.000 0.612
#> GSM97104     3  0.1390     0.7196 0.000 0.016 0.948 0.000 0.004 0.032
#> GSM97108     2  0.4051     0.0720 0.000 0.560 0.000 0.008 0.000 0.432
#> GSM97050     6  0.6680     0.4206 0.000 0.092 0.156 0.104 0.048 0.600
#> GSM97080     3  0.1901     0.7112 0.000 0.008 0.924 0.004 0.052 0.012
#> GSM97089     3  0.3955     0.6792 0.000 0.012 0.776 0.000 0.064 0.148
#> GSM97092     3  0.3695     0.6626 0.000 0.004 0.776 0.000 0.044 0.176
#> GSM97093     6  0.7338     0.0740 0.000 0.184 0.312 0.020 0.076 0.408
#> GSM97058     6  0.5622     0.3845 0.000 0.296 0.056 0.024 0.024 0.600
#> GSM97051     6  0.5982     0.4381 0.000 0.036 0.104 0.184 0.036 0.640
#> GSM97052     3  0.4038     0.6276 0.000 0.000 0.728 0.000 0.056 0.216
#> GSM97061     3  0.4857     0.5299 0.000 0.008 0.636 0.004 0.056 0.296

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-skmeans-membership-heatmap-5

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)

plot of chunk tab-SD-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-SD-skmeans-get-signatures-no-scale-1

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

plot of chunk tab-SD-skmeans-get-signatures-no-scale-2

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

plot of chunk tab-SD-skmeans-get-signatures-no-scale-3

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

plot of chunk tab-SD-skmeans-get-signatures-no-scale-4

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

plot of chunk tab-SD-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-skmeans-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-SD-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-skmeans-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:skmeans 97         5.64e-04       0.415     3.09e-13   0.1020 2
#> SD:skmeans 94         3.88e-04       0.472     3.48e-13   0.4671 3
#> SD:skmeans 93         6.25e-04       0.424     3.06e-15   0.1922 4
#> SD:skmeans 77         8.93e-06       0.200     2.55e-14   0.0219 5
#> SD:skmeans 56         5.12e-05       0.782     2.75e-09   0.2266 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.


SD:pam

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "pam"]
# 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 21512 rows and 100 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 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)

plot of chunk SD-pam-collect-plots

The plots are:

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:

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)

plot of chunk SD-pam-select-partition-number

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.646           0.818       0.903         0.4445 0.535   0.535
#> 3 3 0.608           0.787       0.879         0.4692 0.687   0.473
#> 4 4 0.626           0.640       0.793         0.0930 0.908   0.748
#> 5 5 0.602           0.589       0.753         0.0738 0.902   0.688
#> 6 6 0.628           0.541       0.736         0.0581 0.866   0.509

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.4298      0.830 0.912 0.088
#> GSM97145     1  0.4298      0.830 0.912 0.088
#> GSM97147     2  0.5408      0.881 0.124 0.876
#> GSM97125     1  0.4298      0.830 0.912 0.088
#> GSM97127     1  0.1633      0.826 0.976 0.024
#> GSM97130     1  0.0000      0.819 1.000 0.000
#> GSM97133     1  0.0000      0.819 1.000 0.000
#> GSM97134     1  0.8443      0.638 0.728 0.272
#> GSM97120     1  0.6048      0.805 0.852 0.148
#> GSM97126     1  0.9686      0.505 0.604 0.396
#> GSM97112     1  0.4298      0.830 0.912 0.088
#> GSM97115     2  0.6247      0.852 0.156 0.844
#> GSM97116     1  0.0672      0.822 0.992 0.008
#> GSM97117     2  0.0000      0.926 0.000 1.000
#> GSM97119     1  0.4298      0.830 0.912 0.088
#> GSM97122     1  0.4298      0.830 0.912 0.088
#> GSM97135     1  0.4298      0.830 0.912 0.088
#> GSM97136     2  0.9170      0.277 0.332 0.668
#> GSM97139     1  0.3274      0.830 0.940 0.060
#> GSM97146     1  0.0000      0.819 1.000 0.000
#> GSM97123     2  0.1633      0.922 0.024 0.976
#> GSM97129     2  0.9954     -0.206 0.460 0.540
#> GSM97143     1  0.9635      0.581 0.612 0.388
#> GSM97113     2  0.0672      0.925 0.008 0.992
#> GSM97056     1  0.0000      0.819 1.000 0.000
#> GSM97124     1  0.4298      0.830 0.912 0.088
#> GSM97132     1  0.5946      0.801 0.856 0.144
#> GSM97144     1  0.5946      0.766 0.856 0.144
#> GSM97149     1  0.3733      0.803 0.928 0.072
#> GSM97068     2  0.4431      0.898 0.092 0.908
#> GSM97071     2  0.6712      0.831 0.176 0.824
#> GSM97086     2  0.4298      0.899 0.088 0.912
#> GSM97103     2  0.0000      0.926 0.000 1.000
#> GSM97057     2  0.4298      0.899 0.088 0.912
#> GSM97060     2  0.0000      0.926 0.000 1.000
#> GSM97075     2  0.0000      0.926 0.000 1.000
#> GSM97098     2  0.0000      0.926 0.000 1.000
#> GSM97099     2  0.0000      0.926 0.000 1.000
#> GSM97101     2  0.0000      0.926 0.000 1.000
#> GSM97105     2  0.4298      0.899 0.088 0.912
#> GSM97106     2  0.0000      0.926 0.000 1.000
#> GSM97121     2  0.4298      0.899 0.088 0.912
#> GSM97128     1  0.9922      0.230 0.552 0.448
#> GSM97131     2  0.1633      0.922 0.024 0.976
#> GSM97137     1  0.1633      0.820 0.976 0.024
#> GSM97118     1  0.9393      0.627 0.644 0.356
#> GSM97114     2  0.0938      0.918 0.012 0.988
#> GSM97142     1  0.4298      0.830 0.912 0.088
#> GSM97140     2  0.4298      0.899 0.088 0.912
#> GSM97141     2  0.0000      0.926 0.000 1.000
#> GSM97055     1  0.9522      0.608 0.628 0.372
#> GSM97090     1  0.9732      0.375 0.596 0.404
#> GSM97091     1  0.4939      0.827 0.892 0.108
#> GSM97148     1  0.0000      0.819 1.000 0.000
#> GSM97063     1  0.4298      0.830 0.912 0.088
#> GSM97053     1  0.0000      0.819 1.000 0.000
#> GSM97066     2  0.0000      0.926 0.000 1.000
#> GSM97079     2  0.4298      0.899 0.088 0.912
#> GSM97083     1  0.8207      0.658 0.744 0.256
#> GSM97084     2  0.5842      0.867 0.140 0.860
#> GSM97094     1  0.9996      0.267 0.512 0.488
#> GSM97096     2  0.0000      0.926 0.000 1.000
#> GSM97097     2  0.0000      0.926 0.000 1.000
#> GSM97107     2  0.6148      0.851 0.152 0.848
#> GSM97054     2  0.6247      0.852 0.156 0.844
#> GSM97062     2  0.6148      0.856 0.152 0.848
#> GSM97069     2  0.0000      0.926 0.000 1.000
#> GSM97070     2  0.0000      0.926 0.000 1.000
#> GSM97073     2  0.0000      0.926 0.000 1.000
#> GSM97076     2  0.9323      0.501 0.348 0.652
#> GSM97077     2  0.4298      0.899 0.088 0.912
#> GSM97095     2  0.6048      0.860 0.148 0.852
#> GSM97102     2  0.0000      0.926 0.000 1.000
#> GSM97109     2  0.0000      0.926 0.000 1.000
#> GSM97110     2  0.0000      0.926 0.000 1.000
#> GSM97074     1  0.9358      0.605 0.648 0.352
#> GSM97085     2  0.3431      0.881 0.064 0.936
#> GSM97059     2  0.4431      0.898 0.092 0.908
#> GSM97072     2  0.0000      0.926 0.000 1.000
#> GSM97078     1  0.9944      0.210 0.544 0.456
#> GSM97067     2  0.0000      0.926 0.000 1.000
#> GSM97087     2  0.0000      0.926 0.000 1.000
#> GSM97111     2  0.0000      0.926 0.000 1.000
#> GSM97064     2  0.4298      0.899 0.088 0.912
#> GSM97065     2  0.2236      0.918 0.036 0.964
#> GSM97081     2  0.0000      0.926 0.000 1.000
#> GSM97082     2  0.0000      0.926 0.000 1.000
#> GSM97088     2  0.4562      0.858 0.096 0.904
#> GSM97100     2  0.4298      0.899 0.088 0.912
#> GSM97104     2  0.0000      0.926 0.000 1.000
#> GSM97108     2  0.0000      0.926 0.000 1.000
#> GSM97050     2  0.4298      0.899 0.088 0.912
#> GSM97080     2  0.0000      0.926 0.000 1.000
#> GSM97089     2  0.0000      0.926 0.000 1.000
#> GSM97092     2  0.0000      0.926 0.000 1.000
#> GSM97093     2  0.4298      0.899 0.088 0.912
#> GSM97058     2  0.4298      0.899 0.088 0.912
#> GSM97051     2  0.4298      0.899 0.088 0.912
#> GSM97052     2  0.0000      0.926 0.000 1.000
#> GSM97061     2  0.0000      0.926 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0592     0.8613 0.988 0.000 0.012
#> GSM97145     1  0.0000     0.8637 1.000 0.000 0.000
#> GSM97147     2  0.0661     0.8761 0.004 0.988 0.008
#> GSM97125     1  0.0000     0.8637 1.000 0.000 0.000
#> GSM97127     1  0.0000     0.8637 1.000 0.000 0.000
#> GSM97130     2  0.3619     0.7897 0.136 0.864 0.000
#> GSM97133     1  0.5016     0.5972 0.760 0.240 0.000
#> GSM97134     2  0.6215     0.2552 0.428 0.572 0.000
#> GSM97120     1  0.3038     0.8023 0.896 0.000 0.104
#> GSM97126     3  0.9977    -0.1030 0.300 0.348 0.352
#> GSM97112     1  0.0000     0.8637 1.000 0.000 0.000
#> GSM97115     2  0.1643     0.8589 0.044 0.956 0.000
#> GSM97116     1  0.0000     0.8637 1.000 0.000 0.000
#> GSM97117     3  0.3619     0.8823 0.000 0.136 0.864
#> GSM97119     1  0.0747     0.8616 0.984 0.016 0.000
#> GSM97122     1  0.0747     0.8616 0.984 0.016 0.000
#> GSM97135     1  0.0424     0.8634 0.992 0.008 0.000
#> GSM97136     3  0.5919     0.5647 0.276 0.012 0.712
#> GSM97139     1  0.0000     0.8637 1.000 0.000 0.000
#> GSM97146     1  0.2878     0.7937 0.904 0.096 0.000
#> GSM97123     3  0.2711     0.8745 0.000 0.088 0.912
#> GSM97129     3  0.7208     0.4021 0.340 0.040 0.620
#> GSM97143     1  0.6888     0.2304 0.552 0.016 0.432
#> GSM97113     3  0.3989     0.8752 0.012 0.124 0.864
#> GSM97056     2  0.5882     0.5247 0.348 0.652 0.000
#> GSM97124     1  0.0747     0.8616 0.984 0.016 0.000
#> GSM97132     1  0.5744     0.7390 0.800 0.128 0.072
#> GSM97144     2  0.5327     0.6323 0.272 0.728 0.000
#> GSM97149     1  0.6274     0.0108 0.544 0.456 0.000
#> GSM97068     2  0.0424     0.8756 0.000 0.992 0.008
#> GSM97071     2  0.2448     0.8470 0.000 0.924 0.076
#> GSM97086     2  0.1163     0.8756 0.000 0.972 0.028
#> GSM97103     3  0.2959     0.8885 0.000 0.100 0.900
#> GSM97057     2  0.1163     0.8756 0.000 0.972 0.028
#> GSM97060     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97075     3  0.3686     0.8811 0.000 0.140 0.860
#> GSM97098     3  0.2356     0.8898 0.000 0.072 0.928
#> GSM97099     3  0.3686     0.8811 0.000 0.140 0.860
#> GSM97101     3  0.3686     0.8811 0.000 0.140 0.860
#> GSM97105     2  0.2448     0.8559 0.000 0.924 0.076
#> GSM97106     3  0.2261     0.8905 0.000 0.068 0.932
#> GSM97121     2  0.1163     0.8763 0.000 0.972 0.028
#> GSM97128     2  0.8823     0.3919 0.280 0.564 0.156
#> GSM97131     3  0.4399     0.8457 0.000 0.188 0.812
#> GSM97137     2  0.3686     0.7881 0.140 0.860 0.000
#> GSM97118     1  0.8397     0.4854 0.588 0.116 0.296
#> GSM97114     3  0.4228     0.8768 0.008 0.148 0.844
#> GSM97142     1  0.0237     0.8637 0.996 0.004 0.000
#> GSM97140     2  0.1529     0.8722 0.000 0.960 0.040
#> GSM97141     3  0.3619     0.8823 0.000 0.136 0.864
#> GSM97055     1  0.7458     0.5718 0.676 0.088 0.236
#> GSM97090     2  0.3619     0.7897 0.136 0.864 0.000
#> GSM97091     1  0.1774     0.8526 0.960 0.016 0.024
#> GSM97148     1  0.0237     0.8629 0.996 0.004 0.000
#> GSM97063     1  0.0592     0.8627 0.988 0.012 0.000
#> GSM97053     1  0.0000     0.8637 1.000 0.000 0.000
#> GSM97066     3  0.0892     0.8840 0.000 0.020 0.980
#> GSM97079     2  0.2625     0.8614 0.000 0.916 0.084
#> GSM97083     2  0.4605     0.7292 0.204 0.796 0.000
#> GSM97084     2  0.0592     0.8754 0.000 0.988 0.012
#> GSM97094     3  0.9901    -0.0639 0.336 0.272 0.392
#> GSM97096     3  0.2356     0.8898 0.000 0.072 0.928
#> GSM97097     3  0.3038     0.8881 0.000 0.104 0.896
#> GSM97107     2  0.2711     0.8238 0.000 0.912 0.088
#> GSM97054     2  0.0747     0.8765 0.000 0.984 0.016
#> GSM97062     2  0.0237     0.8746 0.000 0.996 0.004
#> GSM97069     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97070     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97073     3  0.2165     0.8908 0.000 0.064 0.936
#> GSM97076     2  0.3910     0.8139 0.104 0.876 0.020
#> GSM97077     2  0.1163     0.8756 0.000 0.972 0.028
#> GSM97095     2  0.0000     0.8733 0.000 1.000 0.000
#> GSM97102     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97109     3  0.2959     0.8885 0.000 0.100 0.900
#> GSM97110     3  0.3116     0.8876 0.000 0.108 0.892
#> GSM97074     1  0.8140     0.2702 0.524 0.072 0.404
#> GSM97085     3  0.1289     0.8693 0.000 0.032 0.968
#> GSM97059     2  0.1163     0.8756 0.000 0.972 0.028
#> GSM97072     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97078     2  0.4369     0.8190 0.040 0.864 0.096
#> GSM97067     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97087     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97111     3  0.3619     0.8823 0.000 0.136 0.864
#> GSM97064     2  0.2066     0.8640 0.000 0.940 0.060
#> GSM97065     3  0.4654     0.8203 0.000 0.208 0.792
#> GSM97081     3  0.1964     0.8879 0.000 0.056 0.944
#> GSM97082     3  0.1860     0.8858 0.000 0.052 0.948
#> GSM97088     3  0.4217     0.8156 0.032 0.100 0.868
#> GSM97100     2  0.1163     0.8756 0.000 0.972 0.028
#> GSM97104     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97108     3  0.3686     0.8811 0.000 0.140 0.860
#> GSM97050     2  0.2537     0.8645 0.000 0.920 0.080
#> GSM97080     3  0.0000     0.8812 0.000 0.000 1.000
#> GSM97089     3  0.2356     0.8898 0.000 0.072 0.928
#> GSM97092     3  0.1753     0.8858 0.000 0.048 0.952
#> GSM97093     2  0.6337     0.6416 0.028 0.708 0.264
#> GSM97058     2  0.2711     0.8420 0.000 0.912 0.088
#> GSM97051     2  0.3267     0.8451 0.000 0.884 0.116
#> GSM97052     3  0.1860     0.8858 0.000 0.052 0.948
#> GSM97061     3  0.2165     0.8881 0.000 0.064 0.936

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.0188     0.7240 0.996 0.000 0.000 0.004
#> GSM97145     1  0.1557     0.7043 0.944 0.000 0.000 0.056
#> GSM97147     2  0.1256     0.8428 0.000 0.964 0.028 0.008
#> GSM97125     1  0.4454     0.4991 0.692 0.000 0.000 0.308
#> GSM97127     1  0.4134     0.5509 0.740 0.000 0.000 0.260
#> GSM97130     2  0.3443     0.7832 0.016 0.848 0.000 0.136
#> GSM97133     1  0.0188     0.7238 0.996 0.004 0.000 0.000
#> GSM97134     2  0.6773     0.3971 0.276 0.588 0.000 0.136
#> GSM97120     1  0.0188     0.7227 0.996 0.000 0.004 0.000
#> GSM97126     2  0.8959    -0.0606 0.104 0.384 0.376 0.136
#> GSM97112     4  0.4948     0.0325 0.440 0.000 0.000 0.560
#> GSM97115     2  0.1953     0.8374 0.004 0.940 0.012 0.044
#> GSM97116     1  0.0000     0.7259 1.000 0.000 0.000 0.000
#> GSM97117     3  0.1743     0.8099 0.000 0.056 0.940 0.004
#> GSM97119     4  0.4585     0.2935 0.332 0.000 0.000 0.668
#> GSM97122     1  0.4933     0.2611 0.568 0.000 0.000 0.432
#> GSM97135     1  0.4746     0.4111 0.632 0.000 0.000 0.368
#> GSM97136     3  0.4571     0.5837 0.252 0.004 0.736 0.008
#> GSM97139     1  0.0000     0.7259 1.000 0.000 0.000 0.000
#> GSM97146     1  0.0000     0.7259 1.000 0.000 0.000 0.000
#> GSM97123     3  0.5564     0.7717 0.000 0.076 0.708 0.216
#> GSM97129     3  0.7213     0.3217 0.260 0.016 0.588 0.136
#> GSM97143     3  0.7704    -0.1942 0.336 0.000 0.432 0.232
#> GSM97113     3  0.2081     0.7936 0.000 0.084 0.916 0.000
#> GSM97056     1  0.4800     0.2509 0.656 0.340 0.000 0.004
#> GSM97124     1  0.4981     0.1641 0.536 0.000 0.000 0.464
#> GSM97132     4  0.8204     0.2131 0.336 0.084 0.088 0.492
#> GSM97144     2  0.6400     0.5411 0.168 0.652 0.000 0.180
#> GSM97149     1  0.1637     0.6582 0.940 0.060 0.000 0.000
#> GSM97068     2  0.1706     0.8406 0.000 0.948 0.016 0.036
#> GSM97071     2  0.3749     0.8013 0.000 0.840 0.032 0.128
#> GSM97086     2  0.0469     0.8449 0.000 0.988 0.012 0.000
#> GSM97103     3  0.0657     0.8148 0.000 0.004 0.984 0.012
#> GSM97057     2  0.1305     0.8442 0.000 0.960 0.036 0.004
#> GSM97060     3  0.4072     0.7831 0.000 0.000 0.748 0.252
#> GSM97075     3  0.2053     0.8066 0.000 0.072 0.924 0.004
#> GSM97098     3  0.1398     0.8159 0.000 0.004 0.956 0.040
#> GSM97099     3  0.1489     0.8109 0.000 0.044 0.952 0.004
#> GSM97101     3  0.1743     0.8101 0.000 0.056 0.940 0.004
#> GSM97105     2  0.3249     0.7861 0.000 0.852 0.140 0.008
#> GSM97106     3  0.2831     0.8153 0.000 0.004 0.876 0.120
#> GSM97121     2  0.1576     0.8401 0.000 0.948 0.048 0.004
#> GSM97128     4  0.5150     0.0140 0.000 0.396 0.008 0.596
#> GSM97131     3  0.3542     0.7798 0.000 0.120 0.852 0.028
#> GSM97137     2  0.2002     0.8342 0.020 0.936 0.000 0.044
#> GSM97118     4  0.9014     0.3057 0.232 0.076 0.264 0.428
#> GSM97114     3  0.2708     0.8041 0.016 0.076 0.904 0.004
#> GSM97142     4  0.4817     0.1959 0.388 0.000 0.000 0.612
#> GSM97140     2  0.1902     0.8340 0.000 0.932 0.064 0.004
#> GSM97141     3  0.1489     0.8109 0.000 0.044 0.952 0.004
#> GSM97055     4  0.6751     0.3333 0.240 0.060 0.048 0.652
#> GSM97090     2  0.1888     0.8340 0.016 0.940 0.000 0.044
#> GSM97091     4  0.4585     0.2935 0.332 0.000 0.000 0.668
#> GSM97148     1  0.0000     0.7259 1.000 0.000 0.000 0.000
#> GSM97063     4  0.4761     0.2337 0.372 0.000 0.000 0.628
#> GSM97053     1  0.4661     0.4432 0.652 0.000 0.000 0.348
#> GSM97066     3  0.4748     0.7738 0.000 0.016 0.716 0.268
#> GSM97079     2  0.2412     0.8287 0.000 0.908 0.084 0.008
#> GSM97083     2  0.5582     0.4080 0.024 0.576 0.000 0.400
#> GSM97084     2  0.1211     0.8405 0.000 0.960 0.000 0.040
#> GSM97094     3  0.9678    -0.2129 0.216 0.212 0.384 0.188
#> GSM97096     3  0.1398     0.8159 0.000 0.004 0.956 0.040
#> GSM97097     3  0.0937     0.8160 0.000 0.012 0.976 0.012
#> GSM97107     2  0.4856     0.7316 0.000 0.780 0.084 0.136
#> GSM97054     2  0.0336     0.8451 0.000 0.992 0.008 0.000
#> GSM97062     2  0.1677     0.8399 0.000 0.948 0.012 0.040
#> GSM97069     3  0.3873     0.7843 0.000 0.000 0.772 0.228
#> GSM97070     3  0.3837     0.7852 0.000 0.000 0.776 0.224
#> GSM97073     3  0.2469     0.8100 0.000 0.000 0.892 0.108
#> GSM97076     2  0.4011     0.8097 0.020 0.844 0.024 0.112
#> GSM97077     2  0.1661     0.8383 0.000 0.944 0.052 0.004
#> GSM97095     2  0.0707     0.8444 0.000 0.980 0.000 0.020
#> GSM97102     3  0.3172     0.8089 0.000 0.000 0.840 0.160
#> GSM97109     3  0.0657     0.8148 0.000 0.004 0.984 0.012
#> GSM97110     3  0.1209     0.8126 0.000 0.032 0.964 0.004
#> GSM97074     4  0.8033     0.3496 0.220 0.036 0.208 0.536
#> GSM97085     4  0.5257    -0.2800 0.000 0.008 0.444 0.548
#> GSM97059     2  0.1398     0.8404 0.000 0.956 0.040 0.004
#> GSM97072     3  0.4072     0.7797 0.000 0.000 0.748 0.252
#> GSM97078     2  0.3074     0.7878 0.000 0.848 0.000 0.152
#> GSM97067     3  0.3907     0.7856 0.000 0.000 0.768 0.232
#> GSM97087     3  0.3907     0.7896 0.000 0.000 0.768 0.232
#> GSM97111     3  0.1824     0.8082 0.000 0.060 0.936 0.004
#> GSM97064     2  0.4499     0.7579 0.000 0.804 0.124 0.072
#> GSM97065     3  0.3400     0.7537 0.004 0.128 0.856 0.012
#> GSM97081     3  0.3877     0.8169 0.000 0.048 0.840 0.112
#> GSM97082     3  0.5267     0.7822 0.000 0.048 0.712 0.240
#> GSM97088     4  0.6340    -0.1893 0.000 0.064 0.408 0.528
#> GSM97100     2  0.1489     0.8396 0.000 0.952 0.044 0.004
#> GSM97104     3  0.4382     0.7589 0.000 0.000 0.704 0.296
#> GSM97108     3  0.2053     0.8066 0.000 0.072 0.924 0.004
#> GSM97050     2  0.2563     0.8287 0.000 0.908 0.072 0.020
#> GSM97080     3  0.4331     0.7596 0.000 0.000 0.712 0.288
#> GSM97089     3  0.1722     0.8181 0.000 0.008 0.944 0.048
#> GSM97092     3  0.5136     0.7891 0.000 0.048 0.728 0.224
#> GSM97093     2  0.4769     0.6010 0.000 0.684 0.308 0.008
#> GSM97058     2  0.3355     0.7709 0.000 0.836 0.160 0.004
#> GSM97051     2  0.4322     0.7462 0.000 0.804 0.044 0.152
#> GSM97052     3  0.5102     0.7890 0.000 0.048 0.732 0.220
#> GSM97061     3  0.4880     0.8000 0.000 0.052 0.760 0.188

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.3993     0.8833 0.756 0.028 0.000 0.000 0.216
#> GSM97145     1  0.4313     0.7285 0.636 0.008 0.000 0.000 0.356
#> GSM97147     4  0.1915     0.7795 0.040 0.032 0.000 0.928 0.000
#> GSM97125     5  0.4016     0.4033 0.272 0.000 0.012 0.000 0.716
#> GSM97127     5  0.3913     0.2784 0.324 0.000 0.000 0.000 0.676
#> GSM97130     4  0.4524     0.6028 0.000 0.000 0.336 0.644 0.020
#> GSM97133     1  0.3452     0.9074 0.756 0.000 0.000 0.000 0.244
#> GSM97134     4  0.6381     0.4380 0.000 0.000 0.364 0.464 0.172
#> GSM97120     1  0.3819     0.8970 0.756 0.016 0.000 0.000 0.228
#> GSM97126     3  0.8294     0.0223 0.012 0.292 0.348 0.268 0.080
#> GSM97112     5  0.0609     0.6738 0.020 0.000 0.000 0.000 0.980
#> GSM97115     4  0.2351     0.7816 0.000 0.000 0.088 0.896 0.016
#> GSM97116     1  0.3452     0.9074 0.756 0.000 0.000 0.000 0.244
#> GSM97117     2  0.3090     0.6796 0.040 0.856 0.000 0.104 0.000
#> GSM97119     5  0.0162     0.6770 0.000 0.000 0.004 0.000 0.996
#> GSM97122     5  0.2329     0.6369 0.124 0.000 0.000 0.000 0.876
#> GSM97135     5  0.2377     0.6329 0.128 0.000 0.000 0.000 0.872
#> GSM97136     2  0.4960     0.5622 0.024 0.740 0.072 0.000 0.164
#> GSM97139     1  0.3452     0.9074 0.756 0.000 0.000 0.000 0.244
#> GSM97146     1  0.3452     0.9074 0.756 0.000 0.000 0.000 0.244
#> GSM97123     2  0.6408     0.5471 0.156 0.616 0.188 0.040 0.000
#> GSM97129     2  0.6880     0.1600 0.020 0.544 0.264 0.012 0.160
#> GSM97143     5  0.7120     0.1011 0.012 0.320 0.296 0.000 0.372
#> GSM97113     2  0.2329     0.6505 0.000 0.876 0.000 0.124 0.000
#> GSM97056     1  0.5363     0.5453 0.664 0.000 0.004 0.232 0.100
#> GSM97124     5  0.2439     0.6414 0.120 0.000 0.004 0.000 0.876
#> GSM97132     5  0.7099     0.3555 0.036 0.048 0.364 0.056 0.496
#> GSM97144     4  0.6218     0.4508 0.000 0.000 0.364 0.488 0.148
#> GSM97149     1  0.3993     0.8780 0.756 0.000 0.000 0.028 0.216
#> GSM97068     4  0.2474     0.7836 0.000 0.012 0.084 0.896 0.008
#> GSM97071     4  0.5581     0.6348 0.040 0.032 0.256 0.664 0.008
#> GSM97086     4  0.0162     0.7913 0.004 0.000 0.000 0.996 0.000
#> GSM97103     2  0.1041     0.6830 0.032 0.964 0.004 0.000 0.000
#> GSM97057     4  0.2017     0.7800 0.008 0.080 0.000 0.912 0.000
#> GSM97060     2  0.5954     0.5111 0.192 0.592 0.216 0.000 0.000
#> GSM97075     2  0.3649     0.6592 0.040 0.808 0.000 0.152 0.000
#> GSM97098     2  0.2344     0.6684 0.032 0.904 0.064 0.000 0.000
#> GSM97099     2  0.1740     0.6975 0.012 0.932 0.000 0.056 0.000
#> GSM97101     2  0.2470     0.6886 0.012 0.884 0.000 0.104 0.000
#> GSM97105     4  0.2520     0.7689 0.048 0.056 0.000 0.896 0.000
#> GSM97106     2  0.4761     0.6036 0.124 0.732 0.144 0.000 0.000
#> GSM97121     4  0.2438     0.7728 0.040 0.060 0.000 0.900 0.000
#> GSM97128     3  0.6845    -0.2551 0.000 0.004 0.400 0.348 0.248
#> GSM97131     2  0.4514     0.6221 0.072 0.740 0.000 0.188 0.000
#> GSM97137     4  0.2514     0.7818 0.000 0.000 0.060 0.896 0.044
#> GSM97118     5  0.7029     0.1816 0.000 0.216 0.364 0.016 0.404
#> GSM97114     2  0.3409     0.6750 0.052 0.836 0.000 0.112 0.000
#> GSM97142     5  0.0404     0.6777 0.012 0.000 0.000 0.000 0.988
#> GSM97140     4  0.2077     0.7773 0.040 0.040 0.000 0.920 0.000
#> GSM97141     2  0.1740     0.6975 0.012 0.932 0.000 0.056 0.000
#> GSM97055     5  0.4575     0.5150 0.048 0.040 0.012 0.100 0.800
#> GSM97090     4  0.2351     0.7816 0.000 0.000 0.088 0.896 0.016
#> GSM97091     5  0.0162     0.6770 0.000 0.000 0.004 0.000 0.996
#> GSM97148     1  0.3452     0.9074 0.756 0.000 0.000 0.000 0.244
#> GSM97063     5  0.0404     0.6777 0.012 0.000 0.000 0.000 0.988
#> GSM97053     5  0.2813     0.5914 0.168 0.000 0.000 0.000 0.832
#> GSM97066     3  0.5658     0.3611 0.080 0.408 0.512 0.000 0.000
#> GSM97079     4  0.3934     0.7204 0.032 0.168 0.008 0.792 0.000
#> GSM97083     4  0.6596     0.3011 0.000 0.000 0.372 0.416 0.212
#> GSM97084     4  0.2351     0.7816 0.000 0.000 0.088 0.896 0.016
#> GSM97094     2  0.8195    -0.1625 0.000 0.372 0.296 0.136 0.196
#> GSM97096     2  0.2344     0.6684 0.032 0.904 0.064 0.000 0.000
#> GSM97097     2  0.2504     0.6700 0.032 0.900 0.064 0.004 0.000
#> GSM97107     4  0.5848     0.4987 0.000 0.060 0.364 0.556 0.020
#> GSM97054     4  0.0162     0.7919 0.000 0.000 0.004 0.996 0.000
#> GSM97062     4  0.2518     0.7834 0.000 0.008 0.080 0.896 0.016
#> GSM97069     3  0.5689     0.3362 0.080 0.440 0.480 0.000 0.000
#> GSM97070     3  0.5689     0.3362 0.080 0.440 0.480 0.000 0.000
#> GSM97073     2  0.5153    -0.2858 0.040 0.524 0.436 0.000 0.000
#> GSM97076     4  0.5797     0.6758 0.000 0.064 0.228 0.660 0.048
#> GSM97077     4  0.1997     0.7783 0.040 0.036 0.000 0.924 0.000
#> GSM97095     4  0.1628     0.7908 0.000 0.000 0.056 0.936 0.008
#> GSM97102     2  0.3828     0.6448 0.072 0.808 0.120 0.000 0.000
#> GSM97109     2  0.1281     0.6829 0.032 0.956 0.012 0.000 0.000
#> GSM97110     2  0.1041     0.6844 0.004 0.964 0.000 0.032 0.000
#> GSM97074     3  0.3366     0.1695 0.000 0.004 0.784 0.000 0.212
#> GSM97085     3  0.4891     0.3360 0.076 0.036 0.760 0.000 0.128
#> GSM97059     4  0.1915     0.7795 0.040 0.032 0.000 0.928 0.000
#> GSM97072     3  0.5476     0.3333 0.068 0.388 0.544 0.000 0.000
#> GSM97078     4  0.4626     0.5737 0.000 0.000 0.364 0.616 0.020
#> GSM97067     3  0.5680     0.3501 0.080 0.428 0.492 0.000 0.000
#> GSM97087     2  0.5635     0.5403 0.168 0.636 0.196 0.000 0.000
#> GSM97111     2  0.3090     0.6796 0.040 0.856 0.000 0.104 0.000
#> GSM97064     4  0.4883     0.6988 0.100 0.100 0.036 0.764 0.000
#> GSM97065     2  0.3599     0.6457 0.020 0.824 0.016 0.140 0.000
#> GSM97081     2  0.4339     0.6907 0.060 0.808 0.056 0.076 0.000
#> GSM97082     2  0.6041     0.5149 0.168 0.628 0.188 0.016 0.000
#> GSM97088     3  0.6557     0.2940 0.004 0.224 0.608 0.048 0.116
#> GSM97100     4  0.1915     0.7795 0.040 0.032 0.000 0.928 0.000
#> GSM97104     3  0.5815     0.2237 0.104 0.356 0.540 0.000 0.000
#> GSM97108     2  0.3731     0.6537 0.040 0.800 0.000 0.160 0.000
#> GSM97050     4  0.3584     0.7502 0.056 0.108 0.004 0.832 0.000
#> GSM97080     3  0.5533     0.3637 0.084 0.336 0.580 0.000 0.000
#> GSM97089     2  0.1908     0.6881 0.092 0.908 0.000 0.000 0.000
#> GSM97092     2  0.5841     0.5783 0.168 0.664 0.144 0.024 0.000
#> GSM97093     4  0.4315     0.5956 0.024 0.276 0.000 0.700 0.000
#> GSM97058     4  0.2850     0.7583 0.036 0.092 0.000 0.872 0.000
#> GSM97051     4  0.4425     0.7001 0.132 0.036 0.044 0.788 0.000
#> GSM97052     2  0.5803     0.5804 0.168 0.668 0.140 0.024 0.000
#> GSM97061     2  0.5803     0.5998 0.160 0.680 0.124 0.036 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.0000     0.8449 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97145     1  0.4656     0.5908 0.708 0.024 0.000 0.000 0.064 0.204
#> GSM97147     4  0.1923     0.7423 0.000 0.064 0.016 0.916 0.004 0.000
#> GSM97125     1  0.6029    -0.0648 0.396 0.000 0.000 0.000 0.248 0.356
#> GSM97127     1  0.5815     0.0959 0.472 0.000 0.000 0.000 0.200 0.328
#> GSM97130     5  0.3817     0.3131 0.000 0.000 0.000 0.432 0.568 0.000
#> GSM97133     1  0.0000     0.8449 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97134     5  0.4346     0.5426 0.028 0.000 0.000 0.336 0.632 0.004
#> GSM97120     1  0.0000     0.8449 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97126     5  0.6168     0.5688 0.036 0.212 0.000 0.184 0.564 0.004
#> GSM97112     6  0.4466     0.5800 0.044 0.000 0.000 0.000 0.336 0.620
#> GSM97115     4  0.2730     0.7003 0.000 0.000 0.000 0.808 0.192 0.000
#> GSM97116     1  0.0000     0.8449 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97117     2  0.3014     0.6461 0.000 0.804 0.012 0.184 0.000 0.000
#> GSM97119     6  0.4466     0.5800 0.044 0.000 0.000 0.000 0.336 0.620
#> GSM97122     6  0.4766     0.5641 0.072 0.000 0.000 0.000 0.316 0.612
#> GSM97135     6  0.4766     0.5641 0.072 0.000 0.000 0.000 0.316 0.612
#> GSM97136     2  0.5300     0.4919 0.028 0.664 0.224 0.000 0.072 0.012
#> GSM97139     1  0.0000     0.8449 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000     0.8449 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97123     3  0.3377     0.5015 0.000 0.188 0.784 0.028 0.000 0.000
#> GSM97129     2  0.5559    -0.0591 0.024 0.472 0.000 0.060 0.440 0.004
#> GSM97143     5  0.5072     0.4363 0.048 0.172 0.000 0.000 0.696 0.084
#> GSM97113     2  0.3272     0.6093 0.016 0.820 0.000 0.144 0.020 0.000
#> GSM97056     1  0.2333     0.7314 0.884 0.000 0.000 0.092 0.024 0.000
#> GSM97124     6  0.4847     0.5382 0.064 0.000 0.000 0.000 0.376 0.560
#> GSM97132     5  0.1553     0.4790 0.032 0.004 0.000 0.012 0.944 0.008
#> GSM97144     5  0.3445     0.5996 0.008 0.000 0.000 0.260 0.732 0.000
#> GSM97149     1  0.0000     0.8449 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97068     4  0.2946     0.7118 0.000 0.012 0.000 0.812 0.176 0.000
#> GSM97071     4  0.4521     0.2197 0.000 0.032 0.012 0.644 0.312 0.000
#> GSM97086     4  0.0937     0.7714 0.000 0.000 0.000 0.960 0.040 0.000
#> GSM97103     2  0.1866     0.6400 0.000 0.908 0.084 0.000 0.000 0.008
#> GSM97057     4  0.2443     0.7514 0.004 0.096 0.000 0.880 0.020 0.000
#> GSM97060     3  0.2854     0.5321 0.000 0.208 0.792 0.000 0.000 0.000
#> GSM97075     2  0.3342     0.6249 0.000 0.760 0.012 0.228 0.000 0.000
#> GSM97098     2  0.3314     0.5454 0.000 0.764 0.224 0.000 0.000 0.012
#> GSM97099     2  0.1714     0.6773 0.000 0.908 0.000 0.092 0.000 0.000
#> GSM97101     2  0.2300     0.6646 0.000 0.856 0.000 0.144 0.000 0.000
#> GSM97105     4  0.1895     0.7391 0.000 0.072 0.016 0.912 0.000 0.000
#> GSM97106     3  0.3955     0.3723 0.000 0.316 0.668 0.004 0.000 0.012
#> GSM97121     4  0.2214     0.7274 0.000 0.096 0.016 0.888 0.000 0.000
#> GSM97128     5  0.2697     0.6243 0.000 0.000 0.000 0.188 0.812 0.000
#> GSM97131     2  0.4146     0.5419 0.000 0.676 0.036 0.288 0.000 0.000
#> GSM97137     4  0.2838     0.7024 0.004 0.000 0.000 0.808 0.188 0.000
#> GSM97118     5  0.3227     0.5191 0.028 0.124 0.000 0.000 0.832 0.016
#> GSM97114     2  0.3386     0.6404 0.008 0.788 0.016 0.188 0.000 0.000
#> GSM97142     6  0.4466     0.5800 0.044 0.000 0.000 0.000 0.336 0.620
#> GSM97140     4  0.1779     0.7418 0.000 0.064 0.016 0.920 0.000 0.000
#> GSM97141     2  0.1714     0.6773 0.000 0.908 0.000 0.092 0.000 0.000
#> GSM97055     6  0.6099     0.4368 0.004 0.008 0.000 0.180 0.344 0.464
#> GSM97090     4  0.2730     0.7003 0.000 0.000 0.000 0.808 0.192 0.000
#> GSM97091     6  0.4466     0.5800 0.044 0.000 0.000 0.000 0.336 0.620
#> GSM97148     1  0.0000     0.8449 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97063     6  0.4466     0.5800 0.044 0.000 0.000 0.000 0.336 0.620
#> GSM97053     6  0.5406     0.4695 0.160 0.000 0.000 0.000 0.272 0.568
#> GSM97066     3  0.6197     0.3165 0.000 0.228 0.396 0.000 0.008 0.368
#> GSM97079     4  0.4446     0.6450 0.000 0.220 0.032 0.720 0.020 0.008
#> GSM97083     5  0.3198     0.5997 0.000 0.000 0.000 0.260 0.740 0.000
#> GSM97084     4  0.2664     0.7073 0.000 0.000 0.000 0.816 0.184 0.000
#> GSM97094     5  0.5570     0.3802 0.016 0.336 0.008 0.080 0.560 0.000
#> GSM97096     2  0.3314     0.5454 0.000 0.764 0.224 0.000 0.000 0.012
#> GSM97097     2  0.3559     0.5486 0.000 0.744 0.240 0.004 0.000 0.012
#> GSM97107     5  0.4150     0.5388 0.000 0.028 0.000 0.320 0.652 0.000
#> GSM97054     4  0.1204     0.7706 0.000 0.000 0.000 0.944 0.056 0.000
#> GSM97062     4  0.3037     0.7223 0.000 0.016 0.004 0.820 0.160 0.000
#> GSM97069     6  0.6228    -0.3608 0.000 0.292 0.336 0.000 0.004 0.368
#> GSM97070     6  0.6110    -0.3617 0.000 0.296 0.336 0.000 0.000 0.368
#> GSM97073     6  0.6053    -0.3480 0.000 0.372 0.256 0.000 0.000 0.372
#> GSM97076     4  0.5735     0.3175 0.000 0.060 0.004 0.572 0.312 0.052
#> GSM97077     4  0.0260     0.7676 0.000 0.008 0.000 0.992 0.000 0.000
#> GSM97095     4  0.2260     0.7408 0.000 0.000 0.000 0.860 0.140 0.000
#> GSM97102     2  0.4201     0.4588 0.000 0.664 0.300 0.000 0.000 0.036
#> GSM97109     2  0.2056     0.6428 0.012 0.904 0.080 0.000 0.000 0.004
#> GSM97110     2  0.2446     0.6517 0.012 0.904 0.020 0.044 0.020 0.000
#> GSM97074     5  0.4193     0.4661 0.000 0.000 0.024 0.000 0.624 0.352
#> GSM97085     5  0.6082     0.0337 0.000 0.000 0.272 0.000 0.368 0.360
#> GSM97059     4  0.0692     0.7648 0.000 0.020 0.004 0.976 0.000 0.000
#> GSM97072     3  0.5750     0.2860 0.000 0.172 0.448 0.000 0.000 0.380
#> GSM97078     5  0.3717     0.4289 0.000 0.000 0.000 0.384 0.616 0.000
#> GSM97067     6  0.6315    -0.3601 0.000 0.288 0.336 0.000 0.008 0.368
#> GSM97087     3  0.3482     0.5340 0.000 0.316 0.684 0.000 0.000 0.000
#> GSM97111     2  0.3221     0.6431 0.000 0.792 0.020 0.188 0.000 0.000
#> GSM97064     4  0.4443     0.5883 0.000 0.068 0.232 0.696 0.004 0.000
#> GSM97065     2  0.4052     0.6087 0.016 0.772 0.016 0.176 0.016 0.004
#> GSM97081     2  0.4358     0.6514 0.000 0.740 0.108 0.144 0.000 0.008
#> GSM97082     3  0.4302     0.5243 0.000 0.368 0.608 0.020 0.004 0.000
#> GSM97088     5  0.5991     0.5059 0.000 0.024 0.156 0.028 0.624 0.168
#> GSM97100     4  0.1719     0.7445 0.000 0.060 0.016 0.924 0.000 0.000
#> GSM97104     3  0.4011     0.4509 0.000 0.056 0.732 0.000 0.000 0.212
#> GSM97108     2  0.3558     0.6054 0.000 0.736 0.016 0.248 0.000 0.000
#> GSM97050     4  0.3755     0.7121 0.000 0.136 0.048 0.800 0.008 0.008
#> GSM97080     3  0.5765     0.3752 0.000 0.144 0.496 0.000 0.008 0.352
#> GSM97089     2  0.2333     0.6139 0.000 0.872 0.120 0.004 0.000 0.004
#> GSM97092     3  0.4389     0.5065 0.000 0.372 0.596 0.032 0.000 0.000
#> GSM97093     4  0.4165     0.5869 0.000 0.292 0.004 0.676 0.028 0.000
#> GSM97058     4  0.1349     0.7645 0.000 0.056 0.004 0.940 0.000 0.000
#> GSM97051     4  0.4348     0.5584 0.000 0.064 0.248 0.688 0.000 0.000
#> GSM97052     3  0.4312     0.5134 0.000 0.368 0.604 0.028 0.000 0.000
#> GSM97061     3  0.4815     0.4493 0.000 0.384 0.556 0.060 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)

plot of chunk tab-SD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-pam-membership-heatmap-5

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)

plot of chunk tab-SD-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-SD-pam-get-signatures-no-scale-1

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

plot of chunk tab-SD-pam-get-signatures-no-scale-2

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

plot of chunk tab-SD-pam-get-signatures-no-scale-3

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

plot of chunk tab-SD-pam-get-signatures-no-scale-4

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

plot of chunk tab-SD-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-pam-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-SD-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-pam-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:pam 94         5.42e-06       0.735     6.12e-16   0.0454 2
#> SD:pam 91         2.19e-04       0.331     4.32e-12   0.0923 3
#> SD:pam 76         1.62e-04       0.602     5.19e-08   0.5594 4
#> SD:pam 76         2.44e-02       0.570     8.38e-10   0.1164 5
#> SD:pam 74         8.01e-02       0.761     1.48e-07   0.2209 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.


SD:mclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "mclust"]
# 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 21512 rows and 100 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 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)

plot of chunk SD-mclust-collect-plots

The plots are:

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:

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)

plot of chunk SD-mclust-select-partition-number

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.500           0.665       0.861         0.3307 0.677   0.677
#> 3 3 0.520           0.738       0.845         0.8447 0.665   0.521
#> 4 4 0.815           0.874       0.914         0.2114 0.737   0.415
#> 5 5 0.617           0.761       0.853         0.0288 0.949   0.802
#> 6 6 0.721           0.753       0.862         0.0532 0.914   0.646

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.813 1.000 0.000
#> GSM97145     1  0.0000      0.813 1.000 0.000
#> GSM97147     1  0.0000      0.813 1.000 0.000
#> GSM97125     1  0.0000      0.813 1.000 0.000
#> GSM97127     1  0.0000      0.813 1.000 0.000
#> GSM97130     1  0.0000      0.813 1.000 0.000
#> GSM97133     1  0.0000      0.813 1.000 0.000
#> GSM97134     1  0.0000      0.813 1.000 0.000
#> GSM97120     1  0.0000      0.813 1.000 0.000
#> GSM97126     1  0.0000      0.813 1.000 0.000
#> GSM97112     1  0.0000      0.813 1.000 0.000
#> GSM97115     1  0.0376      0.813 0.996 0.004
#> GSM97116     1  0.0000      0.813 1.000 0.000
#> GSM97117     1  0.9323      0.474 0.652 0.348
#> GSM97119     1  0.0000      0.813 1.000 0.000
#> GSM97122     1  0.0000      0.813 1.000 0.000
#> GSM97135     1  0.0000      0.813 1.000 0.000
#> GSM97136     1  0.9286      0.479 0.656 0.344
#> GSM97139     1  0.0000      0.813 1.000 0.000
#> GSM97146     1  0.0000      0.813 1.000 0.000
#> GSM97123     2  0.9998      0.127 0.492 0.508
#> GSM97129     1  0.9209      0.490 0.664 0.336
#> GSM97143     1  0.0000      0.813 1.000 0.000
#> GSM97113     1  0.9323      0.474 0.652 0.348
#> GSM97056     1  0.0000      0.813 1.000 0.000
#> GSM97124     1  0.0000      0.813 1.000 0.000
#> GSM97132     1  0.0000      0.813 1.000 0.000
#> GSM97144     1  0.0000      0.813 1.000 0.000
#> GSM97149     1  0.0000      0.813 1.000 0.000
#> GSM97068     1  0.0672      0.812 0.992 0.008
#> GSM97071     1  0.0672      0.812 0.992 0.008
#> GSM97086     1  0.0672      0.812 0.992 0.008
#> GSM97103     1  0.9358      0.463 0.648 0.352
#> GSM97057     1  0.9323      0.474 0.652 0.348
#> GSM97060     2  0.9608      0.466 0.384 0.616
#> GSM97075     1  0.9323      0.474 0.652 0.348
#> GSM97098     2  0.9933      0.283 0.452 0.548
#> GSM97099     1  0.9323      0.474 0.652 0.348
#> GSM97101     1  0.9323      0.474 0.652 0.348
#> GSM97105     1  0.9323      0.474 0.652 0.348
#> GSM97106     2  0.9993      0.163 0.484 0.516
#> GSM97121     1  0.9323      0.474 0.652 0.348
#> GSM97128     1  0.0672      0.812 0.992 0.008
#> GSM97131     1  0.9323      0.474 0.652 0.348
#> GSM97137     1  0.0000      0.813 1.000 0.000
#> GSM97118     1  0.0000      0.813 1.000 0.000
#> GSM97114     1  0.9323      0.474 0.652 0.348
#> GSM97142     1  0.0000      0.813 1.000 0.000
#> GSM97140     1  0.9248      0.485 0.660 0.340
#> GSM97141     1  0.9323      0.474 0.652 0.348
#> GSM97055     1  0.0000      0.813 1.000 0.000
#> GSM97090     1  0.0000      0.813 1.000 0.000
#> GSM97091     1  0.0000      0.813 1.000 0.000
#> GSM97148     1  0.0000      0.813 1.000 0.000
#> GSM97063     1  0.0000      0.813 1.000 0.000
#> GSM97053     1  0.0000      0.813 1.000 0.000
#> GSM97066     2  0.0000      0.716 0.000 1.000
#> GSM97079     1  0.0938      0.810 0.988 0.012
#> GSM97083     1  0.0000      0.813 1.000 0.000
#> GSM97084     1  0.0672      0.812 0.992 0.008
#> GSM97094     1  0.0672      0.812 0.992 0.008
#> GSM97096     2  0.9393      0.515 0.356 0.644
#> GSM97097     1  0.1414      0.806 0.980 0.020
#> GSM97107     1  0.0672      0.812 0.992 0.008
#> GSM97054     1  0.0672      0.812 0.992 0.008
#> GSM97062     1  0.0672      0.812 0.992 0.008
#> GSM97069     2  0.0000      0.716 0.000 1.000
#> GSM97070     2  0.0000      0.716 0.000 1.000
#> GSM97073     2  0.0000      0.716 0.000 1.000
#> GSM97076     1  0.0672      0.812 0.992 0.008
#> GSM97077     1  0.9323      0.474 0.652 0.348
#> GSM97095     1  0.0376      0.813 0.996 0.004
#> GSM97102     2  0.0000      0.716 0.000 1.000
#> GSM97109     1  0.9323      0.474 0.652 0.348
#> GSM97110     1  0.9323      0.474 0.652 0.348
#> GSM97074     1  0.0672      0.812 0.992 0.008
#> GSM97085     1  0.0672      0.812 0.992 0.008
#> GSM97059     1  0.0672      0.812 0.992 0.008
#> GSM97072     2  0.8955      0.558 0.312 0.688
#> GSM97078     1  0.0672      0.812 0.992 0.008
#> GSM97067     2  0.0000      0.716 0.000 1.000
#> GSM97087     2  0.0000      0.716 0.000 1.000
#> GSM97111     1  0.9323      0.474 0.652 0.348
#> GSM97064     1  0.9323      0.474 0.652 0.348
#> GSM97065     1  0.9323      0.474 0.652 0.348
#> GSM97081     2  0.9522      0.491 0.372 0.628
#> GSM97082     2  0.0000      0.716 0.000 1.000
#> GSM97088     1  0.0672      0.812 0.992 0.008
#> GSM97100     1  0.9087      0.506 0.676 0.324
#> GSM97104     2  0.0000      0.716 0.000 1.000
#> GSM97108     1  0.9323      0.474 0.652 0.348
#> GSM97050     1  0.9323      0.474 0.652 0.348
#> GSM97080     2  0.0000      0.716 0.000 1.000
#> GSM97089     1  0.9850      0.222 0.572 0.428
#> GSM97092     2  0.9460      0.505 0.364 0.636
#> GSM97093     1  0.9323      0.474 0.652 0.348
#> GSM97058     1  0.9323      0.474 0.652 0.348
#> GSM97051     1  0.7950      0.608 0.760 0.240
#> GSM97052     2  0.9460      0.505 0.364 0.636
#> GSM97061     2  0.9963      0.242 0.464 0.536

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97145     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97147     1  0.5639     0.7421 0.752 0.232 0.016
#> GSM97125     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97127     1  0.0237     0.8523 0.996 0.004 0.000
#> GSM97130     1  0.6476     0.8221 0.748 0.068 0.184
#> GSM97133     1  0.0237     0.8523 0.996 0.004 0.000
#> GSM97134     1  0.7036     0.8152 0.720 0.096 0.184
#> GSM97120     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97126     1  0.2959     0.8416 0.900 0.100 0.000
#> GSM97112     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97115     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97116     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97117     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97119     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97122     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97135     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97136     2  0.5061     0.5146 0.208 0.784 0.008
#> GSM97139     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97146     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97123     2  0.6307    -0.4608 0.000 0.512 0.488
#> GSM97129     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97143     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97113     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97056     1  0.4409     0.8291 0.824 0.004 0.172
#> GSM97124     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97132     1  0.0237     0.8521 0.996 0.000 0.004
#> GSM97144     1  0.7036     0.8152 0.720 0.096 0.184
#> GSM97149     1  0.0237     0.8523 0.996 0.004 0.000
#> GSM97068     1  0.9145     0.5864 0.532 0.284 0.184
#> GSM97071     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97086     1  0.9122     0.5938 0.536 0.280 0.184
#> GSM97103     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97057     2  0.2261     0.7570 0.068 0.932 0.000
#> GSM97060     3  0.6286     0.5574 0.000 0.464 0.536
#> GSM97075     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97098     2  0.6308    -0.4712 0.000 0.508 0.492
#> GSM97099     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97101     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97105     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97106     2  0.6295    -0.4139 0.000 0.528 0.472
#> GSM97121     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97128     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97131     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97137     1  0.4099     0.8378 0.852 0.008 0.140
#> GSM97118     1  0.2066     0.8487 0.940 0.060 0.000
#> GSM97114     2  0.2537     0.7321 0.080 0.920 0.000
#> GSM97142     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97140     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97141     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97055     1  0.0424     0.8524 0.992 0.008 0.000
#> GSM97090     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97091     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97148     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97063     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97053     1  0.0000     0.8519 1.000 0.000 0.000
#> GSM97066     3  0.4555     0.8318 0.000 0.200 0.800
#> GSM97079     1  0.9433     0.3321 0.420 0.404 0.176
#> GSM97083     1  0.7036     0.8152 0.720 0.096 0.184
#> GSM97084     1  0.7862     0.7737 0.668 0.148 0.184
#> GSM97094     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97096     3  0.6225     0.6315 0.000 0.432 0.568
#> GSM97097     2  0.8839     0.2077 0.256 0.572 0.172
#> GSM97107     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97054     1  0.9073     0.6079 0.544 0.272 0.184
#> GSM97062     1  0.8845     0.6597 0.576 0.240 0.184
#> GSM97069     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97070     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97073     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97076     1  0.3340     0.8345 0.880 0.120 0.000
#> GSM97077     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97095     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97102     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97109     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97110     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97074     1  0.3832     0.8422 0.880 0.100 0.020
#> GSM97085     1  0.4047     0.8200 0.848 0.148 0.004
#> GSM97059     1  0.8350     0.7259 0.628 0.196 0.176
#> GSM97072     3  0.6126     0.6726 0.000 0.400 0.600
#> GSM97078     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97067     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97087     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97111     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97064     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97065     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97081     3  0.6267     0.5929 0.000 0.452 0.548
#> GSM97082     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97088     1  0.7108     0.8135 0.716 0.100 0.184
#> GSM97100     2  0.0475     0.8382 0.004 0.992 0.004
#> GSM97104     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97108     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97050     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97080     3  0.4346     0.8410 0.000 0.184 0.816
#> GSM97089     2  0.5926     0.0339 0.000 0.644 0.356
#> GSM97092     3  0.6252     0.6096 0.000 0.444 0.556
#> GSM97093     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97058     2  0.0000     0.8459 0.000 1.000 0.000
#> GSM97051     2  0.0237     0.8416 0.000 0.996 0.004
#> GSM97052     3  0.6267     0.5939 0.000 0.452 0.548
#> GSM97061     2  0.6309    -0.4849 0.000 0.504 0.496

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.0779     0.9384 0.980 0.004 0.000 0.016
#> GSM97145     1  0.3219     0.8595 0.868 0.020 0.000 0.112
#> GSM97147     2  0.4669     0.7808 0.052 0.780 0.000 0.168
#> GSM97125     1  0.1520     0.9400 0.956 0.020 0.000 0.024
#> GSM97127     1  0.0707     0.9391 0.980 0.020 0.000 0.000
#> GSM97130     1  0.5602    -0.0459 0.508 0.020 0.000 0.472
#> GSM97133     1  0.0469     0.9324 0.988 0.000 0.000 0.012
#> GSM97134     4  0.3853     0.8578 0.160 0.020 0.000 0.820
#> GSM97120     1  0.0469     0.9324 0.988 0.000 0.000 0.012
#> GSM97126     2  0.6560     0.5459 0.248 0.620 0.000 0.132
#> GSM97112     1  0.1389     0.9423 0.952 0.000 0.000 0.048
#> GSM97115     4  0.3090     0.9198 0.056 0.056 0.000 0.888
#> GSM97116     1  0.0469     0.9324 0.988 0.000 0.000 0.012
#> GSM97117     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97119     1  0.1389     0.9423 0.952 0.000 0.000 0.048
#> GSM97122     1  0.1389     0.9423 0.952 0.000 0.000 0.048
#> GSM97135     1  0.1389     0.9423 0.952 0.000 0.000 0.048
#> GSM97136     2  0.3746     0.8748 0.040 0.868 0.020 0.072
#> GSM97139     1  0.0469     0.9324 0.988 0.000 0.000 0.012
#> GSM97146     1  0.0469     0.9324 0.988 0.000 0.000 0.012
#> GSM97123     3  0.2101     0.8902 0.000 0.060 0.928 0.012
#> GSM97129     2  0.2255     0.9015 0.012 0.920 0.000 0.068
#> GSM97143     1  0.1520     0.9400 0.956 0.020 0.000 0.024
#> GSM97113     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97056     1  0.1624     0.9398 0.952 0.020 0.000 0.028
#> GSM97124     1  0.1624     0.9398 0.952 0.020 0.000 0.028
#> GSM97132     1  0.1624     0.9398 0.952 0.020 0.000 0.028
#> GSM97144     4  0.3900     0.8532 0.164 0.020 0.000 0.816
#> GSM97149     1  0.0592     0.9316 0.984 0.000 0.000 0.016
#> GSM97068     2  0.4764     0.7400 0.032 0.748 0.000 0.220
#> GSM97071     4  0.2670     0.9234 0.052 0.040 0.000 0.908
#> GSM97086     4  0.2048     0.8984 0.008 0.064 0.000 0.928
#> GSM97103     3  0.5256     0.7391 0.000 0.204 0.732 0.064
#> GSM97057     2  0.3508     0.8515 0.012 0.848 0.004 0.136
#> GSM97060     3  0.1305     0.9021 0.000 0.036 0.960 0.004
#> GSM97075     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97098     3  0.1792     0.8910 0.000 0.068 0.932 0.000
#> GSM97099     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97101     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97105     2  0.1716     0.9090 0.000 0.936 0.000 0.064
#> GSM97106     3  0.2256     0.8875 0.000 0.056 0.924 0.020
#> GSM97121     2  0.1398     0.9177 0.000 0.956 0.004 0.040
#> GSM97128     4  0.2413     0.9220 0.064 0.020 0.000 0.916
#> GSM97131     3  0.5750     0.7069 0.000 0.216 0.696 0.088
#> GSM97137     1  0.1624     0.9398 0.952 0.020 0.000 0.028
#> GSM97118     1  0.2843     0.8905 0.892 0.020 0.000 0.088
#> GSM97114     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97142     1  0.1389     0.9423 0.952 0.000 0.000 0.048
#> GSM97140     2  0.1389     0.9171 0.000 0.952 0.000 0.048
#> GSM97141     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97055     1  0.3447     0.8441 0.852 0.020 0.000 0.128
#> GSM97090     4  0.3862     0.8672 0.152 0.024 0.000 0.824
#> GSM97091     1  0.1389     0.9423 0.952 0.000 0.000 0.048
#> GSM97148     1  0.0469     0.9324 0.988 0.000 0.000 0.012
#> GSM97063     1  0.1389     0.9423 0.952 0.000 0.000 0.048
#> GSM97053     1  0.1624     0.9398 0.952 0.020 0.000 0.028
#> GSM97066     3  0.2011     0.8746 0.000 0.080 0.920 0.000
#> GSM97079     4  0.2814     0.8443 0.000 0.132 0.000 0.868
#> GSM97083     4  0.3853     0.8578 0.160 0.020 0.000 0.820
#> GSM97084     4  0.2021     0.9045 0.012 0.056 0.000 0.932
#> GSM97094     4  0.2443     0.9235 0.060 0.024 0.000 0.916
#> GSM97096     3  0.0817     0.9036 0.000 0.024 0.976 0.000
#> GSM97097     4  0.4719     0.7546 0.000 0.180 0.048 0.772
#> GSM97107     4  0.2521     0.9232 0.064 0.024 0.000 0.912
#> GSM97054     4  0.1970     0.8996 0.008 0.060 0.000 0.932
#> GSM97062     4  0.1970     0.8996 0.008 0.060 0.000 0.932
#> GSM97069     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97070     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97073     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97076     2  0.5267     0.7365 0.076 0.740 0.000 0.184
#> GSM97077     2  0.1211     0.9175 0.000 0.960 0.000 0.040
#> GSM97095     4  0.3009     0.9186 0.052 0.056 0.000 0.892
#> GSM97102     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97109     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97110     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97074     4  0.2782     0.9211 0.068 0.024 0.004 0.904
#> GSM97085     3  0.6287     0.6367 0.068 0.036 0.700 0.196
#> GSM97059     2  0.4719     0.7707 0.048 0.772 0.000 0.180
#> GSM97072     3  0.0592     0.9030 0.000 0.016 0.984 0.000
#> GSM97078     4  0.2413     0.9220 0.064 0.020 0.000 0.916
#> GSM97067     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97087     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97111     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97064     3  0.5913     0.5092 0.000 0.352 0.600 0.048
#> GSM97065     2  0.0188     0.9188 0.000 0.996 0.004 0.000
#> GSM97081     3  0.0921     0.9038 0.000 0.028 0.972 0.000
#> GSM97082     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97088     4  0.2413     0.9220 0.064 0.020 0.000 0.916
#> GSM97100     2  0.2281     0.8908 0.000 0.904 0.000 0.096
#> GSM97104     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97108     2  0.1211     0.9175 0.000 0.960 0.000 0.040
#> GSM97050     2  0.1389     0.9150 0.000 0.952 0.000 0.048
#> GSM97080     3  0.0000     0.9005 0.000 0.000 1.000 0.000
#> GSM97089     3  0.4386     0.7844 0.004 0.192 0.784 0.020
#> GSM97092     3  0.1022     0.9035 0.000 0.032 0.968 0.000
#> GSM97093     2  0.1305     0.9184 0.000 0.960 0.004 0.036
#> GSM97058     2  0.1798     0.9146 0.000 0.944 0.016 0.040
#> GSM97051     3  0.7234     0.4735 0.000 0.204 0.544 0.252
#> GSM97052     3  0.1022     0.9035 0.000 0.032 0.968 0.000
#> GSM97061     3  0.1661     0.8968 0.000 0.052 0.944 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.2806      0.942 0.844 0.000 0.000 0.004 0.152
#> GSM97145     1  0.4996      0.707 0.708 0.000 0.000 0.128 0.164
#> GSM97147     2  0.3883      0.766 0.004 0.744 0.000 0.244 0.008
#> GSM97125     5  0.4038      0.645 0.128 0.000 0.000 0.080 0.792
#> GSM97127     1  0.4075      0.853 0.780 0.000 0.000 0.060 0.160
#> GSM97130     4  0.3969      0.435 0.004 0.000 0.000 0.692 0.304
#> GSM97133     1  0.2516      0.952 0.860 0.000 0.000 0.000 0.140
#> GSM97134     4  0.1357      0.884 0.004 0.000 0.000 0.948 0.048
#> GSM97120     1  0.2516      0.952 0.860 0.000 0.000 0.000 0.140
#> GSM97126     2  0.4180      0.768 0.000 0.744 0.000 0.220 0.036
#> GSM97112     5  0.0703      0.688 0.024 0.000 0.000 0.000 0.976
#> GSM97115     4  0.1116      0.890 0.004 0.004 0.000 0.964 0.028
#> GSM97116     1  0.2561      0.950 0.856 0.000 0.000 0.000 0.144
#> GSM97117     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97119     5  0.0865      0.689 0.024 0.000 0.000 0.004 0.972
#> GSM97122     5  0.0703      0.688 0.024 0.000 0.000 0.000 0.976
#> GSM97135     5  0.0703      0.688 0.024 0.000 0.000 0.000 0.976
#> GSM97136     2  0.3937      0.810 0.000 0.784 0.020 0.184 0.012
#> GSM97139     1  0.2516      0.952 0.860 0.000 0.000 0.000 0.140
#> GSM97146     1  0.2516      0.952 0.860 0.000 0.000 0.000 0.140
#> GSM97123     3  0.3745      0.764 0.000 0.196 0.780 0.024 0.000
#> GSM97129     2  0.3048      0.828 0.000 0.820 0.000 0.176 0.004
#> GSM97143     5  0.3527      0.701 0.024 0.000 0.000 0.172 0.804
#> GSM97113     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97056     5  0.5003      0.379 0.032 0.000 0.000 0.424 0.544
#> GSM97124     5  0.3635      0.670 0.004 0.000 0.000 0.248 0.748
#> GSM97132     5  0.4430      0.305 0.004 0.000 0.000 0.456 0.540
#> GSM97144     4  0.1205      0.888 0.004 0.000 0.000 0.956 0.040
#> GSM97149     1  0.2516      0.952 0.860 0.000 0.000 0.000 0.140
#> GSM97068     2  0.5036      0.294 0.004 0.520 0.000 0.452 0.024
#> GSM97071     4  0.1830      0.883 0.068 0.000 0.000 0.924 0.008
#> GSM97086     4  0.2583      0.857 0.132 0.004 0.000 0.864 0.000
#> GSM97103     3  0.5756      0.592 0.000 0.204 0.620 0.176 0.000
#> GSM97057     2  0.2929      0.829 0.000 0.820 0.000 0.180 0.000
#> GSM97060     3  0.3132      0.733 0.000 0.008 0.820 0.172 0.000
#> GSM97075     2  0.0162      0.836 0.000 0.996 0.000 0.004 0.000
#> GSM97098     3  0.3659      0.748 0.000 0.220 0.768 0.012 0.000
#> GSM97099     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97101     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97105     2  0.3586      0.820 0.000 0.792 0.020 0.188 0.000
#> GSM97106     3  0.3954      0.716 0.000 0.036 0.772 0.192 0.000
#> GSM97121     2  0.2179      0.856 0.000 0.888 0.000 0.112 0.000
#> GSM97128     4  0.0798      0.894 0.008 0.000 0.000 0.976 0.016
#> GSM97131     3  0.7462      0.185 0.100 0.108 0.432 0.360 0.000
#> GSM97137     5  0.4696      0.352 0.016 0.000 0.000 0.428 0.556
#> GSM97118     5  0.4350      0.442 0.004 0.000 0.000 0.408 0.588
#> GSM97114     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97142     5  0.0703      0.688 0.024 0.000 0.000 0.000 0.976
#> GSM97140     2  0.2329      0.854 0.000 0.876 0.000 0.124 0.000
#> GSM97141     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97055     5  0.3901      0.692 0.004 0.024 0.000 0.196 0.776
#> GSM97090     4  0.1205      0.888 0.004 0.000 0.000 0.956 0.040
#> GSM97091     5  0.0703      0.688 0.024 0.000 0.000 0.000 0.976
#> GSM97148     1  0.2516      0.952 0.860 0.000 0.000 0.000 0.140
#> GSM97063     5  0.0703      0.688 0.024 0.000 0.000 0.000 0.976
#> GSM97053     5  0.4029      0.686 0.024 0.000 0.000 0.232 0.744
#> GSM97066     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97079     4  0.2707      0.854 0.132 0.008 0.000 0.860 0.000
#> GSM97083     4  0.1331      0.887 0.008 0.000 0.000 0.952 0.040
#> GSM97084     4  0.2583      0.857 0.132 0.004 0.000 0.864 0.000
#> GSM97094     4  0.0794      0.893 0.000 0.000 0.000 0.972 0.028
#> GSM97096     3  0.2732      0.789 0.000 0.160 0.840 0.000 0.000
#> GSM97097     4  0.2741      0.855 0.132 0.004 0.004 0.860 0.000
#> GSM97107     4  0.0693      0.894 0.008 0.000 0.000 0.980 0.012
#> GSM97054     4  0.2583      0.857 0.132 0.004 0.000 0.864 0.000
#> GSM97062     4  0.2583      0.857 0.132 0.004 0.000 0.864 0.000
#> GSM97069     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97070     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97073     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97076     2  0.4104      0.771 0.000 0.748 0.000 0.220 0.032
#> GSM97077     2  0.2516      0.850 0.000 0.860 0.000 0.140 0.000
#> GSM97095     4  0.1285      0.890 0.004 0.004 0.000 0.956 0.036
#> GSM97102     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97109     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97110     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97074     4  0.1978      0.870 0.004 0.024 0.000 0.928 0.044
#> GSM97085     3  0.4881      0.128 0.004 0.000 0.520 0.460 0.016
#> GSM97059     2  0.4908      0.408 0.004 0.560 0.000 0.416 0.020
#> GSM97072     3  0.0579      0.808 0.000 0.008 0.984 0.008 0.000
#> GSM97078     4  0.0798      0.894 0.008 0.000 0.000 0.976 0.016
#> GSM97067     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97087     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97111     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97064     3  0.6247      0.121 0.000 0.424 0.432 0.144 0.000
#> GSM97065     2  0.0000      0.835 0.000 1.000 0.000 0.000 0.000
#> GSM97081     3  0.3109      0.768 0.000 0.200 0.800 0.000 0.000
#> GSM97082     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97088     4  0.0912      0.894 0.012 0.000 0.000 0.972 0.016
#> GSM97100     2  0.4716      0.657 0.036 0.656 0.000 0.308 0.000
#> GSM97104     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97108     2  0.2127      0.856 0.000 0.892 0.000 0.108 0.000
#> GSM97050     2  0.2732      0.841 0.000 0.840 0.000 0.160 0.000
#> GSM97080     3  0.0000      0.807 0.000 0.000 1.000 0.000 0.000
#> GSM97089     3  0.5025      0.687 0.000 0.172 0.704 0.124 0.000
#> GSM97092     3  0.2629      0.796 0.000 0.136 0.860 0.004 0.000
#> GSM97093     2  0.2179      0.856 0.000 0.888 0.000 0.112 0.000
#> GSM97058     2  0.3002      0.846 0.000 0.856 0.028 0.116 0.000
#> GSM97051     4  0.5894      0.593 0.132 0.020 0.200 0.648 0.000
#> GSM97052     3  0.2719      0.794 0.000 0.144 0.852 0.004 0.000
#> GSM97061     3  0.3760      0.768 0.000 0.188 0.784 0.028 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.1780     0.8867 0.924 0.000 0.000 0.000 0.028 0.048
#> GSM97145     1  0.3176     0.7289 0.812 0.000 0.000 0.000 0.032 0.156
#> GSM97147     2  0.3018     0.7542 0.004 0.816 0.000 0.012 0.000 0.168
#> GSM97125     5  0.5737     0.3300 0.368 0.000 0.000 0.000 0.460 0.172
#> GSM97127     1  0.2257     0.8154 0.876 0.000 0.000 0.000 0.008 0.116
#> GSM97130     6  0.2542     0.8023 0.000 0.000 0.000 0.080 0.044 0.876
#> GSM97133     1  0.0146     0.9390 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97134     6  0.1714     0.8123 0.000 0.000 0.000 0.092 0.000 0.908
#> GSM97120     1  0.0146     0.9390 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97126     2  0.4560     0.6174 0.004 0.696 0.000 0.000 0.088 0.212
#> GSM97112     5  0.1152     0.7930 0.004 0.000 0.000 0.000 0.952 0.044
#> GSM97115     6  0.3608     0.6107 0.000 0.012 0.000 0.272 0.000 0.716
#> GSM97116     1  0.0146     0.9390 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97117     2  0.0146     0.8231 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97119     5  0.1531     0.7900 0.004 0.000 0.000 0.000 0.928 0.068
#> GSM97122     5  0.1152     0.7930 0.004 0.000 0.000 0.000 0.952 0.044
#> GSM97135     5  0.1152     0.7930 0.004 0.000 0.000 0.000 0.952 0.044
#> GSM97136     2  0.6299     0.1551 0.000 0.408 0.364 0.000 0.016 0.212
#> GSM97139     1  0.0146     0.9390 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97146     1  0.0146     0.9390 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97123     2  0.5800     0.0558 0.000 0.460 0.424 0.084 0.032 0.000
#> GSM97129     2  0.2491     0.7613 0.000 0.836 0.000 0.000 0.000 0.164
#> GSM97143     5  0.2964     0.7251 0.004 0.000 0.000 0.000 0.792 0.204
#> GSM97113     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97056     6  0.5575     0.5263 0.276 0.000 0.000 0.032 0.096 0.596
#> GSM97124     5  0.3807     0.5105 0.004 0.000 0.000 0.000 0.628 0.368
#> GSM97132     6  0.3620     0.3435 0.000 0.000 0.000 0.000 0.352 0.648
#> GSM97144     6  0.1663     0.8125 0.000 0.000 0.000 0.088 0.000 0.912
#> GSM97149     1  0.0146     0.9390 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97068     2  0.4859     0.5967 0.004 0.676 0.000 0.140 0.000 0.180
#> GSM97071     6  0.0935     0.8050 0.000 0.000 0.000 0.032 0.004 0.964
#> GSM97086     4  0.2454     0.7918 0.000 0.000 0.000 0.840 0.000 0.160
#> GSM97103     2  0.6331     0.3941 0.000 0.520 0.308 0.124 0.012 0.036
#> GSM97057     2  0.2768     0.7659 0.000 0.832 0.000 0.012 0.000 0.156
#> GSM97060     3  0.2078     0.8888 0.000 0.004 0.912 0.040 0.044 0.000
#> GSM97075     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97098     3  0.4798     0.4052 0.000 0.348 0.600 0.016 0.036 0.000
#> GSM97099     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97101     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97105     2  0.2901     0.7989 0.000 0.840 0.000 0.128 0.000 0.032
#> GSM97106     3  0.4593     0.7599 0.000 0.088 0.748 0.120 0.044 0.000
#> GSM97121     2  0.2266     0.8092 0.000 0.880 0.000 0.108 0.000 0.012
#> GSM97128     6  0.0603     0.7975 0.000 0.000 0.000 0.016 0.004 0.980
#> GSM97131     4  0.4053     0.6868 0.000 0.140 0.036 0.780 0.000 0.044
#> GSM97137     6  0.5655     0.4996 0.296 0.000 0.000 0.032 0.096 0.576
#> GSM97118     5  0.3221     0.6762 0.000 0.000 0.000 0.000 0.736 0.264
#> GSM97114     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97142     5  0.1152     0.7930 0.004 0.000 0.000 0.000 0.952 0.044
#> GSM97140     2  0.2662     0.7915 0.000 0.856 0.000 0.024 0.000 0.120
#> GSM97141     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97055     5  0.2994     0.7217 0.004 0.000 0.000 0.000 0.788 0.208
#> GSM97090     6  0.1765     0.8093 0.000 0.000 0.000 0.096 0.000 0.904
#> GSM97091     5  0.1152     0.7930 0.004 0.000 0.000 0.000 0.952 0.044
#> GSM97148     1  0.0146     0.9390 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97063     5  0.1152     0.7930 0.004 0.000 0.000 0.000 0.952 0.044
#> GSM97053     5  0.4389     0.6130 0.052 0.000 0.000 0.000 0.660 0.288
#> GSM97066     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97079     4  0.1610     0.8013 0.000 0.000 0.000 0.916 0.000 0.084
#> GSM97083     6  0.0291     0.8031 0.000 0.000 0.000 0.004 0.004 0.992
#> GSM97084     4  0.2562     0.7770 0.000 0.000 0.000 0.828 0.000 0.172
#> GSM97094     6  0.1663     0.8125 0.000 0.000 0.000 0.088 0.000 0.912
#> GSM97096     3  0.1820     0.8943 0.000 0.012 0.928 0.016 0.044 0.000
#> GSM97097     4  0.1444     0.7954 0.000 0.000 0.000 0.928 0.000 0.072
#> GSM97107     6  0.1663     0.8125 0.000 0.000 0.000 0.088 0.000 0.912
#> GSM97054     4  0.2527     0.7839 0.000 0.000 0.000 0.832 0.000 0.168
#> GSM97062     4  0.2491     0.7889 0.000 0.000 0.000 0.836 0.000 0.164
#> GSM97069     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97070     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97073     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97076     5  0.5803     0.4021 0.004 0.260 0.000 0.000 0.524 0.212
#> GSM97077     2  0.2812     0.8098 0.000 0.856 0.000 0.096 0.000 0.048
#> GSM97095     6  0.2775     0.7821 0.000 0.040 0.000 0.104 0.000 0.856
#> GSM97102     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97109     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97110     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97074     6  0.4795    -0.0422 0.000 0.000 0.056 0.000 0.400 0.544
#> GSM97085     3  0.3725     0.5223 0.000 0.000 0.676 0.000 0.008 0.316
#> GSM97059     2  0.3885     0.7020 0.000 0.756 0.000 0.064 0.000 0.180
#> GSM97072     3  0.1713     0.8928 0.000 0.000 0.928 0.028 0.044 0.000
#> GSM97078     6  0.0603     0.7975 0.000 0.000 0.000 0.016 0.004 0.980
#> GSM97067     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97087     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97111     2  0.0000     0.8244 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97064     2  0.4039     0.7481 0.000 0.776 0.072 0.136 0.000 0.016
#> GSM97065     2  0.0146     0.8231 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97081     3  0.1793     0.8906 0.000 0.036 0.928 0.004 0.032 0.000
#> GSM97082     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97088     6  0.0717     0.7982 0.000 0.000 0.016 0.000 0.008 0.976
#> GSM97100     4  0.4858     0.3230 0.004 0.348 0.000 0.588 0.000 0.060
#> GSM97104     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97108     2  0.2494     0.8059 0.000 0.864 0.000 0.120 0.000 0.016
#> GSM97050     2  0.2706     0.8034 0.000 0.852 0.000 0.124 0.000 0.024
#> GSM97080     3  0.0000     0.9044 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97089     3  0.3344     0.8149 0.000 0.016 0.844 0.008 0.044 0.088
#> GSM97092     3  0.2007     0.8902 0.000 0.004 0.916 0.036 0.044 0.000
#> GSM97093     2  0.2346     0.7912 0.000 0.868 0.000 0.008 0.000 0.124
#> GSM97058     2  0.2890     0.8013 0.000 0.844 0.004 0.128 0.000 0.024
#> GSM97051     4  0.2294     0.7922 0.000 0.036 0.000 0.892 0.000 0.072
#> GSM97052     3  0.2007     0.8902 0.000 0.004 0.916 0.036 0.044 0.000
#> GSM97061     3  0.4821     0.6897 0.000 0.180 0.712 0.064 0.044 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)

plot of chunk tab-SD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-mclust-membership-heatmap-5

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)

plot of chunk tab-SD-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-SD-mclust-get-signatures-no-scale-1

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

plot of chunk tab-SD-mclust-get-signatures-no-scale-2

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

plot of chunk tab-SD-mclust-get-signatures-no-scale-3

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

plot of chunk tab-SD-mclust-get-signatures-no-scale-4

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

plot of chunk tab-SD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-mclust-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-SD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-mclust-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:mclust 68         0.002023      0.1868     1.59e-05    0.247 2
#> SD:mclust 93         0.001622      0.0534     3.99e-10    0.178 3
#> SD:mclust 98         0.000289      0.6454     1.37e-15    0.239 4
#> SD:mclust 90         0.000347      0.6504     9.82e-13    0.346 5
#> SD:mclust 90         0.000104      0.3602     4.01e-11    0.298 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.


SD:NMF*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "NMF"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-NMF-collect-plots

The plots are:

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:

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)

plot of chunk SD-NMF-select-partition-number

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.934       0.973         0.4991 0.500   0.500
#> 3 3 0.432           0.484       0.662         0.3074 0.779   0.589
#> 4 4 0.602           0.586       0.754         0.1313 0.670   0.311
#> 5 5 0.550           0.434       0.694         0.0780 0.819   0.445
#> 6 6 0.643           0.536       0.729         0.0458 0.864   0.452

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.968 1.000 0.000
#> GSM97145     1  0.0000      0.968 1.000 0.000
#> GSM97147     1  0.0000      0.968 1.000 0.000
#> GSM97125     1  0.0000      0.968 1.000 0.000
#> GSM97127     1  0.0000      0.968 1.000 0.000
#> GSM97130     1  0.0000      0.968 1.000 0.000
#> GSM97133     1  0.0000      0.968 1.000 0.000
#> GSM97134     1  0.0000      0.968 1.000 0.000
#> GSM97120     1  0.0000      0.968 1.000 0.000
#> GSM97126     1  0.0000      0.968 1.000 0.000
#> GSM97112     1  0.0000      0.968 1.000 0.000
#> GSM97115     1  0.0000      0.968 1.000 0.000
#> GSM97116     1  0.0000      0.968 1.000 0.000
#> GSM97117     2  0.0000      0.973 0.000 1.000
#> GSM97119     1  0.0000      0.968 1.000 0.000
#> GSM97122     1  0.0000      0.968 1.000 0.000
#> GSM97135     1  0.0000      0.968 1.000 0.000
#> GSM97136     2  0.3584      0.913 0.068 0.932
#> GSM97139     1  0.0000      0.968 1.000 0.000
#> GSM97146     1  0.0000      0.968 1.000 0.000
#> GSM97123     2  0.0000      0.973 0.000 1.000
#> GSM97129     2  0.9170      0.505 0.332 0.668
#> GSM97143     1  0.0000      0.968 1.000 0.000
#> GSM97113     2  0.6531      0.795 0.168 0.832
#> GSM97056     1  0.0000      0.968 1.000 0.000
#> GSM97124     1  0.0000      0.968 1.000 0.000
#> GSM97132     1  0.0000      0.968 1.000 0.000
#> GSM97144     1  0.0000      0.968 1.000 0.000
#> GSM97149     1  0.0000      0.968 1.000 0.000
#> GSM97068     1  0.2603      0.929 0.956 0.044
#> GSM97071     2  0.0000      0.973 0.000 1.000
#> GSM97086     2  0.0000      0.973 0.000 1.000
#> GSM97103     2  0.0000      0.973 0.000 1.000
#> GSM97057     1  0.7453      0.725 0.788 0.212
#> GSM97060     2  0.0000      0.973 0.000 1.000
#> GSM97075     2  0.0000      0.973 0.000 1.000
#> GSM97098     2  0.0000      0.973 0.000 1.000
#> GSM97099     2  0.0000      0.973 0.000 1.000
#> GSM97101     2  0.0000      0.973 0.000 1.000
#> GSM97105     2  0.0000      0.973 0.000 1.000
#> GSM97106     2  0.0000      0.973 0.000 1.000
#> GSM97121     2  0.0000      0.973 0.000 1.000
#> GSM97128     1  0.7745      0.699 0.772 0.228
#> GSM97131     2  0.0000      0.973 0.000 1.000
#> GSM97137     1  0.0000      0.968 1.000 0.000
#> GSM97118     1  0.0000      0.968 1.000 0.000
#> GSM97114     1  0.0672      0.962 0.992 0.008
#> GSM97142     1  0.0000      0.968 1.000 0.000
#> GSM97140     2  0.9209      0.500 0.336 0.664
#> GSM97141     2  0.0000      0.973 0.000 1.000
#> GSM97055     1  0.0000      0.968 1.000 0.000
#> GSM97090     1  0.0000      0.968 1.000 0.000
#> GSM97091     1  0.0000      0.968 1.000 0.000
#> GSM97148     1  0.0000      0.968 1.000 0.000
#> GSM97063     1  0.0000      0.968 1.000 0.000
#> GSM97053     1  0.0000      0.968 1.000 0.000
#> GSM97066     2  0.0000      0.973 0.000 1.000
#> GSM97079     2  0.0000      0.973 0.000 1.000
#> GSM97083     1  0.0000      0.968 1.000 0.000
#> GSM97084     2  0.3431      0.917 0.064 0.936
#> GSM97094     1  0.0000      0.968 1.000 0.000
#> GSM97096     2  0.0000      0.973 0.000 1.000
#> GSM97097     2  0.0000      0.973 0.000 1.000
#> GSM97107     1  0.0376      0.965 0.996 0.004
#> GSM97054     2  0.4815      0.875 0.104 0.896
#> GSM97062     2  0.0000      0.973 0.000 1.000
#> GSM97069     2  0.0000      0.973 0.000 1.000
#> GSM97070     2  0.0000      0.973 0.000 1.000
#> GSM97073     2  0.0000      0.973 0.000 1.000
#> GSM97076     1  0.0376      0.965 0.996 0.004
#> GSM97077     2  0.0000      0.973 0.000 1.000
#> GSM97095     1  0.0000      0.968 1.000 0.000
#> GSM97102     2  0.0000      0.973 0.000 1.000
#> GSM97109     2  0.9087      0.524 0.324 0.676
#> GSM97110     2  0.0000      0.973 0.000 1.000
#> GSM97074     1  0.9896      0.211 0.560 0.440
#> GSM97085     2  0.0000      0.973 0.000 1.000
#> GSM97059     1  0.0000      0.968 1.000 0.000
#> GSM97072     2  0.0000      0.973 0.000 1.000
#> GSM97078     1  0.9661      0.354 0.608 0.392
#> GSM97067     2  0.0000      0.973 0.000 1.000
#> GSM97087     2  0.0000      0.973 0.000 1.000
#> GSM97111     2  0.0000      0.973 0.000 1.000
#> GSM97064     2  0.0000      0.973 0.000 1.000
#> GSM97065     2  0.0000      0.973 0.000 1.000
#> GSM97081     2  0.0000      0.973 0.000 1.000
#> GSM97082     2  0.0000      0.973 0.000 1.000
#> GSM97088     2  0.0000      0.973 0.000 1.000
#> GSM97100     2  0.0000      0.973 0.000 1.000
#> GSM97104     2  0.0000      0.973 0.000 1.000
#> GSM97108     2  0.0000      0.973 0.000 1.000
#> GSM97050     2  0.0000      0.973 0.000 1.000
#> GSM97080     2  0.0000      0.973 0.000 1.000
#> GSM97089     2  0.0000      0.973 0.000 1.000
#> GSM97092     2  0.0000      0.973 0.000 1.000
#> GSM97093     2  0.0938      0.963 0.012 0.988
#> GSM97058     2  0.0000      0.973 0.000 1.000
#> GSM97051     2  0.0000      0.973 0.000 1.000
#> GSM97052     2  0.0000      0.973 0.000 1.000
#> GSM97061     2  0.0000      0.973 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.2261     0.7238 0.932 0.000 0.068
#> GSM97145     1  0.1643     0.7331 0.956 0.000 0.044
#> GSM97147     1  0.5948     0.4629 0.640 0.360 0.000
#> GSM97125     1  0.3267     0.7003 0.884 0.000 0.116
#> GSM97127     1  0.1765     0.7396 0.956 0.040 0.004
#> GSM97130     1  0.5223     0.6955 0.800 0.176 0.024
#> GSM97133     1  0.4121     0.6970 0.832 0.168 0.000
#> GSM97134     1  0.3181     0.7375 0.912 0.024 0.064
#> GSM97120     1  0.1182     0.7400 0.976 0.012 0.012
#> GSM97126     1  0.2400     0.7301 0.932 0.004 0.064
#> GSM97112     1  0.6235     0.3396 0.564 0.000 0.436
#> GSM97115     1  0.6647     0.3900 0.592 0.396 0.012
#> GSM97116     1  0.0892     0.7383 0.980 0.000 0.020
#> GSM97117     2  0.5397     0.4711 0.000 0.720 0.280
#> GSM97119     1  0.5529     0.5562 0.704 0.000 0.296
#> GSM97122     1  0.5465     0.5651 0.712 0.000 0.288
#> GSM97135     1  0.5363     0.5773 0.724 0.000 0.276
#> GSM97136     3  0.3369     0.5361 0.052 0.040 0.908
#> GSM97139     1  0.0661     0.7402 0.988 0.008 0.004
#> GSM97146     1  0.1267     0.7381 0.972 0.004 0.024
#> GSM97123     2  0.4931     0.5232 0.000 0.768 0.232
#> GSM97129     2  0.7309     0.5572 0.168 0.708 0.124
#> GSM97143     1  0.5254     0.5865 0.736 0.000 0.264
#> GSM97113     2  0.5254     0.4999 0.264 0.736 0.000
#> GSM97056     1  0.3120     0.7345 0.908 0.080 0.012
#> GSM97124     1  0.3686     0.6925 0.860 0.000 0.140
#> GSM97132     1  0.3038     0.7141 0.896 0.000 0.104
#> GSM97144     1  0.4799     0.7189 0.836 0.132 0.032
#> GSM97149     1  0.4452     0.6763 0.808 0.192 0.000
#> GSM97068     2  0.6521    -0.1259 0.492 0.504 0.004
#> GSM97071     2  0.6204     0.1991 0.000 0.576 0.424
#> GSM97086     2  0.3618     0.6439 0.104 0.884 0.012
#> GSM97103     2  0.5397     0.4736 0.000 0.720 0.280
#> GSM97057     2  0.6432     0.0903 0.428 0.568 0.004
#> GSM97060     2  0.6215     0.1656 0.000 0.572 0.428
#> GSM97075     2  0.5291     0.4861 0.000 0.732 0.268
#> GSM97098     2  0.5560     0.4415 0.000 0.700 0.300
#> GSM97099     2  0.2448     0.6391 0.000 0.924 0.076
#> GSM97101     2  0.4047     0.6282 0.148 0.848 0.004
#> GSM97105     2  0.2066     0.6573 0.060 0.940 0.000
#> GSM97106     2  0.5431     0.4681 0.000 0.716 0.284
#> GSM97121     2  0.3192     0.6439 0.112 0.888 0.000
#> GSM97128     3  0.4682     0.3678 0.192 0.004 0.804
#> GSM97131     2  0.1753     0.6485 0.000 0.952 0.048
#> GSM97137     1  0.4033     0.7169 0.856 0.136 0.008
#> GSM97118     1  0.6235     0.3472 0.564 0.000 0.436
#> GSM97114     1  0.6235     0.2856 0.564 0.436 0.000
#> GSM97142     1  0.6062     0.4323 0.616 0.000 0.384
#> GSM97140     2  0.6079     0.2188 0.388 0.612 0.000
#> GSM97141     2  0.4602     0.6309 0.152 0.832 0.016
#> GSM97055     3  0.6180    -0.0524 0.416 0.000 0.584
#> GSM97090     1  0.6570     0.5510 0.668 0.308 0.024
#> GSM97091     3  0.6215    -0.1002 0.428 0.000 0.572
#> GSM97148     1  0.2066     0.7358 0.940 0.060 0.000
#> GSM97063     3  0.6299    -0.2055 0.476 0.000 0.524
#> GSM97053     1  0.3116     0.7071 0.892 0.000 0.108
#> GSM97066     3  0.5291     0.4588 0.000 0.268 0.732
#> GSM97079     2  0.2050     0.6593 0.020 0.952 0.028
#> GSM97083     3  0.6944    -0.2338 0.468 0.016 0.516
#> GSM97084     2  0.6226     0.4759 0.252 0.720 0.028
#> GSM97094     1  0.5403     0.7231 0.816 0.124 0.060
#> GSM97096     2  0.6180     0.1960 0.000 0.584 0.416
#> GSM97097     2  0.2165     0.6463 0.000 0.936 0.064
#> GSM97107     1  0.6698     0.5849 0.684 0.280 0.036
#> GSM97054     2  0.6090     0.4659 0.264 0.716 0.020
#> GSM97062     2  0.3550     0.6504 0.080 0.896 0.024
#> GSM97069     3  0.5968     0.3855 0.000 0.364 0.636
#> GSM97070     3  0.6154     0.3115 0.000 0.408 0.592
#> GSM97073     3  0.6180     0.2957 0.000 0.416 0.584
#> GSM97076     1  0.6521     0.2145 0.504 0.004 0.492
#> GSM97077     2  0.3030     0.6506 0.092 0.904 0.004
#> GSM97095     1  0.6879     0.4660 0.616 0.360 0.024
#> GSM97102     3  0.5882     0.4055 0.000 0.348 0.652
#> GSM97109     2  0.6738     0.3239 0.356 0.624 0.020
#> GSM97110     2  0.2689     0.6612 0.036 0.932 0.032
#> GSM97074     3  0.3551     0.4488 0.132 0.000 0.868
#> GSM97085     3  0.0848     0.5335 0.008 0.008 0.984
#> GSM97059     1  0.6410     0.3322 0.576 0.420 0.004
#> GSM97072     2  0.6244     0.1298 0.000 0.560 0.440
#> GSM97078     3  0.4749     0.3884 0.172 0.012 0.816
#> GSM97067     3  0.5621     0.4384 0.000 0.308 0.692
#> GSM97087     3  0.6204     0.2762 0.000 0.424 0.576
#> GSM97111     2  0.3272     0.6263 0.004 0.892 0.104
#> GSM97064     2  0.3412     0.6104 0.000 0.876 0.124
#> GSM97065     2  0.6180     0.3917 0.008 0.660 0.332
#> GSM97081     2  0.6274     0.0710 0.000 0.544 0.456
#> GSM97082     3  0.5785     0.4210 0.000 0.332 0.668
#> GSM97088     3  0.2116     0.5335 0.040 0.012 0.948
#> GSM97100     2  0.4883     0.5733 0.208 0.788 0.004
#> GSM97104     3  0.5926     0.3966 0.000 0.356 0.644
#> GSM97108     2  0.3619     0.6330 0.136 0.864 0.000
#> GSM97050     2  0.2063     0.6603 0.044 0.948 0.008
#> GSM97080     3  0.6204     0.2770 0.000 0.424 0.576
#> GSM97089     3  0.6274     0.1877 0.000 0.456 0.544
#> GSM97092     2  0.6045     0.2896 0.000 0.620 0.380
#> GSM97093     2  0.3856     0.6601 0.072 0.888 0.040
#> GSM97058     2  0.1163     0.6547 0.000 0.972 0.028
#> GSM97051     2  0.1453     0.6577 0.008 0.968 0.024
#> GSM97052     2  0.5882     0.3550 0.000 0.652 0.348
#> GSM97061     2  0.5178     0.4994 0.000 0.744 0.256

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.4998    -0.4564 0.512 0.488 0.000 0.000
#> GSM97145     2  0.5105     0.5670 0.432 0.564 0.004 0.000
#> GSM97147     2  0.6471     0.5806 0.340 0.592 0.052 0.016
#> GSM97125     1  0.4406     0.1738 0.700 0.300 0.000 0.000
#> GSM97127     2  0.4948     0.5585 0.440 0.560 0.000 0.000
#> GSM97130     4  0.3037     0.8544 0.100 0.020 0.000 0.880
#> GSM97133     2  0.4925     0.5693 0.428 0.572 0.000 0.000
#> GSM97134     4  0.4328     0.6978 0.244 0.008 0.000 0.748
#> GSM97120     2  0.5112     0.5633 0.436 0.560 0.004 0.000
#> GSM97126     2  0.5168     0.4485 0.496 0.500 0.004 0.000
#> GSM97112     1  0.0188     0.6127 0.996 0.004 0.000 0.000
#> GSM97115     4  0.2131     0.8846 0.032 0.036 0.000 0.932
#> GSM97116     1  0.4977    -0.3783 0.540 0.460 0.000 0.000
#> GSM97117     3  0.2081     0.7168 0.000 0.084 0.916 0.000
#> GSM97119     1  0.1398     0.5985 0.956 0.040 0.000 0.004
#> GSM97122     1  0.1902     0.5872 0.932 0.064 0.000 0.004
#> GSM97135     1  0.2266     0.5731 0.912 0.084 0.000 0.004
#> GSM97136     3  0.6993     0.5321 0.148 0.296 0.556 0.000
#> GSM97139     2  0.4977     0.5272 0.460 0.540 0.000 0.000
#> GSM97146     2  0.4977     0.5272 0.460 0.540 0.000 0.000
#> GSM97123     3  0.0927     0.7369 0.000 0.008 0.976 0.016
#> GSM97129     3  0.6346     0.4224 0.116 0.244 0.640 0.000
#> GSM97143     1  0.1867     0.5821 0.928 0.072 0.000 0.000
#> GSM97113     2  0.5696     0.1864 0.024 0.496 0.480 0.000
#> GSM97056     1  0.7769     0.0502 0.432 0.272 0.000 0.296
#> GSM97124     1  0.3108     0.5502 0.872 0.112 0.000 0.016
#> GSM97132     1  0.4139     0.5618 0.816 0.040 0.000 0.144
#> GSM97144     4  0.2675     0.8617 0.100 0.008 0.000 0.892
#> GSM97149     2  0.5161     0.5787 0.400 0.592 0.008 0.000
#> GSM97068     4  0.2744     0.8734 0.024 0.052 0.012 0.912
#> GSM97071     4  0.0188     0.8963 0.004 0.000 0.000 0.996
#> GSM97086     4  0.0336     0.8947 0.000 0.000 0.008 0.992
#> GSM97103     3  0.3245     0.7419 0.000 0.056 0.880 0.064
#> GSM97057     2  0.6466     0.5279 0.092 0.588 0.320 0.000
#> GSM97060     3  0.5292     0.7072 0.000 0.208 0.728 0.064
#> GSM97075     3  0.0707     0.7357 0.000 0.020 0.980 0.000
#> GSM97098     3  0.0524     0.7392 0.000 0.008 0.988 0.004
#> GSM97099     3  0.2216     0.7037 0.000 0.092 0.908 0.000
#> GSM97101     3  0.5151    -0.0753 0.004 0.464 0.532 0.000
#> GSM97105     3  0.5815     0.5506 0.000 0.140 0.708 0.152
#> GSM97106     3  0.2882     0.7354 0.000 0.024 0.892 0.084
#> GSM97121     3  0.5371     0.2494 0.000 0.364 0.616 0.020
#> GSM97128     1  0.7439     0.3921 0.532 0.264 0.004 0.200
#> GSM97131     3  0.5097     0.2859 0.000 0.004 0.568 0.428
#> GSM97137     1  0.7569    -0.1797 0.436 0.368 0.000 0.196
#> GSM97118     1  0.4364     0.6081 0.808 0.136 0.000 0.056
#> GSM97114     2  0.6950     0.5590 0.180 0.584 0.236 0.000
#> GSM97142     1  0.0524     0.6132 0.988 0.008 0.000 0.004
#> GSM97140     2  0.5708     0.3571 0.028 0.556 0.416 0.000
#> GSM97141     2  0.5296     0.1448 0.008 0.500 0.492 0.000
#> GSM97055     1  0.4399     0.5845 0.760 0.224 0.016 0.000
#> GSM97090     4  0.1798     0.8901 0.040 0.016 0.000 0.944
#> GSM97091     1  0.3907     0.5885 0.768 0.232 0.000 0.000
#> GSM97148     2  0.4961     0.5473 0.448 0.552 0.000 0.000
#> GSM97063     1  0.2814     0.6158 0.868 0.132 0.000 0.000
#> GSM97053     1  0.3498     0.4866 0.832 0.160 0.000 0.008
#> GSM97066     3  0.6568     0.4865 0.080 0.408 0.512 0.000
#> GSM97079     4  0.0336     0.8947 0.000 0.000 0.008 0.992
#> GSM97083     4  0.4018     0.7203 0.224 0.004 0.000 0.772
#> GSM97084     4  0.0000     0.8959 0.000 0.000 0.000 1.000
#> GSM97094     4  0.1211     0.8912 0.040 0.000 0.000 0.960
#> GSM97096     3  0.2125     0.7433 0.000 0.076 0.920 0.004
#> GSM97097     4  0.0707     0.8887 0.000 0.000 0.020 0.980
#> GSM97107     4  0.0592     0.8956 0.016 0.000 0.000 0.984
#> GSM97054     4  0.0188     0.8959 0.000 0.000 0.004 0.996
#> GSM97062     4  0.0188     0.8959 0.000 0.000 0.004 0.996
#> GSM97069     3  0.5846     0.5912 0.032 0.372 0.592 0.004
#> GSM97070     3  0.4594     0.6845 0.008 0.280 0.712 0.000
#> GSM97073     3  0.4509     0.6822 0.004 0.288 0.708 0.000
#> GSM97076     1  0.3450     0.6101 0.836 0.156 0.008 0.000
#> GSM97077     3  0.5307     0.5623 0.000 0.188 0.736 0.076
#> GSM97095     4  0.2179     0.8814 0.064 0.012 0.000 0.924
#> GSM97102     3  0.4814     0.6643 0.008 0.316 0.676 0.000
#> GSM97109     2  0.6087     0.3620 0.048 0.540 0.412 0.000
#> GSM97110     3  0.3569     0.6094 0.000 0.196 0.804 0.000
#> GSM97074     1  0.5933     0.4598 0.552 0.408 0.040 0.000
#> GSM97085     1  0.6862     0.3786 0.488 0.408 0.104 0.000
#> GSM97059     2  0.8459     0.4223 0.184 0.524 0.072 0.220
#> GSM97072     3  0.4098     0.7158 0.000 0.204 0.784 0.012
#> GSM97078     4  0.5050     0.6188 0.268 0.028 0.000 0.704
#> GSM97067     3  0.5905     0.5586 0.040 0.396 0.564 0.000
#> GSM97087     3  0.4262     0.7041 0.008 0.236 0.756 0.000
#> GSM97111     3  0.2011     0.7133 0.000 0.080 0.920 0.000
#> GSM97064     3  0.1936     0.7275 0.000 0.028 0.940 0.032
#> GSM97065     3  0.1824     0.7239 0.004 0.060 0.936 0.000
#> GSM97081     3  0.1398     0.7443 0.004 0.040 0.956 0.000
#> GSM97082     3  0.5306     0.6295 0.020 0.348 0.632 0.000
#> GSM97088     1  0.7026     0.4632 0.540 0.372 0.036 0.052
#> GSM97100     4  0.5074     0.6068 0.000 0.040 0.236 0.724
#> GSM97104     3  0.5220     0.6302 0.016 0.352 0.632 0.000
#> GSM97108     3  0.5143     0.2733 0.000 0.360 0.628 0.012
#> GSM97050     3  0.4966     0.6056 0.000 0.156 0.768 0.076
#> GSM97080     3  0.4456     0.6859 0.004 0.280 0.716 0.000
#> GSM97089     3  0.3791     0.7165 0.004 0.200 0.796 0.000
#> GSM97092     3  0.2329     0.7443 0.000 0.072 0.916 0.012
#> GSM97093     3  0.4163     0.5666 0.004 0.220 0.772 0.004
#> GSM97058     3  0.3312     0.7011 0.000 0.052 0.876 0.072
#> GSM97051     4  0.2149     0.8330 0.000 0.000 0.088 0.912
#> GSM97052     3  0.1854     0.7447 0.000 0.048 0.940 0.012
#> GSM97061     3  0.1305     0.7381 0.000 0.004 0.960 0.036

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1   0.388     0.5404 0.776 0.000 0.032 0.000 0.192
#> GSM97145     1   0.461     0.5730 0.760 0.008 0.092 0.000 0.140
#> GSM97147     1   0.678     0.4901 0.612 0.192 0.140 0.036 0.020
#> GSM97125     1   0.464     0.3336 0.660 0.000 0.032 0.000 0.308
#> GSM97127     1   0.257     0.6382 0.892 0.000 0.040 0.000 0.068
#> GSM97130     4   0.239     0.8023 0.044 0.000 0.004 0.908 0.044
#> GSM97133     1   0.131     0.6552 0.956 0.000 0.024 0.000 0.020
#> GSM97134     4   0.517     0.5760 0.040 0.004 0.020 0.688 0.248
#> GSM97120     1   0.136     0.6527 0.952 0.000 0.012 0.000 0.036
#> GSM97126     1   0.451     0.4846 0.728 0.012 0.020 0.004 0.236
#> GSM97112     5   0.447     0.5181 0.292 0.000 0.020 0.004 0.684
#> GSM97115     4   0.386     0.7874 0.076 0.076 0.008 0.832 0.008
#> GSM97116     1   0.214     0.6281 0.904 0.000 0.008 0.000 0.088
#> GSM97117     2   0.593     0.2880 0.100 0.536 0.360 0.000 0.004
#> GSM97119     5   0.477     0.4649 0.340 0.000 0.024 0.004 0.632
#> GSM97122     5   0.495     0.4423 0.356 0.000 0.024 0.008 0.612
#> GSM97135     5   0.506     0.3405 0.412 0.000 0.028 0.004 0.556
#> GSM97136     5   0.743    -0.2044 0.052 0.204 0.292 0.000 0.452
#> GSM97139     1   0.120     0.6496 0.952 0.000 0.000 0.000 0.048
#> GSM97146     1   0.153     0.6483 0.948 0.004 0.012 0.000 0.036
#> GSM97123     2   0.304     0.4961 0.000 0.840 0.148 0.004 0.008
#> GSM97129     1   0.816     0.1773 0.376 0.220 0.284 0.000 0.120
#> GSM97143     5   0.474     0.4160 0.380 0.000 0.016 0.004 0.600
#> GSM97113     1   0.471     0.3571 0.684 0.268 0.048 0.000 0.000
#> GSM97056     1   0.630     0.3146 0.592 0.008 0.016 0.272 0.112
#> GSM97124     5   0.575     0.4098 0.356 0.000 0.040 0.032 0.572
#> GSM97132     5   0.653     0.4248 0.232 0.000 0.016 0.196 0.556
#> GSM97144     4   0.144     0.8128 0.004 0.000 0.004 0.948 0.044
#> GSM97149     1   0.111     0.6460 0.964 0.024 0.012 0.000 0.000
#> GSM97068     4   0.476     0.7414 0.104 0.116 0.012 0.764 0.004
#> GSM97071     4   0.160     0.8164 0.000 0.008 0.024 0.948 0.020
#> GSM97086     4   0.225     0.7921 0.000 0.012 0.088 0.900 0.000
#> GSM97103     3   0.353     0.4872 0.000 0.076 0.832 0.092 0.000
#> GSM97057     1   0.500    -0.0400 0.508 0.468 0.016 0.008 0.000
#> GSM97060     2   0.613    -0.2269 0.000 0.476 0.416 0.008 0.100
#> GSM97075     2   0.350     0.4905 0.016 0.816 0.160 0.000 0.008
#> GSM97098     3   0.316     0.5042 0.000 0.164 0.824 0.012 0.000
#> GSM97099     3   0.505     0.3810 0.068 0.248 0.680 0.004 0.000
#> GSM97101     2   0.629     0.3198 0.332 0.500 0.168 0.000 0.000
#> GSM97105     2   0.593     0.4085 0.048 0.632 0.260 0.060 0.000
#> GSM97106     3   0.498     0.1884 0.000 0.484 0.488 0.028 0.000
#> GSM97121     2   0.683     0.2908 0.156 0.480 0.340 0.024 0.000
#> GSM97128     5   0.488     0.3743 0.000 0.032 0.024 0.236 0.708
#> GSM97131     2   0.679     0.1206 0.000 0.376 0.284 0.340 0.000
#> GSM97137     1   0.495     0.4849 0.732 0.000 0.012 0.164 0.092
#> GSM97118     5   0.409     0.5736 0.096 0.000 0.008 0.092 0.804
#> GSM97114     1   0.545     0.5146 0.668 0.128 0.200 0.000 0.004
#> GSM97142     5   0.451     0.5176 0.284 0.000 0.024 0.004 0.688
#> GSM97140     2   0.561     0.4393 0.244 0.648 0.096 0.012 0.000
#> GSM97141     2   0.651     0.2536 0.348 0.452 0.200 0.000 0.000
#> GSM97055     5   0.302     0.5783 0.088 0.012 0.028 0.000 0.872
#> GSM97090     4   0.478     0.7767 0.072 0.076 0.012 0.792 0.048
#> GSM97091     5   0.239     0.5863 0.104 0.000 0.004 0.004 0.888
#> GSM97148     1   0.110     0.6492 0.968 0.008 0.012 0.000 0.012
#> GSM97063     5   0.289     0.5784 0.160 0.000 0.004 0.000 0.836
#> GSM97053     1   0.529    -0.1124 0.516 0.000 0.008 0.032 0.444
#> GSM97066     5   0.691    -0.3794 0.000 0.336 0.276 0.004 0.384
#> GSM97079     4   0.378     0.6328 0.000 0.008 0.252 0.740 0.000
#> GSM97083     4   0.377     0.7132 0.000 0.008 0.012 0.780 0.200
#> GSM97084     4   0.164     0.8054 0.000 0.004 0.064 0.932 0.000
#> GSM97094     4   0.385     0.7306 0.000 0.000 0.172 0.788 0.040
#> GSM97096     3   0.372     0.5204 0.000 0.208 0.776 0.004 0.012
#> GSM97097     3   0.465    -0.1220 0.000 0.012 0.520 0.468 0.000
#> GSM97107     4   0.213     0.8023 0.000 0.000 0.080 0.908 0.012
#> GSM97054     4   0.217     0.8029 0.000 0.088 0.004 0.904 0.004
#> GSM97062     4   0.157     0.8141 0.000 0.012 0.032 0.948 0.008
#> GSM97069     3   0.671     0.3187 0.000 0.296 0.424 0.000 0.280
#> GSM97070     3   0.656     0.2684 0.000 0.372 0.424 0.000 0.204
#> GSM97073     3   0.494     0.5347 0.000 0.176 0.720 0.004 0.100
#> GSM97076     3   0.592     0.2549 0.072 0.004 0.632 0.028 0.264
#> GSM97077     2   0.434     0.5118 0.080 0.812 0.040 0.064 0.004
#> GSM97095     4   0.409     0.7905 0.040 0.060 0.008 0.832 0.060
#> GSM97102     3   0.517     0.5269 0.000 0.184 0.688 0.000 0.128
#> GSM97109     3   0.496     0.3580 0.176 0.084 0.728 0.012 0.000
#> GSM97110     3   0.408     0.4990 0.076 0.104 0.808 0.012 0.000
#> GSM97074     5   0.359     0.4688 0.004 0.040 0.100 0.012 0.844
#> GSM97085     5   0.476     0.2642 0.000 0.140 0.128 0.000 0.732
#> GSM97059     1   0.720     0.0886 0.424 0.352 0.012 0.200 0.012
#> GSM97072     3   0.474     0.5314 0.000 0.216 0.724 0.012 0.048
#> GSM97078     4   0.488     0.5318 0.000 0.020 0.012 0.636 0.332
#> GSM97067     3   0.666     0.3827 0.000 0.236 0.480 0.004 0.280
#> GSM97087     2   0.457     0.3706 0.000 0.748 0.148 0.000 0.104
#> GSM97111     3   0.517     0.0725 0.048 0.376 0.576 0.000 0.000
#> GSM97064     2   0.177     0.5263 0.016 0.944 0.024 0.012 0.004
#> GSM97065     3   0.589     0.2578 0.096 0.360 0.540 0.000 0.004
#> GSM97081     2   0.485     0.3414 0.000 0.692 0.240 0.000 0.068
#> GSM97082     2   0.645    -0.0203 0.000 0.500 0.228 0.000 0.272
#> GSM97088     5   0.535     0.4295 0.000 0.128 0.036 0.112 0.724
#> GSM97100     4   0.656     0.0029 0.016 0.416 0.128 0.440 0.000
#> GSM97104     3   0.663     0.3366 0.000 0.332 0.436 0.000 0.232
#> GSM97108     2   0.673     0.3291 0.140 0.512 0.320 0.028 0.000
#> GSM97050     2   0.483     0.5102 0.108 0.776 0.072 0.040 0.004
#> GSM97080     2   0.621    -0.0263 0.000 0.532 0.296 0.000 0.172
#> GSM97089     2   0.422     0.3817 0.000 0.772 0.156 0.000 0.072
#> GSM97092     2   0.367     0.4371 0.000 0.812 0.140 0.000 0.048
#> GSM97093     2   0.372     0.5105 0.160 0.808 0.024 0.004 0.004
#> GSM97058     2   0.265     0.5327 0.028 0.900 0.052 0.020 0.000
#> GSM97051     2   0.494    -0.0862 0.004 0.516 0.012 0.464 0.004
#> GSM97052     2   0.306     0.4708 0.000 0.860 0.096 0.000 0.044
#> GSM97061     2   0.255     0.4968 0.000 0.896 0.072 0.004 0.028

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.5290    -0.0452 0.468 0.048 0.000 0.000 0.460 0.024
#> GSM97145     5  0.6706     0.2356 0.212 0.272 0.000 0.000 0.460 0.056
#> GSM97147     2  0.4612     0.5764 0.080 0.752 0.000 0.012 0.132 0.024
#> GSM97125     5  0.4430     0.5889 0.196 0.052 0.000 0.000 0.728 0.024
#> GSM97127     1  0.5963     0.1653 0.488 0.108 0.000 0.000 0.372 0.032
#> GSM97130     4  0.2132     0.8237 0.020 0.008 0.000 0.920 0.032 0.020
#> GSM97133     1  0.1856     0.8204 0.920 0.032 0.000 0.000 0.048 0.000
#> GSM97134     5  0.5327     0.1155 0.000 0.044 0.012 0.448 0.484 0.012
#> GSM97120     1  0.1477     0.8296 0.940 0.004 0.000 0.000 0.048 0.008
#> GSM97126     5  0.4448     0.6086 0.176 0.080 0.000 0.008 0.732 0.004
#> GSM97112     5  0.1261     0.7297 0.028 0.004 0.008 0.000 0.956 0.004
#> GSM97115     4  0.3258     0.7974 0.104 0.012 0.020 0.848 0.008 0.008
#> GSM97116     1  0.1285     0.8301 0.944 0.004 0.000 0.000 0.052 0.000
#> GSM97117     2  0.3991     0.6487 0.032 0.820 0.036 0.000 0.052 0.060
#> GSM97119     5  0.1737     0.7291 0.040 0.020 0.000 0.008 0.932 0.000
#> GSM97122     5  0.2077     0.7265 0.056 0.012 0.008 0.008 0.916 0.000
#> GSM97135     5  0.2144     0.7149 0.092 0.004 0.000 0.004 0.896 0.004
#> GSM97136     5  0.6074     0.3485 0.008 0.040 0.256 0.000 0.576 0.120
#> GSM97139     1  0.1349     0.8283 0.940 0.004 0.000 0.000 0.056 0.000
#> GSM97146     1  0.0547     0.8327 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM97123     2  0.4951     0.0551 0.008 0.476 0.476 0.004 0.000 0.036
#> GSM97129     2  0.5895     0.2166 0.056 0.548 0.012 0.000 0.336 0.048
#> GSM97143     5  0.1956     0.7203 0.080 0.008 0.000 0.004 0.908 0.000
#> GSM97113     1  0.2713     0.7616 0.884 0.036 0.040 0.000 0.000 0.040
#> GSM97056     1  0.3252     0.7219 0.832 0.004 0.008 0.124 0.032 0.000
#> GSM97124     5  0.3531     0.7123 0.052 0.052 0.004 0.032 0.848 0.012
#> GSM97132     5  0.3783     0.6766 0.024 0.004 0.016 0.160 0.792 0.004
#> GSM97144     4  0.2245     0.8199 0.000 0.008 0.004 0.908 0.052 0.028
#> GSM97149     1  0.0291     0.8280 0.992 0.004 0.000 0.000 0.004 0.000
#> GSM97068     4  0.3733     0.7376 0.180 0.020 0.016 0.780 0.004 0.000
#> GSM97071     4  0.3690     0.7864 0.000 0.012 0.024 0.824 0.040 0.100
#> GSM97086     4  0.2218     0.8077 0.000 0.012 0.000 0.884 0.000 0.104
#> GSM97103     6  0.3699     0.6121 0.000 0.088 0.028 0.068 0.000 0.816
#> GSM97057     1  0.3327     0.7256 0.844 0.076 0.060 0.016 0.000 0.004
#> GSM97060     3  0.4407     0.3698 0.004 0.020 0.660 0.012 0.000 0.304
#> GSM97075     2  0.4749     0.3995 0.008 0.612 0.332 0.000 0.000 0.048
#> GSM97098     6  0.3915     0.6263 0.000 0.092 0.128 0.004 0.000 0.776
#> GSM97099     6  0.6507     0.4748 0.060 0.200 0.180 0.000 0.008 0.552
#> GSM97101     2  0.3851     0.6538 0.096 0.804 0.072 0.000 0.000 0.028
#> GSM97105     2  0.1950     0.6621 0.012 0.928 0.032 0.008 0.000 0.020
#> GSM97106     3  0.5838     0.0256 0.004 0.096 0.468 0.020 0.000 0.412
#> GSM97121     2  0.2987     0.6525 0.024 0.876 0.004 0.008 0.028 0.060
#> GSM97128     5  0.5911     0.2517 0.000 0.000 0.180 0.316 0.496 0.008
#> GSM97131     2  0.3550     0.6432 0.000 0.816 0.044 0.120 0.000 0.020
#> GSM97137     1  0.2406     0.7941 0.896 0.004 0.004 0.060 0.036 0.000
#> GSM97118     5  0.2933     0.7073 0.000 0.000 0.056 0.076 0.860 0.008
#> GSM97114     2  0.5365     0.5103 0.216 0.652 0.000 0.000 0.044 0.088
#> GSM97142     5  0.0806     0.7300 0.020 0.008 0.000 0.000 0.972 0.000
#> GSM97140     2  0.3627     0.6441 0.036 0.820 0.112 0.028 0.004 0.000
#> GSM97141     2  0.3291     0.6594 0.084 0.848 0.028 0.000 0.004 0.036
#> GSM97055     5  0.3533     0.6286 0.008 0.000 0.196 0.000 0.776 0.020
#> GSM97090     4  0.4163     0.7777 0.096 0.016 0.064 0.800 0.020 0.004
#> GSM97091     5  0.1970     0.7066 0.000 0.000 0.092 0.000 0.900 0.008
#> GSM97148     1  0.0363     0.8312 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM97063     5  0.1655     0.7197 0.008 0.000 0.052 0.000 0.932 0.008
#> GSM97053     5  0.4160     0.6088 0.228 0.008 0.012 0.016 0.732 0.004
#> GSM97066     3  0.5213     0.3488 0.000 0.032 0.640 0.000 0.072 0.256
#> GSM97079     4  0.3905     0.5059 0.000 0.004 0.004 0.636 0.000 0.356
#> GSM97083     4  0.3663     0.7046 0.000 0.000 0.040 0.776 0.180 0.004
#> GSM97084     4  0.2400     0.8032 0.000 0.004 0.008 0.872 0.000 0.116
#> GSM97094     4  0.4471     0.5774 0.000 0.020 0.000 0.648 0.020 0.312
#> GSM97096     6  0.4062     0.5793 0.000 0.068 0.196 0.000 0.000 0.736
#> GSM97097     6  0.4731     0.2087 0.000 0.044 0.008 0.344 0.000 0.604
#> GSM97107     4  0.2593     0.7889 0.000 0.008 0.000 0.844 0.000 0.148
#> GSM97054     4  0.1794     0.8095 0.000 0.036 0.040 0.924 0.000 0.000
#> GSM97062     4  0.1769     0.8180 0.000 0.012 0.004 0.924 0.000 0.060
#> GSM97069     3  0.5035     0.3146 0.000 0.028 0.612 0.000 0.044 0.316
#> GSM97070     3  0.5129     0.2687 0.000 0.076 0.576 0.000 0.008 0.340
#> GSM97073     6  0.4200     0.4746 0.000 0.032 0.264 0.000 0.008 0.696
#> GSM97076     6  0.5542     0.5268 0.016 0.040 0.076 0.016 0.152 0.700
#> GSM97077     2  0.4960     0.5143 0.008 0.656 0.264 0.060 0.000 0.012
#> GSM97095     4  0.3282     0.8012 0.020 0.044 0.048 0.864 0.020 0.004
#> GSM97102     6  0.4319     0.4390 0.000 0.024 0.320 0.000 0.008 0.648
#> GSM97109     6  0.4724     0.5374 0.036 0.208 0.000 0.008 0.036 0.712
#> GSM97110     6  0.3748     0.6409 0.056 0.068 0.048 0.004 0.000 0.824
#> GSM97074     5  0.5910     0.2477 0.000 0.000 0.292 0.008 0.508 0.192
#> GSM97085     3  0.5002     0.0835 0.000 0.000 0.516 0.000 0.412 0.072
#> GSM97059     2  0.6706     0.3896 0.216 0.472 0.060 0.252 0.000 0.000
#> GSM97072     6  0.3719     0.4941 0.000 0.024 0.248 0.000 0.000 0.728
#> GSM97078     4  0.5228     0.5886 0.000 0.004 0.128 0.656 0.200 0.012
#> GSM97067     3  0.4656     0.1603 0.000 0.012 0.552 0.004 0.016 0.416
#> GSM97087     3  0.3258     0.5221 0.008 0.092 0.836 0.000 0.000 0.064
#> GSM97111     2  0.4266     0.5942 0.032 0.776 0.020 0.000 0.028 0.144
#> GSM97064     3  0.5350    -0.0890 0.012 0.412 0.516 0.048 0.000 0.012
#> GSM97065     6  0.6939     0.3073 0.120 0.200 0.192 0.000 0.000 0.488
#> GSM97081     2  0.5399     0.1963 0.000 0.528 0.360 0.000 0.004 0.108
#> GSM97082     3  0.3916     0.4994 0.000 0.040 0.804 0.000 0.072 0.084
#> GSM97088     5  0.6351     0.2241 0.000 0.000 0.344 0.212 0.424 0.020
#> GSM97100     2  0.3354     0.6255 0.000 0.796 0.036 0.168 0.000 0.000
#> GSM97104     3  0.4321     0.3205 0.000 0.012 0.652 0.000 0.020 0.316
#> GSM97108     2  0.2676     0.6652 0.020 0.900 0.024 0.008 0.028 0.020
#> GSM97050     2  0.6576     0.2276 0.040 0.456 0.392 0.080 0.004 0.028
#> GSM97080     3  0.3986     0.4706 0.000 0.036 0.756 0.000 0.016 0.192
#> GSM97089     3  0.3564     0.5167 0.012 0.084 0.824 0.004 0.000 0.076
#> GSM97092     3  0.4357     0.4267 0.008 0.244 0.704 0.004 0.000 0.040
#> GSM97093     3  0.6458     0.0516 0.108 0.336 0.504 0.016 0.008 0.028
#> GSM97058     2  0.4962     0.4272 0.008 0.608 0.332 0.040 0.000 0.012
#> GSM97051     2  0.5927     0.3730 0.004 0.484 0.208 0.304 0.000 0.000
#> GSM97052     3  0.4497     0.3204 0.008 0.284 0.672 0.012 0.000 0.024
#> GSM97061     3  0.4978     0.1038 0.008 0.372 0.576 0.020 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)

plot of chunk tab-SD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-NMF-membership-heatmap-5

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)

plot of chunk tab-SD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-SD-NMF-get-signatures-no-scale-1

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

plot of chunk tab-SD-NMF-get-signatures-no-scale-2

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

plot of chunk tab-SD-NMF-get-signatures-no-scale-3

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

plot of chunk tab-SD-NMF-get-signatures-no-scale-4

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

plot of chunk tab-SD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-NMF-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-SD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-NMF-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF 97         7.18e-05       0.738     3.31e-13    0.149 2
#> SD:NMF 52         1.69e-02       0.437     4.61e-08    0.614 3
#> SD:NMF 78         1.01e-03       0.993     5.54e-12    0.604 4
#> SD:NMF 44         2.78e-03       0.476     8.31e-09    0.410 5
#> SD:NMF 63         5.59e-02       0.869     2.11e-11    0.121 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.


CV:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "hclust"]
# 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 21512 rows and 100 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)

plot of chunk CV-hclust-collect-plots

The plots are:

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:

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)

plot of chunk CV-hclust-select-partition-number

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.426           0.786       0.886         0.4182 0.547   0.547
#> 3 3 0.297           0.657       0.801         0.3678 0.890   0.804
#> 4 4 0.345           0.588       0.747         0.1706 0.886   0.759
#> 5 5 0.406           0.453       0.685         0.0911 0.921   0.786
#> 6 6 0.473           0.528       0.698         0.0463 0.929   0.767

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.4161      0.809 0.916 0.084
#> GSM97145     1  0.3733      0.806 0.928 0.072
#> GSM97147     2  0.7453      0.725 0.212 0.788
#> GSM97125     1  0.3733      0.806 0.928 0.072
#> GSM97127     1  0.3879      0.807 0.924 0.076
#> GSM97130     1  0.8144      0.728 0.748 0.252
#> GSM97133     1  0.2043      0.792 0.968 0.032
#> GSM97134     1  0.9988      0.313 0.520 0.480
#> GSM97120     1  0.2236      0.794 0.964 0.036
#> GSM97126     1  0.9954      0.376 0.540 0.460
#> GSM97112     1  0.6343      0.810 0.840 0.160
#> GSM97115     2  1.0000     -0.227 0.496 0.504
#> GSM97116     1  0.2236      0.794 0.964 0.036
#> GSM97117     2  0.6048      0.819 0.148 0.852
#> GSM97119     1  0.6343      0.810 0.840 0.160
#> GSM97122     1  0.6343      0.810 0.840 0.160
#> GSM97135     1  0.6247      0.810 0.844 0.156
#> GSM97136     2  0.9954     -0.169 0.460 0.540
#> GSM97139     1  0.1633      0.788 0.976 0.024
#> GSM97146     1  0.0000      0.774 1.000 0.000
#> GSM97123     2  0.0000      0.913 0.000 1.000
#> GSM97129     1  0.9988      0.313 0.520 0.480
#> GSM97143     1  0.8909      0.692 0.692 0.308
#> GSM97113     1  0.9970      0.244 0.532 0.468
#> GSM97056     1  0.1184      0.785 0.984 0.016
#> GSM97124     1  0.6438      0.808 0.836 0.164
#> GSM97132     1  0.8608      0.721 0.716 0.284
#> GSM97144     1  0.9129      0.656 0.672 0.328
#> GSM97149     1  0.0000      0.774 1.000 0.000
#> GSM97068     1  0.9795      0.460 0.584 0.416
#> GSM97071     2  0.1633      0.914 0.024 0.976
#> GSM97086     2  0.0000      0.913 0.000 1.000
#> GSM97103     2  0.0672      0.914 0.008 0.992
#> GSM97057     1  0.9775      0.408 0.588 0.412
#> GSM97060     2  0.0000      0.913 0.000 1.000
#> GSM97075     2  0.2948      0.905 0.052 0.948
#> GSM97098     2  0.0672      0.914 0.008 0.992
#> GSM97099     2  0.5059      0.859 0.112 0.888
#> GSM97101     2  0.4939      0.862 0.108 0.892
#> GSM97105     2  0.1414      0.914 0.020 0.980
#> GSM97106     2  0.0000      0.913 0.000 1.000
#> GSM97121     2  0.6048      0.812 0.148 0.852
#> GSM97128     2  0.3733      0.888 0.072 0.928
#> GSM97131     2  0.0000      0.913 0.000 1.000
#> GSM97137     1  0.6343      0.785 0.840 0.160
#> GSM97118     1  0.9427      0.619 0.640 0.360
#> GSM97114     2  0.6048      0.819 0.148 0.852
#> GSM97142     1  0.6343      0.810 0.840 0.160
#> GSM97140     2  0.4022      0.888 0.080 0.920
#> GSM97141     2  0.6048      0.819 0.148 0.852
#> GSM97055     2  0.8267      0.611 0.260 0.740
#> GSM97090     2  0.9983     -0.160 0.476 0.524
#> GSM97091     1  0.6531      0.807 0.832 0.168
#> GSM97148     1  0.0000      0.774 1.000 0.000
#> GSM97063     1  0.6531      0.807 0.832 0.168
#> GSM97053     1  0.5408      0.812 0.876 0.124
#> GSM97066     2  0.1414      0.914 0.020 0.980
#> GSM97079     2  0.0376      0.914 0.004 0.996
#> GSM97083     2  0.3733      0.888 0.072 0.928
#> GSM97084     2  0.0000      0.913 0.000 1.000
#> GSM97094     2  0.4298      0.867 0.088 0.912
#> GSM97096     2  0.0672      0.914 0.008 0.992
#> GSM97097     2  0.0000      0.913 0.000 1.000
#> GSM97107     2  0.3431      0.888 0.064 0.936
#> GSM97054     2  0.1633      0.914 0.024 0.976
#> GSM97062     2  0.0000      0.913 0.000 1.000
#> GSM97069     2  0.1414      0.914 0.020 0.980
#> GSM97070     2  0.1414      0.914 0.020 0.980
#> GSM97073     2  0.1414      0.914 0.020 0.980
#> GSM97076     2  0.3114      0.904 0.056 0.944
#> GSM97077     2  0.3114      0.903 0.056 0.944
#> GSM97095     1  0.9970      0.310 0.532 0.468
#> GSM97102     2  0.0672      0.914 0.008 0.992
#> GSM97109     2  0.2603      0.909 0.044 0.956
#> GSM97110     2  0.2603      0.909 0.044 0.956
#> GSM97074     2  0.5842      0.811 0.140 0.860
#> GSM97085     2  0.2778      0.903 0.048 0.952
#> GSM97059     2  0.8144      0.643 0.252 0.748
#> GSM97072     2  0.0000      0.913 0.000 1.000
#> GSM97078     2  0.3733      0.888 0.072 0.928
#> GSM97067     2  0.1414      0.914 0.020 0.980
#> GSM97087     2  0.0376      0.914 0.004 0.996
#> GSM97111     2  0.3114      0.905 0.056 0.944
#> GSM97064     2  0.0672      0.915 0.008 0.992
#> GSM97065     2  0.3584      0.900 0.068 0.932
#> GSM97081     2  0.2236      0.913 0.036 0.964
#> GSM97082     2  0.0000      0.913 0.000 1.000
#> GSM97088     2  0.2948      0.901 0.052 0.948
#> GSM97100     2  0.2778      0.906 0.048 0.952
#> GSM97104     2  0.0000      0.913 0.000 1.000
#> GSM97108     2  0.4690      0.867 0.100 0.900
#> GSM97050     2  0.0376      0.914 0.004 0.996
#> GSM97080     2  0.0672      0.914 0.008 0.992
#> GSM97089     2  0.0376      0.914 0.004 0.996
#> GSM97092     2  0.0000      0.913 0.000 1.000
#> GSM97093     2  0.6973      0.744 0.188 0.812
#> GSM97058     2  0.2236      0.911 0.036 0.964
#> GSM97051     2  0.0000      0.913 0.000 1.000
#> GSM97052     2  0.0000      0.913 0.000 1.000
#> GSM97061     2  0.0000      0.913 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1   0.286     0.7065 0.912 0.004 0.084
#> GSM97145     1   0.241     0.7094 0.940 0.020 0.040
#> GSM97147     2   0.583     0.6445 0.204 0.764 0.032
#> GSM97125     1   0.253     0.7098 0.936 0.020 0.044
#> GSM97127     1   0.255     0.7093 0.936 0.024 0.040
#> GSM97130     1   0.678     0.5768 0.732 0.188 0.080
#> GSM97133     1   0.162     0.6990 0.964 0.012 0.024
#> GSM97134     1   0.846     0.2442 0.528 0.376 0.096
#> GSM97120     1   0.127     0.7000 0.972 0.004 0.024
#> GSM97126     1   0.882     0.3000 0.540 0.324 0.136
#> GSM97112     1   0.445     0.6924 0.836 0.012 0.152
#> GSM97115     1   0.814     0.1611 0.480 0.452 0.068
#> GSM97116     1   0.186     0.6983 0.948 0.000 0.052
#> GSM97117     2   0.547     0.7259 0.140 0.808 0.052
#> GSM97119     1   0.445     0.6924 0.836 0.012 0.152
#> GSM97122     1   0.445     0.6924 0.836 0.012 0.152
#> GSM97135     1   0.439     0.6936 0.840 0.012 0.148
#> GSM97136     1   0.960     0.1291 0.460 0.320 0.220
#> GSM97139     1   0.140     0.6939 0.968 0.004 0.028
#> GSM97146     1   0.175     0.6856 0.952 0.000 0.048
#> GSM97123     2   0.186     0.7978 0.000 0.948 0.052
#> GSM97129     1   0.846     0.2442 0.528 0.376 0.096
#> GSM97143     1   0.730     0.5866 0.688 0.084 0.228
#> GSM97113     1   0.757     0.1202 0.512 0.448 0.040
#> GSM97056     1   0.175     0.6987 0.952 0.000 0.048
#> GSM97124     1   0.462     0.6959 0.836 0.020 0.144
#> GSM97132     1   0.677     0.6184 0.724 0.068 0.208
#> GSM97144     1   0.771     0.5161 0.660 0.240 0.100
#> GSM97149     1   0.175     0.6856 0.952 0.000 0.048
#> GSM97068     1   0.774     0.2942 0.568 0.376 0.056
#> GSM97071     2   0.611     0.6676 0.044 0.756 0.200
#> GSM97086     2   0.236     0.7933 0.000 0.928 0.072
#> GSM97103     2   0.392     0.7838 0.004 0.856 0.140
#> GSM97057     1   0.744     0.2225 0.568 0.392 0.040
#> GSM97060     2   0.355     0.7765 0.000 0.868 0.132
#> GSM97075     2   0.415     0.7995 0.044 0.876 0.080
#> GSM97098     2   0.385     0.7863 0.004 0.860 0.136
#> GSM97099     2   0.482     0.7619 0.108 0.844 0.048
#> GSM97101     2   0.474     0.7642 0.104 0.848 0.048
#> GSM97105     2   0.191     0.7973 0.016 0.956 0.028
#> GSM97106     2   0.254     0.7878 0.000 0.920 0.080
#> GSM97121     2   0.493     0.7276 0.140 0.828 0.032
#> GSM97128     3   0.543     0.8413 0.048 0.144 0.808
#> GSM97131     2   0.175     0.7976 0.000 0.952 0.048
#> GSM97137     1   0.524     0.6488 0.824 0.120 0.056
#> GSM97118     1   0.792     0.5198 0.636 0.100 0.264
#> GSM97114     2   0.547     0.7259 0.140 0.808 0.052
#> GSM97142     1   0.445     0.6924 0.836 0.012 0.152
#> GSM97140     2   0.376     0.7847 0.068 0.892 0.040
#> GSM97141     2   0.527     0.7289 0.140 0.816 0.044
#> GSM97055     3   0.917     0.6068 0.248 0.212 0.540
#> GSM97090     2   0.821    -0.1949 0.460 0.468 0.072
#> GSM97091     1   0.466     0.6893 0.828 0.016 0.156
#> GSM97148     1   0.175     0.6856 0.952 0.000 0.048
#> GSM97063     1   0.466     0.6893 0.828 0.016 0.156
#> GSM97053     1   0.364     0.7011 0.872 0.004 0.124
#> GSM97066     2   0.581     0.5957 0.004 0.692 0.304
#> GSM97079     2   0.250     0.7950 0.004 0.928 0.068
#> GSM97083     3   0.547     0.8364 0.052 0.140 0.808
#> GSM97084     2   0.303     0.7881 0.004 0.904 0.092
#> GSM97094     2   0.631     0.6862 0.100 0.772 0.128
#> GSM97096     2   0.385     0.7849 0.004 0.860 0.136
#> GSM97097     2   0.286     0.7923 0.004 0.912 0.084
#> GSM97107     2   0.530     0.7421 0.068 0.824 0.108
#> GSM97054     2   0.611     0.6676 0.044 0.756 0.200
#> GSM97062     2   0.268     0.7927 0.004 0.920 0.076
#> GSM97069     2   0.537     0.6781 0.004 0.744 0.252
#> GSM97070     2   0.581     0.5957 0.004 0.692 0.304
#> GSM97073     2   0.596     0.5961 0.008 0.692 0.300
#> GSM97076     2   0.716     0.5153 0.044 0.640 0.316
#> GSM97077     2   0.334     0.7924 0.060 0.908 0.032
#> GSM97095     1   0.781     0.1830 0.512 0.436 0.052
#> GSM97102     2   0.392     0.7838 0.004 0.856 0.140
#> GSM97109     2   0.493     0.7814 0.044 0.836 0.120
#> GSM97110     2   0.493     0.7814 0.044 0.836 0.120
#> GSM97074     2   0.900    -0.0733 0.136 0.488 0.376
#> GSM97085     3   0.638     0.7926 0.032 0.256 0.712
#> GSM97059     2   0.638     0.5599 0.244 0.720 0.036
#> GSM97072     2   0.440     0.7504 0.000 0.812 0.188
#> GSM97078     3   0.543     0.8413 0.048 0.144 0.808
#> GSM97067     2   0.578     0.6030 0.004 0.696 0.300
#> GSM97087     2   0.475     0.7537 0.008 0.808 0.184
#> GSM97111     2   0.514     0.7774 0.052 0.828 0.120
#> GSM97064     2   0.217     0.8029 0.008 0.944 0.048
#> GSM97065     2   0.689     0.6372 0.060 0.704 0.236
#> GSM97081     2   0.492     0.7773 0.036 0.832 0.132
#> GSM97082     2   0.501     0.7422 0.008 0.788 0.204
#> GSM97088     3   0.696     0.7305 0.040 0.300 0.660
#> GSM97100     2   0.292     0.7950 0.044 0.924 0.032
#> GSM97104     2   0.394     0.7749 0.000 0.844 0.156
#> GSM97108     2   0.459     0.7694 0.096 0.856 0.048
#> GSM97050     2   0.116     0.7994 0.000 0.972 0.028
#> GSM97080     2   0.455     0.7489 0.000 0.800 0.200
#> GSM97089     2   0.475     0.7537 0.008 0.808 0.184
#> GSM97092     2   0.388     0.7762 0.000 0.848 0.152
#> GSM97093     2   0.782     0.5234 0.176 0.672 0.152
#> GSM97058     2   0.266     0.8012 0.024 0.932 0.044
#> GSM97051     2   0.175     0.7990 0.000 0.952 0.048
#> GSM97052     2   0.296     0.7902 0.000 0.900 0.100
#> GSM97061     2   0.196     0.7974 0.000 0.944 0.056

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.2401      0.711 0.904 0.000 0.004 0.092
#> GSM97145     1  0.2188      0.715 0.936 0.020 0.012 0.032
#> GSM97147     2  0.5886      0.585 0.200 0.720 0.040 0.040
#> GSM97125     1  0.2284      0.716 0.932 0.020 0.012 0.036
#> GSM97127     1  0.2269      0.716 0.932 0.028 0.008 0.032
#> GSM97130     1  0.6302      0.624 0.720 0.128 0.040 0.112
#> GSM97133     1  0.1271      0.704 0.968 0.012 0.008 0.012
#> GSM97134     1  0.7693      0.386 0.516 0.332 0.028 0.124
#> GSM97120     1  0.0992      0.706 0.976 0.004 0.008 0.012
#> GSM97126     1  0.7988      0.421 0.524 0.268 0.032 0.176
#> GSM97112     1  0.3539      0.691 0.820 0.000 0.004 0.176
#> GSM97115     1  0.7767      0.291 0.472 0.388 0.036 0.104
#> GSM97116     1  0.1767      0.704 0.944 0.000 0.012 0.044
#> GSM97117     2  0.5540      0.631 0.132 0.760 0.088 0.020
#> GSM97119     1  0.3539      0.691 0.820 0.000 0.004 0.176
#> GSM97122     1  0.3539      0.691 0.820 0.000 0.004 0.176
#> GSM97135     1  0.3494      0.692 0.824 0.000 0.004 0.172
#> GSM97136     1  0.8950      0.268 0.444 0.252 0.076 0.228
#> GSM97139     1  0.1124      0.700 0.972 0.004 0.012 0.012
#> GSM97146     1  0.1575      0.693 0.956 0.004 0.012 0.028
#> GSM97123     2  0.3128      0.690 0.000 0.884 0.076 0.040
#> GSM97129     1  0.7693      0.386 0.516 0.332 0.028 0.124
#> GSM97143     1  0.6187      0.601 0.672 0.052 0.024 0.252
#> GSM97113     1  0.6287      0.140 0.508 0.448 0.020 0.024
#> GSM97056     1  0.1822      0.707 0.944 0.004 0.008 0.044
#> GSM97124     1  0.3950      0.698 0.820 0.012 0.008 0.160
#> GSM97132     1  0.5725      0.627 0.708 0.032 0.028 0.232
#> GSM97144     1  0.7126      0.586 0.648 0.172 0.040 0.140
#> GSM97149     1  0.1575      0.693 0.956 0.004 0.012 0.028
#> GSM97068     1  0.7087      0.422 0.564 0.336 0.032 0.068
#> GSM97071     2  0.7929      0.321 0.024 0.516 0.188 0.272
#> GSM97086     2  0.4758      0.633 0.000 0.780 0.156 0.064
#> GSM97103     2  0.6055      0.443 0.004 0.604 0.344 0.048
#> GSM97057     1  0.6099      0.305 0.564 0.396 0.016 0.024
#> GSM97060     2  0.5619      0.566 0.000 0.688 0.248 0.064
#> GSM97075     2  0.4416      0.678 0.040 0.832 0.100 0.028
#> GSM97098     2  0.5733      0.493 0.004 0.648 0.308 0.040
#> GSM97099     2  0.5055      0.653 0.096 0.792 0.096 0.016
#> GSM97101     2  0.4994      0.654 0.092 0.796 0.096 0.016
#> GSM97105     2  0.1975      0.693 0.012 0.944 0.028 0.016
#> GSM97106     2  0.4054      0.633 0.000 0.796 0.188 0.016
#> GSM97121     2  0.4830      0.646 0.136 0.800 0.036 0.028
#> GSM97128     4  0.3048      0.776 0.028 0.016 0.056 0.900
#> GSM97131     2  0.2131      0.695 0.000 0.932 0.032 0.036
#> GSM97137     1  0.4821      0.672 0.812 0.088 0.024 0.076
#> GSM97118     1  0.6338      0.525 0.620 0.024 0.040 0.316
#> GSM97114     2  0.5540      0.631 0.132 0.760 0.088 0.020
#> GSM97142     1  0.3539      0.691 0.820 0.000 0.004 0.176
#> GSM97140     2  0.3793      0.690 0.064 0.868 0.024 0.044
#> GSM97141     2  0.4984      0.642 0.132 0.788 0.068 0.012
#> GSM97055     4  0.8120      0.518 0.232 0.116 0.088 0.564
#> GSM97090     1  0.7857      0.236 0.452 0.404 0.040 0.104
#> GSM97091     1  0.3765      0.688 0.812 0.004 0.004 0.180
#> GSM97148     1  0.1575      0.693 0.956 0.004 0.012 0.028
#> GSM97063     1  0.3765      0.688 0.812 0.004 0.004 0.180
#> GSM97053     1  0.2999      0.705 0.864 0.004 0.000 0.132
#> GSM97066     3  0.4944      0.723 0.000 0.160 0.768 0.072
#> GSM97079     2  0.4711      0.639 0.000 0.784 0.152 0.064
#> GSM97083     4  0.3065      0.774 0.032 0.016 0.052 0.900
#> GSM97084     2  0.5457      0.594 0.000 0.728 0.184 0.088
#> GSM97094     2  0.7688      0.506 0.092 0.624 0.160 0.124
#> GSM97096     2  0.6004      0.461 0.004 0.616 0.332 0.048
#> GSM97097     2  0.5200      0.613 0.000 0.744 0.184 0.072
#> GSM97107     2  0.7126      0.540 0.060 0.660 0.168 0.112
#> GSM97054     2  0.7929      0.321 0.024 0.516 0.188 0.272
#> GSM97062     2  0.4829      0.636 0.000 0.776 0.156 0.068
#> GSM97069     3  0.6182      0.617 0.000 0.308 0.616 0.076
#> GSM97070     3  0.4944      0.723 0.000 0.160 0.768 0.072
#> GSM97073     3  0.5265      0.710 0.000 0.160 0.748 0.092
#> GSM97076     3  0.6400      0.658 0.036 0.148 0.708 0.108
#> GSM97077     2  0.3853      0.693 0.052 0.868 0.040 0.040
#> GSM97095     1  0.7314      0.290 0.508 0.388 0.036 0.068
#> GSM97102     2  0.6055      0.443 0.004 0.604 0.344 0.048
#> GSM97109     2  0.6681      0.486 0.036 0.624 0.288 0.052
#> GSM97110     2  0.6681      0.486 0.036 0.624 0.288 0.052
#> GSM97074     3  0.8399      0.195 0.124 0.092 0.528 0.256
#> GSM97085     4  0.6196      0.674 0.024 0.136 0.124 0.716
#> GSM97059     2  0.5781      0.526 0.240 0.700 0.024 0.036
#> GSM97072     3  0.4482      0.628 0.000 0.264 0.728 0.008
#> GSM97078     4  0.3048      0.776 0.028 0.016 0.056 0.900
#> GSM97067     3  0.4776      0.721 0.000 0.164 0.776 0.060
#> GSM97087     2  0.6355      0.512 0.004 0.656 0.228 0.112
#> GSM97111     2  0.6128      0.589 0.044 0.708 0.200 0.048
#> GSM97064     2  0.2555      0.696 0.008 0.920 0.040 0.032
#> GSM97065     3  0.7494      0.508 0.048 0.332 0.544 0.076
#> GSM97081     2  0.6142      0.562 0.024 0.684 0.236 0.056
#> GSM97082     2  0.6565      0.488 0.004 0.640 0.224 0.132
#> GSM97088     4  0.6770      0.626 0.036 0.168 0.120 0.676
#> GSM97100     2  0.3301      0.694 0.040 0.892 0.024 0.044
#> GSM97104     2  0.5894      0.285 0.000 0.568 0.392 0.040
#> GSM97108     2  0.5126      0.668 0.088 0.800 0.072 0.040
#> GSM97050     2  0.2036      0.693 0.000 0.936 0.032 0.032
#> GSM97080     3  0.6179      0.411 0.000 0.392 0.552 0.056
#> GSM97089     2  0.6355      0.512 0.004 0.656 0.228 0.112
#> GSM97092     2  0.5594      0.578 0.000 0.716 0.192 0.092
#> GSM97093     2  0.8124      0.450 0.172 0.584 0.100 0.144
#> GSM97058     2  0.2719      0.696 0.024 0.916 0.040 0.020
#> GSM97051     2  0.2500      0.693 0.000 0.916 0.044 0.040
#> GSM97052     2  0.4881      0.603 0.000 0.756 0.196 0.048
#> GSM97061     2  0.2845      0.682 0.000 0.896 0.076 0.028

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1   0.233     0.7254 0.908 0.004 0.000 0.024 0.064
#> GSM97145     1   0.207     0.7289 0.932 0.024 0.008 0.008 0.028
#> GSM97147     2   0.493     0.3819 0.196 0.736 0.008 0.036 0.024
#> GSM97125     1   0.215     0.7293 0.928 0.024 0.008 0.008 0.032
#> GSM97127     1   0.211     0.7296 0.928 0.032 0.004 0.008 0.028
#> GSM97130     1   0.573     0.6440 0.712 0.092 0.004 0.128 0.064
#> GSM97133     1   0.199     0.7189 0.936 0.012 0.008 0.028 0.016
#> GSM97134     1   0.692     0.4346 0.528 0.316 0.004 0.064 0.088
#> GSM97120     1   0.193     0.7189 0.936 0.004 0.008 0.032 0.020
#> GSM97126     1   0.724     0.4690 0.544 0.260 0.016 0.052 0.128
#> GSM97112     1   0.288     0.7063 0.848 0.004 0.004 0.000 0.144
#> GSM97115     1   0.696     0.3554 0.484 0.352 0.000 0.108 0.056
#> GSM97116     1   0.247     0.7127 0.908 0.000 0.012 0.040 0.040
#> GSM97117     2   0.464     0.4656 0.140 0.772 0.068 0.016 0.004
#> GSM97119     1   0.288     0.7063 0.848 0.004 0.004 0.000 0.144
#> GSM97122     1   0.288     0.7063 0.848 0.004 0.004 0.000 0.144
#> GSM97135     1   0.283     0.7076 0.852 0.004 0.004 0.000 0.140
#> GSM97136     1   0.824     0.3155 0.468 0.232 0.072 0.040 0.188
#> GSM97139     1   0.209     0.7112 0.928 0.004 0.008 0.040 0.020
#> GSM97146     1   0.281     0.6970 0.896 0.004 0.016 0.048 0.036
#> GSM97123     2   0.469     0.3874 0.000 0.740 0.056 0.192 0.012
#> GSM97129     1   0.692     0.4346 0.528 0.316 0.004 0.064 0.088
#> GSM97143     1   0.541     0.6250 0.700 0.056 0.020 0.012 0.212
#> GSM97113     1   0.553     0.1583 0.492 0.464 0.012 0.016 0.016
#> GSM97056     1   0.258     0.7125 0.908 0.004 0.016 0.036 0.036
#> GSM97124     1   0.317     0.7124 0.844 0.020 0.004 0.000 0.132
#> GSM97132     1   0.509     0.6491 0.728 0.032 0.020 0.020 0.200
#> GSM97144     1   0.618     0.6169 0.668 0.124 0.000 0.124 0.084
#> GSM97149     1   0.281     0.6970 0.896 0.004 0.016 0.048 0.036
#> GSM97068     1   0.668     0.4551 0.548 0.316 0.008 0.088 0.040
#> GSM97071     4   0.791     0.2662 0.024 0.340 0.040 0.396 0.200
#> GSM97086     2   0.441     0.0149 0.000 0.604 0.000 0.388 0.008
#> GSM97103     2   0.744     0.0906 0.004 0.388 0.300 0.284 0.024
#> GSM97057     1   0.556     0.3122 0.544 0.408 0.012 0.016 0.020
#> GSM97060     4   0.727     0.1289 0.000 0.332 0.144 0.464 0.060
#> GSM97075     2   0.484     0.4973 0.036 0.788 0.096 0.060 0.020
#> GSM97098     2   0.713     0.1936 0.004 0.456 0.276 0.248 0.016
#> GSM97099     2   0.473     0.4917 0.100 0.784 0.072 0.040 0.004
#> GSM97101     2   0.468     0.4926 0.096 0.788 0.072 0.040 0.004
#> GSM97105     2   0.189     0.4824 0.012 0.936 0.008 0.040 0.004
#> GSM97106     2   0.623    -0.0234 0.000 0.480 0.092 0.412 0.016
#> GSM97121     2   0.413     0.4109 0.136 0.800 0.008 0.052 0.004
#> GSM97128     5   0.241     0.7898 0.028 0.016 0.044 0.000 0.912
#> GSM97131     2   0.344     0.4464 0.000 0.824 0.024 0.148 0.004
#> GSM97137     1   0.459     0.6877 0.796 0.060 0.008 0.100 0.036
#> GSM97118     1   0.566     0.5484 0.644 0.024 0.040 0.012 0.280
#> GSM97114     2   0.464     0.4656 0.140 0.772 0.068 0.016 0.004
#> GSM97142     1   0.288     0.7063 0.848 0.004 0.004 0.000 0.144
#> GSM97140     2   0.319     0.4775 0.064 0.876 0.004 0.032 0.024
#> GSM97141     2   0.411     0.4717 0.136 0.800 0.048 0.016 0.000
#> GSM97055     5   0.776     0.5359 0.240 0.100 0.076 0.048 0.536
#> GSM97090     1   0.703     0.3250 0.464 0.368 0.000 0.112 0.056
#> GSM97091     1   0.304     0.7038 0.840 0.008 0.004 0.000 0.148
#> GSM97148     1   0.281     0.6970 0.896 0.004 0.016 0.048 0.036
#> GSM97063     1   0.304     0.7038 0.840 0.008 0.004 0.000 0.148
#> GSM97053     1   0.241     0.7201 0.884 0.008 0.000 0.000 0.108
#> GSM97066     3   0.194     0.7019 0.000 0.068 0.920 0.000 0.012
#> GSM97079     2   0.430     0.0481 0.000 0.608 0.000 0.388 0.004
#> GSM97083     5   0.258     0.7861 0.040 0.016 0.040 0.000 0.904
#> GSM97084     4   0.456     0.1082 0.000 0.484 0.000 0.508 0.008
#> GSM97094     4   0.679     0.1904 0.100 0.404 0.000 0.452 0.044
#> GSM97096     2   0.740     0.1208 0.004 0.408 0.288 0.276 0.024
#> GSM97097     2   0.475    -0.1794 0.000 0.500 0.016 0.484 0.000
#> GSM97107     4   0.621     0.1872 0.068 0.424 0.000 0.480 0.028
#> GSM97054     4   0.791     0.2662 0.024 0.340 0.040 0.396 0.200
#> GSM97062     2   0.443     0.0271 0.000 0.600 0.000 0.392 0.008
#> GSM97069     3   0.554     0.6227 0.000 0.136 0.704 0.128 0.032
#> GSM97070     3   0.194     0.7019 0.000 0.068 0.920 0.000 0.012
#> GSM97073     3   0.286     0.6901 0.000 0.076 0.884 0.016 0.024
#> GSM97076     3   0.402     0.6484 0.040 0.068 0.840 0.024 0.028
#> GSM97077     2   0.366     0.4968 0.048 0.860 0.020 0.048 0.024
#> GSM97095     1   0.675     0.3419 0.500 0.368 0.008 0.088 0.036
#> GSM97102     2   0.744     0.0906 0.004 0.388 0.300 0.284 0.024
#> GSM97109     2   0.765     0.2562 0.040 0.484 0.276 0.176 0.024
#> GSM97110     2   0.765     0.2562 0.040 0.484 0.276 0.176 0.024
#> GSM97074     3   0.678     0.2853 0.140 0.060 0.612 0.008 0.180
#> GSM97085     5   0.591     0.7059 0.016 0.100 0.084 0.084 0.716
#> GSM97059     2   0.489     0.3219 0.236 0.712 0.008 0.028 0.016
#> GSM97072     3   0.515     0.6322 0.000 0.100 0.720 0.164 0.016
#> GSM97078     5   0.241     0.7898 0.028 0.016 0.044 0.000 0.912
#> GSM97067     3   0.258     0.7047 0.000 0.084 0.892 0.016 0.008
#> GSM97087     4   0.786     0.1329 0.000 0.360 0.144 0.380 0.116
#> GSM97111     2   0.612     0.4280 0.048 0.672 0.192 0.072 0.016
#> GSM97064     2   0.373     0.4666 0.008 0.832 0.036 0.116 0.008
#> GSM97065     3   0.635     0.4693 0.052 0.264 0.620 0.028 0.036
#> GSM97081     2   0.656     0.3767 0.028 0.624 0.216 0.108 0.024
#> GSM97082     4   0.813     0.1219 0.004 0.344 0.160 0.368 0.124
#> GSM97088     5   0.637     0.6775 0.028 0.104 0.084 0.096 0.688
#> GSM97100     2   0.276     0.4831 0.040 0.900 0.004 0.036 0.020
#> GSM97104     3   0.767     0.0261 0.000 0.276 0.352 0.324 0.048
#> GSM97108     2   0.505     0.4966 0.088 0.780 0.056 0.052 0.024
#> GSM97050     2   0.281     0.4599 0.000 0.872 0.012 0.108 0.008
#> GSM97080     3   0.646     0.5149 0.000 0.180 0.600 0.188 0.032
#> GSM97089     4   0.786     0.1329 0.000 0.360 0.144 0.380 0.116
#> GSM97092     2   0.732    -0.0817 0.000 0.452 0.116 0.352 0.080
#> GSM97093     2   0.842     0.1102 0.176 0.500 0.060 0.144 0.120
#> GSM97058     2   0.305     0.4956 0.020 0.884 0.024 0.064 0.008
#> GSM97051     2   0.356     0.4301 0.000 0.804 0.012 0.176 0.008
#> GSM97052     2   0.683    -0.0844 0.000 0.460 0.112 0.388 0.040
#> GSM97061     2   0.441     0.3865 0.000 0.764 0.048 0.176 0.012

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1   0.283     0.7381 0.876 0.004 0.000 0.056 0.052 0.012
#> GSM97145     1   0.160     0.7416 0.944 0.020 0.000 0.020 0.012 0.004
#> GSM97147     2   0.517     0.4844 0.192 0.704 0.012 0.052 0.024 0.016
#> GSM97125     1   0.169     0.7420 0.940 0.020 0.000 0.020 0.016 0.004
#> GSM97127     1   0.162     0.7421 0.940 0.028 0.000 0.020 0.012 0.000
#> GSM97130     1   0.566     0.6514 0.688 0.068 0.012 0.160 0.056 0.016
#> GSM97133     1   0.239     0.7279 0.900 0.012 0.000 0.064 0.008 0.016
#> GSM97134     1   0.641     0.4233 0.540 0.300 0.004 0.068 0.076 0.012
#> GSM97120     1   0.215     0.7290 0.916 0.004 0.004 0.052 0.012 0.012
#> GSM97126     1   0.666     0.4965 0.556 0.244 0.004 0.056 0.116 0.024
#> GSM97112     1   0.242     0.7248 0.864 0.004 0.000 0.000 0.128 0.004
#> GSM97115     1   0.676     0.3105 0.480 0.308 0.008 0.156 0.040 0.008
#> GSM97116     1   0.338     0.7140 0.844 0.000 0.008 0.088 0.036 0.024
#> GSM97117     2   0.444     0.5640 0.140 0.760 0.008 0.024 0.000 0.068
#> GSM97119     1   0.242     0.7248 0.864 0.004 0.000 0.000 0.128 0.004
#> GSM97122     1   0.242     0.7248 0.864 0.004 0.000 0.000 0.128 0.004
#> GSM97135     1   0.238     0.7260 0.868 0.004 0.000 0.000 0.124 0.004
#> GSM97136     1   0.776     0.3582 0.480 0.208 0.036 0.020 0.168 0.088
#> GSM97139     1   0.268     0.7171 0.884 0.004 0.004 0.076 0.012 0.020
#> GSM97146     1   0.375     0.6859 0.824 0.004 0.024 0.104 0.016 0.028
#> GSM97123     2   0.470     0.2268 0.000 0.624 0.316 0.056 0.000 0.004
#> GSM97129     1   0.641     0.4233 0.540 0.300 0.004 0.068 0.076 0.012
#> GSM97143     1   0.483     0.6460 0.712 0.044 0.000 0.008 0.196 0.040
#> GSM97113     2   0.595    -0.0971 0.440 0.456 0.016 0.064 0.008 0.016
#> GSM97056     1   0.316     0.7174 0.868 0.004 0.020 0.064 0.016 0.028
#> GSM97124     1   0.273     0.7299 0.860 0.016 0.000 0.004 0.116 0.004
#> GSM97132     1   0.477     0.6687 0.724 0.020 0.000 0.028 0.188 0.040
#> GSM97144     1   0.549     0.6197 0.680 0.080 0.004 0.168 0.064 0.004
#> GSM97149     1   0.375     0.6859 0.824 0.004 0.024 0.104 0.016 0.028
#> GSM97068     1   0.633     0.4252 0.536 0.312 0.012 0.100 0.028 0.012
#> GSM97071     4   0.757     0.5005 0.024 0.140 0.136 0.520 0.156 0.024
#> GSM97086     2   0.440    -0.2454 0.000 0.508 0.024 0.468 0.000 0.000
#> GSM97103     3   0.646     0.5146 0.004 0.248 0.476 0.016 0.004 0.252
#> GSM97057     1   0.600     0.2187 0.492 0.400 0.020 0.064 0.008 0.016
#> GSM97060     3   0.398     0.6238 0.000 0.128 0.792 0.052 0.004 0.024
#> GSM97075     2   0.482     0.5492 0.036 0.764 0.068 0.016 0.012 0.104
#> GSM97098     2   0.672    -0.3740 0.004 0.364 0.352 0.028 0.000 0.252
#> GSM97099     2   0.468     0.5826 0.096 0.764 0.032 0.024 0.000 0.084
#> GSM97101     2   0.463     0.5829 0.092 0.768 0.032 0.024 0.000 0.084
#> GSM97105     2   0.207     0.5768 0.012 0.920 0.036 0.028 0.000 0.004
#> GSM97106     3   0.439     0.6290 0.000 0.300 0.652 0.048 0.000 0.000
#> GSM97121     2   0.408     0.5094 0.136 0.784 0.008 0.060 0.004 0.008
#> GSM97128     5   0.112     0.7707 0.004 0.008 0.008 0.000 0.964 0.016
#> GSM97131     2   0.423     0.4604 0.000 0.736 0.180 0.080 0.000 0.004
#> GSM97137     1   0.444     0.7000 0.780 0.048 0.012 0.124 0.020 0.016
#> GSM97118     1   0.505     0.5754 0.652 0.016 0.000 0.008 0.264 0.060
#> GSM97114     2   0.444     0.5640 0.140 0.760 0.008 0.024 0.000 0.068
#> GSM97142     1   0.242     0.7248 0.864 0.004 0.000 0.000 0.128 0.004
#> GSM97140     2   0.347     0.5728 0.064 0.852 0.024 0.036 0.020 0.004
#> GSM97141     2   0.403     0.5710 0.136 0.788 0.008 0.020 0.000 0.048
#> GSM97055     5   0.736     0.4868 0.236 0.084 0.064 0.012 0.524 0.080
#> GSM97090     1   0.674     0.2838 0.460 0.332 0.004 0.152 0.044 0.008
#> GSM97091     1   0.250     0.7221 0.856 0.004 0.000 0.000 0.136 0.004
#> GSM97148     1   0.375     0.6859 0.824 0.004 0.024 0.104 0.016 0.028
#> GSM97063     1   0.250     0.7221 0.856 0.004 0.000 0.000 0.136 0.004
#> GSM97053     1   0.216     0.7367 0.892 0.008 0.000 0.004 0.096 0.000
#> GSM97066     6   0.195     0.7525 0.000 0.012 0.072 0.000 0.004 0.912
#> GSM97079     2   0.440    -0.2043 0.000 0.516 0.024 0.460 0.000 0.000
#> GSM97083     5   0.132     0.7675 0.016 0.008 0.004 0.000 0.956 0.016
#> GSM97084     4   0.398     0.6712 0.000 0.284 0.020 0.692 0.000 0.004
#> GSM97094     4   0.617     0.6726 0.104 0.240 0.020 0.596 0.036 0.004
#> GSM97096     3   0.655     0.4837 0.004 0.288 0.444 0.016 0.004 0.244
#> GSM97097     4   0.491     0.6351 0.000 0.304 0.068 0.620 0.000 0.008
#> GSM97107     4   0.555     0.7049 0.068 0.236 0.024 0.648 0.020 0.004
#> GSM97054     4   0.757     0.5005 0.024 0.140 0.136 0.520 0.156 0.024
#> GSM97062     2   0.434    -0.2488 0.000 0.496 0.020 0.484 0.000 0.000
#> GSM97069     6   0.452     0.5395 0.000 0.048 0.300 0.000 0.004 0.648
#> GSM97070     6   0.195     0.7525 0.000 0.012 0.072 0.000 0.004 0.912
#> GSM97073     6   0.186     0.7460 0.000 0.016 0.044 0.004 0.008 0.928
#> GSM97076     6   0.194     0.7165 0.040 0.016 0.004 0.004 0.008 0.928
#> GSM97077     2   0.385     0.5921 0.048 0.840 0.024 0.040 0.024 0.024
#> GSM97095     1   0.644     0.3056 0.484 0.360 0.008 0.108 0.024 0.016
#> GSM97102     3   0.646     0.5146 0.004 0.248 0.476 0.016 0.004 0.252
#> GSM97109     2   0.712    -0.1747 0.040 0.408 0.280 0.012 0.004 0.256
#> GSM97110     2   0.712    -0.1747 0.040 0.408 0.280 0.012 0.004 0.256
#> GSM97074     6   0.497     0.3987 0.160 0.012 0.000 0.000 0.148 0.680
#> GSM97085     5   0.530     0.7031 0.008 0.056 0.144 0.008 0.712 0.072
#> GSM97059     2   0.486     0.4342 0.224 0.700 0.008 0.040 0.016 0.012
#> GSM97072     6   0.457     0.5797 0.000 0.020 0.304 0.020 0.004 0.652
#> GSM97078     5   0.112     0.7707 0.004 0.008 0.008 0.000 0.964 0.016
#> GSM97067     6   0.235     0.7466 0.000 0.020 0.100 0.000 0.000 0.880
#> GSM97087     3   0.490     0.6894 0.000 0.204 0.696 0.004 0.072 0.024
#> GSM97111     2   0.612     0.4016 0.048 0.632 0.084 0.024 0.008 0.204
#> GSM97064     2   0.383     0.5128 0.008 0.808 0.128 0.036 0.008 0.012
#> GSM97065     6   0.519     0.4336 0.048 0.228 0.016 0.016 0.012 0.680
#> GSM97081     2   0.634     0.2517 0.028 0.588 0.140 0.020 0.008 0.216
#> GSM97082     3   0.566     0.6771 0.004 0.184 0.664 0.008 0.080 0.060
#> GSM97088     5   0.529     0.6633 0.012 0.068 0.172 0.004 0.700 0.044
#> GSM97100     2   0.309     0.5764 0.040 0.876 0.024 0.036 0.020 0.004
#> GSM97104     3   0.555     0.4559 0.000 0.136 0.608 0.008 0.008 0.240
#> GSM97108     2   0.530     0.5919 0.088 0.744 0.040 0.036 0.020 0.072
#> GSM97050     2   0.301     0.5379 0.000 0.844 0.068 0.088 0.000 0.000
#> GSM97080     6   0.542     0.3043 0.000 0.084 0.368 0.004 0.008 0.536
#> GSM97089     3   0.490     0.6894 0.000 0.204 0.696 0.004 0.072 0.024
#> GSM97092     3   0.521     0.6211 0.000 0.312 0.612 0.016 0.044 0.016
#> GSM97093     2   0.833     0.1705 0.172 0.428 0.200 0.088 0.096 0.016
#> GSM97058     2   0.316     0.5716 0.020 0.868 0.068 0.020 0.008 0.016
#> GSM97051     2   0.405     0.4558 0.000 0.752 0.152 0.096 0.000 0.000
#> GSM97052     3   0.417     0.6651 0.000 0.288 0.684 0.012 0.004 0.012
#> GSM97061     2   0.429     0.2826 0.000 0.684 0.276 0.032 0.004 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)

plot of chunk tab-CV-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-hclust-membership-heatmap-5

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)

plot of chunk tab-CV-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-CV-hclust-get-signatures-no-scale-1

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

plot of chunk tab-CV-hclust-get-signatures-no-scale-2

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

plot of chunk tab-CV-hclust-get-signatures-no-scale-3

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

plot of chunk tab-CV-hclust-get-signatures-no-scale-4

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

plot of chunk tab-CV-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-hclust-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-CV-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-hclust-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:hclust 90         6.48e-08       1.000     1.15e-16   0.0559 2
#> CV:hclust 89         2.43e-06       0.956     3.86e-15   0.2565 3
#> CV:hclust 77         5.86e-05       0.460     7.45e-14   0.3050 4
#> CV:hclust 41         4.10e-04       0.341     1.08e-07   0.3823 5
#> CV:hclust 69         2.07e-04       0.595     1.65e-16   0.1259 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.


CV:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "kmeans"]
# 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 21512 rows and 100 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)

plot of chunk CV-kmeans-collect-plots

The plots are:

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:

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)

plot of chunk CV-kmeans-select-partition-number

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.704           0.885       0.937         0.4923 0.505   0.505
#> 3 3 0.656           0.834       0.889         0.3295 0.697   0.472
#> 4 4 0.604           0.577       0.782         0.1225 0.864   0.632
#> 5 5 0.609           0.528       0.716         0.0684 0.896   0.644
#> 6 6 0.667           0.430       0.693         0.0440 0.889   0.563

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.946 1.000 0.000
#> GSM97145     1  0.0000      0.946 1.000 0.000
#> GSM97147     1  0.2603      0.921 0.956 0.044
#> GSM97125     1  0.0000      0.946 1.000 0.000
#> GSM97127     1  0.0376      0.945 0.996 0.004
#> GSM97130     1  0.0376      0.945 0.996 0.004
#> GSM97133     1  0.0376      0.945 0.996 0.004
#> GSM97134     1  0.0000      0.946 1.000 0.000
#> GSM97120     1  0.0000      0.946 1.000 0.000
#> GSM97126     1  0.0000      0.946 1.000 0.000
#> GSM97112     1  0.0000      0.946 1.000 0.000
#> GSM97115     1  0.0938      0.942 0.988 0.012
#> GSM97116     1  0.0000      0.946 1.000 0.000
#> GSM97117     2  0.7883      0.777 0.236 0.764
#> GSM97119     1  0.0000      0.946 1.000 0.000
#> GSM97122     1  0.0000      0.946 1.000 0.000
#> GSM97135     1  0.0000      0.946 1.000 0.000
#> GSM97136     2  0.6531      0.822 0.168 0.832
#> GSM97139     1  0.0000      0.946 1.000 0.000
#> GSM97146     1  0.0000      0.946 1.000 0.000
#> GSM97123     2  0.0000      0.918 0.000 1.000
#> GSM97129     2  0.7815      0.781 0.232 0.768
#> GSM97143     1  0.0000      0.946 1.000 0.000
#> GSM97113     2  0.8144      0.753 0.252 0.748
#> GSM97056     1  0.0376      0.945 0.996 0.004
#> GSM97124     1  0.0000      0.946 1.000 0.000
#> GSM97132     1  0.0000      0.946 1.000 0.000
#> GSM97144     1  0.0376      0.945 0.996 0.004
#> GSM97149     1  0.0376      0.945 0.996 0.004
#> GSM97068     1  0.9427      0.361 0.640 0.360
#> GSM97071     2  0.0376      0.918 0.004 0.996
#> GSM97086     2  0.2778      0.915 0.048 0.952
#> GSM97103     2  0.2778      0.915 0.048 0.952
#> GSM97057     2  0.8499      0.718 0.276 0.724
#> GSM97060     2  0.0000      0.918 0.000 1.000
#> GSM97075     2  0.0000      0.918 0.000 1.000
#> GSM97098     2  0.0000      0.918 0.000 1.000
#> GSM97099     2  0.7815      0.778 0.232 0.768
#> GSM97101     2  0.7815      0.778 0.232 0.768
#> GSM97105     2  0.2778      0.915 0.048 0.952
#> GSM97106     2  0.0000      0.918 0.000 1.000
#> GSM97121     2  0.7528      0.794 0.216 0.784
#> GSM97128     1  0.9000      0.598 0.684 0.316
#> GSM97131     2  0.2778      0.915 0.048 0.952
#> GSM97137     1  0.0376      0.945 0.996 0.004
#> GSM97118     1  0.0000      0.946 1.000 0.000
#> GSM97114     2  0.8386      0.730 0.268 0.732
#> GSM97142     1  0.0000      0.946 1.000 0.000
#> GSM97140     2  0.7815      0.778 0.232 0.768
#> GSM97141     2  0.7815      0.778 0.232 0.768
#> GSM97055     1  0.2778      0.914 0.952 0.048
#> GSM97090     1  0.0938      0.942 0.988 0.012
#> GSM97091     1  0.2778      0.914 0.952 0.048
#> GSM97148     1  0.0376      0.945 0.996 0.004
#> GSM97063     1  0.2603      0.917 0.956 0.044
#> GSM97053     1  0.0000      0.946 1.000 0.000
#> GSM97066     2  0.0376      0.918 0.004 0.996
#> GSM97079     2  0.2423      0.917 0.040 0.960
#> GSM97083     1  0.3274      0.907 0.940 0.060
#> GSM97084     2  0.2778      0.915 0.048 0.952
#> GSM97094     1  0.3584      0.902 0.932 0.068
#> GSM97096     2  0.0000      0.918 0.000 1.000
#> GSM97097     2  0.2778      0.915 0.048 0.952
#> GSM97107     1  0.3584      0.902 0.932 0.068
#> GSM97054     2  0.2778      0.915 0.048 0.952
#> GSM97062     2  0.2778      0.915 0.048 0.952
#> GSM97069     2  0.0376      0.918 0.004 0.996
#> GSM97070     2  0.0376      0.918 0.004 0.996
#> GSM97073     2  0.0376      0.918 0.004 0.996
#> GSM97076     1  0.4161      0.883 0.916 0.084
#> GSM97077     2  0.2423      0.917 0.040 0.960
#> GSM97095     1  0.2778      0.918 0.952 0.048
#> GSM97102     2  0.0376      0.918 0.004 0.996
#> GSM97109     2  0.7815      0.778 0.232 0.768
#> GSM97110     2  0.6973      0.821 0.188 0.812
#> GSM97074     1  0.8207      0.684 0.744 0.256
#> GSM97085     2  0.3584      0.880 0.068 0.932
#> GSM97059     1  0.6712      0.762 0.824 0.176
#> GSM97072     2  0.0376      0.918 0.004 0.996
#> GSM97078     1  0.9795      0.387 0.584 0.416
#> GSM97067     2  0.0376      0.918 0.004 0.996
#> GSM97087     2  0.0376      0.918 0.004 0.996
#> GSM97111     2  0.4298      0.895 0.088 0.912
#> GSM97064     2  0.0000      0.918 0.000 1.000
#> GSM97065     2  0.0376      0.918 0.004 0.996
#> GSM97081     2  0.0000      0.918 0.000 1.000
#> GSM97082     2  0.0376      0.918 0.004 0.996
#> GSM97088     2  0.5178      0.835 0.116 0.884
#> GSM97100     2  0.3274      0.910 0.060 0.940
#> GSM97104     2  0.0376      0.918 0.004 0.996
#> GSM97108     2  0.7815      0.778 0.232 0.768
#> GSM97050     2  0.2423      0.917 0.040 0.960
#> GSM97080     2  0.0376      0.918 0.004 0.996
#> GSM97089     2  0.0376      0.918 0.004 0.996
#> GSM97092     2  0.0000      0.918 0.000 1.000
#> GSM97093     2  0.2423      0.917 0.040 0.960
#> GSM97058     2  0.2423      0.917 0.040 0.960
#> GSM97051     2  0.2236      0.917 0.036 0.964
#> GSM97052     2  0.0000      0.918 0.000 1.000
#> GSM97061     2  0.0000      0.918 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.2356     0.9293 0.928 0.072 0.000
#> GSM97145     1  0.2537     0.9275 0.920 0.080 0.000
#> GSM97147     2  0.1267     0.8278 0.024 0.972 0.004
#> GSM97125     1  0.0747     0.9328 0.984 0.016 0.000
#> GSM97127     1  0.2537     0.9275 0.920 0.080 0.000
#> GSM97130     1  0.4002     0.8962 0.840 0.160 0.000
#> GSM97133     1  0.2711     0.9253 0.912 0.088 0.000
#> GSM97134     1  0.2625     0.8999 0.916 0.084 0.000
#> GSM97120     1  0.2711     0.9253 0.912 0.088 0.000
#> GSM97126     1  0.3715     0.8870 0.868 0.128 0.004
#> GSM97112     1  0.0592     0.9304 0.988 0.000 0.012
#> GSM97115     2  0.3267     0.7453 0.116 0.884 0.000
#> GSM97116     1  0.2711     0.9253 0.912 0.088 0.000
#> GSM97117     2  0.3879     0.8794 0.000 0.848 0.152
#> GSM97119     1  0.0592     0.9304 0.988 0.000 0.012
#> GSM97122     1  0.0592     0.9304 0.988 0.000 0.012
#> GSM97135     1  0.0592     0.9304 0.988 0.000 0.012
#> GSM97136     3  0.4891     0.7895 0.040 0.124 0.836
#> GSM97139     1  0.2711     0.9253 0.912 0.088 0.000
#> GSM97146     1  0.2711     0.9253 0.912 0.088 0.000
#> GSM97123     2  0.5465     0.7546 0.000 0.712 0.288
#> GSM97129     2  0.3752     0.8819 0.000 0.856 0.144
#> GSM97143     1  0.0592     0.9304 0.988 0.000 0.012
#> GSM97113     2  0.2625     0.8658 0.000 0.916 0.084
#> GSM97056     1  0.2796     0.9245 0.908 0.092 0.000
#> GSM97124     1  0.0000     0.9317 1.000 0.000 0.000
#> GSM97132     1  0.1753     0.9192 0.952 0.048 0.000
#> GSM97144     1  0.2537     0.9021 0.920 0.080 0.000
#> GSM97149     1  0.2711     0.9253 0.912 0.088 0.000
#> GSM97068     2  0.0747     0.8248 0.016 0.984 0.000
#> GSM97071     3  0.4209     0.8155 0.020 0.120 0.860
#> GSM97086     2  0.2448     0.8693 0.000 0.924 0.076
#> GSM97103     2  0.5431     0.7566 0.000 0.716 0.284
#> GSM97057     2  0.1482     0.8384 0.012 0.968 0.020
#> GSM97060     3  0.0747     0.8794 0.000 0.016 0.984
#> GSM97075     2  0.4062     0.8742 0.000 0.836 0.164
#> GSM97098     2  0.5560     0.7382 0.000 0.700 0.300
#> GSM97099     2  0.3686     0.8828 0.000 0.860 0.140
#> GSM97101     2  0.3619     0.8837 0.000 0.864 0.136
#> GSM97105     2  0.3752     0.8827 0.000 0.856 0.144
#> GSM97106     3  0.6299    -0.1763 0.000 0.476 0.524
#> GSM97121     2  0.3619     0.8837 0.000 0.864 0.136
#> GSM97128     3  0.6109     0.7214 0.140 0.080 0.780
#> GSM97131     2  0.4062     0.8725 0.000 0.836 0.164
#> GSM97137     1  0.3267     0.9194 0.884 0.116 0.000
#> GSM97118     1  0.2446     0.9149 0.936 0.052 0.012
#> GSM97114     2  0.3120     0.8605 0.012 0.908 0.080
#> GSM97142     1  0.0592     0.9304 0.988 0.000 0.012
#> GSM97140     2  0.2261     0.8720 0.000 0.932 0.068
#> GSM97141     2  0.3686     0.8828 0.000 0.860 0.140
#> GSM97055     1  0.1878     0.9154 0.952 0.004 0.044
#> GSM97090     2  0.4887     0.5987 0.228 0.772 0.000
#> GSM97091     1  0.0592     0.9304 0.988 0.000 0.012
#> GSM97148     1  0.2711     0.9253 0.912 0.088 0.000
#> GSM97063     1  0.0592     0.9304 0.988 0.000 0.012
#> GSM97053     1  0.0000     0.9317 1.000 0.000 0.000
#> GSM97066     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97079     2  0.3116     0.8778 0.000 0.892 0.108
#> GSM97083     1  0.4146     0.8785 0.876 0.080 0.044
#> GSM97084     2  0.3031     0.8649 0.012 0.912 0.076
#> GSM97094     2  0.5873     0.5315 0.312 0.684 0.004
#> GSM97096     3  0.4796     0.6390 0.000 0.220 0.780
#> GSM97097     2  0.4750     0.8348 0.000 0.784 0.216
#> GSM97107     2  0.6359     0.2986 0.404 0.592 0.004
#> GSM97054     2  0.2448     0.8693 0.000 0.924 0.076
#> GSM97062     2  0.2537     0.8691 0.000 0.920 0.080
#> GSM97069     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97070     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97073     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97076     1  0.7816     0.4814 0.628 0.084 0.288
#> GSM97077     2  0.3116     0.8786 0.000 0.892 0.108
#> GSM97095     2  0.2711     0.7735 0.088 0.912 0.000
#> GSM97102     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97109     2  0.3851     0.8833 0.004 0.860 0.136
#> GSM97110     2  0.3686     0.8828 0.000 0.860 0.140
#> GSM97074     3  0.5875     0.7153 0.160 0.056 0.784
#> GSM97085     3  0.3129     0.8174 0.088 0.008 0.904
#> GSM97059     2  0.0747     0.8248 0.016 0.984 0.000
#> GSM97072     3  0.0747     0.8794 0.000 0.016 0.984
#> GSM97078     3  0.6109     0.7214 0.140 0.080 0.780
#> GSM97067     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97087     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97111     2  0.3752     0.8819 0.000 0.856 0.144
#> GSM97064     2  0.4178     0.8693 0.000 0.828 0.172
#> GSM97065     3  0.6267     0.0329 0.000 0.452 0.548
#> GSM97081     3  0.4291     0.7066 0.000 0.180 0.820
#> GSM97082     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97088     3  0.5093     0.7721 0.088 0.076 0.836
#> GSM97100     2  0.2261     0.8720 0.000 0.932 0.068
#> GSM97104     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97108     2  0.3551     0.8845 0.000 0.868 0.132
#> GSM97050     2  0.3816     0.8799 0.000 0.852 0.148
#> GSM97080     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97089     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97092     3  0.0592     0.8810 0.000 0.012 0.988
#> GSM97093     2  0.3619     0.8825 0.000 0.864 0.136
#> GSM97058     2  0.4062     0.8740 0.000 0.836 0.164
#> GSM97051     2  0.3551     0.8796 0.000 0.868 0.132
#> GSM97052     3  0.0747     0.8787 0.000 0.016 0.984
#> GSM97061     2  0.5621     0.7255 0.000 0.692 0.308

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.1256     0.7523 0.964 0.008 0.000 0.028
#> GSM97145     1  0.3102     0.7641 0.872 0.008 0.004 0.116
#> GSM97147     2  0.2742     0.7850 0.024 0.900 0.000 0.076
#> GSM97125     1  0.3538     0.7651 0.832 0.004 0.004 0.160
#> GSM97127     1  0.1042     0.7522 0.972 0.008 0.000 0.020
#> GSM97130     1  0.5678     0.0401 0.524 0.024 0.000 0.452
#> GSM97133     1  0.0336     0.7450 0.992 0.008 0.000 0.000
#> GSM97134     4  0.4483     0.0619 0.284 0.004 0.000 0.712
#> GSM97120     1  0.0336     0.7450 0.992 0.008 0.000 0.000
#> GSM97126     1  0.7344     0.4535 0.528 0.224 0.000 0.248
#> GSM97112     1  0.4713     0.7410 0.700 0.004 0.004 0.292
#> GSM97115     4  0.6658     0.0806 0.084 0.444 0.000 0.472
#> GSM97116     1  0.0336     0.7450 0.992 0.008 0.000 0.000
#> GSM97117     2  0.2214     0.7801 0.028 0.928 0.044 0.000
#> GSM97119     1  0.4713     0.7410 0.700 0.004 0.004 0.292
#> GSM97122     1  0.4661     0.7446 0.708 0.004 0.004 0.284
#> GSM97135     1  0.4579     0.7485 0.720 0.004 0.004 0.272
#> GSM97136     3  0.7609     0.1739 0.004 0.396 0.428 0.172
#> GSM97139     1  0.0336     0.7450 0.992 0.008 0.000 0.000
#> GSM97146     1  0.0336     0.7450 0.992 0.008 0.000 0.000
#> GSM97123     2  0.6369     0.3237 0.000 0.572 0.352 0.076
#> GSM97129     2  0.1471     0.7933 0.024 0.960 0.004 0.012
#> GSM97143     1  0.4687     0.7425 0.704 0.004 0.004 0.288
#> GSM97113     2  0.2149     0.7668 0.088 0.912 0.000 0.000
#> GSM97056     1  0.3450     0.6010 0.836 0.008 0.000 0.156
#> GSM97124     1  0.4579     0.7481 0.720 0.004 0.004 0.272
#> GSM97132     1  0.4933     0.5678 0.568 0.000 0.000 0.432
#> GSM97144     4  0.5062     0.0810 0.300 0.020 0.000 0.680
#> GSM97149     1  0.0336     0.7450 0.992 0.008 0.000 0.000
#> GSM97068     2  0.5374     0.5474 0.052 0.704 0.000 0.244
#> GSM97071     4  0.5478     0.3408 0.000 0.056 0.248 0.696
#> GSM97086     2  0.5137     0.1806 0.000 0.544 0.004 0.452
#> GSM97103     2  0.5657     0.4476 0.000 0.644 0.312 0.044
#> GSM97057     2  0.3687     0.7674 0.080 0.856 0.000 0.064
#> GSM97060     3  0.1398     0.8149 0.000 0.004 0.956 0.040
#> GSM97075     2  0.1471     0.7933 0.012 0.960 0.024 0.004
#> GSM97098     2  0.5888     0.1429 0.000 0.540 0.424 0.036
#> GSM97099     2  0.1209     0.7932 0.032 0.964 0.004 0.000
#> GSM97101     2  0.1109     0.7941 0.028 0.968 0.004 0.000
#> GSM97105     2  0.1890     0.7911 0.000 0.936 0.008 0.056
#> GSM97106     3  0.6352     0.5546 0.000 0.188 0.656 0.156
#> GSM97121     2  0.1114     0.7959 0.016 0.972 0.004 0.008
#> GSM97128     4  0.4608     0.2759 0.004 0.000 0.304 0.692
#> GSM97131     2  0.3485     0.7633 0.000 0.856 0.028 0.116
#> GSM97137     1  0.3810     0.5701 0.804 0.008 0.000 0.188
#> GSM97118     4  0.5000    -0.5219 0.496 0.000 0.000 0.504
#> GSM97114     2  0.1557     0.7840 0.056 0.944 0.000 0.000
#> GSM97142     1  0.4713     0.7410 0.700 0.004 0.004 0.292
#> GSM97140     2  0.2450     0.7852 0.016 0.912 0.000 0.072
#> GSM97141     2  0.1209     0.7932 0.032 0.964 0.004 0.000
#> GSM97055     1  0.5545     0.6683 0.612 0.004 0.020 0.364
#> GSM97090     4  0.6894     0.2557 0.112 0.376 0.000 0.512
#> GSM97091     1  0.5013     0.7004 0.644 0.004 0.004 0.348
#> GSM97148     1  0.0336     0.7450 0.992 0.008 0.000 0.000
#> GSM97063     1  0.4995     0.7042 0.648 0.004 0.004 0.344
#> GSM97053     1  0.4198     0.7595 0.768 0.004 0.004 0.224
#> GSM97066     3  0.2342     0.8109 0.000 0.008 0.912 0.080
#> GSM97079     2  0.5151     0.1383 0.000 0.532 0.004 0.464
#> GSM97083     4  0.4467     0.2368 0.172 0.000 0.040 0.788
#> GSM97084     4  0.5151     0.0111 0.000 0.464 0.004 0.532
#> GSM97094     4  0.4997     0.4643 0.036 0.216 0.004 0.744
#> GSM97096     3  0.6078     0.4723 0.000 0.312 0.620 0.068
#> GSM97097     2  0.7193     0.2648 0.000 0.508 0.152 0.340
#> GSM97107     4  0.5215     0.4739 0.052 0.204 0.004 0.740
#> GSM97054     4  0.4999    -0.0420 0.000 0.492 0.000 0.508
#> GSM97062     4  0.5151     0.0111 0.000 0.464 0.004 0.532
#> GSM97069     3  0.2053     0.8111 0.000 0.004 0.924 0.072
#> GSM97070     3  0.2342     0.8109 0.000 0.008 0.912 0.080
#> GSM97073     3  0.2125     0.8103 0.000 0.004 0.920 0.076
#> GSM97076     4  0.9001    -0.0322 0.300 0.124 0.132 0.444
#> GSM97077     2  0.2149     0.7793 0.000 0.912 0.000 0.088
#> GSM97095     4  0.6334     0.0733 0.060 0.456 0.000 0.484
#> GSM97102     3  0.0592     0.8209 0.000 0.016 0.984 0.000
#> GSM97109     2  0.2221     0.7874 0.044 0.932 0.008 0.016
#> GSM97110     2  0.2221     0.7874 0.044 0.932 0.008 0.016
#> GSM97074     4  0.5290    -0.0765 0.008 0.000 0.476 0.516
#> GSM97085     3  0.4335     0.6166 0.004 0.004 0.752 0.240
#> GSM97059     2  0.4720     0.6516 0.044 0.768 0.000 0.188
#> GSM97072     3  0.1978     0.8145 0.000 0.004 0.928 0.068
#> GSM97078     4  0.4372     0.3262 0.004 0.000 0.268 0.728
#> GSM97067     3  0.2125     0.8103 0.000 0.004 0.920 0.076
#> GSM97087     3  0.1624     0.8157 0.000 0.020 0.952 0.028
#> GSM97111     2  0.0895     0.7951 0.020 0.976 0.004 0.000
#> GSM97064     2  0.3697     0.7674 0.000 0.852 0.048 0.100
#> GSM97065     2  0.5664     0.5963 0.032 0.748 0.164 0.056
#> GSM97081     3  0.5576     0.2106 0.000 0.444 0.536 0.020
#> GSM97082     3  0.0524     0.8209 0.000 0.008 0.988 0.004
#> GSM97088     4  0.5165    -0.0526 0.004 0.000 0.484 0.512
#> GSM97100     2  0.2469     0.7681 0.000 0.892 0.000 0.108
#> GSM97104     3  0.0188     0.8204 0.000 0.004 0.996 0.000
#> GSM97108     2  0.0992     0.7959 0.012 0.976 0.004 0.008
#> GSM97050     2  0.3166     0.7719 0.000 0.868 0.016 0.116
#> GSM97080     3  0.1890     0.8157 0.000 0.008 0.936 0.056
#> GSM97089     3  0.1733     0.8148 0.000 0.024 0.948 0.028
#> GSM97092     3  0.2996     0.7837 0.000 0.064 0.892 0.044
#> GSM97093     2  0.3778     0.7637 0.000 0.848 0.052 0.100
#> GSM97058     2  0.2198     0.7856 0.000 0.920 0.008 0.072
#> GSM97051     2  0.4225     0.7220 0.000 0.792 0.024 0.184
#> GSM97052     3  0.3392     0.7722 0.000 0.072 0.872 0.056
#> GSM97061     2  0.6932     0.1885 0.000 0.492 0.396 0.112

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.2612    0.64006 0.868 0.008 0.000 0.000 0.124
#> GSM97145     1  0.4924    0.56775 0.668 0.060 0.000 0.000 0.272
#> GSM97147     2  0.2914    0.73088 0.016 0.872 0.000 0.100 0.012
#> GSM97125     1  0.4135    0.56342 0.656 0.004 0.000 0.000 0.340
#> GSM97127     1  0.1809    0.65189 0.928 0.012 0.000 0.000 0.060
#> GSM97130     4  0.6548    0.36926 0.292 0.012 0.000 0.524 0.172
#> GSM97133     1  0.0566    0.65055 0.984 0.012 0.000 0.004 0.000
#> GSM97134     4  0.5921   -0.00263 0.088 0.004 0.000 0.460 0.448
#> GSM97120     1  0.0404    0.65195 0.988 0.012 0.000 0.000 0.000
#> GSM97126     2  0.7196   -0.27515 0.244 0.368 0.000 0.020 0.368
#> GSM97112     1  0.4262    0.47152 0.560 0.000 0.000 0.000 0.440
#> GSM97115     4  0.6587    0.65107 0.080 0.164 0.000 0.624 0.132
#> GSM97116     1  0.0290    0.65293 0.992 0.008 0.000 0.000 0.000
#> GSM97117     2  0.1267    0.74239 0.004 0.960 0.012 0.000 0.024
#> GSM97119     1  0.4262    0.47152 0.560 0.000 0.000 0.000 0.440
#> GSM97122     1  0.4262    0.47152 0.560 0.000 0.000 0.000 0.440
#> GSM97135     1  0.4227    0.49710 0.580 0.000 0.000 0.000 0.420
#> GSM97136     2  0.6465    0.31350 0.004 0.548 0.204 0.004 0.240
#> GSM97139     1  0.0290    0.65293 0.992 0.008 0.000 0.000 0.000
#> GSM97146     1  0.0566    0.65055 0.984 0.012 0.000 0.004 0.000
#> GSM97123     2  0.7197    0.18993 0.000 0.460 0.360 0.092 0.088
#> GSM97129     2  0.1847    0.74857 0.004 0.940 0.008 0.020 0.028
#> GSM97143     1  0.4278    0.45170 0.548 0.000 0.000 0.000 0.452
#> GSM97113     2  0.1651    0.74531 0.036 0.944 0.000 0.008 0.012
#> GSM97056     1  0.3576    0.49119 0.840 0.012 0.000 0.100 0.048
#> GSM97124     1  0.4367    0.50073 0.580 0.004 0.000 0.000 0.416
#> GSM97132     5  0.6215    0.09841 0.340 0.004 0.000 0.136 0.520
#> GSM97144     4  0.5763    0.37944 0.108 0.004 0.000 0.600 0.288
#> GSM97149     1  0.0566    0.65055 0.984 0.012 0.000 0.004 0.000
#> GSM97068     2  0.6241    0.29573 0.068 0.556 0.000 0.336 0.040
#> GSM97071     4  0.6141    0.27880 0.004 0.000 0.164 0.572 0.260
#> GSM97086     4  0.3171    0.63462 0.000 0.176 0.000 0.816 0.008
#> GSM97103     2  0.6227    0.31366 0.000 0.584 0.300 0.072 0.044
#> GSM97057     2  0.4943    0.66926 0.088 0.752 0.000 0.132 0.028
#> GSM97060     3  0.1799    0.74200 0.000 0.020 0.940 0.012 0.028
#> GSM97075     2  0.1372    0.74198 0.004 0.956 0.016 0.000 0.024
#> GSM97098     2  0.6233    0.21304 0.000 0.548 0.348 0.060 0.044
#> GSM97099     2  0.1153    0.74236 0.008 0.964 0.004 0.000 0.024
#> GSM97101     2  0.0898    0.74790 0.008 0.972 0.000 0.020 0.000
#> GSM97105     2  0.3340    0.72272 0.000 0.840 0.004 0.124 0.032
#> GSM97106     3  0.6618    0.54339 0.000 0.092 0.616 0.192 0.100
#> GSM97121     2  0.1121    0.74690 0.000 0.956 0.000 0.044 0.000
#> GSM97128     5  0.5435    0.33552 0.004 0.000 0.104 0.236 0.656
#> GSM97131     2  0.5788    0.60922 0.000 0.648 0.064 0.248 0.040
#> GSM97137     1  0.4397    0.40365 0.784 0.012 0.000 0.116 0.088
#> GSM97118     5  0.5543    0.32067 0.224 0.000 0.000 0.136 0.640
#> GSM97114     2  0.1710    0.74418 0.020 0.944 0.000 0.012 0.024
#> GSM97142     1  0.4262    0.47152 0.560 0.000 0.000 0.000 0.440
#> GSM97140     2  0.3059    0.72607 0.000 0.860 0.004 0.108 0.028
#> GSM97141     2  0.1200    0.74643 0.008 0.964 0.000 0.012 0.016
#> GSM97055     5  0.4748   -0.11478 0.384 0.000 0.004 0.016 0.596
#> GSM97090     4  0.6416    0.65147 0.100 0.116 0.000 0.648 0.136
#> GSM97091     5  0.4443   -0.34320 0.472 0.000 0.000 0.004 0.524
#> GSM97148     1  0.0566    0.65055 0.984 0.012 0.000 0.004 0.000
#> GSM97063     5  0.4448   -0.36182 0.480 0.000 0.000 0.004 0.516
#> GSM97053     1  0.4088    0.54392 0.632 0.000 0.000 0.000 0.368
#> GSM97066     3  0.4505    0.69497 0.004 0.016 0.776 0.052 0.152
#> GSM97079     4  0.3622    0.63683 0.000 0.172 0.008 0.804 0.016
#> GSM97083     5  0.5063    0.14325 0.024 0.000 0.012 0.360 0.604
#> GSM97084     4  0.2124    0.68939 0.000 0.096 0.000 0.900 0.004
#> GSM97094     4  0.3953    0.63991 0.000 0.048 0.000 0.784 0.168
#> GSM97096     3  0.6381    0.44666 0.000 0.292 0.580 0.068 0.060
#> GSM97097     4  0.5668    0.53227 0.000 0.168 0.112 0.688 0.032
#> GSM97107     4  0.4191    0.64486 0.012 0.044 0.000 0.784 0.160
#> GSM97054     4  0.3909    0.67669 0.000 0.148 0.004 0.800 0.048
#> GSM97062     4  0.2286    0.68826 0.000 0.108 0.000 0.888 0.004
#> GSM97069     3  0.4211    0.70597 0.004 0.016 0.796 0.040 0.144
#> GSM97070     3  0.4396    0.70111 0.004 0.016 0.784 0.048 0.148
#> GSM97073     3  0.4437    0.70139 0.004 0.016 0.780 0.048 0.152
#> GSM97076     5  0.8483    0.21066 0.056 0.228 0.132 0.112 0.472
#> GSM97077     2  0.3880    0.68879 0.000 0.784 0.004 0.184 0.028
#> GSM97095     4  0.6782    0.62589 0.064 0.204 0.000 0.588 0.144
#> GSM97102     3  0.2474    0.74033 0.000 0.040 0.908 0.012 0.040
#> GSM97109     2  0.2438    0.72514 0.008 0.912 0.004 0.044 0.032
#> GSM97110     2  0.2438    0.72514 0.008 0.912 0.004 0.044 0.032
#> GSM97074     5  0.5963    0.24513 0.004 0.000 0.288 0.128 0.580
#> GSM97085     3  0.5037    0.39406 0.000 0.000 0.584 0.040 0.376
#> GSM97059     2  0.5806    0.52846 0.072 0.648 0.000 0.244 0.036
#> GSM97072     3  0.4133    0.71699 0.004 0.016 0.808 0.048 0.124
#> GSM97078     5  0.5870    0.24667 0.000 0.000 0.140 0.276 0.584
#> GSM97067     3  0.4396    0.70111 0.004 0.016 0.784 0.048 0.148
#> GSM97087     3  0.2742    0.72876 0.000 0.020 0.892 0.020 0.068
#> GSM97111     2  0.1153    0.74249 0.004 0.964 0.008 0.000 0.024
#> GSM97064     2  0.6275    0.61687 0.000 0.644 0.076 0.192 0.088
#> GSM97065     2  0.5242    0.59657 0.008 0.752 0.084 0.044 0.112
#> GSM97081     3  0.5551    0.08127 0.000 0.464 0.484 0.016 0.036
#> GSM97082     3  0.1787    0.74019 0.000 0.016 0.940 0.012 0.032
#> GSM97088     5  0.6410    0.23863 0.000 0.000 0.320 0.192 0.488
#> GSM97100     2  0.4238    0.65622 0.000 0.740 0.004 0.228 0.028
#> GSM97104     3  0.2040    0.74280 0.000 0.032 0.928 0.008 0.032
#> GSM97108     2  0.1357    0.74613 0.000 0.948 0.000 0.048 0.004
#> GSM97050     2  0.5985    0.60050 0.000 0.640 0.040 0.236 0.084
#> GSM97080     3  0.3585    0.72173 0.004 0.016 0.844 0.032 0.104
#> GSM97089     3  0.2742    0.72876 0.000 0.020 0.892 0.020 0.068
#> GSM97092     3  0.3828    0.70355 0.000 0.068 0.832 0.020 0.080
#> GSM97093     2  0.5907    0.65224 0.000 0.688 0.104 0.140 0.068
#> GSM97058     2  0.3951    0.68425 0.000 0.776 0.004 0.192 0.028
#> GSM97051     2  0.6933    0.44584 0.000 0.516 0.076 0.320 0.088
#> GSM97052     3  0.4559    0.68249 0.000 0.072 0.792 0.048 0.088
#> GSM97061     3  0.7592    0.11289 0.000 0.308 0.452 0.152 0.088

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.2300    0.62369 0.856 0.000 0.000 0.000 0.144 0.000
#> GSM97145     1  0.4897    0.07791 0.556 0.056 0.000 0.004 0.384 0.000
#> GSM97147     2  0.4088    0.65328 0.000 0.780 0.104 0.096 0.020 0.000
#> GSM97125     1  0.3971   -0.04908 0.548 0.000 0.000 0.004 0.448 0.000
#> GSM97127     1  0.1908    0.68821 0.900 0.000 0.000 0.004 0.096 0.000
#> GSM97130     4  0.5948    0.44012 0.272 0.000 0.008 0.508 0.212 0.000
#> GSM97133     1  0.0436    0.74760 0.988 0.000 0.004 0.004 0.004 0.000
#> GSM97134     5  0.5452   -0.03264 0.048 0.012 0.024 0.348 0.568 0.000
#> GSM97120     1  0.0363    0.74766 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM97126     2  0.6233    0.00385 0.124 0.448 0.020 0.012 0.396 0.000
#> GSM97112     5  0.3857    0.22416 0.468 0.000 0.000 0.000 0.532 0.000
#> GSM97115     4  0.6829    0.63411 0.064 0.096 0.088 0.588 0.164 0.000
#> GSM97116     1  0.0260    0.74799 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM97117     2  0.0146    0.70750 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM97119     5  0.3854    0.22502 0.464 0.000 0.000 0.000 0.536 0.000
#> GSM97122     5  0.3860    0.21621 0.472 0.000 0.000 0.000 0.528 0.000
#> GSM97135     5  0.3866    0.18277 0.484 0.000 0.000 0.000 0.516 0.000
#> GSM97136     2  0.5328    0.42891 0.000 0.676 0.136 0.004 0.152 0.032
#> GSM97139     1  0.0260    0.74799 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM97146     1  0.0291    0.74842 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM97123     3  0.4947    0.46196 0.000 0.196 0.692 0.032 0.000 0.080
#> GSM97129     2  0.1341    0.70915 0.000 0.948 0.028 0.000 0.024 0.000
#> GSM97143     5  0.3961    0.24889 0.440 0.000 0.000 0.004 0.556 0.000
#> GSM97113     2  0.0858    0.70596 0.028 0.968 0.004 0.000 0.000 0.000
#> GSM97056     1  0.3419    0.56827 0.824 0.000 0.008 0.096 0.072 0.000
#> GSM97124     5  0.4086    0.20430 0.464 0.000 0.000 0.008 0.528 0.000
#> GSM97132     5  0.5494    0.33783 0.208 0.000 0.016 0.160 0.616 0.000
#> GSM97144     4  0.4880    0.48200 0.048 0.000 0.012 0.596 0.344 0.000
#> GSM97149     1  0.0291    0.74842 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM97068     2  0.7227    0.22450 0.060 0.456 0.124 0.312 0.048 0.000
#> GSM97071     4  0.6777    0.18808 0.000 0.000 0.072 0.420 0.160 0.348
#> GSM97086     4  0.3029    0.65639 0.000 0.052 0.088 0.852 0.008 0.000
#> GSM97103     2  0.6388    0.29609 0.000 0.596 0.224 0.068 0.040 0.072
#> GSM97057     2  0.6140    0.54241 0.084 0.620 0.156 0.132 0.008 0.000
#> GSM97060     3  0.4664    0.09828 0.000 0.000 0.488 0.004 0.032 0.476
#> GSM97075     2  0.0405    0.70805 0.000 0.988 0.008 0.000 0.004 0.000
#> GSM97098     2  0.5902    0.21802 0.000 0.588 0.276 0.012 0.040 0.084
#> GSM97099     2  0.0508    0.70548 0.000 0.984 0.012 0.000 0.004 0.000
#> GSM97101     2  0.0547    0.70950 0.000 0.980 0.020 0.000 0.000 0.000
#> GSM97105     2  0.4062    0.63782 0.000 0.764 0.160 0.064 0.012 0.000
#> GSM97106     3  0.5108    0.39862 0.000 0.004 0.692 0.092 0.032 0.180
#> GSM97121     2  0.1745    0.70012 0.000 0.920 0.068 0.000 0.012 0.000
#> GSM97128     5  0.6166    0.15700 0.000 0.000 0.148 0.168 0.596 0.088
#> GSM97131     2  0.6259    0.29064 0.000 0.464 0.312 0.208 0.012 0.004
#> GSM97137     1  0.3860    0.51827 0.788 0.000 0.008 0.108 0.096 0.000
#> GSM97118     5  0.4344    0.34545 0.036 0.000 0.060 0.120 0.776 0.008
#> GSM97114     2  0.0000    0.70822 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97142     5  0.3857    0.22416 0.468 0.000 0.000 0.000 0.532 0.000
#> GSM97140     2  0.4010    0.63898 0.000 0.772 0.148 0.068 0.012 0.000
#> GSM97141     2  0.0000    0.70822 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97055     5  0.5512    0.36422 0.236 0.012 0.076 0.020 0.648 0.008
#> GSM97090     4  0.6235    0.65096 0.064 0.044 0.084 0.632 0.176 0.000
#> GSM97091     5  0.3938    0.34188 0.324 0.000 0.016 0.000 0.660 0.000
#> GSM97148     1  0.0291    0.74842 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM97063     5  0.3984    0.33482 0.336 0.000 0.016 0.000 0.648 0.000
#> GSM97053     1  0.3866   -0.18390 0.516 0.000 0.000 0.000 0.484 0.000
#> GSM97066     6  0.0291    0.67204 0.000 0.000 0.004 0.000 0.004 0.992
#> GSM97079     4  0.3127    0.65140 0.000 0.040 0.104 0.844 0.012 0.000
#> GSM97083     5  0.5387    0.13003 0.008 0.000 0.136 0.212 0.636 0.008
#> GSM97084     4  0.2224    0.69040 0.000 0.020 0.064 0.904 0.012 0.000
#> GSM97094     4  0.3360    0.66743 0.004 0.016 0.008 0.804 0.168 0.000
#> GSM97096     3  0.6694    0.25533 0.000 0.292 0.480 0.012 0.040 0.176
#> GSM97097     4  0.5191    0.52694 0.000 0.108 0.160 0.692 0.036 0.004
#> GSM97107     4  0.3431    0.66881 0.012 0.012 0.012 0.812 0.152 0.000
#> GSM97054     4  0.4403    0.63055 0.000 0.044 0.172 0.744 0.040 0.000
#> GSM97062     4  0.2290    0.67804 0.000 0.020 0.084 0.892 0.004 0.000
#> GSM97069     6  0.0632    0.66763 0.000 0.000 0.024 0.000 0.000 0.976
#> GSM97070     6  0.0260    0.67241 0.000 0.000 0.008 0.000 0.000 0.992
#> GSM97073     6  0.0458    0.67056 0.000 0.000 0.016 0.000 0.000 0.984
#> GSM97076     6  0.6966    0.29270 0.004 0.272 0.048 0.048 0.108 0.520
#> GSM97077     2  0.5098    0.56421 0.000 0.664 0.176 0.148 0.012 0.000
#> GSM97095     4  0.7243    0.59594 0.056 0.140 0.088 0.532 0.184 0.000
#> GSM97102     6  0.5453   -0.02932 0.000 0.024 0.432 0.008 0.044 0.492
#> GSM97109     2  0.1382    0.69269 0.000 0.948 0.036 0.008 0.008 0.000
#> GSM97110     2  0.1382    0.69269 0.000 0.948 0.036 0.008 0.008 0.000
#> GSM97074     6  0.5896    0.36785 0.000 0.000 0.116 0.052 0.240 0.592
#> GSM97085     6  0.6023    0.39312 0.000 0.000 0.176 0.016 0.304 0.504
#> GSM97059     2  0.6875    0.38630 0.056 0.516 0.132 0.264 0.032 0.000
#> GSM97072     6  0.1257    0.65550 0.000 0.000 0.028 0.000 0.020 0.952
#> GSM97078     5  0.6610    0.09051 0.000 0.000 0.148 0.184 0.544 0.124
#> GSM97067     6  0.0146    0.67250 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM97087     3  0.3797    0.25762 0.000 0.000 0.580 0.000 0.000 0.420
#> GSM97111     2  0.0748    0.70217 0.000 0.976 0.016 0.004 0.004 0.000
#> GSM97064     3  0.5770    0.03585 0.000 0.348 0.512 0.128 0.008 0.004
#> GSM97065     2  0.4223    0.33785 0.000 0.612 0.016 0.000 0.004 0.368
#> GSM97081     2  0.5762   -0.25432 0.000 0.440 0.424 0.004 0.004 0.128
#> GSM97082     3  0.3996    0.12798 0.000 0.000 0.512 0.000 0.004 0.484
#> GSM97088     5  0.6733    0.07604 0.000 0.000 0.192 0.164 0.524 0.120
#> GSM97100     2  0.5552    0.50595 0.000 0.600 0.180 0.208 0.012 0.000
#> GSM97104     6  0.4682   -0.01243 0.000 0.000 0.420 0.004 0.036 0.540
#> GSM97108     2  0.2019    0.69460 0.000 0.900 0.088 0.000 0.012 0.000
#> GSM97050     3  0.6224   -0.10934 0.000 0.364 0.412 0.212 0.012 0.000
#> GSM97080     6  0.2994    0.47644 0.000 0.000 0.208 0.000 0.004 0.788
#> GSM97089     3  0.3782    0.26925 0.000 0.000 0.588 0.000 0.000 0.412
#> GSM97092     3  0.3905    0.34127 0.000 0.004 0.636 0.004 0.000 0.356
#> GSM97093     3  0.5502   -0.08319 0.000 0.408 0.484 0.100 0.008 0.000
#> GSM97058     2  0.5098    0.56406 0.000 0.664 0.176 0.148 0.012 0.000
#> GSM97051     3  0.6400    0.15763 0.000 0.216 0.476 0.284 0.016 0.008
#> GSM97052     3  0.3894    0.36732 0.000 0.004 0.664 0.008 0.000 0.324
#> GSM97061     3  0.4717    0.46478 0.000 0.080 0.744 0.068 0.000 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)

plot of chunk tab-CV-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-kmeans-membership-heatmap-5

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)

plot of chunk tab-CV-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-CV-kmeans-get-signatures-no-scale-1

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

plot of chunk tab-CV-kmeans-get-signatures-no-scale-2

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

plot of chunk tab-CV-kmeans-get-signatures-no-scale-3

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

plot of chunk tab-CV-kmeans-get-signatures-no-scale-4

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

plot of chunk tab-CV-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-kmeans-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-CV-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-kmeans-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:kmeans 98         2.21e-04       0.403     2.16e-13    0.146 2
#> CV:kmeans 96         1.37e-05       0.175     1.05e-13    0.139 3
#> CV:kmeans 70         8.41e-05       0.158     4.56e-12    0.156 4
#> CV:kmeans 66         1.02e-04       0.191     1.61e-11    0.242 5
#> CV:kmeans 48         2.87e-03       0.093     5.36e-09    0.118 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.


CV:skmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "skmeans"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-skmeans-collect-plots

The plots are:

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:

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)

plot of chunk CV-skmeans-select-partition-number

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.999           0.965       0.985         0.5000 0.500   0.500
#> 3 3 0.768           0.834       0.924         0.3409 0.731   0.510
#> 4 4 0.564           0.587       0.791         0.1197 0.828   0.543
#> 5 5 0.552           0.381       0.648         0.0657 0.896   0.642
#> 6 6 0.589           0.398       0.638         0.0407 0.867   0.498

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.980 1.000 0.000
#> GSM97145     1  0.0000      0.980 1.000 0.000
#> GSM97147     1  0.0000      0.980 1.000 0.000
#> GSM97125     1  0.0000      0.980 1.000 0.000
#> GSM97127     1  0.0000      0.980 1.000 0.000
#> GSM97130     1  0.0000      0.980 1.000 0.000
#> GSM97133     1  0.0000      0.980 1.000 0.000
#> GSM97134     1  0.0000      0.980 1.000 0.000
#> GSM97120     1  0.0000      0.980 1.000 0.000
#> GSM97126     1  0.0000      0.980 1.000 0.000
#> GSM97112     1  0.0000      0.980 1.000 0.000
#> GSM97115     1  0.0000      0.980 1.000 0.000
#> GSM97116     1  0.0000      0.980 1.000 0.000
#> GSM97117     2  0.0376      0.986 0.004 0.996
#> GSM97119     1  0.0000      0.980 1.000 0.000
#> GSM97122     1  0.0000      0.980 1.000 0.000
#> GSM97135     1  0.0000      0.980 1.000 0.000
#> GSM97136     2  0.8608      0.604 0.284 0.716
#> GSM97139     1  0.0000      0.980 1.000 0.000
#> GSM97146     1  0.0000      0.980 1.000 0.000
#> GSM97123     2  0.0000      0.988 0.000 1.000
#> GSM97129     2  0.3114      0.939 0.056 0.944
#> GSM97143     1  0.0000      0.980 1.000 0.000
#> GSM97113     2  0.0672      0.983 0.008 0.992
#> GSM97056     1  0.0000      0.980 1.000 0.000
#> GSM97124     1  0.0000      0.980 1.000 0.000
#> GSM97132     1  0.0000      0.980 1.000 0.000
#> GSM97144     1  0.0000      0.980 1.000 0.000
#> GSM97149     1  0.0000      0.980 1.000 0.000
#> GSM97068     1  0.9170      0.504 0.668 0.332
#> GSM97071     2  0.3431      0.930 0.064 0.936
#> GSM97086     2  0.0000      0.988 0.000 1.000
#> GSM97103     2  0.0000      0.988 0.000 1.000
#> GSM97057     2  0.4022      0.914 0.080 0.920
#> GSM97060     2  0.0000      0.988 0.000 1.000
#> GSM97075     2  0.0000      0.988 0.000 1.000
#> GSM97098     2  0.0000      0.988 0.000 1.000
#> GSM97099     2  0.0376      0.986 0.004 0.996
#> GSM97101     2  0.0376      0.986 0.004 0.996
#> GSM97105     2  0.0000      0.988 0.000 1.000
#> GSM97106     2  0.0000      0.988 0.000 1.000
#> GSM97121     2  0.0376      0.986 0.004 0.996
#> GSM97128     1  0.0376      0.977 0.996 0.004
#> GSM97131     2  0.0000      0.988 0.000 1.000
#> GSM97137     1  0.0000      0.980 1.000 0.000
#> GSM97118     1  0.0000      0.980 1.000 0.000
#> GSM97114     2  0.4298      0.905 0.088 0.912
#> GSM97142     1  0.0000      0.980 1.000 0.000
#> GSM97140     2  0.0938      0.980 0.012 0.988
#> GSM97141     2  0.0376      0.986 0.004 0.996
#> GSM97055     1  0.0000      0.980 1.000 0.000
#> GSM97090     1  0.0000      0.980 1.000 0.000
#> GSM97091     1  0.0000      0.980 1.000 0.000
#> GSM97148     1  0.0000      0.980 1.000 0.000
#> GSM97063     1  0.0000      0.980 1.000 0.000
#> GSM97053     1  0.0000      0.980 1.000 0.000
#> GSM97066     2  0.0000      0.988 0.000 1.000
#> GSM97079     2  0.0000      0.988 0.000 1.000
#> GSM97083     1  0.0376      0.977 0.996 0.004
#> GSM97084     2  0.0376      0.985 0.004 0.996
#> GSM97094     1  0.0000      0.980 1.000 0.000
#> GSM97096     2  0.0000      0.988 0.000 1.000
#> GSM97097     2  0.0000      0.988 0.000 1.000
#> GSM97107     1  0.0000      0.980 1.000 0.000
#> GSM97054     2  0.1843      0.965 0.028 0.972
#> GSM97062     2  0.0000      0.988 0.000 1.000
#> GSM97069     2  0.0000      0.988 0.000 1.000
#> GSM97070     2  0.0000      0.988 0.000 1.000
#> GSM97073     2  0.0000      0.988 0.000 1.000
#> GSM97076     1  0.0000      0.980 1.000 0.000
#> GSM97077     2  0.0000      0.988 0.000 1.000
#> GSM97095     1  0.0000      0.980 1.000 0.000
#> GSM97102     2  0.0000      0.988 0.000 1.000
#> GSM97109     2  0.0672      0.983 0.008 0.992
#> GSM97110     2  0.0000      0.988 0.000 1.000
#> GSM97074     1  0.0376      0.977 0.996 0.004
#> GSM97085     1  0.9608      0.382 0.616 0.384
#> GSM97059     1  0.3274      0.924 0.940 0.060
#> GSM97072     2  0.0000      0.988 0.000 1.000
#> GSM97078     1  0.0376      0.977 0.996 0.004
#> GSM97067     2  0.0000      0.988 0.000 1.000
#> GSM97087     2  0.0000      0.988 0.000 1.000
#> GSM97111     2  0.0000      0.988 0.000 1.000
#> GSM97064     2  0.0000      0.988 0.000 1.000
#> GSM97065     2  0.0000      0.988 0.000 1.000
#> GSM97081     2  0.0000      0.988 0.000 1.000
#> GSM97082     2  0.0000      0.988 0.000 1.000
#> GSM97088     1  0.3114      0.930 0.944 0.056
#> GSM97100     2  0.0000      0.988 0.000 1.000
#> GSM97104     2  0.0000      0.988 0.000 1.000
#> GSM97108     2  0.0376      0.986 0.004 0.996
#> GSM97050     2  0.0000      0.988 0.000 1.000
#> GSM97080     2  0.0000      0.988 0.000 1.000
#> GSM97089     2  0.0000      0.988 0.000 1.000
#> GSM97092     2  0.0000      0.988 0.000 1.000
#> GSM97093     2  0.0000      0.988 0.000 1.000
#> GSM97058     2  0.0000      0.988 0.000 1.000
#> GSM97051     2  0.0000      0.988 0.000 1.000
#> GSM97052     2  0.0000      0.988 0.000 1.000
#> GSM97061     2  0.0000      0.988 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97145     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97147     2  0.2878    0.82308 0.096 0.904 0.000
#> GSM97125     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97127     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97130     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97133     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97134     1  0.0424    0.95553 0.992 0.008 0.000
#> GSM97120     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97126     1  0.0424    0.95527 0.992 0.008 0.000
#> GSM97112     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97115     2  0.6235    0.21408 0.436 0.564 0.000
#> GSM97116     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97117     2  0.6745    0.24102 0.012 0.560 0.428
#> GSM97119     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97122     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97135     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97136     3  0.2063    0.87693 0.044 0.008 0.948
#> GSM97139     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97146     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97123     2  0.6244    0.28439 0.000 0.560 0.440
#> GSM97129     2  0.8898    0.24309 0.128 0.500 0.372
#> GSM97143     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97113     2  0.0661    0.87824 0.004 0.988 0.008
#> GSM97056     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97124     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97132     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97144     1  0.0747    0.95087 0.984 0.016 0.000
#> GSM97149     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97068     2  0.0592    0.87553 0.012 0.988 0.000
#> GSM97071     3  0.0892    0.89847 0.000 0.020 0.980
#> GSM97086     2  0.0747    0.87892 0.000 0.984 0.016
#> GSM97103     3  0.5363    0.58847 0.000 0.276 0.724
#> GSM97057     2  0.0000    0.87674 0.000 1.000 0.000
#> GSM97060     3  0.0237    0.90397 0.000 0.004 0.996
#> GSM97075     3  0.6308   -0.00393 0.000 0.492 0.508
#> GSM97098     3  0.5882    0.42562 0.000 0.348 0.652
#> GSM97099     2  0.2878    0.84653 0.000 0.904 0.096
#> GSM97101     2  0.0424    0.87771 0.000 0.992 0.008
#> GSM97105     2  0.0237    0.87750 0.000 0.996 0.004
#> GSM97106     3  0.4887    0.67231 0.000 0.228 0.772
#> GSM97121     2  0.0237    0.87750 0.000 0.996 0.004
#> GSM97128     3  0.4912    0.73294 0.196 0.008 0.796
#> GSM97131     2  0.2796    0.85557 0.000 0.908 0.092
#> GSM97137     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97118     1  0.0237    0.95789 0.996 0.000 0.004
#> GSM97114     2  0.1989    0.86301 0.048 0.948 0.004
#> GSM97142     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97140     2  0.0000    0.87674 0.000 1.000 0.000
#> GSM97141     2  0.0592    0.87797 0.000 0.988 0.012
#> GSM97055     1  0.3267    0.85488 0.884 0.000 0.116
#> GSM97090     1  0.4504    0.75062 0.804 0.196 0.000
#> GSM97091     1  0.0424    0.95544 0.992 0.000 0.008
#> GSM97148     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97063     1  0.0237    0.95789 0.996 0.000 0.004
#> GSM97053     1  0.0000    0.95996 1.000 0.000 0.000
#> GSM97066     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97079     2  0.3412    0.83528 0.000 0.876 0.124
#> GSM97083     1  0.2486    0.91058 0.932 0.008 0.060
#> GSM97084     2  0.2066    0.86913 0.000 0.940 0.060
#> GSM97094     1  0.2550    0.91363 0.932 0.056 0.012
#> GSM97096     3  0.1860    0.87580 0.000 0.052 0.948
#> GSM97097     2  0.4452    0.76555 0.000 0.808 0.192
#> GSM97107     1  0.3263    0.89864 0.912 0.048 0.040
#> GSM97054     2  0.0892    0.87904 0.000 0.980 0.020
#> GSM97062     2  0.2448    0.86301 0.000 0.924 0.076
#> GSM97069     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97070     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97073     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97076     1  0.6598    0.22215 0.564 0.008 0.428
#> GSM97077     2  0.1289    0.87803 0.000 0.968 0.032
#> GSM97095     1  0.5859    0.47423 0.656 0.344 0.000
#> GSM97102     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97109     2  0.1525    0.87641 0.004 0.964 0.032
#> GSM97110     2  0.1860    0.87102 0.000 0.948 0.052
#> GSM97074     3  0.4291    0.75374 0.180 0.000 0.820
#> GSM97085     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97059     2  0.2261    0.84484 0.068 0.932 0.000
#> GSM97072     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97078     3  0.4228    0.78472 0.148 0.008 0.844
#> GSM97067     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97087     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97111     2  0.2356    0.86294 0.000 0.928 0.072
#> GSM97064     2  0.3619    0.82419 0.000 0.864 0.136
#> GSM97065     3  0.4654    0.72601 0.000 0.208 0.792
#> GSM97081     3  0.1753    0.88287 0.000 0.048 0.952
#> GSM97082     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97088     3  0.0661    0.90083 0.004 0.008 0.988
#> GSM97100     2  0.0000    0.87674 0.000 1.000 0.000
#> GSM97104     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97108     2  0.0000    0.87674 0.000 1.000 0.000
#> GSM97050     2  0.2356    0.86904 0.000 0.928 0.072
#> GSM97080     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97089     3  0.0000    0.90534 0.000 0.000 1.000
#> GSM97092     3  0.0592    0.90150 0.000 0.012 0.988
#> GSM97093     2  0.3752    0.81125 0.000 0.856 0.144
#> GSM97058     2  0.0892    0.87924 0.000 0.980 0.020
#> GSM97051     2  0.2878    0.85208 0.000 0.904 0.096
#> GSM97052     3  0.1289    0.89171 0.000 0.032 0.968
#> GSM97061     2  0.6299    0.17238 0.000 0.524 0.476

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.2589     0.8634 0.912 0.044 0.000 0.044
#> GSM97145     1  0.2500     0.8647 0.916 0.044 0.000 0.040
#> GSM97147     2  0.5792     0.4121 0.056 0.648 0.000 0.296
#> GSM97125     1  0.1042     0.8711 0.972 0.008 0.000 0.020
#> GSM97127     1  0.2751     0.8622 0.904 0.040 0.000 0.056
#> GSM97130     4  0.5724     0.0759 0.424 0.028 0.000 0.548
#> GSM97133     1  0.3071     0.8567 0.888 0.044 0.000 0.068
#> GSM97134     1  0.5163    -0.0404 0.516 0.004 0.000 0.480
#> GSM97120     1  0.2926     0.8596 0.896 0.048 0.000 0.056
#> GSM97126     1  0.2936     0.8453 0.900 0.056 0.004 0.040
#> GSM97112     1  0.0469     0.8685 0.988 0.000 0.000 0.012
#> GSM97115     4  0.4344     0.5957 0.076 0.108 0.000 0.816
#> GSM97116     1  0.2996     0.8582 0.892 0.044 0.000 0.064
#> GSM97117     2  0.3627     0.6263 0.008 0.840 0.144 0.008
#> GSM97119     1  0.0469     0.8685 0.988 0.000 0.000 0.012
#> GSM97122     1  0.0469     0.8685 0.988 0.000 0.000 0.012
#> GSM97135     1  0.0469     0.8685 0.988 0.000 0.000 0.012
#> GSM97136     3  0.6358     0.5190 0.128 0.204 0.664 0.004
#> GSM97139     1  0.2996     0.8582 0.892 0.044 0.000 0.064
#> GSM97146     1  0.3071     0.8567 0.888 0.044 0.000 0.068
#> GSM97123     3  0.7151    -0.1635 0.000 0.420 0.448 0.132
#> GSM97129     2  0.8054     0.4148 0.160 0.580 0.184 0.076
#> GSM97143     1  0.0336     0.8690 0.992 0.000 0.000 0.008
#> GSM97113     2  0.1854     0.6386 0.012 0.940 0.000 0.048
#> GSM97056     1  0.5308     0.6301 0.684 0.036 0.000 0.280
#> GSM97124     1  0.0592     0.8677 0.984 0.000 0.000 0.016
#> GSM97132     1  0.2760     0.7917 0.872 0.000 0.000 0.128
#> GSM97144     4  0.4776     0.3415 0.376 0.000 0.000 0.624
#> GSM97149     1  0.3156     0.8551 0.884 0.048 0.000 0.068
#> GSM97068     4  0.4585     0.3025 0.000 0.332 0.000 0.668
#> GSM97071     4  0.5600    -0.0575 0.020 0.000 0.468 0.512
#> GSM97086     4  0.3908     0.4859 0.000 0.212 0.004 0.784
#> GSM97103     2  0.7034     0.1533 0.000 0.468 0.412 0.120
#> GSM97057     2  0.4356     0.5240 0.000 0.708 0.000 0.292
#> GSM97060     3  0.0707     0.7989 0.000 0.000 0.980 0.020
#> GSM97075     2  0.5384     0.4873 0.000 0.648 0.324 0.028
#> GSM97098     2  0.6442     0.1234 0.000 0.492 0.440 0.068
#> GSM97099     2  0.2965     0.6504 0.000 0.892 0.072 0.036
#> GSM97101     2  0.1022     0.6502 0.000 0.968 0.000 0.032
#> GSM97105     2  0.3266     0.6121 0.000 0.832 0.000 0.168
#> GSM97106     3  0.5839     0.5575 0.000 0.104 0.696 0.200
#> GSM97121     2  0.2345     0.6422 0.000 0.900 0.000 0.100
#> GSM97128     3  0.7214     0.0984 0.144 0.000 0.476 0.380
#> GSM97131     2  0.6836     0.4779 0.000 0.580 0.140 0.280
#> GSM97137     1  0.5512     0.5923 0.660 0.040 0.000 0.300
#> GSM97118     1  0.3196     0.7731 0.856 0.000 0.008 0.136
#> GSM97114     2  0.2494     0.6212 0.036 0.916 0.000 0.048
#> GSM97142     1  0.0469     0.8685 0.988 0.000 0.000 0.012
#> GSM97140     2  0.3801     0.5804 0.000 0.780 0.000 0.220
#> GSM97141     2  0.0707     0.6493 0.000 0.980 0.000 0.020
#> GSM97055     1  0.3668     0.7658 0.852 0.004 0.116 0.028
#> GSM97090     4  0.3948     0.6099 0.136 0.036 0.000 0.828
#> GSM97091     1  0.1042     0.8630 0.972 0.000 0.008 0.020
#> GSM97148     1  0.3071     0.8567 0.888 0.044 0.000 0.068
#> GSM97063     1  0.0657     0.8674 0.984 0.000 0.004 0.012
#> GSM97053     1  0.0921     0.8707 0.972 0.000 0.000 0.028
#> GSM97066     3  0.0336     0.8009 0.000 0.000 0.992 0.008
#> GSM97079     4  0.4586     0.5209 0.000 0.136 0.068 0.796
#> GSM97083     4  0.6553     0.4141 0.316 0.000 0.100 0.584
#> GSM97084     4  0.2546     0.5817 0.000 0.092 0.008 0.900
#> GSM97094     4  0.4960     0.5821 0.212 0.020 0.016 0.752
#> GSM97096     3  0.5421     0.5720 0.000 0.200 0.724 0.076
#> GSM97097     4  0.7558    -0.1332 0.000 0.380 0.192 0.428
#> GSM97107     4  0.4527     0.5939 0.192 0.020 0.008 0.780
#> GSM97054     4  0.3498     0.5524 0.000 0.160 0.008 0.832
#> GSM97062     4  0.2593     0.5753 0.000 0.104 0.004 0.892
#> GSM97069     3  0.0336     0.8009 0.000 0.000 0.992 0.008
#> GSM97070     3  0.0336     0.8009 0.000 0.000 0.992 0.008
#> GSM97073     3  0.0779     0.7997 0.000 0.004 0.980 0.016
#> GSM97076     1  0.8105     0.3498 0.544 0.084 0.272 0.100
#> GSM97077     2  0.6817     0.2796 0.000 0.492 0.100 0.408
#> GSM97095     4  0.5029     0.6009 0.140 0.072 0.008 0.780
#> GSM97102     3  0.1388     0.7892 0.000 0.028 0.960 0.012
#> GSM97109     2  0.3177     0.6312 0.016 0.892 0.024 0.068
#> GSM97110     2  0.3855     0.6277 0.012 0.860 0.060 0.068
#> GSM97074     3  0.6426     0.4406 0.256 0.000 0.628 0.116
#> GSM97085     3  0.2032     0.7754 0.036 0.000 0.936 0.028
#> GSM97059     4  0.5543     0.0574 0.020 0.424 0.000 0.556
#> GSM97072     3  0.0592     0.8009 0.000 0.000 0.984 0.016
#> GSM97078     3  0.6745     0.0824 0.092 0.000 0.480 0.428
#> GSM97067     3  0.0336     0.8009 0.000 0.000 0.992 0.008
#> GSM97087     3  0.0524     0.8004 0.000 0.004 0.988 0.008
#> GSM97111     2  0.2861     0.6503 0.000 0.888 0.096 0.016
#> GSM97064     2  0.7754     0.3291 0.000 0.420 0.336 0.244
#> GSM97065     2  0.5775     0.0395 0.004 0.488 0.488 0.020
#> GSM97081     3  0.3873     0.5976 0.000 0.228 0.772 0.000
#> GSM97082     3  0.0336     0.8012 0.000 0.000 0.992 0.008
#> GSM97088     3  0.5657     0.5205 0.068 0.000 0.688 0.244
#> GSM97100     2  0.4564     0.4679 0.000 0.672 0.000 0.328
#> GSM97104     3  0.0000     0.8008 0.000 0.000 1.000 0.000
#> GSM97108     2  0.2408     0.6389 0.000 0.896 0.000 0.104
#> GSM97050     2  0.7275     0.3111 0.000 0.472 0.152 0.376
#> GSM97080     3  0.0188     0.8009 0.000 0.000 0.996 0.004
#> GSM97089     3  0.0657     0.7997 0.000 0.004 0.984 0.012
#> GSM97092     3  0.2002     0.7795 0.000 0.020 0.936 0.044
#> GSM97093     2  0.7824     0.2580 0.000 0.400 0.264 0.336
#> GSM97058     2  0.6378     0.5120 0.000 0.628 0.108 0.264
#> GSM97051     4  0.7268     0.0295 0.000 0.312 0.172 0.516
#> GSM97052     3  0.3652     0.7222 0.000 0.052 0.856 0.092
#> GSM97061     3  0.7049     0.2603 0.000 0.236 0.572 0.192

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.4384    0.47558 0.660 0.016 0.000 0.000 0.324
#> GSM97145     1  0.3942    0.53647 0.748 0.020 0.000 0.000 0.232
#> GSM97147     2  0.7419    0.14047 0.084 0.460 0.000 0.328 0.128
#> GSM97125     1  0.3039    0.56352 0.808 0.000 0.000 0.000 0.192
#> GSM97127     1  0.4327    0.44811 0.632 0.008 0.000 0.000 0.360
#> GSM97130     5  0.6166    0.52499 0.180 0.000 0.000 0.272 0.548
#> GSM97133     1  0.4867    0.36701 0.544 0.024 0.000 0.000 0.432
#> GSM97134     1  0.6660   -0.26312 0.468 0.000 0.004 0.216 0.312
#> GSM97120     1  0.4760    0.39292 0.564 0.020 0.000 0.000 0.416
#> GSM97126     1  0.4776    0.49987 0.744 0.084 0.004 0.004 0.164
#> GSM97112     1  0.0290    0.59461 0.992 0.000 0.000 0.000 0.008
#> GSM97115     4  0.5755   -0.11630 0.024 0.040 0.000 0.504 0.432
#> GSM97116     1  0.4682    0.39010 0.564 0.016 0.000 0.000 0.420
#> GSM97117     2  0.2913    0.62529 0.004 0.880 0.080 0.004 0.032
#> GSM97119     1  0.0609    0.59786 0.980 0.000 0.000 0.000 0.020
#> GSM97122     1  0.0794    0.59915 0.972 0.000 0.000 0.000 0.028
#> GSM97135     1  0.1043    0.59965 0.960 0.000 0.000 0.000 0.040
#> GSM97136     3  0.7607    0.30426 0.244 0.212 0.468 0.000 0.076
#> GSM97139     1  0.4689    0.38567 0.560 0.016 0.000 0.000 0.424
#> GSM97146     1  0.4793    0.36467 0.544 0.020 0.000 0.000 0.436
#> GSM97123     3  0.8130   -0.01570 0.000 0.300 0.340 0.260 0.100
#> GSM97129     2  0.8851    0.29140 0.172 0.464 0.116 0.108 0.140
#> GSM97143     1  0.1341    0.58481 0.944 0.000 0.000 0.000 0.056
#> GSM97113     2  0.4333    0.57880 0.000 0.752 0.000 0.060 0.188
#> GSM97056     5  0.6490    0.16652 0.376 0.008 0.000 0.148 0.468
#> GSM97124     1  0.2389    0.58272 0.880 0.000 0.000 0.004 0.116
#> GSM97132     1  0.4527    0.33055 0.700 0.000 0.000 0.040 0.260
#> GSM97144     5  0.6747    0.33121 0.260 0.000 0.000 0.364 0.376
#> GSM97149     1  0.4872    0.36009 0.540 0.024 0.000 0.000 0.436
#> GSM97068     4  0.6193    0.24710 0.000 0.184 0.000 0.544 0.272
#> GSM97071     3  0.7547    0.14284 0.036 0.004 0.416 0.280 0.264
#> GSM97086     4  0.2719    0.48076 0.000 0.068 0.000 0.884 0.048
#> GSM97103     2  0.7540    0.25782 0.000 0.484 0.268 0.156 0.092
#> GSM97057     2  0.6642    0.06338 0.000 0.420 0.000 0.352 0.228
#> GSM97060     3  0.3256    0.64837 0.000 0.012 0.864 0.064 0.060
#> GSM97075     2  0.5896    0.38814 0.000 0.604 0.304 0.052 0.040
#> GSM97098     2  0.6703    0.25069 0.000 0.544 0.308 0.068 0.080
#> GSM97099     2  0.2812    0.63044 0.004 0.896 0.028 0.020 0.052
#> GSM97101     2  0.2189    0.61089 0.000 0.904 0.000 0.084 0.012
#> GSM97105     2  0.4109    0.42479 0.000 0.700 0.000 0.288 0.012
#> GSM97106     3  0.7243    0.26857 0.000 0.072 0.480 0.324 0.124
#> GSM97121     2  0.3318    0.56067 0.000 0.808 0.000 0.180 0.012
#> GSM97128     3  0.7892    0.13225 0.300 0.000 0.340 0.068 0.292
#> GSM97131     4  0.6126    0.13081 0.000 0.380 0.056 0.528 0.036
#> GSM97137     5  0.6170    0.17910 0.364 0.008 0.000 0.112 0.516
#> GSM97118     1  0.4111    0.37454 0.756 0.000 0.016 0.012 0.216
#> GSM97114     2  0.3421    0.60179 0.008 0.824 0.000 0.016 0.152
#> GSM97142     1  0.0404    0.59307 0.988 0.000 0.000 0.000 0.012
#> GSM97140     2  0.5335    0.11725 0.000 0.536 0.004 0.416 0.044
#> GSM97141     2  0.1300    0.63001 0.000 0.956 0.000 0.028 0.016
#> GSM97055     1  0.4171    0.44264 0.784 0.000 0.104 0.000 0.112
#> GSM97090     4  0.5682   -0.19133 0.060 0.008 0.000 0.512 0.420
#> GSM97091     1  0.2110    0.54797 0.912 0.000 0.016 0.000 0.072
#> GSM97148     1  0.4793    0.36467 0.544 0.020 0.000 0.000 0.436
#> GSM97063     1  0.1121    0.57758 0.956 0.000 0.000 0.000 0.044
#> GSM97053     1  0.2773    0.57254 0.836 0.000 0.000 0.000 0.164
#> GSM97066     3  0.1270    0.66290 0.000 0.000 0.948 0.000 0.052
#> GSM97079     4  0.4295    0.45303 0.000 0.052 0.048 0.808 0.092
#> GSM97083     1  0.7832   -0.26032 0.368 0.000 0.084 0.192 0.356
#> GSM97084     4  0.3160    0.33400 0.000 0.004 0.000 0.808 0.188
#> GSM97094     4  0.6802   -0.13190 0.152 0.020 0.004 0.508 0.316
#> GSM97096     3  0.6860    0.38584 0.000 0.256 0.564 0.080 0.100
#> GSM97097     4  0.7343    0.09165 0.000 0.332 0.104 0.468 0.096
#> GSM97107     4  0.6211   -0.22222 0.128 0.000 0.004 0.500 0.368
#> GSM97054     4  0.3497    0.44575 0.000 0.048 0.004 0.836 0.112
#> GSM97062     4  0.2488    0.40771 0.000 0.004 0.000 0.872 0.124
#> GSM97069     3  0.0794    0.66555 0.000 0.000 0.972 0.000 0.028
#> GSM97070     3  0.1121    0.66521 0.000 0.000 0.956 0.000 0.044
#> GSM97073     3  0.1862    0.66306 0.000 0.016 0.932 0.004 0.048
#> GSM97076     3  0.8901    0.02271 0.276 0.132 0.316 0.028 0.248
#> GSM97077     4  0.7016    0.27476 0.008 0.296 0.084 0.540 0.072
#> GSM97095     5  0.6681    0.06080 0.060 0.068 0.000 0.428 0.444
#> GSM97102     3  0.2864    0.65172 0.000 0.064 0.884 0.008 0.044
#> GSM97109     2  0.4181    0.58926 0.000 0.784 0.008 0.052 0.156
#> GSM97110     2  0.4351    0.58686 0.000 0.776 0.020 0.040 0.164
#> GSM97074     3  0.6814    0.35072 0.296 0.000 0.508 0.024 0.172
#> GSM97085     3  0.4766    0.57347 0.136 0.000 0.732 0.000 0.132
#> GSM97059     4  0.6615    0.26266 0.008 0.276 0.000 0.508 0.208
#> GSM97072     3  0.1329    0.66736 0.000 0.008 0.956 0.004 0.032
#> GSM97078     3  0.8109    0.23467 0.216 0.000 0.396 0.120 0.268
#> GSM97067     3  0.1121    0.66403 0.000 0.000 0.956 0.000 0.044
#> GSM97087     3  0.3298    0.64384 0.000 0.012 0.856 0.036 0.096
#> GSM97111     2  0.1978    0.63017 0.000 0.932 0.024 0.032 0.012
#> GSM97064     4  0.7760    0.24025 0.000 0.204 0.240 0.460 0.096
#> GSM97065     3  0.6188   -0.00711 0.000 0.416 0.448 0.000 0.136
#> GSM97081     3  0.6183    0.36524 0.000 0.300 0.588 0.048 0.064
#> GSM97082     3  0.1710    0.66536 0.000 0.004 0.940 0.016 0.040
#> GSM97088     3  0.7476    0.39916 0.180 0.004 0.496 0.064 0.256
#> GSM97100     4  0.4996    0.10805 0.000 0.420 0.000 0.548 0.032
#> GSM97104     3  0.1862    0.66328 0.000 0.016 0.932 0.004 0.048
#> GSM97108     2  0.3318    0.54231 0.000 0.800 0.000 0.192 0.008
#> GSM97050     4  0.6789    0.34469 0.000 0.204 0.092 0.596 0.108
#> GSM97080     3  0.1124    0.66803 0.000 0.004 0.960 0.000 0.036
#> GSM97089     3  0.3699    0.64089 0.000 0.028 0.836 0.032 0.104
#> GSM97092     3  0.5273    0.58010 0.000 0.044 0.736 0.108 0.112
#> GSM97093     4  0.8153    0.20619 0.000 0.260 0.168 0.408 0.164
#> GSM97058     4  0.6506    0.12832 0.000 0.388 0.080 0.492 0.040
#> GSM97051     4  0.6181    0.38413 0.000 0.168 0.096 0.660 0.076
#> GSM97052     3  0.5835    0.52744 0.000 0.048 0.684 0.160 0.108
#> GSM97061     3  0.7751    0.02858 0.000 0.148 0.396 0.356 0.100

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     5  0.4111   -0.33296 0.456 0.004 0.000 0.004 0.536 0.000
#> GSM97145     5  0.4350    0.19229 0.292 0.048 0.000 0.000 0.660 0.000
#> GSM97147     2  0.8273    0.22586 0.180 0.392 0.188 0.164 0.076 0.000
#> GSM97125     5  0.2854    0.44832 0.208 0.000 0.000 0.000 0.792 0.000
#> GSM97127     1  0.4331    0.44111 0.516 0.020 0.000 0.000 0.464 0.000
#> GSM97130     4  0.6008    0.10615 0.424 0.008 0.020 0.444 0.104 0.000
#> GSM97133     1  0.3922    0.66848 0.664 0.016 0.000 0.000 0.320 0.000
#> GSM97134     5  0.6484    0.09278 0.184 0.016 0.012 0.360 0.428 0.000
#> GSM97120     1  0.3955    0.61372 0.608 0.008 0.000 0.000 0.384 0.000
#> GSM97126     5  0.5636    0.39268 0.240 0.092 0.016 0.024 0.628 0.000
#> GSM97112     5  0.0260    0.64435 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM97115     4  0.6300    0.38959 0.364 0.028 0.120 0.476 0.012 0.000
#> GSM97116     1  0.3684    0.63936 0.628 0.000 0.000 0.000 0.372 0.000
#> GSM97117     2  0.2831    0.59529 0.020 0.884 0.028 0.000 0.016 0.052
#> GSM97119     5  0.0951    0.64528 0.020 0.000 0.004 0.008 0.968 0.000
#> GSM97122     5  0.1462    0.62976 0.056 0.000 0.000 0.008 0.936 0.000
#> GSM97135     5  0.1588    0.61947 0.072 0.000 0.000 0.004 0.924 0.000
#> GSM97136     5  0.8505   -0.22926 0.056 0.188 0.136 0.012 0.308 0.300
#> GSM97139     1  0.3659    0.64555 0.636 0.000 0.000 0.000 0.364 0.000
#> GSM97146     1  0.3547    0.66996 0.668 0.000 0.000 0.000 0.332 0.000
#> GSM97123     3  0.6325    0.47033 0.024 0.208 0.560 0.020 0.000 0.188
#> GSM97129     2  0.9241    0.16150 0.140 0.336 0.188 0.052 0.176 0.108
#> GSM97143     5  0.1594    0.64241 0.052 0.000 0.000 0.016 0.932 0.000
#> GSM97113     2  0.4798    0.46207 0.324 0.620 0.044 0.004 0.000 0.008
#> GSM97056     1  0.5475    0.55158 0.620 0.000 0.016 0.164 0.200 0.000
#> GSM97124     5  0.2740    0.59042 0.120 0.000 0.000 0.028 0.852 0.000
#> GSM97132     5  0.5741    0.40430 0.200 0.004 0.012 0.196 0.588 0.000
#> GSM97144     4  0.5528    0.39750 0.172 0.004 0.004 0.596 0.224 0.000
#> GSM97149     1  0.3619    0.67289 0.680 0.000 0.004 0.000 0.316 0.000
#> GSM97068     4  0.7113    0.37306 0.296 0.144 0.136 0.424 0.000 0.000
#> GSM97071     6  0.6375    0.03269 0.072 0.000 0.044 0.428 0.024 0.432
#> GSM97086     4  0.5568    0.21797 0.032 0.064 0.336 0.564 0.000 0.004
#> GSM97103     2  0.7750    0.20380 0.052 0.428 0.120 0.128 0.000 0.272
#> GSM97057     1  0.7115   -0.12616 0.432 0.268 0.188 0.112 0.000 0.000
#> GSM97060     6  0.4347    0.43171 0.012 0.000 0.304 0.024 0.000 0.660
#> GSM97075     2  0.6875    0.21215 0.052 0.496 0.220 0.016 0.000 0.216
#> GSM97098     2  0.7227    0.22288 0.044 0.476 0.156 0.056 0.000 0.268
#> GSM97099     2  0.3804    0.59334 0.052 0.836 0.048 0.028 0.004 0.032
#> GSM97101     2  0.2263    0.58909 0.036 0.900 0.060 0.004 0.000 0.000
#> GSM97105     2  0.5485    0.31771 0.032 0.584 0.308 0.076 0.000 0.000
#> GSM97106     3  0.5774    0.30291 0.032 0.016 0.592 0.072 0.000 0.288
#> GSM97121     2  0.3839    0.55041 0.032 0.796 0.132 0.040 0.000 0.000
#> GSM97128     5  0.8295    0.00524 0.128 0.004 0.052 0.212 0.340 0.264
#> GSM97131     3  0.6961    0.22795 0.040 0.292 0.484 0.144 0.000 0.040
#> GSM97137     1  0.5563    0.51660 0.616 0.000 0.020 0.184 0.180 0.000
#> GSM97118     5  0.5749    0.48845 0.104 0.004 0.020 0.172 0.664 0.036
#> GSM97114     2  0.3500    0.57378 0.168 0.800 0.016 0.004 0.008 0.004
#> GSM97142     5  0.0653    0.64464 0.012 0.000 0.004 0.004 0.980 0.000
#> GSM97140     2  0.6641    0.22988 0.096 0.464 0.344 0.092 0.004 0.000
#> GSM97141     2  0.1856    0.59599 0.032 0.920 0.048 0.000 0.000 0.000
#> GSM97055     5  0.5133    0.55018 0.092 0.008 0.028 0.056 0.748 0.068
#> GSM97090     4  0.5510    0.49851 0.248 0.008 0.100 0.624 0.020 0.000
#> GSM97091     5  0.2113    0.63012 0.032 0.000 0.012 0.028 0.920 0.008
#> GSM97148     1  0.3652    0.67245 0.672 0.000 0.000 0.004 0.324 0.000
#> GSM97063     5  0.1198    0.64162 0.020 0.000 0.004 0.012 0.960 0.004
#> GSM97053     5  0.3364    0.47922 0.196 0.000 0.000 0.024 0.780 0.000
#> GSM97066     6  0.1949    0.60355 0.036 0.000 0.020 0.020 0.000 0.924
#> GSM97079     4  0.6353    0.26712 0.064 0.060 0.256 0.580 0.000 0.040
#> GSM97083     4  0.7082    0.07233 0.124 0.004 0.028 0.448 0.340 0.056
#> GSM97084     4  0.3820    0.47005 0.040 0.016 0.148 0.792 0.000 0.004
#> GSM97094     4  0.4388    0.51591 0.036 0.016 0.052 0.800 0.080 0.016
#> GSM97096     6  0.7386    0.16145 0.044 0.180 0.296 0.052 0.000 0.428
#> GSM97097     4  0.7292    0.13485 0.036 0.216 0.208 0.476 0.000 0.064
#> GSM97107     4  0.3869    0.52905 0.080 0.020 0.016 0.828 0.044 0.012
#> GSM97054     4  0.5603    0.25407 0.072 0.036 0.340 0.552 0.000 0.000
#> GSM97062     4  0.4570    0.37484 0.028 0.032 0.256 0.684 0.000 0.000
#> GSM97069     6  0.1649    0.60841 0.016 0.000 0.040 0.008 0.000 0.936
#> GSM97070     6  0.1405    0.60741 0.024 0.000 0.024 0.004 0.000 0.948
#> GSM97073     6  0.1971    0.59768 0.024 0.024 0.016 0.008 0.000 0.928
#> GSM97076     6  0.8368    0.28379 0.144 0.120 0.040 0.096 0.124 0.476
#> GSM97077     3  0.6968    0.35853 0.080 0.204 0.544 0.136 0.000 0.036
#> GSM97095     4  0.6755    0.47392 0.236 0.052 0.096 0.564 0.048 0.004
#> GSM97102     6  0.5402    0.51710 0.032 0.080 0.144 0.032 0.004 0.708
#> GSM97109     2  0.4489    0.57118 0.128 0.772 0.040 0.044 0.004 0.012
#> GSM97110     2  0.5733    0.53591 0.120 0.692 0.068 0.048 0.000 0.072
#> GSM97074     6  0.6931    0.31308 0.096 0.000 0.028 0.104 0.244 0.528
#> GSM97085     6  0.5780    0.50587 0.072 0.004 0.048 0.048 0.140 0.688
#> GSM97059     1  0.7771   -0.26297 0.368 0.184 0.188 0.248 0.012 0.000
#> GSM97072     6  0.1837    0.60329 0.020 0.012 0.032 0.004 0.000 0.932
#> GSM97078     4  0.8329   -0.01822 0.120 0.000 0.072 0.312 0.208 0.288
#> GSM97067     6  0.0951    0.60711 0.020 0.000 0.008 0.004 0.000 0.968
#> GSM97087     6  0.4788    0.27440 0.028 0.008 0.420 0.004 0.000 0.540
#> GSM97111     2  0.3882    0.58588 0.040 0.812 0.100 0.008 0.000 0.040
#> GSM97064     3  0.5223    0.60309 0.032 0.064 0.728 0.060 0.000 0.116
#> GSM97065     6  0.6702    0.12121 0.132 0.304 0.068 0.008 0.000 0.488
#> GSM97081     6  0.6672    0.24249 0.040 0.188 0.292 0.008 0.000 0.472
#> GSM97082     6  0.3932    0.50560 0.028 0.004 0.248 0.000 0.000 0.720
#> GSM97088     6  0.8641    0.23389 0.104 0.004 0.160 0.204 0.176 0.352
#> GSM97100     2  0.6716   -0.03804 0.052 0.384 0.376 0.188 0.000 0.000
#> GSM97104     6  0.3194    0.56181 0.012 0.004 0.172 0.004 0.000 0.808
#> GSM97108     2  0.4518    0.49161 0.036 0.736 0.172 0.056 0.000 0.000
#> GSM97050     3  0.5664    0.50508 0.044 0.108 0.676 0.148 0.000 0.024
#> GSM97080     6  0.2263    0.59497 0.016 0.000 0.100 0.000 0.000 0.884
#> GSM97089     6  0.5047    0.24891 0.032 0.012 0.424 0.008 0.000 0.524
#> GSM97092     6  0.4805    0.14248 0.016 0.012 0.468 0.008 0.000 0.496
#> GSM97093     3  0.6184    0.55232 0.064 0.100 0.660 0.084 0.000 0.092
#> GSM97058     3  0.6957    0.40288 0.060 0.208 0.556 0.104 0.000 0.072
#> GSM97051     3  0.5310    0.48954 0.024 0.076 0.684 0.192 0.000 0.024
#> GSM97052     3  0.4591   -0.01563 0.008 0.012 0.552 0.008 0.000 0.420
#> GSM97061     3  0.4377    0.50949 0.000 0.040 0.728 0.028 0.000 0.204

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-skmeans-membership-heatmap-5

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)

plot of chunk tab-CV-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-CV-skmeans-get-signatures-no-scale-1

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

plot of chunk tab-CV-skmeans-get-signatures-no-scale-2

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

plot of chunk tab-CV-skmeans-get-signatures-no-scale-3

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

plot of chunk tab-CV-skmeans-get-signatures-no-scale-4

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

plot of chunk tab-CV-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-skmeans-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-CV-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-skmeans-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:skmeans 99         9.78e-04      0.4095     3.76e-12   0.1858 2
#> CV:skmeans 91         2.44e-05      0.4304     4.93e-14   0.3416 3
#> CV:skmeans 72         1.31e-05      0.0481     5.42e-14   0.0260 4
#> CV:skmeans 40         2.93e-03      0.2278     5.02e-06   0.2191 5
#> CV:skmeans 45         7.18e-03      0.3311     6.31e-08   0.0441 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.


CV:pam

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "pam"]
# 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 21512 rows and 100 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 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)

plot of chunk CV-pam-collect-plots

The plots are:

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:

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)

plot of chunk CV-pam-select-partition-number

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.344           0.538       0.787         0.4632 0.576   0.576
#> 3 3 0.494           0.720       0.855         0.4006 0.634   0.431
#> 4 4 0.579           0.747       0.830         0.0954 0.901   0.737
#> 5 5 0.565           0.476       0.739         0.0776 0.943   0.820
#> 6 6 0.594           0.404       0.661         0.0511 0.884   0.613

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.9996     0.4693 0.512 0.488
#> GSM97145     1  0.9909     0.5379 0.556 0.444
#> GSM97147     2  0.9833     0.4931 0.424 0.576
#> GSM97125     1  0.9833     0.5574 0.576 0.424
#> GSM97127     1  0.5408     0.6363 0.876 0.124
#> GSM97130     1  0.0000     0.6241 1.000 0.000
#> GSM97133     1  0.0000     0.6241 1.000 0.000
#> GSM97134     1  0.3114     0.5985 0.944 0.056
#> GSM97120     2  0.9998    -0.4617 0.492 0.508
#> GSM97126     2  0.9954    -0.0792 0.460 0.540
#> GSM97112     1  0.9833     0.5574 0.576 0.424
#> GSM97115     2  0.9983     0.4332 0.476 0.524
#> GSM97116     1  0.7950     0.6265 0.760 0.240
#> GSM97117     2  0.0000     0.6848 0.000 1.000
#> GSM97119     1  0.9833     0.5574 0.576 0.424
#> GSM97122     1  0.9710     0.5719 0.600 0.400
#> GSM97135     1  0.9833     0.5574 0.576 0.424
#> GSM97136     2  0.4690     0.5755 0.100 0.900
#> GSM97139     1  0.9209     0.5994 0.664 0.336
#> GSM97146     1  0.0938     0.6220 0.988 0.012
#> GSM97123     2  0.9087     0.5454 0.324 0.676
#> GSM97129     2  0.7056     0.4206 0.192 0.808
#> GSM97143     2  0.9850    -0.3166 0.428 0.572
#> GSM97113     2  0.1843     0.6791 0.028 0.972
#> GSM97056     1  0.0000     0.6241 1.000 0.000
#> GSM97124     1  0.9954     0.5184 0.540 0.460
#> GSM97132     1  0.8386     0.5961 0.732 0.268
#> GSM97144     1  0.2043     0.6143 0.968 0.032
#> GSM97149     1  0.2948     0.6010 0.948 0.052
#> GSM97068     2  0.9833     0.4931 0.424 0.576
#> GSM97071     2  0.9963     0.4275 0.464 0.536
#> GSM97086     2  0.9833     0.4931 0.424 0.576
#> GSM97103     2  0.0000     0.6848 0.000 1.000
#> GSM97057     2  0.9833     0.4931 0.424 0.576
#> GSM97060     2  0.0000     0.6848 0.000 1.000
#> GSM97075     2  0.0000     0.6848 0.000 1.000
#> GSM97098     2  0.0000     0.6848 0.000 1.000
#> GSM97099     2  0.0000     0.6848 0.000 1.000
#> GSM97101     2  0.0000     0.6848 0.000 1.000
#> GSM97105     2  0.9833     0.4931 0.424 0.576
#> GSM97106     2  0.0000     0.6848 0.000 1.000
#> GSM97121     2  0.9833     0.4931 0.424 0.576
#> GSM97128     1  0.9635     0.0586 0.612 0.388
#> GSM97131     2  0.1843     0.6794 0.028 0.972
#> GSM97137     1  0.3114     0.5950 0.944 0.056
#> GSM97118     2  0.9833    -0.2917 0.424 0.576
#> GSM97114     2  0.0938     0.6753 0.012 0.988
#> GSM97142     1  0.9833     0.5574 0.576 0.424
#> GSM97140     2  0.9833     0.4931 0.424 0.576
#> GSM97141     2  0.0000     0.6848 0.000 1.000
#> GSM97055     2  0.8661     0.1445 0.288 0.712
#> GSM97090     1  0.6973     0.4149 0.812 0.188
#> GSM97091     1  0.9881     0.5471 0.564 0.436
#> GSM97148     1  0.0376     0.6238 0.996 0.004
#> GSM97063     1  0.9833     0.5574 0.576 0.424
#> GSM97053     1  0.0000     0.6241 1.000 0.000
#> GSM97066     2  0.0672     0.6797 0.008 0.992
#> GSM97079     2  0.9833     0.4931 0.424 0.576
#> GSM97083     1  0.2423     0.6101 0.960 0.040
#> GSM97084     2  0.9922     0.4693 0.448 0.552
#> GSM97094     2  0.9087     0.4177 0.324 0.676
#> GSM97096     2  0.0000     0.6848 0.000 1.000
#> GSM97097     2  0.0000     0.6848 0.000 1.000
#> GSM97107     2  0.7219     0.5970 0.200 0.800
#> GSM97054     2  0.9896     0.4788 0.440 0.560
#> GSM97062     2  0.9993     0.4207 0.484 0.516
#> GSM97069     2  0.0000     0.6848 0.000 1.000
#> GSM97070     2  0.0376     0.6823 0.004 0.996
#> GSM97073     2  0.0000     0.6848 0.000 1.000
#> GSM97076     2  0.9963     0.4445 0.464 0.536
#> GSM97077     2  0.9833     0.4931 0.424 0.576
#> GSM97095     2  0.9970     0.4445 0.468 0.532
#> GSM97102     2  0.0000     0.6848 0.000 1.000
#> GSM97109     2  0.0376     0.6818 0.004 0.996
#> GSM97110     2  0.0000     0.6848 0.000 1.000
#> GSM97074     1  0.9358     0.5776 0.648 0.352
#> GSM97085     2  0.4022     0.6105 0.080 0.920
#> GSM97059     2  0.9833     0.4931 0.424 0.576
#> GSM97072     2  0.0000     0.6848 0.000 1.000
#> GSM97078     1  0.9087     0.0565 0.676 0.324
#> GSM97067     2  0.0938     0.6768 0.012 0.988
#> GSM97087     2  0.0000     0.6848 0.000 1.000
#> GSM97111     2  0.0000     0.6848 0.000 1.000
#> GSM97064     2  0.9833     0.4931 0.424 0.576
#> GSM97065     2  0.8909     0.5526 0.308 0.692
#> GSM97081     2  0.0000     0.6848 0.000 1.000
#> GSM97082     2  0.0000     0.6848 0.000 1.000
#> GSM97088     2  0.5946     0.5963 0.144 0.856
#> GSM97100     2  0.9833     0.4931 0.424 0.576
#> GSM97104     2  0.0000     0.6848 0.000 1.000
#> GSM97108     2  0.0000     0.6848 0.000 1.000
#> GSM97050     2  0.9850     0.4891 0.428 0.572
#> GSM97080     2  0.0000     0.6848 0.000 1.000
#> GSM97089     2  0.1843     0.6608 0.028 0.972
#> GSM97092     2  0.0000     0.6848 0.000 1.000
#> GSM97093     2  0.9909     0.4715 0.444 0.556
#> GSM97058     2  0.9833     0.4931 0.424 0.576
#> GSM97051     2  0.9833     0.4931 0.424 0.576
#> GSM97052     2  0.0000     0.6848 0.000 1.000
#> GSM97061     2  0.5408     0.6424 0.124 0.876

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.5785    0.49417 0.668 0.000 0.332
#> GSM97145     1  0.1585    0.79583 0.964 0.008 0.028
#> GSM97147     2  0.3921    0.74401 0.112 0.872 0.016
#> GSM97125     1  0.0592    0.80012 0.988 0.000 0.012
#> GSM97127     1  0.0747    0.79577 0.984 0.016 0.000
#> GSM97130     2  0.4291    0.70302 0.180 0.820 0.000
#> GSM97133     1  0.5591    0.45711 0.696 0.304 0.000
#> GSM97134     2  0.6154    0.29846 0.408 0.592 0.000
#> GSM97120     1  0.5650    0.50114 0.688 0.000 0.312
#> GSM97126     1  0.9464    0.16284 0.412 0.180 0.408
#> GSM97112     1  0.0424    0.79989 0.992 0.008 0.000
#> GSM97115     2  0.4068    0.77801 0.016 0.864 0.120
#> GSM97116     1  0.2569    0.79029 0.936 0.032 0.032
#> GSM97117     3  0.4178    0.83119 0.000 0.172 0.828
#> GSM97119     1  0.0747    0.79964 0.984 0.016 0.000
#> GSM97122     1  0.0747    0.79964 0.984 0.016 0.000
#> GSM97135     1  0.0424    0.79989 0.992 0.008 0.000
#> GSM97136     3  0.5633    0.68104 0.208 0.024 0.768
#> GSM97139     1  0.1015    0.79911 0.980 0.008 0.012
#> GSM97146     1  0.6079    0.27021 0.612 0.388 0.000
#> GSM97123     2  0.6079    0.27612 0.000 0.612 0.388
#> GSM97129     3  0.8623    0.57857 0.224 0.176 0.600
#> GSM97143     3  0.6228    0.46777 0.316 0.012 0.672
#> GSM97113     3  0.3038    0.85387 0.000 0.104 0.896
#> GSM97056     2  0.4702    0.68301 0.212 0.788 0.000
#> GSM97124     1  0.2998    0.78219 0.916 0.016 0.068
#> GSM97132     1  0.8483    0.47821 0.600 0.260 0.140
#> GSM97144     2  0.5070    0.66412 0.224 0.772 0.004
#> GSM97149     2  0.6143    0.55586 0.304 0.684 0.012
#> GSM97068     2  0.2066    0.80644 0.000 0.940 0.060
#> GSM97071     2  0.3030    0.78495 0.004 0.904 0.092
#> GSM97086     2  0.0747    0.80348 0.000 0.984 0.016
#> GSM97103     3  0.0237    0.87879 0.000 0.004 0.996
#> GSM97057     2  0.3482    0.78221 0.000 0.872 0.128
#> GSM97060     3  0.1031    0.87829 0.000 0.024 0.976
#> GSM97075     3  0.4002    0.84011 0.000 0.160 0.840
#> GSM97098     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97099     3  0.2165    0.87250 0.000 0.064 0.936
#> GSM97101     3  0.2165    0.87250 0.000 0.064 0.936
#> GSM97105     2  0.3340    0.75580 0.000 0.880 0.120
#> GSM97106     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97121     2  0.2066    0.79523 0.000 0.940 0.060
#> GSM97128     2  0.8109    0.46822 0.272 0.620 0.108
#> GSM97131     3  0.4654    0.80703 0.000 0.208 0.792
#> GSM97137     2  0.5174    0.73456 0.128 0.824 0.048
#> GSM97118     3  0.8840   -0.14645 0.428 0.116 0.456
#> GSM97114     3  0.7348    0.73663 0.120 0.176 0.704
#> GSM97142     1  0.0592    0.80013 0.988 0.012 0.000
#> GSM97140     2  0.0747    0.80348 0.000 0.984 0.016
#> GSM97141     3  0.2165    0.87250 0.000 0.064 0.936
#> GSM97055     1  0.9395    0.00244 0.432 0.172 0.396
#> GSM97090     2  0.4575    0.71215 0.160 0.828 0.012
#> GSM97091     1  0.2383    0.79050 0.940 0.016 0.044
#> GSM97148     1  0.6081    0.38453 0.652 0.344 0.004
#> GSM97063     1  0.0592    0.80013 0.988 0.012 0.000
#> GSM97053     1  0.0000    0.79900 1.000 0.000 0.000
#> GSM97066     3  0.0237    0.87926 0.000 0.004 0.996
#> GSM97079     2  0.3340    0.79296 0.000 0.880 0.120
#> GSM97083     2  0.5216    0.62087 0.260 0.740 0.000
#> GSM97084     2  0.0592    0.80337 0.000 0.988 0.012
#> GSM97094     2  0.7741    0.29012 0.056 0.568 0.376
#> GSM97096     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97097     3  0.2959    0.85824 0.000 0.100 0.900
#> GSM97107     2  0.6566    0.29577 0.012 0.612 0.376
#> GSM97054     2  0.2796    0.79773 0.000 0.908 0.092
#> GSM97062     2  0.1491    0.80320 0.016 0.968 0.016
#> GSM97069     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97070     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97073     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97076     2  0.7065    0.60464 0.040 0.644 0.316
#> GSM97077     2  0.0747    0.80348 0.000 0.984 0.016
#> GSM97095     2  0.0829    0.80354 0.004 0.984 0.012
#> GSM97102     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97109     3  0.0829    0.87911 0.004 0.012 0.984
#> GSM97110     3  0.0592    0.87933 0.000 0.012 0.988
#> GSM97074     1  0.7741    0.61313 0.660 0.104 0.236
#> GSM97085     3  0.2269    0.85212 0.040 0.016 0.944
#> GSM97059     2  0.0747    0.80348 0.000 0.984 0.016
#> GSM97072     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97078     2  0.5883    0.73498 0.112 0.796 0.092
#> GSM97067     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97087     3  0.1289    0.87797 0.000 0.032 0.968
#> GSM97111     3  0.4178    0.83119 0.000 0.172 0.828
#> GSM97064     2  0.1031    0.80563 0.000 0.976 0.024
#> GSM97065     2  0.6683    0.18991 0.008 0.500 0.492
#> GSM97081     3  0.4062    0.83560 0.000 0.164 0.836
#> GSM97082     3  0.3941    0.83900 0.000 0.156 0.844
#> GSM97088     3  0.6372    0.70102 0.084 0.152 0.764
#> GSM97100     2  0.0747    0.80348 0.000 0.984 0.016
#> GSM97104     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97108     3  0.4235    0.82957 0.000 0.176 0.824
#> GSM97050     2  0.3412    0.79384 0.000 0.876 0.124
#> GSM97080     3  0.0237    0.87926 0.000 0.004 0.996
#> GSM97089     3  0.0000    0.87850 0.000 0.000 1.000
#> GSM97092     3  0.4121    0.83334 0.000 0.168 0.832
#> GSM97093     2  0.4700    0.75132 0.008 0.812 0.180
#> GSM97058     2  0.1411    0.80473 0.000 0.964 0.036
#> GSM97051     2  0.1289    0.80296 0.000 0.968 0.032
#> GSM97052     3  0.4121    0.83334 0.000 0.168 0.832
#> GSM97061     3  0.5529    0.68934 0.000 0.296 0.704

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.0000      0.921 1.000 0.000 0.000 0.000
#> GSM97145     1  0.0992      0.913 0.976 0.004 0.008 0.012
#> GSM97147     2  0.2300      0.782 0.000 0.920 0.016 0.064
#> GSM97125     1  0.0336      0.920 0.992 0.000 0.000 0.008
#> GSM97127     1  0.0336      0.919 0.992 0.000 0.000 0.008
#> GSM97130     2  0.3754      0.740 0.064 0.852 0.000 0.084
#> GSM97133     1  0.0469      0.914 0.988 0.012 0.000 0.000
#> GSM97134     2  0.5952      0.589 0.184 0.692 0.000 0.124
#> GSM97120     1  0.0469      0.913 0.988 0.000 0.012 0.000
#> GSM97126     3  0.8030      0.337 0.164 0.300 0.504 0.032
#> GSM97112     4  0.3649      0.809 0.204 0.000 0.000 0.796
#> GSM97115     2  0.3659      0.759 0.016 0.868 0.032 0.084
#> GSM97116     1  0.0000      0.921 1.000 0.000 0.000 0.000
#> GSM97117     3  0.4872      0.804 0.000 0.148 0.776 0.076
#> GSM97119     4  0.3610      0.809 0.200 0.000 0.000 0.800
#> GSM97122     1  0.4605      0.386 0.664 0.000 0.000 0.336
#> GSM97135     1  0.2921      0.776 0.860 0.000 0.000 0.140
#> GSM97136     3  0.4007      0.815 0.068 0.020 0.856 0.056
#> GSM97139     1  0.0000      0.921 1.000 0.000 0.000 0.000
#> GSM97146     1  0.0000      0.921 1.000 0.000 0.000 0.000
#> GSM97123     2  0.6684      0.260 0.000 0.560 0.336 0.104
#> GSM97129     3  0.6137      0.797 0.044 0.152 0.728 0.076
#> GSM97143     3  0.5911      0.649 0.196 0.000 0.692 0.112
#> GSM97113     3  0.5339      0.758 0.088 0.144 0.760 0.008
#> GSM97056     2  0.4990      0.484 0.352 0.640 0.000 0.008
#> GSM97124     3  0.7506      0.250 0.308 0.000 0.484 0.208
#> GSM97132     2  0.8758      0.387 0.164 0.500 0.236 0.100
#> GSM97144     2  0.4581      0.708 0.080 0.800 0.000 0.120
#> GSM97149     1  0.2480      0.811 0.904 0.088 0.008 0.000
#> GSM97068     2  0.0804      0.797 0.000 0.980 0.012 0.008
#> GSM97071     2  0.3833      0.773 0.000 0.848 0.080 0.072
#> GSM97086     2  0.0188      0.796 0.000 0.996 0.000 0.004
#> GSM97103     3  0.1022      0.833 0.000 0.000 0.968 0.032
#> GSM97057     2  0.3450      0.759 0.084 0.872 0.040 0.004
#> GSM97060     3  0.2179      0.826 0.000 0.012 0.924 0.064
#> GSM97075     3  0.4775      0.809 0.000 0.140 0.784 0.076
#> GSM97098     3  0.0469      0.829 0.000 0.000 0.988 0.012
#> GSM97099     3  0.4318      0.822 0.000 0.116 0.816 0.068
#> GSM97101     3  0.4344      0.822 0.000 0.108 0.816 0.076
#> GSM97105     2  0.4318      0.729 0.000 0.816 0.116 0.068
#> GSM97106     3  0.1637      0.824 0.000 0.000 0.940 0.060
#> GSM97121     2  0.3323      0.768 0.000 0.876 0.060 0.064
#> GSM97128     4  0.4576      0.596 0.012 0.260 0.000 0.728
#> GSM97131     3  0.5021      0.784 0.000 0.180 0.756 0.064
#> GSM97137     2  0.3741      0.739 0.036 0.852 0.004 0.108
#> GSM97118     3  0.8463      0.309 0.064 0.156 0.492 0.288
#> GSM97114     3  0.5390      0.814 0.028 0.120 0.776 0.076
#> GSM97142     4  0.3649      0.808 0.204 0.000 0.000 0.796
#> GSM97140     2  0.2489      0.780 0.000 0.912 0.020 0.068
#> GSM97141     3  0.4344      0.822 0.000 0.108 0.816 0.076
#> GSM97055     4  0.4274      0.740 0.120 0.040 0.012 0.828
#> GSM97090     2  0.3470      0.732 0.008 0.852 0.008 0.132
#> GSM97091     4  0.3688      0.806 0.208 0.000 0.000 0.792
#> GSM97148     1  0.0707      0.908 0.980 0.020 0.000 0.000
#> GSM97063     4  0.4222      0.733 0.272 0.000 0.000 0.728
#> GSM97053     1  0.2530      0.830 0.888 0.000 0.000 0.112
#> GSM97066     3  0.3088      0.809 0.000 0.008 0.864 0.128
#> GSM97079     2  0.3088      0.771 0.000 0.864 0.128 0.008
#> GSM97083     4  0.3542      0.766 0.028 0.120 0.000 0.852
#> GSM97084     2  0.0657      0.796 0.000 0.984 0.004 0.012
#> GSM97094     2  0.6815      0.230 0.016 0.552 0.364 0.068
#> GSM97096     3  0.0817      0.828 0.000 0.000 0.976 0.024
#> GSM97097     3  0.3088      0.834 0.000 0.060 0.888 0.052
#> GSM97107     2  0.6626      0.248 0.000 0.544 0.364 0.092
#> GSM97054     2  0.1584      0.795 0.000 0.952 0.036 0.012
#> GSM97062     2  0.2053      0.777 0.000 0.924 0.004 0.072
#> GSM97069     3  0.2530      0.811 0.000 0.000 0.888 0.112
#> GSM97070     3  0.2255      0.835 0.000 0.012 0.920 0.068
#> GSM97073     3  0.1118      0.830 0.000 0.000 0.964 0.036
#> GSM97076     2  0.6791      0.667 0.036 0.668 0.192 0.104
#> GSM97077     2  0.0000      0.796 0.000 1.000 0.000 0.000
#> GSM97095     2  0.0336      0.796 0.000 0.992 0.000 0.008
#> GSM97102     3  0.2081      0.812 0.000 0.000 0.916 0.084
#> GSM97109     3  0.3349      0.826 0.064 0.004 0.880 0.052
#> GSM97110     3  0.3241      0.816 0.040 0.072 0.884 0.004
#> GSM97074     4  0.2973      0.815 0.144 0.000 0.000 0.856
#> GSM97085     4  0.2530      0.735 0.000 0.000 0.112 0.888
#> GSM97059     2  0.1635      0.791 0.000 0.948 0.008 0.044
#> GSM97072     3  0.1022      0.826 0.000 0.000 0.968 0.032
#> GSM97078     2  0.5300      0.371 0.000 0.580 0.012 0.408
#> GSM97067     3  0.2530      0.804 0.000 0.000 0.888 0.112
#> GSM97087     3  0.3697      0.834 0.000 0.048 0.852 0.100
#> GSM97111     3  0.4872      0.804 0.000 0.148 0.776 0.076
#> GSM97064     2  0.1545      0.797 0.000 0.952 0.008 0.040
#> GSM97065     2  0.7404      0.336 0.096 0.508 0.372 0.024
#> GSM97081     3  0.4605      0.816 0.000 0.132 0.796 0.072
#> GSM97082     3  0.5528      0.812 0.000 0.124 0.732 0.144
#> GSM97088     4  0.2945      0.772 0.012 0.052 0.032 0.904
#> GSM97100     2  0.2413      0.781 0.000 0.916 0.020 0.064
#> GSM97104     3  0.2530      0.803 0.000 0.000 0.888 0.112
#> GSM97108     3  0.4829      0.803 0.000 0.156 0.776 0.068
#> GSM97050     2  0.3464      0.779 0.000 0.860 0.108 0.032
#> GSM97080     3  0.2944      0.807 0.000 0.004 0.868 0.128
#> GSM97089     3  0.1888      0.830 0.016 0.000 0.940 0.044
#> GSM97092     3  0.5314      0.811 0.000 0.144 0.748 0.108
#> GSM97093     2  0.4185      0.751 0.012 0.832 0.120 0.036
#> GSM97058     2  0.2797      0.782 0.000 0.900 0.032 0.068
#> GSM97051     2  0.2706      0.777 0.000 0.900 0.020 0.080
#> GSM97052     3  0.5110      0.824 0.000 0.132 0.764 0.104
#> GSM97061     3  0.6323      0.655 0.000 0.272 0.628 0.100

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.0290    0.84673 0.992 0.000 0.000 0.000 0.008
#> GSM97145     1  0.3878    0.80127 0.808 0.144 0.012 0.000 0.036
#> GSM97147     4  0.5414    0.66665 0.000 0.140 0.200 0.660 0.000
#> GSM97125     1  0.4887    0.74170 0.720 0.148 0.000 0.000 0.132
#> GSM97127     1  0.4437    0.77404 0.760 0.140 0.000 0.000 0.100
#> GSM97130     4  0.2523    0.75020 0.028 0.024 0.000 0.908 0.040
#> GSM97133     1  0.2329    0.82391 0.876 0.124 0.000 0.000 0.000
#> GSM97134     4  0.4017    0.71173 0.060 0.032 0.000 0.824 0.084
#> GSM97120     1  0.2068    0.83451 0.904 0.092 0.000 0.000 0.004
#> GSM97126     3  0.8545    0.09581 0.152 0.156 0.436 0.228 0.028
#> GSM97112     5  0.1544    0.71553 0.068 0.000 0.000 0.000 0.932
#> GSM97115     4  0.1967    0.75981 0.000 0.012 0.020 0.932 0.036
#> GSM97116     1  0.0000    0.84787 1.000 0.000 0.000 0.000 0.000
#> GSM97117     3  0.2079    0.45252 0.000 0.020 0.916 0.064 0.000
#> GSM97119     5  0.3868    0.63113 0.060 0.140 0.000 0.000 0.800
#> GSM97122     5  0.5744    0.18789 0.332 0.104 0.000 0.000 0.564
#> GSM97135     1  0.4114    0.42749 0.624 0.000 0.000 0.000 0.376
#> GSM97136     3  0.5985    0.10151 0.004 0.372 0.544 0.016 0.064
#> GSM97139     1  0.0000    0.84787 1.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000    0.84787 1.000 0.000 0.000 0.000 0.000
#> GSM97123     3  0.6822   -0.00214 0.000 0.332 0.348 0.320 0.000
#> GSM97129     3  0.4017    0.38972 0.000 0.148 0.788 0.064 0.000
#> GSM97143     3  0.5933    0.20668 0.080 0.028 0.676 0.016 0.200
#> GSM97113     3  0.4795    0.29682 0.032 0.020 0.740 0.200 0.008
#> GSM97056     4  0.4299    0.38490 0.388 0.000 0.000 0.608 0.004
#> GSM97124     5  0.7871    0.27542 0.128 0.188 0.220 0.000 0.464
#> GSM97132     4  0.8131    0.22440 0.080 0.028 0.204 0.476 0.212
#> GSM97144     4  0.3152    0.73312 0.016 0.032 0.000 0.868 0.084
#> GSM97149     1  0.0703    0.83118 0.976 0.000 0.000 0.024 0.000
#> GSM97068     4  0.1197    0.78222 0.000 0.000 0.048 0.952 0.000
#> GSM97071     4  0.4475    0.73913 0.000 0.056 0.180 0.756 0.008
#> GSM97086     4  0.1124    0.78074 0.000 0.004 0.036 0.960 0.000
#> GSM97103     3  0.3612    0.27222 0.000 0.228 0.764 0.000 0.008
#> GSM97057     4  0.2308    0.76809 0.036 0.004 0.048 0.912 0.000
#> GSM97060     3  0.4747   -0.41435 0.000 0.484 0.500 0.000 0.016
#> GSM97075     3  0.1983    0.45592 0.000 0.008 0.924 0.060 0.008
#> GSM97098     3  0.4288    0.13340 0.000 0.324 0.664 0.000 0.012
#> GSM97099     3  0.1356    0.45601 0.000 0.004 0.956 0.028 0.012
#> GSM97101     3  0.1356    0.45510 0.000 0.004 0.956 0.028 0.012
#> GSM97105     4  0.4687    0.65016 0.000 0.040 0.288 0.672 0.000
#> GSM97106     2  0.4150    0.42072 0.000 0.612 0.388 0.000 0.000
#> GSM97121     4  0.4384    0.70369 0.000 0.044 0.228 0.728 0.000
#> GSM97128     5  0.5411    0.64957 0.000 0.176 0.000 0.160 0.664
#> GSM97131     3  0.3003    0.43863 0.000 0.044 0.864 0.092 0.000
#> GSM97137     4  0.1901    0.75682 0.024 0.004 0.000 0.932 0.040
#> GSM97118     3  0.7134   -0.04190 0.008 0.028 0.428 0.144 0.392
#> GSM97114     3  0.4725    0.40391 0.040 0.128 0.772 0.060 0.000
#> GSM97142     5  0.1478    0.71668 0.064 0.000 0.000 0.000 0.936
#> GSM97140     4  0.4129    0.72147 0.000 0.040 0.204 0.756 0.000
#> GSM97141     3  0.1243    0.45589 0.000 0.004 0.960 0.028 0.008
#> GSM97055     5  0.5859    0.67425 0.064 0.152 0.040 0.032 0.712
#> GSM97090     4  0.1626    0.75727 0.000 0.016 0.000 0.940 0.044
#> GSM97091     5  0.1410    0.71706 0.060 0.000 0.000 0.000 0.940
#> GSM97148     1  0.0162    0.84638 0.996 0.000 0.000 0.004 0.000
#> GSM97063     5  0.1851    0.70467 0.088 0.000 0.000 0.000 0.912
#> GSM97053     1  0.5260    0.44135 0.592 0.060 0.000 0.000 0.348
#> GSM97066     2  0.5289    0.51135 0.000 0.500 0.452 0.000 0.048
#> GSM97079     4  0.4205    0.71393 0.000 0.164 0.056 0.776 0.004
#> GSM97083     5  0.4972    0.69923 0.008 0.172 0.000 0.096 0.724
#> GSM97084     4  0.1267    0.78066 0.000 0.012 0.024 0.960 0.004
#> GSM97094     4  0.6361    0.14190 0.000 0.048 0.412 0.484 0.056
#> GSM97096     3  0.4341   -0.00957 0.000 0.404 0.592 0.000 0.004
#> GSM97097     3  0.4735    0.26337 0.000 0.304 0.664 0.024 0.008
#> GSM97107     4  0.5993    0.09429 0.000 0.056 0.440 0.480 0.024
#> GSM97054     4  0.1662    0.77893 0.000 0.004 0.056 0.936 0.004
#> GSM97062     4  0.1168    0.76514 0.000 0.008 0.000 0.960 0.032
#> GSM97069     3  0.5086   -0.39196 0.000 0.396 0.564 0.000 0.040
#> GSM97070     3  0.4595    0.13761 0.000 0.236 0.716 0.004 0.044
#> GSM97073     3  0.3958    0.24523 0.000 0.184 0.776 0.000 0.040
#> GSM97076     4  0.6098    0.65532 0.080 0.016 0.168 0.684 0.052
#> GSM97077     4  0.1768    0.78011 0.000 0.004 0.072 0.924 0.000
#> GSM97095     4  0.1116    0.78078 0.000 0.004 0.028 0.964 0.004
#> GSM97102     3  0.4446   -0.22938 0.000 0.476 0.520 0.000 0.004
#> GSM97109     3  0.5210    0.25127 0.088 0.200 0.700 0.000 0.012
#> GSM97110     3  0.4794    0.32404 0.052 0.112 0.784 0.040 0.012
#> GSM97074     5  0.4319    0.71648 0.028 0.176 0.000 0.024 0.772
#> GSM97085     5  0.4268    0.65580 0.000 0.268 0.000 0.024 0.708
#> GSM97059     4  0.3370    0.75575 0.000 0.028 0.148 0.824 0.000
#> GSM97072     3  0.4227   -0.04408 0.000 0.420 0.580 0.000 0.000
#> GSM97078     4  0.6544    0.11871 0.000 0.196 0.004 0.492 0.308
#> GSM97067     3  0.5344   -0.51177 0.000 0.448 0.500 0.000 0.052
#> GSM97087     3  0.5679   -0.27590 0.000 0.364 0.560 0.008 0.068
#> GSM97111     3  0.3055    0.44508 0.000 0.072 0.864 0.064 0.000
#> GSM97064     4  0.3233    0.77733 0.000 0.028 0.112 0.852 0.008
#> GSM97065     4  0.6911    0.29269 0.108 0.020 0.356 0.496 0.020
#> GSM97081     3  0.3260    0.44281 0.000 0.084 0.856 0.056 0.004
#> GSM97082     3  0.5670   -0.40932 0.000 0.452 0.488 0.016 0.044
#> GSM97088     5  0.5155    0.61679 0.000 0.284 0.020 0.036 0.660
#> GSM97100     4  0.4096    0.72357 0.000 0.040 0.200 0.760 0.000
#> GSM97104     2  0.3752    0.57388 0.000 0.708 0.292 0.000 0.000
#> GSM97108     3  0.2504    0.44666 0.000 0.040 0.896 0.064 0.000
#> GSM97050     4  0.3443    0.76499 0.000 0.076 0.060 0.852 0.012
#> GSM97080     2  0.5204    0.58878 0.000 0.560 0.392 0.000 0.048
#> GSM97089     3  0.4387    0.21529 0.000 0.232 0.732 0.008 0.028
#> GSM97092     3  0.4941    0.24437 0.000 0.244 0.696 0.048 0.012
#> GSM97093     4  0.3089    0.75590 0.000 0.076 0.040 0.872 0.012
#> GSM97058     4  0.3977    0.72908 0.000 0.032 0.204 0.764 0.000
#> GSM97051     4  0.4369    0.71500 0.000 0.052 0.208 0.740 0.000
#> GSM97052     3  0.5007    0.05043 0.000 0.320 0.640 0.024 0.016
#> GSM97061     3  0.5638    0.23258 0.000 0.192 0.636 0.172 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.0146    0.79622 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97145     1  0.3969    0.63128 0.644 0.000 0.008 0.000 0.344 0.004
#> GSM97147     2  0.5887   -0.29796 0.000 0.408 0.000 0.392 0.200 0.000
#> GSM97125     1  0.4172    0.47184 0.528 0.000 0.000 0.000 0.460 0.012
#> GSM97127     1  0.3706    0.59873 0.620 0.000 0.000 0.000 0.380 0.000
#> GSM97130     4  0.3142    0.68249 0.016 0.000 0.000 0.848 0.044 0.092
#> GSM97133     1  0.2730    0.73418 0.808 0.000 0.000 0.000 0.192 0.000
#> GSM97134     4  0.3703    0.64464 0.000 0.000 0.000 0.788 0.108 0.104
#> GSM97120     1  0.2178    0.76330 0.868 0.000 0.000 0.000 0.132 0.000
#> GSM97126     5  0.8931   -0.10182 0.124 0.212 0.024 0.256 0.296 0.088
#> GSM97112     5  0.3857    0.48319 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM97115     4  0.1148    0.72511 0.000 0.016 0.000 0.960 0.004 0.020
#> GSM97116     1  0.0000    0.79817 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97117     2  0.1854    0.43603 0.000 0.932 0.016 0.028 0.020 0.004
#> GSM97119     5  0.2912    0.50403 0.000 0.000 0.000 0.000 0.784 0.216
#> GSM97122     5  0.3825    0.48287 0.160 0.000 0.000 0.000 0.768 0.072
#> GSM97135     1  0.4097   -0.07167 0.504 0.000 0.000 0.000 0.488 0.008
#> GSM97136     3  0.7441    0.35331 0.004 0.288 0.376 0.008 0.244 0.080
#> GSM97139     1  0.0000    0.79817 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000    0.79817 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97123     2  0.7487    0.15099 0.000 0.400 0.316 0.184 0.048 0.052
#> GSM97129     2  0.5237    0.29600 0.000 0.652 0.024 0.036 0.260 0.028
#> GSM97143     2  0.6392    0.08929 0.012 0.456 0.012 0.024 0.400 0.096
#> GSM97113     2  0.5983    0.18845 0.012 0.588 0.036 0.292 0.016 0.056
#> GSM97056     4  0.3955    0.30015 0.436 0.000 0.000 0.560 0.004 0.000
#> GSM97124     5  0.3401    0.43082 0.036 0.072 0.000 0.000 0.840 0.052
#> GSM97132     4  0.7850    0.08025 0.048 0.188 0.000 0.412 0.248 0.104
#> GSM97144     4  0.3566    0.64839 0.000 0.000 0.000 0.800 0.096 0.104
#> GSM97149     1  0.0000    0.79817 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97068     4  0.1686    0.73473 0.000 0.064 0.000 0.924 0.000 0.012
#> GSM97071     4  0.5187    0.63741 0.000 0.196 0.012 0.688 0.032 0.072
#> GSM97086     4  0.1663    0.73030 0.000 0.088 0.000 0.912 0.000 0.000
#> GSM97103     2  0.5290   -0.33089 0.000 0.496 0.440 0.012 0.036 0.016
#> GSM97057     4  0.2466    0.72408 0.028 0.052 0.000 0.896 0.000 0.024
#> GSM97060     3  0.5165    0.38865 0.000 0.244 0.636 0.000 0.012 0.108
#> GSM97075     2  0.1971    0.43587 0.000 0.928 0.016 0.024 0.008 0.024
#> GSM97098     3  0.5285    0.53489 0.000 0.376 0.556 0.012 0.032 0.024
#> GSM97099     2  0.2601    0.40021 0.000 0.896 0.040 0.012 0.016 0.036
#> GSM97101     2  0.2627    0.40494 0.000 0.892 0.032 0.008 0.016 0.052
#> GSM97105     4  0.4644    0.45342 0.000 0.440 0.004 0.524 0.032 0.000
#> GSM97106     3  0.2201    0.54455 0.000 0.056 0.904 0.000 0.004 0.036
#> GSM97121     4  0.4494    0.47772 0.000 0.424 0.000 0.544 0.032 0.000
#> GSM97128     6  0.5631    0.15575 0.000 0.000 0.016 0.140 0.264 0.580
#> GSM97131     2  0.1856    0.43302 0.000 0.920 0.000 0.048 0.032 0.000
#> GSM97137     4  0.1237    0.72428 0.020 0.000 0.000 0.956 0.004 0.020
#> GSM97118     2  0.7221   -0.01801 0.000 0.384 0.004 0.120 0.344 0.148
#> GSM97114     2  0.3880    0.36686 0.028 0.772 0.000 0.024 0.176 0.000
#> GSM97142     5  0.3857    0.48319 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM97140     4  0.4461    0.50199 0.000 0.404 0.000 0.564 0.032 0.000
#> GSM97141     2  0.2533    0.40369 0.000 0.900 0.032 0.008 0.028 0.032
#> GSM97055     6  0.5247    0.14038 0.056 0.080 0.000 0.012 0.144 0.708
#> GSM97090     4  0.1010    0.72105 0.000 0.000 0.000 0.960 0.004 0.036
#> GSM97091     5  0.3857    0.48319 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM97148     1  0.0000    0.79817 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.3857    0.48319 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM97053     5  0.4742   -0.00636 0.440 0.000 0.000 0.000 0.512 0.048
#> GSM97066     6  0.6352   -0.12436 0.000 0.364 0.228 0.000 0.016 0.392
#> GSM97079     4  0.4842    0.51040 0.000 0.032 0.292 0.648 0.020 0.008
#> GSM97083     6  0.4316    0.21810 0.000 0.000 0.000 0.128 0.144 0.728
#> GSM97084     4  0.1508    0.73501 0.000 0.048 0.004 0.940 0.004 0.004
#> GSM97094     2  0.6816    0.07792 0.000 0.408 0.092 0.392 0.100 0.008
#> GSM97096     3  0.4201    0.61396 0.000 0.280 0.688 0.004 0.020 0.008
#> GSM97097     3  0.5085    0.52961 0.000 0.356 0.584 0.016 0.032 0.012
#> GSM97107     2  0.7226    0.02417 0.000 0.400 0.068 0.388 0.064 0.080
#> GSM97054     4  0.1829    0.73202 0.000 0.056 0.000 0.920 0.000 0.024
#> GSM97062     4  0.0777    0.72670 0.000 0.000 0.000 0.972 0.004 0.024
#> GSM97069     2  0.6292   -0.07868 0.000 0.432 0.284 0.000 0.012 0.272
#> GSM97070     2  0.5814    0.10464 0.000 0.568 0.164 0.000 0.020 0.248
#> GSM97073     2  0.5722   -0.08264 0.000 0.576 0.296 0.004 0.028 0.096
#> GSM97076     4  0.5634    0.65745 0.040 0.060 0.016 0.716 0.056 0.112
#> GSM97077     4  0.2340    0.71367 0.000 0.148 0.000 0.852 0.000 0.000
#> GSM97095     4  0.1531    0.73294 0.000 0.068 0.000 0.928 0.000 0.004
#> GSM97102     3  0.3612    0.62214 0.000 0.200 0.764 0.000 0.000 0.036
#> GSM97109     3  0.6510    0.47111 0.056 0.396 0.468 0.012 0.032 0.036
#> GSM97110     2  0.6131   -0.11208 0.020 0.588 0.288 0.032 0.036 0.036
#> GSM97074     6  0.3714    0.14595 0.000 0.000 0.000 0.044 0.196 0.760
#> GSM97085     6  0.3469    0.27051 0.000 0.000 0.064 0.004 0.120 0.812
#> GSM97059     4  0.3879    0.61694 0.000 0.292 0.000 0.688 0.020 0.000
#> GSM97072     3  0.3445    0.62590 0.000 0.260 0.732 0.000 0.000 0.008
#> GSM97078     4  0.5867    0.10504 0.000 0.000 0.016 0.472 0.128 0.384
#> GSM97067     2  0.6375   -0.07897 0.000 0.404 0.216 0.008 0.008 0.364
#> GSM97087     3  0.6862    0.08895 0.000 0.284 0.396 0.008 0.032 0.280
#> GSM97111     2  0.3083    0.40276 0.000 0.860 0.060 0.028 0.052 0.000
#> GSM97064     4  0.3895    0.71328 0.000 0.108 0.032 0.800 0.000 0.060
#> GSM97065     4  0.7224    0.27961 0.084 0.288 0.032 0.504 0.024 0.068
#> GSM97081     2  0.4940    0.20886 0.000 0.696 0.220 0.028 0.032 0.024
#> GSM97082     6  0.7005   -0.08091 0.000 0.324 0.296 0.012 0.032 0.336
#> GSM97088     6  0.3428    0.30708 0.000 0.004 0.044 0.028 0.084 0.840
#> GSM97100     4  0.4403    0.50162 0.000 0.408 0.000 0.564 0.028 0.000
#> GSM97104     3  0.2962    0.57005 0.000 0.084 0.848 0.000 0.000 0.068
#> GSM97108     2  0.1498    0.43368 0.000 0.940 0.000 0.028 0.032 0.000
#> GSM97050     4  0.3827    0.70724 0.000 0.048 0.060 0.812 0.000 0.080
#> GSM97080     6  0.6702   -0.07831 0.000 0.248 0.352 0.000 0.036 0.364
#> GSM97089     2  0.6089    0.08287 0.000 0.588 0.180 0.012 0.028 0.192
#> GSM97092     2  0.6734    0.28345 0.000 0.560 0.196 0.028 0.064 0.152
#> GSM97093     4  0.3485    0.70438 0.000 0.052 0.024 0.828 0.000 0.096
#> GSM97058     4  0.4570    0.54755 0.000 0.352 0.000 0.608 0.032 0.008
#> GSM97051     4  0.5196    0.48184 0.000 0.396 0.036 0.536 0.032 0.000
#> GSM97052     2  0.6412    0.17980 0.000 0.500 0.308 0.012 0.028 0.152
#> GSM97061     2  0.6639    0.31607 0.000 0.596 0.168 0.124 0.052 0.060

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-pam-membership-heatmap-5

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)

plot of chunk tab-CV-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-CV-pam-get-signatures-no-scale-1

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

plot of chunk tab-CV-pam-get-signatures-no-scale-2

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

plot of chunk tab-CV-pam-get-signatures-no-scale-3

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

plot of chunk tab-CV-pam-get-signatures-no-scale-4

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

plot of chunk tab-CV-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-pam-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-CV-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-pam-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:pam 66         0.001310       0.993     4.68e-11   0.1244 2
#> CV:pam 85         0.000627       0.188     4.51e-08   0.0449 3
#> CV:pam 89         0.002305       0.263     1.49e-06   0.3288 4
#> CV:pam 53         0.004999       0.413     1.39e-03   0.6961 5
#> CV:pam 42         0.007248       0.746     6.80e-04   0.4629 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.


CV:mclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "mclust"]
# 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 21512 rows and 100 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)

plot of chunk CV-mclust-collect-plots

The plots are:

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:

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)

plot of chunk CV-mclust-select-partition-number

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.395           0.736       0.768         0.3575 0.495   0.495
#> 3 3 0.865           0.901       0.950         0.6521 0.795   0.628
#> 4 4 0.529           0.282       0.691         0.1710 0.851   0.675
#> 5 5 0.579           0.499       0.711         0.0934 0.698   0.318
#> 6 6 0.679           0.661       0.809         0.0703 0.845   0.426

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000     0.8743 1.000 0.000
#> GSM97145     1  0.0376     0.8712 0.996 0.004
#> GSM97147     1  0.9209     0.0651 0.664 0.336
#> GSM97125     1  0.0000     0.8743 1.000 0.000
#> GSM97127     1  0.0000     0.8743 1.000 0.000
#> GSM97130     1  0.0000     0.8743 1.000 0.000
#> GSM97133     1  0.0000     0.8743 1.000 0.000
#> GSM97134     1  0.0000     0.8743 1.000 0.000
#> GSM97120     1  0.0000     0.8743 1.000 0.000
#> GSM97126     1  0.0000     0.8743 1.000 0.000
#> GSM97112     1  0.0000     0.8743 1.000 0.000
#> GSM97115     1  0.1414     0.8592 0.980 0.020
#> GSM97116     1  0.0000     0.8743 1.000 0.000
#> GSM97117     2  0.9881     0.8008 0.436 0.564
#> GSM97119     1  0.0000     0.8743 1.000 0.000
#> GSM97122     1  0.0000     0.8743 1.000 0.000
#> GSM97135     1  0.0000     0.8743 1.000 0.000
#> GSM97136     2  0.9881     0.8008 0.436 0.564
#> GSM97139     1  0.0000     0.8743 1.000 0.000
#> GSM97146     1  0.0000     0.8743 1.000 0.000
#> GSM97123     2  0.9866     0.7970 0.432 0.568
#> GSM97129     2  0.9881     0.8008 0.436 0.564
#> GSM97143     1  0.0000     0.8743 1.000 0.000
#> GSM97113     2  0.9881     0.8008 0.436 0.564
#> GSM97056     1  0.0000     0.8743 1.000 0.000
#> GSM97124     1  0.0000     0.8743 1.000 0.000
#> GSM97132     1  0.0000     0.8743 1.000 0.000
#> GSM97144     1  0.0000     0.8743 1.000 0.000
#> GSM97149     1  0.0000     0.8743 1.000 0.000
#> GSM97068     1  0.8861     0.1951 0.696 0.304
#> GSM97071     1  0.6438     0.6848 0.836 0.164
#> GSM97086     2  0.9988     0.7005 0.480 0.520
#> GSM97103     2  0.9881     0.8008 0.436 0.564
#> GSM97057     2  0.9881     0.8008 0.436 0.564
#> GSM97060     2  0.9866     0.7973 0.432 0.568
#> GSM97075     2  0.9881     0.8008 0.436 0.564
#> GSM97098     2  0.9881     0.8008 0.436 0.564
#> GSM97099     2  0.9881     0.8008 0.436 0.564
#> GSM97101     2  0.9881     0.8008 0.436 0.564
#> GSM97105     2  0.9881     0.8008 0.436 0.564
#> GSM97106     2  0.9866     0.7970 0.432 0.568
#> GSM97121     2  0.9881     0.8008 0.436 0.564
#> GSM97128     1  0.6247     0.6980 0.844 0.156
#> GSM97131     2  0.9881     0.8008 0.436 0.564
#> GSM97137     1  0.0000     0.8743 1.000 0.000
#> GSM97118     1  0.0000     0.8743 1.000 0.000
#> GSM97114     2  0.9881     0.8008 0.436 0.564
#> GSM97142     1  0.0000     0.8743 1.000 0.000
#> GSM97140     2  0.9881     0.8008 0.436 0.564
#> GSM97141     2  0.9881     0.8008 0.436 0.564
#> GSM97055     1  0.0000     0.8743 1.000 0.000
#> GSM97090     1  0.0672     0.8688 0.992 0.008
#> GSM97091     1  0.0000     0.8743 1.000 0.000
#> GSM97148     1  0.0000     0.8743 1.000 0.000
#> GSM97063     1  0.0000     0.8743 1.000 0.000
#> GSM97053     1  0.0000     0.8743 1.000 0.000
#> GSM97066     2  0.0672     0.4750 0.008 0.992
#> GSM97079     2  0.9998     0.6683 0.492 0.508
#> GSM97083     1  0.0000     0.8743 1.000 0.000
#> GSM97084     1  0.9286     0.0626 0.656 0.344
#> GSM97094     1  0.6438     0.6848 0.836 0.164
#> GSM97096     2  0.9881     0.8008 0.436 0.564
#> GSM97097     2  0.9866     0.7970 0.432 0.568
#> GSM97107     1  0.6438     0.6848 0.836 0.164
#> GSM97054     1  0.9209     0.1074 0.664 0.336
#> GSM97062     1  0.9393    -0.0117 0.644 0.356
#> GSM97069     2  0.0672     0.4750 0.008 0.992
#> GSM97070     2  0.0672     0.4750 0.008 0.992
#> GSM97073     2  0.0672     0.4750 0.008 0.992
#> GSM97076     1  0.7815     0.5169 0.768 0.232
#> GSM97077     2  0.9881     0.8008 0.436 0.564
#> GSM97095     1  0.3114     0.8260 0.944 0.056
#> GSM97102     2  0.0672     0.4750 0.008 0.992
#> GSM97109     2  0.9881     0.8008 0.436 0.564
#> GSM97110     2  0.9881     0.8008 0.436 0.564
#> GSM97074     1  0.4690     0.7768 0.900 0.100
#> GSM97085     1  0.6623     0.6685 0.828 0.172
#> GSM97059     1  0.8661     0.2951 0.712 0.288
#> GSM97072     2  0.7950     0.6085 0.240 0.760
#> GSM97078     1  0.6438     0.6848 0.836 0.164
#> GSM97067     2  0.0672     0.4750 0.008 0.992
#> GSM97087     2  0.0672     0.4750 0.008 0.992
#> GSM97111     2  0.9881     0.8008 0.436 0.564
#> GSM97064     2  0.9881     0.8008 0.436 0.564
#> GSM97065     2  0.9881     0.8008 0.436 0.564
#> GSM97081     2  0.9881     0.8008 0.436 0.564
#> GSM97082     2  0.0672     0.4750 0.008 0.992
#> GSM97088     1  0.6438     0.6848 0.836 0.164
#> GSM97100     2  0.9881     0.8008 0.436 0.564
#> GSM97104     2  0.0672     0.4750 0.008 0.992
#> GSM97108     2  0.9881     0.8008 0.436 0.564
#> GSM97050     2  0.9881     0.8008 0.436 0.564
#> GSM97080     2  0.0672     0.4750 0.008 0.992
#> GSM97089     2  0.9881     0.8008 0.436 0.564
#> GSM97092     2  0.9881     0.8008 0.436 0.564
#> GSM97093     2  0.9881     0.8008 0.436 0.564
#> GSM97058     2  0.9881     0.8008 0.436 0.564
#> GSM97051     2  0.9881     0.8008 0.436 0.564
#> GSM97052     2  0.9881     0.8008 0.436 0.564
#> GSM97061     2  0.9866     0.7970 0.432 0.568

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97145     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97147     2  0.6809      0.151 0.464 0.524 0.012
#> GSM97125     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97127     1  0.0424      0.956 0.992 0.008 0.000
#> GSM97130     1  0.1482      0.951 0.968 0.020 0.012
#> GSM97133     1  0.0424      0.956 0.992 0.008 0.000
#> GSM97134     1  0.1877      0.945 0.956 0.032 0.012
#> GSM97120     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97126     1  0.1031      0.952 0.976 0.024 0.000
#> GSM97112     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97115     1  0.5020      0.757 0.796 0.192 0.012
#> GSM97116     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97117     2  0.2537      0.877 0.080 0.920 0.000
#> GSM97119     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97122     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97135     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97136     1  0.5692      0.642 0.724 0.268 0.008
#> GSM97139     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97146     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97123     2  0.0237      0.928 0.004 0.996 0.000
#> GSM97129     2  0.0592      0.929 0.012 0.988 0.000
#> GSM97143     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97113     2  0.1753      0.907 0.048 0.952 0.000
#> GSM97056     1  0.1015      0.954 0.980 0.012 0.008
#> GSM97124     1  0.0424      0.955 0.992 0.000 0.008
#> GSM97132     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97144     1  0.1620      0.949 0.964 0.024 0.012
#> GSM97149     1  0.0592      0.955 0.988 0.012 0.000
#> GSM97068     2  0.5536      0.689 0.236 0.752 0.012
#> GSM97071     1  0.6113      0.568 0.688 0.300 0.012
#> GSM97086     2  0.2031      0.914 0.032 0.952 0.016
#> GSM97103     2  0.0661      0.928 0.008 0.988 0.004
#> GSM97057     2  0.2280      0.904 0.052 0.940 0.008
#> GSM97060     2  0.2173      0.908 0.008 0.944 0.048
#> GSM97075     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97098     2  0.1015      0.926 0.008 0.980 0.012
#> GSM97099     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97101     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97105     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97106     2  0.0237      0.928 0.004 0.996 0.000
#> GSM97121     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97128     1  0.2152      0.941 0.948 0.036 0.016
#> GSM97131     2  0.0237      0.928 0.004 0.996 0.000
#> GSM97137     1  0.0848      0.955 0.984 0.008 0.008
#> GSM97118     1  0.0237      0.956 0.996 0.000 0.004
#> GSM97114     2  0.4974      0.676 0.236 0.764 0.000
#> GSM97142     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97140     2  0.0848      0.927 0.008 0.984 0.008
#> GSM97141     2  0.0237      0.927 0.004 0.996 0.000
#> GSM97055     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97090     1  0.2446      0.931 0.936 0.052 0.012
#> GSM97091     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97148     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97063     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97053     1  0.0000      0.956 1.000 0.000 0.000
#> GSM97066     3  0.0747      0.957 0.000 0.016 0.984
#> GSM97079     2  0.2651      0.893 0.060 0.928 0.012
#> GSM97083     1  0.1620      0.949 0.964 0.024 0.012
#> GSM97084     2  0.4663      0.788 0.156 0.828 0.016
#> GSM97094     1  0.2550      0.928 0.932 0.056 0.012
#> GSM97096     2  0.1878      0.909 0.004 0.952 0.044
#> GSM97097     2  0.0237      0.928 0.004 0.996 0.000
#> GSM97107     1  0.2446      0.932 0.936 0.052 0.012
#> GSM97054     2  0.4602      0.795 0.152 0.832 0.016
#> GSM97062     2  0.4277      0.815 0.132 0.852 0.016
#> GSM97069     3  0.0747      0.957 0.000 0.016 0.984
#> GSM97070     3  0.0747      0.957 0.000 0.016 0.984
#> GSM97073     3  0.0747      0.957 0.000 0.016 0.984
#> GSM97076     1  0.1765      0.944 0.956 0.040 0.004
#> GSM97077     2  0.0848      0.927 0.008 0.984 0.008
#> GSM97095     1  0.3695      0.869 0.880 0.108 0.012
#> GSM97102     3  0.0747      0.957 0.000 0.016 0.984
#> GSM97109     2  0.1860      0.904 0.052 0.948 0.000
#> GSM97110     2  0.0592      0.929 0.012 0.988 0.000
#> GSM97074     1  0.1525      0.948 0.964 0.032 0.004
#> GSM97085     1  0.2280      0.933 0.940 0.052 0.008
#> GSM97059     2  0.6529      0.447 0.368 0.620 0.012
#> GSM97072     3  0.6095      0.348 0.000 0.392 0.608
#> GSM97078     1  0.2269      0.939 0.944 0.040 0.016
#> GSM97067     3  0.0747      0.957 0.000 0.016 0.984
#> GSM97087     3  0.1289      0.945 0.000 0.032 0.968
#> GSM97111     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97064     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97065     2  0.1964      0.904 0.056 0.944 0.000
#> GSM97081     2  0.1765      0.912 0.004 0.956 0.040
#> GSM97082     3  0.0983      0.954 0.004 0.016 0.980
#> GSM97088     1  0.2414      0.937 0.940 0.040 0.020
#> GSM97100     2  0.0848      0.927 0.008 0.984 0.008
#> GSM97104     3  0.0747      0.957 0.000 0.016 0.984
#> GSM97108     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97050     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97080     3  0.0747      0.957 0.000 0.016 0.984
#> GSM97089     2  0.1585      0.919 0.008 0.964 0.028
#> GSM97092     2  0.1399      0.917 0.004 0.968 0.028
#> GSM97093     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97058     2  0.0424      0.929 0.008 0.992 0.000
#> GSM97051     2  0.0848      0.927 0.008 0.984 0.008
#> GSM97052     2  0.1647      0.913 0.004 0.960 0.036
#> GSM97061     2  0.0237      0.928 0.004 0.996 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.3649     0.7235 0.796 0.000 0.000 0.204
#> GSM97145     1  0.3853     0.7427 0.820 0.020 0.000 0.160
#> GSM97147     2  0.7338    -0.3006 0.156 0.440 0.000 0.404
#> GSM97125     1  0.1059     0.7832 0.972 0.012 0.000 0.016
#> GSM97127     1  0.3881     0.7382 0.812 0.016 0.000 0.172
#> GSM97130     1  0.2676     0.7639 0.896 0.092 0.000 0.012
#> GSM97133     1  0.4431     0.6669 0.696 0.000 0.000 0.304
#> GSM97134     1  0.5388     0.4834 0.532 0.456 0.000 0.012
#> GSM97120     1  0.4608     0.6667 0.692 0.004 0.000 0.304
#> GSM97126     1  0.5250     0.5931 0.736 0.068 0.000 0.196
#> GSM97112     1  0.0188     0.7815 0.996 0.000 0.000 0.004
#> GSM97115     2  0.5110    -0.1357 0.328 0.656 0.000 0.016
#> GSM97116     1  0.4431     0.6669 0.696 0.000 0.000 0.304
#> GSM97117     2  0.6393    -0.9442 0.000 0.480 0.064 0.456
#> GSM97119     1  0.0524     0.7831 0.988 0.008 0.000 0.004
#> GSM97122     1  0.0000     0.7813 1.000 0.000 0.000 0.000
#> GSM97135     1  0.0000     0.7813 1.000 0.000 0.000 0.000
#> GSM97136     2  0.8410    -0.6078 0.112 0.420 0.072 0.396
#> GSM97139     1  0.4431     0.6669 0.696 0.000 0.000 0.304
#> GSM97146     1  0.4431     0.6669 0.696 0.000 0.000 0.304
#> GSM97123     2  0.6024     0.1574 0.000 0.540 0.416 0.044
#> GSM97129     2  0.5833    -0.7437 0.000 0.528 0.032 0.440
#> GSM97143     1  0.0469     0.7829 0.988 0.012 0.000 0.000
#> GSM97113     4  0.6395     0.9929 0.000 0.460 0.064 0.476
#> GSM97056     1  0.2342     0.7703 0.912 0.080 0.000 0.008
#> GSM97124     1  0.1854     0.7790 0.940 0.048 0.000 0.012
#> GSM97132     1  0.1109     0.7825 0.968 0.028 0.000 0.004
#> GSM97144     1  0.5310     0.5275 0.576 0.412 0.000 0.012
#> GSM97149     1  0.4608     0.6667 0.692 0.004 0.000 0.304
#> GSM97068     2  0.5228    -0.2558 0.024 0.664 0.000 0.312
#> GSM97071     2  0.4453     0.1043 0.244 0.744 0.000 0.012
#> GSM97086     2  0.2704     0.1878 0.000 0.876 0.000 0.124
#> GSM97103     2  0.7277    -0.3610 0.000 0.540 0.228 0.232
#> GSM97057     2  0.4972    -0.6095 0.000 0.544 0.000 0.456
#> GSM97060     2  0.6242     0.1633 0.000 0.520 0.424 0.056
#> GSM97075     2  0.6340    -0.8099 0.000 0.528 0.064 0.408
#> GSM97098     2  0.5158     0.1289 0.000 0.524 0.472 0.004
#> GSM97099     2  0.6395    -0.9542 0.000 0.476 0.064 0.460
#> GSM97101     2  0.5933    -0.8255 0.000 0.500 0.036 0.464
#> GSM97105     2  0.4955    -0.6151 0.000 0.556 0.000 0.444
#> GSM97106     2  0.6206     0.1602 0.000 0.540 0.404 0.056
#> GSM97121     2  0.4977    -0.6521 0.000 0.540 0.000 0.460
#> GSM97128     1  0.5512     0.4444 0.492 0.492 0.000 0.016
#> GSM97131     2  0.6732     0.0984 0.000 0.556 0.336 0.108
#> GSM97137     1  0.2342     0.7703 0.912 0.080 0.000 0.008
#> GSM97118     1  0.1284     0.7831 0.964 0.024 0.000 0.012
#> GSM97114     4  0.6560     0.9814 0.004 0.456 0.064 0.476
#> GSM97142     1  0.0188     0.7815 0.996 0.000 0.000 0.004
#> GSM97140     2  0.4981    -0.6172 0.000 0.536 0.000 0.464
#> GSM97141     4  0.6395     0.9850 0.000 0.464 0.064 0.472
#> GSM97055     1  0.1305     0.7831 0.960 0.036 0.000 0.004
#> GSM97090     2  0.5268    -0.2913 0.396 0.592 0.000 0.012
#> GSM97091     1  0.0188     0.7815 0.996 0.000 0.000 0.004
#> GSM97148     1  0.4431     0.6669 0.696 0.000 0.000 0.304
#> GSM97063     1  0.0188     0.7815 0.996 0.000 0.000 0.004
#> GSM97053     1  0.1118     0.7826 0.964 0.036 0.000 0.000
#> GSM97066     3  0.0188     0.9731 0.000 0.000 0.996 0.004
#> GSM97079     2  0.3074     0.1786 0.000 0.848 0.000 0.152
#> GSM97083     1  0.5508     0.4609 0.508 0.476 0.000 0.016
#> GSM97084     2  0.3208     0.2010 0.004 0.848 0.000 0.148
#> GSM97094     2  0.5279    -0.2993 0.400 0.588 0.000 0.012
#> GSM97096     2  0.4996     0.1311 0.000 0.516 0.484 0.000
#> GSM97097     2  0.5392     0.1288 0.000 0.724 0.204 0.072
#> GSM97107     2  0.5268    -0.2867 0.396 0.592 0.000 0.012
#> GSM97054     2  0.3208     0.2010 0.004 0.848 0.000 0.148
#> GSM97062     2  0.3208     0.2010 0.004 0.848 0.000 0.148
#> GSM97069     3  0.0000     0.9761 0.000 0.000 1.000 0.000
#> GSM97070     3  0.0000     0.9761 0.000 0.000 1.000 0.000
#> GSM97073     3  0.0000     0.9761 0.000 0.000 1.000 0.000
#> GSM97076     1  0.7921     0.0812 0.464 0.120 0.036 0.380
#> GSM97077     2  0.4941    -0.6062 0.000 0.564 0.000 0.436
#> GSM97095     2  0.4936    -0.1559 0.340 0.652 0.000 0.008
#> GSM97102     3  0.0000     0.9761 0.000 0.000 1.000 0.000
#> GSM97109     4  0.6395     0.9929 0.000 0.460 0.064 0.476
#> GSM97110     4  0.6395     0.9929 0.000 0.460 0.064 0.476
#> GSM97074     1  0.5236     0.5035 0.560 0.432 0.000 0.008
#> GSM97085     1  0.6462     0.1674 0.520 0.060 0.416 0.004
#> GSM97059     2  0.6096     0.1053 0.136 0.680 0.000 0.184
#> GSM97072     3  0.2973     0.7654 0.000 0.144 0.856 0.000
#> GSM97078     1  0.5512     0.4444 0.492 0.492 0.000 0.016
#> GSM97067     3  0.0000     0.9761 0.000 0.000 1.000 0.000
#> GSM97087     3  0.0592     0.9598 0.000 0.016 0.984 0.000
#> GSM97111     2  0.6395    -0.9542 0.000 0.476 0.064 0.460
#> GSM97064     2  0.6337     0.1485 0.000 0.552 0.380 0.068
#> GSM97065     2  0.6395    -0.9542 0.000 0.476 0.064 0.460
#> GSM97081     2  0.5161     0.1300 0.000 0.520 0.476 0.004
#> GSM97082     3  0.0188     0.9733 0.000 0.004 0.996 0.000
#> GSM97088     1  0.5512     0.4444 0.492 0.492 0.000 0.016
#> GSM97100     2  0.4916    -0.5245 0.000 0.576 0.000 0.424
#> GSM97104     3  0.0000     0.9761 0.000 0.000 1.000 0.000
#> GSM97108     2  0.4972    -0.6422 0.000 0.544 0.000 0.456
#> GSM97050     2  0.5543    -0.5929 0.000 0.556 0.020 0.424
#> GSM97080     3  0.0000     0.9761 0.000 0.000 1.000 0.000
#> GSM97089     2  0.5392     0.1225 0.000 0.528 0.460 0.012
#> GSM97092     2  0.6031     0.1587 0.000 0.536 0.420 0.044
#> GSM97093     2  0.4955    -0.6151 0.000 0.556 0.000 0.444
#> GSM97058     2  0.6928    -0.3561 0.000 0.556 0.136 0.308
#> GSM97051     2  0.3758     0.1619 0.000 0.848 0.048 0.104
#> GSM97052     2  0.6222     0.1629 0.000 0.532 0.412 0.056
#> GSM97061     2  0.6206     0.1602 0.000 0.540 0.404 0.056

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.2424     0.7657 0.868 0.000 0.000 0.000 0.132
#> GSM97145     1  0.2865     0.7570 0.856 0.004 0.000 0.008 0.132
#> GSM97147     2  0.5778     0.3684 0.000 0.528 0.000 0.376 0.096
#> GSM97125     1  0.4549    -0.0954 0.528 0.000 0.000 0.008 0.464
#> GSM97127     1  0.2843     0.7503 0.848 0.000 0.000 0.008 0.144
#> GSM97130     5  0.4757     0.6013 0.120 0.000 0.000 0.148 0.732
#> GSM97133     1  0.0000     0.8655 1.000 0.000 0.000 0.000 0.000
#> GSM97134     5  0.3845     0.5990 0.024 0.000 0.000 0.208 0.768
#> GSM97120     1  0.0000     0.8655 1.000 0.000 0.000 0.000 0.000
#> GSM97126     5  0.6814     0.2850 0.052 0.392 0.000 0.092 0.464
#> GSM97112     5  0.5534     0.1272 0.424 0.000 0.000 0.068 0.508
#> GSM97115     5  0.4235     0.2460 0.000 0.000 0.000 0.424 0.576
#> GSM97116     1  0.0510     0.8596 0.984 0.000 0.000 0.000 0.016
#> GSM97117     2  0.1768     0.6601 0.000 0.924 0.004 0.072 0.000
#> GSM97119     5  0.3884     0.4385 0.288 0.000 0.000 0.004 0.708
#> GSM97122     5  0.5431     0.1400 0.424 0.000 0.000 0.060 0.516
#> GSM97135     5  0.5431     0.1400 0.424 0.000 0.000 0.060 0.516
#> GSM97136     2  0.4547     0.4140 0.000 0.712 0.012 0.024 0.252
#> GSM97139     1  0.0162     0.8650 0.996 0.000 0.000 0.000 0.004
#> GSM97146     1  0.0000     0.8655 1.000 0.000 0.000 0.000 0.000
#> GSM97123     3  0.6690     0.2984 0.000 0.232 0.468 0.296 0.004
#> GSM97129     2  0.4268     0.6485 0.000 0.708 0.000 0.268 0.024
#> GSM97143     5  0.4211     0.3424 0.360 0.000 0.000 0.004 0.636
#> GSM97113     2  0.0162     0.6202 0.000 0.996 0.004 0.000 0.000
#> GSM97056     5  0.5093     0.5848 0.180 0.000 0.000 0.124 0.696
#> GSM97124     5  0.4647     0.5835 0.184 0.000 0.000 0.084 0.732
#> GSM97132     5  0.4541     0.5874 0.172 0.000 0.000 0.084 0.744
#> GSM97144     5  0.3690     0.5886 0.012 0.000 0.000 0.224 0.764
#> GSM97149     1  0.0000     0.8655 1.000 0.000 0.000 0.000 0.000
#> GSM97068     4  0.6036    -0.1529 0.000 0.432 0.000 0.452 0.116
#> GSM97071     4  0.3730     0.1113 0.000 0.000 0.000 0.712 0.288
#> GSM97086     4  0.2408     0.6333 0.000 0.092 0.000 0.892 0.016
#> GSM97103     2  0.6616     0.1583 0.000 0.456 0.292 0.252 0.000
#> GSM97057     2  0.3796     0.6439 0.000 0.700 0.000 0.300 0.000
#> GSM97060     3  0.5905     0.4123 0.000 0.136 0.572 0.292 0.000
#> GSM97075     2  0.3607     0.6631 0.000 0.752 0.004 0.244 0.000
#> GSM97098     3  0.6326     0.3925 0.000 0.248 0.528 0.224 0.000
#> GSM97099     2  0.1571     0.6556 0.000 0.936 0.004 0.060 0.000
#> GSM97101     2  0.3635     0.6641 0.000 0.748 0.004 0.248 0.000
#> GSM97105     2  0.4066     0.6199 0.000 0.672 0.004 0.324 0.000
#> GSM97106     3  0.6666     0.3041 0.000 0.224 0.472 0.300 0.004
#> GSM97121     2  0.3796     0.6437 0.000 0.700 0.000 0.300 0.000
#> GSM97128     5  0.4201     0.4917 0.000 0.000 0.000 0.408 0.592
#> GSM97131     4  0.6820    -0.0981 0.000 0.240 0.348 0.408 0.004
#> GSM97137     5  0.5201     0.5809 0.188 0.000 0.000 0.128 0.684
#> GSM97118     5  0.2423     0.5947 0.080 0.000 0.000 0.024 0.896
#> GSM97114     2  0.0162     0.6202 0.000 0.996 0.004 0.000 0.000
#> GSM97142     5  0.5534     0.1272 0.424 0.000 0.000 0.068 0.508
#> GSM97140     2  0.4067     0.6374 0.000 0.692 0.000 0.300 0.008
#> GSM97141     2  0.0324     0.6234 0.000 0.992 0.004 0.004 0.000
#> GSM97055     5  0.3646     0.5596 0.120 0.044 0.000 0.008 0.828
#> GSM97090     5  0.3774     0.5376 0.000 0.000 0.000 0.296 0.704
#> GSM97091     5  0.4679     0.4471 0.216 0.000 0.000 0.068 0.716
#> GSM97148     1  0.0000     0.8655 1.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.5182     0.3427 0.300 0.000 0.000 0.068 0.632
#> GSM97053     5  0.4793     0.5593 0.216 0.000 0.000 0.076 0.708
#> GSM97066     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97079     4  0.2179     0.6201 0.000 0.112 0.000 0.888 0.000
#> GSM97083     5  0.4380     0.5183 0.008 0.000 0.000 0.376 0.616
#> GSM97084     4  0.2193     0.6353 0.000 0.060 0.000 0.912 0.028
#> GSM97094     5  0.4256     0.4480 0.000 0.000 0.000 0.436 0.564
#> GSM97096     3  0.5946     0.4570 0.000 0.184 0.592 0.224 0.000
#> GSM97097     4  0.5629     0.3775 0.000 0.220 0.132 0.644 0.004
#> GSM97107     5  0.4420     0.3547 0.004 0.000 0.000 0.448 0.548
#> GSM97054     4  0.2221     0.6300 0.000 0.052 0.000 0.912 0.036
#> GSM97062     4  0.2104     0.6356 0.000 0.060 0.000 0.916 0.024
#> GSM97069     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97070     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97073     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97076     2  0.6363    -0.0162 0.024 0.512 0.004 0.080 0.380
#> GSM97077     2  0.3913     0.6243 0.000 0.676 0.000 0.324 0.000
#> GSM97095     5  0.4201     0.3615 0.000 0.000 0.000 0.408 0.592
#> GSM97102     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97109     2  0.0162     0.6202 0.000 0.996 0.004 0.000 0.000
#> GSM97110     2  0.0451     0.6261 0.000 0.988 0.004 0.008 0.000
#> GSM97074     5  0.4470     0.5229 0.012 0.000 0.000 0.372 0.616
#> GSM97085     3  0.5713    -0.0293 0.000 0.000 0.500 0.084 0.416
#> GSM97059     4  0.6458     0.3328 0.000 0.216 0.000 0.492 0.292
#> GSM97072     3  0.1557     0.6184 0.000 0.052 0.940 0.008 0.000
#> GSM97078     5  0.4201     0.4917 0.000 0.000 0.000 0.408 0.592
#> GSM97067     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97087     3  0.0451     0.6305 0.000 0.004 0.988 0.008 0.000
#> GSM97111     2  0.2068     0.6637 0.000 0.904 0.004 0.092 0.000
#> GSM97064     3  0.6653     0.2110 0.000 0.240 0.432 0.328 0.000
#> GSM97065     2  0.1704     0.6589 0.000 0.928 0.004 0.068 0.000
#> GSM97081     3  0.6010     0.4550 0.000 0.204 0.584 0.212 0.000
#> GSM97082     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97088     5  0.4235     0.4820 0.000 0.000 0.000 0.424 0.576
#> GSM97100     2  0.4448     0.3379 0.000 0.516 0.000 0.480 0.004
#> GSM97104     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97108     2  0.3816     0.6406 0.000 0.696 0.000 0.304 0.000
#> GSM97050     2  0.5551     0.2797 0.000 0.488 0.068 0.444 0.000
#> GSM97080     3  0.0000     0.6321 0.000 0.000 1.000 0.000 0.000
#> GSM97089     3  0.6441     0.4086 0.000 0.196 0.544 0.252 0.008
#> GSM97092     3  0.6392     0.3992 0.000 0.192 0.532 0.272 0.004
#> GSM97093     2  0.3816     0.6406 0.000 0.696 0.000 0.304 0.000
#> GSM97058     4  0.6784    -0.0165 0.000 0.352 0.280 0.368 0.000
#> GSM97051     4  0.3155     0.6061 0.000 0.128 0.016 0.848 0.008
#> GSM97052     3  0.6295     0.4247 0.000 0.188 0.552 0.256 0.004
#> GSM97061     3  0.6701     0.2908 0.000 0.232 0.464 0.300 0.004

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.1498     0.9185 0.940 0.000 0.000 0.028 0.032 0.000
#> GSM97145     1  0.2112     0.8547 0.896 0.000 0.000 0.088 0.016 0.000
#> GSM97147     3  0.6028     0.4105 0.004 0.308 0.484 0.200 0.004 0.000
#> GSM97125     5  0.5585     0.4840 0.364 0.000 0.000 0.148 0.488 0.000
#> GSM97127     1  0.2237     0.8695 0.896 0.000 0.000 0.068 0.036 0.000
#> GSM97130     4  0.0865     0.7884 0.000 0.000 0.000 0.964 0.036 0.000
#> GSM97133     1  0.0000     0.9589 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97134     4  0.0363     0.7977 0.000 0.000 0.000 0.988 0.012 0.000
#> GSM97120     1  0.0000     0.9589 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97126     5  0.6990     0.4900 0.068 0.248 0.008 0.212 0.464 0.000
#> GSM97112     5  0.1633     0.7516 0.044 0.000 0.000 0.024 0.932 0.000
#> GSM97115     4  0.1531     0.7809 0.000 0.000 0.068 0.928 0.004 0.000
#> GSM97116     1  0.0146     0.9569 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97117     2  0.1858     0.7361 0.000 0.904 0.092 0.000 0.000 0.004
#> GSM97119     5  0.4024     0.7635 0.072 0.000 0.000 0.184 0.744 0.000
#> GSM97122     5  0.1789     0.7573 0.044 0.000 0.000 0.032 0.924 0.000
#> GSM97135     5  0.1789     0.7573 0.044 0.000 0.000 0.032 0.924 0.000
#> GSM97136     2  0.5001     0.5514 0.000 0.700 0.024 0.200 0.016 0.060
#> GSM97139     1  0.0000     0.9589 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000     0.9589 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97123     3  0.4911     0.5959 0.000 0.196 0.688 0.000 0.020 0.096
#> GSM97129     2  0.5200     0.3538 0.000 0.620 0.276 0.088 0.000 0.016
#> GSM97143     5  0.3927     0.7664 0.072 0.000 0.000 0.172 0.756 0.000
#> GSM97113     2  0.0291     0.7341 0.000 0.992 0.004 0.004 0.000 0.000
#> GSM97056     4  0.2009     0.7507 0.024 0.000 0.000 0.908 0.068 0.000
#> GSM97124     5  0.5398     0.6300 0.136 0.000 0.000 0.320 0.544 0.000
#> GSM97132     5  0.4774     0.5277 0.052 0.000 0.000 0.420 0.528 0.000
#> GSM97144     4  0.0363     0.7977 0.000 0.000 0.000 0.988 0.012 0.000
#> GSM97149     1  0.0000     0.9589 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97068     3  0.4764     0.5796 0.000 0.108 0.660 0.232 0.000 0.000
#> GSM97071     4  0.2837     0.7759 0.000 0.000 0.088 0.856 0.056 0.000
#> GSM97086     3  0.3986    -0.0908 0.000 0.004 0.532 0.464 0.000 0.000
#> GSM97103     3  0.5867     0.3578 0.000 0.344 0.516 0.004 0.016 0.120
#> GSM97057     3  0.4781     0.5623 0.000 0.320 0.608 0.072 0.000 0.000
#> GSM97060     6  0.4962     0.6193 0.000 0.032 0.236 0.028 0.020 0.684
#> GSM97075     2  0.3093     0.6698 0.000 0.816 0.164 0.012 0.008 0.000
#> GSM97098     2  0.4967     0.5641 0.000 0.688 0.196 0.004 0.016 0.096
#> GSM97099     2  0.1501     0.7393 0.000 0.924 0.076 0.000 0.000 0.000
#> GSM97101     2  0.2805     0.6784 0.000 0.828 0.160 0.012 0.000 0.000
#> GSM97105     3  0.3409     0.6816 0.000 0.192 0.780 0.028 0.000 0.000
#> GSM97106     3  0.3956     0.6390 0.000 0.072 0.792 0.000 0.024 0.112
#> GSM97121     2  0.4469    -0.1641 0.000 0.504 0.468 0.028 0.000 0.000
#> GSM97128     4  0.2728     0.7558 0.000 0.000 0.040 0.860 0.100 0.000
#> GSM97131     3  0.2153     0.6932 0.000 0.084 0.900 0.008 0.004 0.004
#> GSM97137     4  0.4393     0.0902 0.044 0.000 0.000 0.640 0.316 0.000
#> GSM97118     5  0.3817     0.7283 0.028 0.000 0.000 0.252 0.720 0.000
#> GSM97114     2  0.0146     0.7326 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97142     5  0.1633     0.7516 0.044 0.000 0.000 0.024 0.932 0.000
#> GSM97140     3  0.4569     0.5851 0.000 0.304 0.636 0.060 0.000 0.000
#> GSM97141     2  0.0260     0.7349 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM97055     5  0.3900     0.7588 0.044 0.008 0.000 0.188 0.760 0.000
#> GSM97090     4  0.0405     0.7991 0.000 0.000 0.004 0.988 0.008 0.000
#> GSM97091     5  0.1418     0.7541 0.024 0.000 0.000 0.032 0.944 0.000
#> GSM97148     1  0.0000     0.9589 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.1418     0.7520 0.032 0.000 0.000 0.024 0.944 0.000
#> GSM97053     5  0.4756     0.5612 0.052 0.000 0.000 0.408 0.540 0.000
#> GSM97066     6  0.0000     0.8537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97079     3  0.3872     0.1549 0.000 0.004 0.604 0.392 0.000 0.000
#> GSM97083     4  0.2822     0.7543 0.000 0.000 0.040 0.852 0.108 0.000
#> GSM97084     4  0.4080     0.2496 0.000 0.008 0.456 0.536 0.000 0.000
#> GSM97094     4  0.0909     0.8018 0.000 0.000 0.020 0.968 0.012 0.000
#> GSM97096     6  0.5467     0.5656 0.000 0.156 0.196 0.000 0.020 0.628
#> GSM97097     3  0.2094     0.6865 0.000 0.064 0.908 0.024 0.004 0.000
#> GSM97107     4  0.0692     0.7991 0.000 0.000 0.020 0.976 0.004 0.000
#> GSM97054     4  0.4018     0.3743 0.000 0.008 0.412 0.580 0.000 0.000
#> GSM97062     4  0.4083     0.2369 0.000 0.008 0.460 0.532 0.000 0.000
#> GSM97069     6  0.0000     0.8537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97070     6  0.0000     0.8537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97073     6  0.0000     0.8537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97076     2  0.7161    -0.2634 0.040 0.376 0.004 0.216 0.348 0.016
#> GSM97077     3  0.3745     0.6484 0.000 0.240 0.732 0.028 0.000 0.000
#> GSM97095     4  0.1138     0.7964 0.000 0.012 0.024 0.960 0.004 0.000
#> GSM97102     6  0.0146     0.8534 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM97109     2  0.0146     0.7326 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97110     2  0.0363     0.7361 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97074     5  0.4172     0.6425 0.000 0.000 0.040 0.280 0.680 0.000
#> GSM97085     6  0.5868     0.4143 0.000 0.000 0.040 0.228 0.140 0.592
#> GSM97059     3  0.4863     0.5319 0.000 0.092 0.624 0.284 0.000 0.000
#> GSM97072     6  0.2020     0.8258 0.000 0.020 0.040 0.000 0.020 0.920
#> GSM97078     4  0.2679     0.7580 0.000 0.000 0.040 0.864 0.096 0.000
#> GSM97067     6  0.0000     0.8537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97087     6  0.0146     0.8531 0.000 0.004 0.000 0.000 0.000 0.996
#> GSM97111     2  0.2257     0.7203 0.000 0.876 0.116 0.008 0.000 0.000
#> GSM97064     3  0.3406     0.6985 0.000 0.100 0.832 0.024 0.000 0.044
#> GSM97065     2  0.2169     0.7407 0.000 0.900 0.080 0.008 0.000 0.012
#> GSM97081     2  0.6028     0.1918 0.000 0.464 0.156 0.000 0.016 0.364
#> GSM97082     6  0.0146     0.8530 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM97088     4  0.3491     0.7389 0.000 0.000 0.040 0.828 0.100 0.032
#> GSM97100     3  0.2384     0.6876 0.000 0.048 0.888 0.064 0.000 0.000
#> GSM97104     6  0.0000     0.8537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97108     3  0.4371     0.4246 0.000 0.392 0.580 0.028 0.000 0.000
#> GSM97050     3  0.2554     0.7004 0.000 0.092 0.876 0.028 0.000 0.004
#> GSM97080     6  0.0000     0.8537 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97089     6  0.4322     0.7067 0.000 0.020 0.152 0.040 0.020 0.768
#> GSM97092     6  0.4849     0.5747 0.000 0.044 0.288 0.000 0.024 0.644
#> GSM97093     3  0.4203     0.5620 0.000 0.316 0.652 0.032 0.000 0.000
#> GSM97058     3  0.3353     0.6945 0.000 0.156 0.808 0.028 0.000 0.008
#> GSM97051     3  0.3217     0.5424 0.000 0.008 0.768 0.224 0.000 0.000
#> GSM97052     6  0.4849     0.5754 0.000 0.044 0.288 0.000 0.024 0.644
#> GSM97061     3  0.3977     0.6476 0.000 0.084 0.792 0.000 0.024 0.100

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-mclust-membership-heatmap-5

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)

plot of chunk tab-CV-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-CV-mclust-get-signatures-no-scale-1

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

plot of chunk tab-CV-mclust-get-signatures-no-scale-2

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

plot of chunk tab-CV-mclust-get-signatures-no-scale-3

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

plot of chunk tab-CV-mclust-get-signatures-no-scale-4

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

plot of chunk tab-CV-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-mclust-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-CV-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-mclust-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:mclust 84         2.21e-02      0.1703     2.41e-10   0.4651 2
#> CV:mclust 97         2.50e-04      0.0331     1.46e-11   0.0353 3
#> CV:mclust 46         1.52e-04      0.2732     8.96e-08   0.1054 4
#> CV:mclust 59         8.03e-05      0.0740     4.15e-09   0.2242 5
#> CV:mclust 84         2.66e-04      0.3095     4.48e-10   0.4903 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.


CV:NMF*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "NMF"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-NMF-collect-plots

The plots are:

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:

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)

plot of chunk CV-NMF-select-partition-number

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.935           0.944       0.975         0.4958 0.508   0.508
#> 3 3 0.470           0.630       0.806         0.3180 0.784   0.595
#> 4 4 0.531           0.507       0.763         0.1344 0.766   0.446
#> 5 5 0.538           0.464       0.701         0.0765 0.826   0.450
#> 6 6 0.618           0.481       0.690         0.0446 0.892   0.535

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.987 1.000 0.000
#> GSM97145     1  0.0000      0.987 1.000 0.000
#> GSM97147     1  0.0000      0.987 1.000 0.000
#> GSM97125     1  0.0000      0.987 1.000 0.000
#> GSM97127     1  0.0000      0.987 1.000 0.000
#> GSM97130     1  0.0000      0.987 1.000 0.000
#> GSM97133     1  0.0000      0.987 1.000 0.000
#> GSM97134     1  0.0000      0.987 1.000 0.000
#> GSM97120     1  0.0000      0.987 1.000 0.000
#> GSM97126     1  0.0000      0.987 1.000 0.000
#> GSM97112     1  0.0000      0.987 1.000 0.000
#> GSM97115     1  0.0000      0.987 1.000 0.000
#> GSM97116     1  0.0000      0.987 1.000 0.000
#> GSM97117     2  0.0672      0.959 0.008 0.992
#> GSM97119     1  0.0000      0.987 1.000 0.000
#> GSM97122     1  0.0000      0.987 1.000 0.000
#> GSM97135     1  0.0000      0.987 1.000 0.000
#> GSM97136     2  0.2948      0.924 0.052 0.948
#> GSM97139     1  0.0000      0.987 1.000 0.000
#> GSM97146     1  0.0000      0.987 1.000 0.000
#> GSM97123     2  0.0000      0.964 0.000 1.000
#> GSM97129     2  0.6887      0.780 0.184 0.816
#> GSM97143     1  0.0000      0.987 1.000 0.000
#> GSM97113     2  0.7950      0.703 0.240 0.760
#> GSM97056     1  0.0000      0.987 1.000 0.000
#> GSM97124     1  0.0000      0.987 1.000 0.000
#> GSM97132     1  0.0000      0.987 1.000 0.000
#> GSM97144     1  0.0000      0.987 1.000 0.000
#> GSM97149     1  0.0000      0.987 1.000 0.000
#> GSM97068     1  0.3114      0.937 0.944 0.056
#> GSM97071     2  0.0000      0.964 0.000 1.000
#> GSM97086     2  0.0000      0.964 0.000 1.000
#> GSM97103     2  0.0000      0.964 0.000 1.000
#> GSM97057     1  0.5519      0.852 0.872 0.128
#> GSM97060     2  0.0000      0.964 0.000 1.000
#> GSM97075     2  0.0000      0.964 0.000 1.000
#> GSM97098     2  0.0000      0.964 0.000 1.000
#> GSM97099     2  0.0000      0.964 0.000 1.000
#> GSM97101     2  0.0672      0.959 0.008 0.992
#> GSM97105     2  0.0000      0.964 0.000 1.000
#> GSM97106     2  0.0000      0.964 0.000 1.000
#> GSM97121     2  0.0000      0.964 0.000 1.000
#> GSM97128     2  0.9460      0.468 0.364 0.636
#> GSM97131     2  0.0000      0.964 0.000 1.000
#> GSM97137     1  0.0000      0.987 1.000 0.000
#> GSM97118     1  0.0000      0.987 1.000 0.000
#> GSM97114     1  0.3879      0.916 0.924 0.076
#> GSM97142     1  0.0000      0.987 1.000 0.000
#> GSM97140     2  0.8909      0.586 0.308 0.692
#> GSM97141     2  0.1414      0.950 0.020 0.980
#> GSM97055     1  0.0000      0.987 1.000 0.000
#> GSM97090     1  0.0000      0.987 1.000 0.000
#> GSM97091     1  0.0000      0.987 1.000 0.000
#> GSM97148     1  0.0000      0.987 1.000 0.000
#> GSM97063     1  0.0000      0.987 1.000 0.000
#> GSM97053     1  0.0000      0.987 1.000 0.000
#> GSM97066     2  0.0000      0.964 0.000 1.000
#> GSM97079     2  0.0000      0.964 0.000 1.000
#> GSM97083     1  0.0000      0.987 1.000 0.000
#> GSM97084     2  0.0000      0.964 0.000 1.000
#> GSM97094     1  0.1414      0.972 0.980 0.020
#> GSM97096     2  0.0000      0.964 0.000 1.000
#> GSM97097     2  0.0000      0.964 0.000 1.000
#> GSM97107     1  0.1184      0.975 0.984 0.016
#> GSM97054     2  0.2778      0.927 0.048 0.952
#> GSM97062     2  0.0000      0.964 0.000 1.000
#> GSM97069     2  0.0000      0.964 0.000 1.000
#> GSM97070     2  0.0000      0.964 0.000 1.000
#> GSM97073     2  0.0000      0.964 0.000 1.000
#> GSM97076     1  0.6623      0.790 0.828 0.172
#> GSM97077     2  0.0000      0.964 0.000 1.000
#> GSM97095     1  0.1633      0.968 0.976 0.024
#> GSM97102     2  0.0000      0.964 0.000 1.000
#> GSM97109     2  0.9552      0.428 0.376 0.624
#> GSM97110     2  0.0376      0.961 0.004 0.996
#> GSM97074     2  0.9087      0.557 0.324 0.676
#> GSM97085     2  0.0000      0.964 0.000 1.000
#> GSM97059     1  0.0000      0.987 1.000 0.000
#> GSM97072     2  0.0000      0.964 0.000 1.000
#> GSM97078     2  0.4562      0.882 0.096 0.904
#> GSM97067     2  0.0000      0.964 0.000 1.000
#> GSM97087     2  0.0000      0.964 0.000 1.000
#> GSM97111     2  0.0000      0.964 0.000 1.000
#> GSM97064     2  0.0000      0.964 0.000 1.000
#> GSM97065     2  0.0000      0.964 0.000 1.000
#> GSM97081     2  0.0000      0.964 0.000 1.000
#> GSM97082     2  0.0000      0.964 0.000 1.000
#> GSM97088     2  0.0000      0.964 0.000 1.000
#> GSM97100     2  0.0000      0.964 0.000 1.000
#> GSM97104     2  0.0000      0.964 0.000 1.000
#> GSM97108     2  0.0376      0.961 0.004 0.996
#> GSM97050     2  0.0000      0.964 0.000 1.000
#> GSM97080     2  0.0000      0.964 0.000 1.000
#> GSM97089     2  0.0000      0.964 0.000 1.000
#> GSM97092     2  0.0000      0.964 0.000 1.000
#> GSM97093     2  0.0672      0.959 0.008 0.992
#> GSM97058     2  0.0000      0.964 0.000 1.000
#> GSM97051     2  0.0000      0.964 0.000 1.000
#> GSM97052     2  0.0000      0.964 0.000 1.000
#> GSM97061     2  0.0000      0.964 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.2878     0.7582 0.904 0.000 0.096
#> GSM97145     1  0.1182     0.7789 0.976 0.012 0.012
#> GSM97147     1  0.5363     0.5867 0.724 0.276 0.000
#> GSM97125     1  0.2959     0.7571 0.900 0.000 0.100
#> GSM97127     1  0.2280     0.7755 0.940 0.052 0.008
#> GSM97130     1  0.2939     0.7700 0.916 0.072 0.012
#> GSM97133     1  0.2878     0.7559 0.904 0.096 0.000
#> GSM97134     1  0.3670     0.7710 0.888 0.020 0.092
#> GSM97120     1  0.1337     0.7787 0.972 0.016 0.012
#> GSM97126     1  0.2384     0.7730 0.936 0.008 0.056
#> GSM97112     1  0.6280     0.3384 0.540 0.000 0.460
#> GSM97115     1  0.5431     0.5745 0.716 0.284 0.000
#> GSM97116     1  0.2261     0.7686 0.932 0.000 0.068
#> GSM97117     2  0.3752     0.7098 0.000 0.856 0.144
#> GSM97119     1  0.5591     0.6010 0.696 0.000 0.304
#> GSM97122     1  0.5560     0.6057 0.700 0.000 0.300
#> GSM97135     1  0.5291     0.6388 0.732 0.000 0.268
#> GSM97136     3  0.1905     0.6576 0.016 0.028 0.956
#> GSM97139     1  0.0829     0.7784 0.984 0.004 0.012
#> GSM97146     1  0.1411     0.7749 0.964 0.000 0.036
#> GSM97123     2  0.2959     0.7408 0.000 0.900 0.100
#> GSM97129     2  0.4891     0.7396 0.124 0.836 0.040
#> GSM97143     1  0.5497     0.6136 0.708 0.000 0.292
#> GSM97113     2  0.5497     0.5586 0.292 0.708 0.000
#> GSM97056     1  0.1860     0.7733 0.948 0.052 0.000
#> GSM97124     1  0.3752     0.7377 0.856 0.000 0.144
#> GSM97132     1  0.3752     0.7372 0.856 0.000 0.144
#> GSM97144     1  0.3791     0.7780 0.892 0.060 0.048
#> GSM97149     1  0.3412     0.7410 0.876 0.124 0.000
#> GSM97068     1  0.6299     0.0895 0.524 0.476 0.000
#> GSM97071     3  0.6291     0.2263 0.000 0.468 0.532
#> GSM97086     2  0.3038     0.7628 0.104 0.896 0.000
#> GSM97103     2  0.3816     0.7062 0.000 0.852 0.148
#> GSM97057     2  0.6095     0.3294 0.392 0.608 0.000
#> GSM97060     2  0.5650     0.4457 0.000 0.688 0.312
#> GSM97075     2  0.4062     0.6898 0.000 0.836 0.164
#> GSM97098     2  0.3941     0.6983 0.000 0.844 0.156
#> GSM97099     2  0.1529     0.7824 0.040 0.960 0.000
#> GSM97101     2  0.3879     0.7363 0.152 0.848 0.000
#> GSM97105     2  0.2625     0.7713 0.084 0.916 0.000
#> GSM97106     2  0.4002     0.6958 0.000 0.840 0.160
#> GSM97121     2  0.3752     0.7418 0.144 0.856 0.000
#> GSM97128     3  0.2537     0.5962 0.080 0.000 0.920
#> GSM97131     2  0.1453     0.7800 0.008 0.968 0.024
#> GSM97137     1  0.2448     0.7646 0.924 0.076 0.000
#> GSM97118     1  0.6305     0.2830 0.516 0.000 0.484
#> GSM97114     1  0.6095     0.3562 0.608 0.392 0.000
#> GSM97142     1  0.6140     0.4507 0.596 0.000 0.404
#> GSM97140     2  0.5733     0.4949 0.324 0.676 0.000
#> GSM97141     2  0.4399     0.7048 0.188 0.812 0.000
#> GSM97055     3  0.4887     0.4210 0.228 0.000 0.772
#> GSM97090     1  0.5220     0.6785 0.780 0.208 0.012
#> GSM97091     3  0.5431     0.3205 0.284 0.000 0.716
#> GSM97148     1  0.1411     0.7762 0.964 0.036 0.000
#> GSM97063     3  0.5859     0.1779 0.344 0.000 0.656
#> GSM97053     1  0.3686     0.7392 0.860 0.000 0.140
#> GSM97066     3  0.4842     0.6379 0.000 0.224 0.776
#> GSM97079     2  0.1399     0.7787 0.004 0.968 0.028
#> GSM97083     3  0.5254     0.3602 0.264 0.000 0.736
#> GSM97084     2  0.3267     0.7576 0.116 0.884 0.000
#> GSM97094     1  0.5355     0.7397 0.800 0.032 0.168
#> GSM97096     2  0.5178     0.5597 0.000 0.744 0.256
#> GSM97097     2  0.1289     0.7759 0.000 0.968 0.032
#> GSM97107     1  0.6719     0.7232 0.744 0.160 0.096
#> GSM97054     2  0.4062     0.7292 0.164 0.836 0.000
#> GSM97062     2  0.2173     0.7823 0.048 0.944 0.008
#> GSM97069     3  0.5465     0.6073 0.000 0.288 0.712
#> GSM97070     3  0.5810     0.5518 0.000 0.336 0.664
#> GSM97073     3  0.5760     0.5643 0.000 0.328 0.672
#> GSM97076     3  0.5404     0.3846 0.256 0.004 0.740
#> GSM97077     2  0.2749     0.7813 0.064 0.924 0.012
#> GSM97095     1  0.5325     0.6280 0.748 0.248 0.004
#> GSM97102     3  0.5465     0.6077 0.000 0.288 0.712
#> GSM97109     2  0.5859     0.4550 0.344 0.656 0.000
#> GSM97110     2  0.1860     0.7808 0.052 0.948 0.000
#> GSM97074     3  0.2448     0.5997 0.076 0.000 0.924
#> GSM97085     3  0.0747     0.6574 0.000 0.016 0.984
#> GSM97059     1  0.5926     0.4392 0.644 0.356 0.000
#> GSM97072     2  0.5882     0.3542 0.000 0.652 0.348
#> GSM97078     3  0.1711     0.6370 0.032 0.008 0.960
#> GSM97067     3  0.5216     0.6244 0.000 0.260 0.740
#> GSM97087     3  0.6235     0.3567 0.000 0.436 0.564
#> GSM97111     2  0.1647     0.7760 0.004 0.960 0.036
#> GSM97064     2  0.2261     0.7589 0.000 0.932 0.068
#> GSM97065     2  0.4555     0.6402 0.000 0.800 0.200
#> GSM97081     2  0.5835     0.3748 0.000 0.660 0.340
#> GSM97082     3  0.5431     0.6109 0.000 0.284 0.716
#> GSM97088     3  0.1337     0.6484 0.016 0.012 0.972
#> GSM97100     2  0.3879     0.7359 0.152 0.848 0.000
#> GSM97104     3  0.5650     0.5831 0.000 0.312 0.688
#> GSM97108     2  0.3879     0.7362 0.152 0.848 0.000
#> GSM97050     2  0.1031     0.7823 0.024 0.976 0.000
#> GSM97080     3  0.6126     0.4397 0.000 0.400 0.600
#> GSM97089     3  0.6302     0.2259 0.000 0.480 0.520
#> GSM97092     2  0.5327     0.5320 0.000 0.728 0.272
#> GSM97093     2  0.2772     0.7754 0.080 0.916 0.004
#> GSM97058     2  0.1031     0.7782 0.000 0.976 0.024
#> GSM97051     2  0.1031     0.7783 0.000 0.976 0.024
#> GSM97052     2  0.5016     0.5878 0.000 0.760 0.240
#> GSM97061     2  0.3267     0.7308 0.000 0.884 0.116

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.1302     0.7094 0.956 0.000 0.000 0.044
#> GSM97145     1  0.0921     0.6973 0.972 0.000 0.028 0.000
#> GSM97147     1  0.5208     0.5496 0.748 0.172 0.080 0.000
#> GSM97125     1  0.3157     0.6784 0.852 0.004 0.000 0.144
#> GSM97127     1  0.0564     0.7101 0.988 0.004 0.004 0.004
#> GSM97130     2  0.5387     0.5789 0.256 0.696 0.000 0.048
#> GSM97133     1  0.0895     0.7023 0.976 0.004 0.020 0.000
#> GSM97134     2  0.5889     0.5932 0.188 0.696 0.000 0.116
#> GSM97120     1  0.0707     0.7010 0.980 0.000 0.020 0.000
#> GSM97126     1  0.1824     0.7085 0.936 0.000 0.004 0.060
#> GSM97112     4  0.5263    -0.2646 0.448 0.008 0.000 0.544
#> GSM97115     2  0.2401     0.7793 0.092 0.904 0.000 0.004
#> GSM97116     1  0.2197     0.7021 0.916 0.004 0.000 0.080
#> GSM97117     3  0.1637     0.6803 0.060 0.000 0.940 0.000
#> GSM97119     1  0.5459     0.4234 0.552 0.016 0.000 0.432
#> GSM97122     1  0.5398     0.4644 0.580 0.016 0.000 0.404
#> GSM97135     1  0.5024     0.5210 0.632 0.008 0.000 0.360
#> GSM97136     4  0.5781     0.0198 0.028 0.000 0.484 0.488
#> GSM97139     1  0.0188     0.7098 0.996 0.004 0.000 0.000
#> GSM97146     1  0.0524     0.7110 0.988 0.004 0.000 0.008
#> GSM97123     3  0.1733     0.6860 0.000 0.028 0.948 0.024
#> GSM97129     3  0.3841     0.6505 0.144 0.004 0.832 0.020
#> GSM97143     1  0.4978     0.4951 0.612 0.004 0.000 0.384
#> GSM97113     3  0.4746     0.4432 0.368 0.000 0.632 0.000
#> GSM97056     1  0.6483     0.1893 0.532 0.392 0.000 0.076
#> GSM97124     1  0.5839     0.5597 0.648 0.060 0.000 0.292
#> GSM97132     1  0.6674     0.5051 0.584 0.116 0.000 0.300
#> GSM97144     2  0.4364     0.7174 0.136 0.808 0.000 0.056
#> GSM97149     1  0.1305     0.6931 0.960 0.004 0.036 0.000
#> GSM97068     2  0.4070     0.7472 0.132 0.824 0.044 0.000
#> GSM97071     2  0.1209     0.7846 0.000 0.964 0.004 0.032
#> GSM97086     2  0.0921     0.7851 0.000 0.972 0.028 0.000
#> GSM97103     3  0.1584     0.6813 0.000 0.012 0.952 0.036
#> GSM97057     1  0.6733    -0.0603 0.492 0.092 0.416 0.000
#> GSM97060     3  0.7093     0.3390 0.000 0.172 0.556 0.272
#> GSM97075     3  0.0817     0.6830 0.000 0.000 0.976 0.024
#> GSM97098     3  0.0895     0.6838 0.004 0.000 0.976 0.020
#> GSM97099     3  0.1637     0.6836 0.060 0.000 0.940 0.000
#> GSM97101     3  0.4608     0.5382 0.304 0.004 0.692 0.000
#> GSM97105     3  0.4964     0.6208 0.068 0.168 0.764 0.000
#> GSM97106     3  0.4840     0.6003 0.000 0.240 0.732 0.028
#> GSM97121     3  0.4831     0.6020 0.208 0.040 0.752 0.000
#> GSM97128     4  0.4824     0.3856 0.024 0.228 0.004 0.744
#> GSM97131     3  0.4643     0.4649 0.000 0.344 0.656 0.000
#> GSM97137     1  0.5035     0.6086 0.748 0.196 0.000 0.056
#> GSM97118     4  0.6123    -0.0439 0.336 0.064 0.000 0.600
#> GSM97114     1  0.4992    -0.1168 0.524 0.000 0.476 0.000
#> GSM97142     1  0.5294     0.3306 0.508 0.008 0.000 0.484
#> GSM97140     3  0.7577     0.2514 0.316 0.216 0.468 0.000
#> GSM97141     3  0.4605     0.4955 0.336 0.000 0.664 0.000
#> GSM97055     4  0.3032     0.4666 0.124 0.000 0.008 0.868
#> GSM97090     2  0.2179     0.7866 0.064 0.924 0.000 0.012
#> GSM97091     4  0.3636     0.3901 0.172 0.008 0.000 0.820
#> GSM97148     1  0.0336     0.7108 0.992 0.008 0.000 0.000
#> GSM97063     4  0.4792     0.1104 0.312 0.008 0.000 0.680
#> GSM97053     1  0.5925     0.5608 0.648 0.068 0.000 0.284
#> GSM97066     4  0.4973     0.3085 0.000 0.008 0.348 0.644
#> GSM97079     2  0.1867     0.7628 0.000 0.928 0.072 0.000
#> GSM97083     2  0.5599     0.5088 0.040 0.644 0.000 0.316
#> GSM97084     2  0.0336     0.7901 0.000 0.992 0.008 0.000
#> GSM97094     2  0.2675     0.7810 0.044 0.908 0.000 0.048
#> GSM97096     3  0.2081     0.6617 0.000 0.000 0.916 0.084
#> GSM97097     2  0.5016     0.2140 0.000 0.600 0.396 0.004
#> GSM97107     2  0.1610     0.7920 0.032 0.952 0.000 0.016
#> GSM97054     2  0.0336     0.7901 0.000 0.992 0.008 0.000
#> GSM97062     2  0.0469     0.7889 0.000 0.988 0.012 0.000
#> GSM97069     4  0.5290     0.2126 0.000 0.012 0.404 0.584
#> GSM97070     3  0.5273     0.0904 0.000 0.008 0.536 0.456
#> GSM97073     3  0.5155     0.0632 0.000 0.004 0.528 0.468
#> GSM97076     4  0.5690     0.4790 0.168 0.000 0.116 0.716
#> GSM97077     3  0.5691     0.1744 0.024 0.468 0.508 0.000
#> GSM97095     2  0.3224     0.7563 0.120 0.864 0.000 0.016
#> GSM97102     3  0.4941     0.1536 0.000 0.000 0.564 0.436
#> GSM97109     3  0.4898     0.3484 0.416 0.000 0.584 0.000
#> GSM97110     3  0.1867     0.6812 0.072 0.000 0.928 0.000
#> GSM97074     4  0.0469     0.5408 0.012 0.000 0.000 0.988
#> GSM97085     4  0.1118     0.5557 0.000 0.000 0.036 0.964
#> GSM97059     2  0.5660     0.3901 0.396 0.576 0.028 0.000
#> GSM97072     3  0.4690     0.4639 0.000 0.012 0.712 0.276
#> GSM97078     2  0.5064     0.4707 0.004 0.632 0.004 0.360
#> GSM97067     4  0.5172     0.2151 0.000 0.008 0.404 0.588
#> GSM97087     3  0.5256     0.2518 0.000 0.012 0.596 0.392
#> GSM97111     3  0.0817     0.6858 0.024 0.000 0.976 0.000
#> GSM97064     3  0.3311     0.6541 0.000 0.172 0.828 0.000
#> GSM97065     3  0.1767     0.6806 0.012 0.000 0.944 0.044
#> GSM97081     3  0.2011     0.6641 0.000 0.000 0.920 0.080
#> GSM97082     4  0.5212     0.1763 0.000 0.008 0.420 0.572
#> GSM97088     4  0.2861     0.5201 0.012 0.092 0.004 0.892
#> GSM97100     2  0.3900     0.6971 0.020 0.816 0.164 0.000
#> GSM97104     4  0.5167    -0.0109 0.000 0.004 0.488 0.508
#> GSM97108     3  0.4574     0.6016 0.220 0.024 0.756 0.000
#> GSM97050     2  0.5158    -0.0545 0.004 0.524 0.472 0.000
#> GSM97080     3  0.5399     0.0507 0.000 0.012 0.520 0.468
#> GSM97089     3  0.5110     0.3352 0.000 0.012 0.636 0.352
#> GSM97092     3  0.4206     0.6189 0.000 0.048 0.816 0.136
#> GSM97093     3  0.3858     0.6686 0.100 0.056 0.844 0.000
#> GSM97058     3  0.3626     0.6482 0.004 0.184 0.812 0.000
#> GSM97051     2  0.1637     0.7720 0.000 0.940 0.060 0.000
#> GSM97052     3  0.4784     0.6259 0.000 0.100 0.788 0.112
#> GSM97061     3  0.3280     0.6707 0.000 0.124 0.860 0.016

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.4040     0.4453 0.712 0.012 0.000 0.000 0.276
#> GSM97145     1  0.4390     0.5632 0.760 0.084 0.000 0.000 0.156
#> GSM97147     1  0.7139     0.4923 0.616 0.128 0.060 0.156 0.040
#> GSM97125     1  0.4701     0.2311 0.612 0.016 0.000 0.004 0.368
#> GSM97127     1  0.2707     0.6089 0.860 0.008 0.000 0.000 0.132
#> GSM97130     4  0.4079     0.7256 0.092 0.012 0.004 0.816 0.076
#> GSM97133     1  0.0798     0.6462 0.976 0.008 0.000 0.000 0.016
#> GSM97134     4  0.5042     0.6437 0.044 0.040 0.000 0.728 0.188
#> GSM97120     1  0.1331     0.6449 0.952 0.008 0.000 0.000 0.040
#> GSM97126     1  0.4631     0.4486 0.696 0.020 0.008 0.004 0.272
#> GSM97112     5  0.3895     0.5352 0.264 0.004 0.000 0.004 0.728
#> GSM97115     4  0.2443     0.7863 0.036 0.004 0.040 0.912 0.008
#> GSM97116     1  0.2970     0.5702 0.828 0.000 0.000 0.004 0.168
#> GSM97117     2  0.4751     0.5205 0.036 0.692 0.264 0.000 0.008
#> GSM97119     5  0.4875     0.4545 0.336 0.008 0.000 0.024 0.632
#> GSM97122     5  0.4835     0.3877 0.384 0.004 0.000 0.020 0.592
#> GSM97135     5  0.4837     0.3078 0.424 0.004 0.000 0.016 0.556
#> GSM97136     5  0.6727    -0.1657 0.040 0.400 0.100 0.000 0.460
#> GSM97139     1  0.1502     0.6419 0.940 0.004 0.000 0.000 0.056
#> GSM97146     1  0.1041     0.6427 0.964 0.004 0.000 0.000 0.032
#> GSM97123     3  0.4088     0.2632 0.000 0.304 0.688 0.008 0.000
#> GSM97129     2  0.7074     0.4698 0.156 0.580 0.180 0.004 0.080
#> GSM97143     5  0.4505     0.4239 0.368 0.008 0.000 0.004 0.620
#> GSM97113     1  0.6010     0.1382 0.584 0.208 0.208 0.000 0.000
#> GSM97056     1  0.5707     0.3916 0.644 0.008 0.004 0.244 0.100
#> GSM97124     5  0.6356     0.3558 0.344 0.020 0.000 0.108 0.528
#> GSM97132     5  0.6473     0.3663 0.280 0.004 0.000 0.200 0.516
#> GSM97144     4  0.3243     0.7584 0.012 0.036 0.000 0.860 0.092
#> GSM97149     1  0.1430     0.6235 0.944 0.004 0.052 0.000 0.000
#> GSM97068     4  0.4531     0.7212 0.128 0.024 0.068 0.780 0.000
#> GSM97071     4  0.1498     0.7899 0.000 0.008 0.024 0.952 0.016
#> GSM97086     4  0.1764     0.7727 0.000 0.064 0.008 0.928 0.000
#> GSM97103     2  0.2635     0.5708 0.000 0.888 0.016 0.088 0.008
#> GSM97057     1  0.5122     0.2443 0.584 0.012 0.380 0.024 0.000
#> GSM97060     3  0.5703     0.5245 0.000 0.148 0.684 0.028 0.140
#> GSM97075     3  0.4009     0.2790 0.004 0.312 0.684 0.000 0.000
#> GSM97098     2  0.2077     0.5865 0.000 0.908 0.084 0.008 0.000
#> GSM97099     2  0.3274     0.6026 0.064 0.856 0.076 0.004 0.000
#> GSM97101     2  0.6780     0.3722 0.280 0.448 0.268 0.004 0.000
#> GSM97105     2  0.6291     0.3355 0.040 0.520 0.376 0.064 0.000
#> GSM97106     3  0.5688     0.3321 0.000 0.296 0.608 0.088 0.008
#> GSM97121     2  0.5814     0.5502 0.116 0.688 0.148 0.048 0.000
#> GSM97128     5  0.5491     0.3417 0.000 0.004 0.116 0.224 0.656
#> GSM97131     2  0.6729     0.2947 0.004 0.460 0.244 0.292 0.000
#> GSM97137     1  0.4878     0.4801 0.728 0.004 0.000 0.164 0.104
#> GSM97118     5  0.4436     0.5664 0.140 0.000 0.004 0.088 0.768
#> GSM97114     1  0.5924    -0.0601 0.504 0.400 0.092 0.004 0.000
#> GSM97142     5  0.4253     0.5177 0.284 0.008 0.000 0.008 0.700
#> GSM97140     3  0.7524     0.0723 0.296 0.136 0.472 0.096 0.000
#> GSM97141     2  0.6735     0.3509 0.340 0.436 0.220 0.004 0.000
#> GSM97055     5  0.3572     0.5333 0.040 0.008 0.120 0.000 0.832
#> GSM97090     4  0.4586     0.7466 0.052 0.008 0.104 0.796 0.040
#> GSM97091     5  0.2983     0.5776 0.096 0.000 0.032 0.004 0.868
#> GSM97148     1  0.0671     0.6433 0.980 0.004 0.000 0.000 0.016
#> GSM97063     5  0.3726     0.5784 0.152 0.004 0.028 0.004 0.812
#> GSM97053     1  0.5390    -0.0438 0.536 0.004 0.000 0.048 0.412
#> GSM97066     3  0.6114     0.3931 0.000 0.128 0.472 0.000 0.400
#> GSM97079     4  0.3527     0.6873 0.000 0.192 0.016 0.792 0.000
#> GSM97083     4  0.4669     0.5332 0.004 0.004 0.016 0.656 0.320
#> GSM97084     4  0.1041     0.7839 0.000 0.032 0.004 0.964 0.000
#> GSM97094     4  0.4469     0.7020 0.000 0.148 0.000 0.756 0.096
#> GSM97096     2  0.3419     0.5257 0.000 0.804 0.180 0.000 0.016
#> GSM97097     2  0.4150     0.1329 0.000 0.612 0.000 0.388 0.000
#> GSM97107     4  0.2879     0.7647 0.000 0.100 0.000 0.868 0.032
#> GSM97054     4  0.3243     0.7242 0.000 0.004 0.180 0.812 0.004
#> GSM97062     4  0.0898     0.7856 0.000 0.008 0.020 0.972 0.000
#> GSM97069     3  0.6347     0.3556 0.000 0.160 0.432 0.000 0.408
#> GSM97070     3  0.6303     0.4174 0.000 0.196 0.524 0.000 0.280
#> GSM97073     2  0.6326     0.1385 0.000 0.524 0.268 0.000 0.208
#> GSM97076     2  0.5902     0.1630 0.016 0.556 0.028 0.024 0.376
#> GSM97077     3  0.5380     0.4158 0.100 0.032 0.716 0.152 0.000
#> GSM97095     4  0.3412     0.7663 0.060 0.004 0.020 0.864 0.052
#> GSM97102     2  0.5703     0.3085 0.000 0.628 0.184 0.000 0.188
#> GSM97109     2  0.2973     0.5905 0.084 0.880 0.012 0.016 0.008
#> GSM97110     2  0.2569     0.5993 0.040 0.892 0.068 0.000 0.000
#> GSM97074     5  0.2616     0.4937 0.000 0.020 0.100 0.000 0.880
#> GSM97085     5  0.4398     0.2068 0.000 0.040 0.240 0.000 0.720
#> GSM97059     1  0.6162     0.3346 0.572 0.004 0.252 0.172 0.000
#> GSM97072     2  0.5440     0.2625 0.000 0.620 0.300 0.004 0.076
#> GSM97078     4  0.6464     0.3917 0.000 0.008 0.168 0.520 0.304
#> GSM97067     3  0.6519     0.3267 0.000 0.192 0.408 0.000 0.400
#> GSM97087     3  0.2722     0.5732 0.000 0.020 0.872 0.000 0.108
#> GSM97111     2  0.3760     0.5707 0.028 0.784 0.188 0.000 0.000
#> GSM97064     3  0.3279     0.5131 0.016 0.048 0.864 0.072 0.000
#> GSM97065     2  0.5908     0.3000 0.080 0.552 0.356 0.000 0.012
#> GSM97081     3  0.5843     0.1710 0.000 0.388 0.512 0.000 0.100
#> GSM97082     3  0.5040     0.5107 0.000 0.068 0.660 0.000 0.272
#> GSM97088     5  0.5375     0.2996 0.000 0.004 0.220 0.108 0.668
#> GSM97100     4  0.6649     0.3860 0.024 0.164 0.268 0.544 0.000
#> GSM97104     3  0.6659     0.3337 0.000 0.248 0.436 0.000 0.316
#> GSM97108     2  0.6417     0.4918 0.160 0.596 0.216 0.028 0.000
#> GSM97050     3  0.5186     0.4404 0.068 0.052 0.740 0.140 0.000
#> GSM97080     3  0.5592     0.4995 0.000 0.144 0.636 0.000 0.220
#> GSM97089     3  0.2959     0.5736 0.000 0.036 0.864 0.000 0.100
#> GSM97092     3  0.3291     0.5583 0.000 0.088 0.848 0.000 0.064
#> GSM97093     3  0.5469     0.3828 0.164 0.092 0.708 0.036 0.000
#> GSM97058     3  0.4849     0.4548 0.040 0.128 0.764 0.068 0.000
#> GSM97051     4  0.4735     0.2320 0.004 0.004 0.472 0.516 0.004
#> GSM97052     3  0.3135     0.5659 0.000 0.036 0.876 0.028 0.060
#> GSM97061     3  0.3243     0.5185 0.000 0.092 0.860 0.036 0.012

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.4821    0.24996 0.584 0.040 0.000 0.000 0.364 0.012
#> GSM97145     5  0.6707    0.10079 0.304 0.268 0.000 0.000 0.392 0.036
#> GSM97147     2  0.5307    0.51987 0.128 0.700 0.000 0.080 0.088 0.004
#> GSM97125     5  0.4136    0.54542 0.248 0.040 0.000 0.000 0.708 0.004
#> GSM97127     1  0.4901    0.43780 0.640 0.060 0.000 0.000 0.284 0.016
#> GSM97130     4  0.3211    0.77121 0.028 0.016 0.000 0.852 0.092 0.012
#> GSM97133     1  0.1367    0.80079 0.944 0.012 0.000 0.000 0.044 0.000
#> GSM97134     5  0.5218    0.20626 0.000 0.076 0.000 0.376 0.540 0.008
#> GSM97120     1  0.1245    0.80018 0.952 0.016 0.000 0.000 0.032 0.000
#> GSM97126     5  0.4998    0.53428 0.164 0.172 0.000 0.000 0.660 0.004
#> GSM97112     5  0.2247    0.69235 0.060 0.000 0.024 0.000 0.904 0.012
#> GSM97115     4  0.3827    0.77235 0.036 0.068 0.024 0.828 0.044 0.000
#> GSM97116     1  0.1471    0.79337 0.932 0.004 0.000 0.000 0.064 0.000
#> GSM97117     2  0.4370    0.56177 0.020 0.772 0.036 0.000 0.032 0.140
#> GSM97119     5  0.2252    0.69085 0.056 0.016 0.000 0.016 0.908 0.004
#> GSM97122     5  0.2323    0.68307 0.084 0.012 0.000 0.012 0.892 0.000
#> GSM97135     5  0.2951    0.64668 0.168 0.004 0.000 0.004 0.820 0.004
#> GSM97136     5  0.6890    0.26312 0.004 0.204 0.104 0.000 0.508 0.180
#> GSM97139     1  0.1462    0.79683 0.936 0.008 0.000 0.000 0.056 0.000
#> GSM97146     1  0.0713    0.80170 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM97123     2  0.4498    0.31739 0.000 0.632 0.324 0.004 0.000 0.040
#> GSM97129     2  0.5044    0.49312 0.044 0.712 0.008 0.000 0.164 0.072
#> GSM97143     5  0.2580    0.69127 0.068 0.008 0.008 0.004 0.892 0.020
#> GSM97113     1  0.4192    0.59154 0.748 0.188 0.028 0.000 0.000 0.036
#> GSM97056     1  0.3514    0.72587 0.828 0.008 0.008 0.112 0.040 0.004
#> GSM97124     5  0.4290    0.65826 0.080 0.048 0.000 0.084 0.784 0.004
#> GSM97132     5  0.4552    0.60208 0.052 0.012 0.000 0.188 0.732 0.016
#> GSM97144     4  0.3384    0.72161 0.000 0.024 0.000 0.800 0.168 0.008
#> GSM97149     1  0.0508    0.79684 0.984 0.012 0.004 0.000 0.000 0.000
#> GSM97068     4  0.4768    0.61847 0.240 0.040 0.012 0.692 0.004 0.012
#> GSM97071     4  0.3614    0.74212 0.004 0.008 0.052 0.832 0.016 0.088
#> GSM97086     4  0.2203    0.76355 0.000 0.016 0.004 0.896 0.000 0.084
#> GSM97103     6  0.4703    0.56001 0.000 0.204 0.008 0.084 0.004 0.700
#> GSM97057     1  0.4036    0.64476 0.772 0.100 0.120 0.008 0.000 0.000
#> GSM97060     3  0.4877    0.38976 0.000 0.040 0.688 0.032 0.008 0.232
#> GSM97075     2  0.6213   -0.08083 0.016 0.412 0.384 0.000 0.000 0.188
#> GSM97098     6  0.4127    0.58216 0.000 0.236 0.044 0.004 0.000 0.716
#> GSM97099     6  0.5531    0.26704 0.040 0.416 0.040 0.000 0.004 0.500
#> GSM97101     2  0.2781    0.62814 0.036 0.880 0.044 0.000 0.000 0.040
#> GSM97105     2  0.2635    0.61112 0.004 0.880 0.076 0.004 0.000 0.036
#> GSM97106     3  0.6634    0.28069 0.000 0.192 0.500 0.068 0.000 0.240
#> GSM97121     2  0.2879    0.59209 0.012 0.864 0.000 0.012 0.012 0.100
#> GSM97128     5  0.6039    0.42496 0.008 0.004 0.184 0.196 0.588 0.020
#> GSM97131     2  0.4704    0.55317 0.000 0.732 0.092 0.140 0.000 0.036
#> GSM97137     1  0.2653    0.76041 0.876 0.004 0.000 0.064 0.056 0.000
#> GSM97118     5  0.2978    0.68235 0.012 0.000 0.020 0.068 0.872 0.028
#> GSM97114     2  0.5821    0.21886 0.372 0.488 0.000 0.000 0.016 0.124
#> GSM97142     5  0.1862    0.69372 0.044 0.000 0.008 0.004 0.928 0.016
#> GSM97140     2  0.4522    0.48370 0.040 0.736 0.192 0.020 0.008 0.004
#> GSM97141     2  0.2943    0.63241 0.052 0.872 0.020 0.000 0.004 0.052
#> GSM97055     5  0.4813    0.49597 0.016 0.000 0.272 0.004 0.660 0.048
#> GSM97090     4  0.5151    0.72039 0.080 0.024 0.120 0.728 0.048 0.000
#> GSM97091     5  0.2592    0.67433 0.012 0.000 0.080 0.004 0.884 0.020
#> GSM97148     1  0.0692    0.80160 0.976 0.000 0.004 0.000 0.020 0.000
#> GSM97063     5  0.2650    0.68485 0.036 0.000 0.056 0.004 0.888 0.016
#> GSM97053     5  0.4395    0.51759 0.276 0.004 0.008 0.024 0.684 0.004
#> GSM97066     3  0.5650    0.22898 0.000 0.016 0.548 0.016 0.068 0.352
#> GSM97079     4  0.3955    0.62043 0.000 0.004 0.032 0.724 0.000 0.240
#> GSM97083     4  0.5176    0.42034 0.008 0.004 0.056 0.580 0.348 0.004
#> GSM97084     4  0.2489    0.76389 0.004 0.004 0.016 0.888 0.004 0.084
#> GSM97094     4  0.4799    0.66746 0.000 0.028 0.000 0.704 0.076 0.192
#> GSM97096     6  0.4723    0.57741 0.000 0.124 0.156 0.012 0.000 0.708
#> GSM97097     6  0.5562    0.11076 0.000 0.124 0.000 0.376 0.004 0.496
#> GSM97107     4  0.3676    0.73960 0.000 0.020 0.000 0.808 0.052 0.120
#> GSM97054     4  0.3579    0.71872 0.008 0.064 0.120 0.808 0.000 0.000
#> GSM97062     4  0.2012    0.77569 0.000 0.008 0.028 0.924 0.008 0.032
#> GSM97069     3  0.5228    0.17743 0.000 0.004 0.532 0.004 0.072 0.388
#> GSM97070     3  0.5677    0.16235 0.000 0.040 0.500 0.008 0.044 0.408
#> GSM97073     6  0.4791    0.37418 0.000 0.032 0.252 0.008 0.028 0.680
#> GSM97076     6  0.4421    0.57029 0.012 0.040 0.052 0.036 0.056 0.804
#> GSM97077     3  0.6496   -0.02390 0.016 0.420 0.420 0.116 0.012 0.016
#> GSM97095     4  0.3392    0.77503 0.024 0.024 0.016 0.844 0.092 0.000
#> GSM97102     6  0.4806    0.51729 0.000 0.072 0.200 0.000 0.028 0.700
#> GSM97109     6  0.4898    0.49146 0.032 0.292 0.004 0.016 0.008 0.648
#> GSM97110     6  0.4103    0.63284 0.052 0.136 0.016 0.012 0.000 0.784
#> GSM97074     5  0.6565    0.23561 0.000 0.000 0.240 0.040 0.464 0.256
#> GSM97085     5  0.5834   -0.00175 0.000 0.000 0.424 0.008 0.424 0.144
#> GSM97059     1  0.7417    0.11035 0.404 0.204 0.188 0.204 0.000 0.000
#> GSM97072     6  0.4058    0.48077 0.000 0.044 0.196 0.012 0.000 0.748
#> GSM97078     4  0.6490    0.39742 0.008 0.008 0.284 0.496 0.188 0.016
#> GSM97067     3  0.5297    0.04978 0.000 0.008 0.472 0.012 0.048 0.460
#> GSM97087     3  0.3544    0.46728 0.000 0.140 0.804 0.000 0.008 0.048
#> GSM97111     2  0.4446    0.43006 0.012 0.708 0.036 0.000 0.008 0.236
#> GSM97064     3  0.4944    0.25479 0.012 0.340 0.600 0.044 0.000 0.004
#> GSM97065     6  0.6515    0.30636 0.156 0.084 0.224 0.000 0.000 0.536
#> GSM97081     2  0.6292   -0.12352 0.000 0.388 0.388 0.000 0.016 0.208
#> GSM97082     3  0.4394    0.41278 0.000 0.020 0.760 0.004 0.092 0.124
#> GSM97088     5  0.6081    0.25170 0.004 0.004 0.384 0.084 0.488 0.036
#> GSM97100     2  0.4873    0.46925 0.000 0.676 0.104 0.212 0.004 0.004
#> GSM97104     3  0.5543    0.14449 0.000 0.028 0.532 0.000 0.072 0.368
#> GSM97108     2  0.3300    0.61200 0.036 0.856 0.000 0.024 0.016 0.068
#> GSM97050     3  0.5949    0.21973 0.016 0.316 0.540 0.116 0.000 0.012
#> GSM97080     3  0.5006    0.34029 0.004 0.024 0.660 0.008 0.036 0.268
#> GSM97089     3  0.4007    0.46910 0.000 0.144 0.776 0.000 0.016 0.064
#> GSM97092     3  0.4165    0.35232 0.000 0.292 0.676 0.000 0.004 0.028
#> GSM97093     2  0.5938    0.03826 0.032 0.484 0.420 0.032 0.008 0.024
#> GSM97058     3  0.6619    0.14927 0.024 0.372 0.464 0.072 0.000 0.068
#> GSM97051     3  0.6620    0.01786 0.012 0.308 0.356 0.316 0.000 0.008
#> GSM97052     3  0.3897    0.37008 0.000 0.264 0.712 0.016 0.000 0.008
#> GSM97061     3  0.4650    0.13518 0.000 0.416 0.548 0.028 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)

plot of chunk tab-CV-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-NMF-membership-heatmap-5

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)

plot of chunk tab-CV-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-CV-NMF-get-signatures-no-scale-1

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

plot of chunk tab-CV-NMF-get-signatures-no-scale-2

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

plot of chunk tab-CV-NMF-get-signatures-no-scale-3

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

plot of chunk tab-CV-NMF-get-signatures-no-scale-4

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

plot of chunk tab-CV-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-NMF-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-CV-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-NMF-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:NMF 98         8.95e-05       0.650     4.19e-14    0.184 2
#> CV:NMF 79         7.34e-05       0.107     9.83e-13    0.402 3
#> CV:NMF 62         2.76e-03       0.253     1.41e-11    0.180 4
#> CV:NMF 48         2.44e-04       0.228     6.96e-10    0.384 5
#> CV:NMF 53         7.07e-02       0.720     8.65e-10    0.108 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.


MAD:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "hclust"]
# 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 21512 rows and 100 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)

plot of chunk MAD-hclust-collect-plots

The plots are:

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:

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)

plot of chunk MAD-hclust-select-partition-number

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.219           0.661       0.817         0.4233 0.540   0.540
#> 3 3 0.248           0.351       0.653         0.4089 0.835   0.738
#> 4 4 0.337           0.527       0.696         0.1696 0.761   0.568
#> 5 5 0.434           0.568       0.697         0.0667 0.890   0.672
#> 6 6 0.576           0.538       0.702         0.0665 0.977   0.909

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.1633    0.77905 0.976 0.024
#> GSM97145     1  0.0938    0.78277 0.988 0.012
#> GSM97147     2  0.8861    0.71951 0.304 0.696
#> GSM97125     1  0.0938    0.78277 0.988 0.012
#> GSM97127     1  0.0938    0.78277 0.988 0.012
#> GSM97130     1  0.8144    0.57446 0.748 0.252
#> GSM97133     1  0.0376    0.78306 0.996 0.004
#> GSM97134     1  0.9983   -0.14646 0.524 0.476
#> GSM97120     1  0.0376    0.78150 0.996 0.004
#> GSM97126     1  0.9881    0.02908 0.564 0.436
#> GSM97112     1  0.0000    0.78251 1.000 0.000
#> GSM97115     1  0.9866    0.08085 0.568 0.432
#> GSM97116     1  0.0000    0.78251 1.000 0.000
#> GSM97117     2  0.8661    0.73553 0.288 0.712
#> GSM97119     1  0.0000    0.78251 1.000 0.000
#> GSM97122     1  0.0000    0.78251 1.000 0.000
#> GSM97135     1  0.0000    0.78251 1.000 0.000
#> GSM97136     2  0.9977    0.28813 0.472 0.528
#> GSM97139     1  0.0000    0.78251 1.000 0.000
#> GSM97146     1  0.0000    0.78251 1.000 0.000
#> GSM97123     2  0.2236    0.77300 0.036 0.964
#> GSM97129     1  0.9988   -0.16330 0.520 0.480
#> GSM97143     1  0.7453    0.61867 0.788 0.212
#> GSM97113     2  0.9358    0.65026 0.352 0.648
#> GSM97056     1  0.3274    0.76052 0.940 0.060
#> GSM97124     1  0.1184    0.78204 0.984 0.016
#> GSM97132     1  0.8207    0.57089 0.744 0.256
#> GSM97144     1  0.8713    0.50735 0.708 0.292
#> GSM97149     1  0.0000    0.78251 1.000 0.000
#> GSM97068     1  0.9922    0.00378 0.552 0.448
#> GSM97071     2  0.8207    0.74548 0.256 0.744
#> GSM97086     2  0.7376    0.77761 0.208 0.792
#> GSM97103     2  0.3584    0.78227 0.068 0.932
#> GSM97057     2  0.9358    0.65143 0.352 0.648
#> GSM97060     2  0.0000    0.74787 0.000 1.000
#> GSM97075     2  0.8144    0.76220 0.252 0.748
#> GSM97098     2  0.3584    0.78227 0.068 0.932
#> GSM97099     2  0.8608    0.73843 0.284 0.716
#> GSM97101     2  0.8499    0.74541 0.276 0.724
#> GSM97105     2  0.5629    0.79337 0.132 0.868
#> GSM97106     2  0.0000    0.74787 0.000 1.000
#> GSM97121     2  0.8555    0.73399 0.280 0.720
#> GSM97128     2  0.9963    0.36549 0.464 0.536
#> GSM97131     2  0.5178    0.79295 0.116 0.884
#> GSM97137     1  0.8016    0.58613 0.756 0.244
#> GSM97118     1  0.7602    0.60782 0.780 0.220
#> GSM97114     2  0.8661    0.73553 0.288 0.712
#> GSM97142     1  0.0000    0.78251 1.000 0.000
#> GSM97140     2  0.8081    0.76790 0.248 0.752
#> GSM97141     2  0.8499    0.74420 0.276 0.724
#> GSM97055     1  0.9248    0.36432 0.660 0.340
#> GSM97090     1  0.9909    0.03821 0.556 0.444
#> GSM97091     1  0.2603    0.77011 0.956 0.044
#> GSM97148     1  0.0000    0.78251 1.000 0.000
#> GSM97063     1  0.2603    0.77011 0.956 0.044
#> GSM97053     1  0.0000    0.78251 1.000 0.000
#> GSM97066     2  0.2603    0.77621 0.044 0.956
#> GSM97079     2  0.7453    0.77533 0.212 0.788
#> GSM97083     2  0.9970    0.35371 0.468 0.532
#> GSM97084     2  0.7745    0.76494 0.228 0.772
#> GSM97094     2  0.7745    0.76494 0.228 0.772
#> GSM97096     2  0.3584    0.78227 0.068 0.932
#> GSM97097     2  0.7745    0.76494 0.228 0.772
#> GSM97107     2  0.8016    0.75300 0.244 0.756
#> GSM97054     2  0.8207    0.74548 0.256 0.744
#> GSM97062     2  0.7453    0.77533 0.212 0.788
#> GSM97069     2  0.1184    0.76026 0.016 0.984
#> GSM97070     2  0.2603    0.77621 0.044 0.956
#> GSM97073     2  0.3584    0.78451 0.068 0.932
#> GSM97076     2  0.9710    0.53441 0.400 0.600
#> GSM97077     2  0.7219    0.78772 0.200 0.800
#> GSM97095     1  0.9988   -0.15209 0.520 0.480
#> GSM97102     2  0.3584    0.78227 0.068 0.932
#> GSM97109     2  0.7453    0.77457 0.212 0.788
#> GSM97110     2  0.7453    0.77457 0.212 0.788
#> GSM97074     2  0.9866    0.44192 0.432 0.568
#> GSM97085     2  0.9775    0.48842 0.412 0.588
#> GSM97059     2  0.9209    0.67693 0.336 0.664
#> GSM97072     2  0.0000    0.74787 0.000 1.000
#> GSM97078     2  0.9963    0.36549 0.464 0.536
#> GSM97067     2  0.1414    0.76330 0.020 0.980
#> GSM97087     2  0.0000    0.74787 0.000 1.000
#> GSM97111     2  0.8386    0.75213 0.268 0.732
#> GSM97064     2  0.6623    0.79326 0.172 0.828
#> GSM97065     2  0.9427    0.61986 0.360 0.640
#> GSM97081     2  0.8016    0.76743 0.244 0.756
#> GSM97082     2  0.3274    0.77808 0.060 0.940
#> GSM97088     2  0.9775    0.48842 0.412 0.588
#> GSM97100     2  0.7883    0.77464 0.236 0.764
#> GSM97104     2  0.0000    0.74787 0.000 1.000
#> GSM97108     2  0.8267    0.75939 0.260 0.740
#> GSM97050     2  0.6148    0.79673 0.152 0.848
#> GSM97080     2  0.1414    0.76312 0.020 0.980
#> GSM97089     2  0.0000    0.74787 0.000 1.000
#> GSM97092     2  0.1184    0.76040 0.016 0.984
#> GSM97093     2  0.9815    0.45269 0.420 0.580
#> GSM97058     2  0.6623    0.79326 0.172 0.828
#> GSM97051     2  0.4939    0.79182 0.108 0.892
#> GSM97052     2  0.0000    0.74787 0.000 1.000
#> GSM97061     2  0.2236    0.77320 0.036 0.964

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1   0.409    0.77129 0.880 0.052 0.068
#> GSM97145     1   0.191    0.77398 0.956 0.028 0.016
#> GSM97147     2   0.517    0.33763 0.148 0.816 0.036
#> GSM97125     1   0.191    0.77398 0.956 0.028 0.016
#> GSM97127     1   0.191    0.77398 0.956 0.028 0.016
#> GSM97130     1   0.898    0.20433 0.548 0.284 0.168
#> GSM97133     1   0.192    0.76695 0.956 0.020 0.024
#> GSM97134     2   0.836   -0.11222 0.384 0.528 0.088
#> GSM97120     1   0.192    0.76614 0.956 0.020 0.024
#> GSM97126     2   0.866   -0.16524 0.408 0.488 0.104
#> GSM97112     1   0.492    0.76690 0.832 0.036 0.132
#> GSM97115     2   0.922   -0.29130 0.376 0.468 0.156
#> GSM97116     1   0.301    0.77399 0.920 0.028 0.052
#> GSM97117     2   0.518    0.39437 0.156 0.812 0.032
#> GSM97119     1   0.492    0.76690 0.832 0.036 0.132
#> GSM97122     1   0.492    0.76690 0.832 0.036 0.132
#> GSM97135     1   0.492    0.76690 0.832 0.036 0.132
#> GSM97136     2   0.900   -0.08467 0.312 0.532 0.156
#> GSM97139     1   0.164    0.76808 0.964 0.016 0.020
#> GSM97146     1   0.145    0.76260 0.968 0.008 0.024
#> GSM97123     2   0.553    0.45633 0.000 0.704 0.296
#> GSM97129     2   0.835   -0.10669 0.380 0.532 0.088
#> GSM97143     1   0.884    0.41167 0.580 0.208 0.212
#> GSM97113     2   0.634    0.32151 0.252 0.716 0.032
#> GSM97056     1   0.606    0.67356 0.784 0.084 0.132
#> GSM97124     1   0.550    0.76254 0.804 0.048 0.148
#> GSM97132     1   0.907    0.25190 0.544 0.272 0.184
#> GSM97144     1   0.944   -0.00238 0.480 0.324 0.196
#> GSM97149     1   0.145    0.76260 0.968 0.008 0.024
#> GSM97068     2   0.894   -0.27052 0.368 0.500 0.132
#> GSM97071     2   0.576   -0.14019 0.008 0.716 0.276
#> GSM97086     2   0.493    0.12012 0.004 0.784 0.212
#> GSM97103     2   0.626    0.43558 0.004 0.616 0.380
#> GSM97057     2   0.634    0.32028 0.252 0.716 0.032
#> GSM97060     2   0.628    0.38697 0.000 0.540 0.460
#> GSM97075     2   0.649    0.36854 0.064 0.744 0.192
#> GSM97098     2   0.623    0.43849 0.004 0.624 0.372
#> GSM97099     2   0.556    0.39939 0.152 0.800 0.048
#> GSM97101     2   0.543    0.40441 0.144 0.808 0.048
#> GSM97105     2   0.238    0.44314 0.008 0.936 0.056
#> GSM97106     2   0.627    0.39318 0.000 0.548 0.452
#> GSM97121     2   0.518    0.37407 0.164 0.808 0.028
#> GSM97128     3   0.784    0.99129 0.052 0.460 0.488
#> GSM97131     2   0.296    0.45179 0.000 0.900 0.100
#> GSM97137     1   0.884    0.25205 0.568 0.268 0.164
#> GSM97118     1   0.924    0.31149 0.532 0.220 0.248
#> GSM97114     2   0.518    0.39437 0.156 0.812 0.032
#> GSM97142     1   0.492    0.76690 0.832 0.036 0.132
#> GSM97140     2   0.369    0.38397 0.100 0.884 0.016
#> GSM97141     2   0.529    0.40672 0.148 0.812 0.040
#> GSM97055     1   0.996   -0.28877 0.376 0.324 0.300
#> GSM97090     2   0.906   -0.27023 0.364 0.492 0.144
#> GSM97091     1   0.595    0.73669 0.776 0.052 0.172
#> GSM97148     1   0.145    0.76260 0.968 0.008 0.024
#> GSM97063     1   0.595    0.73669 0.776 0.052 0.172
#> GSM97053     1   0.480    0.76885 0.836 0.032 0.132
#> GSM97066     2   0.615    0.43144 0.000 0.592 0.408
#> GSM97079     2   0.498    0.09545 0.004 0.780 0.216
#> GSM97083     3   0.792    0.98266 0.056 0.456 0.488
#> GSM97084     2   0.540   -0.02875 0.004 0.740 0.256
#> GSM97094     2   0.544   -0.03876 0.004 0.736 0.260
#> GSM97096     2   0.623    0.43849 0.004 0.624 0.372
#> GSM97097     2   0.544   -0.03876 0.004 0.736 0.260
#> GSM97107     2   0.573   -0.09367 0.008 0.720 0.272
#> GSM97054     2   0.576   -0.14019 0.008 0.716 0.276
#> GSM97062     2   0.498    0.09545 0.004 0.780 0.216
#> GSM97069     2   0.615    0.43817 0.000 0.592 0.408
#> GSM97070     2   0.614    0.43378 0.000 0.596 0.404
#> GSM97073     2   0.623    0.43975 0.004 0.624 0.372
#> GSM97076     2   0.902    0.00457 0.212 0.560 0.228
#> GSM97077     2   0.285    0.42134 0.056 0.924 0.020
#> GSM97095     2   0.873   -0.24456 0.316 0.552 0.132
#> GSM97102     2   0.626    0.43558 0.004 0.616 0.380
#> GSM97109     2   0.777    0.39229 0.088 0.640 0.272
#> GSM97110     2   0.777    0.39229 0.088 0.640 0.272
#> GSM97074     2   0.843   -0.64225 0.088 0.500 0.412
#> GSM97085     2   0.740   -0.77695 0.032 0.488 0.480
#> GSM97059     2   0.538    0.28765 0.188 0.788 0.024
#> GSM97072     2   0.628    0.40389 0.000 0.540 0.460
#> GSM97078     3   0.784    0.99129 0.052 0.460 0.488
#> GSM97067     2   0.615    0.43563 0.000 0.592 0.408
#> GSM97087     2   0.626    0.39373 0.000 0.552 0.448
#> GSM97111     2   0.657    0.38067 0.088 0.752 0.160
#> GSM97064     2   0.325    0.44672 0.036 0.912 0.052
#> GSM97065     2   0.860    0.11258 0.184 0.604 0.212
#> GSM97081     2   0.645    0.37434 0.056 0.740 0.204
#> GSM97082     2   0.621    0.40812 0.000 0.572 0.428
#> GSM97088     2   0.740   -0.77695 0.032 0.488 0.480
#> GSM97100     2   0.361    0.39372 0.096 0.888 0.016
#> GSM97104     2   0.629    0.39829 0.000 0.536 0.464
#> GSM97108     2   0.500    0.41287 0.124 0.832 0.044
#> GSM97050     2   0.337    0.44777 0.040 0.908 0.052
#> GSM97080     2   0.610    0.44223 0.000 0.608 0.392
#> GSM97089     2   0.626    0.39373 0.000 0.552 0.448
#> GSM97092     2   0.604    0.42901 0.000 0.620 0.380
#> GSM97093     2   0.799    0.12974 0.292 0.616 0.092
#> GSM97058     2   0.315    0.44448 0.036 0.916 0.048
#> GSM97051     2   0.236    0.44326 0.000 0.928 0.072
#> GSM97052     2   0.618    0.41321 0.000 0.584 0.416
#> GSM97061     2   0.576    0.44294 0.000 0.672 0.328

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1   0.298    0.75628 0.888 0.016 0.004 0.092
#> GSM97145     1   0.151    0.76252 0.956 0.028 0.000 0.016
#> GSM97147     2   0.441    0.57761 0.152 0.808 0.012 0.028
#> GSM97125     1   0.151    0.76252 0.956 0.028 0.000 0.016
#> GSM97127     1   0.151    0.76252 0.956 0.028 0.000 0.016
#> GSM97130     1   0.761    0.29315 0.536 0.196 0.012 0.256
#> GSM97133     1   0.148    0.75457 0.960 0.020 0.004 0.016
#> GSM97134     2   0.777    0.27409 0.360 0.460 0.012 0.168
#> GSM97120     1   0.112    0.75680 0.972 0.012 0.004 0.012
#> GSM97126     2   0.795    0.15601 0.384 0.412 0.012 0.192
#> GSM97112     1   0.359    0.74416 0.824 0.008 0.000 0.168
#> GSM97115     2   0.827    0.13526 0.368 0.372 0.016 0.244
#> GSM97116     1   0.216    0.76131 0.928 0.008 0.004 0.060
#> GSM97117     2   0.431    0.56097 0.152 0.812 0.024 0.012
#> GSM97119     1   0.359    0.74416 0.824 0.008 0.000 0.168
#> GSM97122     1   0.359    0.74416 0.824 0.008 0.000 0.168
#> GSM97135     1   0.359    0.74416 0.824 0.008 0.000 0.168
#> GSM97136     2   0.900    0.18394 0.300 0.404 0.068 0.228
#> GSM97139     1   0.111    0.75851 0.972 0.008 0.004 0.016
#> GSM97146     1   0.123    0.75481 0.968 0.008 0.004 0.020
#> GSM97123     3   0.569    0.52137 0.000 0.464 0.512 0.024
#> GSM97129     2   0.777    0.27811 0.356 0.464 0.012 0.168
#> GSM97143     1   0.663    0.36889 0.564 0.064 0.012 0.360
#> GSM97113     2   0.525    0.53881 0.252 0.712 0.028 0.008
#> GSM97056     1   0.510    0.64154 0.772 0.056 0.012 0.160
#> GSM97124     1   0.404    0.74349 0.804 0.020 0.000 0.176
#> GSM97132     1   0.734    0.31201 0.532 0.168 0.004 0.296
#> GSM97144     1   0.796    0.16436 0.472 0.228 0.012 0.288
#> GSM97149     1   0.123    0.75481 0.968 0.008 0.004 0.020
#> GSM97068     2   0.815    0.19181 0.352 0.416 0.016 0.216
#> GSM97071     2   0.637    0.26368 0.008 0.564 0.052 0.376
#> GSM97086     2   0.570    0.41539 0.004 0.680 0.052 0.264
#> GSM97103     3   0.628    0.66144 0.008 0.304 0.624 0.064
#> GSM97057     2   0.519    0.53868 0.256 0.712 0.024 0.008
#> GSM97060     3   0.443    0.70531 0.000 0.204 0.772 0.024
#> GSM97075     2   0.782    0.27358 0.072 0.604 0.168 0.156
#> GSM97098     3   0.634    0.64932 0.008 0.316 0.612 0.064
#> GSM97099     2   0.467    0.55552 0.148 0.800 0.036 0.016
#> GSM97101     2   0.482    0.55003 0.140 0.796 0.048 0.016
#> GSM97105     2   0.317    0.45028 0.004 0.872 0.112 0.012
#> GSM97106     3   0.457    0.70528 0.000 0.220 0.756 0.024
#> GSM97121     2   0.538    0.56524 0.156 0.764 0.056 0.024
#> GSM97128     4   0.318    0.80151 0.032 0.052 0.020 0.896
#> GSM97131     2   0.409    0.38348 0.000 0.804 0.172 0.024
#> GSM97137     1   0.761    0.31957 0.548 0.184 0.016 0.252
#> GSM97118     1   0.676    0.22299 0.512 0.064 0.012 0.412
#> GSM97114     2   0.431    0.56097 0.152 0.812 0.024 0.012
#> GSM97142     1   0.359    0.74416 0.824 0.008 0.000 0.168
#> GSM97140     2   0.390    0.56371 0.092 0.856 0.032 0.020
#> GSM97141     2   0.458    0.55698 0.148 0.804 0.032 0.016
#> GSM97055     4   0.754    0.19184 0.372 0.108 0.024 0.496
#> GSM97090     2   0.822    0.16721 0.356 0.396 0.016 0.232
#> GSM97091     1   0.439    0.70107 0.768 0.012 0.004 0.216
#> GSM97148     1   0.123    0.75481 0.968 0.008 0.004 0.020
#> GSM97063     1   0.439    0.70107 0.768 0.012 0.004 0.216
#> GSM97053     1   0.354    0.74762 0.828 0.008 0.000 0.164
#> GSM97066     3   0.569    0.67758 0.000 0.240 0.688 0.072
#> GSM97079     2   0.570    0.40754 0.004 0.680 0.052 0.264
#> GSM97083     4   0.316    0.79238 0.036 0.052 0.016 0.896
#> GSM97084     2   0.604    0.33684 0.004 0.620 0.052 0.324
#> GSM97094     2   0.606    0.33047 0.004 0.616 0.052 0.328
#> GSM97096     3   0.634    0.64932 0.008 0.316 0.612 0.064
#> GSM97097     2   0.606    0.33047 0.004 0.616 0.052 0.328
#> GSM97107     2   0.632    0.28490 0.008 0.580 0.052 0.360
#> GSM97054     2   0.637    0.26368 0.008 0.564 0.052 0.376
#> GSM97062     2   0.570    0.40754 0.004 0.680 0.052 0.264
#> GSM97069     3   0.508    0.73098 0.000 0.248 0.716 0.036
#> GSM97070     3   0.572    0.68030 0.000 0.244 0.684 0.072
#> GSM97073     3   0.639    0.61143 0.004 0.292 0.620 0.084
#> GSM97076     2   0.971   -0.00147 0.216 0.376 0.224 0.184
#> GSM97077     2   0.347    0.53198 0.052 0.880 0.056 0.012
#> GSM97095     2   0.787    0.29011 0.312 0.488 0.016 0.184
#> GSM97102     3   0.628    0.66144 0.008 0.304 0.624 0.064
#> GSM97109     2   0.837   -0.08601 0.092 0.472 0.344 0.092
#> GSM97110     2   0.837   -0.08601 0.092 0.472 0.344 0.092
#> GSM97074     4   0.761    0.67882 0.080 0.156 0.136 0.628
#> GSM97085     4   0.570    0.78460 0.024 0.092 0.132 0.752
#> GSM97059     2   0.479    0.56630 0.184 0.776 0.016 0.024
#> GSM97072     3   0.440    0.71808 0.000 0.212 0.768 0.020
#> GSM97078     4   0.318    0.80151 0.032 0.052 0.020 0.896
#> GSM97067     3   0.522    0.70059 0.000 0.244 0.712 0.044
#> GSM97087     3   0.460    0.70852 0.000 0.212 0.760 0.028
#> GSM97111     2   0.759    0.34764 0.100 0.636 0.140 0.124
#> GSM97064     2   0.415    0.48275 0.032 0.836 0.116 0.016
#> GSM97065     2   0.955    0.08525 0.192 0.404 0.236 0.168
#> GSM97081     2   0.791    0.22034 0.064 0.588 0.180 0.168
#> GSM97082     3   0.650    0.70026 0.000 0.216 0.636 0.148
#> GSM97088     4   0.570    0.78460 0.024 0.092 0.132 0.752
#> GSM97100     2   0.382    0.56080 0.088 0.860 0.036 0.016
#> GSM97104     3   0.363    0.73078 0.000 0.160 0.828 0.012
#> GSM97108     2   0.464    0.54788 0.120 0.812 0.052 0.016
#> GSM97050     2   0.419    0.48384 0.032 0.840 0.104 0.024
#> GSM97080     3   0.537    0.73647 0.000 0.276 0.684 0.040
#> GSM97089     3   0.460    0.70852 0.000 0.212 0.760 0.028
#> GSM97092     3   0.527    0.68689 0.000 0.320 0.656 0.024
#> GSM97093     2   0.778    0.45193 0.288 0.556 0.060 0.096
#> GSM97058     2   0.404    0.48962 0.032 0.844 0.108 0.016
#> GSM97051     2   0.401    0.40498 0.000 0.816 0.156 0.028
#> GSM97052     3   0.493    0.70845 0.000 0.264 0.712 0.024
#> GSM97061     3   0.561    0.58234 0.000 0.412 0.564 0.024

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1   0.324     0.7190 0.856 0.028 0.000 0.012 0.104
#> GSM97145     1   0.117     0.7356 0.960 0.032 0.000 0.000 0.008
#> GSM97147     2   0.331     0.6126 0.124 0.844 0.000 0.020 0.012
#> GSM97125     1   0.117     0.7356 0.960 0.032 0.000 0.000 0.008
#> GSM97127     1   0.117     0.7356 0.960 0.032 0.000 0.000 0.008
#> GSM97130     1   0.722     0.3689 0.524 0.136 0.000 0.260 0.080
#> GSM97133     1   0.206     0.7259 0.928 0.036 0.000 0.012 0.024
#> GSM97134     2   0.715     0.3014 0.356 0.456 0.004 0.036 0.148
#> GSM97120     1   0.169     0.7291 0.944 0.028 0.000 0.008 0.020
#> GSM97126     2   0.725     0.1915 0.368 0.412 0.008 0.020 0.192
#> GSM97112     1   0.317     0.7088 0.828 0.008 0.000 0.004 0.160
#> GSM97115     1   0.799    -0.1277 0.340 0.328 0.000 0.248 0.084
#> GSM97116     1   0.272     0.7283 0.892 0.028 0.000 0.012 0.068
#> GSM97117     2   0.336     0.6352 0.120 0.844 0.024 0.000 0.012
#> GSM97119     1   0.317     0.7088 0.828 0.008 0.000 0.004 0.160
#> GSM97122     1   0.317     0.7088 0.828 0.008 0.000 0.004 0.160
#> GSM97135     1   0.317     0.7088 0.828 0.008 0.000 0.004 0.160
#> GSM97136     2   0.838     0.2508 0.292 0.396 0.084 0.024 0.204
#> GSM97139     1   0.189     0.7289 0.936 0.028 0.000 0.012 0.024
#> GSM97146     1   0.218     0.7230 0.924 0.028 0.000 0.020 0.028
#> GSM97123     3   0.565     0.3992 0.000 0.460 0.472 0.064 0.004
#> GSM97129     2   0.714     0.3101 0.352 0.460 0.004 0.036 0.148
#> GSM97143     1   0.605     0.3473 0.560 0.056 0.016 0.012 0.356
#> GSM97113     2   0.467     0.5816 0.200 0.744 0.020 0.032 0.004
#> GSM97056     1   0.505     0.6316 0.748 0.044 0.000 0.140 0.068
#> GSM97124     1   0.382     0.7102 0.808 0.020 0.000 0.020 0.152
#> GSM97132     1   0.754     0.4019 0.516 0.116 0.000 0.192 0.176
#> GSM97144     1   0.760     0.2416 0.464 0.148 0.000 0.292 0.096
#> GSM97149     1   0.218     0.7230 0.924 0.028 0.000 0.020 0.028
#> GSM97068     2   0.767     0.0324 0.340 0.384 0.000 0.216 0.060
#> GSM97071     4   0.516     0.8520 0.000 0.248 0.004 0.672 0.076
#> GSM97086     4   0.448     0.7734 0.000 0.416 0.000 0.576 0.008
#> GSM97103     3   0.509     0.6581 0.004 0.212 0.716 0.036 0.032
#> GSM97057     2   0.452     0.5797 0.204 0.748 0.012 0.032 0.004
#> GSM97060     3   0.514     0.6441 0.000 0.200 0.696 0.100 0.004
#> GSM97075     2   0.750     0.2127 0.048 0.576 0.200 0.064 0.112
#> GSM97098     3   0.511     0.6516 0.004 0.224 0.708 0.032 0.032
#> GSM97099     2   0.405     0.6355 0.108 0.824 0.036 0.016 0.016
#> GSM97101     2   0.415     0.6366 0.104 0.820 0.044 0.016 0.016
#> GSM97105     2   0.320     0.5434 0.000 0.852 0.096 0.052 0.000
#> GSM97106     3   0.523     0.6404 0.000 0.212 0.684 0.100 0.004
#> GSM97121     2   0.499     0.6005 0.148 0.760 0.048 0.028 0.016
#> GSM97128     5   0.248     0.7609 0.028 0.004 0.000 0.068 0.900
#> GSM97131     2   0.423     0.4827 0.000 0.776 0.140 0.084 0.000
#> GSM97137     1   0.713     0.3950 0.536 0.128 0.000 0.256 0.080
#> GSM97118     1   0.618     0.2277 0.512 0.052 0.016 0.016 0.404
#> GSM97114     2   0.336     0.6352 0.120 0.844 0.024 0.000 0.012
#> GSM97142     1   0.317     0.7088 0.828 0.008 0.000 0.004 0.160
#> GSM97140     2   0.318     0.6152 0.072 0.876 0.020 0.024 0.008
#> GSM97141     2   0.332     0.6355 0.116 0.844 0.036 0.000 0.004
#> GSM97055     5   0.774     0.2234 0.336 0.104 0.020 0.084 0.456
#> GSM97090     2   0.792    -0.0298 0.328 0.360 0.000 0.232 0.080
#> GSM97091     1   0.395     0.6639 0.768 0.012 0.000 0.012 0.208
#> GSM97148     1   0.218     0.7230 0.924 0.028 0.000 0.020 0.028
#> GSM97063     1   0.395     0.6639 0.768 0.012 0.000 0.012 0.208
#> GSM97053     1   0.301     0.7121 0.832 0.008 0.000 0.000 0.160
#> GSM97066     3   0.420     0.6424 0.000 0.156 0.788 0.036 0.020
#> GSM97079     4   0.446     0.7932 0.000 0.408 0.000 0.584 0.008
#> GSM97083     5   0.279     0.7496 0.028 0.004 0.000 0.088 0.880
#> GSM97084     4   0.394     0.8786 0.000 0.272 0.004 0.720 0.004
#> GSM97094     4   0.412     0.8813 0.000 0.264 0.004 0.720 0.012
#> GSM97096     3   0.511     0.6516 0.004 0.224 0.708 0.032 0.032
#> GSM97097     4   0.399     0.8796 0.000 0.260 0.004 0.728 0.008
#> GSM97107     4   0.471     0.8666 0.004 0.240 0.004 0.712 0.040
#> GSM97054     4   0.516     0.8520 0.000 0.248 0.004 0.672 0.076
#> GSM97062     4   0.446     0.7932 0.000 0.408 0.000 0.584 0.008
#> GSM97069     3   0.363     0.6883 0.000 0.176 0.800 0.020 0.004
#> GSM97070     3   0.424     0.6465 0.000 0.160 0.784 0.036 0.020
#> GSM97073     3   0.520     0.6118 0.000 0.200 0.712 0.052 0.036
#> GSM97076     3   0.943    -0.0345 0.176 0.300 0.300 0.108 0.116
#> GSM97077     2   0.304     0.6001 0.040 0.888 0.044 0.020 0.008
#> GSM97095     2   0.731     0.0879 0.288 0.464 0.000 0.204 0.044
#> GSM97102     3   0.509     0.6581 0.004 0.212 0.716 0.036 0.032
#> GSM97109     3   0.751     0.2730 0.068 0.388 0.444 0.040 0.060
#> GSM97110     3   0.751     0.2730 0.068 0.388 0.444 0.040 0.060
#> GSM97074     5   0.663     0.6635 0.080 0.104 0.160 0.012 0.644
#> GSM97085     5   0.484     0.7545 0.020 0.044 0.148 0.020 0.768
#> GSM97059     2   0.377     0.5900 0.156 0.808 0.000 0.020 0.016
#> GSM97072     3   0.353     0.6676 0.000 0.128 0.824 0.048 0.000
#> GSM97078     5   0.242     0.7616 0.028 0.004 0.000 0.064 0.904
#> GSM97067     3   0.369     0.6639 0.000 0.156 0.808 0.032 0.004
#> GSM97087     3   0.510     0.6434 0.000 0.208 0.696 0.092 0.004
#> GSM97111     2   0.731     0.3454 0.076 0.612 0.164 0.064 0.084
#> GSM97064     2   0.342     0.5740 0.020 0.852 0.104 0.020 0.004
#> GSM97065     2   0.919    -0.1051 0.144 0.336 0.312 0.108 0.100
#> GSM97081     2   0.760     0.1478 0.040 0.560 0.212 0.076 0.112
#> GSM97082     3   0.639     0.6480 0.000 0.208 0.628 0.080 0.084
#> GSM97088     5   0.484     0.7545 0.020 0.044 0.148 0.020 0.768
#> GSM97100     2   0.330     0.6114 0.068 0.872 0.024 0.028 0.008
#> GSM97104     3   0.411     0.6769 0.000 0.140 0.784 0.076 0.000
#> GSM97108     2   0.406     0.6345 0.092 0.828 0.048 0.020 0.012
#> GSM97050     2   0.362     0.5795 0.024 0.852 0.084 0.032 0.008
#> GSM97080     3   0.432     0.6887 0.000 0.212 0.748 0.032 0.008
#> GSM97089     3   0.510     0.6434 0.000 0.208 0.696 0.092 0.004
#> GSM97092     3   0.547     0.5897 0.000 0.320 0.604 0.072 0.004
#> GSM97093     2   0.739     0.4679 0.252 0.560 0.072 0.048 0.068
#> GSM97058     2   0.331     0.5767 0.020 0.860 0.096 0.020 0.004
#> GSM97051     2   0.419     0.4940 0.000 0.796 0.128 0.064 0.012
#> GSM97052     3   0.530     0.6214 0.000 0.272 0.648 0.076 0.004
#> GSM97061     3   0.566     0.4754 0.000 0.412 0.516 0.068 0.004

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.4071    0.70473 0.796 0.024 0.000 0.008 0.072 0.100
#> GSM97145     1  0.1624    0.72057 0.936 0.040 0.000 0.000 0.004 0.020
#> GSM97147     2  0.3573    0.65114 0.076 0.836 0.000 0.032 0.008 0.048
#> GSM97125     1  0.1552    0.72160 0.940 0.036 0.000 0.000 0.004 0.020
#> GSM97127     1  0.1624    0.72057 0.936 0.040 0.000 0.000 0.004 0.020
#> GSM97130     1  0.7545    0.30891 0.460 0.096 0.000 0.276 0.072 0.096
#> GSM97133     1  0.2867    0.70476 0.848 0.040 0.000 0.000 0.000 0.112
#> GSM97134     2  0.7452    0.34739 0.312 0.448 0.004 0.052 0.108 0.076
#> GSM97120     1  0.2848    0.70741 0.856 0.036 0.000 0.004 0.000 0.104
#> GSM97126     2  0.7538    0.23952 0.332 0.404 0.008 0.020 0.136 0.100
#> GSM97112     1  0.2821    0.69662 0.832 0.000 0.000 0.000 0.152 0.016
#> GSM97115     2  0.8236    0.07916 0.272 0.292 0.000 0.268 0.060 0.108
#> GSM97116     1  0.3705    0.71051 0.812 0.024 0.000 0.004 0.040 0.120
#> GSM97117     2  0.2903    0.64462 0.076 0.864 0.004 0.000 0.004 0.052
#> GSM97119     1  0.2821    0.69662 0.832 0.000 0.000 0.000 0.152 0.016
#> GSM97122     1  0.2821    0.69662 0.832 0.000 0.000 0.000 0.152 0.016
#> GSM97135     1  0.2821    0.69662 0.832 0.000 0.000 0.000 0.152 0.016
#> GSM97136     2  0.8303    0.11423 0.260 0.368 0.068 0.004 0.124 0.176
#> GSM97139     1  0.2776    0.70791 0.860 0.032 0.000 0.004 0.000 0.104
#> GSM97146     1  0.3164    0.69425 0.824 0.032 0.000 0.004 0.000 0.140
#> GSM97123     3  0.5862    0.28421 0.000 0.388 0.476 0.012 0.004 0.120
#> GSM97129     2  0.7411    0.35285 0.312 0.452 0.004 0.052 0.108 0.072
#> GSM97143     1  0.6179    0.31974 0.544 0.020 0.012 0.004 0.292 0.128
#> GSM97113     2  0.4358    0.61178 0.144 0.756 0.016 0.004 0.000 0.080
#> GSM97056     1  0.5512    0.60148 0.684 0.016 0.000 0.144 0.044 0.112
#> GSM97124     1  0.3708    0.69834 0.808 0.012 0.000 0.024 0.136 0.020
#> GSM97132     1  0.7730    0.36662 0.476 0.080 0.000 0.200 0.148 0.096
#> GSM97144     1  0.7462    0.20772 0.432 0.092 0.000 0.324 0.088 0.064
#> GSM97149     1  0.3164    0.69425 0.824 0.032 0.000 0.004 0.000 0.140
#> GSM97068     2  0.8099    0.15626 0.268 0.344 0.000 0.228 0.052 0.108
#> GSM97071     4  0.3217    0.79323 0.000 0.044 0.000 0.852 0.068 0.036
#> GSM97086     4  0.3819    0.70061 0.000 0.280 0.000 0.700 0.000 0.020
#> GSM97103     3  0.3548    0.47914 0.000 0.048 0.796 0.000 0.004 0.152
#> GSM97057     2  0.4209    0.61285 0.148 0.760 0.008 0.004 0.000 0.080
#> GSM97060     3  0.3659    0.58433 0.000 0.012 0.752 0.012 0.000 0.224
#> GSM97075     2  0.6867   -0.00532 0.020 0.472 0.184 0.000 0.040 0.284
#> GSM97098     3  0.3728    0.47243 0.000 0.060 0.784 0.000 0.004 0.152
#> GSM97099     2  0.3862    0.62884 0.064 0.804 0.020 0.000 0.004 0.108
#> GSM97101     2  0.4019    0.62950 0.064 0.796 0.028 0.000 0.004 0.108
#> GSM97105     2  0.3162    0.60877 0.000 0.860 0.064 0.040 0.004 0.032
#> GSM97106     3  0.4312    0.58391 0.000 0.032 0.728 0.020 0.004 0.216
#> GSM97121     2  0.4536    0.63951 0.116 0.780 0.032 0.032 0.008 0.032
#> GSM97128     5  0.0260    0.69517 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM97131     2  0.4346    0.56550 0.000 0.776 0.112 0.060 0.004 0.048
#> GSM97137     1  0.7520    0.32931 0.468 0.092 0.000 0.268 0.072 0.100
#> GSM97118     1  0.6216    0.21149 0.500 0.016 0.012 0.004 0.344 0.124
#> GSM97114     2  0.2903    0.64462 0.076 0.864 0.004 0.000 0.004 0.052
#> GSM97142     1  0.2821    0.69662 0.832 0.000 0.000 0.000 0.152 0.016
#> GSM97140     2  0.3153    0.65106 0.036 0.872 0.016 0.028 0.004 0.044
#> GSM97141     2  0.2797    0.64770 0.076 0.872 0.016 0.000 0.000 0.036
#> GSM97055     5  0.7090    0.20008 0.296 0.032 0.024 0.000 0.404 0.244
#> GSM97090     2  0.8153    0.12067 0.264 0.324 0.000 0.252 0.056 0.104
#> GSM97091     1  0.3618    0.65506 0.768 0.000 0.000 0.000 0.192 0.040
#> GSM97148     1  0.3164    0.69425 0.824 0.032 0.000 0.004 0.000 0.140
#> GSM97063     1  0.3618    0.65506 0.768 0.000 0.000 0.000 0.192 0.040
#> GSM97053     1  0.2869    0.70111 0.832 0.000 0.000 0.000 0.148 0.020
#> GSM97066     3  0.3650    0.44126 0.000 0.024 0.756 0.000 0.004 0.216
#> GSM97079     4  0.3799    0.71102 0.000 0.276 0.000 0.704 0.000 0.020
#> GSM97083     5  0.0862    0.68804 0.008 0.000 0.000 0.016 0.972 0.004
#> GSM97084     4  0.1265    0.82673 0.000 0.044 0.000 0.948 0.000 0.008
#> GSM97094     4  0.1082    0.82853 0.000 0.040 0.000 0.956 0.004 0.000
#> GSM97096     3  0.3728    0.47243 0.000 0.060 0.784 0.000 0.004 0.152
#> GSM97097     4  0.0865    0.82622 0.000 0.036 0.000 0.964 0.000 0.000
#> GSM97107     4  0.1760    0.81027 0.004 0.020 0.000 0.936 0.028 0.012
#> GSM97054     4  0.3217    0.79323 0.000 0.044 0.000 0.852 0.068 0.036
#> GSM97062     4  0.3778    0.71541 0.000 0.272 0.000 0.708 0.000 0.020
#> GSM97069     3  0.2250    0.55294 0.000 0.020 0.888 0.000 0.000 0.092
#> GSM97070     3  0.3622    0.44586 0.000 0.024 0.760 0.000 0.004 0.212
#> GSM97073     3  0.4495    0.31444 0.000 0.044 0.664 0.000 0.008 0.284
#> GSM97076     6  0.6904    0.86097 0.136 0.088 0.244 0.000 0.016 0.516
#> GSM97077     2  0.2556    0.64348 0.016 0.904 0.028 0.020 0.004 0.028
#> GSM97095     2  0.7649    0.23509 0.236 0.416 0.000 0.228 0.036 0.084
#> GSM97102     3  0.3548    0.47914 0.000 0.048 0.796 0.000 0.004 0.152
#> GSM97109     3  0.6789   -0.25389 0.044 0.264 0.472 0.004 0.004 0.212
#> GSM97110     3  0.6789   -0.25389 0.044 0.264 0.472 0.004 0.004 0.212
#> GSM97074     5  0.6750    0.44248 0.076 0.020 0.116 0.004 0.556 0.228
#> GSM97085     5  0.5080    0.62204 0.016 0.008 0.116 0.004 0.704 0.152
#> GSM97059     2  0.4227    0.63073 0.104 0.788 0.000 0.036 0.008 0.064
#> GSM97072     3  0.3168    0.52847 0.000 0.016 0.792 0.000 0.000 0.192
#> GSM97078     5  0.0622    0.69649 0.012 0.000 0.000 0.000 0.980 0.008
#> GSM97067     3  0.3263    0.48519 0.000 0.020 0.800 0.000 0.004 0.176
#> GSM97087     3  0.3534    0.58435 0.000 0.016 0.740 0.000 0.000 0.244
#> GSM97111     2  0.6389    0.24765 0.040 0.560 0.132 0.000 0.020 0.248
#> GSM97064     2  0.3558    0.60344 0.008 0.832 0.088 0.020 0.000 0.052
#> GSM97065     6  0.7037    0.86589 0.100 0.148 0.248 0.000 0.012 0.492
#> GSM97081     2  0.6921   -0.07408 0.016 0.444 0.204 0.000 0.040 0.296
#> GSM97082     3  0.4496    0.55675 0.000 0.008 0.708 0.000 0.076 0.208
#> GSM97088     5  0.5045    0.62246 0.016 0.008 0.116 0.004 0.708 0.148
#> GSM97100     2  0.3088    0.65076 0.032 0.876 0.016 0.032 0.004 0.040
#> GSM97104     3  0.2917    0.60133 0.000 0.016 0.840 0.008 0.000 0.136
#> GSM97108     2  0.4050    0.63022 0.056 0.804 0.036 0.004 0.004 0.096
#> GSM97050     2  0.3060    0.62108 0.004 0.868 0.056 0.016 0.004 0.052
#> GSM97080     3  0.2398    0.57726 0.000 0.020 0.876 0.000 0.000 0.104
#> GSM97089     3  0.3534    0.58435 0.000 0.016 0.740 0.000 0.000 0.244
#> GSM97092     3  0.5414    0.51199 0.000 0.184 0.628 0.008 0.004 0.176
#> GSM97093     2  0.7288    0.47043 0.180 0.548 0.056 0.036 0.028 0.152
#> GSM97058     2  0.3402    0.61140 0.008 0.844 0.076 0.020 0.000 0.052
#> GSM97051     2  0.4246    0.56448 0.000 0.784 0.108 0.052 0.004 0.052
#> GSM97052     3  0.4803    0.56443 0.000 0.108 0.684 0.008 0.000 0.200
#> GSM97061     3  0.5986    0.38338 0.000 0.308 0.516 0.012 0.004 0.160

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-hclust-membership-heatmap-5

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)

plot of chunk tab-MAD-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-MAD-hclust-get-signatures-no-scale-1

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

plot of chunk tab-MAD-hclust-get-signatures-no-scale-2

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

plot of chunk tab-MAD-hclust-get-signatures-no-scale-3

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

plot of chunk tab-MAD-hclust-get-signatures-no-scale-4

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

plot of chunk tab-MAD-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-hclust-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-MAD-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-hclust-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:hclust 84         1.73e-06       1.000     2.80e-16   0.0431 2
#> MAD:hclust 24         1.75e-01       1.000     6.14e-06   0.7279 3
#> MAD:hclust 62         1.61e-04       0.472     1.18e-10   0.2285 4
#> MAD:hclust 73         7.71e-05       0.701     1.95e-15   0.0744 5
#> MAD:hclust 68         1.63e-03       0.645     4.50e-15   0.0769 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.


MAD:kmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "kmeans"]
# 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 21512 rows and 100 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)

plot of chunk MAD-kmeans-collect-plots

The plots are:

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:

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)

plot of chunk MAD-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.977       0.988         0.4919 0.508   0.508
#> 3 3 0.545           0.755       0.846         0.3360 0.725   0.509
#> 4 4 0.733           0.778       0.865         0.1317 0.836   0.560
#> 5 5 0.696           0.665       0.791         0.0609 0.960   0.843
#> 6 6 0.699           0.462       0.639         0.0390 0.941   0.755

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.986 1.000 0.000
#> GSM97145     1  0.0000      0.986 1.000 0.000
#> GSM97147     1  0.0672      0.981 0.992 0.008
#> GSM97125     1  0.0000      0.986 1.000 0.000
#> GSM97127     1  0.0000      0.986 1.000 0.000
#> GSM97130     1  0.0000      0.986 1.000 0.000
#> GSM97133     1  0.0000      0.986 1.000 0.000
#> GSM97134     1  0.0000      0.986 1.000 0.000
#> GSM97120     1  0.0000      0.986 1.000 0.000
#> GSM97126     1  0.0000      0.986 1.000 0.000
#> GSM97112     1  0.0000      0.986 1.000 0.000
#> GSM97115     1  0.0376      0.984 0.996 0.004
#> GSM97116     1  0.0000      0.986 1.000 0.000
#> GSM97117     2  0.0938      0.984 0.012 0.988
#> GSM97119     1  0.0000      0.986 1.000 0.000
#> GSM97122     1  0.0000      0.986 1.000 0.000
#> GSM97135     1  0.0000      0.986 1.000 0.000
#> GSM97136     2  0.0938      0.984 0.012 0.988
#> GSM97139     1  0.0000      0.986 1.000 0.000
#> GSM97146     1  0.0000      0.986 1.000 0.000
#> GSM97123     2  0.0000      0.989 0.000 1.000
#> GSM97129     2  0.0938      0.984 0.012 0.988
#> GSM97143     1  0.0000      0.986 1.000 0.000
#> GSM97113     2  0.0938      0.984 0.012 0.988
#> GSM97056     1  0.0000      0.986 1.000 0.000
#> GSM97124     1  0.0000      0.986 1.000 0.000
#> GSM97132     1  0.0000      0.986 1.000 0.000
#> GSM97144     1  0.0000      0.986 1.000 0.000
#> GSM97149     1  0.0000      0.986 1.000 0.000
#> GSM97068     2  0.7299      0.749 0.204 0.796
#> GSM97071     2  0.0000      0.989 0.000 1.000
#> GSM97086     2  0.0000      0.989 0.000 1.000
#> GSM97103     2  0.0000      0.989 0.000 1.000
#> GSM97057     2  0.0938      0.984 0.012 0.988
#> GSM97060     2  0.0000      0.989 0.000 1.000
#> GSM97075     2  0.0000      0.989 0.000 1.000
#> GSM97098     2  0.0000      0.989 0.000 1.000
#> GSM97099     2  0.0938      0.984 0.012 0.988
#> GSM97101     2  0.0938      0.984 0.012 0.988
#> GSM97105     2  0.0000      0.989 0.000 1.000
#> GSM97106     2  0.0000      0.989 0.000 1.000
#> GSM97121     2  0.0938      0.984 0.012 0.988
#> GSM97128     1  0.4161      0.916 0.916 0.084
#> GSM97131     2  0.0000      0.989 0.000 1.000
#> GSM97137     1  0.0000      0.986 1.000 0.000
#> GSM97118     1  0.0000      0.986 1.000 0.000
#> GSM97114     2  0.6623      0.798 0.172 0.828
#> GSM97142     1  0.0000      0.986 1.000 0.000
#> GSM97140     2  0.0938      0.984 0.012 0.988
#> GSM97141     2  0.0938      0.984 0.012 0.988
#> GSM97055     1  0.0000      0.986 1.000 0.000
#> GSM97090     1  0.0376      0.984 0.996 0.004
#> GSM97091     1  0.0000      0.986 1.000 0.000
#> GSM97148     1  0.0000      0.986 1.000 0.000
#> GSM97063     1  0.0000      0.986 1.000 0.000
#> GSM97053     1  0.0000      0.986 1.000 0.000
#> GSM97066     2  0.0000      0.989 0.000 1.000
#> GSM97079     2  0.0000      0.989 0.000 1.000
#> GSM97083     1  0.0000      0.986 1.000 0.000
#> GSM97084     2  0.0000      0.989 0.000 1.000
#> GSM97094     1  0.0938      0.978 0.988 0.012
#> GSM97096     2  0.0000      0.989 0.000 1.000
#> GSM97097     2  0.0000      0.989 0.000 1.000
#> GSM97107     1  0.1414      0.973 0.980 0.020
#> GSM97054     2  0.0000      0.989 0.000 1.000
#> GSM97062     2  0.0000      0.989 0.000 1.000
#> GSM97069     2  0.0000      0.989 0.000 1.000
#> GSM97070     2  0.0000      0.989 0.000 1.000
#> GSM97073     2  0.0000      0.989 0.000 1.000
#> GSM97076     1  0.1633      0.970 0.976 0.024
#> GSM97077     2  0.0000      0.989 0.000 1.000
#> GSM97095     1  0.5059      0.878 0.888 0.112
#> GSM97102     2  0.0000      0.989 0.000 1.000
#> GSM97109     2  0.0938      0.984 0.012 0.988
#> GSM97110     2  0.0938      0.984 0.012 0.988
#> GSM97074     1  0.1414      0.973 0.980 0.020
#> GSM97085     2  0.1414      0.974 0.020 0.980
#> GSM97059     1  0.7453      0.739 0.788 0.212
#> GSM97072     2  0.0000      0.989 0.000 1.000
#> GSM97078     1  0.4161      0.916 0.916 0.084
#> GSM97067     2  0.0000      0.989 0.000 1.000
#> GSM97087     2  0.0000      0.989 0.000 1.000
#> GSM97111     2  0.0938      0.984 0.012 0.988
#> GSM97064     2  0.0000      0.989 0.000 1.000
#> GSM97065     2  0.0000      0.989 0.000 1.000
#> GSM97081     2  0.0000      0.989 0.000 1.000
#> GSM97082     2  0.0000      0.989 0.000 1.000
#> GSM97088     2  0.2603      0.951 0.044 0.956
#> GSM97100     2  0.0000      0.989 0.000 1.000
#> GSM97104     2  0.0000      0.989 0.000 1.000
#> GSM97108     2  0.0938      0.984 0.012 0.988
#> GSM97050     2  0.0000      0.989 0.000 1.000
#> GSM97080     2  0.0000      0.989 0.000 1.000
#> GSM97089     2  0.0000      0.989 0.000 1.000
#> GSM97092     2  0.0000      0.989 0.000 1.000
#> GSM97093     2  0.0000      0.989 0.000 1.000
#> GSM97058     2  0.0000      0.989 0.000 1.000
#> GSM97051     2  0.0000      0.989 0.000 1.000
#> GSM97052     2  0.0000      0.989 0.000 1.000
#> GSM97061     2  0.0000      0.989 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97145     1  0.2959     0.8740 0.900 0.100 0.000
#> GSM97147     2  0.0237     0.7230 0.004 0.996 0.000
#> GSM97125     1  0.1529     0.8796 0.960 0.040 0.000
#> GSM97127     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97130     1  0.5785     0.7181 0.668 0.332 0.000
#> GSM97133     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97134     1  0.5397     0.6890 0.720 0.280 0.000
#> GSM97120     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97126     1  0.2796     0.8757 0.908 0.092 0.000
#> GSM97112     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97115     2  0.1289     0.7046 0.032 0.968 0.000
#> GSM97116     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97117     2  0.6104     0.6982 0.004 0.648 0.348
#> GSM97119     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97122     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97135     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97136     3  0.1832     0.8668 0.008 0.036 0.956
#> GSM97139     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97146     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97123     3  0.4796     0.5608 0.000 0.220 0.780
#> GSM97129     2  0.6102     0.7247 0.008 0.672 0.320
#> GSM97143     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97113     2  0.5722     0.7063 0.004 0.704 0.292
#> GSM97056     1  0.3116     0.8740 0.892 0.108 0.000
#> GSM97124     1  0.0424     0.8781 0.992 0.008 0.000
#> GSM97132     1  0.2356     0.8601 0.928 0.072 0.000
#> GSM97144     1  0.5327     0.6984 0.728 0.272 0.000
#> GSM97149     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97068     2  0.0000     0.7222 0.000 1.000 0.000
#> GSM97071     2  0.7159     0.1382 0.024 0.528 0.448
#> GSM97086     2  0.3192     0.7642 0.000 0.888 0.112
#> GSM97103     3  0.6192    -0.2191 0.000 0.420 0.580
#> GSM97057     2  0.3030     0.7595 0.004 0.904 0.092
#> GSM97060     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97075     2  0.6008     0.6798 0.000 0.628 0.372
#> GSM97098     3  0.3879     0.7058 0.000 0.152 0.848
#> GSM97099     2  0.6126     0.6961 0.004 0.644 0.352
#> GSM97101     2  0.6008     0.7141 0.004 0.664 0.332
#> GSM97105     2  0.5178     0.7680 0.000 0.744 0.256
#> GSM97106     3  0.1411     0.8688 0.000 0.036 0.964
#> GSM97121     2  0.4978     0.7798 0.004 0.780 0.216
#> GSM97128     1  0.9896     0.0876 0.376 0.264 0.360
#> GSM97131     2  0.5058     0.7721 0.000 0.756 0.244
#> GSM97137     1  0.4062     0.8577 0.836 0.164 0.000
#> GSM97118     1  0.2261     0.8569 0.932 0.068 0.000
#> GSM97114     2  0.6063     0.7161 0.084 0.784 0.132
#> GSM97142     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97140     2  0.3983     0.7828 0.004 0.852 0.144
#> GSM97141     2  0.6081     0.7004 0.004 0.652 0.344
#> GSM97055     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97090     2  0.4178     0.5306 0.172 0.828 0.000
#> GSM97091     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97148     1  0.3192     0.8715 0.888 0.112 0.000
#> GSM97063     1  0.0000     0.8773 1.000 0.000 0.000
#> GSM97053     1  0.0424     0.8781 0.992 0.008 0.000
#> GSM97066     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97079     2  0.3412     0.7610 0.000 0.876 0.124
#> GSM97083     1  0.5812     0.6876 0.724 0.264 0.012
#> GSM97084     2  0.3267     0.7591 0.000 0.884 0.116
#> GSM97094     2  0.5953     0.4564 0.280 0.708 0.012
#> GSM97096     3  0.0592     0.8904 0.000 0.012 0.988
#> GSM97097     2  0.4504     0.7693 0.000 0.804 0.196
#> GSM97107     2  0.5919     0.4650 0.276 0.712 0.012
#> GSM97054     2  0.3192     0.7642 0.000 0.888 0.112
#> GSM97062     2  0.3412     0.7610 0.000 0.876 0.124
#> GSM97069     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97070     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97073     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97076     1  0.7504     0.5426 0.628 0.312 0.060
#> GSM97077     2  0.4555     0.7802 0.000 0.800 0.200
#> GSM97095     2  0.1529     0.6995 0.040 0.960 0.000
#> GSM97102     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97109     2  0.5982     0.7088 0.004 0.668 0.328
#> GSM97110     2  0.6057     0.7048 0.004 0.656 0.340
#> GSM97074     3  0.8295     0.2333 0.364 0.088 0.548
#> GSM97085     3  0.3192     0.7784 0.112 0.000 0.888
#> GSM97059     2  0.0237     0.7230 0.004 0.996 0.000
#> GSM97072     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97078     1  0.9956     0.1466 0.376 0.328 0.296
#> GSM97067     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97087     3  0.0237     0.8958 0.000 0.004 0.996
#> GSM97111     2  0.6126     0.6961 0.004 0.644 0.352
#> GSM97064     2  0.6026     0.6760 0.000 0.624 0.376
#> GSM97065     2  0.6192     0.5957 0.000 0.580 0.420
#> GSM97081     3  0.0892     0.8853 0.000 0.020 0.980
#> GSM97082     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97088     3  0.7165     0.5905 0.112 0.172 0.716
#> GSM97100     2  0.2959     0.7668 0.000 0.900 0.100
#> GSM97104     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97108     2  0.4978     0.7802 0.004 0.780 0.216
#> GSM97050     2  0.5291     0.7635 0.000 0.732 0.268
#> GSM97080     3  0.0000     0.8968 0.000 0.000 1.000
#> GSM97089     3  0.0237     0.8958 0.000 0.004 0.996
#> GSM97092     3  0.0237     0.8958 0.000 0.004 0.996
#> GSM97093     2  0.5706     0.7291 0.000 0.680 0.320
#> GSM97058     2  0.5497     0.7517 0.000 0.708 0.292
#> GSM97051     2  0.4504     0.7789 0.000 0.804 0.196
#> GSM97052     3  0.0237     0.8958 0.000 0.004 0.996
#> GSM97061     3  0.2711     0.8097 0.000 0.088 0.912

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.1109     0.8659 0.968 0.028 0.000 0.004
#> GSM97145     1  0.1406     0.8675 0.960 0.024 0.000 0.016
#> GSM97147     2  0.1624     0.9053 0.020 0.952 0.000 0.028
#> GSM97125     1  0.1209     0.8678 0.964 0.004 0.000 0.032
#> GSM97127     1  0.0921     0.8643 0.972 0.028 0.000 0.000
#> GSM97130     4  0.4574     0.6264 0.220 0.024 0.000 0.756
#> GSM97133     1  0.1022     0.8635 0.968 0.032 0.000 0.000
#> GSM97134     4  0.2654     0.6583 0.108 0.004 0.000 0.888
#> GSM97120     1  0.1022     0.8633 0.968 0.032 0.000 0.000
#> GSM97126     2  0.7333     0.0628 0.332 0.496 0.000 0.172
#> GSM97112     1  0.3356     0.8489 0.824 0.000 0.000 0.176
#> GSM97115     4  0.4934     0.6720 0.028 0.252 0.000 0.720
#> GSM97116     1  0.0921     0.8647 0.972 0.028 0.000 0.000
#> GSM97117     2  0.1389     0.9249 0.000 0.952 0.048 0.000
#> GSM97119     1  0.3356     0.8489 0.824 0.000 0.000 0.176
#> GSM97122     1  0.3311     0.8508 0.828 0.000 0.000 0.172
#> GSM97135     1  0.3123     0.8556 0.844 0.000 0.000 0.156
#> GSM97136     3  0.6061     0.3451 0.000 0.400 0.552 0.048
#> GSM97139     1  0.0921     0.8647 0.972 0.028 0.000 0.000
#> GSM97146     1  0.1022     0.8635 0.968 0.032 0.000 0.000
#> GSM97123     3  0.4936     0.5915 0.000 0.316 0.672 0.012
#> GSM97129     2  0.1677     0.9259 0.000 0.948 0.040 0.012
#> GSM97143     1  0.3400     0.8467 0.820 0.000 0.000 0.180
#> GSM97113     2  0.1575     0.9232 0.012 0.956 0.028 0.004
#> GSM97056     1  0.4149     0.6891 0.804 0.028 0.000 0.168
#> GSM97124     1  0.3123     0.8556 0.844 0.000 0.000 0.156
#> GSM97132     4  0.5000    -0.2157 0.496 0.000 0.000 0.504
#> GSM97144     4  0.2859     0.6605 0.112 0.008 0.000 0.880
#> GSM97149     1  0.1118     0.8615 0.964 0.036 0.000 0.000
#> GSM97068     2  0.4464     0.6523 0.024 0.768 0.000 0.208
#> GSM97071     4  0.3320     0.7159 0.000 0.068 0.056 0.876
#> GSM97086     4  0.4746     0.6236 0.000 0.304 0.008 0.688
#> GSM97103     3  0.4820     0.6270 0.000 0.296 0.692 0.012
#> GSM97057     2  0.1733     0.9013 0.024 0.948 0.000 0.028
#> GSM97060     3  0.0927     0.8902 0.000 0.008 0.976 0.016
#> GSM97075     2  0.1389     0.9249 0.000 0.952 0.048 0.000
#> GSM97098     3  0.3972     0.7551 0.000 0.204 0.788 0.008
#> GSM97099     2  0.1389     0.9249 0.000 0.952 0.048 0.000
#> GSM97101     2  0.1489     0.9259 0.000 0.952 0.044 0.004
#> GSM97105     2  0.1929     0.9191 0.000 0.940 0.024 0.036
#> GSM97106     3  0.1388     0.8879 0.000 0.028 0.960 0.012
#> GSM97121     2  0.1042     0.9256 0.000 0.972 0.020 0.008
#> GSM97128     4  0.2317     0.6747 0.032 0.004 0.036 0.928
#> GSM97131     2  0.2313     0.9097 0.000 0.924 0.032 0.044
#> GSM97137     1  0.4934     0.5391 0.720 0.028 0.000 0.252
#> GSM97118     4  0.4967    -0.0970 0.452 0.000 0.000 0.548
#> GSM97114     2  0.1575     0.9093 0.028 0.956 0.004 0.012
#> GSM97142     1  0.3356     0.8489 0.824 0.000 0.000 0.176
#> GSM97140     2  0.1509     0.9217 0.008 0.960 0.012 0.020
#> GSM97141     2  0.1489     0.9259 0.000 0.952 0.044 0.004
#> GSM97055     1  0.3528     0.8387 0.808 0.000 0.000 0.192
#> GSM97090     4  0.5031     0.7007 0.048 0.212 0.000 0.740
#> GSM97091     1  0.3486     0.8419 0.812 0.000 0.000 0.188
#> GSM97148     1  0.1022     0.8635 0.968 0.032 0.000 0.000
#> GSM97063     1  0.3444     0.8447 0.816 0.000 0.000 0.184
#> GSM97053     1  0.2589     0.8629 0.884 0.000 0.000 0.116
#> GSM97066     3  0.1807     0.8838 0.000 0.008 0.940 0.052
#> GSM97079     4  0.4722     0.6288 0.000 0.300 0.008 0.692
#> GSM97083     4  0.2216     0.6615 0.092 0.000 0.000 0.908
#> GSM97084     4  0.4391     0.6773 0.000 0.252 0.008 0.740
#> GSM97094     4  0.3172     0.7280 0.012 0.112 0.004 0.872
#> GSM97096     3  0.1256     0.8879 0.000 0.028 0.964 0.008
#> GSM97097     4  0.6252     0.5895 0.000 0.288 0.088 0.624
#> GSM97107     4  0.3436     0.7286 0.016 0.112 0.008 0.864
#> GSM97054     4  0.4422     0.6753 0.000 0.256 0.008 0.736
#> GSM97062     4  0.4391     0.6773 0.000 0.252 0.008 0.740
#> GSM97069     3  0.1576     0.8838 0.000 0.004 0.948 0.048
#> GSM97070     3  0.1807     0.8838 0.000 0.008 0.940 0.052
#> GSM97073     3  0.1807     0.8838 0.000 0.008 0.940 0.052
#> GSM97076     4  0.8511     0.0160 0.316 0.288 0.024 0.372
#> GSM97077     2  0.2214     0.9210 0.000 0.928 0.028 0.044
#> GSM97095     4  0.5137     0.6282 0.024 0.296 0.000 0.680
#> GSM97102     3  0.0937     0.8918 0.000 0.012 0.976 0.012
#> GSM97109     2  0.1639     0.9261 0.008 0.952 0.036 0.004
#> GSM97110     2  0.1576     0.9255 0.000 0.948 0.048 0.004
#> GSM97074     4  0.5311     0.3573 0.024 0.000 0.328 0.648
#> GSM97085     3  0.3625     0.7709 0.012 0.000 0.828 0.160
#> GSM97059     2  0.2521     0.8777 0.024 0.912 0.000 0.064
#> GSM97072     3  0.1389     0.8841 0.000 0.000 0.952 0.048
#> GSM97078     4  0.1697     0.6834 0.028 0.004 0.016 0.952
#> GSM97067     3  0.1807     0.8838 0.000 0.008 0.940 0.052
#> GSM97087     3  0.1004     0.8921 0.000 0.024 0.972 0.004
#> GSM97111     2  0.1389     0.9249 0.000 0.952 0.048 0.000
#> GSM97064     2  0.2742     0.9039 0.000 0.900 0.076 0.024
#> GSM97065     2  0.3081     0.8787 0.000 0.888 0.064 0.048
#> GSM97081     3  0.3074     0.8122 0.000 0.152 0.848 0.000
#> GSM97082     3  0.0927     0.8924 0.000 0.016 0.976 0.008
#> GSM97088     4  0.5140     0.4474 0.020 0.004 0.284 0.692
#> GSM97100     2  0.1722     0.9068 0.000 0.944 0.008 0.048
#> GSM97104     3  0.0657     0.8907 0.000 0.004 0.984 0.012
#> GSM97108     2  0.1624     0.9203 0.000 0.952 0.020 0.028
#> GSM97050     2  0.2494     0.9204 0.000 0.916 0.048 0.036
#> GSM97080     3  0.1452     0.8878 0.000 0.008 0.956 0.036
#> GSM97089     3  0.1004     0.8921 0.000 0.024 0.972 0.004
#> GSM97092     3  0.1151     0.8917 0.000 0.024 0.968 0.008
#> GSM97093     2  0.2197     0.8976 0.000 0.916 0.080 0.004
#> GSM97058     2  0.2224     0.9225 0.000 0.928 0.040 0.032
#> GSM97051     2  0.2111     0.9118 0.000 0.932 0.024 0.044
#> GSM97052     3  0.1151     0.8917 0.000 0.024 0.968 0.008
#> GSM97061     3  0.3271     0.8287 0.000 0.132 0.856 0.012

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.2017     0.7590 0.912 0.008 0.000 0.000 0.080
#> GSM97145     1  0.1356     0.7612 0.956 0.028 0.000 0.012 0.004
#> GSM97147     2  0.1522     0.8383 0.000 0.944 0.000 0.044 0.012
#> GSM97125     1  0.1211     0.7640 0.960 0.000 0.000 0.016 0.024
#> GSM97127     1  0.2361     0.7553 0.892 0.012 0.000 0.000 0.096
#> GSM97130     4  0.5644     0.3833 0.144 0.000 0.000 0.628 0.228
#> GSM97133     1  0.2997     0.7428 0.840 0.012 0.000 0.000 0.148
#> GSM97134     4  0.5065    -0.1121 0.036 0.000 0.000 0.544 0.420
#> GSM97120     1  0.2997     0.7428 0.840 0.012 0.000 0.000 0.148
#> GSM97126     2  0.6319     0.3936 0.200 0.620 0.000 0.036 0.144
#> GSM97112     1  0.3445     0.7341 0.824 0.000 0.000 0.036 0.140
#> GSM97115     4  0.4832     0.6113 0.008 0.064 0.000 0.720 0.208
#> GSM97116     1  0.2886     0.7445 0.844 0.008 0.000 0.000 0.148
#> GSM97117     2  0.0451     0.8412 0.000 0.988 0.004 0.000 0.008
#> GSM97119     1  0.3445     0.7341 0.824 0.000 0.000 0.036 0.140
#> GSM97122     1  0.3445     0.7341 0.824 0.000 0.000 0.036 0.140
#> GSM97135     1  0.3355     0.7385 0.832 0.000 0.000 0.036 0.132
#> GSM97136     2  0.6803     0.3384 0.052 0.556 0.264 0.000 0.128
#> GSM97139     1  0.2886     0.7445 0.844 0.008 0.000 0.000 0.148
#> GSM97146     1  0.2886     0.7445 0.844 0.008 0.000 0.000 0.148
#> GSM97123     3  0.4528     0.6787 0.000 0.172 0.756 0.008 0.064
#> GSM97129     2  0.0865     0.8379 0.000 0.972 0.004 0.000 0.024
#> GSM97143     1  0.3919     0.6878 0.776 0.000 0.000 0.036 0.188
#> GSM97113     2  0.0162     0.8425 0.000 0.996 0.004 0.000 0.000
#> GSM97056     1  0.5531     0.4593 0.632 0.000 0.000 0.120 0.248
#> GSM97124     1  0.3355     0.7385 0.832 0.000 0.000 0.036 0.132
#> GSM97132     5  0.6515     0.3529 0.388 0.000 0.000 0.192 0.420
#> GSM97144     4  0.4301     0.4349 0.028 0.000 0.000 0.712 0.260
#> GSM97149     1  0.2997     0.7428 0.840 0.012 0.000 0.000 0.148
#> GSM97068     2  0.4860     0.6020 0.004 0.664 0.000 0.292 0.040
#> GSM97071     4  0.4017     0.5312 0.000 0.004 0.012 0.736 0.248
#> GSM97086     4  0.1981     0.6554 0.000 0.064 0.000 0.920 0.016
#> GSM97103     3  0.6199     0.4993 0.000 0.328 0.564 0.036 0.072
#> GSM97057     2  0.2984     0.8115 0.000 0.860 0.000 0.108 0.032
#> GSM97060     3  0.2037     0.8060 0.000 0.004 0.920 0.012 0.064
#> GSM97075     2  0.0798     0.8410 0.000 0.976 0.016 0.000 0.008
#> GSM97098     3  0.4961     0.5962 0.000 0.276 0.672 0.008 0.044
#> GSM97099     2  0.0566     0.8408 0.000 0.984 0.004 0.000 0.012
#> GSM97101     2  0.0162     0.8425 0.000 0.996 0.004 0.000 0.000
#> GSM97105     2  0.3425     0.8112 0.000 0.840 0.004 0.112 0.044
#> GSM97106     3  0.2760     0.7837 0.000 0.016 0.892 0.028 0.064
#> GSM97121     2  0.0510     0.8422 0.000 0.984 0.000 0.016 0.000
#> GSM97128     5  0.4726     0.3247 0.020 0.000 0.000 0.400 0.580
#> GSM97131     2  0.5765     0.6493 0.000 0.644 0.036 0.256 0.064
#> GSM97137     1  0.6233     0.1956 0.520 0.000 0.000 0.168 0.312
#> GSM97118     5  0.6442     0.4779 0.324 0.000 0.000 0.196 0.480
#> GSM97114     2  0.0613     0.8421 0.004 0.984 0.000 0.004 0.008
#> GSM97142     1  0.3445     0.7341 0.824 0.000 0.000 0.036 0.140
#> GSM97140     2  0.1408     0.8391 0.000 0.948 0.000 0.044 0.008
#> GSM97141     2  0.0162     0.8425 0.000 0.996 0.004 0.000 0.000
#> GSM97055     1  0.4451     0.6018 0.712 0.000 0.000 0.040 0.248
#> GSM97090     4  0.4832     0.6035 0.008 0.060 0.000 0.716 0.216
#> GSM97091     1  0.4193     0.6574 0.748 0.000 0.000 0.040 0.212
#> GSM97148     1  0.2886     0.7445 0.844 0.008 0.000 0.000 0.148
#> GSM97063     1  0.3691     0.7196 0.804 0.000 0.000 0.040 0.156
#> GSM97053     1  0.2616     0.7545 0.888 0.000 0.000 0.036 0.076
#> GSM97066     3  0.3661     0.7483 0.000 0.000 0.724 0.000 0.276
#> GSM97079     4  0.1571     0.6672 0.000 0.060 0.000 0.936 0.004
#> GSM97083     4  0.4829    -0.2709 0.020 0.000 0.000 0.500 0.480
#> GSM97084     4  0.1270     0.6721 0.000 0.052 0.000 0.948 0.000
#> GSM97094     4  0.2813     0.6495 0.000 0.024 0.000 0.868 0.108
#> GSM97096     3  0.3113     0.7751 0.000 0.080 0.868 0.008 0.044
#> GSM97097     4  0.3389     0.5893 0.000 0.048 0.052 0.864 0.036
#> GSM97107     4  0.2813     0.6495 0.000 0.024 0.000 0.868 0.108
#> GSM97054     4  0.2124     0.6690 0.000 0.056 0.000 0.916 0.028
#> GSM97062     4  0.1341     0.6708 0.000 0.056 0.000 0.944 0.000
#> GSM97069     3  0.3741     0.7536 0.000 0.000 0.732 0.004 0.264
#> GSM97070     3  0.3636     0.7504 0.000 0.000 0.728 0.000 0.272
#> GSM97073     3  0.3661     0.7483 0.000 0.000 0.724 0.000 0.276
#> GSM97076     2  0.6893     0.0478 0.108 0.432 0.024 0.012 0.424
#> GSM97077     2  0.3495     0.8035 0.000 0.836 0.008 0.120 0.036
#> GSM97095     4  0.6610     0.3246 0.004 0.288 0.000 0.488 0.220
#> GSM97102     3  0.2942     0.8025 0.000 0.008 0.856 0.008 0.128
#> GSM97109     2  0.0671     0.8404 0.000 0.980 0.004 0.000 0.016
#> GSM97110     2  0.0671     0.8404 0.000 0.980 0.004 0.000 0.016
#> GSM97074     5  0.5540     0.4344 0.100 0.000 0.084 0.092 0.724
#> GSM97085     3  0.4895     0.4674 0.008 0.000 0.528 0.012 0.452
#> GSM97059     2  0.3722     0.7697 0.004 0.796 0.000 0.176 0.024
#> GSM97072     3  0.3809     0.7610 0.000 0.000 0.736 0.008 0.256
#> GSM97078     5  0.4746     0.1106 0.016 0.000 0.000 0.480 0.504
#> GSM97067     3  0.3661     0.7483 0.000 0.000 0.724 0.000 0.276
#> GSM97087     3  0.1168     0.8011 0.000 0.008 0.960 0.000 0.032
#> GSM97111     2  0.0566     0.8408 0.000 0.984 0.004 0.000 0.012
#> GSM97064     2  0.5590     0.7406 0.000 0.712 0.124 0.112 0.052
#> GSM97065     2  0.3283     0.7567 0.000 0.832 0.028 0.000 0.140
#> GSM97081     3  0.3639     0.7210 0.000 0.184 0.792 0.000 0.024
#> GSM97082     3  0.1638     0.8062 0.000 0.004 0.932 0.000 0.064
#> GSM97088     5  0.6126     0.3761 0.008 0.000 0.128 0.300 0.564
#> GSM97100     2  0.3841     0.7650 0.000 0.780 0.000 0.188 0.032
#> GSM97104     3  0.2570     0.8005 0.000 0.004 0.880 0.008 0.108
#> GSM97108     2  0.1469     0.8395 0.000 0.948 0.000 0.036 0.016
#> GSM97050     2  0.5557     0.7404 0.000 0.712 0.104 0.136 0.048
#> GSM97080     3  0.3242     0.7730 0.000 0.000 0.784 0.000 0.216
#> GSM97089     3  0.1168     0.8011 0.000 0.008 0.960 0.000 0.032
#> GSM97092     3  0.1862     0.7913 0.000 0.016 0.932 0.004 0.048
#> GSM97093     2  0.3922     0.7524 0.000 0.796 0.164 0.012 0.028
#> GSM97058     2  0.3579     0.8052 0.000 0.836 0.016 0.116 0.032
#> GSM97051     2  0.6776     0.6008 0.000 0.576 0.120 0.240 0.064
#> GSM97052     3  0.1862     0.7913 0.000 0.016 0.932 0.004 0.048
#> GSM97061     3  0.3164     0.7676 0.000 0.040 0.872 0.020 0.068

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.1910   0.549897 0.892 0.000 0.000 0.000 0.108 0.000
#> GSM97145     1  0.4212   0.365896 0.560 0.016 0.000 0.000 0.424 0.000
#> GSM97147     2  0.3286   0.791489 0.000 0.844 0.000 0.044 0.084 0.028
#> GSM97125     1  0.3833   0.362153 0.556 0.000 0.000 0.000 0.444 0.000
#> GSM97127     1  0.2300   0.543294 0.856 0.000 0.000 0.000 0.144 0.000
#> GSM97130     4  0.7356   0.439345 0.152 0.000 0.000 0.408 0.228 0.212
#> GSM97133     1  0.0146   0.571019 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97134     5  0.6415  -0.375556 0.012 0.000 0.000 0.312 0.348 0.328
#> GSM97120     1  0.0363   0.573493 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM97126     2  0.5102   0.552320 0.028 0.680 0.000 0.000 0.184 0.108
#> GSM97112     1  0.3868   0.299464 0.504 0.000 0.000 0.000 0.496 0.000
#> GSM97115     4  0.6827   0.523214 0.020 0.032 0.000 0.476 0.236 0.236
#> GSM97116     1  0.0363   0.574262 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM97117     2  0.0810   0.800767 0.004 0.976 0.008 0.000 0.004 0.008
#> GSM97119     1  0.3868   0.299464 0.504 0.000 0.000 0.000 0.496 0.000
#> GSM97122     1  0.3868   0.306654 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM97135     1  0.3868   0.306654 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM97136     2  0.6239   0.302244 0.004 0.560 0.228 0.000 0.044 0.164
#> GSM97139     1  0.0363   0.574262 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM97146     1  0.0000   0.572253 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97123     3  0.3773   0.600189 0.000 0.136 0.804 0.016 0.032 0.012
#> GSM97129     2  0.1498   0.797068 0.004 0.948 0.012 0.000 0.012 0.024
#> GSM97143     5  0.4587  -0.281035 0.456 0.000 0.000 0.000 0.508 0.036
#> GSM97113     2  0.0436   0.803398 0.004 0.988 0.004 0.000 0.004 0.000
#> GSM97056     1  0.4481   0.253073 0.736 0.000 0.000 0.056 0.176 0.032
#> GSM97124     1  0.3868   0.304807 0.504 0.000 0.000 0.000 0.496 0.000
#> GSM97132     5  0.6588   0.136437 0.124 0.000 0.000 0.080 0.472 0.324
#> GSM97144     4  0.6177   0.488835 0.016 0.000 0.000 0.488 0.264 0.232
#> GSM97149     1  0.0000   0.572253 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97068     2  0.5836   0.620889 0.016 0.620 0.000 0.220 0.116 0.028
#> GSM97071     4  0.4755   0.586618 0.000 0.000 0.004 0.664 0.088 0.244
#> GSM97086     4  0.1448   0.656821 0.000 0.016 0.000 0.948 0.024 0.012
#> GSM97103     3  0.7500   0.396770 0.000 0.300 0.448 0.072 0.092 0.088
#> GSM97057     2  0.4393   0.774740 0.016 0.792 0.008 0.084 0.072 0.028
#> GSM97060     3  0.3142   0.671864 0.000 0.000 0.840 0.008 0.044 0.108
#> GSM97075     2  0.0881   0.805066 0.000 0.972 0.008 0.000 0.008 0.012
#> GSM97098     3  0.6475   0.469024 0.000 0.284 0.536 0.012 0.092 0.076
#> GSM97099     2  0.1377   0.793891 0.004 0.952 0.004 0.000 0.016 0.024
#> GSM97101     2  0.0653   0.805516 0.004 0.980 0.004 0.000 0.012 0.000
#> GSM97105     2  0.4272   0.775150 0.000 0.788 0.012 0.096 0.072 0.032
#> GSM97106     3  0.3467   0.668023 0.000 0.012 0.836 0.048 0.092 0.012
#> GSM97121     2  0.1434   0.805947 0.000 0.948 0.000 0.012 0.028 0.012
#> GSM97128     6  0.6018  -0.053215 0.000 0.000 0.008 0.192 0.336 0.464
#> GSM97131     2  0.6713   0.551279 0.000 0.528 0.076 0.284 0.080 0.032
#> GSM97137     1  0.5151   0.150391 0.668 0.000 0.000 0.068 0.220 0.044
#> GSM97118     5  0.5924   0.032592 0.048 0.000 0.000 0.076 0.476 0.400
#> GSM97114     2  0.0551   0.802626 0.004 0.984 0.000 0.000 0.004 0.008
#> GSM97142     1  0.3868   0.299464 0.504 0.000 0.000 0.000 0.496 0.000
#> GSM97140     2  0.2803   0.797396 0.000 0.876 0.000 0.032 0.064 0.028
#> GSM97141     2  0.0436   0.803398 0.004 0.988 0.004 0.000 0.004 0.000
#> GSM97055     5  0.5510  -0.000949 0.340 0.000 0.000 0.000 0.516 0.144
#> GSM97090     4  0.6827   0.522415 0.020 0.032 0.000 0.476 0.236 0.236
#> GSM97091     5  0.4468  -0.196827 0.408 0.000 0.000 0.000 0.560 0.032
#> GSM97148     1  0.0000   0.572253 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.4067  -0.277092 0.444 0.000 0.000 0.000 0.548 0.008
#> GSM97053     1  0.3867   0.312662 0.512 0.000 0.000 0.000 0.488 0.000
#> GSM97066     6  0.3867  -0.263564 0.000 0.000 0.488 0.000 0.000 0.512
#> GSM97079     4  0.0520   0.678203 0.000 0.008 0.000 0.984 0.000 0.008
#> GSM97083     6  0.6130  -0.151259 0.004 0.000 0.000 0.240 0.352 0.404
#> GSM97084     4  0.0551   0.680267 0.000 0.008 0.004 0.984 0.000 0.004
#> GSM97094     4  0.3418   0.674147 0.000 0.004 0.000 0.820 0.084 0.092
#> GSM97096     3  0.5263   0.638948 0.000 0.104 0.716 0.012 0.092 0.076
#> GSM97097     4  0.2973   0.593100 0.000 0.004 0.032 0.864 0.084 0.016
#> GSM97107     4  0.3658   0.671615 0.000 0.004 0.004 0.808 0.092 0.092
#> GSM97054     4  0.2460   0.661252 0.000 0.016 0.004 0.896 0.064 0.020
#> GSM97062     4  0.0520   0.680810 0.000 0.008 0.000 0.984 0.000 0.008
#> GSM97069     3  0.3866   0.206563 0.000 0.000 0.516 0.000 0.000 0.484
#> GSM97070     6  0.3869  -0.282764 0.000 0.000 0.500 0.000 0.000 0.500
#> GSM97073     6  0.3864  -0.264336 0.000 0.000 0.480 0.000 0.000 0.520
#> GSM97076     6  0.4607   0.082445 0.000 0.356 0.012 0.000 0.028 0.604
#> GSM97077     2  0.4788   0.760443 0.000 0.756 0.028 0.108 0.076 0.032
#> GSM97095     4  0.7939   0.336610 0.016 0.160 0.000 0.300 0.264 0.260
#> GSM97102     3  0.4891   0.608747 0.000 0.004 0.664 0.004 0.092 0.236
#> GSM97109     2  0.1924   0.785441 0.004 0.928 0.004 0.004 0.024 0.036
#> GSM97110     2  0.1924   0.785441 0.004 0.928 0.004 0.004 0.024 0.036
#> GSM97074     6  0.3811   0.250731 0.004 0.000 0.028 0.024 0.152 0.792
#> GSM97085     6  0.5121   0.113746 0.000 0.000 0.272 0.000 0.124 0.604
#> GSM97059     2  0.5378   0.720800 0.016 0.704 0.008 0.136 0.108 0.028
#> GSM97072     3  0.4468   0.223301 0.000 0.000 0.492 0.004 0.020 0.484
#> GSM97078     6  0.5932  -0.103640 0.000 0.000 0.000 0.224 0.336 0.440
#> GSM97067     6  0.3866  -0.265688 0.000 0.000 0.484 0.000 0.000 0.516
#> GSM97087     3  0.1657   0.691647 0.000 0.016 0.928 0.000 0.000 0.056
#> GSM97111     2  0.1096   0.797180 0.004 0.964 0.004 0.000 0.008 0.020
#> GSM97064     2  0.6644   0.615613 0.000 0.560 0.240 0.100 0.068 0.032
#> GSM97065     2  0.3670   0.575326 0.000 0.704 0.012 0.000 0.000 0.284
#> GSM97081     3  0.4051   0.635035 0.000 0.164 0.756 0.000 0.004 0.076
#> GSM97082     3  0.2178   0.664381 0.000 0.000 0.868 0.000 0.000 0.132
#> GSM97088     6  0.6433  -0.017422 0.000 0.000 0.044 0.172 0.300 0.484
#> GSM97100     2  0.5055   0.719231 0.000 0.700 0.008 0.184 0.076 0.032
#> GSM97104     3  0.4121   0.610340 0.000 0.000 0.732 0.004 0.056 0.208
#> GSM97108     2  0.2589   0.799373 0.000 0.888 0.000 0.024 0.060 0.028
#> GSM97050     2  0.6683   0.629308 0.000 0.572 0.176 0.160 0.060 0.032
#> GSM97080     3  0.3727   0.379624 0.000 0.000 0.612 0.000 0.000 0.388
#> GSM97089     3  0.1700   0.692863 0.000 0.024 0.928 0.000 0.000 0.048
#> GSM97092     3  0.1109   0.692315 0.000 0.016 0.964 0.004 0.012 0.004
#> GSM97093     2  0.4823   0.572540 0.000 0.648 0.296 0.016 0.020 0.020
#> GSM97058     2  0.4788   0.759311 0.000 0.756 0.028 0.108 0.076 0.032
#> GSM97051     2  0.7584   0.432181 0.000 0.412 0.216 0.260 0.080 0.032
#> GSM97052     3  0.1109   0.692315 0.000 0.016 0.964 0.004 0.012 0.004
#> GSM97061     3  0.2145   0.674666 0.000 0.020 0.920 0.032 0.016 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)

plot of chunk tab-MAD-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-kmeans-membership-heatmap-5

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)

plot of chunk tab-MAD-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-1

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

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-2

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

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-3

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

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-4

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

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-kmeans-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-MAD-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-kmeans-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:kmeans 100         0.000277       0.298     2.66e-13   0.0975 2
#> MAD:kmeans  93         0.000141       0.249     1.94e-12   0.2283 3
#> MAD:kmeans  93         0.000266       0.331     7.45e-16   0.1535 4
#> MAD:kmeans  82         0.000097       0.187     1.56e-15   0.0497 5
#> MAD:kmeans  61         0.002758       0.310     5.40e-10   0.2320 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.


MAD:skmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "skmeans"]
# 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 21512 rows and 100 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 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)

plot of chunk MAD-skmeans-collect-plots

The plots are:

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:

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)

plot of chunk MAD-skmeans-select-partition-number

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.953       0.982         0.4995 0.500   0.500
#> 3 3 0.820           0.849       0.931         0.3415 0.753   0.541
#> 4 4 0.719           0.793       0.887         0.1215 0.829   0.544
#> 5 5 0.616           0.547       0.719         0.0615 0.976   0.904
#> 6 6 0.614           0.429       0.637         0.0393 0.951   0.789

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.974 1.000 0.000
#> GSM97145     1  0.0000      0.974 1.000 0.000
#> GSM97147     1  0.0000      0.974 1.000 0.000
#> GSM97125     1  0.0000      0.974 1.000 0.000
#> GSM97127     1  0.0000      0.974 1.000 0.000
#> GSM97130     1  0.0000      0.974 1.000 0.000
#> GSM97133     1  0.0000      0.974 1.000 0.000
#> GSM97134     1  0.0000      0.974 1.000 0.000
#> GSM97120     1  0.0000      0.974 1.000 0.000
#> GSM97126     1  0.0000      0.974 1.000 0.000
#> GSM97112     1  0.0000      0.974 1.000 0.000
#> GSM97115     1  0.0000      0.974 1.000 0.000
#> GSM97116     1  0.0000      0.974 1.000 0.000
#> GSM97117     2  0.0000      0.986 0.000 1.000
#> GSM97119     1  0.0000      0.974 1.000 0.000
#> GSM97122     1  0.0000      0.974 1.000 0.000
#> GSM97135     1  0.0000      0.974 1.000 0.000
#> GSM97136     2  0.4690      0.885 0.100 0.900
#> GSM97139     1  0.0000      0.974 1.000 0.000
#> GSM97146     1  0.0000      0.974 1.000 0.000
#> GSM97123     2  0.0000      0.986 0.000 1.000
#> GSM97129     2  0.6343      0.805 0.160 0.840
#> GSM97143     1  0.0000      0.974 1.000 0.000
#> GSM97113     2  0.0376      0.983 0.004 0.996
#> GSM97056     1  0.0000      0.974 1.000 0.000
#> GSM97124     1  0.0000      0.974 1.000 0.000
#> GSM97132     1  0.0000      0.974 1.000 0.000
#> GSM97144     1  0.0000      0.974 1.000 0.000
#> GSM97149     1  0.0000      0.974 1.000 0.000
#> GSM97068     1  0.8386      0.631 0.732 0.268
#> GSM97071     2  0.2603      0.946 0.044 0.956
#> GSM97086     2  0.0000      0.986 0.000 1.000
#> GSM97103     2  0.0000      0.986 0.000 1.000
#> GSM97057     2  0.0938      0.977 0.012 0.988
#> GSM97060     2  0.0000      0.986 0.000 1.000
#> GSM97075     2  0.0000      0.986 0.000 1.000
#> GSM97098     2  0.0000      0.986 0.000 1.000
#> GSM97099     2  0.0000      0.986 0.000 1.000
#> GSM97101     2  0.0000      0.986 0.000 1.000
#> GSM97105     2  0.0000      0.986 0.000 1.000
#> GSM97106     2  0.0000      0.986 0.000 1.000
#> GSM97121     2  0.0000      0.986 0.000 1.000
#> GSM97128     1  0.0000      0.974 1.000 0.000
#> GSM97131     2  0.0000      0.986 0.000 1.000
#> GSM97137     1  0.0000      0.974 1.000 0.000
#> GSM97118     1  0.0000      0.974 1.000 0.000
#> GSM97114     1  0.9944      0.166 0.544 0.456
#> GSM97142     1  0.0000      0.974 1.000 0.000
#> GSM97140     2  0.0376      0.983 0.004 0.996
#> GSM97141     2  0.0000      0.986 0.000 1.000
#> GSM97055     1  0.0000      0.974 1.000 0.000
#> GSM97090     1  0.0000      0.974 1.000 0.000
#> GSM97091     1  0.0000      0.974 1.000 0.000
#> GSM97148     1  0.0000      0.974 1.000 0.000
#> GSM97063     1  0.0000      0.974 1.000 0.000
#> GSM97053     1  0.0000      0.974 1.000 0.000
#> GSM97066     2  0.0000      0.986 0.000 1.000
#> GSM97079     2  0.0000      0.986 0.000 1.000
#> GSM97083     1  0.0000      0.974 1.000 0.000
#> GSM97084     2  0.0938      0.977 0.012 0.988
#> GSM97094     1  0.0000      0.974 1.000 0.000
#> GSM97096     2  0.0000      0.986 0.000 1.000
#> GSM97097     2  0.0000      0.986 0.000 1.000
#> GSM97107     1  0.0000      0.974 1.000 0.000
#> GSM97054     2  0.0000      0.986 0.000 1.000
#> GSM97062     2  0.0000      0.986 0.000 1.000
#> GSM97069     2  0.0000      0.986 0.000 1.000
#> GSM97070     2  0.0000      0.986 0.000 1.000
#> GSM97073     2  0.0000      0.986 0.000 1.000
#> GSM97076     1  0.0000      0.974 1.000 0.000
#> GSM97077     2  0.0000      0.986 0.000 1.000
#> GSM97095     1  0.0000      0.974 1.000 0.000
#> GSM97102     2  0.0000      0.986 0.000 1.000
#> GSM97109     2  0.0376      0.983 0.004 0.996
#> GSM97110     2  0.0000      0.986 0.000 1.000
#> GSM97074     1  0.0000      0.974 1.000 0.000
#> GSM97085     2  0.9491      0.403 0.368 0.632
#> GSM97059     1  0.0376      0.970 0.996 0.004
#> GSM97072     2  0.0000      0.986 0.000 1.000
#> GSM97078     1  0.0000      0.974 1.000 0.000
#> GSM97067     2  0.0000      0.986 0.000 1.000
#> GSM97087     2  0.0000      0.986 0.000 1.000
#> GSM97111     2  0.0000      0.986 0.000 1.000
#> GSM97064     2  0.0000      0.986 0.000 1.000
#> GSM97065     2  0.0000      0.986 0.000 1.000
#> GSM97081     2  0.0000      0.986 0.000 1.000
#> GSM97082     2  0.0000      0.986 0.000 1.000
#> GSM97088     1  0.9686      0.343 0.604 0.396
#> GSM97100     2  0.0000      0.986 0.000 1.000
#> GSM97104     2  0.0000      0.986 0.000 1.000
#> GSM97108     2  0.0000      0.986 0.000 1.000
#> GSM97050     2  0.0000      0.986 0.000 1.000
#> GSM97080     2  0.0000      0.986 0.000 1.000
#> GSM97089     2  0.0000      0.986 0.000 1.000
#> GSM97092     2  0.0000      0.986 0.000 1.000
#> GSM97093     2  0.0376      0.983 0.004 0.996
#> GSM97058     2  0.0000      0.986 0.000 1.000
#> GSM97051     2  0.0000      0.986 0.000 1.000
#> GSM97052     2  0.0000      0.986 0.000 1.000
#> GSM97061     2  0.0000      0.986 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97145     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97147     2  0.1529     0.9099 0.040 0.960 0.000
#> GSM97125     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97127     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97130     1  0.1031     0.9374 0.976 0.024 0.000
#> GSM97133     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97134     1  0.1031     0.9369 0.976 0.024 0.000
#> GSM97120     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97126     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97112     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97115     1  0.6286     0.2064 0.536 0.464 0.000
#> GSM97116     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97117     3  0.6295     0.0797 0.000 0.472 0.528
#> GSM97119     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97122     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97135     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97136     3  0.0892     0.8839 0.020 0.000 0.980
#> GSM97139     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97146     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97123     3  0.4291     0.7414 0.000 0.180 0.820
#> GSM97129     3  0.9171     0.1612 0.152 0.372 0.476
#> GSM97143     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97113     2  0.1643     0.9235 0.000 0.956 0.044
#> GSM97056     1  0.0237     0.9469 0.996 0.004 0.000
#> GSM97124     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97132     1  0.0237     0.9470 0.996 0.004 0.000
#> GSM97144     1  0.1411     0.9296 0.964 0.036 0.000
#> GSM97149     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97068     2  0.0000     0.9252 0.000 1.000 0.000
#> GSM97071     3  0.2959     0.8320 0.000 0.100 0.900
#> GSM97086     2  0.0747     0.9266 0.000 0.984 0.016
#> GSM97103     3  0.2537     0.8469 0.000 0.080 0.920
#> GSM97057     2  0.0424     0.9280 0.000 0.992 0.008
#> GSM97060     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97075     3  0.5678     0.5246 0.000 0.316 0.684
#> GSM97098     3  0.1753     0.8697 0.000 0.048 0.952
#> GSM97099     2  0.5138     0.6956 0.000 0.748 0.252
#> GSM97101     2  0.1289     0.9272 0.000 0.968 0.032
#> GSM97105     2  0.0592     0.9287 0.000 0.988 0.012
#> GSM97106     3  0.0592     0.8911 0.000 0.012 0.988
#> GSM97121     2  0.0592     0.9287 0.000 0.988 0.012
#> GSM97128     3  0.7353     0.1596 0.436 0.032 0.532
#> GSM97131     2  0.1860     0.9249 0.000 0.948 0.052
#> GSM97137     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97118     1  0.0237     0.9470 0.996 0.004 0.000
#> GSM97114     2  0.1753     0.9077 0.048 0.952 0.000
#> GSM97142     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97140     2  0.0237     0.9268 0.000 0.996 0.004
#> GSM97141     2  0.1643     0.9235 0.000 0.956 0.044
#> GSM97055     1  0.0424     0.9438 0.992 0.000 0.008
#> GSM97090     1  0.4178     0.8004 0.828 0.172 0.000
#> GSM97091     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97148     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97063     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97053     1  0.0000     0.9485 1.000 0.000 0.000
#> GSM97066     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97079     2  0.1964     0.9146 0.000 0.944 0.056
#> GSM97083     1  0.1289     0.9319 0.968 0.032 0.000
#> GSM97084     2  0.1289     0.9236 0.000 0.968 0.032
#> GSM97094     1  0.2711     0.8913 0.912 0.088 0.000
#> GSM97096     3  0.0237     0.8941 0.000 0.004 0.996
#> GSM97097     2  0.4452     0.7729 0.000 0.808 0.192
#> GSM97107     1  0.3532     0.8671 0.884 0.108 0.008
#> GSM97054     2  0.0424     0.9266 0.000 0.992 0.008
#> GSM97062     2  0.1964     0.9135 0.000 0.944 0.056
#> GSM97069     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97070     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97073     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97076     1  0.1860     0.9070 0.948 0.000 0.052
#> GSM97077     2  0.1163     0.9304 0.000 0.972 0.028
#> GSM97095     1  0.6192     0.3447 0.580 0.420 0.000
#> GSM97102     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97109     2  0.2550     0.9144 0.012 0.932 0.056
#> GSM97110     2  0.2959     0.8881 0.000 0.900 0.100
#> GSM97074     3  0.6104     0.4512 0.348 0.004 0.648
#> GSM97085     3  0.0237     0.8934 0.000 0.004 0.996
#> GSM97059     2  0.0000     0.9252 0.000 1.000 0.000
#> GSM97072     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97078     1  0.7411     0.2078 0.548 0.036 0.416
#> GSM97067     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97087     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97111     2  0.4121     0.8182 0.000 0.832 0.168
#> GSM97064     2  0.4235     0.8150 0.000 0.824 0.176
#> GSM97065     3  0.5138     0.6414 0.000 0.252 0.748
#> GSM97081     3  0.0237     0.8938 0.000 0.004 0.996
#> GSM97082     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97088     3  0.0892     0.8851 0.000 0.020 0.980
#> GSM97100     2  0.0237     0.9268 0.000 0.996 0.004
#> GSM97104     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97108     2  0.0592     0.9287 0.000 0.988 0.012
#> GSM97050     2  0.2537     0.9122 0.000 0.920 0.080
#> GSM97080     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97089     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97092     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97093     2  0.6140     0.3474 0.000 0.596 0.404
#> GSM97058     2  0.1411     0.9288 0.000 0.964 0.036
#> GSM97051     2  0.2356     0.9144 0.000 0.928 0.072
#> GSM97052     3  0.0000     0.8955 0.000 0.000 1.000
#> GSM97061     3  0.2959     0.8289 0.000 0.100 0.900

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.0779      0.952 0.980 0.016 0.000 0.004
#> GSM97145     1  0.0895      0.950 0.976 0.020 0.000 0.004
#> GSM97147     2  0.4638      0.729 0.060 0.788 0.000 0.152
#> GSM97125     1  0.0376      0.953 0.992 0.004 0.000 0.004
#> GSM97127     1  0.0779      0.952 0.980 0.016 0.000 0.004
#> GSM97130     4  0.4761      0.526 0.332 0.004 0.000 0.664
#> GSM97133     1  0.0779      0.952 0.980 0.016 0.000 0.004
#> GSM97134     4  0.4040      0.697 0.248 0.000 0.000 0.752
#> GSM97120     1  0.0895      0.950 0.976 0.020 0.000 0.004
#> GSM97126     1  0.0921      0.939 0.972 0.028 0.000 0.000
#> GSM97112     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97115     4  0.1610      0.846 0.032 0.016 0.000 0.952
#> GSM97116     1  0.0779      0.952 0.980 0.016 0.000 0.004
#> GSM97117     2  0.1824      0.807 0.004 0.936 0.060 0.000
#> GSM97119     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97122     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97135     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97136     3  0.4359      0.770 0.084 0.100 0.816 0.000
#> GSM97139     1  0.0779      0.952 0.980 0.016 0.000 0.004
#> GSM97146     1  0.0779      0.952 0.980 0.016 0.000 0.004
#> GSM97123     3  0.4675      0.651 0.000 0.244 0.736 0.020
#> GSM97129     2  0.8125      0.451 0.144 0.544 0.252 0.060
#> GSM97143     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97113     2  0.0779      0.811 0.004 0.980 0.000 0.016
#> GSM97056     1  0.4228      0.689 0.760 0.008 0.000 0.232
#> GSM97124     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97132     1  0.2589      0.859 0.884 0.000 0.000 0.116
#> GSM97144     4  0.2921      0.801 0.140 0.000 0.000 0.860
#> GSM97149     1  0.0779      0.952 0.980 0.016 0.000 0.004
#> GSM97068     4  0.4877      0.148 0.000 0.408 0.000 0.592
#> GSM97071     4  0.2983      0.807 0.008 0.004 0.108 0.880
#> GSM97086     4  0.2011      0.798 0.000 0.080 0.000 0.920
#> GSM97103     3  0.4719      0.726 0.000 0.180 0.772 0.048
#> GSM97057     2  0.1716      0.806 0.000 0.936 0.000 0.064
#> GSM97060     3  0.0188      0.884 0.000 0.004 0.996 0.000
#> GSM97075     2  0.4072      0.672 0.000 0.748 0.252 0.000
#> GSM97098     3  0.3893      0.738 0.000 0.196 0.796 0.008
#> GSM97099     2  0.2281      0.795 0.000 0.904 0.096 0.000
#> GSM97101     2  0.0336      0.811 0.000 0.992 0.000 0.008
#> GSM97105     2  0.2011      0.802 0.000 0.920 0.000 0.080
#> GSM97106     3  0.2197      0.863 0.000 0.048 0.928 0.024
#> GSM97121     2  0.0921      0.811 0.000 0.972 0.000 0.028
#> GSM97128     4  0.6074      0.634 0.104 0.000 0.228 0.668
#> GSM97131     2  0.6531      0.640 0.000 0.636 0.160 0.204
#> GSM97137     1  0.4284      0.708 0.764 0.012 0.000 0.224
#> GSM97118     1  0.2589      0.857 0.884 0.000 0.000 0.116
#> GSM97114     2  0.1109      0.804 0.028 0.968 0.000 0.004
#> GSM97142     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97140     2  0.1557      0.808 0.000 0.944 0.000 0.056
#> GSM97141     2  0.0376      0.809 0.004 0.992 0.004 0.000
#> GSM97055     1  0.0376      0.952 0.992 0.000 0.004 0.004
#> GSM97090     4  0.1118      0.846 0.036 0.000 0.000 0.964
#> GSM97091     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97148     1  0.0779      0.952 0.980 0.016 0.000 0.004
#> GSM97063     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97053     1  0.0188      0.954 0.996 0.000 0.000 0.004
#> GSM97066     3  0.0000      0.885 0.000 0.000 1.000 0.000
#> GSM97079     4  0.1109      0.834 0.000 0.028 0.004 0.968
#> GSM97083     4  0.3052      0.806 0.136 0.000 0.004 0.860
#> GSM97084     4  0.0469      0.838 0.000 0.012 0.000 0.988
#> GSM97094     4  0.1022      0.846 0.032 0.000 0.000 0.968
#> GSM97096     3  0.1661      0.869 0.000 0.052 0.944 0.004
#> GSM97097     4  0.4257      0.721 0.000 0.048 0.140 0.812
#> GSM97107     4  0.0921      0.846 0.028 0.000 0.000 0.972
#> GSM97054     4  0.1022      0.833 0.000 0.032 0.000 0.968
#> GSM97062     4  0.0336      0.839 0.000 0.008 0.000 0.992
#> GSM97069     3  0.0000      0.885 0.000 0.000 1.000 0.000
#> GSM97070     3  0.0000      0.885 0.000 0.000 1.000 0.000
#> GSM97073     3  0.0000      0.885 0.000 0.000 1.000 0.000
#> GSM97076     1  0.5173      0.783 0.800 0.068 0.080 0.052
#> GSM97077     2  0.5988      0.672 0.000 0.676 0.100 0.224
#> GSM97095     4  0.3617      0.803 0.064 0.076 0.000 0.860
#> GSM97102     3  0.0336      0.884 0.000 0.008 0.992 0.000
#> GSM97109     2  0.1697      0.808 0.016 0.952 0.028 0.004
#> GSM97110     2  0.1732      0.809 0.004 0.948 0.040 0.008
#> GSM97074     3  0.7469      0.187 0.312 0.000 0.488 0.200
#> GSM97085     3  0.0672      0.879 0.008 0.000 0.984 0.008
#> GSM97059     2  0.4679      0.516 0.000 0.648 0.000 0.352
#> GSM97072     3  0.0000      0.885 0.000 0.000 1.000 0.000
#> GSM97078     4  0.3325      0.802 0.024 0.000 0.112 0.864
#> GSM97067     3  0.0000      0.885 0.000 0.000 1.000 0.000
#> GSM97087     3  0.0336      0.884 0.000 0.008 0.992 0.000
#> GSM97111     2  0.1296      0.812 0.004 0.964 0.028 0.004
#> GSM97064     2  0.6111      0.354 0.000 0.556 0.392 0.052
#> GSM97065     2  0.4741      0.546 0.004 0.668 0.328 0.000
#> GSM97081     3  0.2469      0.828 0.000 0.108 0.892 0.000
#> GSM97082     3  0.0000      0.885 0.000 0.000 1.000 0.000
#> GSM97088     3  0.5376      0.259 0.016 0.000 0.588 0.396
#> GSM97100     2  0.3942      0.696 0.000 0.764 0.000 0.236
#> GSM97104     3  0.0188      0.885 0.000 0.004 0.996 0.000
#> GSM97108     2  0.1302      0.810 0.000 0.956 0.000 0.044
#> GSM97050     2  0.7211      0.540 0.000 0.548 0.248 0.204
#> GSM97080     3  0.0000      0.885 0.000 0.000 1.000 0.000
#> GSM97089     3  0.0336      0.884 0.000 0.008 0.992 0.000
#> GSM97092     3  0.1305      0.875 0.000 0.036 0.960 0.004
#> GSM97093     3  0.6808      0.223 0.004 0.368 0.536 0.092
#> GSM97058     2  0.4171      0.785 0.000 0.828 0.084 0.088
#> GSM97051     2  0.7875      0.278 0.000 0.384 0.288 0.328
#> GSM97052     3  0.1576      0.870 0.000 0.048 0.948 0.004
#> GSM97061     3  0.3278      0.810 0.000 0.116 0.864 0.020

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.3143    0.79222 0.796 0.000 0.000 0.000 0.204
#> GSM97145     1  0.2929    0.80206 0.856 0.012 0.000 0.004 0.128
#> GSM97147     2  0.6421    0.37402 0.060 0.608 0.000 0.092 0.240
#> GSM97125     1  0.1851    0.80636 0.912 0.000 0.000 0.000 0.088
#> GSM97127     1  0.3123    0.79388 0.812 0.000 0.000 0.004 0.184
#> GSM97130     4  0.5510    0.49389 0.184 0.000 0.000 0.652 0.164
#> GSM97133     1  0.3689    0.77428 0.740 0.000 0.000 0.004 0.256
#> GSM97134     4  0.4960    0.53657 0.268 0.000 0.000 0.668 0.064
#> GSM97120     1  0.3579    0.78036 0.756 0.000 0.000 0.004 0.240
#> GSM97126     1  0.5536    0.69131 0.712 0.108 0.000 0.044 0.136
#> GSM97112     1  0.0693    0.79746 0.980 0.000 0.000 0.008 0.012
#> GSM97115     4  0.4096    0.62234 0.024 0.012 0.000 0.772 0.192
#> GSM97116     1  0.3607    0.77882 0.752 0.000 0.000 0.004 0.244
#> GSM97117     2  0.1329    0.60377 0.004 0.956 0.032 0.000 0.008
#> GSM97119     1  0.0451    0.79946 0.988 0.000 0.000 0.008 0.004
#> GSM97122     1  0.0451    0.79946 0.988 0.000 0.000 0.008 0.004
#> GSM97135     1  0.0290    0.80013 0.992 0.000 0.000 0.008 0.000
#> GSM97136     3  0.7991    0.21539 0.160 0.192 0.496 0.012 0.140
#> GSM97139     1  0.3635    0.77751 0.748 0.000 0.000 0.004 0.248
#> GSM97146     1  0.3689    0.77428 0.740 0.000 0.000 0.004 0.256
#> GSM97123     3  0.6194    0.21454 0.000 0.208 0.588 0.008 0.196
#> GSM97129     2  0.8437    0.10453 0.180 0.476 0.152 0.036 0.156
#> GSM97143     1  0.1403    0.78844 0.952 0.000 0.000 0.024 0.024
#> GSM97113     2  0.2970    0.58866 0.000 0.828 0.000 0.004 0.168
#> GSM97056     1  0.6493    0.47084 0.492 0.000 0.000 0.260 0.248
#> GSM97124     1  0.0912    0.80367 0.972 0.000 0.000 0.012 0.016
#> GSM97132     1  0.5304    0.44611 0.640 0.000 0.000 0.272 0.088
#> GSM97144     4  0.3736    0.63043 0.140 0.000 0.000 0.808 0.052
#> GSM97149     1  0.3989    0.76923 0.728 0.004 0.000 0.008 0.260
#> GSM97068     4  0.6418    0.22027 0.000 0.184 0.000 0.472 0.344
#> GSM97071     4  0.5184    0.50314 0.000 0.000 0.176 0.688 0.136
#> GSM97086     4  0.4851    0.42469 0.000 0.036 0.000 0.624 0.340
#> GSM97103     3  0.6703    0.34253 0.000 0.208 0.600 0.076 0.116
#> GSM97057     2  0.4540    0.40119 0.000 0.640 0.000 0.020 0.340
#> GSM97060     3  0.1608    0.71125 0.000 0.000 0.928 0.000 0.072
#> GSM97075     2  0.5955    0.16347 0.000 0.596 0.256 0.004 0.144
#> GSM97098     3  0.5441    0.35200 0.000 0.280 0.624 0.000 0.096
#> GSM97099     2  0.3441    0.54888 0.000 0.848 0.088 0.008 0.056
#> GSM97101     2  0.1121    0.60498 0.000 0.956 0.000 0.000 0.044
#> GSM97105     2  0.3993    0.45754 0.000 0.756 0.000 0.028 0.216
#> GSM97106     3  0.4295    0.56558 0.000 0.020 0.740 0.012 0.228
#> GSM97121     2  0.1410    0.60253 0.000 0.940 0.000 0.000 0.060
#> GSM97128     4  0.7779    0.37497 0.188 0.000 0.180 0.488 0.144
#> GSM97131     2  0.7934   -0.43905 0.000 0.376 0.124 0.148 0.352
#> GSM97137     1  0.6687    0.31453 0.420 0.000 0.000 0.332 0.248
#> GSM97118     1  0.5976    0.40180 0.616 0.000 0.016 0.252 0.116
#> GSM97114     2  0.2408    0.59338 0.008 0.892 0.000 0.004 0.096
#> GSM97142     1  0.0693    0.79713 0.980 0.000 0.000 0.008 0.012
#> GSM97140     2  0.3805    0.51365 0.000 0.784 0.000 0.032 0.184
#> GSM97141     2  0.0794    0.60743 0.000 0.972 0.000 0.000 0.028
#> GSM97055     1  0.2954    0.76527 0.888 0.004 0.024 0.024 0.060
#> GSM97090     4  0.3608    0.63918 0.040 0.000 0.000 0.812 0.148
#> GSM97091     1  0.1522    0.78207 0.944 0.000 0.000 0.012 0.044
#> GSM97148     1  0.3809    0.77217 0.736 0.000 0.000 0.008 0.256
#> GSM97063     1  0.0898    0.79427 0.972 0.000 0.000 0.008 0.020
#> GSM97053     1  0.1430    0.80714 0.944 0.000 0.000 0.004 0.052
#> GSM97066     3  0.1892    0.70901 0.000 0.000 0.916 0.004 0.080
#> GSM97079     4  0.4698    0.48640 0.000 0.028 0.004 0.664 0.304
#> GSM97083     4  0.4819    0.58917 0.148 0.000 0.004 0.736 0.112
#> GSM97084     4  0.3274    0.58355 0.000 0.000 0.000 0.780 0.220
#> GSM97094     4  0.2813    0.64655 0.032 0.004 0.000 0.880 0.084
#> GSM97096     3  0.3937    0.65718 0.000 0.072 0.808 0.004 0.116
#> GSM97097     4  0.6840    0.29109 0.000 0.060 0.116 0.552 0.272
#> GSM97107     4  0.1965    0.65026 0.024 0.000 0.000 0.924 0.052
#> GSM97054     4  0.4445    0.50702 0.000 0.024 0.000 0.676 0.300
#> GSM97062     4  0.3790    0.54557 0.000 0.004 0.000 0.724 0.272
#> GSM97069     3  0.1121    0.72217 0.000 0.000 0.956 0.000 0.044
#> GSM97070     3  0.1638    0.71816 0.000 0.000 0.932 0.004 0.064
#> GSM97073     3  0.1892    0.71295 0.000 0.000 0.916 0.004 0.080
#> GSM97076     1  0.8563    0.36553 0.464 0.084 0.144 0.076 0.232
#> GSM97077     5  0.7331    0.22034 0.000 0.388 0.064 0.136 0.412
#> GSM97095     4  0.5355    0.57286 0.024 0.076 0.000 0.696 0.204
#> GSM97102     3  0.1484    0.72309 0.000 0.008 0.944 0.000 0.048
#> GSM97109     2  0.3476    0.57498 0.004 0.844 0.016 0.020 0.116
#> GSM97110     2  0.4361    0.54898 0.000 0.780 0.040 0.024 0.156
#> GSM97074     3  0.8368    0.00668 0.220 0.000 0.372 0.228 0.180
#> GSM97085     3  0.5081    0.54547 0.064 0.000 0.736 0.036 0.164
#> GSM97059     2  0.6773    0.04705 0.004 0.424 0.000 0.228 0.344
#> GSM97072     3  0.1430    0.72092 0.000 0.000 0.944 0.004 0.052
#> GSM97078     4  0.6240    0.54583 0.104 0.000 0.076 0.656 0.164
#> GSM97067     3  0.1732    0.71313 0.000 0.000 0.920 0.000 0.080
#> GSM97087     3  0.2074    0.70003 0.000 0.000 0.896 0.000 0.104
#> GSM97111     2  0.2012    0.60338 0.000 0.920 0.020 0.000 0.060
#> GSM97064     5  0.7350    0.54102 0.000 0.228 0.368 0.032 0.372
#> GSM97065     2  0.6362    0.03610 0.000 0.484 0.364 0.004 0.148
#> GSM97081     3  0.4238    0.60668 0.000 0.136 0.776 0.000 0.088
#> GSM97082     3  0.1197    0.72076 0.000 0.000 0.952 0.000 0.048
#> GSM97088     3  0.7640   -0.10204 0.084 0.000 0.388 0.376 0.152
#> GSM97100     2  0.6134   -0.01013 0.000 0.516 0.000 0.144 0.340
#> GSM97104     3  0.0703    0.72459 0.000 0.000 0.976 0.000 0.024
#> GSM97108     2  0.2011    0.58849 0.000 0.908 0.000 0.004 0.088
#> GSM97050     5  0.7880    0.61436 0.000 0.252 0.204 0.104 0.440
#> GSM97080     3  0.1197    0.72406 0.000 0.000 0.952 0.000 0.048
#> GSM97089     3  0.2127    0.69956 0.000 0.000 0.892 0.000 0.108
#> GSM97092     3  0.3013    0.64883 0.000 0.008 0.832 0.000 0.160
#> GSM97093     5  0.8122    0.47303 0.008 0.292 0.292 0.068 0.340
#> GSM97058     2  0.6622   -0.19259 0.000 0.500 0.088 0.044 0.368
#> GSM97051     5  0.7968    0.58896 0.000 0.180 0.192 0.168 0.460
#> GSM97052     3  0.3475    0.61714 0.000 0.012 0.804 0.004 0.180
#> GSM97061     3  0.4870    0.41427 0.000 0.040 0.680 0.008 0.272

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.2445     0.6196 0.868 0.008 0.000 0.004 0.120 0.000
#> GSM97145     1  0.4127     0.6203 0.716 0.016 0.000 0.016 0.248 0.004
#> GSM97147     2  0.7724     0.2418 0.116 0.476 0.000 0.116 0.080 0.212
#> GSM97125     1  0.3972     0.6265 0.664 0.000 0.000 0.012 0.320 0.004
#> GSM97127     1  0.3051     0.6241 0.824 0.004 0.000 0.012 0.156 0.004
#> GSM97130     4  0.6018     0.2646 0.344 0.000 0.000 0.488 0.148 0.020
#> GSM97133     1  0.0405     0.5956 0.988 0.000 0.000 0.004 0.008 0.000
#> GSM97134     4  0.6324     0.0383 0.084 0.004 0.000 0.440 0.408 0.064
#> GSM97120     1  0.0632     0.5972 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM97126     1  0.6200     0.2451 0.440 0.092 0.000 0.016 0.424 0.028
#> GSM97112     1  0.3950     0.5855 0.564 0.000 0.000 0.004 0.432 0.000
#> GSM97115     4  0.6012     0.5150 0.136 0.012 0.000 0.644 0.116 0.092
#> GSM97116     1  0.0632     0.6036 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM97117     2  0.1707     0.5838 0.000 0.928 0.004 0.000 0.012 0.056
#> GSM97119     1  0.4088     0.5867 0.556 0.000 0.000 0.004 0.436 0.004
#> GSM97122     1  0.4056     0.6010 0.576 0.000 0.000 0.004 0.416 0.004
#> GSM97135     1  0.4002     0.6059 0.588 0.000 0.000 0.008 0.404 0.000
#> GSM97136     3  0.8387     0.1330 0.060 0.212 0.372 0.012 0.232 0.112
#> GSM97139     1  0.0547     0.6035 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM97146     1  0.0291     0.5911 0.992 0.000 0.000 0.004 0.004 0.000
#> GSM97123     3  0.6347     0.2759 0.000 0.144 0.452 0.012 0.020 0.372
#> GSM97129     2  0.8697     0.1658 0.100 0.412 0.092 0.044 0.208 0.144
#> GSM97143     1  0.4304     0.5566 0.536 0.000 0.000 0.008 0.448 0.008
#> GSM97113     2  0.5116     0.4940 0.128 0.696 0.004 0.000 0.028 0.144
#> GSM97056     1  0.4792     0.1977 0.672 0.000 0.000 0.232 0.088 0.008
#> GSM97124     1  0.4325     0.5966 0.568 0.000 0.000 0.016 0.412 0.004
#> GSM97132     5  0.6528    -0.0544 0.360 0.000 0.000 0.192 0.412 0.036
#> GSM97144     4  0.5204     0.3937 0.068 0.000 0.000 0.636 0.264 0.032
#> GSM97149     1  0.0551     0.5852 0.984 0.008 0.000 0.004 0.004 0.000
#> GSM97068     4  0.8124     0.1896 0.140 0.124 0.000 0.416 0.092 0.228
#> GSM97071     4  0.6212     0.2416 0.000 0.000 0.240 0.556 0.148 0.056
#> GSM97086     4  0.4552     0.3855 0.000 0.024 0.000 0.668 0.028 0.280
#> GSM97103     3  0.8021     0.2348 0.000 0.208 0.432 0.124 0.076 0.160
#> GSM97057     2  0.7050     0.1758 0.172 0.468 0.000 0.044 0.032 0.284
#> GSM97060     3  0.3730     0.6497 0.000 0.004 0.796 0.020 0.028 0.152
#> GSM97075     2  0.6651     0.0934 0.000 0.480 0.256 0.004 0.044 0.216
#> GSM97098     3  0.7096     0.2755 0.000 0.296 0.432 0.012 0.064 0.196
#> GSM97099     2  0.4298     0.5283 0.004 0.796 0.048 0.012 0.052 0.088
#> GSM97101     2  0.2349     0.5809 0.008 0.892 0.000 0.000 0.020 0.080
#> GSM97105     2  0.5115     0.3607 0.000 0.624 0.004 0.040 0.032 0.300
#> GSM97106     3  0.6157     0.4244 0.000 0.044 0.528 0.056 0.028 0.344
#> GSM97121     2  0.3652     0.5515 0.004 0.796 0.000 0.004 0.048 0.148
#> GSM97128     5  0.6865     0.2449 0.004 0.000 0.212 0.220 0.488 0.076
#> GSM97131     6  0.7229     0.2803 0.000 0.320 0.076 0.148 0.024 0.432
#> GSM97137     1  0.5090     0.1133 0.624 0.000 0.000 0.272 0.096 0.008
#> GSM97118     5  0.6598     0.1789 0.260 0.000 0.012 0.132 0.532 0.064
#> GSM97114     2  0.3340     0.5723 0.100 0.840 0.000 0.004 0.024 0.032
#> GSM97142     1  0.3955     0.5846 0.560 0.000 0.000 0.004 0.436 0.000
#> GSM97140     2  0.5654     0.4124 0.012 0.620 0.000 0.044 0.064 0.260
#> GSM97141     2  0.2094     0.5857 0.016 0.908 0.000 0.000 0.008 0.068
#> GSM97055     5  0.5315    -0.4128 0.448 0.008 0.040 0.004 0.488 0.012
#> GSM97090     4  0.5457     0.5413 0.116 0.000 0.000 0.676 0.132 0.076
#> GSM97091     1  0.3996     0.5208 0.512 0.000 0.000 0.004 0.484 0.000
#> GSM97148     1  0.0291     0.5911 0.992 0.000 0.000 0.004 0.004 0.000
#> GSM97063     1  0.3847     0.5631 0.544 0.000 0.000 0.000 0.456 0.000
#> GSM97053     1  0.4090     0.6137 0.604 0.000 0.000 0.008 0.384 0.004
#> GSM97066     3  0.2398     0.6333 0.000 0.000 0.876 0.000 0.104 0.020
#> GSM97079     4  0.4648     0.3998 0.000 0.004 0.016 0.668 0.036 0.276
#> GSM97083     4  0.5300     0.1277 0.008 0.000 0.008 0.492 0.436 0.056
#> GSM97084     4  0.2882     0.5140 0.000 0.000 0.000 0.812 0.008 0.180
#> GSM97094     4  0.3417     0.5591 0.004 0.000 0.000 0.812 0.132 0.052
#> GSM97096     3  0.6261     0.5218 0.000 0.100 0.584 0.016 0.060 0.240
#> GSM97097     4  0.6206     0.3188 0.000 0.068 0.036 0.612 0.064 0.220
#> GSM97107     4  0.2619     0.5742 0.008 0.000 0.000 0.880 0.072 0.040
#> GSM97054     4  0.4222     0.4302 0.000 0.016 0.000 0.708 0.028 0.248
#> GSM97062     4  0.3424     0.4934 0.000 0.004 0.000 0.780 0.020 0.196
#> GSM97069     3  0.1584     0.6563 0.000 0.000 0.928 0.000 0.064 0.008
#> GSM97070     3  0.1858     0.6494 0.000 0.000 0.912 0.000 0.076 0.012
#> GSM97073     3  0.2701     0.6361 0.000 0.004 0.864 0.000 0.104 0.028
#> GSM97076     5  0.8952     0.2796 0.244 0.080 0.244 0.068 0.304 0.060
#> GSM97077     6  0.6562     0.4452 0.000 0.232 0.048 0.092 0.052 0.576
#> GSM97095     4  0.7744     0.4012 0.164 0.064 0.000 0.468 0.196 0.108
#> GSM97102     3  0.3971     0.6445 0.000 0.036 0.808 0.008 0.056 0.092
#> GSM97109     2  0.5154     0.5018 0.040 0.748 0.016 0.024 0.088 0.084
#> GSM97110     2  0.6139     0.4554 0.040 0.676 0.048 0.024 0.084 0.128
#> GSM97074     5  0.6284     0.1117 0.004 0.000 0.424 0.084 0.428 0.060
#> GSM97085     3  0.5050     0.3201 0.000 0.000 0.640 0.032 0.276 0.052
#> GSM97059     6  0.8554     0.0537 0.168 0.252 0.000 0.252 0.072 0.256
#> GSM97072     3  0.2442     0.6609 0.000 0.000 0.884 0.000 0.068 0.048
#> GSM97078     5  0.6871    -0.0549 0.000 0.000 0.136 0.376 0.392 0.096
#> GSM97067     3  0.2006     0.6457 0.000 0.000 0.904 0.000 0.080 0.016
#> GSM97087     3  0.3828     0.5887 0.000 0.000 0.696 0.004 0.012 0.288
#> GSM97111     2  0.3380     0.5692 0.000 0.832 0.016 0.000 0.056 0.096
#> GSM97064     6  0.5771     0.5182 0.000 0.116 0.188 0.048 0.008 0.640
#> GSM97065     2  0.7658     0.1402 0.036 0.412 0.308 0.004 0.148 0.092
#> GSM97081     3  0.5276     0.5816 0.000 0.108 0.676 0.000 0.044 0.172
#> GSM97082     3  0.2445     0.6646 0.000 0.000 0.872 0.000 0.020 0.108
#> GSM97088     3  0.6769    -0.0600 0.000 0.000 0.460 0.144 0.308 0.088
#> GSM97100     2  0.6543    -0.0581 0.000 0.420 0.000 0.172 0.044 0.364
#> GSM97104     3  0.1728     0.6706 0.000 0.000 0.924 0.004 0.008 0.064
#> GSM97108     2  0.4238     0.4770 0.000 0.720 0.000 0.016 0.036 0.228
#> GSM97050     6  0.6010     0.5600 0.000 0.132 0.068 0.132 0.020 0.648
#> GSM97080     3  0.1856     0.6662 0.000 0.000 0.920 0.000 0.032 0.048
#> GSM97089     3  0.4283     0.5853 0.000 0.004 0.676 0.004 0.028 0.288
#> GSM97092     3  0.4197     0.5563 0.000 0.012 0.660 0.004 0.008 0.316
#> GSM97093     6  0.7211     0.3886 0.012 0.120 0.152 0.068 0.076 0.572
#> GSM97058     6  0.6379     0.4507 0.000 0.252 0.100 0.048 0.028 0.572
#> GSM97051     6  0.5517     0.5657 0.000 0.076 0.068 0.152 0.016 0.688
#> GSM97052     3  0.4289     0.5294 0.000 0.012 0.636 0.004 0.008 0.340
#> GSM97061     3  0.5210     0.3055 0.000 0.036 0.488 0.016 0.008 0.452

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-skmeans-membership-heatmap-5

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)

plot of chunk tab-MAD-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-1

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

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-2

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

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-3

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

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-4

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

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-skmeans-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-MAD-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-skmeans-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:skmeans 97         5.64e-04       0.415     3.09e-13    0.102 2
#> MAD:skmeans 92         1.86e-04       0.410     1.35e-13    0.379 3
#> MAD:skmeans 93         6.25e-04       0.424     3.06e-15    0.192 4
#> MAD:skmeans 70         2.27e-05       0.422     1.45e-12    0.193 5
#> MAD:skmeans 54         2.48e-05       0.181     7.58e-09    0.181 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.


MAD:pam

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "pam"]
# 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 21512 rows and 100 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)

plot of chunk MAD-pam-collect-plots

The plots are:

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:

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)

plot of chunk MAD-pam-select-partition-number

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.597           0.733       0.899         0.4544 0.529   0.529
#> 3 3 0.727           0.839       0.924         0.4358 0.666   0.447
#> 4 4 0.662           0.741       0.839         0.1101 0.892   0.704
#> 5 5 0.629           0.684       0.767         0.0615 0.959   0.855
#> 6 6 0.684           0.515       0.720         0.0584 0.919   0.683

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0376    0.82719 0.996 0.004
#> GSM97145     1  0.2423    0.80884 0.960 0.040
#> GSM97147     2  0.7219    0.66637 0.200 0.800
#> GSM97125     1  0.0000    0.82823 1.000 0.000
#> GSM97127     1  0.1633    0.81770 0.976 0.024
#> GSM97130     1  0.0000    0.82823 1.000 0.000
#> GSM97133     1  0.0000    0.82823 1.000 0.000
#> GSM97134     1  0.8713    0.62042 0.708 0.292
#> GSM97120     1  0.9044    0.48274 0.680 0.320
#> GSM97126     1  0.9850    0.34449 0.572 0.428
#> GSM97112     1  0.0000    0.82823 1.000 0.000
#> GSM97115     1  0.9998    0.13424 0.508 0.492
#> GSM97116     1  0.0000    0.82823 1.000 0.000
#> GSM97117     2  0.0000    0.89973 0.000 1.000
#> GSM97119     1  0.0000    0.82823 1.000 0.000
#> GSM97122     1  0.0000    0.82823 1.000 0.000
#> GSM97135     1  0.0000    0.82823 1.000 0.000
#> GSM97136     2  0.7299    0.65587 0.204 0.796
#> GSM97139     1  0.0000    0.82823 1.000 0.000
#> GSM97146     1  0.0672    0.82535 0.992 0.008
#> GSM97123     2  0.0000    0.89973 0.000 1.000
#> GSM97129     2  0.9635    0.25777 0.388 0.612
#> GSM97143     1  0.8861    0.60526 0.696 0.304
#> GSM97113     2  0.0000    0.89973 0.000 1.000
#> GSM97056     1  0.0000    0.82823 1.000 0.000
#> GSM97124     1  0.0000    0.82823 1.000 0.000
#> GSM97132     1  0.5946    0.75304 0.856 0.144
#> GSM97144     1  0.0000    0.82823 1.000 0.000
#> GSM97149     1  0.8713    0.53002 0.708 0.292
#> GSM97068     2  0.1414    0.88352 0.020 0.980
#> GSM97071     2  0.9954    0.00951 0.460 0.540
#> GSM97086     2  0.0000    0.89973 0.000 1.000
#> GSM97103     2  0.0000    0.89973 0.000 1.000
#> GSM97057     2  0.0376    0.89706 0.004 0.996
#> GSM97060     2  0.0000    0.89973 0.000 1.000
#> GSM97075     2  0.0000    0.89973 0.000 1.000
#> GSM97098     2  0.0000    0.89973 0.000 1.000
#> GSM97099     2  0.0000    0.89973 0.000 1.000
#> GSM97101     2  0.0000    0.89973 0.000 1.000
#> GSM97105     2  0.0000    0.89973 0.000 1.000
#> GSM97106     2  0.0000    0.89973 0.000 1.000
#> GSM97121     2  0.0000    0.89973 0.000 1.000
#> GSM97128     1  0.9491    0.49497 0.632 0.368
#> GSM97131     2  0.0000    0.89973 0.000 1.000
#> GSM97137     1  0.0376    0.82729 0.996 0.004
#> GSM97118     1  0.8763    0.61533 0.704 0.296
#> GSM97114     2  0.0376    0.89706 0.004 0.996
#> GSM97142     1  0.0000    0.82823 1.000 0.000
#> GSM97140     2  0.0672    0.89413 0.008 0.992
#> GSM97141     2  0.0000    0.89973 0.000 1.000
#> GSM97055     1  1.0000    0.15082 0.504 0.496
#> GSM97090     1  0.9552    0.47464 0.624 0.376
#> GSM97091     1  0.0000    0.82823 1.000 0.000
#> GSM97148     1  0.0000    0.82823 1.000 0.000
#> GSM97063     1  0.0000    0.82823 1.000 0.000
#> GSM97053     1  0.0000    0.82823 1.000 0.000
#> GSM97066     2  0.0376    0.89713 0.004 0.996
#> GSM97079     2  0.0376    0.89705 0.004 0.996
#> GSM97083     1  0.8713    0.62042 0.708 0.292
#> GSM97084     2  0.9815    0.15139 0.420 0.580
#> GSM97094     1  0.9522    0.49801 0.628 0.372
#> GSM97096     2  0.0000    0.89973 0.000 1.000
#> GSM97097     2  0.0000    0.89973 0.000 1.000
#> GSM97107     2  1.0000   -0.13281 0.496 0.504
#> GSM97054     2  0.9427    0.33172 0.360 0.640
#> GSM97062     2  0.9996   -0.09865 0.488 0.512
#> GSM97069     2  0.0000    0.89973 0.000 1.000
#> GSM97070     2  0.0000    0.89973 0.000 1.000
#> GSM97073     2  0.0000    0.89973 0.000 1.000
#> GSM97076     2  0.9963   -0.00893 0.464 0.536
#> GSM97077     2  0.1184    0.88709 0.016 0.984
#> GSM97095     2  0.9833    0.13998 0.424 0.576
#> GSM97102     2  0.0000    0.89973 0.000 1.000
#> GSM97109     2  0.0000    0.89973 0.000 1.000
#> GSM97110     2  0.0000    0.89973 0.000 1.000
#> GSM97074     1  0.8955    0.59354 0.688 0.312
#> GSM97085     2  0.9996   -0.09865 0.488 0.512
#> GSM97059     2  0.0672    0.89431 0.008 0.992
#> GSM97072     2  0.0000    0.89973 0.000 1.000
#> GSM97078     1  0.9000    0.58765 0.684 0.316
#> GSM97067     2  0.0000    0.89973 0.000 1.000
#> GSM97087     2  0.0000    0.89973 0.000 1.000
#> GSM97111     2  0.0000    0.89973 0.000 1.000
#> GSM97064     2  0.0000    0.89973 0.000 1.000
#> GSM97065     2  0.0000    0.89973 0.000 1.000
#> GSM97081     2  0.0000    0.89973 0.000 1.000
#> GSM97082     2  0.0000    0.89973 0.000 1.000
#> GSM97088     2  0.9998   -0.11388 0.492 0.508
#> GSM97100     2  0.0000    0.89973 0.000 1.000
#> GSM97104     2  0.0000    0.89973 0.000 1.000
#> GSM97108     2  0.0000    0.89973 0.000 1.000
#> GSM97050     2  0.0376    0.89711 0.004 0.996
#> GSM97080     2  0.0000    0.89973 0.000 1.000
#> GSM97089     2  0.0000    0.89973 0.000 1.000
#> GSM97092     2  0.0000    0.89973 0.000 1.000
#> GSM97093     2  0.0000    0.89973 0.000 1.000
#> GSM97058     2  0.0000    0.89973 0.000 1.000
#> GSM97051     2  0.0000    0.89973 0.000 1.000
#> GSM97052     2  0.0000    0.89973 0.000 1.000
#> GSM97061     2  0.0000    0.89973 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97145     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97147     2  0.0424      0.886 0.008 0.992 0.000
#> GSM97125     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97127     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97130     2  0.0424      0.885 0.008 0.992 0.000
#> GSM97133     1  0.1753      0.880 0.952 0.048 0.000
#> GSM97134     2  0.3482      0.804 0.128 0.872 0.000
#> GSM97120     1  0.4702      0.704 0.788 0.000 0.212
#> GSM97126     2  0.7104      0.378 0.032 0.608 0.360
#> GSM97112     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97115     2  0.0237      0.886 0.004 0.996 0.000
#> GSM97116     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97117     3  0.0424      0.940 0.000 0.008 0.992
#> GSM97119     1  0.0237      0.913 0.996 0.004 0.000
#> GSM97122     1  0.0424      0.912 0.992 0.008 0.000
#> GSM97135     1  0.0424      0.912 0.992 0.008 0.000
#> GSM97136     3  0.0983      0.930 0.016 0.004 0.980
#> GSM97139     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97146     1  0.2878      0.831 0.904 0.096 0.000
#> GSM97123     3  0.0237      0.941 0.000 0.004 0.996
#> GSM97129     3  0.5486      0.751 0.024 0.196 0.780
#> GSM97143     3  0.6228      0.505 0.316 0.012 0.672
#> GSM97113     3  0.4235      0.800 0.000 0.176 0.824
#> GSM97056     2  0.4974      0.672 0.236 0.764 0.000
#> GSM97124     1  0.0592      0.911 0.988 0.012 0.000
#> GSM97132     1  0.7027      0.665 0.724 0.172 0.104
#> GSM97144     2  0.5760      0.511 0.328 0.672 0.000
#> GSM97149     2  0.6291      0.163 0.468 0.532 0.000
#> GSM97068     2  0.0661      0.888 0.004 0.988 0.008
#> GSM97071     2  0.0237      0.887 0.000 0.996 0.004
#> GSM97086     2  0.0592      0.888 0.000 0.988 0.012
#> GSM97103     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97057     2  0.0747      0.887 0.000 0.984 0.016
#> GSM97060     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97075     3  0.4796      0.749 0.000 0.220 0.780
#> GSM97098     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97099     3  0.0237      0.941 0.000 0.004 0.996
#> GSM97101     3  0.1860      0.913 0.000 0.052 0.948
#> GSM97105     2  0.4605      0.740 0.000 0.796 0.204
#> GSM97106     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97121     2  0.1529      0.879 0.000 0.960 0.040
#> GSM97128     2  0.4750      0.707 0.216 0.784 0.000
#> GSM97131     3  0.4842      0.740 0.000 0.224 0.776
#> GSM97137     2  0.0892      0.884 0.020 0.980 0.000
#> GSM97118     1  0.9311      0.232 0.468 0.168 0.364
#> GSM97114     3  0.4953      0.796 0.016 0.176 0.808
#> GSM97142     1  0.0424      0.912 0.992 0.008 0.000
#> GSM97140     2  0.0592      0.888 0.000 0.988 0.012
#> GSM97141     3  0.0424      0.940 0.000 0.008 0.992
#> GSM97055     1  0.7013      0.195 0.548 0.020 0.432
#> GSM97090     2  0.0424      0.885 0.008 0.992 0.000
#> GSM97091     1  0.0592      0.911 0.988 0.012 0.000
#> GSM97148     1  0.0424      0.911 0.992 0.008 0.000
#> GSM97063     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97053     1  0.0000      0.914 1.000 0.000 0.000
#> GSM97066     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97079     2  0.0892      0.887 0.000 0.980 0.020
#> GSM97083     2  0.3192      0.822 0.112 0.888 0.000
#> GSM97084     2  0.0000      0.886 0.000 1.000 0.000
#> GSM97094     2  0.6737      0.704 0.156 0.744 0.100
#> GSM97096     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97097     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97107     2  0.2860      0.842 0.004 0.912 0.084
#> GSM97054     2  0.0424      0.888 0.000 0.992 0.008
#> GSM97062     2  0.0237      0.886 0.004 0.996 0.000
#> GSM97069     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97070     3  0.0237      0.941 0.000 0.004 0.996
#> GSM97073     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97076     2  0.1015      0.885 0.008 0.980 0.012
#> GSM97077     2  0.0592      0.888 0.000 0.988 0.012
#> GSM97095     2  0.0000      0.886 0.000 1.000 0.000
#> GSM97102     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97109     3  0.0237      0.940 0.004 0.000 0.996
#> GSM97110     3  0.2165      0.901 0.000 0.064 0.936
#> GSM97074     2  0.9284      0.360 0.192 0.512 0.296
#> GSM97085     3  0.0829      0.933 0.004 0.012 0.984
#> GSM97059     2  0.0592      0.888 0.000 0.988 0.012
#> GSM97072     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97078     2  0.0424      0.885 0.008 0.992 0.000
#> GSM97067     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97087     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97111     3  0.0424      0.940 0.000 0.008 0.992
#> GSM97064     2  0.1031      0.886 0.000 0.976 0.024
#> GSM97065     2  0.6330      0.319 0.004 0.600 0.396
#> GSM97081     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97082     3  0.0424      0.940 0.000 0.008 0.992
#> GSM97088     3  0.5722      0.631 0.004 0.292 0.704
#> GSM97100     2  0.0592      0.888 0.000 0.988 0.012
#> GSM97104     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97108     3  0.4291      0.799 0.000 0.180 0.820
#> GSM97050     2  0.3941      0.788 0.000 0.844 0.156
#> GSM97080     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97089     3  0.0000      0.942 0.000 0.000 1.000
#> GSM97092     3  0.0424      0.940 0.000 0.008 0.992
#> GSM97093     2  0.2165      0.866 0.000 0.936 0.064
#> GSM97058     2  0.1031      0.885 0.000 0.976 0.024
#> GSM97051     2  0.0892      0.887 0.000 0.980 0.020
#> GSM97052     3  0.0237      0.941 0.000 0.004 0.996
#> GSM97061     3  0.0000      0.942 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.0188     0.8720 0.996 0.000 0.000 0.004
#> GSM97145     1  0.0188     0.8721 0.996 0.000 0.000 0.004
#> GSM97147     2  0.0921     0.8339 0.000 0.972 0.000 0.028
#> GSM97125     1  0.3266     0.7285 0.832 0.000 0.000 0.168
#> GSM97127     1  0.0707     0.8680 0.980 0.000 0.000 0.020
#> GSM97130     2  0.4277     0.5356 0.000 0.720 0.000 0.280
#> GSM97133     1  0.0469     0.8686 0.988 0.000 0.000 0.012
#> GSM97134     4  0.6615     0.3261 0.084 0.404 0.000 0.512
#> GSM97120     1  0.0376     0.8700 0.992 0.000 0.004 0.004
#> GSM97126     4  0.8774     0.4546 0.084 0.300 0.156 0.460
#> GSM97112     1  0.4888     0.3980 0.588 0.000 0.000 0.412
#> GSM97115     2  0.1389     0.8220 0.000 0.952 0.000 0.048
#> GSM97116     1  0.0336     0.8709 0.992 0.000 0.000 0.008
#> GSM97117     3  0.3877     0.8749 0.000 0.048 0.840 0.112
#> GSM97119     4  0.4661     0.3387 0.348 0.000 0.000 0.652
#> GSM97122     1  0.3688     0.7153 0.792 0.000 0.000 0.208
#> GSM97135     1  0.2704     0.8121 0.876 0.000 0.000 0.124
#> GSM97136     3  0.2408     0.8687 0.044 0.000 0.920 0.036
#> GSM97139     1  0.0000     0.8722 1.000 0.000 0.000 0.000
#> GSM97146     1  0.0000     0.8722 1.000 0.000 0.000 0.000
#> GSM97123     3  0.1635     0.9021 0.000 0.008 0.948 0.044
#> GSM97129     3  0.7081     0.2499 0.028 0.060 0.496 0.416
#> GSM97143     4  0.7307     0.4829 0.192 0.000 0.284 0.524
#> GSM97113     3  0.3335     0.8351 0.016 0.128 0.856 0.000
#> GSM97056     2  0.5387     0.2998 0.400 0.584 0.000 0.016
#> GSM97124     4  0.4916     0.2936 0.424 0.000 0.000 0.576
#> GSM97132     4  0.7514     0.5366 0.276 0.068 0.072 0.584
#> GSM97144     4  0.6851     0.5186 0.132 0.300 0.000 0.568
#> GSM97149     1  0.3219     0.6503 0.836 0.164 0.000 0.000
#> GSM97068     2  0.1302     0.8241 0.000 0.956 0.000 0.044
#> GSM97071     2  0.2053     0.8241 0.000 0.924 0.004 0.072
#> GSM97086     2  0.0000     0.8359 0.000 1.000 0.000 0.000
#> GSM97103     3  0.0376     0.9022 0.000 0.004 0.992 0.004
#> GSM97057     2  0.0188     0.8368 0.000 0.996 0.004 0.000
#> GSM97060     3  0.1118     0.8991 0.000 0.000 0.964 0.036
#> GSM97075     3  0.4773     0.8429 0.000 0.092 0.788 0.120
#> GSM97098     3  0.0000     0.9010 0.000 0.000 1.000 0.000
#> GSM97099     3  0.1256     0.9030 0.000 0.008 0.964 0.028
#> GSM97101     3  0.3934     0.8728 0.000 0.048 0.836 0.116
#> GSM97105     2  0.4055     0.7381 0.000 0.832 0.108 0.060
#> GSM97106     3  0.1022     0.8993 0.000 0.000 0.968 0.032
#> GSM97121     2  0.1936     0.8235 0.000 0.940 0.028 0.032
#> GSM97128     4  0.6584     0.4487 0.080 0.348 0.004 0.568
#> GSM97131     3  0.5250     0.7405 0.000 0.196 0.736 0.068
#> GSM97137     2  0.1489     0.8192 0.044 0.952 0.000 0.004
#> GSM97118     4  0.7574     0.5965 0.144 0.060 0.176 0.620
#> GSM97114     3  0.5850     0.8199 0.076 0.052 0.756 0.116
#> GSM97142     4  0.4605     0.3410 0.336 0.000 0.000 0.664
#> GSM97140     2  0.1118     0.8323 0.000 0.964 0.000 0.036
#> GSM97141     3  0.2036     0.8981 0.000 0.032 0.936 0.032
#> GSM97055     4  0.6099     0.4692 0.076 0.040 0.156 0.728
#> GSM97090     2  0.1389     0.8220 0.000 0.952 0.000 0.048
#> GSM97091     4  0.3688     0.5300 0.208 0.000 0.000 0.792
#> GSM97148     1  0.0000     0.8722 1.000 0.000 0.000 0.000
#> GSM97063     1  0.4585     0.5523 0.668 0.000 0.000 0.332
#> GSM97053     1  0.2216     0.8321 0.908 0.000 0.000 0.092
#> GSM97066     3  0.2973     0.8883 0.000 0.000 0.856 0.144
#> GSM97079     2  0.1302     0.8235 0.000 0.956 0.044 0.000
#> GSM97083     4  0.4595     0.6249 0.044 0.176 0.000 0.780
#> GSM97084     2  0.0000     0.8359 0.000 1.000 0.000 0.000
#> GSM97094     2  0.7631     0.2073 0.084 0.556 0.056 0.304
#> GSM97096     3  0.0000     0.9010 0.000 0.000 1.000 0.000
#> GSM97097     3  0.0779     0.9019 0.000 0.004 0.980 0.016
#> GSM97107     2  0.5866     0.3802 0.000 0.624 0.052 0.324
#> GSM97054     2  0.0000     0.8359 0.000 1.000 0.000 0.000
#> GSM97062     2  0.1389     0.8220 0.000 0.952 0.000 0.048
#> GSM97069     3  0.2589     0.8910 0.000 0.000 0.884 0.116
#> GSM97070     3  0.2676     0.8947 0.000 0.012 0.896 0.092
#> GSM97073     3  0.1792     0.9010 0.000 0.000 0.932 0.068
#> GSM97076     2  0.3455     0.7571 0.004 0.852 0.012 0.132
#> GSM97077     2  0.0817     0.8351 0.000 0.976 0.000 0.024
#> GSM97095     2  0.0592     0.8342 0.000 0.984 0.000 0.016
#> GSM97102     3  0.0817     0.8999 0.000 0.000 0.976 0.024
#> GSM97109     3  0.1975     0.8893 0.048 0.000 0.936 0.016
#> GSM97110     3  0.1743     0.8908 0.004 0.056 0.940 0.000
#> GSM97074     4  0.5400     0.6281 0.124 0.068 0.032 0.776
#> GSM97085     4  0.3024     0.5832 0.000 0.000 0.148 0.852
#> GSM97059     2  0.0707     0.8356 0.000 0.980 0.000 0.020
#> GSM97072     3  0.1022     0.8993 0.000 0.000 0.968 0.032
#> GSM97078     2  0.4999    -0.0966 0.000 0.508 0.000 0.492
#> GSM97067     3  0.0921     0.8988 0.000 0.000 0.972 0.028
#> GSM97087     3  0.0817     0.9010 0.000 0.000 0.976 0.024
#> GSM97111     3  0.3934     0.8728 0.000 0.048 0.836 0.116
#> GSM97064     2  0.1677     0.8292 0.000 0.948 0.012 0.040
#> GSM97065     2  0.7630     0.0475 0.036 0.484 0.388 0.092
#> GSM97081     3  0.2654     0.8978 0.000 0.004 0.888 0.108
#> GSM97082     3  0.4370     0.8680 0.000 0.044 0.800 0.156
#> GSM97088     4  0.5051     0.6302 0.000 0.132 0.100 0.768
#> GSM97100     2  0.1022     0.8327 0.000 0.968 0.000 0.032
#> GSM97104     3  0.1474     0.8943 0.000 0.000 0.948 0.052
#> GSM97108     3  0.4094     0.8698 0.000 0.056 0.828 0.116
#> GSM97050     2  0.3552     0.7547 0.000 0.848 0.128 0.024
#> GSM97080     3  0.2921     0.8894 0.000 0.000 0.860 0.140
#> GSM97089     3  0.0188     0.9018 0.000 0.000 0.996 0.004
#> GSM97092     3  0.4307     0.8708 0.000 0.048 0.808 0.144
#> GSM97093     2  0.2197     0.8076 0.000 0.916 0.080 0.004
#> GSM97058     2  0.2987     0.7733 0.000 0.880 0.016 0.104
#> GSM97051     2  0.3157     0.7530 0.000 0.852 0.004 0.144
#> GSM97052     3  0.3606     0.8880 0.000 0.024 0.844 0.132
#> GSM97061     3  0.1576     0.9026 0.000 0.004 0.948 0.048

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.0290     0.8066 0.992 0.000 0.000 0.000 0.008
#> GSM97145     1  0.1341     0.7701 0.944 0.000 0.000 0.000 0.056
#> GSM97147     2  0.2803     0.8018 0.004 0.892 0.008 0.036 0.060
#> GSM97125     1  0.5355     0.3882 0.660 0.000 0.000 0.220 0.120
#> GSM97127     1  0.3366     0.5364 0.768 0.000 0.000 0.000 0.232
#> GSM97130     2  0.3796     0.4684 0.000 0.700 0.000 0.300 0.000
#> GSM97133     1  0.0000     0.8110 1.000 0.000 0.000 0.000 0.000
#> GSM97134     4  0.5198     0.6582 0.004 0.284 0.000 0.648 0.064
#> GSM97120     1  0.0000     0.8110 1.000 0.000 0.000 0.000 0.000
#> GSM97126     4  0.7057     0.5864 0.156 0.224 0.068 0.552 0.000
#> GSM97112     5  0.3495     0.7213 0.160 0.000 0.000 0.028 0.812
#> GSM97115     2  0.1341     0.8014 0.000 0.944 0.000 0.056 0.000
#> GSM97116     1  0.0000     0.8110 1.000 0.000 0.000 0.000 0.000
#> GSM97117     3  0.4664     0.7677 0.000 0.052 0.784 0.100 0.064
#> GSM97119     5  0.3734     0.6936 0.060 0.000 0.000 0.128 0.812
#> GSM97122     5  0.5229     0.5659 0.324 0.000 0.000 0.064 0.612
#> GSM97135     5  0.4576     0.4713 0.376 0.000 0.000 0.016 0.608
#> GSM97136     3  0.2515     0.7837 0.020 0.000 0.908 0.032 0.040
#> GSM97139     1  0.0000     0.8110 1.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000     0.8110 1.000 0.000 0.000 0.000 0.000
#> GSM97123     3  0.4462     0.7862 0.000 0.004 0.768 0.128 0.100
#> GSM97129     3  0.6761     0.2920 0.028 0.060 0.476 0.408 0.028
#> GSM97143     4  0.6379     0.5054 0.048 0.000 0.132 0.624 0.196
#> GSM97113     3  0.3848     0.7303 0.040 0.172 0.788 0.000 0.000
#> GSM97056     1  0.4977    -0.0381 0.500 0.472 0.000 0.028 0.000
#> GSM97124     5  0.5568     0.5237 0.096 0.000 0.000 0.308 0.596
#> GSM97132     4  0.6420     0.6149 0.052 0.076 0.020 0.648 0.204
#> GSM97144     4  0.5820     0.6780 0.012 0.168 0.000 0.648 0.172
#> GSM97149     1  0.0162     0.8073 0.996 0.004 0.000 0.000 0.000
#> GSM97068     2  0.1270     0.8035 0.000 0.948 0.000 0.052 0.000
#> GSM97071     2  0.3265     0.7959 0.000 0.860 0.012 0.088 0.040
#> GSM97086     2  0.0000     0.8210 0.000 1.000 0.000 0.000 0.000
#> GSM97103     3  0.0162     0.7989 0.000 0.000 0.996 0.000 0.004
#> GSM97057     2  0.0162     0.8219 0.000 0.996 0.004 0.000 0.000
#> GSM97060     3  0.5016     0.7358 0.000 0.000 0.704 0.176 0.120
#> GSM97075     3  0.5454     0.7450 0.000 0.104 0.728 0.104 0.064
#> GSM97098     3  0.0579     0.7975 0.000 0.000 0.984 0.008 0.008
#> GSM97099     3  0.2696     0.7948 0.000 0.012 0.896 0.040 0.052
#> GSM97101     3  0.4679     0.7682 0.000 0.056 0.784 0.096 0.064
#> GSM97105     2  0.4990     0.7160 0.000 0.764 0.092 0.080 0.064
#> GSM97106     3  0.3427     0.7879 0.000 0.000 0.836 0.108 0.056
#> GSM97121     2  0.3670     0.7760 0.000 0.848 0.044 0.044 0.064
#> GSM97128     4  0.5349     0.6993 0.004 0.204 0.000 0.676 0.116
#> GSM97131     3  0.6047     0.6780 0.000 0.184 0.664 0.088 0.064
#> GSM97137     2  0.1430     0.8016 0.052 0.944 0.000 0.004 0.000
#> GSM97118     4  0.5743     0.5896 0.004 0.040 0.048 0.652 0.256
#> GSM97114     3  0.6569     0.7251 0.108 0.052 0.680 0.096 0.064
#> GSM97142     5  0.4627     0.6741 0.080 0.000 0.000 0.188 0.732
#> GSM97140     2  0.2983     0.7939 0.000 0.880 0.012 0.048 0.060
#> GSM97141     3  0.3310     0.7877 0.000 0.036 0.868 0.040 0.056
#> GSM97055     5  0.6569     0.3240 0.024 0.048 0.056 0.272 0.600
#> GSM97090     2  0.1341     0.8014 0.000 0.944 0.000 0.056 0.000
#> GSM97091     5  0.3280     0.6425 0.012 0.000 0.000 0.176 0.812
#> GSM97148     1  0.0000     0.8110 1.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.3003     0.6964 0.188 0.000 0.000 0.000 0.812
#> GSM97053     1  0.4287    -0.1461 0.540 0.000 0.000 0.000 0.460
#> GSM97066     3  0.5828     0.7109 0.000 0.004 0.596 0.284 0.116
#> GSM97079     2  0.1341     0.8024 0.000 0.944 0.056 0.000 0.000
#> GSM97083     4  0.5329     0.7002 0.000 0.184 0.000 0.672 0.144
#> GSM97084     2  0.0404     0.8200 0.000 0.988 0.000 0.012 0.000
#> GSM97094     2  0.7575    -0.3046 0.004 0.384 0.044 0.364 0.204
#> GSM97096     3  0.0579     0.7975 0.000 0.000 0.984 0.008 0.008
#> GSM97097     3  0.0865     0.7993 0.000 0.000 0.972 0.024 0.004
#> GSM97107     2  0.5014     0.2288 0.000 0.592 0.040 0.368 0.000
#> GSM97054     2  0.0000     0.8210 0.000 1.000 0.000 0.000 0.000
#> GSM97062     2  0.1341     0.8014 0.000 0.944 0.000 0.056 0.000
#> GSM97069     3  0.5663     0.7169 0.000 0.004 0.628 0.252 0.116
#> GSM97070     3  0.5060     0.7712 0.000 0.020 0.720 0.192 0.068
#> GSM97073     3  0.3779     0.7790 0.000 0.000 0.804 0.144 0.052
#> GSM97076     2  0.3403     0.7087 0.008 0.820 0.012 0.160 0.000
#> GSM97077     2  0.1393     0.8200 0.000 0.956 0.008 0.024 0.012
#> GSM97095     2  0.0703     0.8171 0.000 0.976 0.000 0.024 0.000
#> GSM97102     3  0.1774     0.7995 0.000 0.000 0.932 0.052 0.016
#> GSM97109     3  0.2020     0.7828 0.100 0.000 0.900 0.000 0.000
#> GSM97110     3  0.2471     0.7683 0.000 0.136 0.864 0.000 0.000
#> GSM97074     4  0.4804     0.6242 0.000 0.044 0.016 0.720 0.220
#> GSM97085     4  0.4847     0.4221 0.000 0.000 0.080 0.704 0.216
#> GSM97059     2  0.2158     0.8106 0.000 0.920 0.008 0.020 0.052
#> GSM97072     3  0.3953     0.7645 0.000 0.000 0.792 0.148 0.060
#> GSM97078     4  0.4114     0.5515 0.000 0.376 0.000 0.624 0.000
#> GSM97067     3  0.4219     0.7510 0.000 0.000 0.772 0.156 0.072
#> GSM97087     3  0.3682     0.7810 0.000 0.000 0.820 0.108 0.072
#> GSM97111     3  0.4664     0.7677 0.000 0.052 0.784 0.100 0.064
#> GSM97064     2  0.1597     0.8179 0.000 0.940 0.012 0.048 0.000
#> GSM97065     2  0.7056     0.0504 0.084 0.480 0.368 0.060 0.008
#> GSM97081     3  0.3184     0.8019 0.000 0.000 0.852 0.100 0.048
#> GSM97082     3  0.7368     0.6805 0.000 0.056 0.472 0.288 0.184
#> GSM97088     4  0.4857     0.6474 0.000 0.100 0.068 0.772 0.060
#> GSM97100     2  0.3079     0.7899 0.000 0.876 0.016 0.044 0.064
#> GSM97104     3  0.5434     0.6941 0.000 0.000 0.648 0.232 0.120
#> GSM97108     3  0.4919     0.7630 0.000 0.068 0.768 0.100 0.064
#> GSM97050     2  0.2921     0.7563 0.000 0.856 0.124 0.020 0.000
#> GSM97080     3  0.6043     0.6802 0.000 0.004 0.560 0.308 0.128
#> GSM97089     3  0.2139     0.8032 0.000 0.000 0.916 0.032 0.052
#> GSM97092     3  0.6520     0.7398 0.000 0.056 0.612 0.204 0.128
#> GSM97093     2  0.1908     0.7890 0.000 0.908 0.092 0.000 0.000
#> GSM97058     2  0.4116     0.7490 0.000 0.816 0.032 0.096 0.056
#> GSM97051     2  0.4512     0.7180 0.000 0.776 0.020 0.140 0.064
#> GSM97052     3  0.6626     0.7401 0.000 0.032 0.572 0.228 0.168
#> GSM97061     3  0.4785     0.7824 0.000 0.004 0.740 0.140 0.116

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.0146     0.8455 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97145     1  0.1267     0.8009 0.940 0.000 0.000 0.000 0.060 0.000
#> GSM97147     4  0.3126     0.7305 0.000 0.248 0.000 0.752 0.000 0.000
#> GSM97125     1  0.5510     0.3136 0.560 0.000 0.000 0.000 0.192 0.248
#> GSM97127     1  0.3464     0.4109 0.688 0.000 0.000 0.000 0.312 0.000
#> GSM97130     4  0.3728     0.3371 0.004 0.000 0.000 0.652 0.000 0.344
#> GSM97133     1  0.0000     0.8479 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97134     6  0.3307     0.7782 0.000 0.000 0.000 0.148 0.044 0.808
#> GSM97120     1  0.0000     0.8479 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97126     6  0.5402     0.6660 0.152 0.012 0.008 0.180 0.000 0.648
#> GSM97112     5  0.1245     0.8369 0.032 0.000 0.000 0.000 0.952 0.016
#> GSM97115     4  0.0458     0.7963 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM97116     1  0.0000     0.8479 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97117     2  0.3938     0.4500 0.000 0.660 0.324 0.016 0.000 0.000
#> GSM97119     5  0.1225     0.8306 0.012 0.000 0.000 0.000 0.952 0.036
#> GSM97122     5  0.2730     0.7953 0.152 0.000 0.000 0.000 0.836 0.012
#> GSM97135     5  0.2491     0.7864 0.164 0.000 0.000 0.000 0.836 0.000
#> GSM97136     3  0.5347     0.0755 0.020 0.320 0.596 0.000 0.012 0.052
#> GSM97139     1  0.0000     0.8479 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000     0.8479 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97123     2  0.3543     0.1640 0.000 0.756 0.224 0.000 0.004 0.016
#> GSM97129     2  0.6603     0.1309 0.012 0.400 0.164 0.028 0.000 0.396
#> GSM97143     6  0.3593     0.7180 0.016 0.000 0.020 0.000 0.180 0.784
#> GSM97113     3  0.6671    -0.0851 0.028 0.328 0.332 0.312 0.000 0.000
#> GSM97056     1  0.4648    -0.0198 0.496 0.000 0.000 0.464 0.000 0.040
#> GSM97124     5  0.2848     0.7358 0.008 0.000 0.000 0.000 0.816 0.176
#> GSM97132     6  0.3621     0.7590 0.024 0.000 0.000 0.036 0.132 0.808
#> GSM97144     6  0.3472     0.7839 0.000 0.000 0.000 0.092 0.100 0.808
#> GSM97149     1  0.0000     0.8479 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97068     4  0.0458     0.7963 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM97071     4  0.3824     0.7499 0.000 0.164 0.016 0.780 0.000 0.040
#> GSM97086     4  0.0000     0.8007 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97103     3  0.3620     0.0647 0.000 0.352 0.648 0.000 0.000 0.000
#> GSM97057     4  0.0000     0.8007 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97060     3  0.4494     0.1407 0.000 0.400 0.572 0.000 0.016 0.012
#> GSM97075     2  0.4403     0.4444 0.000 0.648 0.304 0.048 0.000 0.000
#> GSM97098     3  0.3547     0.1066 0.000 0.332 0.668 0.000 0.000 0.000
#> GSM97099     2  0.3989     0.2819 0.000 0.528 0.468 0.004 0.000 0.000
#> GSM97101     2  0.3922     0.4506 0.000 0.664 0.320 0.016 0.000 0.000
#> GSM97105     4  0.4285     0.6430 0.000 0.320 0.036 0.644 0.000 0.000
#> GSM97106     2  0.3854    -0.0470 0.000 0.536 0.464 0.000 0.000 0.000
#> GSM97121     4  0.3802     0.6658 0.000 0.312 0.012 0.676 0.000 0.000
#> GSM97128     6  0.3424     0.7872 0.000 0.008 0.000 0.076 0.092 0.824
#> GSM97131     2  0.5156     0.3862 0.000 0.600 0.272 0.128 0.000 0.000
#> GSM97137     4  0.0458     0.7965 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM97118     6  0.3158     0.7460 0.000 0.000 0.004 0.020 0.164 0.812
#> GSM97114     2  0.5218     0.4163 0.088 0.616 0.280 0.016 0.000 0.000
#> GSM97142     5  0.2554     0.8238 0.048 0.000 0.000 0.000 0.876 0.076
#> GSM97140     4  0.3266     0.7145 0.000 0.272 0.000 0.728 0.000 0.000
#> GSM97141     2  0.3756     0.3864 0.000 0.600 0.400 0.000 0.000 0.000
#> GSM97055     5  0.5795     0.4885 0.016 0.232 0.012 0.008 0.620 0.112
#> GSM97090     4  0.0458     0.7963 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM97091     5  0.1075     0.8223 0.000 0.000 0.000 0.000 0.952 0.048
#> GSM97148     1  0.0000     0.8479 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.1075     0.8351 0.048 0.000 0.000 0.000 0.952 0.000
#> GSM97053     5  0.3684     0.4785 0.372 0.000 0.000 0.000 0.628 0.000
#> GSM97066     3  0.5961     0.2745 0.000 0.168 0.596 0.000 0.048 0.188
#> GSM97079     4  0.0508     0.7969 0.000 0.004 0.012 0.984 0.000 0.000
#> GSM97083     6  0.3094     0.7817 0.000 0.000 0.000 0.140 0.036 0.824
#> GSM97084     4  0.0000     0.8007 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97094     6  0.7762     0.2610 0.000 0.160 0.032 0.284 0.128 0.396
#> GSM97096     3  0.3515     0.1125 0.000 0.324 0.676 0.000 0.000 0.000
#> GSM97097     3  0.3659     0.0362 0.000 0.364 0.636 0.000 0.000 0.000
#> GSM97107     4  0.5092    -0.0956 0.000 0.044 0.016 0.492 0.000 0.448
#> GSM97054     4  0.0000     0.8007 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97062     4  0.0458     0.7963 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM97069     3  0.6278     0.2575 0.000 0.216 0.544 0.000 0.048 0.192
#> GSM97070     3  0.5724     0.2759 0.000 0.144 0.628 0.000 0.048 0.180
#> GSM97073     3  0.5301     0.2709 0.000 0.120 0.676 0.000 0.044 0.160
#> GSM97076     4  0.2853     0.7149 0.004 0.012 0.012 0.856 0.000 0.116
#> GSM97077     4  0.2048     0.7841 0.000 0.120 0.000 0.880 0.000 0.000
#> GSM97095     4  0.0260     0.7990 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM97102     3  0.3490     0.1372 0.000 0.268 0.724 0.000 0.000 0.008
#> GSM97109     3  0.5016     0.0504 0.092 0.324 0.584 0.000 0.000 0.000
#> GSM97110     3  0.5940    -0.0617 0.000 0.332 0.440 0.228 0.000 0.000
#> GSM97074     6  0.1148     0.7309 0.000 0.000 0.020 0.004 0.016 0.960
#> GSM97085     6  0.3962     0.5703 0.000 0.000 0.116 0.000 0.120 0.764
#> GSM97059     4  0.2854     0.7509 0.000 0.208 0.000 0.792 0.000 0.000
#> GSM97072     3  0.2669     0.3103 0.000 0.000 0.836 0.000 0.008 0.156
#> GSM97078     6  0.3198     0.7013 0.000 0.000 0.000 0.260 0.000 0.740
#> GSM97067     3  0.4354     0.3071 0.000 0.028 0.740 0.000 0.048 0.184
#> GSM97087     2  0.4388     0.0095 0.000 0.648 0.312 0.000 0.004 0.036
#> GSM97111     2  0.3852     0.4489 0.000 0.664 0.324 0.012 0.000 0.000
#> GSM97064     4  0.1531     0.7922 0.000 0.068 0.004 0.928 0.000 0.000
#> GSM97065     4  0.6675     0.2096 0.080 0.236 0.132 0.540 0.000 0.012
#> GSM97081     2  0.3996     0.2059 0.000 0.512 0.484 0.000 0.000 0.004
#> GSM97082     2  0.5162    -0.0591 0.000 0.612 0.312 0.004 0.040 0.032
#> GSM97088     6  0.1508     0.7419 0.000 0.020 0.004 0.016 0.012 0.948
#> GSM97100     4  0.3409     0.6872 0.000 0.300 0.000 0.700 0.000 0.000
#> GSM97104     3  0.3898     0.1949 0.000 0.296 0.684 0.000 0.000 0.020
#> GSM97108     2  0.4062     0.4513 0.000 0.660 0.316 0.024 0.000 0.000
#> GSM97050     4  0.2869     0.7303 0.000 0.020 0.148 0.832 0.000 0.000
#> GSM97080     3  0.6680     0.1835 0.000 0.360 0.400 0.000 0.048 0.192
#> GSM97089     3  0.4381     0.0291 0.000 0.456 0.524 0.000 0.004 0.016
#> GSM97092     2  0.1109     0.3123 0.000 0.964 0.012 0.004 0.004 0.016
#> GSM97093     4  0.1471     0.7835 0.000 0.004 0.064 0.932 0.000 0.000
#> GSM97058     4  0.3464     0.6813 0.000 0.312 0.000 0.688 0.000 0.000
#> GSM97051     4  0.3695     0.6239 0.000 0.376 0.000 0.624 0.000 0.000
#> GSM97052     2  0.3805     0.1073 0.000 0.728 0.248 0.000 0.008 0.016
#> GSM97061     2  0.3000     0.2412 0.000 0.824 0.156 0.000 0.004 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)

plot of chunk tab-MAD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-pam-membership-heatmap-5

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)

plot of chunk tab-MAD-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-MAD-pam-get-signatures-no-scale-1

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

plot of chunk tab-MAD-pam-get-signatures-no-scale-2

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

plot of chunk tab-MAD-pam-get-signatures-no-scale-3

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

plot of chunk tab-MAD-pam-get-signatures-no-scale-4

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

plot of chunk tab-MAD-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-pam-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-MAD-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-pam-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:pam 83         0.000194       0.697     4.28e-13   0.1590 2
#> MAD:pam 94         0.000647       0.278     1.32e-10   0.0607 3
#> MAD:pam 85         0.000311       0.506     1.05e-08   0.0238 4
#> MAD:pam 89         0.004272       0.663     1.34e-08   0.1969 5
#> MAD:pam 54         0.029447       0.576     6.07e-05   0.0453 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.


MAD:mclust*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "mclust"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-mclust-collect-plots

The plots are:

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:

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)

plot of chunk MAD-mclust-select-partition-number

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.538           0.906       0.905         0.4401 0.496   0.496
#> 3 3 0.669           0.846       0.890         0.3900 0.894   0.785
#> 4 4 0.908           0.905       0.945         0.2215 0.754   0.442
#> 5 5 0.692           0.678       0.849         0.0152 0.864   0.550
#> 6 6 0.745           0.752       0.840         0.0664 0.925   0.690

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1   0.000      0.976 1.000 0.000
#> GSM97145     1   0.000      0.976 1.000 0.000
#> GSM97147     1   0.204      0.966 0.968 0.032
#> GSM97125     1   0.000      0.976 1.000 0.000
#> GSM97127     1   0.000      0.976 1.000 0.000
#> GSM97130     1   0.000      0.976 1.000 0.000
#> GSM97133     1   0.000      0.976 1.000 0.000
#> GSM97134     1   0.000      0.976 1.000 0.000
#> GSM97120     1   0.000      0.976 1.000 0.000
#> GSM97126     1   0.000      0.976 1.000 0.000
#> GSM97112     1   0.000      0.976 1.000 0.000
#> GSM97115     1   0.163      0.969 0.976 0.024
#> GSM97116     1   0.000      0.976 1.000 0.000
#> GSM97117     2   0.767      0.892 0.224 0.776
#> GSM97119     1   0.000      0.976 1.000 0.000
#> GSM97122     1   0.000      0.976 1.000 0.000
#> GSM97135     1   0.000      0.976 1.000 0.000
#> GSM97136     2   0.767      0.892 0.224 0.776
#> GSM97139     1   0.000      0.976 1.000 0.000
#> GSM97146     1   0.000      0.976 1.000 0.000
#> GSM97123     2   0.714      0.890 0.196 0.804
#> GSM97129     2   0.952      0.689 0.372 0.628
#> GSM97143     1   0.000      0.976 1.000 0.000
#> GSM97113     2   0.767      0.892 0.224 0.776
#> GSM97056     1   0.000      0.976 1.000 0.000
#> GSM97124     1   0.000      0.976 1.000 0.000
#> GSM97132     1   0.000      0.976 1.000 0.000
#> GSM97144     1   0.000      0.976 1.000 0.000
#> GSM97149     1   0.000      0.976 1.000 0.000
#> GSM97068     1   0.242      0.962 0.960 0.040
#> GSM97071     1   0.242      0.962 0.960 0.040
#> GSM97086     1   0.278      0.954 0.952 0.048
#> GSM97103     2   0.753      0.892 0.216 0.784
#> GSM97057     2   0.767      0.892 0.224 0.776
#> GSM97060     2   0.615      0.877 0.152 0.848
#> GSM97075     2   0.767      0.892 0.224 0.776
#> GSM97098     2   0.706      0.889 0.192 0.808
#> GSM97099     2   0.767      0.892 0.224 0.776
#> GSM97101     2   0.767      0.892 0.224 0.776
#> GSM97105     2   0.767      0.892 0.224 0.776
#> GSM97106     2   0.689      0.887 0.184 0.816
#> GSM97121     2   0.767      0.892 0.224 0.776
#> GSM97128     1   0.242      0.962 0.960 0.040
#> GSM97131     2   0.767      0.892 0.224 0.776
#> GSM97137     1   0.000      0.976 1.000 0.000
#> GSM97118     1   0.000      0.976 1.000 0.000
#> GSM97114     2   0.767      0.892 0.224 0.776
#> GSM97142     1   0.000      0.976 1.000 0.000
#> GSM97140     2   0.814      0.864 0.252 0.748
#> GSM97141     2   0.767      0.892 0.224 0.776
#> GSM97055     1   0.000      0.976 1.000 0.000
#> GSM97090     1   0.141      0.970 0.980 0.020
#> GSM97091     1   0.000      0.976 1.000 0.000
#> GSM97148     1   0.000      0.976 1.000 0.000
#> GSM97063     1   0.000      0.976 1.000 0.000
#> GSM97053     1   0.000      0.976 1.000 0.000
#> GSM97066     2   0.000      0.795 0.000 1.000
#> GSM97079     1   0.295      0.949 0.948 0.052
#> GSM97083     1   0.000      0.976 1.000 0.000
#> GSM97084     1   0.242      0.962 0.960 0.040
#> GSM97094     1   0.242      0.962 0.960 0.040
#> GSM97096     2   0.563      0.869 0.132 0.868
#> GSM97097     1   0.662      0.754 0.828 0.172
#> GSM97107     1   0.242      0.962 0.960 0.040
#> GSM97054     1   0.242      0.962 0.960 0.040
#> GSM97062     1   0.242      0.962 0.960 0.040
#> GSM97069     2   0.000      0.795 0.000 1.000
#> GSM97070     2   0.000      0.795 0.000 1.000
#> GSM97073     2   0.000      0.795 0.000 1.000
#> GSM97076     1   0.242      0.962 0.960 0.040
#> GSM97077     2   0.992      0.521 0.448 0.552
#> GSM97095     1   0.204      0.966 0.968 0.032
#> GSM97102     2   0.000      0.795 0.000 1.000
#> GSM97109     2   0.767      0.892 0.224 0.776
#> GSM97110     2   0.767      0.892 0.224 0.776
#> GSM97074     1   0.224      0.964 0.964 0.036
#> GSM97085     1   0.260      0.958 0.956 0.044
#> GSM97059     1   0.242      0.962 0.960 0.040
#> GSM97072     2   0.343      0.831 0.064 0.936
#> GSM97078     1   0.242      0.962 0.960 0.040
#> GSM97067     2   0.000      0.795 0.000 1.000
#> GSM97087     2   0.000      0.795 0.000 1.000
#> GSM97111     2   0.767      0.892 0.224 0.776
#> GSM97064     2   0.767      0.892 0.224 0.776
#> GSM97065     2   0.767      0.892 0.224 0.776
#> GSM97081     2   0.605      0.876 0.148 0.852
#> GSM97082     2   0.000      0.795 0.000 1.000
#> GSM97088     1   0.242      0.962 0.960 0.040
#> GSM97100     2   0.998      0.443 0.476 0.524
#> GSM97104     2   0.000      0.795 0.000 1.000
#> GSM97108     2   0.767      0.892 0.224 0.776
#> GSM97050     2   0.767      0.892 0.224 0.776
#> GSM97080     2   0.000      0.795 0.000 1.000
#> GSM97089     2   0.689      0.887 0.184 0.816
#> GSM97092     2   0.574      0.871 0.136 0.864
#> GSM97093     2   0.775      0.888 0.228 0.772
#> GSM97058     2   0.767      0.892 0.224 0.776
#> GSM97051     2   0.983      0.580 0.424 0.576
#> GSM97052     2   0.574      0.871 0.136 0.864
#> GSM97061     2   0.697      0.888 0.188 0.812

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000      0.907 1.000 0.000 0.000
#> GSM97145     1  0.0237      0.908 0.996 0.004 0.000
#> GSM97147     1  0.4324      0.872 0.860 0.112 0.028
#> GSM97125     1  0.0000      0.907 1.000 0.000 0.000
#> GSM97127     1  0.0237      0.908 0.996 0.004 0.000
#> GSM97130     1  0.4748      0.889 0.832 0.024 0.144
#> GSM97133     1  0.0237      0.908 0.996 0.004 0.000
#> GSM97134     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97120     1  0.0000      0.907 1.000 0.000 0.000
#> GSM97126     1  0.1031      0.908 0.976 0.024 0.000
#> GSM97112     1  0.0237      0.907 0.996 0.000 0.004
#> GSM97115     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97116     1  0.0000      0.907 1.000 0.000 0.000
#> GSM97117     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97119     1  0.0237      0.907 0.996 0.000 0.004
#> GSM97122     1  0.0237      0.907 0.996 0.000 0.004
#> GSM97135     1  0.0237      0.907 0.996 0.000 0.004
#> GSM97136     2  0.2261      0.818 0.068 0.932 0.000
#> GSM97139     1  0.0000      0.907 1.000 0.000 0.000
#> GSM97146     1  0.0000      0.907 1.000 0.000 0.000
#> GSM97123     2  0.5363      0.436 0.000 0.724 0.276
#> GSM97129     2  0.0237      0.918 0.004 0.996 0.000
#> GSM97143     1  0.0237      0.908 0.996 0.004 0.000
#> GSM97113     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97056     1  0.3213      0.901 0.900 0.008 0.092
#> GSM97124     1  0.0237      0.908 0.996 0.004 0.000
#> GSM97132     1  0.0661      0.909 0.988 0.004 0.008
#> GSM97144     1  0.4874      0.888 0.828 0.028 0.144
#> GSM97149     1  0.0237      0.908 0.996 0.004 0.000
#> GSM97068     1  0.6721      0.837 0.748 0.116 0.136
#> GSM97071     1  0.5730      0.876 0.796 0.060 0.144
#> GSM97086     1  0.6705      0.840 0.748 0.108 0.144
#> GSM97103     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97057     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97060     3  0.5835      0.758 0.000 0.340 0.660
#> GSM97075     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97098     2  0.6260     -0.233 0.000 0.552 0.448
#> GSM97099     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97101     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97105     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97106     2  0.5948      0.154 0.000 0.640 0.360
#> GSM97121     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97128     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97131     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97137     1  0.2384      0.907 0.936 0.008 0.056
#> GSM97118     1  0.1482      0.909 0.968 0.020 0.012
#> GSM97114     2  0.0747      0.902 0.016 0.984 0.000
#> GSM97142     1  0.0237      0.907 0.996 0.000 0.004
#> GSM97140     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97141     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97055     1  0.0592      0.908 0.988 0.012 0.000
#> GSM97090     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97091     1  0.0237      0.907 0.996 0.000 0.004
#> GSM97148     1  0.0000      0.907 1.000 0.000 0.000
#> GSM97063     1  0.0237      0.907 0.996 0.000 0.004
#> GSM97053     1  0.0237      0.908 0.996 0.004 0.000
#> GSM97066     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97079     1  0.7661      0.772 0.684 0.172 0.144
#> GSM97083     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97084     1  0.6087      0.865 0.780 0.076 0.144
#> GSM97094     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97096     3  0.5882      0.749 0.000 0.348 0.652
#> GSM97097     1  0.9024      0.285 0.448 0.420 0.132
#> GSM97107     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97054     1  0.6634      0.843 0.752 0.104 0.144
#> GSM97062     1  0.6486      0.850 0.760 0.096 0.144
#> GSM97069     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97070     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97073     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97076     1  0.2959      0.880 0.900 0.100 0.000
#> GSM97077     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97095     1  0.5435      0.882 0.808 0.048 0.144
#> GSM97102     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97109     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97110     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97074     1  0.2743      0.903 0.928 0.052 0.020
#> GSM97085     1  0.3116      0.875 0.892 0.108 0.000
#> GSM97059     1  0.6462      0.843 0.764 0.120 0.116
#> GSM97072     3  0.4555      0.862 0.000 0.200 0.800
#> GSM97078     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97067     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97087     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97111     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97064     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97065     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97081     3  0.6026      0.702 0.000 0.376 0.624
#> GSM97082     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97088     1  0.5222      0.886 0.816 0.040 0.144
#> GSM97100     2  0.1129      0.895 0.004 0.976 0.020
#> GSM97104     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97108     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97050     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97080     3  0.3816      0.885 0.000 0.148 0.852
#> GSM97089     3  0.6252      0.530 0.000 0.444 0.556
#> GSM97092     3  0.5905      0.744 0.000 0.352 0.648
#> GSM97093     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97058     2  0.0000      0.923 0.000 1.000 0.000
#> GSM97051     2  0.0892      0.899 0.000 0.980 0.020
#> GSM97052     3  0.5905      0.744 0.000 0.352 0.648
#> GSM97061     2  0.6192     -0.116 0.000 0.580 0.420

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.0336     0.9675 0.992 0.000 0.000 0.008
#> GSM97145     1  0.0707     0.9654 0.980 0.000 0.000 0.020
#> GSM97147     2  0.3486     0.8518 0.044 0.864 0.000 0.092
#> GSM97125     1  0.0707     0.9692 0.980 0.000 0.000 0.020
#> GSM97127     1  0.0000     0.9667 1.000 0.000 0.000 0.000
#> GSM97130     1  0.4509     0.6099 0.708 0.004 0.000 0.288
#> GSM97133     1  0.0000     0.9667 1.000 0.000 0.000 0.000
#> GSM97134     4  0.1661     0.9302 0.052 0.004 0.000 0.944
#> GSM97120     1  0.0188     0.9661 0.996 0.000 0.000 0.004
#> GSM97126     2  0.5923     0.3562 0.376 0.580 0.000 0.044
#> GSM97112     1  0.1022     0.9682 0.968 0.000 0.000 0.032
#> GSM97115     4  0.1913     0.9345 0.040 0.020 0.000 0.940
#> GSM97116     1  0.0000     0.9667 1.000 0.000 0.000 0.000
#> GSM97117     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97119     1  0.0895     0.9688 0.976 0.004 0.000 0.020
#> GSM97122     1  0.0921     0.9690 0.972 0.000 0.000 0.028
#> GSM97135     1  0.0921     0.9690 0.972 0.000 0.000 0.028
#> GSM97136     2  0.1811     0.9018 0.028 0.948 0.004 0.020
#> GSM97139     1  0.0000     0.9667 1.000 0.000 0.000 0.000
#> GSM97146     1  0.0000     0.9667 1.000 0.000 0.000 0.000
#> GSM97123     3  0.1716     0.9359 0.000 0.064 0.936 0.000
#> GSM97129     2  0.0707     0.9256 0.000 0.980 0.000 0.020
#> GSM97143     1  0.0895     0.9688 0.976 0.004 0.000 0.020
#> GSM97113     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97056     1  0.0895     0.9688 0.976 0.004 0.000 0.020
#> GSM97124     1  0.0895     0.9688 0.976 0.004 0.000 0.020
#> GSM97132     1  0.1209     0.9627 0.964 0.004 0.000 0.032
#> GSM97144     4  0.1661     0.9302 0.052 0.004 0.000 0.944
#> GSM97149     1  0.0188     0.9661 0.996 0.000 0.000 0.004
#> GSM97068     4  0.5168    -0.0323 0.004 0.496 0.000 0.500
#> GSM97071     4  0.1724     0.9344 0.032 0.020 0.000 0.948
#> GSM97086     4  0.1022     0.9183 0.000 0.032 0.000 0.968
#> GSM97103     3  0.2342     0.9222 0.000 0.080 0.912 0.008
#> GSM97057     2  0.0336     0.9295 0.000 0.992 0.000 0.008
#> GSM97060     3  0.0817     0.9508 0.000 0.024 0.976 0.000
#> GSM97075     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97098     3  0.1637     0.9383 0.000 0.060 0.940 0.000
#> GSM97099     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97101     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97105     2  0.2739     0.8822 0.000 0.904 0.060 0.036
#> GSM97106     3  0.1557     0.9403 0.000 0.056 0.944 0.000
#> GSM97121     2  0.0336     0.9295 0.000 0.992 0.000 0.008
#> GSM97128     4  0.1305     0.9360 0.036 0.004 0.000 0.960
#> GSM97131     3  0.3176     0.9016 0.000 0.084 0.880 0.036
#> GSM97137     1  0.0895     0.9688 0.976 0.004 0.000 0.020
#> GSM97118     1  0.3751     0.7745 0.800 0.004 0.000 0.196
#> GSM97114     2  0.0188     0.9289 0.004 0.996 0.000 0.000
#> GSM97142     1  0.1022     0.9682 0.968 0.000 0.000 0.032
#> GSM97140     2  0.0336     0.9295 0.000 0.992 0.000 0.008
#> GSM97141     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97055     1  0.1398     0.9584 0.956 0.004 0.000 0.040
#> GSM97090     4  0.1489     0.9338 0.044 0.004 0.000 0.952
#> GSM97091     1  0.1022     0.9682 0.968 0.000 0.000 0.032
#> GSM97148     1  0.0000     0.9667 1.000 0.000 0.000 0.000
#> GSM97063     1  0.1022     0.9682 0.968 0.000 0.000 0.032
#> GSM97053     1  0.0895     0.9688 0.976 0.004 0.000 0.020
#> GSM97066     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97079     4  0.1557     0.9060 0.000 0.056 0.000 0.944
#> GSM97083     4  0.1661     0.9302 0.052 0.004 0.000 0.944
#> GSM97084     4  0.1022     0.9183 0.000 0.032 0.000 0.968
#> GSM97094     4  0.1305     0.9360 0.036 0.004 0.000 0.960
#> GSM97096     3  0.0707     0.9511 0.000 0.020 0.980 0.000
#> GSM97097     4  0.4875     0.7307 0.000 0.068 0.160 0.772
#> GSM97107     4  0.1398     0.9352 0.040 0.004 0.000 0.956
#> GSM97054     4  0.1022     0.9183 0.000 0.032 0.000 0.968
#> GSM97062     4  0.1022     0.9183 0.000 0.032 0.000 0.968
#> GSM97069     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97070     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97073     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97076     2  0.3764     0.8290 0.040 0.844 0.000 0.116
#> GSM97077     2  0.2011     0.8886 0.000 0.920 0.000 0.080
#> GSM97095     4  0.1929     0.9331 0.036 0.024 0.000 0.940
#> GSM97102     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97109     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97110     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97074     4  0.1492     0.9355 0.036 0.004 0.004 0.956
#> GSM97085     3  0.4232     0.7974 0.036 0.004 0.816 0.144
#> GSM97059     2  0.3659     0.8206 0.024 0.840 0.000 0.136
#> GSM97072     3  0.0592     0.9511 0.000 0.016 0.984 0.000
#> GSM97078     4  0.1305     0.9360 0.036 0.004 0.000 0.960
#> GSM97067     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97087     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97111     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97064     3  0.3450     0.8507 0.000 0.156 0.836 0.008
#> GSM97065     2  0.0000     0.9299 0.000 1.000 0.000 0.000
#> GSM97081     3  0.0817     0.9506 0.000 0.024 0.976 0.000
#> GSM97082     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97088     4  0.1305     0.9360 0.036 0.004 0.000 0.960
#> GSM97100     2  0.2469     0.8663 0.000 0.892 0.000 0.108
#> GSM97104     3  0.0000     0.9489 0.000 0.000 1.000 0.000
#> GSM97108     2  0.0336     0.9295 0.000 0.992 0.000 0.008
#> GSM97050     2  0.1557     0.9056 0.000 0.944 0.000 0.056
#> GSM97080     3  0.0188     0.9497 0.000 0.004 0.996 0.000
#> GSM97089     3  0.3401     0.8495 0.000 0.152 0.840 0.008
#> GSM97092     3  0.0707     0.9511 0.000 0.020 0.980 0.000
#> GSM97093     2  0.0336     0.9295 0.000 0.992 0.000 0.008
#> GSM97058     2  0.5085     0.3477 0.000 0.616 0.376 0.008
#> GSM97051     3  0.4700     0.8134 0.000 0.084 0.792 0.124
#> GSM97052     3  0.0817     0.9508 0.000 0.024 0.976 0.000
#> GSM97061     3  0.1557     0.9403 0.000 0.056 0.944 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.2984     0.9038 0.860 0.000 0.000 0.032 0.108
#> GSM97145     1  0.1768     0.9836 0.924 0.000 0.000 0.004 0.072
#> GSM97147     2  0.4009     0.4605 0.004 0.684 0.000 0.312 0.000
#> GSM97125     5  0.5670     0.2396 0.388 0.000 0.000 0.084 0.528
#> GSM97127     1  0.1608     0.9868 0.928 0.000 0.000 0.000 0.072
#> GSM97130     4  0.3395     0.5250 0.000 0.000 0.000 0.764 0.236
#> GSM97133     1  0.1608     0.9868 0.928 0.000 0.000 0.000 0.072
#> GSM97134     4  0.0290     0.7890 0.000 0.000 0.000 0.992 0.008
#> GSM97120     1  0.1608     0.9868 0.928 0.000 0.000 0.000 0.072
#> GSM97126     2  0.5447     0.2267 0.008 0.560 0.000 0.384 0.048
#> GSM97112     5  0.1410     0.7274 0.000 0.000 0.000 0.060 0.940
#> GSM97115     4  0.0566     0.7922 0.004 0.012 0.000 0.984 0.000
#> GSM97116     1  0.2069     0.9730 0.912 0.000 0.000 0.012 0.076
#> GSM97117     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97119     5  0.3395     0.7102 0.000 0.000 0.000 0.236 0.764
#> GSM97122     5  0.1410     0.7274 0.000 0.000 0.000 0.060 0.940
#> GSM97135     5  0.1410     0.7274 0.000 0.000 0.000 0.060 0.940
#> GSM97136     2  0.4141     0.6043 0.000 0.736 0.028 0.236 0.000
#> GSM97139     1  0.1608     0.9868 0.928 0.000 0.000 0.000 0.072
#> GSM97146     1  0.1608     0.9868 0.928 0.000 0.000 0.000 0.072
#> GSM97123     2  0.4227     0.0801 0.000 0.580 0.420 0.000 0.000
#> GSM97129     2  0.1908     0.7561 0.000 0.908 0.000 0.092 0.000
#> GSM97143     5  0.3949     0.6382 0.000 0.000 0.000 0.332 0.668
#> GSM97113     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97056     4  0.4583     0.3657 0.032 0.000 0.000 0.672 0.296
#> GSM97124     5  0.4182     0.5404 0.000 0.000 0.000 0.400 0.600
#> GSM97132     4  0.4045     0.2505 0.000 0.000 0.000 0.644 0.356
#> GSM97144     4  0.0000     0.7921 0.000 0.000 0.000 1.000 0.000
#> GSM97149     1  0.1608     0.9868 0.928 0.000 0.000 0.000 0.072
#> GSM97068     4  0.4298     0.4884 0.008 0.352 0.000 0.640 0.000
#> GSM97071     4  0.1082     0.7893 0.028 0.008 0.000 0.964 0.000
#> GSM97086     4  0.3561     0.7531 0.068 0.028 0.000 0.852 0.052
#> GSM97103     2  0.4937     0.0154 0.000 0.544 0.428 0.028 0.000
#> GSM97057     2  0.0162     0.8176 0.004 0.996 0.000 0.000 0.000
#> GSM97060     3  0.5535     0.5114 0.000 0.108 0.620 0.272 0.000
#> GSM97075     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97098     2  0.4242     0.0588 0.000 0.572 0.428 0.000 0.000
#> GSM97099     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97101     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97105     2  0.0451     0.8149 0.004 0.988 0.000 0.008 0.000
#> GSM97106     3  0.6417     0.4037 0.000 0.280 0.504 0.216 0.000
#> GSM97121     2  0.0162     0.8176 0.004 0.996 0.000 0.000 0.000
#> GSM97128     4  0.0000     0.7921 0.000 0.000 0.000 1.000 0.000
#> GSM97131     2  0.7079     0.0415 0.016 0.432 0.276 0.276 0.000
#> GSM97137     4  0.4583     0.3657 0.032 0.000 0.000 0.672 0.296
#> GSM97118     5  0.4268     0.4767 0.000 0.000 0.000 0.444 0.556
#> GSM97114     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97142     5  0.1410     0.7274 0.000 0.000 0.000 0.060 0.940
#> GSM97140     2  0.0162     0.8176 0.004 0.996 0.000 0.000 0.000
#> GSM97141     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97055     5  0.4074     0.6027 0.000 0.000 0.000 0.364 0.636
#> GSM97090     4  0.0162     0.7920 0.004 0.000 0.000 0.996 0.000
#> GSM97091     5  0.1410     0.7274 0.000 0.000 0.000 0.060 0.940
#> GSM97148     1  0.1608     0.9868 0.928 0.000 0.000 0.000 0.072
#> GSM97063     5  0.1410     0.7274 0.000 0.000 0.000 0.060 0.940
#> GSM97053     5  0.4300     0.3431 0.000 0.000 0.000 0.476 0.524
#> GSM97066     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97079     4  0.3918     0.7308 0.068 0.080 0.000 0.828 0.024
#> GSM97083     4  0.0000     0.7921 0.000 0.000 0.000 1.000 0.000
#> GSM97084     4  0.3383     0.7563 0.068 0.020 0.000 0.860 0.052
#> GSM97094     4  0.0000     0.7921 0.000 0.000 0.000 1.000 0.000
#> GSM97096     3  0.3932     0.5537 0.000 0.328 0.672 0.000 0.000
#> GSM97097     4  0.4955     0.6641 0.072 0.136 0.008 0.760 0.024
#> GSM97107     4  0.0000     0.7921 0.000 0.000 0.000 1.000 0.000
#> GSM97054     4  0.3474     0.7552 0.068 0.024 0.000 0.856 0.052
#> GSM97062     4  0.3474     0.7552 0.068 0.024 0.000 0.856 0.052
#> GSM97069     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97070     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97073     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97076     2  0.4482     0.3139 0.000 0.612 0.000 0.376 0.012
#> GSM97077     2  0.0162     0.8176 0.004 0.996 0.000 0.000 0.000
#> GSM97095     4  0.0703     0.7891 0.000 0.024 0.000 0.976 0.000
#> GSM97102     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97109     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97110     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97074     4  0.1043     0.7700 0.000 0.000 0.000 0.960 0.040
#> GSM97085     4  0.3816     0.4866 0.000 0.000 0.304 0.696 0.000
#> GSM97059     4  0.4420     0.2711 0.004 0.448 0.000 0.548 0.000
#> GSM97072     3  0.0880     0.7962 0.000 0.032 0.968 0.000 0.000
#> GSM97078     4  0.0000     0.7921 0.000 0.000 0.000 1.000 0.000
#> GSM97067     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97087     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97111     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97064     2  0.3928     0.4035 0.004 0.700 0.296 0.000 0.000
#> GSM97065     2  0.0290     0.8185 0.000 0.992 0.000 0.000 0.008
#> GSM97081     3  0.4242     0.3400 0.000 0.428 0.572 0.000 0.000
#> GSM97082     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97088     4  0.0000     0.7921 0.000 0.000 0.000 1.000 0.000
#> GSM97100     2  0.4206     0.5149 0.020 0.708 0.000 0.272 0.000
#> GSM97104     3  0.0000     0.8007 0.000 0.000 1.000 0.000 0.000
#> GSM97108     2  0.0162     0.8176 0.004 0.996 0.000 0.000 0.000
#> GSM97050     2  0.0162     0.8176 0.004 0.996 0.000 0.000 0.000
#> GSM97080     3  0.0290     0.8002 0.000 0.008 0.992 0.000 0.000
#> GSM97089     3  0.3421     0.7043 0.000 0.204 0.788 0.008 0.000
#> GSM97092     3  0.3534     0.6544 0.000 0.256 0.744 0.000 0.000
#> GSM97093     2  0.0324     0.8166 0.004 0.992 0.000 0.004 0.000
#> GSM97058     2  0.2583     0.6902 0.004 0.864 0.132 0.000 0.000
#> GSM97051     4  0.7683     0.2701 0.072 0.260 0.196 0.468 0.004
#> GSM97052     3  0.3730     0.6155 0.000 0.288 0.712 0.000 0.000
#> GSM97061     3  0.4306     0.1611 0.000 0.492 0.508 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.1492      0.897 0.940 0.000 0.000 0.000 0.036 0.024
#> GSM97145     1  0.0146      0.947 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM97147     2  0.4513      0.709 0.000 0.704 0.000 0.172 0.000 0.124
#> GSM97125     1  0.4687      0.386 0.632 0.000 0.000 0.000 0.296 0.072
#> GSM97127     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97130     6  0.2129      0.807 0.000 0.000 0.000 0.056 0.040 0.904
#> GSM97133     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97134     6  0.1204      0.817 0.000 0.000 0.000 0.056 0.000 0.944
#> GSM97120     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97126     2  0.5617      0.465 0.036 0.628 0.000 0.000 0.140 0.196
#> GSM97112     5  0.1007      0.827 0.000 0.000 0.000 0.000 0.956 0.044
#> GSM97115     6  0.2340      0.741 0.000 0.000 0.000 0.148 0.000 0.852
#> GSM97116     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97117     2  0.0363      0.784 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM97119     5  0.2491      0.805 0.000 0.000 0.000 0.000 0.836 0.164
#> GSM97122     5  0.1007      0.827 0.000 0.000 0.000 0.000 0.956 0.044
#> GSM97135     5  0.1007      0.827 0.000 0.000 0.000 0.000 0.956 0.044
#> GSM97136     2  0.3620      0.637 0.000 0.772 0.044 0.000 0.000 0.184
#> GSM97139     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97123     2  0.6053      0.425 0.000 0.488 0.304 0.196 0.012 0.000
#> GSM97129     2  0.3552      0.744 0.000 0.800 0.000 0.084 0.000 0.116
#> GSM97143     5  0.2664      0.794 0.000 0.000 0.000 0.000 0.816 0.184
#> GSM97113     2  0.0000      0.787 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97056     6  0.4858      0.566 0.180 0.000 0.000 0.000 0.156 0.664
#> GSM97124     5  0.3952      0.629 0.020 0.000 0.000 0.000 0.672 0.308
#> GSM97132     6  0.3221      0.554 0.000 0.000 0.000 0.000 0.264 0.736
#> GSM97144     6  0.1204      0.817 0.000 0.000 0.000 0.056 0.000 0.944
#> GSM97149     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97068     4  0.5160      0.251 0.000 0.320 0.000 0.572 0.000 0.108
#> GSM97071     6  0.0865      0.812 0.000 0.000 0.000 0.036 0.000 0.964
#> GSM97086     4  0.3076      0.720 0.000 0.000 0.000 0.760 0.000 0.240
#> GSM97103     2  0.5908      0.506 0.000 0.520 0.256 0.216 0.000 0.008
#> GSM97057     2  0.3320      0.769 0.000 0.772 0.000 0.212 0.000 0.016
#> GSM97060     3  0.3414      0.841 0.000 0.004 0.844 0.036 0.044 0.072
#> GSM97075     2  0.0458      0.786 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM97098     2  0.4546      0.505 0.000 0.660 0.288 0.040 0.012 0.000
#> GSM97099     2  0.0260      0.789 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM97101     2  0.0458      0.789 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM97105     2  0.3758      0.732 0.000 0.700 0.000 0.284 0.000 0.016
#> GSM97106     3  0.4367      0.771 0.000 0.044 0.752 0.160 0.044 0.000
#> GSM97121     2  0.2562      0.780 0.000 0.828 0.000 0.172 0.000 0.000
#> GSM97128     6  0.0146      0.813 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM97131     4  0.3090      0.603 0.000 0.140 0.004 0.828 0.000 0.028
#> GSM97137     6  0.5224      0.488 0.228 0.000 0.000 0.000 0.164 0.608
#> GSM97118     5  0.3409      0.668 0.000 0.000 0.000 0.000 0.700 0.300
#> GSM97114     2  0.0000      0.787 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97142     5  0.1007      0.827 0.000 0.000 0.000 0.000 0.956 0.044
#> GSM97140     2  0.3323      0.760 0.000 0.752 0.000 0.240 0.000 0.008
#> GSM97141     2  0.0000      0.787 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97055     5  0.2664      0.794 0.000 0.000 0.000 0.000 0.816 0.184
#> GSM97090     6  0.1267      0.816 0.000 0.000 0.000 0.060 0.000 0.940
#> GSM97091     5  0.1007      0.827 0.000 0.000 0.000 0.000 0.956 0.044
#> GSM97148     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.1007      0.827 0.000 0.000 0.000 0.000 0.956 0.044
#> GSM97053     5  0.3614      0.752 0.028 0.000 0.000 0.000 0.752 0.220
#> GSM97066     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97079     4  0.3342      0.729 0.000 0.012 0.000 0.760 0.000 0.228
#> GSM97083     6  0.0146      0.813 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM97084     4  0.3351      0.657 0.000 0.000 0.000 0.712 0.000 0.288
#> GSM97094     6  0.1204      0.817 0.000 0.000 0.000 0.056 0.000 0.944
#> GSM97096     3  0.2252      0.884 0.000 0.020 0.908 0.044 0.028 0.000
#> GSM97097     4  0.3287      0.729 0.000 0.012 0.000 0.768 0.000 0.220
#> GSM97107     6  0.1204      0.817 0.000 0.000 0.000 0.056 0.000 0.944
#> GSM97054     4  0.3221      0.700 0.000 0.000 0.000 0.736 0.000 0.264
#> GSM97062     4  0.3266      0.689 0.000 0.000 0.000 0.728 0.000 0.272
#> GSM97069     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97070     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97073     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97076     5  0.5965      0.338 0.000 0.352 0.000 0.004 0.448 0.196
#> GSM97077     2  0.3734      0.743 0.000 0.716 0.000 0.264 0.000 0.020
#> GSM97095     6  0.3247      0.704 0.000 0.036 0.000 0.156 0.000 0.808
#> GSM97102     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97109     2  0.0000      0.787 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97110     2  0.0146      0.786 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM97074     6  0.4879     -0.192 0.000 0.000 0.048 0.004 0.448 0.500
#> GSM97085     3  0.3636      0.522 0.000 0.000 0.676 0.004 0.000 0.320
#> GSM97059     2  0.4871      0.653 0.000 0.652 0.000 0.224 0.000 0.124
#> GSM97072     3  0.1480      0.892 0.000 0.000 0.940 0.020 0.040 0.000
#> GSM97078     6  0.0146      0.813 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM97067     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97087     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97111     2  0.0363      0.784 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM97064     2  0.4389      0.706 0.000 0.660 0.052 0.288 0.000 0.000
#> GSM97065     2  0.0363      0.784 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM97081     3  0.3748      0.737 0.000 0.212 0.756 0.020 0.012 0.000
#> GSM97082     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97088     6  0.2482      0.662 0.000 0.000 0.148 0.004 0.000 0.848
#> GSM97100     4  0.3744      0.577 0.000 0.184 0.000 0.764 0.000 0.052
#> GSM97104     3  0.0000      0.903 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97108     2  0.3101      0.761 0.000 0.756 0.000 0.244 0.000 0.000
#> GSM97050     2  0.3608      0.743 0.000 0.716 0.000 0.272 0.000 0.012
#> GSM97080     3  0.0146      0.903 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM97089     3  0.2030      0.882 0.000 0.036 0.924 0.016 0.008 0.016
#> GSM97092     3  0.2889      0.862 0.000 0.004 0.856 0.096 0.044 0.000
#> GSM97093     2  0.3348      0.769 0.000 0.768 0.000 0.216 0.000 0.016
#> GSM97058     2  0.3767      0.740 0.000 0.708 0.004 0.276 0.000 0.012
#> GSM97051     4  0.3006      0.687 0.000 0.092 0.000 0.844 0.000 0.064
#> GSM97052     3  0.2984      0.856 0.000 0.004 0.848 0.104 0.044 0.000
#> GSM97061     3  0.5815      0.538 0.000 0.208 0.608 0.140 0.044 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)

plot of chunk tab-MAD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-membership-heatmap-5

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)

plot of chunk tab-MAD-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-MAD-mclust-get-signatures-no-scale-1

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

plot of chunk tab-MAD-mclust-get-signatures-no-scale-2

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

plot of chunk tab-MAD-mclust-get-signatures-no-scale-3

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

plot of chunk tab-MAD-mclust-get-signatures-no-scale-4

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

plot of chunk tab-MAD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-mclust-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-MAD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-mclust-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:mclust 99         2.75e-02      0.4512     1.16e-11    0.441 2
#> MAD:mclust 95         1.29e-03      0.0433     2.87e-10    0.161 3
#> MAD:mclust 97         1.01e-04      0.6347     2.67e-16    0.275 4
#> MAD:mclust 79         1.15e-04      0.2310     5.81e-12    0.150 5
#> MAD:mclust 93         3.34e-05      0.2292     3.99e-11    0.266 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.


MAD:NMF*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "NMF"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-NMF-collect-plots

The plots are:

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:

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)

plot of chunk MAD-NMF-select-partition-number

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.944       0.975         0.4983 0.502   0.502
#> 3 3 0.449           0.504       0.714         0.3127 0.727   0.510
#> 4 4 0.564           0.536       0.742         0.1290 0.671   0.300
#> 5 5 0.538           0.399       0.675         0.0745 0.836   0.484
#> 6 6 0.595           0.458       0.646         0.0467 0.844   0.401

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.978 1.000 0.000
#> GSM97145     1  0.0000      0.978 1.000 0.000
#> GSM97147     1  0.0000      0.978 1.000 0.000
#> GSM97125     1  0.0000      0.978 1.000 0.000
#> GSM97127     1  0.0000      0.978 1.000 0.000
#> GSM97130     1  0.0000      0.978 1.000 0.000
#> GSM97133     1  0.0000      0.978 1.000 0.000
#> GSM97134     1  0.0000      0.978 1.000 0.000
#> GSM97120     1  0.0000      0.978 1.000 0.000
#> GSM97126     1  0.0000      0.978 1.000 0.000
#> GSM97112     1  0.0000      0.978 1.000 0.000
#> GSM97115     1  0.0000      0.978 1.000 0.000
#> GSM97116     1  0.0000      0.978 1.000 0.000
#> GSM97117     2  0.0000      0.971 0.000 1.000
#> GSM97119     1  0.0000      0.978 1.000 0.000
#> GSM97122     1  0.0000      0.978 1.000 0.000
#> GSM97135     1  0.0000      0.978 1.000 0.000
#> GSM97136     2  0.5842      0.830 0.140 0.860
#> GSM97139     1  0.0000      0.978 1.000 0.000
#> GSM97146     1  0.0000      0.978 1.000 0.000
#> GSM97123     2  0.0000      0.971 0.000 1.000
#> GSM97129     2  0.9393      0.457 0.356 0.644
#> GSM97143     1  0.0000      0.978 1.000 0.000
#> GSM97113     2  0.2948      0.926 0.052 0.948
#> GSM97056     1  0.0000      0.978 1.000 0.000
#> GSM97124     1  0.0000      0.978 1.000 0.000
#> GSM97132     1  0.0000      0.978 1.000 0.000
#> GSM97144     1  0.0000      0.978 1.000 0.000
#> GSM97149     1  0.0000      0.978 1.000 0.000
#> GSM97068     1  0.7376      0.740 0.792 0.208
#> GSM97071     2  0.0000      0.971 0.000 1.000
#> GSM97086     2  0.0000      0.971 0.000 1.000
#> GSM97103     2  0.0000      0.971 0.000 1.000
#> GSM97057     2  0.8499      0.631 0.276 0.724
#> GSM97060     2  0.0000      0.971 0.000 1.000
#> GSM97075     2  0.0000      0.971 0.000 1.000
#> GSM97098     2  0.0000      0.971 0.000 1.000
#> GSM97099     2  0.0000      0.971 0.000 1.000
#> GSM97101     2  0.0000      0.971 0.000 1.000
#> GSM97105     2  0.0000      0.971 0.000 1.000
#> GSM97106     2  0.0000      0.971 0.000 1.000
#> GSM97121     2  0.0000      0.971 0.000 1.000
#> GSM97128     1  0.6801      0.783 0.820 0.180
#> GSM97131     2  0.0000      0.971 0.000 1.000
#> GSM97137     1  0.0000      0.978 1.000 0.000
#> GSM97118     1  0.0000      0.978 1.000 0.000
#> GSM97114     1  0.2043      0.951 0.968 0.032
#> GSM97142     1  0.0000      0.978 1.000 0.000
#> GSM97140     2  0.8713      0.600 0.292 0.708
#> GSM97141     2  0.0000      0.971 0.000 1.000
#> GSM97055     1  0.0000      0.978 1.000 0.000
#> GSM97090     1  0.0000      0.978 1.000 0.000
#> GSM97091     1  0.0000      0.978 1.000 0.000
#> GSM97148     1  0.0000      0.978 1.000 0.000
#> GSM97063     1  0.0000      0.978 1.000 0.000
#> GSM97053     1  0.0000      0.978 1.000 0.000
#> GSM97066     2  0.0000      0.971 0.000 1.000
#> GSM97079     2  0.0000      0.971 0.000 1.000
#> GSM97083     1  0.0000      0.978 1.000 0.000
#> GSM97084     2  0.0672      0.965 0.008 0.992
#> GSM97094     1  0.0000      0.978 1.000 0.000
#> GSM97096     2  0.0000      0.971 0.000 1.000
#> GSM97097     2  0.0000      0.971 0.000 1.000
#> GSM97107     1  0.0000      0.978 1.000 0.000
#> GSM97054     2  0.0376      0.968 0.004 0.996
#> GSM97062     2  0.0000      0.971 0.000 1.000
#> GSM97069     2  0.0000      0.971 0.000 1.000
#> GSM97070     2  0.0000      0.971 0.000 1.000
#> GSM97073     2  0.0000      0.971 0.000 1.000
#> GSM97076     1  0.0938      0.969 0.988 0.012
#> GSM97077     2  0.0000      0.971 0.000 1.000
#> GSM97095     1  0.0672      0.972 0.992 0.008
#> GSM97102     2  0.0000      0.971 0.000 1.000
#> GSM97109     2  0.9393      0.463 0.356 0.644
#> GSM97110     2  0.0000      0.971 0.000 1.000
#> GSM97074     1  0.7376      0.741 0.792 0.208
#> GSM97085     2  0.0000      0.971 0.000 1.000
#> GSM97059     1  0.0000      0.978 1.000 0.000
#> GSM97072     2  0.0000      0.971 0.000 1.000
#> GSM97078     1  0.8081      0.675 0.752 0.248
#> GSM97067     2  0.0000      0.971 0.000 1.000
#> GSM97087     2  0.0000      0.971 0.000 1.000
#> GSM97111     2  0.0000      0.971 0.000 1.000
#> GSM97064     2  0.0000      0.971 0.000 1.000
#> GSM97065     2  0.0000      0.971 0.000 1.000
#> GSM97081     2  0.0000      0.971 0.000 1.000
#> GSM97082     2  0.0000      0.971 0.000 1.000
#> GSM97088     2  0.0000      0.971 0.000 1.000
#> GSM97100     2  0.0000      0.971 0.000 1.000
#> GSM97104     2  0.0000      0.971 0.000 1.000
#> GSM97108     2  0.0000      0.971 0.000 1.000
#> GSM97050     2  0.0000      0.971 0.000 1.000
#> GSM97080     2  0.0000      0.971 0.000 1.000
#> GSM97089     2  0.0000      0.971 0.000 1.000
#> GSM97092     2  0.0000      0.971 0.000 1.000
#> GSM97093     2  0.3879      0.903 0.076 0.924
#> GSM97058     2  0.0000      0.971 0.000 1.000
#> GSM97051     2  0.0000      0.971 0.000 1.000
#> GSM97052     2  0.0000      0.971 0.000 1.000
#> GSM97061     2  0.0000      0.971 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.2711     0.7651 0.912 0.088 0.000
#> GSM97145     1  0.4504     0.7433 0.804 0.196 0.000
#> GSM97147     2  0.6235    -0.1587 0.436 0.564 0.000
#> GSM97125     1  0.2537     0.7649 0.920 0.080 0.000
#> GSM97127     1  0.4974     0.7202 0.764 0.236 0.000
#> GSM97130     1  0.5678     0.6518 0.684 0.316 0.000
#> GSM97133     1  0.5733     0.6424 0.676 0.324 0.000
#> GSM97134     1  0.4413     0.7568 0.832 0.160 0.008
#> GSM97120     1  0.4605     0.7394 0.796 0.204 0.000
#> GSM97126     1  0.3116     0.7641 0.892 0.108 0.000
#> GSM97112     1  0.4974     0.6057 0.764 0.000 0.236
#> GSM97115     2  0.6215    -0.1321 0.428 0.572 0.000
#> GSM97116     1  0.3619     0.7608 0.864 0.136 0.000
#> GSM97117     2  0.6095     0.2212 0.000 0.608 0.392
#> GSM97119     1  0.2448     0.7213 0.924 0.000 0.076
#> GSM97122     1  0.2711     0.7154 0.912 0.000 0.088
#> GSM97135     1  0.2261     0.7247 0.932 0.000 0.068
#> GSM97136     3  0.5016     0.3989 0.240 0.000 0.760
#> GSM97139     1  0.4346     0.7478 0.816 0.184 0.000
#> GSM97146     1  0.4002     0.7552 0.840 0.160 0.000
#> GSM97123     2  0.5905     0.3234 0.000 0.648 0.352
#> GSM97129     2  0.8396     0.4837 0.196 0.624 0.180
#> GSM97143     1  0.3116     0.7037 0.892 0.000 0.108
#> GSM97113     2  0.0747     0.6233 0.016 0.984 0.000
#> GSM97056     1  0.5465     0.6804 0.712 0.288 0.000
#> GSM97124     1  0.1453     0.7578 0.968 0.024 0.008
#> GSM97132     1  0.1711     0.7594 0.960 0.032 0.008
#> GSM97144     1  0.5254     0.6991 0.736 0.264 0.000
#> GSM97149     1  0.5905     0.6047 0.648 0.352 0.000
#> GSM97068     2  0.5327     0.3161 0.272 0.728 0.000
#> GSM97071     3  0.6045     0.4353 0.000 0.380 0.620
#> GSM97086     2  0.1753     0.6218 0.000 0.952 0.048
#> GSM97103     2  0.6267     0.0303 0.000 0.548 0.452
#> GSM97057     2  0.4062     0.5158 0.164 0.836 0.000
#> GSM97060     3  0.6140     0.3969 0.000 0.404 0.596
#> GSM97075     2  0.6291    -0.0402 0.000 0.532 0.468
#> GSM97098     2  0.6299    -0.0711 0.000 0.524 0.476
#> GSM97099     2  0.5431     0.4536 0.000 0.716 0.284
#> GSM97101     2  0.1182     0.6251 0.012 0.976 0.012
#> GSM97105     2  0.3340     0.6005 0.000 0.880 0.120
#> GSM97106     2  0.6215     0.1168 0.000 0.572 0.428
#> GSM97121     2  0.1267     0.6227 0.024 0.972 0.004
#> GSM97128     3  0.5810     0.2262 0.336 0.000 0.664
#> GSM97131     2  0.4887     0.5247 0.000 0.772 0.228
#> GSM97137     1  0.5621     0.6605 0.692 0.308 0.000
#> GSM97118     1  0.4931     0.6087 0.768 0.000 0.232
#> GSM97114     2  0.6008     0.0513 0.372 0.628 0.000
#> GSM97142     1  0.4346     0.6509 0.816 0.000 0.184
#> GSM97140     2  0.4555     0.4601 0.200 0.800 0.000
#> GSM97141     2  0.1620     0.6243 0.024 0.964 0.012
#> GSM97055     1  0.6235     0.3140 0.564 0.000 0.436
#> GSM97090     1  0.6309     0.3030 0.500 0.500 0.000
#> GSM97091     1  0.6062     0.4105 0.616 0.000 0.384
#> GSM97148     1  0.5291     0.6975 0.732 0.268 0.000
#> GSM97063     1  0.5810     0.4867 0.664 0.000 0.336
#> GSM97053     1  0.1950     0.7606 0.952 0.040 0.008
#> GSM97066     3  0.2066     0.6290 0.000 0.060 0.940
#> GSM97079     2  0.4235     0.5682 0.000 0.824 0.176
#> GSM97083     1  0.5621     0.5239 0.692 0.000 0.308
#> GSM97084     2  0.1964     0.6081 0.056 0.944 0.000
#> GSM97094     1  0.4589     0.7429 0.820 0.172 0.008
#> GSM97096     3  0.6168     0.3808 0.000 0.412 0.588
#> GSM97097     2  0.5254     0.4837 0.000 0.736 0.264
#> GSM97107     1  0.6345     0.5049 0.596 0.400 0.004
#> GSM97054     2  0.1643     0.6136 0.044 0.956 0.000
#> GSM97062     2  0.2356     0.6172 0.000 0.928 0.072
#> GSM97069     3  0.3412     0.6453 0.000 0.124 0.876
#> GSM97070     3  0.4605     0.6276 0.000 0.204 0.796
#> GSM97073     3  0.4291     0.6360 0.000 0.180 0.820
#> GSM97076     1  0.5956     0.4995 0.672 0.004 0.324
#> GSM97077     2  0.3267     0.6035 0.000 0.884 0.116
#> GSM97095     2  0.6286    -0.2380 0.464 0.536 0.000
#> GSM97102     3  0.2959     0.6423 0.000 0.100 0.900
#> GSM97109     2  0.3816     0.5412 0.148 0.852 0.000
#> GSM97110     2  0.4555     0.5510 0.000 0.800 0.200
#> GSM97074     3  0.5560     0.2993 0.300 0.000 0.700
#> GSM97085     3  0.4750     0.4342 0.216 0.000 0.784
#> GSM97059     2  0.6062     0.0113 0.384 0.616 0.000
#> GSM97072     3  0.5926     0.4804 0.000 0.356 0.644
#> GSM97078     3  0.5905     0.1892 0.352 0.000 0.648
#> GSM97067     3  0.2356     0.6340 0.000 0.072 0.928
#> GSM97087     3  0.4931     0.6128 0.000 0.232 0.768
#> GSM97111     2  0.5529     0.4355 0.000 0.704 0.296
#> GSM97064     2  0.5591     0.4203 0.000 0.696 0.304
#> GSM97065     3  0.6307     0.1603 0.000 0.488 0.512
#> GSM97081     3  0.5882     0.4918 0.000 0.348 0.652
#> GSM97082     3  0.3619     0.6448 0.000 0.136 0.864
#> GSM97088     3  0.4796     0.4288 0.220 0.000 0.780
#> GSM97100     2  0.0892     0.6225 0.020 0.980 0.000
#> GSM97104     3  0.3192     0.6444 0.000 0.112 0.888
#> GSM97108     2  0.0983     0.6251 0.004 0.980 0.016
#> GSM97050     2  0.4002     0.5799 0.000 0.840 0.160
#> GSM97080     3  0.5098     0.6019 0.000 0.248 0.752
#> GSM97089     3  0.5098     0.6022 0.000 0.248 0.752
#> GSM97092     3  0.6225     0.3319 0.000 0.432 0.568
#> GSM97093     2  0.3644     0.5971 0.004 0.872 0.124
#> GSM97058     2  0.5178     0.4926 0.000 0.744 0.256
#> GSM97051     2  0.5058     0.5084 0.000 0.756 0.244
#> GSM97052     3  0.6267     0.2755 0.000 0.452 0.548
#> GSM97061     2  0.6168     0.1674 0.000 0.588 0.412

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.3172     0.5204 0.840 0.000 0.000 0.160
#> GSM97145     1  0.0804     0.6021 0.980 0.000 0.012 0.008
#> GSM97147     1  0.3108     0.5436 0.872 0.016 0.112 0.000
#> GSM97125     1  0.3942     0.4203 0.764 0.000 0.000 0.236
#> GSM97127     1  0.0707     0.6033 0.980 0.000 0.000 0.020
#> GSM97130     2  0.5077     0.7146 0.160 0.760 0.000 0.080
#> GSM97133     1  0.0188     0.6024 0.996 0.000 0.004 0.000
#> GSM97134     2  0.5167     0.7117 0.108 0.760 0.000 0.132
#> GSM97120     1  0.0469     0.6000 0.988 0.000 0.012 0.000
#> GSM97126     1  0.2334     0.5797 0.908 0.000 0.004 0.088
#> GSM97112     4  0.4907     0.2843 0.420 0.000 0.000 0.580
#> GSM97115     2  0.1716     0.8478 0.064 0.936 0.000 0.000
#> GSM97116     1  0.3219     0.5148 0.836 0.000 0.000 0.164
#> GSM97117     3  0.1637     0.7336 0.060 0.000 0.940 0.000
#> GSM97119     4  0.5168     0.1093 0.496 0.004 0.000 0.500
#> GSM97122     4  0.5168     0.1068 0.496 0.004 0.000 0.500
#> GSM97135     1  0.5132    -0.0523 0.548 0.004 0.000 0.448
#> GSM97136     3  0.5755     0.5431 0.044 0.000 0.624 0.332
#> GSM97139     1  0.1637     0.5913 0.940 0.000 0.000 0.060
#> GSM97146     1  0.1389     0.5962 0.952 0.000 0.000 0.048
#> GSM97123     3  0.1892     0.7459 0.004 0.036 0.944 0.016
#> GSM97129     3  0.5423     0.4656 0.332 0.000 0.640 0.028
#> GSM97143     1  0.4985    -0.1063 0.532 0.000 0.000 0.468
#> GSM97113     3  0.4855     0.3355 0.400 0.000 0.600 0.000
#> GSM97056     1  0.7384     0.1623 0.476 0.352 0.000 0.172
#> GSM97124     1  0.5004     0.1037 0.604 0.004 0.000 0.392
#> GSM97132     1  0.7283    -0.1436 0.432 0.148 0.000 0.420
#> GSM97144     2  0.3691     0.8042 0.068 0.856 0.000 0.076
#> GSM97149     1  0.1637     0.5788 0.940 0.000 0.060 0.000
#> GSM97068     2  0.1388     0.8561 0.028 0.960 0.012 0.000
#> GSM97071     2  0.0592     0.8580 0.000 0.984 0.000 0.016
#> GSM97086     2  0.0188     0.8565 0.000 0.996 0.004 0.000
#> GSM97103     3  0.3810     0.7391 0.000 0.060 0.848 0.092
#> GSM97057     1  0.5581     0.0262 0.532 0.020 0.448 0.000
#> GSM97060     3  0.6102     0.6563 0.000 0.116 0.672 0.212
#> GSM97075     3  0.0779     0.7444 0.004 0.000 0.980 0.016
#> GSM97098     3  0.0817     0.7452 0.000 0.000 0.976 0.024
#> GSM97099     3  0.1211     0.7370 0.040 0.000 0.960 0.000
#> GSM97101     3  0.4776     0.3846 0.376 0.000 0.624 0.000
#> GSM97105     3  0.5384     0.6054 0.076 0.196 0.728 0.000
#> GSM97106     3  0.4782     0.7114 0.000 0.152 0.780 0.068
#> GSM97121     3  0.5110     0.4155 0.352 0.012 0.636 0.000
#> GSM97128     4  0.4182     0.4582 0.024 0.180 0.000 0.796
#> GSM97131     2  0.4955     0.0702 0.000 0.556 0.444 0.000
#> GSM97137     1  0.6313     0.3645 0.652 0.220 0.000 0.128
#> GSM97118     4  0.5200     0.4613 0.264 0.036 0.000 0.700
#> GSM97114     1  0.4382     0.3951 0.704 0.000 0.296 0.000
#> GSM97142     4  0.4933     0.2636 0.432 0.000 0.000 0.568
#> GSM97140     1  0.5594    -0.0141 0.520 0.020 0.460 0.000
#> GSM97141     3  0.4916     0.2790 0.424 0.000 0.576 0.000
#> GSM97055     4  0.3450     0.5274 0.156 0.000 0.008 0.836
#> GSM97090     2  0.1706     0.8525 0.036 0.948 0.000 0.016
#> GSM97091     4  0.3688     0.5139 0.208 0.000 0.000 0.792
#> GSM97148     1  0.0592     0.6032 0.984 0.000 0.000 0.016
#> GSM97063     4  0.4304     0.4656 0.284 0.000 0.000 0.716
#> GSM97053     1  0.5883     0.0698 0.572 0.040 0.000 0.388
#> GSM97066     4  0.4994    -0.3647 0.000 0.000 0.480 0.520
#> GSM97079     2  0.0000     0.8577 0.000 1.000 0.000 0.000
#> GSM97083     2  0.4678     0.6704 0.024 0.744 0.000 0.232
#> GSM97084     2  0.0000     0.8577 0.000 1.000 0.000 0.000
#> GSM97094     2  0.2060     0.8448 0.016 0.932 0.000 0.052
#> GSM97096     3  0.2921     0.7296 0.000 0.000 0.860 0.140
#> GSM97097     2  0.0524     0.8544 0.000 0.988 0.008 0.004
#> GSM97107     2  0.0707     0.8568 0.000 0.980 0.000 0.020
#> GSM97054     2  0.0000     0.8577 0.000 1.000 0.000 0.000
#> GSM97062     2  0.0000     0.8577 0.000 1.000 0.000 0.000
#> GSM97069     3  0.4972     0.4349 0.000 0.000 0.544 0.456
#> GSM97070     3  0.4331     0.6516 0.000 0.000 0.712 0.288
#> GSM97073     3  0.4564     0.6156 0.000 0.000 0.672 0.328
#> GSM97076     4  0.5344     0.4571 0.300 0.000 0.032 0.668
#> GSM97077     3  0.6248     0.5423 0.104 0.252 0.644 0.000
#> GSM97095     2  0.3205     0.8141 0.104 0.872 0.000 0.024
#> GSM97102     3  0.4697     0.5861 0.000 0.000 0.644 0.356
#> GSM97109     1  0.5000    -0.1192 0.500 0.000 0.500 0.000
#> GSM97110     3  0.2704     0.7010 0.124 0.000 0.876 0.000
#> GSM97074     4  0.0804     0.5185 0.012 0.000 0.008 0.980
#> GSM97085     4  0.2408     0.4645 0.000 0.000 0.104 0.896
#> GSM97059     2  0.6412     0.3940 0.348 0.572 0.080 0.000
#> GSM97072     3  0.4542     0.6858 0.000 0.020 0.752 0.228
#> GSM97078     2  0.4053     0.6971 0.004 0.768 0.000 0.228
#> GSM97067     4  0.5000    -0.3969 0.000 0.000 0.496 0.504
#> GSM97087     3  0.4193     0.6669 0.000 0.000 0.732 0.268
#> GSM97111     3  0.1474     0.7346 0.052 0.000 0.948 0.000
#> GSM97064     3  0.1557     0.7405 0.000 0.056 0.944 0.000
#> GSM97065     3  0.1004     0.7419 0.024 0.000 0.972 0.004
#> GSM97081     3  0.2647     0.7350 0.000 0.000 0.880 0.120
#> GSM97082     3  0.4855     0.5280 0.000 0.000 0.600 0.400
#> GSM97088     4  0.1406     0.5126 0.000 0.024 0.016 0.960
#> GSM97100     2  0.3196     0.7629 0.008 0.856 0.136 0.000
#> GSM97104     3  0.4843     0.5335 0.000 0.000 0.604 0.396
#> GSM97108     3  0.4983     0.5328 0.272 0.024 0.704 0.000
#> GSM97050     3  0.5111     0.6291 0.056 0.204 0.740 0.000
#> GSM97080     3  0.4697     0.6424 0.000 0.008 0.696 0.296
#> GSM97089     3  0.4103     0.6757 0.000 0.000 0.744 0.256
#> GSM97092     3  0.4050     0.7273 0.000 0.036 0.820 0.144
#> GSM97093     3  0.3808     0.6547 0.176 0.012 0.812 0.000
#> GSM97058     3  0.3612     0.7142 0.044 0.100 0.856 0.000
#> GSM97051     2  0.2081     0.8029 0.000 0.916 0.084 0.000
#> GSM97052     3  0.3638     0.7352 0.000 0.032 0.848 0.120
#> GSM97061     3  0.2996     0.7434 0.000 0.064 0.892 0.044

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.5014   -0.00901 0.536 0.032 0.000 0.000 0.432
#> GSM97145     1  0.5840    0.33310 0.604 0.164 0.000 0.000 0.232
#> GSM97147     1  0.5589    0.41138 0.688 0.224 0.020 0.028 0.040
#> GSM97125     1  0.5379   -0.10666 0.492 0.044 0.000 0.004 0.460
#> GSM97127     1  0.4481    0.38914 0.720 0.048 0.000 0.000 0.232
#> GSM97130     4  0.3273    0.74231 0.036 0.004 0.000 0.848 0.112
#> GSM97133     1  0.2676    0.50427 0.884 0.036 0.000 0.000 0.080
#> GSM97134     4  0.5023    0.55768 0.028 0.024 0.000 0.676 0.272
#> GSM97120     1  0.2795    0.49993 0.872 0.028 0.000 0.000 0.100
#> GSM97126     1  0.4934    0.18979 0.616 0.024 0.000 0.008 0.352
#> GSM97112     5  0.3849    0.56192 0.232 0.016 0.000 0.000 0.752
#> GSM97115     4  0.2624    0.77092 0.032 0.012 0.004 0.904 0.048
#> GSM97116     1  0.3607    0.32736 0.752 0.004 0.000 0.000 0.244
#> GSM97117     2  0.6825    0.35412 0.208 0.468 0.312 0.000 0.012
#> GSM97119     5  0.4805    0.54625 0.252 0.032 0.000 0.016 0.700
#> GSM97122     5  0.4491    0.53178 0.280 0.024 0.000 0.004 0.692
#> GSM97135     5  0.4636    0.49864 0.308 0.024 0.000 0.004 0.664
#> GSM97136     5  0.7863   -0.23803 0.064 0.296 0.316 0.000 0.324
#> GSM97139     1  0.3462    0.41934 0.792 0.012 0.000 0.000 0.196
#> GSM97146     1  0.2011    0.48853 0.908 0.004 0.000 0.000 0.088
#> GSM97123     3  0.4133    0.40716 0.012 0.232 0.744 0.012 0.000
#> GSM97129     2  0.7767    0.03083 0.344 0.408 0.132 0.000 0.116
#> GSM97143     5  0.4607    0.49196 0.320 0.020 0.000 0.004 0.656
#> GSM97113     1  0.5957    0.03223 0.572 0.148 0.280 0.000 0.000
#> GSM97056     1  0.7147    0.07952 0.492 0.020 0.008 0.252 0.228
#> GSM97124     5  0.5396    0.50040 0.284 0.036 0.000 0.032 0.648
#> GSM97132     5  0.6325    0.47808 0.204 0.024 0.000 0.168 0.604
#> GSM97144     4  0.3070    0.75153 0.012 0.016 0.000 0.860 0.112
#> GSM97149     1  0.0807    0.51224 0.976 0.012 0.000 0.000 0.012
#> GSM97068     4  0.3990    0.74343 0.096 0.032 0.040 0.828 0.004
#> GSM97071     4  0.1992    0.77763 0.000 0.044 0.000 0.924 0.032
#> GSM97086     4  0.1671    0.76699 0.000 0.076 0.000 0.924 0.000
#> GSM97103     2  0.4348    0.45567 0.000 0.788 0.068 0.128 0.016
#> GSM97057     1  0.5839    0.15103 0.568 0.056 0.352 0.024 0.000
#> GSM97060     3  0.4989    0.53377 0.000 0.176 0.736 0.032 0.056
#> GSM97075     3  0.4010    0.42287 0.032 0.208 0.760 0.000 0.000
#> GSM97098     2  0.4103    0.41103 0.012 0.748 0.228 0.012 0.000
#> GSM97099     2  0.5004    0.45458 0.076 0.696 0.224 0.004 0.000
#> GSM97101     1  0.6775   -0.27691 0.388 0.328 0.284 0.000 0.000
#> GSM97105     2  0.7293    0.28151 0.088 0.460 0.348 0.104 0.000
#> GSM97106     3  0.5448    0.26457 0.000 0.340 0.584 0.076 0.000
#> GSM97121     2  0.6605    0.45307 0.212 0.588 0.160 0.040 0.000
#> GSM97128     5  0.6603    0.25235 0.004 0.024 0.140 0.268 0.564
#> GSM97131     4  0.5996    0.13968 0.004 0.432 0.096 0.468 0.000
#> GSM97137     1  0.5969    0.25826 0.644 0.020 0.000 0.160 0.176
#> GSM97118     5  0.4392    0.56739 0.088 0.012 0.020 0.072 0.808
#> GSM97114     1  0.5257    0.22777 0.640 0.296 0.056 0.000 0.008
#> GSM97142     5  0.4286    0.54691 0.260 0.020 0.000 0.004 0.716
#> GSM97140     1  0.7145   -0.12176 0.380 0.256 0.348 0.016 0.000
#> GSM97141     1  0.6646   -0.24510 0.416 0.356 0.228 0.000 0.000
#> GSM97055     5  0.3677    0.53623 0.032 0.032 0.096 0.000 0.840
#> GSM97090     4  0.5021    0.71568 0.068 0.016 0.044 0.776 0.096
#> GSM97091     5  0.2581    0.56523 0.048 0.020 0.028 0.000 0.904
#> GSM97148     1  0.2166    0.49523 0.912 0.012 0.000 0.004 0.072
#> GSM97063     5  0.3173    0.57931 0.112 0.016 0.016 0.000 0.856
#> GSM97053     5  0.5403    0.42288 0.368 0.016 0.000 0.036 0.580
#> GSM97066     3  0.6009    0.41932 0.000 0.180 0.580 0.000 0.240
#> GSM97079     4  0.2597    0.75075 0.000 0.120 0.004 0.872 0.004
#> GSM97083     4  0.4756    0.57203 0.004 0.016 0.012 0.676 0.292
#> GSM97084     4  0.1341    0.77209 0.000 0.056 0.000 0.944 0.000
#> GSM97094     4  0.4649    0.66885 0.000 0.212 0.000 0.720 0.068
#> GSM97096     2  0.4478    0.09836 0.000 0.628 0.360 0.004 0.008
#> GSM97097     4  0.4843    0.39894 0.000 0.428 0.004 0.552 0.016
#> GSM97107     4  0.2900    0.75676 0.000 0.108 0.000 0.864 0.028
#> GSM97054     4  0.1988    0.76962 0.000 0.016 0.048 0.928 0.008
#> GSM97062     4  0.0880    0.77401 0.000 0.032 0.000 0.968 0.000
#> GSM97069     3  0.6106    0.41455 0.000 0.228 0.568 0.000 0.204
#> GSM97070     3  0.5490    0.45805 0.000 0.248 0.636 0.000 0.116
#> GSM97073     3  0.6316    0.25018 0.000 0.396 0.464 0.004 0.136
#> GSM97076     2  0.6524   -0.11059 0.056 0.488 0.036 0.012 0.408
#> GSM97077     3  0.7218    0.21136 0.124 0.096 0.560 0.216 0.004
#> GSM97095     4  0.5228    0.70096 0.100 0.020 0.020 0.752 0.108
#> GSM97102     2  0.6213   -0.20836 0.000 0.452 0.408 0.000 0.140
#> GSM97109     2  0.4753    0.49276 0.136 0.780 0.024 0.028 0.032
#> GSM97110     2  0.4752    0.50322 0.080 0.760 0.144 0.012 0.004
#> GSM97074     5  0.4911    0.44488 0.000 0.124 0.132 0.008 0.736
#> GSM97085     5  0.5932    0.03555 0.000 0.096 0.336 0.008 0.560
#> GSM97059     1  0.7507    0.02162 0.460 0.040 0.176 0.312 0.012
#> GSM97072     3  0.5439    0.20528 0.000 0.464 0.484 0.004 0.048
#> GSM97078     4  0.5581    0.55229 0.004 0.016 0.064 0.648 0.268
#> GSM97067     3  0.6171    0.40522 0.000 0.240 0.556 0.000 0.204
#> GSM97087     3  0.1357    0.56136 0.000 0.004 0.948 0.000 0.048
#> GSM97111     2  0.5789    0.44920 0.124 0.612 0.260 0.000 0.004
#> GSM97064     3  0.4346    0.47207 0.044 0.080 0.812 0.060 0.004
#> GSM97065     3  0.6243   -0.00465 0.124 0.432 0.440 0.000 0.004
#> GSM97081     3  0.4535    0.42284 0.004 0.288 0.684 0.000 0.024
#> GSM97082     3  0.4496    0.51791 0.000 0.092 0.752 0.000 0.156
#> GSM97088     5  0.6602    0.30406 0.000 0.024 0.240 0.176 0.560
#> GSM97100     4  0.6109    0.56574 0.040 0.164 0.144 0.652 0.000
#> GSM97104     3  0.6128    0.40964 0.000 0.252 0.560 0.000 0.188
#> GSM97108     2  0.6847    0.41576 0.208 0.520 0.248 0.024 0.000
#> GSM97050     3  0.6969    0.27200 0.124 0.116 0.604 0.152 0.004
#> GSM97080     3  0.4300    0.53486 0.000 0.132 0.772 0.000 0.096
#> GSM97089     3  0.1579    0.56374 0.000 0.032 0.944 0.000 0.024
#> GSM97092     3  0.2199    0.55051 0.000 0.060 0.916 0.016 0.008
#> GSM97093     3  0.5746    0.27663 0.228 0.108 0.648 0.016 0.000
#> GSM97058     3  0.5726    0.37875 0.064 0.128 0.704 0.104 0.000
#> GSM97051     4  0.5315    0.35591 0.004 0.036 0.396 0.560 0.004
#> GSM97052     3  0.2053    0.54618 0.000 0.048 0.924 0.024 0.004
#> GSM97061     3  0.3163    0.51047 0.012 0.092 0.864 0.032 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     5   0.542     0.1477 0.428 0.068 0.012 0.000 0.488 0.004
#> GSM97145     5   0.686     0.2236 0.252 0.248 0.052 0.000 0.444 0.004
#> GSM97147     2   0.545     0.4790 0.160 0.672 0.012 0.028 0.128 0.000
#> GSM97125     5   0.487     0.5362 0.228 0.064 0.020 0.004 0.684 0.000
#> GSM97127     5   0.578     0.0907 0.420 0.096 0.024 0.000 0.460 0.000
#> GSM97130     4   0.321     0.7645 0.036 0.008 0.016 0.852 0.088 0.000
#> GSM97133     1   0.396     0.7006 0.748 0.040 0.008 0.000 0.204 0.000
#> GSM97134     4   0.523     0.1563 0.000 0.040 0.020 0.500 0.436 0.004
#> GSM97120     1   0.370     0.7544 0.784 0.044 0.008 0.000 0.164 0.000
#> GSM97126     5   0.488     0.5445 0.216 0.092 0.008 0.000 0.680 0.004
#> GSM97112     5   0.186     0.6759 0.044 0.004 0.008 0.000 0.928 0.016
#> GSM97115     4   0.384     0.7565 0.084 0.004 0.048 0.816 0.048 0.000
#> GSM97116     1   0.230     0.7766 0.856 0.000 0.000 0.000 0.144 0.000
#> GSM97117     2   0.324     0.5335 0.024 0.864 0.040 0.000 0.048 0.024
#> GSM97119     5   0.239     0.6782 0.064 0.028 0.000 0.012 0.896 0.000
#> GSM97122     5   0.234     0.6732 0.088 0.020 0.000 0.004 0.888 0.000
#> GSM97135     5   0.272     0.6598 0.128 0.016 0.000 0.004 0.852 0.000
#> GSM97136     5   0.768     0.0690 0.020 0.192 0.140 0.000 0.412 0.236
#> GSM97139     1   0.290     0.7373 0.800 0.004 0.000 0.000 0.196 0.000
#> GSM97146     1   0.207     0.7966 0.896 0.012 0.000 0.000 0.092 0.000
#> GSM97123     3   0.581     0.3799 0.004 0.384 0.452 0.000 0.000 0.160
#> GSM97129     2   0.635     0.2736 0.092 0.552 0.052 0.000 0.284 0.020
#> GSM97143     5   0.216     0.6790 0.076 0.008 0.008 0.000 0.904 0.004
#> GSM97113     1   0.537     0.4550 0.660 0.176 0.128 0.000 0.000 0.036
#> GSM97056     1   0.432     0.6952 0.772 0.008 0.020 0.116 0.084 0.000
#> GSM97124     5   0.419     0.6516 0.084 0.068 0.004 0.052 0.792 0.000
#> GSM97132     5   0.456     0.5962 0.072 0.008 0.008 0.172 0.736 0.004
#> GSM97144     4   0.267     0.7610 0.008 0.008 0.008 0.868 0.108 0.000
#> GSM97149     1   0.219     0.7925 0.904 0.032 0.004 0.000 0.060 0.000
#> GSM97068     4   0.527     0.6288 0.216 0.036 0.068 0.672 0.004 0.004
#> GSM97071     4   0.303     0.7641 0.000 0.016 0.032 0.872 0.020 0.060
#> GSM97086     4   0.222     0.7639 0.012 0.020 0.036 0.916 0.000 0.016
#> GSM97103     3   0.845    -0.2874 0.044 0.212 0.296 0.160 0.008 0.280
#> GSM97057     1   0.528     0.3863 0.620 0.192 0.184 0.004 0.000 0.000
#> GSM97060     6   0.491     0.1615 0.000 0.024 0.356 0.032 0.000 0.588
#> GSM97075     2   0.641    -0.0740 0.032 0.476 0.280 0.000 0.000 0.212
#> GSM97098     6   0.688     0.1963 0.036 0.296 0.304 0.004 0.000 0.360
#> GSM97099     2   0.717    -0.1838 0.056 0.360 0.248 0.004 0.004 0.328
#> GSM97101     2   0.428     0.4648 0.128 0.732 0.140 0.000 0.000 0.000
#> GSM97105     2   0.368     0.4196 0.012 0.796 0.160 0.020 0.000 0.012
#> GSM97106     3   0.627     0.2501 0.004 0.160 0.544 0.040 0.000 0.252
#> GSM97121     2   0.256     0.5365 0.036 0.904 0.024 0.008 0.016 0.012
#> GSM97128     5   0.716     0.2232 0.016 0.000 0.100 0.228 0.488 0.168
#> GSM97131     2   0.569     0.3416 0.020 0.600 0.092 0.276 0.004 0.008
#> GSM97137     1   0.388     0.7297 0.784 0.000 0.008 0.080 0.128 0.000
#> GSM97118     5   0.382     0.6229 0.016 0.000 0.028 0.060 0.824 0.072
#> GSM97114     2   0.438     0.4960 0.220 0.720 0.008 0.000 0.044 0.008
#> GSM97142     5   0.166     0.6786 0.052 0.008 0.000 0.000 0.932 0.008
#> GSM97140     2   0.477     0.3730 0.064 0.704 0.208 0.008 0.016 0.000
#> GSM97141     2   0.375     0.5144 0.104 0.804 0.076 0.000 0.016 0.000
#> GSM97055     5   0.502     0.3965 0.012 0.008 0.060 0.000 0.644 0.276
#> GSM97090     4   0.524     0.6848 0.100 0.012 0.152 0.700 0.036 0.000
#> GSM97091     5   0.340     0.6184 0.016 0.000 0.040 0.000 0.824 0.120
#> GSM97148     1   0.207     0.7963 0.904 0.024 0.000 0.000 0.072 0.000
#> GSM97063     5   0.288     0.6424 0.012 0.000 0.040 0.000 0.864 0.084
#> GSM97053     5   0.388     0.6163 0.200 0.012 0.004 0.024 0.760 0.000
#> GSM97066     6   0.388     0.4779 0.004 0.012 0.116 0.000 0.072 0.796
#> GSM97079     4   0.350     0.7198 0.004 0.008 0.100 0.824 0.000 0.064
#> GSM97083     4   0.550     0.5977 0.028 0.000 0.056 0.648 0.240 0.028
#> GSM97084     4   0.105     0.7671 0.000 0.004 0.020 0.964 0.000 0.012
#> GSM97094     4   0.550     0.6475 0.024 0.040 0.160 0.708 0.028 0.040
#> GSM97096     6   0.655     0.3548 0.028 0.188 0.280 0.012 0.000 0.492
#> GSM97097     4   0.736     0.3081 0.036 0.116 0.252 0.480 0.000 0.116
#> GSM97107     4   0.357     0.7459 0.016 0.020 0.072 0.848 0.028 0.016
#> GSM97054     4   0.316     0.7398 0.012 0.028 0.104 0.848 0.008 0.000
#> GSM97062     4   0.158     0.7683 0.000 0.008 0.036 0.940 0.000 0.016
#> GSM97069     6   0.326     0.5083 0.004 0.004 0.100 0.008 0.040 0.844
#> GSM97070     6   0.387     0.4893 0.008 0.068 0.116 0.004 0.004 0.800
#> GSM97073     6   0.400     0.5268 0.012 0.060 0.100 0.012 0.008 0.808
#> GSM97076     6   0.803     0.3550 0.036 0.104 0.192 0.052 0.128 0.488
#> GSM97077     3   0.666     0.1675 0.040 0.392 0.432 0.112 0.000 0.024
#> GSM97095     4   0.570     0.6922 0.088 0.056 0.112 0.700 0.040 0.004
#> GSM97102     6   0.545     0.4798 0.020 0.092 0.196 0.000 0.024 0.668
#> GSM97109     2   0.799    -0.0210 0.064 0.372 0.296 0.020 0.036 0.212
#> GSM97110     6   0.780     0.2385 0.080 0.224 0.272 0.028 0.008 0.388
#> GSM97074     6   0.512     0.1573 0.004 0.000 0.036 0.020 0.392 0.548
#> GSM97085     6   0.535     0.2395 0.004 0.000 0.100 0.000 0.372 0.524
#> GSM97059     2   0.785     0.0779 0.244 0.324 0.212 0.212 0.008 0.000
#> GSM97072     6   0.446     0.5067 0.012 0.052 0.148 0.028 0.000 0.760
#> GSM97078     4   0.628     0.5965 0.016 0.000 0.160 0.604 0.160 0.060
#> GSM97067     6   0.241     0.5286 0.000 0.004 0.068 0.008 0.024 0.896
#> GSM97087     3   0.536     0.3394 0.004 0.076 0.544 0.004 0.004 0.368
#> GSM97111     2   0.394     0.5127 0.020 0.816 0.064 0.000 0.024 0.076
#> GSM97064     3   0.627     0.5140 0.024 0.256 0.568 0.032 0.000 0.120
#> GSM97065     6   0.643     0.3279 0.140 0.232 0.060 0.004 0.004 0.560
#> GSM97081     2   0.616    -0.1190 0.008 0.452 0.252 0.000 0.000 0.288
#> GSM97082     6   0.569     0.1135 0.004 0.052 0.352 0.000 0.048 0.544
#> GSM97088     5   0.740    -0.0642 0.012 0.000 0.148 0.120 0.372 0.348
#> GSM97100     2   0.581     0.2559 0.016 0.552 0.128 0.300 0.004 0.000
#> GSM97104     6   0.418     0.4508 0.000 0.028 0.228 0.000 0.020 0.724
#> GSM97108     2   0.355     0.5279 0.040 0.852 0.056 0.016 0.024 0.012
#> GSM97050     3   0.699     0.4961 0.064 0.200 0.556 0.068 0.000 0.112
#> GSM97080     6   0.430     0.3044 0.000 0.032 0.284 0.000 0.008 0.676
#> GSM97089     3   0.572     0.2905 0.012 0.080 0.516 0.004 0.008 0.380
#> GSM97092     3   0.599     0.4876 0.004 0.180 0.512 0.008 0.000 0.296
#> GSM97093     3   0.695     0.4683 0.128 0.228 0.520 0.008 0.004 0.112
#> GSM97058     3   0.666     0.1840 0.028 0.412 0.424 0.080 0.000 0.056
#> GSM97051     3   0.683     0.1518 0.024 0.316 0.388 0.260 0.000 0.012
#> GSM97052     3   0.587     0.5173 0.004 0.192 0.528 0.004 0.000 0.272
#> GSM97061     3   0.580     0.5509 0.004 0.244 0.548 0.004 0.000 0.200

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-membership-heatmap-5

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)

plot of chunk tab-MAD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-MAD-NMF-get-signatures-no-scale-1

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

plot of chunk tab-MAD-NMF-get-signatures-no-scale-2

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

plot of chunk tab-MAD-NMF-get-signatures-no-scale-3

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

plot of chunk tab-MAD-NMF-get-signatures-no-scale-4

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

plot of chunk tab-MAD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-NMF-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-MAD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-NMF-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:NMF 98         1.37e-04      0.5025     3.14e-14   0.0947 2
#> MAD:NMF 61         9.50e-06      0.0726     1.84e-10   0.0259 3
#> MAD:NMF 69         1.83e-05      0.5813     3.99e-10   0.3021 4
#> MAD:NMF 38         2.02e-01      0.6930     1.89e-08   0.3341 5
#> MAD:NMF 51         7.90e-02      0.8392     1.49e-11   0.3598 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.


ATC:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "hclust"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-hclust-collect-plots

The plots are:

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:

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)

plot of chunk ATC-hclust-select-partition-number

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.344           0.688       0.802         0.4431 0.553   0.553
#> 3 3 0.369           0.598       0.723         0.2693 0.906   0.834
#> 4 4 0.530           0.668       0.803         0.2476 0.787   0.572
#> 5 5 0.593           0.682       0.815         0.0633 0.946   0.819
#> 6 6 0.620           0.517       0.729         0.0606 0.973   0.890

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1   0.981     0.7956 0.580 0.420
#> GSM97145     2   0.388     0.6701 0.076 0.924
#> GSM97147     2   0.000     0.7081 0.000 1.000
#> GSM97125     2   0.929    -0.0501 0.344 0.656
#> GSM97127     2   0.388     0.6701 0.076 0.924
#> GSM97130     2   0.358     0.6795 0.068 0.932
#> GSM97133     2   0.388     0.6701 0.076 0.924
#> GSM97134     2   0.402     0.6693 0.080 0.920
#> GSM97120     2   0.388     0.6701 0.076 0.924
#> GSM97126     1   0.886     0.9574 0.696 0.304
#> GSM97112     1   0.886     0.9574 0.696 0.304
#> GSM97115     2   0.278     0.7033 0.048 0.952
#> GSM97116     2   0.939    -0.0939 0.356 0.644
#> GSM97117     2   0.242     0.6940 0.040 0.960
#> GSM97119     1   0.904     0.9565 0.680 0.320
#> GSM97122     1   0.909     0.9548 0.676 0.324
#> GSM97135     1   0.886     0.9574 0.696 0.304
#> GSM97136     1   0.981     0.8049 0.580 0.420
#> GSM97139     2   0.469     0.6483 0.100 0.900
#> GSM97146     2   0.605     0.5853 0.148 0.852
#> GSM97123     2   0.917     0.6700 0.332 0.668
#> GSM97129     2   0.311     0.6856 0.056 0.944
#> GSM97143     1   0.886     0.9574 0.696 0.304
#> GSM97113     2   0.775     0.6944 0.228 0.772
#> GSM97056     2   0.358     0.6783 0.068 0.932
#> GSM97124     2   0.443     0.6562 0.092 0.908
#> GSM97132     2   0.988    -0.4203 0.436 0.564
#> GSM97144     2   0.358     0.6795 0.068 0.932
#> GSM97149     2   0.469     0.6483 0.100 0.900
#> GSM97068     2   0.839     0.6835 0.268 0.732
#> GSM97071     2   0.775     0.3909 0.228 0.772
#> GSM97086     2   0.886     0.6696 0.304 0.696
#> GSM97103     2   0.844     0.6780 0.272 0.728
#> GSM97057     2   0.844     0.6822 0.272 0.728
#> GSM97060     2   0.939     0.6299 0.356 0.644
#> GSM97075     2   1.000    -0.6067 0.492 0.508
#> GSM97098     2   0.844     0.6780 0.272 0.728
#> GSM97099     2   0.722     0.6811 0.200 0.800
#> GSM97101     2   0.295     0.7161 0.052 0.948
#> GSM97105     2   0.886     0.6696 0.304 0.696
#> GSM97106     2   0.891     0.6688 0.308 0.692
#> GSM97121     2   0.295     0.7161 0.052 0.948
#> GSM97128     1   0.886     0.9574 0.696 0.304
#> GSM97131     2   0.886     0.6696 0.304 0.696
#> GSM97137     2   0.278     0.6905 0.048 0.952
#> GSM97118     1   0.886     0.9574 0.696 0.304
#> GSM97114     2   0.242     0.6940 0.040 0.960
#> GSM97142     1   0.886     0.9574 0.696 0.304
#> GSM97140     2   0.000     0.7081 0.000 1.000
#> GSM97141     2   0.373     0.7135 0.072 0.928
#> GSM97055     1   0.886     0.9574 0.696 0.304
#> GSM97090     2   0.260     0.6931 0.044 0.956
#> GSM97091     1   0.886     0.9574 0.696 0.304
#> GSM97148     2   0.469     0.6483 0.100 0.900
#> GSM97063     1   0.886     0.9574 0.696 0.304
#> GSM97053     2   0.541     0.6196 0.124 0.876
#> GSM97066     1   0.909     0.9563 0.676 0.324
#> GSM97079     2   0.886     0.6696 0.304 0.696
#> GSM97083     1   0.886     0.9574 0.696 0.304
#> GSM97084     2   0.886     0.6696 0.304 0.696
#> GSM97094     2   0.745     0.4429 0.212 0.788
#> GSM97096     2   1.000    -0.6161 0.496 0.504
#> GSM97097     2   0.886     0.6696 0.304 0.696
#> GSM97107     2   0.443     0.6559 0.092 0.908
#> GSM97054     2   0.886     0.6696 0.304 0.696
#> GSM97062     2   0.886     0.6696 0.304 0.696
#> GSM97069     1   0.909     0.9547 0.676 0.324
#> GSM97070     1   0.909     0.9563 0.676 0.324
#> GSM97073     1   0.909     0.9563 0.676 0.324
#> GSM97076     1   0.909     0.9563 0.676 0.324
#> GSM97077     2   0.430     0.7157 0.088 0.912
#> GSM97095     2   0.706     0.4878 0.192 0.808
#> GSM97102     1   0.913     0.9501 0.672 0.328
#> GSM97109     2   0.242     0.6940 0.040 0.960
#> GSM97110     2   0.775     0.6956 0.228 0.772
#> GSM97074     1   0.909     0.9563 0.676 0.324
#> GSM97085     1   0.886     0.9574 0.696 0.304
#> GSM97059     2   0.000     0.7081 0.000 1.000
#> GSM97072     1   0.925     0.9422 0.660 0.340
#> GSM97078     1   0.988     0.7799 0.564 0.436
#> GSM97067     1   0.909     0.9563 0.676 0.324
#> GSM97087     1   0.946     0.9077 0.636 0.364
#> GSM97111     2   0.242     0.6940 0.040 0.960
#> GSM97064     2   0.895     0.6744 0.312 0.688
#> GSM97065     1   0.909     0.9563 0.676 0.324
#> GSM97081     2   1.000    -0.6067 0.492 0.508
#> GSM97082     1   0.946     0.9077 0.636 0.364
#> GSM97088     1   0.886     0.9574 0.696 0.304
#> GSM97100     2   0.886     0.6696 0.304 0.696
#> GSM97104     1   0.913     0.9501 0.672 0.328
#> GSM97108     2   0.295     0.7161 0.052 0.948
#> GSM97050     2   0.886     0.6696 0.304 0.696
#> GSM97080     1   0.917     0.9482 0.668 0.332
#> GSM97089     1   0.949     0.9031 0.632 0.368
#> GSM97092     2   0.939     0.6611 0.356 0.644
#> GSM97093     2   0.958     0.3923 0.380 0.620
#> GSM97058     2   0.844     0.6822 0.272 0.728
#> GSM97051     2   0.886     0.6696 0.304 0.696
#> GSM97052     2   0.943     0.6592 0.360 0.640
#> GSM97061     2   0.943     0.6592 0.360 0.640

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.7395     0.1268 0.580 0.380 0.040
#> GSM97145     2  0.1832     0.6703 0.008 0.956 0.036
#> GSM97147     2  0.1643     0.7083 0.000 0.956 0.044
#> GSM97125     2  0.6998     0.0787 0.292 0.664 0.044
#> GSM97127     2  0.1832     0.6703 0.008 0.956 0.036
#> GSM97130     2  0.2280     0.6780 0.008 0.940 0.052
#> GSM97133     2  0.1832     0.6703 0.008 0.956 0.036
#> GSM97134     2  0.2056     0.6705 0.024 0.952 0.024
#> GSM97120     2  0.1832     0.6703 0.008 0.956 0.036
#> GSM97126     1  0.5660     0.5068 0.772 0.200 0.028
#> GSM97112     1  0.2492     0.6008 0.936 0.048 0.016
#> GSM97115     2  0.2173     0.7031 0.008 0.944 0.048
#> GSM97116     2  0.7084     0.0440 0.304 0.652 0.044
#> GSM97117     2  0.0424     0.6921 0.000 0.992 0.008
#> GSM97119     1  0.7027     0.3339 0.660 0.296 0.044
#> GSM97122     1  0.7056     0.3261 0.656 0.300 0.044
#> GSM97135     1  0.6839     0.3625 0.684 0.272 0.044
#> GSM97136     1  0.8882     0.3874 0.540 0.316 0.144
#> GSM97139     2  0.2663     0.6515 0.024 0.932 0.044
#> GSM97146     2  0.4058     0.6016 0.076 0.880 0.044
#> GSM97123     2  0.6617     0.6459 0.012 0.600 0.388
#> GSM97129     2  0.1129     0.6839 0.004 0.976 0.020
#> GSM97143     1  0.5660     0.5068 0.772 0.200 0.028
#> GSM97113     2  0.5465     0.6906 0.000 0.712 0.288
#> GSM97056     2  0.1636     0.6783 0.020 0.964 0.016
#> GSM97124     2  0.2434     0.6578 0.024 0.940 0.036
#> GSM97132     2  0.7508    -0.2374 0.416 0.544 0.040
#> GSM97144     2  0.2280     0.6780 0.008 0.940 0.052
#> GSM97149     2  0.2663     0.6515 0.024 0.932 0.044
#> GSM97068     2  0.5785     0.6779 0.000 0.668 0.332
#> GSM97071     2  0.5455     0.3959 0.020 0.776 0.204
#> GSM97086     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97103     2  0.6313     0.6585 0.016 0.676 0.308
#> GSM97057     2  0.5810     0.6766 0.000 0.664 0.336
#> GSM97060     2  0.9405     0.4911 0.204 0.496 0.300
#> GSM97075     1  0.9648     0.2577 0.408 0.384 0.208
#> GSM97098     2  0.6313     0.6585 0.016 0.676 0.308
#> GSM97099     2  0.5595     0.6719 0.016 0.756 0.228
#> GSM97101     2  0.2796     0.7159 0.000 0.908 0.092
#> GSM97105     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97106     2  0.6026     0.6599 0.000 0.624 0.376
#> GSM97121     2  0.2796     0.7159 0.000 0.908 0.092
#> GSM97128     1  0.1711     0.6054 0.960 0.032 0.008
#> GSM97131     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97137     2  0.1170     0.6882 0.008 0.976 0.016
#> GSM97118     1  0.5610     0.5111 0.776 0.196 0.028
#> GSM97114     2  0.0424     0.6921 0.000 0.992 0.008
#> GSM97142     1  0.6839     0.3625 0.684 0.272 0.044
#> GSM97140     2  0.1643     0.7083 0.000 0.956 0.044
#> GSM97141     2  0.2537     0.7135 0.000 0.920 0.080
#> GSM97055     1  0.1315     0.6047 0.972 0.020 0.008
#> GSM97090     2  0.1453     0.6928 0.008 0.968 0.024
#> GSM97091     1  0.1315     0.6047 0.972 0.020 0.008
#> GSM97148     2  0.2663     0.6515 0.024 0.932 0.044
#> GSM97063     1  0.1315     0.6047 0.972 0.020 0.008
#> GSM97053     2  0.3369     0.6270 0.052 0.908 0.040
#> GSM97066     3  0.9575     0.9295 0.216 0.320 0.464
#> GSM97079     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97083     1  0.1585     0.6050 0.964 0.028 0.008
#> GSM97084     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97094     2  0.6211     0.4196 0.228 0.736 0.036
#> GSM97096     1  0.9645     0.2654 0.412 0.380 0.208
#> GSM97097     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97107     2  0.3043     0.6589 0.008 0.908 0.084
#> GSM97054     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97062     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97069     1  0.8924     0.4071 0.524 0.140 0.336
#> GSM97070     3  0.9575     0.9295 0.216 0.320 0.464
#> GSM97073     3  0.9575     0.9295 0.216 0.320 0.464
#> GSM97076     3  0.9899     0.8671 0.280 0.320 0.400
#> GSM97077     2  0.3482     0.7136 0.000 0.872 0.128
#> GSM97095     2  0.5987     0.4595 0.208 0.756 0.036
#> GSM97102     1  0.6624     0.5532 0.708 0.044 0.248
#> GSM97109     2  0.0424     0.6921 0.000 0.992 0.008
#> GSM97110     2  0.5919     0.6840 0.016 0.724 0.260
#> GSM97074     3  0.9899     0.8671 0.280 0.320 0.400
#> GSM97085     1  0.1315     0.6047 0.972 0.020 0.008
#> GSM97059     2  0.1643     0.7083 0.000 0.956 0.044
#> GSM97072     3  0.7378     0.7084 0.052 0.320 0.628
#> GSM97078     1  0.8841     0.3573 0.528 0.340 0.132
#> GSM97067     3  0.9575     0.9295 0.216 0.320 0.464
#> GSM97087     1  0.7331     0.5471 0.672 0.072 0.256
#> GSM97111     2  0.0424     0.6921 0.000 0.992 0.008
#> GSM97064     2  0.6209     0.6632 0.004 0.628 0.368
#> GSM97065     3  0.9575     0.9295 0.216 0.320 0.464
#> GSM97081     1  0.9648     0.2577 0.408 0.384 0.208
#> GSM97082     1  0.7331     0.5471 0.672 0.072 0.256
#> GSM97088     1  0.1585     0.6050 0.964 0.028 0.008
#> GSM97100     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97104     1  0.6624     0.5532 0.708 0.044 0.248
#> GSM97108     2  0.2796     0.7159 0.000 0.908 0.092
#> GSM97050     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97080     1  0.7565     0.5464 0.660 0.084 0.256
#> GSM97089     1  0.7489     0.5453 0.664 0.080 0.256
#> GSM97092     2  0.7410     0.6285 0.040 0.576 0.384
#> GSM97093     2  0.9223     0.2850 0.272 0.528 0.200
#> GSM97058     2  0.5810     0.6766 0.000 0.664 0.336
#> GSM97051     2  0.5988     0.6641 0.000 0.632 0.368
#> GSM97052     2  0.7424     0.6256 0.040 0.572 0.388
#> GSM97061     2  0.7424     0.6256 0.040 0.572 0.388

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.7416     -0.367 0.440 0.000 0.392 0.168
#> GSM97145     1  0.0707      0.790 0.980 0.020 0.000 0.000
#> GSM97147     1  0.4874      0.733 0.764 0.180 0.000 0.056
#> GSM97125     1  0.6162      0.466 0.704 0.012 0.148 0.136
#> GSM97127     1  0.0707      0.790 0.980 0.020 0.000 0.000
#> GSM97130     1  0.3972      0.787 0.840 0.080 0.000 0.080
#> GSM97133     1  0.0707      0.790 0.980 0.020 0.000 0.000
#> GSM97134     1  0.1917      0.794 0.944 0.036 0.008 0.012
#> GSM97120     1  0.0707      0.790 0.980 0.020 0.000 0.000
#> GSM97126     3  0.6780      0.604 0.232 0.000 0.604 0.164
#> GSM97112     3  0.4864      0.627 0.060 0.000 0.768 0.172
#> GSM97115     1  0.2944      0.785 0.868 0.128 0.000 0.004
#> GSM97116     1  0.5724      0.455 0.716 0.000 0.144 0.140
#> GSM97117     1  0.3323      0.793 0.876 0.064 0.000 0.060
#> GSM97119     3  0.7277      0.523 0.360 0.000 0.484 0.156
#> GSM97122     3  0.7286      0.519 0.364 0.000 0.480 0.156
#> GSM97135     3  0.7314      0.533 0.336 0.000 0.496 0.168
#> GSM97136     3  0.6619      0.545 0.328 0.004 0.580 0.088
#> GSM97139     1  0.0188      0.777 0.996 0.000 0.000 0.004
#> GSM97146     1  0.1833      0.754 0.944 0.000 0.032 0.024
#> GSM97123     2  0.1724      0.827 0.000 0.948 0.032 0.020
#> GSM97129     1  0.2300      0.798 0.924 0.048 0.000 0.028
#> GSM97143     3  0.6780      0.604 0.232 0.000 0.604 0.164
#> GSM97113     2  0.4415      0.737 0.140 0.804 0.000 0.056
#> GSM97056     1  0.1022      0.794 0.968 0.032 0.000 0.000
#> GSM97124     1  0.1377      0.787 0.964 0.020 0.008 0.008
#> GSM97132     1  0.6731      0.175 0.604 0.000 0.248 0.148
#> GSM97144     1  0.3972      0.787 0.840 0.080 0.000 0.080
#> GSM97149     1  0.0188      0.777 0.996 0.000 0.000 0.004
#> GSM97068     2  0.2469      0.816 0.108 0.892 0.000 0.000
#> GSM97071     1  0.5986      0.538 0.620 0.060 0.000 0.320
#> GSM97086     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97103     2  0.7708      0.442 0.268 0.576 0.076 0.080
#> GSM97057     2  0.2408      0.819 0.104 0.896 0.000 0.000
#> GSM97060     2  0.4574      0.641 0.000 0.756 0.220 0.024
#> GSM97075     3  0.8166      0.445 0.324 0.092 0.504 0.080
#> GSM97098     2  0.7708      0.442 0.268 0.576 0.076 0.080
#> GSM97099     1  0.8148      0.174 0.456 0.384 0.076 0.084
#> GSM97101     1  0.5769      0.592 0.652 0.292 0.000 0.056
#> GSM97105     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97106     2  0.0188      0.840 0.000 0.996 0.004 0.000
#> GSM97121     1  0.5769      0.592 0.652 0.292 0.000 0.056
#> GSM97128     3  0.3925      0.625 0.016 0.000 0.808 0.176
#> GSM97131     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97137     1  0.1661      0.797 0.944 0.052 0.000 0.004
#> GSM97118     3  0.6714      0.608 0.228 0.000 0.612 0.160
#> GSM97114     1  0.3323      0.793 0.876 0.064 0.000 0.060
#> GSM97142     3  0.7314      0.533 0.336 0.000 0.496 0.168
#> GSM97140     1  0.4874      0.733 0.764 0.180 0.000 0.056
#> GSM97141     1  0.5550      0.653 0.692 0.248 0.000 0.060
#> GSM97055     3  0.3311      0.622 0.000 0.000 0.828 0.172
#> GSM97090     1  0.2542      0.798 0.904 0.084 0.000 0.012
#> GSM97091     3  0.3311      0.622 0.000 0.000 0.828 0.172
#> GSM97148     1  0.0188      0.777 0.996 0.000 0.000 0.004
#> GSM97063     3  0.3311      0.622 0.000 0.000 0.828 0.172
#> GSM97053     1  0.1362      0.768 0.964 0.004 0.020 0.012
#> GSM97066     4  0.0336      0.934 0.008 0.000 0.000 0.992
#> GSM97079     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97083     3  0.3681      0.624 0.008 0.000 0.816 0.176
#> GSM97084     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97094     1  0.6040      0.543 0.708 0.044 0.208 0.040
#> GSM97096     3  0.8153      0.452 0.320 0.092 0.508 0.080
#> GSM97097     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97107     1  0.5080      0.751 0.764 0.092 0.000 0.144
#> GSM97054     2  0.0921      0.857 0.028 0.972 0.000 0.000
#> GSM97062     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97069     3  0.4883      0.329 0.000 0.016 0.696 0.288
#> GSM97070     4  0.0336      0.934 0.008 0.000 0.000 0.992
#> GSM97073     4  0.0336      0.934 0.008 0.000 0.000 0.992
#> GSM97076     4  0.2124      0.876 0.008 0.000 0.068 0.924
#> GSM97077     1  0.6421      0.228 0.508 0.432 0.004 0.056
#> GSM97095     1  0.5972      0.574 0.720 0.048 0.192 0.040
#> GSM97102     3  0.3080      0.550 0.000 0.024 0.880 0.096
#> GSM97109     1  0.3323      0.793 0.876 0.064 0.000 0.060
#> GSM97110     2  0.7505      0.301 0.332 0.544 0.052 0.072
#> GSM97074     4  0.2124      0.876 0.008 0.000 0.068 0.924
#> GSM97085     3  0.3311      0.622 0.000 0.000 0.828 0.172
#> GSM97059     1  0.4874      0.733 0.764 0.180 0.000 0.056
#> GSM97072     4  0.4088      0.724 0.008 0.012 0.172 0.808
#> GSM97078     3  0.7680      0.527 0.328 0.028 0.520 0.124
#> GSM97067     4  0.0336      0.934 0.008 0.000 0.000 0.992
#> GSM97087     3  0.4022      0.548 0.000 0.068 0.836 0.096
#> GSM97111     1  0.3323      0.793 0.876 0.064 0.000 0.060
#> GSM97064     2  0.3215      0.828 0.064 0.892 0.024 0.020
#> GSM97065     4  0.0336      0.934 0.008 0.000 0.000 0.992
#> GSM97081     3  0.8166      0.445 0.324 0.092 0.504 0.080
#> GSM97082     3  0.4022      0.548 0.000 0.068 0.836 0.096
#> GSM97088     3  0.3681      0.624 0.008 0.000 0.816 0.176
#> GSM97100     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97104     3  0.3080      0.550 0.000 0.024 0.880 0.096
#> GSM97108     1  0.5769      0.592 0.652 0.292 0.000 0.056
#> GSM97050     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97080     3  0.3763      0.521 0.000 0.024 0.832 0.144
#> GSM97089     3  0.4402      0.549 0.012 0.064 0.828 0.096
#> GSM97092     2  0.2667      0.813 0.008 0.912 0.060 0.020
#> GSM97093     2  0.8382     -0.133 0.324 0.348 0.312 0.016
#> GSM97058     2  0.2408      0.819 0.104 0.896 0.000 0.000
#> GSM97051     2  0.0817      0.858 0.024 0.976 0.000 0.000
#> GSM97052     2  0.2335      0.812 0.000 0.920 0.060 0.020
#> GSM97061     2  0.2335      0.812 0.000 0.920 0.060 0.020

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     5  0.5811     0.5049 0.340 0.000 0.000 0.108 0.552
#> GSM97145     1  0.1787     0.7702 0.936 0.016 0.004 0.000 0.044
#> GSM97147     1  0.4352     0.7179 0.772 0.172 0.020 0.036 0.000
#> GSM97125     1  0.5811     0.4021 0.640 0.012 0.004 0.100 0.244
#> GSM97127     1  0.1787     0.7702 0.936 0.016 0.004 0.000 0.044
#> GSM97130     1  0.3646     0.7630 0.848 0.064 0.016 0.068 0.004
#> GSM97133     1  0.1787     0.7702 0.936 0.016 0.004 0.000 0.044
#> GSM97134     1  0.1975     0.7750 0.936 0.020 0.004 0.016 0.024
#> GSM97120     1  0.1787     0.7702 0.936 0.016 0.004 0.000 0.044
#> GSM97126     5  0.5276     0.6819 0.148 0.000 0.024 0.108 0.720
#> GSM97112     5  0.2228     0.6805 0.020 0.000 0.056 0.008 0.916
#> GSM97115     1  0.2780     0.7669 0.872 0.112 0.008 0.004 0.004
#> GSM97116     1  0.5470     0.3386 0.628 0.000 0.000 0.104 0.268
#> GSM97117     1  0.2901     0.7701 0.888 0.048 0.020 0.044 0.000
#> GSM97119     5  0.5449     0.6258 0.256 0.000 0.000 0.108 0.636
#> GSM97122     5  0.5472     0.6216 0.260 0.000 0.000 0.108 0.632
#> GSM97135     5  0.5303     0.6439 0.232 0.000 0.000 0.108 0.660
#> GSM97136     3  0.7511     0.2548 0.296 0.000 0.412 0.044 0.248
#> GSM97139     1  0.1732     0.7485 0.920 0.000 0.000 0.000 0.080
#> GSM97146     1  0.2921     0.7134 0.856 0.000 0.000 0.020 0.124
#> GSM97123     2  0.2280     0.7998 0.000 0.880 0.120 0.000 0.000
#> GSM97129     1  0.2227     0.7795 0.924 0.032 0.004 0.028 0.012
#> GSM97143     5  0.5276     0.6819 0.148 0.000 0.024 0.108 0.720
#> GSM97113     2  0.3935     0.7182 0.140 0.808 0.016 0.036 0.000
#> GSM97056     1  0.1525     0.7720 0.948 0.012 0.004 0.000 0.036
#> GSM97124     1  0.2082     0.7679 0.928 0.012 0.004 0.012 0.044
#> GSM97132     1  0.5876    -0.0385 0.512 0.000 0.000 0.104 0.384
#> GSM97144     1  0.3646     0.7630 0.848 0.064 0.016 0.068 0.004
#> GSM97149     1  0.1792     0.7465 0.916 0.000 0.000 0.000 0.084
#> GSM97068     2  0.2074     0.8045 0.104 0.896 0.000 0.000 0.000
#> GSM97071     1  0.5751     0.5314 0.620 0.048 0.028 0.300 0.004
#> GSM97086     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97103     2  0.6520     0.4191 0.268 0.576 0.116 0.040 0.000
#> GSM97057     2  0.2020     0.8078 0.100 0.900 0.000 0.000 0.000
#> GSM97060     2  0.3857     0.5934 0.000 0.688 0.312 0.000 0.000
#> GSM97075     3  0.7411     0.4523 0.308 0.032 0.500 0.032 0.128
#> GSM97098     2  0.6520     0.4191 0.268 0.576 0.116 0.040 0.000
#> GSM97099     1  0.6906     0.1986 0.464 0.376 0.116 0.044 0.000
#> GSM97101     1  0.5134     0.6110 0.664 0.280 0.020 0.036 0.000
#> GSM97105     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97106     2  0.1608     0.8210 0.000 0.928 0.072 0.000 0.000
#> GSM97121     1  0.5134     0.6110 0.664 0.280 0.020 0.036 0.000
#> GSM97128     5  0.2408     0.6706 0.004 0.000 0.096 0.008 0.892
#> GSM97131     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97137     1  0.1573     0.7779 0.948 0.036 0.008 0.004 0.004
#> GSM97118     5  0.5223     0.6829 0.144 0.000 0.028 0.100 0.728
#> GSM97114     1  0.2901     0.7701 0.888 0.048 0.020 0.044 0.000
#> GSM97142     5  0.5303     0.6439 0.232 0.000 0.000 0.108 0.660
#> GSM97140     1  0.4352     0.7179 0.772 0.172 0.020 0.036 0.000
#> GSM97141     1  0.4911     0.6658 0.708 0.232 0.020 0.040 0.000
#> GSM97055     5  0.2249     0.6681 0.000 0.000 0.096 0.008 0.896
#> GSM97090     1  0.2512     0.7799 0.904 0.068 0.008 0.012 0.008
#> GSM97091     5  0.2249     0.6681 0.000 0.000 0.096 0.008 0.896
#> GSM97148     1  0.1792     0.7465 0.916 0.000 0.000 0.000 0.084
#> GSM97063     5  0.2249     0.6681 0.000 0.000 0.096 0.008 0.896
#> GSM97053     1  0.2305     0.7378 0.896 0.000 0.000 0.012 0.092
#> GSM97066     4  0.1410     0.9438 0.000 0.000 0.060 0.940 0.000
#> GSM97079     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97083     5  0.2304     0.6664 0.000 0.000 0.100 0.008 0.892
#> GSM97084     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97094     1  0.5978     0.5489 0.672 0.040 0.024 0.048 0.216
#> GSM97096     3  0.7398     0.4546 0.304 0.032 0.504 0.032 0.128
#> GSM97097     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97107     1  0.4965     0.7218 0.764 0.076 0.028 0.124 0.008
#> GSM97054     2  0.0451     0.8571 0.008 0.988 0.004 0.000 0.000
#> GSM97062     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97069     3  0.4367     0.4592 0.000 0.000 0.748 0.192 0.060
#> GSM97070     4  0.1410     0.9438 0.000 0.000 0.060 0.940 0.000
#> GSM97073     4  0.1410     0.9438 0.000 0.000 0.060 0.940 0.000
#> GSM97076     4  0.0566     0.8972 0.000 0.000 0.004 0.984 0.012
#> GSM97077     1  0.5690     0.2518 0.508 0.432 0.024 0.036 0.000
#> GSM97095     1  0.5930     0.5803 0.684 0.044 0.024 0.048 0.200
#> GSM97102     3  0.1608     0.6219 0.000 0.000 0.928 0.000 0.072
#> GSM97109     1  0.2901     0.7701 0.888 0.048 0.020 0.044 0.000
#> GSM97110     2  0.6442     0.2766 0.332 0.544 0.080 0.044 0.000
#> GSM97074     4  0.0566     0.8972 0.000 0.000 0.004 0.984 0.012
#> GSM97085     5  0.2249     0.6681 0.000 0.000 0.096 0.008 0.896
#> GSM97059     1  0.4352     0.7179 0.772 0.172 0.020 0.036 0.000
#> GSM97072     4  0.3750     0.7435 0.000 0.012 0.232 0.756 0.000
#> GSM97078     5  0.7703     0.3289 0.284 0.028 0.152 0.048 0.488
#> GSM97067     4  0.1410     0.9438 0.000 0.000 0.060 0.940 0.000
#> GSM97087     3  0.1041     0.6254 0.000 0.004 0.964 0.000 0.032
#> GSM97111     1  0.2901     0.7701 0.888 0.048 0.020 0.044 0.000
#> GSM97064     2  0.3102     0.8148 0.056 0.860 0.084 0.000 0.000
#> GSM97065     4  0.1410     0.9438 0.000 0.000 0.060 0.940 0.000
#> GSM97081     3  0.7411     0.4523 0.308 0.032 0.500 0.032 0.128
#> GSM97082     3  0.1041     0.6254 0.000 0.004 0.964 0.000 0.032
#> GSM97088     5  0.2304     0.6664 0.000 0.000 0.100 0.008 0.892
#> GSM97100     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97104     3  0.1608     0.6219 0.000 0.000 0.928 0.000 0.072
#> GSM97108     1  0.5134     0.6110 0.664 0.280 0.020 0.036 0.000
#> GSM97050     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97080     3  0.2782     0.6018 0.000 0.000 0.880 0.048 0.072
#> GSM97089     3  0.1757     0.6318 0.012 0.004 0.936 0.000 0.048
#> GSM97092     2  0.2886     0.7807 0.008 0.844 0.148 0.000 0.000
#> GSM97093     3  0.7801     0.2756 0.308 0.280 0.352 0.000 0.060
#> GSM97058     2  0.2020     0.8078 0.100 0.900 0.000 0.000 0.000
#> GSM97051     2  0.0162     0.8588 0.004 0.996 0.000 0.000 0.000
#> GSM97052     2  0.2605     0.7809 0.000 0.852 0.148 0.000 0.000
#> GSM97061     2  0.2605     0.7809 0.000 0.852 0.148 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     5  0.6198     0.0963 0.408 0.156 0.000 0.000 0.412 0.024
#> GSM97145     2  0.3765     0.0263 0.404 0.596 0.000 0.000 0.000 0.000
#> GSM97147     2  0.2092     0.4687 0.000 0.876 0.000 0.124 0.000 0.000
#> GSM97125     1  0.6122     0.6401 0.440 0.384 0.000 0.000 0.156 0.020
#> GSM97127     2  0.3765     0.0263 0.404 0.596 0.000 0.000 0.000 0.000
#> GSM97130     2  0.3967     0.3543 0.356 0.632 0.000 0.012 0.000 0.000
#> GSM97133     2  0.3756     0.0318 0.400 0.600 0.000 0.000 0.000 0.000
#> GSM97134     2  0.3636     0.2018 0.320 0.676 0.000 0.000 0.000 0.004
#> GSM97120     2  0.3765     0.0263 0.404 0.596 0.000 0.000 0.000 0.000
#> GSM97126     5  0.4668     0.5972 0.324 0.024 0.000 0.000 0.628 0.024
#> GSM97112     5  0.1124     0.6842 0.036 0.008 0.000 0.000 0.956 0.000
#> GSM97115     2  0.4619     0.3442 0.244 0.668 0.000 0.088 0.000 0.000
#> GSM97116     1  0.6000     0.6781 0.504 0.324 0.000 0.000 0.152 0.020
#> GSM97117     2  0.0653     0.4634 0.012 0.980 0.000 0.004 0.000 0.004
#> GSM97119     5  0.5500     0.4445 0.412 0.068 0.000 0.000 0.496 0.024
#> GSM97122     5  0.5504     0.4386 0.416 0.068 0.000 0.000 0.492 0.024
#> GSM97135     5  0.5299     0.4833 0.404 0.052 0.000 0.000 0.520 0.024
#> GSM97136     3  0.8146     0.3322 0.192 0.180 0.396 0.000 0.176 0.056
#> GSM97139     2  0.4095    -0.2570 0.480 0.512 0.000 0.000 0.008 0.000
#> GSM97146     1  0.4500     0.1799 0.496 0.480 0.000 0.000 0.012 0.012
#> GSM97123     4  0.2964     0.7949 0.032 0.004 0.108 0.852 0.004 0.000
#> GSM97129     2  0.3109     0.3317 0.224 0.772 0.000 0.000 0.000 0.004
#> GSM97143     5  0.4668     0.5972 0.324 0.024 0.000 0.000 0.628 0.024
#> GSM97113     4  0.3109     0.7038 0.004 0.224 0.000 0.772 0.000 0.000
#> GSM97056     2  0.3892     0.1567 0.352 0.640 0.000 0.004 0.004 0.000
#> GSM97124     2  0.3819     0.0681 0.372 0.624 0.000 0.000 0.004 0.000
#> GSM97132     1  0.6376     0.5074 0.448 0.272 0.000 0.000 0.260 0.020
#> GSM97144     2  0.3967     0.3543 0.356 0.632 0.000 0.012 0.000 0.000
#> GSM97149     2  0.4080    -0.2005 0.456 0.536 0.000 0.000 0.008 0.000
#> GSM97068     4  0.2048     0.7949 0.000 0.120 0.000 0.880 0.000 0.000
#> GSM97071     2  0.5925     0.2373 0.244 0.552 0.004 0.012 0.000 0.188
#> GSM97086     4  0.0146     0.8519 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97103     4  0.5854     0.4278 0.032 0.344 0.088 0.532 0.000 0.004
#> GSM97057     4  0.2003     0.7984 0.000 0.116 0.000 0.884 0.000 0.000
#> GSM97060     4  0.4408     0.5903 0.032 0.004 0.300 0.660 0.004 0.000
#> GSM97075     3  0.7776     0.4865 0.168 0.212 0.468 0.008 0.096 0.048
#> GSM97098     4  0.5854     0.4278 0.032 0.344 0.088 0.532 0.000 0.004
#> GSM97099     2  0.5788     0.1419 0.032 0.556 0.088 0.320 0.000 0.004
#> GSM97101     2  0.3023     0.4186 0.000 0.768 0.000 0.232 0.000 0.000
#> GSM97105     4  0.0146     0.8519 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97106     4  0.2069     0.8198 0.020 0.000 0.068 0.908 0.004 0.000
#> GSM97121     2  0.3023     0.4186 0.000 0.768 0.000 0.232 0.000 0.000
#> GSM97128     5  0.1390     0.6849 0.016 0.004 0.032 0.000 0.948 0.000
#> GSM97131     4  0.0146     0.8519 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97137     2  0.3695     0.3204 0.272 0.712 0.000 0.016 0.000 0.000
#> GSM97118     5  0.4622     0.6045 0.316 0.020 0.004 0.000 0.640 0.020
#> GSM97114     2  0.0653     0.4634 0.012 0.980 0.000 0.004 0.000 0.004
#> GSM97142     5  0.5299     0.4833 0.404 0.052 0.000 0.000 0.520 0.024
#> GSM97140     2  0.2234     0.4699 0.004 0.872 0.000 0.124 0.000 0.000
#> GSM97141     2  0.2805     0.4360 0.000 0.812 0.000 0.184 0.000 0.004
#> GSM97055     5  0.0547     0.6808 0.000 0.000 0.020 0.000 0.980 0.000
#> GSM97090     2  0.4193     0.3333 0.272 0.684 0.000 0.044 0.000 0.000
#> GSM97091     5  0.0547     0.6808 0.000 0.000 0.020 0.000 0.980 0.000
#> GSM97148     2  0.4080    -0.2005 0.456 0.536 0.000 0.000 0.008 0.000
#> GSM97063     5  0.0547     0.6808 0.000 0.000 0.020 0.000 0.980 0.000
#> GSM97053     2  0.4333    -0.3005 0.468 0.512 0.000 0.000 0.020 0.000
#> GSM97066     6  0.0000     0.9472 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97079     4  0.0146     0.8519 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97083     5  0.1151     0.6813 0.012 0.000 0.032 0.000 0.956 0.000
#> GSM97084     4  0.0000     0.8502 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97094     2  0.6200    -0.0887 0.324 0.472 0.000 0.008 0.188 0.008
#> GSM97096     3  0.7758     0.4883 0.168 0.208 0.472 0.008 0.096 0.048
#> GSM97097     4  0.0291     0.8503 0.004 0.004 0.000 0.992 0.000 0.000
#> GSM97107     2  0.4254     0.3098 0.352 0.624 0.004 0.020 0.000 0.000
#> GSM97054     4  0.0508     0.8493 0.004 0.012 0.000 0.984 0.000 0.000
#> GSM97062     4  0.0146     0.8519 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97069     3  0.3854     0.5223 0.016 0.000 0.768 0.000 0.032 0.184
#> GSM97070     6  0.0000     0.9472 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97073     6  0.0000     0.9472 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97076     6  0.1471     0.9085 0.064 0.000 0.000 0.000 0.004 0.932
#> GSM97077     2  0.4066     0.1476 0.012 0.596 0.000 0.392 0.000 0.000
#> GSM97095     2  0.6073    -0.0128 0.292 0.512 0.000 0.008 0.180 0.008
#> GSM97102     3  0.1461     0.6623 0.016 0.000 0.940 0.000 0.044 0.000
#> GSM97109     2  0.0653     0.4634 0.012 0.980 0.000 0.004 0.000 0.004
#> GSM97110     4  0.5556     0.3040 0.028 0.412 0.056 0.500 0.000 0.004
#> GSM97074     6  0.1471     0.9085 0.064 0.000 0.000 0.000 0.004 0.932
#> GSM97085     5  0.0547     0.6808 0.000 0.000 0.020 0.000 0.980 0.000
#> GSM97059     2  0.2234     0.4699 0.004 0.872 0.000 0.124 0.000 0.000
#> GSM97072     6  0.3121     0.7523 0.012 0.000 0.180 0.004 0.000 0.804
#> GSM97078     5  0.7783     0.3199 0.204 0.180 0.088 0.008 0.468 0.052
#> GSM97067     6  0.0000     0.9472 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97087     3  0.0363     0.6673 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM97111     2  0.0653     0.4634 0.012 0.980 0.000 0.004 0.000 0.004
#> GSM97064     4  0.3594     0.8033 0.032 0.068 0.064 0.832 0.004 0.000
#> GSM97065     6  0.0000     0.9472 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97081     3  0.7776     0.4865 0.168 0.212 0.468 0.008 0.096 0.048
#> GSM97082     3  0.0363     0.6673 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM97088     5  0.1151     0.6813 0.012 0.000 0.032 0.000 0.956 0.000
#> GSM97100     4  0.0146     0.8519 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97104     3  0.1461     0.6623 0.016 0.000 0.940 0.000 0.044 0.000
#> GSM97108     2  0.3023     0.4186 0.000 0.768 0.000 0.232 0.000 0.000
#> GSM97050     4  0.0146     0.8519 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97080     3  0.2171     0.6470 0.016 0.000 0.912 0.000 0.032 0.040
#> GSM97089     3  0.1074     0.6723 0.000 0.012 0.960 0.000 0.028 0.000
#> GSM97092     4  0.3475     0.7754 0.032 0.012 0.136 0.816 0.004 0.000
#> GSM97093     3  0.7731     0.2862 0.072 0.272 0.360 0.264 0.028 0.004
#> GSM97058     4  0.2003     0.7984 0.000 0.116 0.000 0.884 0.000 0.000
#> GSM97051     4  0.0146     0.8519 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97052     4  0.3266     0.7770 0.032 0.004 0.136 0.824 0.004 0.000
#> GSM97061     4  0.3266     0.7770 0.032 0.004 0.136 0.824 0.004 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-membership-heatmap-5

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)

plot of chunk tab-ATC-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-ATC-hclust-get-signatures-no-scale-1

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

plot of chunk tab-ATC-hclust-get-signatures-no-scale-2

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

plot of chunk tab-ATC-hclust-get-signatures-no-scale-3

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

plot of chunk tab-ATC-hclust-get-signatures-no-scale-4

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

plot of chunk tab-ATC-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-hclust-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-ATC-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-hclust-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:hclust 90          0.01978      0.0110     3.85e-01    0.121 2
#> ATC:hclust 81          0.03939      0.0731     2.47e-02    0.182 3
#> ATC:hclust 86          0.00566      0.0555     1.79e-06    0.460 4
#> ATC:hclust 85          0.00205      0.1029     3.40e-08    0.358 5
#> ATC:hclust 51          0.01687      0.1213     1.94e-06    0.382 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.


ATC:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "kmeans"]
# 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 21512 rows and 100 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)

plot of chunk ATC-kmeans-collect-plots

The plots are:

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:

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)

plot of chunk ATC-kmeans-select-partition-number

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.625           0.870       0.928         0.4997 0.495   0.495
#> 3 3 0.732           0.856       0.929         0.3259 0.699   0.466
#> 4 4 0.534           0.536       0.741         0.0990 0.897   0.709
#> 5 5 0.611           0.555       0.767         0.0692 0.778   0.377
#> 6 6 0.773           0.830       0.868         0.0557 0.872   0.511

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0376      0.892 0.996 0.004
#> GSM97145     1  0.3431      0.865 0.936 0.064
#> GSM97147     2  0.0000      0.942 0.000 1.000
#> GSM97125     1  0.0376      0.892 0.996 0.004
#> GSM97127     2  0.8207      0.700 0.256 0.744
#> GSM97130     2  0.8016      0.714 0.244 0.756
#> GSM97133     2  0.8016      0.714 0.244 0.756
#> GSM97134     2  0.8813      0.637 0.300 0.700
#> GSM97120     1  0.3431      0.865 0.936 0.064
#> GSM97126     1  0.0376      0.892 0.996 0.004
#> GSM97112     1  0.0000      0.892 1.000 0.000
#> GSM97115     2  0.0000      0.942 0.000 1.000
#> GSM97116     1  0.0376      0.892 0.996 0.004
#> GSM97117     1  0.1184      0.892 0.984 0.016
#> GSM97119     1  0.0376      0.892 0.996 0.004
#> GSM97122     1  0.0376      0.892 0.996 0.004
#> GSM97135     1  0.0376      0.892 0.996 0.004
#> GSM97136     1  0.0000      0.892 1.000 0.000
#> GSM97139     1  0.3431      0.865 0.936 0.064
#> GSM97146     1  0.0376      0.892 0.996 0.004
#> GSM97123     2  0.0376      0.939 0.004 0.996
#> GSM97129     2  0.4431      0.872 0.092 0.908
#> GSM97143     1  0.0000      0.892 1.000 0.000
#> GSM97113     2  0.0000      0.942 0.000 1.000
#> GSM97056     2  0.8016      0.714 0.244 0.756
#> GSM97124     1  0.1843      0.883 0.972 0.028
#> GSM97132     1  0.0376      0.892 0.996 0.004
#> GSM97144     2  0.8016      0.714 0.244 0.756
#> GSM97149     2  0.8016      0.714 0.244 0.756
#> GSM97068     2  0.0000      0.942 0.000 1.000
#> GSM97071     1  0.8443      0.743 0.728 0.272
#> GSM97086     2  0.0000      0.942 0.000 1.000
#> GSM97103     2  0.0000      0.942 0.000 1.000
#> GSM97057     2  0.0000      0.942 0.000 1.000
#> GSM97060     2  0.0376      0.939 0.004 0.996
#> GSM97075     1  0.8661      0.725 0.712 0.288
#> GSM97098     2  0.0376      0.939 0.004 0.996
#> GSM97099     2  0.0000      0.942 0.000 1.000
#> GSM97101     2  0.0000      0.942 0.000 1.000
#> GSM97105     2  0.0000      0.942 0.000 1.000
#> GSM97106     2  0.0376      0.939 0.004 0.996
#> GSM97121     2  0.0000      0.942 0.000 1.000
#> GSM97128     1  0.0000      0.892 1.000 0.000
#> GSM97131     2  0.0000      0.942 0.000 1.000
#> GSM97137     2  0.8016      0.714 0.244 0.756
#> GSM97118     1  0.0000      0.892 1.000 0.000
#> GSM97114     2  0.2948      0.902 0.052 0.948
#> GSM97142     1  0.0000      0.892 1.000 0.000
#> GSM97140     2  0.0000      0.942 0.000 1.000
#> GSM97141     2  0.0000      0.942 0.000 1.000
#> GSM97055     1  0.0000      0.892 1.000 0.000
#> GSM97090     2  0.0000      0.942 0.000 1.000
#> GSM97091     1  0.0000      0.892 1.000 0.000
#> GSM97148     1  0.3431      0.865 0.936 0.064
#> GSM97063     1  0.0000      0.892 1.000 0.000
#> GSM97053     1  0.0672      0.891 0.992 0.008
#> GSM97066     1  0.7056      0.816 0.808 0.192
#> GSM97079     2  0.0000      0.942 0.000 1.000
#> GSM97083     1  0.0000      0.892 1.000 0.000
#> GSM97084     2  0.0000      0.942 0.000 1.000
#> GSM97094     1  0.3431      0.865 0.936 0.064
#> GSM97096     1  0.8016      0.775 0.756 0.244
#> GSM97097     2  0.0000      0.942 0.000 1.000
#> GSM97107     2  0.1414      0.928 0.020 0.980
#> GSM97054     2  0.0000      0.942 0.000 1.000
#> GSM97062     2  0.0000      0.942 0.000 1.000
#> GSM97069     1  0.7602      0.796 0.780 0.220
#> GSM97070     1  0.7056      0.816 0.808 0.192
#> GSM97073     1  0.7056      0.816 0.808 0.192
#> GSM97076     1  0.0376      0.892 0.996 0.004
#> GSM97077     2  0.0000      0.942 0.000 1.000
#> GSM97095     2  0.8909      0.486 0.308 0.692
#> GSM97102     1  0.7602      0.796 0.780 0.220
#> GSM97109     2  0.0000      0.942 0.000 1.000
#> GSM97110     2  0.0000      0.942 0.000 1.000
#> GSM97074     1  0.0000      0.892 1.000 0.000
#> GSM97085     1  0.0000      0.892 1.000 0.000
#> GSM97059     2  0.0000      0.942 0.000 1.000
#> GSM97072     2  0.1843      0.919 0.028 0.972
#> GSM97078     1  0.6973      0.818 0.812 0.188
#> GSM97067     1  0.7056      0.816 0.808 0.192
#> GSM97087     1  0.8016      0.775 0.756 0.244
#> GSM97111     1  0.9460      0.600 0.636 0.364
#> GSM97064     2  0.0000      0.942 0.000 1.000
#> GSM97065     1  0.7139      0.815 0.804 0.196
#> GSM97081     1  0.8016      0.775 0.756 0.244
#> GSM97082     1  0.8016      0.775 0.756 0.244
#> GSM97088     1  0.0000      0.892 1.000 0.000
#> GSM97100     2  0.0000      0.942 0.000 1.000
#> GSM97104     1  0.8016      0.775 0.756 0.244
#> GSM97108     2  0.0000      0.942 0.000 1.000
#> GSM97050     2  0.0000      0.942 0.000 1.000
#> GSM97080     1  0.8016      0.775 0.756 0.244
#> GSM97089     1  0.8016      0.775 0.756 0.244
#> GSM97092     2  0.0376      0.939 0.004 0.996
#> GSM97093     2  0.0376      0.939 0.004 0.996
#> GSM97058     2  0.0000      0.942 0.000 1.000
#> GSM97051     2  0.0000      0.942 0.000 1.000
#> GSM97052     2  0.0376      0.939 0.004 0.996
#> GSM97061     2  0.0376      0.939 0.004 0.996

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0237      0.873 0.996 0.000 0.004
#> GSM97145     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97147     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97125     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97127     1  0.2066      0.857 0.940 0.060 0.000
#> GSM97130     1  0.5327      0.695 0.728 0.272 0.000
#> GSM97133     1  0.4235      0.795 0.824 0.176 0.000
#> GSM97134     1  0.3816      0.813 0.852 0.148 0.000
#> GSM97120     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97126     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97112     1  0.3412      0.778 0.876 0.000 0.124
#> GSM97115     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97116     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97117     1  0.0424      0.872 0.992 0.000 0.008
#> GSM97119     1  0.0237      0.873 0.996 0.000 0.004
#> GSM97122     1  0.0237      0.873 0.996 0.000 0.004
#> GSM97135     1  0.0237      0.873 0.996 0.000 0.004
#> GSM97136     3  0.1031      0.886 0.024 0.000 0.976
#> GSM97139     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97146     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97123     2  0.0424      0.973 0.000 0.992 0.008
#> GSM97129     1  0.4346      0.788 0.816 0.184 0.000
#> GSM97143     1  0.2878      0.807 0.904 0.000 0.096
#> GSM97113     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97056     1  0.2878      0.842 0.904 0.096 0.000
#> GSM97124     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97132     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97144     1  0.5327      0.695 0.728 0.272 0.000
#> GSM97149     1  0.3192      0.834 0.888 0.112 0.000
#> GSM97068     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97071     3  0.6180      0.622 0.260 0.024 0.716
#> GSM97086     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97103     2  0.0747      0.966 0.000 0.984 0.016
#> GSM97057     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97060     3  0.5882      0.482 0.000 0.348 0.652
#> GSM97075     3  0.6264      0.630 0.256 0.028 0.716
#> GSM97098     2  0.1031      0.960 0.000 0.976 0.024
#> GSM97099     2  0.0747      0.966 0.000 0.984 0.016
#> GSM97101     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97105     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97106     2  0.0424      0.973 0.000 0.992 0.008
#> GSM97121     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97128     3  0.4062      0.784 0.164 0.000 0.836
#> GSM97131     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97137     1  0.5327      0.695 0.728 0.272 0.000
#> GSM97118     1  0.6215      0.164 0.572 0.000 0.428
#> GSM97114     1  0.5216      0.712 0.740 0.260 0.000
#> GSM97142     1  0.1860      0.844 0.948 0.000 0.052
#> GSM97140     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97141     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97055     3  0.5733      0.565 0.324 0.000 0.676
#> GSM97090     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97091     3  0.5760      0.558 0.328 0.000 0.672
#> GSM97148     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97063     1  0.5327      0.558 0.728 0.000 0.272
#> GSM97053     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97066     3  0.0475      0.889 0.004 0.004 0.992
#> GSM97079     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97083     3  0.4291      0.768 0.180 0.000 0.820
#> GSM97084     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97094     1  0.0000      0.874 1.000 0.000 0.000
#> GSM97096     3  0.0829      0.889 0.012 0.004 0.984
#> GSM97097     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97107     2  0.3551      0.824 0.132 0.868 0.000
#> GSM97054     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97062     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97069     3  0.0237      0.888 0.000 0.004 0.996
#> GSM97070     3  0.0475      0.889 0.004 0.004 0.992
#> GSM97073     3  0.0475      0.889 0.004 0.004 0.992
#> GSM97076     1  0.3816      0.763 0.852 0.000 0.148
#> GSM97077     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97095     1  0.6019      0.661 0.700 0.288 0.012
#> GSM97102     3  0.0237      0.888 0.000 0.004 0.996
#> GSM97109     2  0.5363      0.561 0.276 0.724 0.000
#> GSM97110     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97074     3  0.1031      0.883 0.024 0.000 0.976
#> GSM97085     3  0.1289      0.882 0.032 0.000 0.968
#> GSM97059     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97072     3  0.1964      0.857 0.000 0.056 0.944
#> GSM97078     3  0.1399      0.886 0.028 0.004 0.968
#> GSM97067     3  0.0475      0.889 0.004 0.004 0.992
#> GSM97087     3  0.0829      0.889 0.012 0.004 0.984
#> GSM97111     1  0.5268      0.760 0.776 0.212 0.012
#> GSM97064     2  0.0237      0.975 0.000 0.996 0.004
#> GSM97065     3  0.5443      0.640 0.260 0.004 0.736
#> GSM97081     3  0.0829      0.889 0.012 0.004 0.984
#> GSM97082     3  0.0829      0.889 0.012 0.004 0.984
#> GSM97088     3  0.0747      0.888 0.016 0.000 0.984
#> GSM97100     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97104     3  0.0237      0.888 0.000 0.004 0.996
#> GSM97108     2  0.0237      0.976 0.004 0.996 0.000
#> GSM97050     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97080     3  0.0237      0.888 0.000 0.004 0.996
#> GSM97089     3  0.0829      0.889 0.012 0.004 0.984
#> GSM97092     3  0.5882      0.482 0.000 0.348 0.652
#> GSM97093     2  0.0747      0.968 0.000 0.984 0.016
#> GSM97058     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97051     2  0.0000      0.977 0.000 1.000 0.000
#> GSM97052     2  0.4346      0.753 0.000 0.816 0.184
#> GSM97061     2  0.0424      0.973 0.000 0.992 0.008

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.4907     0.0550 0.580 0.000 0.000 0.420
#> GSM97145     1  0.0817     0.7171 0.976 0.000 0.000 0.024
#> GSM97147     2  0.5936     0.5572 0.324 0.620 0.056 0.000
#> GSM97125     1  0.2921     0.6400 0.860 0.000 0.000 0.140
#> GSM97127     1  0.1022     0.7243 0.968 0.032 0.000 0.000
#> GSM97130     1  0.3743     0.6707 0.824 0.160 0.000 0.016
#> GSM97133     1  0.2814     0.6933 0.868 0.132 0.000 0.000
#> GSM97134     1  0.3190     0.7054 0.880 0.096 0.008 0.016
#> GSM97120     1  0.0817     0.7171 0.976 0.000 0.000 0.024
#> GSM97126     1  0.3311     0.6006 0.828 0.000 0.000 0.172
#> GSM97112     4  0.4955     0.2893 0.444 0.000 0.000 0.556
#> GSM97115     2  0.5997     0.4830 0.368 0.592 0.028 0.012
#> GSM97116     1  0.3123     0.6183 0.844 0.000 0.000 0.156
#> GSM97117     1  0.2401     0.6931 0.904 0.000 0.092 0.004
#> GSM97119     1  0.4907     0.0550 0.580 0.000 0.000 0.420
#> GSM97122     1  0.4907     0.0550 0.580 0.000 0.000 0.420
#> GSM97135     1  0.4907     0.0550 0.580 0.000 0.000 0.420
#> GSM97136     4  0.5755    -0.1691 0.028 0.000 0.444 0.528
#> GSM97139     1  0.1474     0.7072 0.948 0.000 0.000 0.052
#> GSM97146     1  0.3123     0.6183 0.844 0.000 0.000 0.156
#> GSM97123     2  0.4277     0.5673 0.000 0.720 0.280 0.000
#> GSM97129     1  0.4617     0.6676 0.812 0.100 0.080 0.008
#> GSM97143     1  0.4999    -0.1940 0.508 0.000 0.000 0.492
#> GSM97113     2  0.0000     0.7861 0.000 1.000 0.000 0.000
#> GSM97056     1  0.1576     0.7237 0.948 0.048 0.000 0.004
#> GSM97124     1  0.1389     0.7108 0.952 0.000 0.000 0.048
#> GSM97132     1  0.1557     0.7120 0.944 0.000 0.000 0.056
#> GSM97144     1  0.3743     0.6707 0.824 0.160 0.000 0.016
#> GSM97149     1  0.1557     0.7229 0.944 0.056 0.000 0.000
#> GSM97068     2  0.1042     0.7839 0.020 0.972 0.000 0.008
#> GSM97071     3  0.7795     0.2626 0.264 0.004 0.468 0.264
#> GSM97086     2  0.0336     0.7849 0.000 0.992 0.000 0.008
#> GSM97103     2  0.5926     0.5512 0.060 0.632 0.308 0.000
#> GSM97057     2  0.0000     0.7861 0.000 1.000 0.000 0.000
#> GSM97060     3  0.4901     0.5207 0.000 0.112 0.780 0.108
#> GSM97075     3  0.8004     0.2174 0.368 0.044 0.472 0.116
#> GSM97098     2  0.4996     0.2335 0.000 0.516 0.484 0.000
#> GSM97099     2  0.7453     0.4658 0.300 0.496 0.204 0.000
#> GSM97101     2  0.2816     0.7687 0.036 0.900 0.064 0.000
#> GSM97105     2  0.0000     0.7861 0.000 1.000 0.000 0.000
#> GSM97106     2  0.4103     0.5780 0.000 0.744 0.256 0.000
#> GSM97121     2  0.5491     0.6373 0.260 0.688 0.052 0.000
#> GSM97128     4  0.4938     0.5995 0.148 0.000 0.080 0.772
#> GSM97131     2  0.0000     0.7861 0.000 1.000 0.000 0.000
#> GSM97137     1  0.3743     0.6707 0.824 0.160 0.000 0.016
#> GSM97118     4  0.4746     0.5514 0.304 0.000 0.008 0.688
#> GSM97114     1  0.4979     0.6030 0.760 0.176 0.064 0.000
#> GSM97142     4  0.4994     0.1852 0.480 0.000 0.000 0.520
#> GSM97140     2  0.6033     0.5641 0.316 0.620 0.064 0.000
#> GSM97141     2  0.6182     0.5714 0.308 0.616 0.076 0.000
#> GSM97055     4  0.4098     0.6414 0.204 0.000 0.012 0.784
#> GSM97090     2  0.6616     0.2694 0.456 0.480 0.052 0.012
#> GSM97091     4  0.4098     0.6414 0.204 0.000 0.012 0.784
#> GSM97148     1  0.1389     0.7095 0.952 0.000 0.000 0.048
#> GSM97063     4  0.4428     0.6041 0.276 0.000 0.004 0.720
#> GSM97053     1  0.2469     0.6675 0.892 0.000 0.000 0.108
#> GSM97066     3  0.4564     0.4858 0.000 0.000 0.672 0.328
#> GSM97079     2  0.0336     0.7849 0.000 0.992 0.000 0.008
#> GSM97083     4  0.5032     0.6059 0.156 0.000 0.080 0.764
#> GSM97084     2  0.0336     0.7849 0.000 0.992 0.000 0.008
#> GSM97094     1  0.2188     0.7175 0.936 0.012 0.032 0.020
#> GSM97096     3  0.3668     0.5424 0.000 0.004 0.808 0.188
#> GSM97097     2  0.0336     0.7849 0.000 0.992 0.000 0.008
#> GSM97107     2  0.6611     0.2335 0.460 0.480 0.040 0.020
#> GSM97054     2  0.0336     0.7849 0.000 0.992 0.000 0.008
#> GSM97062     2  0.0336     0.7849 0.000 0.992 0.000 0.008
#> GSM97069     3  0.4500     0.4925 0.000 0.000 0.684 0.316
#> GSM97070     3  0.4564     0.4858 0.000 0.000 0.672 0.328
#> GSM97073     3  0.4477     0.4881 0.000 0.000 0.688 0.312
#> GSM97076     4  0.7550    -0.0905 0.192 0.000 0.372 0.436
#> GSM97077     2  0.2282     0.7742 0.024 0.924 0.052 0.000
#> GSM97095     1  0.5711     0.6116 0.744 0.140 0.100 0.016
#> GSM97102     3  0.4356     0.5369 0.000 0.000 0.708 0.292
#> GSM97109     1  0.6835     0.0272 0.540 0.360 0.096 0.004
#> GSM97110     2  0.5792     0.6829 0.168 0.708 0.124 0.000
#> GSM97074     3  0.4998     0.2595 0.000 0.000 0.512 0.488
#> GSM97085     4  0.4857     0.2530 0.016 0.000 0.284 0.700
#> GSM97059     2  0.5973     0.5463 0.332 0.612 0.056 0.000
#> GSM97072     3  0.4122     0.5123 0.000 0.004 0.760 0.236
#> GSM97078     3  0.8017     0.3778 0.124 0.048 0.512 0.316
#> GSM97067     3  0.4564     0.4858 0.000 0.000 0.672 0.328
#> GSM97087     3  0.4277     0.5427 0.000 0.000 0.720 0.280
#> GSM97111     1  0.5106     0.6426 0.780 0.112 0.100 0.008
#> GSM97064     2  0.1474     0.7716 0.000 0.948 0.052 0.000
#> GSM97065     3  0.7458     0.2969 0.240 0.000 0.508 0.252
#> GSM97081     3  0.3810     0.5415 0.000 0.008 0.804 0.188
#> GSM97082     3  0.4277     0.5427 0.000 0.000 0.720 0.280
#> GSM97088     4  0.4857     0.1628 0.008 0.000 0.324 0.668
#> GSM97100     2  0.0000     0.7861 0.000 1.000 0.000 0.000
#> GSM97104     3  0.4304     0.5419 0.000 0.000 0.716 0.284
#> GSM97108     2  0.4514     0.7270 0.148 0.796 0.056 0.000
#> GSM97050     2  0.0000     0.7861 0.000 1.000 0.000 0.000
#> GSM97080     3  0.4304     0.5419 0.000 0.000 0.716 0.284
#> GSM97089     3  0.4250     0.5441 0.000 0.000 0.724 0.276
#> GSM97092     3  0.4728     0.5228 0.000 0.104 0.792 0.104
#> GSM97093     3  0.9359     0.0544 0.300 0.220 0.376 0.104
#> GSM97058     2  0.0188     0.7855 0.000 0.996 0.004 0.000
#> GSM97051     2  0.0000     0.7861 0.000 1.000 0.000 0.000
#> GSM97052     3  0.6712     0.2302 0.000 0.344 0.552 0.104
#> GSM97061     2  0.4304     0.5615 0.000 0.716 0.284 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     5  0.2719     0.5081 0.144 0.000 0.000 0.004 0.852
#> GSM97145     1  0.4211     0.4733 0.636 0.000 0.000 0.004 0.360
#> GSM97147     1  0.4325     0.3958 0.684 0.300 0.012 0.004 0.000
#> GSM97125     5  0.4449    -0.2256 0.484 0.000 0.000 0.004 0.512
#> GSM97127     1  0.3884     0.5531 0.708 0.000 0.000 0.004 0.288
#> GSM97130     1  0.3099     0.6320 0.848 0.008 0.000 0.012 0.132
#> GSM97133     1  0.3790     0.5655 0.724 0.000 0.000 0.004 0.272
#> GSM97134     1  0.2818     0.6321 0.856 0.000 0.000 0.012 0.132
#> GSM97120     1  0.4251     0.4563 0.624 0.000 0.000 0.004 0.372
#> GSM97126     5  0.4437    -0.1788 0.464 0.000 0.004 0.000 0.532
#> GSM97112     5  0.3379     0.5834 0.016 0.000 0.008 0.148 0.828
#> GSM97115     1  0.4536     0.4110 0.656 0.324 0.004 0.016 0.000
#> GSM97116     5  0.4443    -0.1924 0.472 0.000 0.000 0.004 0.524
#> GSM97117     1  0.1956     0.6415 0.928 0.008 0.012 0.000 0.052
#> GSM97119     5  0.2719     0.5081 0.144 0.000 0.000 0.004 0.852
#> GSM97122     5  0.2561     0.5044 0.144 0.000 0.000 0.000 0.856
#> GSM97135     5  0.2719     0.5081 0.144 0.000 0.000 0.004 0.852
#> GSM97136     3  0.5992    -0.1171 0.000 0.000 0.472 0.112 0.416
#> GSM97139     1  0.4375     0.3740 0.576 0.000 0.000 0.004 0.420
#> GSM97146     5  0.4443    -0.1955 0.472 0.000 0.000 0.004 0.524
#> GSM97123     3  0.5974     0.3641 0.100 0.380 0.516 0.004 0.000
#> GSM97129     1  0.2302     0.6453 0.904 0.008 0.008 0.000 0.080
#> GSM97143     5  0.2871     0.5883 0.040 0.000 0.000 0.088 0.872
#> GSM97113     2  0.0000     0.8446 0.000 1.000 0.000 0.000 0.000
#> GSM97056     1  0.3849     0.5761 0.752 0.000 0.000 0.016 0.232
#> GSM97124     1  0.4658     0.3981 0.576 0.000 0.000 0.016 0.408
#> GSM97132     1  0.4430     0.4382 0.628 0.000 0.000 0.012 0.360
#> GSM97144     1  0.3099     0.6320 0.848 0.008 0.000 0.012 0.132
#> GSM97149     1  0.3838     0.5640 0.716 0.000 0.000 0.004 0.280
#> GSM97068     2  0.1270     0.8201 0.052 0.948 0.000 0.000 0.000
#> GSM97071     4  0.4281     0.7034 0.204 0.000 0.028 0.756 0.012
#> GSM97086     2  0.0451     0.8426 0.008 0.988 0.000 0.004 0.000
#> GSM97103     2  0.6842     0.1941 0.360 0.392 0.244 0.004 0.000
#> GSM97057     2  0.0000     0.8446 0.000 1.000 0.000 0.000 0.000
#> GSM97060     3  0.3396     0.6816 0.112 0.036 0.844 0.008 0.000
#> GSM97075     1  0.4633     0.2514 0.632 0.016 0.348 0.004 0.000
#> GSM97098     3  0.5335     0.6045 0.112 0.208 0.676 0.004 0.000
#> GSM97099     1  0.5759     0.3811 0.636 0.188 0.172 0.004 0.000
#> GSM97101     2  0.4500     0.5670 0.316 0.664 0.016 0.004 0.000
#> GSM97105     2  0.0000     0.8446 0.000 1.000 0.000 0.000 0.000
#> GSM97106     3  0.5814     0.2533 0.092 0.436 0.472 0.000 0.000
#> GSM97121     1  0.4661     0.2608 0.624 0.356 0.016 0.004 0.000
#> GSM97128     5  0.6606     0.4512 0.028 0.000 0.232 0.172 0.568
#> GSM97131     2  0.0162     0.8439 0.000 0.996 0.000 0.004 0.000
#> GSM97137     1  0.3099     0.6320 0.848 0.008 0.000 0.012 0.132
#> GSM97118     5  0.5430     0.5465 0.008 0.000 0.144 0.164 0.684
#> GSM97114     1  0.2569     0.6509 0.896 0.032 0.004 0.000 0.068
#> GSM97142     5  0.2625     0.5875 0.016 0.000 0.000 0.108 0.876
#> GSM97140     1  0.4359     0.4011 0.692 0.288 0.016 0.004 0.000
#> GSM97141     1  0.4359     0.4011 0.692 0.288 0.016 0.004 0.000
#> GSM97055     5  0.5530     0.5319 0.004 0.000 0.160 0.172 0.664
#> GSM97090     1  0.3504     0.5770 0.816 0.160 0.008 0.016 0.000
#> GSM97091     5  0.5494     0.5353 0.004 0.000 0.156 0.172 0.668
#> GSM97148     1  0.4367     0.3894 0.580 0.000 0.000 0.004 0.416
#> GSM97063     5  0.5434     0.5461 0.008 0.000 0.152 0.156 0.684
#> GSM97053     1  0.4437     0.2791 0.532 0.000 0.000 0.004 0.464
#> GSM97066     4  0.2690     0.8867 0.000 0.000 0.156 0.844 0.000
#> GSM97079     2  0.0451     0.8426 0.008 0.988 0.000 0.004 0.000
#> GSM97083     5  0.6606     0.4512 0.028 0.000 0.232 0.172 0.568
#> GSM97084     2  0.0451     0.8426 0.008 0.988 0.000 0.004 0.000
#> GSM97094     1  0.2407     0.6411 0.896 0.000 0.004 0.012 0.088
#> GSM97096     3  0.2624     0.6790 0.116 0.000 0.872 0.012 0.000
#> GSM97097     2  0.0451     0.8426 0.008 0.988 0.000 0.004 0.000
#> GSM97107     1  0.3988     0.5185 0.732 0.252 0.000 0.016 0.000
#> GSM97054     2  0.0451     0.8426 0.008 0.988 0.000 0.004 0.000
#> GSM97062     2  0.0451     0.8426 0.008 0.988 0.000 0.004 0.000
#> GSM97069     4  0.2852     0.8777 0.000 0.000 0.172 0.828 0.000
#> GSM97070     4  0.2690     0.8867 0.000 0.000 0.156 0.844 0.000
#> GSM97073     4  0.3362     0.8858 0.008 0.000 0.156 0.824 0.012
#> GSM97076     4  0.4274     0.7388 0.032 0.000 0.020 0.776 0.172
#> GSM97077     2  0.4843     0.5949 0.276 0.676 0.044 0.004 0.000
#> GSM97095     1  0.1439     0.6348 0.956 0.004 0.020 0.016 0.004
#> GSM97102     3  0.2124     0.6214 0.000 0.000 0.900 0.096 0.004
#> GSM97109     1  0.2984     0.6147 0.856 0.124 0.016 0.004 0.000
#> GSM97110     2  0.6388     0.2156 0.424 0.428 0.144 0.004 0.000
#> GSM97074     4  0.2824     0.8626 0.000 0.000 0.116 0.864 0.020
#> GSM97085     5  0.6497     0.3027 0.000 0.000 0.312 0.212 0.476
#> GSM97059     1  0.4283     0.4064 0.692 0.292 0.012 0.004 0.000
#> GSM97072     4  0.3318     0.8668 0.008 0.000 0.192 0.800 0.000
#> GSM97078     1  0.7613     0.0199 0.464 0.004 0.300 0.076 0.156
#> GSM97067     4  0.2690     0.8867 0.000 0.000 0.156 0.844 0.000
#> GSM97087     3  0.1544     0.6464 0.000 0.000 0.932 0.068 0.000
#> GSM97111     1  0.2376     0.6356 0.916 0.012 0.024 0.004 0.044
#> GSM97064     2  0.3567     0.7164 0.092 0.836 0.068 0.004 0.000
#> GSM97065     4  0.4870     0.7858 0.140 0.000 0.104 0.744 0.012
#> GSM97081     3  0.2624     0.6790 0.116 0.000 0.872 0.012 0.000
#> GSM97082     3  0.1544     0.6464 0.000 0.000 0.932 0.068 0.000
#> GSM97088     5  0.6545     0.2797 0.000 0.000 0.324 0.216 0.460
#> GSM97100     2  0.0000     0.8446 0.000 1.000 0.000 0.000 0.000
#> GSM97104     3  0.1792     0.6339 0.000 0.000 0.916 0.084 0.000
#> GSM97108     2  0.4877     0.2586 0.456 0.524 0.016 0.004 0.000
#> GSM97050     2  0.0000     0.8446 0.000 1.000 0.000 0.000 0.000
#> GSM97080     3  0.1965     0.6305 0.000 0.000 0.904 0.096 0.000
#> GSM97089     3  0.1544     0.6464 0.000 0.000 0.932 0.068 0.000
#> GSM97092     3  0.2915     0.6814 0.116 0.024 0.860 0.000 0.000
#> GSM97093     3  0.4812     0.5275 0.312 0.032 0.652 0.004 0.000
#> GSM97058     2  0.0963     0.8230 0.036 0.964 0.000 0.000 0.000
#> GSM97051     2  0.0000     0.8446 0.000 1.000 0.000 0.000 0.000
#> GSM97052     3  0.4277     0.6684 0.112 0.100 0.784 0.004 0.000
#> GSM97061     3  0.5974     0.3641 0.100 0.380 0.516 0.004 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.3934      0.635 0.728 0.012 0.000 0.000 0.240 0.020
#> GSM97145     1  0.2006      0.839 0.892 0.104 0.000 0.000 0.004 0.000
#> GSM97147     2  0.3104      0.827 0.028 0.852 0.028 0.092 0.000 0.000
#> GSM97125     1  0.2100      0.837 0.916 0.036 0.000 0.000 0.032 0.016
#> GSM97127     1  0.2730      0.771 0.808 0.192 0.000 0.000 0.000 0.000
#> GSM97130     2  0.5057      0.625 0.280 0.648 0.000 0.024 0.024 0.024
#> GSM97133     1  0.2823      0.757 0.796 0.204 0.000 0.000 0.000 0.000
#> GSM97134     2  0.4505      0.683 0.240 0.704 0.000 0.008 0.024 0.024
#> GSM97120     1  0.2006      0.839 0.892 0.104 0.000 0.000 0.004 0.000
#> GSM97126     1  0.2772      0.818 0.876 0.036 0.000 0.000 0.068 0.020
#> GSM97112     5  0.2070      0.866 0.092 0.000 0.000 0.000 0.896 0.012
#> GSM97115     2  0.4319      0.806 0.080 0.796 0.008 0.076 0.024 0.016
#> GSM97116     1  0.1851      0.838 0.928 0.024 0.000 0.000 0.036 0.012
#> GSM97117     2  0.2822      0.811 0.108 0.852 0.040 0.000 0.000 0.000
#> GSM97119     1  0.3876      0.635 0.728 0.012 0.000 0.000 0.244 0.016
#> GSM97122     1  0.3636      0.682 0.764 0.012 0.000 0.000 0.208 0.016
#> GSM97135     1  0.3876      0.635 0.728 0.012 0.000 0.000 0.244 0.016
#> GSM97136     5  0.4346      0.662 0.008 0.016 0.240 0.000 0.712 0.024
#> GSM97139     1  0.1644      0.846 0.920 0.076 0.000 0.000 0.004 0.000
#> GSM97146     1  0.1498      0.841 0.940 0.028 0.000 0.000 0.032 0.000
#> GSM97123     3  0.4341      0.739 0.008 0.080 0.732 0.180 0.000 0.000
#> GSM97129     2  0.2869      0.795 0.148 0.832 0.020 0.000 0.000 0.000
#> GSM97143     5  0.3831      0.716 0.224 0.012 0.000 0.000 0.744 0.020
#> GSM97113     4  0.0632      0.968 0.000 0.024 0.000 0.976 0.000 0.000
#> GSM97056     1  0.3971      0.679 0.748 0.208 0.000 0.000 0.024 0.020
#> GSM97124     1  0.1779      0.842 0.920 0.064 0.000 0.000 0.000 0.016
#> GSM97132     1  0.3425      0.789 0.824 0.120 0.000 0.000 0.024 0.032
#> GSM97144     2  0.5038      0.631 0.276 0.652 0.000 0.024 0.024 0.024
#> GSM97149     1  0.2793      0.762 0.800 0.200 0.000 0.000 0.000 0.000
#> GSM97068     4  0.0146      0.970 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM97071     6  0.2086      0.888 0.008 0.064 0.012 0.000 0.004 0.912
#> GSM97086     4  0.0000      0.972 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97103     2  0.3838      0.753 0.004 0.784 0.096 0.116 0.000 0.000
#> GSM97057     4  0.0632      0.968 0.000 0.024 0.000 0.976 0.000 0.000
#> GSM97060     3  0.1265      0.847 0.008 0.044 0.948 0.000 0.000 0.000
#> GSM97075     2  0.2257      0.783 0.008 0.876 0.116 0.000 0.000 0.000
#> GSM97098     3  0.2911      0.819 0.008 0.100 0.856 0.036 0.000 0.000
#> GSM97099     2  0.2649      0.807 0.004 0.876 0.068 0.052 0.000 0.000
#> GSM97101     2  0.4338      0.683 0.012 0.700 0.040 0.248 0.000 0.000
#> GSM97105     4  0.0547      0.970 0.000 0.020 0.000 0.980 0.000 0.000
#> GSM97106     3  0.4340      0.708 0.008 0.060 0.716 0.216 0.000 0.000
#> GSM97121     2  0.3123      0.818 0.012 0.840 0.032 0.116 0.000 0.000
#> GSM97128     5  0.1337      0.877 0.012 0.008 0.016 0.000 0.956 0.008
#> GSM97131     4  0.0363      0.973 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97137     2  0.5076      0.629 0.284 0.644 0.000 0.024 0.024 0.024
#> GSM97118     5  0.1951      0.885 0.060 0.004 0.000 0.000 0.916 0.020
#> GSM97114     2  0.2859      0.793 0.156 0.828 0.016 0.000 0.000 0.000
#> GSM97142     5  0.2877      0.801 0.168 0.000 0.000 0.000 0.820 0.012
#> GSM97140     2  0.3179      0.826 0.028 0.848 0.032 0.092 0.000 0.000
#> GSM97141     2  0.3025      0.828 0.028 0.860 0.032 0.080 0.000 0.000
#> GSM97055     5  0.1333      0.889 0.048 0.000 0.008 0.000 0.944 0.000
#> GSM97090     2  0.4127      0.796 0.120 0.800 0.008 0.028 0.024 0.020
#> GSM97091     5  0.1333      0.889 0.048 0.000 0.008 0.000 0.944 0.000
#> GSM97148     1  0.1644      0.846 0.920 0.076 0.000 0.000 0.004 0.000
#> GSM97063     5  0.1411      0.887 0.060 0.000 0.004 0.000 0.936 0.000
#> GSM97053     1  0.1341      0.845 0.948 0.028 0.000 0.000 0.024 0.000
#> GSM97066     6  0.1082      0.958 0.000 0.000 0.040 0.000 0.004 0.956
#> GSM97079     4  0.0000      0.972 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97083     5  0.1337      0.877 0.012 0.008 0.016 0.000 0.956 0.008
#> GSM97084     4  0.0000      0.972 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97094     2  0.3994      0.782 0.124 0.804 0.008 0.012 0.028 0.024
#> GSM97096     3  0.1900      0.846 0.000 0.068 0.916 0.000 0.008 0.008
#> GSM97097     4  0.0000      0.972 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97107     2  0.3925      0.794 0.104 0.812 0.000 0.036 0.024 0.024
#> GSM97054     4  0.0000      0.972 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97062     4  0.0000      0.972 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97069     6  0.2203      0.916 0.004 0.000 0.084 0.000 0.016 0.896
#> GSM97070     6  0.1082      0.958 0.000 0.000 0.040 0.000 0.004 0.956
#> GSM97073     6  0.1484      0.958 0.004 0.004 0.040 0.000 0.008 0.944
#> GSM97076     6  0.1850      0.902 0.052 0.016 0.000 0.000 0.008 0.924
#> GSM97077     2  0.4282      0.621 0.000 0.656 0.040 0.304 0.000 0.000
#> GSM97095     2  0.3480      0.807 0.072 0.852 0.016 0.012 0.028 0.020
#> GSM97102     3  0.2907      0.811 0.008 0.004 0.868 0.000 0.064 0.056
#> GSM97109     2  0.2541      0.829 0.052 0.892 0.024 0.032 0.000 0.000
#> GSM97110     2  0.3297      0.782 0.000 0.820 0.068 0.112 0.000 0.000
#> GSM97074     6  0.1370      0.956 0.004 0.000 0.036 0.000 0.012 0.948
#> GSM97085     5  0.2563      0.824 0.008 0.004 0.108 0.000 0.872 0.008
#> GSM97059     2  0.2589      0.833 0.028 0.888 0.024 0.060 0.000 0.000
#> GSM97072     6  0.1152      0.957 0.000 0.004 0.044 0.000 0.000 0.952
#> GSM97078     2  0.4642      0.776 0.052 0.792 0.052 0.016 0.052 0.036
#> GSM97067     6  0.1082      0.958 0.000 0.000 0.040 0.000 0.004 0.956
#> GSM97087     3  0.2656      0.819 0.008 0.004 0.884 0.000 0.060 0.044
#> GSM97111     2  0.2527      0.817 0.084 0.876 0.040 0.000 0.000 0.000
#> GSM97064     4  0.4024      0.741 0.008 0.092 0.128 0.772 0.000 0.000
#> GSM97065     6  0.2217      0.927 0.004 0.048 0.036 0.000 0.004 0.908
#> GSM97081     3  0.1957      0.846 0.000 0.072 0.912 0.000 0.008 0.008
#> GSM97082     3  0.2722      0.818 0.008 0.004 0.880 0.000 0.060 0.048
#> GSM97088     5  0.2912      0.815 0.008 0.008 0.112 0.000 0.856 0.016
#> GSM97100     4  0.0363      0.973 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97104     3  0.2848      0.814 0.008 0.004 0.872 0.000 0.060 0.056
#> GSM97108     2  0.3194      0.811 0.008 0.828 0.032 0.132 0.000 0.000
#> GSM97050     4  0.0547      0.970 0.000 0.020 0.000 0.980 0.000 0.000
#> GSM97080     3  0.2848      0.814 0.008 0.004 0.872 0.000 0.060 0.056
#> GSM97089     3  0.2394      0.824 0.008 0.004 0.900 0.000 0.052 0.036
#> GSM97092     3  0.1524      0.844 0.008 0.060 0.932 0.000 0.000 0.000
#> GSM97093     3  0.3470      0.688 0.012 0.248 0.740 0.000 0.000 0.000
#> GSM97058     4  0.0993      0.957 0.000 0.024 0.012 0.964 0.000 0.000
#> GSM97051     4  0.0363      0.973 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97052     3  0.2001      0.841 0.008 0.068 0.912 0.012 0.000 0.000
#> GSM97061     3  0.4341      0.739 0.008 0.080 0.732 0.180 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)

plot of chunk tab-ATC-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-membership-heatmap-5

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)

plot of chunk tab-ATC-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-1

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

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-2

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

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-3

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

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-4

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

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-kmeans-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-ATC-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-kmeans-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:kmeans  99         5.34e-02      0.0201     3.41e-02   0.0991 2
#> ATC:kmeans  97         9.51e-07      0.1400     2.13e-12   0.0897 3
#> ATC:kmeans  71         1.03e-03      0.3798     2.62e-09   0.2825 4
#> ATC:kmeans  69         7.22e-04      0.2582     9.31e-12   0.2071 5
#> ATC:kmeans 100         4.95e-05      0.6295     3.66e-13   0.3836 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.


ATC:skmeans*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "skmeans"]
# 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 21512 rows and 100 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 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)

plot of chunk ATC-skmeans-collect-plots

The plots are:

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:

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)

plot of chunk ATC-skmeans-select-partition-number

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.696           0.948       0.973         0.5055 0.495   0.495
#> 3 3 0.936           0.945       0.976         0.3264 0.706   0.475
#> 4 4 0.720           0.699       0.843         0.0956 0.908   0.735
#> 5 5 0.772           0.804       0.888         0.0726 0.875   0.591
#> 6 6 0.774           0.640       0.794         0.0462 0.952   0.783

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1   0.000      0.967 1.000 0.000
#> GSM97145     1   0.000      0.967 1.000 0.000
#> GSM97147     2   0.000      0.974 0.000 1.000
#> GSM97125     1   0.000      0.967 1.000 0.000
#> GSM97127     2   0.469      0.906 0.100 0.900
#> GSM97130     2   0.469      0.906 0.100 0.900
#> GSM97133     2   0.469      0.906 0.100 0.900
#> GSM97134     2   0.662      0.832 0.172 0.828
#> GSM97120     1   0.000      0.967 1.000 0.000
#> GSM97126     1   0.000      0.967 1.000 0.000
#> GSM97112     1   0.000      0.967 1.000 0.000
#> GSM97115     2   0.000      0.974 0.000 1.000
#> GSM97116     1   0.000      0.967 1.000 0.000
#> GSM97117     1   0.000      0.967 1.000 0.000
#> GSM97119     1   0.000      0.967 1.000 0.000
#> GSM97122     1   0.000      0.967 1.000 0.000
#> GSM97135     1   0.000      0.967 1.000 0.000
#> GSM97136     1   0.000      0.967 1.000 0.000
#> GSM97139     1   0.000      0.967 1.000 0.000
#> GSM97146     1   0.000      0.967 1.000 0.000
#> GSM97123     2   0.000      0.974 0.000 1.000
#> GSM97129     2   0.605      0.861 0.148 0.852
#> GSM97143     1   0.000      0.967 1.000 0.000
#> GSM97113     2   0.000      0.974 0.000 1.000
#> GSM97056     2   0.469      0.906 0.100 0.900
#> GSM97124     1   0.000      0.967 1.000 0.000
#> GSM97132     1   0.000      0.967 1.000 0.000
#> GSM97144     2   0.469      0.906 0.100 0.900
#> GSM97149     2   0.469      0.906 0.100 0.900
#> GSM97068     2   0.000      0.974 0.000 1.000
#> GSM97071     1   0.000      0.967 1.000 0.000
#> GSM97086     2   0.000      0.974 0.000 1.000
#> GSM97103     2   0.000      0.974 0.000 1.000
#> GSM97057     2   0.000      0.974 0.000 1.000
#> GSM97060     2   0.000      0.974 0.000 1.000
#> GSM97075     1   0.469      0.903 0.900 0.100
#> GSM97098     2   0.000      0.974 0.000 1.000
#> GSM97099     2   0.000      0.974 0.000 1.000
#> GSM97101     2   0.000      0.974 0.000 1.000
#> GSM97105     2   0.000      0.974 0.000 1.000
#> GSM97106     2   0.000      0.974 0.000 1.000
#> GSM97121     2   0.000      0.974 0.000 1.000
#> GSM97128     1   0.000      0.967 1.000 0.000
#> GSM97131     2   0.000      0.974 0.000 1.000
#> GSM97137     2   0.469      0.906 0.100 0.900
#> GSM97118     1   0.000      0.967 1.000 0.000
#> GSM97114     2   0.469      0.906 0.100 0.900
#> GSM97142     1   0.000      0.967 1.000 0.000
#> GSM97140     2   0.000      0.974 0.000 1.000
#> GSM97141     2   0.000      0.974 0.000 1.000
#> GSM97055     1   0.000      0.967 1.000 0.000
#> GSM97090     2   0.000      0.974 0.000 1.000
#> GSM97091     1   0.000      0.967 1.000 0.000
#> GSM97148     1   0.000      0.967 1.000 0.000
#> GSM97063     1   0.000      0.967 1.000 0.000
#> GSM97053     1   0.000      0.967 1.000 0.000
#> GSM97066     1   0.000      0.967 1.000 0.000
#> GSM97079     2   0.000      0.974 0.000 1.000
#> GSM97083     1   0.000      0.967 1.000 0.000
#> GSM97084     2   0.000      0.974 0.000 1.000
#> GSM97094     1   0.000      0.967 1.000 0.000
#> GSM97096     1   0.469      0.903 0.900 0.100
#> GSM97097     2   0.000      0.974 0.000 1.000
#> GSM97107     2   0.456      0.909 0.096 0.904
#> GSM97054     2   0.000      0.974 0.000 1.000
#> GSM97062     2   0.000      0.974 0.000 1.000
#> GSM97069     1   0.469      0.903 0.900 0.100
#> GSM97070     1   0.000      0.967 1.000 0.000
#> GSM97073     1   0.000      0.967 1.000 0.000
#> GSM97076     1   0.000      0.967 1.000 0.000
#> GSM97077     2   0.000      0.974 0.000 1.000
#> GSM97095     1   0.963      0.326 0.612 0.388
#> GSM97102     1   0.469      0.903 0.900 0.100
#> GSM97109     2   0.000      0.974 0.000 1.000
#> GSM97110     2   0.000      0.974 0.000 1.000
#> GSM97074     1   0.000      0.967 1.000 0.000
#> GSM97085     1   0.000      0.967 1.000 0.000
#> GSM97059     2   0.000      0.974 0.000 1.000
#> GSM97072     2   0.000      0.974 0.000 1.000
#> GSM97078     1   0.000      0.967 1.000 0.000
#> GSM97067     1   0.000      0.967 1.000 0.000
#> GSM97087     1   0.469      0.903 0.900 0.100
#> GSM97111     1   0.552      0.878 0.872 0.128
#> GSM97064     2   0.000      0.974 0.000 1.000
#> GSM97065     1   0.000      0.967 1.000 0.000
#> GSM97081     1   0.469      0.903 0.900 0.100
#> GSM97082     1   0.469      0.903 0.900 0.100
#> GSM97088     1   0.000      0.967 1.000 0.000
#> GSM97100     2   0.000      0.974 0.000 1.000
#> GSM97104     1   0.469      0.903 0.900 0.100
#> GSM97108     2   0.000      0.974 0.000 1.000
#> GSM97050     2   0.000      0.974 0.000 1.000
#> GSM97080     1   0.469      0.903 0.900 0.100
#> GSM97089     1   0.469      0.903 0.900 0.100
#> GSM97092     2   0.000      0.974 0.000 1.000
#> GSM97093     2   0.000      0.974 0.000 1.000
#> GSM97058     2   0.000      0.974 0.000 1.000
#> GSM97051     2   0.000      0.974 0.000 1.000
#> GSM97052     2   0.000      0.974 0.000 1.000
#> GSM97061     2   0.000      0.974 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97145     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97147     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97125     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97127     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97130     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97133     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97134     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97120     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97126     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97112     1  0.4346      0.783 0.816 0.000 0.184
#> GSM97115     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97116     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97117     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97119     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97122     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97135     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97136     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97139     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97146     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97123     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97129     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97143     1  0.4346      0.783 0.816 0.000 0.184
#> GSM97113     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97056     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97124     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97132     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97144     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97149     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97068     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97071     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97086     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97103     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97057     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97060     3  0.4555      0.740 0.000 0.200 0.800
#> GSM97075     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97098     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97099     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97101     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97105     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97106     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97121     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97128     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97131     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97137     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97118     3  0.5138      0.630 0.252 0.000 0.748
#> GSM97114     1  0.0237      0.958 0.996 0.004 0.000
#> GSM97142     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97140     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97141     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97055     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97090     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97091     3  0.0424      0.967 0.008 0.000 0.992
#> GSM97148     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97063     1  0.4605      0.757 0.796 0.000 0.204
#> GSM97053     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97066     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97079     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97083     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97084     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97094     1  0.0000      0.961 1.000 0.000 0.000
#> GSM97096     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97097     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97107     2  0.0237      0.981 0.004 0.996 0.000
#> GSM97054     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97062     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97069     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97070     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97073     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97076     1  0.5988      0.455 0.632 0.000 0.368
#> GSM97077     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97095     1  0.6723      0.629 0.704 0.248 0.048
#> GSM97102     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97109     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97110     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97074     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97085     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97059     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97072     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97078     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97067     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97087     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97111     1  0.0892      0.945 0.980 0.020 0.000
#> GSM97064     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97065     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97081     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97082     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97088     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97100     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97104     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97108     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97050     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97080     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97089     3  0.0000      0.974 0.000 0.000 1.000
#> GSM97092     3  0.4504      0.746 0.000 0.196 0.804
#> GSM97093     2  0.5138      0.664 0.000 0.748 0.252
#> GSM97058     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97051     2  0.0000      0.985 0.000 1.000 0.000
#> GSM97052     2  0.5291      0.636 0.000 0.732 0.268
#> GSM97061     2  0.0000      0.985 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.4605      0.705 0.664 0.000 0.000 0.336
#> GSM97145     1  0.0000      0.810 1.000 0.000 0.000 0.000
#> GSM97147     2  0.1004      0.919 0.024 0.972 0.000 0.004
#> GSM97125     1  0.3266      0.795 0.832 0.000 0.000 0.168
#> GSM97127     1  0.0000      0.810 1.000 0.000 0.000 0.000
#> GSM97130     1  0.2773      0.723 0.880 0.116 0.000 0.004
#> GSM97133     1  0.1302      0.784 0.956 0.044 0.000 0.000
#> GSM97134     1  0.0188      0.809 0.996 0.000 0.000 0.004
#> GSM97120     1  0.0000      0.810 1.000 0.000 0.000 0.000
#> GSM97126     1  0.4605      0.705 0.664 0.000 0.000 0.336
#> GSM97112     1  0.4661      0.693 0.652 0.000 0.000 0.348
#> GSM97115     2  0.1489      0.907 0.044 0.952 0.000 0.004
#> GSM97116     1  0.3528      0.788 0.808 0.000 0.000 0.192
#> GSM97117     1  0.3400      0.792 0.820 0.000 0.000 0.180
#> GSM97119     1  0.4382      0.738 0.704 0.000 0.000 0.296
#> GSM97122     1  0.4331      0.743 0.712 0.000 0.000 0.288
#> GSM97135     1  0.4382      0.738 0.704 0.000 0.000 0.296
#> GSM97136     3  0.4877      0.390 0.000 0.000 0.592 0.408
#> GSM97139     1  0.0000      0.810 1.000 0.000 0.000 0.000
#> GSM97146     1  0.2281      0.807 0.904 0.000 0.000 0.096
#> GSM97123     2  0.4331      0.615 0.000 0.712 0.288 0.000
#> GSM97129     1  0.0188      0.808 0.996 0.000 0.000 0.004
#> GSM97143     1  0.4661      0.693 0.652 0.000 0.000 0.348
#> GSM97113     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97056     1  0.0188      0.809 0.996 0.000 0.000 0.004
#> GSM97124     1  0.0707      0.810 0.980 0.000 0.000 0.020
#> GSM97132     1  0.3873      0.774 0.772 0.000 0.000 0.228
#> GSM97144     1  0.2888      0.715 0.872 0.124 0.000 0.004
#> GSM97149     1  0.0000      0.810 1.000 0.000 0.000 0.000
#> GSM97068     2  0.0188      0.928 0.000 0.996 0.000 0.004
#> GSM97071     4  0.4431      0.682 0.000 0.000 0.304 0.696
#> GSM97086     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97103     2  0.6742      0.456 0.000 0.608 0.232 0.160
#> GSM97057     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97060     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97075     3  0.0188      0.662 0.000 0.000 0.996 0.004
#> GSM97098     3  0.5000     -0.185 0.000 0.496 0.504 0.000
#> GSM97099     2  0.6482      0.527 0.000 0.640 0.208 0.152
#> GSM97101     2  0.0188      0.927 0.000 0.996 0.000 0.004
#> GSM97105     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97106     2  0.4356      0.608 0.000 0.708 0.292 0.000
#> GSM97121     2  0.1004      0.919 0.024 0.972 0.000 0.004
#> GSM97128     3  0.6552      0.274 0.076 0.000 0.484 0.440
#> GSM97131     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97137     1  0.2888      0.715 0.872 0.124 0.000 0.004
#> GSM97118     4  0.7641     -0.179 0.344 0.000 0.216 0.440
#> GSM97114     1  0.2714      0.727 0.884 0.112 0.000 0.004
#> GSM97142     1  0.4661      0.693 0.652 0.000 0.000 0.348
#> GSM97140     2  0.1004      0.919 0.024 0.972 0.000 0.004
#> GSM97141     2  0.1004      0.919 0.024 0.972 0.000 0.004
#> GSM97055     3  0.7047      0.202 0.120 0.000 0.440 0.440
#> GSM97090     2  0.1398      0.910 0.040 0.956 0.000 0.004
#> GSM97091     4  0.7391     -0.231 0.164 0.000 0.396 0.440
#> GSM97148     1  0.0000      0.810 1.000 0.000 0.000 0.000
#> GSM97063     1  0.7617      0.303 0.424 0.000 0.204 0.372
#> GSM97053     1  0.0921      0.810 0.972 0.000 0.000 0.028
#> GSM97066     4  0.4454      0.683 0.000 0.000 0.308 0.692
#> GSM97079     2  0.0188      0.928 0.000 0.996 0.000 0.004
#> GSM97083     3  0.6130      0.312 0.048 0.000 0.512 0.440
#> GSM97084     2  0.0188      0.928 0.000 0.996 0.000 0.004
#> GSM97094     1  0.4164      0.760 0.736 0.000 0.000 0.264
#> GSM97096     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97097     2  0.0188      0.928 0.000 0.996 0.000 0.004
#> GSM97107     2  0.4300      0.791 0.092 0.820 0.000 0.088
#> GSM97054     2  0.0188      0.928 0.000 0.996 0.000 0.004
#> GSM97062     2  0.0188      0.928 0.000 0.996 0.000 0.004
#> GSM97069     4  0.4522      0.671 0.000 0.000 0.320 0.680
#> GSM97070     4  0.4454      0.683 0.000 0.000 0.308 0.692
#> GSM97073     4  0.4454      0.683 0.000 0.000 0.308 0.692
#> GSM97076     4  0.0804      0.503 0.008 0.000 0.012 0.980
#> GSM97077     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97095     3  0.9365      0.150 0.200 0.112 0.376 0.312
#> GSM97102     3  0.0188      0.661 0.000 0.000 0.996 0.004
#> GSM97109     2  0.2831      0.840 0.120 0.876 0.000 0.004
#> GSM97110     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97074     4  0.1867      0.543 0.000 0.000 0.072 0.928
#> GSM97085     3  0.4790      0.406 0.000 0.000 0.620 0.380
#> GSM97059     2  0.1004      0.919 0.024 0.972 0.000 0.004
#> GSM97072     4  0.4713      0.615 0.000 0.000 0.360 0.640
#> GSM97078     4  0.4008      0.371 0.000 0.000 0.244 0.756
#> GSM97067     4  0.4454      0.683 0.000 0.000 0.308 0.692
#> GSM97087     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97111     1  0.6080      0.496 0.660 0.012 0.272 0.056
#> GSM97064     2  0.1867      0.879 0.000 0.928 0.072 0.000
#> GSM97065     4  0.4431      0.682 0.000 0.000 0.304 0.696
#> GSM97081     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97082     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97088     3  0.4776      0.408 0.000 0.000 0.624 0.376
#> GSM97100     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97104     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97108     2  0.0188      0.927 0.000 0.996 0.000 0.004
#> GSM97050     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97080     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97089     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97092     3  0.0000      0.664 0.000 0.000 1.000 0.000
#> GSM97093     3  0.4222      0.435 0.000 0.272 0.728 0.000
#> GSM97058     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97051     2  0.0000      0.928 0.000 1.000 0.000 0.000
#> GSM97052     3  0.1637      0.621 0.000 0.060 0.940 0.000
#> GSM97061     2  0.4331      0.615 0.000 0.712 0.288 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     5  0.0880     0.8460 0.032 0.000 0.000 0.000 0.968
#> GSM97145     1  0.2179     0.8418 0.888 0.000 0.000 0.000 0.112
#> GSM97147     2  0.2694     0.8571 0.128 0.864 0.004 0.004 0.000
#> GSM97125     1  0.4114     0.6334 0.624 0.000 0.000 0.000 0.376
#> GSM97127     1  0.1608     0.8399 0.928 0.000 0.000 0.000 0.072
#> GSM97130     1  0.2676     0.7932 0.884 0.080 0.000 0.000 0.036
#> GSM97133     1  0.1205     0.8299 0.956 0.004 0.000 0.000 0.040
#> GSM97134     1  0.2193     0.8268 0.900 0.008 0.000 0.000 0.092
#> GSM97120     1  0.2329     0.8418 0.876 0.000 0.000 0.000 0.124
#> GSM97126     5  0.0703     0.8508 0.024 0.000 0.000 0.000 0.976
#> GSM97112     5  0.0510     0.8533 0.016 0.000 0.000 0.000 0.984
#> GSM97115     2  0.3003     0.8094 0.188 0.812 0.000 0.000 0.000
#> GSM97116     1  0.4114     0.6336 0.624 0.000 0.000 0.000 0.376
#> GSM97117     1  0.4370     0.6019 0.656 0.000 0.004 0.008 0.332
#> GSM97119     5  0.2377     0.7499 0.128 0.000 0.000 0.000 0.872
#> GSM97122     5  0.3480     0.5282 0.248 0.000 0.000 0.000 0.752
#> GSM97135     5  0.3274     0.5927 0.220 0.000 0.000 0.000 0.780
#> GSM97136     5  0.3942     0.7008 0.000 0.000 0.232 0.020 0.748
#> GSM97139     1  0.2424     0.8416 0.868 0.000 0.000 0.000 0.132
#> GSM97146     1  0.3752     0.7445 0.708 0.000 0.000 0.000 0.292
#> GSM97123     3  0.3395     0.7117 0.000 0.236 0.764 0.000 0.000
#> GSM97129     1  0.1924     0.8317 0.924 0.000 0.004 0.008 0.064
#> GSM97143     5  0.0510     0.8533 0.016 0.000 0.000 0.000 0.984
#> GSM97113     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97056     1  0.1952     0.8269 0.912 0.004 0.000 0.000 0.084
#> GSM97124     1  0.3305     0.8013 0.776 0.000 0.000 0.000 0.224
#> GSM97132     1  0.4304     0.2989 0.516 0.000 0.000 0.000 0.484
#> GSM97144     1  0.2676     0.7932 0.884 0.080 0.000 0.000 0.036
#> GSM97149     1  0.1341     0.8349 0.944 0.000 0.000 0.000 0.056
#> GSM97068     2  0.0162     0.9043 0.004 0.996 0.000 0.000 0.000
#> GSM97071     4  0.0324     0.9395 0.004 0.000 0.000 0.992 0.004
#> GSM97086     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97103     2  0.6568     0.3183 0.000 0.528 0.276 0.184 0.012
#> GSM97057     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97060     3  0.0290     0.8805 0.000 0.008 0.992 0.000 0.000
#> GSM97075     3  0.0613     0.8804 0.004 0.000 0.984 0.008 0.004
#> GSM97098     3  0.2753     0.7916 0.000 0.136 0.856 0.000 0.008
#> GSM97099     2  0.6894     0.3986 0.020 0.548 0.248 0.172 0.012
#> GSM97101     2  0.1990     0.8798 0.068 0.920 0.008 0.004 0.000
#> GSM97105     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97106     3  0.3612     0.6615 0.000 0.268 0.732 0.000 0.000
#> GSM97121     2  0.2964     0.8426 0.152 0.840 0.004 0.004 0.000
#> GSM97128     5  0.3059     0.8155 0.028 0.000 0.108 0.004 0.860
#> GSM97131     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97137     1  0.2597     0.7861 0.884 0.092 0.000 0.000 0.024
#> GSM97118     5  0.0613     0.8550 0.008 0.000 0.004 0.004 0.984
#> GSM97114     1  0.1996     0.8212 0.932 0.016 0.004 0.008 0.040
#> GSM97142     5  0.0794     0.8481 0.028 0.000 0.000 0.000 0.972
#> GSM97140     2  0.2741     0.8550 0.132 0.860 0.004 0.004 0.000
#> GSM97141     2  0.3402     0.8173 0.184 0.804 0.008 0.004 0.000
#> GSM97055     5  0.1638     0.8434 0.000 0.000 0.064 0.004 0.932
#> GSM97090     2  0.2732     0.8277 0.160 0.840 0.000 0.000 0.000
#> GSM97091     5  0.0955     0.8531 0.000 0.000 0.028 0.004 0.968
#> GSM97148     1  0.2280     0.8443 0.880 0.000 0.000 0.000 0.120
#> GSM97063     5  0.0451     0.8549 0.008 0.000 0.004 0.000 0.988
#> GSM97053     1  0.3586     0.7714 0.736 0.000 0.000 0.000 0.264
#> GSM97066     4  0.0324     0.9412 0.000 0.000 0.004 0.992 0.004
#> GSM97079     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97083     5  0.3059     0.8155 0.028 0.000 0.108 0.004 0.860
#> GSM97084     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97094     5  0.2471     0.7999 0.136 0.000 0.000 0.000 0.864
#> GSM97096     3  0.0671     0.8821 0.000 0.000 0.980 0.016 0.004
#> GSM97097     2  0.0404     0.9017 0.000 0.988 0.000 0.000 0.012
#> GSM97107     2  0.3858     0.7951 0.156 0.804 0.000 0.024 0.016
#> GSM97054     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97062     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97069     4  0.0566     0.9365 0.000 0.000 0.012 0.984 0.004
#> GSM97070     4  0.0324     0.9412 0.000 0.000 0.004 0.992 0.004
#> GSM97073     4  0.0324     0.9412 0.000 0.000 0.004 0.992 0.004
#> GSM97076     4  0.0703     0.9259 0.000 0.000 0.000 0.976 0.024
#> GSM97077     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97095     5  0.3773     0.7983 0.100 0.020 0.048 0.000 0.832
#> GSM97102     3  0.1018     0.8801 0.000 0.000 0.968 0.016 0.016
#> GSM97109     2  0.4438     0.7307 0.252 0.720 0.008 0.008 0.012
#> GSM97110     2  0.0912     0.8962 0.000 0.972 0.016 0.000 0.012
#> GSM97074     4  0.0290     0.9398 0.000 0.000 0.000 0.992 0.008
#> GSM97085     5  0.3852     0.7168 0.000 0.000 0.220 0.020 0.760
#> GSM97059     2  0.2488     0.8615 0.124 0.872 0.004 0.000 0.000
#> GSM97072     4  0.0290     0.9382 0.000 0.000 0.008 0.992 0.000
#> GSM97078     4  0.6067    -0.0041 0.028 0.000 0.056 0.472 0.444
#> GSM97067     4  0.0324     0.9412 0.000 0.000 0.004 0.992 0.004
#> GSM97087     3  0.0912     0.8814 0.000 0.000 0.972 0.016 0.012
#> GSM97111     3  0.6782    -0.0588 0.408 0.004 0.412 0.008 0.168
#> GSM97064     2  0.3561     0.6142 0.000 0.740 0.260 0.000 0.000
#> GSM97065     4  0.0162     0.9400 0.000 0.000 0.000 0.996 0.004
#> GSM97081     3  0.0798     0.8820 0.000 0.000 0.976 0.016 0.008
#> GSM97082     3  0.1018     0.8801 0.000 0.000 0.968 0.016 0.016
#> GSM97088     5  0.3970     0.6968 0.000 0.000 0.236 0.020 0.744
#> GSM97100     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97104     3  0.1018     0.8801 0.000 0.000 0.968 0.016 0.016
#> GSM97108     2  0.1518     0.8899 0.048 0.944 0.004 0.004 0.000
#> GSM97050     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97080     3  0.0955     0.8779 0.000 0.000 0.968 0.028 0.004
#> GSM97089     3  0.0912     0.8814 0.000 0.000 0.972 0.016 0.012
#> GSM97092     3  0.0162     0.8809 0.000 0.004 0.996 0.000 0.000
#> GSM97093     3  0.1124     0.8705 0.000 0.036 0.960 0.000 0.004
#> GSM97058     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97051     2  0.0000     0.9052 0.000 1.000 0.000 0.000 0.000
#> GSM97052     3  0.0609     0.8769 0.000 0.020 0.980 0.000 0.000
#> GSM97061     3  0.3366     0.7164 0.000 0.232 0.768 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     5  0.1643    0.78016 0.068 0.000 0.000 0.008 0.924 0.000
#> GSM97145     1  0.1320    0.62776 0.948 0.000 0.000 0.016 0.036 0.000
#> GSM97147     2  0.4517    0.47379 0.060 0.648 0.000 0.292 0.000 0.000
#> GSM97125     1  0.4124    0.42816 0.644 0.000 0.000 0.024 0.332 0.000
#> GSM97127     1  0.1700    0.61883 0.928 0.000 0.000 0.048 0.024 0.000
#> GSM97130     1  0.4184    0.29751 0.500 0.012 0.000 0.488 0.000 0.000
#> GSM97133     1  0.1204    0.60473 0.944 0.000 0.000 0.056 0.000 0.000
#> GSM97134     1  0.3854    0.33377 0.536 0.000 0.000 0.464 0.000 0.000
#> GSM97120     1  0.1434    0.63050 0.940 0.000 0.000 0.012 0.048 0.000
#> GSM97126     5  0.1285    0.79198 0.052 0.000 0.000 0.004 0.944 0.000
#> GSM97112     5  0.0777    0.79980 0.024 0.000 0.000 0.004 0.972 0.000
#> GSM97115     4  0.5114    0.34049 0.080 0.452 0.000 0.468 0.000 0.000
#> GSM97116     1  0.4139    0.41913 0.640 0.000 0.000 0.024 0.336 0.000
#> GSM97117     1  0.5650    0.28130 0.508 0.000 0.004 0.344 0.144 0.000
#> GSM97119     5  0.3592    0.56445 0.240 0.000 0.000 0.020 0.740 0.000
#> GSM97122     5  0.4193    0.32934 0.352 0.000 0.000 0.024 0.624 0.000
#> GSM97135     5  0.4139    0.36806 0.336 0.000 0.000 0.024 0.640 0.000
#> GSM97136     5  0.3248    0.66145 0.000 0.000 0.224 0.004 0.768 0.004
#> GSM97139     1  0.1333    0.63080 0.944 0.000 0.000 0.008 0.048 0.000
#> GSM97146     1  0.3629    0.53106 0.724 0.000 0.000 0.016 0.260 0.000
#> GSM97123     3  0.4431    0.70067 0.000 0.200 0.704 0.096 0.000 0.000
#> GSM97129     1  0.3499    0.39471 0.680 0.000 0.000 0.320 0.000 0.000
#> GSM97143     5  0.0777    0.79980 0.024 0.000 0.000 0.004 0.972 0.000
#> GSM97113     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97056     1  0.3866    0.31538 0.516 0.000 0.000 0.484 0.000 0.000
#> GSM97124     1  0.3276    0.60662 0.816 0.000 0.000 0.052 0.132 0.000
#> GSM97132     1  0.5917    0.16025 0.400 0.000 0.000 0.208 0.392 0.000
#> GSM97144     1  0.4184    0.29751 0.500 0.012 0.000 0.488 0.000 0.000
#> GSM97149     1  0.1398    0.61024 0.940 0.000 0.000 0.052 0.008 0.000
#> GSM97068     2  0.0146    0.80053 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM97071     6  0.0000    0.98971 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97086     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97103     2  0.6238    0.21979 0.000 0.584 0.156 0.176 0.000 0.084
#> GSM97057     2  0.0146    0.80055 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM97060     3  0.1714    0.86754 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM97075     3  0.2278    0.83593 0.000 0.000 0.868 0.128 0.004 0.000
#> GSM97098     3  0.4121    0.75467 0.000 0.136 0.748 0.116 0.000 0.000
#> GSM97099     4  0.6829   -0.11569 0.024 0.376 0.116 0.432 0.000 0.052
#> GSM97101     2  0.4219    0.49273 0.036 0.660 0.000 0.304 0.000 0.000
#> GSM97105     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97106     3  0.4513    0.68357 0.000 0.212 0.692 0.096 0.000 0.000
#> GSM97121     2  0.5070    0.36248 0.096 0.576 0.000 0.328 0.000 0.000
#> GSM97128     5  0.2118    0.75510 0.000 0.000 0.104 0.008 0.888 0.000
#> GSM97131     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97137     1  0.4264    0.29057 0.496 0.016 0.000 0.488 0.000 0.000
#> GSM97118     5  0.0260    0.80012 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM97114     1  0.3672    0.34800 0.632 0.000 0.000 0.368 0.000 0.000
#> GSM97142     5  0.1265    0.79343 0.044 0.000 0.000 0.008 0.948 0.000
#> GSM97140     2  0.4736    0.43351 0.072 0.620 0.000 0.308 0.000 0.000
#> GSM97141     2  0.5574    0.21699 0.152 0.504 0.000 0.344 0.000 0.000
#> GSM97055     5  0.0547    0.79364 0.000 0.000 0.020 0.000 0.980 0.000
#> GSM97090     4  0.4948    0.33339 0.064 0.460 0.000 0.476 0.000 0.000
#> GSM97091     5  0.0000    0.79902 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97148     1  0.1333    0.63129 0.944 0.000 0.000 0.008 0.048 0.000
#> GSM97063     5  0.0458    0.80058 0.016 0.000 0.000 0.000 0.984 0.000
#> GSM97053     1  0.3333    0.58971 0.784 0.000 0.000 0.024 0.192 0.000
#> GSM97066     6  0.0000    0.98971 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97079     2  0.0146    0.80053 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM97083     5  0.2118    0.75504 0.000 0.000 0.104 0.008 0.888 0.000
#> GSM97084     2  0.0363    0.79503 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM97094     4  0.5745   -0.05626 0.212 0.000 0.000 0.508 0.280 0.000
#> GSM97096     3  0.0862    0.87822 0.000 0.000 0.972 0.016 0.008 0.004
#> GSM97097     2  0.1007    0.77106 0.000 0.956 0.000 0.044 0.000 0.000
#> GSM97107     4  0.4868    0.36896 0.060 0.416 0.000 0.524 0.000 0.000
#> GSM97054     2  0.0363    0.79503 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM97062     2  0.0146    0.80053 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM97069     6  0.1588    0.91031 0.000 0.000 0.072 0.004 0.000 0.924
#> GSM97070     6  0.0000    0.98971 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97073     6  0.0000    0.98971 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97076     6  0.0146    0.98485 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM97077     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97095     4  0.5864   -0.02095 0.052 0.012 0.040 0.492 0.404 0.000
#> GSM97102     3  0.1003    0.86788 0.000 0.000 0.964 0.004 0.028 0.004
#> GSM97109     4  0.5999    0.00961 0.256 0.312 0.000 0.432 0.000 0.000
#> GSM97110     2  0.1556    0.74120 0.000 0.920 0.000 0.080 0.000 0.000
#> GSM97074     6  0.0000    0.98971 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97085     5  0.3192    0.66694 0.000 0.000 0.216 0.004 0.776 0.004
#> GSM97059     2  0.4110    0.53165 0.052 0.712 0.000 0.236 0.000 0.000
#> GSM97072     6  0.0000    0.98971 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97078     5  0.5856    0.07297 0.000 0.000 0.084 0.036 0.460 0.420
#> GSM97067     6  0.0000    0.98971 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97087     3  0.0748    0.87565 0.000 0.000 0.976 0.004 0.016 0.004
#> GSM97111     1  0.5753    0.19283 0.468 0.008 0.044 0.436 0.044 0.000
#> GSM97064     2  0.3426    0.57936 0.000 0.808 0.124 0.068 0.000 0.000
#> GSM97065     6  0.0000    0.98971 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97081     3  0.0291    0.87791 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM97082     3  0.0748    0.87565 0.000 0.000 0.976 0.004 0.016 0.004
#> GSM97088     5  0.3354    0.64153 0.000 0.000 0.240 0.004 0.752 0.004
#> GSM97100     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97104     3  0.0748    0.87565 0.000 0.000 0.976 0.004 0.016 0.004
#> GSM97108     2  0.4165    0.50724 0.036 0.672 0.000 0.292 0.000 0.000
#> GSM97050     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97080     3  0.0748    0.87565 0.000 0.000 0.976 0.004 0.016 0.004
#> GSM97089     3  0.0748    0.87565 0.000 0.000 0.976 0.004 0.016 0.004
#> GSM97092     3  0.1714    0.86754 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM97093     3  0.2070    0.86392 0.000 0.008 0.892 0.100 0.000 0.000
#> GSM97058     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97051     2  0.0000    0.80227 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97052     3  0.1714    0.86754 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM97061     3  0.4431    0.70067 0.000 0.200 0.704 0.096 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)

plot of chunk tab-ATC-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-membership-heatmap-5

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)

plot of chunk tab-ATC-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-1

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

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-2

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

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-3

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

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-4

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

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-skmeans-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-ATC-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-skmeans-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:skmeans 99         5.34e-02      0.0201     3.41e-02   0.0991 2
#> ATC:skmeans 99         9.07e-07      0.1940     1.22e-12   0.0406 3
#> ATC:skmeans 85         1.78e-06      0.5372     5.62e-16   0.1843 4
#> ATC:skmeans 95         2.61e-04      0.5584     2.02e-15   0.3617 5
#> ATC:skmeans 72         9.22e-04      0.6769     3.37e-13   0.6042 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.


ATC:pam

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "pam"]
# 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 21512 rows and 100 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 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)

plot of chunk ATC-pam-collect-plots

The plots are:

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:

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)

plot of chunk ATC-pam-select-partition-number

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.624           0.902       0.944         0.4649 0.547   0.547
#> 3 3 0.864           0.900       0.949         0.4122 0.772   0.593
#> 4 4 0.807           0.822       0.921         0.0943 0.754   0.439
#> 5 5 0.761           0.562       0.772         0.0750 0.891   0.643
#> 6 6 0.890           0.871       0.933         0.0531 0.899   0.599

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000      0.961 1.000 0.000
#> GSM97145     1  0.0000      0.961 1.000 0.000
#> GSM97147     2  0.0938      0.920 0.012 0.988
#> GSM97125     1  0.0000      0.961 1.000 0.000
#> GSM97127     1  0.0000      0.961 1.000 0.000
#> GSM97130     1  0.6887      0.799 0.816 0.184
#> GSM97133     1  0.6801      0.801 0.820 0.180
#> GSM97134     1  0.0376      0.958 0.996 0.004
#> GSM97120     1  0.0000      0.961 1.000 0.000
#> GSM97126     1  0.0000      0.961 1.000 0.000
#> GSM97112     1  0.0000      0.961 1.000 0.000
#> GSM97115     2  0.0000      0.927 0.000 1.000
#> GSM97116     1  0.0000      0.961 1.000 0.000
#> GSM97117     2  0.7139      0.826 0.196 0.804
#> GSM97119     1  0.0000      0.961 1.000 0.000
#> GSM97122     1  0.0000      0.961 1.000 0.000
#> GSM97135     1  0.0000      0.961 1.000 0.000
#> GSM97136     2  0.9000      0.660 0.316 0.684
#> GSM97139     1  0.0000      0.961 1.000 0.000
#> GSM97146     1  0.0000      0.961 1.000 0.000
#> GSM97123     2  0.0000      0.927 0.000 1.000
#> GSM97129     2  0.6343      0.853 0.160 0.840
#> GSM97143     1  0.0000      0.961 1.000 0.000
#> GSM97113     2  0.0000      0.927 0.000 1.000
#> GSM97056     1  0.2948      0.922 0.948 0.052
#> GSM97124     1  0.0000      0.961 1.000 0.000
#> GSM97132     1  0.0000      0.961 1.000 0.000
#> GSM97144     1  0.7299      0.780 0.796 0.204
#> GSM97149     1  0.6801      0.801 0.820 0.180
#> GSM97068     2  0.0000      0.927 0.000 1.000
#> GSM97071     2  0.0000      0.927 0.000 1.000
#> GSM97086     2  0.0000      0.927 0.000 1.000
#> GSM97103     2  0.0000      0.927 0.000 1.000
#> GSM97057     2  0.0000      0.927 0.000 1.000
#> GSM97060     2  0.0000      0.927 0.000 1.000
#> GSM97075     2  0.0672      0.924 0.008 0.992
#> GSM97098     2  0.0000      0.927 0.000 1.000
#> GSM97099     2  0.0000      0.927 0.000 1.000
#> GSM97101     2  0.0000      0.927 0.000 1.000
#> GSM97105     2  0.0000      0.927 0.000 1.000
#> GSM97106     2  0.0000      0.927 0.000 1.000
#> GSM97121     2  0.0000      0.927 0.000 1.000
#> GSM97128     1  0.0938      0.953 0.988 0.012
#> GSM97131     2  0.0000      0.927 0.000 1.000
#> GSM97137     1  0.6887      0.797 0.816 0.184
#> GSM97118     1  0.0000      0.961 1.000 0.000
#> GSM97114     2  0.0938      0.920 0.012 0.988
#> GSM97142     1  0.0000      0.961 1.000 0.000
#> GSM97140     2  0.0000      0.927 0.000 1.000
#> GSM97141     2  0.0000      0.927 0.000 1.000
#> GSM97055     1  0.0000      0.961 1.000 0.000
#> GSM97090     2  0.0672      0.923 0.008 0.992
#> GSM97091     1  0.0000      0.961 1.000 0.000
#> GSM97148     1  0.0000      0.961 1.000 0.000
#> GSM97063     1  0.0000      0.961 1.000 0.000
#> GSM97053     1  0.0000      0.961 1.000 0.000
#> GSM97066     2  0.6887      0.835 0.184 0.816
#> GSM97079     2  0.0000      0.927 0.000 1.000
#> GSM97083     1  0.0672      0.956 0.992 0.008
#> GSM97084     2  0.0000      0.927 0.000 1.000
#> GSM97094     2  0.6343      0.852 0.160 0.840
#> GSM97096     2  0.6801      0.839 0.180 0.820
#> GSM97097     2  0.0000      0.927 0.000 1.000
#> GSM97107     2  0.0000      0.927 0.000 1.000
#> GSM97054     2  0.0000      0.927 0.000 1.000
#> GSM97062     2  0.0000      0.927 0.000 1.000
#> GSM97069     2  0.6801      0.839 0.180 0.820
#> GSM97070     2  0.6887      0.835 0.184 0.816
#> GSM97073     2  0.6801      0.839 0.180 0.820
#> GSM97076     1  0.0938      0.953 0.988 0.012
#> GSM97077     2  0.0000      0.927 0.000 1.000
#> GSM97095     2  0.6623      0.844 0.172 0.828
#> GSM97102     2  0.6887      0.835 0.184 0.816
#> GSM97109     2  0.0000      0.927 0.000 1.000
#> GSM97110     2  0.0000      0.927 0.000 1.000
#> GSM97074     2  0.9922      0.354 0.448 0.552
#> GSM97085     1  0.5519      0.825 0.872 0.128
#> GSM97059     2  0.0000      0.927 0.000 1.000
#> GSM97072     2  0.0000      0.927 0.000 1.000
#> GSM97078     2  0.6801      0.839 0.180 0.820
#> GSM97067     2  0.6887      0.835 0.184 0.816
#> GSM97087     2  0.6801      0.839 0.180 0.820
#> GSM97111     2  0.0672      0.924 0.008 0.992
#> GSM97064     2  0.0000      0.927 0.000 1.000
#> GSM97065     2  0.6801      0.839 0.180 0.820
#> GSM97081     2  0.6801      0.839 0.180 0.820
#> GSM97082     2  0.6801      0.839 0.180 0.820
#> GSM97088     2  0.7056      0.828 0.192 0.808
#> GSM97100     2  0.0000      0.927 0.000 1.000
#> GSM97104     2  0.6801      0.839 0.180 0.820
#> GSM97108     2  0.0000      0.927 0.000 1.000
#> GSM97050     2  0.0000      0.927 0.000 1.000
#> GSM97080     2  0.6801      0.839 0.180 0.820
#> GSM97089     2  0.6801      0.839 0.180 0.820
#> GSM97092     2  0.0000      0.927 0.000 1.000
#> GSM97093     2  0.0000      0.927 0.000 1.000
#> GSM97058     2  0.0000      0.927 0.000 1.000
#> GSM97051     2  0.0000      0.927 0.000 1.000
#> GSM97052     2  0.0000      0.927 0.000 1.000
#> GSM97061     2  0.0000      0.927 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97145     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97147     2  0.0747     0.9490 0.000 0.984 0.016
#> GSM97125     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97127     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97130     2  0.3686     0.8102 0.140 0.860 0.000
#> GSM97133     1  0.6026     0.3798 0.624 0.376 0.000
#> GSM97134     1  0.0424     0.9698 0.992 0.000 0.008
#> GSM97120     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97126     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97112     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97115     2  0.0747     0.9490 0.000 0.984 0.016
#> GSM97116     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97117     3  0.1647     0.9188 0.036 0.004 0.960
#> GSM97119     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97122     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97135     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97136     3  0.4842     0.7296 0.224 0.000 0.776
#> GSM97139     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97146     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97123     3  0.1643     0.9259 0.000 0.044 0.956
#> GSM97129     3  0.1751     0.9262 0.012 0.028 0.960
#> GSM97143     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97113     2  0.0592     0.9507 0.000 0.988 0.012
#> GSM97056     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97124     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97132     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97144     2  0.0747     0.9454 0.016 0.984 0.000
#> GSM97149     1  0.1411     0.9430 0.964 0.036 0.000
#> GSM97068     2  0.0747     0.9490 0.000 0.984 0.016
#> GSM97071     3  0.1643     0.9233 0.000 0.044 0.956
#> GSM97086     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97103     3  0.1643     0.9233 0.000 0.044 0.956
#> GSM97057     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97060     3  0.1643     0.9259 0.000 0.044 0.956
#> GSM97075     3  0.1751     0.9262 0.012 0.028 0.960
#> GSM97098     3  0.1163     0.9263 0.000 0.028 0.972
#> GSM97099     3  0.1529     0.9242 0.000 0.040 0.960
#> GSM97101     3  0.4931     0.7430 0.000 0.232 0.768
#> GSM97105     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97106     3  0.3816     0.8495 0.000 0.148 0.852
#> GSM97121     2  0.4654     0.7134 0.000 0.792 0.208
#> GSM97128     1  0.1163     0.9549 0.972 0.000 0.028
#> GSM97131     2  0.0747     0.9490 0.000 0.984 0.016
#> GSM97137     2  0.1643     0.9182 0.044 0.956 0.000
#> GSM97118     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97114     3  0.1751     0.9262 0.012 0.028 0.960
#> GSM97142     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97140     2  0.6302    -0.0342 0.000 0.520 0.480
#> GSM97141     3  0.4390     0.8362 0.012 0.148 0.840
#> GSM97055     1  0.0892     0.9598 0.980 0.000 0.020
#> GSM97090     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97091     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97148     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97063     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97053     1  0.0000     0.9753 1.000 0.000 0.000
#> GSM97066     3  0.0000     0.9239 0.000 0.000 1.000
#> GSM97079     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97083     1  0.1289     0.9519 0.968 0.000 0.032
#> GSM97084     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97094     3  0.3192     0.8630 0.112 0.000 0.888
#> GSM97096     3  0.0237     0.9251 0.000 0.004 0.996
#> GSM97097     3  0.5016     0.7323 0.000 0.240 0.760
#> GSM97107     3  0.6244     0.2770 0.000 0.440 0.560
#> GSM97054     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97062     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97069     3  0.0000     0.9239 0.000 0.000 1.000
#> GSM97070     3  0.0000     0.9239 0.000 0.000 1.000
#> GSM97073     3  0.0592     0.9231 0.012 0.000 0.988
#> GSM97076     1  0.0592     0.9676 0.988 0.000 0.012
#> GSM97077     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97095     3  0.3482     0.8595 0.000 0.128 0.872
#> GSM97102     3  0.0000     0.9239 0.000 0.000 1.000
#> GSM97109     3  0.1751     0.9262 0.012 0.028 0.960
#> GSM97110     3  0.1964     0.9178 0.000 0.056 0.944
#> GSM97074     3  0.6244     0.2456 0.440 0.000 0.560
#> GSM97085     1  0.4399     0.7789 0.812 0.000 0.188
#> GSM97059     2  0.0747     0.9490 0.000 0.984 0.016
#> GSM97072     3  0.0237     0.9247 0.000 0.004 0.996
#> GSM97078     3  0.2793     0.9133 0.028 0.044 0.928
#> GSM97067     3  0.0000     0.9239 0.000 0.000 1.000
#> GSM97087     3  0.0747     0.9224 0.000 0.016 0.984
#> GSM97111     3  0.1751     0.9262 0.012 0.028 0.960
#> GSM97064     2  0.0892     0.9417 0.000 0.980 0.020
#> GSM97065     3  0.1636     0.9255 0.020 0.016 0.964
#> GSM97081     3  0.1643     0.9259 0.000 0.044 0.956
#> GSM97082     3  0.0747     0.9224 0.000 0.016 0.984
#> GSM97088     3  0.1529     0.9076 0.040 0.000 0.960
#> GSM97100     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97104     3  0.0000     0.9239 0.000 0.000 1.000
#> GSM97108     3  0.5058     0.7262 0.000 0.244 0.756
#> GSM97050     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97080     3  0.0747     0.9224 0.000 0.016 0.984
#> GSM97089     3  0.0747     0.9224 0.000 0.016 0.984
#> GSM97092     3  0.1643     0.9259 0.000 0.044 0.956
#> GSM97093     3  0.1643     0.9259 0.000 0.044 0.956
#> GSM97058     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97051     2  0.0000     0.9544 0.000 1.000 0.000
#> GSM97052     3  0.1643     0.9259 0.000 0.044 0.956
#> GSM97061     3  0.1643     0.9259 0.000 0.044 0.956

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97145     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97147     2  0.0336      0.920 0.008 0.992 0.000 0.000
#> GSM97125     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97127     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97130     2  0.2921      0.797 0.140 0.860 0.000 0.000
#> GSM97133     1  0.4624      0.538 0.660 0.340 0.000 0.000
#> GSM97134     1  0.0336      0.902 0.992 0.000 0.008 0.000
#> GSM97120     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97126     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97112     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97115     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97116     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97117     1  0.5627      0.616 0.692 0.068 0.240 0.000
#> GSM97119     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97122     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97135     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97136     1  0.2149      0.846 0.912 0.000 0.088 0.000
#> GSM97139     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97146     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97123     3  0.0336      0.826 0.000 0.008 0.992 0.000
#> GSM97129     1  0.5757      0.607 0.684 0.076 0.240 0.000
#> GSM97143     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97113     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97056     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97124     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97132     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97144     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97149     1  0.0921      0.889 0.972 0.028 0.000 0.000
#> GSM97068     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97071     2  0.7768      0.065 0.000 0.400 0.240 0.360
#> GSM97086     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97103     3  0.4746      0.326 0.000 0.368 0.632 0.000
#> GSM97057     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97060     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97075     3  0.6179      0.346 0.320 0.072 0.608 0.000
#> GSM97098     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97099     2  0.4193      0.658 0.000 0.732 0.268 0.000
#> GSM97101     2  0.1474      0.896 0.000 0.948 0.052 0.000
#> GSM97105     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97106     3  0.2011      0.777 0.000 0.080 0.920 0.000
#> GSM97121     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97128     1  0.2011      0.839 0.920 0.000 0.080 0.000
#> GSM97131     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97137     2  0.1940      0.854 0.076 0.924 0.000 0.000
#> GSM97118     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97114     1  0.7010      0.466 0.576 0.184 0.240 0.000
#> GSM97142     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97140     2  0.1474      0.897 0.000 0.948 0.052 0.000
#> GSM97141     1  0.6954      0.460 0.568 0.280 0.152 0.000
#> GSM97055     1  0.0188      0.904 0.996 0.000 0.004 0.000
#> GSM97090     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97091     1  0.0188      0.904 0.996 0.000 0.004 0.000
#> GSM97148     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97063     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97053     1  0.0000      0.906 1.000 0.000 0.000 0.000
#> GSM97066     4  0.0000      0.989 0.000 0.000 0.000 1.000
#> GSM97079     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97083     3  0.4933      0.273 0.432 0.000 0.568 0.000
#> GSM97084     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97094     1  0.4491      0.749 0.800 0.060 0.140 0.000
#> GSM97096     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97097     2  0.2011      0.875 0.000 0.920 0.080 0.000
#> GSM97107     2  0.3569      0.755 0.000 0.804 0.196 0.000
#> GSM97054     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97062     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97069     4  0.0000      0.989 0.000 0.000 0.000 1.000
#> GSM97070     4  0.0000      0.989 0.000 0.000 0.000 1.000
#> GSM97073     4  0.0000      0.989 0.000 0.000 0.000 1.000
#> GSM97076     4  0.0188      0.985 0.004 0.000 0.000 0.996
#> GSM97077     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97095     2  0.3975      0.698 0.000 0.760 0.240 0.000
#> GSM97102     3  0.3907      0.622 0.000 0.000 0.768 0.232
#> GSM97109     1  0.7074      0.453 0.568 0.192 0.240 0.000
#> GSM97110     2  0.3975      0.698 0.000 0.760 0.240 0.000
#> GSM97074     4  0.0000      0.989 0.000 0.000 0.000 1.000
#> GSM97085     4  0.0188      0.985 0.000 0.000 0.004 0.996
#> GSM97059     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97072     4  0.0000      0.989 0.000 0.000 0.000 1.000
#> GSM97078     3  0.6362      0.251 0.072 0.368 0.560 0.000
#> GSM97067     4  0.0000      0.989 0.000 0.000 0.000 1.000
#> GSM97087     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97111     1  0.5817      0.596 0.676 0.076 0.248 0.000
#> GSM97064     2  0.3528      0.726 0.000 0.808 0.192 0.000
#> GSM97065     4  0.1867      0.902 0.000 0.000 0.072 0.928
#> GSM97081     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97082     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97088     3  0.3123      0.709 0.000 0.000 0.844 0.156
#> GSM97100     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97104     3  0.3975      0.607 0.000 0.000 0.760 0.240
#> GSM97108     2  0.1474      0.896 0.000 0.948 0.052 0.000
#> GSM97050     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97080     3  0.4072      0.594 0.000 0.000 0.748 0.252
#> GSM97089     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97092     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97093     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97058     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97051     2  0.0000      0.925 0.000 1.000 0.000 0.000
#> GSM97052     3  0.0000      0.830 0.000 0.000 1.000 0.000
#> GSM97061     3  0.0336      0.826 0.000 0.008 0.992 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97145     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97147     2  0.0404     0.8530 0.000 0.988 0.000 0.012 0.000
#> GSM97125     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97127     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97130     2  0.2966     0.6835 0.184 0.816 0.000 0.000 0.000
#> GSM97133     1  0.5504     0.5848 0.488 0.064 0.000 0.000 0.448
#> GSM97134     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97120     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97126     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97112     5  0.0000     0.7013 0.000 0.000 0.000 0.000 1.000
#> GSM97115     2  0.0000     0.8552 0.000 1.000 0.000 0.000 0.000
#> GSM97116     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97117     1  0.5459     0.1210 0.472 0.000 0.060 0.468 0.000
#> GSM97119     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97122     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97135     5  0.4304    -0.6360 0.484 0.000 0.000 0.000 0.516
#> GSM97136     1  0.6036     0.1040 0.472 0.000 0.436 0.080 0.012
#> GSM97139     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97146     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97123     3  0.3835     0.6118 0.000 0.012 0.744 0.244 0.000
#> GSM97129     1  0.5320     0.1500 0.488 0.004 0.040 0.468 0.000
#> GSM97143     5  0.4278    -0.5600 0.452 0.000 0.000 0.000 0.548
#> GSM97113     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97056     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97124     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97132     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97144     2  0.1121     0.8290 0.044 0.956 0.000 0.000 0.000
#> GSM97149     1  0.4440     0.6989 0.528 0.004 0.000 0.000 0.468
#> GSM97068     2  0.0000     0.8552 0.000 1.000 0.000 0.000 0.000
#> GSM97071     4  0.5310     0.1536 0.072 0.108 0.080 0.740 0.000
#> GSM97086     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97103     4  0.5557    -0.3807 0.000 0.068 0.464 0.468 0.000
#> GSM97057     2  0.0000     0.8552 0.000 1.000 0.000 0.000 0.000
#> GSM97060     3  0.0000     0.7561 0.000 0.000 1.000 0.000 0.000
#> GSM97075     4  0.6684    -0.2209 0.152 0.016 0.364 0.468 0.000
#> GSM97098     3  0.4283     0.4132 0.000 0.000 0.544 0.456 0.000
#> GSM97099     4  0.6578    -0.0921 0.000 0.284 0.248 0.468 0.000
#> GSM97101     2  0.4294     0.3875 0.000 0.532 0.000 0.468 0.000
#> GSM97105     2  0.0404     0.8530 0.000 0.988 0.000 0.012 0.000
#> GSM97106     3  0.1893     0.7297 0.000 0.048 0.928 0.024 0.000
#> GSM97121     2  0.2929     0.7350 0.000 0.820 0.000 0.180 0.000
#> GSM97128     5  0.1205     0.6639 0.040 0.000 0.004 0.000 0.956
#> GSM97131     2  0.0404     0.8530 0.000 0.988 0.000 0.012 0.000
#> GSM97137     2  0.2074     0.7728 0.104 0.896 0.000 0.000 0.000
#> GSM97118     5  0.3177     0.3378 0.208 0.000 0.000 0.000 0.792
#> GSM97114     1  0.5320     0.1500 0.488 0.004 0.040 0.468 0.000
#> GSM97142     5  0.0000     0.7013 0.000 0.000 0.000 0.000 1.000
#> GSM97140     2  0.3730     0.6275 0.000 0.712 0.000 0.288 0.000
#> GSM97141     4  0.7258     0.0904 0.284 0.208 0.040 0.468 0.000
#> GSM97055     5  0.0000     0.7013 0.000 0.000 0.000 0.000 1.000
#> GSM97090     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97091     5  0.0000     0.7013 0.000 0.000 0.000 0.000 1.000
#> GSM97148     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97063     5  0.0000     0.7013 0.000 0.000 0.000 0.000 1.000
#> GSM97053     1  0.4294     0.7066 0.532 0.000 0.000 0.000 0.468
#> GSM97066     4  0.4294     0.5257 0.468 0.000 0.000 0.532 0.000
#> GSM97079     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97083     5  0.0000     0.7013 0.000 0.000 0.000 0.000 1.000
#> GSM97084     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97094     1  0.5496     0.1296 0.476 0.004 0.052 0.468 0.000
#> GSM97096     3  0.4283     0.4132 0.000 0.000 0.544 0.456 0.000
#> GSM97097     2  0.4549     0.3817 0.000 0.528 0.008 0.464 0.000
#> GSM97107     2  0.4555     0.6442 0.000 0.732 0.068 0.200 0.000
#> GSM97054     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97062     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97069     4  0.4294     0.5257 0.468 0.000 0.000 0.532 0.000
#> GSM97070     4  0.4294     0.5257 0.468 0.000 0.000 0.532 0.000
#> GSM97073     4  0.4294     0.5257 0.468 0.000 0.000 0.532 0.000
#> GSM97076     4  0.4294     0.5257 0.468 0.000 0.000 0.532 0.000
#> GSM97077     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97095     2  0.7058     0.2564 0.084 0.456 0.080 0.380 0.000
#> GSM97102     3  0.2773     0.6487 0.000 0.000 0.836 0.164 0.000
#> GSM97109     4  0.6202    -0.1377 0.432 0.020 0.080 0.468 0.000
#> GSM97110     2  0.5737     0.2606 0.000 0.460 0.084 0.456 0.000
#> GSM97074     4  0.4294     0.5257 0.468 0.000 0.000 0.532 0.000
#> GSM97085     5  0.5735    -0.0947 0.092 0.000 0.376 0.000 0.532
#> GSM97059     2  0.0404     0.8530 0.000 0.988 0.000 0.012 0.000
#> GSM97072     4  0.4294     0.5257 0.468 0.000 0.000 0.532 0.000
#> GSM97078     3  0.6069     0.3005 0.008 0.092 0.456 0.444 0.000
#> GSM97067     4  0.4294     0.5257 0.468 0.000 0.000 0.532 0.000
#> GSM97087     3  0.0000     0.7561 0.000 0.000 1.000 0.000 0.000
#> GSM97111     4  0.6038    -0.1522 0.440 0.012 0.080 0.468 0.000
#> GSM97064     2  0.1908     0.7947 0.000 0.908 0.092 0.000 0.000
#> GSM97065     4  0.5046     0.5066 0.468 0.000 0.032 0.500 0.000
#> GSM97081     3  0.4060     0.5195 0.000 0.000 0.640 0.360 0.000
#> GSM97082     3  0.0000     0.7561 0.000 0.000 1.000 0.000 0.000
#> GSM97088     3  0.3039     0.6228 0.000 0.000 0.808 0.000 0.192
#> GSM97100     2  0.0000     0.8552 0.000 1.000 0.000 0.000 0.000
#> GSM97104     3  0.2648     0.6590 0.000 0.000 0.848 0.152 0.000
#> GSM97108     2  0.4294     0.3875 0.000 0.532 0.000 0.468 0.000
#> GSM97050     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97080     3  0.2970     0.6423 0.004 0.000 0.828 0.168 0.000
#> GSM97089     3  0.0000     0.7561 0.000 0.000 1.000 0.000 0.000
#> GSM97092     3  0.0000     0.7561 0.000 0.000 1.000 0.000 0.000
#> GSM97093     3  0.0000     0.7561 0.000 0.000 1.000 0.000 0.000
#> GSM97058     2  0.0290     0.8540 0.000 0.992 0.000 0.008 0.000
#> GSM97051     2  0.0162     0.8555 0.000 0.996 0.004 0.000 0.000
#> GSM97052     3  0.0000     0.7561 0.000 0.000 1.000 0.000 0.000
#> GSM97061     3  0.4482     0.4944 0.000 0.012 0.612 0.376 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.0291      0.943 0.992 0.004 0.000 0.000 0.004 0.000
#> GSM97145     1  0.0000      0.945 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97147     4  0.1858      0.895 0.004 0.092 0.000 0.904 0.000 0.000
#> GSM97125     1  0.0146      0.944 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM97127     1  0.0000      0.945 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97130     4  0.3071      0.744 0.180 0.016 0.000 0.804 0.000 0.000
#> GSM97133     1  0.1152      0.906 0.952 0.004 0.000 0.044 0.000 0.000
#> GSM97134     1  0.0146      0.944 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM97120     1  0.0000      0.945 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97126     1  0.0000      0.945 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97112     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97115     4  0.0363      0.939 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97116     1  0.0146      0.944 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM97117     1  0.1863      0.865 0.896 0.104 0.000 0.000 0.000 0.000
#> GSM97119     1  0.0291      0.943 0.992 0.004 0.000 0.000 0.004 0.000
#> GSM97122     1  0.0291      0.943 0.992 0.004 0.000 0.000 0.004 0.000
#> GSM97135     1  0.1285      0.912 0.944 0.004 0.000 0.000 0.052 0.000
#> GSM97136     1  0.5788      0.238 0.488 0.204 0.308 0.000 0.000 0.000
#> GSM97139     1  0.0000      0.945 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000      0.945 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97123     3  0.3330      0.671 0.000 0.284 0.716 0.000 0.000 0.000
#> GSM97129     1  0.1075      0.916 0.952 0.048 0.000 0.000 0.000 0.000
#> GSM97143     1  0.1958      0.867 0.896 0.004 0.000 0.000 0.100 0.000
#> GSM97113     4  0.0363      0.939 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97056     1  0.0146      0.943 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM97124     1  0.0146      0.944 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM97132     1  0.0146      0.944 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM97144     4  0.1594      0.900 0.052 0.016 0.000 0.932 0.000 0.000
#> GSM97149     1  0.0260      0.941 0.992 0.008 0.000 0.000 0.000 0.000
#> GSM97068     4  0.0363      0.939 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97071     2  0.0146      0.835 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM97086     4  0.0000      0.939 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97103     2  0.0363      0.835 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97057     4  0.0363      0.939 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97060     3  0.1267      0.867 0.000 0.060 0.940 0.000 0.000 0.000
#> GSM97075     2  0.0363      0.832 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97098     2  0.2260      0.761 0.000 0.860 0.140 0.000 0.000 0.000
#> GSM97099     2  0.0146      0.834 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97101     2  0.2730      0.758 0.000 0.808 0.000 0.192 0.000 0.000
#> GSM97105     4  0.1501      0.902 0.000 0.076 0.000 0.924 0.000 0.000
#> GSM97106     3  0.3699      0.731 0.000 0.212 0.752 0.036 0.000 0.000
#> GSM97121     4  0.3126      0.684 0.000 0.248 0.000 0.752 0.000 0.000
#> GSM97128     5  0.1718      0.927 0.044 0.008 0.016 0.000 0.932 0.000
#> GSM97131     4  0.1501      0.902 0.000 0.076 0.000 0.924 0.000 0.000
#> GSM97137     4  0.1556      0.880 0.080 0.000 0.000 0.920 0.000 0.000
#> GSM97118     1  0.4367      0.398 0.604 0.032 0.000 0.000 0.364 0.000
#> GSM97114     1  0.1075      0.916 0.952 0.048 0.000 0.000 0.000 0.000
#> GSM97142     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97140     2  0.3862      0.130 0.000 0.524 0.000 0.476 0.000 0.000
#> GSM97141     2  0.1663      0.822 0.000 0.912 0.000 0.088 0.000 0.000
#> GSM97055     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97090     4  0.0363      0.939 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97091     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97148     1  0.0000      0.945 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97053     1  0.0000      0.945 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97066     6  0.0000      0.989 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97079     4  0.0000      0.939 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97083     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97084     4  0.0000      0.939 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97094     2  0.0937      0.825 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM97096     2  0.1714      0.777 0.000 0.908 0.092 0.000 0.000 0.000
#> GSM97097     2  0.2697      0.767 0.000 0.812 0.000 0.188 0.000 0.000
#> GSM97107     2  0.3727      0.473 0.000 0.612 0.000 0.388 0.000 0.000
#> GSM97054     4  0.0000      0.939 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97062     4  0.0000      0.939 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97069     6  0.0000      0.989 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97070     6  0.0000      0.989 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97073     6  0.0000      0.989 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97076     6  0.0000      0.989 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97077     4  0.0363      0.939 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM97095     2  0.2006      0.814 0.004 0.892 0.000 0.104 0.000 0.000
#> GSM97102     3  0.1387      0.858 0.000 0.000 0.932 0.000 0.000 0.068
#> GSM97109     2  0.0458      0.835 0.016 0.984 0.000 0.000 0.000 0.000
#> GSM97110     2  0.1556      0.821 0.000 0.920 0.000 0.080 0.000 0.000
#> GSM97074     6  0.0000      0.989 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97085     5  0.0146      0.986 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM97059     4  0.1663      0.898 0.000 0.088 0.000 0.912 0.000 0.000
#> GSM97072     6  0.0000      0.989 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97078     2  0.2315      0.813 0.008 0.892 0.016 0.084 0.000 0.000
#> GSM97067     6  0.0000      0.989 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97087     3  0.0937      0.876 0.000 0.040 0.960 0.000 0.000 0.000
#> GSM97111     2  0.1444      0.803 0.072 0.928 0.000 0.000 0.000 0.000
#> GSM97064     4  0.2848      0.779 0.000 0.008 0.176 0.816 0.000 0.000
#> GSM97065     6  0.1501      0.906 0.000 0.076 0.000 0.000 0.000 0.924
#> GSM97081     3  0.2762      0.793 0.000 0.196 0.804 0.000 0.000 0.000
#> GSM97082     3  0.0937      0.876 0.000 0.040 0.960 0.000 0.000 0.000
#> GSM97088     3  0.1387      0.849 0.000 0.000 0.932 0.000 0.068 0.000
#> GSM97100     4  0.0000      0.939 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97104     3  0.1267      0.862 0.000 0.000 0.940 0.000 0.000 0.060
#> GSM97108     2  0.2793      0.752 0.000 0.800 0.000 0.200 0.000 0.000
#> GSM97050     4  0.0000      0.939 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97080     3  0.1444      0.855 0.000 0.000 0.928 0.000 0.000 0.072
#> GSM97089     3  0.0937      0.876 0.000 0.040 0.960 0.000 0.000 0.000
#> GSM97092     3  0.0000      0.871 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97093     3  0.2597      0.823 0.000 0.176 0.824 0.000 0.000 0.000
#> GSM97058     4  0.1387      0.913 0.000 0.068 0.000 0.932 0.000 0.000
#> GSM97051     4  0.0000      0.939 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM97052     3  0.0146      0.872 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM97061     3  0.3446      0.634 0.000 0.308 0.692 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)

plot of chunk tab-ATC-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-membership-heatmap-5

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)

plot of chunk tab-ATC-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-ATC-pam-get-signatures-no-scale-1

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

plot of chunk tab-ATC-pam-get-signatures-no-scale-2

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

plot of chunk tab-ATC-pam-get-signatures-no-scale-3

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

plot of chunk tab-ATC-pam-get-signatures-no-scale-4

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

plot of chunk tab-ATC-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-pam-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-ATC-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-pam-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:pam 99         6.38e-05       0.842     2.96e-13   0.0823 2
#> ATC:pam 96         3.29e-03       0.458     1.35e-09   0.1412 3
#> ATC:pam 92         1.73e-05       0.199     2.61e-15   0.0358 4
#> ATC:pam 75         1.08e-04       0.334     6.07e-12   0.2391 5
#> ATC:pam 96         2.10e-06       0.212     4.71e-15   0.0833 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.


ATC:mclust*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "mclust"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-mclust-collect-plots

The plots are:

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:

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)

plot of chunk ATC-mclust-select-partition-number

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.599           0.822       0.911         0.2817 0.802   0.802
#> 3 3 0.581           0.885       0.917         1.0116 0.602   0.510
#> 4 4 0.936           0.937       0.974         0.2631 0.806   0.570
#> 5 5 0.785           0.763       0.872         0.0631 0.964   0.877
#> 6 6 0.887           0.833       0.924         0.0671 0.871   0.553

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     2  0.0000      0.885 0.000 1.000
#> GSM97145     2  0.0000      0.885 0.000 1.000
#> GSM97147     2  0.0000      0.885 0.000 1.000
#> GSM97125     2  0.0000      0.885 0.000 1.000
#> GSM97127     2  0.0000      0.885 0.000 1.000
#> GSM97130     2  0.0000      0.885 0.000 1.000
#> GSM97133     2  0.0000      0.885 0.000 1.000
#> GSM97134     2  0.0000      0.885 0.000 1.000
#> GSM97120     2  0.0000      0.885 0.000 1.000
#> GSM97126     2  0.0000      0.885 0.000 1.000
#> GSM97112     2  0.0000      0.885 0.000 1.000
#> GSM97115     2  0.0000      0.885 0.000 1.000
#> GSM97116     2  0.0000      0.885 0.000 1.000
#> GSM97117     2  0.0000      0.885 0.000 1.000
#> GSM97119     2  0.0000      0.885 0.000 1.000
#> GSM97122     2  0.0000      0.885 0.000 1.000
#> GSM97135     2  0.0000      0.885 0.000 1.000
#> GSM97136     2  0.8909      0.663 0.308 0.692
#> GSM97139     2  0.0000      0.885 0.000 1.000
#> GSM97146     2  0.0000      0.885 0.000 1.000
#> GSM97123     2  0.9000      0.653 0.316 0.684
#> GSM97129     2  0.0000      0.885 0.000 1.000
#> GSM97143     2  0.0000      0.885 0.000 1.000
#> GSM97113     2  0.0000      0.885 0.000 1.000
#> GSM97056     2  0.0000      0.885 0.000 1.000
#> GSM97124     2  0.0000      0.885 0.000 1.000
#> GSM97132     2  0.0000      0.885 0.000 1.000
#> GSM97144     2  0.0000      0.885 0.000 1.000
#> GSM97149     2  0.0000      0.885 0.000 1.000
#> GSM97068     2  0.0000      0.885 0.000 1.000
#> GSM97071     1  0.0000      0.956 1.000 0.000
#> GSM97086     2  0.0000      0.885 0.000 1.000
#> GSM97103     2  0.9170      0.632 0.332 0.668
#> GSM97057     2  0.0000      0.885 0.000 1.000
#> GSM97060     2  0.9170      0.632 0.332 0.668
#> GSM97075     2  0.0672      0.881 0.008 0.992
#> GSM97098     2  0.9087      0.643 0.324 0.676
#> GSM97099     2  0.0000      0.885 0.000 1.000
#> GSM97101     2  0.0000      0.885 0.000 1.000
#> GSM97105     2  0.0000      0.885 0.000 1.000
#> GSM97106     2  0.9170      0.632 0.332 0.668
#> GSM97121     2  0.0000      0.885 0.000 1.000
#> GSM97128     2  0.8909      0.663 0.308 0.692
#> GSM97131     2  0.0000      0.885 0.000 1.000
#> GSM97137     2  0.0000      0.885 0.000 1.000
#> GSM97118     2  0.8909      0.663 0.308 0.692
#> GSM97114     2  0.0000      0.885 0.000 1.000
#> GSM97142     2  0.0000      0.885 0.000 1.000
#> GSM97140     2  0.0000      0.885 0.000 1.000
#> GSM97141     2  0.0000      0.885 0.000 1.000
#> GSM97055     2  0.8909      0.663 0.308 0.692
#> GSM97090     2  0.0000      0.885 0.000 1.000
#> GSM97091     2  0.8909      0.663 0.308 0.692
#> GSM97148     2  0.0000      0.885 0.000 1.000
#> GSM97063     2  0.8909      0.663 0.308 0.692
#> GSM97053     2  0.0000      0.885 0.000 1.000
#> GSM97066     1  0.0000      0.956 1.000 0.000
#> GSM97079     2  0.0000      0.885 0.000 1.000
#> GSM97083     2  0.8909      0.663 0.308 0.692
#> GSM97084     2  0.0000      0.885 0.000 1.000
#> GSM97094     2  0.0000      0.885 0.000 1.000
#> GSM97096     2  0.8909      0.663 0.308 0.692
#> GSM97097     2  0.0000      0.885 0.000 1.000
#> GSM97107     2  0.0000      0.885 0.000 1.000
#> GSM97054     2  0.0000      0.885 0.000 1.000
#> GSM97062     2  0.0000      0.885 0.000 1.000
#> GSM97069     1  0.0000      0.956 1.000 0.000
#> GSM97070     1  0.0000      0.956 1.000 0.000
#> GSM97073     1  0.0000      0.956 1.000 0.000
#> GSM97076     1  0.0000      0.956 1.000 0.000
#> GSM97077     2  0.0000      0.885 0.000 1.000
#> GSM97095     2  0.0000      0.885 0.000 1.000
#> GSM97102     2  0.9170      0.632 0.332 0.668
#> GSM97109     2  0.0000      0.885 0.000 1.000
#> GSM97110     2  0.0000      0.885 0.000 1.000
#> GSM97074     1  0.0000      0.956 1.000 0.000
#> GSM97085     2  0.8909      0.663 0.308 0.692
#> GSM97059     2  0.0000      0.885 0.000 1.000
#> GSM97072     1  0.0000      0.956 1.000 0.000
#> GSM97078     2  0.8909      0.663 0.308 0.692
#> GSM97067     1  0.0000      0.956 1.000 0.000
#> GSM97087     2  0.9170      0.632 0.332 0.668
#> GSM97111     2  0.0000      0.885 0.000 1.000
#> GSM97064     2  0.8909      0.663 0.308 0.692
#> GSM97065     1  0.0000      0.956 1.000 0.000
#> GSM97081     2  0.8909      0.663 0.308 0.692
#> GSM97082     2  0.9170      0.632 0.332 0.668
#> GSM97088     2  0.8909      0.663 0.308 0.692
#> GSM97100     2  0.0000      0.885 0.000 1.000
#> GSM97104     2  0.9170      0.632 0.332 0.668
#> GSM97108     2  0.0000      0.885 0.000 1.000
#> GSM97050     2  0.0000      0.885 0.000 1.000
#> GSM97080     1  0.9427      0.247 0.640 0.360
#> GSM97089     2  0.9044      0.648 0.320 0.680
#> GSM97092     2  0.9170      0.632 0.332 0.668
#> GSM97093     2  0.8909      0.663 0.308 0.692
#> GSM97058     2  0.0000      0.885 0.000 1.000
#> GSM97051     2  0.0000      0.885 0.000 1.000
#> GSM97052     2  0.9170      0.632 0.332 0.668
#> GSM97061     2  0.8909      0.663 0.308 0.692

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97145     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97147     2  0.2066      0.873 0.060 0.940 0.000
#> GSM97125     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97127     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97130     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97133     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97134     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97120     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97126     1  0.3752      0.937 0.856 0.144 0.000
#> GSM97112     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97115     2  0.3482      0.792 0.128 0.872 0.000
#> GSM97116     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97117     1  0.4291      0.902 0.820 0.180 0.000
#> GSM97119     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97122     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97135     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97136     1  0.7004     -0.108 0.552 0.428 0.020
#> GSM97139     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97146     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97123     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97129     2  0.5678      0.401 0.316 0.684 0.000
#> GSM97143     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97113     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97056     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97124     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97132     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97144     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97149     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97068     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97071     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97086     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97103     2  0.0892      0.909 0.000 0.980 0.020
#> GSM97057     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97060     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97075     2  0.0661      0.912 0.004 0.988 0.008
#> GSM97098     2  0.1129      0.909 0.004 0.976 0.020
#> GSM97099     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97101     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97105     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97106     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97121     2  0.0424      0.911 0.008 0.992 0.000
#> GSM97128     1  0.4418      0.662 0.848 0.132 0.020
#> GSM97131     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97137     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97118     1  0.4099      0.934 0.852 0.140 0.008
#> GSM97114     1  0.5397      0.774 0.720 0.280 0.000
#> GSM97142     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97140     2  0.0424      0.911 0.008 0.992 0.000
#> GSM97141     2  0.0237      0.912 0.004 0.996 0.000
#> GSM97055     1  0.0892      0.768 0.980 0.000 0.020
#> GSM97090     2  0.4887      0.620 0.228 0.772 0.000
#> GSM97091     1  0.0892      0.768 0.980 0.000 0.020
#> GSM97148     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97063     1  0.0892      0.768 0.980 0.000 0.020
#> GSM97053     1  0.3686      0.940 0.860 0.140 0.000
#> GSM97066     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97079     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97083     1  0.0892      0.768 0.980 0.000 0.020
#> GSM97084     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97094     1  0.3816      0.934 0.852 0.148 0.000
#> GSM97096     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97097     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97107     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97054     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97062     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97069     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97070     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97073     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97076     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97077     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97095     2  0.0592      0.909 0.012 0.988 0.000
#> GSM97102     2  0.4731      0.848 0.128 0.840 0.032
#> GSM97109     2  0.0424      0.911 0.008 0.992 0.000
#> GSM97110     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97074     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97085     2  0.6832      0.589 0.376 0.604 0.020
#> GSM97059     2  0.1163      0.899 0.028 0.972 0.000
#> GSM97072     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97078     2  0.0892      0.909 0.000 0.980 0.020
#> GSM97067     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97087     2  0.4731      0.848 0.128 0.840 0.032
#> GSM97111     2  0.1163      0.899 0.028 0.972 0.000
#> GSM97064     2  0.4485      0.851 0.136 0.844 0.020
#> GSM97065     3  0.0000      1.000 0.000 0.000 1.000
#> GSM97081     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97082     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97088     2  0.4862      0.841 0.160 0.820 0.020
#> GSM97100     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97104     2  0.4731      0.848 0.128 0.840 0.032
#> GSM97108     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97050     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97080     2  0.4731      0.848 0.128 0.840 0.032
#> GSM97089     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97092     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97093     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97058     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97051     2  0.0000      0.913 0.000 1.000 0.000
#> GSM97052     2  0.4551      0.848 0.140 0.840 0.020
#> GSM97061     2  0.4551      0.848 0.140 0.840 0.020

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3 p4
#> GSM97138     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97145     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97147     2  0.2589      0.868 0.116 0.884 0.000  0
#> GSM97125     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97127     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97130     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97133     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97134     1  0.4790      0.365 0.620 0.380 0.000  0
#> GSM97120     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97126     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97112     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97115     2  0.2216      0.890 0.092 0.908 0.000  0
#> GSM97116     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97117     1  0.4382      0.569 0.704 0.296 0.000  0
#> GSM97119     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97122     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97135     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97136     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97139     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97146     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97123     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97129     2  0.3024      0.835 0.148 0.852 0.000  0
#> GSM97143     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97113     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97056     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97124     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97132     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97144     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97149     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97068     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97071     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97086     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97103     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97057     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97060     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97075     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97098     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97099     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97101     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97105     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97106     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97121     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97128     3  0.0469      0.967 0.012 0.000 0.988  0
#> GSM97131     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97137     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97118     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97114     2  0.3074      0.831 0.152 0.848 0.000  0
#> GSM97142     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97140     2  0.1022      0.936 0.032 0.968 0.000  0
#> GSM97141     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97055     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97090     2  0.4746      0.444 0.368 0.632 0.000  0
#> GSM97091     3  0.4406      0.559 0.300 0.000 0.700  0
#> GSM97148     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97063     1  0.1557      0.899 0.944 0.000 0.056  0
#> GSM97053     1  0.0000      0.957 1.000 0.000 0.000  0
#> GSM97066     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97079     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97083     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97084     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97094     1  0.3942      0.671 0.764 0.236 0.000  0
#> GSM97096     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97097     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97107     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97054     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97062     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97069     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97070     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97073     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97076     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97077     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97095     2  0.1867      0.907 0.072 0.928 0.000  0
#> GSM97102     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97109     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97110     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97074     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97085     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97059     2  0.3311      0.807 0.172 0.828 0.000  0
#> GSM97072     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97078     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97067     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97087     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97111     2  0.2921      0.844 0.140 0.860 0.000  0
#> GSM97064     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97065     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM97081     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97082     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97088     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97100     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97104     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97108     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97050     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97080     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97089     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97092     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97093     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97058     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97051     2  0.0000      0.958 0.000 1.000 0.000  0
#> GSM97052     3  0.0000      0.982 0.000 0.000 1.000  0
#> GSM97061     3  0.0000      0.982 0.000 0.000 1.000  0

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97145     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97147     2  0.5671     0.6292 0.096 0.568 0.000 0.000 0.336
#> GSM97125     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97127     1  0.0162     0.8560 0.996 0.000 0.000 0.000 0.004
#> GSM97130     1  0.2561     0.7423 0.856 0.000 0.000 0.000 0.144
#> GSM97133     1  0.0404     0.8517 0.988 0.000 0.000 0.000 0.012
#> GSM97134     1  0.4313     0.6054 0.732 0.040 0.000 0.000 0.228
#> GSM97120     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97126     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97112     1  0.3957     0.2838 0.712 0.000 0.008 0.000 0.280
#> GSM97115     2  0.6466     0.4886 0.204 0.480 0.000 0.000 0.316
#> GSM97116     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97117     1  0.6054     0.3508 0.560 0.160 0.000 0.000 0.280
#> GSM97119     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97122     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97135     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97136     3  0.3741     0.5726 0.004 0.000 0.732 0.000 0.264
#> GSM97139     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97146     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97123     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97129     1  0.6739     0.0428 0.400 0.264 0.000 0.000 0.336
#> GSM97143     1  0.0579     0.8437 0.984 0.000 0.008 0.000 0.008
#> GSM97113     2  0.2179     0.7676 0.000 0.888 0.000 0.000 0.112
#> GSM97056     1  0.0162     0.8560 0.996 0.000 0.000 0.000 0.004
#> GSM97124     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97132     1  0.0290     0.8542 0.992 0.000 0.000 0.000 0.008
#> GSM97144     1  0.3048     0.7079 0.820 0.004 0.000 0.000 0.176
#> GSM97149     1  0.0162     0.8560 0.996 0.000 0.000 0.000 0.004
#> GSM97068     2  0.0963     0.8096 0.000 0.964 0.000 0.000 0.036
#> GSM97071     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97086     2  0.1965     0.7769 0.000 0.904 0.000 0.000 0.096
#> GSM97103     2  0.2136     0.7771 0.000 0.904 0.008 0.000 0.088
#> GSM97057     2  0.3177     0.7819 0.000 0.792 0.000 0.000 0.208
#> GSM97060     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97075     2  0.4088     0.7320 0.008 0.688 0.000 0.000 0.304
#> GSM97098     2  0.1648     0.7870 0.000 0.940 0.040 0.000 0.020
#> GSM97099     2  0.0703     0.8087 0.000 0.976 0.000 0.000 0.024
#> GSM97101     2  0.3109     0.7851 0.000 0.800 0.000 0.000 0.200
#> GSM97105     2  0.1410     0.7911 0.000 0.940 0.000 0.000 0.060
#> GSM97106     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97121     2  0.3521     0.7701 0.004 0.764 0.000 0.000 0.232
#> GSM97128     3  0.5131     0.3844 0.048 0.008 0.648 0.000 0.296
#> GSM97131     2  0.2280     0.7635 0.000 0.880 0.000 0.000 0.120
#> GSM97137     1  0.2970     0.7158 0.828 0.004 0.000 0.000 0.168
#> GSM97118     1  0.1082     0.8211 0.964 0.000 0.028 0.000 0.008
#> GSM97114     1  0.5678     0.4171 0.600 0.116 0.000 0.000 0.284
#> GSM97142     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97140     2  0.4045     0.7048 0.000 0.644 0.000 0.000 0.356
#> GSM97141     2  0.4201     0.7158 0.008 0.664 0.000 0.000 0.328
#> GSM97055     3  0.4307    -0.0121 0.000 0.000 0.504 0.000 0.496
#> GSM97090     2  0.6779     0.3152 0.288 0.388 0.000 0.000 0.324
#> GSM97091     5  0.6107     0.1483 0.132 0.000 0.372 0.000 0.496
#> GSM97148     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97063     5  0.5498     0.3133 0.440 0.000 0.064 0.000 0.496
#> GSM97053     1  0.0000     0.8570 1.000 0.000 0.000 0.000 0.000
#> GSM97066     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97079     2  0.2424     0.7544 0.000 0.868 0.000 0.000 0.132
#> GSM97083     3  0.4262     0.1767 0.000 0.000 0.560 0.000 0.440
#> GSM97084     2  0.1544     0.7886 0.000 0.932 0.000 0.000 0.068
#> GSM97094     1  0.4588     0.5897 0.720 0.060 0.000 0.000 0.220
#> GSM97096     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97097     2  0.2516     0.7492 0.000 0.860 0.000 0.000 0.140
#> GSM97107     2  0.2249     0.7982 0.000 0.896 0.000 0.008 0.096
#> GSM97054     2  0.2020     0.8069 0.000 0.900 0.000 0.000 0.100
#> GSM97062     2  0.2280     0.7627 0.000 0.880 0.000 0.000 0.120
#> GSM97069     4  0.0404     0.9823 0.000 0.000 0.012 0.988 0.000
#> GSM97070     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97073     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97076     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97077     2  0.1608     0.8093 0.000 0.928 0.000 0.000 0.072
#> GSM97095     2  0.5822     0.6076 0.108 0.548 0.000 0.000 0.344
#> GSM97102     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97109     2  0.3913     0.7231 0.000 0.676 0.000 0.000 0.324
#> GSM97110     2  0.0290     0.8067 0.000 0.992 0.000 0.000 0.008
#> GSM97074     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97085     3  0.3424     0.6204 0.000 0.000 0.760 0.000 0.240
#> GSM97059     2  0.5989     0.5925 0.128 0.536 0.000 0.000 0.336
#> GSM97072     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97078     2  0.2732     0.7968 0.000 0.840 0.000 0.000 0.160
#> GSM97067     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97087     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97111     2  0.6394     0.5042 0.180 0.476 0.000 0.000 0.344
#> GSM97064     3  0.0290     0.8818 0.000 0.008 0.992 0.000 0.000
#> GSM97065     4  0.0000     0.9981 0.000 0.000 0.000 1.000 0.000
#> GSM97081     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97082     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97088     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97100     2  0.0510     0.8031 0.000 0.984 0.000 0.000 0.016
#> GSM97104     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97108     2  0.2648     0.7981 0.000 0.848 0.000 0.000 0.152
#> GSM97050     2  0.1792     0.8088 0.000 0.916 0.000 0.000 0.084
#> GSM97080     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97089     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97092     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97093     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97058     2  0.1121     0.8008 0.000 0.956 0.000 0.000 0.044
#> GSM97051     2  0.1270     0.8101 0.000 0.948 0.000 0.000 0.052
#> GSM97052     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000
#> GSM97061     3  0.0000     0.8920 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5 p6
#> GSM97138     1  0.0000     0.9084 1.000 0.000 0.000 0.000 0.000  0
#> GSM97145     1  0.0260     0.9090 0.992 0.008 0.000 0.000 0.000  0
#> GSM97147     2  0.1225     0.8419 0.012 0.952 0.000 0.036 0.000  0
#> GSM97125     1  0.0146     0.9091 0.996 0.004 0.000 0.000 0.000  0
#> GSM97127     1  0.0458     0.9065 0.984 0.016 0.000 0.000 0.000  0
#> GSM97130     1  0.2219     0.7866 0.864 0.136 0.000 0.000 0.000  0
#> GSM97133     1  0.0632     0.9014 0.976 0.024 0.000 0.000 0.000  0
#> GSM97134     2  0.2823     0.6529 0.204 0.796 0.000 0.000 0.000  0
#> GSM97120     1  0.0260     0.9090 0.992 0.008 0.000 0.000 0.000  0
#> GSM97126     1  0.3409     0.5607 0.700 0.300 0.000 0.000 0.000  0
#> GSM97112     5  0.3620     0.3723 0.352 0.000 0.000 0.000 0.648  0
#> GSM97115     2  0.1261     0.8418 0.024 0.952 0.000 0.024 0.000  0
#> GSM97116     1  0.0000     0.9084 1.000 0.000 0.000 0.000 0.000  0
#> GSM97117     2  0.0363     0.8336 0.012 0.988 0.000 0.000 0.000  0
#> GSM97119     1  0.0000     0.9084 1.000 0.000 0.000 0.000 0.000  0
#> GSM97122     1  0.0000     0.9084 1.000 0.000 0.000 0.000 0.000  0
#> GSM97135     1  0.0000     0.9084 1.000 0.000 0.000 0.000 0.000  0
#> GSM97136     5  0.5928     0.5273 0.004 0.264 0.236 0.000 0.496  0
#> GSM97139     1  0.0146     0.9091 0.996 0.004 0.000 0.000 0.000  0
#> GSM97146     1  0.0000     0.9084 1.000 0.000 0.000 0.000 0.000  0
#> GSM97123     3  0.0146     0.9938 0.000 0.004 0.996 0.000 0.000  0
#> GSM97129     2  0.1196     0.8308 0.040 0.952 0.000 0.008 0.000  0
#> GSM97143     1  0.1007     0.8742 0.956 0.000 0.000 0.000 0.044  0
#> GSM97113     4  0.0146     0.9133 0.000 0.004 0.000 0.996 0.000  0
#> GSM97056     1  0.0458     0.9065 0.984 0.016 0.000 0.000 0.000  0
#> GSM97124     1  0.0260     0.9090 0.992 0.008 0.000 0.000 0.000  0
#> GSM97132     1  0.0458     0.9065 0.984 0.016 0.000 0.000 0.000  0
#> GSM97144     1  0.3390     0.5738 0.704 0.296 0.000 0.000 0.000  0
#> GSM97149     1  0.0458     0.9065 0.984 0.016 0.000 0.000 0.000  0
#> GSM97068     4  0.1204     0.9010 0.000 0.056 0.000 0.944 0.000  0
#> GSM97071     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97086     4  0.0146     0.9116 0.000 0.000 0.000 0.996 0.004  0
#> GSM97103     4  0.1663     0.8618 0.000 0.088 0.000 0.912 0.000  0
#> GSM97057     4  0.2146     0.8543 0.000 0.116 0.000 0.880 0.004  0
#> GSM97060     3  0.0146     0.9938 0.000 0.004 0.996 0.000 0.000  0
#> GSM97075     2  0.0717     0.8398 0.008 0.976 0.000 0.016 0.000  0
#> GSM97098     4  0.1010     0.8923 0.000 0.004 0.036 0.960 0.000  0
#> GSM97099     2  0.3547     0.5536 0.000 0.668 0.000 0.332 0.000  0
#> GSM97101     4  0.3854     0.0506 0.000 0.464 0.000 0.536 0.000  0
#> GSM97105     4  0.0291     0.9133 0.000 0.004 0.000 0.992 0.004  0
#> GSM97106     3  0.0146     0.9938 0.000 0.004 0.996 0.000 0.000  0
#> GSM97121     2  0.3360     0.6456 0.004 0.732 0.000 0.264 0.000  0
#> GSM97128     5  0.4703     0.1559 0.000 0.464 0.044 0.000 0.492  0
#> GSM97131     4  0.0000     0.9124 0.000 0.000 0.000 1.000 0.000  0
#> GSM97137     1  0.3797     0.2832 0.580 0.420 0.000 0.000 0.000  0
#> GSM97118     1  0.4835     0.3622 0.580 0.352 0.000 0.000 0.068  0
#> GSM97114     2  0.2092     0.7533 0.124 0.876 0.000 0.000 0.000  0
#> GSM97142     1  0.0146     0.9058 0.996 0.000 0.000 0.000 0.004  0
#> GSM97140     2  0.0790     0.8396 0.000 0.968 0.000 0.032 0.000  0
#> GSM97141     2  0.1219     0.8360 0.004 0.948 0.000 0.048 0.000  0
#> GSM97055     5  0.0260     0.7179 0.000 0.000 0.008 0.000 0.992  0
#> GSM97090     2  0.0891     0.8379 0.024 0.968 0.000 0.008 0.000  0
#> GSM97091     5  0.0260     0.7179 0.000 0.000 0.008 0.000 0.992  0
#> GSM97148     1  0.0146     0.9091 0.996 0.004 0.000 0.000 0.000  0
#> GSM97063     5  0.0260     0.7179 0.000 0.000 0.008 0.000 0.992  0
#> GSM97053     1  0.0000     0.9084 1.000 0.000 0.000 0.000 0.000  0
#> GSM97066     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97079     4  0.0000     0.9124 0.000 0.000 0.000 1.000 0.000  0
#> GSM97083     5  0.1765     0.7091 0.000 0.000 0.096 0.000 0.904  0
#> GSM97084     4  0.0291     0.9133 0.000 0.004 0.000 0.992 0.004  0
#> GSM97094     2  0.1327     0.8103 0.064 0.936 0.000 0.000 0.000  0
#> GSM97096     3  0.0000     0.9941 0.000 0.000 1.000 0.000 0.000  0
#> GSM97097     4  0.0000     0.9124 0.000 0.000 0.000 1.000 0.000  0
#> GSM97107     2  0.3647     0.5238 0.000 0.640 0.000 0.360 0.000  0
#> GSM97054     4  0.1411     0.9005 0.000 0.060 0.000 0.936 0.004  0
#> GSM97062     4  0.0000     0.9124 0.000 0.000 0.000 1.000 0.000  0
#> GSM97069     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97070     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97073     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97076     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97077     4  0.3499     0.4963 0.000 0.320 0.000 0.680 0.000  0
#> GSM97095     2  0.0405     0.8356 0.008 0.988 0.000 0.004 0.000  0
#> GSM97102     3  0.0000     0.9941 0.000 0.000 1.000 0.000 0.000  0
#> GSM97109     2  0.1124     0.8417 0.008 0.956 0.000 0.036 0.000  0
#> GSM97110     2  0.3851     0.2332 0.000 0.540 0.000 0.460 0.000  0
#> GSM97074     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97085     5  0.3446     0.5153 0.000 0.000 0.308 0.000 0.692  0
#> GSM97059     2  0.0891     0.8423 0.008 0.968 0.000 0.024 0.000  0
#> GSM97072     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97078     2  0.0603     0.8375 0.004 0.980 0.000 0.016 0.000  0
#> GSM97067     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97087     3  0.0000     0.9941 0.000 0.000 1.000 0.000 0.000  0
#> GSM97111     2  0.0405     0.8356 0.008 0.988 0.000 0.004 0.000  0
#> GSM97064     3  0.0146     0.9938 0.000 0.004 0.996 0.000 0.000  0
#> GSM97065     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM97081     3  0.0000     0.9941 0.000 0.000 1.000 0.000 0.000  0
#> GSM97082     3  0.0000     0.9941 0.000 0.000 1.000 0.000 0.000  0
#> GSM97088     3  0.0632     0.9709 0.000 0.000 0.976 0.000 0.024  0
#> GSM97100     4  0.0405     0.9132 0.000 0.008 0.000 0.988 0.004  0
#> GSM97104     3  0.0000     0.9941 0.000 0.000 1.000 0.000 0.000  0
#> GSM97108     2  0.3804     0.3324 0.000 0.576 0.000 0.424 0.000  0
#> GSM97050     4  0.1411     0.9004 0.000 0.060 0.000 0.936 0.004  0
#> GSM97080     3  0.0000     0.9941 0.000 0.000 1.000 0.000 0.000  0
#> GSM97089     3  0.0000     0.9941 0.000 0.000 1.000 0.000 0.000  0
#> GSM97092     3  0.0146     0.9938 0.000 0.004 0.996 0.000 0.000  0
#> GSM97093     3  0.0790     0.9627 0.000 0.032 0.968 0.000 0.000  0
#> GSM97058     4  0.0937     0.9082 0.000 0.040 0.000 0.960 0.000  0
#> GSM97051     4  0.1010     0.9093 0.000 0.036 0.000 0.960 0.004  0
#> GSM97052     3  0.0146     0.9938 0.000 0.004 0.996 0.000 0.000  0
#> GSM97061     3  0.0146     0.9938 0.000 0.004 0.996 0.000 0.000  0

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-membership-heatmap-5

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)

plot of chunk tab-ATC-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-ATC-mclust-get-signatures-no-scale-1

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

plot of chunk tab-ATC-mclust-get-signatures-no-scale-2

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

plot of chunk tab-ATC-mclust-get-signatures-no-scale-3

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

plot of chunk tab-ATC-mclust-get-signatures-no-scale-4

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

plot of chunk tab-ATC-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-mclust-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-ATC-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-mclust-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:mclust 99         5.43e-02      0.5156     4.66e-04   0.5101 2
#> ATC:mclust 98         3.01e-06      0.4748     2.61e-17   0.1297 3
#> ATC:mclust 98         2.32e-06      0.1255     1.64e-15   0.0431 4
#> ATC:mclust 89         8.31e-07      0.1198     1.82e-17   0.1541 5
#> ATC:mclust 92         4.34e-06      0.0833     9.96e-15   0.1335 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.


ATC:NMF*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "NMF"]
# 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 21512 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

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:

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)

plot of chunk ATC-NMF-select-partition-number

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.918           0.918       0.968         0.5025 0.497   0.497
#> 3 3 0.618           0.710       0.875         0.3265 0.661   0.418
#> 4 4 0.654           0.703       0.842         0.1026 0.905   0.727
#> 5 5 0.639           0.592       0.793         0.0831 0.780   0.362
#> 6 6 0.637           0.474       0.694         0.0402 0.908   0.610

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.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97138     1  0.0000    0.95809 1.000 0.000
#> GSM97145     1  0.0000    0.95809 1.000 0.000
#> GSM97147     2  0.0000    0.97421 0.000 1.000
#> GSM97125     1  0.0000    0.95809 1.000 0.000
#> GSM97127     1  0.2043    0.93722 0.968 0.032
#> GSM97130     2  0.1184    0.96094 0.016 0.984
#> GSM97133     2  0.1184    0.96094 0.016 0.984
#> GSM97134     1  0.9922    0.22790 0.552 0.448
#> GSM97120     1  0.0000    0.95809 1.000 0.000
#> GSM97126     1  0.0000    0.95809 1.000 0.000
#> GSM97112     1  0.0000    0.95809 1.000 0.000
#> GSM97115     2  0.0000    0.97421 0.000 1.000
#> GSM97116     1  0.0000    0.95809 1.000 0.000
#> GSM97117     1  0.0000    0.95809 1.000 0.000
#> GSM97119     1  0.0000    0.95809 1.000 0.000
#> GSM97122     1  0.0000    0.95809 1.000 0.000
#> GSM97135     1  0.0000    0.95809 1.000 0.000
#> GSM97136     1  0.0000    0.95809 1.000 0.000
#> GSM97139     1  0.0000    0.95809 1.000 0.000
#> GSM97146     1  0.0000    0.95809 1.000 0.000
#> GSM97123     2  0.0000    0.97421 0.000 1.000
#> GSM97129     1  0.9983    0.13308 0.524 0.476
#> GSM97143     1  0.0000    0.95809 1.000 0.000
#> GSM97113     2  0.0000    0.97421 0.000 1.000
#> GSM97056     1  0.4939    0.86802 0.892 0.108
#> GSM97124     1  0.0000    0.95809 1.000 0.000
#> GSM97132     1  0.0000    0.95809 1.000 0.000
#> GSM97144     2  0.0376    0.97112 0.004 0.996
#> GSM97149     2  0.9963    0.08774 0.464 0.536
#> GSM97068     2  0.0000    0.97421 0.000 1.000
#> GSM97071     2  0.9993   -0.00864 0.484 0.516
#> GSM97086     2  0.0000    0.97421 0.000 1.000
#> GSM97103     2  0.0000    0.97421 0.000 1.000
#> GSM97057     2  0.0000    0.97421 0.000 1.000
#> GSM97060     2  0.0000    0.97421 0.000 1.000
#> GSM97075     1  0.4939    0.87054 0.892 0.108
#> GSM97098     2  0.0000    0.97421 0.000 1.000
#> GSM97099     2  0.0000    0.97421 0.000 1.000
#> GSM97101     2  0.0000    0.97421 0.000 1.000
#> GSM97105     2  0.0000    0.97421 0.000 1.000
#> GSM97106     2  0.0000    0.97421 0.000 1.000
#> GSM97121     2  0.0000    0.97421 0.000 1.000
#> GSM97128     1  0.0000    0.95809 1.000 0.000
#> GSM97131     2  0.0000    0.97421 0.000 1.000
#> GSM97137     2  0.0938    0.96446 0.012 0.988
#> GSM97118     1  0.0000    0.95809 1.000 0.000
#> GSM97114     2  0.0000    0.97421 0.000 1.000
#> GSM97142     1  0.0000    0.95809 1.000 0.000
#> GSM97140     2  0.0000    0.97421 0.000 1.000
#> GSM97141     2  0.0000    0.97421 0.000 1.000
#> GSM97055     1  0.0000    0.95809 1.000 0.000
#> GSM97090     2  0.0000    0.97421 0.000 1.000
#> GSM97091     1  0.0000    0.95809 1.000 0.000
#> GSM97148     1  0.0000    0.95809 1.000 0.000
#> GSM97063     1  0.0000    0.95809 1.000 0.000
#> GSM97053     1  0.0000    0.95809 1.000 0.000
#> GSM97066     1  0.0000    0.95809 1.000 0.000
#> GSM97079     2  0.0000    0.97421 0.000 1.000
#> GSM97083     1  0.0000    0.95809 1.000 0.000
#> GSM97084     2  0.0000    0.97421 0.000 1.000
#> GSM97094     1  0.0376    0.95592 0.996 0.004
#> GSM97096     1  0.2043    0.93786 0.968 0.032
#> GSM97097     2  0.0000    0.97421 0.000 1.000
#> GSM97107     2  0.0000    0.97421 0.000 1.000
#> GSM97054     2  0.0000    0.97421 0.000 1.000
#> GSM97062     2  0.0000    0.97421 0.000 1.000
#> GSM97069     1  0.0376    0.95592 0.996 0.004
#> GSM97070     1  0.0000    0.95809 1.000 0.000
#> GSM97073     1  0.3431    0.91281 0.936 0.064
#> GSM97076     1  0.0000    0.95809 1.000 0.000
#> GSM97077     2  0.0000    0.97421 0.000 1.000
#> GSM97095     1  0.9209    0.51922 0.664 0.336
#> GSM97102     1  0.0000    0.95809 1.000 0.000
#> GSM97109     2  0.0672    0.96787 0.008 0.992
#> GSM97110     2  0.0000    0.97421 0.000 1.000
#> GSM97074     1  0.0000    0.95809 1.000 0.000
#> GSM97085     1  0.0000    0.95809 1.000 0.000
#> GSM97059     2  0.0000    0.97421 0.000 1.000
#> GSM97072     2  0.0000    0.97421 0.000 1.000
#> GSM97078     1  0.1184    0.94853 0.984 0.016
#> GSM97067     1  0.0000    0.95809 1.000 0.000
#> GSM97087     1  0.0000    0.95809 1.000 0.000
#> GSM97111     1  0.3733    0.90632 0.928 0.072
#> GSM97064     2  0.0000    0.97421 0.000 1.000
#> GSM97065     1  0.2778    0.92591 0.952 0.048
#> GSM97081     1  0.4298    0.89049 0.912 0.088
#> GSM97082     1  0.0000    0.95809 1.000 0.000
#> GSM97088     1  0.0000    0.95809 1.000 0.000
#> GSM97100     2  0.0000    0.97421 0.000 1.000
#> GSM97104     1  0.0000    0.95809 1.000 0.000
#> GSM97108     2  0.0000    0.97421 0.000 1.000
#> GSM97050     2  0.0000    0.97421 0.000 1.000
#> GSM97080     1  0.8555    0.62791 0.720 0.280
#> GSM97089     1  0.0000    0.95809 1.000 0.000
#> GSM97092     2  0.0000    0.97421 0.000 1.000
#> GSM97093     2  0.5178    0.84730 0.116 0.884
#> GSM97058     2  0.0000    0.97421 0.000 1.000
#> GSM97051     2  0.0000    0.97421 0.000 1.000
#> GSM97052     2  0.0000    0.97421 0.000 1.000
#> GSM97061     2  0.0000    0.97421 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97138     1  0.1643    0.84002 0.956 0.000 0.044
#> GSM97145     1  0.0237    0.86359 0.996 0.004 0.000
#> GSM97147     1  0.6154    0.37844 0.592 0.408 0.000
#> GSM97125     1  0.0000    0.86282 1.000 0.000 0.000
#> GSM97127     1  0.1031    0.86229 0.976 0.024 0.000
#> GSM97130     1  0.3038    0.83012 0.896 0.104 0.000
#> GSM97133     1  0.3412    0.81570 0.876 0.124 0.000
#> GSM97134     1  0.1964    0.85357 0.944 0.056 0.000
#> GSM97120     1  0.0237    0.86359 0.996 0.004 0.000
#> GSM97126     1  0.2878    0.79957 0.904 0.000 0.096
#> GSM97112     1  0.5785    0.40660 0.668 0.000 0.332
#> GSM97115     1  0.6111    0.41041 0.604 0.396 0.000
#> GSM97116     1  0.0000    0.86282 1.000 0.000 0.000
#> GSM97117     1  0.3038    0.79158 0.896 0.000 0.104
#> GSM97119     1  0.0237    0.86146 0.996 0.000 0.004
#> GSM97122     1  0.0000    0.86282 1.000 0.000 0.000
#> GSM97135     1  0.0237    0.86146 0.996 0.000 0.004
#> GSM97136     3  0.2878    0.78853 0.096 0.000 0.904
#> GSM97139     1  0.0237    0.86359 0.996 0.004 0.000
#> GSM97146     1  0.0000    0.86282 1.000 0.000 0.000
#> GSM97123     2  0.4002    0.73496 0.000 0.840 0.160
#> GSM97129     1  0.2711    0.84045 0.912 0.088 0.000
#> GSM97143     1  0.5016    0.60202 0.760 0.000 0.240
#> GSM97113     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97056     1  0.1031    0.86229 0.976 0.024 0.000
#> GSM97124     1  0.0237    0.86359 0.996 0.004 0.000
#> GSM97132     1  0.0000    0.86282 1.000 0.000 0.000
#> GSM97144     1  0.3038    0.83012 0.896 0.104 0.000
#> GSM97149     1  0.2537    0.84420 0.920 0.080 0.000
#> GSM97068     2  0.1289    0.84499 0.032 0.968 0.000
#> GSM97071     2  0.7658    0.29664 0.056 0.588 0.356
#> GSM97086     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97103     2  0.5058    0.62556 0.000 0.756 0.244
#> GSM97057     2  0.1031    0.84960 0.024 0.976 0.000
#> GSM97060     3  0.6204    0.24844 0.000 0.424 0.576
#> GSM97075     3  0.1529    0.80833 0.000 0.040 0.960
#> GSM97098     2  0.5706    0.47842 0.000 0.680 0.320
#> GSM97099     2  0.2625    0.81298 0.000 0.916 0.084
#> GSM97101     2  0.0237    0.85942 0.004 0.996 0.000
#> GSM97105     2  0.0237    0.85942 0.004 0.996 0.000
#> GSM97106     2  0.3752    0.75146 0.000 0.856 0.144
#> GSM97121     2  0.6095    0.25181 0.392 0.608 0.000
#> GSM97128     3  0.3686    0.75609 0.140 0.000 0.860
#> GSM97131     2  0.0237    0.85934 0.000 0.996 0.004
#> GSM97137     1  0.3192    0.82483 0.888 0.112 0.000
#> GSM97118     3  0.6225    0.29784 0.432 0.000 0.568
#> GSM97114     1  0.4002    0.78386 0.840 0.160 0.000
#> GSM97142     1  0.2959    0.79582 0.900 0.000 0.100
#> GSM97140     2  0.6180    0.17595 0.416 0.584 0.000
#> GSM97141     2  0.6026    0.29774 0.376 0.624 0.000
#> GSM97055     3  0.4702    0.68434 0.212 0.000 0.788
#> GSM97090     1  0.5905    0.50662 0.648 0.352 0.000
#> GSM97091     3  0.5529    0.57112 0.296 0.000 0.704
#> GSM97148     1  0.0237    0.86359 0.996 0.004 0.000
#> GSM97063     3  0.6309    0.09168 0.500 0.000 0.500
#> GSM97053     1  0.0000    0.86282 1.000 0.000 0.000
#> GSM97066     3  0.0000    0.82525 0.000 0.000 1.000
#> GSM97079     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97083     3  0.3816    0.74876 0.148 0.000 0.852
#> GSM97084     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97094     1  0.0475    0.86315 0.992 0.004 0.004
#> GSM97096     3  0.0424    0.82469 0.000 0.008 0.992
#> GSM97097     2  0.0424    0.85785 0.000 0.992 0.008
#> GSM97107     1  0.6308    0.10536 0.508 0.492 0.000
#> GSM97054     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97062     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97069     3  0.0424    0.82469 0.000 0.008 0.992
#> GSM97070     3  0.0237    0.82567 0.000 0.004 0.996
#> GSM97073     3  0.0592    0.82324 0.000 0.012 0.988
#> GSM97076     1  0.4605    0.66153 0.796 0.000 0.204
#> GSM97077     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97095     1  0.6796    0.66993 0.708 0.236 0.056
#> GSM97102     3  0.0237    0.82567 0.000 0.004 0.996
#> GSM97109     1  0.5882    0.51290 0.652 0.348 0.000
#> GSM97110     2  0.1031    0.85016 0.000 0.976 0.024
#> GSM97074     3  0.2261    0.80262 0.068 0.000 0.932
#> GSM97085     3  0.0747    0.82234 0.016 0.000 0.984
#> GSM97059     2  0.6309   -0.13933 0.500 0.500 0.000
#> GSM97072     3  0.6111    0.31670 0.000 0.396 0.604
#> GSM97078     3  0.0829    0.82466 0.012 0.004 0.984
#> GSM97067     3  0.0000    0.82525 0.000 0.000 1.000
#> GSM97087     3  0.0237    0.82567 0.000 0.004 0.996
#> GSM97111     1  0.4357    0.83202 0.868 0.080 0.052
#> GSM97064     2  0.2625    0.80798 0.000 0.916 0.084
#> GSM97065     3  0.8169    0.28790 0.388 0.076 0.536
#> GSM97081     3  0.0592    0.82324 0.000 0.012 0.988
#> GSM97082     3  0.0237    0.82567 0.000 0.004 0.996
#> GSM97088     3  0.0424    0.82432 0.008 0.000 0.992
#> GSM97100     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97104     3  0.0237    0.82567 0.000 0.004 0.996
#> GSM97108     2  0.1411    0.84254 0.036 0.964 0.000
#> GSM97050     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97080     3  0.0747    0.82140 0.000 0.016 0.984
#> GSM97089     3  0.0237    0.82567 0.000 0.004 0.996
#> GSM97092     3  0.5882    0.41803 0.000 0.348 0.652
#> GSM97093     3  0.6309    0.00352 0.000 0.496 0.504
#> GSM97058     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97051     2  0.0000    0.86097 0.000 1.000 0.000
#> GSM97052     3  0.6295    0.10946 0.000 0.472 0.528
#> GSM97061     2  0.3752    0.75154 0.000 0.856 0.144

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97138     1  0.2706      0.840 0.900 0.000 0.080 0.020
#> GSM97145     1  0.0592      0.872 0.984 0.016 0.000 0.000
#> GSM97147     1  0.5256      0.345 0.596 0.392 0.000 0.012
#> GSM97125     1  0.1411      0.867 0.960 0.000 0.020 0.020
#> GSM97127     1  0.0921      0.870 0.972 0.028 0.000 0.000
#> GSM97130     1  0.1888      0.862 0.940 0.044 0.000 0.016
#> GSM97133     1  0.2089      0.859 0.932 0.048 0.000 0.020
#> GSM97134     1  0.1284      0.871 0.964 0.024 0.000 0.012
#> GSM97120     1  0.0779      0.873 0.980 0.016 0.004 0.000
#> GSM97126     1  0.3743      0.775 0.824 0.000 0.160 0.016
#> GSM97112     1  0.4910      0.603 0.704 0.000 0.276 0.020
#> GSM97115     1  0.5364      0.333 0.592 0.392 0.000 0.016
#> GSM97116     1  0.1510      0.867 0.956 0.000 0.028 0.016
#> GSM97117     1  0.1489      0.867 0.952 0.000 0.044 0.004
#> GSM97119     1  0.2775      0.839 0.896 0.000 0.084 0.020
#> GSM97122     1  0.2089      0.857 0.932 0.000 0.048 0.020
#> GSM97135     1  0.2256      0.853 0.924 0.000 0.056 0.020
#> GSM97136     3  0.1174      0.753 0.020 0.000 0.968 0.012
#> GSM97139     1  0.0592      0.872 0.984 0.016 0.000 0.000
#> GSM97146     1  0.1677      0.865 0.948 0.000 0.040 0.012
#> GSM97123     2  0.2814      0.720 0.000 0.868 0.132 0.000
#> GSM97129     1  0.1833      0.863 0.944 0.024 0.000 0.032
#> GSM97143     1  0.4797      0.631 0.720 0.000 0.260 0.020
#> GSM97113     2  0.4730      0.555 0.000 0.636 0.000 0.364
#> GSM97056     1  0.1256      0.872 0.964 0.028 0.008 0.000
#> GSM97124     1  0.0779      0.873 0.980 0.016 0.004 0.000
#> GSM97132     1  0.1411      0.866 0.960 0.000 0.020 0.020
#> GSM97144     1  0.2111      0.859 0.932 0.044 0.000 0.024
#> GSM97149     1  0.1256      0.869 0.964 0.028 0.000 0.008
#> GSM97068     2  0.5130      0.613 0.020 0.668 0.000 0.312
#> GSM97071     4  0.0188      0.795 0.000 0.004 0.000 0.996
#> GSM97086     2  0.2530      0.784 0.000 0.888 0.000 0.112
#> GSM97103     4  0.1820      0.800 0.000 0.020 0.036 0.944
#> GSM97057     2  0.1302      0.794 0.044 0.956 0.000 0.000
#> GSM97060     3  0.5933      0.351 0.000 0.408 0.552 0.040
#> GSM97075     3  0.3385      0.752 0.008 0.072 0.880 0.040
#> GSM97098     2  0.5938      0.548 0.000 0.696 0.136 0.168
#> GSM97099     4  0.1929      0.799 0.000 0.024 0.036 0.940
#> GSM97101     2  0.1209      0.794 0.032 0.964 0.004 0.000
#> GSM97105     2  0.2480      0.794 0.008 0.904 0.000 0.088
#> GSM97106     2  0.2814      0.720 0.000 0.868 0.132 0.000
#> GSM97121     2  0.6730      0.521 0.276 0.592 0.000 0.132
#> GSM97128     3  0.2089      0.741 0.048 0.000 0.932 0.020
#> GSM97131     2  0.1867      0.794 0.000 0.928 0.000 0.072
#> GSM97137     1  0.1637      0.860 0.940 0.060 0.000 0.000
#> GSM97118     3  0.5558      0.165 0.432 0.000 0.548 0.020
#> GSM97114     1  0.3958      0.788 0.836 0.052 0.000 0.112
#> GSM97142     1  0.3708      0.782 0.832 0.000 0.148 0.020
#> GSM97140     2  0.3024      0.737 0.148 0.852 0.000 0.000
#> GSM97141     2  0.3837      0.672 0.224 0.776 0.000 0.000
#> GSM97055     3  0.2843      0.719 0.088 0.000 0.892 0.020
#> GSM97090     1  0.4955      0.221 0.556 0.444 0.000 0.000
#> GSM97091     3  0.3806      0.653 0.156 0.000 0.824 0.020
#> GSM97148     1  0.1174      0.873 0.968 0.020 0.012 0.000
#> GSM97063     3  0.5550      0.171 0.428 0.000 0.552 0.020
#> GSM97053     1  0.1042      0.872 0.972 0.008 0.020 0.000
#> GSM97066     4  0.5143      0.557 0.012 0.000 0.360 0.628
#> GSM97079     2  0.4898      0.474 0.000 0.584 0.000 0.416
#> GSM97083     3  0.2174      0.743 0.052 0.000 0.928 0.020
#> GSM97084     2  0.2345      0.789 0.000 0.900 0.000 0.100
#> GSM97094     1  0.2002      0.861 0.936 0.000 0.044 0.020
#> GSM97096     3  0.2500      0.756 0.000 0.044 0.916 0.040
#> GSM97097     2  0.4999      0.302 0.000 0.508 0.000 0.492
#> GSM97107     4  0.2984      0.729 0.084 0.028 0.000 0.888
#> GSM97054     2  0.1151      0.798 0.024 0.968 0.000 0.008
#> GSM97062     2  0.3649      0.732 0.000 0.796 0.000 0.204
#> GSM97069     4  0.5004      0.501 0.004 0.000 0.392 0.604
#> GSM97070     4  0.4452      0.687 0.008 0.000 0.260 0.732
#> GSM97073     4  0.1398      0.803 0.004 0.000 0.040 0.956
#> GSM97076     4  0.2443      0.782 0.024 0.000 0.060 0.916
#> GSM97077     2  0.1938      0.801 0.012 0.936 0.000 0.052
#> GSM97095     1  0.6243      0.665 0.668 0.160 0.172 0.000
#> GSM97102     3  0.1833      0.759 0.000 0.024 0.944 0.032
#> GSM97109     1  0.6522      0.527 0.632 0.144 0.000 0.224
#> GSM97110     4  0.4428      0.388 0.000 0.276 0.004 0.720
#> GSM97074     4  0.4748      0.676 0.016 0.000 0.268 0.716
#> GSM97085     3  0.1042      0.753 0.008 0.000 0.972 0.020
#> GSM97059     2  0.4500      0.511 0.316 0.684 0.000 0.000
#> GSM97072     4  0.2089      0.800 0.000 0.020 0.048 0.932
#> GSM97078     3  0.4964      0.416 0.028 0.000 0.716 0.256
#> GSM97067     4  0.4857      0.612 0.008 0.000 0.324 0.668
#> GSM97087     3  0.2742      0.754 0.000 0.076 0.900 0.024
#> GSM97111     1  0.3616      0.835 0.852 0.036 0.112 0.000
#> GSM97064     2  0.1792      0.768 0.000 0.932 0.068 0.000
#> GSM97065     4  0.0524      0.799 0.004 0.000 0.008 0.988
#> GSM97081     3  0.2443      0.760 0.000 0.060 0.916 0.024
#> GSM97082     3  0.2021      0.763 0.000 0.040 0.936 0.024
#> GSM97088     3  0.0469      0.764 0.000 0.012 0.988 0.000
#> GSM97100     2  0.1938      0.800 0.012 0.936 0.000 0.052
#> GSM97104     3  0.2385      0.749 0.000 0.028 0.920 0.052
#> GSM97108     2  0.4776      0.732 0.060 0.776 0.000 0.164
#> GSM97050     2  0.0524      0.796 0.008 0.988 0.004 0.000
#> GSM97080     3  0.3813      0.652 0.000 0.024 0.828 0.148
#> GSM97089     3  0.1938      0.765 0.000 0.052 0.936 0.012
#> GSM97092     3  0.5465      0.398 0.000 0.392 0.588 0.020
#> GSM97093     3  0.4877      0.369 0.000 0.408 0.592 0.000
#> GSM97058     2  0.1807      0.801 0.008 0.940 0.000 0.052
#> GSM97051     2  0.0524      0.797 0.008 0.988 0.000 0.004
#> GSM97052     2  0.4998     -0.149 0.000 0.512 0.488 0.000
#> GSM97061     2  0.2469      0.742 0.000 0.892 0.108 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97138     1  0.4126     0.4271 0.620 0.000 0.000 0.000 0.380
#> GSM97145     1  0.0324     0.7825 0.992 0.004 0.000 0.000 0.004
#> GSM97147     1  0.3339     0.6983 0.836 0.000 0.040 0.124 0.000
#> GSM97125     1  0.3661     0.5988 0.724 0.000 0.000 0.000 0.276
#> GSM97127     1  0.0404     0.7830 0.988 0.000 0.000 0.000 0.012
#> GSM97130     4  0.5368     0.5673 0.136 0.028 0.012 0.736 0.088
#> GSM97133     1  0.0000     0.7823 1.000 0.000 0.000 0.000 0.000
#> GSM97134     4  0.5890     0.3325 0.048 0.024 0.012 0.616 0.300
#> GSM97120     1  0.0510     0.7829 0.984 0.000 0.000 0.000 0.016
#> GSM97126     1  0.3242     0.6787 0.784 0.000 0.000 0.000 0.216
#> GSM97112     5  0.2798     0.6265 0.140 0.000 0.008 0.000 0.852
#> GSM97115     4  0.1780     0.7375 0.028 0.000 0.024 0.940 0.008
#> GSM97116     1  0.3109     0.6855 0.800 0.000 0.000 0.000 0.200
#> GSM97117     1  0.1568     0.7738 0.944 0.020 0.036 0.000 0.000
#> GSM97119     5  0.4249     0.0517 0.432 0.000 0.000 0.000 0.568
#> GSM97122     1  0.4300     0.1678 0.524 0.000 0.000 0.000 0.476
#> GSM97135     1  0.4227     0.3277 0.580 0.000 0.000 0.000 0.420
#> GSM97136     5  0.6303    -0.2234 0.000 0.160 0.364 0.000 0.476
#> GSM97139     1  0.0703     0.7822 0.976 0.000 0.000 0.000 0.024
#> GSM97146     1  0.1792     0.7607 0.916 0.000 0.000 0.000 0.084
#> GSM97123     3  0.1704     0.6946 0.000 0.004 0.928 0.068 0.000
#> GSM97129     1  0.1281     0.7715 0.956 0.032 0.012 0.000 0.000
#> GSM97143     5  0.2707     0.6339 0.132 0.000 0.008 0.000 0.860
#> GSM97113     4  0.7520     0.2402 0.056 0.188 0.360 0.396 0.000
#> GSM97056     4  0.6576     0.0115 0.216 0.000 0.000 0.444 0.340
#> GSM97124     1  0.3508     0.6280 0.748 0.000 0.000 0.000 0.252
#> GSM97132     5  0.5401    -0.1394 0.480 0.004 0.012 0.024 0.480
#> GSM97144     4  0.4313     0.6352 0.020 0.060 0.012 0.812 0.096
#> GSM97149     1  0.0000     0.7823 1.000 0.000 0.000 0.000 0.000
#> GSM97068     4  0.0693     0.7353 0.000 0.008 0.012 0.980 0.000
#> GSM97071     2  0.3653     0.7737 0.000 0.808 0.012 0.164 0.016
#> GSM97086     4  0.1357     0.7351 0.000 0.004 0.048 0.948 0.000
#> GSM97103     2  0.2464     0.8517 0.000 0.888 0.016 0.096 0.000
#> GSM97057     4  0.5344     0.3331 0.052 0.000 0.448 0.500 0.000
#> GSM97060     3  0.3766     0.7242 0.000 0.104 0.828 0.012 0.056
#> GSM97075     3  0.2818     0.7106 0.004 0.128 0.860 0.000 0.008
#> GSM97098     3  0.3635     0.6060 0.000 0.248 0.748 0.004 0.000
#> GSM97099     2  0.2331     0.8665 0.020 0.900 0.080 0.000 0.000
#> GSM97101     3  0.5463     0.4114 0.256 0.004 0.644 0.096 0.000
#> GSM97105     4  0.4491     0.5086 0.008 0.004 0.364 0.624 0.000
#> GSM97106     3  0.2179     0.6710 0.000 0.000 0.896 0.100 0.004
#> GSM97121     1  0.3527     0.6855 0.820 0.028 0.148 0.004 0.000
#> GSM97128     5  0.0486     0.6866 0.004 0.000 0.004 0.004 0.988
#> GSM97131     4  0.3177     0.6716 0.000 0.000 0.208 0.792 0.000
#> GSM97137     4  0.4522     0.6077 0.072 0.008 0.008 0.780 0.132
#> GSM97118     5  0.0703     0.6908 0.024 0.000 0.000 0.000 0.976
#> GSM97114     1  0.1364     0.7703 0.952 0.036 0.012 0.000 0.000
#> GSM97142     5  0.3752     0.4062 0.292 0.000 0.000 0.000 0.708
#> GSM97140     1  0.5092     0.1753 0.524 0.000 0.440 0.036 0.000
#> GSM97141     1  0.4329     0.4858 0.672 0.016 0.312 0.000 0.000
#> GSM97055     5  0.1628     0.6587 0.008 0.000 0.056 0.000 0.936
#> GSM97090     4  0.3047     0.7114 0.004 0.000 0.044 0.868 0.084
#> GSM97091     5  0.0693     0.6849 0.008 0.000 0.012 0.000 0.980
#> GSM97148     1  0.0703     0.7820 0.976 0.000 0.000 0.000 0.024
#> GSM97063     5  0.1364     0.6898 0.036 0.000 0.012 0.000 0.952
#> GSM97053     1  0.3579     0.6407 0.756 0.000 0.000 0.004 0.240
#> GSM97066     2  0.1836     0.8760 0.000 0.932 0.032 0.000 0.036
#> GSM97079     4  0.0324     0.7342 0.000 0.004 0.004 0.992 0.000
#> GSM97083     5  0.1153     0.6876 0.004 0.000 0.008 0.024 0.964
#> GSM97084     4  0.0609     0.7357 0.000 0.000 0.020 0.980 0.000
#> GSM97094     5  0.5315     0.3173 0.028 0.004 0.012 0.368 0.588
#> GSM97096     3  0.5190     0.6320 0.000 0.172 0.688 0.000 0.140
#> GSM97097     4  0.0566     0.7322 0.000 0.012 0.004 0.984 0.000
#> GSM97107     4  0.3049     0.6726 0.000 0.084 0.012 0.872 0.032
#> GSM97054     4  0.1478     0.7331 0.000 0.000 0.064 0.936 0.000
#> GSM97062     4  0.0324     0.7342 0.000 0.004 0.004 0.992 0.000
#> GSM97069     2  0.2795     0.8516 0.000 0.880 0.056 0.000 0.064
#> GSM97070     2  0.1408     0.8776 0.000 0.948 0.044 0.000 0.008
#> GSM97073     2  0.0740     0.8831 0.008 0.980 0.008 0.004 0.000
#> GSM97076     2  0.2821     0.8462 0.052 0.896 0.012 0.032 0.008
#> GSM97077     4  0.3884     0.6104 0.000 0.004 0.288 0.708 0.000
#> GSM97095     5  0.4473     0.2485 0.008 0.000 0.000 0.412 0.580
#> GSM97102     5  0.6480    -0.3356 0.000 0.184 0.404 0.000 0.412
#> GSM97109     1  0.1914     0.7578 0.924 0.060 0.016 0.000 0.000
#> GSM97110     2  0.3934     0.7887 0.016 0.820 0.060 0.104 0.000
#> GSM97074     2  0.2606     0.8617 0.000 0.900 0.012 0.032 0.056
#> GSM97085     5  0.3336     0.5464 0.000 0.060 0.096 0.000 0.844
#> GSM97059     4  0.6709     0.2537 0.384 0.000 0.152 0.448 0.016
#> GSM97072     2  0.1661     0.8836 0.000 0.940 0.036 0.024 0.000
#> GSM97078     5  0.4810     0.2817 0.000 0.008 0.012 0.400 0.580
#> GSM97067     2  0.2074     0.8718 0.000 0.920 0.044 0.000 0.036
#> GSM97087     3  0.5487     0.5509 0.000 0.100 0.620 0.000 0.280
#> GSM97111     1  0.4397     0.5789 0.708 0.024 0.264 0.000 0.004
#> GSM97064     3  0.2127     0.6534 0.000 0.000 0.892 0.108 0.000
#> GSM97065     2  0.1547     0.8764 0.032 0.948 0.016 0.004 0.000
#> GSM97081     3  0.3911     0.6948 0.000 0.144 0.796 0.000 0.060
#> GSM97082     3  0.6269     0.3018 0.000 0.148 0.444 0.000 0.408
#> GSM97088     5  0.2110     0.6254 0.000 0.016 0.072 0.000 0.912
#> GSM97100     4  0.2377     0.7158 0.000 0.000 0.128 0.872 0.000
#> GSM97104     3  0.6368     0.3800 0.000 0.172 0.472 0.000 0.356
#> GSM97108     4  0.7385     0.2836 0.232 0.036 0.320 0.412 0.000
#> GSM97050     3  0.4425    -0.0185 0.008 0.000 0.600 0.392 0.000
#> GSM97080     2  0.5657     0.4278 0.000 0.616 0.256 0.000 0.128
#> GSM97089     3  0.5580     0.5832 0.000 0.132 0.632 0.000 0.236
#> GSM97092     3  0.2843     0.7310 0.000 0.076 0.876 0.000 0.048
#> GSM97093     3  0.1918     0.7301 0.004 0.004 0.932 0.012 0.048
#> GSM97058     4  0.4542     0.3481 0.000 0.008 0.456 0.536 0.000
#> GSM97051     4  0.3707     0.6153 0.000 0.000 0.284 0.716 0.000
#> GSM97052     3  0.1646     0.7288 0.000 0.004 0.944 0.020 0.032
#> GSM97061     3  0.1697     0.7014 0.000 0.008 0.932 0.060 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97138     1  0.5466     0.2262 0.512 0.096 0.004 0.000 0.384 0.004
#> GSM97145     1  0.1398     0.6837 0.940 0.052 0.000 0.000 0.008 0.000
#> GSM97147     1  0.6505     0.2286 0.460 0.192 0.040 0.308 0.000 0.000
#> GSM97125     1  0.4716     0.5603 0.680 0.136 0.000 0.000 0.184 0.000
#> GSM97127     1  0.0520     0.6853 0.984 0.008 0.000 0.000 0.008 0.000
#> GSM97130     2  0.5762     0.3958 0.096 0.476 0.000 0.408 0.016 0.004
#> GSM97133     1  0.0363     0.6852 0.988 0.012 0.000 0.000 0.000 0.000
#> GSM97134     4  0.6799    -0.3342 0.048 0.252 0.000 0.452 0.244 0.004
#> GSM97120     1  0.0820     0.6858 0.972 0.016 0.000 0.000 0.012 0.000
#> GSM97126     5  0.3869     0.0366 0.500 0.000 0.000 0.000 0.500 0.000
#> GSM97112     5  0.2033     0.7252 0.056 0.020 0.004 0.000 0.916 0.004
#> GSM97115     4  0.5455    -0.0489 0.080 0.308 0.020 0.588 0.004 0.000
#> GSM97116     1  0.2608     0.6628 0.872 0.048 0.000 0.000 0.080 0.000
#> GSM97117     1  0.6287     0.3852 0.516 0.216 0.240 0.000 0.004 0.024
#> GSM97119     5  0.4585     0.4174 0.308 0.060 0.000 0.000 0.632 0.000
#> GSM97122     5  0.5149     0.0139 0.440 0.084 0.000 0.000 0.476 0.000
#> GSM97135     1  0.5516     0.2315 0.504 0.140 0.000 0.000 0.356 0.000
#> GSM97136     5  0.6478    -0.1799 0.004 0.036 0.364 0.000 0.440 0.156
#> GSM97139     1  0.0891     0.6855 0.968 0.024 0.000 0.000 0.008 0.000
#> GSM97146     1  0.2618     0.6587 0.872 0.052 0.000 0.000 0.076 0.000
#> GSM97123     3  0.2113     0.6797 0.000 0.048 0.912 0.032 0.000 0.008
#> GSM97129     1  0.3970     0.6206 0.756 0.196 0.008 0.000 0.004 0.036
#> GSM97143     5  0.2492     0.7226 0.068 0.036 0.008 0.000 0.888 0.000
#> GSM97113     4  0.7093     0.3324 0.024 0.172 0.092 0.536 0.004 0.172
#> GSM97056     1  0.7681    -0.2092 0.356 0.300 0.012 0.184 0.148 0.000
#> GSM97124     1  0.5019     0.5434 0.652 0.236 0.000 0.004 0.104 0.004
#> GSM97132     1  0.6660     0.1116 0.388 0.388 0.000 0.020 0.188 0.016
#> GSM97144     2  0.5114     0.3457 0.016 0.484 0.000 0.464 0.024 0.012
#> GSM97149     1  0.1036     0.6847 0.964 0.024 0.000 0.004 0.008 0.000
#> GSM97068     4  0.1843     0.4803 0.000 0.080 0.004 0.912 0.000 0.004
#> GSM97071     6  0.4973     0.6490 0.000 0.276 0.004 0.072 0.008 0.640
#> GSM97086     4  0.0291     0.5162 0.000 0.004 0.004 0.992 0.000 0.000
#> GSM97103     6  0.6123     0.5663 0.004 0.312 0.032 0.112 0.004 0.536
#> GSM97057     4  0.5639     0.4366 0.036 0.104 0.232 0.624 0.004 0.000
#> GSM97060     3  0.3700     0.6503 0.000 0.016 0.808 0.012 0.028 0.136
#> GSM97075     3  0.5120     0.6410 0.032 0.116 0.740 0.008 0.028 0.076
#> GSM97098     3  0.4754     0.5802 0.000 0.076 0.704 0.024 0.000 0.196
#> GSM97099     6  0.6102     0.6054 0.036 0.228 0.136 0.012 0.000 0.588
#> GSM97101     3  0.6391     0.4204 0.168 0.144 0.584 0.100 0.000 0.004
#> GSM97105     4  0.4981     0.4682 0.008 0.160 0.132 0.692 0.000 0.008
#> GSM97106     3  0.1969     0.6746 0.000 0.020 0.920 0.052 0.004 0.004
#> GSM97121     1  0.5983     0.4750 0.564 0.264 0.140 0.028 0.000 0.004
#> GSM97128     5  0.1503     0.7270 0.000 0.032 0.016 0.000 0.944 0.008
#> GSM97131     4  0.2799     0.5273 0.000 0.064 0.076 0.860 0.000 0.000
#> GSM97137     4  0.6176    -0.0966 0.080 0.288 0.000 0.552 0.076 0.004
#> GSM97118     5  0.3282     0.6948 0.016 0.116 0.004 0.000 0.836 0.028
#> GSM97114     1  0.3823     0.6164 0.772 0.188 0.008 0.016 0.000 0.016
#> GSM97142     5  0.3455     0.6553 0.144 0.056 0.000 0.000 0.800 0.000
#> GSM97140     3  0.6480     0.0170 0.372 0.128 0.440 0.060 0.000 0.000
#> GSM97141     1  0.5911     0.2731 0.496 0.180 0.316 0.008 0.000 0.000
#> GSM97055     5  0.1995     0.7182 0.004 0.024 0.036 0.000 0.924 0.012
#> GSM97090     4  0.5546     0.2798 0.020 0.204 0.032 0.668 0.072 0.004
#> GSM97091     5  0.1129     0.7338 0.008 0.012 0.012 0.000 0.964 0.004
#> GSM97148     1  0.1461     0.6805 0.940 0.044 0.000 0.000 0.016 0.000
#> GSM97063     5  0.1149     0.7348 0.024 0.008 0.008 0.000 0.960 0.000
#> GSM97053     1  0.3979     0.5805 0.752 0.076 0.000 0.000 0.172 0.000
#> GSM97066     6  0.1542     0.8149 0.000 0.024 0.016 0.000 0.016 0.944
#> GSM97079     4  0.1863     0.5087 0.000 0.060 0.000 0.920 0.004 0.016
#> GSM97083     5  0.2094     0.7175 0.000 0.064 0.024 0.000 0.908 0.004
#> GSM97084     4  0.3023     0.3209 0.000 0.212 0.004 0.784 0.000 0.000
#> GSM97094     2  0.6570     0.4059 0.024 0.504 0.004 0.188 0.268 0.012
#> GSM97096     3  0.4601     0.6548 0.000 0.080 0.760 0.004 0.056 0.100
#> GSM97097     4  0.4235     0.1235 0.000 0.300 0.008 0.668 0.000 0.024
#> GSM97107     2  0.5264     0.3623 0.004 0.500 0.004 0.436 0.012 0.044
#> GSM97054     4  0.3534     0.3272 0.000 0.200 0.024 0.772 0.000 0.004
#> GSM97062     4  0.2362     0.4340 0.000 0.136 0.000 0.860 0.000 0.004
#> GSM97069     6  0.2345     0.7947 0.000 0.028 0.028 0.000 0.040 0.904
#> GSM97070     6  0.1053     0.8147 0.000 0.012 0.020 0.000 0.004 0.964
#> GSM97073     6  0.2663     0.8125 0.000 0.084 0.012 0.028 0.000 0.876
#> GSM97076     6  0.4672     0.7368 0.044 0.216 0.004 0.016 0.008 0.712
#> GSM97077     4  0.4170     0.5188 0.004 0.116 0.064 0.788 0.004 0.024
#> GSM97095     2  0.7238     0.3344 0.008 0.324 0.048 0.316 0.300 0.004
#> GSM97102     3  0.6601     0.3388 0.000 0.044 0.440 0.000 0.320 0.196
#> GSM97109     1  0.6524     0.4076 0.472 0.372 0.056 0.024 0.000 0.076
#> GSM97110     4  0.6564     0.0145 0.004 0.156 0.032 0.420 0.004 0.384
#> GSM97074     6  0.3130     0.7921 0.000 0.144 0.000 0.004 0.028 0.824
#> GSM97085     5  0.3320     0.6678 0.000 0.032 0.076 0.000 0.844 0.048
#> GSM97059     4  0.6446     0.0235 0.396 0.060 0.104 0.436 0.004 0.000
#> GSM97072     6  0.2313     0.8085 0.000 0.044 0.016 0.036 0.000 0.904
#> GSM97078     5  0.4429     0.4144 0.000 0.040 0.004 0.240 0.704 0.012
#> GSM97067     6  0.1232     0.8142 0.000 0.024 0.016 0.000 0.004 0.956
#> GSM97087     3  0.4668     0.5962 0.000 0.020 0.712 0.000 0.188 0.080
#> GSM97111     3  0.6598    -0.0918 0.372 0.220 0.384 0.012 0.004 0.008
#> GSM97064     3  0.4828    -0.0700 0.000 0.044 0.500 0.452 0.000 0.004
#> GSM97065     6  0.3434     0.7898 0.008 0.136 0.012 0.024 0.000 0.820
#> GSM97081     3  0.5052     0.6671 0.000 0.092 0.732 0.012 0.104 0.060
#> GSM97082     3  0.6166     0.2474 0.000 0.036 0.452 0.000 0.388 0.124
#> GSM97088     5  0.2926     0.6800 0.000 0.024 0.112 0.000 0.852 0.012
#> GSM97100     4  0.2003     0.5307 0.000 0.044 0.044 0.912 0.000 0.000
#> GSM97104     3  0.6405     0.4386 0.000 0.040 0.504 0.000 0.240 0.216
#> GSM97108     2  0.7705    -0.1933 0.276 0.340 0.148 0.228 0.000 0.008
#> GSM97050     4  0.5421     0.4143 0.000 0.120 0.264 0.604 0.008 0.004
#> GSM97080     6  0.5566     0.5423 0.000 0.044 0.156 0.012 0.116 0.672
#> GSM97089     3  0.5202     0.5816 0.000 0.024 0.668 0.000 0.176 0.132
#> GSM97092     3  0.1760     0.6854 0.000 0.000 0.928 0.004 0.020 0.048
#> GSM97093     3  0.1065     0.6893 0.000 0.008 0.964 0.008 0.020 0.000
#> GSM97058     4  0.5570     0.4544 0.000 0.156 0.180 0.636 0.004 0.024
#> GSM97051     4  0.3062     0.5289 0.000 0.052 0.112 0.836 0.000 0.000
#> GSM97052     3  0.1242     0.6874 0.000 0.008 0.960 0.012 0.012 0.008
#> GSM97061     3  0.2103     0.6766 0.000 0.012 0.912 0.056 0.000 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)

plot of chunk tab-ATC-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-membership-heatmap-5

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)

plot of chunk tab-ATC-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-ATC-NMF-get-signatures-no-scale-1

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

plot of chunk tab-ATC-NMF-get-signatures-no-scale-2

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

plot of chunk tab-ATC-NMF-get-signatures-no-scale-3

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

plot of chunk tab-ATC-NMF-get-signatures-no-scale-4

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

plot of chunk tab-ATC-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-NMF-signature_compare

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:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. 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")

plot of chunk tab-ATC-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-NMF-collect-classes

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 disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:NMF 96         2.74e-02      0.0378     1.75e-03   0.2217 2
#> ATC:NMF 82         1.44e-06      0.0332     3.74e-11   0.0603 3
#> ATC:NMF 87         6.01e-06      0.2059     2.36e-14   0.1471 4
#> ATC:NMF 75         6.08e-03      0.9663     1.16e-10   0.3964 5
#> ATC:NMF 57         2.17e-03      0.9315     1.43e-10   0.8218 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.

Session info

sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#> 
#> Matrix products: default
#> BLAS:   /usr/lib64/libblas.so.3.4.2
#> LAPACK: /usr/lib64/liblapack.so.3.4.2
#> 
#> locale:
#>  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8       
#>  [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
#>  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
#> [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] grid      stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] genefilter_1.66.0    ComplexHeatmap_2.3.1 markdown_1.1         knitr_1.26          
#> [5] GetoptLong_0.1.7     cola_1.3.2          
#> 
#> loaded via a namespace (and not attached):
#>  [1] circlize_0.4.8       shape_1.4.4          xfun_0.11            slam_0.1-46         
#>  [5] lattice_0.20-38      splines_3.6.0        colorspace_1.4-1     vctrs_0.2.0         
#>  [9] stats4_3.6.0         blob_1.2.0           XML_3.98-1.20        survival_2.44-1.1   
#> [13] rlang_0.4.2          pillar_1.4.2         DBI_1.0.0            BiocGenerics_0.30.0 
#> [17] bit64_0.9-7          RColorBrewer_1.1-2   matrixStats_0.55.0   stringr_1.4.0       
#> [21] GlobalOptions_0.1.1  evaluate_0.14        memoise_1.1.0        Biobase_2.44.0      
#> [25] IRanges_2.18.3       parallel_3.6.0       AnnotationDbi_1.46.1 highr_0.8           
#> [29] Rcpp_1.0.3           xtable_1.8-4         backports_1.1.5      S4Vectors_0.22.1    
#> [33] annotate_1.62.0      skmeans_0.2-11       bit_1.1-14           microbenchmark_1.4-7
#> [37] brew_1.0-6           impute_1.58.0        rjson_0.2.20         png_0.1-7           
#> [41] digest_0.6.23        stringi_1.4.3        polyclip_1.10-0      clue_0.3-57         
#> [45] tools_3.6.0          bitops_1.0-6         magrittr_1.5         eulerr_6.0.0        
#> [49] RCurl_1.95-4.12      RSQLite_2.1.4        tibble_2.1.3         cluster_2.1.0       
#> [53] crayon_1.3.4         pkgconfig_2.0.3      zeallot_0.1.0        Matrix_1.2-17       
#> [57] xml2_1.2.2           httr_1.4.1           R6_2.4.1             mclust_5.4.5        
#> [61] compiler_3.6.0