cola Report for recount2:SRP063496

Date: 2019-12-26 01:16:51 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 16873 rows and 72 columns.
#>   Top rows are extracted by 'SD, CV, MAD, ATC' methods.
#>   Subgroups are detected by 'hclust, kmeans, skmeans, pam, mclust, NMF' method.
#>   Number of partitions are tried for k = 2, 3, 4, 5, 6.
#>   Performed in total 30000 partitions by row resampling.
#> 
#> Following methods can be applied to this 'ConsensusPartitionList' object:
#>  [1] "cola_report"           "collect_classes"       "collect_plots"         "collect_stats"        
#>  [5] "colnames"              "functional_enrichment" "get_anno_col"          "get_anno"             
#>  [9] "get_classes"           "get_matrix"            "get_membership"        "get_stats"            
#> [13] "is_best_k"             "is_stable_k"           "ncol"                  "nrow"                 
#> [17] "rownames"              "show"                  "suggest_best_k"        "test_to_known_factors"
#> [21] "top_rows_heatmap"      "top_rows_overlap"     
#> 
#> You can get result for a single method by, e.g. object["SD", "hclust"] or object["SD:hclust"]
#> or a subset of methods by object[c("SD", "CV")], c("hclust", "kmeans")]

The call of run_all_consensus_partition_methods() was:

#> run_all_consensus_partition_methods(data = mat, mc.cores = 4)

Dimension of the input matrix:

mat = get_matrix(res_list)
dim(mat)
#> [1] 16873    72

Density distribution

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

library(ComplexHeatmap)
densityHeatmap(mat, ylab = "value", cluster_columns = TRUE, show_column_names = FALSE,
    mc.cores = 4)

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 Optional k
SD:kmeans 3 1.000 0.972 0.977 **
CV:NMF 2 1.000 0.949 0.980 **
MAD:kmeans 3 1.000 0.980 0.991 **
MAD:skmeans 2 1.000 0.995 0.998 **
ATC:kmeans 3 1.000 0.946 0.979 ** 2
ATC:skmeans 2 1.000 0.988 0.995 **
CV:pam 2 0.977 0.915 0.949 **
MAD:NMF 2 0.971 0.963 0.982 **
ATC:pam 4 0.952 0.914 0.963 **
ATC:NMF 2 0.945 0.951 0.980 *
SD:NMF 2 0.913 0.948 0.976 *
SD:skmeans 4 0.908 0.853 0.930 * 2,3
CV:kmeans 2 0.889 0.941 0.974
CV:skmeans 2 0.887 0.932 0.970
MAD:pam 3 0.854 0.942 0.973
CV:mclust 2 0.711 0.924 0.951
ATC:hclust 3 0.709 0.844 0.913
MAD:hclust 3 0.630 0.774 0.893
SD:pam 2 0.622 0.917 0.952
ATC:mclust 2 0.619 0.845 0.925
CV:hclust 3 0.520 0.763 0.864
SD:hclust 3 0.512 0.705 0.862
MAD:mclust 2 0.486 0.857 0.898
SD:mclust 2 0.428 0.793 0.894

**: 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.913           0.948       0.976          0.505 0.493   0.493
#> CV:NMF      2 1.000           0.949       0.980          0.498 0.503   0.503
#> MAD:NMF     2 0.971           0.963       0.982          0.506 0.493   0.493
#> ATC:NMF     2 0.945           0.951       0.980          0.502 0.496   0.496
#> SD:skmeans  2 1.000           0.995       0.998          0.507 0.493   0.493
#> CV:skmeans  2 0.887           0.932       0.970          0.505 0.495   0.495
#> MAD:skmeans 2 1.000           0.995       0.998          0.507 0.493   0.493
#> ATC:skmeans 2 1.000           0.988       0.995          0.506 0.495   0.495
#> SD:mclust   2 0.428           0.793       0.894          0.444 0.540   0.540
#> CV:mclust   2 0.711           0.924       0.951          0.484 0.518   0.518
#> MAD:mclust  2 0.486           0.857       0.898          0.468 0.525   0.525
#> ATC:mclust  2 0.619           0.845       0.925          0.466 0.503   0.503
#> SD:kmeans   2 0.803           0.848       0.944          0.494 0.503   0.503
#> CV:kmeans   2 0.889           0.941       0.974          0.480 0.512   0.512
#> MAD:kmeans  2 0.759           0.894       0.950          0.497 0.493   0.493
#> ATC:kmeans  2 1.000           0.992       0.997          0.474 0.525   0.525
#> SD:pam      2 0.622           0.917       0.952          0.490 0.503   0.503
#> CV:pam      2 0.977           0.915       0.949          0.441 0.549   0.549
#> MAD:pam     2 0.838           0.924       0.959          0.490 0.503   0.503
#> ATC:pam     2 0.767           0.908       0.958          0.490 0.512   0.512
#> SD:hclust   2 0.513           0.720       0.875          0.434 0.581   0.581
#> CV:hclust   2 0.419           0.673       0.847          0.423 0.581   0.581
#> MAD:hclust  2 0.453           0.723       0.865          0.455 0.493   0.493
#> ATC:hclust  2 0.815           0.917       0.955          0.418 0.593   0.593
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.463           0.478       0.744          0.261 0.856   0.718
#> CV:NMF      3 0.842           0.856       0.938          0.331 0.797   0.608
#> MAD:NMF     3 0.388           0.453       0.717          0.297 0.783   0.585
#> ATC:NMF     3 0.575           0.751       0.858          0.265 0.788   0.598
#> SD:skmeans  3 0.928           0.851       0.940          0.268 0.848   0.698
#> CV:skmeans  3 0.719           0.785       0.896          0.274 0.802   0.619
#> MAD:skmeans 3 0.826           0.917       0.956          0.267 0.823   0.654
#> ATC:skmeans 3 0.771           0.788       0.909          0.191 0.907   0.814
#> SD:mclust   3 0.423           0.564       0.805          0.221 0.898   0.820
#> CV:mclust   3 0.518           0.540       0.806          0.327 0.737   0.527
#> MAD:mclust  3 0.337           0.710       0.795          0.188 0.619   0.462
#> ATC:mclust  3 0.360           0.555       0.775          0.234 0.710   0.526
#> SD:kmeans   3 1.000           0.972       0.977          0.318 0.654   0.420
#> CV:kmeans   3 0.670           0.772       0.879          0.345 0.656   0.426
#> MAD:kmeans  3 1.000           0.980       0.991          0.318 0.672   0.436
#> ATC:kmeans  3 1.000           0.946       0.979          0.404 0.682   0.462
#> SD:pam      3 0.741           0.899       0.949          0.319 0.678   0.452
#> CV:pam      3 0.813           0.868       0.937          0.420 0.831   0.692
#> MAD:pam     3 0.854           0.942       0.973          0.317 0.678   0.452
#> ATC:pam     3 0.792           0.895       0.951          0.358 0.714   0.492
#> SD:hclust   3 0.512           0.705       0.862          0.455 0.665   0.469
#> CV:hclust   3 0.520           0.763       0.864          0.476 0.668   0.472
#> MAD:hclust  3 0.630           0.774       0.893          0.380 0.718   0.500
#> ATC:hclust  3 0.709           0.844       0.913          0.562 0.739   0.560
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.588           0.659       0.820         0.1621 0.683   0.336
#> CV:NMF      4 0.874           0.871       0.932         0.1409 0.805   0.492
#> MAD:NMF     4 0.585           0.669       0.795         0.1406 0.786   0.463
#> ATC:NMF     4 0.559           0.505       0.722         0.1220 0.842   0.607
#> SD:skmeans  4 0.908           0.853       0.930         0.0957 0.867   0.664
#> CV:skmeans  4 0.772           0.736       0.872         0.1260 0.832   0.570
#> MAD:skmeans 4 0.792           0.804       0.895         0.0931 0.913   0.766
#> ATC:skmeans 4 0.853           0.825       0.909         0.1141 0.868   0.690
#> SD:mclust   4 0.499           0.661       0.810         0.1517 0.807   0.653
#> CV:mclust   4 0.511           0.509       0.680         0.0568 0.815   0.523
#> MAD:mclust  4 0.419           0.496       0.727         0.2476 0.760   0.537
#> ATC:mclust  4 0.442           0.436       0.719         0.1528 0.796   0.571
#> SD:kmeans   4 0.659           0.498       0.754         0.1225 0.975   0.928
#> CV:kmeans   4 0.656           0.705       0.823         0.1379 0.828   0.548
#> MAD:kmeans  4 0.615           0.543       0.706         0.1193 0.939   0.826
#> ATC:kmeans  4 0.766           0.810       0.854         0.1065 0.894   0.700
#> SD:pam      4 0.681           0.653       0.806         0.1241 0.900   0.727
#> CV:pam      4 0.841           0.880       0.940         0.1600 0.856   0.640
#> MAD:pam     4 0.657           0.748       0.876         0.1448 0.837   0.580
#> ATC:pam     4 0.952           0.914       0.963         0.1109 0.891   0.689
#> SD:hclust   4 0.560           0.609       0.735         0.1010 1.000   1.000
#> CV:hclust   4 0.508           0.691       0.803         0.0819 0.977   0.932
#> MAD:hclust  4 0.636           0.682       0.795         0.1242 0.930   0.807
#> ATC:hclust  4 0.709           0.775       0.833         0.1072 0.944   0.838
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.691           0.681       0.825         0.0652 0.888   0.617
#> CV:NMF      5 0.793           0.786       0.874         0.0574 0.916   0.677
#> MAD:NMF     5 0.677           0.602       0.787         0.0673 0.870   0.544
#> ATC:NMF     5 0.583           0.536       0.728         0.0644 0.898   0.685
#> SD:skmeans  5 0.789           0.708       0.866         0.0618 0.928   0.770
#> CV:skmeans  5 0.798           0.743       0.881         0.0590 0.919   0.725
#> MAD:skmeans 5 0.721           0.682       0.823         0.0641 0.935   0.795
#> ATC:skmeans 5 0.840           0.758       0.879         0.0546 0.957   0.866
#> SD:mclust   5 0.522           0.574       0.760         0.1902 0.782   0.509
#> CV:mclust   5 0.784           0.795       0.921         0.1093 0.869   0.591
#> MAD:mclust  5 0.581           0.608       0.788         0.1065 0.797   0.431
#> ATC:mclust  5 0.618           0.609       0.795         0.1427 0.752   0.384
#> SD:kmeans   5 0.651           0.540       0.689         0.0614 0.749   0.362
#> CV:kmeans   5 0.652           0.551       0.756         0.0703 0.872   0.579
#> MAD:kmeans  5 0.633           0.431       0.662         0.0721 0.760   0.375
#> ATC:kmeans  5 0.746           0.677       0.790         0.0690 0.908   0.669
#> SD:pam      5 0.780           0.742       0.881         0.0739 0.840   0.519
#> CV:pam      5 0.698           0.662       0.802         0.0574 0.978   0.920
#> MAD:pam     5 0.627           0.553       0.716         0.0688 0.849   0.521
#> ATC:pam     5 0.858           0.796       0.901         0.0523 0.942   0.789
#> SD:hclust   5 0.550           0.362       0.670         0.0629 0.694   0.354
#> CV:hclust   5 0.609           0.499       0.768         0.0977 0.860   0.599
#> MAD:hclust  5 0.657           0.732       0.834         0.0723 0.919   0.738
#> ATC:hclust  5 0.738           0.713       0.841         0.0617 0.944   0.812
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.697           0.616       0.799         0.0347 0.923   0.675
#> CV:NMF      6 0.806           0.746       0.868         0.0336 0.924   0.660
#> MAD:NMF     6 0.701           0.562       0.770         0.0288 0.916   0.628
#> ATC:NMF     6 0.623           0.530       0.733         0.0554 0.898   0.635
#> SD:skmeans  6 0.763           0.688       0.829         0.0591 0.933   0.753
#> CV:skmeans  6 0.733           0.585       0.796         0.0385 0.973   0.890
#> MAD:skmeans 6 0.744           0.687       0.822         0.0543 0.929   0.746
#> ATC:skmeans 6 0.800           0.691       0.836         0.0415 0.930   0.771
#> SD:mclust   6 0.600           0.586       0.765         0.0704 0.896   0.608
#> CV:mclust   6 0.701           0.586       0.783         0.0613 0.912   0.660
#> MAD:mclust  6 0.647           0.632       0.794         0.0479 0.971   0.875
#> ATC:mclust  6 0.596           0.507       0.691         0.0517 0.867   0.556
#> SD:kmeans   6 0.698           0.678       0.796         0.0491 0.896   0.588
#> CV:kmeans   6 0.656           0.542       0.701         0.0427 0.883   0.565
#> MAD:kmeans  6 0.651           0.556       0.726         0.0397 0.848   0.462
#> ATC:kmeans  6 0.724           0.616       0.742         0.0423 0.918   0.657
#> SD:pam      6 0.725           0.651       0.830         0.0410 0.972   0.873
#> CV:pam      6 0.716           0.625       0.832         0.0507 0.871   0.541
#> MAD:pam     6 0.690           0.662       0.787         0.0432 0.911   0.624
#> ATC:pam     6 0.812           0.767       0.874         0.0535 0.923   0.681
#> SD:hclust   6 0.625           0.622       0.734         0.0427 0.799   0.431
#> CV:hclust   6 0.634           0.517       0.672         0.0545 0.873   0.573
#> MAD:hclust  6 0.718           0.758       0.828         0.0458 0.965   0.851
#> ATC:hclust  6 0.726           0.590       0.781         0.0358 0.969   0.876

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

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

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

collect_plots(res)

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.513           0.720       0.875         0.4344 0.581   0.581
#> 3 3 0.512           0.705       0.862         0.4551 0.665   0.469
#> 4 4 0.560           0.609       0.735         0.1010 1.000   1.000
#> 5 5 0.550           0.362       0.670         0.0629 0.694   0.354
#> 6 6 0.625           0.622       0.734         0.0427 0.799   0.431

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
#> SRR2313978     2  0.0000      0.819 0.000 1.000
#> SRR2313980     2  0.0000      0.819 0.000 1.000
#> SRR2313979     1  0.0000      0.893 1.000 0.000
#> SRR2313977     2  0.0000      0.819 0.000 1.000
#> SRR2313976     2  0.0000      0.819 0.000 1.000
#> SRR2313975     1  0.1184      0.895 0.984 0.016
#> SRR2313973     1  0.0000      0.893 1.000 0.000
#> SRR2313974     1  0.2778      0.878 0.952 0.048
#> SRR2313985     1  0.0000      0.893 1.000 0.000
#> SRR2313993     2  0.0000      0.819 0.000 1.000
#> SRR2313994     2  0.0000      0.819 0.000 1.000
#> SRR2313995     2  0.0000      0.819 0.000 1.000
#> SRR2314024     2  0.0000      0.819 0.000 1.000
#> SRR2314015     2  0.0000      0.819 0.000 1.000
#> SRR2314025     1  0.5408      0.804 0.876 0.124
#> SRR2314023     1  0.0000      0.893 1.000 0.000
#> SRR2314033     2  0.0000      0.819 0.000 1.000
#> SRR2314045     1  0.1184      0.895 0.984 0.016
#> SRR2314042     1  0.9686      0.213 0.604 0.396
#> SRR2314043     2  0.8813      0.593 0.300 0.700
#> SRR2314041     2  0.2236      0.809 0.036 0.964
#> SRR2314044     2  0.2603      0.805 0.044 0.956
#> SRR2314040     2  0.6048      0.741 0.148 0.852
#> SRR2314039     2  0.2236      0.809 0.036 0.964
#> SRR2314038     2  0.9833      0.414 0.424 0.576
#> SRR2314037     2  0.9866      0.398 0.432 0.568
#> SRR2314036     2  0.0000      0.819 0.000 1.000
#> SRR2314035     2  0.6048      0.741 0.148 0.852
#> SRR2314034     2  0.9933      0.345 0.452 0.548
#> SRR2314032     1  0.1184      0.895 0.984 0.016
#> SRR2314031     1  0.8763      0.523 0.704 0.296
#> SRR2314029     2  0.2236      0.809 0.036 0.964
#> SRR2314030     2  0.9833      0.414 0.424 0.576
#> SRR2314028     1  0.8861      0.500 0.696 0.304
#> SRR2314027     2  0.2236      0.809 0.036 0.964
#> SRR2314026     2  0.9866      0.398 0.432 0.568
#> SRR2314020     2  0.0000      0.819 0.000 1.000
#> SRR2314019     2  0.9866      0.398 0.432 0.568
#> SRR2314021     2  0.9866      0.398 0.432 0.568
#> SRR2314018     2  0.6048      0.741 0.148 0.852
#> SRR2314017     2  0.9833      0.414 0.424 0.576
#> SRR2314016     2  0.9833      0.414 0.424 0.576
#> SRR2314014     2  0.0000      0.819 0.000 1.000
#> SRR2314013     2  0.0000      0.819 0.000 1.000
#> SRR2314012     1  0.2948      0.875 0.948 0.052
#> SRR2314011     1  0.0000      0.893 1.000 0.000
#> SRR2314010     2  0.0000      0.819 0.000 1.000
#> SRR2314009     2  0.9866      0.398 0.432 0.568
#> SRR2314008     2  0.0000      0.819 0.000 1.000
#> SRR2314007     2  0.1184      0.815 0.016 0.984
#> SRR2314005     2  0.0000      0.819 0.000 1.000
#> SRR2314004     2  0.0000      0.819 0.000 1.000
#> SRR2314003     1  0.2423      0.883 0.960 0.040
#> SRR2314006     2  0.0000      0.819 0.000 1.000
#> SRR2314002     2  0.9983      0.283 0.476 0.524
#> SRR2314001     2  0.0000      0.819 0.000 1.000
#> SRR2314000     2  0.9044      0.573 0.320 0.680
#> SRR2313998     2  0.0376      0.818 0.004 0.996
#> SRR2313996     2  0.0000      0.819 0.000 1.000
#> SRR2313999     1  0.0938      0.895 0.988 0.012
#> SRR2313997     2  0.0000      0.819 0.000 1.000
#> SRR2313992     2  0.9866      0.398 0.432 0.568
#> SRR2313991     2  0.9833      0.414 0.424 0.576
#> SRR2313990     2  0.0000      0.819 0.000 1.000
#> SRR2313988     1  0.1184      0.895 0.984 0.016
#> SRR2313987     1  0.0000      0.893 1.000 0.000
#> SRR2313984     2  0.0000      0.819 0.000 1.000
#> SRR2313989     2  0.0000      0.819 0.000 1.000
#> SRR2313983     1  0.0000      0.893 1.000 0.000
#> SRR2313986     1  0.8763      0.523 0.704 0.296
#> SRR2313982     1  0.0000      0.893 1.000 0.000
#> SRR2313981     2  0.9866      0.398 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
#> SRR2313978     2  0.4235     0.8676 0.000 0.824 0.176
#> SRR2313980     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2313979     1  0.0000     0.8697 1.000 0.000 0.000
#> SRR2313977     2  0.3686     0.8909 0.000 0.860 0.140
#> SRR2313976     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2313975     1  0.3340     0.8557 0.880 0.000 0.120
#> SRR2313973     1  0.0000     0.8697 1.000 0.000 0.000
#> SRR2313974     1  0.6260     0.4112 0.552 0.000 0.448
#> SRR2313985     1  0.0747     0.8755 0.984 0.000 0.016
#> SRR2313993     2  0.3879     0.8877 0.000 0.848 0.152
#> SRR2313994     2  0.3879     0.8877 0.000 0.848 0.152
#> SRR2313995     2  0.4178     0.8359 0.000 0.828 0.172
#> SRR2314024     2  0.0747     0.8809 0.000 0.984 0.016
#> SRR2314015     2  0.4235     0.8676 0.000 0.824 0.176
#> SRR2314025     3  0.6267    -0.2056 0.452 0.000 0.548
#> SRR2314023     1  0.0747     0.8755 0.984 0.000 0.016
#> SRR2314033     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2314045     1  0.2878     0.8686 0.904 0.000 0.096
#> SRR2314042     3  0.4575     0.5437 0.184 0.004 0.812
#> SRR2314043     3  0.3412     0.6990 0.000 0.124 0.876
#> SRR2314041     3  0.6286     0.0976 0.000 0.464 0.536
#> SRR2314044     3  0.6260     0.1542 0.000 0.448 0.552
#> SRR2314040     3  0.5591     0.4999 0.000 0.304 0.696
#> SRR2314039     3  0.6274     0.1249 0.000 0.456 0.544
#> SRR2314038     3  0.0000     0.7283 0.000 0.000 1.000
#> SRR2314037     3  0.0829     0.7281 0.012 0.004 0.984
#> SRR2314036     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2314035     3  0.5591     0.4999 0.000 0.304 0.696
#> SRR2314034     3  0.1525     0.7157 0.032 0.004 0.964
#> SRR2314032     1  0.2878     0.8686 0.904 0.000 0.096
#> SRR2314031     3  0.5397     0.3543 0.280 0.000 0.720
#> SRR2314029     3  0.6244     0.1790 0.000 0.440 0.560
#> SRR2314030     3  0.0000     0.7283 0.000 0.000 1.000
#> SRR2314028     3  0.5327     0.3821 0.272 0.000 0.728
#> SRR2314027     3  0.6274     0.1249 0.000 0.456 0.544
#> SRR2314026     3  0.0829     0.7281 0.012 0.004 0.984
#> SRR2314020     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2314019     3  0.0829     0.7281 0.012 0.004 0.984
#> SRR2314021     3  0.0829     0.7281 0.012 0.004 0.984
#> SRR2314018     3  0.5591     0.4999 0.000 0.304 0.696
#> SRR2314017     3  0.0000     0.7283 0.000 0.000 1.000
#> SRR2314016     3  0.0000     0.7283 0.000 0.000 1.000
#> SRR2314014     2  0.3686     0.8909 0.000 0.860 0.140
#> SRR2314013     2  0.3752     0.8881 0.000 0.856 0.144
#> SRR2314012     1  0.6154     0.4924 0.592 0.000 0.408
#> SRR2314011     1  0.1031     0.8766 0.976 0.000 0.024
#> SRR2314010     2  0.3267     0.8923 0.000 0.884 0.116
#> SRR2314009     3  0.0829     0.7281 0.012 0.004 0.984
#> SRR2314008     2  0.4504     0.8444 0.000 0.804 0.196
#> SRR2314007     3  0.6302     0.0350 0.000 0.480 0.520
#> SRR2314005     2  0.0424     0.8790 0.000 0.992 0.008
#> SRR2314004     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2314003     1  0.5650     0.6349 0.688 0.000 0.312
#> SRR2314006     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2314002     3  0.3482     0.6469 0.128 0.000 0.872
#> SRR2314001     2  0.3879     0.8877 0.000 0.848 0.152
#> SRR2314000     3  0.4280     0.6963 0.020 0.124 0.856
#> SRR2313998     2  0.4346     0.8598 0.000 0.816 0.184
#> SRR2313996     2  0.3879     0.8877 0.000 0.848 0.152
#> SRR2313999     1  0.3551     0.8393 0.868 0.000 0.132
#> SRR2313997     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2313992     3  0.0829     0.7281 0.012 0.004 0.984
#> SRR2313991     3  0.0000     0.7283 0.000 0.000 1.000
#> SRR2313990     2  0.3879     0.8877 0.000 0.848 0.152
#> SRR2313988     1  0.2625     0.8710 0.916 0.000 0.084
#> SRR2313987     1  0.2448     0.8669 0.924 0.000 0.076
#> SRR2313984     2  0.3879     0.8877 0.000 0.848 0.152
#> SRR2313989     2  0.0000     0.8768 0.000 1.000 0.000
#> SRR2313983     1  0.0000     0.8697 1.000 0.000 0.000
#> SRR2313986     3  0.5397     0.3543 0.280 0.000 0.720
#> SRR2313982     1  0.0000     0.8697 1.000 0.000 0.000
#> SRR2313981     3  0.0829     0.7281 0.012 0.004 0.984

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3 p4
#> SRR2313978     2  0.7102      0.722 0.000 0.540 0.156 NA
#> SRR2313980     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2313979     1  0.4605      0.724 0.664 0.000 0.000 NA
#> SRR2313977     2  0.6856      0.744 0.000 0.576 0.140 NA
#> SRR2313976     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2313975     1  0.5572      0.695 0.716 0.000 0.088 NA
#> SRR2313973     1  0.4605      0.724 0.664 0.000 0.000 NA
#> SRR2313974     1  0.6042      0.319 0.560 0.000 0.392 NA
#> SRR2313985     1  0.4516      0.746 0.736 0.000 0.012 NA
#> SRR2313993     2  0.6956      0.741 0.000 0.564 0.148 NA
#> SRR2313994     2  0.6956      0.741 0.000 0.564 0.148 NA
#> SRR2313995     2  0.6994      0.692 0.000 0.560 0.152 NA
#> SRR2314024     2  0.1510      0.698 0.000 0.956 0.016 NA
#> SRR2314015     2  0.7102      0.722 0.000 0.540 0.156 NA
#> SRR2314025     3  0.6265     -0.138 0.444 0.000 0.500 NA
#> SRR2314023     1  0.4059      0.756 0.788 0.000 0.012 NA
#> SRR2314033     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2314045     1  0.5132      0.709 0.748 0.000 0.068 NA
#> SRR2314042     3  0.3853      0.543 0.160 0.000 0.820 NA
#> SRR2314043     3  0.3074      0.658 0.000 0.000 0.848 NA
#> SRR2314041     3  0.7382      0.185 0.000 0.208 0.516 NA
#> SRR2314044     3  0.7271      0.227 0.000 0.192 0.532 NA
#> SRR2314040     3  0.5130      0.517 0.000 0.020 0.668 NA
#> SRR2314039     3  0.7337      0.205 0.000 0.204 0.524 NA
#> SRR2314038     3  0.3836      0.626 0.016 0.000 0.816 NA
#> SRR2314037     3  0.0000      0.684 0.000 0.000 1.000 NA
#> SRR2314036     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2314035     3  0.5130      0.517 0.000 0.020 0.668 NA
#> SRR2314034     3  0.1059      0.677 0.016 0.000 0.972 NA
#> SRR2314032     1  0.5132      0.709 0.748 0.000 0.068 NA
#> SRR2314031     3  0.5646      0.332 0.272 0.000 0.672 NA
#> SRR2314029     3  0.7198      0.257 0.000 0.180 0.540 NA
#> SRR2314030     3  0.3836      0.626 0.016 0.000 0.816 NA
#> SRR2314028     3  0.5690      0.350 0.268 0.000 0.672 NA
#> SRR2314027     3  0.7337      0.205 0.000 0.204 0.524 NA
#> SRR2314026     3  0.0336      0.684 0.000 0.000 0.992 NA
#> SRR2314020     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2314019     3  0.0336      0.684 0.000 0.000 0.992 NA
#> SRR2314021     3  0.0336      0.684 0.000 0.000 0.992 NA
#> SRR2314018     3  0.5130      0.517 0.000 0.020 0.668 NA
#> SRR2314017     3  0.3836      0.626 0.016 0.000 0.816 NA
#> SRR2314016     3  0.3836      0.626 0.016 0.000 0.816 NA
#> SRR2314014     2  0.6856      0.744 0.000 0.576 0.140 NA
#> SRR2314013     2  0.6783      0.741 0.000 0.572 0.124 NA
#> SRR2314012     1  0.6121      0.386 0.588 0.000 0.352 NA
#> SRR2314011     1  0.2924      0.752 0.884 0.000 0.016 NA
#> SRR2314010     2  0.6566      0.746 0.000 0.600 0.112 NA
#> SRR2314009     3  0.0000      0.684 0.000 0.000 1.000 NA
#> SRR2314008     2  0.7270      0.697 0.000 0.520 0.176 NA
#> SRR2314007     3  0.7458      0.146 0.000 0.212 0.500 NA
#> SRR2314005     2  0.3249      0.717 0.000 0.852 0.008 NA
#> SRR2314004     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2314003     1  0.5619      0.539 0.688 0.000 0.248 NA
#> SRR2314006     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2314002     3  0.5788      0.537 0.084 0.000 0.688 NA
#> SRR2314001     2  0.6956      0.741 0.000 0.564 0.148 NA
#> SRR2314000     3  0.3757      0.654 0.020 0.000 0.828 NA
#> SRR2313998     2  0.7172      0.714 0.000 0.532 0.164 NA
#> SRR2313996     2  0.6956      0.741 0.000 0.564 0.148 NA
#> SRR2313999     1  0.3308      0.714 0.872 0.000 0.092 NA
#> SRR2313997     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2313992     3  0.0000      0.684 0.000 0.000 1.000 NA
#> SRR2313991     3  0.3836      0.626 0.016 0.000 0.816 NA
#> SRR2313990     2  0.6956      0.741 0.000 0.564 0.148 NA
#> SRR2313988     1  0.5132      0.732 0.748 0.000 0.068 NA
#> SRR2313987     1  0.5328      0.747 0.724 0.000 0.064 NA
#> SRR2313984     2  0.6956      0.741 0.000 0.564 0.148 NA
#> SRR2313989     2  0.0000      0.684 0.000 1.000 0.000 NA
#> SRR2313983     1  0.4564      0.731 0.672 0.000 0.000 NA
#> SRR2313986     3  0.5573      0.334 0.272 0.000 0.676 NA
#> SRR2313982     1  0.4605      0.724 0.664 0.000 0.000 NA
#> SRR2313981     3  0.0000      0.684 0.000 0.000 1.000 NA

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     3  0.4350     0.2846 0.004 0.408 0.588 0.000 0.000
#> SRR2313980     2  0.0162     0.9519 0.000 0.996 0.004 0.000 0.000
#> SRR2313979     1  0.4201     0.9822 0.664 0.000 0.008 0.328 0.000
#> SRR2313977     3  0.4415     0.2362 0.004 0.444 0.552 0.000 0.000
#> SRR2313976     2  0.0000     0.9538 0.000 1.000 0.000 0.000 0.000
#> SRR2313975     4  0.5652     0.3119 0.400 0.000 0.060 0.532 0.008
#> SRR2313973     1  0.4201     0.9822 0.664 0.000 0.008 0.328 0.000
#> SRR2313974     4  0.5154     0.3458 0.016 0.000 0.052 0.680 0.252
#> SRR2313985     4  0.4297    -0.6901 0.472 0.000 0.000 0.528 0.000
#> SRR2313993     3  0.4397     0.2598 0.004 0.432 0.564 0.000 0.000
#> SRR2313994     3  0.4410     0.2526 0.004 0.440 0.556 0.000 0.000
#> SRR2313995     3  0.4434     0.1409 0.004 0.460 0.536 0.000 0.000
#> SRR2314024     2  0.1831     0.8717 0.004 0.920 0.076 0.000 0.000
#> SRR2314015     3  0.4350     0.2846 0.004 0.408 0.588 0.000 0.000
#> SRR2314025     4  0.5228     0.1819 0.000 0.000 0.056 0.588 0.356
#> SRR2314023     4  0.4150    -0.5355 0.388 0.000 0.000 0.612 0.000
#> SRR2314033     2  0.0000     0.9538 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     4  0.5624     0.2959 0.392 0.000 0.052 0.544 0.012
#> SRR2314042     5  0.6790     0.0914 0.000 0.000 0.328 0.292 0.380
#> SRR2314043     3  0.4731     0.1023 0.000 0.000 0.640 0.032 0.328
#> SRR2314041     3  0.3780     0.4873 0.000 0.116 0.812 0.000 0.072
#> SRR2314044     3  0.3962     0.4788 0.000 0.112 0.800 0.000 0.088
#> SRR2314040     3  0.3320     0.3625 0.004 0.000 0.820 0.012 0.164
#> SRR2314039     3  0.4002     0.4865 0.000 0.120 0.796 0.000 0.084
#> SRR2314038     5  0.0290     0.8403 0.000 0.000 0.008 0.000 0.992
#> SRR2314037     3  0.5944    -0.1402 0.000 0.000 0.488 0.108 0.404
#> SRR2314036     2  0.0000     0.9538 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     3  0.3320     0.3625 0.004 0.000 0.820 0.012 0.164
#> SRR2314034     3  0.6059    -0.1634 0.000 0.000 0.468 0.120 0.412
#> SRR2314032     4  0.5624     0.2959 0.392 0.000 0.052 0.544 0.012
#> SRR2314031     4  0.6582    -0.0720 0.000 0.000 0.208 0.416 0.376
#> SRR2314029     3  0.3749     0.4608 0.000 0.080 0.816 0.000 0.104
#> SRR2314030     5  0.0290     0.8403 0.000 0.000 0.008 0.000 0.992
#> SRR2314028     4  0.6650    -0.0842 0.000 0.000 0.228 0.412 0.360
#> SRR2314027     3  0.4002     0.4865 0.000 0.120 0.796 0.000 0.084
#> SRR2314026     3  0.5876    -0.1372 0.000 0.000 0.488 0.100 0.412
#> SRR2314020     2  0.0000     0.9538 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     3  0.5876    -0.1372 0.000 0.000 0.488 0.100 0.412
#> SRR2314021     3  0.5876    -0.1372 0.000 0.000 0.488 0.100 0.412
#> SRR2314018     3  0.3320     0.3625 0.004 0.000 0.820 0.012 0.164
#> SRR2314017     5  0.0290     0.8403 0.000 0.000 0.008 0.000 0.992
#> SRR2314016     5  0.0290     0.8403 0.000 0.000 0.008 0.000 0.992
#> SRR2314014     3  0.4415     0.2362 0.004 0.444 0.552 0.000 0.000
#> SRR2314013     3  0.4410     0.2286 0.004 0.440 0.556 0.000 0.000
#> SRR2314012     4  0.4415     0.3772 0.008 0.000 0.028 0.728 0.236
#> SRR2314011     4  0.3395    -0.1941 0.236 0.000 0.000 0.764 0.000
#> SRR2314010     3  0.4443     0.1626 0.004 0.472 0.524 0.000 0.000
#> SRR2314009     3  0.5944    -0.1402 0.000 0.000 0.488 0.108 0.404
#> SRR2314008     3  0.4585     0.2985 0.004 0.396 0.592 0.000 0.008
#> SRR2314007     3  0.3622     0.4899 0.000 0.124 0.820 0.000 0.056
#> SRR2314005     2  0.3480     0.5686 0.000 0.752 0.248 0.000 0.000
#> SRR2314004     2  0.0000     0.9538 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     4  0.5269     0.3898 0.060 0.000 0.048 0.724 0.168
#> SRR2314006     2  0.0162     0.9519 0.000 0.996 0.004 0.000 0.000
#> SRR2314002     5  0.3138     0.7007 0.032 0.000 0.032 0.060 0.876
#> SRR2314001     3  0.4397     0.2598 0.004 0.432 0.564 0.000 0.000
#> SRR2314000     3  0.4854     0.1053 0.000 0.000 0.648 0.044 0.308
#> SRR2313998     3  0.4507     0.2844 0.004 0.412 0.580 0.000 0.004
#> SRR2313996     3  0.4397     0.2598 0.004 0.432 0.564 0.000 0.000
#> SRR2313999     4  0.3301     0.1413 0.088 0.000 0.048 0.856 0.008
#> SRR2313997     2  0.0000     0.9538 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     3  0.5944    -0.1402 0.000 0.000 0.488 0.108 0.404
#> SRR2313991     5  0.0290     0.8403 0.000 0.000 0.008 0.000 0.992
#> SRR2313990     3  0.4397     0.2598 0.004 0.432 0.564 0.000 0.000
#> SRR2313988     4  0.4826     0.2042 0.472 0.000 0.020 0.508 0.000
#> SRR2313987     4  0.4937    -0.5222 0.364 0.000 0.028 0.604 0.004
#> SRR2313984     3  0.4397     0.2598 0.004 0.432 0.564 0.000 0.000
#> SRR2313989     2  0.0000     0.9538 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.4371     0.9453 0.644 0.000 0.012 0.344 0.000
#> SRR2313986     4  0.6579    -0.0716 0.000 0.000 0.208 0.420 0.372
#> SRR2313982     1  0.4201     0.9822 0.664 0.000 0.008 0.328 0.000
#> SRR2313981     3  0.5944    -0.1402 0.000 0.000 0.488 0.108 0.404

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR2313978     2  0.0260     0.7641 0.000 0.992 0.008 0.000 0.000 0.000
#> SRR2313980     6  0.3371     0.9843 0.000 0.292 0.000 0.000 0.000 0.708
#> SRR2313979     1  0.4743     0.5589 0.652 0.000 0.000 0.012 0.056 0.280
#> SRR2313977     2  0.0713     0.7528 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR2313976     6  0.3351     0.9868 0.000 0.288 0.000 0.000 0.000 0.712
#> SRR2313975     4  0.1003     0.8658 0.000 0.000 0.020 0.964 0.016 0.000
#> SRR2313973     1  0.4743     0.5589 0.652 0.000 0.000 0.012 0.056 0.280
#> SRR2313974     3  0.6643    -0.0761 0.328 0.000 0.476 0.088 0.104 0.004
#> SRR2313985     1  0.4565     0.5511 0.744 0.000 0.020 0.100 0.004 0.132
#> SRR2313993     2  0.0458     0.7627 0.000 0.984 0.000 0.000 0.000 0.016
#> SRR2313994     2  0.0632     0.7600 0.000 0.976 0.000 0.000 0.000 0.024
#> SRR2313995     2  0.4176     0.4771 0.000 0.720 0.068 0.000 0.000 0.212
#> SRR2314024     6  0.3672     0.8824 0.000 0.368 0.000 0.000 0.000 0.632
#> SRR2314015     2  0.0260     0.7641 0.000 0.992 0.008 0.000 0.000 0.000
#> SRR2314025     3  0.5660     0.1196 0.324 0.000 0.560 0.016 0.092 0.008
#> SRR2314023     1  0.5696     0.5521 0.636 0.000 0.052 0.100 0.004 0.208
#> SRR2314033     6  0.3351     0.9868 0.000 0.288 0.000 0.000 0.000 0.712
#> SRR2314045     4  0.1563     0.9092 0.056 0.000 0.012 0.932 0.000 0.000
#> SRR2314042     3  0.4723     0.5488 0.112 0.084 0.748 0.000 0.052 0.004
#> SRR2314043     3  0.3840     0.5250 0.000 0.284 0.696 0.000 0.020 0.000
#> SRR2314041     2  0.3819     0.3299 0.000 0.624 0.372 0.000 0.004 0.000
#> SRR2314044     2  0.3955     0.2950 0.000 0.608 0.384 0.000 0.008 0.000
#> SRR2314040     3  0.4260     0.1245 0.000 0.472 0.512 0.000 0.016 0.000
#> SRR2314039     2  0.3706     0.3260 0.000 0.620 0.380 0.000 0.000 0.000
#> SRR2314038     5  0.2730     0.9547 0.000 0.000 0.192 0.000 0.808 0.000
#> SRR2314037     3  0.2531     0.6484 0.000 0.132 0.856 0.000 0.012 0.000
#> SRR2314036     6  0.3351     0.9868 0.000 0.288 0.000 0.000 0.000 0.712
#> SRR2314035     3  0.4260     0.1245 0.000 0.472 0.512 0.000 0.016 0.000
#> SRR2314034     3  0.3110     0.6422 0.016 0.128 0.836 0.000 0.020 0.000
#> SRR2314032     4  0.1563     0.9092 0.056 0.000 0.012 0.932 0.000 0.000
#> SRR2314031     3  0.4629     0.4183 0.156 0.000 0.732 0.012 0.092 0.008
#> SRR2314029     2  0.3890     0.2282 0.000 0.596 0.400 0.000 0.004 0.000
#> SRR2314030     5  0.2913     0.9496 0.000 0.000 0.180 0.004 0.812 0.004
#> SRR2314028     3  0.5265     0.4396 0.156 0.020 0.708 0.020 0.088 0.008
#> SRR2314027     2  0.3706     0.3260 0.000 0.620 0.380 0.000 0.000 0.000
#> SRR2314026     3  0.2709     0.6444 0.000 0.132 0.848 0.000 0.020 0.000
#> SRR2314020     6  0.3351     0.9868 0.000 0.288 0.000 0.000 0.000 0.712
#> SRR2314019     3  0.2709     0.6444 0.000 0.132 0.848 0.000 0.020 0.000
#> SRR2314021     3  0.2709     0.6444 0.000 0.132 0.848 0.000 0.020 0.000
#> SRR2314018     3  0.4260     0.1245 0.000 0.472 0.512 0.000 0.016 0.000
#> SRR2314017     5  0.2762     0.9537 0.000 0.000 0.196 0.000 0.804 0.000
#> SRR2314016     5  0.2913     0.9496 0.000 0.000 0.180 0.004 0.812 0.004
#> SRR2314014     2  0.0713     0.7528 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR2314013     2  0.0858     0.7465 0.000 0.968 0.004 0.000 0.000 0.028
#> SRR2314012     3  0.6397    -0.1770 0.408 0.000 0.428 0.040 0.116 0.008
#> SRR2314011     1  0.4290     0.4583 0.772 0.000 0.088 0.104 0.036 0.000
#> SRR2314010     2  0.1204     0.7137 0.000 0.944 0.000 0.000 0.000 0.056
#> SRR2314009     3  0.2531     0.6484 0.000 0.132 0.856 0.000 0.012 0.000
#> SRR2314008     2  0.0713     0.7598 0.000 0.972 0.028 0.000 0.000 0.000
#> SRR2314007     2  0.3620     0.3709 0.000 0.648 0.352 0.000 0.000 0.000
#> SRR2314005     2  0.3563    -0.0740 0.000 0.664 0.000 0.000 0.000 0.336
#> SRR2314004     6  0.3351     0.9868 0.000 0.288 0.000 0.000 0.000 0.712
#> SRR2314003     1  0.6987     0.2008 0.424 0.000 0.340 0.124 0.108 0.004
#> SRR2314006     6  0.3371     0.9843 0.000 0.292 0.000 0.000 0.000 0.708
#> SRR2314002     5  0.4204     0.8223 0.000 0.000 0.128 0.132 0.740 0.000
#> SRR2314001     2  0.0458     0.7627 0.000 0.984 0.000 0.000 0.000 0.016
#> SRR2314000     3  0.4464     0.5182 0.004 0.284 0.672 0.012 0.028 0.000
#> SRR2313998     2  0.0717     0.7625 0.000 0.976 0.016 0.000 0.000 0.008
#> SRR2313996     2  0.0458     0.7627 0.000 0.984 0.000 0.000 0.000 0.016
#> SRR2313999     1  0.6184     0.3580 0.604 0.000 0.180 0.124 0.088 0.004
#> SRR2313997     6  0.3351     0.9868 0.000 0.288 0.000 0.000 0.000 0.712
#> SRR2313992     3  0.2531     0.6484 0.000 0.132 0.856 0.000 0.012 0.000
#> SRR2313991     5  0.2730     0.9547 0.000 0.000 0.192 0.000 0.808 0.000
#> SRR2313990     2  0.0458     0.7627 0.000 0.984 0.000 0.000 0.000 0.016
#> SRR2313988     4  0.3503     0.7726 0.180 0.000 0.012 0.788 0.020 0.000
#> SRR2313987     1  0.6305     0.5211 0.636 0.000 0.068 0.120 0.044 0.132
#> SRR2313984     2  0.0458     0.7627 0.000 0.984 0.000 0.000 0.000 0.016
#> SRR2313989     6  0.3351     0.9868 0.000 0.288 0.000 0.000 0.000 0.712
#> SRR2313983     1  0.5189     0.5368 0.628 0.000 0.000 0.056 0.036 0.280
#> SRR2313986     3  0.4486     0.4246 0.156 0.000 0.740 0.008 0.088 0.008
#> SRR2313982     1  0.4743     0.5589 0.652 0.000 0.000 0.012 0.056 0.280
#> SRR2313981     3  0.2531     0.6484 0.000 0.132 0.856 0.000 0.012 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-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

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

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

collect_plots(res)

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.803           0.848       0.944         0.4937 0.503   0.503
#> 3 3 1.000           0.972       0.977         0.3177 0.654   0.420
#> 4 4 0.659           0.498       0.754         0.1225 0.975   0.928
#> 5 5 0.651           0.540       0.689         0.0614 0.749   0.362
#> 6 6 0.698           0.678       0.796         0.0491 0.896   0.588

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
#> SRR2313978     2   0.000    0.92925 0.000 1.000
#> SRR2313980     2   0.000    0.92925 0.000 1.000
#> SRR2313979     1   0.000    0.94303 1.000 0.000
#> SRR2313977     2   0.000    0.92925 0.000 1.000
#> SRR2313976     2   0.000    0.92925 0.000 1.000
#> SRR2313975     1   0.000    0.94303 1.000 0.000
#> SRR2313973     1   0.000    0.94303 1.000 0.000
#> SRR2313974     1   0.000    0.94303 1.000 0.000
#> SRR2313985     1   0.000    0.94303 1.000 0.000
#> SRR2313993     2   0.000    0.92925 0.000 1.000
#> SRR2313994     2   0.000    0.92925 0.000 1.000
#> SRR2313995     2   0.000    0.92925 0.000 1.000
#> SRR2314024     2   0.000    0.92925 0.000 1.000
#> SRR2314015     2   0.000    0.92925 0.000 1.000
#> SRR2314025     1   0.000    0.94303 1.000 0.000
#> SRR2314023     1   0.000    0.94303 1.000 0.000
#> SRR2314033     2   0.000    0.92925 0.000 1.000
#> SRR2314045     1   0.000    0.94303 1.000 0.000
#> SRR2314042     1   0.278    0.91699 0.952 0.048
#> SRR2314043     2   0.992    0.17753 0.448 0.552
#> SRR2314041     2   0.000    0.92925 0.000 1.000
#> SRR2314044     2   0.000    0.92925 0.000 1.000
#> SRR2314040     2   0.469    0.83554 0.100 0.900
#> SRR2314039     2   0.000    0.92925 0.000 1.000
#> SRR2314038     2   0.000    0.92925 0.000 1.000
#> SRR2314037     2   0.999    0.06757 0.480 0.520
#> SRR2314036     2   0.000    0.92925 0.000 1.000
#> SRR2314035     2   1.000    0.00485 0.496 0.504
#> SRR2314034     1   0.000    0.94303 1.000 0.000
#> SRR2314032     1   0.000    0.94303 1.000 0.000
#> SRR2314031     1   0.278    0.91699 0.952 0.048
#> SRR2314029     2   0.000    0.92925 0.000 1.000
#> SRR2314030     1   0.343    0.90445 0.936 0.064
#> SRR2314028     1   0.000    0.94303 1.000 0.000
#> SRR2314027     2   0.000    0.92925 0.000 1.000
#> SRR2314026     1   1.000   -0.02725 0.504 0.496
#> SRR2314020     2   0.000    0.92925 0.000 1.000
#> SRR2314019     2   0.995    0.13930 0.460 0.540
#> SRR2314021     1   0.260    0.91970 0.956 0.044
#> SRR2314018     2   0.443    0.84407 0.092 0.908
#> SRR2314017     1   0.634    0.80281 0.840 0.160
#> SRR2314016     1   0.000    0.94303 1.000 0.000
#> SRR2314014     2   0.000    0.92925 0.000 1.000
#> SRR2314013     2   0.000    0.92925 0.000 1.000
#> SRR2314012     1   0.000    0.94303 1.000 0.000
#> SRR2314011     1   0.000    0.94303 1.000 0.000
#> SRR2314010     2   0.000    0.92925 0.000 1.000
#> SRR2314009     2   0.995    0.13926 0.460 0.540
#> SRR2314008     2   0.000    0.92925 0.000 1.000
#> SRR2314007     2   0.000    0.92925 0.000 1.000
#> SRR2314005     2   0.000    0.92925 0.000 1.000
#> SRR2314004     2   0.000    0.92925 0.000 1.000
#> SRR2314003     1   0.000    0.94303 1.000 0.000
#> SRR2314006     2   0.000    0.92925 0.000 1.000
#> SRR2314002     1   0.506    0.85152 0.888 0.112
#> SRR2314001     2   0.000    0.92925 0.000 1.000
#> SRR2314000     1   0.939    0.41349 0.644 0.356
#> SRR2313998     2   0.000    0.92925 0.000 1.000
#> SRR2313996     2   0.000    0.92925 0.000 1.000
#> SRR2313999     1   0.000    0.94303 1.000 0.000
#> SRR2313997     2   0.000    0.92925 0.000 1.000
#> SRR2313992     1   0.260    0.91970 0.956 0.044
#> SRR2313991     2   0.000    0.92925 0.000 1.000
#> SRR2313990     2   0.000    0.92925 0.000 1.000
#> SRR2313988     1   0.000    0.94303 1.000 0.000
#> SRR2313987     1   0.000    0.94303 1.000 0.000
#> SRR2313984     2   0.000    0.92925 0.000 1.000
#> SRR2313989     2   0.000    0.92925 0.000 1.000
#> SRR2313983     1   0.000    0.94303 1.000 0.000
#> SRR2313986     1   0.000    0.94303 1.000 0.000
#> SRR2313982     1   0.000    0.94303 1.000 0.000
#> SRR2313981     1   0.634    0.80281 0.840 0.160

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2313980     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313977     2  0.0892      0.979 0.000 0.980 0.020
#> SRR2313976     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2313975     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313973     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313974     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313985     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313993     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2313994     2  0.0424      0.991 0.000 0.992 0.008
#> SRR2313995     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314024     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314015     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314025     1  0.4555      0.758 0.800 0.000 0.200
#> SRR2314023     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2314033     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314045     1  0.1163      0.954 0.972 0.000 0.028
#> SRR2314042     3  0.1643      0.962 0.044 0.000 0.956
#> SRR2314043     3  0.1765      0.977 0.004 0.040 0.956
#> SRR2314041     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314044     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314040     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314039     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314038     3  0.0000      0.964 0.000 0.000 1.000
#> SRR2314037     3  0.1765      0.977 0.004 0.040 0.956
#> SRR2314036     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314035     3  0.1765      0.977 0.004 0.040 0.956
#> SRR2314034     3  0.1643      0.962 0.044 0.000 0.956
#> SRR2314032     1  0.1163      0.954 0.972 0.000 0.028
#> SRR2314031     3  0.1643      0.962 0.044 0.000 0.956
#> SRR2314029     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314030     3  0.0000      0.964 0.000 0.000 1.000
#> SRR2314028     3  0.1643      0.962 0.044 0.000 0.956
#> SRR2314027     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314026     3  0.1765      0.977 0.004 0.040 0.956
#> SRR2314020     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314019     3  0.1765      0.977 0.004 0.040 0.956
#> SRR2314021     3  0.1643      0.962 0.044 0.000 0.956
#> SRR2314018     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314017     3  0.0000      0.964 0.000 0.000 1.000
#> SRR2314016     3  0.0424      0.960 0.008 0.000 0.992
#> SRR2314014     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314013     2  0.0237      0.994 0.000 0.996 0.004
#> SRR2314012     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2314011     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2314010     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314009     3  0.1765      0.977 0.004 0.040 0.956
#> SRR2314008     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314007     3  0.1643      0.976 0.000 0.044 0.956
#> SRR2314005     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314004     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314003     1  0.4452      0.768 0.808 0.000 0.192
#> SRR2314006     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2314002     3  0.0424      0.960 0.008 0.000 0.992
#> SRR2314001     2  0.0424      0.991 0.000 0.992 0.008
#> SRR2314000     3  0.1765      0.977 0.004 0.040 0.956
#> SRR2313998     2  0.0424      0.991 0.000 0.992 0.008
#> SRR2313996     2  0.0892      0.979 0.000 0.980 0.020
#> SRR2313999     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313997     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2313992     3  0.1643      0.962 0.044 0.000 0.956
#> SRR2313991     3  0.0000      0.964 0.000 0.000 1.000
#> SRR2313990     3  0.1753      0.974 0.000 0.048 0.952
#> SRR2313988     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313987     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313984     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2313989     2  0.0000      0.997 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.970 1.000 0.000 0.000
#> SRR2313986     3  0.1643      0.962 0.044 0.000 0.956
#> SRR2313982     1  0.0237      0.968 0.996 0.000 0.004
#> SRR2313981     3  0.1877      0.976 0.012 0.032 0.956

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.5696    -0.2249 0.000 0.492 0.024 0.484
#> SRR2313980     2  0.0000     0.6187 0.000 1.000 0.000 0.000
#> SRR2313979     1  0.0469     0.8901 0.988 0.000 0.000 0.012
#> SRR2313977     4  0.6599     0.1364 0.000 0.432 0.080 0.488
#> SRR2313976     2  0.0469     0.6174 0.000 0.988 0.000 0.012
#> SRR2313975     1  0.2345     0.8825 0.900 0.000 0.000 0.100
#> SRR2313973     1  0.0000     0.8907 1.000 0.000 0.000 0.000
#> SRR2313974     1  0.2216     0.8800 0.908 0.000 0.000 0.092
#> SRR2313985     1  0.0000     0.8907 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.4972     0.0384 0.000 0.544 0.000 0.456
#> SRR2313994     2  0.5408    -0.1864 0.000 0.500 0.012 0.488
#> SRR2313995     2  0.4643     0.3068 0.000 0.656 0.000 0.344
#> SRR2314024     2  0.0469     0.6175 0.000 0.988 0.000 0.012
#> SRR2314015     2  0.4989    -0.0352 0.000 0.528 0.000 0.472
#> SRR2314025     1  0.7210     0.4741 0.540 0.000 0.276 0.184
#> SRR2314023     1  0.0000     0.8907 1.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000     0.6187 0.000 1.000 0.000 0.000
#> SRR2314045     1  0.5564     0.7174 0.708 0.000 0.076 0.216
#> SRR2314042     3  0.2973     0.6631 0.000 0.000 0.856 0.144
#> SRR2314043     3  0.1302     0.6799 0.000 0.000 0.956 0.044
#> SRR2314041     3  0.4998    -0.0932 0.000 0.000 0.512 0.488
#> SRR2314044     3  0.4817     0.2605 0.000 0.000 0.612 0.388
#> SRR2314040     3  0.4164     0.4836 0.000 0.000 0.736 0.264
#> SRR2314039     3  0.4817     0.2605 0.000 0.000 0.612 0.388
#> SRR2314038     3  0.4679     0.5372 0.000 0.000 0.648 0.352
#> SRR2314037     3  0.1211     0.6814 0.000 0.000 0.960 0.040
#> SRR2314036     2  0.0000     0.6187 0.000 1.000 0.000 0.000
#> SRR2314035     3  0.1302     0.6799 0.000 0.000 0.956 0.044
#> SRR2314034     3  0.2647     0.6688 0.000 0.000 0.880 0.120
#> SRR2314032     1  0.3528     0.7965 0.808 0.000 0.000 0.192
#> SRR2314031     3  0.3356     0.6492 0.000 0.000 0.824 0.176
#> SRR2314029     3  0.4925     0.1607 0.000 0.000 0.572 0.428
#> SRR2314030     3  0.4916     0.5022 0.000 0.000 0.576 0.424
#> SRR2314028     3  0.2760     0.6663 0.000 0.000 0.872 0.128
#> SRR2314027     3  0.4830     0.2502 0.000 0.000 0.608 0.392
#> SRR2314026     3  0.0707     0.6853 0.000 0.000 0.980 0.020
#> SRR2314020     2  0.0000     0.6187 0.000 1.000 0.000 0.000
#> SRR2314019     3  0.1302     0.6869 0.000 0.000 0.956 0.044
#> SRR2314021     3  0.1211     0.6854 0.000 0.000 0.960 0.040
#> SRR2314018     3  0.3907     0.5245 0.000 0.000 0.768 0.232
#> SRR2314017     3  0.4697     0.5341 0.000 0.000 0.644 0.356
#> SRR2314016     3  0.5000     0.4196 0.000 0.000 0.500 0.500
#> SRR2314014     2  0.4996    -0.0953 0.000 0.516 0.000 0.484
#> SRR2314013     2  0.4996    -0.0957 0.000 0.516 0.000 0.484
#> SRR2314012     1  0.4713     0.7960 0.776 0.000 0.052 0.172
#> SRR2314011     1  0.1557     0.8869 0.944 0.000 0.000 0.056
#> SRR2314010     2  0.4977     0.0219 0.000 0.540 0.000 0.460
#> SRR2314009     3  0.1118     0.6825 0.000 0.000 0.964 0.036
#> SRR2314008     3  0.4817     0.2605 0.000 0.000 0.612 0.388
#> SRR2314007     3  0.4830     0.2502 0.000 0.000 0.608 0.392
#> SRR2314005     2  0.3486     0.5314 0.000 0.812 0.000 0.188
#> SRR2314004     2  0.2345     0.5891 0.000 0.900 0.000 0.100
#> SRR2314003     1  0.7149     0.4951 0.552 0.000 0.264 0.184
#> SRR2314006     2  0.0000     0.6187 0.000 1.000 0.000 0.000
#> SRR2314002     3  0.4790     0.5189 0.000 0.000 0.620 0.380
#> SRR2314001     4  0.5861    -0.0839 0.000 0.480 0.032 0.488
#> SRR2314000     3  0.1022     0.6854 0.000 0.000 0.968 0.032
#> SRR2313998     2  0.5607    -0.2332 0.000 0.492 0.020 0.488
#> SRR2313996     4  0.6211    -0.0741 0.000 0.052 0.460 0.488
#> SRR2313999     1  0.2149     0.8800 0.912 0.000 0.000 0.088
#> SRR2313997     2  0.0000     0.6187 0.000 1.000 0.000 0.000
#> SRR2313992     3  0.2647     0.6688 0.000 0.000 0.880 0.120
#> SRR2313991     3  0.4679     0.5372 0.000 0.000 0.648 0.352
#> SRR2313990     3  0.4998    -0.0932 0.000 0.000 0.512 0.488
#> SRR2313988     1  0.0592     0.8896 0.984 0.000 0.000 0.016
#> SRR2313987     1  0.1118     0.8897 0.964 0.000 0.000 0.036
#> SRR2313984     2  0.4605     0.3545 0.000 0.664 0.000 0.336
#> SRR2313989     2  0.0000     0.6187 0.000 1.000 0.000 0.000
#> SRR2313983     1  0.0469     0.8901 0.988 0.000 0.000 0.012
#> SRR2313986     3  0.3400     0.6471 0.000 0.000 0.820 0.180
#> SRR2313982     1  0.0469     0.8901 0.988 0.000 0.000 0.012
#> SRR2313981     3  0.0000     0.6863 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     3  0.4046     0.4477 0.000 0.296 0.696 0.000 0.008
#> SRR2313980     2  0.0404     0.8651 0.000 0.988 0.000 0.000 0.012
#> SRR2313979     1  0.0609     0.7973 0.980 0.000 0.000 0.000 0.020
#> SRR2313977     3  0.4793     0.4700 0.000 0.260 0.684 0.000 0.056
#> SRR2313976     2  0.2795     0.8078 0.000 0.880 0.056 0.000 0.064
#> SRR2313975     1  0.5717     0.6386 0.540 0.000 0.000 0.368 0.092
#> SRR2313973     1  0.0609     0.7995 0.980 0.000 0.000 0.020 0.000
#> SRR2313974     1  0.5529     0.6084 0.512 0.000 0.000 0.420 0.068
#> SRR2313985     1  0.0609     0.7995 0.980 0.000 0.000 0.020 0.000
#> SRR2313993     3  0.4934     0.3161 0.000 0.364 0.600 0.000 0.036
#> SRR2313994     3  0.4550     0.4657 0.000 0.276 0.688 0.000 0.036
#> SRR2313995     2  0.4752     0.1902 0.000 0.568 0.412 0.000 0.020
#> SRR2314024     2  0.1106     0.8562 0.000 0.964 0.024 0.000 0.012
#> SRR2314015     3  0.4540     0.4065 0.000 0.320 0.656 0.000 0.024
#> SRR2314025     4  0.4809    -0.1531 0.296 0.000 0.004 0.664 0.036
#> SRR2314023     1  0.0609     0.7995 0.980 0.000 0.000 0.020 0.000
#> SRR2314033     2  0.0794     0.8595 0.000 0.972 0.000 0.000 0.028
#> SRR2314045     1  0.5524     0.3522 0.516 0.000 0.000 0.068 0.416
#> SRR2314042     4  0.4263     0.5437 0.000 0.000 0.180 0.760 0.060
#> SRR2314043     4  0.6288     0.5826 0.000 0.000 0.372 0.472 0.156
#> SRR2314041     3  0.1818     0.5129 0.000 0.000 0.932 0.024 0.044
#> SRR2314044     3  0.4010     0.3613 0.000 0.000 0.792 0.136 0.072
#> SRR2314040     3  0.6114    -0.3467 0.000 0.000 0.536 0.312 0.152
#> SRR2314039     3  0.4934     0.1712 0.000 0.000 0.708 0.188 0.104
#> SRR2314038     5  0.3495     0.8993 0.000 0.000 0.032 0.152 0.816
#> SRR2314037     4  0.6235     0.6085 0.000 0.000 0.344 0.500 0.156
#> SRR2314036     2  0.0290     0.8647 0.000 0.992 0.000 0.000 0.008
#> SRR2314035     4  0.6308     0.5692 0.000 0.000 0.388 0.456 0.156
#> SRR2314034     4  0.5004     0.5790 0.000 0.000 0.216 0.692 0.092
#> SRR2314032     1  0.5128     0.5036 0.604 0.000 0.000 0.052 0.344
#> SRR2314031     4  0.2595     0.3800 0.000 0.000 0.080 0.888 0.032
#> SRR2314029     3  0.3608     0.4172 0.000 0.000 0.824 0.112 0.064
#> SRR2314030     5  0.3550     0.8800 0.000 0.000 0.004 0.236 0.760
#> SRR2314028     4  0.4289     0.5445 0.000 0.000 0.176 0.760 0.064
#> SRR2314027     3  0.3912     0.3759 0.000 0.000 0.804 0.108 0.088
#> SRR2314026     4  0.6234     0.6082 0.000 0.000 0.332 0.508 0.160
#> SRR2314020     2  0.0000     0.8654 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     4  0.6194     0.6107 0.000 0.000 0.328 0.516 0.156
#> SRR2314021     4  0.6103     0.6106 0.000 0.000 0.300 0.544 0.156
#> SRR2314018     3  0.6200    -0.3668 0.000 0.000 0.520 0.320 0.160
#> SRR2314017     5  0.3381     0.8987 0.000 0.000 0.016 0.176 0.808
#> SRR2314016     5  0.3816     0.7962 0.000 0.000 0.000 0.304 0.696
#> SRR2314014     3  0.5027     0.4114 0.000 0.304 0.640 0.000 0.056
#> SRR2314013     3  0.5163     0.4174 0.000 0.296 0.636 0.000 0.068
#> SRR2314012     4  0.4650    -0.5156 0.468 0.000 0.000 0.520 0.012
#> SRR2314011     1  0.3561     0.7259 0.740 0.000 0.000 0.260 0.000
#> SRR2314010     3  0.4283     0.3705 0.000 0.348 0.644 0.000 0.008
#> SRR2314009     4  0.6235     0.6060 0.000 0.000 0.344 0.500 0.156
#> SRR2314008     3  0.2983     0.4542 0.000 0.000 0.864 0.040 0.096
#> SRR2314007     3  0.3967     0.3701 0.000 0.000 0.800 0.108 0.092
#> SRR2314005     2  0.5338     0.3925 0.000 0.604 0.324 0.000 0.072
#> SRR2314004     2  0.3995     0.6958 0.000 0.776 0.180 0.000 0.044
#> SRR2314003     4  0.4919    -0.1776 0.304 0.000 0.004 0.652 0.040
#> SRR2314006     2  0.0404     0.8651 0.000 0.988 0.000 0.000 0.012
#> SRR2314002     5  0.2563     0.8790 0.000 0.000 0.008 0.120 0.872
#> SRR2314001     3  0.4576     0.4713 0.000 0.268 0.692 0.000 0.040
#> SRR2314000     4  0.6477     0.5603 0.000 0.000 0.340 0.464 0.196
#> SRR2313998     3  0.4691     0.4625 0.000 0.276 0.680 0.000 0.044
#> SRR2313996     3  0.0290     0.5563 0.000 0.008 0.992 0.000 0.000
#> SRR2313999     1  0.4470     0.6450 0.616 0.000 0.000 0.372 0.012
#> SRR2313997     2  0.0162     0.8654 0.000 0.996 0.000 0.000 0.004
#> SRR2313992     4  0.4558     0.5730 0.000 0.000 0.216 0.724 0.060
#> SRR2313991     5  0.3495     0.8993 0.000 0.000 0.032 0.152 0.816
#> SRR2313990     3  0.0794     0.5511 0.000 0.000 0.972 0.000 0.028
#> SRR2313988     1  0.2504     0.7738 0.896 0.000 0.000 0.040 0.064
#> SRR2313987     1  0.2798     0.7744 0.852 0.000 0.000 0.140 0.008
#> SRR2313984     3  0.5173     0.0252 0.000 0.460 0.500 0.000 0.040
#> SRR2313989     2  0.0510     0.8648 0.000 0.984 0.000 0.000 0.016
#> SRR2313983     1  0.0609     0.7973 0.980 0.000 0.000 0.000 0.020
#> SRR2313986     4  0.2595     0.3800 0.000 0.000 0.080 0.888 0.032
#> SRR2313982     1  0.0609     0.7973 0.980 0.000 0.000 0.000 0.020
#> SRR2313981     4  0.6145     0.6128 0.000 0.000 0.312 0.532 0.156

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR2313978     2  0.1396     0.7386 0.000 0.952 0.004 0.008 0.024 0.012
#> SRR2313980     6  0.1477     0.8869 0.000 0.048 0.000 0.004 0.008 0.940
#> SRR2313979     1  0.0000     0.7300 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.3036     0.7265 0.000 0.840 0.008 0.124 0.028 0.000
#> SRR2313976     6  0.5644     0.6833 0.000 0.172 0.000 0.156 0.040 0.632
#> SRR2313975     4  0.6204     0.2858 0.348 0.008 0.020 0.528 0.056 0.040
#> SRR2313973     1  0.1398     0.7193 0.940 0.000 0.000 0.052 0.008 0.000
#> SRR2313974     4  0.4664     0.5015 0.284 0.000 0.012 0.664 0.028 0.012
#> SRR2313985     1  0.1462     0.7176 0.936 0.000 0.000 0.056 0.008 0.000
#> SRR2313993     2  0.4048     0.6972 0.000 0.788 0.000 0.104 0.028 0.080
#> SRR2313994     2  0.3272     0.7334 0.000 0.848 0.008 0.092 0.032 0.020
#> SRR2313995     2  0.4960     0.3136 0.000 0.600 0.000 0.044 0.020 0.336
#> SRR2314024     6  0.2699     0.8755 0.000 0.068 0.000 0.032 0.020 0.880
#> SRR2314015     2  0.1616     0.7352 0.000 0.940 0.000 0.012 0.020 0.028
#> SRR2314025     4  0.5666     0.6547 0.180 0.000 0.144 0.632 0.044 0.000
#> SRR2314023     1  0.2122     0.7004 0.900 0.000 0.000 0.084 0.008 0.008
#> SRR2314033     6  0.3468     0.8408 0.000 0.072 0.000 0.072 0.024 0.832
#> SRR2314045     1  0.6647     0.1928 0.468 0.004 0.044 0.084 0.372 0.028
#> SRR2314042     3  0.2772     0.6989 0.000 0.000 0.816 0.180 0.004 0.000
#> SRR2314043     3  0.1726     0.8642 0.000 0.044 0.932 0.012 0.012 0.000
#> SRR2314041     2  0.3550     0.6725 0.000 0.788 0.176 0.012 0.024 0.000
#> SRR2314044     2  0.4753     0.4542 0.000 0.620 0.328 0.024 0.028 0.000
#> SRR2314040     3  0.3201     0.8167 0.000 0.088 0.848 0.036 0.028 0.000
#> SRR2314039     3  0.4771     0.2368 0.000 0.384 0.572 0.020 0.024 0.000
#> SRR2314038     5  0.2704     0.9208 0.000 0.016 0.140 0.000 0.844 0.000
#> SRR2314037     3  0.1226     0.8710 0.000 0.040 0.952 0.004 0.004 0.000
#> SRR2314036     6  0.1980     0.8843 0.000 0.048 0.000 0.016 0.016 0.920
#> SRR2314035     3  0.1858     0.8628 0.000 0.052 0.924 0.012 0.012 0.000
#> SRR2314034     3  0.1471     0.8208 0.000 0.000 0.932 0.064 0.004 0.000
#> SRR2314032     1  0.5611     0.4296 0.576 0.004 0.000 0.080 0.312 0.028
#> SRR2314031     4  0.4602     0.4474 0.000 0.000 0.384 0.572 0.044 0.000
#> SRR2314029     2  0.4695     0.6240 0.000 0.696 0.224 0.052 0.028 0.000
#> SRR2314030     5  0.3480     0.9109 0.000 0.000 0.140 0.044 0.808 0.008
#> SRR2314028     3  0.2558     0.7267 0.000 0.004 0.840 0.156 0.000 0.000
#> SRR2314027     2  0.4817     0.2801 0.000 0.548 0.408 0.020 0.024 0.000
#> SRR2314026     3  0.1116     0.8703 0.000 0.028 0.960 0.008 0.004 0.000
#> SRR2314020     6  0.2068     0.8874 0.000 0.048 0.000 0.020 0.016 0.916
#> SRR2314019     3  0.1218     0.8703 0.000 0.028 0.956 0.012 0.004 0.000
#> SRR2314021     3  0.0405     0.8616 0.000 0.000 0.988 0.008 0.004 0.000
#> SRR2314018     3  0.2969     0.8242 0.000 0.088 0.860 0.020 0.032 0.000
#> SRR2314017     5  0.2884     0.9205 0.000 0.004 0.164 0.008 0.824 0.000
#> SRR2314016     5  0.3528     0.8797 0.000 0.000 0.092 0.084 0.816 0.008
#> SRR2314014     2  0.3318     0.7154 0.000 0.824 0.000 0.132 0.020 0.024
#> SRR2314013     2  0.3996     0.6916 0.000 0.772 0.000 0.164 0.036 0.028
#> SRR2314012     4  0.5165     0.6202 0.244 0.000 0.068 0.652 0.036 0.000
#> SRR2314011     1  0.4546    -0.1608 0.516 0.000 0.008 0.460 0.008 0.008
#> SRR2314010     2  0.2501     0.7163 0.000 0.888 0.000 0.028 0.012 0.072
#> SRR2314009     3  0.1082     0.8703 0.000 0.040 0.956 0.004 0.000 0.000
#> SRR2314008     2  0.3972     0.6285 0.000 0.740 0.220 0.016 0.024 0.000
#> SRR2314007     2  0.4752     0.2658 0.000 0.548 0.412 0.020 0.020 0.000
#> SRR2314005     2  0.6537     0.0298 0.000 0.464 0.000 0.176 0.048 0.312
#> SRR2314004     6  0.5945     0.4398 0.000 0.312 0.000 0.108 0.040 0.540
#> SRR2314003     4  0.5491     0.6566 0.180 0.000 0.124 0.652 0.044 0.000
#> SRR2314006     6  0.1477     0.8869 0.000 0.048 0.000 0.004 0.008 0.940
#> SRR2314002     5  0.2776     0.8941 0.000 0.004 0.104 0.032 0.860 0.000
#> SRR2314001     2  0.2686     0.7370 0.000 0.880 0.008 0.080 0.024 0.008
#> SRR2314000     3  0.3375     0.8311 0.000 0.056 0.852 0.052 0.028 0.012
#> SRR2313998     2  0.3623     0.7283 0.000 0.816 0.008 0.124 0.036 0.016
#> SRR2313996     2  0.1956     0.7347 0.000 0.908 0.080 0.004 0.008 0.000
#> SRR2313999     4  0.4505     0.4655 0.348 0.000 0.016 0.620 0.008 0.008
#> SRR2313997     6  0.2401     0.8848 0.000 0.048 0.000 0.028 0.024 0.900
#> SRR2313992     3  0.2278     0.7673 0.000 0.004 0.868 0.128 0.000 0.000
#> SRR2313991     5  0.2664     0.9213 0.000 0.016 0.136 0.000 0.848 0.000
#> SRR2313990     2  0.4022     0.7361 0.000 0.788 0.104 0.084 0.024 0.000
#> SRR2313988     1  0.2985     0.6699 0.868 0.004 0.000 0.068 0.040 0.020
#> SRR2313987     1  0.3950     0.3618 0.672 0.000 0.000 0.312 0.008 0.008
#> SRR2313984     2  0.4313     0.6755 0.000 0.768 0.000 0.108 0.032 0.092
#> SRR2313989     6  0.1793     0.8867 0.000 0.048 0.000 0.012 0.012 0.928
#> SRR2313983     1  0.0000     0.7300 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.4593     0.4549 0.000 0.000 0.380 0.576 0.044 0.000
#> SRR2313982     1  0.0000     0.7300 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313981     3  0.1003     0.8670 0.000 0.020 0.964 0.016 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-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

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 16873 rows and 72 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 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-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 1.000           0.995       0.998         0.5075 0.493   0.493
#> 3 3 0.928           0.851       0.940         0.2677 0.848   0.698
#> 4 4 0.908           0.853       0.930         0.0957 0.867   0.664
#> 5 5 0.789           0.708       0.866         0.0618 0.928   0.770
#> 6 6 0.763           0.688       0.829         0.0591 0.933   0.753

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

suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3

There is also optional best \(k\) = 2 3 that is worth to check.

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>            class entropy silhouette    p1    p2
#> SRR2313978     2  0.0000      0.995 0.000 1.000
#> SRR2313980     2  0.0000      0.995 0.000 1.000
#> SRR2313979     1  0.0000      1.000 1.000 0.000
#> SRR2313977     2  0.0000      0.995 0.000 1.000
#> SRR2313976     2  0.0000      0.995 0.000 1.000
#> SRR2313975     1  0.0000      1.000 1.000 0.000
#> SRR2313973     1  0.0000      1.000 1.000 0.000
#> SRR2313974     1  0.0000      1.000 1.000 0.000
#> SRR2313985     1  0.0000      1.000 1.000 0.000
#> SRR2313993     2  0.0000      0.995 0.000 1.000
#> SRR2313994     2  0.0000      0.995 0.000 1.000
#> SRR2313995     2  0.0000      0.995 0.000 1.000
#> SRR2314024     2  0.0000      0.995 0.000 1.000
#> SRR2314015     2  0.0000      0.995 0.000 1.000
#> SRR2314025     1  0.0000      1.000 1.000 0.000
#> SRR2314023     1  0.0000      1.000 1.000 0.000
#> SRR2314033     2  0.0000      0.995 0.000 1.000
#> SRR2314045     1  0.0000      1.000 1.000 0.000
#> SRR2314042     1  0.0000      1.000 1.000 0.000
#> SRR2314043     1  0.0000      1.000 1.000 0.000
#> SRR2314041     2  0.0000      0.995 0.000 1.000
#> SRR2314044     2  0.0000      0.995 0.000 1.000
#> SRR2314040     2  0.6148      0.821 0.152 0.848
#> SRR2314039     2  0.0000      0.995 0.000 1.000
#> SRR2314038     2  0.0000      0.995 0.000 1.000
#> SRR2314037     1  0.0000      1.000 1.000 0.000
#> SRR2314036     2  0.0000      0.995 0.000 1.000
#> SRR2314035     1  0.0000      1.000 1.000 0.000
#> SRR2314034     1  0.0000      1.000 1.000 0.000
#> SRR2314032     1  0.0000      1.000 1.000 0.000
#> SRR2314031     1  0.0000      1.000 1.000 0.000
#> SRR2314029     2  0.0000      0.995 0.000 1.000
#> SRR2314030     1  0.0000      1.000 1.000 0.000
#> SRR2314028     1  0.0000      1.000 1.000 0.000
#> SRR2314027     2  0.0000      0.995 0.000 1.000
#> SRR2314026     1  0.0000      1.000 1.000 0.000
#> SRR2314020     2  0.0000      0.995 0.000 1.000
#> SRR2314019     1  0.0376      0.996 0.996 0.004
#> SRR2314021     1  0.0000      1.000 1.000 0.000
#> SRR2314018     2  0.0938      0.984 0.012 0.988
#> SRR2314017     1  0.0000      1.000 1.000 0.000
#> SRR2314016     1  0.0000      1.000 1.000 0.000
#> SRR2314014     2  0.0000      0.995 0.000 1.000
#> SRR2314013     2  0.0000      0.995 0.000 1.000
#> SRR2314012     1  0.0000      1.000 1.000 0.000
#> SRR2314011     1  0.0000      1.000 1.000 0.000
#> SRR2314010     2  0.0000      0.995 0.000 1.000
#> SRR2314009     1  0.0000      1.000 1.000 0.000
#> SRR2314008     2  0.0000      0.995 0.000 1.000
#> SRR2314007     2  0.0000      0.995 0.000 1.000
#> SRR2314005     2  0.0000      0.995 0.000 1.000
#> SRR2314004     2  0.0000      0.995 0.000 1.000
#> SRR2314003     1  0.0000      1.000 1.000 0.000
#> SRR2314006     2  0.0000      0.995 0.000 1.000
#> SRR2314002     1  0.0000      1.000 1.000 0.000
#> SRR2314001     2  0.0000      0.995 0.000 1.000
#> SRR2314000     1  0.0000      1.000 1.000 0.000
#> SRR2313998     2  0.0000      0.995 0.000 1.000
#> SRR2313996     2  0.0000      0.995 0.000 1.000
#> SRR2313999     1  0.0000      1.000 1.000 0.000
#> SRR2313997     2  0.0000      0.995 0.000 1.000
#> SRR2313992     1  0.0000      1.000 1.000 0.000
#> SRR2313991     2  0.0000      0.995 0.000 1.000
#> SRR2313990     2  0.0000      0.995 0.000 1.000
#> SRR2313988     1  0.0000      1.000 1.000 0.000
#> SRR2313987     1  0.0000      1.000 1.000 0.000
#> SRR2313984     2  0.0000      0.995 0.000 1.000
#> SRR2313989     2  0.0000      0.995 0.000 1.000
#> SRR2313983     1  0.0000      1.000 1.000 0.000
#> SRR2313986     1  0.0000      1.000 1.000 0.000
#> SRR2313982     1  0.0000      1.000 1.000 0.000
#> SRR2313981     1  0.0000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313980     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313979     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313977     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313976     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313975     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313973     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313974     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313985     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313993     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313994     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313995     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314024     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314015     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314025     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2314023     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2314033     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314045     1  0.1411     0.9225 0.964 0.000 0.036
#> SRR2314042     1  0.6309    -0.1280 0.500 0.000 0.500
#> SRR2314043     3  0.1289     0.8778 0.032 0.000 0.968
#> SRR2314041     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314044     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314040     3  0.1411     0.8607 0.000 0.036 0.964
#> SRR2314039     3  0.5254     0.5643 0.000 0.264 0.736
#> SRR2314038     2  0.2663     0.8933 0.024 0.932 0.044
#> SRR2314037     3  0.1643     0.8797 0.044 0.000 0.956
#> SRR2314036     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314035     3  0.0000     0.8618 0.000 0.000 1.000
#> SRR2314034     3  0.6225     0.2542 0.432 0.000 0.568
#> SRR2314032     1  0.1411     0.9225 0.964 0.000 0.036
#> SRR2314031     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2314029     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314030     1  0.1411     0.9225 0.964 0.000 0.036
#> SRR2314028     3  0.6235     0.2421 0.436 0.000 0.564
#> SRR2314027     2  0.6126     0.3654 0.000 0.600 0.400
#> SRR2314026     3  0.1643     0.8797 0.044 0.000 0.956
#> SRR2314020     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314019     3  0.1643     0.8797 0.044 0.000 0.956
#> SRR2314021     3  0.1643     0.8797 0.044 0.000 0.956
#> SRR2314018     3  0.1411     0.8607 0.000 0.036 0.964
#> SRR2314017     1  0.1643     0.9172 0.956 0.000 0.044
#> SRR2314016     1  0.1411     0.9225 0.964 0.000 0.036
#> SRR2314014     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314013     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314012     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2314011     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2314010     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314009     3  0.1411     0.8786 0.036 0.000 0.964
#> SRR2314008     2  0.0424     0.9466 0.000 0.992 0.008
#> SRR2314007     2  0.6295     0.1676 0.000 0.528 0.472
#> SRR2314005     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314004     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314003     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2314006     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314002     1  0.1643     0.9172 0.956 0.000 0.044
#> SRR2314001     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2314000     1  0.2356     0.8797 0.928 0.000 0.072
#> SRR2313998     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313996     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313999     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313997     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313992     1  0.6307    -0.0838 0.512 0.000 0.488
#> SRR2313991     2  0.1643     0.9167 0.000 0.956 0.044
#> SRR2313990     2  0.6260     0.2422 0.000 0.552 0.448
#> SRR2313988     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313987     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313984     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313989     2  0.0000     0.9528 0.000 1.000 0.000
#> SRR2313983     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313986     1  0.0000     0.9407 1.000 0.000 0.000
#> SRR2313982     1  0.0237     0.9390 0.996 0.000 0.004
#> SRR2313981     3  0.1643     0.8797 0.044 0.000 0.956

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.0707      0.985 0.000 0.980 0.000 0.020
#> SRR2313980     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2313979     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.0817      0.983 0.000 0.976 0.000 0.024
#> SRR2313976     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2313975     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313973     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313974     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313985     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.0188      0.992 0.000 0.996 0.000 0.004
#> SRR2313994     2  0.0188      0.992 0.000 0.996 0.000 0.004
#> SRR2313995     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314024     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314015     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314025     1  0.1661      0.852 0.944 0.000 0.004 0.052
#> SRR2314023     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314045     1  0.4804      0.297 0.616 0.000 0.000 0.384
#> SRR2314042     1  0.5925      0.590 0.648 0.000 0.284 0.068
#> SRR2314043     3  0.0657      0.807 0.004 0.000 0.984 0.012
#> SRR2314041     2  0.0707      0.985 0.000 0.980 0.000 0.020
#> SRR2314044     2  0.0817      0.983 0.000 0.976 0.000 0.024
#> SRR2314040     3  0.0376      0.807 0.004 0.000 0.992 0.004
#> SRR2314039     3  0.4898      0.608 0.000 0.260 0.716 0.024
#> SRR2314038     4  0.1474      0.912 0.000 0.052 0.000 0.948
#> SRR2314037     3  0.1452      0.793 0.008 0.000 0.956 0.036
#> SRR2314036     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314035     3  0.1576      0.785 0.004 0.000 0.948 0.048
#> SRR2314034     1  0.5517      0.419 0.568 0.000 0.412 0.020
#> SRR2314032     1  0.4804      0.297 0.616 0.000 0.000 0.384
#> SRR2314031     1  0.2101      0.845 0.928 0.000 0.012 0.060
#> SRR2314029     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314030     4  0.1389      0.940 0.048 0.000 0.000 0.952
#> SRR2314028     1  0.5805      0.455 0.576 0.000 0.388 0.036
#> SRR2314027     3  0.5586      0.296 0.000 0.452 0.528 0.020
#> SRR2314026     3  0.0657      0.807 0.004 0.000 0.984 0.012
#> SRR2314020     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314019     3  0.0469      0.807 0.000 0.000 0.988 0.012
#> SRR2314021     3  0.0804      0.807 0.008 0.000 0.980 0.012
#> SRR2314018     3  0.1356      0.800 0.000 0.008 0.960 0.032
#> SRR2314017     4  0.1743      0.944 0.056 0.000 0.004 0.940
#> SRR2314016     4  0.1792      0.941 0.068 0.000 0.000 0.932
#> SRR2314014     2  0.0817      0.983 0.000 0.976 0.000 0.024
#> SRR2314013     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314012     1  0.0592      0.867 0.984 0.000 0.000 0.016
#> SRR2314011     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2314010     2  0.0188      0.992 0.000 0.996 0.000 0.004
#> SRR2314009     3  0.0469      0.806 0.000 0.000 0.988 0.012
#> SRR2314008     2  0.1109      0.977 0.000 0.968 0.004 0.028
#> SRR2314007     3  0.5478      0.524 0.000 0.344 0.628 0.028
#> SRR2314005     2  0.0188      0.991 0.000 0.996 0.000 0.004
#> SRR2314004     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314003     1  0.1489      0.856 0.952 0.000 0.004 0.044
#> SRR2314006     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2314002     4  0.2216      0.924 0.092 0.000 0.000 0.908
#> SRR2314001     2  0.0707      0.985 0.000 0.980 0.000 0.020
#> SRR2314000     1  0.1624      0.848 0.952 0.000 0.020 0.028
#> SRR2313998     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2313996     2  0.0707      0.985 0.000 0.980 0.000 0.020
#> SRR2313999     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313997     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2313992     1  0.5639      0.554 0.636 0.000 0.324 0.040
#> SRR2313991     4  0.1867      0.900 0.000 0.072 0.000 0.928
#> SRR2313990     3  0.5420      0.514 0.000 0.352 0.624 0.024
#> SRR2313988     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313987     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313984     2  0.0188      0.992 0.000 0.996 0.000 0.004
#> SRR2313989     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> SRR2313983     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313986     1  0.1743      0.850 0.940 0.000 0.004 0.056
#> SRR2313982     1  0.0000      0.871 1.000 0.000 0.000 0.000
#> SRR2313981     3  0.1305      0.794 0.004 0.000 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
#> SRR2313978     2  0.2249     0.8958 0.000 0.896 0.096 0.000 0.008
#> SRR2313980     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.3388     0.8164 0.000 0.792 0.200 0.000 0.008
#> SRR2313976     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2313975     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313973     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313974     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313985     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313993     2  0.0671     0.9384 0.000 0.980 0.016 0.000 0.004
#> SRR2313994     2  0.0955     0.9344 0.000 0.968 0.028 0.000 0.004
#> SRR2313995     2  0.0290     0.9394 0.000 0.992 0.008 0.000 0.000
#> SRR2314024     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     2  0.0162     0.9411 0.000 0.996 0.004 0.000 0.000
#> SRR2314025     1  0.3838     0.6344 0.716 0.000 0.000 0.280 0.004
#> SRR2314023     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     1  0.3752     0.5448 0.708 0.000 0.000 0.000 0.292
#> SRR2314042     4  0.2929     0.4120 0.180 0.000 0.000 0.820 0.000
#> SRR2314043     3  0.4137     0.3817 0.012 0.000 0.732 0.248 0.008
#> SRR2314041     2  0.2358     0.8919 0.000 0.888 0.104 0.000 0.008
#> SRR2314044     2  0.3170     0.8550 0.000 0.828 0.160 0.004 0.008
#> SRR2314040     3  0.2462     0.4846 0.000 0.000 0.880 0.112 0.008
#> SRR2314039     4  0.6341     0.0524 0.000 0.120 0.328 0.536 0.016
#> SRR2314038     5  0.0703     0.9614 0.000 0.024 0.000 0.000 0.976
#> SRR2314037     4  0.1704     0.3856 0.004 0.000 0.068 0.928 0.000
#> SRR2314036     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     3  0.3277     0.4579 0.008 0.000 0.832 0.148 0.012
#> SRR2314034     4  0.6159     0.3208 0.348 0.000 0.096 0.540 0.016
#> SRR2314032     1  0.3752     0.5448 0.708 0.000 0.000 0.000 0.292
#> SRR2314031     1  0.4029     0.5763 0.680 0.000 0.000 0.316 0.004
#> SRR2314029     2  0.0510     0.9369 0.000 0.984 0.016 0.000 0.000
#> SRR2314030     5  0.0613     0.9631 0.004 0.000 0.004 0.008 0.984
#> SRR2314028     4  0.5336     0.3387 0.252 0.000 0.100 0.648 0.000
#> SRR2314027     4  0.7208    -0.1291 0.000 0.344 0.292 0.348 0.016
#> SRR2314026     4  0.4311     0.2840 0.004 0.000 0.264 0.712 0.020
#> SRR2314020     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     4  0.4106     0.2958 0.000 0.000 0.256 0.724 0.020
#> SRR2314021     4  0.4301     0.3019 0.008 0.000 0.244 0.728 0.020
#> SRR2314018     3  0.0671     0.4807 0.000 0.000 0.980 0.016 0.004
#> SRR2314017     5  0.0865     0.9716 0.024 0.000 0.004 0.000 0.972
#> SRR2314016     5  0.0794     0.9705 0.028 0.000 0.000 0.000 0.972
#> SRR2314014     2  0.3318     0.8248 0.000 0.800 0.192 0.000 0.008
#> SRR2314013     2  0.0290     0.9404 0.000 0.992 0.008 0.000 0.000
#> SRR2314012     1  0.1410     0.8435 0.940 0.000 0.000 0.060 0.000
#> SRR2314011     1  0.0162     0.8766 0.996 0.000 0.000 0.004 0.000
#> SRR2314010     2  0.0671     0.9382 0.000 0.980 0.016 0.000 0.004
#> SRR2314009     3  0.4283     0.0930 0.000 0.000 0.544 0.456 0.000
#> SRR2314008     2  0.4046     0.6864 0.000 0.696 0.296 0.000 0.008
#> SRR2314007     3  0.6864     0.0217 0.000 0.196 0.420 0.372 0.012
#> SRR2314005     2  0.1608     0.9084 0.000 0.928 0.072 0.000 0.000
#> SRR2314004     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     1  0.3586     0.6576 0.736 0.000 0.000 0.264 0.000
#> SRR2314006     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     5  0.0880     0.9672 0.032 0.000 0.000 0.000 0.968
#> SRR2314001     2  0.2971     0.8566 0.000 0.836 0.156 0.000 0.008
#> SRR2314000     3  0.4451    -0.0573 0.492 0.000 0.504 0.004 0.000
#> SRR2313998     2  0.0703     0.9349 0.000 0.976 0.024 0.000 0.000
#> SRR2313996     2  0.2798     0.8674 0.000 0.852 0.140 0.000 0.008
#> SRR2313999     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313997     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     4  0.4359     0.1027 0.412 0.000 0.004 0.584 0.000
#> SRR2313991     5  0.0794     0.9591 0.000 0.028 0.000 0.000 0.972
#> SRR2313990     3  0.4082     0.3077 0.000 0.240 0.740 0.012 0.008
#> SRR2313988     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313987     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313984     2  0.0451     0.9401 0.000 0.988 0.008 0.000 0.004
#> SRR2313989     2  0.0000     0.9410 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313986     1  0.3861     0.6290 0.712 0.000 0.000 0.284 0.004
#> SRR2313982     1  0.0000     0.8785 1.000 0.000 0.000 0.000 0.000
#> SRR2313981     4  0.3452     0.2359 0.000 0.000 0.244 0.756 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
#> SRR2313978     2  0.3883    0.58985 0.000 0.656 0.332 0.012 0.000 0.000
#> SRR2313980     2  0.0291    0.82978 0.000 0.992 0.004 0.004 0.000 0.000
#> SRR2313979     1  0.0000    0.94549 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.5183    0.39757 0.000 0.516 0.408 0.008 0.000 0.068
#> SRR2313976     2  0.1049    0.82730 0.000 0.960 0.032 0.000 0.000 0.008
#> SRR2313975     1  0.0146    0.94405 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR2313973     1  0.0000    0.94549 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313974     1  0.0146    0.94455 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2313985     1  0.0000    0.94549 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313993     2  0.2048    0.80647 0.000 0.880 0.120 0.000 0.000 0.000
#> SRR2313994     2  0.2402    0.80162 0.000 0.868 0.120 0.000 0.000 0.012
#> SRR2313995     2  0.1349    0.81474 0.000 0.940 0.056 0.004 0.000 0.000
#> SRR2314024     2  0.1082    0.82339 0.000 0.956 0.040 0.004 0.000 0.000
#> SRR2314015     2  0.0777    0.83255 0.000 0.972 0.024 0.000 0.000 0.004
#> SRR2314025     4  0.3578    0.63012 0.340 0.000 0.000 0.660 0.000 0.000
#> SRR2314023     1  0.0146    0.94455 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2314033     2  0.0291    0.82959 0.000 0.992 0.004 0.000 0.000 0.004
#> SRR2314045     1  0.2092    0.82505 0.876 0.000 0.000 0.000 0.124 0.000
#> SRR2314042     4  0.1707    0.68426 0.056 0.000 0.012 0.928 0.000 0.004
#> SRR2314043     6  0.3932    0.54054 0.004 0.000 0.072 0.112 0.016 0.796
#> SRR2314041     2  0.3923    0.56419 0.000 0.620 0.372 0.008 0.000 0.000
#> SRR2314044     2  0.6032    0.27017 0.000 0.436 0.424 0.104 0.000 0.036
#> SRR2314040     6  0.1753    0.57938 0.000 0.000 0.084 0.004 0.000 0.912
#> SRR2314039     3  0.4662    0.42138 0.000 0.060 0.748 0.104 0.000 0.088
#> SRR2314038     5  0.0000    0.99782 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314037     4  0.2389    0.58575 0.000 0.000 0.060 0.888 0.000 0.052
#> SRR2314036     2  0.0000    0.83055 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314035     6  0.1121    0.59319 0.008 0.000 0.008 0.016 0.004 0.964
#> SRR2314034     4  0.6958    0.20519 0.220 0.000 0.080 0.440 0.000 0.260
#> SRR2314032     1  0.2092    0.82505 0.876 0.000 0.000 0.000 0.124 0.000
#> SRR2314031     4  0.3043    0.70666 0.200 0.000 0.000 0.792 0.008 0.000
#> SRR2314029     2  0.2420    0.79340 0.000 0.888 0.076 0.032 0.000 0.004
#> SRR2314030     5  0.0146    0.99504 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR2314028     4  0.2962    0.67793 0.068 0.000 0.000 0.848 0.000 0.084
#> SRR2314027     3  0.4296    0.41345 0.000 0.152 0.760 0.044 0.000 0.044
#> SRR2314026     3  0.5894    0.31859 0.004 0.000 0.500 0.216 0.000 0.280
#> SRR2314020     2  0.0000    0.83055 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314019     3  0.5894    0.31859 0.004 0.000 0.500 0.216 0.000 0.280
#> SRR2314021     3  0.5894    0.31859 0.004 0.000 0.500 0.216 0.000 0.280
#> SRR2314018     6  0.3109    0.46926 0.000 0.000 0.224 0.000 0.004 0.772
#> SRR2314017     5  0.0000    0.99782 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314016     5  0.0146    0.99388 0.004 0.000 0.000 0.000 0.996 0.000
#> SRR2314014     2  0.4969    0.44797 0.000 0.544 0.396 0.008 0.000 0.052
#> SRR2314013     2  0.1265    0.82565 0.000 0.948 0.044 0.000 0.000 0.008
#> SRR2314012     1  0.2730    0.70464 0.808 0.000 0.000 0.192 0.000 0.000
#> SRR2314011     1  0.1610    0.87221 0.916 0.000 0.000 0.084 0.000 0.000
#> SRR2314010     2  0.2100    0.80241 0.000 0.884 0.112 0.004 0.000 0.000
#> SRR2314009     6  0.4962    0.16384 0.000 0.000 0.068 0.416 0.000 0.516
#> SRR2314008     3  0.6007   -0.23734 0.000 0.404 0.424 0.012 0.000 0.160
#> SRR2314007     3  0.3092    0.36777 0.000 0.036 0.860 0.040 0.000 0.064
#> SRR2314005     2  0.2383    0.79699 0.000 0.880 0.096 0.000 0.000 0.024
#> SRR2314004     2  0.0363    0.83157 0.000 0.988 0.012 0.000 0.000 0.000
#> SRR2314003     4  0.3672    0.58223 0.368 0.000 0.000 0.632 0.000 0.000
#> SRR2314006     2  0.0405    0.82926 0.000 0.988 0.008 0.004 0.000 0.000
#> SRR2314002     5  0.0000    0.99782 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314001     2  0.4326    0.50117 0.000 0.572 0.404 0.000 0.000 0.024
#> SRR2314000     6  0.4591    0.09661 0.452 0.000 0.000 0.028 0.004 0.516
#> SRR2313998     2  0.1745    0.81812 0.000 0.920 0.068 0.000 0.000 0.012
#> SRR2313996     2  0.4208    0.46643 0.000 0.536 0.452 0.008 0.000 0.004
#> SRR2313999     1  0.1007    0.91388 0.956 0.000 0.000 0.044 0.000 0.000
#> SRR2313997     2  0.0146    0.83019 0.000 0.996 0.004 0.000 0.000 0.000
#> SRR2313992     4  0.2389    0.71435 0.128 0.000 0.000 0.864 0.000 0.008
#> SRR2313991     5  0.0000    0.99782 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313990     3  0.5970   -0.00184 0.000 0.172 0.444 0.008 0.000 0.376
#> SRR2313988     1  0.0000    0.94549 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313987     1  0.0146    0.94455 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2313984     2  0.1387    0.82648 0.000 0.932 0.068 0.000 0.000 0.000
#> SRR2313989     2  0.0291    0.82978 0.000 0.992 0.004 0.004 0.000 0.000
#> SRR2313983     1  0.0000    0.94549 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.3244    0.68000 0.268 0.000 0.000 0.732 0.000 0.000
#> SRR2313982     1  0.0000    0.94549 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313981     4  0.3190    0.49857 0.000 0.000 0.008 0.772 0.000 0.220

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

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 16873 rows and 72 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 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-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.622           0.917       0.952         0.4895 0.503   0.503
#> 3 3 0.741           0.899       0.949         0.3192 0.678   0.452
#> 4 4 0.681           0.653       0.806         0.1241 0.900   0.727
#> 5 5 0.780           0.742       0.881         0.0739 0.840   0.519
#> 6 6 0.725           0.651       0.830         0.0410 0.972   0.873

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
#> SRR2313978     2  0.0000      0.972 0.000 1.000
#> SRR2313980     2  0.0000      0.972 0.000 1.000
#> SRR2313979     1  0.0000      0.929 1.000 0.000
#> SRR2313977     2  0.0000      0.972 0.000 1.000
#> SRR2313976     2  0.0000      0.972 0.000 1.000
#> SRR2313975     1  0.0000      0.929 1.000 0.000
#> SRR2313973     1  0.0000      0.929 1.000 0.000
#> SRR2313974     1  0.0000      0.929 1.000 0.000
#> SRR2313985     1  0.0000      0.929 1.000 0.000
#> SRR2313993     2  0.0000      0.972 0.000 1.000
#> SRR2313994     2  0.0000      0.972 0.000 1.000
#> SRR2313995     2  0.0000      0.972 0.000 1.000
#> SRR2314024     2  0.0000      0.972 0.000 1.000
#> SRR2314015     2  0.0000      0.972 0.000 1.000
#> SRR2314025     1  0.0000      0.929 1.000 0.000
#> SRR2314023     1  0.0000      0.929 1.000 0.000
#> SRR2314033     2  0.0000      0.972 0.000 1.000
#> SRR2314045     1  0.0000      0.929 1.000 0.000
#> SRR2314042     1  0.4815      0.913 0.896 0.104
#> SRR2314043     1  0.4815      0.913 0.896 0.104
#> SRR2314041     2  0.3733      0.911 0.072 0.928
#> SRR2314044     1  0.7602      0.787 0.780 0.220
#> SRR2314040     1  0.4815      0.913 0.896 0.104
#> SRR2314039     2  0.3733      0.911 0.072 0.928
#> SRR2314038     1  0.9850      0.364 0.572 0.428
#> SRR2314037     1  0.4815      0.913 0.896 0.104
#> SRR2314036     2  0.0000      0.972 0.000 1.000
#> SRR2314035     1  0.4815      0.913 0.896 0.104
#> SRR2314034     1  0.4690      0.914 0.900 0.100
#> SRR2314032     1  0.0000      0.929 1.000 0.000
#> SRR2314031     1  0.4690      0.914 0.900 0.100
#> SRR2314029     2  0.8608      0.585 0.284 0.716
#> SRR2314030     1  0.4815      0.913 0.896 0.104
#> SRR2314028     1  0.2236      0.925 0.964 0.036
#> SRR2314027     2  0.3733      0.911 0.072 0.928
#> SRR2314026     1  0.5294      0.900 0.880 0.120
#> SRR2314020     2  0.0000      0.972 0.000 1.000
#> SRR2314019     1  0.4815      0.913 0.896 0.104
#> SRR2314021     1  0.4815      0.913 0.896 0.104
#> SRR2314018     1  0.4815      0.913 0.896 0.104
#> SRR2314017     1  0.4815      0.913 0.896 0.104
#> SRR2314016     1  0.0000      0.929 1.000 0.000
#> SRR2314014     2  0.0000      0.972 0.000 1.000
#> SRR2314013     2  0.0000      0.972 0.000 1.000
#> SRR2314012     1  0.0000      0.929 1.000 0.000
#> SRR2314011     1  0.0000      0.929 1.000 0.000
#> SRR2314010     2  0.0000      0.972 0.000 1.000
#> SRR2314009     1  0.4815      0.913 0.896 0.104
#> SRR2314008     1  0.9358      0.558 0.648 0.352
#> SRR2314007     2  0.0000      0.972 0.000 1.000
#> SRR2314005     2  0.0000      0.972 0.000 1.000
#> SRR2314004     2  0.0000      0.972 0.000 1.000
#> SRR2314003     1  0.0000      0.929 1.000 0.000
#> SRR2314006     2  0.0000      0.972 0.000 1.000
#> SRR2314002     1  0.0672      0.928 0.992 0.008
#> SRR2314001     2  0.0000      0.972 0.000 1.000
#> SRR2314000     1  0.0000      0.929 1.000 0.000
#> SRR2313998     2  0.0000      0.972 0.000 1.000
#> SRR2313996     2  0.0000      0.972 0.000 1.000
#> SRR2313999     1  0.0000      0.929 1.000 0.000
#> SRR2313997     2  0.0000      0.972 0.000 1.000
#> SRR2313992     1  0.4815      0.913 0.896 0.104
#> SRR2313991     2  0.6438      0.792 0.164 0.836
#> SRR2313990     2  0.4562      0.883 0.096 0.904
#> SRR2313988     1  0.0000      0.929 1.000 0.000
#> SRR2313987     1  0.0000      0.929 1.000 0.000
#> SRR2313984     2  0.0000      0.972 0.000 1.000
#> SRR2313989     2  0.0000      0.972 0.000 1.000
#> SRR2313983     1  0.0000      0.929 1.000 0.000
#> SRR2313986     1  0.0000      0.929 1.000 0.000
#> SRR2313982     1  0.0000      0.929 1.000 0.000
#> SRR2313981     1  0.4815      0.913 0.896 0.104

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     3  0.6204      0.228 0.000 0.424 0.576
#> SRR2313980     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2313977     2  0.4702      0.811 0.000 0.788 0.212
#> SRR2313976     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2313975     1  0.4346      0.764 0.816 0.000 0.184
#> SRR2313973     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2313974     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2313985     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2313993     2  0.3116      0.909 0.000 0.892 0.108
#> SRR2313994     2  0.4062      0.864 0.000 0.836 0.164
#> SRR2313995     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2314024     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2314015     2  0.3116      0.909 0.000 0.892 0.108
#> SRR2314025     1  0.1529      0.951 0.960 0.000 0.040
#> SRR2314023     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2314033     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2314045     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2314042     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314043     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314041     3  0.0747      0.924 0.000 0.016 0.984
#> SRR2314044     3  0.2448      0.873 0.000 0.076 0.924
#> SRR2314040     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314039     3  0.0237      0.932 0.000 0.004 0.996
#> SRR2314038     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314037     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314036     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2314035     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314034     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314032     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2314031     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314029     3  0.5591      0.543 0.000 0.304 0.696
#> SRR2314030     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314028     3  0.2356      0.880 0.072 0.000 0.928
#> SRR2314027     3  0.3619      0.808 0.000 0.136 0.864
#> SRR2314026     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314020     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2314019     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314021     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314018     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314017     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314016     3  0.3816      0.801 0.148 0.000 0.852
#> SRR2314014     2  0.4555      0.825 0.000 0.800 0.200
#> SRR2314013     2  0.3038      0.910 0.000 0.896 0.104
#> SRR2314012     1  0.1529      0.951 0.960 0.000 0.040
#> SRR2314011     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2314010     2  0.3116      0.909 0.000 0.892 0.108
#> SRR2314009     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314008     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2314007     3  0.0237      0.932 0.000 0.004 0.996
#> SRR2314005     2  0.1289      0.921 0.000 0.968 0.032
#> SRR2314004     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2314003     1  0.1529      0.951 0.960 0.000 0.040
#> SRR2314006     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2314002     3  0.3412      0.829 0.124 0.000 0.876
#> SRR2314001     2  0.4702      0.811 0.000 0.788 0.212
#> SRR2314000     3  0.3116      0.844 0.108 0.000 0.892
#> SRR2313998     2  0.3116      0.909 0.000 0.892 0.108
#> SRR2313996     3  0.5859      0.434 0.000 0.344 0.656
#> SRR2313999     1  0.0592      0.970 0.988 0.000 0.012
#> SRR2313997     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2313992     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2313991     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2313990     3  0.0000      0.934 0.000 0.000 1.000
#> SRR2313988     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2313987     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2313984     2  0.2959      0.911 0.000 0.900 0.100
#> SRR2313989     2  0.0000      0.922 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2313986     3  0.3116      0.844 0.108 0.000 0.892
#> SRR2313982     1  0.0000      0.977 1.000 0.000 0.000
#> SRR2313981     3  0.0000      0.934 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
#> SRR2313978     2  0.4907     -0.380 0.000 0.580 0.420 0.000
#> SRR2313980     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2313979     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.3907      0.395 0.000 0.768 0.232 0.000
#> SRR2313976     2  0.4977      0.664 0.000 0.540 0.000 0.460
#> SRR2313975     1  0.3486      0.697 0.812 0.000 0.188 0.000
#> SRR2313973     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2313974     1  0.0188      0.923 0.996 0.000 0.004 0.000
#> SRR2313985     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.0592      0.616 0.000 0.984 0.000 0.016
#> SRR2313994     2  0.0000      0.608 0.000 1.000 0.000 0.000
#> SRR2313995     2  0.3726      0.646 0.000 0.788 0.000 0.212
#> SRR2314024     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2314015     2  0.0000      0.608 0.000 1.000 0.000 0.000
#> SRR2314025     1  0.3528      0.779 0.808 0.000 0.192 0.000
#> SRR2314023     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2314033     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2314045     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2314042     3  0.0336      0.659 0.000 0.008 0.992 0.000
#> SRR2314043     3  0.0707      0.657 0.000 0.020 0.980 0.000
#> SRR2314041     3  0.4977      0.504 0.000 0.460 0.540 0.000
#> SRR2314044     3  0.4977      0.503 0.000 0.460 0.540 0.000
#> SRR2314040     3  0.3486      0.607 0.000 0.188 0.812 0.000
#> SRR2314039     3  0.4916      0.535 0.000 0.424 0.576 0.000
#> SRR2314038     4  0.7149      0.715 0.000 0.156 0.316 0.528
#> SRR2314037     3  0.0000      0.659 0.000 0.000 1.000 0.000
#> SRR2314036     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2314035     3  0.0000      0.659 0.000 0.000 1.000 0.000
#> SRR2314034     3  0.0000      0.659 0.000 0.000 1.000 0.000
#> SRR2314032     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2314031     3  0.0000      0.659 0.000 0.000 1.000 0.000
#> SRR2314029     3  0.4888      0.351 0.000 0.412 0.588 0.000
#> SRR2314030     4  0.6949      0.485 0.000 0.348 0.124 0.528
#> SRR2314028     3  0.0000      0.659 0.000 0.000 1.000 0.000
#> SRR2314027     3  0.4955      0.517 0.000 0.444 0.556 0.000
#> SRR2314026     3  0.4877      0.542 0.000 0.408 0.592 0.000
#> SRR2314020     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2314019     3  0.4817      0.548 0.000 0.388 0.612 0.000
#> SRR2314021     3  0.4730      0.557 0.000 0.364 0.636 0.000
#> SRR2314018     3  0.1637      0.647 0.000 0.060 0.940 0.000
#> SRR2314017     4  0.5493      0.719 0.000 0.016 0.456 0.528
#> SRR2314016     4  0.5281      0.704 0.008 0.000 0.464 0.528
#> SRR2314014     2  0.0000      0.608 0.000 1.000 0.000 0.000
#> SRR2314013     2  0.0592      0.616 0.000 0.984 0.000 0.016
#> SRR2314012     1  0.3486      0.783 0.812 0.000 0.188 0.000
#> SRR2314011     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2314010     2  0.0592      0.616 0.000 0.984 0.000 0.016
#> SRR2314009     3  0.0592      0.654 0.000 0.016 0.984 0.000
#> SRR2314008     3  0.3528      0.605 0.000 0.192 0.808 0.000
#> SRR2314007     3  0.4925      0.533 0.000 0.428 0.572 0.000
#> SRR2314005     2  0.4679      0.660 0.000 0.648 0.000 0.352
#> SRR2314004     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2314003     1  0.3528      0.779 0.808 0.000 0.192 0.000
#> SRR2314006     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2314002     4  0.6044      0.736 0.000 0.044 0.428 0.528
#> SRR2314001     2  0.0000      0.608 0.000 1.000 0.000 0.000
#> SRR2314000     3  0.0000      0.659 0.000 0.000 1.000 0.000
#> SRR2313998     2  0.0336      0.611 0.000 0.992 0.000 0.008
#> SRR2313996     2  0.4855     -0.336 0.000 0.600 0.400 0.000
#> SRR2313999     1  0.3486      0.783 0.812 0.000 0.188 0.000
#> SRR2313997     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2313992     3  0.0000      0.659 0.000 0.000 1.000 0.000
#> SRR2313991     4  0.7344      0.666 0.000 0.224 0.248 0.528
#> SRR2313990     3  0.3975      0.581 0.000 0.240 0.760 0.000
#> SRR2313988     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2313987     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2313984     2  0.3528      0.645 0.000 0.808 0.000 0.192
#> SRR2313989     2  0.4989      0.664 0.000 0.528 0.000 0.472
#> SRR2313983     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2313986     3  0.0000      0.659 0.000 0.000 1.000 0.000
#> SRR2313982     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR2313981     3  0.0000      0.659 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     3  0.0865     0.7554 0.000 0.004 0.972 0.024 0.000
#> SRR2313980     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.1197     0.8399 0.952 0.000 0.000 0.000 0.048
#> SRR2313977     3  0.3368     0.6712 0.000 0.024 0.820 0.156 0.000
#> SRR2313976     2  0.0703     0.9705 0.000 0.976 0.024 0.000 0.000
#> SRR2313975     1  0.4325     0.6884 0.736 0.000 0.000 0.220 0.044
#> SRR2313973     1  0.1121     0.8400 0.956 0.000 0.000 0.000 0.044
#> SRR2313974     1  0.2890     0.7930 0.836 0.000 0.000 0.160 0.004
#> SRR2313985     1  0.0162     0.8401 0.996 0.000 0.000 0.000 0.004
#> SRR2313993     3  0.0794     0.7523 0.000 0.028 0.972 0.000 0.000
#> SRR2313994     3  0.0000     0.7550 0.000 0.000 1.000 0.000 0.000
#> SRR2313995     3  0.3305     0.6014 0.000 0.224 0.776 0.000 0.000
#> SRR2314024     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     3  0.0794     0.7523 0.000 0.028 0.972 0.000 0.000
#> SRR2314025     1  0.4151     0.6587 0.652 0.000 0.000 0.344 0.004
#> SRR2314023     1  0.0162     0.8401 0.996 0.000 0.000 0.000 0.004
#> SRR2314033     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     1  0.3758     0.7795 0.816 0.000 0.000 0.088 0.096
#> SRR2314042     4  0.0451     0.8656 0.000 0.000 0.008 0.988 0.004
#> SRR2314043     4  0.1121     0.8628 0.000 0.000 0.044 0.956 0.000
#> SRR2314041     3  0.1851     0.7274 0.000 0.000 0.912 0.088 0.000
#> SRR2314044     3  0.0963     0.7546 0.000 0.000 0.964 0.036 0.000
#> SRR2314040     4  0.3999     0.4228 0.000 0.000 0.344 0.656 0.000
#> SRR2314039     3  0.4307    -0.0486 0.000 0.000 0.504 0.496 0.000
#> SRR2314038     5  0.1408     0.9650 0.000 0.000 0.008 0.044 0.948
#> SRR2314037     4  0.0162     0.8673 0.000 0.000 0.000 0.996 0.004
#> SRR2314036     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     4  0.1341     0.8550 0.000 0.000 0.056 0.944 0.000
#> SRR2314034     4  0.0000     0.8676 0.000 0.000 0.000 1.000 0.000
#> SRR2314032     1  0.1197     0.8399 0.952 0.000 0.000 0.000 0.048
#> SRR2314031     4  0.0162     0.8673 0.000 0.000 0.000 0.996 0.004
#> SRR2314029     3  0.3300     0.6156 0.000 0.000 0.792 0.204 0.004
#> SRR2314030     5  0.1341     0.9180 0.000 0.000 0.056 0.000 0.944
#> SRR2314028     4  0.0000     0.8676 0.000 0.000 0.000 1.000 0.000
#> SRR2314027     3  0.4307    -0.0486 0.000 0.000 0.504 0.496 0.000
#> SRR2314026     3  0.4307    -0.0486 0.000 0.000 0.504 0.496 0.000
#> SRR2314020     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     3  0.4307    -0.0591 0.000 0.000 0.500 0.500 0.000
#> SRR2314021     4  0.4256     0.1920 0.000 0.000 0.436 0.564 0.000
#> SRR2314018     4  0.2471     0.7769 0.000 0.000 0.136 0.864 0.000
#> SRR2314017     5  0.1341     0.9619 0.000 0.000 0.000 0.056 0.944
#> SRR2314016     5  0.2068     0.9312 0.004 0.000 0.000 0.092 0.904
#> SRR2314014     3  0.0703     0.7525 0.000 0.024 0.976 0.000 0.000
#> SRR2314013     3  0.0794     0.7519 0.000 0.028 0.972 0.000 0.000
#> SRR2314012     1  0.4183     0.6773 0.668 0.000 0.000 0.324 0.008
#> SRR2314011     1  0.1282     0.8337 0.952 0.000 0.000 0.044 0.004
#> SRR2314010     3  0.0162     0.7553 0.000 0.004 0.996 0.000 0.000
#> SRR2314009     4  0.1121     0.8628 0.000 0.000 0.044 0.956 0.000
#> SRR2314008     4  0.4015     0.4157 0.000 0.000 0.348 0.652 0.000
#> SRR2314007     3  0.3816     0.4531 0.000 0.000 0.696 0.304 0.000
#> SRR2314005     3  0.4287     0.0686 0.000 0.460 0.540 0.000 0.000
#> SRR2314004     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     1  0.4235     0.6667 0.656 0.000 0.000 0.336 0.008
#> SRR2314006     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     5  0.1197     0.9630 0.000 0.000 0.000 0.048 0.952
#> SRR2314001     3  0.0000     0.7550 0.000 0.000 1.000 0.000 0.000
#> SRR2314000     4  0.0000     0.8676 0.000 0.000 0.000 1.000 0.000
#> SRR2313998     3  0.3274     0.6324 0.000 0.220 0.780 0.000 0.000
#> SRR2313996     3  0.0162     0.7556 0.000 0.000 0.996 0.004 0.000
#> SRR2313999     1  0.4235     0.6667 0.656 0.000 0.000 0.336 0.008
#> SRR2313997     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     4  0.0162     0.8673 0.000 0.000 0.000 0.996 0.004
#> SRR2313991     5  0.1568     0.9605 0.000 0.000 0.020 0.036 0.944
#> SRR2313990     3  0.2690     0.6725 0.000 0.000 0.844 0.156 0.000
#> SRR2313988     1  0.1197     0.8399 0.952 0.000 0.000 0.000 0.048
#> SRR2313987     1  0.0290     0.8402 0.992 0.000 0.000 0.000 0.008
#> SRR2313984     3  0.3612     0.5250 0.000 0.268 0.732 0.000 0.000
#> SRR2313989     2  0.0000     0.9968 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.1197     0.8399 0.952 0.000 0.000 0.000 0.048
#> SRR2313986     4  0.0162     0.8673 0.000 0.000 0.000 0.996 0.004
#> SRR2313982     1  0.1197     0.8399 0.952 0.000 0.000 0.000 0.048
#> SRR2313981     4  0.1121     0.8628 0.000 0.000 0.044 0.956 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
#> SRR2313978     2  0.2526     0.7212 0.000 0.876 0.096 0.024 0.000 0.004
#> SRR2313980     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313979     1  0.2378     0.6835 0.848 0.000 0.000 0.152 0.000 0.000
#> SRR2313977     2  0.4348     0.6265 0.000 0.748 0.124 0.116 0.000 0.012
#> SRR2313976     6  0.2164     0.8903 0.000 0.032 0.000 0.068 0.000 0.900
#> SRR2313975     1  0.5144     0.2177 0.560 0.000 0.100 0.340 0.000 0.000
#> SRR2313973     1  0.2378     0.6835 0.848 0.000 0.000 0.152 0.000 0.000
#> SRR2313974     4  0.2563     0.6971 0.052 0.000 0.072 0.876 0.000 0.000
#> SRR2313985     4  0.3747     0.3598 0.396 0.000 0.000 0.604 0.000 0.000
#> SRR2313993     2  0.2458     0.7285 0.000 0.892 0.068 0.024 0.000 0.016
#> SRR2313994     2  0.1082     0.7273 0.000 0.956 0.004 0.040 0.000 0.000
#> SRR2313995     2  0.4620     0.5920 0.000 0.692 0.068 0.012 0.000 0.228
#> SRR2314024     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314015     2  0.2889     0.7287 0.000 0.868 0.048 0.068 0.000 0.016
#> SRR2314025     4  0.4319     0.4127 0.032 0.000 0.348 0.620 0.000 0.000
#> SRR2314023     4  0.3747     0.3598 0.396 0.000 0.000 0.604 0.000 0.000
#> SRR2314033     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314045     1  0.7240    -0.1192 0.360 0.000 0.240 0.304 0.096 0.000
#> SRR2314042     3  0.3266     0.5656 0.000 0.000 0.728 0.272 0.000 0.000
#> SRR2314043     3  0.0363     0.7742 0.000 0.012 0.988 0.000 0.000 0.000
#> SRR2314041     2  0.2669     0.6840 0.000 0.836 0.156 0.008 0.000 0.000
#> SRR2314044     2  0.2609     0.7205 0.000 0.868 0.096 0.036 0.000 0.000
#> SRR2314040     3  0.4563     0.2671 0.000 0.368 0.588 0.044 0.000 0.000
#> SRR2314039     2  0.4096     0.1502 0.000 0.508 0.484 0.008 0.000 0.000
#> SRR2314038     5  0.0000     0.9311 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314037     3  0.1387     0.7696 0.000 0.000 0.932 0.068 0.000 0.000
#> SRR2314036     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314035     3  0.0713     0.7642 0.000 0.028 0.972 0.000 0.000 0.000
#> SRR2314034     3  0.1387     0.7696 0.000 0.000 0.932 0.068 0.000 0.000
#> SRR2314032     1  0.0000     0.7117 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2314031     3  0.3266     0.5656 0.000 0.000 0.728 0.272 0.000 0.000
#> SRR2314029     2  0.3819     0.5601 0.000 0.700 0.280 0.020 0.000 0.000
#> SRR2314030     5  0.0000     0.9311 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314028     3  0.1501     0.7657 0.000 0.000 0.924 0.076 0.000 0.000
#> SRR2314027     2  0.4096     0.1502 0.000 0.508 0.484 0.008 0.000 0.000
#> SRR2314026     2  0.4096     0.1502 0.000 0.508 0.484 0.008 0.000 0.000
#> SRR2314020     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314019     2  0.4097     0.1417 0.000 0.504 0.488 0.008 0.000 0.000
#> SRR2314021     3  0.3961    -0.0219 0.000 0.440 0.556 0.004 0.000 0.000
#> SRR2314018     3  0.3245     0.6621 0.000 0.172 0.800 0.028 0.000 0.000
#> SRR2314017     5  0.0000     0.9311 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314016     5  0.3608     0.5859 0.000 0.000 0.012 0.272 0.716 0.000
#> SRR2314014     2  0.2357     0.7083 0.000 0.872 0.000 0.116 0.000 0.012
#> SRR2314013     2  0.2404     0.7088 0.000 0.872 0.000 0.112 0.000 0.016
#> SRR2314012     4  0.2509     0.6996 0.036 0.000 0.088 0.876 0.000 0.000
#> SRR2314011     4  0.2312     0.6579 0.112 0.000 0.012 0.876 0.000 0.000
#> SRR2314010     2  0.1787     0.7217 0.000 0.920 0.068 0.008 0.000 0.004
#> SRR2314009     3  0.0363     0.7742 0.000 0.012 0.988 0.000 0.000 0.000
#> SRR2314008     3  0.3819     0.2723 0.000 0.340 0.652 0.008 0.000 0.000
#> SRR2314007     2  0.3653     0.5222 0.000 0.692 0.300 0.008 0.000 0.000
#> SRR2314005     2  0.5329     0.2315 0.000 0.528 0.000 0.116 0.000 0.356
#> SRR2314004     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314003     4  0.2680     0.6885 0.032 0.000 0.108 0.860 0.000 0.000
#> SRR2314006     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314002     5  0.0000     0.9311 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314001     2  0.1007     0.7265 0.000 0.956 0.000 0.044 0.000 0.000
#> SRR2314000     3  0.1616     0.7706 0.000 0.020 0.932 0.048 0.000 0.000
#> SRR2313998     2  0.3600     0.6452 0.000 0.776 0.012 0.020 0.000 0.192
#> SRR2313996     2  0.1524     0.7269 0.000 0.932 0.008 0.060 0.000 0.000
#> SRR2313999     4  0.2487     0.6981 0.032 0.000 0.092 0.876 0.000 0.000
#> SRR2313997     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313992     3  0.1387     0.7696 0.000 0.000 0.932 0.068 0.000 0.000
#> SRR2313991     5  0.0000     0.9311 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313990     2  0.3706     0.6149 0.000 0.772 0.172 0.056 0.000 0.000
#> SRR2313988     1  0.0000     0.7117 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313987     4  0.3747     0.3598 0.396 0.000 0.000 0.604 0.000 0.000
#> SRR2313984     2  0.4556     0.5607 0.000 0.696 0.000 0.116 0.000 0.188
#> SRR2313989     6  0.0000     0.9884 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     1  0.2378     0.6835 0.848 0.000 0.000 0.152 0.000 0.000
#> SRR2313986     3  0.3266     0.5656 0.000 0.000 0.728 0.272 0.000 0.000
#> SRR2313982     1  0.0000     0.7117 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313981     3  0.0363     0.7742 0.000 0.012 0.988 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-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

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

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

collect_plots(res)

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.428           0.793       0.894         0.4443 0.540   0.540
#> 3 3 0.423           0.564       0.805         0.2207 0.898   0.820
#> 4 4 0.499           0.661       0.810         0.1517 0.807   0.653
#> 5 5 0.522           0.574       0.760         0.1902 0.782   0.509
#> 6 6 0.600           0.586       0.765         0.0704 0.896   0.608

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
#> SRR2313978     2  0.2236      0.886 0.036 0.964
#> SRR2313980     2  0.8144      0.689 0.252 0.748
#> SRR2313979     1  0.2948      0.851 0.948 0.052
#> SRR2313977     2  0.0000      0.890 0.000 1.000
#> SRR2313976     2  0.5294      0.850 0.120 0.880
#> SRR2313975     1  0.4562      0.846 0.904 0.096
#> SRR2313973     1  0.4431      0.848 0.908 0.092
#> SRR2313974     1  0.6438      0.805 0.836 0.164
#> SRR2313985     1  0.3431      0.853 0.936 0.064
#> SRR2313993     2  0.0938      0.890 0.012 0.988
#> SRR2313994     2  0.4562      0.864 0.096 0.904
#> SRR2313995     2  0.7528      0.737 0.216 0.784
#> SRR2314024     2  0.5178      0.852 0.116 0.884
#> SRR2314015     2  0.4939      0.857 0.108 0.892
#> SRR2314025     1  0.9000      0.607 0.684 0.316
#> SRR2314023     1  0.4298      0.849 0.912 0.088
#> SRR2314033     1  0.9983      0.149 0.524 0.476
#> SRR2314045     1  0.0000      0.832 1.000 0.000
#> SRR2314042     2  0.7453      0.723 0.212 0.788
#> SRR2314043     2  0.0938      0.890 0.012 0.988
#> SRR2314041     2  0.0000      0.890 0.000 1.000
#> SRR2314044     2  0.0000      0.890 0.000 1.000
#> SRR2314040     2  0.3114      0.878 0.056 0.944
#> SRR2314039     2  0.0000      0.890 0.000 1.000
#> SRR2314038     1  0.6973      0.728 0.812 0.188
#> SRR2314037     2  0.0000      0.890 0.000 1.000
#> SRR2314036     1  0.8608      0.582 0.716 0.284
#> SRR2314035     2  0.8267      0.555 0.260 0.740
#> SRR2314034     2  0.3584      0.853 0.068 0.932
#> SRR2314032     1  0.0000      0.832 1.000 0.000
#> SRR2314031     2  0.9909      0.147 0.444 0.556
#> SRR2314029     2  0.4690      0.860 0.100 0.900
#> SRR2314030     1  0.4022      0.822 0.920 0.080
#> SRR2314028     2  0.0000      0.890 0.000 1.000
#> SRR2314027     2  0.0000      0.890 0.000 1.000
#> SRR2314026     2  0.2043      0.879 0.032 0.968
#> SRR2314020     2  0.6343      0.814 0.160 0.840
#> SRR2314019     2  0.0000      0.890 0.000 1.000
#> SRR2314021     2  0.0672      0.889 0.008 0.992
#> SRR2314018     2  0.0000      0.890 0.000 1.000
#> SRR2314017     1  0.1843      0.827 0.972 0.028
#> SRR2314016     1  0.0672      0.833 0.992 0.008
#> SRR2314014     2  0.0000      0.890 0.000 1.000
#> SRR2314013     2  0.2043      0.887 0.032 0.968
#> SRR2314012     1  0.5178      0.839 0.884 0.116
#> SRR2314011     1  0.9248      0.533 0.660 0.340
#> SRR2314010     2  0.1843      0.888 0.028 0.972
#> SRR2314009     2  0.0000      0.890 0.000 1.000
#> SRR2314008     2  0.0376      0.890 0.004 0.996
#> SRR2314007     2  0.0000      0.890 0.000 1.000
#> SRR2314005     2  0.5294      0.850 0.120 0.880
#> SRR2314004     2  0.5294      0.850 0.120 0.880
#> SRR2314003     1  0.9833      0.340 0.576 0.424
#> SRR2314006     2  0.8144      0.689 0.252 0.748
#> SRR2314002     1  0.0000      0.832 1.000 0.000
#> SRR2314001     2  0.0000      0.890 0.000 1.000
#> SRR2314000     2  0.9427      0.474 0.360 0.640
#> SRR2313998     2  0.5294      0.850 0.120 0.880
#> SRR2313996     2  0.0000      0.890 0.000 1.000
#> SRR2313999     1  0.8081      0.726 0.752 0.248
#> SRR2313997     2  0.7453      0.752 0.212 0.788
#> SRR2313992     2  0.2043      0.879 0.032 0.968
#> SRR2313991     1  0.5842      0.779 0.860 0.140
#> SRR2313990     2  0.0000      0.890 0.000 1.000
#> SRR2313988     1  0.3733      0.853 0.928 0.072
#> SRR2313987     1  0.3733      0.853 0.928 0.072
#> SRR2313984     2  0.1633      0.887 0.024 0.976
#> SRR2313989     2  0.7056      0.778 0.192 0.808
#> SRR2313983     1  0.3431      0.853 0.936 0.064
#> SRR2313986     2  0.9608      0.335 0.384 0.616
#> SRR2313982     1  0.0000      0.832 1.000 0.000
#> SRR2313981     2  0.0000      0.890 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
#> SRR2313978     2  0.1031     0.8032 0.000 0.976 0.024
#> SRR2313980     2  0.6045     0.5002 0.000 0.620 0.380
#> SRR2313979     1  0.1129     0.4917 0.976 0.004 0.020
#> SRR2313977     2  0.0661     0.8035 0.004 0.988 0.008
#> SRR2313976     2  0.5831     0.6043 0.008 0.708 0.284
#> SRR2313975     1  0.2339     0.4754 0.940 0.012 0.048
#> SRR2313973     1  0.2400     0.4793 0.932 0.004 0.064
#> SRR2313974     1  0.5158     0.5400 0.764 0.232 0.004
#> SRR2313985     1  0.0475     0.4974 0.992 0.004 0.004
#> SRR2313993     2  0.1411     0.7994 0.000 0.964 0.036
#> SRR2313994     2  0.1525     0.8012 0.004 0.964 0.032
#> SRR2313995     2  0.4682     0.7014 0.004 0.804 0.192
#> SRR2314024     2  0.5982     0.5575 0.004 0.668 0.328
#> SRR2314015     2  0.2096     0.7948 0.004 0.944 0.052
#> SRR2314025     1  0.6822     0.3029 0.508 0.480 0.012
#> SRR2314023     1  0.2945     0.5341 0.908 0.088 0.004
#> SRR2314033     2  0.7054     0.3248 0.020 0.524 0.456
#> SRR2314045     1  0.5397     0.0197 0.720 0.000 0.280
#> SRR2314042     2  0.6309    -0.3140 0.496 0.504 0.000
#> SRR2314043     2  0.1170     0.7979 0.016 0.976 0.008
#> SRR2314041     2  0.0424     0.8013 0.000 0.992 0.008
#> SRR2314044     2  0.0424     0.8013 0.000 0.992 0.008
#> SRR2314040     2  0.0237     0.8028 0.004 0.996 0.000
#> SRR2314039     2  0.0424     0.8013 0.000 0.992 0.008
#> SRR2314038     3  0.6295     0.6288 0.036 0.236 0.728
#> SRR2314037     2  0.0475     0.8013 0.004 0.992 0.004
#> SRR2314036     3  0.2383     0.5511 0.016 0.044 0.940
#> SRR2314035     2  0.6467     0.0798 0.388 0.604 0.008
#> SRR2314034     2  0.6169     0.1624 0.360 0.636 0.004
#> SRR2314032     3  0.6260     0.4976 0.448 0.000 0.552
#> SRR2314031     1  0.6309     0.2671 0.500 0.500 0.000
#> SRR2314029     2  0.3851     0.7433 0.004 0.860 0.136
#> SRR2314030     3  0.8309     0.6815 0.180 0.188 0.632
#> SRR2314028     2  0.0424     0.8013 0.000 0.992 0.008
#> SRR2314027     2  0.0424     0.8013 0.000 0.992 0.008
#> SRR2314026     2  0.4589     0.6123 0.172 0.820 0.008
#> SRR2314020     2  0.6045     0.5002 0.000 0.620 0.380
#> SRR2314019     2  0.1585     0.7878 0.028 0.964 0.008
#> SRR2314021     2  0.2280     0.7700 0.052 0.940 0.008
#> SRR2314018     2  0.0661     0.8013 0.004 0.988 0.008
#> SRR2314017     3  0.8950     0.6451 0.212 0.220 0.568
#> SRR2314016     3  0.8460     0.6265 0.148 0.244 0.608
#> SRR2314014     2  0.1525     0.8004 0.004 0.964 0.032
#> SRR2314013     2  0.1267     0.8022 0.004 0.972 0.024
#> SRR2314012     1  0.7683     0.4671 0.608 0.328 0.064
#> SRR2314011     1  0.5681     0.5293 0.748 0.236 0.016
#> SRR2314010     2  0.1411     0.7994 0.000 0.964 0.036
#> SRR2314009     2  0.2173     0.7728 0.048 0.944 0.008
#> SRR2314008     2  0.0983     0.8020 0.004 0.980 0.016
#> SRR2314007     2  0.0000     0.8024 0.000 1.000 0.000
#> SRR2314005     2  0.5247     0.6677 0.008 0.768 0.224
#> SRR2314004     2  0.3425     0.7623 0.004 0.884 0.112
#> SRR2314003     1  0.6680     0.2942 0.508 0.484 0.008
#> SRR2314006     2  0.6045     0.5002 0.000 0.620 0.380
#> SRR2314002     3  0.6735     0.5254 0.424 0.012 0.564
#> SRR2314001     2  0.0424     0.8031 0.000 0.992 0.008
#> SRR2314000     2  0.6677     0.2984 0.324 0.652 0.024
#> SRR2313998     2  0.1453     0.8021 0.008 0.968 0.024
#> SRR2313996     2  0.0000     0.8024 0.000 1.000 0.000
#> SRR2313999     1  0.6641     0.3640 0.544 0.448 0.008
#> SRR2313997     2  0.6045     0.5002 0.000 0.620 0.380
#> SRR2313992     2  0.6244    -0.1371 0.440 0.560 0.000
#> SRR2313991     3  0.4563     0.6537 0.036 0.112 0.852
#> SRR2313990     2  0.0237     0.8028 0.004 0.996 0.000
#> SRR2313988     1  0.1753     0.4663 0.952 0.000 0.048
#> SRR2313987     1  0.5365     0.5206 0.744 0.252 0.004
#> SRR2313984     2  0.1753     0.7970 0.000 0.952 0.048
#> SRR2313989     2  0.6247     0.5006 0.004 0.620 0.376
#> SRR2313983     1  0.0475     0.4974 0.992 0.004 0.004
#> SRR2313986     2  0.6309    -0.3249 0.500 0.500 0.000
#> SRR2313982     1  0.6309    -0.5287 0.504 0.000 0.496
#> SRR2313981     2  0.2096     0.7719 0.052 0.944 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     3  0.0469     0.8346 0.000 0.012 0.988 0.000
#> SRR2313980     2  0.2408     0.9014 0.000 0.896 0.104 0.000
#> SRR2313979     1  0.3649     0.4734 0.796 0.000 0.000 0.204
#> SRR2313977     3  0.1792     0.8251 0.000 0.068 0.932 0.000
#> SRR2313976     3  0.4804     0.4818 0.000 0.384 0.616 0.000
#> SRR2313975     1  0.5516     0.4863 0.732 0.056 0.012 0.200
#> SRR2313973     1  0.1022     0.5903 0.968 0.000 0.000 0.032
#> SRR2313974     1  0.7034     0.3185 0.576 0.000 0.204 0.220
#> SRR2313985     1  0.2081     0.5919 0.916 0.000 0.000 0.084
#> SRR2313993     3  0.0336     0.8351 0.000 0.008 0.992 0.000
#> SRR2313994     3  0.2149     0.8119 0.000 0.088 0.912 0.000
#> SRR2313995     3  0.4761     0.4134 0.000 0.372 0.628 0.000
#> SRR2314024     3  0.4916     0.2851 0.000 0.424 0.576 0.000
#> SRR2314015     3  0.2530     0.7846 0.000 0.112 0.888 0.000
#> SRR2314025     3  0.8291    -0.1197 0.308 0.012 0.344 0.336
#> SRR2314023     1  0.3266     0.5588 0.832 0.000 0.000 0.168
#> SRR2314033     2  0.2515     0.8489 0.004 0.912 0.072 0.012
#> SRR2314045     1  0.6139    -0.0518 0.544 0.052 0.000 0.404
#> SRR2314042     3  0.6473     0.6438 0.152 0.012 0.676 0.160
#> SRR2314043     3  0.3144     0.8290 0.000 0.044 0.884 0.072
#> SRR2314041     3  0.0469     0.8346 0.000 0.012 0.988 0.000
#> SRR2314044     3  0.1004     0.8365 0.000 0.024 0.972 0.004
#> SRR2314040     3  0.3900     0.8105 0.000 0.084 0.844 0.072
#> SRR2314039     3  0.0817     0.8360 0.000 0.024 0.976 0.000
#> SRR2314038     4  0.5057     0.6639 0.016 0.060 0.140 0.784
#> SRR2314037     3  0.2329     0.8319 0.000 0.012 0.916 0.072
#> SRR2314036     2  0.5427     0.1890 0.016 0.568 0.000 0.416
#> SRR2314035     3  0.4724     0.7907 0.000 0.136 0.788 0.076
#> SRR2314034     3  0.2775     0.8300 0.000 0.020 0.896 0.084
#> SRR2314032     4  0.5865     0.4401 0.340 0.048 0.000 0.612
#> SRR2314031     3  0.7248     0.5167 0.200 0.012 0.592 0.196
#> SRR2314029     3  0.2494     0.8325 0.000 0.036 0.916 0.048
#> SRR2314030     4  0.4093     0.6841 0.032 0.012 0.120 0.836
#> SRR2314028     3  0.2984     0.8307 0.000 0.028 0.888 0.084
#> SRR2314027     3  0.0592     0.8353 0.000 0.016 0.984 0.000
#> SRR2314026     3  0.2450     0.8334 0.000 0.016 0.912 0.072
#> SRR2314020     2  0.2408     0.9014 0.000 0.896 0.104 0.000
#> SRR2314019     3  0.2670     0.8305 0.000 0.024 0.904 0.072
#> SRR2314021     3  0.2563     0.8313 0.000 0.020 0.908 0.072
#> SRR2314018     3  0.3056     0.8295 0.000 0.040 0.888 0.072
#> SRR2314017     4  0.3597     0.6698 0.016 0.000 0.148 0.836
#> SRR2314016     4  0.1637     0.5582 0.060 0.000 0.000 0.940
#> SRR2314014     3  0.2281     0.8159 0.000 0.096 0.904 0.000
#> SRR2314013     3  0.1118     0.8311 0.000 0.036 0.964 0.000
#> SRR2314012     1  0.4500     0.4521 0.684 0.000 0.000 0.316
#> SRR2314011     1  0.8088     0.1598 0.420 0.012 0.340 0.228
#> SRR2314010     3  0.0469     0.8346 0.000 0.012 0.988 0.000
#> SRR2314009     3  0.2563     0.8326 0.000 0.020 0.908 0.072
#> SRR2314008     3  0.1978     0.8177 0.000 0.068 0.928 0.004
#> SRR2314007     3  0.0336     0.8356 0.000 0.008 0.992 0.000
#> SRR2314005     3  0.3528     0.7391 0.000 0.192 0.808 0.000
#> SRR2314004     3  0.1940     0.8141 0.000 0.076 0.924 0.000
#> SRR2314003     3  0.8105     0.1621 0.300 0.012 0.436 0.252
#> SRR2314006     2  0.2408     0.9014 0.000 0.896 0.104 0.000
#> SRR2314002     4  0.4222     0.5612 0.272 0.000 0.000 0.728
#> SRR2314001     3  0.1118     0.8311 0.000 0.036 0.964 0.000
#> SRR2314000     3  0.5615     0.7030 0.000 0.096 0.716 0.188
#> SRR2313998     3  0.1211     0.8311 0.000 0.040 0.960 0.000
#> SRR2313996     3  0.0000     0.8355 0.000 0.000 1.000 0.000
#> SRR2313999     3  0.8103    -0.1121 0.344 0.008 0.388 0.260
#> SRR2313997     2  0.2408     0.9014 0.000 0.896 0.104 0.000
#> SRR2313992     3  0.3015     0.8263 0.000 0.024 0.884 0.092
#> SRR2313991     4  0.5500     0.6550 0.016 0.080 0.148 0.756
#> SRR2313990     3  0.2081     0.8182 0.000 0.084 0.916 0.000
#> SRR2313988     1  0.4669     0.4751 0.780 0.052 0.000 0.168
#> SRR2313987     1  0.4103     0.5101 0.744 0.000 0.000 0.256
#> SRR2313984     3  0.3024     0.7482 0.000 0.148 0.852 0.000
#> SRR2313989     2  0.2408     0.9014 0.000 0.896 0.104 0.000
#> SRR2313983     1  0.2760     0.5497 0.872 0.000 0.000 0.128
#> SRR2313986     3  0.7309     0.5054 0.196 0.012 0.584 0.208
#> SRR2313982     4  0.4790     0.4384 0.380 0.000 0.000 0.620
#> SRR2313981     3  0.2635     0.8320 0.000 0.020 0.904 0.076

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     3  0.3132     0.6843 0.000 0.008 0.820 0.172 0.000
#> SRR2313980     2  0.0510     0.9466 0.000 0.984 0.016 0.000 0.000
#> SRR2313979     1  0.4219     0.6524 0.584 0.000 0.000 0.000 0.416
#> SRR2313977     3  0.4297     0.4593 0.000 0.020 0.692 0.288 0.000
#> SRR2313976     3  0.4067     0.4715 0.000 0.300 0.692 0.008 0.000
#> SRR2313975     1  0.6890     0.4865 0.456 0.000 0.028 0.148 0.368
#> SRR2313973     1  0.3883     0.7200 0.744 0.000 0.004 0.008 0.244
#> SRR2313974     1  0.6313     0.3168 0.540 0.000 0.008 0.304 0.148
#> SRR2313985     1  0.3274     0.7194 0.780 0.000 0.000 0.000 0.220
#> SRR2313993     3  0.1668     0.7222 0.000 0.028 0.940 0.032 0.000
#> SRR2313994     3  0.0898     0.7159 0.000 0.020 0.972 0.008 0.000
#> SRR2313995     3  0.5379     0.5385 0.000 0.244 0.648 0.108 0.000
#> SRR2314024     3  0.5218     0.4871 0.000 0.296 0.632 0.072 0.000
#> SRR2314015     3  0.2513     0.6888 0.000 0.116 0.876 0.008 0.000
#> SRR2314025     4  0.4604     0.2196 0.404 0.000 0.004 0.584 0.008
#> SRR2314023     1  0.3177     0.7175 0.792 0.000 0.000 0.000 0.208
#> SRR2314033     2  0.0898     0.9323 0.000 0.972 0.020 0.000 0.008
#> SRR2314045     5  0.5043    -0.3980 0.356 0.000 0.000 0.044 0.600
#> SRR2314042     4  0.2124     0.5779 0.096 0.000 0.004 0.900 0.000
#> SRR2314043     4  0.4074     0.5307 0.000 0.000 0.364 0.636 0.000
#> SRR2314041     3  0.3424     0.6298 0.000 0.000 0.760 0.240 0.000
#> SRR2314044     4  0.3876     0.5570 0.000 0.000 0.316 0.684 0.000
#> SRR2314040     4  0.4298     0.5132 0.000 0.008 0.352 0.640 0.000
#> SRR2314039     4  0.4235     0.3270 0.000 0.000 0.424 0.576 0.000
#> SRR2314038     5  0.7079     0.6074 0.008 0.064 0.148 0.204 0.576
#> SRR2314037     4  0.3177     0.6561 0.000 0.000 0.208 0.792 0.000
#> SRR2314036     2  0.3662     0.6201 0.000 0.744 0.004 0.000 0.252
#> SRR2314035     4  0.4283     0.5011 0.000 0.008 0.348 0.644 0.000
#> SRR2314034     4  0.2970     0.6610 0.004 0.000 0.168 0.828 0.000
#> SRR2314032     5  0.1907     0.4423 0.028 0.000 0.000 0.044 0.928
#> SRR2314031     4  0.3196     0.5302 0.192 0.000 0.004 0.804 0.000
#> SRR2314029     3  0.3752     0.4995 0.000 0.000 0.708 0.292 0.000
#> SRR2314030     5  0.5964     0.6613 0.040 0.016 0.064 0.204 0.676
#> SRR2314028     4  0.3010     0.6612 0.004 0.000 0.172 0.824 0.000
#> SRR2314027     3  0.3534     0.6078 0.000 0.000 0.744 0.256 0.000
#> SRR2314026     4  0.3707     0.5958 0.000 0.000 0.284 0.716 0.000
#> SRR2314020     2  0.0510     0.9466 0.000 0.984 0.016 0.000 0.000
#> SRR2314019     4  0.3336     0.6451 0.000 0.000 0.228 0.772 0.000
#> SRR2314021     4  0.3143     0.6572 0.000 0.000 0.204 0.796 0.000
#> SRR2314018     4  0.4367     0.5119 0.000 0.008 0.372 0.620 0.000
#> SRR2314017     5  0.5278     0.6528 0.008 0.008 0.064 0.232 0.688
#> SRR2314016     5  0.5264     0.4344 0.340 0.004 0.000 0.052 0.604
#> SRR2314014     3  0.3687     0.6522 0.000 0.028 0.792 0.180 0.000
#> SRR2314013     3  0.0771     0.7186 0.000 0.004 0.976 0.020 0.000
#> SRR2314012     1  0.1862     0.5780 0.932 0.000 0.004 0.048 0.016
#> SRR2314011     4  0.5983    -0.0161 0.380 0.000 0.000 0.504 0.116
#> SRR2314010     3  0.2723     0.6972 0.000 0.012 0.864 0.124 0.000
#> SRR2314009     4  0.3480     0.6321 0.000 0.000 0.248 0.752 0.000
#> SRR2314008     3  0.4713     0.5300 0.000 0.044 0.676 0.280 0.000
#> SRR2314007     3  0.4297    -0.0390 0.000 0.000 0.528 0.472 0.000
#> SRR2314005     3  0.1628     0.7033 0.000 0.056 0.936 0.008 0.000
#> SRR2314004     3  0.0794     0.7153 0.000 0.028 0.972 0.000 0.000
#> SRR2314003     4  0.4318     0.3445 0.348 0.000 0.004 0.644 0.004
#> SRR2314006     2  0.0510     0.9466 0.000 0.984 0.016 0.000 0.000
#> SRR2314002     5  0.3132     0.6430 0.000 0.008 0.000 0.172 0.820
#> SRR2314001     3  0.3194     0.6783 0.000 0.020 0.832 0.148 0.000
#> SRR2314000     4  0.4551     0.3647 0.004 0.004 0.436 0.556 0.000
#> SRR2313998     3  0.0693     0.7159 0.000 0.008 0.980 0.012 0.000
#> SRR2313996     3  0.4283     0.4221 0.000 0.008 0.644 0.348 0.000
#> SRR2313999     4  0.4520     0.3614 0.340 0.000 0.008 0.644 0.008
#> SRR2313997     2  0.0510     0.9466 0.000 0.984 0.016 0.000 0.000
#> SRR2313992     4  0.2930     0.6603 0.004 0.000 0.164 0.832 0.000
#> SRR2313991     5  0.6776     0.6313 0.008 0.116 0.072 0.188 0.616
#> SRR2313990     3  0.4651     0.2114 0.000 0.020 0.608 0.372 0.000
#> SRR2313988     1  0.5216     0.5994 0.520 0.000 0.000 0.044 0.436
#> SRR2313987     1  0.2166     0.6479 0.912 0.000 0.004 0.012 0.072
#> SRR2313984     3  0.3209     0.6456 0.000 0.180 0.812 0.008 0.000
#> SRR2313989     2  0.0510     0.9466 0.000 0.984 0.016 0.000 0.000
#> SRR2313983     1  0.4192     0.6595 0.596 0.000 0.000 0.000 0.404
#> SRR2313986     4  0.3300     0.5224 0.204 0.000 0.004 0.792 0.000
#> SRR2313982     5  0.1478     0.4560 0.064 0.000 0.000 0.000 0.936
#> SRR2313981     4  0.3177     0.6561 0.000 0.000 0.208 0.792 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
#> SRR2313978     2  0.5036     0.5520 0.000 0.644 0.260 0.008 0.084 0.004
#> SRR2313980     6  0.0000     0.9384 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313979     1  0.0937     0.8240 0.960 0.000 0.000 0.000 0.040 0.000
#> SRR2313977     2  0.3672     0.1943 0.000 0.632 0.368 0.000 0.000 0.000
#> SRR2313976     2  0.3409     0.4864 0.000 0.780 0.000 0.000 0.028 0.192
#> SRR2313975     1  0.4903     0.7091 0.720 0.012 0.068 0.020 0.176 0.004
#> SRR2313973     1  0.2257     0.7642 0.876 0.000 0.000 0.116 0.008 0.000
#> SRR2313974     4  0.5553     0.1935 0.432 0.000 0.060 0.476 0.032 0.000
#> SRR2313985     1  0.0603     0.8219 0.980 0.000 0.000 0.016 0.004 0.000
#> SRR2313993     2  0.3371     0.6141 0.000 0.780 0.200 0.000 0.004 0.016
#> SRR2313994     2  0.0993     0.6308 0.000 0.964 0.024 0.000 0.000 0.012
#> SRR2313995     2  0.6554     0.4767 0.000 0.512 0.180 0.012 0.036 0.260
#> SRR2314024     2  0.6590     0.4110 0.000 0.456 0.216 0.012 0.020 0.296
#> SRR2314015     2  0.4584     0.5769 0.000 0.724 0.024 0.008 0.044 0.200
#> SRR2314025     4  0.2001     0.6141 0.068 0.008 0.012 0.912 0.000 0.000
#> SRR2314023     1  0.1531     0.8069 0.928 0.000 0.000 0.068 0.004 0.000
#> SRR2314033     6  0.1644     0.8877 0.000 0.040 0.000 0.000 0.028 0.932
#> SRR2314045     1  0.3606     0.6215 0.708 0.000 0.004 0.004 0.284 0.000
#> SRR2314042     4  0.3741     0.5025 0.000 0.008 0.320 0.672 0.000 0.000
#> SRR2314043     3  0.0790     0.7534 0.000 0.032 0.968 0.000 0.000 0.000
#> SRR2314041     2  0.5884     0.4095 0.000 0.480 0.328 0.004 0.188 0.000
#> SRR2314044     3  0.4035     0.5836 0.000 0.052 0.740 0.004 0.204 0.000
#> SRR2314040     3  0.3409     0.5437 0.000 0.300 0.700 0.000 0.000 0.000
#> SRR2314039     3  0.5085     0.4325 0.000 0.144 0.644 0.004 0.208 0.000
#> SRR2314038     5  0.6643     0.6560 0.076 0.108 0.188 0.012 0.596 0.020
#> SRR2314037     3  0.0520     0.7609 0.000 0.008 0.984 0.008 0.000 0.000
#> SRR2314036     6  0.3126     0.6314 0.000 0.000 0.000 0.000 0.248 0.752
#> SRR2314035     3  0.3468     0.5728 0.000 0.264 0.728 0.000 0.000 0.008
#> SRR2314034     3  0.0260     0.7604 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR2314032     5  0.3835     0.4778 0.320 0.000 0.000 0.012 0.668 0.000
#> SRR2314031     4  0.2706     0.5648 0.000 0.008 0.160 0.832 0.000 0.000
#> SRR2314029     3  0.6623    -0.1750 0.028 0.384 0.468 0.024 0.076 0.020
#> SRR2314030     5  0.5992     0.6942 0.144 0.024 0.204 0.020 0.608 0.000
#> SRR2314028     3  0.0260     0.7604 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR2314027     2  0.6006     0.2988 0.000 0.420 0.376 0.004 0.200 0.000
#> SRR2314026     3  0.0790     0.7534 0.000 0.032 0.968 0.000 0.000 0.000
#> SRR2314020     6  0.0146     0.9361 0.000 0.004 0.000 0.000 0.000 0.996
#> SRR2314019     3  0.0146     0.7612 0.000 0.004 0.996 0.000 0.000 0.000
#> SRR2314021     3  0.0000     0.7608 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314018     3  0.3534     0.5601 0.000 0.276 0.716 0.000 0.000 0.008
#> SRR2314017     5  0.5975     0.6735 0.112 0.032 0.240 0.016 0.600 0.000
#> SRR2314016     5  0.5848     0.5210 0.204 0.000 0.012 0.236 0.548 0.000
#> SRR2314014     2  0.3531     0.2916 0.000 0.672 0.328 0.000 0.000 0.000
#> SRR2314013     2  0.1908     0.6292 0.000 0.900 0.096 0.000 0.004 0.000
#> SRR2314012     4  0.4312    -0.0403 0.476 0.000 0.004 0.508 0.012 0.000
#> SRR2314011     4  0.3679     0.4905 0.260 0.000 0.004 0.724 0.012 0.000
#> SRR2314010     2  0.4932     0.5796 0.000 0.680 0.236 0.012 0.056 0.016
#> SRR2314009     3  0.0520     0.7609 0.000 0.008 0.984 0.008 0.000 0.000
#> SRR2314008     2  0.6891     0.2862 0.000 0.412 0.328 0.000 0.188 0.072
#> SRR2314007     3  0.4264     0.3068 0.000 0.332 0.636 0.000 0.032 0.000
#> SRR2314005     2  0.1257     0.6262 0.000 0.952 0.000 0.000 0.020 0.028
#> SRR2314004     2  0.3100     0.6418 0.000 0.840 0.124 0.008 0.004 0.024
#> SRR2314003     4  0.1914     0.6155 0.056 0.008 0.016 0.920 0.000 0.000
#> SRR2314006     6  0.0000     0.9384 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314002     5  0.3997     0.6105 0.216 0.000 0.044 0.004 0.736 0.000
#> SRR2314001     2  0.3390     0.3575 0.000 0.704 0.296 0.000 0.000 0.000
#> SRR2314000     3  0.4382     0.5408 0.008 0.280 0.684 0.012 0.008 0.008
#> SRR2313998     2  0.1065     0.6266 0.000 0.964 0.020 0.000 0.008 0.008
#> SRR2313996     3  0.4569     0.0801 0.000 0.396 0.564 0.000 0.040 0.000
#> SRR2313999     4  0.5395     0.5396 0.164 0.000 0.216 0.612 0.008 0.000
#> SRR2313997     6  0.0000     0.9384 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313992     3  0.0520     0.7609 0.000 0.008 0.984 0.008 0.000 0.000
#> SRR2313991     5  0.6688     0.6734 0.084 0.088 0.180 0.012 0.604 0.032
#> SRR2313990     2  0.3747     0.1262 0.000 0.604 0.396 0.000 0.000 0.000
#> SRR2313988     1  0.2706     0.7858 0.832 0.000 0.000 0.008 0.160 0.000
#> SRR2313987     1  0.3281     0.6658 0.784 0.000 0.004 0.200 0.012 0.000
#> SRR2313984     2  0.3481     0.5803 0.000 0.772 0.012 0.004 0.004 0.208
#> SRR2313989     6  0.0000     0.9384 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     1  0.1082     0.8253 0.956 0.000 0.000 0.004 0.040 0.000
#> SRR2313986     4  0.3707     0.5164 0.000 0.008 0.312 0.680 0.000 0.000
#> SRR2313982     5  0.3971     0.4168 0.448 0.000 0.000 0.004 0.548 0.000
#> SRR2313981     3  0.0405     0.7612 0.000 0.004 0.988 0.008 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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 16873 rows and 72 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.913           0.948       0.976         0.5046 0.493   0.493
#> 3 3 0.463           0.478       0.744         0.2613 0.856   0.718
#> 4 4 0.588           0.659       0.820         0.1621 0.683   0.336
#> 5 5 0.691           0.681       0.825         0.0652 0.888   0.617
#> 6 6 0.697           0.616       0.799         0.0347 0.923   0.675

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
#> SRR2313978     2  0.0000      0.994 0.000 1.000
#> SRR2313980     2  0.0000      0.994 0.000 1.000
#> SRR2313979     1  0.0000      0.955 1.000 0.000
#> SRR2313977     2  0.0000      0.994 0.000 1.000
#> SRR2313976     2  0.0000      0.994 0.000 1.000
#> SRR2313975     1  0.0000      0.955 1.000 0.000
#> SRR2313973     1  0.0000      0.955 1.000 0.000
#> SRR2313974     1  0.0000      0.955 1.000 0.000
#> SRR2313985     1  0.0000      0.955 1.000 0.000
#> SRR2313993     2  0.0000      0.994 0.000 1.000
#> SRR2313994     2  0.0000      0.994 0.000 1.000
#> SRR2313995     2  0.0000      0.994 0.000 1.000
#> SRR2314024     2  0.0000      0.994 0.000 1.000
#> SRR2314015     2  0.0000      0.994 0.000 1.000
#> SRR2314025     1  0.0000      0.955 1.000 0.000
#> SRR2314023     1  0.0000      0.955 1.000 0.000
#> SRR2314033     2  0.0000      0.994 0.000 1.000
#> SRR2314045     1  0.0000      0.955 1.000 0.000
#> SRR2314042     1  0.0000      0.955 1.000 0.000
#> SRR2314043     1  0.9850      0.319 0.572 0.428
#> SRR2314041     2  0.0000      0.994 0.000 1.000
#> SRR2314044     2  0.0000      0.994 0.000 1.000
#> SRR2314040     2  0.5059      0.868 0.112 0.888
#> SRR2314039     2  0.0000      0.994 0.000 1.000
#> SRR2314038     2  0.1414      0.975 0.020 0.980
#> SRR2314037     1  0.6973      0.790 0.812 0.188
#> SRR2314036     2  0.0000      0.994 0.000 1.000
#> SRR2314035     1  0.6712      0.804 0.824 0.176
#> SRR2314034     1  0.0000      0.955 1.000 0.000
#> SRR2314032     1  0.0000      0.955 1.000 0.000
#> SRR2314031     1  0.0000      0.955 1.000 0.000
#> SRR2314029     2  0.0000      0.994 0.000 1.000
#> SRR2314030     1  0.0000      0.955 1.000 0.000
#> SRR2314028     1  0.0000      0.955 1.000 0.000
#> SRR2314027     2  0.0000      0.994 0.000 1.000
#> SRR2314026     1  0.7602      0.747 0.780 0.220
#> SRR2314020     2  0.0000      0.994 0.000 1.000
#> SRR2314019     1  0.8386      0.675 0.732 0.268
#> SRR2314021     1  0.0000      0.955 1.000 0.000
#> SRR2314018     2  0.3431      0.928 0.064 0.936
#> SRR2314017     1  0.0000      0.955 1.000 0.000
#> SRR2314016     1  0.0000      0.955 1.000 0.000
#> SRR2314014     2  0.0000      0.994 0.000 1.000
#> SRR2314013     2  0.0000      0.994 0.000 1.000
#> SRR2314012     1  0.0000      0.955 1.000 0.000
#> SRR2314011     1  0.0000      0.955 1.000 0.000
#> SRR2314010     2  0.0000      0.994 0.000 1.000
#> SRR2314009     1  0.6973      0.790 0.812 0.188
#> SRR2314008     2  0.0000      0.994 0.000 1.000
#> SRR2314007     2  0.0000      0.994 0.000 1.000
#> SRR2314005     2  0.0000      0.994 0.000 1.000
#> SRR2314004     2  0.0000      0.994 0.000 1.000
#> SRR2314003     1  0.0000      0.955 1.000 0.000
#> SRR2314006     2  0.0000      0.994 0.000 1.000
#> SRR2314002     1  0.0000      0.955 1.000 0.000
#> SRR2314001     2  0.0000      0.994 0.000 1.000
#> SRR2314000     1  0.4562      0.881 0.904 0.096
#> SRR2313998     2  0.0000      0.994 0.000 1.000
#> SRR2313996     2  0.0000      0.994 0.000 1.000
#> SRR2313999     1  0.0000      0.955 1.000 0.000
#> SRR2313997     2  0.0000      0.994 0.000 1.000
#> SRR2313992     1  0.0000      0.955 1.000 0.000
#> SRR2313991     2  0.0376      0.990 0.004 0.996
#> SRR2313990     2  0.0000      0.994 0.000 1.000
#> SRR2313988     1  0.0000      0.955 1.000 0.000
#> SRR2313987     1  0.0000      0.955 1.000 0.000
#> SRR2313984     2  0.0000      0.994 0.000 1.000
#> SRR2313989     2  0.0000      0.994 0.000 1.000
#> SRR2313983     1  0.0000      0.955 1.000 0.000
#> SRR2313986     1  0.0000      0.955 1.000 0.000
#> SRR2313982     1  0.0000      0.955 1.000 0.000
#> SRR2313981     1  0.0000      0.955 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.4575     0.6995 0.004 0.812 0.184
#> SRR2313980     2  0.0000     0.7923 0.000 1.000 0.000
#> SRR2313979     1  0.5810     0.3423 0.664 0.000 0.336
#> SRR2313977     2  0.1163     0.7851 0.000 0.972 0.028
#> SRR2313976     2  0.0592     0.7904 0.000 0.988 0.012
#> SRR2313975     1  0.5810     0.3423 0.664 0.000 0.336
#> SRR2313973     1  0.4178     0.4175 0.828 0.000 0.172
#> SRR2313974     1  0.5810     0.3423 0.664 0.000 0.336
#> SRR2313985     1  0.5621     0.3575 0.692 0.000 0.308
#> SRR2313993     2  0.3340     0.7556 0.000 0.880 0.120
#> SRR2313994     2  0.3340     0.7580 0.000 0.880 0.120
#> SRR2313995     2  0.3141     0.7682 0.020 0.912 0.068
#> SRR2314024     2  0.0237     0.7926 0.000 0.996 0.004
#> SRR2314015     2  0.0000     0.7923 0.000 1.000 0.000
#> SRR2314025     1  0.4750     0.5158 0.784 0.000 0.216
#> SRR2314023     1  0.5363     0.3777 0.724 0.000 0.276
#> SRR2314033     2  0.0237     0.7920 0.000 0.996 0.004
#> SRR2314045     3  0.6045     0.1583 0.380 0.000 0.620
#> SRR2314042     1  0.5591     0.4819 0.696 0.000 0.304
#> SRR2314043     2  0.8312     0.2721 0.324 0.576 0.100
#> SRR2314041     2  0.7559     0.4806 0.056 0.608 0.336
#> SRR2314044     2  0.7222     0.5545 0.072 0.684 0.244
#> SRR2314040     3  0.7549    -0.0879 0.040 0.436 0.524
#> SRR2314039     2  0.9880     0.0553 0.260 0.384 0.356
#> SRR2314038     2  0.6773     0.3172 0.024 0.636 0.340
#> SRR2314037     1  0.7085     0.4088 0.612 0.032 0.356
#> SRR2314036     2  0.0000     0.7923 0.000 1.000 0.000
#> SRR2314035     3  0.8042     0.3651 0.116 0.248 0.636
#> SRR2314034     1  0.5926     0.4600 0.644 0.000 0.356
#> SRR2314032     3  0.6235     0.0592 0.436 0.000 0.564
#> SRR2314031     1  0.5138     0.5045 0.748 0.000 0.252
#> SRR2314029     2  0.0829     0.7907 0.012 0.984 0.004
#> SRR2314030     3  0.4978     0.1073 0.216 0.004 0.780
#> SRR2314028     1  0.5650     0.4754 0.688 0.000 0.312
#> SRR2314027     2  0.6867     0.5277 0.028 0.636 0.336
#> SRR2314026     3  0.8019     0.0966 0.076 0.348 0.576
#> SRR2314020     2  0.0000     0.7923 0.000 1.000 0.000
#> SRR2314019     1  0.9627     0.1224 0.428 0.208 0.364
#> SRR2314021     1  0.7192     0.3499 0.560 0.028 0.412
#> SRR2314018     3  0.6280    -0.1704 0.000 0.460 0.540
#> SRR2314017     3  0.2860     0.2746 0.084 0.004 0.912
#> SRR2314016     3  0.5859     0.0128 0.344 0.000 0.656
#> SRR2314014     2  0.4346     0.7253 0.000 0.816 0.184
#> SRR2314013     2  0.0892     0.7919 0.000 0.980 0.020
#> SRR2314012     1  0.4178     0.5161 0.828 0.000 0.172
#> SRR2314011     1  0.0424     0.4724 0.992 0.000 0.008
#> SRR2314010     2  0.3686     0.7485 0.000 0.860 0.140
#> SRR2314009     1  0.9653     0.1150 0.424 0.212 0.364
#> SRR2314008     2  0.5859     0.5632 0.000 0.656 0.344
#> SRR2314007     2  0.5733     0.5922 0.000 0.676 0.324
#> SRR2314005     2  0.1753     0.7741 0.000 0.952 0.048
#> SRR2314004     2  0.0000     0.7923 0.000 1.000 0.000
#> SRR2314003     1  0.4654     0.5170 0.792 0.000 0.208
#> SRR2314006     2  0.0000     0.7923 0.000 1.000 0.000
#> SRR2314002     3  0.6275     0.1919 0.348 0.008 0.644
#> SRR2314001     2  0.5058     0.6774 0.000 0.756 0.244
#> SRR2314000     1  0.8737    -0.1403 0.464 0.108 0.428
#> SRR2313998     2  0.0592     0.7904 0.000 0.988 0.012
#> SRR2313996     2  0.6033     0.5621 0.004 0.660 0.336
#> SRR2313999     1  0.5138     0.4729 0.748 0.000 0.252
#> SRR2313997     2  0.0000     0.7923 0.000 1.000 0.000
#> SRR2313992     1  0.5785     0.4609 0.668 0.000 0.332
#> SRR2313991     2  0.6460     0.0758 0.004 0.556 0.440
#> SRR2313990     2  0.5968     0.5500 0.000 0.636 0.364
#> SRR2313988     1  0.5810     0.3423 0.664 0.000 0.336
#> SRR2313987     1  0.5291     0.3823 0.732 0.000 0.268
#> SRR2313984     2  0.0892     0.7926 0.000 0.980 0.020
#> SRR2313989     2  0.0000     0.7923 0.000 1.000 0.000
#> SRR2313983     1  0.5810     0.3423 0.664 0.000 0.336
#> SRR2313986     1  0.4452     0.5179 0.808 0.000 0.192
#> SRR2313982     1  0.5810     0.3423 0.664 0.000 0.336
#> SRR2313981     1  0.6667     0.4140 0.616 0.016 0.368

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.0469     0.9106 0.000 0.988 0.000 0.012
#> SRR2313980     2  0.0000     0.9137 0.000 1.000 0.000 0.000
#> SRR2313979     1  0.1302     0.8504 0.956 0.000 0.000 0.044
#> SRR2313977     2  0.3668     0.7450 0.000 0.808 0.188 0.004
#> SRR2313976     2  0.2469     0.8573 0.000 0.892 0.108 0.000
#> SRR2313975     1  0.1302     0.8504 0.956 0.000 0.000 0.044
#> SRR2313973     1  0.2647     0.8154 0.880 0.000 0.000 0.120
#> SRR2313974     1  0.1389     0.8497 0.952 0.000 0.000 0.048
#> SRR2313985     1  0.1940     0.8408 0.924 0.000 0.000 0.076
#> SRR2313993     3  0.5050     0.4683 0.000 0.408 0.588 0.004
#> SRR2313994     3  0.4560     0.6170 0.000 0.296 0.700 0.004
#> SRR2313995     2  0.1557     0.8733 0.000 0.944 0.000 0.056
#> SRR2314024     2  0.0188     0.9136 0.000 0.996 0.004 0.000
#> SRR2314015     2  0.0000     0.9137 0.000 1.000 0.000 0.000
#> SRR2314025     4  0.1211     0.6945 0.040 0.000 0.000 0.960
#> SRR2314023     1  0.2944     0.8072 0.868 0.000 0.004 0.128
#> SRR2314033     2  0.1792     0.8893 0.000 0.932 0.068 0.000
#> SRR2314045     1  0.4364     0.6636 0.764 0.000 0.220 0.016
#> SRR2314042     4  0.0524     0.6931 0.008 0.000 0.004 0.988
#> SRR2314043     3  0.6440     0.6381 0.068 0.224 0.676 0.032
#> SRR2314041     4  0.5705     0.4521 0.000 0.204 0.092 0.704
#> SRR2314044     4  0.5167    -0.0076 0.000 0.488 0.004 0.508
#> SRR2314040     3  0.3088     0.6930 0.008 0.128 0.864 0.000
#> SRR2314039     4  0.6042     0.0762 0.000 0.048 0.392 0.560
#> SRR2314038     2  0.8024     0.1845 0.216 0.492 0.272 0.020
#> SRR2314037     4  0.4647     0.4069 0.000 0.008 0.288 0.704
#> SRR2314036     2  0.0336     0.9134 0.000 0.992 0.008 0.000
#> SRR2314035     3  0.1929     0.6793 0.024 0.036 0.940 0.000
#> SRR2314034     3  0.5256     0.2870 0.012 0.000 0.596 0.392
#> SRR2314032     1  0.1970     0.7987 0.932 0.000 0.060 0.008
#> SRR2314031     4  0.0895     0.6970 0.020 0.000 0.004 0.976
#> SRR2314029     2  0.0336     0.9117 0.000 0.992 0.000 0.008
#> SRR2314030     3  0.6281     0.3935 0.128 0.000 0.656 0.216
#> SRR2314028     4  0.5392    -0.0172 0.012 0.000 0.460 0.528
#> SRR2314027     3  0.6356     0.4822 0.004 0.076 0.612 0.308
#> SRR2314026     3  0.2319     0.6526 0.036 0.000 0.924 0.040
#> SRR2314020     2  0.0000     0.9137 0.000 1.000 0.000 0.000
#> SRR2314019     3  0.4652     0.5983 0.020 0.012 0.776 0.192
#> SRR2314021     3  0.3525     0.6402 0.040 0.000 0.860 0.100
#> SRR2314018     3  0.4255     0.6797 0.008 0.200 0.784 0.008
#> SRR2314017     3  0.4149     0.5660 0.152 0.000 0.812 0.036
#> SRR2314016     1  0.7547     0.3570 0.488 0.000 0.276 0.236
#> SRR2314014     3  0.4720     0.5786 0.000 0.324 0.672 0.004
#> SRR2314013     2  0.2149     0.8759 0.000 0.912 0.088 0.000
#> SRR2314012     4  0.1940     0.6803 0.076 0.000 0.000 0.924
#> SRR2314011     4  0.4936     0.2092 0.372 0.000 0.004 0.624
#> SRR2314010     2  0.1182     0.9021 0.000 0.968 0.016 0.016
#> SRR2314009     3  0.3672     0.6332 0.000 0.012 0.824 0.164
#> SRR2314008     3  0.6635     0.5955 0.008 0.176 0.652 0.164
#> SRR2314007     3  0.2910     0.6659 0.028 0.020 0.908 0.044
#> SRR2314005     2  0.2466     0.8698 0.000 0.900 0.096 0.004
#> SRR2314004     2  0.0336     0.9125 0.000 0.992 0.008 0.000
#> SRR2314003     4  0.1824     0.6878 0.060 0.000 0.004 0.936
#> SRR2314006     2  0.0188     0.9129 0.000 0.996 0.004 0.000
#> SRR2314002     1  0.5467     0.4678 0.612 0.000 0.364 0.024
#> SRR2314001     3  0.4018     0.6706 0.000 0.224 0.772 0.004
#> SRR2314000     1  0.2528     0.7959 0.908 0.004 0.080 0.008
#> SRR2313998     2  0.2266     0.8761 0.004 0.912 0.084 0.000
#> SRR2313996     3  0.6954     0.5642 0.000 0.280 0.568 0.152
#> SRR2313999     4  0.5168    -0.1834 0.496 0.000 0.004 0.500
#> SRR2313997     2  0.0188     0.9129 0.000 0.996 0.004 0.000
#> SRR2313992     4  0.2593     0.6593 0.016 0.000 0.080 0.904
#> SRR2313991     3  0.8337     0.1314 0.176 0.356 0.432 0.036
#> SRR2313990     3  0.3978     0.6833 0.000 0.192 0.796 0.012
#> SRR2313988     1  0.1211     0.8497 0.960 0.000 0.000 0.040
#> SRR2313987     1  0.4122     0.6879 0.760 0.000 0.004 0.236
#> SRR2313984     2  0.3123     0.7387 0.000 0.844 0.156 0.000
#> SRR2313989     2  0.0000     0.9137 0.000 1.000 0.000 0.000
#> SRR2313983     1  0.1302     0.8504 0.956 0.000 0.000 0.044
#> SRR2313986     4  0.1902     0.6854 0.064 0.000 0.004 0.932
#> SRR2313982     1  0.1302     0.8504 0.956 0.000 0.000 0.044
#> SRR2313981     3  0.3626     0.6082 0.004 0.000 0.812 0.184

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     2  0.1569     0.9125 0.000 0.944 0.008 0.004 0.044
#> SRR2313980     2  0.0000     0.9401 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0000     0.8406 1.000 0.000 0.000 0.000 0.000
#> SRR2313977     3  0.6503     0.0995 0.000 0.372 0.436 0.000 0.192
#> SRR2313976     2  0.3700     0.7137 0.000 0.752 0.240 0.000 0.008
#> SRR2313975     1  0.0000     0.8406 1.000 0.000 0.000 0.000 0.000
#> SRR2313973     1  0.3661     0.6240 0.724 0.000 0.000 0.276 0.000
#> SRR2313974     1  0.1197     0.8328 0.952 0.000 0.000 0.048 0.000
#> SRR2313985     1  0.2471     0.7785 0.864 0.000 0.000 0.136 0.000
#> SRR2313993     3  0.3421     0.6234 0.000 0.164 0.816 0.004 0.016
#> SRR2313994     3  0.3823     0.6353 0.000 0.048 0.808 0.004 0.140
#> SRR2313995     2  0.0727     0.9366 0.000 0.980 0.004 0.012 0.004
#> SRR2314024     2  0.0324     0.9395 0.000 0.992 0.000 0.004 0.004
#> SRR2314015     2  0.0162     0.9401 0.000 0.996 0.000 0.000 0.004
#> SRR2314025     4  0.1173     0.7210 0.012 0.000 0.004 0.964 0.020
#> SRR2314023     1  0.3819     0.6844 0.756 0.000 0.000 0.228 0.016
#> SRR2314033     2  0.1281     0.9265 0.000 0.956 0.012 0.000 0.032
#> SRR2314045     1  0.5243     0.3063 0.596 0.000 0.048 0.004 0.352
#> SRR2314042     4  0.2504     0.6800 0.000 0.000 0.040 0.896 0.064
#> SRR2314043     3  0.2606     0.6712 0.008 0.024 0.904 0.008 0.056
#> SRR2314041     3  0.8018     0.1663 0.000 0.120 0.380 0.328 0.172
#> SRR2314044     4  0.5900     0.3924 0.004 0.312 0.072 0.596 0.016
#> SRR2314040     3  0.2604     0.6601 0.004 0.004 0.880 0.004 0.108
#> SRR2314039     3  0.6307     0.4096 0.000 0.000 0.532 0.224 0.244
#> SRR2314038     5  0.5264     0.6258 0.008 0.120 0.008 0.144 0.720
#> SRR2314037     3  0.5018     0.5192 0.000 0.004 0.660 0.284 0.052
#> SRR2314036     2  0.0290     0.9397 0.000 0.992 0.000 0.000 0.008
#> SRR2314035     3  0.1478     0.6741 0.000 0.000 0.936 0.000 0.064
#> SRR2314034     3  0.4649     0.6042 0.000 0.000 0.720 0.068 0.212
#> SRR2314032     1  0.2416     0.7672 0.888 0.000 0.012 0.000 0.100
#> SRR2314031     4  0.2517     0.7079 0.008 0.000 0.004 0.884 0.104
#> SRR2314029     2  0.0162     0.9401 0.000 0.996 0.000 0.004 0.000
#> SRR2314030     5  0.5466     0.5853 0.004 0.000 0.192 0.136 0.668
#> SRR2314028     3  0.3489     0.6413 0.000 0.000 0.820 0.144 0.036
#> SRR2314027     3  0.5756     0.4222 0.000 0.000 0.576 0.112 0.312
#> SRR2314026     3  0.4268     0.3136 0.000 0.000 0.556 0.000 0.444
#> SRR2314020     2  0.0000     0.9401 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     3  0.5042     0.2212 0.000 0.000 0.508 0.032 0.460
#> SRR2314021     3  0.4557     0.3412 0.000 0.000 0.584 0.012 0.404
#> SRR2314018     3  0.3491     0.5276 0.004 0.000 0.768 0.000 0.228
#> SRR2314017     5  0.3018     0.7487 0.008 0.000 0.084 0.036 0.872
#> SRR2314016     5  0.3792     0.6920 0.020 0.000 0.008 0.180 0.792
#> SRR2314014     3  0.3003     0.6477 0.000 0.092 0.864 0.000 0.044
#> SRR2314013     2  0.2848     0.8284 0.000 0.840 0.156 0.000 0.004
#> SRR2314012     4  0.2450     0.7197 0.076 0.000 0.000 0.896 0.028
#> SRR2314011     4  0.4040     0.5048 0.276 0.000 0.000 0.712 0.012
#> SRR2314010     2  0.2283     0.8937 0.000 0.916 0.036 0.008 0.040
#> SRR2314009     3  0.3214     0.6599 0.000 0.000 0.844 0.036 0.120
#> SRR2314008     5  0.5244     0.3285 0.000 0.024 0.360 0.020 0.596
#> SRR2314007     3  0.4088     0.5442 0.000 0.004 0.712 0.008 0.276
#> SRR2314005     2  0.3692     0.8158 0.000 0.812 0.136 0.000 0.052
#> SRR2314004     2  0.0566     0.9383 0.000 0.984 0.004 0.000 0.012
#> SRR2314003     4  0.2520     0.7141 0.012 0.000 0.004 0.888 0.096
#> SRR2314006     2  0.0000     0.9401 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     5  0.3810     0.6858 0.168 0.000 0.040 0.000 0.792
#> SRR2314001     3  0.2260     0.6756 0.000 0.028 0.908 0.000 0.064
#> SRR2314000     1  0.0867     0.8340 0.976 0.008 0.008 0.000 0.008
#> SRR2313998     2  0.1952     0.8964 0.000 0.912 0.084 0.000 0.004
#> SRR2313996     3  0.3301     0.6642 0.000 0.076 0.864 0.024 0.036
#> SRR2313999     4  0.6637     0.1477 0.368 0.000 0.008 0.452 0.172
#> SRR2313997     2  0.0290     0.9397 0.000 0.992 0.000 0.000 0.008
#> SRR2313992     4  0.4482     0.4911 0.004 0.000 0.252 0.712 0.032
#> SRR2313991     5  0.3388     0.7607 0.012 0.024 0.048 0.044 0.872
#> SRR2313990     3  0.0992     0.6777 0.000 0.024 0.968 0.000 0.008
#> SRR2313988     1  0.0162     0.8398 0.996 0.000 0.000 0.000 0.004
#> SRR2313987     1  0.4491     0.5232 0.652 0.000 0.000 0.328 0.020
#> SRR2313984     2  0.1628     0.9083 0.000 0.936 0.056 0.000 0.008
#> SRR2313989     2  0.0000     0.9401 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0000     0.8406 1.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.3012     0.6949 0.024 0.000 0.000 0.852 0.124
#> SRR2313982     1  0.0955     0.8368 0.968 0.000 0.000 0.028 0.004
#> SRR2313981     3  0.3112     0.6648 0.000 0.000 0.856 0.044 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
#> SRR2313978     6  0.2326     0.8367 0.000 0.012 0.000 0.008 0.092 0.888
#> SRR2313980     6  0.0458     0.8877 0.000 0.000 0.000 0.000 0.016 0.984
#> SRR2313979     1  0.0000     0.8226 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     5  0.3898     0.4977 0.000 0.296 0.000 0.000 0.684 0.020
#> SRR2313976     6  0.5018     0.3883 0.000 0.372 0.004 0.000 0.068 0.556
#> SRR2313975     1  0.0000     0.8226 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313973     1  0.3810     0.2766 0.572 0.000 0.000 0.428 0.000 0.000
#> SRR2313974     1  0.2100     0.7850 0.884 0.000 0.000 0.112 0.004 0.000
#> SRR2313985     1  0.2823     0.6951 0.796 0.000 0.000 0.204 0.000 0.000
#> SRR2313993     2  0.4264     0.6525 0.000 0.776 0.108 0.000 0.044 0.072
#> SRR2313994     2  0.3062     0.7007 0.000 0.824 0.144 0.000 0.000 0.032
#> SRR2313995     6  0.0405     0.8884 0.000 0.000 0.000 0.008 0.004 0.988
#> SRR2314024     6  0.1049     0.8822 0.000 0.000 0.008 0.000 0.032 0.960
#> SRR2314015     6  0.1934     0.8628 0.000 0.044 0.000 0.000 0.040 0.916
#> SRR2314025     4  0.1951     0.7276 0.000 0.000 0.076 0.908 0.016 0.000
#> SRR2314023     1  0.4389     0.2010 0.528 0.000 0.000 0.448 0.024 0.000
#> SRR2314033     6  0.1871     0.8747 0.000 0.016 0.032 0.000 0.024 0.928
#> SRR2314045     3  0.4702     0.0155 0.440 0.024 0.524 0.000 0.012 0.000
#> SRR2314042     4  0.4706     0.5605 0.000 0.020 0.232 0.688 0.060 0.000
#> SRR2314043     2  0.2728     0.7118 0.004 0.864 0.032 0.000 0.100 0.000
#> SRR2314041     2  0.7635     0.2161 0.000 0.464 0.052 0.188 0.092 0.204
#> SRR2314044     4  0.5533     0.5281 0.000 0.112 0.004 0.668 0.056 0.160
#> SRR2314040     2  0.1753     0.7497 0.000 0.912 0.084 0.000 0.004 0.000
#> SRR2314039     3  0.5989     0.3263 0.000 0.404 0.468 0.060 0.068 0.000
#> SRR2314038     5  0.3486     0.5102 0.000 0.000 0.056 0.064 0.836 0.044
#> SRR2314037     2  0.4506     0.5162 0.000 0.684 0.048 0.256 0.012 0.000
#> SRR2314036     6  0.0458     0.8873 0.000 0.000 0.000 0.000 0.016 0.984
#> SRR2314035     2  0.1408     0.7601 0.000 0.944 0.036 0.000 0.020 0.000
#> SRR2314034     2  0.4379     0.0862 0.000 0.576 0.400 0.020 0.004 0.000
#> SRR2314032     1  0.2243     0.7473 0.880 0.004 0.112 0.000 0.004 0.000
#> SRR2314031     4  0.1845     0.7361 0.000 0.000 0.052 0.920 0.028 0.000
#> SRR2314029     6  0.0405     0.8884 0.000 0.000 0.000 0.008 0.004 0.988
#> SRR2314030     3  0.2847     0.4061 0.000 0.048 0.876 0.040 0.036 0.000
#> SRR2314028     2  0.3005     0.7266 0.000 0.864 0.024 0.060 0.052 0.000
#> SRR2314027     3  0.4858     0.4559 0.000 0.368 0.584 0.016 0.028 0.004
#> SRR2314026     3  0.3351     0.5619 0.000 0.288 0.712 0.000 0.000 0.000
#> SRR2314020     6  0.0260     0.8883 0.000 0.000 0.000 0.000 0.008 0.992
#> SRR2314019     3  0.3629     0.5733 0.000 0.276 0.712 0.012 0.000 0.000
#> SRR2314021     3  0.3862     0.4367 0.000 0.388 0.608 0.004 0.000 0.000
#> SRR2314018     5  0.3854     0.1766 0.000 0.464 0.000 0.000 0.536 0.000
#> SRR2314017     5  0.4528     0.2900 0.000 0.028 0.404 0.004 0.564 0.000
#> SRR2314016     3  0.5475     0.0275 0.000 0.008 0.596 0.160 0.236 0.000
#> SRR2314014     2  0.2766     0.7000 0.000 0.852 0.004 0.000 0.124 0.020
#> SRR2314013     6  0.4204     0.6276 0.000 0.260 0.004 0.000 0.040 0.696
#> SRR2314012     4  0.1779     0.7385 0.016 0.000 0.064 0.920 0.000 0.000
#> SRR2314011     4  0.3931     0.6032 0.192 0.000 0.008 0.756 0.044 0.000
#> SRR2314010     6  0.2594     0.8498 0.000 0.048 0.016 0.004 0.040 0.892
#> SRR2314009     2  0.2527     0.7466 0.000 0.884 0.048 0.004 0.064 0.000
#> SRR2314008     5  0.3385     0.5737 0.000 0.144 0.036 0.008 0.812 0.000
#> SRR2314007     2  0.3878     0.3009 0.000 0.644 0.348 0.000 0.004 0.004
#> SRR2314005     6  0.5719     0.3290 0.000 0.248 0.000 0.000 0.232 0.520
#> SRR2314004     6  0.1219     0.8802 0.000 0.004 0.000 0.000 0.048 0.948
#> SRR2314003     4  0.2178     0.7203 0.000 0.000 0.000 0.868 0.132 0.000
#> SRR2314006     6  0.0146     0.8878 0.000 0.000 0.000 0.000 0.004 0.996
#> SRR2314002     5  0.5513     0.2141 0.068 0.024 0.428 0.000 0.480 0.000
#> SRR2314001     2  0.1956     0.7469 0.000 0.908 0.080 0.000 0.008 0.004
#> SRR2314000     1  0.2390     0.7780 0.896 0.044 0.000 0.008 0.052 0.000
#> SRR2313998     6  0.1644     0.8646 0.000 0.076 0.004 0.000 0.000 0.920
#> SRR2313996     2  0.2322     0.7291 0.000 0.896 0.000 0.004 0.064 0.036
#> SRR2313999     4  0.4759     0.4494 0.044 0.004 0.000 0.556 0.396 0.000
#> SRR2313997     6  0.0146     0.8875 0.000 0.000 0.000 0.000 0.004 0.996
#> SRR2313992     4  0.3777     0.5912 0.000 0.208 0.028 0.756 0.008 0.000
#> SRR2313991     3  0.4624     0.0400 0.000 0.032 0.648 0.004 0.304 0.012
#> SRR2313990     2  0.1074     0.7600 0.000 0.960 0.028 0.000 0.012 0.000
#> SRR2313988     1  0.0000     0.8226 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313987     4  0.4591     0.0593 0.408 0.000 0.000 0.552 0.040 0.000
#> SRR2313984     6  0.1802     0.8514 0.000 0.072 0.000 0.000 0.012 0.916
#> SRR2313989     6  0.0000     0.8873 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     1  0.0000     0.8226 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.1863     0.7280 0.000 0.000 0.000 0.896 0.104 0.000
#> SRR2313982     1  0.1285     0.8132 0.944 0.000 0.000 0.052 0.004 0.000
#> SRR2313981     2  0.2265     0.7426 0.000 0.896 0.076 0.004 0.024 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-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

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

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

collect_plots(res)

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.419           0.673       0.847         0.4229 0.581   0.581
#> 3 3 0.520           0.763       0.864         0.4758 0.668   0.472
#> 4 4 0.508           0.691       0.803         0.0819 0.977   0.932
#> 5 5 0.609           0.499       0.768         0.0977 0.860   0.599
#> 6 6 0.634           0.517       0.672         0.0545 0.873   0.573

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
#> SRR2313978     2  0.0000      0.769 0.000 1.000
#> SRR2313980     2  0.0000      0.769 0.000 1.000
#> SRR2313979     1  0.0000      0.854 1.000 0.000
#> SRR2313977     2  0.0672      0.768 0.008 0.992
#> SRR2313976     2  0.0000      0.769 0.000 1.000
#> SRR2313975     1  0.0000      0.854 1.000 0.000
#> SRR2313973     1  0.0000      0.854 1.000 0.000
#> SRR2313974     1  0.0938      0.852 0.988 0.012
#> SRR2313985     1  0.2236      0.839 0.964 0.036
#> SRR2313993     2  0.0000      0.769 0.000 1.000
#> SRR2313994     2  0.0000      0.769 0.000 1.000
#> SRR2313995     2  0.1414      0.765 0.020 0.980
#> SRR2314024     2  0.0000      0.769 0.000 1.000
#> SRR2314015     2  0.0000      0.769 0.000 1.000
#> SRR2314025     1  0.9460      0.298 0.636 0.364
#> SRR2314023     1  0.0000      0.854 1.000 0.000
#> SRR2314033     2  0.0000      0.769 0.000 1.000
#> SRR2314045     1  0.1414      0.848 0.980 0.020
#> SRR2314042     1  0.9552      0.254 0.624 0.376
#> SRR2314043     2  0.9044      0.620 0.320 0.680
#> SRR2314041     2  0.5294      0.732 0.120 0.880
#> SRR2314044     2  0.9866      0.442 0.432 0.568
#> SRR2314040     2  0.8555      0.664 0.280 0.720
#> SRR2314039     2  0.8386      0.673 0.268 0.732
#> SRR2314038     2  0.9993      0.307 0.484 0.516
#> SRR2314037     2  0.9944      0.389 0.456 0.544
#> SRR2314036     2  0.0000      0.769 0.000 1.000
#> SRR2314035     2  0.8555      0.664 0.280 0.720
#> SRR2314034     2  0.9909      0.416 0.444 0.556
#> SRR2314032     1  0.0000      0.854 1.000 0.000
#> SRR2314031     1  0.9460      0.298 0.636 0.364
#> SRR2314029     2  0.9815      0.466 0.420 0.580
#> SRR2314030     2  0.9933      0.397 0.452 0.548
#> SRR2314028     1  0.9427      0.309 0.640 0.360
#> SRR2314027     2  0.8386      0.673 0.268 0.732
#> SRR2314026     2  0.8661      0.656 0.288 0.712
#> SRR2314020     2  0.0000      0.769 0.000 1.000
#> SRR2314019     2  0.9909      0.416 0.444 0.556
#> SRR2314021     2  0.9909      0.416 0.444 0.556
#> SRR2314018     2  0.8555      0.664 0.280 0.720
#> SRR2314017     2  0.8555      0.664 0.280 0.720
#> SRR2314016     2  0.9993      0.307 0.484 0.516
#> SRR2314014     2  0.0000      0.769 0.000 1.000
#> SRR2314013     2  0.0672      0.768 0.008 0.992
#> SRR2314012     1  0.9427      0.309 0.640 0.360
#> SRR2314011     1  0.0000      0.854 1.000 0.000
#> SRR2314010     2  0.1184      0.766 0.016 0.984
#> SRR2314009     2  0.8555      0.664 0.280 0.720
#> SRR2314008     2  0.8555      0.664 0.280 0.720
#> SRR2314007     2  0.2043      0.764 0.032 0.968
#> SRR2314005     2  0.0000      0.769 0.000 1.000
#> SRR2314004     2  0.0000      0.769 0.000 1.000
#> SRR2314003     1  0.3431      0.817 0.936 0.064
#> SRR2314006     2  0.0000      0.769 0.000 1.000
#> SRR2314002     2  0.8555      0.664 0.280 0.720
#> SRR2314001     2  0.0000      0.769 0.000 1.000
#> SRR2314000     2  0.9732      0.498 0.404 0.596
#> SRR2313998     2  0.0376      0.769 0.004 0.996
#> SRR2313996     2  0.0000      0.769 0.000 1.000
#> SRR2313999     1  0.0000      0.854 1.000 0.000
#> SRR2313997     2  0.0000      0.769 0.000 1.000
#> SRR2313992     2  0.9963      0.367 0.464 0.536
#> SRR2313991     2  0.8499      0.667 0.276 0.724
#> SRR2313990     2  0.0000      0.769 0.000 1.000
#> SRR2313988     1  0.0000      0.854 1.000 0.000
#> SRR2313987     1  0.0938      0.852 0.988 0.012
#> SRR2313984     2  0.0000      0.769 0.000 1.000
#> SRR2313989     2  0.0000      0.769 0.000 1.000
#> SRR2313983     1  0.0000      0.854 1.000 0.000
#> SRR2313986     1  0.4022      0.802 0.920 0.080
#> SRR2313982     1  0.0000      0.854 1.000 0.000
#> SRR2313981     2  0.9954      0.377 0.460 0.540

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.4399      0.817 0.000 0.812 0.188
#> SRR2313980     2  0.0000      0.826 0.000 1.000 0.000
#> SRR2313979     1  0.0237      0.928 0.996 0.000 0.004
#> SRR2313977     2  0.4842      0.782 0.000 0.776 0.224
#> SRR2313976     2  0.0747      0.831 0.000 0.984 0.016
#> SRR2313975     1  0.0424      0.928 0.992 0.000 0.008
#> SRR2313973     1  0.0237      0.926 0.996 0.000 0.004
#> SRR2313974     1  0.2448      0.901 0.924 0.000 0.076
#> SRR2313985     1  0.2625      0.889 0.916 0.000 0.084
#> SRR2313993     2  0.3619      0.835 0.000 0.864 0.136
#> SRR2313994     2  0.5216      0.742 0.000 0.740 0.260
#> SRR2313995     2  0.4887      0.686 0.000 0.772 0.228
#> SRR2314024     2  0.0892      0.831 0.000 0.980 0.020
#> SRR2314015     2  0.3619      0.836 0.000 0.864 0.136
#> SRR2314025     3  0.4002      0.649 0.160 0.000 0.840
#> SRR2314023     1  0.0237      0.926 0.996 0.000 0.004
#> SRR2314033     2  0.0000      0.826 0.000 1.000 0.000
#> SRR2314045     1  0.1399      0.921 0.968 0.004 0.028
#> SRR2314042     3  0.4047      0.663 0.148 0.004 0.848
#> SRR2314043     3  0.4605      0.731 0.000 0.204 0.796
#> SRR2314041     2  0.6140      0.470 0.000 0.596 0.404
#> SRR2314044     3  0.1964      0.785 0.000 0.056 0.944
#> SRR2314040     3  0.5363      0.679 0.000 0.276 0.724
#> SRR2314039     3  0.6260      0.242 0.000 0.448 0.552
#> SRR2314038     3  0.0661      0.772 0.008 0.004 0.988
#> SRR2314037     3  0.1711      0.785 0.008 0.032 0.960
#> SRR2314036     2  0.0000      0.826 0.000 1.000 0.000
#> SRR2314035     3  0.5327      0.684 0.000 0.272 0.728
#> SRR2314034     3  0.1411      0.786 0.000 0.036 0.964
#> SRR2314032     1  0.0424      0.928 0.992 0.000 0.008
#> SRR2314031     3  0.4002      0.649 0.160 0.000 0.840
#> SRR2314029     3  0.2774      0.784 0.008 0.072 0.920
#> SRR2314030     3  0.1163      0.785 0.000 0.028 0.972
#> SRR2314028     3  0.4062      0.644 0.164 0.000 0.836
#> SRR2314027     3  0.6260      0.242 0.000 0.448 0.552
#> SRR2314026     3  0.5431      0.665 0.000 0.284 0.716
#> SRR2314020     2  0.0000      0.826 0.000 1.000 0.000
#> SRR2314019     3  0.1411      0.786 0.000 0.036 0.964
#> SRR2314021     3  0.1411      0.786 0.000 0.036 0.964
#> SRR2314018     3  0.5327      0.684 0.000 0.272 0.728
#> SRR2314017     3  0.5327      0.685 0.000 0.272 0.728
#> SRR2314016     3  0.0661      0.772 0.008 0.004 0.988
#> SRR2314014     2  0.4062      0.825 0.000 0.836 0.164
#> SRR2314013     2  0.5529      0.666 0.000 0.704 0.296
#> SRR2314012     3  0.4062      0.644 0.164 0.000 0.836
#> SRR2314011     1  0.0747      0.927 0.984 0.000 0.016
#> SRR2314010     2  0.4842      0.793 0.000 0.776 0.224
#> SRR2314009     3  0.5327      0.684 0.000 0.272 0.728
#> SRR2314008     3  0.5327      0.684 0.000 0.272 0.728
#> SRR2314007     2  0.5529      0.684 0.000 0.704 0.296
#> SRR2314005     2  0.2165      0.837 0.000 0.936 0.064
#> SRR2314004     2  0.0000      0.826 0.000 1.000 0.000
#> SRR2314003     1  0.5905      0.488 0.648 0.000 0.352
#> SRR2314006     2  0.0000      0.826 0.000 1.000 0.000
#> SRR2314002     3  0.5553      0.684 0.004 0.272 0.724
#> SRR2314001     2  0.4555      0.806 0.000 0.800 0.200
#> SRR2314000     3  0.6954      0.706 0.084 0.196 0.720
#> SRR2313998     2  0.3267      0.839 0.000 0.884 0.116
#> SRR2313996     2  0.4654      0.803 0.000 0.792 0.208
#> SRR2313999     1  0.0747      0.927 0.984 0.000 0.016
#> SRR2313997     2  0.0000      0.826 0.000 1.000 0.000
#> SRR2313992     3  0.1751      0.784 0.012 0.028 0.960
#> SRR2313991     3  0.5363      0.682 0.000 0.276 0.724
#> SRR2313990     2  0.5291      0.731 0.000 0.732 0.268
#> SRR2313988     1  0.0424      0.928 0.992 0.000 0.008
#> SRR2313987     1  0.2448      0.901 0.924 0.000 0.076
#> SRR2313984     2  0.4654      0.803 0.000 0.792 0.208
#> SRR2313989     2  0.0000      0.826 0.000 1.000 0.000
#> SRR2313983     1  0.0237      0.928 0.996 0.000 0.004
#> SRR2313986     1  0.5988      0.450 0.632 0.000 0.368
#> SRR2313982     1  0.0237      0.928 0.996 0.000 0.004
#> SRR2313981     3  0.1585      0.784 0.008 0.028 0.964

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.3528      0.798 0.000 0.808 0.192 0.000
#> SRR2313980     2  0.1557      0.805 0.000 0.944 0.000 0.056
#> SRR2313979     1  0.0188      0.886 0.996 0.000 0.000 0.004
#> SRR2313977     2  0.4353      0.767 0.000 0.756 0.232 0.012
#> SRR2313976     2  0.1488      0.812 0.000 0.956 0.012 0.032
#> SRR2313975     1  0.0000      0.886 1.000 0.000 0.000 0.000
#> SRR2313973     4  0.4134      0.690 0.260 0.000 0.000 0.740
#> SRR2313974     1  0.5522      0.464 0.668 0.000 0.044 0.288
#> SRR2313985     1  0.2408      0.818 0.920 0.000 0.044 0.036
#> SRR2313993     2  0.2999      0.818 0.000 0.864 0.132 0.004
#> SRR2313994     2  0.4193      0.729 0.000 0.732 0.268 0.000
#> SRR2313995     2  0.5478      0.637 0.000 0.696 0.248 0.056
#> SRR2314024     2  0.2256      0.810 0.000 0.924 0.020 0.056
#> SRR2314015     2  0.3813      0.818 0.000 0.828 0.148 0.024
#> SRR2314025     3  0.4564      0.427 0.000 0.000 0.672 0.328
#> SRR2314023     4  0.4134      0.690 0.260 0.000 0.000 0.740
#> SRR2314033     2  0.1557      0.805 0.000 0.944 0.000 0.056
#> SRR2314045     1  0.0927      0.869 0.976 0.000 0.016 0.008
#> SRR2314042     3  0.4134      0.513 0.000 0.000 0.740 0.260
#> SRR2314043     3  0.3672      0.696 0.000 0.164 0.824 0.012
#> SRR2314041     2  0.5070      0.477 0.000 0.580 0.416 0.004
#> SRR2314044     3  0.1610      0.714 0.000 0.032 0.952 0.016
#> SRR2314040     3  0.5047      0.621 0.004 0.256 0.716 0.024
#> SRR2314039     3  0.5126      0.191 0.000 0.444 0.552 0.004
#> SRR2314038     3  0.2530      0.670 0.000 0.000 0.888 0.112
#> SRR2314037     3  0.1716      0.696 0.000 0.000 0.936 0.064
#> SRR2314036     2  0.1557      0.805 0.000 0.944 0.000 0.056
#> SRR2314035     3  0.4632      0.639 0.004 0.244 0.740 0.012
#> SRR2314034     3  0.1305      0.708 0.000 0.004 0.960 0.036
#> SRR2314032     1  0.0000      0.886 1.000 0.000 0.000 0.000
#> SRR2314031     3  0.4564      0.427 0.000 0.000 0.672 0.328
#> SRR2314029     3  0.2830      0.712 0.000 0.040 0.900 0.060
#> SRR2314030     3  0.2053      0.699 0.000 0.004 0.924 0.072
#> SRR2314028     3  0.4769      0.440 0.008 0.000 0.684 0.308
#> SRR2314027     3  0.5126      0.191 0.000 0.444 0.552 0.004
#> SRR2314026     3  0.4661      0.617 0.004 0.264 0.724 0.008
#> SRR2314020     2  0.1557      0.805 0.000 0.944 0.000 0.056
#> SRR2314019     3  0.1305      0.708 0.000 0.004 0.960 0.036
#> SRR2314021     3  0.1305      0.708 0.000 0.004 0.960 0.036
#> SRR2314018     3  0.4632      0.639 0.004 0.244 0.740 0.012
#> SRR2314017     3  0.4778      0.639 0.004 0.248 0.732 0.016
#> SRR2314016     3  0.2530      0.670 0.000 0.000 0.888 0.112
#> SRR2314014     2  0.3266      0.805 0.000 0.832 0.168 0.000
#> SRR2314013     2  0.5417      0.647 0.000 0.676 0.284 0.040
#> SRR2314012     3  0.4769      0.440 0.008 0.000 0.684 0.308
#> SRR2314011     4  0.4040      0.696 0.248 0.000 0.000 0.752
#> SRR2314010     2  0.4158      0.778 0.000 0.768 0.224 0.008
#> SRR2314009     3  0.4632      0.639 0.004 0.244 0.740 0.012
#> SRR2314008     3  0.4632      0.639 0.004 0.244 0.740 0.012
#> SRR2314007     2  0.4584      0.672 0.000 0.696 0.300 0.004
#> SRR2314005     2  0.2376      0.819 0.000 0.916 0.068 0.016
#> SRR2314004     2  0.1557      0.805 0.000 0.944 0.000 0.056
#> SRR2314003     4  0.7285      0.515 0.180 0.000 0.300 0.520
#> SRR2314006     2  0.1557      0.805 0.000 0.944 0.000 0.056
#> SRR2314002     3  0.5155      0.625 0.008 0.252 0.716 0.024
#> SRR2314001     2  0.3649      0.787 0.000 0.796 0.204 0.000
#> SRR2314000     3  0.6331      0.665 0.088 0.160 0.712 0.040
#> SRR2313998     2  0.2469      0.821 0.000 0.892 0.108 0.000
#> SRR2313996     2  0.3726      0.784 0.000 0.788 0.212 0.000
#> SRR2313999     4  0.3975      0.695 0.240 0.000 0.000 0.760
#> SRR2313997     2  0.1557      0.805 0.000 0.944 0.000 0.056
#> SRR2313992     3  0.2216      0.686 0.000 0.000 0.908 0.092
#> SRR2313991     3  0.5047      0.623 0.004 0.256 0.716 0.024
#> SRR2313990     2  0.4401      0.721 0.000 0.724 0.272 0.004
#> SRR2313988     1  0.0000      0.886 1.000 0.000 0.000 0.000
#> SRR2313987     1  0.5522      0.464 0.668 0.000 0.044 0.288
#> SRR2313984     2  0.3726      0.784 0.000 0.788 0.212 0.000
#> SRR2313989     2  0.1557      0.805 0.000 0.944 0.000 0.056
#> SRR2313983     1  0.0188      0.886 0.996 0.000 0.000 0.004
#> SRR2313986     4  0.7172      0.510 0.164 0.000 0.304 0.532
#> SRR2313982     1  0.0188      0.886 0.996 0.000 0.000 0.004
#> SRR2313981     3  0.2647      0.669 0.000 0.000 0.880 0.120

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     2  0.4613    0.57367 0.000 0.580 0.408 0.008 0.004
#> SRR2313980     2  0.0000    0.72061 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0162    0.86546 0.996 0.000 0.000 0.000 0.004
#> SRR2313977     2  0.4794    0.48016 0.000 0.520 0.464 0.004 0.012
#> SRR2313976     2  0.1544    0.72101 0.000 0.932 0.068 0.000 0.000
#> SRR2313975     1  0.0000    0.86536 1.000 0.000 0.000 0.000 0.000
#> SRR2313973     5  0.3130    0.81741 0.048 0.000 0.000 0.096 0.856
#> SRR2313974     1  0.5798    0.17659 0.500 0.000 0.020 0.048 0.432
#> SRR2313985     1  0.2362    0.81135 0.916 0.000 0.032 0.024 0.028
#> SRR2313993     2  0.3913    0.65398 0.000 0.676 0.324 0.000 0.000
#> SRR2313994     3  0.4559   -0.43224 0.000 0.480 0.512 0.000 0.008
#> SRR2313995     2  0.5023    0.55180 0.000 0.708 0.192 0.096 0.004
#> SRR2314024     2  0.0609    0.72094 0.000 0.980 0.020 0.000 0.000
#> SRR2314015     2  0.4302    0.63668 0.000 0.648 0.344 0.004 0.004
#> SRR2314025     4  0.0671    0.51772 0.000 0.000 0.004 0.980 0.016
#> SRR2314023     5  0.3130    0.81741 0.048 0.000 0.000 0.096 0.856
#> SRR2314033     2  0.0000    0.72061 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     1  0.0867    0.85519 0.976 0.000 0.008 0.008 0.008
#> SRR2314042     4  0.2011    0.57838 0.000 0.000 0.088 0.908 0.004
#> SRR2314043     3  0.2787    0.49575 0.000 0.004 0.856 0.136 0.004
#> SRR2314041     3  0.6144   -0.22594 0.000 0.432 0.452 0.112 0.004
#> SRR2314044     3  0.4362    0.11153 0.000 0.004 0.632 0.360 0.004
#> SRR2314040     3  0.1612    0.57618 0.000 0.016 0.948 0.024 0.012
#> SRR2314039     3  0.4398    0.41736 0.000 0.240 0.720 0.040 0.000
#> SRR2314038     4  0.5925    0.35556 0.000 0.000 0.424 0.472 0.104
#> SRR2314037     3  0.4504   -0.12791 0.000 0.000 0.564 0.428 0.008
#> SRR2314036     2  0.0000    0.72061 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     3  0.1673    0.57820 0.000 0.016 0.944 0.032 0.008
#> SRR2314034     3  0.4299    0.00482 0.000 0.000 0.608 0.388 0.004
#> SRR2314032     1  0.0000    0.86536 1.000 0.000 0.000 0.000 0.000
#> SRR2314031     4  0.0671    0.51772 0.000 0.000 0.004 0.980 0.016
#> SRR2314029     4  0.4238    0.39667 0.000 0.000 0.368 0.628 0.004
#> SRR2314030     4  0.5583    0.34392 0.000 0.000 0.424 0.504 0.072
#> SRR2314028     4  0.1741    0.55165 0.000 0.000 0.040 0.936 0.024
#> SRR2314027     3  0.4398    0.41736 0.000 0.240 0.720 0.040 0.000
#> SRR2314026     3  0.1743    0.57640 0.000 0.028 0.940 0.028 0.004
#> SRR2314020     2  0.0000    0.72061 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     3  0.4299    0.00482 0.000 0.000 0.608 0.388 0.004
#> SRR2314021     3  0.4299    0.00482 0.000 0.000 0.608 0.388 0.004
#> SRR2314018     3  0.1673    0.57820 0.000 0.016 0.944 0.032 0.008
#> SRR2314017     3  0.2866    0.51691 0.000 0.004 0.872 0.024 0.100
#> SRR2314016     4  0.5925    0.35556 0.000 0.000 0.424 0.472 0.104
#> SRR2314014     2  0.4350    0.58515 0.000 0.588 0.408 0.000 0.004
#> SRR2314013     2  0.6043    0.48393 0.000 0.568 0.308 0.116 0.008
#> SRR2314012     4  0.1741    0.55165 0.000 0.000 0.040 0.936 0.024
#> SRR2314011     5  0.2959    0.82091 0.036 0.000 0.000 0.100 0.864
#> SRR2314010     2  0.4856    0.56093 0.000 0.584 0.388 0.028 0.000
#> SRR2314009     3  0.1673    0.57820 0.000 0.016 0.944 0.032 0.008
#> SRR2314008     3  0.1673    0.57820 0.000 0.016 0.944 0.032 0.008
#> SRR2314007     3  0.4549   -0.36911 0.000 0.464 0.528 0.008 0.000
#> SRR2314005     2  0.3659    0.69020 0.000 0.768 0.220 0.000 0.012
#> SRR2314004     2  0.0000    0.72061 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     5  0.4648    0.61190 0.012 0.000 0.000 0.464 0.524
#> SRR2314006     2  0.0000    0.72061 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     3  0.2729    0.51634 0.004 0.004 0.876 0.008 0.108
#> SRR2314001     2  0.4397    0.54898 0.000 0.564 0.432 0.000 0.004
#> SRR2314000     3  0.4264    0.46706 0.084 0.000 0.808 0.076 0.032
#> SRR2313998     2  0.4084    0.65414 0.000 0.668 0.328 0.000 0.004
#> SRR2313996     2  0.4645    0.54643 0.000 0.564 0.424 0.008 0.004
#> SRR2313999     5  0.2707    0.81918 0.024 0.000 0.000 0.100 0.876
#> SRR2313997     2  0.0000    0.72061 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     3  0.4440   -0.22784 0.000 0.000 0.528 0.468 0.004
#> SRR2313991     3  0.2805    0.52055 0.000 0.008 0.872 0.012 0.108
#> SRR2313990     3  0.4555   -0.41881 0.000 0.472 0.520 0.000 0.008
#> SRR2313988     1  0.0000    0.86536 1.000 0.000 0.000 0.000 0.000
#> SRR2313987     1  0.5798    0.17659 0.500 0.000 0.020 0.048 0.432
#> SRR2313984     2  0.4645    0.54643 0.000 0.564 0.424 0.008 0.004
#> SRR2313989     2  0.0000    0.72061 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0162    0.86546 0.996 0.000 0.000 0.000 0.004
#> SRR2313986     5  0.4656    0.59220 0.012 0.000 0.000 0.480 0.508
#> SRR2313982     1  0.0162    0.86546 0.996 0.000 0.000 0.000 0.004
#> SRR2313981     4  0.4452    0.20697 0.000 0.000 0.496 0.500 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
#> SRR2313978     2  0.0632     0.6430 0.000 0.976 0.000 0.000 0.024 0.000
#> SRR2313980     2  0.4086     0.6124 0.000 0.528 0.464 0.000 0.008 0.000
#> SRR2313979     1  0.0146     0.8605 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR2313977     2  0.3175     0.5777 0.000 0.808 0.028 0.000 0.164 0.000
#> SRR2313976     2  0.3672     0.6496 0.000 0.632 0.368 0.000 0.000 0.000
#> SRR2313975     1  0.0146     0.8603 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR2313973     6  0.0622     0.7896 0.012 0.000 0.008 0.000 0.000 0.980
#> SRR2313974     1  0.5493     0.1445 0.480 0.000 0.008 0.052 0.020 0.440
#> SRR2313985     1  0.2539     0.8093 0.900 0.000 0.012 0.020 0.040 0.028
#> SRR2313993     2  0.1806     0.6766 0.000 0.908 0.088 0.000 0.004 0.000
#> SRR2313994     2  0.2630     0.5564 0.000 0.872 0.064 0.000 0.064 0.000
#> SRR2313995     2  0.5753     0.4903 0.000 0.448 0.432 0.020 0.100 0.000
#> SRR2314024     2  0.4032     0.6365 0.000 0.572 0.420 0.000 0.008 0.000
#> SRR2314015     2  0.1753     0.6695 0.000 0.912 0.084 0.000 0.004 0.000
#> SRR2314025     4  0.0964     0.6888 0.000 0.000 0.012 0.968 0.004 0.016
#> SRR2314023     6  0.0622     0.7896 0.012 0.000 0.008 0.000 0.000 0.980
#> SRR2314033     2  0.3823     0.6320 0.000 0.564 0.436 0.000 0.000 0.000
#> SRR2314045     1  0.0909     0.8520 0.968 0.000 0.012 0.000 0.020 0.000
#> SRR2314042     4  0.3246     0.6600 0.000 0.020 0.052 0.860 0.052 0.016
#> SRR2314043     3  0.7215     0.4778 0.000 0.260 0.352 0.088 0.300 0.000
#> SRR2314041     2  0.5206     0.3881 0.000 0.696 0.108 0.060 0.136 0.000
#> SRR2314044     3  0.7298     0.4555 0.000 0.152 0.424 0.220 0.204 0.000
#> SRR2314040     3  0.5990     0.4769 0.000 0.368 0.400 0.000 0.232 0.000
#> SRR2314039     2  0.4538    -0.2115 0.000 0.612 0.340 0.000 0.048 0.000
#> SRR2314038     5  0.4598     0.1237 0.000 0.000 0.048 0.360 0.592 0.000
#> SRR2314037     3  0.6941     0.4218 0.000 0.116 0.444 0.304 0.136 0.000
#> SRR2314036     2  0.3828     0.6314 0.000 0.560 0.440 0.000 0.000 0.000
#> SRR2314035     3  0.6236     0.4764 0.000 0.296 0.352 0.004 0.348 0.000
#> SRR2314034     3  0.7082     0.4928 0.000 0.144 0.444 0.272 0.140 0.000
#> SRR2314032     1  0.0291     0.8600 0.992 0.000 0.004 0.000 0.004 0.000
#> SRR2314031     4  0.0964     0.6888 0.000 0.000 0.012 0.968 0.004 0.016
#> SRR2314029     4  0.7084     0.1737 0.000 0.132 0.192 0.464 0.212 0.000
#> SRR2314030     5  0.6432    -0.0756 0.000 0.040 0.160 0.368 0.432 0.000
#> SRR2314028     4  0.1874     0.6970 0.000 0.000 0.016 0.928 0.028 0.028
#> SRR2314027     2  0.4538    -0.2115 0.000 0.612 0.340 0.000 0.048 0.000
#> SRR2314026     3  0.5902     0.4764 0.000 0.392 0.404 0.000 0.204 0.000
#> SRR2314020     2  0.3828     0.6314 0.000 0.560 0.440 0.000 0.000 0.000
#> SRR2314019     3  0.7082     0.4928 0.000 0.144 0.444 0.272 0.140 0.000
#> SRR2314021     3  0.7082     0.4928 0.000 0.144 0.444 0.272 0.140 0.000
#> SRR2314018     3  0.6236     0.4764 0.000 0.296 0.352 0.004 0.348 0.000
#> SRR2314017     5  0.4233     0.3529 0.000 0.216 0.060 0.004 0.720 0.000
#> SRR2314016     5  0.4598     0.1237 0.000 0.000 0.048 0.360 0.592 0.000
#> SRR2314014     2  0.1434     0.6461 0.000 0.940 0.012 0.000 0.048 0.000
#> SRR2314013     2  0.5781     0.5200 0.000 0.604 0.212 0.036 0.148 0.000
#> SRR2314012     4  0.1874     0.6970 0.000 0.000 0.016 0.928 0.028 0.028
#> SRR2314011     6  0.0000     0.7927 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314010     2  0.2365     0.6365 0.000 0.888 0.072 0.000 0.040 0.000
#> SRR2314009     3  0.6242     0.4798 0.000 0.304 0.352 0.004 0.340 0.000
#> SRR2314008     3  0.6242     0.4798 0.000 0.304 0.352 0.004 0.340 0.000
#> SRR2314007     2  0.3039     0.5179 0.000 0.848 0.088 0.004 0.060 0.000
#> SRR2314005     2  0.4278     0.6503 0.000 0.712 0.212 0.000 0.076 0.000
#> SRR2314004     2  0.3828     0.6314 0.000 0.560 0.440 0.000 0.000 0.000
#> SRR2314003     6  0.4242     0.4505 0.000 0.000 0.000 0.448 0.016 0.536
#> SRR2314006     2  0.4086     0.6124 0.000 0.528 0.464 0.000 0.008 0.000
#> SRR2314002     5  0.3231     0.4089 0.000 0.200 0.016 0.000 0.784 0.000
#> SRR2314001     2  0.1003     0.6300 0.000 0.964 0.016 0.000 0.020 0.000
#> SRR2314000     5  0.7954    -0.4546 0.072 0.216 0.324 0.036 0.340 0.012
#> SRR2313998     2  0.2383     0.6731 0.000 0.880 0.096 0.000 0.024 0.000
#> SRR2313996     2  0.1049     0.6316 0.000 0.960 0.032 0.000 0.008 0.000
#> SRR2313999     6  0.0363     0.7913 0.000 0.000 0.000 0.000 0.012 0.988
#> SRR2313997     2  0.3828     0.6314 0.000 0.560 0.440 0.000 0.000 0.000
#> SRR2313992     3  0.6856     0.3267 0.000 0.108 0.408 0.364 0.120 0.000
#> SRR2313991     5  0.3488     0.4011 0.000 0.216 0.016 0.004 0.764 0.000
#> SRR2313990     2  0.2740     0.5495 0.000 0.864 0.060 0.000 0.076 0.000
#> SRR2313988     1  0.0291     0.8600 0.992 0.000 0.004 0.000 0.004 0.000
#> SRR2313987     1  0.5493     0.1445 0.480 0.000 0.008 0.052 0.020 0.440
#> SRR2313984     2  0.1049     0.6316 0.000 0.960 0.032 0.000 0.008 0.000
#> SRR2313989     2  0.3828     0.6314 0.000 0.560 0.440 0.000 0.000 0.000
#> SRR2313983     1  0.0146     0.8605 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR2313986     6  0.4175     0.4245 0.000 0.000 0.000 0.464 0.012 0.524
#> SRR2313982     1  0.0146     0.8605 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR2313981     4  0.6658    -0.3916 0.000 0.096 0.388 0.412 0.104 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-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

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 16873 rows and 72 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.889           0.941       0.974         0.4797 0.512   0.512
#> 3 3 0.670           0.772       0.879         0.3454 0.656   0.426
#> 4 4 0.656           0.705       0.823         0.1379 0.828   0.548
#> 5 5 0.652           0.551       0.756         0.0703 0.872   0.579
#> 6 6 0.656           0.542       0.701         0.0427 0.883   0.565

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
#> SRR2313978     2  0.0000      0.991 0.000 1.000
#> SRR2313980     2  0.0000      0.991 0.000 1.000
#> SRR2313979     1  0.0000      0.944 1.000 0.000
#> SRR2313977     2  0.0000      0.991 0.000 1.000
#> SRR2313976     2  0.0000      0.991 0.000 1.000
#> SRR2313975     1  0.0000      0.944 1.000 0.000
#> SRR2313973     1  0.0000      0.944 1.000 0.000
#> SRR2313974     1  0.0000      0.944 1.000 0.000
#> SRR2313985     1  0.0000      0.944 1.000 0.000
#> SRR2313993     2  0.0000      0.991 0.000 1.000
#> SRR2313994     2  0.0000      0.991 0.000 1.000
#> SRR2313995     2  0.0000      0.991 0.000 1.000
#> SRR2314024     2  0.0000      0.991 0.000 1.000
#> SRR2314015     2  0.0000      0.991 0.000 1.000
#> SRR2314025     1  0.0672      0.940 0.992 0.008
#> SRR2314023     1  0.0000      0.944 1.000 0.000
#> SRR2314033     2  0.0000      0.991 0.000 1.000
#> SRR2314045     1  0.0000      0.944 1.000 0.000
#> SRR2314042     1  0.5059      0.867 0.888 0.112
#> SRR2314043     2  0.0000      0.991 0.000 1.000
#> SRR2314041     2  0.0000      0.991 0.000 1.000
#> SRR2314044     2  0.0000      0.991 0.000 1.000
#> SRR2314040     2  0.0000      0.991 0.000 1.000
#> SRR2314039     2  0.0000      0.991 0.000 1.000
#> SRR2314038     2  0.8661      0.559 0.288 0.712
#> SRR2314037     1  0.5059      0.867 0.888 0.112
#> SRR2314036     2  0.0000      0.991 0.000 1.000
#> SRR2314035     2  0.0000      0.991 0.000 1.000
#> SRR2314034     1  0.4815      0.874 0.896 0.104
#> SRR2314032     1  0.0000      0.944 1.000 0.000
#> SRR2314031     1  0.0672      0.940 0.992 0.008
#> SRR2314029     2  0.0000      0.991 0.000 1.000
#> SRR2314030     1  0.9775      0.368 0.588 0.412
#> SRR2314028     1  0.0000      0.944 1.000 0.000
#> SRR2314027     2  0.0000      0.991 0.000 1.000
#> SRR2314026     2  0.0000      0.991 0.000 1.000
#> SRR2314020     2  0.0000      0.991 0.000 1.000
#> SRR2314019     2  0.0000      0.991 0.000 1.000
#> SRR2314021     1  0.9732      0.389 0.596 0.404
#> SRR2314018     2  0.0000      0.991 0.000 1.000
#> SRR2314017     2  0.1184      0.975 0.016 0.984
#> SRR2314016     1  0.0000      0.944 1.000 0.000
#> SRR2314014     2  0.0000      0.991 0.000 1.000
#> SRR2314013     2  0.0000      0.991 0.000 1.000
#> SRR2314012     1  0.0000      0.944 1.000 0.000
#> SRR2314011     1  0.0000      0.944 1.000 0.000
#> SRR2314010     2  0.0000      0.991 0.000 1.000
#> SRR2314009     2  0.0000      0.991 0.000 1.000
#> SRR2314008     2  0.0000      0.991 0.000 1.000
#> SRR2314007     2  0.0000      0.991 0.000 1.000
#> SRR2314005     2  0.0000      0.991 0.000 1.000
#> SRR2314004     2  0.0000      0.991 0.000 1.000
#> SRR2314003     1  0.0000      0.944 1.000 0.000
#> SRR2314006     2  0.0000      0.991 0.000 1.000
#> SRR2314002     2  0.2603      0.945 0.044 0.956
#> SRR2314001     2  0.0000      0.991 0.000 1.000
#> SRR2314000     1  0.8144      0.668 0.748 0.252
#> SRR2313998     2  0.0000      0.991 0.000 1.000
#> SRR2313996     2  0.0000      0.991 0.000 1.000
#> SRR2313999     1  0.0000      0.944 1.000 0.000
#> SRR2313997     2  0.0000      0.991 0.000 1.000
#> SRR2313992     1  0.0672      0.940 0.992 0.008
#> SRR2313991     2  0.0000      0.991 0.000 1.000
#> SRR2313990     2  0.0000      0.991 0.000 1.000
#> SRR2313988     1  0.0000      0.944 1.000 0.000
#> SRR2313987     1  0.0000      0.944 1.000 0.000
#> SRR2313984     2  0.0000      0.991 0.000 1.000
#> SRR2313989     2  0.0000      0.991 0.000 1.000
#> SRR2313983     1  0.0000      0.944 1.000 0.000
#> SRR2313986     1  0.0000      0.944 1.000 0.000
#> SRR2313982     1  0.0000      0.944 1.000 0.000
#> SRR2313981     1  0.5178      0.863 0.884 0.116

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.0237   0.987441 0.000 0.996 0.004
#> SRR2313980     2  0.0237   0.987441 0.000 0.996 0.004
#> SRR2313979     1  0.0000   0.823020 1.000 0.000 0.000
#> SRR2313977     2  0.3267   0.834976 0.000 0.884 0.116
#> SRR2313976     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2313975     1  0.0000   0.823020 1.000 0.000 0.000
#> SRR2313973     1  0.1860   0.829027 0.948 0.000 0.052
#> SRR2313974     1  0.1860   0.829027 0.948 0.000 0.052
#> SRR2313985     1  0.0000   0.823020 1.000 0.000 0.000
#> SRR2313993     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2313994     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2313995     2  0.0237   0.987441 0.000 0.996 0.004
#> SRR2314024     2  0.0237   0.987441 0.000 0.996 0.004
#> SRR2314015     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2314025     1  0.6274   0.502332 0.544 0.000 0.456
#> SRR2314023     1  0.1860   0.829027 0.948 0.000 0.052
#> SRR2314033     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2314045     3  0.6286   0.184028 0.464 0.000 0.536
#> SRR2314042     3  0.0237   0.743254 0.004 0.000 0.996
#> SRR2314043     3  0.1964   0.772325 0.000 0.056 0.944
#> SRR2314041     3  0.5988   0.608687 0.000 0.368 0.632
#> SRR2314044     3  0.1529   0.769211 0.000 0.040 0.960
#> SRR2314040     3  0.5058   0.740437 0.000 0.244 0.756
#> SRR2314039     3  0.6154   0.540789 0.000 0.408 0.592
#> SRR2314038     3  0.1267   0.761019 0.004 0.024 0.972
#> SRR2314037     3  0.0237   0.743254 0.004 0.000 0.996
#> SRR2314036     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2314035     3  0.4654   0.760009 0.000 0.208 0.792
#> SRR2314034     3  0.0237   0.743254 0.004 0.000 0.996
#> SRR2314032     1  0.6260   0.000494 0.552 0.000 0.448
#> SRR2314031     3  0.6291  -0.377801 0.468 0.000 0.532
#> SRR2314029     3  0.1529   0.769211 0.000 0.040 0.960
#> SRR2314030     3  0.1031   0.762103 0.000 0.024 0.976
#> SRR2314028     3  0.0237   0.743254 0.004 0.000 0.996
#> SRR2314027     3  0.6192   0.518651 0.000 0.420 0.580
#> SRR2314026     3  0.4974   0.746611 0.000 0.236 0.764
#> SRR2314020     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2314019     3  0.1860   0.772117 0.000 0.052 0.948
#> SRR2314021     3  0.1267   0.760868 0.004 0.024 0.972
#> SRR2314018     3  0.4605   0.761086 0.000 0.204 0.796
#> SRR2314017     3  0.3816   0.769673 0.000 0.148 0.852
#> SRR2314016     1  0.6225   0.546701 0.568 0.000 0.432
#> SRR2314014     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2314013     2  0.1860   0.926770 0.000 0.948 0.052
#> SRR2314012     1  0.6192   0.564948 0.580 0.000 0.420
#> SRR2314011     1  0.1860   0.829027 0.948 0.000 0.052
#> SRR2314010     2  0.0237   0.987441 0.000 0.996 0.004
#> SRR2314009     3  0.1964   0.772325 0.000 0.056 0.944
#> SRR2314008     3  0.5948   0.624394 0.000 0.360 0.640
#> SRR2314007     3  0.6154   0.548928 0.000 0.408 0.592
#> SRR2314005     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2314004     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2314003     1  0.6168   0.574095 0.588 0.000 0.412
#> SRR2314006     2  0.0237   0.987441 0.000 0.996 0.004
#> SRR2314002     3  0.5115   0.761043 0.016 0.188 0.796
#> SRR2314001     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2314000     3  0.2804   0.744975 0.060 0.016 0.924
#> SRR2313998     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2313996     3  0.5968   0.614572 0.000 0.364 0.636
#> SRR2313999     1  0.1860   0.829027 0.948 0.000 0.052
#> SRR2313997     2  0.0000   0.988543 0.000 1.000 0.000
#> SRR2313992     3  0.0237   0.743254 0.004 0.000 0.996
#> SRR2313991     3  0.5905   0.634448 0.000 0.352 0.648
#> SRR2313990     3  0.5968   0.619219 0.000 0.364 0.636
#> SRR2313988     1  0.0000   0.823020 1.000 0.000 0.000
#> SRR2313987     1  0.1860   0.829027 0.948 0.000 0.052
#> SRR2313984     2  0.0237   0.987441 0.000 0.996 0.004
#> SRR2313989     2  0.0237   0.987441 0.000 0.996 0.004
#> SRR2313983     1  0.0000   0.823020 1.000 0.000 0.000
#> SRR2313986     1  0.6180   0.569758 0.584 0.000 0.416
#> SRR2313982     1  0.0000   0.823020 1.000 0.000 0.000
#> SRR2313981     3  0.0237   0.743254 0.004 0.000 0.996

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     3  0.5050     0.0401 0.000 0.408 0.588 0.004
#> SRR2313980     2  0.1211     0.8414 0.000 0.960 0.000 0.040
#> SRR2313979     1  0.0000     0.8268 1.000 0.000 0.000 0.000
#> SRR2313977     3  0.4331     0.4221 0.000 0.288 0.712 0.000
#> SRR2313976     2  0.0000     0.8503 0.000 1.000 0.000 0.000
#> SRR2313975     1  0.0921     0.8164 0.972 0.000 0.000 0.028
#> SRR2313973     1  0.4387     0.7996 0.752 0.000 0.012 0.236
#> SRR2313974     1  0.4262     0.8002 0.756 0.000 0.008 0.236
#> SRR2313985     1  0.1022     0.8285 0.968 0.000 0.000 0.032
#> SRR2313993     2  0.1867     0.8424 0.000 0.928 0.072 0.000
#> SRR2313994     2  0.4925     0.4394 0.000 0.572 0.428 0.000
#> SRR2313995     2  0.3266     0.8356 0.000 0.876 0.084 0.040
#> SRR2314024     2  0.1211     0.8414 0.000 0.960 0.000 0.040
#> SRR2314015     2  0.2469     0.8287 0.000 0.892 0.108 0.000
#> SRR2314025     4  0.4290     0.6154 0.164 0.000 0.036 0.800
#> SRR2314023     1  0.4387     0.7996 0.752 0.000 0.012 0.236
#> SRR2314033     2  0.0000     0.8503 0.000 1.000 0.000 0.000
#> SRR2314045     1  0.5174     0.6264 0.760 0.000 0.116 0.124
#> SRR2314042     4  0.4304     0.6852 0.000 0.000 0.284 0.716
#> SRR2314043     3  0.2281     0.7846 0.000 0.000 0.904 0.096
#> SRR2314041     3  0.1389     0.8015 0.000 0.048 0.952 0.000
#> SRR2314044     4  0.4877     0.6016 0.000 0.000 0.408 0.592
#> SRR2314040     3  0.2179     0.8011 0.000 0.012 0.924 0.064
#> SRR2314039     3  0.1576     0.8016 0.000 0.048 0.948 0.004
#> SRR2314038     3  0.5000    -0.2358 0.000 0.000 0.500 0.500
#> SRR2314037     4  0.4624     0.6344 0.000 0.000 0.340 0.660
#> SRR2314036     2  0.0000     0.8503 0.000 1.000 0.000 0.000
#> SRR2314035     3  0.2867     0.7958 0.000 0.012 0.884 0.104
#> SRR2314034     4  0.4454     0.6716 0.000 0.000 0.308 0.692
#> SRR2314032     1  0.4764     0.6587 0.788 0.000 0.088 0.124
#> SRR2314031     4  0.4290     0.6154 0.164 0.000 0.036 0.800
#> SRR2314029     4  0.4866     0.6099 0.000 0.000 0.404 0.596
#> SRR2314030     4  0.4454     0.6690 0.000 0.000 0.308 0.692
#> SRR2314028     4  0.2760     0.7052 0.000 0.000 0.128 0.872
#> SRR2314027     3  0.1389     0.8015 0.000 0.048 0.952 0.000
#> SRR2314026     3  0.2610     0.7934 0.000 0.012 0.900 0.088
#> SRR2314020     2  0.0000     0.8503 0.000 1.000 0.000 0.000
#> SRR2314019     3  0.4406     0.4778 0.000 0.000 0.700 0.300
#> SRR2314021     3  0.4431     0.4701 0.000 0.000 0.696 0.304
#> SRR2314018     3  0.2676     0.7994 0.000 0.012 0.896 0.092
#> SRR2314017     3  0.2976     0.7901 0.000 0.008 0.872 0.120
#> SRR2314016     4  0.4244     0.6173 0.160 0.000 0.036 0.804
#> SRR2314014     2  0.4907     0.4564 0.000 0.580 0.420 0.000
#> SRR2314013     2  0.4933     0.4268 0.000 0.568 0.432 0.000
#> SRR2314012     4  0.4197     0.6198 0.156 0.000 0.036 0.808
#> SRR2314011     1  0.4420     0.7971 0.748 0.000 0.012 0.240
#> SRR2314010     2  0.3198     0.8372 0.000 0.880 0.080 0.040
#> SRR2314009     3  0.2281     0.7846 0.000 0.000 0.904 0.096
#> SRR2314008     3  0.1389     0.8015 0.000 0.048 0.952 0.000
#> SRR2314007     3  0.1389     0.8015 0.000 0.048 0.952 0.000
#> SRR2314005     2  0.2530     0.8008 0.000 0.888 0.112 0.000
#> SRR2314004     2  0.0000     0.8503 0.000 1.000 0.000 0.000
#> SRR2314003     4  0.3545     0.5606 0.164 0.000 0.008 0.828
#> SRR2314006     2  0.1211     0.8414 0.000 0.960 0.000 0.040
#> SRR2314002     3  0.3188     0.7920 0.008 0.008 0.872 0.112
#> SRR2314001     2  0.4941     0.4209 0.000 0.564 0.436 0.000
#> SRR2314000     3  0.5604     0.6229 0.160 0.000 0.724 0.116
#> SRR2313998     2  0.4643     0.5817 0.000 0.656 0.344 0.000
#> SRR2313996     3  0.1474     0.7991 0.000 0.052 0.948 0.000
#> SRR2313999     1  0.4420     0.7971 0.748 0.000 0.012 0.240
#> SRR2313997     2  0.0000     0.8503 0.000 1.000 0.000 0.000
#> SRR2313992     4  0.4431     0.6749 0.000 0.000 0.304 0.696
#> SRR2313991     3  0.3056     0.8030 0.000 0.040 0.888 0.072
#> SRR2313990     3  0.1389     0.8015 0.000 0.048 0.952 0.000
#> SRR2313988     1  0.2281     0.7719 0.904 0.000 0.000 0.096
#> SRR2313987     1  0.4295     0.7985 0.752 0.000 0.008 0.240
#> SRR2313984     2  0.1867     0.8424 0.000 0.928 0.072 0.000
#> SRR2313989     2  0.1211     0.8414 0.000 0.960 0.000 0.040
#> SRR2313983     1  0.0000     0.8268 1.000 0.000 0.000 0.000
#> SRR2313986     4  0.3545     0.5606 0.164 0.000 0.008 0.828
#> SRR2313982     1  0.0000     0.8268 1.000 0.000 0.000 0.000
#> SRR2313981     4  0.4661     0.6224 0.000 0.000 0.348 0.652

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     3  0.2674     0.6358 0.000 0.120 0.868 0.000 0.012
#> SRR2313980     2  0.2011     0.8236 0.000 0.908 0.000 0.004 0.088
#> SRR2313979     1  0.4249     0.4575 0.568 0.000 0.000 0.000 0.432
#> SRR2313977     3  0.4171     0.6155 0.000 0.112 0.784 0.000 0.104
#> SRR2313976     2  0.0693     0.8359 0.000 0.980 0.012 0.000 0.008
#> SRR2313975     1  0.4450     0.3238 0.508 0.000 0.004 0.000 0.488
#> SRR2313973     1  0.0000     0.6602 1.000 0.000 0.000 0.000 0.000
#> SRR2313974     1  0.1851     0.6659 0.912 0.000 0.000 0.000 0.088
#> SRR2313985     1  0.4201     0.4829 0.592 0.000 0.000 0.000 0.408
#> SRR2313993     2  0.4297     0.6315 0.000 0.692 0.288 0.000 0.020
#> SRR2313994     3  0.4530     0.2385 0.000 0.376 0.612 0.004 0.008
#> SRR2313995     2  0.5036     0.7191 0.000 0.704 0.200 0.004 0.092
#> SRR2314024     2  0.2011     0.8236 0.000 0.908 0.000 0.004 0.088
#> SRR2314015     2  0.3992     0.6575 0.000 0.720 0.268 0.000 0.012
#> SRR2314025     4  0.3727     0.6558 0.216 0.000 0.000 0.768 0.016
#> SRR2314023     1  0.0000     0.6602 1.000 0.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000     0.8375 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     5  0.4289     0.2969 0.192 0.000 0.024 0.020 0.764
#> SRR2314042     4  0.0693     0.7260 0.000 0.000 0.008 0.980 0.012
#> SRR2314043     3  0.6183     0.3948 0.000 0.000 0.544 0.180 0.276
#> SRR2314041     3  0.1442     0.6632 0.000 0.004 0.952 0.032 0.012
#> SRR2314044     4  0.4393     0.6617 0.000 0.000 0.168 0.756 0.076
#> SRR2314040     3  0.3460     0.6239 0.000 0.000 0.828 0.044 0.128
#> SRR2314039     3  0.2722     0.6320 0.000 0.000 0.872 0.108 0.020
#> SRR2314038     4  0.6678     0.2042 0.000 0.000 0.264 0.436 0.300
#> SRR2314037     4  0.3366     0.6948 0.000 0.000 0.140 0.828 0.032
#> SRR2314036     2  0.0290     0.8369 0.000 0.992 0.000 0.000 0.008
#> SRR2314035     3  0.4687     0.4737 0.000 0.000 0.636 0.028 0.336
#> SRR2314034     4  0.2659     0.7132 0.000 0.000 0.052 0.888 0.060
#> SRR2314032     5  0.4422     0.2484 0.232 0.000 0.016 0.020 0.732
#> SRR2314031     4  0.3727     0.6558 0.216 0.000 0.000 0.768 0.016
#> SRR2314029     4  0.4277     0.6706 0.000 0.000 0.156 0.768 0.076
#> SRR2314030     4  0.1082     0.7251 0.000 0.000 0.008 0.964 0.028
#> SRR2314028     4  0.0912     0.7233 0.016 0.000 0.000 0.972 0.012
#> SRR2314027     3  0.1956     0.6500 0.000 0.000 0.916 0.076 0.008
#> SRR2314026     3  0.4634     0.5782 0.000 0.000 0.744 0.136 0.120
#> SRR2314020     2  0.0324     0.8375 0.000 0.992 0.000 0.004 0.004
#> SRR2314019     4  0.6002     0.1940 0.000 0.000 0.392 0.492 0.116
#> SRR2314021     4  0.6054     0.2086 0.000 0.000 0.380 0.496 0.124
#> SRR2314018     3  0.4671     0.4756 0.000 0.000 0.640 0.028 0.332
#> SRR2314017     3  0.5143     0.4165 0.000 0.000 0.584 0.048 0.368
#> SRR2314016     4  0.3663     0.6614 0.208 0.000 0.000 0.776 0.016
#> SRR2314014     3  0.4494     0.2225 0.000 0.380 0.608 0.000 0.012
#> SRR2314013     3  0.5568     0.1995 0.000 0.384 0.540 0.000 0.076
#> SRR2314012     4  0.3530     0.6633 0.204 0.000 0.000 0.784 0.012
#> SRR2314011     1  0.0000     0.6602 1.000 0.000 0.000 0.000 0.000
#> SRR2314010     2  0.5844     0.5555 0.000 0.556 0.344 0.004 0.096
#> SRR2314009     3  0.4587     0.5700 0.000 0.000 0.744 0.096 0.160
#> SRR2314008     3  0.2280     0.6332 0.000 0.000 0.880 0.000 0.120
#> SRR2314007     3  0.1041     0.6637 0.000 0.000 0.964 0.032 0.004
#> SRR2314005     2  0.4923     0.5619 0.000 0.700 0.212 0.000 0.088
#> SRR2314004     2  0.0609     0.8360 0.000 0.980 0.000 0.000 0.020
#> SRR2314003     4  0.4626     0.5161 0.364 0.000 0.000 0.616 0.020
#> SRR2314006     2  0.2011     0.8236 0.000 0.908 0.000 0.004 0.088
#> SRR2314002     3  0.5167     0.3669 0.000 0.000 0.552 0.044 0.404
#> SRR2314001     3  0.4607     0.2545 0.000 0.368 0.616 0.004 0.012
#> SRR2314000     5  0.6118    -0.3628 0.020 0.000 0.448 0.072 0.460
#> SRR2313998     3  0.4781     0.0718 0.000 0.428 0.552 0.000 0.020
#> SRR2313996     3  0.1492     0.6623 0.000 0.004 0.948 0.040 0.008
#> SRR2313999     1  0.0000     0.6602 1.000 0.000 0.000 0.000 0.000
#> SRR2313997     2  0.0404     0.8365 0.000 0.988 0.000 0.000 0.012
#> SRR2313992     4  0.1300     0.7258 0.000 0.000 0.028 0.956 0.016
#> SRR2313991     3  0.4696     0.4516 0.000 0.000 0.616 0.024 0.360
#> SRR2313990     3  0.1281     0.6639 0.000 0.000 0.956 0.032 0.012
#> SRR2313988     5  0.4892    -0.4903 0.488 0.000 0.004 0.016 0.492
#> SRR2313987     1  0.1851     0.6659 0.912 0.000 0.000 0.000 0.088
#> SRR2313984     2  0.4839     0.6347 0.000 0.668 0.288 0.004 0.040
#> SRR2313989     2  0.1892     0.8254 0.000 0.916 0.000 0.004 0.080
#> SRR2313983     1  0.4256     0.4569 0.564 0.000 0.000 0.000 0.436
#> SRR2313986     4  0.4538     0.5176 0.364 0.000 0.000 0.620 0.016
#> SRR2313982     1  0.4256     0.4569 0.564 0.000 0.000 0.000 0.436
#> SRR2313981     4  0.3193     0.6974 0.000 0.000 0.132 0.840 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
#> SRR2313978     2  0.3430     0.5641 0.000 0.836 0.076 0.000 0.028 0.060
#> SRR2313980     6  0.3725     0.7988 0.000 0.008 0.060 0.000 0.140 0.792
#> SRR2313979     1  0.0000     0.5785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.5285     0.2102 0.000 0.596 0.316 0.000 0.040 0.048
#> SRR2313976     6  0.1901     0.8107 0.000 0.028 0.008 0.000 0.040 0.924
#> SRR2313975     1  0.1802     0.5854 0.916 0.000 0.072 0.000 0.012 0.000
#> SRR2313973     5  0.4250     0.9878 0.456 0.000 0.016 0.000 0.528 0.000
#> SRR2313974     1  0.4379    -0.6713 0.576 0.000 0.004 0.020 0.400 0.000
#> SRR2313985     1  0.2039     0.4747 0.904 0.000 0.020 0.000 0.076 0.000
#> SRR2313993     2  0.4467     0.2106 0.000 0.508 0.000 0.000 0.028 0.464
#> SRR2313994     2  0.3813     0.5887 0.000 0.736 0.008 0.000 0.020 0.236
#> SRR2313995     6  0.6779     0.2790 0.000 0.308 0.068 0.000 0.180 0.444
#> SRR2314024     6  0.3478     0.8055 0.000 0.008 0.060 0.000 0.116 0.816
#> SRR2314015     2  0.5168     0.1867 0.000 0.480 0.020 0.000 0.044 0.456
#> SRR2314025     4  0.3231     0.6296 0.008 0.000 0.012 0.800 0.180 0.000
#> SRR2314023     5  0.4250     0.9878 0.456 0.000 0.016 0.000 0.528 0.000
#> SRR2314033     6  0.1116     0.8323 0.000 0.004 0.008 0.000 0.028 0.960
#> SRR2314045     1  0.4674     0.4231 0.600 0.000 0.356 0.012 0.032 0.000
#> SRR2314042     4  0.1767     0.6887 0.000 0.012 0.036 0.932 0.020 0.000
#> SRR2314043     3  0.6610     0.4470 0.000 0.308 0.480 0.132 0.080 0.000
#> SRR2314041     2  0.1713     0.5549 0.000 0.928 0.044 0.000 0.028 0.000
#> SRR2314044     4  0.6180     0.5770 0.000 0.160 0.108 0.600 0.132 0.000
#> SRR2314040     2  0.4145     0.3009 0.000 0.724 0.220 0.004 0.052 0.000
#> SRR2314039     2  0.4235     0.4386 0.000 0.784 0.072 0.076 0.068 0.000
#> SRR2314038     3  0.5746     0.4570 0.000 0.092 0.612 0.236 0.060 0.000
#> SRR2314037     4  0.5545     0.6186 0.000 0.168 0.072 0.660 0.100 0.000
#> SRR2314036     6  0.0603     0.8365 0.000 0.000 0.004 0.000 0.016 0.980
#> SRR2314035     3  0.3489     0.7635 0.000 0.288 0.708 0.000 0.004 0.000
#> SRR2314034     4  0.5288     0.6370 0.000 0.104 0.092 0.696 0.108 0.000
#> SRR2314032     1  0.4570     0.4286 0.608 0.000 0.352 0.008 0.032 0.000
#> SRR2314031     4  0.3264     0.6291 0.008 0.000 0.012 0.796 0.184 0.000
#> SRR2314029     4  0.6249     0.5772 0.000 0.156 0.108 0.592 0.144 0.000
#> SRR2314030     4  0.3666     0.6742 0.000 0.048 0.060 0.824 0.068 0.000
#> SRR2314028     4  0.1204     0.6818 0.000 0.000 0.000 0.944 0.056 0.000
#> SRR2314027     2  0.2831     0.5167 0.000 0.876 0.052 0.028 0.044 0.000
#> SRR2314026     2  0.5727     0.2505 0.000 0.648 0.156 0.100 0.096 0.000
#> SRR2314020     6  0.0551     0.8378 0.000 0.004 0.008 0.000 0.004 0.984
#> SRR2314019     4  0.7094     0.2871 0.000 0.340 0.148 0.392 0.120 0.000
#> SRR2314021     4  0.7109     0.2940 0.000 0.332 0.152 0.396 0.120 0.000
#> SRR2314018     3  0.3528     0.7567 0.000 0.296 0.700 0.000 0.004 0.000
#> SRR2314017     3  0.3151     0.7798 0.000 0.252 0.748 0.000 0.000 0.000
#> SRR2314016     4  0.3187     0.6321 0.004 0.000 0.012 0.796 0.188 0.000
#> SRR2314014     2  0.4484     0.5691 0.000 0.696 0.020 0.000 0.040 0.244
#> SRR2314013     2  0.5981     0.5220 0.000 0.588 0.116 0.000 0.060 0.236
#> SRR2314012     4  0.2482     0.6419 0.004 0.000 0.000 0.848 0.148 0.000
#> SRR2314011     5  0.4246     0.9867 0.452 0.000 0.016 0.000 0.532 0.000
#> SRR2314010     2  0.6261     0.2810 0.000 0.544 0.064 0.000 0.128 0.264
#> SRR2314009     2  0.5897    -0.0824 0.000 0.568 0.288 0.060 0.084 0.000
#> SRR2314008     2  0.4159    -0.0659 0.000 0.588 0.396 0.000 0.016 0.000
#> SRR2314007     2  0.2221     0.5244 0.000 0.896 0.072 0.000 0.032 0.000
#> SRR2314005     6  0.5404     0.4802 0.000 0.156 0.128 0.000 0.048 0.668
#> SRR2314004     6  0.1334     0.8225 0.000 0.020 0.000 0.000 0.032 0.948
#> SRR2314003     4  0.4274     0.4389 0.008 0.000 0.012 0.600 0.380 0.000
#> SRR2314006     6  0.3763     0.7963 0.000 0.008 0.060 0.000 0.144 0.788
#> SRR2314002     3  0.2703     0.7561 0.000 0.172 0.824 0.000 0.004 0.000
#> SRR2314001     2  0.3998     0.5884 0.000 0.728 0.016 0.000 0.020 0.236
#> SRR2314000     3  0.3234     0.7271 0.028 0.120 0.836 0.012 0.004 0.000
#> SRR2313998     2  0.4482     0.5348 0.000 0.664 0.012 0.000 0.036 0.288
#> SRR2313996     2  0.1789     0.5568 0.000 0.924 0.044 0.000 0.032 0.000
#> SRR2313999     5  0.3975     0.9762 0.452 0.000 0.004 0.000 0.544 0.000
#> SRR2313997     6  0.0363     0.8356 0.000 0.000 0.000 0.000 0.012 0.988
#> SRR2313992     4  0.3320     0.6851 0.000 0.032 0.048 0.844 0.076 0.000
#> SRR2313991     3  0.3266     0.7710 0.000 0.272 0.728 0.000 0.000 0.000
#> SRR2313990     2  0.1753     0.5333 0.000 0.912 0.084 0.000 0.004 0.000
#> SRR2313988     1  0.2468     0.5779 0.880 0.000 0.096 0.008 0.016 0.000
#> SRR2313987     1  0.4371    -0.6642 0.580 0.000 0.004 0.020 0.396 0.000
#> SRR2313984     2  0.5484     0.2329 0.000 0.504 0.032 0.000 0.056 0.408
#> SRR2313989     6  0.3002     0.8166 0.000 0.004 0.048 0.000 0.100 0.848
#> SRR2313983     1  0.0000     0.5785 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.4274     0.4389 0.008 0.000 0.012 0.600 0.380 0.000
#> SRR2313982     1  0.0260     0.5779 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR2313981     4  0.5568     0.6095 0.000 0.176 0.076 0.656 0.092 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-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

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 16873 rows and 72 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.887           0.932       0.970         0.5047 0.495   0.495
#> 3 3 0.719           0.785       0.896         0.2742 0.802   0.619
#> 4 4 0.772           0.736       0.872         0.1260 0.832   0.570
#> 5 5 0.798           0.743       0.881         0.0590 0.919   0.725
#> 6 6 0.733           0.585       0.796         0.0385 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
#> SRR2313978     2   0.000      0.973 0.000 1.000
#> SRR2313980     2   0.000      0.973 0.000 1.000
#> SRR2313979     1   0.000      0.962 1.000 0.000
#> SRR2313977     2   0.000      0.973 0.000 1.000
#> SRR2313976     2   0.000      0.973 0.000 1.000
#> SRR2313975     1   0.000      0.962 1.000 0.000
#> SRR2313973     1   0.000      0.962 1.000 0.000
#> SRR2313974     1   0.000      0.962 1.000 0.000
#> SRR2313985     1   0.000      0.962 1.000 0.000
#> SRR2313993     2   0.000      0.973 0.000 1.000
#> SRR2313994     2   0.000      0.973 0.000 1.000
#> SRR2313995     2   0.000      0.973 0.000 1.000
#> SRR2314024     2   0.000      0.973 0.000 1.000
#> SRR2314015     2   0.000      0.973 0.000 1.000
#> SRR2314025     1   0.000      0.962 1.000 0.000
#> SRR2314023     1   0.000      0.962 1.000 0.000
#> SRR2314033     2   0.000      0.973 0.000 1.000
#> SRR2314045     1   0.000      0.962 1.000 0.000
#> SRR2314042     1   0.000      0.962 1.000 0.000
#> SRR2314043     1   0.745      0.755 0.788 0.212
#> SRR2314041     2   0.000      0.973 0.000 1.000
#> SRR2314044     1   0.722      0.770 0.800 0.200
#> SRR2314040     2   0.000      0.973 0.000 1.000
#> SRR2314039     2   0.000      0.973 0.000 1.000
#> SRR2314038     1   0.000      0.962 1.000 0.000
#> SRR2314037     1   0.000      0.962 1.000 0.000
#> SRR2314036     2   0.000      0.973 0.000 1.000
#> SRR2314035     2   0.242      0.939 0.040 0.960
#> SRR2314034     1   0.000      0.962 1.000 0.000
#> SRR2314032     1   0.000      0.962 1.000 0.000
#> SRR2314031     1   0.000      0.962 1.000 0.000
#> SRR2314029     1   0.738      0.762 0.792 0.208
#> SRR2314030     1   0.456      0.885 0.904 0.096
#> SRR2314028     1   0.000      0.962 1.000 0.000
#> SRR2314027     2   0.000      0.973 0.000 1.000
#> SRR2314026     2   0.000      0.973 0.000 1.000
#> SRR2314020     2   0.000      0.973 0.000 1.000
#> SRR2314019     1   0.958      0.434 0.620 0.380
#> SRR2314021     1   0.541      0.857 0.876 0.124
#> SRR2314018     2   0.295      0.927 0.052 0.948
#> SRR2314017     2   0.722      0.751 0.200 0.800
#> SRR2314016     1   0.000      0.962 1.000 0.000
#> SRR2314014     2   0.000      0.973 0.000 1.000
#> SRR2314013     2   0.000      0.973 0.000 1.000
#> SRR2314012     1   0.000      0.962 1.000 0.000
#> SRR2314011     1   0.000      0.962 1.000 0.000
#> SRR2314010     2   0.000      0.973 0.000 1.000
#> SRR2314009     2   0.985      0.180 0.428 0.572
#> SRR2314008     2   0.000      0.973 0.000 1.000
#> SRR2314007     2   0.000      0.973 0.000 1.000
#> SRR2314005     2   0.000      0.973 0.000 1.000
#> SRR2314004     2   0.000      0.973 0.000 1.000
#> SRR2314003     1   0.000      0.962 1.000 0.000
#> SRR2314006     2   0.000      0.973 0.000 1.000
#> SRR2314002     2   0.722      0.751 0.200 0.800
#> SRR2314001     2   0.000      0.973 0.000 1.000
#> SRR2314000     1   0.000      0.962 1.000 0.000
#> SRR2313998     2   0.000      0.973 0.000 1.000
#> SRR2313996     2   0.000      0.973 0.000 1.000
#> SRR2313999     1   0.000      0.962 1.000 0.000
#> SRR2313997     2   0.000      0.973 0.000 1.000
#> SRR2313992     1   0.000      0.962 1.000 0.000
#> SRR2313991     2   0.000      0.973 0.000 1.000
#> SRR2313990     2   0.000      0.973 0.000 1.000
#> SRR2313988     1   0.000      0.962 1.000 0.000
#> SRR2313987     1   0.000      0.962 1.000 0.000
#> SRR2313984     2   0.000      0.973 0.000 1.000
#> SRR2313989     2   0.000      0.973 0.000 1.000
#> SRR2313983     1   0.000      0.962 1.000 0.000
#> SRR2313986     1   0.000      0.962 1.000 0.000
#> SRR2313982     1   0.000      0.962 1.000 0.000
#> SRR2313981     1   0.000      0.962 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313980     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313979     1  0.6260      0.307 0.552 0.000 0.448
#> SRR2313977     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313976     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313975     1  0.6235      0.331 0.564 0.000 0.436
#> SRR2313973     3  0.3686      0.758 0.140 0.000 0.860
#> SRR2313974     3  0.4555      0.697 0.200 0.000 0.800
#> SRR2313985     1  0.6286      0.262 0.536 0.000 0.464
#> SRR2313993     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313994     2  0.0424      0.980 0.008 0.992 0.000
#> SRR2313995     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314024     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314015     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314025     3  0.0000      0.836 0.000 0.000 1.000
#> SRR2314023     3  0.4555      0.697 0.200 0.000 0.800
#> SRR2314033     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314045     1  0.2537      0.670 0.920 0.000 0.080
#> SRR2314042     3  0.2066      0.823 0.060 0.000 0.940
#> SRR2314043     3  0.8373      0.223 0.388 0.088 0.524
#> SRR2314041     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314044     3  0.2625      0.784 0.000 0.084 0.916
#> SRR2314040     1  0.4555      0.575 0.800 0.200 0.000
#> SRR2314039     2  0.0892      0.969 0.020 0.980 0.000
#> SRR2314038     3  0.3412      0.772 0.124 0.000 0.876
#> SRR2314037     3  0.2165      0.821 0.064 0.000 0.936
#> SRR2314036     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314035     1  0.3038      0.641 0.896 0.104 0.000
#> SRR2314034     3  0.2537      0.813 0.080 0.000 0.920
#> SRR2314032     1  0.2537      0.670 0.920 0.000 0.080
#> SRR2314031     3  0.0000      0.836 0.000 0.000 1.000
#> SRR2314029     3  0.3551      0.727 0.000 0.132 0.868
#> SRR2314030     3  0.4002      0.748 0.160 0.000 0.840
#> SRR2314028     3  0.0000      0.836 0.000 0.000 1.000
#> SRR2314027     2  0.0424      0.980 0.008 0.992 0.000
#> SRR2314026     1  0.6308     -0.101 0.508 0.492 0.000
#> SRR2314020     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314019     3  0.7720      0.548 0.208 0.120 0.672
#> SRR2314021     3  0.4978      0.686 0.216 0.004 0.780
#> SRR2314018     1  0.3375      0.645 0.892 0.100 0.008
#> SRR2314017     1  0.4636      0.619 0.848 0.036 0.116
#> SRR2314016     3  0.0892      0.830 0.020 0.000 0.980
#> SRR2314014     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314013     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314012     3  0.0000      0.836 0.000 0.000 1.000
#> SRR2314011     3  0.3686      0.758 0.140 0.000 0.860
#> SRR2314010     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314009     1  0.6144      0.574 0.780 0.132 0.088
#> SRR2314008     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314007     2  0.0424      0.980 0.008 0.992 0.000
#> SRR2314005     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314004     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314003     3  0.0000      0.836 0.000 0.000 1.000
#> SRR2314006     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2314002     1  0.2448      0.670 0.924 0.000 0.076
#> SRR2314001     2  0.0237      0.982 0.004 0.996 0.000
#> SRR2314000     1  0.4002      0.645 0.840 0.000 0.160
#> SRR2313998     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313996     2  0.0424      0.980 0.008 0.992 0.000
#> SRR2313999     3  0.4555      0.697 0.200 0.000 0.800
#> SRR2313997     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313992     3  0.1964      0.825 0.056 0.000 0.944
#> SRR2313991     2  0.5254      0.624 0.264 0.736 0.000
#> SRR2313990     2  0.2878      0.884 0.096 0.904 0.000
#> SRR2313988     1  0.3879      0.650 0.848 0.000 0.152
#> SRR2313987     3  0.4702      0.679 0.212 0.000 0.788
#> SRR2313984     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313989     2  0.0000      0.985 0.000 1.000 0.000
#> SRR2313983     1  0.6260      0.307 0.552 0.000 0.448
#> SRR2313986     3  0.0000      0.836 0.000 0.000 1.000
#> SRR2313982     1  0.6267      0.297 0.548 0.000 0.452
#> SRR2313981     3  0.2537      0.813 0.080 0.000 0.920

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2313980     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2313979     1  0.1867     0.7795 0.928 0.000 0.000 0.072
#> SRR2313977     2  0.1557     0.8942 0.000 0.944 0.056 0.000
#> SRR2313976     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2313975     1  0.1389     0.7704 0.952 0.000 0.000 0.048
#> SRR2313973     1  0.4961     0.4243 0.552 0.000 0.000 0.448
#> SRR2313974     1  0.4072     0.7224 0.748 0.000 0.000 0.252
#> SRR2313985     1  0.2081     0.7793 0.916 0.000 0.000 0.084
#> SRR2313993     2  0.0188     0.9353 0.000 0.996 0.004 0.000
#> SRR2313994     2  0.2081     0.8714 0.000 0.916 0.084 0.000
#> SRR2313995     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314024     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314015     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314025     4  0.0336     0.9395 0.008 0.000 0.000 0.992
#> SRR2314023     1  0.4250     0.7021 0.724 0.000 0.000 0.276
#> SRR2314033     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314045     1  0.1356     0.7299 0.960 0.000 0.032 0.008
#> SRR2314042     4  0.0469     0.9342 0.000 0.000 0.012 0.988
#> SRR2314043     3  0.7309     0.3467 0.112 0.020 0.556 0.312
#> SRR2314041     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314044     4  0.1398     0.9095 0.000 0.040 0.004 0.956
#> SRR2314040     3  0.1489     0.6084 0.044 0.004 0.952 0.000
#> SRR2314039     2  0.5193     0.2847 0.000 0.580 0.412 0.008
#> SRR2314038     1  0.5570     0.3429 0.540 0.000 0.020 0.440
#> SRR2314037     4  0.0524     0.9371 0.004 0.000 0.008 0.988
#> SRR2314036     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314035     3  0.3123     0.5748 0.156 0.000 0.844 0.000
#> SRR2314034     4  0.2888     0.8420 0.004 0.000 0.124 0.872
#> SRR2314032     1  0.1356     0.7299 0.960 0.000 0.032 0.008
#> SRR2314031     4  0.0336     0.9395 0.008 0.000 0.000 0.992
#> SRR2314029     4  0.1743     0.8905 0.000 0.056 0.004 0.940
#> SRR2314030     4  0.3249     0.7865 0.008 0.000 0.140 0.852
#> SRR2314028     4  0.0336     0.9395 0.008 0.000 0.000 0.992
#> SRR2314027     2  0.4872     0.4294 0.000 0.640 0.356 0.004
#> SRR2314026     3  0.3651     0.5954 0.012 0.136 0.844 0.008
#> SRR2314020     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314019     3  0.5463    -0.0174 0.008 0.004 0.504 0.484
#> SRR2314021     3  0.5295    -0.0289 0.008 0.000 0.504 0.488
#> SRR2314018     3  0.3355     0.5733 0.160 0.004 0.836 0.000
#> SRR2314017     3  0.6116     0.4691 0.220 0.000 0.668 0.112
#> SRR2314016     4  0.3024     0.7607 0.148 0.000 0.000 0.852
#> SRR2314014     2  0.1022     0.9176 0.000 0.968 0.032 0.000
#> SRR2314013     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314012     4  0.0469     0.9385 0.012 0.000 0.000 0.988
#> SRR2314011     1  0.4996     0.3286 0.516 0.000 0.000 0.484
#> SRR2314010     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314009     3  0.0707     0.6080 0.020 0.000 0.980 0.000
#> SRR2314008     3  0.5511     0.0736 0.016 0.484 0.500 0.000
#> SRR2314007     2  0.4624     0.4678 0.000 0.660 0.340 0.000
#> SRR2314005     2  0.0188     0.9349 0.000 0.996 0.004 0.000
#> SRR2314004     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314003     4  0.1302     0.9130 0.044 0.000 0.000 0.956
#> SRR2314006     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2314002     1  0.4994    -0.0534 0.520 0.000 0.480 0.000
#> SRR2314001     2  0.1792     0.8894 0.000 0.932 0.068 0.000
#> SRR2314000     1  0.0592     0.7355 0.984 0.000 0.016 0.000
#> SRR2313998     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2313996     2  0.1940     0.8800 0.000 0.924 0.076 0.000
#> SRR2313999     1  0.4304     0.6941 0.716 0.000 0.000 0.284
#> SRR2313997     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2313992     4  0.0188     0.9390 0.004 0.000 0.000 0.996
#> SRR2313991     3  0.6442     0.2189 0.068 0.440 0.492 0.000
#> SRR2313990     3  0.4746     0.3247 0.000 0.368 0.632 0.000
#> SRR2313988     1  0.0707     0.7556 0.980 0.000 0.000 0.020
#> SRR2313987     1  0.4040     0.7251 0.752 0.000 0.000 0.248
#> SRR2313984     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2313989     2  0.0000     0.9377 0.000 1.000 0.000 0.000
#> SRR2313983     1  0.1867     0.7795 0.928 0.000 0.000 0.072
#> SRR2313986     4  0.0592     0.9366 0.016 0.000 0.000 0.984
#> SRR2313982     1  0.1867     0.7795 0.928 0.000 0.000 0.072
#> SRR2313981     4  0.1398     0.9227 0.004 0.000 0.040 0.956

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     2  0.0566     0.9349 0.000 0.984 0.012 0.000 0.004
#> SRR2313980     2  0.0290     0.9364 0.000 0.992 0.008 0.000 0.000
#> SRR2313979     1  0.0290     0.8664 0.992 0.000 0.000 0.008 0.000
#> SRR2313977     2  0.3534     0.6683 0.000 0.744 0.000 0.000 0.256
#> SRR2313976     2  0.0162     0.9368 0.000 0.996 0.000 0.000 0.004
#> SRR2313975     1  0.0290     0.8664 0.992 0.000 0.000 0.008 0.000
#> SRR2313973     4  0.4538     0.0511 0.452 0.000 0.000 0.540 0.008
#> SRR2313974     1  0.3461     0.7126 0.772 0.000 0.000 0.224 0.004
#> SRR2313985     1  0.0451     0.8655 0.988 0.000 0.000 0.008 0.004
#> SRR2313993     2  0.0404     0.9343 0.000 0.988 0.012 0.000 0.000
#> SRR2313994     2  0.2674     0.8194 0.000 0.856 0.140 0.000 0.004
#> SRR2313995     2  0.0404     0.9351 0.000 0.988 0.012 0.000 0.000
#> SRR2314024     2  0.0290     0.9364 0.000 0.992 0.008 0.000 0.000
#> SRR2314015     2  0.0162     0.9368 0.000 0.996 0.000 0.000 0.004
#> SRR2314025     4  0.0671     0.8290 0.004 0.000 0.016 0.980 0.000
#> SRR2314023     1  0.4183     0.5503 0.668 0.000 0.000 0.324 0.008
#> SRR2314033     2  0.0162     0.9368 0.000 0.996 0.000 0.000 0.004
#> SRR2314045     1  0.0771     0.8544 0.976 0.000 0.000 0.004 0.020
#> SRR2314042     4  0.1341     0.8217 0.000 0.000 0.056 0.944 0.000
#> SRR2314043     5  0.7376     0.2122 0.036 0.004 0.248 0.244 0.468
#> SRR2314041     2  0.0290     0.9364 0.000 0.992 0.008 0.000 0.000
#> SRR2314044     4  0.2740     0.7887 0.004 0.048 0.020 0.900 0.028
#> SRR2314040     3  0.4470     0.3647 0.004 0.004 0.596 0.000 0.396
#> SRR2314039     3  0.2439     0.6396 0.000 0.120 0.876 0.000 0.004
#> SRR2314038     4  0.6130     0.2563 0.088 0.000 0.016 0.524 0.372
#> SRR2314037     4  0.1788     0.8246 0.004 0.000 0.056 0.932 0.008
#> SRR2314036     2  0.0162     0.9368 0.000 0.996 0.000 0.000 0.004
#> SRR2314035     5  0.2077     0.7450 0.008 0.000 0.084 0.000 0.908
#> SRR2314034     4  0.4301     0.6822 0.020 0.000 0.244 0.728 0.008
#> SRR2314032     1  0.0703     0.8509 0.976 0.000 0.000 0.000 0.024
#> SRR2314031     4  0.0451     0.8286 0.004 0.000 0.008 0.988 0.000
#> SRR2314029     4  0.3544     0.7504 0.004 0.088 0.036 0.852 0.020
#> SRR2314030     4  0.4680     0.2755 0.004 0.000 0.448 0.540 0.008
#> SRR2314028     4  0.0671     0.8290 0.004 0.000 0.016 0.980 0.000
#> SRR2314027     3  0.3607     0.5419 0.000 0.244 0.752 0.000 0.004
#> SRR2314026     3  0.1404     0.6543 0.004 0.008 0.956 0.004 0.028
#> SRR2314020     2  0.0000     0.9371 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     3  0.1124     0.6487 0.004 0.000 0.960 0.036 0.000
#> SRR2314021     3  0.1205     0.6466 0.004 0.000 0.956 0.040 0.000
#> SRR2314018     5  0.1168     0.7741 0.008 0.000 0.032 0.000 0.960
#> SRR2314017     5  0.1074     0.7755 0.004 0.000 0.012 0.016 0.968
#> SRR2314016     4  0.2017     0.7935 0.080 0.000 0.000 0.912 0.008
#> SRR2314014     2  0.1764     0.8936 0.000 0.928 0.008 0.000 0.064
#> SRR2314013     2  0.0000     0.9371 0.000 1.000 0.000 0.000 0.000
#> SRR2314012     4  0.0912     0.8298 0.012 0.000 0.016 0.972 0.000
#> SRR2314011     4  0.4446     0.2289 0.400 0.000 0.000 0.592 0.008
#> SRR2314010     2  0.0794     0.9294 0.000 0.972 0.028 0.000 0.000
#> SRR2314009     3  0.4278     0.2458 0.000 0.000 0.548 0.000 0.452
#> SRR2314008     5  0.2624     0.6889 0.000 0.116 0.012 0.000 0.872
#> SRR2314007     2  0.5405    -0.1223 0.000 0.484 0.460 0.000 0.056
#> SRR2314005     2  0.1671     0.8876 0.000 0.924 0.000 0.000 0.076
#> SRR2314004     2  0.0000     0.9371 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     4  0.0992     0.8238 0.024 0.000 0.000 0.968 0.008
#> SRR2314006     2  0.0404     0.9351 0.000 0.988 0.012 0.000 0.000
#> SRR2314002     5  0.2516     0.7020 0.140 0.000 0.000 0.000 0.860
#> SRR2314001     2  0.3051     0.8398 0.000 0.864 0.076 0.000 0.060
#> SRR2314000     1  0.1608     0.8151 0.928 0.000 0.000 0.000 0.072
#> SRR2313998     2  0.0162     0.9368 0.000 0.996 0.000 0.000 0.004
#> SRR2313996     2  0.2280     0.8513 0.000 0.880 0.120 0.000 0.000
#> SRR2313999     1  0.4392     0.4189 0.612 0.000 0.000 0.380 0.008
#> SRR2313997     2  0.0000     0.9371 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     4  0.1357     0.8245 0.004 0.000 0.048 0.948 0.000
#> SRR2313991     5  0.1792     0.7417 0.000 0.084 0.000 0.000 0.916
#> SRR2313990     3  0.6584     0.3052 0.000 0.272 0.468 0.000 0.260
#> SRR2313988     1  0.0324     0.8627 0.992 0.000 0.000 0.004 0.004
#> SRR2313987     1  0.3388     0.7371 0.792 0.000 0.000 0.200 0.008
#> SRR2313984     2  0.0404     0.9356 0.000 0.988 0.012 0.000 0.000
#> SRR2313989     2  0.0162     0.9369 0.000 0.996 0.004 0.000 0.000
#> SRR2313983     1  0.0290     0.8664 0.992 0.000 0.000 0.008 0.000
#> SRR2313986     4  0.1012     0.8245 0.020 0.000 0.000 0.968 0.012
#> SRR2313982     1  0.0290     0.8664 0.992 0.000 0.000 0.008 0.000
#> SRR2313981     4  0.1831     0.8174 0.004 0.000 0.076 0.920 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
#> SRR2313978     2  0.1327     0.8832 0.000 0.936 0.000 0.000 0.000 0.064
#> SRR2313980     2  0.1204     0.8748 0.000 0.944 0.000 0.000 0.000 0.056
#> SRR2313979     1  0.0146     0.7998 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2313977     2  0.5106     0.5919 0.000 0.652 0.012 0.000 0.220 0.116
#> SRR2313976     2  0.0508     0.8847 0.000 0.984 0.004 0.000 0.000 0.012
#> SRR2313975     1  0.0146     0.7998 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2313973     4  0.5301     0.2710 0.300 0.000 0.000 0.568 0.000 0.132
#> SRR2313974     1  0.4931     0.3399 0.592 0.000 0.000 0.324 0.000 0.084
#> SRR2313985     1  0.1088     0.7806 0.960 0.000 0.000 0.016 0.000 0.024
#> SRR2313993     2  0.2051     0.8702 0.000 0.916 0.036 0.000 0.008 0.040
#> SRR2313994     2  0.4095     0.7442 0.000 0.756 0.152 0.000 0.004 0.088
#> SRR2313995     2  0.2212     0.8450 0.000 0.880 0.008 0.000 0.000 0.112
#> SRR2314024     2  0.1007     0.8785 0.000 0.956 0.000 0.000 0.000 0.044
#> SRR2314015     2  0.0547     0.8858 0.000 0.980 0.000 0.000 0.000 0.020
#> SRR2314025     4  0.1663     0.5946 0.000 0.000 0.000 0.912 0.000 0.088
#> SRR2314023     1  0.5521     0.0266 0.468 0.000 0.000 0.400 0.000 0.132
#> SRR2314033     2  0.0458     0.8851 0.000 0.984 0.000 0.000 0.000 0.016
#> SRR2314045     1  0.1010     0.7781 0.960 0.000 0.000 0.000 0.036 0.004
#> SRR2314042     4  0.3045     0.5700 0.000 0.000 0.060 0.840 0.000 0.100
#> SRR2314043     5  0.7492    -0.1110 0.020 0.000 0.180 0.096 0.392 0.312
#> SRR2314041     2  0.2636     0.8557 0.000 0.860 0.016 0.000 0.004 0.120
#> SRR2314044     4  0.4675     0.0852 0.004 0.028 0.000 0.552 0.004 0.412
#> SRR2314040     3  0.6015     0.1279 0.000 0.004 0.460 0.000 0.312 0.224
#> SRR2314039     3  0.2882     0.5420 0.000 0.076 0.860 0.000 0.004 0.060
#> SRR2314038     6  0.6692     0.0000 0.040 0.000 0.000 0.228 0.336 0.396
#> SRR2314037     4  0.4452     0.5193 0.004 0.000 0.064 0.708 0.004 0.220
#> SRR2314036     2  0.0000     0.8839 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314035     5  0.4087     0.6198 0.020 0.000 0.056 0.000 0.768 0.156
#> SRR2314034     4  0.5457     0.3622 0.012 0.000 0.220 0.624 0.004 0.140
#> SRR2314032     1  0.1010     0.7781 0.960 0.000 0.000 0.000 0.036 0.004
#> SRR2314031     4  0.1863     0.5928 0.000 0.000 0.000 0.896 0.000 0.104
#> SRR2314029     4  0.5362    -0.0558 0.004 0.056 0.016 0.496 0.000 0.428
#> SRR2314030     3  0.6175    -0.0739 0.000 0.000 0.436 0.408 0.040 0.116
#> SRR2314028     4  0.1500     0.6147 0.012 0.000 0.000 0.936 0.000 0.052
#> SRR2314027     3  0.4030     0.4725 0.000 0.172 0.748 0.000 0.000 0.080
#> SRR2314026     3  0.0820     0.5499 0.000 0.000 0.972 0.000 0.016 0.012
#> SRR2314020     2  0.0260     0.8838 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR2314019     3  0.2554     0.5240 0.000 0.000 0.876 0.028 0.004 0.092
#> SRR2314021     3  0.2984     0.5110 0.000 0.000 0.848 0.044 0.004 0.104
#> SRR2314018     5  0.3242     0.6298 0.004 0.000 0.032 0.000 0.816 0.148
#> SRR2314017     5  0.0725     0.5930 0.000 0.000 0.000 0.012 0.976 0.012
#> SRR2314016     4  0.3845     0.5289 0.056 0.000 0.000 0.768 0.004 0.172
#> SRR2314014     2  0.4049     0.7822 0.000 0.784 0.032 0.000 0.056 0.128
#> SRR2314013     2  0.1340     0.8811 0.000 0.948 0.008 0.000 0.004 0.040
#> SRR2314012     4  0.1391     0.6169 0.016 0.000 0.000 0.944 0.000 0.040
#> SRR2314011     4  0.5207     0.3008 0.276 0.000 0.000 0.592 0.000 0.132
#> SRR2314010     2  0.2775     0.8453 0.000 0.856 0.040 0.000 0.000 0.104
#> SRR2314009     3  0.6090     0.0135 0.000 0.000 0.404 0.004 0.368 0.224
#> SRR2314008     5  0.5578     0.5121 0.000 0.124 0.048 0.000 0.644 0.184
#> SRR2314007     2  0.6655    -0.1384 0.000 0.392 0.388 0.000 0.056 0.164
#> SRR2314005     2  0.2583     0.8495 0.000 0.884 0.008 0.000 0.056 0.052
#> SRR2314004     2  0.0665     0.8836 0.000 0.980 0.004 0.000 0.008 0.008
#> SRR2314003     4  0.2872     0.5615 0.024 0.000 0.000 0.836 0.000 0.140
#> SRR2314006     2  0.1753     0.8614 0.000 0.912 0.004 0.000 0.000 0.084
#> SRR2314002     5  0.2877     0.4515 0.168 0.000 0.000 0.000 0.820 0.012
#> SRR2314001     2  0.4689     0.7317 0.000 0.732 0.100 0.000 0.032 0.136
#> SRR2314000     1  0.1908     0.7358 0.916 0.000 0.000 0.000 0.056 0.028
#> SRR2313998     2  0.1036     0.8848 0.000 0.964 0.008 0.000 0.004 0.024
#> SRR2313996     2  0.4600     0.7151 0.000 0.708 0.136 0.000 0.004 0.152
#> SRR2313999     4  0.5527     0.0693 0.408 0.000 0.000 0.460 0.000 0.132
#> SRR2313997     2  0.0665     0.8836 0.000 0.980 0.004 0.000 0.008 0.008
#> SRR2313992     4  0.2000     0.6109 0.000 0.000 0.032 0.916 0.004 0.048
#> SRR2313991     5  0.2333     0.5514 0.000 0.092 0.000 0.000 0.884 0.024
#> SRR2313990     3  0.7433     0.1603 0.000 0.184 0.380 0.000 0.168 0.268
#> SRR2313988     1  0.0291     0.7987 0.992 0.000 0.000 0.004 0.000 0.004
#> SRR2313987     1  0.5135     0.3095 0.572 0.000 0.000 0.324 0.000 0.104
#> SRR2313984     2  0.1633     0.8788 0.000 0.932 0.024 0.000 0.000 0.044
#> SRR2313989     2  0.0547     0.8829 0.000 0.980 0.000 0.000 0.000 0.020
#> SRR2313983     1  0.0146     0.7998 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2313986     4  0.2869     0.5606 0.020 0.000 0.000 0.832 0.000 0.148
#> SRR2313982     1  0.0146     0.7998 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2313981     4  0.3013     0.5759 0.000 0.000 0.068 0.844 0.000 0.088

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

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

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

collect_plots(res)

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.977           0.915       0.949         0.4410 0.549   0.549
#> 3 3 0.813           0.868       0.937         0.4204 0.831   0.692
#> 4 4 0.841           0.880       0.940         0.1600 0.856   0.640
#> 5 5 0.698           0.662       0.802         0.0574 0.978   0.920
#> 6 6 0.716           0.625       0.832         0.0507 0.871   0.541

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
#> SRR2313978     2   0.402     0.9516 0.080 0.920
#> SRR2313980     2   0.000     0.9368 0.000 1.000
#> SRR2313979     1   0.000     0.9536 1.000 0.000
#> SRR2313977     2   0.402     0.9516 0.080 0.920
#> SRR2313976     2   0.000     0.9368 0.000 1.000
#> SRR2313975     1   0.000     0.9536 1.000 0.000
#> SRR2313973     1   0.000     0.9536 1.000 0.000
#> SRR2313974     1   0.000     0.9536 1.000 0.000
#> SRR2313985     1   0.000     0.9536 1.000 0.000
#> SRR2313993     2   0.000     0.9368 0.000 1.000
#> SRR2313994     2   0.000     0.9368 0.000 1.000
#> SRR2313995     2   0.000     0.9368 0.000 1.000
#> SRR2314024     2   0.000     0.9368 0.000 1.000
#> SRR2314015     2   0.000     0.9368 0.000 1.000
#> SRR2314025     1   0.000     0.9536 1.000 0.000
#> SRR2314023     1   0.000     0.9536 1.000 0.000
#> SRR2314033     2   0.000     0.9368 0.000 1.000
#> SRR2314045     1   0.000     0.9536 1.000 0.000
#> SRR2314042     1   1.000    -0.0733 0.508 0.492
#> SRR2314043     2   0.416     0.9500 0.084 0.916
#> SRR2314041     2   0.402     0.9516 0.080 0.920
#> SRR2314044     2   0.416     0.9500 0.084 0.916
#> SRR2314040     2   0.402     0.9516 0.080 0.920
#> SRR2314039     2   0.402     0.9516 0.080 0.920
#> SRR2314038     2   0.722     0.8208 0.200 0.800
#> SRR2314037     2   0.416     0.9500 0.084 0.916
#> SRR2314036     2   0.000     0.9368 0.000 1.000
#> SRR2314035     2   0.402     0.9516 0.080 0.920
#> SRR2314034     1   0.981     0.2049 0.580 0.420
#> SRR2314032     1   0.000     0.9536 1.000 0.000
#> SRR2314031     1   0.141     0.9367 0.980 0.020
#> SRR2314029     2   0.416     0.9500 0.084 0.916
#> SRR2314030     2   0.416     0.9500 0.084 0.916
#> SRR2314028     1   0.000     0.9536 1.000 0.000
#> SRR2314027     2   0.402     0.9516 0.080 0.920
#> SRR2314026     2   0.402     0.9516 0.080 0.920
#> SRR2314020     2   0.000     0.9368 0.000 1.000
#> SRR2314019     2   0.416     0.9500 0.084 0.916
#> SRR2314021     2   0.416     0.9500 0.084 0.916
#> SRR2314018     2   0.416     0.9500 0.084 0.916
#> SRR2314017     2   0.416     0.9500 0.084 0.916
#> SRR2314016     1   0.000     0.9536 1.000 0.000
#> SRR2314014     2   0.388     0.9513 0.076 0.924
#> SRR2314013     2   0.000     0.9368 0.000 1.000
#> SRR2314012     1   0.000     0.9536 1.000 0.000
#> SRR2314011     1   0.000     0.9536 1.000 0.000
#> SRR2314010     2   0.000     0.9368 0.000 1.000
#> SRR2314009     2   0.416     0.9500 0.084 0.916
#> SRR2314008     2   0.402     0.9516 0.080 0.920
#> SRR2314007     2   0.402     0.9516 0.080 0.920
#> SRR2314005     2   0.000     0.9368 0.000 1.000
#> SRR2314004     2   0.000     0.9368 0.000 1.000
#> SRR2314003     1   0.000     0.9536 1.000 0.000
#> SRR2314006     2   0.000     0.9368 0.000 1.000
#> SRR2314002     2   0.402     0.9516 0.080 0.920
#> SRR2314001     2   0.358     0.9502 0.068 0.932
#> SRR2314000     2   0.929     0.5612 0.344 0.656
#> SRR2313998     2   0.000     0.9368 0.000 1.000
#> SRR2313996     2   0.402     0.9516 0.080 0.920
#> SRR2313999     1   0.000     0.9536 1.000 0.000
#> SRR2313997     2   0.000     0.9368 0.000 1.000
#> SRR2313992     1   0.242     0.9175 0.960 0.040
#> SRR2313991     2   0.402     0.9516 0.080 0.920
#> SRR2313990     2   0.402     0.9516 0.080 0.920
#> SRR2313988     1   0.000     0.9536 1.000 0.000
#> SRR2313987     1   0.000     0.9536 1.000 0.000
#> SRR2313984     2   0.000     0.9368 0.000 1.000
#> SRR2313989     2   0.000     0.9368 0.000 1.000
#> SRR2313983     1   0.000     0.9536 1.000 0.000
#> SRR2313986     1   0.000     0.9536 1.000 0.000
#> SRR2313982     1   0.000     0.9536 1.000 0.000
#> SRR2313981     2   0.416     0.9500 0.084 0.916

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2313980     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313977     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2313976     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2313975     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313973     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313974     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313985     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313993     3  0.6235      0.355 0.000 0.436 0.564
#> SRR2313994     3  0.4974      0.746 0.000 0.236 0.764
#> SRR2313995     2  0.0237      0.963 0.000 0.996 0.004
#> SRR2314024     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314015     3  0.3816      0.807 0.000 0.148 0.852
#> SRR2314025     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2314023     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2314033     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314045     1  0.3879      0.807 0.848 0.000 0.152
#> SRR2314042     1  0.7758      0.113 0.484 0.048 0.468
#> SRR2314043     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314041     3  0.2165      0.913 0.000 0.064 0.936
#> SRR2314044     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314040     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2314039     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2314038     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314037     3  0.0237      0.922 0.000 0.004 0.996
#> SRR2314036     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314035     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314034     1  0.7462      0.455 0.600 0.048 0.352
#> SRR2314032     1  0.2261      0.873 0.932 0.000 0.068
#> SRR2314031     1  0.3267      0.840 0.884 0.000 0.116
#> SRR2314029     3  0.1860      0.918 0.000 0.052 0.948
#> SRR2314030     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2314028     1  0.3879      0.807 0.848 0.000 0.152
#> SRR2314027     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2314026     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2314020     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314019     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2314021     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2314018     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314017     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314016     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2314014     3  0.0237      0.921 0.000 0.004 0.996
#> SRR2314013     3  0.4654      0.777 0.000 0.208 0.792
#> SRR2314012     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2314011     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2314010     2  0.4654      0.690 0.000 0.792 0.208
#> SRR2314009     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314008     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314007     3  0.1643      0.920 0.000 0.044 0.956
#> SRR2314005     3  0.3941      0.799 0.000 0.156 0.844
#> SRR2314004     2  0.1964      0.923 0.000 0.944 0.056
#> SRR2314003     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2314006     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314002     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2314001     3  0.0424      0.920 0.000 0.008 0.992
#> SRR2314000     3  0.0424      0.918 0.008 0.000 0.992
#> SRR2313998     3  0.5621      0.635 0.000 0.308 0.692
#> SRR2313996     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2313999     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313997     2  0.1529      0.934 0.000 0.960 0.040
#> SRR2313992     1  0.4702      0.746 0.788 0.000 0.212
#> SRR2313991     3  0.0000      0.922 0.000 0.000 1.000
#> SRR2313990     3  0.1753      0.919 0.000 0.048 0.952
#> SRR2313988     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313987     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313984     3  0.6299      0.231 0.000 0.476 0.524
#> SRR2313989     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313986     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313982     1  0.0000      0.915 1.000 0.000 0.000
#> SRR2313981     3  0.1753      0.919 0.000 0.048 0.952

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2313980     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> SRR2313979     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2313977     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2313976     2  0.1182      0.947 0.000 0.968 0.016 0.016
#> SRR2313975     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2313973     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2313974     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2313985     1  0.0188      0.981 0.996 0.000 0.000 0.004
#> SRR2313993     3  0.5220      0.472 0.000 0.352 0.632 0.016
#> SRR2313994     3  0.4989      0.751 0.000 0.164 0.764 0.072
#> SRR2313995     2  0.0592      0.958 0.000 0.984 0.000 0.016
#> SRR2314024     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> SRR2314015     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314025     4  0.3024      0.810 0.148 0.000 0.000 0.852
#> SRR2314023     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> SRR2314045     1  0.3356      0.755 0.824 0.000 0.000 0.176
#> SRR2314042     4  0.0000      0.861 0.000 0.000 0.000 1.000
#> SRR2314043     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314041     3  0.0779      0.921 0.000 0.004 0.980 0.016
#> SRR2314044     3  0.4250      0.580 0.000 0.000 0.724 0.276
#> SRR2314040     3  0.1867      0.892 0.000 0.000 0.928 0.072
#> SRR2314039     3  0.3024      0.832 0.000 0.000 0.852 0.148
#> SRR2314038     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314037     4  0.0592      0.859 0.000 0.000 0.016 0.984
#> SRR2314036     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> SRR2314035     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314034     4  0.0000      0.861 0.000 0.000 0.000 1.000
#> SRR2314032     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2314031     4  0.3497      0.822 0.124 0.000 0.024 0.852
#> SRR2314029     4  0.4585      0.483 0.000 0.000 0.332 0.668
#> SRR2314030     4  0.0000      0.861 0.000 0.000 0.000 1.000
#> SRR2314028     4  0.1867      0.850 0.072 0.000 0.000 0.928
#> SRR2314027     3  0.2281      0.873 0.000 0.000 0.904 0.096
#> SRR2314026     3  0.3024      0.832 0.000 0.000 0.852 0.148
#> SRR2314020     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> SRR2314019     4  0.0000      0.861 0.000 0.000 0.000 1.000
#> SRR2314021     4  0.0469      0.858 0.000 0.000 0.012 0.988
#> SRR2314018     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314017     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314016     4  0.3873      0.738 0.228 0.000 0.000 0.772
#> SRR2314014     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314013     3  0.2376      0.884 0.000 0.068 0.916 0.016
#> SRR2314012     4  0.3649      0.769 0.204 0.000 0.000 0.796
#> SRR2314011     1  0.0188      0.981 0.996 0.000 0.000 0.004
#> SRR2314010     2  0.5581      0.675 0.000 0.728 0.140 0.132
#> SRR2314009     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314008     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314007     3  0.0469      0.923 0.000 0.000 0.988 0.012
#> SRR2314005     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314004     2  0.0469      0.959 0.000 0.988 0.012 0.000
#> SRR2314003     1  0.0817      0.962 0.976 0.000 0.000 0.024
#> SRR2314006     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> SRR2314002     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314001     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2314000     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2313998     3  0.3495      0.817 0.000 0.140 0.844 0.016
#> SRR2313996     3  0.0592      0.921 0.000 0.000 0.984 0.016
#> SRR2313999     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2313997     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> SRR2313992     4  0.0672      0.862 0.008 0.000 0.008 0.984
#> SRR2313991     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> SRR2313990     3  0.0707      0.920 0.000 0.000 0.980 0.020
#> SRR2313988     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2313987     1  0.0188      0.981 0.996 0.000 0.000 0.004
#> SRR2313984     3  0.5427      0.320 0.000 0.416 0.568 0.016
#> SRR2313989     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> SRR2313983     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2313986     4  0.3975      0.728 0.240 0.000 0.000 0.760
#> SRR2313982     1  0.0000      0.983 1.000 0.000 0.000 0.000
#> SRR2313981     4  0.4040      0.620 0.000 0.000 0.248 0.752

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2313980     2  0.0000      0.894 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.4182      0.353 0.600 0.000 0.000 0.000 0.400
#> SRR2313977     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2313976     2  0.4358      0.635 0.000 0.732 0.016 0.016 0.236
#> SRR2313975     1  0.4235      0.301 0.576 0.000 0.000 0.000 0.424
#> SRR2313973     1  0.0000      0.678 1.000 0.000 0.000 0.000 0.000
#> SRR2313974     1  0.2654      0.688 0.884 0.000 0.000 0.084 0.032
#> SRR2313985     1  0.2561      0.685 0.884 0.000 0.000 0.096 0.020
#> SRR2313993     3  0.6954      0.280 0.000 0.196 0.404 0.016 0.384
#> SRR2313994     3  0.7525      0.346 0.000 0.164 0.444 0.072 0.320
#> SRR2313995     2  0.3098      0.748 0.000 0.836 0.000 0.016 0.148
#> SRR2314024     2  0.0000      0.894 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314025     4  0.3359      0.800 0.072 0.000 0.000 0.844 0.084
#> SRR2314023     1  0.0000      0.678 1.000 0.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000      0.894 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     1  0.5787      0.452 0.608 0.000 0.000 0.240 0.152
#> SRR2314042     4  0.0162      0.832 0.000 0.000 0.000 0.996 0.004
#> SRR2314043     3  0.0404      0.812 0.000 0.000 0.988 0.000 0.012
#> SRR2314041     3  0.3213      0.751 0.000 0.004 0.836 0.016 0.144
#> SRR2314044     3  0.5232      0.520 0.000 0.000 0.648 0.268 0.084
#> SRR2314040     3  0.5117      0.633 0.000 0.000 0.652 0.072 0.276
#> SRR2314039     3  0.5163      0.632 0.000 0.000 0.692 0.156 0.152
#> SRR2314038     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314037     4  0.0671      0.832 0.000 0.000 0.016 0.980 0.004
#> SRR2314036     2  0.0000      0.894 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314034     4  0.0162      0.832 0.000 0.000 0.000 0.996 0.004
#> SRR2314032     5  0.4297     -0.357 0.472 0.000 0.000 0.000 0.528
#> SRR2314031     4  0.3644      0.806 0.048 0.000 0.024 0.844 0.084
#> SRR2314029     4  0.5464      0.572 0.000 0.000 0.224 0.648 0.128
#> SRR2314030     4  0.1478      0.816 0.000 0.000 0.000 0.936 0.064
#> SRR2314028     4  0.3301      0.802 0.072 0.000 0.000 0.848 0.080
#> SRR2314027     3  0.4609      0.680 0.000 0.000 0.744 0.104 0.152
#> SRR2314026     3  0.6308      0.442 0.000 0.000 0.456 0.156 0.388
#> SRR2314020     2  0.0000      0.894 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     4  0.2605      0.775 0.000 0.000 0.000 0.852 0.148
#> SRR2314021     4  0.2997      0.769 0.000 0.000 0.012 0.840 0.148
#> SRR2314018     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314017     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314016     4  0.4390      0.738 0.156 0.000 0.000 0.760 0.084
#> SRR2314014     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314013     3  0.5680      0.584 0.000 0.068 0.608 0.016 0.308
#> SRR2314012     4  0.3210      0.730 0.212 0.000 0.000 0.788 0.000
#> SRR2314011     1  0.1792      0.639 0.916 0.000 0.000 0.000 0.084
#> SRR2314010     2  0.7311      0.218 0.000 0.412 0.060 0.140 0.388
#> SRR2314009     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314008     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314007     3  0.1444      0.801 0.000 0.000 0.948 0.012 0.040
#> SRR2314005     3  0.3003      0.728 0.000 0.000 0.812 0.000 0.188
#> SRR2314004     2  0.0404      0.882 0.000 0.988 0.012 0.000 0.000
#> SRR2314003     1  0.4226      0.605 0.776 0.000 0.000 0.140 0.084
#> SRR2314006     2  0.0000      0.894 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2314001     3  0.3395      0.694 0.000 0.000 0.764 0.000 0.236
#> SRR2314000     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2313998     3  0.6536      0.454 0.000 0.140 0.508 0.016 0.336
#> SRR2313996     3  0.3011      0.755 0.000 0.000 0.844 0.016 0.140
#> SRR2313999     1  0.0290      0.678 0.992 0.000 0.000 0.000 0.008
#> SRR2313997     2  0.0000      0.894 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     4  0.0579      0.832 0.008 0.000 0.008 0.984 0.000
#> SRR2313991     3  0.0000      0.814 0.000 0.000 1.000 0.000 0.000
#> SRR2313990     3  0.4157      0.675 0.000 0.000 0.716 0.020 0.264
#> SRR2313988     5  0.4297     -0.357 0.472 0.000 0.000 0.000 0.528
#> SRR2313987     1  0.2230      0.674 0.884 0.000 0.000 0.116 0.000
#> SRR2313984     5  0.7215     -0.342 0.000 0.316 0.312 0.016 0.356
#> SRR2313989     2  0.0000      0.894 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.4182      0.353 0.600 0.000 0.000 0.000 0.400
#> SRR2313986     4  0.4390      0.743 0.156 0.000 0.000 0.760 0.084
#> SRR2313982     1  0.4182      0.353 0.600 0.000 0.000 0.000 0.400
#> SRR2313981     4  0.4404      0.681 0.000 0.000 0.152 0.760 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
#> SRR2313978     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2313980     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313979     1  0.3862     0.4129 0.524 0.000 0.000 0.000 0.476 0.000
#> SRR2313977     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2313976     2  0.3789     0.1193 0.000 0.584 0.000 0.000 0.000 0.416
#> SRR2313975     1  0.3782     0.4501 0.588 0.000 0.000 0.000 0.412 0.000
#> SRR2313973     5  0.0000     0.6952 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313974     5  0.3543     0.6594 0.032 0.000 0.000 0.200 0.768 0.000
#> SRR2313985     5  0.3920     0.6188 0.120 0.000 0.000 0.112 0.768 0.000
#> SRR2313993     2  0.3098     0.6190 0.000 0.812 0.164 0.000 0.000 0.024
#> SRR2313994     2  0.3231     0.6078 0.000 0.784 0.200 0.000 0.000 0.016
#> SRR2313995     6  0.3684     0.3472 0.000 0.372 0.000 0.000 0.000 0.628
#> SRR2314024     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314015     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314025     4  0.0000     0.8210 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314023     5  0.0000     0.6952 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314033     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314045     1  0.5848    -0.1280 0.500 0.004 0.016 0.368 0.112 0.000
#> SRR2314042     4  0.2048     0.8313 0.000 0.120 0.000 0.880 0.000 0.000
#> SRR2314043     3  0.0547     0.8331 0.000 0.020 0.980 0.000 0.000 0.000
#> SRR2314041     3  0.3807     0.2729 0.000 0.368 0.628 0.000 0.000 0.004
#> SRR2314044     3  0.5011     0.3126 0.000 0.112 0.616 0.272 0.000 0.000
#> SRR2314040     2  0.3409     0.5142 0.000 0.700 0.300 0.000 0.000 0.000
#> SRR2314039     2  0.3838     0.0618 0.000 0.552 0.448 0.000 0.000 0.000
#> SRR2314038     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314037     4  0.2003     0.8327 0.000 0.116 0.000 0.884 0.000 0.000
#> SRR2314036     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314035     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314034     4  0.2597     0.8103 0.000 0.176 0.000 0.824 0.000 0.000
#> SRR2314032     1  0.0000     0.4788 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2314031     4  0.0000     0.8210 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314029     4  0.4992     0.5755 0.000 0.268 0.112 0.620 0.000 0.000
#> SRR2314030     4  0.3464     0.6725 0.000 0.312 0.000 0.688 0.000 0.000
#> SRR2314028     4  0.0260     0.8240 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR2314027     2  0.3868    -0.0320 0.000 0.508 0.492 0.000 0.000 0.000
#> SRR2314026     2  0.0000     0.5591 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314020     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314019     2  0.3727    -0.1203 0.000 0.612 0.000 0.388 0.000 0.000
#> SRR2314021     2  0.3833    -0.2656 0.000 0.556 0.000 0.444 0.000 0.000
#> SRR2314018     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314017     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314016     4  0.1444     0.7768 0.000 0.000 0.000 0.928 0.072 0.000
#> SRR2314014     3  0.0146     0.8450 0.000 0.004 0.996 0.000 0.000 0.000
#> SRR2314013     2  0.3841     0.4052 0.000 0.616 0.380 0.000 0.000 0.004
#> SRR2314012     4  0.3050     0.6402 0.000 0.000 0.000 0.764 0.236 0.000
#> SRR2314011     5  0.1957     0.6424 0.000 0.000 0.000 0.112 0.888 0.000
#> SRR2314010     2  0.1327     0.5631 0.000 0.936 0.000 0.000 0.000 0.064
#> SRR2314009     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314008     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314007     3  0.2730     0.6182 0.000 0.192 0.808 0.000 0.000 0.000
#> SRR2314005     3  0.3175     0.4806 0.000 0.256 0.744 0.000 0.000 0.000
#> SRR2314004     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314003     5  0.3695     0.5342 0.000 0.000 0.000 0.376 0.624 0.000
#> SRR2314006     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314002     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314001     3  0.3851    -0.0607 0.000 0.460 0.540 0.000 0.000 0.000
#> SRR2314000     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2313998     2  0.3649     0.6127 0.000 0.764 0.196 0.000 0.000 0.040
#> SRR2313996     3  0.3647     0.3018 0.000 0.360 0.640 0.000 0.000 0.000
#> SRR2313999     5  0.0260     0.6964 0.000 0.000 0.000 0.008 0.992 0.000
#> SRR2313997     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313992     4  0.1957     0.8325 0.000 0.112 0.000 0.888 0.000 0.000
#> SRR2313991     3  0.0000     0.8481 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2313990     2  0.3647     0.4325 0.000 0.640 0.360 0.000 0.000 0.000
#> SRR2313988     1  0.0000     0.4788 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313987     5  0.3023     0.6473 0.000 0.000 0.000 0.232 0.768 0.000
#> SRR2313984     2  0.3752     0.6214 0.000 0.772 0.164 0.000 0.000 0.064
#> SRR2313989     6  0.0000     0.9482 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     1  0.3862     0.4129 0.524 0.000 0.000 0.000 0.476 0.000
#> SRR2313986     4  0.1501     0.7735 0.000 0.000 0.000 0.924 0.076 0.000
#> SRR2313982     1  0.3862     0.4129 0.524 0.000 0.000 0.000 0.476 0.000
#> SRR2313981     4  0.4444     0.6997 0.000 0.184 0.108 0.708 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-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

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

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

collect_plots(res)

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.711           0.924       0.951         0.4838 0.518   0.518
#> 3 3 0.518           0.540       0.806         0.3273 0.737   0.527
#> 4 4 0.511           0.509       0.680         0.0568 0.815   0.523
#> 5 5 0.784           0.795       0.921         0.1093 0.869   0.591
#> 6 6 0.701           0.586       0.783         0.0613 0.912   0.660

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
#> SRR2313978     2  0.0000      0.983 0.000 1.000
#> SRR2313980     2  0.0000      0.983 0.000 1.000
#> SRR2313979     1  0.0672      0.933 0.992 0.008
#> SRR2313977     2  0.0000      0.983 0.000 1.000
#> SRR2313976     2  0.0000      0.983 0.000 1.000
#> SRR2313975     1  0.1843      0.931 0.972 0.028
#> SRR2313973     1  0.0672      0.933 0.992 0.008
#> SRR2313974     1  0.0672      0.933 0.992 0.008
#> SRR2313985     1  0.0672      0.933 0.992 0.008
#> SRR2313993     2  0.0376      0.981 0.004 0.996
#> SRR2313994     2  0.0672      0.979 0.008 0.992
#> SRR2313995     1  0.9286      0.594 0.656 0.344
#> SRR2314024     2  0.0000      0.983 0.000 1.000
#> SRR2314015     2  0.0000      0.983 0.000 1.000
#> SRR2314025     1  0.1414      0.934 0.980 0.020
#> SRR2314023     1  0.0672      0.933 0.992 0.008
#> SRR2314033     2  0.0000      0.983 0.000 1.000
#> SRR2314045     1  0.0000      0.930 1.000 0.000
#> SRR2314042     1  0.0938      0.933 0.988 0.012
#> SRR2314043     1  0.6531      0.859 0.832 0.168
#> SRR2314041     2  0.0938      0.976 0.012 0.988
#> SRR2314044     1  0.2948      0.927 0.948 0.052
#> SRR2314040     1  0.5737      0.872 0.864 0.136
#> SRR2314039     1  0.7674      0.788 0.776 0.224
#> SRR2314038     1  0.2236      0.931 0.964 0.036
#> SRR2314037     1  0.1414      0.932 0.980 0.020
#> SRR2314036     2  0.0000      0.983 0.000 1.000
#> SRR2314035     1  0.6712      0.842 0.824 0.176
#> SRR2314034     1  0.2603      0.925 0.956 0.044
#> SRR2314032     1  0.0672      0.933 0.992 0.008
#> SRR2314031     1  0.1184      0.934 0.984 0.016
#> SRR2314029     1  0.2423      0.930 0.960 0.040
#> SRR2314030     1  0.5178      0.886 0.884 0.116
#> SRR2314028     1  0.0938      0.933 0.988 0.012
#> SRR2314027     1  0.9393      0.567 0.644 0.356
#> SRR2314026     1  0.6712      0.840 0.824 0.176
#> SRR2314020     2  0.0000      0.983 0.000 1.000
#> SRR2314019     1  0.6531      0.847 0.832 0.168
#> SRR2314021     1  0.6247      0.856 0.844 0.156
#> SRR2314018     1  0.6623      0.854 0.828 0.172
#> SRR2314017     1  0.5408      0.884 0.876 0.124
#> SRR2314016     1  0.1414      0.934 0.980 0.020
#> SRR2314014     2  0.0672      0.979 0.008 0.992
#> SRR2314013     2  0.0000      0.983 0.000 1.000
#> SRR2314012     1  0.0938      0.933 0.988 0.012
#> SRR2314011     1  0.0672      0.933 0.992 0.008
#> SRR2314010     2  0.0000      0.983 0.000 1.000
#> SRR2314009     1  0.6801      0.838 0.820 0.180
#> SRR2314008     2  0.0000      0.983 0.000 1.000
#> SRR2314007     2  0.0000      0.983 0.000 1.000
#> SRR2314005     2  0.1414      0.970 0.020 0.980
#> SRR2314004     2  0.0000      0.983 0.000 1.000
#> SRR2314003     1  0.0938      0.934 0.988 0.012
#> SRR2314006     2  0.0938      0.976 0.012 0.988
#> SRR2314002     1  0.2043      0.931 0.968 0.032
#> SRR2314001     2  0.0672      0.979 0.008 0.992
#> SRR2314000     1  0.1843      0.931 0.972 0.028
#> SRR2313998     2  0.0000      0.983 0.000 1.000
#> SRR2313996     2  0.5178      0.871 0.116 0.884
#> SRR2313999     1  0.0672      0.933 0.992 0.008
#> SRR2313997     2  0.0000      0.983 0.000 1.000
#> SRR2313992     1  0.0938      0.933 0.988 0.012
#> SRR2313991     2  0.4298      0.893 0.088 0.912
#> SRR2313990     2  0.5629      0.848 0.132 0.868
#> SRR2313988     1  0.0672      0.933 0.992 0.008
#> SRR2313987     1  0.0672      0.933 0.992 0.008
#> SRR2313984     2  0.0672      0.979 0.008 0.992
#> SRR2313989     2  0.0000      0.983 0.000 1.000
#> SRR2313983     1  0.0672      0.933 0.992 0.008
#> SRR2313986     1  0.0938      0.934 0.988 0.012
#> SRR2313982     1  0.0672      0.933 0.992 0.008
#> SRR2313981     1  0.2948      0.921 0.948 0.052

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.6180     0.4046 0.000 0.584 0.416
#> SRR2313980     2  0.0000     0.7334 0.000 1.000 0.000
#> SRR2313979     1  0.0000     0.8241 1.000 0.000 0.000
#> SRR2313977     2  0.6095     0.4557 0.000 0.608 0.392
#> SRR2313976     2  0.1753     0.7429 0.000 0.952 0.048
#> SRR2313975     1  0.0000     0.8241 1.000 0.000 0.000
#> SRR2313973     1  0.0424     0.8255 0.992 0.000 0.008
#> SRR2313974     1  0.0424     0.8255 0.992 0.000 0.008
#> SRR2313985     1  0.5465     0.6692 0.712 0.000 0.288
#> SRR2313993     2  0.2066     0.7429 0.000 0.940 0.060
#> SRR2313994     2  0.5397     0.5962 0.000 0.720 0.280
#> SRR2313995     2  0.6204     0.3912 0.000 0.576 0.424
#> SRR2314024     2  0.0000     0.7334 0.000 1.000 0.000
#> SRR2314015     2  0.1860     0.7430 0.000 0.948 0.052
#> SRR2314025     1  0.6252     0.5017 0.556 0.000 0.444
#> SRR2314023     1  0.0424     0.8255 0.992 0.000 0.008
#> SRR2314033     2  0.0892     0.7386 0.000 0.980 0.020
#> SRR2314045     1  0.6062     0.5564 0.616 0.000 0.384
#> SRR2314042     3  0.5431     0.1953 0.284 0.000 0.716
#> SRR2314043     3  0.6274    -0.1559 0.000 0.456 0.544
#> SRR2314041     2  0.6291     0.3110 0.000 0.532 0.468
#> SRR2314044     3  0.8236    -0.0875 0.076 0.416 0.508
#> SRR2314040     3  0.1411     0.6529 0.000 0.036 0.964
#> SRR2314039     3  0.2066     0.6426 0.000 0.060 0.940
#> SRR2314038     3  0.9572    -0.0269 0.196 0.388 0.416
#> SRR2314037     3  0.5062     0.5133 0.016 0.184 0.800
#> SRR2314036     2  0.0000     0.7334 0.000 1.000 0.000
#> SRR2314035     3  0.5016     0.4502 0.000 0.240 0.760
#> SRR2314034     3  0.5178     0.2691 0.256 0.000 0.744
#> SRR2314032     1  0.6062     0.5564 0.616 0.000 0.384
#> SRR2314031     1  0.5497     0.6716 0.708 0.000 0.292
#> SRR2314029     3  0.8373    -0.0238 0.088 0.388 0.524
#> SRR2314030     3  0.2165     0.6024 0.064 0.000 0.936
#> SRR2314028     3  0.6305    -0.4159 0.484 0.000 0.516
#> SRR2314027     3  0.2066     0.6426 0.000 0.060 0.940
#> SRR2314026     3  0.1411     0.6529 0.000 0.036 0.964
#> SRR2314020     2  0.0000     0.7334 0.000 1.000 0.000
#> SRR2314019     3  0.1289     0.6533 0.000 0.032 0.968
#> SRR2314021     3  0.0237     0.6488 0.000 0.004 0.996
#> SRR2314018     3  0.6676    -0.2232 0.008 0.476 0.516
#> SRR2314017     3  0.1031     0.6520 0.000 0.024 0.976
#> SRR2314016     1  0.4887     0.7311 0.772 0.000 0.228
#> SRR2314014     2  0.3267     0.7274 0.000 0.884 0.116
#> SRR2314013     2  0.5560     0.5796 0.000 0.700 0.300
#> SRR2314012     1  0.6252     0.5017 0.556 0.000 0.444
#> SRR2314011     1  0.0424     0.8255 0.992 0.000 0.008
#> SRR2314010     2  0.5905     0.5045 0.000 0.648 0.352
#> SRR2314009     3  0.1860     0.6482 0.000 0.052 0.948
#> SRR2314008     2  0.6291     0.3110 0.000 0.532 0.468
#> SRR2314007     2  0.6307     0.2647 0.000 0.512 0.488
#> SRR2314005     2  0.2537     0.7397 0.000 0.920 0.080
#> SRR2314004     2  0.0000     0.7334 0.000 1.000 0.000
#> SRR2314003     1  0.2066     0.8087 0.940 0.000 0.060
#> SRR2314006     2  0.0000     0.7334 0.000 1.000 0.000
#> SRR2314002     2  0.9706     0.0117 0.220 0.412 0.368
#> SRR2314001     2  0.4399     0.6758 0.000 0.812 0.188
#> SRR2314000     1  0.9792    -0.1602 0.436 0.288 0.276
#> SRR2313998     2  0.2448     0.7404 0.000 0.924 0.076
#> SRR2313996     3  0.5810     0.2512 0.000 0.336 0.664
#> SRR2313999     1  0.0424     0.8255 0.992 0.000 0.008
#> SRR2313997     2  0.0000     0.7334 0.000 1.000 0.000
#> SRR2313992     3  0.5733     0.0554 0.324 0.000 0.676
#> SRR2313991     2  0.6286     0.3181 0.000 0.536 0.464
#> SRR2313990     3  0.5621     0.3246 0.000 0.308 0.692
#> SRR2313988     1  0.1163     0.8195 0.972 0.000 0.028
#> SRR2313987     1  0.0237     0.8249 0.996 0.000 0.004
#> SRR2313984     2  0.3482     0.7211 0.000 0.872 0.128
#> SRR2313989     2  0.0000     0.7334 0.000 1.000 0.000
#> SRR2313983     1  0.0000     0.8241 1.000 0.000 0.000
#> SRR2313986     1  0.2066     0.8087 0.940 0.000 0.060
#> SRR2313982     1  0.0000     0.8241 1.000 0.000 0.000
#> SRR2313981     3  0.0237     0.6489 0.000 0.004 0.996

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2   0.353     0.7273 0.000 0.808 0.192 0.000
#> SRR2313980     2   0.000     0.8150 0.000 1.000 0.000 0.000
#> SRR2313979     1   0.495     0.6739 0.620 0.000 0.376 0.004
#> SRR2313977     2   0.419     0.5786 0.000 0.732 0.268 0.000
#> SRR2313976     2   0.121     0.8224 0.000 0.960 0.040 0.000
#> SRR2313975     1   0.495     0.6739 0.620 0.000 0.376 0.004
#> SRR2313973     1   0.482     0.1511 0.612 0.000 0.000 0.388
#> SRR2313974     4   0.788    -0.3858 0.300 0.000 0.312 0.388
#> SRR2313985     1   0.655     0.6335 0.540 0.000 0.376 0.084
#> SRR2313993     2   0.156     0.8217 0.000 0.944 0.056 0.000
#> SRR2313994     2   0.450     0.4868 0.000 0.684 0.316 0.000
#> SRR2313995     2   0.749     0.1410 0.000 0.464 0.188 0.348
#> SRR2314024     2   0.000     0.8150 0.000 1.000 0.000 0.000
#> SRR2314015     2   0.208     0.8121 0.000 0.916 0.084 0.000
#> SRR2314025     4   0.277     0.3893 0.116 0.000 0.004 0.880
#> SRR2314023     1   0.482     0.1511 0.612 0.000 0.000 0.388
#> SRR2314033     2   0.130     0.8225 0.000 0.956 0.044 0.000
#> SRR2314045     1   0.510     0.6290 0.568 0.000 0.428 0.004
#> SRR2314042     4   0.480     0.2109 0.000 0.000 0.384 0.616
#> SRR2314043     3   0.482     0.6492 0.000 0.388 0.612 0.000
#> SRR2314041     3   0.492     0.6122 0.000 0.424 0.576 0.000
#> SRR2314044     3   0.510     0.6003 0.000 0.432 0.564 0.004
#> SRR2314040     3   0.495     0.6560 0.004 0.376 0.620 0.000
#> SRR2314039     3   0.494     0.3142 0.000 0.004 0.624 0.372
#> SRR2314038     3   0.679     0.5897 0.024 0.408 0.520 0.048
#> SRR2314037     3   0.721     0.3242 0.000 0.144 0.476 0.380
#> SRR2314036     2   0.000     0.8150 0.000 1.000 0.000 0.000
#> SRR2314035     3   0.496     0.6543 0.004 0.380 0.616 0.000
#> SRR2314034     4   0.488     0.1614 0.000 0.000 0.408 0.592
#> SRR2314032     1   0.505     0.6492 0.588 0.000 0.408 0.004
#> SRR2314031     4   0.317     0.3558 0.160 0.000 0.000 0.840
#> SRR2314029     3   0.546     0.5976 0.000 0.432 0.552 0.016
#> SRR2314030     3   0.499     0.2767 0.004 0.000 0.608 0.388
#> SRR2314028     4   0.441     0.3366 0.000 0.000 0.300 0.700
#> SRR2314027     3   0.663     0.5824 0.000 0.164 0.624 0.212
#> SRR2314026     3   0.494     0.3142 0.000 0.004 0.624 0.372
#> SRR2314020     2   0.000     0.8150 0.000 1.000 0.000 0.000
#> SRR2314019     3   0.479     0.2993 0.000 0.000 0.620 0.380
#> SRR2314021     3   0.482     0.2854 0.000 0.000 0.612 0.388
#> SRR2314018     3   0.489     0.6268 0.000 0.412 0.588 0.000
#> SRR2314017     3   0.446     0.6261 0.004 0.280 0.716 0.000
#> SRR2314016     4   0.259     0.3872 0.116 0.000 0.000 0.884
#> SRR2314014     2   0.302     0.7779 0.000 0.852 0.148 0.000
#> SRR2314013     2   0.436     0.5129 0.000 0.708 0.292 0.000
#> SRR2314012     4   0.292     0.3906 0.116 0.000 0.008 0.876
#> SRR2314011     1   0.482     0.1511 0.612 0.000 0.000 0.388
#> SRR2314010     2   0.336     0.7476 0.000 0.824 0.176 0.000
#> SRR2314009     3   0.542     0.6591 0.000 0.352 0.624 0.024
#> SRR2314008     3   0.494     0.5953 0.000 0.436 0.564 0.000
#> SRR2314007     3   0.484     0.6421 0.000 0.396 0.604 0.000
#> SRR2314005     2   0.156     0.8214 0.000 0.944 0.056 0.000
#> SRR2314004     2   0.000     0.8150 0.000 1.000 0.000 0.000
#> SRR2314003     4   0.500    -0.0535 0.492 0.000 0.000 0.508
#> SRR2314006     2   0.000     0.8150 0.000 1.000 0.000 0.000
#> SRR2314002     3   0.238     0.2299 0.068 0.016 0.916 0.000
#> SRR2314001     2   0.413     0.6257 0.000 0.740 0.260 0.000
#> SRR2314000     3   0.769     0.4451 0.220 0.364 0.416 0.000
#> SRR2313998     2   0.327     0.7533 0.000 0.832 0.168 0.000
#> SRR2313996     3   0.479     0.6548 0.000 0.380 0.620 0.000
#> SRR2313999     1   0.482     0.1511 0.612 0.000 0.000 0.388
#> SRR2313997     2   0.000     0.8150 0.000 1.000 0.000 0.000
#> SRR2313992     4   0.480     0.2109 0.000 0.000 0.384 0.616
#> SRR2313991     3   0.494     0.5953 0.000 0.436 0.564 0.000
#> SRR2313990     3   0.479     0.6548 0.000 0.380 0.620 0.000
#> SRR2313988     1   0.495     0.6739 0.620 0.000 0.376 0.004
#> SRR2313987     4   0.782    -0.4119 0.256 0.000 0.356 0.388
#> SRR2313984     2   0.331     0.7589 0.000 0.828 0.172 0.000
#> SRR2313989     2   0.000     0.8150 0.000 1.000 0.000 0.000
#> SRR2313983     1   0.495     0.6739 0.620 0.000 0.376 0.004
#> SRR2313986     4   0.500    -0.0535 0.492 0.000 0.000 0.508
#> SRR2313982     1   0.495     0.6739 0.620 0.000 0.376 0.004
#> SRR2313981     4   0.498     0.0348 0.000 0.000 0.460 0.540

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     3  0.2648      0.779 0.000 0.152 0.848 0.000 0.000
#> SRR2313980     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0000      0.893 1.000 0.000 0.000 0.000 0.000
#> SRR2313977     3  0.3177      0.690 0.000 0.208 0.792 0.000 0.000
#> SRR2313976     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2313975     1  0.0000      0.893 1.000 0.000 0.000 0.000 0.000
#> SRR2313973     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313974     1  0.4235      0.351 0.576 0.000 0.000 0.000 0.424
#> SRR2313985     1  0.0963      0.870 0.964 0.000 0.000 0.000 0.036
#> SRR2313993     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2313994     3  0.4210      0.237 0.000 0.412 0.588 0.000 0.000
#> SRR2313995     3  0.4126      0.371 0.000 0.380 0.620 0.000 0.000
#> SRR2314024     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2314025     4  0.0000      0.867 0.000 0.000 0.000 1.000 0.000
#> SRR2314023     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314033     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     1  0.0000      0.893 1.000 0.000 0.000 0.000 0.000
#> SRR2314042     4  0.0000      0.867 0.000 0.000 0.000 1.000 0.000
#> SRR2314043     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314041     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314044     3  0.2280      0.806 0.000 0.000 0.880 0.120 0.000
#> SRR2314040     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314039     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314038     3  0.3074      0.719 0.000 0.000 0.804 0.196 0.000
#> SRR2314037     4  0.2773      0.708 0.000 0.000 0.164 0.836 0.000
#> SRR2314036     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314034     4  0.1341      0.823 0.000 0.000 0.056 0.944 0.000
#> SRR2314032     1  0.0000      0.893 1.000 0.000 0.000 0.000 0.000
#> SRR2314031     4  0.0000      0.867 0.000 0.000 0.000 1.000 0.000
#> SRR2314029     3  0.3039      0.724 0.000 0.000 0.808 0.192 0.000
#> SRR2314030     4  0.4304      0.056 0.000 0.000 0.484 0.516 0.000
#> SRR2314028     4  0.0000      0.867 0.000 0.000 0.000 1.000 0.000
#> SRR2314027     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314026     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314020     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314021     3  0.4182      0.270 0.000 0.000 0.600 0.400 0.000
#> SRR2314018     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314017     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314016     4  0.0000      0.867 0.000 0.000 0.000 1.000 0.000
#> SRR2314014     2  0.2605      0.758 0.000 0.852 0.148 0.000 0.000
#> SRR2314013     3  0.2471      0.784 0.000 0.136 0.864 0.000 0.000
#> SRR2314012     4  0.0000      0.867 0.000 0.000 0.000 1.000 0.000
#> SRR2314011     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314010     2  0.3857      0.514 0.000 0.688 0.312 0.000 0.000
#> SRR2314009     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314008     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314007     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2314005     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2314004     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     4  0.0963      0.845 0.000 0.000 0.000 0.964 0.036
#> SRR2314006     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     3  0.0290      0.890 0.008 0.000 0.992 0.000 0.000
#> SRR2314001     2  0.4045      0.456 0.000 0.644 0.356 0.000 0.000
#> SRR2314000     3  0.2377      0.805 0.128 0.000 0.872 0.000 0.000
#> SRR2313998     2  0.4268      0.170 0.000 0.556 0.444 0.000 0.000
#> SRR2313996     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2313999     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313997     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     4  0.0000      0.867 0.000 0.000 0.000 1.000 0.000
#> SRR2313991     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2313990     3  0.0000      0.894 0.000 0.000 1.000 0.000 0.000
#> SRR2313988     1  0.0000      0.893 1.000 0.000 0.000 0.000 0.000
#> SRR2313987     1  0.4262      0.314 0.560 0.000 0.000 0.000 0.440
#> SRR2313984     2  0.2230      0.792 0.000 0.884 0.116 0.000 0.000
#> SRR2313989     2  0.0000      0.887 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0000      0.893 1.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.0290      0.863 0.000 0.000 0.000 0.992 0.008
#> SRR2313982     1  0.0000      0.893 1.000 0.000 0.000 0.000 0.000
#> SRR2313981     4  0.3966      0.502 0.000 0.000 0.336 0.664 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
#> SRR2313978     2  0.4751    0.58959 0.000 0.624 0.300 0.000 0.000 0.076
#> SRR2313980     6  0.0000    0.79709 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313979     1  0.0000    0.91104 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     3  0.6052   -0.18093 0.000 0.256 0.380 0.000 0.000 0.364
#> SRR2313976     6  0.1863    0.79655 0.000 0.044 0.036 0.000 0.000 0.920
#> SRR2313975     1  0.1663    0.85005 0.912 0.088 0.000 0.000 0.000 0.000
#> SRR2313973     5  0.0000    0.85536 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313974     1  0.3868   -0.16338 0.504 0.000 0.000 0.000 0.496 0.000
#> SRR2313985     1  0.0790    0.88819 0.968 0.000 0.000 0.000 0.032 0.000
#> SRR2313993     6  0.2706    0.77662 0.000 0.104 0.036 0.000 0.000 0.860
#> SRR2313994     6  0.6067   -0.02067 0.000 0.276 0.324 0.000 0.000 0.400
#> SRR2313995     2  0.4918    0.56029 0.000 0.644 0.232 0.000 0.000 0.124
#> SRR2314024     6  0.0547    0.79578 0.000 0.020 0.000 0.000 0.000 0.980
#> SRR2314015     6  0.3998    0.67880 0.000 0.248 0.040 0.000 0.000 0.712
#> SRR2314025     4  0.1958    0.86053 0.000 0.100 0.000 0.896 0.004 0.000
#> SRR2314023     5  0.0000    0.85536 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314033     6  0.1498    0.80058 0.000 0.028 0.032 0.000 0.000 0.940
#> SRR2314045     1  0.0000    0.91104 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2314042     4  0.0405    0.87569 0.000 0.008 0.004 0.988 0.000 0.000
#> SRR2314043     3  0.2969    0.29856 0.000 0.224 0.776 0.000 0.000 0.000
#> SRR2314041     2  0.3847    0.55652 0.000 0.544 0.456 0.000 0.000 0.000
#> SRR2314044     2  0.5841    0.38882 0.000 0.480 0.300 0.220 0.000 0.000
#> SRR2314040     3  0.0260    0.54199 0.000 0.008 0.992 0.000 0.000 0.000
#> SRR2314039     2  0.3868    0.49486 0.000 0.508 0.492 0.000 0.000 0.000
#> SRR2314038     3  0.5133   -0.00192 0.000 0.336 0.564 0.100 0.000 0.000
#> SRR2314037     4  0.2872    0.78213 0.000 0.140 0.024 0.836 0.000 0.000
#> SRR2314036     6  0.0000    0.79709 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314035     3  0.0458    0.54302 0.000 0.016 0.984 0.000 0.000 0.000
#> SRR2314034     4  0.1983    0.84359 0.000 0.020 0.072 0.908 0.000 0.000
#> SRR2314032     1  0.0000    0.91104 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2314031     4  0.1958    0.86053 0.000 0.100 0.000 0.896 0.004 0.000
#> SRR2314029     2  0.5756    0.38413 0.000 0.508 0.272 0.220 0.000 0.000
#> SRR2314030     4  0.4144    0.38475 0.000 0.020 0.360 0.620 0.000 0.000
#> SRR2314028     4  0.0000    0.87691 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314027     2  0.3854    0.54748 0.000 0.536 0.464 0.000 0.000 0.000
#> SRR2314026     3  0.0363    0.54094 0.000 0.012 0.988 0.000 0.000 0.000
#> SRR2314020     6  0.0000    0.79709 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314019     3  0.5198    0.12866 0.000 0.204 0.616 0.180 0.000 0.000
#> SRR2314021     3  0.4300    0.12211 0.000 0.020 0.548 0.432 0.000 0.000
#> SRR2314018     3  0.0713    0.54004 0.000 0.028 0.972 0.000 0.000 0.000
#> SRR2314017     3  0.0146    0.54299 0.000 0.004 0.996 0.000 0.000 0.000
#> SRR2314016     4  0.1082    0.87472 0.000 0.040 0.000 0.956 0.004 0.000
#> SRR2314014     6  0.4650    0.64040 0.000 0.220 0.104 0.000 0.000 0.676
#> SRR2314013     3  0.6115   -0.23437 0.000 0.324 0.368 0.000 0.000 0.308
#> SRR2314012     4  0.0508    0.87729 0.000 0.012 0.000 0.984 0.004 0.000
#> SRR2314011     5  0.0000    0.85536 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2314010     2  0.4937    0.52347 0.000 0.652 0.196 0.000 0.000 0.152
#> SRR2314009     3  0.2219    0.43546 0.000 0.136 0.864 0.000 0.000 0.000
#> SRR2314008     3  0.2883    0.31331 0.000 0.212 0.788 0.000 0.000 0.000
#> SRR2314007     3  0.3869   -0.55551 0.000 0.500 0.500 0.000 0.000 0.000
#> SRR2314005     6  0.2527    0.78355 0.000 0.084 0.040 0.000 0.000 0.876
#> SRR2314004     6  0.0000    0.79709 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314003     4  0.3985    0.75645 0.000 0.100 0.000 0.760 0.140 0.000
#> SRR2314006     6  0.0858    0.79543 0.000 0.028 0.004 0.000 0.000 0.968
#> SRR2314002     3  0.3130    0.45291 0.048 0.124 0.828 0.000 0.000 0.000
#> SRR2314001     6  0.5767    0.35204 0.000 0.260 0.232 0.000 0.000 0.508
#> SRR2314000     3  0.4792    0.30942 0.148 0.180 0.672 0.000 0.000 0.000
#> SRR2313998     6  0.5796    0.27292 0.000 0.268 0.232 0.000 0.000 0.500
#> SRR2313996     2  0.3851    0.55794 0.000 0.540 0.460 0.000 0.000 0.000
#> SRR2313999     5  0.0000    0.85536 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313997     6  0.0000    0.79709 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313992     4  0.0692    0.87329 0.000 0.020 0.004 0.976 0.000 0.000
#> SRR2313991     3  0.2340    0.41563 0.000 0.148 0.852 0.000 0.000 0.000
#> SRR2313990     3  0.1957    0.47714 0.000 0.112 0.888 0.000 0.000 0.000
#> SRR2313988     1  0.0000    0.91104 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313987     5  0.3869   -0.13557 0.500 0.000 0.000 0.000 0.500 0.000
#> SRR2313984     6  0.4834    0.61205 0.000 0.260 0.100 0.000 0.000 0.640
#> SRR2313989     6  0.0000    0.79709 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     1  0.0000    0.91104 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.3159    0.82348 0.000 0.100 0.000 0.832 0.068 0.000
#> SRR2313982     1  0.0000    0.91104 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313981     4  0.2277    0.83904 0.000 0.032 0.076 0.892 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-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

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 16873 rows and 72 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 1.000           0.949       0.980         0.4981 0.503   0.503
#> 3 3 0.842           0.856       0.938         0.3312 0.797   0.608
#> 4 4 0.874           0.871       0.932         0.1409 0.805   0.492
#> 5 5 0.793           0.786       0.874         0.0574 0.916   0.677
#> 6 6 0.806           0.746       0.868         0.0336 0.924   0.660

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
#> SRR2313978     2  0.0000      0.982 0.000 1.000
#> SRR2313980     2  0.0000      0.982 0.000 1.000
#> SRR2313979     1  0.0000      0.977 1.000 0.000
#> SRR2313977     2  0.0000      0.982 0.000 1.000
#> SRR2313976     2  0.0000      0.982 0.000 1.000
#> SRR2313975     1  0.0000      0.977 1.000 0.000
#> SRR2313973     1  0.0000      0.977 1.000 0.000
#> SRR2313974     1  0.0000      0.977 1.000 0.000
#> SRR2313985     1  0.0000      0.977 1.000 0.000
#> SRR2313993     2  0.0000      0.982 0.000 1.000
#> SRR2313994     2  0.0000      0.982 0.000 1.000
#> SRR2313995     2  0.0000      0.982 0.000 1.000
#> SRR2314024     2  0.0000      0.982 0.000 1.000
#> SRR2314015     2  0.0000      0.982 0.000 1.000
#> SRR2314025     1  0.0000      0.977 1.000 0.000
#> SRR2314023     1  0.0000      0.977 1.000 0.000
#> SRR2314033     2  0.0000      0.982 0.000 1.000
#> SRR2314045     1  0.0000      0.977 1.000 0.000
#> SRR2314042     1  0.0000      0.977 1.000 0.000
#> SRR2314043     1  0.0000      0.977 1.000 0.000
#> SRR2314041     2  0.0376      0.978 0.004 0.996
#> SRR2314044     1  0.8499      0.619 0.724 0.276
#> SRR2314040     1  0.1843      0.954 0.972 0.028
#> SRR2314039     2  0.0672      0.975 0.008 0.992
#> SRR2314038     1  0.0000      0.977 1.000 0.000
#> SRR2314037     1  0.0000      0.977 1.000 0.000
#> SRR2314036     2  0.0000      0.982 0.000 1.000
#> SRR2314035     1  0.0000      0.977 1.000 0.000
#> SRR2314034     1  0.0000      0.977 1.000 0.000
#> SRR2314032     1  0.0000      0.977 1.000 0.000
#> SRR2314031     1  0.0000      0.977 1.000 0.000
#> SRR2314029     1  0.9944      0.160 0.544 0.456
#> SRR2314030     1  0.0000      0.977 1.000 0.000
#> SRR2314028     1  0.0000      0.977 1.000 0.000
#> SRR2314027     2  0.0000      0.982 0.000 1.000
#> SRR2314026     1  0.2948      0.931 0.948 0.052
#> SRR2314020     2  0.0000      0.982 0.000 1.000
#> SRR2314019     1  0.3584      0.914 0.932 0.068
#> SRR2314021     1  0.0000      0.977 1.000 0.000
#> SRR2314018     1  0.0000      0.977 1.000 0.000
#> SRR2314017     1  0.0000      0.977 1.000 0.000
#> SRR2314016     1  0.0000      0.977 1.000 0.000
#> SRR2314014     2  0.0000      0.982 0.000 1.000
#> SRR2314013     2  0.0000      0.982 0.000 1.000
#> SRR2314012     1  0.0000      0.977 1.000 0.000
#> SRR2314011     1  0.0000      0.977 1.000 0.000
#> SRR2314010     2  0.0000      0.982 0.000 1.000
#> SRR2314009     1  0.0000      0.977 1.000 0.000
#> SRR2314008     2  0.4161      0.895 0.084 0.916
#> SRR2314007     2  0.0000      0.982 0.000 1.000
#> SRR2314005     2  0.0000      0.982 0.000 1.000
#> SRR2314004     2  0.0000      0.982 0.000 1.000
#> SRR2314003     1  0.0000      0.977 1.000 0.000
#> SRR2314006     2  0.0000      0.982 0.000 1.000
#> SRR2314002     1  0.0000      0.977 1.000 0.000
#> SRR2314001     2  0.0000      0.982 0.000 1.000
#> SRR2314000     1  0.0000      0.977 1.000 0.000
#> SRR2313998     2  0.0000      0.982 0.000 1.000
#> SRR2313996     2  0.0000      0.982 0.000 1.000
#> SRR2313999     1  0.0000      0.977 1.000 0.000
#> SRR2313997     2  0.0000      0.982 0.000 1.000
#> SRR2313992     1  0.0000      0.977 1.000 0.000
#> SRR2313991     2  0.9866      0.209 0.432 0.568
#> SRR2313990     2  0.0000      0.982 0.000 1.000
#> SRR2313988     1  0.0000      0.977 1.000 0.000
#> SRR2313987     1  0.0000      0.977 1.000 0.000
#> SRR2313984     2  0.0000      0.982 0.000 1.000
#> SRR2313989     2  0.0000      0.982 0.000 1.000
#> SRR2313983     1  0.0000      0.977 1.000 0.000
#> SRR2313986     1  0.0000      0.977 1.000 0.000
#> SRR2313982     1  0.0000      0.977 1.000 0.000
#> SRR2313981     1  0.0000      0.977 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2313980     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2313979     1  0.0892     0.8749 0.980 0.000 0.020
#> SRR2313977     2  0.0747     0.9590 0.016 0.984 0.000
#> SRR2313976     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2313975     1  0.0237     0.8768 0.996 0.000 0.004
#> SRR2313973     3  0.1163     0.9203 0.028 0.000 0.972
#> SRR2313974     1  0.2165     0.8534 0.936 0.000 0.064
#> SRR2313985     1  0.1031     0.8734 0.976 0.000 0.024
#> SRR2313993     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2313994     2  0.0424     0.9638 0.000 0.992 0.008
#> SRR2313995     2  0.5785     0.5043 0.000 0.668 0.332
#> SRR2314024     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2314015     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2314025     3  0.0237     0.9321 0.004 0.000 0.996
#> SRR2314023     1  0.6045     0.4176 0.620 0.000 0.380
#> SRR2314033     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2314045     1  0.0424     0.8766 0.992 0.000 0.008
#> SRR2314042     3  0.0000     0.9323 0.000 0.000 1.000
#> SRR2314043     1  0.7438     0.3400 0.568 0.040 0.392
#> SRR2314041     3  0.5810     0.4955 0.000 0.336 0.664
#> SRR2314044     3  0.0424     0.9301 0.000 0.008 0.992
#> SRR2314040     1  0.0424     0.8744 0.992 0.000 0.008
#> SRR2314039     2  0.6111     0.3524 0.000 0.604 0.396
#> SRR2314038     3  0.3213     0.8756 0.028 0.060 0.912
#> SRR2314037     3  0.0000     0.9323 0.000 0.000 1.000
#> SRR2314036     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2314035     1  0.0237     0.8755 0.996 0.000 0.004
#> SRR2314034     3  0.0000     0.9323 0.000 0.000 1.000
#> SRR2314032     1  0.0237     0.8768 0.996 0.000 0.004
#> SRR2314031     3  0.0237     0.9321 0.004 0.000 0.996
#> SRR2314029     3  0.0747     0.9254 0.000 0.016 0.984
#> SRR2314030     3  0.0000     0.9323 0.000 0.000 1.000
#> SRR2314028     3  0.0000     0.9323 0.000 0.000 1.000
#> SRR2314027     2  0.1031     0.9537 0.000 0.976 0.024
#> SRR2314026     1  0.5551     0.6801 0.760 0.224 0.016
#> SRR2314020     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2314019     3  0.2959     0.8397 0.000 0.100 0.900
#> SRR2314021     3  0.3502     0.8520 0.084 0.020 0.896
#> SRR2314018     1  0.0237     0.8755 0.996 0.000 0.004
#> SRR2314017     1  0.3879     0.7839 0.848 0.000 0.152
#> SRR2314016     3  0.0592     0.9295 0.012 0.000 0.988
#> SRR2314014     2  0.0661     0.9627 0.008 0.988 0.004
#> SRR2314013     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2314012     3  0.0424     0.9312 0.008 0.000 0.992
#> SRR2314011     3  0.0892     0.9255 0.020 0.000 0.980
#> SRR2314010     2  0.0424     0.9636 0.000 0.992 0.008
#> SRR2314009     1  0.4575     0.7547 0.812 0.004 0.184
#> SRR2314008     2  0.0747     0.9592 0.016 0.984 0.000
#> SRR2314007     2  0.0424     0.9638 0.000 0.992 0.008
#> SRR2314005     2  0.0592     0.9613 0.012 0.988 0.000
#> SRR2314004     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2314003     3  0.0424     0.9312 0.008 0.000 0.992
#> SRR2314006     2  0.0237     0.9648 0.000 0.996 0.004
#> SRR2314002     1  0.0000     0.8759 1.000 0.000 0.000
#> SRR2314001     2  0.0848     0.9616 0.008 0.984 0.008
#> SRR2314000     1  0.0000     0.8759 1.000 0.000 0.000
#> SRR2313998     2  0.0237     0.9649 0.004 0.996 0.000
#> SRR2313996     2  0.0892     0.9572 0.000 0.980 0.020
#> SRR2313999     3  0.6308    -0.1072 0.492 0.000 0.508
#> SRR2313997     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2313992     3  0.0000     0.9323 0.000 0.000 1.000
#> SRR2313991     1  0.6302     0.0942 0.520 0.480 0.000
#> SRR2313990     2  0.1015     0.9594 0.012 0.980 0.008
#> SRR2313988     1  0.0237     0.8768 0.996 0.000 0.004
#> SRR2313987     1  0.5138     0.6775 0.748 0.000 0.252
#> SRR2313984     2  0.0424     0.9638 0.000 0.992 0.008
#> SRR2313989     2  0.0000     0.9660 0.000 1.000 0.000
#> SRR2313983     1  0.0747     0.8757 0.984 0.000 0.016
#> SRR2313986     3  0.0424     0.9312 0.008 0.000 0.992
#> SRR2313982     1  0.0892     0.8749 0.980 0.000 0.020
#> SRR2313981     3  0.0000     0.9323 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
#> SRR2313978     2  0.1004     0.9391 0.000 0.972 0.024 0.004
#> SRR2313980     2  0.0524     0.9484 0.000 0.988 0.008 0.004
#> SRR2313979     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.1209     0.9370 0.004 0.964 0.032 0.000
#> SRR2313976     2  0.0336     0.9494 0.000 0.992 0.008 0.000
#> SRR2313975     1  0.0188     0.9227 0.996 0.000 0.000 0.004
#> SRR2313973     4  0.1716     0.8707 0.064 0.000 0.000 0.936
#> SRR2313974     1  0.0817     0.9152 0.976 0.000 0.000 0.024
#> SRR2313985     1  0.0188     0.9226 0.996 0.000 0.000 0.004
#> SRR2313993     3  0.4103     0.6835 0.000 0.256 0.744 0.000
#> SRR2313994     3  0.1022     0.9415 0.000 0.032 0.968 0.000
#> SRR2313995     2  0.4182     0.7478 0.000 0.796 0.024 0.180
#> SRR2314024     2  0.0657     0.9470 0.000 0.984 0.012 0.004
#> SRR2314015     2  0.0188     0.9500 0.000 0.996 0.004 0.000
#> SRR2314025     4  0.0376     0.8992 0.004 0.000 0.004 0.992
#> SRR2314023     1  0.1940     0.8827 0.924 0.000 0.000 0.076
#> SRR2314033     2  0.0336     0.9494 0.000 0.992 0.008 0.000
#> SRR2314045     1  0.0921     0.9089 0.972 0.000 0.028 0.000
#> SRR2314042     4  0.0469     0.8971 0.000 0.000 0.012 0.988
#> SRR2314043     4  0.7268     0.3311 0.312 0.000 0.172 0.516
#> SRR2314041     4  0.1913     0.8750 0.000 0.040 0.020 0.940
#> SRR2314044     4  0.0188     0.8991 0.004 0.000 0.000 0.996
#> SRR2314040     3  0.1302     0.9305 0.044 0.000 0.956 0.000
#> SRR2314039     3  0.1284     0.9424 0.000 0.024 0.964 0.012
#> SRR2314038     4  0.8514     0.0726 0.292 0.312 0.024 0.372
#> SRR2314037     4  0.1302     0.8827 0.000 0.000 0.044 0.956
#> SRR2314036     2  0.0188     0.9500 0.000 0.996 0.004 0.000
#> SRR2314035     3  0.1940     0.9077 0.076 0.000 0.924 0.000
#> SRR2314034     3  0.1389     0.9275 0.000 0.000 0.952 0.048
#> SRR2314032     1  0.0188     0.9217 0.996 0.000 0.004 0.000
#> SRR2314031     4  0.0376     0.8992 0.004 0.000 0.004 0.992
#> SRR2314029     4  0.2053     0.8598 0.000 0.072 0.004 0.924
#> SRR2314030     3  0.2469     0.8766 0.000 0.000 0.892 0.108
#> SRR2314028     4  0.3583     0.7439 0.004 0.000 0.180 0.816
#> SRR2314027     3  0.1151     0.9428 0.000 0.024 0.968 0.008
#> SRR2314026     3  0.1042     0.9412 0.020 0.008 0.972 0.000
#> SRR2314020     2  0.0000     0.9494 0.000 1.000 0.000 0.000
#> SRR2314019     3  0.1059     0.9433 0.000 0.016 0.972 0.012
#> SRR2314021     3  0.0927     0.9405 0.008 0.000 0.976 0.016
#> SRR2314018     1  0.1356     0.9090 0.960 0.008 0.032 0.000
#> SRR2314017     1  0.5321     0.7076 0.740 0.004 0.064 0.192
#> SRR2314016     4  0.0707     0.8940 0.020 0.000 0.000 0.980
#> SRR2314014     3  0.3610     0.7555 0.000 0.200 0.800 0.000
#> SRR2314013     2  0.0000     0.9494 0.000 1.000 0.000 0.000
#> SRR2314012     4  0.0657     0.8981 0.004 0.000 0.012 0.984
#> SRR2314011     4  0.1637     0.8735 0.060 0.000 0.000 0.940
#> SRR2314010     2  0.2546     0.8839 0.000 0.900 0.092 0.008
#> SRR2314009     3  0.0804     0.9391 0.012 0.000 0.980 0.008
#> SRR2314008     2  0.2988     0.8708 0.012 0.876 0.112 0.000
#> SRR2314007     3  0.0707     0.9423 0.000 0.020 0.980 0.000
#> SRR2314005     2  0.0817     0.9406 0.000 0.976 0.024 0.000
#> SRR2314004     2  0.0707     0.9425 0.000 0.980 0.020 0.000
#> SRR2314003     4  0.0188     0.8991 0.004 0.000 0.000 0.996
#> SRR2314006     2  0.0657     0.9470 0.000 0.984 0.012 0.004
#> SRR2314002     1  0.0469     0.9208 0.988 0.000 0.012 0.000
#> SRR2314001     3  0.0921     0.9401 0.000 0.028 0.972 0.000
#> SRR2314000     1  0.0188     0.9227 0.996 0.000 0.000 0.004
#> SRR2313998     2  0.0188     0.9500 0.000 0.996 0.004 0.000
#> SRR2313996     3  0.1174     0.9442 0.000 0.020 0.968 0.012
#> SRR2313999     1  0.3400     0.7806 0.820 0.000 0.000 0.180
#> SRR2313997     2  0.0336     0.9472 0.000 0.992 0.008 0.000
#> SRR2313992     4  0.0524     0.8989 0.004 0.000 0.008 0.988
#> SRR2313991     1  0.5793     0.3475 0.580 0.384 0.036 0.000
#> SRR2313990     3  0.0921     0.9424 0.000 0.028 0.972 0.000
#> SRR2313988     1  0.0188     0.9217 0.996 0.000 0.004 0.000
#> SRR2313987     1  0.2760     0.8395 0.872 0.000 0.000 0.128
#> SRR2313984     2  0.4741     0.4824 0.000 0.668 0.328 0.004
#> SRR2313989     2  0.0188     0.9500 0.000 0.996 0.004 0.000
#> SRR2313983     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> SRR2313986     4  0.0188     0.8991 0.004 0.000 0.000 0.996
#> SRR2313982     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> SRR2313981     3  0.1557     0.9220 0.000 0.000 0.944 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
#> SRR2313978     5  0.6055      0.253 0.000 0.408 0.000 0.120 0.472
#> SRR2313980     2  0.0000      0.914 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0162      0.933 0.996 0.000 0.000 0.000 0.004
#> SRR2313977     5  0.4615      0.615 0.004 0.220 0.052 0.000 0.724
#> SRR2313976     2  0.0404      0.909 0.000 0.988 0.000 0.000 0.012
#> SRR2313975     1  0.0162      0.933 0.996 0.000 0.000 0.000 0.004
#> SRR2313973     4  0.1168      0.816 0.032 0.000 0.000 0.960 0.008
#> SRR2313974     1  0.1117      0.914 0.964 0.000 0.000 0.020 0.016
#> SRR2313985     1  0.0324      0.931 0.992 0.000 0.000 0.004 0.004
#> SRR2313993     3  0.3039      0.683 0.000 0.192 0.808 0.000 0.000
#> SRR2313994     3  0.0290      0.906 0.000 0.008 0.992 0.000 0.000
#> SRR2313995     2  0.2209      0.850 0.000 0.912 0.000 0.056 0.032
#> SRR2314024     2  0.0000      0.914 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     2  0.0000      0.914 0.000 1.000 0.000 0.000 0.000
#> SRR2314025     4  0.3242      0.773 0.000 0.000 0.000 0.784 0.216
#> SRR2314023     1  0.4712      0.600 0.684 0.000 0.000 0.268 0.048
#> SRR2314033     2  0.0000      0.914 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     1  0.1493      0.897 0.948 0.000 0.024 0.000 0.028
#> SRR2314042     4  0.3521      0.762 0.000 0.000 0.004 0.764 0.232
#> SRR2314043     5  0.4718      0.651 0.000 0.000 0.092 0.180 0.728
#> SRR2314041     5  0.6522      0.375 0.000 0.008 0.156 0.360 0.476
#> SRR2314044     4  0.2179      0.775 0.000 0.004 0.000 0.896 0.100
#> SRR2314040     3  0.0290      0.906 0.000 0.000 0.992 0.000 0.008
#> SRR2314039     3  0.1043      0.902 0.000 0.000 0.960 0.000 0.040
#> SRR2314038     5  0.5138      0.618 0.016 0.080 0.000 0.192 0.712
#> SRR2314037     4  0.2863      0.762 0.000 0.000 0.060 0.876 0.064
#> SRR2314036     2  0.0162      0.912 0.000 0.996 0.000 0.000 0.004
#> SRR2314035     3  0.0703      0.903 0.000 0.000 0.976 0.000 0.024
#> SRR2314034     3  0.1568      0.896 0.000 0.000 0.944 0.020 0.036
#> SRR2314032     1  0.0290      0.930 0.992 0.000 0.000 0.000 0.008
#> SRR2314031     4  0.2329      0.812 0.000 0.000 0.000 0.876 0.124
#> SRR2314029     4  0.3661      0.573 0.000 0.276 0.000 0.724 0.000
#> SRR2314030     3  0.6565      0.129 0.000 0.000 0.472 0.280 0.248
#> SRR2314028     4  0.4558      0.735 0.000 0.000 0.060 0.724 0.216
#> SRR2314027     3  0.0963      0.901 0.000 0.000 0.964 0.000 0.036
#> SRR2314026     3  0.0963      0.900 0.000 0.000 0.964 0.000 0.036
#> SRR2314020     2  0.0000      0.914 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     3  0.1270      0.892 0.000 0.000 0.948 0.000 0.052
#> SRR2314021     3  0.0963      0.901 0.000 0.000 0.964 0.000 0.036
#> SRR2314018     5  0.3992      0.643 0.012 0.000 0.268 0.000 0.720
#> SRR2314017     5  0.3961      0.591 0.212 0.000 0.028 0.000 0.760
#> SRR2314016     4  0.2690      0.810 0.000 0.000 0.000 0.844 0.156
#> SRR2314014     5  0.4276      0.479 0.000 0.004 0.380 0.000 0.616
#> SRR2314013     2  0.1364      0.893 0.000 0.952 0.012 0.000 0.036
#> SRR2314012     4  0.3305      0.768 0.000 0.000 0.000 0.776 0.224
#> SRR2314011     4  0.2450      0.783 0.052 0.000 0.000 0.900 0.048
#> SRR2314010     2  0.2389      0.788 0.000 0.880 0.116 0.000 0.004
#> SRR2314009     3  0.1043      0.896 0.000 0.000 0.960 0.000 0.040
#> SRR2314008     5  0.3684      0.632 0.000 0.000 0.280 0.000 0.720
#> SRR2314007     3  0.1792      0.863 0.000 0.000 0.916 0.000 0.084
#> SRR2314005     2  0.4367      0.353 0.000 0.620 0.008 0.000 0.372
#> SRR2314004     2  0.3561      0.624 0.000 0.740 0.000 0.000 0.260
#> SRR2314003     4  0.1704      0.796 0.004 0.000 0.000 0.928 0.068
#> SRR2314006     2  0.0000      0.914 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     1  0.0290      0.931 0.992 0.000 0.000 0.000 0.008
#> SRR2314001     3  0.0510      0.905 0.000 0.000 0.984 0.000 0.016
#> SRR2314000     1  0.0162      0.933 0.996 0.000 0.000 0.000 0.004
#> SRR2313998     2  0.0000      0.914 0.000 1.000 0.000 0.000 0.000
#> SRR2313996     3  0.0703      0.903 0.000 0.000 0.976 0.000 0.024
#> SRR2313999     4  0.5923      0.371 0.280 0.000 0.000 0.576 0.144
#> SRR2313997     2  0.1544      0.875 0.000 0.932 0.000 0.000 0.068
#> SRR2313992     4  0.0807      0.813 0.000 0.000 0.012 0.976 0.012
#> SRR2313991     5  0.5416      0.642 0.144 0.132 0.020 0.000 0.704
#> SRR2313990     3  0.0794      0.901 0.000 0.000 0.972 0.000 0.028
#> SRR2313988     1  0.0162      0.932 0.996 0.000 0.000 0.000 0.004
#> SRR2313987     1  0.4453      0.652 0.724 0.000 0.000 0.228 0.048
#> SRR2313984     2  0.2648      0.758 0.000 0.848 0.152 0.000 0.000
#> SRR2313989     2  0.0000      0.914 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0000      0.933 1.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.1357      0.803 0.004 0.000 0.000 0.948 0.048
#> SRR2313982     1  0.0162      0.932 0.996 0.000 0.000 0.000 0.004
#> SRR2313981     3  0.2209      0.862 0.000 0.000 0.912 0.056 0.032

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR2313978     6  0.6078     0.2063 0.000 0.220 0.008 0.000 0.304 0.468
#> SRR2313980     6  0.0458     0.8123 0.000 0.000 0.016 0.000 0.000 0.984
#> SRR2313979     1  0.0260     0.8946 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR2313977     2  0.1078     0.7390 0.000 0.964 0.008 0.000 0.012 0.016
#> SRR2313976     6  0.2358     0.7872 0.000 0.108 0.000 0.016 0.000 0.876
#> SRR2313975     1  0.0260     0.8946 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR2313973     5  0.2328     0.7970 0.052 0.000 0.000 0.056 0.892 0.000
#> SRR2313974     1  0.1010     0.8738 0.960 0.004 0.000 0.000 0.036 0.000
#> SRR2313985     1  0.0260     0.8946 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR2313993     3  0.1779     0.8694 0.000 0.016 0.920 0.000 0.000 0.064
#> SRR2313994     3  0.0458     0.9213 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR2313995     6  0.0713     0.8102 0.000 0.000 0.000 0.028 0.000 0.972
#> SRR2314024     6  0.0458     0.8123 0.000 0.000 0.016 0.000 0.000 0.984
#> SRR2314015     6  0.0363     0.8156 0.000 0.012 0.000 0.000 0.000 0.988
#> SRR2314025     4  0.2527     0.8512 0.000 0.000 0.000 0.832 0.168 0.000
#> SRR2314023     5  0.3052     0.6795 0.216 0.004 0.000 0.000 0.780 0.000
#> SRR2314033     6  0.2066     0.8006 0.000 0.072 0.000 0.024 0.000 0.904
#> SRR2314045     1  0.2196     0.8177 0.884 0.004 0.004 0.108 0.000 0.000
#> SRR2314042     4  0.2454     0.8545 0.000 0.000 0.000 0.840 0.160 0.000
#> SRR2314043     3  0.5875     0.0408 0.000 0.264 0.480 0.000 0.256 0.000
#> SRR2314041     2  0.5946     0.4185 0.000 0.552 0.196 0.008 0.236 0.008
#> SRR2314044     5  0.3663     0.6600 0.000 0.180 0.000 0.040 0.776 0.004
#> SRR2314040     3  0.0820     0.9239 0.000 0.016 0.972 0.012 0.000 0.000
#> SRR2314039     3  0.1194     0.9161 0.000 0.004 0.956 0.032 0.000 0.008
#> SRR2314038     2  0.2737     0.6746 0.004 0.832 0.000 0.000 0.160 0.004
#> SRR2314037     5  0.3109     0.6238 0.000 0.000 0.224 0.004 0.772 0.000
#> SRR2314036     6  0.1765     0.7985 0.000 0.096 0.000 0.000 0.000 0.904
#> SRR2314035     3  0.0909     0.9235 0.000 0.020 0.968 0.012 0.000 0.000
#> SRR2314034     3  0.1668     0.8929 0.000 0.004 0.928 0.008 0.060 0.000
#> SRR2314032     1  0.0713     0.8810 0.972 0.000 0.000 0.028 0.000 0.000
#> SRR2314031     4  0.4301     0.7509 0.000 0.064 0.000 0.696 0.240 0.000
#> SRR2314029     6  0.6448     0.1778 0.000 0.088 0.000 0.088 0.376 0.448
#> SRR2314030     4  0.0748     0.7611 0.000 0.004 0.016 0.976 0.004 0.000
#> SRR2314028     4  0.2006     0.8401 0.000 0.000 0.004 0.892 0.104 0.000
#> SRR2314027     3  0.1080     0.9169 0.000 0.004 0.960 0.032 0.000 0.004
#> SRR2314026     3  0.2149     0.8749 0.000 0.004 0.888 0.104 0.000 0.004
#> SRR2314020     6  0.0260     0.8155 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR2314019     3  0.1788     0.8971 0.000 0.004 0.916 0.076 0.000 0.004
#> SRR2314021     3  0.1285     0.9124 0.000 0.004 0.944 0.052 0.000 0.000
#> SRR2314018     2  0.2199     0.7392 0.000 0.892 0.088 0.000 0.020 0.000
#> SRR2314017     2  0.3472     0.6698 0.012 0.804 0.004 0.160 0.020 0.000
#> SRR2314016     4  0.5147     0.4301 0.000 0.096 0.000 0.548 0.356 0.000
#> SRR2314014     2  0.4041     0.3180 0.000 0.584 0.408 0.004 0.000 0.004
#> SRR2314013     6  0.4875     0.6349 0.000 0.224 0.008 0.100 0.000 0.668
#> SRR2314012     4  0.2378     0.8550 0.000 0.000 0.000 0.848 0.152 0.000
#> SRR2314011     5  0.0622     0.8273 0.012 0.000 0.000 0.008 0.980 0.000
#> SRR2314010     6  0.3298     0.5942 0.000 0.000 0.236 0.000 0.008 0.756
#> SRR2314009     3  0.0603     0.9233 0.000 0.016 0.980 0.000 0.004 0.000
#> SRR2314008     2  0.1829     0.7490 0.000 0.920 0.056 0.000 0.024 0.000
#> SRR2314007     3  0.0146     0.9239 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR2314005     2  0.3702     0.4397 0.000 0.720 0.004 0.012 0.000 0.264
#> SRR2314004     6  0.3804     0.3915 0.000 0.424 0.000 0.000 0.000 0.576
#> SRR2314003     5  0.0909     0.8220 0.000 0.012 0.000 0.020 0.968 0.000
#> SRR2314006     6  0.0363     0.8130 0.000 0.000 0.012 0.000 0.000 0.988
#> SRR2314002     1  0.4159     0.3323 0.588 0.396 0.000 0.016 0.000 0.000
#> SRR2314001     3  0.0692     0.9233 0.000 0.020 0.976 0.004 0.000 0.000
#> SRR2314000     1  0.0260     0.8946 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR2313998     6  0.1010     0.8148 0.000 0.036 0.004 0.000 0.000 0.960
#> SRR2313996     3  0.0777     0.9211 0.000 0.024 0.972 0.004 0.000 0.000
#> SRR2313999     5  0.2250     0.7867 0.092 0.020 0.000 0.000 0.888 0.000
#> SRR2313997     6  0.3266     0.6572 0.000 0.272 0.000 0.000 0.000 0.728
#> SRR2313992     5  0.2201     0.7876 0.000 0.000 0.028 0.076 0.896 0.000
#> SRR2313991     2  0.2170     0.7295 0.008 0.912 0.008 0.056 0.000 0.016
#> SRR2313990     3  0.0547     0.9226 0.000 0.020 0.980 0.000 0.000 0.000
#> SRR2313988     1  0.0000     0.8935 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313987     1  0.3979     0.0547 0.540 0.004 0.000 0.000 0.456 0.000
#> SRR2313984     6  0.2631     0.6856 0.000 0.000 0.180 0.000 0.000 0.820
#> SRR2313989     6  0.0260     0.8158 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR2313983     1  0.0000     0.8935 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     5  0.0692     0.8231 0.000 0.004 0.000 0.020 0.976 0.000
#> SRR2313982     1  0.0146     0.8936 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR2313981     3  0.0820     0.9209 0.000 0.012 0.972 0.000 0.016 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-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

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 16873 rows and 72 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 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-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.453           0.723       0.865         0.4551 0.493   0.493
#> 3 3 0.630           0.774       0.893         0.3804 0.718   0.500
#> 4 4 0.636           0.682       0.795         0.1242 0.930   0.807
#> 5 5 0.657           0.732       0.834         0.0723 0.919   0.738
#> 6 6 0.718           0.758       0.828         0.0458 0.965   0.851

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
#> SRR2313978     2  0.0000      0.894 0.000 1.000
#> SRR2313980     2  0.0000      0.894 0.000 1.000
#> SRR2313979     1  0.0000      0.752 1.000 0.000
#> SRR2313977     2  0.0000      0.894 0.000 1.000
#> SRR2313976     2  0.0000      0.894 0.000 1.000
#> SRR2313975     1  0.0376      0.752 0.996 0.004
#> SRR2313973     1  0.0000      0.752 1.000 0.000
#> SRR2313974     1  0.2603      0.755 0.956 0.044
#> SRR2313985     1  0.0000      0.752 1.000 0.000
#> SRR2313993     2  0.0000      0.894 0.000 1.000
#> SRR2313994     2  0.0376      0.891 0.004 0.996
#> SRR2313995     2  0.0000      0.894 0.000 1.000
#> SRR2314024     2  0.0000      0.894 0.000 1.000
#> SRR2314015     2  0.0000      0.894 0.000 1.000
#> SRR2314025     1  0.2423      0.755 0.960 0.040
#> SRR2314023     1  0.0000      0.752 1.000 0.000
#> SRR2314033     2  0.0000      0.894 0.000 1.000
#> SRR2314045     1  0.0000      0.752 1.000 0.000
#> SRR2314042     1  0.8327      0.691 0.736 0.264
#> SRR2314043     1  0.9983      0.379 0.524 0.476
#> SRR2314041     2  0.8909      0.428 0.308 0.692
#> SRR2314044     2  0.8909      0.428 0.308 0.692
#> SRR2314040     2  0.9552      0.202 0.376 0.624
#> SRR2314039     2  0.8267      0.549 0.260 0.740
#> SRR2314038     1  0.9866      0.500 0.568 0.432
#> SRR2314037     1  0.9635      0.593 0.612 0.388
#> SRR2314036     2  0.0000      0.894 0.000 1.000
#> SRR2314035     2  0.9552      0.202 0.376 0.624
#> SRR2314034     1  0.8955      0.664 0.688 0.312
#> SRR2314032     1  0.0000      0.752 1.000 0.000
#> SRR2314031     1  0.5059      0.745 0.888 0.112
#> SRR2314029     2  0.2423      0.860 0.040 0.960
#> SRR2314030     1  0.9608      0.601 0.616 0.384
#> SRR2314028     1  0.8081      0.699 0.752 0.248
#> SRR2314027     2  0.8267      0.549 0.260 0.740
#> SRR2314026     1  0.9522      0.617 0.628 0.372
#> SRR2314020     2  0.0000      0.894 0.000 1.000
#> SRR2314019     1  0.9522      0.617 0.628 0.372
#> SRR2314021     1  0.9522      0.617 0.628 0.372
#> SRR2314018     2  0.9552      0.202 0.376 0.624
#> SRR2314017     1  0.9491      0.622 0.632 0.368
#> SRR2314016     1  0.9491      0.622 0.632 0.368
#> SRR2314014     2  0.0000      0.894 0.000 1.000
#> SRR2314013     2  0.0000      0.894 0.000 1.000
#> SRR2314012     1  0.1414      0.754 0.980 0.020
#> SRR2314011     1  0.0000      0.752 1.000 0.000
#> SRR2314010     2  0.0000      0.894 0.000 1.000
#> SRR2314009     1  0.9635      0.593 0.612 0.388
#> SRR2314008     2  0.0000      0.894 0.000 1.000
#> SRR2314007     2  0.8207      0.557 0.256 0.744
#> SRR2314005     2  0.0000      0.894 0.000 1.000
#> SRR2314004     2  0.0000      0.894 0.000 1.000
#> SRR2314003     1  0.2236      0.755 0.964 0.036
#> SRR2314006     2  0.0000      0.894 0.000 1.000
#> SRR2314002     1  0.9491      0.622 0.632 0.368
#> SRR2314001     2  0.0000      0.894 0.000 1.000
#> SRR2314000     1  0.9983      0.379 0.524 0.476
#> SRR2313998     2  0.1633      0.874 0.024 0.976
#> SRR2313996     2  0.0000      0.894 0.000 1.000
#> SRR2313999     1  0.0000      0.752 1.000 0.000
#> SRR2313997     2  0.0000      0.894 0.000 1.000
#> SRR2313992     1  0.9635      0.593 0.612 0.388
#> SRR2313991     1  0.9491      0.622 0.632 0.368
#> SRR2313990     2  0.0000      0.894 0.000 1.000
#> SRR2313988     1  0.0000      0.752 1.000 0.000
#> SRR2313987     1  0.0000      0.752 1.000 0.000
#> SRR2313984     2  0.0000      0.894 0.000 1.000
#> SRR2313989     2  0.0000      0.894 0.000 1.000
#> SRR2313983     1  0.0000      0.752 1.000 0.000
#> SRR2313986     1  0.5059      0.745 0.888 0.112
#> SRR2313982     1  0.0000      0.752 1.000 0.000
#> SRR2313981     1  0.9635      0.593 0.612 0.388

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.1411      0.972 0.000 0.964 0.036
#> SRR2313980     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.804 1.000 0.000 0.000
#> SRR2313977     2  0.1289      0.972 0.000 0.968 0.032
#> SRR2313976     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2313975     1  0.5591      0.662 0.696 0.000 0.304
#> SRR2313973     1  0.0000      0.804 1.000 0.000 0.000
#> SRR2313974     3  0.5859      0.252 0.344 0.000 0.656
#> SRR2313985     1  0.0237      0.805 0.996 0.000 0.004
#> SRR2313993     2  0.1411      0.972 0.000 0.964 0.036
#> SRR2313994     2  0.1643      0.967 0.000 0.956 0.044
#> SRR2313995     2  0.1643      0.968 0.000 0.956 0.044
#> SRR2314024     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314015     2  0.1411      0.972 0.000 0.964 0.036
#> SRR2314025     3  0.5760      0.299 0.328 0.000 0.672
#> SRR2314023     1  0.0237      0.805 0.996 0.000 0.004
#> SRR2314033     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314045     1  0.5291      0.707 0.732 0.000 0.268
#> SRR2314042     3  0.3038      0.694 0.104 0.000 0.896
#> SRR2314043     3  0.3116      0.741 0.000 0.108 0.892
#> SRR2314041     3  0.5760      0.569 0.000 0.328 0.672
#> SRR2314044     3  0.5760      0.569 0.000 0.328 0.672
#> SRR2314040     3  0.5291      0.637 0.000 0.268 0.732
#> SRR2314039     3  0.6026      0.483 0.000 0.376 0.624
#> SRR2314038     3  0.2165      0.758 0.000 0.064 0.936
#> SRR2314037     3  0.0892      0.769 0.000 0.020 0.980
#> SRR2314036     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314035     3  0.5254      0.640 0.000 0.264 0.736
#> SRR2314034     3  0.1964      0.734 0.056 0.000 0.944
#> SRR2314032     1  0.5291      0.707 0.732 0.000 0.268
#> SRR2314031     3  0.5178      0.472 0.256 0.000 0.744
#> SRR2314029     2  0.3267      0.891 0.000 0.884 0.116
#> SRR2314030     3  0.0747      0.767 0.000 0.016 0.984
#> SRR2314028     3  0.3340      0.677 0.120 0.000 0.880
#> SRR2314027     3  0.6026      0.483 0.000 0.376 0.624
#> SRR2314026     3  0.0237      0.766 0.000 0.004 0.996
#> SRR2314020     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314019     3  0.0237      0.766 0.000 0.004 0.996
#> SRR2314021     3  0.0237      0.766 0.000 0.004 0.996
#> SRR2314018     3  0.5254      0.640 0.000 0.264 0.736
#> SRR2314017     3  0.0000      0.764 0.000 0.000 1.000
#> SRR2314016     3  0.0000      0.764 0.000 0.000 1.000
#> SRR2314014     2  0.1289      0.972 0.000 0.968 0.032
#> SRR2314013     2  0.1289      0.972 0.000 0.968 0.032
#> SRR2314012     1  0.6307      0.244 0.512 0.000 0.488
#> SRR2314011     1  0.3752      0.775 0.856 0.000 0.144
#> SRR2314010     2  0.1411      0.972 0.000 0.964 0.036
#> SRR2314009     3  0.0892      0.769 0.000 0.020 0.980
#> SRR2314008     2  0.2959      0.908 0.000 0.900 0.100
#> SRR2314007     3  0.6045      0.474 0.000 0.380 0.620
#> SRR2314005     2  0.0747      0.970 0.000 0.984 0.016
#> SRR2314004     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314003     3  0.6079      0.116 0.388 0.000 0.612
#> SRR2314006     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2314002     3  0.0000      0.764 0.000 0.000 1.000
#> SRR2314001     2  0.1411      0.972 0.000 0.964 0.036
#> SRR2314000     3  0.3116      0.741 0.000 0.108 0.892
#> SRR2313998     2  0.2261      0.946 0.000 0.932 0.068
#> SRR2313996     2  0.1411      0.972 0.000 0.964 0.036
#> SRR2313999     1  0.5810      0.614 0.664 0.000 0.336
#> SRR2313997     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2313992     3  0.0892      0.769 0.000 0.020 0.980
#> SRR2313991     3  0.0000      0.764 0.000 0.000 1.000
#> SRR2313990     2  0.1411      0.972 0.000 0.964 0.036
#> SRR2313988     1  0.5291      0.707 0.732 0.000 0.268
#> SRR2313987     1  0.1031      0.801 0.976 0.000 0.024
#> SRR2313984     2  0.1411      0.972 0.000 0.964 0.036
#> SRR2313989     2  0.0000      0.966 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.804 1.000 0.000 0.000
#> SRR2313986     3  0.5178      0.472 0.256 0.000 0.744
#> SRR2313982     1  0.0000      0.804 1.000 0.000 0.000
#> SRR2313981     3  0.0892      0.769 0.000 0.020 0.980

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.0000     0.8444 0.000 1.000 0.000 0.000
#> SRR2313980     2  0.4679     0.7625 0.000 0.648 0.000 0.352
#> SRR2313979     1  0.0000     0.8881 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.0592     0.8461 0.000 0.984 0.000 0.016
#> SRR2313976     2  0.4679     0.7625 0.000 0.648 0.000 0.352
#> SRR2313975     4  0.6619     0.4920 0.332 0.000 0.100 0.568
#> SRR2313973     1  0.0000     0.8881 1.000 0.000 0.000 0.000
#> SRR2313974     4  0.6633     0.5919 0.084 0.000 0.416 0.500
#> SRR2313985     1  0.1022     0.8818 0.968 0.000 0.000 0.032
#> SRR2313993     2  0.0000     0.8444 0.000 1.000 0.000 0.000
#> SRR2313994     2  0.0336     0.8406 0.000 0.992 0.008 0.000
#> SRR2313995     2  0.1256     0.8385 0.000 0.964 0.008 0.028
#> SRR2314024     2  0.4103     0.7903 0.000 0.744 0.000 0.256
#> SRR2314015     2  0.0000     0.8444 0.000 1.000 0.000 0.000
#> SRR2314025     4  0.6487     0.5689 0.072 0.000 0.428 0.500
#> SRR2314023     1  0.2081     0.8374 0.916 0.000 0.000 0.084
#> SRR2314033     2  0.4679     0.7625 0.000 0.648 0.000 0.352
#> SRR2314045     4  0.6451     0.4328 0.404 0.000 0.072 0.524
#> SRR2314042     3  0.4220     0.3322 0.000 0.004 0.748 0.248
#> SRR2314043     3  0.3428     0.7088 0.000 0.144 0.844 0.012
#> SRR2314041     3  0.4889     0.5798 0.000 0.360 0.636 0.004
#> SRR2314044     3  0.4889     0.5798 0.000 0.360 0.636 0.004
#> SRR2314040     3  0.4868     0.6225 0.000 0.304 0.684 0.012
#> SRR2314039     3  0.4888     0.5218 0.000 0.412 0.588 0.000
#> SRR2314038     3  0.2413     0.7288 0.000 0.064 0.916 0.020
#> SRR2314037     3  0.1211     0.7364 0.000 0.040 0.960 0.000
#> SRR2314036     2  0.4679     0.7625 0.000 0.648 0.000 0.352
#> SRR2314035     3  0.4844     0.6249 0.000 0.300 0.688 0.012
#> SRR2314034     3  0.1902     0.6736 0.000 0.004 0.932 0.064
#> SRR2314032     4  0.6451     0.4328 0.404 0.000 0.072 0.524
#> SRR2314031     4  0.5000     0.3910 0.000 0.000 0.500 0.500
#> SRR2314029     2  0.2593     0.7750 0.000 0.904 0.080 0.016
#> SRR2314030     3  0.1637     0.7109 0.000 0.000 0.940 0.060
#> SRR2314028     3  0.4522     0.1470 0.000 0.000 0.680 0.320
#> SRR2314027     3  0.4888     0.5218 0.000 0.412 0.588 0.000
#> SRR2314026     3  0.0672     0.7242 0.000 0.008 0.984 0.008
#> SRR2314020     2  0.4679     0.7625 0.000 0.648 0.000 0.352
#> SRR2314019     3  0.0672     0.7242 0.000 0.008 0.984 0.008
#> SRR2314021     3  0.0672     0.7242 0.000 0.008 0.984 0.008
#> SRR2314018     3  0.4844     0.6249 0.000 0.300 0.688 0.012
#> SRR2314017     3  0.1118     0.7192 0.000 0.000 0.964 0.036
#> SRR2314016     3  0.1211     0.7145 0.000 0.000 0.960 0.040
#> SRR2314014     2  0.0592     0.8461 0.000 0.984 0.000 0.016
#> SRR2314013     2  0.1978     0.8405 0.000 0.928 0.004 0.068
#> SRR2314012     4  0.7500     0.6067 0.248 0.000 0.252 0.500
#> SRR2314011     1  0.5712    -0.0436 0.584 0.000 0.032 0.384
#> SRR2314010     2  0.0000     0.8444 0.000 1.000 0.000 0.000
#> SRR2314009     3  0.1211     0.7364 0.000 0.040 0.960 0.000
#> SRR2314008     2  0.1716     0.7863 0.000 0.936 0.064 0.000
#> SRR2314007     3  0.4898     0.5136 0.000 0.416 0.584 0.000
#> SRR2314005     2  0.4040     0.7992 0.000 0.752 0.000 0.248
#> SRR2314004     2  0.4661     0.7642 0.000 0.652 0.000 0.348
#> SRR2314003     4  0.6794     0.6330 0.104 0.000 0.372 0.524
#> SRR2314006     2  0.4679     0.7625 0.000 0.648 0.000 0.352
#> SRR2314002     3  0.1118     0.7192 0.000 0.000 0.964 0.036
#> SRR2314001     2  0.0000     0.8444 0.000 1.000 0.000 0.000
#> SRR2314000     3  0.3428     0.7088 0.000 0.144 0.844 0.012
#> SRR2313998     2  0.1174     0.8278 0.000 0.968 0.020 0.012
#> SRR2313996     2  0.0000     0.8444 0.000 1.000 0.000 0.000
#> SRR2313999     4  0.7143     0.4935 0.380 0.000 0.136 0.484
#> SRR2313997     2  0.4679     0.7625 0.000 0.648 0.000 0.352
#> SRR2313992     3  0.1211     0.7364 0.000 0.040 0.960 0.000
#> SRR2313991     3  0.1118     0.7192 0.000 0.000 0.964 0.036
#> SRR2313990     2  0.0000     0.8444 0.000 1.000 0.000 0.000
#> SRR2313988     4  0.6451     0.4328 0.404 0.000 0.072 0.524
#> SRR2313987     1  0.1724     0.8677 0.948 0.000 0.020 0.032
#> SRR2313984     2  0.0000     0.8444 0.000 1.000 0.000 0.000
#> SRR2313989     2  0.4679     0.7625 0.000 0.648 0.000 0.352
#> SRR2313983     1  0.0336     0.8877 0.992 0.000 0.000 0.008
#> SRR2313986     3  0.5000    -0.4698 0.000 0.000 0.504 0.496
#> SRR2313982     1  0.0000     0.8881 1.000 0.000 0.000 0.000
#> SRR2313981     3  0.1211     0.7364 0.000 0.040 0.960 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
#> SRR2313978     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> SRR2313980     5  0.2127      0.977 0.000 0.108 0.000 0.000 0.892
#> SRR2313979     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.0794      0.920 0.000 0.972 0.000 0.000 0.028
#> SRR2313976     5  0.2127      0.977 0.000 0.108 0.000 0.000 0.892
#> SRR2313975     4  0.2472      0.506 0.012 0.000 0.036 0.908 0.044
#> SRR2313973     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000
#> SRR2313974     4  0.5546      0.655 0.084 0.000 0.340 0.576 0.000
#> SRR2313985     1  0.1121      0.881 0.956 0.000 0.000 0.044 0.000
#> SRR2313993     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> SRR2313994     2  0.0451      0.927 0.000 0.988 0.008 0.000 0.004
#> SRR2313995     2  0.1697      0.906 0.000 0.932 0.008 0.000 0.060
#> SRR2314024     2  0.4182      0.155 0.000 0.600 0.000 0.000 0.400
#> SRR2314015     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> SRR2314025     4  0.5558      0.653 0.072 0.000 0.344 0.580 0.004
#> SRR2314023     1  0.1965      0.844 0.904 0.000 0.000 0.096 0.000
#> SRR2314033     5  0.2127      0.977 0.000 0.108 0.000 0.000 0.892
#> SRR2314045     4  0.4658      0.482 0.196 0.000 0.028 0.744 0.032
#> SRR2314042     3  0.4102      0.226 0.000 0.004 0.692 0.300 0.004
#> SRR2314043     3  0.3213      0.727 0.000 0.144 0.836 0.016 0.004
#> SRR2314041     3  0.4211      0.577 0.000 0.360 0.636 0.000 0.004
#> SRR2314044     3  0.4211      0.577 0.000 0.360 0.636 0.000 0.004
#> SRR2314040     3  0.4240      0.640 0.000 0.304 0.684 0.008 0.004
#> SRR2314039     3  0.4210      0.478 0.000 0.412 0.588 0.000 0.000
#> SRR2314038     3  0.3279      0.730 0.000 0.064 0.868 0.028 0.040
#> SRR2314037     3  0.1043      0.747 0.000 0.040 0.960 0.000 0.000
#> SRR2314036     5  0.2127      0.977 0.000 0.108 0.000 0.000 0.892
#> SRR2314035     3  0.4220      0.644 0.000 0.300 0.688 0.008 0.004
#> SRR2314034     3  0.1704      0.688 0.000 0.004 0.928 0.068 0.000
#> SRR2314032     4  0.4658      0.482 0.196 0.000 0.028 0.744 0.032
#> SRR2314031     4  0.4367      0.551 0.000 0.000 0.416 0.580 0.004
#> SRR2314029     2  0.2233      0.858 0.000 0.904 0.080 0.000 0.016
#> SRR2314030     3  0.2659      0.700 0.000 0.000 0.888 0.052 0.060
#> SRR2314028     3  0.4321     -0.071 0.000 0.000 0.600 0.396 0.004
#> SRR2314027     3  0.4210      0.478 0.000 0.412 0.588 0.000 0.000
#> SRR2314026     3  0.0579      0.734 0.000 0.008 0.984 0.008 0.000
#> SRR2314020     5  0.2127      0.977 0.000 0.108 0.000 0.000 0.892
#> SRR2314019     3  0.0579      0.734 0.000 0.008 0.984 0.008 0.000
#> SRR2314021     3  0.0579      0.734 0.000 0.008 0.984 0.008 0.000
#> SRR2314018     3  0.4220      0.644 0.000 0.300 0.688 0.008 0.004
#> SRR2314017     3  0.2153      0.715 0.000 0.000 0.916 0.040 0.044
#> SRR2314016     3  0.2376      0.707 0.000 0.000 0.904 0.052 0.044
#> SRR2314014     2  0.0794      0.920 0.000 0.972 0.000 0.000 0.028
#> SRR2314013     2  0.2970      0.757 0.000 0.828 0.004 0.000 0.168
#> SRR2314012     4  0.6207      0.583 0.244 0.000 0.184 0.568 0.004
#> SRR2314011     1  0.4383      0.113 0.572 0.000 0.004 0.424 0.000
#> SRR2314010     2  0.0703      0.924 0.000 0.976 0.000 0.000 0.024
#> SRR2314009     3  0.1043      0.747 0.000 0.040 0.960 0.000 0.000
#> SRR2314008     2  0.1478      0.878 0.000 0.936 0.064 0.000 0.000
#> SRR2314007     3  0.4219      0.470 0.000 0.416 0.584 0.000 0.000
#> SRR2314005     5  0.3561      0.758 0.000 0.260 0.000 0.000 0.740
#> SRR2314004     5  0.2179      0.973 0.000 0.112 0.000 0.000 0.888
#> SRR2314003     4  0.5488      0.657 0.092 0.000 0.300 0.608 0.000
#> SRR2314006     5  0.2127      0.977 0.000 0.108 0.000 0.000 0.892
#> SRR2314002     3  0.2153      0.715 0.000 0.000 0.916 0.040 0.044
#> SRR2314001     2  0.0000      0.930 0.000 1.000 0.000 0.000 0.000
#> SRR2314000     3  0.3213      0.727 0.000 0.144 0.836 0.016 0.004
#> SRR2313998     2  0.1186      0.913 0.000 0.964 0.020 0.008 0.008
#> SRR2313996     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> SRR2313999     4  0.5530      0.362 0.368 0.000 0.076 0.556 0.000
#> SRR2313997     5  0.2127      0.977 0.000 0.108 0.000 0.000 0.892
#> SRR2313992     3  0.1043      0.747 0.000 0.040 0.960 0.000 0.000
#> SRR2313991     3  0.2153      0.715 0.000 0.000 0.916 0.040 0.044
#> SRR2313990     2  0.0000      0.930 0.000 1.000 0.000 0.000 0.000
#> SRR2313988     4  0.4658      0.482 0.196 0.000 0.028 0.744 0.032
#> SRR2313987     1  0.1725      0.873 0.936 0.000 0.020 0.044 0.000
#> SRR2313984     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> SRR2313989     5  0.2127      0.977 0.000 0.108 0.000 0.000 0.892
#> SRR2313983     1  0.1251      0.874 0.956 0.000 0.000 0.036 0.008
#> SRR2313986     4  0.4383      0.545 0.000 0.000 0.424 0.572 0.004
#> SRR2313982     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000
#> SRR2313981     3  0.1043      0.747 0.000 0.040 0.960 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
#> SRR2313978     2  0.0291      0.923 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR2313980     6  0.0865      0.971 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR2313979     1  0.0000      0.876 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.0858      0.915 0.000 0.968 0.000 0.004 0.000 0.028
#> SRR2313976     6  0.0865      0.971 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR2313975     5  0.1970      0.770 0.000 0.000 0.028 0.060 0.912 0.000
#> SRR2313973     1  0.0000      0.876 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313974     4  0.3377      0.742 0.084 0.000 0.080 0.828 0.008 0.000
#> SRR2313985     1  0.1151      0.871 0.956 0.000 0.000 0.012 0.032 0.000
#> SRR2313993     2  0.0146      0.923 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR2313994     2  0.1036      0.911 0.000 0.964 0.008 0.024 0.000 0.004
#> SRR2313995     2  0.2165      0.889 0.000 0.912 0.008 0.024 0.004 0.052
#> SRR2314024     2  0.3843      0.110 0.000 0.548 0.000 0.000 0.000 0.452
#> SRR2314015     2  0.0291      0.923 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR2314025     4  0.2965      0.745 0.072 0.000 0.080 0.848 0.000 0.000
#> SRR2314023     1  0.2106      0.838 0.904 0.000 0.000 0.064 0.032 0.000
#> SRR2314033     6  0.0865      0.971 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR2314045     5  0.4414      0.914 0.184 0.000 0.028 0.052 0.736 0.000
#> SRR2314042     4  0.3828      0.239 0.000 0.000 0.440 0.560 0.000 0.000
#> SRR2314043     3  0.3920      0.707 0.000 0.112 0.768 0.120 0.000 0.000
#> SRR2314041     3  0.4344      0.587 0.000 0.356 0.612 0.032 0.000 0.000
#> SRR2314044     3  0.4344      0.587 0.000 0.356 0.612 0.032 0.000 0.000
#> SRR2314040     3  0.4066      0.674 0.000 0.272 0.692 0.036 0.000 0.000
#> SRR2314039     3  0.3915      0.535 0.000 0.412 0.584 0.004 0.000 0.000
#> SRR2314038     3  0.5139      0.653 0.000 0.064 0.740 0.092 0.068 0.036
#> SRR2314037     3  0.2058      0.721 0.000 0.036 0.908 0.056 0.000 0.000
#> SRR2314036     6  0.0865      0.971 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR2314035     3  0.4045      0.677 0.000 0.268 0.696 0.036 0.000 0.000
#> SRR2314034     3  0.2402      0.648 0.000 0.000 0.856 0.140 0.004 0.000
#> SRR2314032     5  0.4414      0.914 0.184 0.000 0.028 0.052 0.736 0.000
#> SRR2314031     4  0.1556      0.728 0.000 0.000 0.080 0.920 0.000 0.000
#> SRR2314029     2  0.2344      0.853 0.000 0.892 0.076 0.028 0.004 0.000
#> SRR2314030     3  0.5312      0.485 0.000 0.000 0.648 0.228 0.088 0.036
#> SRR2314028     4  0.3221      0.582 0.000 0.000 0.264 0.736 0.000 0.000
#> SRR2314027     3  0.3915      0.535 0.000 0.412 0.584 0.004 0.000 0.000
#> SRR2314026     3  0.1843      0.698 0.000 0.004 0.912 0.080 0.004 0.000
#> SRR2314020     6  0.0865      0.971 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR2314019     3  0.1843      0.698 0.000 0.004 0.912 0.080 0.004 0.000
#> SRR2314021     3  0.1843      0.698 0.000 0.004 0.912 0.080 0.004 0.000
#> SRR2314018     3  0.4045      0.677 0.000 0.268 0.696 0.036 0.000 0.000
#> SRR2314017     3  0.4004      0.638 0.000 0.000 0.796 0.084 0.084 0.036
#> SRR2314016     3  0.4770      0.587 0.000 0.000 0.720 0.164 0.080 0.036
#> SRR2314014     2  0.0713      0.916 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR2314013     2  0.3385      0.752 0.000 0.796 0.004 0.028 0.000 0.172
#> SRR2314012     4  0.3488      0.546 0.244 0.000 0.008 0.744 0.004 0.000
#> SRR2314011     1  0.4445      0.264 0.572 0.000 0.000 0.396 0.032 0.000
#> SRR2314010     2  0.0713      0.917 0.000 0.972 0.000 0.000 0.000 0.028
#> SRR2314009     3  0.2058      0.721 0.000 0.036 0.908 0.056 0.000 0.000
#> SRR2314008     2  0.1471      0.871 0.000 0.932 0.064 0.004 0.000 0.000
#> SRR2314007     3  0.3923      0.528 0.000 0.416 0.580 0.004 0.000 0.000
#> SRR2314005     6  0.3440      0.724 0.000 0.196 0.000 0.028 0.000 0.776
#> SRR2314004     6  0.0937      0.966 0.000 0.040 0.000 0.000 0.000 0.960
#> SRR2314003     4  0.3876      0.722 0.092 0.000 0.072 0.804 0.032 0.000
#> SRR2314006     6  0.0865      0.971 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR2314002     3  0.4004      0.638 0.000 0.000 0.796 0.084 0.084 0.036
#> SRR2314001     2  0.0000      0.922 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314000     3  0.3920      0.707 0.000 0.112 0.768 0.120 0.000 0.000
#> SRR2313998     2  0.1636      0.894 0.000 0.936 0.024 0.036 0.000 0.004
#> SRR2313996     2  0.0146      0.923 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR2313999     4  0.4868      0.251 0.368 0.000 0.020 0.580 0.032 0.000
#> SRR2313997     6  0.0865      0.971 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR2313992     3  0.2058      0.721 0.000 0.036 0.908 0.056 0.000 0.000
#> SRR2313991     3  0.4004      0.638 0.000 0.000 0.796 0.084 0.084 0.036
#> SRR2313990     2  0.0000      0.922 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313988     5  0.4414      0.914 0.184 0.000 0.028 0.052 0.736 0.000
#> SRR2313987     1  0.1642      0.866 0.936 0.000 0.004 0.028 0.032 0.000
#> SRR2313984     2  0.0146      0.923 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR2313989     6  0.0865      0.971 0.000 0.036 0.000 0.000 0.000 0.964
#> SRR2313983     1  0.1007      0.855 0.956 0.000 0.000 0.000 0.044 0.000
#> SRR2313986     4  0.1663      0.728 0.000 0.000 0.088 0.912 0.000 0.000
#> SRR2313982     1  0.0000      0.876 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313981     3  0.2058      0.721 0.000 0.036 0.908 0.056 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-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

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

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

collect_plots(res)

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 0.759           0.894       0.950         0.4965 0.493   0.493
#> 3 3 1.000           0.980       0.991         0.3177 0.672   0.436
#> 4 4 0.615           0.543       0.706         0.1193 0.939   0.826
#> 5 5 0.633           0.431       0.662         0.0721 0.760   0.375
#> 6 6 0.651           0.556       0.726         0.0397 0.848   0.462

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
#> SRR2313978     2   0.000      0.986 0.000 1.000
#> SRR2313980     2   0.000      0.986 0.000 1.000
#> SRR2313979     1   0.000      0.904 1.000 0.000
#> SRR2313977     2   0.000      0.986 0.000 1.000
#> SRR2313976     2   0.000      0.986 0.000 1.000
#> SRR2313975     1   0.000      0.904 1.000 0.000
#> SRR2313973     1   0.000      0.904 1.000 0.000
#> SRR2313974     1   0.000      0.904 1.000 0.000
#> SRR2313985     1   0.000      0.904 1.000 0.000
#> SRR2313993     2   0.000      0.986 0.000 1.000
#> SRR2313994     2   0.000      0.986 0.000 1.000
#> SRR2313995     2   0.000      0.986 0.000 1.000
#> SRR2314024     2   0.000      0.986 0.000 1.000
#> SRR2314015     2   0.000      0.986 0.000 1.000
#> SRR2314025     1   0.000      0.904 1.000 0.000
#> SRR2314023     1   0.000      0.904 1.000 0.000
#> SRR2314033     2   0.000      0.986 0.000 1.000
#> SRR2314045     1   0.000      0.904 1.000 0.000
#> SRR2314042     1   0.000      0.904 1.000 0.000
#> SRR2314043     1   0.955      0.520 0.624 0.376
#> SRR2314041     2   0.000      0.986 0.000 1.000
#> SRR2314044     2   0.000      0.986 0.000 1.000
#> SRR2314040     2   0.753      0.681 0.216 0.784
#> SRR2314039     2   0.000      0.986 0.000 1.000
#> SRR2314038     2   0.000      0.986 0.000 1.000
#> SRR2314037     1   0.952      0.528 0.628 0.372
#> SRR2314036     2   0.000      0.986 0.000 1.000
#> SRR2314035     1   0.955      0.520 0.624 0.376
#> SRR2314034     1   0.000      0.904 1.000 0.000
#> SRR2314032     1   0.000      0.904 1.000 0.000
#> SRR2314031     1   0.000      0.904 1.000 0.000
#> SRR2314029     2   0.000      0.986 0.000 1.000
#> SRR2314030     1   0.000      0.904 1.000 0.000
#> SRR2314028     1   0.000      0.904 1.000 0.000
#> SRR2314027     2   0.000      0.986 0.000 1.000
#> SRR2314026     1   0.949      0.535 0.632 0.368
#> SRR2314020     2   0.000      0.986 0.000 1.000
#> SRR2314019     1   0.949      0.535 0.632 0.368
#> SRR2314021     1   0.000      0.904 1.000 0.000
#> SRR2314018     2   0.738      0.696 0.208 0.792
#> SRR2314017     1   0.738      0.747 0.792 0.208
#> SRR2314016     1   0.000      0.904 1.000 0.000
#> SRR2314014     2   0.000      0.986 0.000 1.000
#> SRR2314013     2   0.000      0.986 0.000 1.000
#> SRR2314012     1   0.000      0.904 1.000 0.000
#> SRR2314011     1   0.000      0.904 1.000 0.000
#> SRR2314010     2   0.000      0.986 0.000 1.000
#> SRR2314009     1   0.952      0.528 0.628 0.372
#> SRR2314008     2   0.000      0.986 0.000 1.000
#> SRR2314007     2   0.000      0.986 0.000 1.000
#> SRR2314005     2   0.000      0.986 0.000 1.000
#> SRR2314004     2   0.000      0.986 0.000 1.000
#> SRR2314003     1   0.000      0.904 1.000 0.000
#> SRR2314006     2   0.000      0.986 0.000 1.000
#> SRR2314002     1   0.738      0.747 0.792 0.208
#> SRR2314001     2   0.000      0.986 0.000 1.000
#> SRR2314000     1   0.955      0.520 0.624 0.376
#> SRR2313998     2   0.000      0.986 0.000 1.000
#> SRR2313996     2   0.000      0.986 0.000 1.000
#> SRR2313999     1   0.000      0.904 1.000 0.000
#> SRR2313997     2   0.000      0.986 0.000 1.000
#> SRR2313992     1   0.000      0.904 1.000 0.000
#> SRR2313991     2   0.000      0.986 0.000 1.000
#> SRR2313990     2   0.000      0.986 0.000 1.000
#> SRR2313988     1   0.000      0.904 1.000 0.000
#> SRR2313987     1   0.000      0.904 1.000 0.000
#> SRR2313984     2   0.000      0.986 0.000 1.000
#> SRR2313989     2   0.000      0.986 0.000 1.000
#> SRR2313983     1   0.000      0.904 1.000 0.000
#> SRR2313986     1   0.000      0.904 1.000 0.000
#> SRR2313982     1   0.000      0.904 1.000 0.000
#> SRR2313981     1   0.552      0.818 0.872 0.128

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313980     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313977     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313976     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313975     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313973     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313974     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313985     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313993     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313994     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313995     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314024     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314015     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314025     1  0.4555      0.764 0.800 0.000 0.200
#> SRR2314023     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2314033     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314045     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2314042     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314043     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314041     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314044     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314040     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314039     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314038     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314037     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314036     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314035     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314034     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314032     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2314031     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314029     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314030     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314028     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314027     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314026     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314020     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314019     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314021     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314018     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314017     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314016     3  0.1031      0.974 0.024 0.000 0.976
#> SRR2314014     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314013     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314012     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2314011     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2314010     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314009     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314008     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314007     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314005     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314004     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314003     1  0.4178      0.802 0.828 0.000 0.172
#> SRR2314006     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314002     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2314001     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2314000     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2313998     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313996     2  0.4842      0.705 0.000 0.776 0.224
#> SRR2313999     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313997     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313992     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2313991     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2313990     3  0.0424      0.991 0.000 0.008 0.992
#> SRR2313988     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313987     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313984     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313989     2  0.0000      0.989 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313986     3  0.0000      0.999 0.000 0.000 1.000
#> SRR2313982     1  0.0000      0.974 1.000 0.000 0.000
#> SRR2313981     3  0.0000      0.999 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
#> SRR2313978     2  0.1557     0.5297 0.000 0.944 0.056 0.000
#> SRR2313980     4  0.5000     1.0000 0.000 0.496 0.000 0.504
#> SRR2313979     1  0.0188     0.8737 0.996 0.000 0.000 0.004
#> SRR2313977     2  0.2124     0.5205 0.000 0.924 0.068 0.008
#> SRR2313976     2  0.4985    -0.8993 0.000 0.532 0.000 0.468
#> SRR2313975     1  0.5165     0.7910 0.752 0.000 0.080 0.168
#> SRR2313973     1  0.0000     0.8739 1.000 0.000 0.000 0.000
#> SRR2313974     1  0.3208     0.8444 0.848 0.000 0.004 0.148
#> SRR2313985     1  0.0000     0.8739 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.1557     0.4859 0.000 0.944 0.000 0.056
#> SRR2313994     2  0.0188     0.5411 0.000 0.996 0.004 0.000
#> SRR2313995     2  0.3942    -0.0317 0.000 0.764 0.000 0.236
#> SRR2314024     2  0.5000    -0.9811 0.000 0.504 0.000 0.496
#> SRR2314015     2  0.0336     0.5432 0.000 0.992 0.008 0.000
#> SRR2314025     1  0.7472     0.4614 0.504 0.000 0.232 0.264
#> SRR2314023     1  0.0000     0.8739 1.000 0.000 0.000 0.000
#> SRR2314033     2  0.4999    -0.9424 0.000 0.508 0.000 0.492
#> SRR2314045     1  0.5375     0.7460 0.744 0.000 0.116 0.140
#> SRR2314042     3  0.4193     0.6359 0.000 0.000 0.732 0.268
#> SRR2314043     3  0.1209     0.7271 0.000 0.032 0.964 0.004
#> SRR2314041     3  0.4985     0.2880 0.000 0.468 0.532 0.000
#> SRR2314044     3  0.4866     0.4205 0.000 0.404 0.596 0.000
#> SRR2314040     3  0.4283     0.5954 0.000 0.256 0.740 0.004
#> SRR2314039     3  0.5016     0.4298 0.000 0.396 0.600 0.004
#> SRR2314038     3  0.5221     0.6610 0.000 0.060 0.732 0.208
#> SRR2314037     3  0.0921     0.7277 0.000 0.028 0.972 0.000
#> SRR2314036     4  0.5000     1.0000 0.000 0.496 0.000 0.504
#> SRR2314035     3  0.1211     0.7254 0.000 0.040 0.960 0.000
#> SRR2314034     3  0.4103     0.6429 0.000 0.000 0.744 0.256
#> SRR2314032     1  0.2216     0.8470 0.908 0.000 0.000 0.092
#> SRR2314031     3  0.4222     0.6313 0.000 0.000 0.728 0.272
#> SRR2314029     3  0.5213     0.5197 0.000 0.328 0.652 0.020
#> SRR2314030     3  0.4776     0.5775 0.000 0.000 0.624 0.376
#> SRR2314028     3  0.4134     0.6363 0.000 0.000 0.740 0.260
#> SRR2314027     3  0.5028     0.4237 0.000 0.400 0.596 0.004
#> SRR2314026     3  0.1118     0.7301 0.000 0.000 0.964 0.036
#> SRR2314020     4  0.5000     1.0000 0.000 0.496 0.000 0.504
#> SRR2314019     3  0.1867     0.7243 0.000 0.000 0.928 0.072
#> SRR2314021     3  0.2868     0.7050 0.000 0.000 0.864 0.136
#> SRR2314018     3  0.3942     0.6139 0.000 0.236 0.764 0.000
#> SRR2314017     3  0.3764     0.6593 0.000 0.000 0.784 0.216
#> SRR2314016     3  0.4994     0.4687 0.000 0.000 0.520 0.480
#> SRR2314014     2  0.0672     0.5431 0.000 0.984 0.008 0.008
#> SRR2314013     2  0.0336     0.5391 0.000 0.992 0.000 0.008
#> SRR2314012     1  0.5434     0.7349 0.696 0.000 0.052 0.252
#> SRR2314011     1  0.1867     0.8650 0.928 0.000 0.000 0.072
#> SRR2314010     2  0.1474     0.4917 0.000 0.948 0.000 0.052
#> SRR2314009     3  0.0921     0.7277 0.000 0.028 0.972 0.000
#> SRR2314008     3  0.4877     0.4136 0.000 0.408 0.592 0.000
#> SRR2314007     3  0.5028     0.4237 0.000 0.400 0.596 0.004
#> SRR2314005     2  0.4040    -0.1179 0.000 0.752 0.000 0.248
#> SRR2314004     2  0.4843    -0.7227 0.000 0.604 0.000 0.396
#> SRR2314003     1  0.7450     0.4687 0.508 0.000 0.228 0.264
#> SRR2314006     4  0.5000     1.0000 0.000 0.496 0.000 0.504
#> SRR2314002     3  0.3907     0.6498 0.000 0.000 0.768 0.232
#> SRR2314001     2  0.1118     0.5406 0.000 0.964 0.036 0.000
#> SRR2314000     3  0.1798     0.7267 0.000 0.040 0.944 0.016
#> SRR2313998     2  0.0592     0.5441 0.000 0.984 0.016 0.000
#> SRR2313996     2  0.4994    -0.2284 0.000 0.520 0.480 0.000
#> SRR2313999     1  0.2868     0.8470 0.864 0.000 0.000 0.136
#> SRR2313997     4  0.5000     1.0000 0.000 0.496 0.000 0.504
#> SRR2313992     3  0.4040     0.6446 0.000 0.000 0.752 0.248
#> SRR2313991     3  0.5257     0.6598 0.000 0.060 0.728 0.212
#> SRR2313990     2  0.5168    -0.2650 0.000 0.504 0.492 0.004
#> SRR2313988     1  0.0707     0.8732 0.980 0.000 0.000 0.020
#> SRR2313987     1  0.0188     0.8741 0.996 0.000 0.000 0.004
#> SRR2313984     2  0.3172     0.2563 0.000 0.840 0.000 0.160
#> SRR2313989     4  0.5000     1.0000 0.000 0.496 0.000 0.504
#> SRR2313983     1  0.0188     0.8737 0.996 0.000 0.000 0.004
#> SRR2313986     3  0.4250     0.6300 0.000 0.000 0.724 0.276
#> SRR2313982     1  0.0188     0.8737 0.996 0.000 0.000 0.004
#> SRR2313981     3  0.0817     0.7300 0.000 0.000 0.976 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
#> SRR2313978     3  0.5382     0.5047 0.000 0.104 0.644 0.000 0.252
#> SRR2313980     2  0.0162     0.8332 0.000 0.996 0.000 0.000 0.004
#> SRR2313979     1  0.0290     0.8518 0.992 0.000 0.000 0.000 0.008
#> SRR2313977     3  0.5757     0.4878 0.000 0.104 0.560 0.000 0.336
#> SRR2313976     2  0.3488     0.7365 0.000 0.808 0.024 0.000 0.168
#> SRR2313975     1  0.6394     0.5344 0.504 0.000 0.000 0.292 0.204
#> SRR2313973     1  0.0000     0.8520 1.000 0.000 0.000 0.000 0.000
#> SRR2313974     1  0.5704     0.6492 0.620 0.000 0.000 0.232 0.148
#> SRR2313985     1  0.0000     0.8520 1.000 0.000 0.000 0.000 0.000
#> SRR2313993     3  0.6558     0.3674 0.000 0.232 0.468 0.000 0.300
#> SRR2313994     3  0.6220     0.4446 0.000 0.168 0.524 0.000 0.308
#> SRR2313995     2  0.6422     0.0166 0.000 0.460 0.360 0.000 0.180
#> SRR2314024     2  0.0510     0.8315 0.000 0.984 0.000 0.000 0.016
#> SRR2314015     3  0.5952     0.4621 0.000 0.164 0.584 0.000 0.252
#> SRR2314025     4  0.5888     0.1113 0.288 0.000 0.000 0.576 0.136
#> SRR2314023     1  0.0000     0.8520 1.000 0.000 0.000 0.000 0.000
#> SRR2314033     2  0.1522     0.8111 0.000 0.944 0.012 0.000 0.044
#> SRR2314045     1  0.5693     0.5892 0.620 0.000 0.000 0.144 0.236
#> SRR2314042     4  0.2409     0.4316 0.000 0.000 0.032 0.900 0.068
#> SRR2314043     4  0.6032    -0.1516 0.000 0.000 0.424 0.460 0.116
#> SRR2314041     3  0.2464     0.4174 0.000 0.000 0.888 0.016 0.096
#> SRR2314044     3  0.2879     0.2623 0.000 0.000 0.868 0.100 0.032
#> SRR2314040     3  0.5480    -0.3607 0.000 0.000 0.560 0.368 0.072
#> SRR2314039     3  0.3398     0.0478 0.000 0.000 0.780 0.216 0.004
#> SRR2314038     5  0.6236     0.8011 0.000 0.000 0.400 0.144 0.456
#> SRR2314037     4  0.4707     0.1158 0.000 0.000 0.392 0.588 0.020
#> SRR2314036     2  0.0000     0.8329 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     3  0.5857    -0.4595 0.000 0.000 0.460 0.444 0.096
#> SRR2314034     4  0.2079     0.4161 0.000 0.000 0.064 0.916 0.020
#> SRR2314032     1  0.3690     0.7415 0.764 0.000 0.000 0.012 0.224
#> SRR2314031     4  0.3197     0.4164 0.000 0.000 0.024 0.836 0.140
#> SRR2314029     3  0.3967     0.2202 0.000 0.000 0.800 0.092 0.108
#> SRR2314030     4  0.5434    -0.1366 0.000 0.000 0.076 0.588 0.336
#> SRR2314028     4  0.1992     0.4397 0.000 0.000 0.044 0.924 0.032
#> SRR2314027     3  0.2338     0.2414 0.000 0.000 0.884 0.112 0.004
#> SRR2314026     4  0.4800     0.1357 0.000 0.000 0.368 0.604 0.028
#> SRR2314020     2  0.0404     0.8323 0.000 0.988 0.000 0.000 0.012
#> SRR2314019     4  0.4570     0.1754 0.000 0.000 0.348 0.632 0.020
#> SRR2314021     4  0.4400     0.2085 0.000 0.000 0.308 0.672 0.020
#> SRR2314018     3  0.5922    -0.4119 0.000 0.000 0.520 0.368 0.112
#> SRR2314017     5  0.6706     0.7438 0.000 0.000 0.288 0.284 0.428
#> SRR2314016     4  0.4256     0.0944 0.000 0.000 0.000 0.564 0.436
#> SRR2314014     3  0.6215     0.4396 0.000 0.156 0.508 0.000 0.336
#> SRR2314013     3  0.6360     0.4110 0.000 0.172 0.476 0.000 0.352
#> SRR2314012     4  0.5976    -0.1397 0.376 0.000 0.000 0.508 0.116
#> SRR2314011     1  0.3647     0.7740 0.816 0.000 0.000 0.132 0.052
#> SRR2314010     3  0.6307     0.4016 0.000 0.224 0.532 0.000 0.244
#> SRR2314009     4  0.5524    -0.0229 0.000 0.000 0.416 0.516 0.068
#> SRR2314008     3  0.1830     0.2655 0.000 0.000 0.932 0.028 0.040
#> SRR2314007     3  0.2124     0.2546 0.000 0.000 0.900 0.096 0.004
#> SRR2314005     2  0.6526     0.2266 0.000 0.464 0.212 0.000 0.324
#> SRR2314004     2  0.5005     0.5585 0.000 0.660 0.064 0.000 0.276
#> SRR2314003     4  0.5905     0.1065 0.292 0.000 0.000 0.572 0.136
#> SRR2314006     2  0.0162     0.8332 0.000 0.996 0.000 0.000 0.004
#> SRR2314002     5  0.6332     0.7770 0.000 0.000 0.264 0.212 0.524
#> SRR2314001     3  0.5864     0.4834 0.000 0.128 0.572 0.000 0.300
#> SRR2314000     3  0.6392    -0.5004 0.000 0.000 0.432 0.400 0.168
#> SRR2313998     3  0.6220     0.4446 0.000 0.168 0.524 0.000 0.308
#> SRR2313996     3  0.3607     0.5319 0.000 0.004 0.752 0.000 0.244
#> SRR2313999     1  0.5256     0.6600 0.672 0.000 0.000 0.212 0.116
#> SRR2313997     2  0.0290     0.8328 0.000 0.992 0.000 0.000 0.008
#> SRR2313992     4  0.1544     0.4276 0.000 0.000 0.068 0.932 0.000
#> SRR2313991     5  0.6405     0.8237 0.000 0.000 0.384 0.172 0.444
#> SRR2313990     3  0.3885     0.5263 0.000 0.000 0.724 0.008 0.268
#> SRR2313988     1  0.2069     0.8304 0.912 0.000 0.000 0.012 0.076
#> SRR2313987     1  0.0771     0.8495 0.976 0.000 0.000 0.004 0.020
#> SRR2313984     3  0.6738     0.2726 0.000 0.280 0.412 0.000 0.308
#> SRR2313989     2  0.0000     0.8329 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0290     0.8518 0.992 0.000 0.000 0.000 0.008
#> SRR2313986     4  0.3197     0.4164 0.000 0.000 0.024 0.836 0.140
#> SRR2313982     1  0.0290     0.8518 0.992 0.000 0.000 0.000 0.008
#> SRR2313981     4  0.4599     0.1670 0.000 0.000 0.356 0.624 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
#> SRR2313978     2  0.4870     0.6858 0.000 0.740 0.048 0.008 0.096 0.108
#> SRR2313980     6  0.0363     0.8785 0.000 0.000 0.000 0.012 0.000 0.988
#> SRR2313979     1  0.0146     0.8158 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR2313977     2  0.4424     0.6619 0.000 0.776 0.012 0.036 0.068 0.108
#> SRR2313976     6  0.5413     0.5744 0.000 0.224 0.000 0.044 0.088 0.644
#> SRR2313975     4  0.7910     0.0814 0.248 0.108 0.044 0.392 0.208 0.000
#> SRR2313973     1  0.0508     0.8145 0.984 0.000 0.000 0.012 0.004 0.000
#> SRR2313974     4  0.5725     0.2733 0.296 0.048 0.008 0.588 0.060 0.000
#> SRR2313985     1  0.0458     0.8147 0.984 0.000 0.000 0.016 0.000 0.000
#> SRR2313993     2  0.4193     0.6308 0.000 0.740 0.008 0.032 0.012 0.208
#> SRR2313994     2  0.3002     0.6807 0.000 0.836 0.008 0.020 0.000 0.136
#> SRR2313995     2  0.6475     0.3521 0.000 0.456 0.036 0.036 0.076 0.396
#> SRR2314024     6  0.1453     0.8722 0.000 0.008 0.000 0.040 0.008 0.944
#> SRR2314015     2  0.4456     0.6847 0.000 0.748 0.028 0.000 0.080 0.144
#> SRR2314025     4  0.3229     0.6432 0.120 0.000 0.048 0.828 0.004 0.000
#> SRR2314023     1  0.0964     0.8112 0.968 0.012 0.000 0.016 0.004 0.000
#> SRR2314033     6  0.2727     0.8160 0.000 0.028 0.000 0.028 0.064 0.880
#> SRR2314045     1  0.7234     0.4364 0.492 0.088 0.080 0.064 0.276 0.000
#> SRR2314042     4  0.4264    -0.0826 0.000 0.000 0.488 0.496 0.016 0.000
#> SRR2314043     3  0.3031     0.5858 0.000 0.044 0.844 0.004 0.108 0.000
#> SRR2314041     2  0.5284     0.4499 0.000 0.596 0.296 0.012 0.096 0.000
#> SRR2314044     2  0.5840     0.1740 0.000 0.468 0.404 0.024 0.104 0.000
#> SRR2314040     3  0.3079     0.5962 0.000 0.128 0.836 0.008 0.028 0.000
#> SRR2314039     3  0.4768     0.4008 0.000 0.244 0.668 0.008 0.080 0.000
#> SRR2314038     5  0.4401     0.7325 0.000 0.060 0.168 0.028 0.744 0.000
#> SRR2314037     3  0.2432     0.6422 0.000 0.024 0.888 0.080 0.008 0.000
#> SRR2314036     6  0.0000     0.8790 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314035     3  0.3270     0.5590 0.000 0.060 0.820 0.000 0.120 0.000
#> SRR2314034     3  0.3670     0.4421 0.000 0.000 0.704 0.284 0.012 0.000
#> SRR2314032     1  0.5951     0.5756 0.600 0.088 0.008 0.056 0.248 0.000
#> SRR2314031     4  0.2743     0.5718 0.000 0.000 0.164 0.828 0.008 0.000
#> SRR2314029     2  0.6443     0.2547 0.000 0.448 0.336 0.036 0.180 0.000
#> SRR2314030     5  0.6091     0.4127 0.000 0.008 0.296 0.228 0.468 0.000
#> SRR2314028     3  0.4072     0.1092 0.000 0.000 0.544 0.448 0.008 0.000
#> SRR2314027     3  0.5350     0.0551 0.000 0.376 0.532 0.012 0.080 0.000
#> SRR2314026     3  0.2195     0.6374 0.000 0.016 0.904 0.068 0.012 0.000
#> SRR2314020     6  0.0922     0.8771 0.000 0.004 0.000 0.024 0.004 0.968
#> SRR2314019     3  0.2308     0.6359 0.000 0.016 0.896 0.076 0.012 0.000
#> SRR2314021     3  0.2520     0.6188 0.000 0.008 0.872 0.108 0.012 0.000
#> SRR2314018     3  0.4463     0.4952 0.000 0.096 0.732 0.012 0.160 0.000
#> SRR2314017     5  0.4540     0.7100 0.000 0.008 0.308 0.040 0.644 0.000
#> SRR2314016     4  0.4983    -0.1202 0.000 0.004 0.056 0.484 0.456 0.000
#> SRR2314014     2  0.4420     0.6398 0.000 0.756 0.000 0.036 0.072 0.136
#> SRR2314013     2  0.4939     0.6153 0.000 0.724 0.004 0.048 0.084 0.140
#> SRR2314012     4  0.2983     0.6373 0.136 0.000 0.032 0.832 0.000 0.000
#> SRR2314011     1  0.4505     0.3063 0.612 0.020 0.004 0.356 0.008 0.000
#> SRR2314010     2  0.5665     0.6441 0.000 0.656 0.040 0.024 0.076 0.204
#> SRR2314009     3  0.2100     0.6275 0.000 0.036 0.916 0.016 0.032 0.000
#> SRR2314008     2  0.5845     0.2628 0.000 0.472 0.368 0.008 0.152 0.000
#> SRR2314007     3  0.5535    -0.0262 0.000 0.392 0.500 0.012 0.096 0.000
#> SRR2314005     2  0.6047     0.0563 0.000 0.484 0.004 0.040 0.088 0.384
#> SRR2314004     6  0.5232     0.3158 0.000 0.356 0.000 0.040 0.036 0.568
#> SRR2314003     4  0.3229     0.6432 0.120 0.000 0.048 0.828 0.004 0.000
#> SRR2314006     6  0.0363     0.8785 0.000 0.000 0.000 0.012 0.000 0.988
#> SRR2314002     5  0.3473     0.7178 0.000 0.004 0.192 0.024 0.780 0.000
#> SRR2314001     2  0.2912     0.6911 0.000 0.856 0.016 0.008 0.008 0.112
#> SRR2314000     3  0.4882     0.3993 0.000 0.068 0.668 0.020 0.244 0.000
#> SRR2313998     2  0.3674     0.6785 0.000 0.812 0.016 0.024 0.016 0.132
#> SRR2313996     2  0.4420     0.6114 0.000 0.728 0.172 0.008 0.092 0.000
#> SRR2313999     4  0.4467     0.3306 0.344 0.020 0.004 0.624 0.008 0.000
#> SRR2313997     6  0.1003     0.8766 0.000 0.004 0.000 0.028 0.004 0.964
#> SRR2313992     3  0.3782     0.3268 0.000 0.000 0.636 0.360 0.004 0.000
#> SRR2313991     5  0.4288     0.7433 0.000 0.056 0.180 0.020 0.744 0.000
#> SRR2313990     2  0.3805     0.5525 0.000 0.728 0.248 0.008 0.016 0.000
#> SRR2313988     1  0.5178     0.6693 0.716 0.092 0.008 0.064 0.120 0.000
#> SRR2313987     1  0.1701     0.7786 0.920 0.008 0.000 0.072 0.000 0.000
#> SRR2313984     2  0.4454     0.5932 0.000 0.704 0.000 0.032 0.028 0.236
#> SRR2313989     6  0.0363     0.8787 0.000 0.000 0.000 0.012 0.000 0.988
#> SRR2313983     1  0.0000     0.8161 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.2743     0.5718 0.000 0.000 0.164 0.828 0.008 0.000
#> SRR2313982     1  0.0146     0.8158 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR2313981     3  0.2165     0.6283 0.000 0.008 0.884 0.108 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-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

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 16873 rows and 72 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 1.000           0.995       0.998         0.5075 0.493   0.493
#> 3 3 0.826           0.917       0.956         0.2667 0.823   0.654
#> 4 4 0.792           0.804       0.895         0.0931 0.913   0.766
#> 5 5 0.721           0.682       0.823         0.0641 0.935   0.795
#> 6 6 0.744           0.687       0.822         0.0543 0.929   0.746

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
#> SRR2313978     2   0.000      0.995 0.000 1.000
#> SRR2313980     2   0.000      0.995 0.000 1.000
#> SRR2313979     1   0.000      1.000 1.000 0.000
#> SRR2313977     2   0.000      0.995 0.000 1.000
#> SRR2313976     2   0.000      0.995 0.000 1.000
#> SRR2313975     1   0.000      1.000 1.000 0.000
#> SRR2313973     1   0.000      1.000 1.000 0.000
#> SRR2313974     1   0.000      1.000 1.000 0.000
#> SRR2313985     1   0.000      1.000 1.000 0.000
#> SRR2313993     2   0.000      0.995 0.000 1.000
#> SRR2313994     2   0.000      0.995 0.000 1.000
#> SRR2313995     2   0.000      0.995 0.000 1.000
#> SRR2314024     2   0.000      0.995 0.000 1.000
#> SRR2314015     2   0.000      0.995 0.000 1.000
#> SRR2314025     1   0.000      1.000 1.000 0.000
#> SRR2314023     1   0.000      1.000 1.000 0.000
#> SRR2314033     2   0.000      0.995 0.000 1.000
#> SRR2314045     1   0.000      1.000 1.000 0.000
#> SRR2314042     1   0.000      1.000 1.000 0.000
#> SRR2314043     1   0.000      1.000 1.000 0.000
#> SRR2314041     2   0.000      0.995 0.000 1.000
#> SRR2314044     2   0.000      0.995 0.000 1.000
#> SRR2314040     2   0.644      0.805 0.164 0.836
#> SRR2314039     2   0.000      0.995 0.000 1.000
#> SRR2314038     2   0.000      0.995 0.000 1.000
#> SRR2314037     1   0.000      1.000 1.000 0.000
#> SRR2314036     2   0.000      0.995 0.000 1.000
#> SRR2314035     1   0.000      1.000 1.000 0.000
#> SRR2314034     1   0.000      1.000 1.000 0.000
#> SRR2314032     1   0.000      1.000 1.000 0.000
#> SRR2314031     1   0.000      1.000 1.000 0.000
#> SRR2314029     2   0.000      0.995 0.000 1.000
#> SRR2314030     1   0.000      1.000 1.000 0.000
#> SRR2314028     1   0.000      1.000 1.000 0.000
#> SRR2314027     2   0.000      0.995 0.000 1.000
#> SRR2314026     1   0.000      1.000 1.000 0.000
#> SRR2314020     2   0.000      0.995 0.000 1.000
#> SRR2314019     1   0.000      1.000 1.000 0.000
#> SRR2314021     1   0.000      1.000 1.000 0.000
#> SRR2314018     2   0.118      0.980 0.016 0.984
#> SRR2314017     1   0.000      1.000 1.000 0.000
#> SRR2314016     1   0.000      1.000 1.000 0.000
#> SRR2314014     2   0.000      0.995 0.000 1.000
#> SRR2314013     2   0.000      0.995 0.000 1.000
#> SRR2314012     1   0.000      1.000 1.000 0.000
#> SRR2314011     1   0.000      1.000 1.000 0.000
#> SRR2314010     2   0.000      0.995 0.000 1.000
#> SRR2314009     1   0.000      1.000 1.000 0.000
#> SRR2314008     2   0.000      0.995 0.000 1.000
#> SRR2314007     2   0.000      0.995 0.000 1.000
#> SRR2314005     2   0.000      0.995 0.000 1.000
#> SRR2314004     2   0.000      0.995 0.000 1.000
#> SRR2314003     1   0.000      1.000 1.000 0.000
#> SRR2314006     2   0.000      0.995 0.000 1.000
#> SRR2314002     1   0.000      1.000 1.000 0.000
#> SRR2314001     2   0.000      0.995 0.000 1.000
#> SRR2314000     1   0.000      1.000 1.000 0.000
#> SRR2313998     2   0.000      0.995 0.000 1.000
#> SRR2313996     2   0.000      0.995 0.000 1.000
#> SRR2313999     1   0.000      1.000 1.000 0.000
#> SRR2313997     2   0.000      0.995 0.000 1.000
#> SRR2313992     1   0.000      1.000 1.000 0.000
#> SRR2313991     2   0.000      0.995 0.000 1.000
#> SRR2313990     2   0.000      0.995 0.000 1.000
#> SRR2313988     1   0.000      1.000 1.000 0.000
#> SRR2313987     1   0.000      1.000 1.000 0.000
#> SRR2313984     2   0.000      0.995 0.000 1.000
#> SRR2313989     2   0.000      0.995 0.000 1.000
#> SRR2313983     1   0.000      1.000 1.000 0.000
#> SRR2313986     1   0.000      1.000 1.000 0.000
#> SRR2313982     1   0.000      1.000 1.000 0.000
#> SRR2313981     1   0.000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313980     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313977     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313976     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313975     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313973     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313974     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313985     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313993     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313994     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313995     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314024     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314015     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314025     1  0.0237      0.953 0.996 0.000 0.004
#> SRR2314023     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2314033     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314045     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2314042     1  0.1753      0.922 0.952 0.000 0.048
#> SRR2314043     3  0.0237      0.852 0.004 0.000 0.996
#> SRR2314041     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314044     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314040     3  0.0000      0.853 0.000 0.000 1.000
#> SRR2314039     3  0.5560      0.646 0.000 0.300 0.700
#> SRR2314038     2  0.3038      0.883 0.000 0.896 0.104
#> SRR2314037     3  0.3038      0.837 0.104 0.000 0.896
#> SRR2314036     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314035     3  0.0237      0.852 0.004 0.000 0.996
#> SRR2314034     1  0.5216      0.675 0.740 0.000 0.260
#> SRR2314032     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2314031     1  0.0237      0.953 0.996 0.000 0.004
#> SRR2314029     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314030     1  0.0747      0.946 0.984 0.000 0.016
#> SRR2314028     1  0.5138      0.688 0.748 0.000 0.252
#> SRR2314027     3  0.5948      0.546 0.000 0.360 0.640
#> SRR2314026     3  0.3038      0.837 0.104 0.000 0.896
#> SRR2314020     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314019     3  0.3038      0.837 0.104 0.000 0.896
#> SRR2314021     3  0.3038      0.837 0.104 0.000 0.896
#> SRR2314018     3  0.0237      0.853 0.000 0.004 0.996
#> SRR2314017     1  0.3038      0.872 0.896 0.000 0.104
#> SRR2314016     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2314014     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314013     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314012     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2314011     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2314010     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314009     3  0.0237      0.853 0.004 0.000 0.996
#> SRR2314008     2  0.2066      0.931 0.000 0.940 0.060
#> SRR2314007     3  0.5905      0.562 0.000 0.352 0.648
#> SRR2314005     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314004     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314003     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2314006     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314002     1  0.3038      0.872 0.896 0.000 0.104
#> SRR2314001     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2314000     1  0.3038      0.872 0.896 0.000 0.104
#> SRR2313998     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313996     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313999     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313997     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313992     1  0.5058      0.699 0.756 0.000 0.244
#> SRR2313991     2  0.3038      0.883 0.000 0.896 0.104
#> SRR2313990     3  0.4399      0.776 0.000 0.188 0.812
#> SRR2313988     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313987     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313984     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313989     2  0.0000      0.990 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313986     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313982     1  0.0000      0.955 1.000 0.000 0.000
#> SRR2313981     3  0.3038      0.837 0.104 0.000 0.896

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.1022      0.947 0.000 0.968 0.000 0.032
#> SRR2313980     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2313979     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.1576      0.936 0.000 0.948 0.004 0.048
#> SRR2313976     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2313975     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313973     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313974     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313985     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.0524      0.956 0.000 0.988 0.004 0.008
#> SRR2313994     2  0.0657      0.954 0.000 0.984 0.004 0.012
#> SRR2313995     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314024     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314015     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314025     1  0.3205      0.847 0.872 0.000 0.024 0.104
#> SRR2314023     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314045     1  0.1389      0.861 0.952 0.000 0.000 0.048
#> SRR2314042     1  0.5839      0.706 0.696 0.000 0.200 0.104
#> SRR2314043     4  0.5980      0.373 0.044 0.000 0.396 0.560
#> SRR2314041     2  0.1118      0.946 0.000 0.964 0.000 0.036
#> SRR2314044     2  0.1576      0.937 0.000 0.948 0.004 0.048
#> SRR2314040     3  0.2714      0.757 0.004 0.000 0.884 0.112
#> SRR2314039     3  0.3803      0.693 0.000 0.132 0.836 0.032
#> SRR2314038     4  0.3649      0.555 0.000 0.204 0.000 0.796
#> SRR2314037     3  0.3166      0.747 0.016 0.000 0.868 0.116
#> SRR2314036     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314035     4  0.5587      0.423 0.028 0.000 0.372 0.600
#> SRR2314034     1  0.4635      0.678 0.720 0.000 0.268 0.012
#> SRR2314032     1  0.1389      0.861 0.952 0.000 0.000 0.048
#> SRR2314031     1  0.3587      0.839 0.856 0.000 0.040 0.104
#> SRR2314029     2  0.0188      0.957 0.000 0.996 0.000 0.004
#> SRR2314030     1  0.7459      0.366 0.476 0.000 0.188 0.336
#> SRR2314028     1  0.5716      0.698 0.700 0.000 0.212 0.088
#> SRR2314027     3  0.4932      0.558 0.000 0.240 0.728 0.032
#> SRR2314026     3  0.0524      0.793 0.008 0.000 0.988 0.004
#> SRR2314020     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314019     3  0.0376      0.794 0.004 0.000 0.992 0.004
#> SRR2314021     3  0.0524      0.793 0.008 0.000 0.988 0.004
#> SRR2314018     4  0.5130      0.413 0.004 0.008 0.344 0.644
#> SRR2314017     4  0.2266      0.609 0.084 0.000 0.004 0.912
#> SRR2314016     1  0.4483      0.678 0.712 0.000 0.004 0.284
#> SRR2314014     2  0.1576      0.936 0.000 0.948 0.004 0.048
#> SRR2314013     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314012     1  0.2473      0.861 0.908 0.000 0.012 0.080
#> SRR2314011     1  0.0188      0.884 0.996 0.000 0.000 0.004
#> SRR2314010     2  0.0336      0.957 0.000 0.992 0.000 0.008
#> SRR2314009     3  0.2408      0.774 0.000 0.000 0.896 0.104
#> SRR2314008     2  0.4155      0.698 0.000 0.756 0.004 0.240
#> SRR2314007     3  0.5247      0.565 0.000 0.228 0.720 0.052
#> SRR2314005     2  0.0336      0.957 0.000 0.992 0.000 0.008
#> SRR2314004     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314003     1  0.2741      0.855 0.892 0.000 0.012 0.096
#> SRR2314006     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2314002     4  0.3764      0.595 0.216 0.000 0.000 0.784
#> SRR2314001     2  0.1489      0.939 0.000 0.952 0.004 0.044
#> SRR2314000     4  0.5126      0.325 0.444 0.000 0.004 0.552
#> SRR2313998     2  0.0524      0.956 0.000 0.988 0.004 0.008
#> SRR2313996     2  0.1489      0.939 0.000 0.952 0.004 0.044
#> SRR2313999     1  0.0188      0.884 0.996 0.000 0.004 0.000
#> SRR2313997     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2313992     1  0.5572      0.716 0.716 0.000 0.196 0.088
#> SRR2313991     4  0.3688      0.554 0.000 0.208 0.000 0.792
#> SRR2313990     2  0.6831     -0.069 0.000 0.480 0.420 0.100
#> SRR2313988     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313987     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313984     2  0.0188      0.958 0.000 0.996 0.000 0.004
#> SRR2313989     2  0.0000      0.958 0.000 1.000 0.000 0.000
#> SRR2313983     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313986     1  0.2987      0.851 0.880 0.000 0.016 0.104
#> SRR2313982     1  0.0000      0.884 1.000 0.000 0.000 0.000
#> SRR2313981     3  0.3088      0.750 0.008 0.000 0.864 0.128

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     2  0.2554     0.8878 0.000 0.892 0.072 0.000 0.036
#> SRR2313980     2  0.0000     0.9237 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.4400     0.7642 0.000 0.736 0.212 0.000 0.052
#> SRR2313976     2  0.0798     0.9213 0.000 0.976 0.016 0.000 0.008
#> SRR2313975     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313973     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313974     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313985     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313993     2  0.1386     0.9161 0.000 0.952 0.032 0.000 0.016
#> SRR2313994     2  0.1914     0.9086 0.000 0.924 0.060 0.000 0.016
#> SRR2313995     2  0.0290     0.9224 0.000 0.992 0.008 0.000 0.000
#> SRR2314024     2  0.0000     0.9237 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     2  0.0162     0.9240 0.000 0.996 0.004 0.000 0.000
#> SRR2314025     1  0.5409     0.6337 0.660 0.000 0.252 0.012 0.076
#> SRR2314023     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2314033     2  0.0404     0.9225 0.000 0.988 0.012 0.000 0.000
#> SRR2314045     1  0.1608     0.7573 0.928 0.000 0.000 0.000 0.072
#> SRR2314042     4  0.7953    -0.0452 0.296 0.000 0.280 0.348 0.076
#> SRR2314043     3  0.6897     0.5091 0.032 0.000 0.532 0.216 0.220
#> SRR2314041     2  0.2632     0.8851 0.000 0.888 0.072 0.000 0.040
#> SRR2314044     2  0.4497     0.7646 0.000 0.732 0.208 0.000 0.060
#> SRR2314040     3  0.4840     0.4456 0.000 0.000 0.640 0.320 0.040
#> SRR2314039     4  0.3504     0.5279 0.000 0.044 0.100 0.844 0.012
#> SRR2314038     5  0.2522     0.6048 0.000 0.108 0.012 0.000 0.880
#> SRR2314037     4  0.5329     0.1222 0.000 0.000 0.432 0.516 0.052
#> SRR2314036     2  0.0000     0.9237 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     3  0.6310     0.5429 0.020 0.000 0.600 0.184 0.196
#> SRR2314034     1  0.5938     0.4177 0.568 0.000 0.072 0.340 0.020
#> SRR2314032     1  0.1671     0.7531 0.924 0.000 0.000 0.000 0.076
#> SRR2314031     1  0.6375     0.5670 0.588 0.000 0.280 0.056 0.076
#> SRR2314029     2  0.0566     0.9209 0.000 0.984 0.012 0.000 0.004
#> SRR2314030     5  0.6153     0.4383 0.048 0.000 0.076 0.260 0.616
#> SRR2314028     1  0.7477     0.3231 0.440 0.000 0.320 0.180 0.060
#> SRR2314027     4  0.4990     0.4298 0.000 0.152 0.104 0.732 0.012
#> SRR2314026     4  0.0000     0.5592 0.000 0.000 0.000 1.000 0.000
#> SRR2314020     2  0.0000     0.9237 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     4  0.0000     0.5592 0.000 0.000 0.000 1.000 0.000
#> SRR2314021     4  0.0162     0.5580 0.000 0.000 0.004 0.996 0.000
#> SRR2314018     3  0.5428     0.5294 0.000 0.008 0.668 0.100 0.224
#> SRR2314017     5  0.2390     0.6105 0.044 0.000 0.044 0.004 0.908
#> SRR2314016     5  0.5386     0.3067 0.372 0.000 0.064 0.000 0.564
#> SRR2314014     2  0.4369     0.7693 0.000 0.740 0.208 0.000 0.052
#> SRR2314013     2  0.0992     0.9200 0.000 0.968 0.024 0.000 0.008
#> SRR2314012     1  0.4000     0.7241 0.800 0.000 0.132 0.004 0.064
#> SRR2314011     1  0.0671     0.8121 0.980 0.000 0.016 0.000 0.004
#> SRR2314010     2  0.1124     0.9176 0.000 0.960 0.036 0.000 0.004
#> SRR2314009     3  0.5097     0.2488 0.000 0.000 0.624 0.320 0.056
#> SRR2314008     2  0.5593     0.4780 0.000 0.572 0.340 0.000 0.088
#> SRR2314007     4  0.6309     0.3418 0.000 0.148 0.160 0.640 0.052
#> SRR2314005     2  0.2416     0.8749 0.000 0.888 0.100 0.000 0.012
#> SRR2314004     2  0.0000     0.9237 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     1  0.5137     0.6449 0.676 0.000 0.244 0.004 0.076
#> SRR2314006     2  0.0000     0.9237 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     5  0.2732     0.6052 0.160 0.000 0.000 0.000 0.840
#> SRR2314001     2  0.3409     0.8548 0.000 0.836 0.112 0.000 0.052
#> SRR2314000     3  0.6645     0.1425 0.332 0.000 0.432 0.000 0.236
#> SRR2313998     2  0.1018     0.9212 0.000 0.968 0.016 0.000 0.016
#> SRR2313996     2  0.3359     0.8578 0.000 0.840 0.108 0.000 0.052
#> SRR2313999     1  0.0579     0.8134 0.984 0.000 0.008 0.000 0.008
#> SRR2313997     2  0.0000     0.9237 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     1  0.7222     0.4288 0.496 0.000 0.292 0.152 0.060
#> SRR2313991     5  0.2732     0.5807 0.000 0.160 0.000 0.000 0.840
#> SRR2313990     3  0.7146     0.2317 0.000 0.240 0.540 0.144 0.076
#> SRR2313988     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313987     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313984     2  0.0579     0.9239 0.000 0.984 0.008 0.000 0.008
#> SRR2313989     2  0.0000     0.9237 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313986     1  0.5460     0.6128 0.636 0.000 0.280 0.008 0.076
#> SRR2313982     1  0.0000     0.8163 1.000 0.000 0.000 0.000 0.000
#> SRR2313981     3  0.5459    -0.0222 0.012 0.000 0.588 0.352 0.048

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR2313978     2  0.4534     0.7458 0.000 0.764 0.136 0.020 0.036 0.044
#> SRR2313980     2  0.0405     0.8390 0.000 0.988 0.000 0.008 0.000 0.004
#> SRR2313979     1  0.0000     0.9079 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.6640     0.4392 0.000 0.520 0.308 0.040 0.060 0.072
#> SRR2313976     2  0.2562     0.8243 0.000 0.900 0.036 0.028 0.016 0.020
#> SRR2313975     1  0.0000     0.9079 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313973     1  0.0260     0.9069 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR2313974     1  0.0260     0.9069 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR2313985     1  0.0000     0.9079 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313993     2  0.2732     0.8285 0.000 0.884 0.028 0.004 0.024 0.060
#> SRR2313994     2  0.4223     0.7900 0.000 0.800 0.064 0.028 0.028 0.080
#> SRR2313995     2  0.1585     0.8260 0.000 0.940 0.012 0.012 0.000 0.036
#> SRR2314024     2  0.0806     0.8365 0.000 0.972 0.000 0.008 0.000 0.020
#> SRR2314015     2  0.1235     0.8435 0.000 0.960 0.016 0.008 0.008 0.008
#> SRR2314025     4  0.3923     0.5451 0.372 0.000 0.000 0.620 0.008 0.000
#> SRR2314023     1  0.0260     0.9069 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR2314033     2  0.1078     0.8385 0.000 0.964 0.012 0.016 0.000 0.008
#> SRR2314045     1  0.1010     0.8764 0.960 0.000 0.000 0.004 0.036 0.000
#> SRR2314042     4  0.3479     0.6866 0.088 0.000 0.000 0.820 0.008 0.084
#> SRR2314043     3  0.6674     0.3907 0.040 0.000 0.600 0.140 0.104 0.116
#> SRR2314041     2  0.4796     0.7397 0.000 0.748 0.116 0.020 0.028 0.088
#> SRR2314044     2  0.7932     0.1722 0.000 0.396 0.288 0.148 0.068 0.100
#> SRR2314040     3  0.3642     0.4531 0.000 0.000 0.800 0.048 0.012 0.140
#> SRR2314039     6  0.3101     0.7498 0.000 0.040 0.048 0.036 0.008 0.868
#> SRR2314038     5  0.1844     0.7616 0.000 0.048 0.024 0.004 0.924 0.000
#> SRR2314037     4  0.3208     0.5731 0.008 0.000 0.040 0.832 0.000 0.120
#> SRR2314036     2  0.0000     0.8400 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314035     3  0.4814     0.4834 0.016 0.000 0.756 0.064 0.092 0.072
#> SRR2314034     1  0.6671    -0.1262 0.436 0.000 0.020 0.292 0.012 0.240
#> SRR2314032     1  0.1010     0.8764 0.960 0.000 0.000 0.004 0.036 0.000
#> SRR2314031     4  0.3314     0.7216 0.224 0.000 0.000 0.764 0.012 0.000
#> SRR2314029     2  0.2632     0.8044 0.000 0.896 0.020 0.028 0.016 0.040
#> SRR2314030     5  0.4556     0.5967 0.004 0.000 0.004 0.068 0.696 0.228
#> SRR2314028     4  0.3024     0.7166 0.116 0.000 0.008 0.844 0.000 0.032
#> SRR2314027     6  0.3574     0.6788 0.000 0.104 0.052 0.008 0.012 0.824
#> SRR2314026     6  0.2833     0.7772 0.000 0.000 0.024 0.104 0.012 0.860
#> SRR2314020     2  0.0000     0.8400 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314019     6  0.2880     0.7770 0.000 0.000 0.024 0.108 0.012 0.856
#> SRR2314021     6  0.2844     0.7754 0.000 0.000 0.020 0.112 0.012 0.856
#> SRR2314018     3  0.2563     0.5046 0.000 0.000 0.880 0.040 0.076 0.004
#> SRR2314017     5  0.2169     0.7514 0.008 0.000 0.080 0.012 0.900 0.000
#> SRR2314016     5  0.4808     0.5294 0.272 0.000 0.000 0.092 0.636 0.000
#> SRR2314014     2  0.6522     0.4936 0.000 0.548 0.280 0.040 0.048 0.084
#> SRR2314013     2  0.2938     0.8166 0.000 0.880 0.044 0.028 0.016 0.032
#> SRR2314012     1  0.3601     0.4027 0.684 0.000 0.000 0.312 0.004 0.000
#> SRR2314011     1  0.1765     0.8243 0.904 0.000 0.000 0.096 0.000 0.000
#> SRR2314010     2  0.2704     0.8213 0.000 0.880 0.020 0.012 0.008 0.080
#> SRR2314009     4  0.5520    -0.0299 0.000 0.000 0.444 0.448 0.008 0.100
#> SRR2314008     3  0.6685    -0.1648 0.000 0.404 0.428 0.024 0.072 0.072
#> SRR2314007     6  0.5285     0.5195 0.000 0.076 0.176 0.012 0.044 0.692
#> SRR2314005     2  0.3984     0.7624 0.000 0.800 0.124 0.028 0.016 0.032
#> SRR2314004     2  0.0405     0.8404 0.000 0.988 0.004 0.008 0.000 0.000
#> SRR2314003     4  0.3975     0.5058 0.392 0.000 0.000 0.600 0.008 0.000
#> SRR2314006     2  0.0520     0.8387 0.000 0.984 0.000 0.008 0.000 0.008
#> SRR2314002     5  0.1908     0.7599 0.096 0.000 0.004 0.000 0.900 0.000
#> SRR2314001     2  0.6117     0.6399 0.000 0.636 0.180 0.040 0.048 0.096
#> SRR2314000     3  0.5953     0.2320 0.328 0.000 0.532 0.048 0.092 0.000
#> SRR2313998     2  0.3216     0.8127 0.000 0.864 0.056 0.028 0.020 0.032
#> SRR2313996     2  0.6129     0.6546 0.000 0.636 0.168 0.036 0.048 0.112
#> SRR2313999     1  0.1007     0.8807 0.956 0.000 0.000 0.044 0.000 0.000
#> SRR2313997     2  0.0405     0.8390 0.000 0.988 0.000 0.008 0.000 0.004
#> SRR2313992     4  0.2595     0.7327 0.160 0.000 0.000 0.836 0.000 0.004
#> SRR2313991     5  0.1753     0.7525 0.000 0.084 0.004 0.000 0.912 0.000
#> SRR2313990     3  0.6581     0.2581 0.000 0.240 0.560 0.040 0.040 0.120
#> SRR2313988     1  0.0000     0.9079 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313987     1  0.0260     0.9069 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR2313984     2  0.1932     0.8391 0.000 0.924 0.016 0.000 0.020 0.040
#> SRR2313989     2  0.0405     0.8390 0.000 0.988 0.000 0.008 0.000 0.004
#> SRR2313983     1  0.0000     0.9079 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.3468     0.6922 0.264 0.000 0.000 0.728 0.008 0.000
#> SRR2313982     1  0.0000     0.9079 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313981     4  0.3875     0.5512 0.008 0.000 0.144 0.780 0.000 0.068

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

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 16873 rows and 72 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.838           0.924       0.959         0.4897 0.503   0.503
#> 3 3 0.854           0.942       0.973         0.3173 0.678   0.452
#> 4 4 0.657           0.748       0.876         0.1448 0.837   0.580
#> 5 5 0.627           0.553       0.716         0.0688 0.849   0.521
#> 6 6 0.690           0.662       0.787         0.0432 0.911   0.624

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
#> SRR2313978     2  0.0000      0.958 0.000 1.000
#> SRR2313980     2  0.0000      0.958 0.000 1.000
#> SRR2313979     1  0.0000      0.952 1.000 0.000
#> SRR2313977     2  0.0000      0.958 0.000 1.000
#> SRR2313976     2  0.0000      0.958 0.000 1.000
#> SRR2313975     1  0.0000      0.952 1.000 0.000
#> SRR2313973     1  0.0000      0.952 1.000 0.000
#> SRR2313974     1  0.0000      0.952 1.000 0.000
#> SRR2313985     1  0.0000      0.952 1.000 0.000
#> SRR2313993     2  0.0000      0.958 0.000 1.000
#> SRR2313994     2  0.0000      0.958 0.000 1.000
#> SRR2313995     2  0.0000      0.958 0.000 1.000
#> SRR2314024     2  0.0000      0.958 0.000 1.000
#> SRR2314015     2  0.0000      0.958 0.000 1.000
#> SRR2314025     1  0.0000      0.952 1.000 0.000
#> SRR2314023     1  0.0000      0.952 1.000 0.000
#> SRR2314033     2  0.0000      0.958 0.000 1.000
#> SRR2314045     1  0.0000      0.952 1.000 0.000
#> SRR2314042     1  0.3584      0.938 0.932 0.068
#> SRR2314043     1  0.3733      0.936 0.928 0.072
#> SRR2314041     2  0.5629      0.842 0.132 0.868
#> SRR2314044     1  0.4815      0.910 0.896 0.104
#> SRR2314040     1  0.3733      0.936 0.928 0.072
#> SRR2314039     2  0.5842      0.834 0.140 0.860
#> SRR2314038     1  0.8955      0.590 0.688 0.312
#> SRR2314037     1  0.3733      0.936 0.928 0.072
#> SRR2314036     2  0.0000      0.958 0.000 1.000
#> SRR2314035     1  0.3733      0.936 0.928 0.072
#> SRR2314034     1  0.0000      0.952 1.000 0.000
#> SRR2314032     1  0.0000      0.952 1.000 0.000
#> SRR2314031     1  0.0000      0.952 1.000 0.000
#> SRR2314029     2  0.9393      0.451 0.356 0.644
#> SRR2314030     1  0.3733      0.936 0.928 0.072
#> SRR2314028     1  0.0000      0.952 1.000 0.000
#> SRR2314027     2  0.5842      0.834 0.140 0.860
#> SRR2314026     1  0.7219      0.789 0.800 0.200
#> SRR2314020     2  0.0000      0.958 0.000 1.000
#> SRR2314019     1  0.3733      0.936 0.928 0.072
#> SRR2314021     1  0.3733      0.936 0.928 0.072
#> SRR2314018     1  0.3733      0.936 0.928 0.072
#> SRR2314017     1  0.3584      0.938 0.932 0.068
#> SRR2314016     1  0.0000      0.952 1.000 0.000
#> SRR2314014     2  0.0000      0.958 0.000 1.000
#> SRR2314013     2  0.0000      0.958 0.000 1.000
#> SRR2314012     1  0.0000      0.952 1.000 0.000
#> SRR2314011     1  0.0000      0.952 1.000 0.000
#> SRR2314010     2  0.0000      0.958 0.000 1.000
#> SRR2314009     1  0.3733      0.936 0.928 0.072
#> SRR2314008     1  0.7219      0.797 0.800 0.200
#> SRR2314007     2  0.0376      0.955 0.004 0.996
#> SRR2314005     2  0.0000      0.958 0.000 1.000
#> SRR2314004     2  0.0000      0.958 0.000 1.000
#> SRR2314003     1  0.0000      0.952 1.000 0.000
#> SRR2314006     2  0.0000      0.958 0.000 1.000
#> SRR2314002     1  0.3431      0.939 0.936 0.064
#> SRR2314001     2  0.0000      0.958 0.000 1.000
#> SRR2314000     1  0.0000      0.952 1.000 0.000
#> SRR2313998     2  0.0000      0.958 0.000 1.000
#> SRR2313996     2  0.0000      0.958 0.000 1.000
#> SRR2313999     1  0.0000      0.952 1.000 0.000
#> SRR2313997     2  0.0000      0.958 0.000 1.000
#> SRR2313992     1  0.3431      0.939 0.936 0.064
#> SRR2313991     2  0.8327      0.646 0.264 0.736
#> SRR2313990     2  0.5737      0.834 0.136 0.864
#> SRR2313988     1  0.0000      0.952 1.000 0.000
#> SRR2313987     1  0.0000      0.952 1.000 0.000
#> SRR2313984     2  0.0000      0.958 0.000 1.000
#> SRR2313989     2  0.0000      0.958 0.000 1.000
#> SRR2313983     1  0.0000      0.952 1.000 0.000
#> SRR2313986     1  0.0000      0.952 1.000 0.000
#> SRR2313982     1  0.0000      0.952 1.000 0.000
#> SRR2313981     1  0.3733      0.936 0.928 0.072

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     3  0.4178      0.805 0.000 0.172 0.828
#> SRR2313980     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2313977     2  0.4178      0.802 0.000 0.828 0.172
#> SRR2313976     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2313975     1  0.4605      0.757 0.796 0.000 0.204
#> SRR2313973     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2313974     1  0.0237      0.950 0.996 0.000 0.004
#> SRR2313985     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2313993     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2313994     2  0.2537      0.896 0.000 0.920 0.080
#> SRR2313995     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314024     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314015     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314025     1  0.3879      0.841 0.848 0.000 0.152
#> SRR2314023     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2314033     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314045     1  0.0237      0.950 0.996 0.000 0.004
#> SRR2314042     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314043     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314041     3  0.0592      0.970 0.000 0.012 0.988
#> SRR2314044     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314040     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314039     3  0.0592      0.970 0.000 0.012 0.988
#> SRR2314038     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314037     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314036     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314035     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314034     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314032     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2314031     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314029     3  0.5291      0.640 0.000 0.268 0.732
#> SRR2314030     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314028     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314027     3  0.0592      0.970 0.000 0.012 0.988
#> SRR2314026     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314020     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314019     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314021     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314018     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314017     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314016     3  0.2878      0.880 0.096 0.000 0.904
#> SRR2314014     2  0.4178      0.802 0.000 0.828 0.172
#> SRR2314013     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314012     1  0.3482      0.863 0.872 0.000 0.128
#> SRR2314011     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2314010     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314009     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314008     3  0.0592      0.970 0.000 0.012 0.988
#> SRR2314007     3  0.1031      0.960 0.000 0.024 0.976
#> SRR2314005     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314004     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314003     1  0.3941      0.838 0.844 0.000 0.156
#> SRR2314006     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2314002     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2314001     2  0.4178      0.802 0.000 0.828 0.172
#> SRR2314000     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2313998     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2313996     3  0.2448      0.911 0.000 0.076 0.924
#> SRR2313999     1  0.1163      0.938 0.972 0.000 0.028
#> SRR2313997     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2313992     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2313991     3  0.0424      0.972 0.000 0.008 0.992
#> SRR2313990     3  0.0592      0.969 0.000 0.012 0.988
#> SRR2313988     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2313987     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2313984     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2313989     2  0.0000      0.965 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2313986     3  0.0000      0.976 0.000 0.000 1.000
#> SRR2313982     1  0.0000      0.951 1.000 0.000 0.000
#> SRR2313981     3  0.0000      0.976 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
#> SRR2313978     2  0.1151      0.741 0.000 0.968 0.024 0.008
#> SRR2313980     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2313979     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.5977      0.597 0.000 0.688 0.192 0.120
#> SRR2313976     4  0.1940      0.900 0.000 0.076 0.000 0.924
#> SRR2313975     1  0.3831      0.741 0.792 0.004 0.204 0.000
#> SRR2313973     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2313974     1  0.1489      0.897 0.952 0.004 0.044 0.000
#> SRR2313985     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.3726      0.671 0.000 0.788 0.000 0.212
#> SRR2313994     2  0.0188      0.742 0.000 0.996 0.000 0.004
#> SRR2313995     2  0.3801      0.647 0.000 0.780 0.000 0.220
#> SRR2314024     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2314015     2  0.2704      0.719 0.000 0.876 0.000 0.124
#> SRR2314025     1  0.4372      0.732 0.728 0.004 0.268 0.000
#> SRR2314023     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2314033     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2314045     1  0.0817      0.905 0.976 0.000 0.024 0.000
#> SRR2314042     3  0.0188      0.828 0.000 0.004 0.996 0.000
#> SRR2314043     3  0.0817      0.830 0.000 0.024 0.976 0.000
#> SRR2314041     2  0.3569      0.574 0.000 0.804 0.196 0.000
#> SRR2314044     2  0.2647      0.692 0.000 0.880 0.120 0.000
#> SRR2314040     3  0.3569      0.724 0.000 0.196 0.804 0.000
#> SRR2314039     3  0.5000      0.277 0.000 0.496 0.504 0.000
#> SRR2314038     3  0.3024      0.772 0.000 0.148 0.852 0.000
#> SRR2314037     3  0.0000      0.829 0.000 0.000 1.000 0.000
#> SRR2314036     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2314035     3  0.0592      0.829 0.000 0.016 0.984 0.000
#> SRR2314034     3  0.0000      0.829 0.000 0.000 1.000 0.000
#> SRR2314032     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2314031     3  0.0188      0.828 0.000 0.004 0.996 0.000
#> SRR2314029     2  0.3837      0.599 0.000 0.776 0.224 0.000
#> SRR2314030     3  0.4585      0.529 0.000 0.332 0.668 0.000
#> SRR2314028     3  0.0188      0.828 0.000 0.004 0.996 0.000
#> SRR2314027     2  0.4955     -0.178 0.000 0.556 0.444 0.000
#> SRR2314026     3  0.4888      0.416 0.000 0.412 0.588 0.000
#> SRR2314020     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2314019     3  0.4877      0.421 0.000 0.408 0.592 0.000
#> SRR2314021     3  0.4776      0.472 0.000 0.376 0.624 0.000
#> SRR2314018     3  0.2530      0.794 0.000 0.112 0.888 0.000
#> SRR2314017     3  0.2281      0.802 0.000 0.096 0.904 0.000
#> SRR2314016     3  0.1489      0.804 0.044 0.004 0.952 0.000
#> SRR2314014     2  0.2647      0.720 0.000 0.880 0.000 0.120
#> SRR2314013     2  0.3649      0.677 0.000 0.796 0.000 0.204
#> SRR2314012     1  0.4283      0.746 0.740 0.004 0.256 0.000
#> SRR2314011     1  0.0779      0.906 0.980 0.004 0.016 0.000
#> SRR2314010     2  0.2868      0.707 0.000 0.864 0.000 0.136
#> SRR2314009     3  0.1118      0.827 0.000 0.036 0.964 0.000
#> SRR2314008     3  0.4134      0.657 0.000 0.260 0.740 0.000
#> SRR2314007     2  0.4164      0.434 0.000 0.736 0.264 0.000
#> SRR2314005     2  0.4933      0.253 0.000 0.568 0.000 0.432
#> SRR2314004     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2314003     1  0.4313      0.742 0.736 0.004 0.260 0.000
#> SRR2314006     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2314002     3  0.3123      0.769 0.000 0.156 0.844 0.000
#> SRR2314001     2  0.0188      0.742 0.000 0.996 0.000 0.004
#> SRR2314000     3  0.0000      0.829 0.000 0.000 1.000 0.000
#> SRR2313998     2  0.4431      0.558 0.000 0.696 0.000 0.304
#> SRR2313996     2  0.0469      0.743 0.000 0.988 0.012 0.000
#> SRR2313999     1  0.3668      0.811 0.808 0.004 0.188 0.000
#> SRR2313997     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2313992     3  0.0000      0.829 0.000 0.000 1.000 0.000
#> SRR2313991     3  0.4356      0.643 0.000 0.292 0.708 0.000
#> SRR2313990     2  0.4406      0.475 0.000 0.700 0.300 0.000
#> SRR2313988     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2313987     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2313984     2  0.4948      0.260 0.000 0.560 0.000 0.440
#> SRR2313989     4  0.0000      0.990 0.000 0.000 0.000 1.000
#> SRR2313983     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2313986     3  0.0188      0.828 0.000 0.004 0.996 0.000
#> SRR2313982     1  0.0000      0.911 1.000 0.000 0.000 0.000
#> SRR2313981     3  0.0592      0.829 0.000 0.016 0.984 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
#> SRR2313978     3  0.4418    0.52509 0.000 0.000 0.652 0.016 0.332
#> SRR2313980     2  0.0000    0.90383 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0000    0.83481 1.000 0.000 0.000 0.000 0.000
#> SRR2313977     5  0.7609   -0.07249 0.000 0.096 0.212 0.200 0.492
#> SRR2313976     2  0.5537    0.58475 0.000 0.648 0.160 0.192 0.000
#> SRR2313975     1  0.4183    0.44569 0.668 0.000 0.000 0.324 0.008
#> SRR2313973     1  0.0000    0.83481 1.000 0.000 0.000 0.000 0.000
#> SRR2313974     1  0.4088    0.35364 0.632 0.000 0.000 0.368 0.000
#> SRR2313985     1  0.0609    0.83164 0.980 0.000 0.000 0.020 0.000
#> SRR2313993     3  0.2905    0.62701 0.000 0.096 0.868 0.036 0.000
#> SRR2313994     3  0.0404    0.67020 0.000 0.000 0.988 0.012 0.000
#> SRR2313995     3  0.3861    0.50673 0.000 0.284 0.712 0.004 0.000
#> SRR2314024     2  0.0000    0.90383 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     3  0.7958    0.32777 0.000 0.096 0.372 0.200 0.332
#> SRR2314025     4  0.4626    0.43507 0.364 0.000 0.000 0.616 0.020
#> SRR2314023     1  0.0609    0.83164 0.980 0.000 0.000 0.020 0.000
#> SRR2314033     2  0.0000    0.90383 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     1  0.4588    0.64688 0.748 0.000 0.000 0.116 0.136
#> SRR2314042     4  0.4897    0.04361 0.000 0.000 0.024 0.516 0.460
#> SRR2314043     5  0.5413    0.47835 0.000 0.000 0.172 0.164 0.664
#> SRR2314041     3  0.3395    0.63714 0.000 0.000 0.764 0.000 0.236
#> SRR2314044     3  0.3452    0.65780 0.000 0.000 0.820 0.032 0.148
#> SRR2314040     5  0.4030    0.43208 0.000 0.000 0.352 0.000 0.648
#> SRR2314039     3  0.4555    0.53850 0.000 0.000 0.636 0.020 0.344
#> SRR2314038     5  0.3835    0.42725 0.000 0.000 0.008 0.260 0.732
#> SRR2314037     5  0.4074    0.31521 0.000 0.000 0.000 0.364 0.636
#> SRR2314036     2  0.0000    0.90383 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     5  0.3013    0.56974 0.000 0.000 0.008 0.160 0.832
#> SRR2314034     5  0.4045    0.34480 0.000 0.000 0.000 0.356 0.644
#> SRR2314032     1  0.1608    0.80282 0.928 0.000 0.000 0.072 0.000
#> SRR2314031     4  0.4192    0.28910 0.000 0.000 0.000 0.596 0.404
#> SRR2314029     3  0.3732    0.61501 0.000 0.000 0.792 0.176 0.032
#> SRR2314030     3  0.5556    0.49206 0.000 0.000 0.616 0.276 0.108
#> SRR2314028     5  0.4291   -0.01650 0.000 0.000 0.000 0.464 0.536
#> SRR2314027     3  0.4252    0.57173 0.000 0.000 0.700 0.020 0.280
#> SRR2314026     3  0.5640    0.47793 0.000 0.000 0.636 0.176 0.188
#> SRR2314020     2  0.0000    0.90383 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     3  0.5642    0.47682 0.000 0.000 0.636 0.180 0.184
#> SRR2314021     3  0.5731    0.46316 0.000 0.000 0.624 0.180 0.196
#> SRR2314018     5  0.0000    0.60270 0.000 0.000 0.000 0.000 1.000
#> SRR2314017     5  0.1908    0.57397 0.000 0.000 0.000 0.092 0.908
#> SRR2314016     4  0.4152    0.33385 0.012 0.000 0.000 0.692 0.296
#> SRR2314014     3  0.7393    0.35292 0.000 0.096 0.528 0.200 0.176
#> SRR2314013     3  0.6003    0.47425 0.000 0.100 0.656 0.200 0.044
#> SRR2314012     4  0.4707    0.38540 0.392 0.000 0.000 0.588 0.020
#> SRR2314011     1  0.3983    0.45032 0.660 0.000 0.000 0.340 0.000
#> SRR2314010     3  0.0000    0.67004 0.000 0.000 1.000 0.000 0.000
#> SRR2314009     5  0.1478    0.60612 0.000 0.000 0.000 0.064 0.936
#> SRR2314008     5  0.1197    0.59777 0.000 0.000 0.048 0.000 0.952
#> SRR2314007     3  0.3612    0.61892 0.000 0.000 0.732 0.000 0.268
#> SRR2314005     2  0.7898    0.07273 0.000 0.356 0.356 0.200 0.088
#> SRR2314004     2  0.0162    0.90139 0.000 0.996 0.000 0.004 0.000
#> SRR2314003     4  0.4651    0.42347 0.372 0.000 0.000 0.608 0.020
#> SRR2314006     2  0.0000    0.90383 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     5  0.2773    0.53418 0.000 0.000 0.000 0.164 0.836
#> SRR2314001     3  0.0703    0.67002 0.000 0.000 0.976 0.024 0.000
#> SRR2314000     5  0.2891    0.55982 0.000 0.000 0.000 0.176 0.824
#> SRR2313998     3  0.2516    0.63393 0.000 0.140 0.860 0.000 0.000
#> SRR2313996     3  0.3075    0.67073 0.000 0.000 0.860 0.048 0.092
#> SRR2313999     4  0.4446    0.34772 0.400 0.000 0.000 0.592 0.008
#> SRR2313997     2  0.0000    0.90383 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     5  0.4074    0.31521 0.000 0.000 0.000 0.364 0.636
#> SRR2313991     5  0.3648    0.54588 0.000 0.000 0.084 0.092 0.824
#> SRR2313990     3  0.4481   -0.00285 0.000 0.000 0.576 0.008 0.416
#> SRR2313988     1  0.1608    0.80282 0.928 0.000 0.000 0.072 0.000
#> SRR2313987     1  0.2179    0.77381 0.888 0.000 0.000 0.112 0.000
#> SRR2313984     3  0.6225    0.22187 0.000 0.256 0.544 0.200 0.000
#> SRR2313989     2  0.0000    0.90383 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0000    0.83481 1.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.4192    0.28910 0.000 0.000 0.000 0.596 0.404
#> SRR2313982     1  0.0000    0.83481 1.000 0.000 0.000 0.000 0.000
#> SRR2313981     5  0.5378    0.48151 0.000 0.000 0.172 0.160 0.668

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR2313978     2   0.433     0.5484 0.000 0.644 0.040 0.000 0.316 0.000
#> SRR2313980     6   0.000     0.9988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313979     1   0.000     0.8436 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     5   0.353     0.7405 0.000 0.068 0.040 0.000 0.832 0.060
#> SRR2313976     5   0.376     0.2849 0.000 0.000 0.000 0.000 0.600 0.400
#> SRR2313975     4   0.389     0.5482 0.400 0.000 0.004 0.596 0.000 0.000
#> SRR2313973     1   0.000     0.8436 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313974     4   0.358     0.5793 0.340 0.000 0.000 0.660 0.000 0.000
#> SRR2313985     1   0.161     0.8144 0.916 0.000 0.000 0.084 0.000 0.000
#> SRR2313993     2   0.490     0.2361 0.000 0.476 0.000 0.000 0.464 0.060
#> SRR2313994     2   0.370     0.5585 0.000 0.624 0.000 0.000 0.376 0.000
#> SRR2313995     2   0.550     0.5164 0.000 0.564 0.000 0.000 0.200 0.236
#> SRR2314024     6   0.000     0.9988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314015     5   0.399     0.7194 0.000 0.104 0.040 0.000 0.796 0.060
#> SRR2314025     4   0.367     0.7596 0.132 0.000 0.080 0.788 0.000 0.000
#> SRR2314023     1   0.161     0.8144 0.916 0.000 0.000 0.084 0.000 0.000
#> SRR2314033     6   0.000     0.9988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314045     1   0.642     0.2185 0.404 0.000 0.376 0.192 0.028 0.000
#> SRR2314042     4   0.433     0.5301 0.000 0.048 0.288 0.664 0.000 0.000
#> SRR2314043     3   0.309     0.6825 0.000 0.140 0.824 0.036 0.000 0.000
#> SRR2314041     2   0.327     0.7164 0.000 0.824 0.076 0.000 0.100 0.000
#> SRR2314044     2   0.403     0.6808 0.000 0.744 0.016 0.032 0.208 0.000
#> SRR2314040     3   0.415     0.6321 0.000 0.108 0.744 0.000 0.148 0.000
#> SRR2314039     2   0.242     0.6914 0.000 0.844 0.156 0.000 0.000 0.000
#> SRR2314038     3   0.711     0.1363 0.000 0.224 0.400 0.288 0.088 0.000
#> SRR2314037     3   0.297     0.5960 0.000 0.000 0.776 0.224 0.000 0.000
#> SRR2314036     6   0.000     0.9988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314035     3   0.307     0.6967 0.000 0.084 0.856 0.036 0.024 0.000
#> SRR2314034     3   0.312     0.6279 0.000 0.020 0.804 0.176 0.000 0.000
#> SRR2314032     1   0.348     0.7649 0.816 0.000 0.024 0.132 0.028 0.000
#> SRR2314031     4   0.300     0.6633 0.000 0.000 0.228 0.772 0.000 0.000
#> SRR2314029     2   0.557     0.6601 0.000 0.656 0.080 0.088 0.176 0.000
#> SRR2314030     2   0.429     0.5018 0.000 0.740 0.184 0.016 0.060 0.000
#> SRR2314028     3   0.385     0.0699 0.000 0.000 0.540 0.460 0.000 0.000
#> SRR2314027     2   0.277     0.6944 0.000 0.832 0.156 0.000 0.012 0.000
#> SRR2314026     2   0.300     0.6779 0.000 0.772 0.228 0.000 0.000 0.000
#> SRR2314020     6   0.000     0.9988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314019     2   0.297     0.6797 0.000 0.776 0.224 0.000 0.000 0.000
#> SRR2314021     2   0.362     0.6531 0.000 0.744 0.232 0.024 0.000 0.000
#> SRR2314018     3   0.396     0.6863 0.000 0.068 0.796 0.032 0.104 0.000
#> SRR2314017     3   0.479     0.5536 0.000 0.224 0.680 0.012 0.084 0.000
#> SRR2314016     4   0.294     0.6652 0.000 0.000 0.220 0.780 0.000 0.000
#> SRR2314014     5   0.197     0.7766 0.000 0.000 0.028 0.000 0.912 0.060
#> SRR2314013     5   0.206     0.7740 0.000 0.020 0.008 0.000 0.912 0.060
#> SRR2314012     4   0.285     0.7354 0.176 0.000 0.008 0.816 0.000 0.000
#> SRR2314011     4   0.362     0.5524 0.352 0.000 0.000 0.648 0.000 0.000
#> SRR2314010     2   0.310     0.6763 0.000 0.756 0.000 0.000 0.244 0.000
#> SRR2314009     3   0.366     0.6967 0.000 0.136 0.804 0.036 0.024 0.000
#> SRR2314008     3   0.367     0.6422 0.000 0.240 0.736 0.000 0.024 0.000
#> SRR2314007     2   0.309     0.7093 0.000 0.824 0.036 0.000 0.140 0.000
#> SRR2314005     5   0.181     0.7770 0.000 0.000 0.008 0.000 0.912 0.080
#> SRR2314004     6   0.026     0.9902 0.000 0.000 0.000 0.000 0.008 0.992
#> SRR2314003     4   0.271     0.7584 0.132 0.000 0.020 0.848 0.000 0.000
#> SRR2314006     6   0.000     0.9988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314002     3   0.648     0.4453 0.000 0.220 0.544 0.148 0.088 0.000
#> SRR2314001     2   0.381     0.4803 0.000 0.572 0.000 0.000 0.428 0.000
#> SRR2314000     3   0.280     0.6875 0.000 0.000 0.860 0.068 0.072 0.000
#> SRR2313998     2   0.501     0.5520 0.000 0.620 0.000 0.000 0.264 0.116
#> SRR2313996     5   0.385    -0.2835 0.000 0.460 0.000 0.000 0.540 0.000
#> SRR2313999     4   0.240     0.7519 0.140 0.000 0.004 0.856 0.000 0.000
#> SRR2313997     6   0.000     0.9988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313992     3   0.297     0.5960 0.000 0.000 0.776 0.224 0.000 0.000
#> SRR2313991     3   0.527     0.5029 0.000 0.328 0.576 0.012 0.084 0.000
#> SRR2313990     3   0.549     0.2896 0.000 0.136 0.504 0.000 0.360 0.000
#> SRR2313988     1   0.348     0.7649 0.816 0.000 0.024 0.132 0.028 0.000
#> SRR2313987     1   0.263     0.7273 0.820 0.000 0.000 0.180 0.000 0.000
#> SRR2313984     5   0.235     0.7551 0.000 0.036 0.000 0.000 0.888 0.076
#> SRR2313989     6   0.000     0.9988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     1   0.000     0.8436 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4   0.300     0.6633 0.000 0.000 0.228 0.772 0.000 0.000
#> SRR2313982     1   0.000     0.8436 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313981     3   0.309     0.6825 0.000 0.140 0.824 0.036 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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 16873 rows and 72 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 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-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.486           0.857       0.898         0.4685 0.525   0.525
#> 3 3 0.337           0.710       0.795         0.1878 0.619   0.462
#> 4 4 0.419           0.496       0.727         0.2476 0.760   0.537
#> 5 5 0.581           0.608       0.788         0.1065 0.797   0.431
#> 6 6 0.647           0.632       0.794         0.0479 0.971   0.875

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
#> SRR2313978     2  0.5294      0.901 0.120 0.880
#> SRR2313980     2  0.5946      0.895 0.144 0.856
#> SRR2313979     1  0.0000      0.908 1.000 0.000
#> SRR2313977     2  0.3879      0.904 0.076 0.924
#> SRR2313976     2  0.5946      0.895 0.144 0.856
#> SRR2313975     1  0.1414      0.906 0.980 0.020
#> SRR2313973     1  0.0000      0.908 1.000 0.000
#> SRR2313974     1  0.2948      0.896 0.948 0.052
#> SRR2313985     1  0.0000      0.908 1.000 0.000
#> SRR2313993     2  0.4022      0.903 0.080 0.920
#> SRR2313994     2  0.4298      0.904 0.088 0.912
#> SRR2313995     2  0.4022      0.894 0.080 0.920
#> SRR2314024     2  0.4562      0.896 0.096 0.904
#> SRR2314015     2  0.5519      0.899 0.128 0.872
#> SRR2314025     1  0.7376      0.840 0.792 0.208
#> SRR2314023     1  0.0000      0.908 1.000 0.000
#> SRR2314033     2  0.6247      0.887 0.156 0.844
#> SRR2314045     1  0.0000      0.908 1.000 0.000
#> SRR2314042     1  0.7528      0.833 0.784 0.216
#> SRR2314043     2  0.8909      0.606 0.308 0.692
#> SRR2314041     2  0.1414      0.886 0.020 0.980
#> SRR2314044     2  0.1633      0.886 0.024 0.976
#> SRR2314040     2  0.4431      0.905 0.092 0.908
#> SRR2314039     2  0.0000      0.880 0.000 1.000
#> SRR2314038     2  0.8909      0.707 0.308 0.692
#> SRR2314037     2  0.0000      0.880 0.000 1.000
#> SRR2314036     2  0.7299      0.845 0.204 0.796
#> SRR2314035     1  0.8813      0.649 0.700 0.300
#> SRR2314034     2  0.9635      0.131 0.388 0.612
#> SRR2314032     1  0.0000      0.908 1.000 0.000
#> SRR2314031     1  0.7453      0.836 0.788 0.212
#> SRR2314029     2  0.3584      0.886 0.068 0.932
#> SRR2314030     1  0.3584      0.884 0.932 0.068
#> SRR2314028     2  0.0376      0.882 0.004 0.996
#> SRR2314027     2  0.0000      0.880 0.000 1.000
#> SRR2314026     2  0.7528      0.634 0.216 0.784
#> SRR2314020     2  0.5946      0.895 0.144 0.856
#> SRR2314019     2  0.0000      0.880 0.000 1.000
#> SRR2314021     2  0.2603      0.861 0.044 0.956
#> SRR2314018     2  0.3879      0.904 0.076 0.924
#> SRR2314017     1  0.3733      0.881 0.928 0.072
#> SRR2314016     1  0.1184      0.905 0.984 0.016
#> SRR2314014     2  0.3879      0.904 0.076 0.924
#> SRR2314013     2  0.5059      0.904 0.112 0.888
#> SRR2314012     1  0.2948      0.893 0.948 0.052
#> SRR2314011     1  0.7056      0.846 0.808 0.192
#> SRR2314010     2  0.2948      0.887 0.052 0.948
#> SRR2314009     2  0.3733      0.903 0.072 0.928
#> SRR2314008     2  0.4022      0.903 0.080 0.920
#> SRR2314007     2  0.0000      0.880 0.000 1.000
#> SRR2314005     2  0.5946      0.895 0.144 0.856
#> SRR2314004     2  0.5946      0.895 0.144 0.856
#> SRR2314003     1  0.7376      0.840 0.792 0.208
#> SRR2314006     2  0.5946      0.895 0.144 0.856
#> SRR2314002     1  0.0000      0.908 1.000 0.000
#> SRR2314001     2  0.3879      0.904 0.076 0.924
#> SRR2314000     1  0.5519      0.849 0.872 0.128
#> SRR2313998     2  0.5946      0.895 0.144 0.856
#> SRR2313996     2  0.0000      0.880 0.000 1.000
#> SRR2313999     1  0.5737      0.853 0.864 0.136
#> SRR2313997     2  0.5946      0.895 0.144 0.856
#> SRR2313992     1  0.8909      0.745 0.692 0.308
#> SRR2313991     2  0.9866      0.470 0.432 0.568
#> SRR2313990     2  0.3879      0.904 0.076 0.924
#> SRR2313988     1  0.0000      0.908 1.000 0.000
#> SRR2313987     1  0.0000      0.908 1.000 0.000
#> SRR2313984     2  0.4022      0.903 0.080 0.920
#> SRR2313989     2  0.5946      0.895 0.144 0.856
#> SRR2313983     1  0.0000      0.908 1.000 0.000
#> SRR2313986     1  0.7453      0.837 0.788 0.212
#> SRR2313982     1  0.0000      0.908 1.000 0.000
#> SRR2313981     2  0.0000      0.880 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
#> SRR2313978     3  0.5756      0.650 0.028 0.208 0.764
#> SRR2313980     2  0.5667      0.939 0.060 0.800 0.140
#> SRR2313979     1  0.0592      0.907 0.988 0.012 0.000
#> SRR2313977     3  0.6402      0.651 0.040 0.236 0.724
#> SRR2313976     3  0.8019      0.422 0.076 0.348 0.576
#> SRR2313975     1  0.5505      0.814 0.816 0.088 0.096
#> SRR2313973     1  0.1529      0.899 0.960 0.040 0.000
#> SRR2313974     1  0.2846      0.855 0.924 0.020 0.056
#> SRR2313985     1  0.0237      0.908 0.996 0.004 0.000
#> SRR2313993     3  0.5158      0.635 0.004 0.232 0.764
#> SRR2313994     3  0.7062      0.618 0.068 0.236 0.696
#> SRR2313995     2  0.5774      0.889 0.020 0.748 0.232
#> SRR2314024     2  0.5817      0.891 0.020 0.744 0.236
#> SRR2314015     3  0.6936      0.622 0.064 0.232 0.704
#> SRR2314025     3  0.7996      0.455 0.380 0.068 0.552
#> SRR2314023     1  0.0237      0.907 0.996 0.004 0.000
#> SRR2314033     2  0.5780      0.920 0.080 0.800 0.120
#> SRR2314045     1  0.3181      0.882 0.912 0.064 0.024
#> SRR2314042     3  0.6541      0.671 0.212 0.056 0.732
#> SRR2314043     3  0.3532      0.735 0.108 0.008 0.884
#> SRR2314041     3  0.0747      0.723 0.000 0.016 0.984
#> SRR2314044     3  0.0747      0.729 0.016 0.000 0.984
#> SRR2314040     3  0.5454      0.715 0.044 0.152 0.804
#> SRR2314039     3  0.0237      0.725 0.004 0.000 0.996
#> SRR2314038     3  0.7317      0.682 0.208 0.096 0.696
#> SRR2314037     3  0.0237      0.724 0.004 0.000 0.996
#> SRR2314036     2  0.5740      0.898 0.096 0.804 0.100
#> SRR2314035     3  0.6765      0.690 0.208 0.068 0.724
#> SRR2314034     3  0.3415      0.727 0.080 0.020 0.900
#> SRR2314032     1  0.2945      0.882 0.908 0.088 0.004
#> SRR2314031     3  0.6820      0.637 0.248 0.052 0.700
#> SRR2314029     3  0.7524      0.540 0.116 0.196 0.688
#> SRR2314030     3  0.7644      0.590 0.308 0.068 0.624
#> SRR2314028     3  0.1482      0.724 0.012 0.020 0.968
#> SRR2314027     3  0.0747      0.723 0.000 0.016 0.984
#> SRR2314026     3  0.2414      0.729 0.040 0.020 0.940
#> SRR2314020     2  0.5355      0.940 0.036 0.804 0.160
#> SRR2314019     3  0.1482      0.722 0.012 0.020 0.968
#> SRR2314021     3  0.1781      0.723 0.020 0.020 0.960
#> SRR2314018     3  0.4677      0.734 0.132 0.028 0.840
#> SRR2314017     3  0.8247      0.492 0.324 0.096 0.580
#> SRR2314016     3  0.7690      0.463 0.416 0.048 0.536
#> SRR2314014     3  0.6633      0.653 0.040 0.260 0.700
#> SRR2314013     3  0.6913      0.620 0.056 0.248 0.696
#> SRR2314012     3  0.7777      0.423 0.416 0.052 0.532
#> SRR2314011     1  0.6621      0.590 0.720 0.052 0.228
#> SRR2314010     3  0.4842      0.638 0.000 0.224 0.776
#> SRR2314009     3  0.1289      0.732 0.032 0.000 0.968
#> SRR2314008     3  0.3752      0.732 0.144 0.000 0.856
#> SRR2314007     3  0.3116      0.713 0.000 0.108 0.892
#> SRR2314005     3  0.8019      0.433 0.076 0.348 0.576
#> SRR2314004     3  0.7874      0.462 0.076 0.320 0.604
#> SRR2314003     3  0.7982      0.457 0.376 0.068 0.556
#> SRR2314006     2  0.6025      0.931 0.076 0.784 0.140
#> SRR2314002     1  0.6184      0.786 0.780 0.112 0.108
#> SRR2314001     3  0.6965      0.646 0.060 0.244 0.696
#> SRR2314000     3  0.8191      0.370 0.396 0.076 0.528
#> SRR2313998     3  0.7411      0.599 0.076 0.256 0.668
#> SRR2313996     3  0.4452      0.670 0.000 0.192 0.808
#> SRR2313999     3  0.7289      0.406 0.468 0.028 0.504
#> SRR2313997     2  0.5295      0.941 0.036 0.808 0.156
#> SRR2313992     3  0.4979      0.713 0.168 0.020 0.812
#> SRR2313991     3  0.8372      0.615 0.228 0.152 0.620
#> SRR2313990     3  0.5637      0.710 0.040 0.172 0.788
#> SRR2313988     1  0.2400      0.889 0.932 0.064 0.004
#> SRR2313987     1  0.0000      0.907 1.000 0.000 0.000
#> SRR2313984     3  0.6847      0.625 0.060 0.232 0.708
#> SRR2313989     2  0.5295      0.941 0.036 0.808 0.156
#> SRR2313983     1  0.0592      0.907 0.988 0.012 0.000
#> SRR2313986     3  0.6668      0.630 0.264 0.040 0.696
#> SRR2313982     1  0.1031      0.904 0.976 0.024 0.000
#> SRR2313981     3  0.0829      0.724 0.012 0.004 0.984

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     3  0.4399     0.5539 0.000 0.016 0.760 0.224
#> SRR2313980     2  0.1749     0.8162 0.024 0.952 0.012 0.012
#> SRR2313979     1  0.0000     0.8731 1.000 0.000 0.000 0.000
#> SRR2313977     3  0.3875     0.5678 0.004 0.068 0.852 0.076
#> SRR2313976     3  0.5252     0.4030 0.020 0.280 0.692 0.008
#> SRR2313975     1  0.4762     0.7869 0.796 0.004 0.120 0.080
#> SRR2313973     1  0.1474     0.8530 0.948 0.000 0.000 0.052
#> SRR2313974     1  0.4290     0.6883 0.772 0.000 0.016 0.212
#> SRR2313985     1  0.0000     0.8731 1.000 0.000 0.000 0.000
#> SRR2313993     3  0.5585     0.5802 0.008 0.108 0.744 0.140
#> SRR2313994     3  0.2673     0.5893 0.020 0.048 0.916 0.016
#> SRR2313995     2  0.7792    -0.0800 0.012 0.412 0.412 0.164
#> SRR2314024     2  0.7469     0.2241 0.012 0.524 0.320 0.144
#> SRR2314015     3  0.4914     0.6120 0.024 0.064 0.804 0.108
#> SRR2314025     4  0.3400     0.5167 0.180 0.000 0.000 0.820
#> SRR2314023     1  0.0707     0.8658 0.980 0.000 0.000 0.020
#> SRR2314033     2  0.3820     0.7436 0.064 0.848 0.088 0.000
#> SRR2314045     1  0.5332     0.7802 0.748 0.000 0.124 0.128
#> SRR2314042     4  0.5823     0.5278 0.176 0.000 0.120 0.704
#> SRR2314043     3  0.5497    -0.0274 0.016 0.000 0.524 0.460
#> SRR2314041     3  0.4008     0.5374 0.000 0.000 0.756 0.244
#> SRR2314044     3  0.4500     0.4665 0.000 0.000 0.684 0.316
#> SRR2314040     3  0.5773     0.0409 0.004 0.032 0.612 0.352
#> SRR2314039     3  0.4730     0.3801 0.000 0.000 0.636 0.364
#> SRR2314038     3  0.8791     0.2070 0.076 0.160 0.428 0.336
#> SRR2314037     4  0.4830     0.3066 0.000 0.000 0.392 0.608
#> SRR2314036     2  0.2125     0.7674 0.076 0.920 0.004 0.000
#> SRR2314035     3  0.6361    -0.0827 0.044 0.008 0.504 0.444
#> SRR2314034     4  0.5420     0.3526 0.024 0.000 0.352 0.624
#> SRR2314032     1  0.3128     0.8365 0.884 0.000 0.076 0.040
#> SRR2314031     4  0.5811     0.5283 0.180 0.000 0.116 0.704
#> SRR2314029     3  0.7072     0.4369 0.000 0.172 0.560 0.268
#> SRR2314030     4  0.8649     0.1963 0.112 0.152 0.212 0.524
#> SRR2314028     4  0.4790     0.3259 0.000 0.000 0.380 0.620
#> SRR2314027     3  0.4605     0.4343 0.000 0.000 0.664 0.336
#> SRR2314026     4  0.4697     0.3088 0.000 0.000 0.356 0.644
#> SRR2314020     2  0.1526     0.8153 0.016 0.960 0.012 0.012
#> SRR2314019     4  0.4817     0.2998 0.000 0.000 0.388 0.612
#> SRR2314021     4  0.5038     0.3452 0.012 0.000 0.336 0.652
#> SRR2314018     3  0.5728     0.0279 0.008 0.024 0.616 0.352
#> SRR2314017     4  0.7781     0.0767 0.344 0.000 0.248 0.408
#> SRR2314016     4  0.4767     0.4244 0.256 0.020 0.000 0.724
#> SRR2314014     3  0.3861     0.5880 0.008 0.080 0.856 0.056
#> SRR2314013     3  0.3231     0.5978 0.012 0.116 0.868 0.004
#> SRR2314012     4  0.4328     0.4583 0.244 0.008 0.000 0.748
#> SRR2314011     4  0.4998    -0.0334 0.488 0.000 0.000 0.512
#> SRR2314010     3  0.5442     0.5712 0.008 0.080 0.748 0.164
#> SRR2314009     4  0.4877     0.2882 0.000 0.000 0.408 0.592
#> SRR2314008     3  0.3441     0.6010 0.024 0.000 0.856 0.120
#> SRR2314007     3  0.5060     0.2461 0.004 0.000 0.584 0.412
#> SRR2314005     3  0.5718     0.4481 0.024 0.232 0.708 0.036
#> SRR2314004     3  0.6820     0.5333 0.016 0.228 0.636 0.120
#> SRR2314003     4  0.3400     0.5167 0.180 0.000 0.000 0.820
#> SRR2314006     2  0.1749     0.8162 0.024 0.952 0.012 0.012
#> SRR2314002     1  0.6385     0.7330 0.716 0.048 0.096 0.140
#> SRR2314001     3  0.3587     0.5980 0.004 0.032 0.860 0.104
#> SRR2314000     4  0.6722     0.1329 0.068 0.008 0.424 0.500
#> SRR2313998     3  0.3353     0.5749 0.020 0.056 0.888 0.036
#> SRR2313996     3  0.4331     0.5003 0.000 0.000 0.712 0.288
#> SRR2313999     4  0.5169     0.4278 0.272 0.000 0.032 0.696
#> SRR2313997     2  0.1526     0.8153 0.016 0.960 0.012 0.012
#> SRR2313992     4  0.6677     0.3984 0.100 0.000 0.348 0.552
#> SRR2313991     3  0.8369     0.3329 0.076 0.172 0.540 0.212
#> SRR2313990     3  0.5693     0.1957 0.004 0.036 0.644 0.316
#> SRR2313988     1  0.3128     0.8365 0.884 0.000 0.076 0.040
#> SRR2313987     1  0.3219     0.7806 0.836 0.000 0.000 0.164
#> SRR2313984     3  0.5945     0.5885 0.020 0.156 0.728 0.096
#> SRR2313989     2  0.2074     0.8098 0.016 0.940 0.032 0.012
#> SRR2313983     1  0.0000     0.8731 1.000 0.000 0.000 0.000
#> SRR2313986     4  0.5759     0.5292 0.180 0.000 0.112 0.708
#> SRR2313982     1  0.0000     0.8731 1.000 0.000 0.000 0.000
#> SRR2313981     4  0.4978     0.3251 0.004 0.000 0.384 0.612

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     2  0.3844      0.704 0.000 0.788 0.180 0.004 0.028
#> SRR2313980     5  0.0324      0.885 0.004 0.004 0.000 0.000 0.992
#> SRR2313979     1  0.0865      0.860 0.972 0.004 0.000 0.024 0.000
#> SRR2313977     2  0.3766      0.547 0.004 0.728 0.268 0.000 0.000
#> SRR2313976     2  0.4702     -0.259 0.004 0.512 0.008 0.000 0.476
#> SRR2313975     1  0.5227      0.467 0.688 0.024 0.236 0.052 0.000
#> SRR2313973     1  0.1544      0.837 0.932 0.000 0.000 0.068 0.000
#> SRR2313974     4  0.4802     -0.172 0.480 0.012 0.004 0.504 0.000
#> SRR2313985     1  0.1768      0.852 0.924 0.004 0.000 0.072 0.000
#> SRR2313993     2  0.4239      0.698 0.000 0.784 0.080 0.004 0.132
#> SRR2313994     2  0.1682      0.706 0.004 0.940 0.044 0.000 0.012
#> SRR2313995     2  0.4754      0.654 0.000 0.736 0.072 0.008 0.184
#> SRR2314024     5  0.5370      0.142 0.000 0.408 0.040 0.008 0.544
#> SRR2314015     2  0.3937      0.718 0.004 0.804 0.132 0.000 0.060
#> SRR2314025     4  0.2338      0.715 0.004 0.000 0.112 0.884 0.000
#> SRR2314023     1  0.2536      0.820 0.868 0.004 0.000 0.128 0.000
#> SRR2314033     5  0.2909      0.769 0.012 0.140 0.000 0.000 0.848
#> SRR2314045     1  0.3797      0.702 0.756 0.008 0.004 0.232 0.000
#> SRR2314042     4  0.3796      0.599 0.000 0.000 0.300 0.700 0.000
#> SRR2314043     3  0.2719      0.684 0.004 0.144 0.852 0.000 0.000
#> SRR2314041     2  0.5190      0.454 0.000 0.540 0.424 0.008 0.028
#> SRR2314044     3  0.2852      0.598 0.000 0.172 0.828 0.000 0.000
#> SRR2314040     3  0.3333      0.651 0.004 0.208 0.788 0.000 0.000
#> SRR2314039     3  0.4118      0.534 0.000 0.188 0.772 0.008 0.032
#> SRR2314038     3  0.6749      0.368 0.044 0.316 0.556 0.024 0.060
#> SRR2314037     3  0.0162      0.712 0.000 0.004 0.996 0.000 0.000
#> SRR2314036     5  0.1605      0.849 0.040 0.004 0.000 0.012 0.944
#> SRR2314035     3  0.4973      0.635 0.012 0.184 0.724 0.080 0.000
#> SRR2314034     3  0.1569      0.692 0.004 0.008 0.944 0.044 0.000
#> SRR2314032     1  0.1082      0.849 0.964 0.008 0.000 0.028 0.000
#> SRR2314031     4  0.3796      0.599 0.000 0.000 0.300 0.700 0.000
#> SRR2314029     2  0.5745      0.360 0.000 0.568 0.352 0.012 0.068
#> SRR2314030     3  0.7451      0.190 0.048 0.124 0.444 0.368 0.016
#> SRR2314028     3  0.1443      0.694 0.004 0.004 0.948 0.044 0.000
#> SRR2314027     3  0.4998      0.183 0.000 0.328 0.632 0.008 0.032
#> SRR2314026     3  0.1518      0.710 0.000 0.012 0.952 0.016 0.020
#> SRR2314020     5  0.0000      0.884 0.000 0.000 0.000 0.000 1.000
#> SRR2314019     3  0.1357      0.704 0.000 0.000 0.948 0.048 0.004
#> SRR2314021     3  0.2177      0.684 0.004 0.008 0.908 0.080 0.000
#> SRR2314018     3  0.3266      0.655 0.004 0.200 0.796 0.000 0.000
#> SRR2314017     3  0.7105      0.346 0.160 0.060 0.532 0.248 0.000
#> SRR2314016     4  0.1408      0.640 0.044 0.000 0.008 0.948 0.000
#> SRR2314014     2  0.3989      0.552 0.004 0.728 0.260 0.000 0.008
#> SRR2314013     2  0.1357      0.705 0.000 0.948 0.048 0.000 0.004
#> SRR2314012     4  0.2726      0.671 0.064 0.000 0.052 0.884 0.000
#> SRR2314011     4  0.4920      0.350 0.308 0.000 0.048 0.644 0.000
#> SRR2314010     2  0.4347      0.694 0.000 0.780 0.076 0.008 0.136
#> SRR2314009     3  0.0162      0.712 0.000 0.004 0.996 0.000 0.000
#> SRR2314008     3  0.4238      0.405 0.004 0.368 0.628 0.000 0.000
#> SRR2314007     3  0.4523      0.407 0.000 0.252 0.712 0.008 0.028
#> SRR2314005     2  0.2408      0.645 0.004 0.892 0.008 0.000 0.096
#> SRR2314004     2  0.4269      0.689 0.004 0.780 0.076 0.000 0.140
#> SRR2314003     4  0.2536      0.717 0.004 0.000 0.128 0.868 0.000
#> SRR2314006     5  0.0451      0.884 0.008 0.004 0.000 0.000 0.988
#> SRR2314002     3  0.6717      0.157 0.412 0.056 0.464 0.064 0.004
#> SRR2314001     2  0.4937      0.502 0.004 0.604 0.364 0.000 0.028
#> SRR2314000     3  0.6780      0.464 0.028 0.216 0.544 0.212 0.000
#> SRR2313998     2  0.1443      0.703 0.004 0.948 0.044 0.000 0.004
#> SRR2313996     2  0.5089      0.446 0.000 0.536 0.432 0.004 0.028
#> SRR2313999     4  0.5283      0.646 0.144 0.016 0.128 0.712 0.000
#> SRR2313997     5  0.0000      0.884 0.000 0.000 0.000 0.000 1.000
#> SRR2313992     3  0.1282      0.697 0.000 0.004 0.952 0.044 0.000
#> SRR2313991     3  0.7739      0.267 0.048 0.380 0.432 0.084 0.056
#> SRR2313990     2  0.3906      0.517 0.004 0.704 0.292 0.000 0.000
#> SRR2313988     1  0.0693      0.854 0.980 0.012 0.000 0.008 0.000
#> SRR2313987     1  0.3550      0.710 0.760 0.004 0.000 0.236 0.000
#> SRR2313984     2  0.4150      0.691 0.004 0.788 0.068 0.000 0.140
#> SRR2313989     5  0.0162      0.883 0.000 0.000 0.004 0.000 0.996
#> SRR2313983     1  0.0771      0.860 0.976 0.004 0.000 0.020 0.000
#> SRR2313986     4  0.3949      0.555 0.000 0.000 0.332 0.668 0.000
#> SRR2313982     1  0.0963      0.860 0.964 0.000 0.000 0.036 0.000
#> SRR2313981     3  0.0162      0.712 0.000 0.004 0.996 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
#> SRR2313978     2  0.5693     0.5739 0.000 0.584 0.188 0.004 0.216 0.008
#> SRR2313980     6  0.0291     0.9237 0.004 0.000 0.000 0.000 0.004 0.992
#> SRR2313979     1  0.0260     0.7474 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR2313977     2  0.1829     0.7222 0.000 0.920 0.064 0.004 0.012 0.000
#> SRR2313976     2  0.4619     0.0377 0.000 0.564 0.000 0.000 0.044 0.392
#> SRR2313975     5  0.7021     0.6052 0.316 0.004 0.156 0.092 0.432 0.000
#> SRR2313973     1  0.1411     0.7146 0.936 0.000 0.000 0.060 0.004 0.000
#> SRR2313974     4  0.5253     0.3048 0.296 0.000 0.000 0.576 0.128 0.000
#> SRR2313985     1  0.0935     0.7479 0.964 0.000 0.000 0.032 0.004 0.000
#> SRR2313993     2  0.3644     0.6930 0.000 0.784 0.020 0.004 0.012 0.180
#> SRR2313994     2  0.1149     0.7332 0.000 0.960 0.008 0.000 0.024 0.008
#> SRR2313995     2  0.5831     0.5708 0.000 0.560 0.008 0.004 0.204 0.224
#> SRR2314024     6  0.3013     0.7573 0.000 0.152 0.004 0.004 0.012 0.828
#> SRR2314015     2  0.4829     0.7082 0.004 0.748 0.048 0.008 0.124 0.068
#> SRR2314025     4  0.0790     0.7998 0.000 0.000 0.032 0.968 0.000 0.000
#> SRR2314023     1  0.1152     0.7429 0.952 0.000 0.000 0.044 0.004 0.000
#> SRR2314033     6  0.3691     0.7447 0.004 0.168 0.000 0.000 0.048 0.780
#> SRR2314045     1  0.4881     0.0234 0.496 0.000 0.004 0.048 0.452 0.000
#> SRR2314042     4  0.1958     0.7796 0.000 0.000 0.100 0.896 0.004 0.000
#> SRR2314043     3  0.1444     0.7135 0.000 0.072 0.928 0.000 0.000 0.000
#> SRR2314041     2  0.6323     0.2542 0.000 0.364 0.332 0.008 0.296 0.000
#> SRR2314044     3  0.4266     0.6333 0.000 0.088 0.736 0.004 0.172 0.000
#> SRR2314040     3  0.2882     0.6684 0.000 0.180 0.812 0.000 0.008 0.000
#> SRR2314039     3  0.4374     0.6350 0.000 0.088 0.732 0.008 0.172 0.000
#> SRR2314038     3  0.6405     0.5627 0.004 0.160 0.608 0.020 0.148 0.060
#> SRR2314037     3  0.0000     0.7110 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314036     6  0.1285     0.8972 0.004 0.000 0.000 0.000 0.052 0.944
#> SRR2314035     3  0.4012     0.6389 0.004 0.144 0.784 0.044 0.024 0.000
#> SRR2314034     3  0.2092     0.6440 0.000 0.000 0.876 0.124 0.000 0.000
#> SRR2314032     1  0.3857     0.0489 0.532 0.000 0.000 0.000 0.468 0.000
#> SRR2314031     4  0.1858     0.7844 0.000 0.000 0.092 0.904 0.004 0.000
#> SRR2314029     3  0.6269     0.2557 0.000 0.284 0.476 0.008 0.224 0.008
#> SRR2314030     3  0.6373     0.0255 0.004 0.012 0.432 0.360 0.188 0.004
#> SRR2314028     3  0.1863     0.6638 0.000 0.000 0.896 0.104 0.000 0.000
#> SRR2314027     3  0.5715     0.3773 0.000 0.160 0.540 0.008 0.292 0.000
#> SRR2314026     3  0.0665     0.7142 0.000 0.008 0.980 0.008 0.004 0.000
#> SRR2314020     6  0.0000     0.9252 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314019     3  0.0692     0.7108 0.000 0.000 0.976 0.020 0.004 0.000
#> SRR2314021     3  0.2234     0.6539 0.000 0.000 0.872 0.124 0.004 0.000
#> SRR2314018     3  0.2988     0.6667 0.000 0.152 0.824 0.000 0.024 0.000
#> SRR2314017     3  0.5473     0.3855 0.028 0.028 0.632 0.044 0.268 0.000
#> SRR2314016     4  0.1605     0.7710 0.016 0.000 0.004 0.936 0.044 0.000
#> SRR2314014     2  0.1745     0.7195 0.000 0.920 0.068 0.000 0.012 0.000
#> SRR2314013     2  0.0291     0.7319 0.000 0.992 0.000 0.004 0.004 0.000
#> SRR2314012     4  0.1152     0.7837 0.044 0.000 0.004 0.952 0.000 0.000
#> SRR2314011     4  0.3890     0.3425 0.400 0.000 0.004 0.596 0.000 0.000
#> SRR2314010     2  0.5782     0.6291 0.000 0.612 0.028 0.004 0.192 0.164
#> SRR2314009     3  0.0000     0.7110 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314008     3  0.5018     0.6236 0.004 0.156 0.680 0.008 0.152 0.000
#> SRR2314007     3  0.4480     0.6091 0.000 0.192 0.716 0.008 0.084 0.000
#> SRR2314005     2  0.1984     0.7098 0.000 0.912 0.000 0.000 0.056 0.032
#> SRR2314004     2  0.3618     0.6648 0.000 0.764 0.012 0.004 0.008 0.212
#> SRR2314003     4  0.0790     0.7998 0.000 0.000 0.032 0.968 0.000 0.000
#> SRR2314006     6  0.0405     0.9234 0.004 0.000 0.000 0.000 0.008 0.988
#> SRR2314002     5  0.5252     0.6718 0.172 0.004 0.200 0.000 0.624 0.000
#> SRR2314001     2  0.2312     0.7214 0.000 0.876 0.112 0.000 0.012 0.000
#> SRR2314000     3  0.4930     0.6098 0.016 0.176 0.720 0.044 0.044 0.000
#> SRR2313998     2  0.0865     0.7253 0.000 0.964 0.000 0.000 0.036 0.000
#> SRR2313996     2  0.5961     0.4848 0.000 0.504 0.276 0.008 0.212 0.000
#> SRR2313999     4  0.3551     0.7200 0.148 0.000 0.060 0.792 0.000 0.000
#> SRR2313997     6  0.0000     0.9252 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313992     3  0.1610     0.6770 0.000 0.000 0.916 0.084 0.000 0.000
#> SRR2313991     3  0.6520     0.3938 0.004 0.204 0.456 0.020 0.312 0.004
#> SRR2313990     2  0.3298     0.6059 0.000 0.756 0.236 0.000 0.008 0.000
#> SRR2313988     1  0.3817     0.1220 0.568 0.000 0.000 0.000 0.432 0.000
#> SRR2313987     1  0.1531     0.7260 0.928 0.000 0.000 0.068 0.004 0.000
#> SRR2313984     2  0.3385     0.6895 0.000 0.792 0.016 0.004 0.004 0.184
#> SRR2313989     6  0.0000     0.9252 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     1  0.0260     0.7474 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR2313986     4  0.2234     0.7582 0.000 0.000 0.124 0.872 0.004 0.000
#> SRR2313982     1  0.0891     0.7397 0.968 0.000 0.000 0.008 0.024 0.000
#> SRR2313981     3  0.0000     0.7110 0.000 0.000 1.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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 16873 rows and 72 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.971           0.963       0.982         0.5057 0.493   0.493
#> 3 3 0.388           0.453       0.717         0.2966 0.783   0.585
#> 4 4 0.585           0.669       0.795         0.1406 0.786   0.463
#> 5 5 0.677           0.602       0.787         0.0673 0.870   0.544
#> 6 6 0.701           0.562       0.770         0.0288 0.916   0.628

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
#> SRR2313978     2   0.000      0.980 0.000 1.000
#> SRR2313980     2   0.000      0.980 0.000 1.000
#> SRR2313979     1   0.000      0.982 1.000 0.000
#> SRR2313977     2   0.000      0.980 0.000 1.000
#> SRR2313976     2   0.000      0.980 0.000 1.000
#> SRR2313975     1   0.000      0.982 1.000 0.000
#> SRR2313973     1   0.000      0.982 1.000 0.000
#> SRR2313974     1   0.000      0.982 1.000 0.000
#> SRR2313985     1   0.000      0.982 1.000 0.000
#> SRR2313993     2   0.000      0.980 0.000 1.000
#> SRR2313994     2   0.000      0.980 0.000 1.000
#> SRR2313995     2   0.000      0.980 0.000 1.000
#> SRR2314024     2   0.000      0.980 0.000 1.000
#> SRR2314015     2   0.000      0.980 0.000 1.000
#> SRR2314025     1   0.000      0.982 1.000 0.000
#> SRR2314023     1   0.000      0.982 1.000 0.000
#> SRR2314033     2   0.000      0.980 0.000 1.000
#> SRR2314045     1   0.000      0.982 1.000 0.000
#> SRR2314042     1   0.000      0.982 1.000 0.000
#> SRR2314043     1   0.605      0.840 0.852 0.148
#> SRR2314041     2   0.000      0.980 0.000 1.000
#> SRR2314044     2   0.000      0.980 0.000 1.000
#> SRR2314040     2   0.839      0.637 0.268 0.732
#> SRR2314039     2   0.000      0.980 0.000 1.000
#> SRR2314038     2   0.469      0.881 0.100 0.900
#> SRR2314037     1   0.260      0.951 0.956 0.044
#> SRR2314036     2   0.000      0.980 0.000 1.000
#> SRR2314035     1   0.373      0.927 0.928 0.072
#> SRR2314034     1   0.000      0.982 1.000 0.000
#> SRR2314032     1   0.000      0.982 1.000 0.000
#> SRR2314031     1   0.000      0.982 1.000 0.000
#> SRR2314029     2   0.000      0.980 0.000 1.000
#> SRR2314030     1   0.000      0.982 1.000 0.000
#> SRR2314028     1   0.000      0.982 1.000 0.000
#> SRR2314027     2   0.000      0.980 0.000 1.000
#> SRR2314026     1   0.634      0.824 0.840 0.160
#> SRR2314020     2   0.000      0.980 0.000 1.000
#> SRR2314019     1   0.327      0.938 0.940 0.060
#> SRR2314021     1   0.000      0.982 1.000 0.000
#> SRR2314018     2   0.850      0.622 0.276 0.724
#> SRR2314017     1   0.000      0.982 1.000 0.000
#> SRR2314016     1   0.000      0.982 1.000 0.000
#> SRR2314014     2   0.000      0.980 0.000 1.000
#> SRR2314013     2   0.000      0.980 0.000 1.000
#> SRR2314012     1   0.000      0.982 1.000 0.000
#> SRR2314011     1   0.000      0.982 1.000 0.000
#> SRR2314010     2   0.000      0.980 0.000 1.000
#> SRR2314009     1   0.260      0.951 0.956 0.044
#> SRR2314008     2   0.000      0.980 0.000 1.000
#> SRR2314007     2   0.000      0.980 0.000 1.000
#> SRR2314005     2   0.000      0.980 0.000 1.000
#> SRR2314004     2   0.000      0.980 0.000 1.000
#> SRR2314003     1   0.000      0.982 1.000 0.000
#> SRR2314006     2   0.000      0.980 0.000 1.000
#> SRR2314002     1   0.000      0.982 1.000 0.000
#> SRR2314001     2   0.000      0.980 0.000 1.000
#> SRR2314000     1   0.388      0.923 0.924 0.076
#> SRR2313998     2   0.000      0.980 0.000 1.000
#> SRR2313996     2   0.000      0.980 0.000 1.000
#> SRR2313999     1   0.000      0.982 1.000 0.000
#> SRR2313997     2   0.000      0.980 0.000 1.000
#> SRR2313992     1   0.000      0.982 1.000 0.000
#> SRR2313991     2   0.141      0.963 0.020 0.980
#> SRR2313990     2   0.000      0.980 0.000 1.000
#> SRR2313988     1   0.000      0.982 1.000 0.000
#> SRR2313987     1   0.000      0.982 1.000 0.000
#> SRR2313984     2   0.000      0.980 0.000 1.000
#> SRR2313989     2   0.000      0.980 0.000 1.000
#> SRR2313983     1   0.000      0.982 1.000 0.000
#> SRR2313986     1   0.000      0.982 1.000 0.000
#> SRR2313982     1   0.000      0.982 1.000 0.000
#> SRR2313981     1   0.000      0.982 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.2959     0.7299 0.000 0.900 0.100
#> SRR2313980     2  0.0000     0.7481 0.000 1.000 0.000
#> SRR2313979     1  0.0000     0.7114 1.000 0.000 0.000
#> SRR2313977     2  0.5760     0.5626 0.000 0.672 0.328
#> SRR2313976     2  0.4931     0.6578 0.000 0.768 0.232
#> SRR2313975     1  0.0000     0.7114 1.000 0.000 0.000
#> SRR2313973     1  0.3412     0.6964 0.876 0.000 0.124
#> SRR2313974     1  0.0237     0.7124 0.996 0.000 0.004
#> SRR2313985     1  0.1289     0.7141 0.968 0.000 0.032
#> SRR2313993     2  0.4931     0.5950 0.000 0.768 0.232
#> SRR2313994     2  0.6280     0.3672 0.000 0.540 0.460
#> SRR2313995     2  0.5529     0.4514 0.000 0.704 0.296
#> SRR2314024     2  0.0592     0.7453 0.000 0.988 0.012
#> SRR2314015     2  0.1643     0.7469 0.000 0.956 0.044
#> SRR2314025     1  0.6274     0.3881 0.544 0.000 0.456
#> SRR2314023     1  0.1860     0.7127 0.948 0.000 0.052
#> SRR2314033     2  0.3752     0.7083 0.000 0.856 0.144
#> SRR2314045     1  0.2796     0.6491 0.908 0.000 0.092
#> SRR2314042     3  0.7293    -0.3132 0.476 0.028 0.496
#> SRR2314043     1  0.9409    -0.0347 0.508 0.236 0.256
#> SRR2314041     2  0.6095     0.3043 0.000 0.608 0.392
#> SRR2314044     2  0.6880     0.5167 0.036 0.660 0.304
#> SRR2314040     3  0.8714     0.1123 0.156 0.264 0.580
#> SRR2314039     3  0.7001     0.1409 0.024 0.388 0.588
#> SRR2314038     2  0.5174     0.6330 0.128 0.824 0.048
#> SRR2314037     3  0.5810     0.0675 0.336 0.000 0.664
#> SRR2314036     2  0.1411     0.7481 0.000 0.964 0.036
#> SRR2314035     3  0.6451     0.0955 0.436 0.004 0.560
#> SRR2314034     1  0.6079     0.3179 0.612 0.000 0.388
#> SRR2314032     1  0.1411     0.6943 0.964 0.000 0.036
#> SRR2314031     1  0.6305     0.3306 0.516 0.000 0.484
#> SRR2314029     2  0.3340     0.6780 0.000 0.880 0.120
#> SRR2314030     3  0.8168     0.1319 0.280 0.108 0.612
#> SRR2314028     1  0.6286     0.2695 0.536 0.000 0.464
#> SRR2314027     3  0.6307    -0.1376 0.000 0.488 0.512
#> SRR2314026     3  0.9574     0.3489 0.244 0.276 0.480
#> SRR2314020     2  0.0000     0.7481 0.000 1.000 0.000
#> SRR2314019     3  0.8433     0.3395 0.204 0.176 0.620
#> SRR2314021     3  0.6507     0.1881 0.284 0.028 0.688
#> SRR2314018     3  0.9257     0.0841 0.196 0.284 0.520
#> SRR2314017     3  0.6305    -0.0728 0.484 0.000 0.516
#> SRR2314016     1  0.5216     0.6287 0.740 0.000 0.260
#> SRR2314014     3  0.6309    -0.3538 0.000 0.500 0.500
#> SRR2314013     2  0.3941     0.7017 0.000 0.844 0.156
#> SRR2314012     1  0.6154     0.4677 0.592 0.000 0.408
#> SRR2314011     1  0.5650     0.5699 0.688 0.000 0.312
#> SRR2314010     2  0.4235     0.6481 0.000 0.824 0.176
#> SRR2314009     3  0.8221     0.3416 0.248 0.128 0.624
#> SRR2314008     2  0.6608     0.4393 0.008 0.560 0.432
#> SRR2314007     2  0.6062     0.3788 0.000 0.616 0.384
#> SRR2314005     2  0.5529     0.5893 0.000 0.704 0.296
#> SRR2314004     2  0.1289     0.7485 0.000 0.968 0.032
#> SRR2314003     1  0.6168     0.4617 0.588 0.000 0.412
#> SRR2314006     2  0.0237     0.7474 0.000 0.996 0.004
#> SRR2314002     1  0.3879     0.5771 0.848 0.000 0.152
#> SRR2314001     3  0.6302    -0.3192 0.000 0.480 0.520
#> SRR2314000     1  0.5480     0.3911 0.732 0.004 0.264
#> SRR2313998     2  0.5058     0.6444 0.000 0.756 0.244
#> SRR2313996     2  0.6079     0.4296 0.000 0.612 0.388
#> SRR2313999     1  0.4178     0.6736 0.828 0.000 0.172
#> SRR2313997     2  0.0000     0.7481 0.000 1.000 0.000
#> SRR2313992     3  0.6168    -0.1175 0.412 0.000 0.588
#> SRR2313991     2  0.5566     0.6534 0.080 0.812 0.108
#> SRR2313990     3  0.6215    -0.2323 0.000 0.428 0.572
#> SRR2313988     1  0.0592     0.7057 0.988 0.000 0.012
#> SRR2313987     1  0.2448     0.7086 0.924 0.000 0.076
#> SRR2313984     2  0.3267     0.7023 0.000 0.884 0.116
#> SRR2313989     2  0.0000     0.7481 0.000 1.000 0.000
#> SRR2313983     1  0.0000     0.7114 1.000 0.000 0.000
#> SRR2313986     1  0.6095     0.4887 0.608 0.000 0.392
#> SRR2313982     1  0.0237     0.7124 0.996 0.000 0.004
#> SRR2313981     3  0.5158     0.2311 0.232 0.004 0.764

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.1936    0.85788 0.000 0.940 0.032 0.028
#> SRR2313980     2  0.0336    0.86230 0.000 0.992 0.000 0.008
#> SRR2313979     1  0.1716    0.85105 0.936 0.000 0.000 0.064
#> SRR2313977     2  0.5389    0.63729 0.000 0.660 0.308 0.032
#> SRR2313976     2  0.5110    0.62313 0.000 0.656 0.328 0.016
#> SRR2313975     1  0.1716    0.85105 0.936 0.000 0.000 0.064
#> SRR2313973     1  0.3444    0.78220 0.816 0.000 0.000 0.184
#> SRR2313974     1  0.1867    0.85017 0.928 0.000 0.000 0.072
#> SRR2313985     1  0.2011    0.84808 0.920 0.000 0.000 0.080
#> SRR2313993     3  0.4767    0.62319 0.000 0.256 0.724 0.020
#> SRR2313994     3  0.2775    0.70504 0.000 0.084 0.896 0.020
#> SRR2313995     2  0.1940    0.82901 0.000 0.924 0.000 0.076
#> SRR2314024     2  0.0469    0.86187 0.000 0.988 0.000 0.012
#> SRR2314015     2  0.0817    0.86345 0.000 0.976 0.024 0.000
#> SRR2314025     4  0.2408    0.69910 0.104 0.000 0.000 0.896
#> SRR2314023     1  0.2281    0.84229 0.904 0.000 0.000 0.096
#> SRR2314033     2  0.3836    0.79781 0.000 0.816 0.168 0.016
#> SRR2314045     1  0.3464    0.73097 0.860 0.000 0.108 0.032
#> SRR2314042     4  0.2384    0.69170 0.016 0.040 0.016 0.928
#> SRR2314043     3  0.6395    0.49316 0.248 0.060 0.664 0.028
#> SRR2314041     4  0.5172    0.55284 0.000 0.188 0.068 0.744
#> SRR2314044     4  0.7210    0.26992 0.024 0.356 0.084 0.536
#> SRR2314040     3  0.1943    0.71263 0.032 0.016 0.944 0.008
#> SRR2314039     4  0.6731   -0.11240 0.004 0.080 0.404 0.512
#> SRR2314038     2  0.5329    0.73329 0.136 0.772 0.072 0.020
#> SRR2314037     4  0.4964    0.46411 0.032 0.000 0.244 0.724
#> SRR2314036     2  0.1174    0.86326 0.000 0.968 0.020 0.012
#> SRR2314035     3  0.1661    0.70593 0.052 0.000 0.944 0.004
#> SRR2314034     3  0.5792    0.55683 0.056 0.000 0.648 0.296
#> SRR2314032     1  0.2032    0.78397 0.936 0.000 0.036 0.028
#> SRR2314031     4  0.2345    0.69944 0.100 0.000 0.000 0.900
#> SRR2314029     2  0.0707    0.85966 0.000 0.980 0.000 0.020
#> SRR2314030     4  0.6332    0.53676 0.080 0.044 0.164 0.712
#> SRR2314028     4  0.7001    0.06674 0.116 0.000 0.420 0.464
#> SRR2314027     3  0.6602    0.44307 0.000 0.092 0.552 0.356
#> SRR2314026     3  0.5292    0.66947 0.064 0.024 0.776 0.136
#> SRR2314020     2  0.0524    0.86287 0.000 0.988 0.008 0.004
#> SRR2314019     3  0.6602    0.55358 0.056 0.028 0.624 0.292
#> SRR2314021     3  0.5567    0.65370 0.068 0.016 0.744 0.172
#> SRR2314018     3  0.4834    0.64294 0.136 0.032 0.800 0.032
#> SRR2314017     3  0.4153    0.67745 0.132 0.000 0.820 0.048
#> SRR2314016     4  0.6384    0.21880 0.400 0.000 0.068 0.532
#> SRR2314014     3  0.3659    0.65777 0.000 0.136 0.840 0.024
#> SRR2314013     2  0.4214    0.76997 0.000 0.780 0.204 0.016
#> SRR2314012     4  0.2469    0.69767 0.108 0.000 0.000 0.892
#> SRR2314011     1  0.5000    0.14055 0.500 0.000 0.000 0.500
#> SRR2314010     2  0.2124    0.83565 0.000 0.924 0.008 0.068
#> SRR2314009     3  0.4422    0.63553 0.008 0.000 0.736 0.256
#> SRR2314008     3  0.7175   -0.00622 0.000 0.404 0.460 0.136
#> SRR2314007     3  0.5764    0.67532 0.044 0.068 0.756 0.132
#> SRR2314005     2  0.4776    0.73150 0.000 0.732 0.244 0.024
#> SRR2314004     2  0.1510    0.86126 0.000 0.956 0.028 0.016
#> SRR2314003     4  0.2647    0.68510 0.120 0.000 0.000 0.880
#> SRR2314006     2  0.0469    0.86187 0.000 0.988 0.000 0.012
#> SRR2314002     1  0.3774    0.72576 0.844 0.008 0.128 0.020
#> SRR2314001     3  0.2363    0.71777 0.000 0.056 0.920 0.024
#> SRR2314000     1  0.4315    0.70649 0.816 0.012 0.144 0.028
#> SRR2313998     2  0.4214    0.76984 0.000 0.780 0.204 0.016
#> SRR2313996     3  0.6942    0.54175 0.000 0.176 0.584 0.240
#> SRR2313999     1  0.5060    0.41301 0.584 0.000 0.004 0.412
#> SRR2313997     2  0.0524    0.86287 0.000 0.988 0.008 0.004
#> SRR2313992     4  0.2565    0.70898 0.056 0.000 0.032 0.912
#> SRR2313991     2  0.7202    0.53847 0.092 0.632 0.224 0.052
#> SRR2313990     3  0.2443    0.71243 0.000 0.060 0.916 0.024
#> SRR2313988     1  0.0817    0.83569 0.976 0.000 0.000 0.024
#> SRR2313987     1  0.3311    0.79180 0.828 0.000 0.000 0.172
#> SRR2313984     2  0.3768    0.70805 0.000 0.808 0.184 0.008
#> SRR2313989     2  0.0188    0.86271 0.000 0.996 0.000 0.004
#> SRR2313983     1  0.1716    0.85105 0.936 0.000 0.000 0.064
#> SRR2313986     4  0.2868    0.66913 0.136 0.000 0.000 0.864
#> SRR2313982     1  0.1716    0.85105 0.936 0.000 0.000 0.064
#> SRR2313981     3  0.5646    0.61158 0.056 0.000 0.672 0.272

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     2  0.4691     0.6929 0.000 0.764 0.076 0.020 0.140
#> SRR2313980     2  0.0000     0.8789 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0451     0.8219 0.988 0.000 0.000 0.008 0.004
#> SRR2313977     3  0.4933     0.5361 0.004 0.060 0.688 0.000 0.248
#> SRR2313976     3  0.4747    -0.0153 0.000 0.484 0.500 0.000 0.016
#> SRR2313975     1  0.0451     0.8226 0.988 0.000 0.000 0.008 0.004
#> SRR2313973     1  0.4118     0.5236 0.660 0.000 0.000 0.336 0.004
#> SRR2313974     1  0.2110     0.8040 0.912 0.000 0.000 0.072 0.016
#> SRR2313985     1  0.1892     0.8037 0.916 0.000 0.000 0.080 0.004
#> SRR2313993     5  0.6441     0.4666 0.000 0.188 0.344 0.000 0.468
#> SRR2313994     3  0.4691     0.3238 0.000 0.044 0.680 0.000 0.276
#> SRR2313995     2  0.1082     0.8662 0.000 0.964 0.000 0.028 0.008
#> SRR2314024     2  0.0000     0.8789 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     2  0.0771     0.8751 0.000 0.976 0.020 0.000 0.004
#> SRR2314025     4  0.1106     0.7077 0.024 0.000 0.000 0.964 0.012
#> SRR2314023     1  0.3906     0.6520 0.744 0.000 0.000 0.240 0.016
#> SRR2314033     2  0.2304     0.8166 0.000 0.892 0.100 0.000 0.008
#> SRR2314045     1  0.3561     0.6627 0.740 0.000 0.000 0.000 0.260
#> SRR2314042     4  0.2439     0.6219 0.000 0.000 0.004 0.876 0.120
#> SRR2314043     3  0.3694     0.5891 0.032 0.000 0.796 0.000 0.172
#> SRR2314041     4  0.7141     0.2535 0.000 0.072 0.312 0.500 0.116
#> SRR2314044     4  0.4454     0.6309 0.008 0.096 0.108 0.784 0.004
#> SRR2314040     3  0.3366     0.4673 0.004 0.000 0.784 0.000 0.212
#> SRR2314039     5  0.6684     0.5061 0.000 0.000 0.276 0.288 0.436
#> SRR2314038     2  0.8162     0.1380 0.012 0.384 0.136 0.120 0.348
#> SRR2314037     4  0.5296     0.0638 0.000 0.000 0.468 0.484 0.048
#> SRR2314036     2  0.0451     0.8772 0.000 0.988 0.004 0.000 0.008
#> SRR2314035     3  0.2471     0.5709 0.000 0.000 0.864 0.000 0.136
#> SRR2314034     5  0.6427     0.5599 0.004 0.000 0.340 0.164 0.492
#> SRR2314032     1  0.2929     0.7245 0.820 0.000 0.000 0.000 0.180
#> SRR2314031     4  0.0703     0.7099 0.024 0.000 0.000 0.976 0.000
#> SRR2314029     2  0.0162     0.8785 0.000 0.996 0.000 0.000 0.004
#> SRR2314030     5  0.4556     0.4099 0.004 0.000 0.024 0.292 0.680
#> SRR2314028     3  0.3351     0.5634 0.004 0.000 0.828 0.148 0.020
#> SRR2314027     5  0.6103     0.6143 0.000 0.000 0.292 0.160 0.548
#> SRR2314026     5  0.4325     0.6440 0.004 0.000 0.300 0.012 0.684
#> SRR2314020     2  0.0162     0.8784 0.000 0.996 0.000 0.000 0.004
#> SRR2314019     5  0.4960     0.6570 0.000 0.000 0.268 0.064 0.668
#> SRR2314021     5  0.4556     0.6496 0.004 0.000 0.292 0.024 0.680
#> SRR2314018     3  0.3689     0.5609 0.000 0.000 0.740 0.004 0.256
#> SRR2314017     5  0.5048     0.1646 0.052 0.000 0.268 0.008 0.672
#> SRR2314016     4  0.5597     0.1226 0.072 0.000 0.000 0.488 0.440
#> SRR2314014     3  0.0404     0.6257 0.000 0.000 0.988 0.000 0.012
#> SRR2314013     2  0.4542     0.0745 0.000 0.536 0.456 0.000 0.008
#> SRR2314012     4  0.1205     0.7107 0.040 0.000 0.000 0.956 0.004
#> SRR2314011     4  0.4538     0.2477 0.364 0.000 0.000 0.620 0.016
#> SRR2314010     2  0.1597     0.8563 0.000 0.948 0.020 0.008 0.024
#> SRR2314009     3  0.3694     0.6069 0.000 0.000 0.796 0.032 0.172
#> SRR2314008     3  0.4686     0.5512 0.004 0.016 0.712 0.020 0.248
#> SRR2314007     5  0.4675     0.6111 0.000 0.004 0.360 0.016 0.620
#> SRR2314005     3  0.4886     0.2712 0.000 0.372 0.596 0.000 0.032
#> SRR2314004     2  0.0992     0.8739 0.000 0.968 0.024 0.000 0.008
#> SRR2314003     4  0.3089     0.7020 0.040 0.000 0.012 0.872 0.076
#> SRR2314006     2  0.0000     0.8789 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     1  0.4074     0.4960 0.636 0.000 0.000 0.000 0.364
#> SRR2314001     3  0.3616     0.4461 0.000 0.004 0.768 0.004 0.224
#> SRR2314000     1  0.1901     0.8052 0.932 0.000 0.040 0.004 0.024
#> SRR2313998     2  0.2723     0.7864 0.000 0.864 0.124 0.000 0.012
#> SRR2313996     3  0.3076     0.6083 0.000 0.028 0.880 0.040 0.052
#> SRR2313999     4  0.7932     0.2055 0.272 0.000 0.084 0.392 0.252
#> SRR2313997     2  0.0451     0.8781 0.000 0.988 0.004 0.000 0.008
#> SRR2313992     4  0.2054     0.6861 0.004 0.000 0.072 0.916 0.008
#> SRR2313991     5  0.5075     0.1446 0.020 0.360 0.016 0.000 0.604
#> SRR2313990     3  0.2629     0.5627 0.000 0.000 0.860 0.004 0.136
#> SRR2313988     1  0.0671     0.8185 0.980 0.000 0.000 0.004 0.016
#> SRR2313987     1  0.4451     0.4979 0.644 0.000 0.000 0.340 0.016
#> SRR2313984     2  0.3551     0.7371 0.000 0.820 0.136 0.000 0.044
#> SRR2313989     2  0.0000     0.8789 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0290     0.8224 0.992 0.000 0.000 0.008 0.000
#> SRR2313986     4  0.1981     0.7091 0.048 0.000 0.000 0.924 0.028
#> SRR2313982     1  0.0912     0.8221 0.972 0.000 0.000 0.016 0.012
#> SRR2313981     3  0.4317     0.4890 0.000 0.000 0.772 0.112 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
#> SRR2313978     6  0.4695    0.64254 0.000 0.040 0.004 0.032 0.220 0.704
#> SRR2313980     6  0.0146    0.92656 0.000 0.000 0.004 0.000 0.000 0.996
#> SRR2313979     1  0.0146    0.79655 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR2313977     5  0.3799    0.55541 0.000 0.276 0.000 0.000 0.704 0.020
#> SRR2313976     2  0.5309    0.13970 0.000 0.492 0.020 0.000 0.056 0.432
#> SRR2313975     1  0.0146    0.79770 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2313973     1  0.3695    0.46773 0.624 0.000 0.000 0.376 0.000 0.000
#> SRR2313974     1  0.2199    0.77735 0.892 0.000 0.000 0.088 0.020 0.000
#> SRR2313985     1  0.1918    0.78037 0.904 0.000 0.000 0.088 0.008 0.000
#> SRR2313993     2  0.5969    0.05183 0.000 0.536 0.304 0.000 0.032 0.128
#> SRR2313994     2  0.3164    0.55274 0.000 0.824 0.140 0.000 0.004 0.032
#> SRR2313995     6  0.0405    0.92561 0.000 0.000 0.000 0.008 0.004 0.988
#> SRR2314024     6  0.0260    0.92605 0.000 0.000 0.008 0.000 0.000 0.992
#> SRR2314015     6  0.1320    0.91156 0.000 0.016 0.000 0.000 0.036 0.948
#> SRR2314025     4  0.1010    0.71162 0.000 0.000 0.036 0.960 0.004 0.000
#> SRR2314023     1  0.4361    0.53314 0.648 0.000 0.000 0.308 0.044 0.000
#> SRR2314033     6  0.3201    0.83262 0.000 0.088 0.036 0.000 0.028 0.848
#> SRR2314045     1  0.4874    0.19283 0.496 0.008 0.456 0.000 0.040 0.000
#> SRR2314042     4  0.3084    0.64738 0.000 0.008 0.136 0.832 0.024 0.000
#> SRR2314043     2  0.3245    0.38100 0.000 0.764 0.008 0.000 0.228 0.000
#> SRR2314041     4  0.8204   -0.00419 0.000 0.324 0.080 0.328 0.120 0.148
#> SRR2314044     4  0.5073    0.54756 0.000 0.156 0.004 0.704 0.036 0.100
#> SRR2314040     2  0.1204    0.61306 0.000 0.944 0.056 0.000 0.000 0.000
#> SRR2314039     3  0.6419    0.38810 0.000 0.340 0.456 0.164 0.040 0.000
#> SRR2314038     5  0.3206    0.50219 0.012 0.000 0.072 0.048 0.856 0.012
#> SRR2314037     2  0.5207    0.22547 0.000 0.572 0.028 0.352 0.048 0.000
#> SRR2314036     6  0.0146    0.92663 0.000 0.000 0.000 0.000 0.004 0.996
#> SRR2314035     2  0.1010    0.61158 0.000 0.960 0.036 0.000 0.004 0.000
#> SRR2314034     2  0.5636   -0.37938 0.016 0.456 0.456 0.056 0.016 0.000
#> SRR2314032     1  0.3284    0.66393 0.800 0.000 0.168 0.000 0.032 0.000
#> SRR2314031     4  0.1320    0.71193 0.000 0.000 0.036 0.948 0.016 0.000
#> SRR2314029     6  0.0551    0.92617 0.000 0.000 0.008 0.004 0.004 0.984
#> SRR2314030     3  0.3210    0.37728 0.000 0.004 0.836 0.088 0.072 0.000
#> SRR2314028     2  0.4142    0.47670 0.000 0.764 0.024 0.160 0.052 0.000
#> SRR2314027     3  0.5485    0.50286 0.000 0.336 0.560 0.080 0.024 0.000
#> SRR2314026     3  0.3266    0.57605 0.000 0.272 0.728 0.000 0.000 0.000
#> SRR2314020     6  0.1092    0.91975 0.000 0.000 0.020 0.000 0.020 0.960
#> SRR2314019     3  0.4011    0.56675 0.000 0.304 0.672 0.024 0.000 0.000
#> SRR2314021     3  0.3464    0.56356 0.000 0.312 0.688 0.000 0.000 0.000
#> SRR2314018     5  0.3851    0.27227 0.000 0.460 0.000 0.000 0.540 0.000
#> SRR2314017     5  0.4407    0.30403 0.004 0.020 0.304 0.012 0.660 0.000
#> SRR2314016     3  0.6032    0.01158 0.016 0.000 0.496 0.172 0.316 0.000
#> SRR2314014     2  0.2527    0.53993 0.000 0.868 0.000 0.000 0.108 0.024
#> SRR2314013     2  0.5169    0.04827 0.000 0.468 0.012 0.000 0.056 0.464
#> SRR2314012     4  0.1382    0.71401 0.008 0.000 0.036 0.948 0.008 0.000
#> SRR2314011     4  0.4313    0.39106 0.284 0.000 0.000 0.668 0.048 0.000
#> SRR2314010     6  0.3617    0.78618 0.000 0.088 0.048 0.004 0.032 0.828
#> SRR2314009     2  0.3000    0.57221 0.000 0.860 0.048 0.016 0.076 0.000
#> SRR2314008     5  0.4460    0.58176 0.008 0.204 0.016 0.036 0.732 0.004
#> SRR2314007     3  0.4254    0.51903 0.000 0.352 0.624 0.004 0.020 0.000
#> SRR2314005     2  0.6014   -0.00657 0.000 0.392 0.000 0.000 0.240 0.368
#> SRR2314004     6  0.0865    0.92073 0.000 0.000 0.000 0.000 0.036 0.964
#> SRR2314003     4  0.2402    0.68295 0.000 0.004 0.000 0.856 0.140 0.000
#> SRR2314006     6  0.0000    0.92634 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314002     3  0.6057   -0.14929 0.188 0.008 0.412 0.000 0.392 0.000
#> SRR2314001     2  0.1714    0.59617 0.000 0.908 0.092 0.000 0.000 0.000
#> SRR2314000     1  0.2361    0.76416 0.896 0.032 0.000 0.008 0.064 0.000
#> SRR2313998     6  0.1606    0.89613 0.000 0.056 0.008 0.000 0.004 0.932
#> SRR2313996     2  0.2340    0.57725 0.000 0.896 0.004 0.000 0.056 0.044
#> SRR2313999     4  0.5713    0.22793 0.140 0.004 0.000 0.436 0.420 0.000
#> SRR2313997     6  0.0717    0.92489 0.000 0.000 0.008 0.000 0.016 0.976
#> SRR2313992     4  0.3352    0.61501 0.000 0.172 0.016 0.800 0.012 0.000
#> SRR2313991     3  0.4632    0.10490 0.000 0.000 0.620 0.004 0.328 0.048
#> SRR2313990     2  0.0865    0.61330 0.000 0.964 0.036 0.000 0.000 0.000
#> SRR2313988     1  0.0291    0.79528 0.992 0.000 0.004 0.000 0.004 0.000
#> SRR2313987     1  0.4756    0.38267 0.564 0.000 0.000 0.380 0.056 0.000
#> SRR2313984     6  0.3798    0.79041 0.000 0.088 0.060 0.000 0.040 0.812
#> SRR2313989     6  0.0000    0.92634 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     1  0.0000    0.79708 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.2445    0.68674 0.008 0.004 0.000 0.868 0.120 0.000
#> SRR2313982     1  0.1168    0.79703 0.956 0.000 0.000 0.016 0.028 0.000
#> SRR2313981     2  0.2583    0.59261 0.000 0.884 0.056 0.052 0.008 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-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

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

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

collect_plots(res)

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.815           0.917       0.955         0.4180 0.593   0.593
#> 3 3 0.709           0.844       0.913         0.5618 0.739   0.560
#> 4 4 0.709           0.775       0.833         0.1072 0.944   0.838
#> 5 5 0.738           0.713       0.841         0.0617 0.944   0.812
#> 6 6 0.726           0.590       0.781         0.0358 0.969   0.876

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
#> SRR2313978     2  0.0376      0.948 0.004 0.996
#> SRR2313980     2  0.0000      0.948 0.000 1.000
#> SRR2313979     1  0.0000      0.965 1.000 0.000
#> SRR2313977     2  0.0000      0.948 0.000 1.000
#> SRR2313976     2  0.0000      0.948 0.000 1.000
#> SRR2313975     1  0.5842      0.851 0.860 0.140
#> SRR2313973     1  0.0000      0.965 1.000 0.000
#> SRR2313974     1  0.4161      0.907 0.916 0.084
#> SRR2313985     1  0.0000      0.965 1.000 0.000
#> SRR2313993     2  0.0000      0.948 0.000 1.000
#> SRR2313994     2  0.0000      0.948 0.000 1.000
#> SRR2313995     2  0.0672      0.948 0.008 0.992
#> SRR2314024     2  0.0000      0.948 0.000 1.000
#> SRR2314015     2  0.0000      0.948 0.000 1.000
#> SRR2314025     1  0.0000      0.965 1.000 0.000
#> SRR2314023     1  0.0000      0.965 1.000 0.000
#> SRR2314033     2  0.0000      0.948 0.000 1.000
#> SRR2314045     1  0.0000      0.965 1.000 0.000
#> SRR2314042     2  0.9580      0.456 0.380 0.620
#> SRR2314043     2  0.2043      0.945 0.032 0.968
#> SRR2314041     2  0.1843      0.946 0.028 0.972
#> SRR2314044     2  0.2043      0.945 0.032 0.968
#> SRR2314040     2  0.2043      0.945 0.032 0.968
#> SRR2314039     2  0.2043      0.945 0.032 0.968
#> SRR2314038     2  0.4161      0.913 0.084 0.916
#> SRR2314037     2  0.4562      0.903 0.096 0.904
#> SRR2314036     2  0.0000      0.948 0.000 1.000
#> SRR2314035     2  0.2236      0.944 0.036 0.964
#> SRR2314034     2  0.7056      0.798 0.192 0.808
#> SRR2314032     1  0.0000      0.965 1.000 0.000
#> SRR2314031     1  0.5842      0.851 0.860 0.140
#> SRR2314029     2  0.0672      0.948 0.008 0.992
#> SRR2314030     2  0.9686      0.412 0.396 0.604
#> SRR2314028     2  0.9580      0.456 0.380 0.620
#> SRR2314027     2  0.2043      0.945 0.032 0.968
#> SRR2314026     2  0.2423      0.942 0.040 0.960
#> SRR2314020     2  0.0000      0.948 0.000 1.000
#> SRR2314019     2  0.5842      0.860 0.140 0.860
#> SRR2314021     2  0.5842      0.860 0.140 0.860
#> SRR2314018     2  0.2043      0.945 0.032 0.968
#> SRR2314017     2  0.2236      0.944 0.036 0.964
#> SRR2314016     1  0.5842      0.851 0.860 0.140
#> SRR2314014     2  0.0000      0.948 0.000 1.000
#> SRR2314013     2  0.0000      0.948 0.000 1.000
#> SRR2314012     1  0.0000      0.965 1.000 0.000
#> SRR2314011     1  0.0000      0.965 1.000 0.000
#> SRR2314010     2  0.0000      0.948 0.000 1.000
#> SRR2314009     2  0.4562      0.903 0.096 0.904
#> SRR2314008     2  0.2043      0.945 0.032 0.968
#> SRR2314007     2  0.2236      0.944 0.036 0.964
#> SRR2314005     2  0.0000      0.948 0.000 1.000
#> SRR2314004     2  0.0000      0.948 0.000 1.000
#> SRR2314003     1  0.0000      0.965 1.000 0.000
#> SRR2314006     2  0.0000      0.948 0.000 1.000
#> SRR2314002     2  0.2423      0.942 0.040 0.960
#> SRR2314001     2  0.0000      0.948 0.000 1.000
#> SRR2314000     2  0.2043      0.945 0.032 0.968
#> SRR2313998     2  0.0000      0.948 0.000 1.000
#> SRR2313996     2  0.0376      0.948 0.004 0.996
#> SRR2313999     1  0.0000      0.965 1.000 0.000
#> SRR2313997     2  0.0000      0.948 0.000 1.000
#> SRR2313992     2  0.4690      0.900 0.100 0.900
#> SRR2313991     2  0.2423      0.942 0.040 0.960
#> SRR2313990     2  0.0672      0.948 0.008 0.992
#> SRR2313988     1  0.0000      0.965 1.000 0.000
#> SRR2313987     1  0.0000      0.965 1.000 0.000
#> SRR2313984     2  0.0000      0.948 0.000 1.000
#> SRR2313989     2  0.0000      0.948 0.000 1.000
#> SRR2313983     1  0.0000      0.965 1.000 0.000
#> SRR2313986     1  0.4690      0.893 0.900 0.100
#> SRR2313982     1  0.0000      0.965 1.000 0.000
#> SRR2313981     2  0.4562      0.903 0.096 0.904

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.6291     0.0619 0.000 0.532 0.468
#> SRR2313980     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2313979     1  0.0000     0.9306 1.000 0.000 0.000
#> SRR2313977     2  0.5016     0.6772 0.000 0.760 0.240
#> SRR2313976     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2313975     1  0.5058     0.7792 0.756 0.000 0.244
#> SRR2313973     1  0.0000     0.9306 1.000 0.000 0.000
#> SRR2313974     1  0.4002     0.8599 0.840 0.000 0.160
#> SRR2313985     1  0.0000     0.9306 1.000 0.000 0.000
#> SRR2313993     2  0.1860     0.8990 0.000 0.948 0.052
#> SRR2313994     2  0.1860     0.8990 0.000 0.948 0.052
#> SRR2313995     3  0.3619     0.8568 0.000 0.136 0.864
#> SRR2314024     2  0.1860     0.8990 0.000 0.948 0.052
#> SRR2314015     2  0.4750     0.7123 0.000 0.784 0.216
#> SRR2314025     1  0.1964     0.9308 0.944 0.000 0.056
#> SRR2314023     1  0.0000     0.9306 1.000 0.000 0.000
#> SRR2314033     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2314045     1  0.1753     0.9327 0.952 0.000 0.048
#> SRR2314042     3  0.5363     0.5457 0.276 0.000 0.724
#> SRR2314043     3  0.2448     0.8925 0.000 0.076 0.924
#> SRR2314041     3  0.3686     0.8584 0.000 0.140 0.860
#> SRR2314044     3  0.2537     0.8920 0.000 0.080 0.920
#> SRR2314040     3  0.3340     0.8750 0.000 0.120 0.880
#> SRR2314039     3  0.2448     0.8925 0.000 0.076 0.924
#> SRR2314038     3  0.0892     0.8803 0.000 0.020 0.980
#> SRR2314037     3  0.0424     0.8753 0.000 0.008 0.992
#> SRR2314036     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2314035     3  0.2878     0.8876 0.000 0.096 0.904
#> SRR2314034     3  0.2711     0.8092 0.088 0.000 0.912
#> SRR2314032     1  0.1753     0.9327 0.952 0.000 0.048
#> SRR2314031     1  0.5058     0.7792 0.756 0.000 0.244
#> SRR2314029     3  0.3619     0.8568 0.000 0.136 0.864
#> SRR2314030     3  0.5497     0.4987 0.292 0.000 0.708
#> SRR2314028     3  0.5363     0.5457 0.276 0.000 0.724
#> SRR2314027     3  0.2448     0.8925 0.000 0.076 0.924
#> SRR2314026     3  0.2261     0.8924 0.000 0.068 0.932
#> SRR2314020     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2314019     3  0.1411     0.8536 0.036 0.000 0.964
#> SRR2314021     3  0.1411     0.8536 0.036 0.000 0.964
#> SRR2314018     3  0.3340     0.8750 0.000 0.120 0.880
#> SRR2314017     3  0.2878     0.8876 0.000 0.096 0.904
#> SRR2314016     1  0.5058     0.7792 0.756 0.000 0.244
#> SRR2314014     2  0.0237     0.9128 0.000 0.996 0.004
#> SRR2314013     2  0.0237     0.9128 0.000 0.996 0.004
#> SRR2314012     1  0.1964     0.9308 0.944 0.000 0.056
#> SRR2314011     1  0.0747     0.9326 0.984 0.000 0.016
#> SRR2314010     2  0.1860     0.8990 0.000 0.948 0.052
#> SRR2314009     3  0.0424     0.8753 0.000 0.008 0.992
#> SRR2314008     3  0.3551     0.8661 0.000 0.132 0.868
#> SRR2314007     3  0.2356     0.8924 0.000 0.072 0.928
#> SRR2314005     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2314004     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2314003     1  0.1753     0.9327 0.952 0.000 0.048
#> SRR2314006     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2314002     3  0.2796     0.8890 0.000 0.092 0.908
#> SRR2314001     2  0.1860     0.8990 0.000 0.948 0.052
#> SRR2314000     3  0.2448     0.8925 0.000 0.076 0.924
#> SRR2313998     2  0.1860     0.8990 0.000 0.948 0.052
#> SRR2313996     2  0.6140     0.3084 0.000 0.596 0.404
#> SRR2313999     1  0.0747     0.9326 0.984 0.000 0.016
#> SRR2313997     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2313992     3  0.0237     0.8729 0.000 0.004 0.996
#> SRR2313991     3  0.2796     0.8890 0.000 0.092 0.908
#> SRR2313990     3  0.6252     0.2395 0.000 0.444 0.556
#> SRR2313988     1  0.1753     0.9327 0.952 0.000 0.048
#> SRR2313987     1  0.0000     0.9306 1.000 0.000 0.000
#> SRR2313984     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2313989     2  0.0000     0.9137 0.000 1.000 0.000
#> SRR2313983     1  0.0000     0.9306 1.000 0.000 0.000
#> SRR2313986     1  0.4346     0.8389 0.816 0.000 0.184
#> SRR2313982     1  0.0000     0.9306 1.000 0.000 0.000
#> SRR2313981     3  0.0424     0.8753 0.000 0.008 0.992

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     3  0.6586    -0.0199 0.080 0.420 0.500 0.000
#> SRR2313980     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2313979     1  0.4898     1.0000 0.584 0.000 0.000 0.416
#> SRR2313977     2  0.5962     0.6436 0.080 0.660 0.260 0.000
#> SRR2313976     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2313975     4  0.4182     0.7376 0.180 0.000 0.024 0.796
#> SRR2313973     1  0.4898     1.0000 0.584 0.000 0.000 0.416
#> SRR2313974     4  0.3160     0.7951 0.108 0.000 0.020 0.872
#> SRR2313985     1  0.4898     1.0000 0.584 0.000 0.000 0.416
#> SRR2313993     2  0.3080     0.8810 0.024 0.880 0.096 0.000
#> SRR2313994     2  0.3080     0.8810 0.024 0.880 0.096 0.000
#> SRR2313995     3  0.3497     0.7911 0.104 0.036 0.860 0.000
#> SRR2314024     2  0.1970     0.8938 0.008 0.932 0.060 0.000
#> SRR2314015     2  0.5790     0.6823 0.080 0.684 0.236 0.000
#> SRR2314025     4  0.1209     0.8156 0.032 0.000 0.004 0.964
#> SRR2314023     1  0.4898     1.0000 0.584 0.000 0.000 0.416
#> SRR2314033     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2314045     4  0.0188     0.8232 0.000 0.000 0.004 0.996
#> SRR2314042     3  0.7889     0.2152 0.304 0.000 0.380 0.316
#> SRR2314043     3  0.0000     0.8078 0.000 0.000 1.000 0.000
#> SRR2314041     3  0.2739     0.7838 0.060 0.036 0.904 0.000
#> SRR2314044     3  0.0469     0.8067 0.012 0.000 0.988 0.000
#> SRR2314040     3  0.2142     0.7924 0.056 0.016 0.928 0.000
#> SRR2314039     3  0.0000     0.8078 0.000 0.000 1.000 0.000
#> SRR2314038     3  0.4175     0.7594 0.200 0.000 0.784 0.016
#> SRR2314037     3  0.2845     0.7939 0.076 0.000 0.896 0.028
#> SRR2314036     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2314035     3  0.1716     0.7983 0.064 0.000 0.936 0.000
#> SRR2314034     3  0.6708     0.6116 0.272 0.000 0.596 0.132
#> SRR2314032     4  0.0188     0.8232 0.000 0.000 0.004 0.996
#> SRR2314031     4  0.4182     0.7376 0.180 0.000 0.024 0.796
#> SRR2314029     3  0.4050     0.7815 0.144 0.036 0.820 0.000
#> SRR2314030     3  0.7925     0.1172 0.332 0.000 0.336 0.332
#> SRR2314028     3  0.7889     0.2152 0.304 0.000 0.380 0.316
#> SRR2314027     3  0.0000     0.8078 0.000 0.000 1.000 0.000
#> SRR2314026     3  0.3355     0.7786 0.160 0.000 0.836 0.004
#> SRR2314020     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2314019     3  0.6136     0.6591 0.288 0.000 0.632 0.080
#> SRR2314021     3  0.6136     0.6591 0.288 0.000 0.632 0.080
#> SRR2314018     3  0.2142     0.7924 0.056 0.016 0.928 0.000
#> SRR2314017     3  0.1716     0.7983 0.064 0.000 0.936 0.000
#> SRR2314016     4  0.4182     0.7376 0.180 0.000 0.024 0.796
#> SRR2314014     2  0.1406     0.9006 0.016 0.960 0.024 0.000
#> SRR2314013     2  0.2197     0.8949 0.024 0.928 0.048 0.000
#> SRR2314012     4  0.1209     0.8156 0.032 0.000 0.004 0.964
#> SRR2314011     4  0.2469     0.6661 0.108 0.000 0.000 0.892
#> SRR2314010     2  0.3080     0.8810 0.024 0.880 0.096 0.000
#> SRR2314009     3  0.2845     0.7939 0.076 0.000 0.896 0.028
#> SRR2314008     3  0.2565     0.7872 0.056 0.032 0.912 0.000
#> SRR2314007     3  0.2868     0.7884 0.136 0.000 0.864 0.000
#> SRR2314005     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2314004     2  0.0188     0.9009 0.000 0.996 0.004 0.000
#> SRR2314003     4  0.0895     0.8115 0.020 0.000 0.004 0.976
#> SRR2314006     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2314002     3  0.3494     0.7966 0.172 0.000 0.824 0.004
#> SRR2314001     2  0.3080     0.8810 0.024 0.880 0.096 0.000
#> SRR2314000     3  0.0000     0.8078 0.000 0.000 1.000 0.000
#> SRR2313998     2  0.3080     0.8810 0.024 0.880 0.096 0.000
#> SRR2313996     2  0.6599     0.2365 0.080 0.488 0.432 0.000
#> SRR2313999     4  0.2469     0.6661 0.108 0.000 0.000 0.892
#> SRR2313997     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2313992     3  0.3694     0.7725 0.124 0.000 0.844 0.032
#> SRR2313991     3  0.3494     0.7966 0.172 0.000 0.824 0.004
#> SRR2313990     3  0.6334     0.2999 0.080 0.328 0.592 0.000
#> SRR2313988     4  0.0188     0.8232 0.000 0.000 0.004 0.996
#> SRR2313987     1  0.4898     1.0000 0.584 0.000 0.000 0.416
#> SRR2313984     2  0.1510     0.9001 0.016 0.956 0.028 0.000
#> SRR2313989     2  0.0188     0.9004 0.004 0.996 0.000 0.000
#> SRR2313983     1  0.4898     1.0000 0.584 0.000 0.000 0.416
#> SRR2313986     4  0.3552     0.7826 0.128 0.000 0.024 0.848
#> SRR2313982     1  0.4898     1.0000 0.584 0.000 0.000 0.416
#> SRR2313981     3  0.2845     0.7939 0.076 0.000 0.896 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
#> SRR2313978     3  0.6341    -0.0583 0.012 0.388 0.496 0.004 0.100
#> SRR2313980     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2313979     1  0.0404     1.0000 0.988 0.000 0.000 0.012 0.000
#> SRR2313977     2  0.5880     0.6279 0.012 0.628 0.256 0.004 0.100
#> SRR2313976     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2313975     4  0.3730     0.6840 0.000 0.000 0.000 0.712 0.288
#> SRR2313973     1  0.0404     1.0000 0.988 0.000 0.000 0.012 0.000
#> SRR2313974     4  0.2351     0.8322 0.016 0.000 0.000 0.896 0.088
#> SRR2313985     1  0.0404     1.0000 0.988 0.000 0.000 0.012 0.000
#> SRR2313993     2  0.3606     0.8610 0.012 0.848 0.072 0.004 0.064
#> SRR2313994     2  0.3606     0.8610 0.012 0.848 0.072 0.004 0.064
#> SRR2313995     3  0.4985     0.3507 0.012 0.016 0.580 0.000 0.392
#> SRR2314024     2  0.1862     0.8797 0.004 0.932 0.048 0.000 0.016
#> SRR2314015     2  0.5641     0.6599 0.012 0.652 0.248 0.004 0.084
#> SRR2314025     4  0.1410     0.8645 0.060 0.000 0.000 0.940 0.000
#> SRR2314023     1  0.0404     1.0000 0.988 0.000 0.000 0.012 0.000
#> SRR2314033     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2314045     4  0.1800     0.8661 0.048 0.000 0.000 0.932 0.020
#> SRR2314042     5  0.5169     0.6921 0.000 0.000 0.128 0.184 0.688
#> SRR2314043     3  0.1341     0.6876 0.000 0.000 0.944 0.000 0.056
#> SRR2314041     3  0.2424     0.6579 0.004 0.024 0.908 0.004 0.060
#> SRR2314044     3  0.1270     0.6910 0.000 0.000 0.948 0.000 0.052
#> SRR2314040     3  0.0912     0.6837 0.000 0.012 0.972 0.000 0.016
#> SRR2314039     3  0.3003     0.6078 0.000 0.000 0.812 0.000 0.188
#> SRR2314038     3  0.4305     0.0194 0.000 0.000 0.512 0.000 0.488
#> SRR2314037     3  0.3163     0.6229 0.000 0.000 0.824 0.012 0.164
#> SRR2314036     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2314035     3  0.0290     0.6864 0.000 0.000 0.992 0.000 0.008
#> SRR2314034     5  0.5484     0.5974 0.000 0.000 0.336 0.080 0.584
#> SRR2314032     4  0.1800     0.8661 0.048 0.000 0.000 0.932 0.020
#> SRR2314031     4  0.4150     0.5816 0.000 0.000 0.000 0.612 0.388
#> SRR2314029     3  0.5061     0.2349 0.012 0.016 0.540 0.000 0.432
#> SRR2314030     5  0.2677     0.5646 0.000 0.000 0.016 0.112 0.872
#> SRR2314028     5  0.5169     0.6921 0.000 0.000 0.128 0.184 0.688
#> SRR2314027     3  0.2929     0.6147 0.000 0.000 0.820 0.000 0.180
#> SRR2314026     3  0.4249     0.0917 0.000 0.000 0.568 0.000 0.432
#> SRR2314020     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2314019     5  0.4570     0.5605 0.000 0.000 0.348 0.020 0.632
#> SRR2314021     5  0.4570     0.5605 0.000 0.000 0.348 0.020 0.632
#> SRR2314018     3  0.0693     0.6851 0.000 0.012 0.980 0.000 0.008
#> SRR2314017     3  0.0510     0.6867 0.000 0.000 0.984 0.000 0.016
#> SRR2314016     4  0.3837     0.6750 0.000 0.000 0.000 0.692 0.308
#> SRR2314014     2  0.1805     0.8816 0.008 0.936 0.004 0.004 0.048
#> SRR2314013     2  0.2728     0.8740 0.012 0.896 0.024 0.004 0.064
#> SRR2314012     4  0.1410     0.8645 0.060 0.000 0.000 0.940 0.000
#> SRR2314011     4  0.2690     0.8103 0.156 0.000 0.000 0.844 0.000
#> SRR2314010     2  0.3606     0.8610 0.012 0.848 0.072 0.004 0.064
#> SRR2314009     3  0.3163     0.6229 0.000 0.000 0.824 0.012 0.164
#> SRR2314008     3  0.1710     0.6719 0.000 0.016 0.940 0.004 0.040
#> SRR2314007     3  0.4150     0.2350 0.000 0.000 0.612 0.000 0.388
#> SRR2314005     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2314004     2  0.0000     0.8842 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     4  0.1478     0.8630 0.064 0.000 0.000 0.936 0.000
#> SRR2314006     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2314002     3  0.2813     0.5981 0.000 0.000 0.832 0.000 0.168
#> SRR2314001     2  0.3606     0.8610 0.012 0.848 0.072 0.004 0.064
#> SRR2314000     3  0.1341     0.6876 0.000 0.000 0.944 0.000 0.056
#> SRR2313998     2  0.3606     0.8610 0.012 0.848 0.072 0.004 0.064
#> SRR2313996     2  0.6415     0.2003 0.012 0.456 0.424 0.004 0.104
#> SRR2313999     4  0.2690     0.8103 0.156 0.000 0.000 0.844 0.000
#> SRR2313997     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2313992     3  0.3628     0.5492 0.000 0.000 0.772 0.012 0.216
#> SRR2313991     3  0.2813     0.5977 0.000 0.000 0.832 0.000 0.168
#> SRR2313990     3  0.5841     0.2773 0.012 0.296 0.608 0.004 0.080
#> SRR2313988     4  0.1800     0.8661 0.048 0.000 0.000 0.932 0.020
#> SRR2313987     1  0.0404     1.0000 0.988 0.000 0.000 0.012 0.000
#> SRR2313984     2  0.1836     0.8826 0.008 0.936 0.016 0.000 0.040
#> SRR2313989     2  0.0566     0.8837 0.000 0.984 0.000 0.004 0.012
#> SRR2313983     1  0.0404     1.0000 0.988 0.000 0.000 0.012 0.000
#> SRR2313986     4  0.2522     0.8194 0.012 0.000 0.000 0.880 0.108
#> SRR2313982     1  0.0404     1.0000 0.988 0.000 0.000 0.012 0.000
#> SRR2313981     3  0.3163     0.6229 0.000 0.000 0.824 0.012 0.164

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR2313978     6  0.5928    -0.1870 0.000 0.180 0.400 0.000 0.004 0.416
#> SRR2313980     2  0.0000     0.7712 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313979     1  0.0000     1.0000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313977     2  0.5830     0.3374 0.000 0.420 0.160 0.000 0.004 0.416
#> SRR2313976     2  0.0363     0.7691 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR2313975     6  0.5667    -0.4647 0.000 0.000 0.000 0.168 0.340 0.492
#> SRR2313973     1  0.0000     1.0000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313974     4  0.3290     0.6746 0.004 0.000 0.000 0.820 0.132 0.044
#> SRR2313985     1  0.0000     1.0000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313993     2  0.3898     0.7180 0.000 0.652 0.012 0.000 0.000 0.336
#> SRR2313994     2  0.3898     0.7180 0.000 0.652 0.012 0.000 0.000 0.336
#> SRR2313995     3  0.5758     0.2188 0.000 0.000 0.492 0.000 0.312 0.196
#> SRR2314024     2  0.2762     0.7694 0.000 0.804 0.000 0.000 0.000 0.196
#> SRR2314015     2  0.5716     0.3863 0.000 0.444 0.164 0.000 0.000 0.392
#> SRR2314025     4  0.0692     0.7146 0.020 0.000 0.000 0.976 0.000 0.004
#> SRR2314023     1  0.0000     1.0000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2314033     2  0.0363     0.7691 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR2314045     4  0.4378     0.4392 0.004 0.000 0.000 0.528 0.016 0.452
#> SRR2314042     5  0.4294     0.6515 0.000 0.000 0.128 0.092 0.760 0.020
#> SRR2314043     3  0.1349     0.6525 0.000 0.000 0.940 0.000 0.056 0.004
#> SRR2314041     3  0.2955     0.5908 0.000 0.004 0.816 0.000 0.008 0.172
#> SRR2314044     3  0.1367     0.6567 0.000 0.000 0.944 0.000 0.044 0.012
#> SRR2314040     3  0.1327     0.6471 0.000 0.000 0.936 0.000 0.000 0.064
#> SRR2314039     3  0.3892     0.5393 0.000 0.000 0.752 0.000 0.188 0.060
#> SRR2314038     3  0.4702     0.0056 0.000 0.000 0.496 0.000 0.460 0.044
#> SRR2314037     3  0.2562     0.5899 0.000 0.000 0.828 0.000 0.172 0.000
#> SRR2314036     2  0.0000     0.7712 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314035     3  0.0405     0.6506 0.000 0.000 0.988 0.000 0.004 0.008
#> SRR2314034     5  0.4511     0.5708 0.000 0.000 0.332 0.048 0.620 0.000
#> SRR2314032     4  0.4378     0.4392 0.004 0.000 0.000 0.528 0.016 0.452
#> SRR2314031     4  0.5061     0.4228 0.000 0.000 0.000 0.496 0.428 0.076
#> SRR2314029     3  0.5616     0.1696 0.000 0.000 0.492 0.000 0.352 0.156
#> SRR2314030     5  0.2060     0.4450 0.000 0.000 0.000 0.016 0.900 0.084
#> SRR2314028     5  0.4294     0.6515 0.000 0.000 0.128 0.092 0.760 0.020
#> SRR2314027     3  0.3796     0.5520 0.000 0.000 0.764 0.000 0.176 0.060
#> SRR2314026     3  0.4136     0.0702 0.000 0.000 0.560 0.000 0.428 0.012
#> SRR2314020     2  0.0000     0.7712 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314019     5  0.3728     0.5441 0.000 0.000 0.344 0.000 0.652 0.004
#> SRR2314021     5  0.3728     0.5441 0.000 0.000 0.344 0.000 0.652 0.004
#> SRR2314018     3  0.1204     0.6488 0.000 0.000 0.944 0.000 0.000 0.056
#> SRR2314017     3  0.0622     0.6502 0.000 0.000 0.980 0.000 0.012 0.008
#> SRR2314016     4  0.4868     0.5280 0.000 0.000 0.000 0.592 0.332 0.076
#> SRR2314014     2  0.3175     0.7591 0.000 0.744 0.000 0.000 0.000 0.256
#> SRR2314013     2  0.3710     0.7397 0.000 0.696 0.012 0.000 0.000 0.292
#> SRR2314012     4  0.0692     0.7146 0.020 0.000 0.000 0.976 0.000 0.004
#> SRR2314011     4  0.2003     0.6940 0.116 0.000 0.000 0.884 0.000 0.000
#> SRR2314010     2  0.3898     0.7180 0.000 0.652 0.012 0.000 0.000 0.336
#> SRR2314009     3  0.2562     0.5899 0.000 0.000 0.828 0.000 0.172 0.000
#> SRR2314008     3  0.2006     0.6300 0.000 0.000 0.892 0.000 0.004 0.104
#> SRR2314007     3  0.4273     0.2046 0.000 0.000 0.596 0.000 0.380 0.024
#> SRR2314005     2  0.0363     0.7691 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR2314004     2  0.2135     0.7770 0.000 0.872 0.000 0.000 0.000 0.128
#> SRR2314003     4  0.0547     0.7132 0.020 0.000 0.000 0.980 0.000 0.000
#> SRR2314006     2  0.0000     0.7712 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314002     3  0.2743     0.5671 0.000 0.000 0.828 0.000 0.164 0.008
#> SRR2314001     2  0.3898     0.7180 0.000 0.652 0.012 0.000 0.000 0.336
#> SRR2314000     3  0.1349     0.6525 0.000 0.000 0.940 0.000 0.056 0.004
#> SRR2313998     2  0.3898     0.7180 0.000 0.652 0.012 0.000 0.000 0.336
#> SRR2313996     3  0.6342    -0.3347 0.000 0.324 0.336 0.000 0.008 0.332
#> SRR2313999     4  0.2003     0.6940 0.116 0.000 0.000 0.884 0.000 0.000
#> SRR2313997     2  0.0000     0.7712 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313992     3  0.2969     0.5169 0.000 0.000 0.776 0.000 0.224 0.000
#> SRR2313991     3  0.2841     0.5646 0.000 0.000 0.824 0.000 0.164 0.012
#> SRR2313990     3  0.5057    -0.0627 0.000 0.088 0.560 0.000 0.000 0.352
#> SRR2313988     4  0.4378     0.4392 0.004 0.000 0.000 0.528 0.016 0.452
#> SRR2313987     1  0.0000     1.0000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313984     2  0.3081     0.7675 0.000 0.776 0.004 0.000 0.000 0.220
#> SRR2313989     2  0.0000     0.7712 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313983     1  0.0000     1.0000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.3048     0.6628 0.004 0.000 0.000 0.824 0.152 0.020
#> SRR2313982     1  0.0000     1.0000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313981     3  0.2562     0.5899 0.000 0.000 0.828 0.000 0.172 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

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

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

collect_plots(res)

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 1.000           0.992       0.997         0.4741 0.525   0.525
#> 3 3 1.000           0.946       0.979         0.4039 0.682   0.462
#> 4 4 0.766           0.810       0.854         0.1065 0.894   0.700
#> 5 5 0.746           0.677       0.790         0.0690 0.908   0.669
#> 6 6 0.724           0.616       0.742         0.0423 0.918   0.657

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

suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>            class entropy silhouette    p1    p2
#> SRR2313978     2   0.000      1.000 0.000 1.000
#> SRR2313980     2   0.000      1.000 0.000 1.000
#> SRR2313979     1   0.000      0.991 1.000 0.000
#> SRR2313977     2   0.000      1.000 0.000 1.000
#> SRR2313976     2   0.000      1.000 0.000 1.000
#> SRR2313975     1   0.000      0.991 1.000 0.000
#> SRR2313973     1   0.000      0.991 1.000 0.000
#> SRR2313974     1   0.000      0.991 1.000 0.000
#> SRR2313985     1   0.000      0.991 1.000 0.000
#> SRR2313993     2   0.000      1.000 0.000 1.000
#> SRR2313994     2   0.000      1.000 0.000 1.000
#> SRR2313995     2   0.000      1.000 0.000 1.000
#> SRR2314024     2   0.000      1.000 0.000 1.000
#> SRR2314015     2   0.000      1.000 0.000 1.000
#> SRR2314025     1   0.000      0.991 1.000 0.000
#> SRR2314023     1   0.000      0.991 1.000 0.000
#> SRR2314033     2   0.000      1.000 0.000 1.000
#> SRR2314045     1   0.000      0.991 1.000 0.000
#> SRR2314042     1   0.000      0.991 1.000 0.000
#> SRR2314043     2   0.000      1.000 0.000 1.000
#> SRR2314041     2   0.000      1.000 0.000 1.000
#> SRR2314044     2   0.000      1.000 0.000 1.000
#> SRR2314040     2   0.000      1.000 0.000 1.000
#> SRR2314039     2   0.000      1.000 0.000 1.000
#> SRR2314038     2   0.000      1.000 0.000 1.000
#> SRR2314037     2   0.000      1.000 0.000 1.000
#> SRR2314036     2   0.000      1.000 0.000 1.000
#> SRR2314035     2   0.000      1.000 0.000 1.000
#> SRR2314034     1   0.000      0.991 1.000 0.000
#> SRR2314032     1   0.000      0.991 1.000 0.000
#> SRR2314031     1   0.000      0.991 1.000 0.000
#> SRR2314029     2   0.000      1.000 0.000 1.000
#> SRR2314030     1   0.000      0.991 1.000 0.000
#> SRR2314028     1   0.000      0.991 1.000 0.000
#> SRR2314027     2   0.000      1.000 0.000 1.000
#> SRR2314026     2   0.000      1.000 0.000 1.000
#> SRR2314020     2   0.000      1.000 0.000 1.000
#> SRR2314019     2   0.000      1.000 0.000 1.000
#> SRR2314021     1   0.000      0.991 1.000 0.000
#> SRR2314018     2   0.000      1.000 0.000 1.000
#> SRR2314017     2   0.000      1.000 0.000 1.000
#> SRR2314016     1   0.000      0.991 1.000 0.000
#> SRR2314014     2   0.000      1.000 0.000 1.000
#> SRR2314013     2   0.000      1.000 0.000 1.000
#> SRR2314012     1   0.000      0.991 1.000 0.000
#> SRR2314011     1   0.000      0.991 1.000 0.000
#> SRR2314010     2   0.000      1.000 0.000 1.000
#> SRR2314009     2   0.000      1.000 0.000 1.000
#> SRR2314008     2   0.000      1.000 0.000 1.000
#> SRR2314007     2   0.000      1.000 0.000 1.000
#> SRR2314005     2   0.000      1.000 0.000 1.000
#> SRR2314004     2   0.000      1.000 0.000 1.000
#> SRR2314003     1   0.000      0.991 1.000 0.000
#> SRR2314006     2   0.000      1.000 0.000 1.000
#> SRR2314002     2   0.000      1.000 0.000 1.000
#> SRR2314001     2   0.000      1.000 0.000 1.000
#> SRR2314000     2   0.000      1.000 0.000 1.000
#> SRR2313998     2   0.000      1.000 0.000 1.000
#> SRR2313996     2   0.000      1.000 0.000 1.000
#> SRR2313999     1   0.000      0.991 1.000 0.000
#> SRR2313997     2   0.000      1.000 0.000 1.000
#> SRR2313992     1   0.000      0.991 1.000 0.000
#> SRR2313991     2   0.000      1.000 0.000 1.000
#> SRR2313990     2   0.000      1.000 0.000 1.000
#> SRR2313988     1   0.000      0.991 1.000 0.000
#> SRR2313987     1   0.000      0.991 1.000 0.000
#> SRR2313984     2   0.000      1.000 0.000 1.000
#> SRR2313989     2   0.000      1.000 0.000 1.000
#> SRR2313983     1   0.000      0.991 1.000 0.000
#> SRR2313986     1   0.000      0.991 1.000 0.000
#> SRR2313982     1   0.000      0.991 1.000 0.000
#> SRR2313981     1   0.802      0.677 0.756 0.244

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     3  0.6095      0.394 0.000 0.392 0.608
#> SRR2313980     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313977     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313976     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313975     1  0.1031      0.977 0.976 0.000 0.024
#> SRR2313973     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313974     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313985     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313993     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313994     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313995     3  0.6280      0.213 0.000 0.460 0.540
#> SRR2314024     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314015     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314025     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2314023     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2314033     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314045     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2314042     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314043     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314041     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314044     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314040     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314039     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314038     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314037     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314036     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314035     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314034     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314032     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2314031     1  0.0892      0.981 0.980 0.000 0.020
#> SRR2314029     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314030     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314028     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314027     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314026     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314020     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314019     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314021     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314018     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314017     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314016     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2314014     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314013     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314012     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2314011     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2314010     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314009     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314008     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314007     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314005     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314004     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314003     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2314006     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314002     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2314001     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2314000     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2313998     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313996     3  0.2959      0.858 0.000 0.100 0.900
#> SRR2313999     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313997     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313992     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2313991     3  0.0000      0.951 0.000 0.000 1.000
#> SRR2313990     3  0.6307      0.122 0.000 0.488 0.512
#> SRR2313988     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313987     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313984     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313989     2  0.0000      1.000 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313986     1  0.0892      0.981 0.980 0.000 0.020
#> SRR2313982     1  0.0000      0.996 1.000 0.000 0.000
#> SRR2313981     3  0.0000      0.951 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
#> SRR2313978     3  0.4630      0.683 0.000 0.252 0.732 0.016
#> SRR2313980     2  0.3219      0.890 0.000 0.836 0.000 0.164
#> SRR2313979     1  0.0000      0.853 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.1406      0.868 0.000 0.960 0.024 0.016
#> SRR2313976     2  0.4072      0.871 0.000 0.748 0.000 0.252
#> SRR2313975     4  0.4193      0.609 0.268 0.000 0.000 0.732
#> SRR2313973     1  0.0188      0.852 0.996 0.000 0.000 0.004
#> SRR2313974     4  0.4776      0.398 0.376 0.000 0.000 0.624
#> SRR2313985     1  0.0000      0.853 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.0000      0.881 0.000 1.000 0.000 0.000
#> SRR2313994     2  0.2843      0.870 0.000 0.892 0.020 0.088
#> SRR2313995     3  0.4744      0.653 0.000 0.284 0.704 0.012
#> SRR2314024     2  0.3219      0.890 0.000 0.836 0.000 0.164
#> SRR2314015     2  0.1610      0.864 0.000 0.952 0.032 0.016
#> SRR2314025     1  0.4522      0.582 0.680 0.000 0.000 0.320
#> SRR2314023     1  0.0188      0.852 0.996 0.000 0.000 0.004
#> SRR2314033     2  0.4072      0.871 0.000 0.748 0.000 0.252
#> SRR2314045     4  0.4585      0.499 0.332 0.000 0.000 0.668
#> SRR2314042     4  0.4193      0.719 0.000 0.000 0.268 0.732
#> SRR2314043     3  0.0817      0.911 0.000 0.000 0.976 0.024
#> SRR2314041     3  0.3672      0.768 0.000 0.164 0.824 0.012
#> SRR2314044     3  0.0188      0.907 0.000 0.000 0.996 0.004
#> SRR2314040     3  0.0524      0.906 0.000 0.008 0.988 0.004
#> SRR2314039     3  0.0817      0.911 0.000 0.000 0.976 0.024
#> SRR2314038     3  0.1637      0.885 0.000 0.000 0.940 0.060
#> SRR2314037     3  0.0817      0.911 0.000 0.000 0.976 0.024
#> SRR2314036     2  0.4040      0.871 0.000 0.752 0.000 0.248
#> SRR2314035     3  0.0188      0.909 0.000 0.000 0.996 0.004
#> SRR2314034     4  0.4193      0.719 0.000 0.000 0.268 0.732
#> SRR2314032     1  0.4040      0.683 0.752 0.000 0.000 0.248
#> SRR2314031     4  0.4193      0.606 0.268 0.000 0.000 0.732
#> SRR2314029     3  0.1867      0.885 0.000 0.000 0.928 0.072
#> SRR2314030     4  0.4193      0.719 0.000 0.000 0.268 0.732
#> SRR2314028     4  0.4193      0.719 0.000 0.000 0.268 0.732
#> SRR2314027     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> SRR2314026     3  0.0817      0.911 0.000 0.000 0.976 0.024
#> SRR2314020     2  0.3219      0.890 0.000 0.836 0.000 0.164
#> SRR2314019     3  0.2589      0.828 0.000 0.000 0.884 0.116
#> SRR2314021     4  0.4193      0.719 0.000 0.000 0.268 0.732
#> SRR2314018     3  0.0188      0.909 0.000 0.000 0.996 0.004
#> SRR2314017     3  0.0817      0.911 0.000 0.000 0.976 0.024
#> SRR2314016     4  0.4193      0.606 0.268 0.000 0.000 0.732
#> SRR2314014     2  0.2843      0.870 0.000 0.892 0.020 0.088
#> SRR2314013     2  0.2843      0.870 0.000 0.892 0.020 0.088
#> SRR2314012     1  0.4522      0.582 0.680 0.000 0.000 0.320
#> SRR2314011     1  0.1389      0.842 0.952 0.000 0.000 0.048
#> SRR2314010     2  0.1284      0.869 0.000 0.964 0.024 0.012
#> SRR2314009     3  0.0817      0.911 0.000 0.000 0.976 0.024
#> SRR2314008     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> SRR2314007     3  0.1022      0.909 0.000 0.000 0.968 0.032
#> SRR2314005     2  0.4072      0.871 0.000 0.748 0.000 0.252
#> SRR2314004     2  0.3219      0.890 0.000 0.836 0.000 0.164
#> SRR2314003     1  0.4164      0.672 0.736 0.000 0.000 0.264
#> SRR2314006     2  0.3219      0.890 0.000 0.836 0.000 0.164
#> SRR2314002     3  0.0817      0.911 0.000 0.000 0.976 0.024
#> SRR2314001     2  0.1406      0.868 0.000 0.960 0.024 0.016
#> SRR2314000     3  0.0817      0.911 0.000 0.000 0.976 0.024
#> SRR2313998     2  0.1042      0.875 0.000 0.972 0.020 0.008
#> SRR2313996     3  0.4485      0.691 0.000 0.248 0.740 0.012
#> SRR2313999     1  0.1389      0.842 0.952 0.000 0.000 0.048
#> SRR2313997     2  0.3219      0.890 0.000 0.836 0.000 0.164
#> SRR2313992     4  0.4790      0.568 0.000 0.000 0.380 0.620
#> SRR2313991     3  0.0707      0.911 0.000 0.000 0.980 0.020
#> SRR2313990     3  0.4630      0.683 0.000 0.252 0.732 0.016
#> SRR2313988     1  0.4008      0.688 0.756 0.000 0.000 0.244
#> SRR2313987     1  0.0000      0.853 1.000 0.000 0.000 0.000
#> SRR2313984     2  0.0657      0.876 0.000 0.984 0.004 0.012
#> SRR2313989     2  0.4040      0.871 0.000 0.752 0.000 0.248
#> SRR2313983     1  0.0000      0.853 1.000 0.000 0.000 0.000
#> SRR2313986     4  0.4193      0.606 0.268 0.000 0.000 0.732
#> SRR2313982     1  0.0000      0.853 1.000 0.000 0.000 0.000
#> SRR2313981     3  0.0817      0.911 0.000 0.000 0.976 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
#> SRR2313978     5  0.4403     0.1067 0.000 0.004 0.436 0.000 0.560
#> SRR2313980     2  0.4304     0.9021 0.000 0.516 0.000 0.000 0.484
#> SRR2313979     1  0.0000     0.7858 1.000 0.000 0.000 0.000 0.000
#> SRR2313977     5  0.0609     0.4657 0.000 0.000 0.020 0.000 0.980
#> SRR2313976     2  0.4161     0.8730 0.000 0.608 0.000 0.000 0.392
#> SRR2313975     4  0.2886     0.7926 0.000 0.148 0.008 0.844 0.000
#> SRR2313973     1  0.0290     0.7860 0.992 0.008 0.000 0.000 0.000
#> SRR2313974     4  0.5572     0.5184 0.124 0.248 0.000 0.628 0.000
#> SRR2313985     1  0.1043     0.7891 0.960 0.040 0.000 0.000 0.000
#> SRR2313993     5  0.2929     0.1628 0.000 0.180 0.000 0.000 0.820
#> SRR2313994     5  0.3534     0.1292 0.000 0.256 0.000 0.000 0.744
#> SRR2313995     5  0.4339     0.3205 0.000 0.012 0.336 0.000 0.652
#> SRR2314024     2  0.4304     0.9021 0.000 0.516 0.000 0.000 0.484
#> SRR2314015     5  0.1478     0.4736 0.000 0.000 0.064 0.000 0.936
#> SRR2314025     1  0.6339     0.5406 0.508 0.188 0.000 0.304 0.000
#> SRR2314023     1  0.0290     0.7860 0.992 0.008 0.000 0.000 0.000
#> SRR2314033     2  0.4161     0.8730 0.000 0.608 0.000 0.000 0.392
#> SRR2314045     4  0.5283     0.6140 0.084 0.232 0.008 0.676 0.000
#> SRR2314042     4  0.0290     0.8327 0.000 0.000 0.008 0.992 0.000
#> SRR2314043     3  0.0404     0.8886 0.000 0.000 0.988 0.012 0.000
#> SRR2314041     3  0.4383     0.2373 0.000 0.004 0.572 0.000 0.424
#> SRR2314044     3  0.1608     0.8572 0.000 0.000 0.928 0.000 0.072
#> SRR2314040     3  0.0290     0.8864 0.000 0.000 0.992 0.000 0.008
#> SRR2314039     3  0.0162     0.8884 0.000 0.004 0.996 0.000 0.000
#> SRR2314038     3  0.5117     0.7567 0.000 0.052 0.748 0.128 0.072
#> SRR2314037     3  0.0955     0.8853 0.000 0.004 0.968 0.028 0.000
#> SRR2314036     2  0.4114     0.8797 0.000 0.624 0.000 0.000 0.376
#> SRR2314035     3  0.0992     0.8844 0.000 0.024 0.968 0.000 0.008
#> SRR2314034     4  0.0579     0.8318 0.000 0.008 0.008 0.984 0.000
#> SRR2314032     1  0.6329     0.5459 0.528 0.232 0.000 0.240 0.000
#> SRR2314031     4  0.1851     0.8151 0.000 0.088 0.000 0.912 0.000
#> SRR2314029     3  0.5906     0.6676 0.000 0.048 0.676 0.108 0.168
#> SRR2314030     4  0.1331     0.8199 0.000 0.040 0.008 0.952 0.000
#> SRR2314028     4  0.0290     0.8327 0.000 0.000 0.008 0.992 0.000
#> SRR2314027     3  0.0865     0.8829 0.000 0.004 0.972 0.000 0.024
#> SRR2314026     3  0.2592     0.8624 0.000 0.052 0.892 0.056 0.000
#> SRR2314020     2  0.4304     0.9021 0.000 0.516 0.000 0.000 0.484
#> SRR2314019     3  0.4754     0.6275 0.000 0.052 0.684 0.264 0.000
#> SRR2314021     4  0.1408     0.8174 0.000 0.044 0.008 0.948 0.000
#> SRR2314018     3  0.0290     0.8864 0.000 0.000 0.992 0.000 0.008
#> SRR2314017     3  0.1750     0.8772 0.000 0.036 0.936 0.028 0.000
#> SRR2314016     4  0.2020     0.8114 0.000 0.100 0.000 0.900 0.000
#> SRR2314014     5  0.3707     0.0790 0.000 0.284 0.000 0.000 0.716
#> SRR2314013     5  0.3661     0.1094 0.000 0.276 0.000 0.000 0.724
#> SRR2314012     1  0.6339     0.5406 0.508 0.188 0.000 0.304 0.000
#> SRR2314011     1  0.4522     0.7530 0.744 0.176 0.000 0.080 0.000
#> SRR2314010     5  0.0912     0.4556 0.000 0.016 0.012 0.000 0.972
#> SRR2314009     3  0.0955     0.8853 0.000 0.004 0.968 0.028 0.000
#> SRR2314008     3  0.0510     0.8852 0.000 0.000 0.984 0.000 0.016
#> SRR2314007     3  0.3953     0.7542 0.000 0.048 0.784 0.000 0.168
#> SRR2314005     2  0.4161     0.8730 0.000 0.608 0.000 0.000 0.392
#> SRR2314004     2  0.4304     0.9021 0.000 0.516 0.000 0.000 0.484
#> SRR2314003     1  0.5902     0.6587 0.600 0.192 0.000 0.208 0.000
#> SRR2314006     2  0.4304     0.9021 0.000 0.516 0.000 0.000 0.484
#> SRR2314002     3  0.2570     0.8626 0.000 0.084 0.888 0.028 0.000
#> SRR2314001     5  0.1282     0.4206 0.000 0.044 0.004 0.000 0.952
#> SRR2314000     3  0.0404     0.8886 0.000 0.000 0.988 0.012 0.000
#> SRR2313998     5  0.3305     0.1461 0.000 0.224 0.000 0.000 0.776
#> SRR2313996     5  0.4604     0.1127 0.000 0.012 0.428 0.000 0.560
#> SRR2313999     1  0.4627     0.7488 0.732 0.188 0.000 0.080 0.000
#> SRR2313997     2  0.4304     0.9021 0.000 0.516 0.000 0.000 0.484
#> SRR2313992     4  0.4390     0.2190 0.000 0.004 0.428 0.568 0.000
#> SRR2313991     3  0.2270     0.8712 0.000 0.076 0.904 0.000 0.020
#> SRR2313990     5  0.4306    -0.0629 0.000 0.000 0.492 0.000 0.508
#> SRR2313988     1  0.6309     0.5502 0.532 0.228 0.000 0.240 0.000
#> SRR2313987     1  0.1792     0.7868 0.916 0.084 0.000 0.000 0.000
#> SRR2313984     5  0.1732     0.3787 0.000 0.080 0.000 0.000 0.920
#> SRR2313989     2  0.4150     0.8857 0.000 0.612 0.000 0.000 0.388
#> SRR2313983     1  0.0000     0.7858 1.000 0.000 0.000 0.000 0.000
#> SRR2313986     4  0.1908     0.8139 0.000 0.092 0.000 0.908 0.000
#> SRR2313982     1  0.0000     0.7858 1.000 0.000 0.000 0.000 0.000
#> SRR2313981     3  0.1571     0.8724 0.000 0.004 0.936 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
#> SRR2313978     2  0.2996    0.61367 0.000 0.772 0.228 0.000 NA 0.000
#> SRR2313980     6  0.1663    0.71368 0.000 0.088 0.000 0.000 NA 0.912
#> SRR2313979     1  0.0000    0.71304 1.000 0.000 0.000 0.000 NA 0.000
#> SRR2313977     2  0.4526    0.42730 0.000 0.708 0.004 0.000 NA 0.188
#> SRR2313976     6  0.2871    0.67951 0.000 0.004 0.000 0.000 NA 0.804
#> SRR2313975     4  0.4478    0.67330 0.000 0.076 0.000 0.680 NA 0.000
#> SRR2313973     1  0.0458    0.71286 0.984 0.000 0.000 0.000 NA 0.000
#> SRR2313974     4  0.6002    0.40059 0.060 0.068 0.000 0.440 NA 0.000
#> SRR2313985     1  0.1757    0.71856 0.916 0.008 0.000 0.000 NA 0.000
#> SRR2313993     6  0.5249    0.32028 0.000 0.368 0.000 0.000 NA 0.528
#> SRR2313994     6  0.5933    0.39680 0.000 0.288 0.000 0.000 NA 0.460
#> SRR2313995     2  0.3150    0.60629 0.000 0.828 0.120 0.000 NA 0.052
#> SRR2314024     6  0.2712    0.70596 0.000 0.088 0.000 0.000 NA 0.864
#> SRR2314015     2  0.5046    0.51358 0.000 0.712 0.060 0.000 NA 0.128
#> SRR2314025     1  0.6178    0.43216 0.404 0.004 0.000 0.272 NA 0.000
#> SRR2314023     1  0.0458    0.71286 0.984 0.000 0.000 0.000 NA 0.000
#> SRR2314033     6  0.2871    0.67951 0.000 0.004 0.000 0.000 NA 0.804
#> SRR2314045     4  0.5503    0.51755 0.016 0.092 0.000 0.540 NA 0.000
#> SRR2314042     4  0.0405    0.79829 0.000 0.000 0.008 0.988 NA 0.000
#> SRR2314043     3  0.0405    0.82947 0.000 0.008 0.988 0.000 NA 0.000
#> SRR2314041     2  0.3862    0.38550 0.000 0.608 0.388 0.000 NA 0.000
#> SRR2314044     3  0.2454    0.72527 0.000 0.160 0.840 0.000 NA 0.000
#> SRR2314040     3  0.1349    0.81439 0.000 0.056 0.940 0.000 NA 0.000
#> SRR2314039     3  0.0692    0.82858 0.000 0.020 0.976 0.000 NA 0.000
#> SRR2314038     3  0.6478    0.41655 0.000 0.248 0.536 0.112 NA 0.000
#> SRR2314037     3  0.1088    0.82492 0.000 0.000 0.960 0.024 NA 0.000
#> SRR2314036     6  0.1663    0.70359 0.000 0.000 0.000 0.000 NA 0.912
#> SRR2314035     3  0.1616    0.82163 0.000 0.020 0.932 0.000 NA 0.000
#> SRR2314034     4  0.0603    0.79601 0.000 0.004 0.016 0.980 NA 0.000
#> SRR2314032     1  0.7149    0.29132 0.352 0.092 0.000 0.208 NA 0.000
#> SRR2314031     4  0.2988    0.75771 0.000 0.024 0.000 0.824 NA 0.000
#> SRR2314029     2  0.6096    0.07543 0.000 0.480 0.380 0.072 NA 0.000
#> SRR2314030     4  0.1755    0.77940 0.000 0.032 0.008 0.932 NA 0.000
#> SRR2314028     4  0.0405    0.79829 0.000 0.000 0.008 0.988 NA 0.000
#> SRR2314027     3  0.1958    0.78638 0.000 0.100 0.896 0.000 NA 0.000
#> SRR2314026     3  0.4699    0.70935 0.000 0.056 0.736 0.144 NA 0.000
#> SRR2314020     6  0.1663    0.71368 0.000 0.088 0.000 0.000 NA 0.912
#> SRR2314019     3  0.5512    0.53328 0.000 0.044 0.588 0.304 NA 0.000
#> SRR2314021     4  0.2042    0.76315 0.000 0.024 0.024 0.920 NA 0.000
#> SRR2314018     3  0.0935    0.82353 0.000 0.032 0.964 0.000 NA 0.000
#> SRR2314017     3  0.2811    0.80388 0.000 0.020 0.872 0.032 NA 0.000
#> SRR2314016     4  0.3098    0.75227 0.000 0.024 0.000 0.812 NA 0.000
#> SRR2314014     6  0.5896    0.43449 0.000 0.236 0.000 0.000 NA 0.468
#> SRR2314013     6  0.5911    0.39844 0.000 0.280 0.000 0.000 NA 0.468
#> SRR2314012     1  0.6178    0.43655 0.404 0.004 0.000 0.272 NA 0.000
#> SRR2314011     1  0.4725    0.65239 0.604 0.000 0.000 0.064 NA 0.000
#> SRR2314010     2  0.4503    0.41204 0.000 0.696 0.000 0.000 NA 0.204
#> SRR2314009     3  0.1088    0.82492 0.000 0.000 0.960 0.024 NA 0.000
#> SRR2314008     3  0.1082    0.82140 0.000 0.040 0.956 0.000 NA 0.000
#> SRR2314007     2  0.5694    0.00738 0.000 0.476 0.420 0.036 NA 0.000
#> SRR2314005     6  0.2902    0.67942 0.000 0.004 0.000 0.000 NA 0.800
#> SRR2314004     6  0.3006    0.69892 0.000 0.092 0.000 0.000 NA 0.844
#> SRR2314003     1  0.5625    0.57210 0.504 0.000 0.000 0.164 NA 0.000
#> SRR2314006     6  0.1663    0.71368 0.000 0.088 0.000 0.000 NA 0.912
#> SRR2314002     3  0.4789    0.72875 0.000 0.068 0.728 0.056 NA 0.000
#> SRR2314001     2  0.4675    0.35472 0.000 0.672 0.000 0.000 NA 0.224
#> SRR2314000     3  0.0520    0.83006 0.000 0.008 0.984 0.000 NA 0.000
#> SRR2313998     6  0.5984    0.34315 0.000 0.344 0.000 0.000 NA 0.420
#> SRR2313996     2  0.2854    0.61930 0.000 0.792 0.208 0.000 NA 0.000
#> SRR2313999     1  0.4872    0.64893 0.596 0.004 0.000 0.064 NA 0.000
#> SRR2313997     6  0.1663    0.71368 0.000 0.088 0.000 0.000 NA 0.912
#> SRR2313992     3  0.3990    0.55038 0.000 0.004 0.676 0.304 NA 0.000
#> SRR2313991     3  0.4886    0.65716 0.000 0.184 0.680 0.008 NA 0.000
#> SRR2313990     2  0.4443    0.57830 0.000 0.664 0.276 0.000 NA 0.000
#> SRR2313988     1  0.7149    0.29132 0.352 0.092 0.000 0.208 NA 0.000
#> SRR2313987     1  0.2442    0.71496 0.852 0.004 0.000 0.000 NA 0.000
#> SRR2313984     2  0.5313   -0.07792 0.000 0.484 0.000 0.000 NA 0.412
#> SRR2313989     6  0.0363    0.71411 0.000 0.012 0.000 0.000 NA 0.988
#> SRR2313983     1  0.0000    0.71304 1.000 0.000 0.000 0.000 NA 0.000
#> SRR2313986     4  0.2988    0.75854 0.000 0.024 0.000 0.824 NA 0.000
#> SRR2313982     1  0.0000    0.71304 1.000 0.000 0.000 0.000 NA 0.000
#> SRR2313981     3  0.2006    0.80124 0.000 0.000 0.904 0.080 NA 0.000

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

consensus_heatmap(res, k = 2)

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

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

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

collect_plots(res)

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 1.000           0.988       0.995         0.5057 0.495   0.495
#> 3 3 0.771           0.788       0.909         0.1907 0.907   0.814
#> 4 4 0.853           0.825       0.909         0.1141 0.868   0.690
#> 5 5 0.840           0.758       0.879         0.0546 0.957   0.866
#> 6 6 0.800           0.691       0.836         0.0415 0.930   0.771

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
#> SRR2313978     2   0.000      0.996 0.000 1.000
#> SRR2313980     2   0.000      0.996 0.000 1.000
#> SRR2313979     1   0.000      0.993 1.000 0.000
#> SRR2313977     2   0.000      0.996 0.000 1.000
#> SRR2313976     2   0.000      0.996 0.000 1.000
#> SRR2313975     1   0.000      0.993 1.000 0.000
#> SRR2313973     1   0.000      0.993 1.000 0.000
#> SRR2313974     1   0.000      0.993 1.000 0.000
#> SRR2313985     1   0.000      0.993 1.000 0.000
#> SRR2313993     2   0.000      0.996 0.000 1.000
#> SRR2313994     2   0.000      0.996 0.000 1.000
#> SRR2313995     2   0.000      0.996 0.000 1.000
#> SRR2314024     2   0.000      0.996 0.000 1.000
#> SRR2314015     2   0.000      0.996 0.000 1.000
#> SRR2314025     1   0.000      0.993 1.000 0.000
#> SRR2314023     1   0.000      0.993 1.000 0.000
#> SRR2314033     2   0.000      0.996 0.000 1.000
#> SRR2314045     1   0.000      0.993 1.000 0.000
#> SRR2314042     1   0.000      0.993 1.000 0.000
#> SRR2314043     2   0.000      0.996 0.000 1.000
#> SRR2314041     2   0.000      0.996 0.000 1.000
#> SRR2314044     2   0.000      0.996 0.000 1.000
#> SRR2314040     2   0.000      0.996 0.000 1.000
#> SRR2314039     2   0.000      0.996 0.000 1.000
#> SRR2314038     1   0.714      0.754 0.804 0.196
#> SRR2314037     1   0.000      0.993 1.000 0.000
#> SRR2314036     2   0.000      0.996 0.000 1.000
#> SRR2314035     2   0.000      0.996 0.000 1.000
#> SRR2314034     1   0.000      0.993 1.000 0.000
#> SRR2314032     1   0.000      0.993 1.000 0.000
#> SRR2314031     1   0.000      0.993 1.000 0.000
#> SRR2314029     2   0.000      0.996 0.000 1.000
#> SRR2314030     1   0.000      0.993 1.000 0.000
#> SRR2314028     1   0.000      0.993 1.000 0.000
#> SRR2314027     2   0.000      0.996 0.000 1.000
#> SRR2314026     1   0.000      0.993 1.000 0.000
#> SRR2314020     2   0.000      0.996 0.000 1.000
#> SRR2314019     1   0.000      0.993 1.000 0.000
#> SRR2314021     1   0.000      0.993 1.000 0.000
#> SRR2314018     2   0.000      0.996 0.000 1.000
#> SRR2314017     1   0.141      0.975 0.980 0.020
#> SRR2314016     1   0.000      0.993 1.000 0.000
#> SRR2314014     2   0.000      0.996 0.000 1.000
#> SRR2314013     2   0.000      0.996 0.000 1.000
#> SRR2314012     1   0.000      0.993 1.000 0.000
#> SRR2314011     1   0.000      0.993 1.000 0.000
#> SRR2314010     2   0.000      0.996 0.000 1.000
#> SRR2314009     1   0.000      0.993 1.000 0.000
#> SRR2314008     2   0.000      0.996 0.000 1.000
#> SRR2314007     2   0.000      0.996 0.000 1.000
#> SRR2314005     2   0.000      0.996 0.000 1.000
#> SRR2314004     2   0.000      0.996 0.000 1.000
#> SRR2314003     1   0.000      0.993 1.000 0.000
#> SRR2314006     2   0.000      0.996 0.000 1.000
#> SRR2314002     1   0.000      0.993 1.000 0.000
#> SRR2314001     2   0.000      0.996 0.000 1.000
#> SRR2314000     2   0.634      0.807 0.160 0.840
#> SRR2313998     2   0.000      0.996 0.000 1.000
#> SRR2313996     2   0.000      0.996 0.000 1.000
#> SRR2313999     1   0.000      0.993 1.000 0.000
#> SRR2313997     2   0.000      0.996 0.000 1.000
#> SRR2313992     1   0.000      0.993 1.000 0.000
#> SRR2313991     2   0.000      0.996 0.000 1.000
#> SRR2313990     2   0.000      0.996 0.000 1.000
#> SRR2313988     1   0.000      0.993 1.000 0.000
#> SRR2313987     1   0.000      0.993 1.000 0.000
#> SRR2313984     2   0.000      0.996 0.000 1.000
#> SRR2313989     2   0.000      0.996 0.000 1.000
#> SRR2313983     1   0.000      0.993 1.000 0.000
#> SRR2313986     1   0.000      0.993 1.000 0.000
#> SRR2313982     1   0.000      0.993 1.000 0.000
#> SRR2313981     1   0.000      0.993 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313980     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313979     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313977     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313976     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313975     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313973     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313974     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313985     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313993     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313994     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313995     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314024     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314015     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314025     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314023     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314033     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314045     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314042     1  0.0237     0.9390 0.996 0.000 0.004
#> SRR2314043     3  0.5835     0.3270 0.000 0.340 0.660
#> SRR2314041     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314044     2  0.4796     0.6530 0.000 0.780 0.220
#> SRR2314040     2  0.5529     0.4944 0.000 0.704 0.296
#> SRR2314039     2  0.1860     0.8646 0.000 0.948 0.052
#> SRR2314038     3  0.7843     0.4911 0.208 0.128 0.664
#> SRR2314037     1  0.4931     0.5938 0.768 0.000 0.232
#> SRR2314036     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314035     2  0.6295     0.0128 0.000 0.528 0.472
#> SRR2314034     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314032     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314031     1  0.0237     0.9390 0.996 0.000 0.004
#> SRR2314029     2  0.6180     0.3035 0.000 0.584 0.416
#> SRR2314030     1  0.4842     0.6654 0.776 0.000 0.224
#> SRR2314028     1  0.0237     0.9390 0.996 0.000 0.004
#> SRR2314027     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314026     1  0.5905     0.4175 0.648 0.000 0.352
#> SRR2314020     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314019     1  0.5016     0.6407 0.760 0.000 0.240
#> SRR2314021     1  0.4842     0.6654 0.776 0.000 0.224
#> SRR2314018     3  0.6235     0.1224 0.000 0.436 0.564
#> SRR2314017     3  0.7517     0.3879 0.420 0.040 0.540
#> SRR2314016     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314014     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314013     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314012     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314011     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314010     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314009     3  0.6305     0.2269 0.484 0.000 0.516
#> SRR2314008     2  0.5733     0.4441 0.000 0.676 0.324
#> SRR2314007     2  0.6045     0.3757 0.000 0.620 0.380
#> SRR2314005     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314004     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314003     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2314006     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314002     3  0.5810     0.3924 0.336 0.000 0.664
#> SRR2314001     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2314000     3  0.6374     0.5876 0.100 0.132 0.768
#> SRR2313998     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313996     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313999     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313997     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313992     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313991     2  0.6307     0.0871 0.000 0.512 0.488
#> SRR2313990     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313988     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313987     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313984     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313989     2  0.0000     0.9062 0.000 1.000 0.000
#> SRR2313983     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313986     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313982     1  0.0000     0.9420 1.000 0.000 0.000
#> SRR2313981     1  0.0000     0.9420 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313980     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313979     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313976     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313975     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313973     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313974     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313985     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313994     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313995     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314024     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314015     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314025     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2314023     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314045     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2314042     1  0.0817      0.958 0.976 0.000 0.000 0.024
#> SRR2314043     3  0.6374      0.450 0.000 0.084 0.592 0.324
#> SRR2314041     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314044     2  0.6178      0.422 0.000 0.660 0.112 0.228
#> SRR2314040     3  0.4948      0.385 0.000 0.440 0.560 0.000
#> SRR2314039     2  0.5990      0.492 0.000 0.692 0.164 0.144
#> SRR2314038     4  0.2589      0.410 0.000 0.000 0.116 0.884
#> SRR2314037     1  0.6319      0.326 0.604 0.000 0.312 0.084
#> SRR2314036     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314035     3  0.3312      0.553 0.000 0.052 0.876 0.072
#> SRR2314034     1  0.0188      0.974 0.996 0.000 0.000 0.004
#> SRR2314032     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2314031     1  0.0817      0.958 0.976 0.000 0.000 0.024
#> SRR2314029     4  0.4100      0.423 0.000 0.148 0.036 0.816
#> SRR2314030     4  0.4898      0.435 0.416 0.000 0.000 0.584
#> SRR2314028     1  0.0817      0.958 0.976 0.000 0.000 0.024
#> SRR2314027     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314026     4  0.4944      0.502 0.072 0.000 0.160 0.768
#> SRR2314020     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314019     4  0.5024      0.515 0.360 0.000 0.008 0.632
#> SRR2314021     4  0.4843      0.475 0.396 0.000 0.000 0.604
#> SRR2314018     3  0.4365      0.584 0.000 0.188 0.784 0.028
#> SRR2314017     3  0.3278      0.499 0.020 0.000 0.864 0.116
#> SRR2314016     1  0.0592      0.965 0.984 0.000 0.000 0.016
#> SRR2314014     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314013     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314012     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2314011     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2314010     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314009     3  0.3074      0.447 0.152 0.000 0.848 0.000
#> SRR2314008     3  0.4843      0.443 0.000 0.396 0.604 0.000
#> SRR2314007     4  0.4988      0.352 0.000 0.236 0.036 0.728
#> SRR2314005     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314004     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314003     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2314006     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314002     4  0.5762      0.351 0.040 0.000 0.352 0.608
#> SRR2314001     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2314000     3  0.4454      0.460 0.000 0.000 0.692 0.308
#> SRR2313998     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313996     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313999     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313997     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313992     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313991     4  0.7065      0.261 0.000 0.212 0.216 0.572
#> SRR2313990     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313988     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313987     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313984     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313989     2  0.0000      0.973 0.000 1.000 0.000 0.000
#> SRR2313983     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313986     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313982     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> SRR2313981     1  0.0188      0.974 0.996 0.000 0.000 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
#> SRR2313978     2  0.0162     0.9875 0.000 0.996 0.004 0.000 0.000
#> SRR2313980     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2313977     2  0.0912     0.9771 0.000 0.972 0.012 0.000 0.016
#> SRR2313976     2  0.0798     0.9794 0.000 0.976 0.008 0.000 0.016
#> SRR2313975     1  0.0404     0.9202 0.988 0.000 0.000 0.012 0.000
#> SRR2313973     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2313974     1  0.0000     0.9222 1.000 0.000 0.000 0.000 0.000
#> SRR2313985     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2313993     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2313994     2  0.0798     0.9794 0.000 0.976 0.008 0.000 0.016
#> SRR2313995     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314024     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314025     1  0.1012     0.9168 0.968 0.000 0.020 0.012 0.000
#> SRR2314023     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2314033     2  0.0798     0.9794 0.000 0.976 0.008 0.000 0.016
#> SRR2314045     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2314042     1  0.4157     0.6747 0.716 0.000 0.020 0.264 0.000
#> SRR2314043     3  0.3819     0.5371 0.000 0.000 0.756 0.016 0.228
#> SRR2314041     2  0.0162     0.9875 0.000 0.996 0.004 0.000 0.000
#> SRR2314044     3  0.5341     0.2171 0.000 0.300 0.620 0.000 0.080
#> SRR2314040     5  0.6153     0.1237 0.000 0.416 0.084 0.016 0.484
#> SRR2314039     4  0.6800     0.1836 0.000 0.240 0.044 0.560 0.156
#> SRR2314038     3  0.3242     0.2364 0.000 0.000 0.784 0.216 0.000
#> SRR2314037     1  0.6946     0.0445 0.460 0.000 0.328 0.020 0.192
#> SRR2314036     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     5  0.0854     0.3670 0.000 0.004 0.012 0.008 0.976
#> SRR2314034     1  0.2616     0.8619 0.880 0.000 0.020 0.100 0.000
#> SRR2314032     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2314031     1  0.3999     0.7087 0.740 0.000 0.020 0.240 0.000
#> SRR2314029     4  0.6129     0.0643 0.000 0.128 0.420 0.452 0.000
#> SRR2314030     4  0.3109     0.4724 0.200 0.000 0.000 0.800 0.000
#> SRR2314028     1  0.4106     0.6866 0.724 0.000 0.020 0.256 0.000
#> SRR2314027     2  0.0451     0.9802 0.000 0.988 0.008 0.000 0.004
#> SRR2314026     4  0.1012     0.5148 0.000 0.000 0.020 0.968 0.012
#> SRR2314020     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     4  0.0609     0.5315 0.020 0.000 0.000 0.980 0.000
#> SRR2314021     4  0.2648     0.5119 0.152 0.000 0.000 0.848 0.000
#> SRR2314018     5  0.4564     0.2573 0.000 0.072 0.176 0.004 0.748
#> SRR2314017     5  0.2798     0.3741 0.000 0.000 0.140 0.008 0.852
#> SRR2314016     1  0.2616     0.8609 0.880 0.000 0.020 0.100 0.000
#> SRR2314014     2  0.0912     0.9771 0.000 0.972 0.012 0.000 0.016
#> SRR2314013     2  0.0912     0.9771 0.000 0.972 0.012 0.000 0.016
#> SRR2314012     1  0.1173     0.9182 0.964 0.000 0.020 0.012 0.004
#> SRR2314011     1  0.0771     0.9190 0.976 0.000 0.020 0.004 0.000
#> SRR2314010     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314009     5  0.6060     0.1933 0.136 0.000 0.116 0.072 0.676
#> SRR2314008     5  0.4564     0.2702 0.000 0.372 0.016 0.000 0.612
#> SRR2314007     4  0.6703     0.0667 0.000 0.244 0.360 0.396 0.000
#> SRR2314005     2  0.0912     0.9771 0.000 0.972 0.012 0.000 0.016
#> SRR2314004     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     1  0.0609     0.9197 0.980 0.000 0.020 0.000 0.000
#> SRR2314006     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     5  0.6389     0.1734 0.004 0.000 0.284 0.184 0.528
#> SRR2314001     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2314000     3  0.3586     0.5212 0.000 0.000 0.736 0.000 0.264
#> SRR2313998     2  0.0798     0.9794 0.000 0.976 0.008 0.000 0.016
#> SRR2313996     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2313999     1  0.0510     0.9206 0.984 0.000 0.016 0.000 0.000
#> SRR2313997     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     1  0.1026     0.9170 0.968 0.000 0.024 0.004 0.004
#> SRR2313991     5  0.8082     0.1894 0.000 0.176 0.284 0.136 0.404
#> SRR2313990     2  0.0912     0.9771 0.000 0.972 0.012 0.000 0.016
#> SRR2313988     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2313987     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2313984     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2313989     2  0.0000     0.9885 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2313986     1  0.0898     0.9182 0.972 0.000 0.020 0.008 0.000
#> SRR2313982     1  0.0162     0.9224 0.996 0.000 0.000 0.000 0.004
#> SRR2313981     1  0.2722     0.8773 0.892 0.000 0.040 0.060 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR2313978     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313980     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313979     1  0.0405     0.8962 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR2313977     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2313976     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2313975     1  0.1477     0.8716 0.940 0.000 0.000 0.048 0.008 0.004
#> SRR2313973     1  0.0000     0.8953 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR2313974     1  0.0260     0.8962 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR2313985     1  0.0405     0.8962 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR2313993     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313994     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2313995     2  0.1124     0.9132 0.000 0.956 0.000 0.000 0.008 0.036
#> SRR2314024     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314015     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314025     1  0.2442     0.8021 0.852 0.000 0.000 0.144 0.000 0.004
#> SRR2314023     1  0.0146     0.8959 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR2314033     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2314045     1  0.0405     0.8962 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR2314042     4  0.3961     0.3074 0.440 0.000 0.000 0.556 0.000 0.004
#> SRR2314043     6  0.4587     0.2197 0.000 0.004 0.372 0.000 0.036 0.588
#> SRR2314041     2  0.0820     0.9367 0.000 0.972 0.016 0.000 0.000 0.012
#> SRR2314044     6  0.5873     0.1821 0.000 0.248 0.272 0.000 0.000 0.480
#> SRR2314040     3  0.4133     0.2553 0.000 0.156 0.772 0.004 0.040 0.028
#> SRR2314039     3  0.7974     0.0505 0.000 0.136 0.300 0.280 0.024 0.260
#> SRR2314038     6  0.5962     0.1971 0.000 0.000 0.036 0.128 0.284 0.552
#> SRR2314037     3  0.6456     0.1344 0.224 0.000 0.412 0.024 0.000 0.340
#> SRR2314036     2  0.0146     0.9418 0.000 0.996 0.004 0.000 0.000 0.000
#> SRR2314035     3  0.3995    -0.1126 0.000 0.000 0.516 0.000 0.480 0.004
#> SRR2314034     1  0.3448     0.5754 0.716 0.000 0.000 0.280 0.000 0.004
#> SRR2314032     1  0.0405     0.8962 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR2314031     4  0.3986     0.2339 0.464 0.000 0.000 0.532 0.000 0.004
#> SRR2314029     6  0.6552     0.3433 0.000 0.120 0.008 0.184 0.116 0.572
#> SRR2314030     4  0.2956     0.4868 0.100 0.000 0.000 0.856 0.016 0.028
#> SRR2314028     4  0.3966     0.2982 0.444 0.000 0.000 0.552 0.000 0.004
#> SRR2314027     2  0.2450     0.8527 0.000 0.896 0.024 0.004 0.012 0.064
#> SRR2314026     4  0.4122     0.2152 0.000 0.000 0.020 0.764 0.056 0.160
#> SRR2314020     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314019     4  0.2468     0.3383 0.000 0.000 0.016 0.880 0.008 0.096
#> SRR2314021     4  0.3054     0.4633 0.076 0.000 0.000 0.848 0.004 0.072
#> SRR2314018     3  0.3720     0.3351 0.000 0.036 0.812 0.000 0.108 0.044
#> SRR2314017     5  0.2416     0.6163 0.000 0.000 0.156 0.000 0.844 0.000
#> SRR2314016     1  0.3668     0.4573 0.668 0.000 0.000 0.328 0.000 0.004
#> SRR2314014     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2314013     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2314012     1  0.2146     0.8268 0.880 0.000 0.000 0.116 0.000 0.004
#> SRR2314011     1  0.1471     0.8681 0.932 0.000 0.000 0.064 0.000 0.004
#> SRR2314010     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314009     3  0.6000     0.3437 0.096 0.000 0.652 0.020 0.088 0.144
#> SRR2314008     2  0.6203    -0.3063 0.000 0.384 0.336 0.000 0.276 0.004
#> SRR2314007     6  0.7077     0.2867 0.000 0.252 0.012 0.120 0.128 0.488
#> SRR2314005     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2314004     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314003     1  0.0935     0.8841 0.964 0.000 0.000 0.032 0.000 0.004
#> SRR2314006     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314002     5  0.0891     0.7203 0.008 0.000 0.000 0.024 0.968 0.000
#> SRR2314001     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2314000     6  0.4709     0.1552 0.004 0.000 0.444 0.000 0.036 0.516
#> SRR2313998     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2313996     2  0.0363     0.9372 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR2313999     1  0.0777     0.8872 0.972 0.000 0.000 0.024 0.000 0.004
#> SRR2313997     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313992     1  0.2589     0.8307 0.888 0.000 0.024 0.028 0.000 0.060
#> SRR2313991     5  0.3153     0.6359 0.000 0.100 0.004 0.012 0.848 0.036
#> SRR2313990     2  0.1411     0.9235 0.000 0.936 0.060 0.000 0.000 0.004
#> SRR2313988     1  0.0405     0.8962 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR2313987     1  0.0405     0.8962 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR2313984     2  0.0146     0.9408 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR2313989     2  0.0000     0.9424 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313983     1  0.0405     0.8962 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR2313986     1  0.2668     0.7777 0.828 0.000 0.000 0.168 0.000 0.004
#> SRR2313982     1  0.0405     0.8962 0.988 0.000 0.000 0.000 0.008 0.004
#> SRR2313981     1  0.5459     0.5655 0.680 0.000 0.084 0.156 0.004 0.076

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

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 16873 rows and 72 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 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-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.767           0.908       0.958         0.4896 0.512   0.512
#> 3 3 0.792           0.895       0.951         0.3580 0.714   0.492
#> 4 4 0.952           0.914       0.963         0.1109 0.891   0.689
#> 5 5 0.858           0.796       0.901         0.0523 0.942   0.789
#> 6 6 0.812           0.767       0.874         0.0535 0.923   0.681

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
#> SRR2313978     2  0.0000      0.939 0.000 1.000
#> SRR2313980     2  0.0000      0.939 0.000 1.000
#> SRR2313979     1  0.0000      0.976 1.000 0.000
#> SRR2313977     2  0.0000      0.939 0.000 1.000
#> SRR2313976     2  0.0000      0.939 0.000 1.000
#> SRR2313975     1  0.0000      0.976 1.000 0.000
#> SRR2313973     1  0.0000      0.976 1.000 0.000
#> SRR2313974     1  0.0000      0.976 1.000 0.000
#> SRR2313985     1  0.0000      0.976 1.000 0.000
#> SRR2313993     2  0.0000      0.939 0.000 1.000
#> SRR2313994     2  0.0000      0.939 0.000 1.000
#> SRR2313995     2  0.0000      0.939 0.000 1.000
#> SRR2314024     2  0.0000      0.939 0.000 1.000
#> SRR2314015     2  0.0000      0.939 0.000 1.000
#> SRR2314025     1  0.0000      0.976 1.000 0.000
#> SRR2314023     1  0.0000      0.976 1.000 0.000
#> SRR2314033     2  0.0000      0.939 0.000 1.000
#> SRR2314045     1  0.0000      0.976 1.000 0.000
#> SRR2314042     1  0.0000      0.976 1.000 0.000
#> SRR2314043     2  0.8443      0.686 0.272 0.728
#> SRR2314041     2  0.0376      0.938 0.004 0.996
#> SRR2314044     2  0.0376      0.938 0.004 0.996
#> SRR2314040     2  0.0376      0.938 0.004 0.996
#> SRR2314039     2  0.4298      0.879 0.088 0.912
#> SRR2314038     2  0.8327      0.697 0.264 0.736
#> SRR2314037     2  0.8443      0.686 0.272 0.728
#> SRR2314036     2  0.0000      0.939 0.000 1.000
#> SRR2314035     2  0.7056      0.783 0.192 0.808
#> SRR2314034     1  0.0000      0.976 1.000 0.000
#> SRR2314032     1  0.0000      0.976 1.000 0.000
#> SRR2314031     1  0.0000      0.976 1.000 0.000
#> SRR2314029     2  0.0376      0.938 0.004 0.996
#> SRR2314030     1  0.0000      0.976 1.000 0.000
#> SRR2314028     1  0.0000      0.976 1.000 0.000
#> SRR2314027     2  0.0376      0.938 0.004 0.996
#> SRR2314026     2  0.8443      0.686 0.272 0.728
#> SRR2314020     2  0.0000      0.939 0.000 1.000
#> SRR2314019     2  0.8443      0.686 0.272 0.728
#> SRR2314021     1  0.0000      0.976 1.000 0.000
#> SRR2314018     2  0.5946      0.831 0.144 0.856
#> SRR2314017     1  0.9850      0.136 0.572 0.428
#> SRR2314016     1  0.0000      0.976 1.000 0.000
#> SRR2314014     2  0.0000      0.939 0.000 1.000
#> SRR2314013     2  0.0000      0.939 0.000 1.000
#> SRR2314012     1  0.0000      0.976 1.000 0.000
#> SRR2314011     1  0.0000      0.976 1.000 0.000
#> SRR2314010     2  0.0000      0.939 0.000 1.000
#> SRR2314009     2  0.8443      0.686 0.272 0.728
#> SRR2314008     2  0.0376      0.938 0.004 0.996
#> SRR2314007     2  0.0376      0.938 0.004 0.996
#> SRR2314005     2  0.0000      0.939 0.000 1.000
#> SRR2314004     2  0.0000      0.939 0.000 1.000
#> SRR2314003     1  0.0000      0.976 1.000 0.000
#> SRR2314006     2  0.0000      0.939 0.000 1.000
#> SRR2314002     1  0.6712      0.754 0.824 0.176
#> SRR2314001     2  0.0000      0.939 0.000 1.000
#> SRR2314000     2  0.9209      0.570 0.336 0.664
#> SRR2313998     2  0.0000      0.939 0.000 1.000
#> SRR2313996     2  0.0000      0.939 0.000 1.000
#> SRR2313999     1  0.0000      0.976 1.000 0.000
#> SRR2313997     2  0.0000      0.939 0.000 1.000
#> SRR2313992     1  0.0000      0.976 1.000 0.000
#> SRR2313991     2  0.0376      0.938 0.004 0.996
#> SRR2313990     2  0.0000      0.939 0.000 1.000
#> SRR2313988     1  0.0000      0.976 1.000 0.000
#> SRR2313987     1  0.0000      0.976 1.000 0.000
#> SRR2313984     2  0.0000      0.939 0.000 1.000
#> SRR2313989     2  0.0000      0.939 0.000 1.000
#> SRR2313983     1  0.0000      0.976 1.000 0.000
#> SRR2313986     1  0.0000      0.976 1.000 0.000
#> SRR2313982     1  0.0000      0.976 1.000 0.000
#> SRR2313981     1  0.0376      0.972 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     3  0.3267      0.840 0.000 0.116 0.884
#> SRR2313980     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313979     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313977     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313976     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313975     1  0.5882      0.605 0.652 0.000 0.348
#> SRR2313973     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313974     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313985     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313993     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313994     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313995     3  0.5882      0.465 0.000 0.348 0.652
#> SRR2314024     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314015     2  0.1411      0.960 0.000 0.964 0.036
#> SRR2314025     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2314023     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2314033     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314045     1  0.3192      0.833 0.888 0.000 0.112
#> SRR2314042     1  0.5882      0.605 0.652 0.000 0.348
#> SRR2314043     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314041     3  0.0592      0.935 0.000 0.012 0.988
#> SRR2314044     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314040     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314039     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314038     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314037     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314036     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314035     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314034     1  0.5882      0.605 0.652 0.000 0.348
#> SRR2314032     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2314031     1  0.5706      0.641 0.680 0.000 0.320
#> SRR2314029     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314030     3  0.3340      0.817 0.120 0.000 0.880
#> SRR2314028     1  0.5882      0.605 0.652 0.000 0.348
#> SRR2314027     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314026     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314020     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314019     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314021     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314018     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314017     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314016     1  0.3192      0.833 0.888 0.000 0.112
#> SRR2314014     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314013     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314012     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2314011     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2314010     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314009     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314008     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314007     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314005     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314004     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314003     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2314006     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314002     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2314001     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2314000     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2313998     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313996     3  0.3267      0.841 0.000 0.116 0.884
#> SRR2313999     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313997     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313992     3  0.5733      0.396 0.324 0.000 0.676
#> SRR2313991     3  0.0000      0.944 0.000 0.000 1.000
#> SRR2313990     3  0.4555      0.742 0.000 0.200 0.800
#> SRR2313988     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313987     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313984     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313989     2  0.0000      0.998 0.000 1.000 0.000
#> SRR2313983     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313986     1  0.5859      0.611 0.656 0.000 0.344
#> SRR2313982     1  0.0000      0.889 1.000 0.000 0.000
#> SRR2313981     3  0.0000      0.944 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
#> SRR2313978     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2313980     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313979     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> SRR2313977     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313976     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313975     4  0.0000      0.968 0.000 0.000 0.000 1.000
#> SRR2313973     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> SRR2313974     4  0.0921      0.956 0.028 0.000 0.000 0.972
#> SRR2313985     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> SRR2313993     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313994     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313995     3  0.2973      0.794 0.000 0.144 0.856 0.000
#> SRR2314024     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314015     2  0.4661      0.468 0.000 0.652 0.348 0.000
#> SRR2314025     4  0.0000      0.968 0.000 0.000 0.000 1.000
#> SRR2314023     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> SRR2314033     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314045     4  0.0000      0.968 0.000 0.000 0.000 1.000
#> SRR2314042     4  0.0817      0.964 0.000 0.000 0.024 0.976
#> SRR2314043     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314041     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314044     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314040     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314039     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314038     3  0.4164      0.634 0.000 0.000 0.736 0.264
#> SRR2314037     3  0.1474      0.901 0.000 0.000 0.948 0.052
#> SRR2314036     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314035     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314034     4  0.0817      0.964 0.000 0.000 0.024 0.976
#> SRR2314032     4  0.2149      0.901 0.088 0.000 0.000 0.912
#> SRR2314031     4  0.0000      0.968 0.000 0.000 0.000 1.000
#> SRR2314029     3  0.1211      0.911 0.000 0.000 0.960 0.040
#> SRR2314030     4  0.0707      0.964 0.000 0.000 0.020 0.980
#> SRR2314028     4  0.0817      0.964 0.000 0.000 0.024 0.976
#> SRR2314027     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314026     3  0.3942      0.686 0.000 0.000 0.764 0.236
#> SRR2314020     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314019     4  0.2011      0.905 0.000 0.000 0.080 0.920
#> SRR2314021     4  0.1389      0.941 0.000 0.000 0.048 0.952
#> SRR2314018     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314017     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314016     4  0.0000      0.968 0.000 0.000 0.000 1.000
#> SRR2314014     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314013     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314012     4  0.0921      0.955 0.028 0.000 0.000 0.972
#> SRR2314011     1  0.2408      0.882 0.896 0.000 0.000 0.104
#> SRR2314010     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314009     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314008     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314007     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314005     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314004     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314003     4  0.0921      0.956 0.028 0.000 0.000 0.972
#> SRR2314006     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314002     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2314001     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2314000     3  0.1022      0.917 0.000 0.000 0.968 0.032
#> SRR2313998     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313996     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2313999     1  0.2081      0.896 0.916 0.000 0.000 0.084
#> SRR2313997     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313992     4  0.0817      0.964 0.000 0.000 0.024 0.976
#> SRR2313991     3  0.0000      0.938 0.000 0.000 1.000 0.000
#> SRR2313990     3  0.0188      0.935 0.000 0.004 0.996 0.000
#> SRR2313988     1  0.4855      0.352 0.600 0.000 0.000 0.400
#> SRR2313987     1  0.1389      0.914 0.952 0.000 0.000 0.048
#> SRR2313984     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313989     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR2313983     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> SRR2313986     4  0.0000      0.968 0.000 0.000 0.000 1.000
#> SRR2313982     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> SRR2313981     3  0.4992      0.103 0.000 0.000 0.524 0.476

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR2313978     3  0.1478     0.8329 0.064 0.000 0.936 0.000 0.000
#> SRR2313980     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2313979     5  0.0000     0.9974 0.000 0.000 0.000 0.000 1.000
#> SRR2313977     2  0.1478     0.9163 0.064 0.936 0.000 0.000 0.000
#> SRR2313976     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2313975     1  0.1732     0.8687 0.920 0.000 0.000 0.080 0.000
#> SRR2313973     5  0.0000     0.9974 0.000 0.000 0.000 0.000 1.000
#> SRR2313974     1  0.1608     0.8726 0.928 0.000 0.000 0.072 0.000
#> SRR2313985     5  0.0510     0.9868 0.016 0.000 0.000 0.000 0.984
#> SRR2313993     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2313994     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2313995     3  0.3116     0.7782 0.064 0.076 0.860 0.000 0.000
#> SRR2314024     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314015     2  0.5245     0.4401 0.064 0.608 0.328 0.000 0.000
#> SRR2314025     4  0.4088     0.3441 0.368 0.000 0.000 0.632 0.000
#> SRR2314023     5  0.0000     0.9974 0.000 0.000 0.000 0.000 1.000
#> SRR2314033     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314045     1  0.3452     0.6733 0.756 0.000 0.000 0.244 0.000
#> SRR2314042     4  0.0162     0.7306 0.004 0.000 0.000 0.996 0.000
#> SRR2314043     3  0.2516     0.7834 0.000 0.000 0.860 0.140 0.000
#> SRR2314041     3  0.1478     0.8329 0.064 0.000 0.936 0.000 0.000
#> SRR2314044     3  0.1478     0.8329 0.064 0.000 0.936 0.000 0.000
#> SRR2314040     3  0.0000     0.8417 0.000 0.000 1.000 0.000 0.000
#> SRR2314039     3  0.0510     0.8401 0.000 0.000 0.984 0.016 0.000
#> SRR2314038     4  0.5289     0.0311 0.064 0.000 0.340 0.596 0.000
#> SRR2314037     3  0.3966     0.6252 0.000 0.000 0.664 0.336 0.000
#> SRR2314036     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314035     3  0.0162     0.8413 0.000 0.000 0.996 0.004 0.000
#> SRR2314034     4  0.0162     0.7306 0.004 0.000 0.000 0.996 0.000
#> SRR2314032     1  0.1478     0.8730 0.936 0.000 0.000 0.064 0.000
#> SRR2314031     4  0.3999     0.3805 0.344 0.000 0.000 0.656 0.000
#> SRR2314029     3  0.2654     0.8137 0.064 0.000 0.888 0.048 0.000
#> SRR2314030     4  0.0162     0.7306 0.004 0.000 0.000 0.996 0.000
#> SRR2314028     4  0.0162     0.7306 0.004 0.000 0.000 0.996 0.000
#> SRR2314027     3  0.0000     0.8417 0.000 0.000 1.000 0.000 0.000
#> SRR2314026     3  0.3305     0.7178 0.000 0.000 0.776 0.224 0.000
#> SRR2314020     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314019     4  0.2763     0.6482 0.004 0.000 0.148 0.848 0.000
#> SRR2314021     4  0.0162     0.7306 0.004 0.000 0.000 0.996 0.000
#> SRR2314018     3  0.0162     0.8413 0.000 0.000 0.996 0.004 0.000
#> SRR2314017     3  0.3949     0.6287 0.000 0.000 0.668 0.332 0.000
#> SRR2314016     4  0.4045     0.3632 0.356 0.000 0.000 0.644 0.000
#> SRR2314014     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314013     2  0.0162     0.9665 0.000 0.996 0.004 0.000 0.000
#> SRR2314012     4  0.4268     0.1515 0.444 0.000 0.000 0.556 0.000
#> SRR2314011     1  0.1671     0.8626 0.924 0.000 0.000 0.000 0.076
#> SRR2314010     2  0.2104     0.8975 0.060 0.916 0.024 0.000 0.000
#> SRR2314009     3  0.3949     0.6287 0.000 0.000 0.668 0.332 0.000
#> SRR2314008     3  0.0000     0.8417 0.000 0.000 1.000 0.000 0.000
#> SRR2314007     3  0.1764     0.8318 0.064 0.000 0.928 0.008 0.000
#> SRR2314005     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314004     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314003     1  0.1608     0.8726 0.928 0.000 0.000 0.072 0.000
#> SRR2314006     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314002     3  0.3949     0.6287 0.000 0.000 0.668 0.332 0.000
#> SRR2314001     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2314000     3  0.3949     0.6287 0.000 0.000 0.668 0.332 0.000
#> SRR2313998     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2313996     3  0.1478     0.8329 0.064 0.000 0.936 0.000 0.000
#> SRR2313999     1  0.1671     0.8626 0.924 0.000 0.000 0.000 0.076
#> SRR2313997     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2313992     4  0.1478     0.6864 0.000 0.000 0.064 0.936 0.000
#> SRR2313991     3  0.0290     0.8417 0.008 0.000 0.992 0.000 0.000
#> SRR2313990     3  0.1478     0.8329 0.064 0.000 0.936 0.000 0.000
#> SRR2313988     1  0.1697     0.8667 0.932 0.000 0.000 0.008 0.060
#> SRR2313987     1  0.1908     0.8511 0.908 0.000 0.000 0.000 0.092
#> SRR2313984     2  0.0404     0.9609 0.012 0.988 0.000 0.000 0.000
#> SRR2313989     2  0.0000     0.9694 0.000 1.000 0.000 0.000 0.000
#> SRR2313983     5  0.0000     0.9974 0.000 0.000 0.000 0.000 1.000
#> SRR2313986     1  0.4150     0.3045 0.612 0.000 0.000 0.388 0.000
#> SRR2313982     5  0.0000     0.9974 0.000 0.000 0.000 0.000 1.000
#> SRR2313981     3  0.4302     0.3672 0.000 0.000 0.520 0.480 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
#> SRR2313978     2  0.0146     0.7435 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR2313980     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313979     5  0.0000     0.9939 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313977     6  0.5481     0.5963 0.000 0.264 0.176 0.000 0.000 0.560
#> SRR2313976     6  0.2902     0.8366 0.000 0.004 0.196 0.000 0.000 0.800
#> SRR2313975     1  0.0790     0.8769 0.968 0.000 0.000 0.032 0.000 0.000
#> SRR2313973     5  0.0000     0.9939 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313974     1  0.0146     0.8928 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2313985     5  0.0632     0.9774 0.024 0.000 0.000 0.000 0.976 0.000
#> SRR2313993     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313994     6  0.2902     0.8366 0.000 0.004 0.196 0.000 0.000 0.800
#> SRR2313995     2  0.0632     0.7311 0.000 0.976 0.000 0.000 0.000 0.024
#> SRR2314024     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314015     2  0.3857    -0.0946 0.000 0.532 0.000 0.000 0.000 0.468
#> SRR2314025     4  0.3288     0.6321 0.276 0.000 0.000 0.724 0.000 0.000
#> SRR2314023     5  0.0260     0.9894 0.008 0.000 0.000 0.000 0.992 0.000
#> SRR2314033     6  0.2902     0.8366 0.000 0.004 0.196 0.000 0.000 0.800
#> SRR2314045     1  0.3747     0.2741 0.604 0.000 0.000 0.396 0.000 0.000
#> SRR2314042     4  0.0000     0.8503 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314043     3  0.2762     0.8927 0.000 0.196 0.804 0.000 0.000 0.000
#> SRR2314041     2  0.0458     0.7420 0.000 0.984 0.016 0.000 0.000 0.000
#> SRR2314044     2  0.0260     0.7431 0.000 0.992 0.008 0.000 0.000 0.000
#> SRR2314040     2  0.3221     0.5731 0.000 0.736 0.264 0.000 0.000 0.000
#> SRR2314039     2  0.3684     0.3368 0.000 0.628 0.372 0.000 0.000 0.000
#> SRR2314038     3  0.5509     0.3680 0.000 0.292 0.544 0.164 0.000 0.000
#> SRR2314037     3  0.2762     0.8927 0.000 0.196 0.804 0.000 0.000 0.000
#> SRR2314036     6  0.0547     0.8900 0.000 0.000 0.020 0.000 0.000 0.980
#> SRR2314035     3  0.3023     0.8437 0.000 0.232 0.768 0.000 0.000 0.000
#> SRR2314034     4  0.0000     0.8503 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314032     1  0.0260     0.8916 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR2314031     4  0.0000     0.8503 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314029     2  0.0632     0.7306 0.000 0.976 0.000 0.024 0.000 0.000
#> SRR2314030     4  0.0000     0.8503 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314028     4  0.0000     0.8503 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314027     2  0.3221     0.5731 0.000 0.736 0.264 0.000 0.000 0.000
#> SRR2314026     2  0.4337    -0.0816 0.000 0.500 0.480 0.020 0.000 0.000
#> SRR2314020     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314019     4  0.3612     0.6770 0.000 0.036 0.200 0.764 0.000 0.000
#> SRR2314021     4  0.0000     0.8503 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR2314018     3  0.2762     0.8927 0.000 0.196 0.804 0.000 0.000 0.000
#> SRR2314017     3  0.2762     0.8927 0.000 0.196 0.804 0.000 0.000 0.000
#> SRR2314016     4  0.3023     0.6816 0.232 0.000 0.000 0.768 0.000 0.000
#> SRR2314014     6  0.2902     0.8366 0.000 0.004 0.196 0.000 0.000 0.800
#> SRR2314013     6  0.3012     0.8346 0.000 0.008 0.196 0.000 0.000 0.796
#> SRR2314012     4  0.3833     0.2631 0.444 0.000 0.000 0.556 0.000 0.000
#> SRR2314011     1  0.0146     0.8927 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR2314010     6  0.3428     0.5772 0.000 0.304 0.000 0.000 0.000 0.696
#> SRR2314009     3  0.2762     0.8927 0.000 0.196 0.804 0.000 0.000 0.000
#> SRR2314008     2  0.3266     0.5628 0.000 0.728 0.272 0.000 0.000 0.000
#> SRR2314007     2  0.0146     0.7437 0.000 0.996 0.004 0.000 0.000 0.000
#> SRR2314005     6  0.2902     0.8366 0.000 0.004 0.196 0.000 0.000 0.800
#> SRR2314004     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314003     1  0.0146     0.8928 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR2314006     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314002     3  0.2762     0.8927 0.000 0.196 0.804 0.000 0.000 0.000
#> SRR2314001     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2314000     3  0.2762     0.8927 0.000 0.196 0.804 0.000 0.000 0.000
#> SRR2313998     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313996     2  0.0146     0.7435 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR2313999     1  0.0146     0.8927 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR2313997     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313992     3  0.2762     0.6566 0.000 0.000 0.804 0.196 0.000 0.000
#> SRR2313991     2  0.3151     0.5861 0.000 0.748 0.252 0.000 0.000 0.000
#> SRR2313990     2  0.0000     0.7431 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR2313988     1  0.0260     0.8916 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR2313987     1  0.0458     0.8865 0.984 0.000 0.000 0.000 0.016 0.000
#> SRR2313984     6  0.2135     0.8077 0.000 0.128 0.000 0.000 0.000 0.872
#> SRR2313989     6  0.0000     0.8944 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR2313983     5  0.0000     0.9939 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313986     1  0.3592     0.3543 0.656 0.000 0.000 0.344 0.000 0.000
#> SRR2313982     5  0.0000     0.9939 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR2313981     3  0.3122     0.8725 0.000 0.176 0.804 0.020 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

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 16873 rows and 72 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 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-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.619           0.845       0.925         0.4663 0.503   0.503
#> 3 3 0.360           0.555       0.775         0.2344 0.710   0.526
#> 4 4 0.442           0.436       0.719         0.1528 0.796   0.571
#> 5 5 0.618           0.609       0.795         0.1427 0.752   0.384
#> 6 6 0.596           0.507       0.691         0.0517 0.867   0.556

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
#> SRR2313978     2  0.9358      0.618 0.352 0.648
#> SRR2313980     2  0.0000      0.851 0.000 1.000
#> SRR2313979     1  0.0000      0.960 1.000 0.000
#> SRR2313977     2  0.8608      0.717 0.284 0.716
#> SRR2313976     2  0.0672      0.854 0.008 0.992
#> SRR2313975     1  0.0000      0.960 1.000 0.000
#> SRR2313973     1  0.0000      0.960 1.000 0.000
#> SRR2313974     1  0.0000      0.960 1.000 0.000
#> SRR2313985     1  0.0000      0.960 1.000 0.000
#> SRR2313993     2  0.5178      0.835 0.116 0.884
#> SRR2313994     2  0.0672      0.854 0.008 0.992
#> SRR2313995     2  0.9866      0.451 0.432 0.568
#> SRR2314024     2  0.0672      0.853 0.008 0.992
#> SRR2314015     2  0.0000      0.851 0.000 1.000
#> SRR2314025     1  0.0000      0.960 1.000 0.000
#> SRR2314023     1  0.0000      0.960 1.000 0.000
#> SRR2314033     2  0.5178      0.835 0.116 0.884
#> SRR2314045     1  0.0000      0.960 1.000 0.000
#> SRR2314042     1  0.0000      0.960 1.000 0.000
#> SRR2314043     2  0.9909      0.419 0.444 0.556
#> SRR2314041     2  0.5059      0.833 0.112 0.888
#> SRR2314044     1  0.9580      0.198 0.620 0.380
#> SRR2314040     2  0.8499      0.726 0.276 0.724
#> SRR2314039     1  0.9933     -0.103 0.548 0.452
#> SRR2314038     1  0.0000      0.960 1.000 0.000
#> SRR2314037     1  0.0000      0.960 1.000 0.000
#> SRR2314036     2  0.0672      0.854 0.008 0.992
#> SRR2314035     1  0.0000      0.960 1.000 0.000
#> SRR2314034     1  0.0000      0.960 1.000 0.000
#> SRR2314032     1  0.0000      0.960 1.000 0.000
#> SRR2314031     1  0.0000      0.960 1.000 0.000
#> SRR2314029     1  0.0000      0.960 1.000 0.000
#> SRR2314030     1  0.0000      0.960 1.000 0.000
#> SRR2314028     1  0.0000      0.960 1.000 0.000
#> SRR2314027     2  0.9286      0.631 0.344 0.656
#> SRR2314026     1  0.0000      0.960 1.000 0.000
#> SRR2314020     2  0.0376      0.851 0.004 0.996
#> SRR2314019     1  0.0000      0.960 1.000 0.000
#> SRR2314021     1  0.0000      0.960 1.000 0.000
#> SRR2314018     2  0.9815      0.480 0.420 0.580
#> SRR2314017     1  0.0000      0.960 1.000 0.000
#> SRR2314016     1  0.0000      0.960 1.000 0.000
#> SRR2314014     2  0.0672      0.854 0.008 0.992
#> SRR2314013     2  0.0672      0.854 0.008 0.992
#> SRR2314012     1  0.0000      0.960 1.000 0.000
#> SRR2314011     1  0.0000      0.960 1.000 0.000
#> SRR2314010     2  0.0000      0.851 0.000 1.000
#> SRR2314009     1  0.5059      0.821 0.888 0.112
#> SRR2314008     2  0.7745      0.767 0.228 0.772
#> SRR2314007     1  0.1184      0.943 0.984 0.016
#> SRR2314005     2  0.7883      0.764 0.236 0.764
#> SRR2314004     2  0.0000      0.851 0.000 1.000
#> SRR2314003     1  0.0000      0.960 1.000 0.000
#> SRR2314006     2  0.3879      0.845 0.076 0.924
#> SRR2314002     1  0.0000      0.960 1.000 0.000
#> SRR2314001     2  0.4939      0.837 0.108 0.892
#> SRR2314000     1  0.9129      0.369 0.672 0.328
#> SRR2313998     2  0.0672      0.854 0.008 0.992
#> SRR2313996     2  0.8555      0.721 0.280 0.720
#> SRR2313999     1  0.0000      0.960 1.000 0.000
#> SRR2313997     2  0.0000      0.851 0.000 1.000
#> SRR2313992     1  0.0000      0.960 1.000 0.000
#> SRR2313991     1  0.0000      0.960 1.000 0.000
#> SRR2313990     2  0.7602      0.777 0.220 0.780
#> SRR2313988     1  0.0000      0.960 1.000 0.000
#> SRR2313987     1  0.0000      0.960 1.000 0.000
#> SRR2313984     2  0.1184      0.854 0.016 0.984
#> SRR2313989     2  0.0000      0.851 0.000 1.000
#> SRR2313983     1  0.0000      0.960 1.000 0.000
#> SRR2313986     1  0.0000      0.960 1.000 0.000
#> SRR2313982     1  0.0000      0.960 1.000 0.000
#> SRR2313981     1  0.0000      0.960 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.6142      0.707 0.212 0.748 0.040
#> SRR2313980     2  0.2537      0.757 0.000 0.920 0.080
#> SRR2313979     1  0.6280      0.249 0.540 0.000 0.460
#> SRR2313977     2  0.5028      0.756 0.132 0.828 0.040
#> SRR2313976     2  0.0237      0.772 0.000 0.996 0.004
#> SRR2313975     1  0.2806      0.569 0.928 0.040 0.032
#> SRR2313973     1  0.5621      0.392 0.692 0.000 0.308
#> SRR2313974     1  0.1315      0.591 0.972 0.020 0.008
#> SRR2313985     1  0.6309      0.203 0.504 0.000 0.496
#> SRR2313993     2  0.2773      0.782 0.048 0.928 0.024
#> SRR2313994     2  0.0000      0.772 0.000 1.000 0.000
#> SRR2313995     2  0.7534      0.537 0.368 0.584 0.048
#> SRR2314024     2  0.3120      0.764 0.012 0.908 0.080
#> SRR2314015     2  0.1163      0.777 0.000 0.972 0.028
#> SRR2314025     1  0.1289      0.585 0.968 0.000 0.032
#> SRR2314023     1  0.4750      0.463 0.784 0.000 0.216
#> SRR2314033     2  0.2301      0.766 0.004 0.936 0.060
#> SRR2314045     3  0.5882      0.536 0.348 0.000 0.652
#> SRR2314042     1  0.1753      0.572 0.952 0.000 0.048
#> SRR2314043     2  0.7301      0.607 0.308 0.640 0.052
#> SRR2314041     2  0.3039      0.781 0.044 0.920 0.036
#> SRR2314044     2  0.7328      0.556 0.364 0.596 0.040
#> SRR2314040     2  0.4526      0.766 0.104 0.856 0.040
#> SRR2314039     2  0.7624      0.523 0.368 0.580 0.052
#> SRR2314038     2  0.7674      0.356 0.472 0.484 0.044
#> SRR2314037     2  0.7464      0.503 0.400 0.560 0.040
#> SRR2314036     2  0.0237      0.772 0.000 0.996 0.004
#> SRR2314035     2  0.8543      0.496 0.292 0.580 0.128
#> SRR2314034     1  0.2187      0.586 0.948 0.024 0.028
#> SRR2314032     3  0.4235      0.514 0.176 0.000 0.824
#> SRR2314031     1  0.1031      0.585 0.976 0.000 0.024
#> SRR2314029     1  0.7759     -0.376 0.480 0.472 0.048
#> SRR2314030     1  0.6308     -0.426 0.508 0.000 0.492
#> SRR2314028     1  0.1031      0.585 0.976 0.000 0.024
#> SRR2314027     2  0.7260      0.595 0.316 0.636 0.048
#> SRR2314026     3  0.8800      0.550 0.396 0.116 0.488
#> SRR2314020     2  0.2796      0.752 0.000 0.908 0.092
#> SRR2314019     1  0.8439     -0.115 0.536 0.368 0.096
#> SRR2314021     1  0.6274     -0.384 0.544 0.000 0.456
#> SRR2314018     2  0.5951      0.717 0.196 0.764 0.040
#> SRR2314017     3  0.8599      0.654 0.276 0.140 0.584
#> SRR2314016     1  0.4178      0.391 0.828 0.000 0.172
#> SRR2314014     2  0.0237      0.772 0.000 0.996 0.004
#> SRR2314013     2  0.0237      0.772 0.000 0.996 0.004
#> SRR2314012     1  0.3482      0.524 0.872 0.000 0.128
#> SRR2314011     1  0.1315      0.591 0.972 0.020 0.008
#> SRR2314010     2  0.1163      0.777 0.000 0.972 0.028
#> SRR2314009     2  0.7263      0.547 0.372 0.592 0.036
#> SRR2314008     2  0.3742      0.777 0.072 0.892 0.036
#> SRR2314007     2  0.7807      0.410 0.432 0.516 0.052
#> SRR2314005     2  0.3369      0.776 0.052 0.908 0.040
#> SRR2314004     2  0.2356      0.760 0.000 0.928 0.072
#> SRR2314003     1  0.2229      0.586 0.944 0.012 0.044
#> SRR2314006     2  0.3550      0.768 0.024 0.896 0.080
#> SRR2314002     3  0.8483      0.651 0.260 0.140 0.600
#> SRR2314001     2  0.2200      0.783 0.056 0.940 0.004
#> SRR2314000     2  0.7395      0.535 0.380 0.580 0.040
#> SRR2313998     2  0.0000      0.772 0.000 1.000 0.000
#> SRR2313996     2  0.5955      0.720 0.180 0.772 0.048
#> SRR2313999     1  0.1315      0.591 0.972 0.020 0.008
#> SRR2313997     2  0.2537      0.757 0.000 0.920 0.080
#> SRR2313992     1  0.4786      0.447 0.844 0.112 0.044
#> SRR2313991     3  0.9290      0.519 0.372 0.164 0.464
#> SRR2313990     2  0.3921      0.776 0.080 0.884 0.036
#> SRR2313988     3  0.4002      0.497 0.160 0.000 0.840
#> SRR2313987     1  0.5926      0.338 0.644 0.000 0.356
#> SRR2313984     2  0.3031      0.766 0.012 0.912 0.076
#> SRR2313989     2  0.0000      0.772 0.000 1.000 0.000
#> SRR2313983     1  0.6280      0.249 0.540 0.000 0.460
#> SRR2313986     1  0.2772      0.543 0.916 0.080 0.004
#> SRR2313982     1  0.6280      0.249 0.540 0.000 0.460
#> SRR2313981     2  0.7735      0.400 0.440 0.512 0.048

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.5000     0.2802 0.000 0.504 0.496 0.000
#> SRR2313980     2  0.1807     0.7560 0.008 0.940 0.000 0.052
#> SRR2313979     1  0.0592     0.8513 0.984 0.000 0.016 0.000
#> SRR2313977     2  0.2149     0.7436 0.000 0.912 0.088 0.000
#> SRR2313976     2  0.2271     0.7468 0.008 0.916 0.000 0.076
#> SRR2313975     3  0.3765     0.2346 0.032 0.004 0.848 0.116
#> SRR2313973     1  0.2814     0.7717 0.868 0.000 0.132 0.000
#> SRR2313974     3  0.5346     0.0739 0.272 0.004 0.692 0.032
#> SRR2313985     1  0.1297     0.8446 0.964 0.000 0.016 0.020
#> SRR2313993     2  0.1042     0.7641 0.000 0.972 0.008 0.020
#> SRR2313994     2  0.2125     0.7491 0.004 0.920 0.000 0.076
#> SRR2313995     3  0.7822     0.1667 0.000 0.256 0.380 0.364
#> SRR2314024     2  0.1807     0.7560 0.008 0.940 0.000 0.052
#> SRR2314015     2  0.0817     0.7648 0.000 0.976 0.024 0.000
#> SRR2314025     4  0.7811     0.1002 0.268 0.000 0.320 0.412
#> SRR2314023     1  0.4843     0.4966 0.604 0.000 0.396 0.000
#> SRR2314033     2  0.2546     0.7462 0.008 0.900 0.000 0.092
#> SRR2314045     4  0.6371     0.2427 0.300 0.000 0.092 0.608
#> SRR2314042     3  0.5408     0.1150 0.016 0.000 0.576 0.408
#> SRR2314043     2  0.5465     0.4594 0.000 0.588 0.392 0.020
#> SRR2314041     2  0.4564     0.5545 0.000 0.672 0.328 0.000
#> SRR2314044     3  0.4981    -0.2323 0.000 0.464 0.536 0.000
#> SRR2314040     2  0.5460     0.5294 0.000 0.632 0.340 0.028
#> SRR2314039     2  0.7521     0.0477 0.000 0.420 0.396 0.184
#> SRR2314038     3  0.3595     0.3174 0.008 0.084 0.868 0.040
#> SRR2314037     3  0.3764     0.3382 0.000 0.216 0.784 0.000
#> SRR2314036     2  0.2125     0.7491 0.004 0.920 0.000 0.076
#> SRR2314035     2  0.6460     0.4308 0.012 0.548 0.392 0.048
#> SRR2314034     3  0.5376     0.1282 0.016 0.000 0.588 0.396
#> SRR2314032     4  0.6702     0.0269 0.436 0.000 0.088 0.476
#> SRR2314031     4  0.7835     0.0816 0.268 0.000 0.336 0.396
#> SRR2314029     3  0.7207     0.1582 0.008 0.116 0.512 0.364
#> SRR2314030     4  0.3032     0.4269 0.008 0.000 0.124 0.868
#> SRR2314028     3  0.5376     0.1282 0.016 0.000 0.588 0.396
#> SRR2314027     2  0.5465     0.4594 0.000 0.588 0.392 0.020
#> SRR2314026     4  0.3873     0.4180 0.008 0.016 0.144 0.832
#> SRR2314020     2  0.2140     0.7526 0.008 0.932 0.008 0.052
#> SRR2314019     4  0.7218    -0.1582 0.008 0.108 0.436 0.448
#> SRR2314021     4  0.3032     0.4269 0.008 0.000 0.124 0.868
#> SRR2314018     2  0.4697     0.5316 0.000 0.644 0.356 0.000
#> SRR2314017     4  0.8685     0.2595 0.104 0.288 0.124 0.484
#> SRR2314016     4  0.6961     0.1976 0.124 0.000 0.352 0.524
#> SRR2314014     2  0.2125     0.7491 0.004 0.920 0.000 0.076
#> SRR2314013     2  0.2125     0.7491 0.004 0.920 0.000 0.076
#> SRR2314012     4  0.7491     0.2010 0.268 0.000 0.232 0.500
#> SRR2314011     3  0.5141     0.0766 0.268 0.000 0.700 0.032
#> SRR2314010     2  0.0469     0.7642 0.000 0.988 0.012 0.000
#> SRR2314009     2  0.5050     0.4606 0.000 0.588 0.408 0.004
#> SRR2314008     2  0.4713     0.5248 0.000 0.640 0.360 0.000
#> SRR2314007     2  0.6163     0.3713 0.000 0.532 0.416 0.052
#> SRR2314005     2  0.2966     0.7432 0.008 0.896 0.020 0.076
#> SRR2314004     2  0.1807     0.7560 0.008 0.940 0.000 0.052
#> SRR2314003     3  0.5615    -0.0918 0.356 0.000 0.612 0.032
#> SRR2314006     2  0.1807     0.7560 0.008 0.940 0.000 0.052
#> SRR2314002     4  0.7857     0.2033 0.036 0.348 0.120 0.496
#> SRR2314001     2  0.0895     0.7652 0.000 0.976 0.004 0.020
#> SRR2314000     3  0.4543     0.1842 0.000 0.324 0.676 0.000
#> SRR2313998     2  0.0817     0.7639 0.000 0.976 0.024 0.000
#> SRR2313996     2  0.5313     0.4842 0.000 0.608 0.376 0.016
#> SRR2313999     3  0.5141     0.0766 0.268 0.000 0.700 0.032
#> SRR2313997     2  0.2140     0.7526 0.008 0.932 0.008 0.052
#> SRR2313992     3  0.6132     0.0879 0.016 0.376 0.580 0.028
#> SRR2313991     4  0.7339     0.1429 0.004 0.376 0.140 0.480
#> SRR2313990     2  0.1940     0.7486 0.000 0.924 0.076 0.000
#> SRR2313988     4  0.6702     0.0269 0.436 0.000 0.088 0.476
#> SRR2313987     1  0.2408     0.8046 0.896 0.000 0.104 0.000
#> SRR2313984     2  0.1722     0.7573 0.000 0.944 0.008 0.048
#> SRR2313989     2  0.1042     0.7610 0.008 0.972 0.000 0.020
#> SRR2313983     1  0.0592     0.8513 0.984 0.000 0.016 0.000
#> SRR2313986     3  0.5429     0.0836 0.264 0.008 0.696 0.032
#> SRR2313982     1  0.0592     0.8513 0.984 0.000 0.016 0.000
#> SRR2313981     3  0.5597    -0.2134 0.000 0.464 0.516 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
#> SRR2313978     3  0.1082      0.809 0.000 0.008 0.964 0.028 0.000
#> SRR2313980     2  0.3597      0.866 0.000 0.800 0.180 0.008 0.012
#> SRR2313979     1  0.0510      0.859 0.984 0.000 0.000 0.016 0.000
#> SRR2313977     2  0.4726      0.807 0.016 0.684 0.280 0.020 0.000
#> SRR2313976     2  0.1721      0.781 0.016 0.944 0.020 0.000 0.020
#> SRR2313975     4  0.3961      0.497 0.000 0.000 0.016 0.736 0.248
#> SRR2313973     1  0.3578      0.753 0.784 0.000 0.008 0.204 0.004
#> SRR2313974     4  0.0290      0.665 0.000 0.000 0.008 0.992 0.000
#> SRR2313985     1  0.2783      0.812 0.868 0.000 0.004 0.116 0.012
#> SRR2313993     2  0.3530      0.862 0.000 0.784 0.204 0.000 0.012
#> SRR2313994     2  0.1503      0.784 0.008 0.952 0.020 0.000 0.020
#> SRR2313995     3  0.4348      0.659 0.000 0.008 0.744 0.032 0.216
#> SRR2314024     2  0.3705      0.868 0.000 0.788 0.192 0.008 0.012
#> SRR2314015     2  0.4291      0.445 0.000 0.536 0.464 0.000 0.000
#> SRR2314025     4  0.4182      0.350 0.000 0.000 0.000 0.600 0.400
#> SRR2314023     1  0.3756      0.719 0.744 0.000 0.008 0.248 0.000
#> SRR2314033     2  0.1989      0.778 0.016 0.932 0.020 0.000 0.032
#> SRR2314045     5  0.5579      0.243 0.224 0.000 0.012 0.104 0.660
#> SRR2314042     5  0.4702     -0.261 0.000 0.000 0.016 0.432 0.552
#> SRR2314043     3  0.0162      0.809 0.000 0.004 0.996 0.000 0.000
#> SRR2314041     3  0.0290      0.809 0.000 0.008 0.992 0.000 0.000
#> SRR2314044     3  0.0898      0.810 0.000 0.008 0.972 0.020 0.000
#> SRR2314040     3  0.2848      0.724 0.000 0.156 0.840 0.000 0.004
#> SRR2314039     3  0.1356      0.806 0.000 0.004 0.956 0.012 0.028
#> SRR2314038     3  0.4785      0.645 0.000 0.004 0.732 0.088 0.176
#> SRR2314037     3  0.0703      0.810 0.000 0.000 0.976 0.024 0.000
#> SRR2314036     2  0.0898      0.781 0.000 0.972 0.008 0.000 0.020
#> SRR2314035     3  0.4832      0.659 0.080 0.168 0.740 0.000 0.012
#> SRR2314034     4  0.6564      0.239 0.000 0.000 0.224 0.460 0.316
#> SRR2314032     5  0.6075     -0.107 0.444 0.000 0.004 0.104 0.448
#> SRR2314031     5  0.4294     -0.300 0.000 0.000 0.000 0.468 0.532
#> SRR2314029     3  0.4615      0.634 0.000 0.004 0.724 0.052 0.220
#> SRR2314030     5  0.1121      0.288 0.000 0.000 0.000 0.044 0.956
#> SRR2314028     5  0.4727     -0.284 0.000 0.000 0.016 0.452 0.532
#> SRR2314027     3  0.1314      0.807 0.000 0.012 0.960 0.016 0.012
#> SRR2314026     3  0.4976      0.250 0.000 0.000 0.504 0.028 0.468
#> SRR2314020     2  0.3597      0.866 0.000 0.800 0.180 0.008 0.012
#> SRR2314019     3  0.4977      0.604 0.000 0.008 0.684 0.052 0.256
#> SRR2314021     5  0.1121      0.288 0.000 0.000 0.000 0.044 0.956
#> SRR2314018     3  0.1792      0.778 0.000 0.084 0.916 0.000 0.000
#> SRR2314017     5  0.6908      0.067 0.220 0.012 0.324 0.000 0.444
#> SRR2314016     5  0.4291     -0.307 0.000 0.000 0.000 0.464 0.536
#> SRR2314014     2  0.1721      0.781 0.016 0.944 0.020 0.000 0.020
#> SRR2314013     2  0.1721      0.781 0.016 0.944 0.020 0.000 0.020
#> SRR2314012     4  0.4268      0.428 0.000 0.000 0.008 0.648 0.344
#> SRR2314011     4  0.1608      0.657 0.000 0.000 0.000 0.928 0.072
#> SRR2314010     2  0.3534      0.845 0.000 0.744 0.256 0.000 0.000
#> SRR2314009     3  0.0162      0.809 0.000 0.004 0.996 0.000 0.000
#> SRR2314008     3  0.0404      0.808 0.000 0.012 0.988 0.000 0.000
#> SRR2314007     3  0.4514      0.668 0.000 0.016 0.756 0.044 0.184
#> SRR2314005     2  0.2121      0.778 0.016 0.932 0.020 0.012 0.020
#> SRR2314004     2  0.3705      0.868 0.000 0.788 0.192 0.008 0.012
#> SRR2314003     4  0.1168      0.653 0.032 0.000 0.008 0.960 0.000
#> SRR2314006     2  0.3496      0.868 0.000 0.788 0.200 0.000 0.012
#> SRR2314002     3  0.5826      0.229 0.032 0.016 0.496 0.012 0.444
#> SRR2314001     2  0.3628      0.861 0.000 0.772 0.216 0.000 0.012
#> SRR2314000     3  0.0609      0.810 0.000 0.000 0.980 0.020 0.000
#> SRR2313998     2  0.3424      0.856 0.000 0.760 0.240 0.000 0.000
#> SRR2313996     3  0.0798      0.810 0.000 0.008 0.976 0.016 0.000
#> SRR2313999     4  0.0451      0.666 0.000 0.000 0.008 0.988 0.004
#> SRR2313997     2  0.3597      0.866 0.000 0.800 0.180 0.008 0.012
#> SRR2313992     3  0.5588      0.286 0.000 0.000 0.604 0.292 0.104
#> SRR2313991     3  0.5144      0.278 0.000 0.008 0.520 0.024 0.448
#> SRR2313990     3  0.0290      0.809 0.000 0.008 0.992 0.000 0.000
#> SRR2313988     5  0.6075     -0.107 0.444 0.000 0.004 0.104 0.448
#> SRR2313987     1  0.2424      0.817 0.868 0.000 0.000 0.132 0.000
#> SRR2313984     2  0.3671      0.848 0.000 0.756 0.236 0.008 0.000
#> SRR2313989     2  0.4125      0.868 0.012 0.772 0.196 0.008 0.012
#> SRR2313983     1  0.0510      0.859 0.984 0.000 0.000 0.016 0.000
#> SRR2313986     4  0.3508      0.541 0.000 0.000 0.000 0.748 0.252
#> SRR2313982     1  0.0510      0.859 0.984 0.000 0.000 0.016 0.000
#> SRR2313981     3  0.1026      0.808 0.000 0.004 0.968 0.024 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
#> SRR2313978     3  0.5539     0.3994 0.004 0.180 0.652 0.036 0.000 0.128
#> SRR2313980     6  0.3109     0.7879 0.000 0.004 0.224 0.000 0.000 0.772
#> SRR2313979     1  0.2854     0.6427 0.792 0.000 0.000 0.000 0.208 0.000
#> SRR2313977     3  0.4634     0.4300 0.004 0.184 0.708 0.004 0.000 0.100
#> SRR2313976     2  0.3807     0.8680 0.000 0.628 0.004 0.000 0.000 0.368
#> SRR2313975     4  0.7410     0.4288 0.148 0.164 0.192 0.476 0.020 0.000
#> SRR2313973     1  0.3541     0.3517 0.728 0.000 0.000 0.260 0.012 0.000
#> SRR2313974     4  0.7213     0.4585 0.200 0.164 0.000 0.448 0.188 0.000
#> SRR2313985     1  0.3706     0.5342 0.620 0.000 0.000 0.000 0.380 0.000
#> SRR2313993     6  0.5468     0.6395 0.000 0.156 0.296 0.000 0.000 0.548
#> SRR2313994     2  0.3215     0.6948 0.000 0.756 0.004 0.000 0.000 0.240
#> SRR2313995     3  0.6070     0.4178 0.004 0.168 0.564 0.240 0.004 0.020
#> SRR2314024     6  0.3109     0.7879 0.000 0.004 0.224 0.000 0.000 0.772
#> SRR2314015     3  0.5714    -0.2639 0.000 0.168 0.464 0.000 0.000 0.368
#> SRR2314025     4  0.4617     0.5681 0.096 0.016 0.000 0.720 0.168 0.000
#> SRR2314023     1  0.3787     0.3267 0.720 0.012 0.000 0.260 0.008 0.000
#> SRR2314033     2  0.3807     0.8680 0.000 0.628 0.004 0.000 0.000 0.368
#> SRR2314045     5  0.2669     0.4670 0.008 0.000 0.000 0.156 0.836 0.000
#> SRR2314042     4  0.1151     0.5994 0.000 0.000 0.000 0.956 0.012 0.032
#> SRR2314043     3  0.0000     0.6307 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR2314041     3  0.0922     0.6269 0.000 0.024 0.968 0.000 0.004 0.004
#> SRR2314044     3  0.0912     0.6303 0.004 0.012 0.972 0.004 0.000 0.008
#> SRR2314040     3  0.4146     0.4645 0.000 0.232 0.720 0.000 0.040 0.008
#> SRR2314039     3  0.2685     0.6146 0.000 0.004 0.880 0.020 0.080 0.016
#> SRR2314038     3  0.6462     0.2734 0.008 0.020 0.480 0.264 0.000 0.228
#> SRR2314037     3  0.0653     0.6299 0.004 0.012 0.980 0.000 0.000 0.004
#> SRR2314036     2  0.3971     0.7851 0.000 0.548 0.004 0.000 0.000 0.448
#> SRR2314035     3  0.6320    -0.0545 0.000 0.336 0.364 0.000 0.292 0.008
#> SRR2314034     4  0.3243     0.4837 0.008 0.000 0.208 0.780 0.004 0.000
#> SRR2314032     5  0.2491     0.4547 0.164 0.000 0.000 0.000 0.836 0.000
#> SRR2314031     4  0.1390     0.6052 0.004 0.016 0.000 0.948 0.000 0.032
#> SRR2314029     3  0.4267     0.5157 0.004 0.000 0.692 0.260 0.000 0.044
#> SRR2314030     4  0.5475     0.2687 0.000 0.004 0.000 0.588 0.184 0.224
#> SRR2314028     4  0.0363     0.6082 0.000 0.000 0.000 0.988 0.000 0.012
#> SRR2314027     3  0.2482     0.6170 0.000 0.004 0.892 0.012 0.072 0.020
#> SRR2314026     3  0.7161     0.0464 0.000 0.004 0.412 0.080 0.268 0.236
#> SRR2314020     6  0.1082     0.4515 0.000 0.004 0.040 0.000 0.000 0.956
#> SRR2314019     3  0.5432     0.4031 0.000 0.000 0.564 0.344 0.048 0.044
#> SRR2314021     4  0.5475     0.2687 0.000 0.004 0.000 0.588 0.184 0.224
#> SRR2314018     3  0.2994     0.5114 0.000 0.208 0.788 0.000 0.000 0.004
#> SRR2314017     5  0.2805     0.5042 0.000 0.004 0.184 0.000 0.812 0.000
#> SRR2314016     4  0.4864     0.4827 0.000 0.076 0.000 0.680 0.020 0.224
#> SRR2314014     2  0.3899     0.8674 0.000 0.628 0.008 0.000 0.000 0.364
#> SRR2314013     2  0.3236     0.7055 0.000 0.796 0.024 0.000 0.000 0.180
#> SRR2314012     4  0.4613     0.5556 0.116 0.000 0.000 0.688 0.196 0.000
#> SRR2314011     4  0.6695     0.5245 0.112 0.176 0.000 0.528 0.184 0.000
#> SRR2314010     3  0.5461     0.1007 0.000 0.168 0.560 0.000 0.000 0.272
#> SRR2314009     3  0.0363     0.6307 0.000 0.000 0.988 0.000 0.012 0.000
#> SRR2314008     3  0.0692     0.6295 0.000 0.000 0.976 0.000 0.020 0.004
#> SRR2314007     3  0.5778     0.2917 0.000 0.000 0.504 0.268 0.000 0.228
#> SRR2314005     2  0.4022     0.8656 0.004 0.628 0.008 0.000 0.000 0.360
#> SRR2314004     6  0.3109     0.7879 0.000 0.004 0.224 0.000 0.000 0.772
#> SRR2314003     4  0.7223     0.4324 0.232 0.144 0.000 0.436 0.188 0.000
#> SRR2314006     6  0.3163     0.7857 0.000 0.004 0.232 0.000 0.000 0.764
#> SRR2314002     5  0.3592     0.3699 0.000 0.000 0.344 0.000 0.656 0.000
#> SRR2314001     6  0.5588     0.6216 0.000 0.172 0.300 0.000 0.000 0.528
#> SRR2314000     3  0.0508     0.6305 0.004 0.012 0.984 0.000 0.000 0.000
#> SRR2313998     3  0.5737    -0.3824 0.000 0.172 0.460 0.000 0.000 0.368
#> SRR2313996     3  0.5887     0.3859 0.000 0.168 0.624 0.072 0.000 0.136
#> SRR2313999     4  0.7257     0.4604 0.200 0.176 0.000 0.440 0.184 0.000
#> SRR2313997     6  0.3109     0.7858 0.000 0.004 0.224 0.000 0.000 0.772
#> SRR2313992     3  0.4916     0.3957 0.000 0.000 0.620 0.296 0.080 0.004
#> SRR2313991     3  0.7145     0.0663 0.000 0.008 0.368 0.056 0.256 0.312
#> SRR2313990     3  0.2772     0.5269 0.000 0.180 0.816 0.000 0.000 0.004
#> SRR2313988     5  0.2491     0.4547 0.164 0.000 0.000 0.000 0.836 0.000
#> SRR2313987     1  0.3819     0.5392 0.624 0.000 0.000 0.004 0.372 0.000
#> SRR2313984     6  0.4510     0.4679 0.000 0.172 0.084 0.016 0.000 0.728
#> SRR2313989     6  0.4431     0.7033 0.000 0.080 0.228 0.000 0.000 0.692
#> SRR2313983     1  0.2854     0.6427 0.792 0.000 0.000 0.000 0.208 0.000
#> SRR2313986     4  0.3659     0.5943 0.028 0.180 0.000 0.780 0.012 0.000
#> SRR2313982     1  0.2883     0.6410 0.788 0.000 0.000 0.000 0.212 0.000
#> SRR2313981     3  0.1701     0.6204 0.000 0.000 0.920 0.008 0.072 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-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

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 16873 rows and 72 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.945           0.951       0.980         0.5017 0.496   0.496
#> 3 3 0.575           0.751       0.858         0.2647 0.788   0.598
#> 4 4 0.559           0.505       0.722         0.1220 0.842   0.607
#> 5 5 0.583           0.536       0.728         0.0644 0.898   0.685
#> 6 6 0.623           0.530       0.733         0.0554 0.898   0.635

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
#> SRR2313978     2  0.0000     0.9716 0.000 1.000
#> SRR2313980     2  0.0000     0.9716 0.000 1.000
#> SRR2313979     1  0.0000     0.9842 1.000 0.000
#> SRR2313977     2  0.0000     0.9716 0.000 1.000
#> SRR2313976     2  0.0000     0.9716 0.000 1.000
#> SRR2313975     1  0.0000     0.9842 1.000 0.000
#> SRR2313973     1  0.0000     0.9842 1.000 0.000
#> SRR2313974     1  0.0000     0.9842 1.000 0.000
#> SRR2313985     1  0.0000     0.9842 1.000 0.000
#> SRR2313993     2  0.0000     0.9716 0.000 1.000
#> SRR2313994     2  0.0000     0.9716 0.000 1.000
#> SRR2313995     2  0.0000     0.9716 0.000 1.000
#> SRR2314024     2  0.0000     0.9716 0.000 1.000
#> SRR2314015     2  0.0000     0.9716 0.000 1.000
#> SRR2314025     1  0.0000     0.9842 1.000 0.000
#> SRR2314023     1  0.0000     0.9842 1.000 0.000
#> SRR2314033     2  0.0000     0.9716 0.000 1.000
#> SRR2314045     1  0.0000     0.9842 1.000 0.000
#> SRR2314042     1  0.0000     0.9842 1.000 0.000
#> SRR2314043     1  0.1633     0.9639 0.976 0.024
#> SRR2314041     2  0.0000     0.9716 0.000 1.000
#> SRR2314044     2  0.9983     0.0923 0.476 0.524
#> SRR2314040     2  0.4815     0.8807 0.104 0.896
#> SRR2314039     1  0.5946     0.8255 0.856 0.144
#> SRR2314038     1  0.2603     0.9443 0.956 0.044
#> SRR2314037     1  0.0000     0.9842 1.000 0.000
#> SRR2314036     2  0.0000     0.9716 0.000 1.000
#> SRR2314035     1  0.0938     0.9748 0.988 0.012
#> SRR2314034     1  0.0000     0.9842 1.000 0.000
#> SRR2314032     1  0.0000     0.9842 1.000 0.000
#> SRR2314031     1  0.0000     0.9842 1.000 0.000
#> SRR2314029     2  0.2778     0.9343 0.048 0.952
#> SRR2314030     1  0.0000     0.9842 1.000 0.000
#> SRR2314028     1  0.0000     0.9842 1.000 0.000
#> SRR2314027     2  0.0938     0.9636 0.012 0.988
#> SRR2314026     1  0.0376     0.9813 0.996 0.004
#> SRR2314020     2  0.0000     0.9716 0.000 1.000
#> SRR2314019     1  0.0000     0.9842 1.000 0.000
#> SRR2314021     1  0.0000     0.9842 1.000 0.000
#> SRR2314018     1  0.9286     0.4594 0.656 0.344
#> SRR2314017     1  0.0000     0.9842 1.000 0.000
#> SRR2314016     1  0.0000     0.9842 1.000 0.000
#> SRR2314014     2  0.0000     0.9716 0.000 1.000
#> SRR2314013     2  0.0000     0.9716 0.000 1.000
#> SRR2314012     1  0.0000     0.9842 1.000 0.000
#> SRR2314011     1  0.0000     0.9842 1.000 0.000
#> SRR2314010     2  0.0000     0.9716 0.000 1.000
#> SRR2314009     1  0.0000     0.9842 1.000 0.000
#> SRR2314008     2  0.5737     0.8425 0.136 0.864
#> SRR2314007     2  0.0938     0.9636 0.012 0.988
#> SRR2314005     2  0.0000     0.9716 0.000 1.000
#> SRR2314004     2  0.0000     0.9716 0.000 1.000
#> SRR2314003     1  0.0000     0.9842 1.000 0.000
#> SRR2314006     2  0.0000     0.9716 0.000 1.000
#> SRR2314002     1  0.0000     0.9842 1.000 0.000
#> SRR2314001     2  0.0000     0.9716 0.000 1.000
#> SRR2314000     1  0.0376     0.9813 0.996 0.004
#> SRR2313998     2  0.0000     0.9716 0.000 1.000
#> SRR2313996     2  0.0000     0.9716 0.000 1.000
#> SRR2313999     1  0.0000     0.9842 1.000 0.000
#> SRR2313997     2  0.0000     0.9716 0.000 1.000
#> SRR2313992     1  0.0000     0.9842 1.000 0.000
#> SRR2313991     2  0.4690     0.8849 0.100 0.900
#> SRR2313990     2  0.0000     0.9716 0.000 1.000
#> SRR2313988     1  0.0000     0.9842 1.000 0.000
#> SRR2313987     1  0.0000     0.9842 1.000 0.000
#> SRR2313984     2  0.0000     0.9716 0.000 1.000
#> SRR2313989     2  0.0000     0.9716 0.000 1.000
#> SRR2313983     1  0.0000     0.9842 1.000 0.000
#> SRR2313986     1  0.0000     0.9842 1.000 0.000
#> SRR2313982     1  0.0000     0.9842 1.000 0.000
#> SRR2313981     1  0.0000     0.9842 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR2313978     2  0.2165      0.824 0.000 0.936 0.064
#> SRR2313980     3  0.5859      0.641 0.000 0.344 0.656
#> SRR2313979     1  0.0424      0.908 0.992 0.000 0.008
#> SRR2313977     2  0.0000      0.835 0.000 1.000 0.000
#> SRR2313976     2  0.1031      0.834 0.000 0.976 0.024
#> SRR2313975     1  0.0424      0.908 0.992 0.000 0.008
#> SRR2313973     1  0.0424      0.908 0.992 0.000 0.008
#> SRR2313974     1  0.0424      0.908 0.992 0.000 0.008
#> SRR2313985     1  0.0000      0.908 1.000 0.000 0.000
#> SRR2313993     3  0.6280      0.423 0.000 0.460 0.540
#> SRR2313994     2  0.0424      0.834 0.000 0.992 0.008
#> SRR2313995     3  0.4605      0.701 0.000 0.204 0.796
#> SRR2314024     2  0.2625      0.809 0.000 0.916 0.084
#> SRR2314015     2  0.4178      0.693 0.000 0.828 0.172
#> SRR2314025     1  0.3619      0.863 0.864 0.000 0.136
#> SRR2314023     1  0.0592      0.907 0.988 0.000 0.012
#> SRR2314033     2  0.0237      0.835 0.000 0.996 0.004
#> SRR2314045     1  0.3267      0.861 0.884 0.000 0.116
#> SRR2314042     1  0.4504      0.822 0.804 0.000 0.196
#> SRR2314043     1  0.3879      0.782 0.848 0.152 0.000
#> SRR2314041     2  0.0424      0.836 0.000 0.992 0.008
#> SRR2314044     2  0.6264      0.301 0.380 0.616 0.004
#> SRR2314040     2  0.5020      0.681 0.056 0.836 0.108
#> SRR2314039     1  0.8508      0.454 0.608 0.160 0.232
#> SRR2314038     3  0.7205      0.662 0.192 0.100 0.708
#> SRR2314037     1  0.1170      0.905 0.976 0.016 0.008
#> SRR2314036     2  0.1964      0.825 0.000 0.944 0.056
#> SRR2314035     1  0.7496      0.591 0.672 0.240 0.088
#> SRR2314034     1  0.0592      0.908 0.988 0.000 0.012
#> SRR2314032     1  0.2356      0.885 0.928 0.000 0.072
#> SRR2314031     1  0.4002      0.846 0.840 0.000 0.160
#> SRR2314029     3  0.5216      0.691 0.000 0.260 0.740
#> SRR2314030     3  0.3038      0.637 0.104 0.000 0.896
#> SRR2314028     1  0.3116      0.879 0.892 0.000 0.108
#> SRR2314027     3  0.8937      0.504 0.152 0.308 0.540
#> SRR2314026     3  0.5505      0.685 0.088 0.096 0.816
#> SRR2314020     3  0.6204      0.507 0.000 0.424 0.576
#> SRR2314019     1  0.7346      0.502 0.592 0.040 0.368
#> SRR2314021     3  0.3038      0.637 0.104 0.000 0.896
#> SRR2314018     2  0.6952      0.301 0.376 0.600 0.024
#> SRR2314017     1  0.4634      0.816 0.824 0.012 0.164
#> SRR2314016     3  0.6140      0.235 0.404 0.000 0.596
#> SRR2314014     2  0.0424      0.834 0.000 0.992 0.008
#> SRR2314013     2  0.0424      0.834 0.000 0.992 0.008
#> SRR2314012     1  0.3619      0.863 0.864 0.000 0.136
#> SRR2314011     1  0.2537      0.889 0.920 0.000 0.080
#> SRR2314010     2  0.2796      0.801 0.000 0.908 0.092
#> SRR2314009     1  0.1529      0.895 0.960 0.040 0.000
#> SRR2314008     2  0.5905      0.334 0.352 0.648 0.000
#> SRR2314007     3  0.5650      0.667 0.000 0.312 0.688
#> SRR2314005     2  0.0592      0.832 0.000 0.988 0.012
#> SRR2314004     2  0.2537      0.812 0.000 0.920 0.080
#> SRR2314003     1  0.1031      0.907 0.976 0.000 0.024
#> SRR2314006     3  0.5760      0.655 0.000 0.328 0.672
#> SRR2314002     3  0.5656      0.591 0.264 0.008 0.728
#> SRR2314001     2  0.1860      0.828 0.000 0.948 0.052
#> SRR2314000     1  0.4045      0.834 0.872 0.104 0.024
#> SRR2313998     2  0.0424      0.834 0.000 0.992 0.008
#> SRR2313996     2  0.2448      0.814 0.000 0.924 0.076
#> SRR2313999     1  0.0747      0.908 0.984 0.000 0.016
#> SRR2313997     2  0.6008      0.139 0.000 0.628 0.372
#> SRR2313992     1  0.0237      0.908 0.996 0.000 0.004
#> SRR2313991     3  0.4465      0.701 0.004 0.176 0.820
#> SRR2313990     2  0.0747      0.829 0.000 0.984 0.016
#> SRR2313988     1  0.1163      0.903 0.972 0.000 0.028
#> SRR2313987     1  0.0424      0.908 0.992 0.000 0.008
#> SRR2313984     3  0.5859      0.641 0.000 0.344 0.656
#> SRR2313989     2  0.2625      0.809 0.000 0.916 0.084
#> SRR2313983     1  0.0424      0.908 0.992 0.000 0.008
#> SRR2313986     1  0.2165      0.896 0.936 0.000 0.064
#> SRR2313982     1  0.0424      0.908 0.992 0.000 0.008
#> SRR2313981     1  0.1878      0.903 0.952 0.004 0.044

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR2313978     2  0.1406     0.8032 0.000 0.960 0.016 0.024
#> SRR2313980     2  0.4998    -0.0675 0.000 0.512 0.000 0.488
#> SRR2313979     1  0.3688     0.6240 0.792 0.000 0.208 0.000
#> SRR2313977     2  0.0188     0.8047 0.000 0.996 0.004 0.000
#> SRR2313976     2  0.0592     0.8043 0.000 0.984 0.000 0.016
#> SRR2313975     1  0.3907     0.5945 0.768 0.000 0.232 0.000
#> SRR2313973     1  0.0336     0.6909 0.992 0.000 0.008 0.000
#> SRR2313974     1  0.3649     0.6271 0.796 0.000 0.204 0.000
#> SRR2313985     1  0.3726     0.6341 0.788 0.000 0.212 0.000
#> SRR2313993     2  0.4888     0.1840 0.000 0.588 0.000 0.412
#> SRR2313994     2  0.0336     0.8040 0.000 0.992 0.008 0.000
#> SRR2313995     2  0.8649    -0.1538 0.036 0.384 0.248 0.332
#> SRR2314024     2  0.1389     0.7947 0.000 0.952 0.000 0.048
#> SRR2314015     2  0.2408     0.7552 0.000 0.896 0.000 0.104
#> SRR2314025     1  0.5927     0.5091 0.660 0.000 0.264 0.076
#> SRR2314023     1  0.1637     0.6844 0.940 0.000 0.060 0.000
#> SRR2314033     2  0.0336     0.8046 0.000 0.992 0.000 0.008
#> SRR2314045     3  0.4482     0.3242 0.264 0.000 0.728 0.008
#> SRR2314042     3  0.7259     0.1611 0.352 0.000 0.492 0.156
#> SRR2314043     2  0.5147     0.1268 0.460 0.536 0.004 0.000
#> SRR2314041     2  0.1940     0.7692 0.000 0.924 0.076 0.000
#> SRR2314044     2  0.6223     0.1813 0.384 0.556 0.060 0.000
#> SRR2314040     2  0.5846     0.0947 0.032 0.516 0.452 0.000
#> SRR2314039     3  0.7396     0.3252 0.252 0.036 0.596 0.116
#> SRR2314038     4  0.6570     0.2552 0.340 0.072 0.008 0.580
#> SRR2314037     1  0.4274     0.6390 0.808 0.044 0.148 0.000
#> SRR2314036     2  0.1118     0.7997 0.000 0.964 0.000 0.036
#> SRR2314035     3  0.6702     0.3055 0.168 0.216 0.616 0.000
#> SRR2314034     1  0.3813     0.6228 0.828 0.000 0.148 0.024
#> SRR2314032     3  0.5105    -0.0122 0.432 0.000 0.564 0.004
#> SRR2314031     1  0.6967     0.3862 0.580 0.000 0.244 0.176
#> SRR2314029     4  0.9082     0.1057 0.176 0.200 0.144 0.480
#> SRR2314030     4  0.3649     0.4064 0.000 0.000 0.204 0.796
#> SRR2314028     1  0.5933     0.2503 0.552 0.000 0.408 0.040
#> SRR2314027     3  0.7869     0.0733 0.024 0.332 0.492 0.152
#> SRR2314026     3  0.5457    -0.2119 0.008 0.004 0.516 0.472
#> SRR2314020     4  0.4999     0.0415 0.000 0.492 0.000 0.508
#> SRR2314019     3  0.7300     0.2187 0.180 0.000 0.516 0.304
#> SRR2314021     4  0.3681     0.4159 0.008 0.000 0.176 0.816
#> SRR2314018     2  0.5452     0.5546 0.156 0.736 0.108 0.000
#> SRR2314017     3  0.5713     0.3767 0.192 0.004 0.716 0.088
#> SRR2314016     4  0.4391     0.2980 0.252 0.000 0.008 0.740
#> SRR2314014     2  0.0336     0.8037 0.000 0.992 0.008 0.000
#> SRR2314013     2  0.0592     0.8019 0.000 0.984 0.016 0.000
#> SRR2314012     1  0.5528     0.5523 0.700 0.000 0.236 0.064
#> SRR2314011     1  0.3307     0.6699 0.868 0.000 0.104 0.028
#> SRR2314010     2  0.1305     0.7994 0.000 0.960 0.004 0.036
#> SRR2314009     1  0.3400     0.6608 0.872 0.064 0.064 0.000
#> SRR2314008     2  0.1042     0.7982 0.008 0.972 0.020 0.000
#> SRR2314007     4  0.3355     0.4962 0.000 0.160 0.004 0.836
#> SRR2314005     2  0.0336     0.8041 0.000 0.992 0.008 0.000
#> SRR2314004     2  0.1474     0.7925 0.000 0.948 0.000 0.052
#> SRR2314003     1  0.4323     0.6230 0.788 0.000 0.184 0.028
#> SRR2314006     2  0.2973     0.7243 0.000 0.856 0.000 0.144
#> SRR2314002     4  0.6832     0.2716 0.116 0.008 0.272 0.604
#> SRR2314001     2  0.1211     0.7926 0.000 0.960 0.040 0.000
#> SRR2314000     1  0.5837     0.4883 0.668 0.072 0.260 0.000
#> SRR2313998     2  0.0000     0.8045 0.000 1.000 0.000 0.000
#> SRR2313996     2  0.0779     0.8049 0.000 0.980 0.004 0.016
#> SRR2313999     1  0.1004     0.6909 0.972 0.000 0.024 0.004
#> SRR2313997     2  0.4761     0.2825 0.000 0.628 0.000 0.372
#> SRR2313992     1  0.4077     0.6396 0.800 0.004 0.184 0.012
#> SRR2313991     4  0.4010     0.4586 0.000 0.028 0.156 0.816
#> SRR2313990     2  0.0592     0.8018 0.000 0.984 0.016 0.000
#> SRR2313988     1  0.4925     0.2636 0.572 0.000 0.428 0.000
#> SRR2313987     1  0.2704     0.6651 0.876 0.000 0.124 0.000
#> SRR2313984     4  0.4948     0.1913 0.000 0.440 0.000 0.560
#> SRR2313989     2  0.1389     0.7947 0.000 0.952 0.000 0.048
#> SRR2313983     1  0.3688     0.6240 0.792 0.000 0.208 0.000
#> SRR2313986     1  0.3658     0.6546 0.836 0.000 0.144 0.020
#> SRR2313982     1  0.3610     0.6294 0.800 0.000 0.200 0.000
#> SRR2313981     1  0.4844     0.5980 0.748 0.012 0.224 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
#> SRR2313978     2  0.2381     0.8094 0.000 0.908 0.004 0.036 0.052
#> SRR2313980     2  0.3274     0.7115 0.000 0.780 0.000 0.000 0.220
#> SRR2313979     1  0.0912     0.6853 0.972 0.000 0.012 0.016 0.000
#> SRR2313977     2  0.1314     0.8100 0.000 0.960 0.016 0.012 0.012
#> SRR2313976     2  0.0404     0.8117 0.000 0.988 0.000 0.000 0.012
#> SRR2313975     1  0.0451     0.6837 0.988 0.000 0.008 0.004 0.000
#> SRR2313973     1  0.4505     0.3186 0.620 0.000 0.008 0.368 0.004
#> SRR2313974     1  0.0162     0.6851 0.996 0.000 0.000 0.004 0.000
#> SRR2313985     1  0.2304     0.6726 0.908 0.000 0.048 0.044 0.000
#> SRR2313993     2  0.4313     0.4705 0.000 0.636 0.008 0.000 0.356
#> SRR2313994     2  0.0609     0.8090 0.000 0.980 0.020 0.000 0.000
#> SRR2313995     2  0.6661     0.2458 0.000 0.468 0.036 0.396 0.100
#> SRR2314024     2  0.1908     0.7975 0.000 0.908 0.000 0.000 0.092
#> SRR2314015     2  0.2605     0.7728 0.000 0.852 0.000 0.000 0.148
#> SRR2314025     4  0.3197     0.6272 0.152 0.000 0.012 0.832 0.004
#> SRR2314023     1  0.2690     0.6161 0.844 0.000 0.000 0.156 0.000
#> SRR2314033     2  0.0290     0.8116 0.000 0.992 0.000 0.000 0.008
#> SRR2314045     3  0.3314     0.5200 0.124 0.000 0.844 0.012 0.020
#> SRR2314042     4  0.5389     0.0962 0.040 0.000 0.300 0.636 0.024
#> SRR2314043     2  0.4029     0.5979 0.232 0.744 0.024 0.000 0.000
#> SRR2314041     2  0.4915     0.6105 0.000 0.696 0.064 0.236 0.004
#> SRR2314044     2  0.5488     0.5887 0.140 0.708 0.020 0.128 0.004
#> SRR2314040     3  0.4570     0.4885 0.000 0.216 0.732 0.044 0.008
#> SRR2314039     3  0.5194     0.4181 0.000 0.024 0.552 0.412 0.012
#> SRR2314038     5  0.5788     0.4085 0.260 0.056 0.008 0.028 0.648
#> SRR2314037     4  0.6051     0.1922 0.408 0.052 0.024 0.512 0.004
#> SRR2314036     2  0.1671     0.8025 0.000 0.924 0.000 0.000 0.076
#> SRR2314035     3  0.4371     0.5334 0.012 0.140 0.792 0.044 0.012
#> SRR2314034     3  0.6886    -0.1136 0.264 0.000 0.444 0.284 0.008
#> SRR2314032     1  0.4682     0.1771 0.564 0.000 0.420 0.000 0.016
#> SRR2314031     4  0.3595     0.6210 0.140 0.000 0.000 0.816 0.044
#> SRR2314029     2  0.6754     0.1149 0.000 0.404 0.000 0.312 0.284
#> SRR2314030     5  0.4793     0.4215 0.000 0.000 0.260 0.056 0.684
#> SRR2314028     4  0.5486     0.4551 0.100 0.000 0.204 0.680 0.016
#> SRR2314027     3  0.5965     0.4638 0.000 0.080 0.560 0.344 0.016
#> SRR2314026     3  0.4039     0.4502 0.004 0.000 0.776 0.036 0.184
#> SRR2314020     5  0.4126     0.2409 0.000 0.380 0.000 0.000 0.620
#> SRR2314019     3  0.5312     0.5091 0.008 0.000 0.628 0.308 0.056
#> SRR2314021     5  0.4678     0.3825 0.004 0.000 0.300 0.028 0.668
#> SRR2314018     2  0.5383     0.5846 0.008 0.684 0.232 0.064 0.012
#> SRR2314017     3  0.2457     0.5421 0.008 0.000 0.900 0.016 0.076
#> SRR2314016     5  0.6902     0.2821 0.280 0.000 0.068 0.108 0.544
#> SRR2314014     2  0.1059     0.8061 0.000 0.968 0.020 0.008 0.004
#> SRR2314013     2  0.1901     0.7934 0.000 0.932 0.040 0.024 0.004
#> SRR2314012     4  0.5587     0.4541 0.320 0.000 0.072 0.600 0.008
#> SRR2314011     1  0.4557     0.2265 0.584 0.000 0.000 0.404 0.012
#> SRR2314010     2  0.2069     0.8045 0.000 0.912 0.000 0.012 0.076
#> SRR2314009     1  0.8863    -0.2818 0.292 0.208 0.228 0.260 0.012
#> SRR2314008     2  0.4769     0.6324 0.000 0.720 0.216 0.056 0.008
#> SRR2314007     5  0.2977     0.5573 0.000 0.040 0.076 0.008 0.876
#> SRR2314005     2  0.0727     0.8088 0.000 0.980 0.012 0.004 0.004
#> SRR2314004     2  0.2074     0.7923 0.000 0.896 0.000 0.000 0.104
#> SRR2314003     4  0.4318     0.3852 0.348 0.000 0.004 0.644 0.004
#> SRR2314006     2  0.2127     0.7905 0.000 0.892 0.000 0.000 0.108
#> SRR2314002     5  0.5390     0.4497 0.052 0.004 0.284 0.012 0.648
#> SRR2314001     2  0.2966     0.7090 0.000 0.816 0.184 0.000 0.000
#> SRR2314000     1  0.2228     0.6274 0.908 0.076 0.012 0.004 0.000
#> SRR2313998     2  0.0451     0.8113 0.000 0.988 0.004 0.000 0.008
#> SRR2313996     2  0.1095     0.8130 0.000 0.968 0.012 0.008 0.012
#> SRR2313999     1  0.3928     0.4472 0.700 0.000 0.000 0.296 0.004
#> SRR2313997     2  0.3661     0.6282 0.000 0.724 0.000 0.000 0.276
#> SRR2313992     4  0.5104     0.5917 0.224 0.008 0.064 0.700 0.004
#> SRR2313991     5  0.4360     0.5350 0.000 0.032 0.192 0.016 0.760
#> SRR2313990     2  0.2674     0.7780 0.000 0.896 0.060 0.032 0.012
#> SRR2313988     1  0.2886     0.5834 0.844 0.000 0.148 0.008 0.000
#> SRR2313987     1  0.1965     0.6569 0.904 0.000 0.000 0.096 0.000
#> SRR2313984     5  0.4171     0.1927 0.000 0.396 0.000 0.000 0.604
#> SRR2313989     2  0.1965     0.7962 0.000 0.904 0.000 0.000 0.096
#> SRR2313983     1  0.0566     0.6844 0.984 0.000 0.012 0.004 0.000
#> SRR2313986     1  0.4450    -0.0196 0.508 0.000 0.000 0.488 0.004
#> SRR2313982     1  0.1251     0.6847 0.956 0.000 0.008 0.036 0.000
#> SRR2313981     4  0.6900     0.1370 0.136 0.016 0.356 0.480 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
#> SRR2313978     2  0.5595     0.4146 0.000 0.588 0.236 0.164 0.012 0.000
#> SRR2313980     2  0.1901     0.8049 0.000 0.912 0.004 0.008 0.076 0.000
#> SRR2313979     1  0.1334     0.6957 0.948 0.000 0.000 0.032 0.000 0.020
#> SRR2313977     2  0.3489     0.6479 0.000 0.708 0.288 0.000 0.000 0.004
#> SRR2313976     2  0.0603     0.8279 0.000 0.980 0.016 0.000 0.000 0.004
#> SRR2313975     1  0.1074     0.6884 0.960 0.000 0.000 0.028 0.000 0.012
#> SRR2313973     1  0.4551     0.3238 0.608 0.000 0.000 0.344 0.000 0.048
#> SRR2313974     1  0.1757     0.6929 0.916 0.000 0.000 0.076 0.000 0.008
#> SRR2313985     1  0.3227     0.6626 0.828 0.000 0.000 0.088 0.000 0.084
#> SRR2313993     2  0.3938     0.5520 0.000 0.672 0.012 0.004 0.312 0.000
#> SRR2313994     2  0.1958     0.8102 0.000 0.896 0.100 0.000 0.000 0.004
#> SRR2313995     2  0.5163     0.5020 0.000 0.632 0.004 0.112 0.004 0.248
#> SRR2314024     2  0.0603     0.8266 0.000 0.980 0.004 0.000 0.016 0.000
#> SRR2314015     2  0.1858     0.8103 0.000 0.912 0.012 0.000 0.076 0.000
#> SRR2314025     4  0.5290     0.3334 0.116 0.000 0.000 0.544 0.000 0.340
#> SRR2314023     1  0.2994     0.6089 0.788 0.000 0.000 0.208 0.000 0.004
#> SRR2314033     2  0.0858     0.8274 0.000 0.968 0.028 0.000 0.000 0.004
#> SRR2314045     1  0.7915     0.0093 0.352 0.000 0.168 0.068 0.080 0.332
#> SRR2314042     6  0.4538     0.1282 0.028 0.000 0.000 0.364 0.008 0.600
#> SRR2314043     2  0.5384     0.5876 0.116 0.648 0.212 0.000 0.016 0.008
#> SRR2314041     3  0.7166     0.2389 0.000 0.216 0.448 0.136 0.000 0.200
#> SRR2314044     2  0.5160     0.5968 0.024 0.652 0.060 0.256 0.000 0.008
#> SRR2314040     3  0.5151     0.3037 0.000 0.040 0.596 0.016 0.012 0.336
#> SRR2314039     6  0.4537     0.3685 0.000 0.004 0.300 0.040 0.004 0.652
#> SRR2314038     5  0.7306     0.4346 0.088 0.040 0.192 0.140 0.532 0.008
#> SRR2314037     3  0.6064     0.2146 0.056 0.004 0.476 0.396 0.000 0.068
#> SRR2314036     2  0.0146     0.8266 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR2314035     3  0.3657     0.4592 0.000 0.004 0.788 0.012 0.024 0.172
#> SRR2314034     6  0.7321     0.2179 0.256 0.000 0.228 0.076 0.016 0.424
#> SRR2314032     1  0.5404     0.5215 0.720 0.000 0.052 0.080 0.048 0.100
#> SRR2314031     4  0.4402     0.4832 0.084 0.000 0.000 0.700 0.000 0.216
#> SRR2314029     2  0.5578     0.5821 0.000 0.656 0.004 0.192 0.084 0.064
#> SRR2314030     5  0.5216     0.4703 0.012 0.000 0.036 0.032 0.628 0.292
#> SRR2314028     6  0.5401    -0.1036 0.092 0.000 0.012 0.344 0.000 0.552
#> SRR2314027     6  0.4608     0.3994 0.000 0.004 0.264 0.028 0.024 0.680
#> SRR2314026     5  0.5318     0.4253 0.000 0.000 0.076 0.020 0.584 0.320
#> SRR2314020     5  0.4049     0.1734 0.000 0.412 0.004 0.004 0.580 0.000
#> SRR2314019     6  0.3946     0.4294 0.000 0.000 0.152 0.004 0.076 0.768
#> SRR2314021     5  0.2703     0.6157 0.000 0.000 0.016 0.008 0.860 0.116
#> SRR2314018     3  0.1812     0.5453 0.004 0.060 0.924 0.004 0.000 0.008
#> SRR2314017     3  0.6136     0.1836 0.016 0.000 0.540 0.008 0.196 0.240
#> SRR2314016     5  0.6660     0.3538 0.124 0.000 0.052 0.240 0.552 0.032
#> SRR2314014     2  0.2558     0.7811 0.000 0.840 0.156 0.000 0.000 0.004
#> SRR2314013     2  0.2165     0.8075 0.000 0.884 0.108 0.000 0.000 0.008
#> SRR2314012     4  0.6035     0.2647 0.372 0.000 0.000 0.380 0.000 0.248
#> SRR2314011     1  0.4512     0.1555 0.540 0.000 0.004 0.436 0.008 0.012
#> SRR2314010     2  0.1570     0.8287 0.000 0.944 0.028 0.004 0.016 0.008
#> SRR2314009     3  0.3161     0.5242 0.020 0.000 0.852 0.068 0.000 0.060
#> SRR2314008     3  0.2400     0.5368 0.000 0.036 0.908 0.016 0.020 0.020
#> SRR2314007     5  0.0984     0.6301 0.000 0.012 0.008 0.012 0.968 0.000
#> SRR2314005     2  0.2053     0.8088 0.000 0.888 0.108 0.000 0.000 0.004
#> SRR2314004     2  0.1219     0.8161 0.000 0.948 0.004 0.000 0.048 0.000
#> SRR2314003     4  0.4819     0.5104 0.168 0.000 0.076 0.716 0.000 0.040
#> SRR2314006     2  0.1364     0.8176 0.000 0.944 0.000 0.004 0.048 0.004
#> SRR2314002     5  0.3187     0.6295 0.000 0.000 0.112 0.008 0.836 0.044
#> SRR2314001     2  0.4351     0.6808 0.000 0.728 0.196 0.000 0.012 0.064
#> SRR2314000     1  0.3588     0.6082 0.832 0.084 0.052 0.024 0.000 0.008
#> SRR2313998     2  0.0692     0.8278 0.000 0.976 0.020 0.000 0.000 0.004
#> SRR2313996     2  0.2462     0.8005 0.000 0.860 0.132 0.000 0.004 0.004
#> SRR2313999     1  0.5093     0.1170 0.528 0.000 0.084 0.388 0.000 0.000
#> SRR2313997     2  0.2668     0.7342 0.000 0.828 0.004 0.000 0.168 0.000
#> SRR2313992     3  0.6624    -0.0129 0.032 0.000 0.388 0.340 0.000 0.240
#> SRR2313991     5  0.3251     0.6293 0.000 0.000 0.124 0.008 0.828 0.040
#> SRR2313990     3  0.3859     0.3977 0.000 0.288 0.692 0.000 0.000 0.020
#> SRR2313988     1  0.3056     0.6366 0.856 0.000 0.008 0.084 0.004 0.048
#> SRR2313987     1  0.2402     0.6598 0.856 0.000 0.000 0.140 0.000 0.004
#> SRR2313984     5  0.3899     0.3324 0.000 0.364 0.008 0.000 0.628 0.000
#> SRR2313989     2  0.0458     0.8251 0.000 0.984 0.000 0.000 0.016 0.000
#> SRR2313983     1  0.1176     0.6946 0.956 0.000 0.000 0.020 0.000 0.024
#> SRR2313986     4  0.3915     0.4928 0.272 0.000 0.020 0.704 0.000 0.004
#> SRR2313982     1  0.2350     0.6828 0.880 0.000 0.000 0.100 0.000 0.020
#> SRR2313981     3  0.4237     0.4744 0.012 0.000 0.768 0.072 0.008 0.140

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

consensus_heatmap(res, k = 2)

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

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