cola Report for recount2:SRP023262

Date: 2019-12-25 23:37:02 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 15961 rows and 80 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] 15961    80

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:skmeans 2 1.000 0.989 0.994 **
MAD:skmeans 2 1.000 0.983 0.992 **
ATC:kmeans 3 1.000 0.985 0.994 **
ATC:skmeans 2 1.000 0.985 0.995 **
ATC:pam 4 0.988 0.969 0.987 ** 2,3
MAD:pam 6 0.985 0.953 0.980 ** 2,3,5
SD:NMF 3 0.961 0.941 0.976 ** 2
MAD:NMF 3 0.941 0.930 0.972 * 2
SD:pam 6 0.924 0.925 0.970 * 2,3,5
CV:skmeans 2 0.875 0.943 0.973
CV:mclust 2 0.873 0.898 0.961
CV:pam 2 0.849 0.928 0.968
CV:NMF 3 0.780 0.859 0.934
MAD:kmeans 2 0.753 0.894 0.947
ATC:NMF 5 0.626 0.706 0.824
MAD:hclust 3 0.598 0.788 0.907
SD:kmeans 2 0.590 0.869 0.940
ATC:hclust 2 0.583 0.871 0.936
SD:hclust 3 0.580 0.649 0.834
ATC:mclust 4 0.518 0.794 0.840
SD:mclust 2 0.489 0.813 0.887
CV:kmeans 3 0.471 0.802 0.850
MAD:mclust 2 0.432 0.835 0.889
CV:hclust NA NA NA NA

**: 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.921           0.936       0.974          0.504 0.495   0.495
#> CV:NMF      2 0.687           0.813       0.925          0.492 0.497   0.497
#> MAD:NMF     2 0.922           0.932       0.972          0.503 0.495   0.495
#> ATC:NMF     2 0.293           0.574       0.791          0.435 0.596   0.596
#> SD:skmeans  2 1.000           0.989       0.994          0.506 0.495   0.495
#> CV:skmeans  2 0.875           0.943       0.973          0.501 0.495   0.495
#> MAD:skmeans 2 1.000           0.983       0.992          0.506 0.495   0.495
#> ATC:skmeans 2 1.000           0.985       0.995          0.500 0.502   0.502
#> SD:mclust   2 0.489           0.813       0.887          0.479 0.495   0.495
#> CV:mclust   2 0.873           0.898       0.961          0.491 0.505   0.505
#> MAD:mclust  2 0.432           0.835       0.889          0.465 0.499   0.499
#> ATC:mclust  2 0.362           0.644       0.756          0.389 0.676   0.676
#> SD:kmeans   2 0.590           0.869       0.940          0.486 0.499   0.499
#> CV:kmeans   2 0.851           0.855       0.942          0.336 0.633   0.633
#> MAD:kmeans  2 0.753           0.894       0.947          0.494 0.495   0.495
#> ATC:kmeans  2 0.811           0.903       0.956          0.451 0.525   0.525
#> SD:pam      2 1.000           0.987       0.995          0.390 0.608   0.608
#> CV:pam      2 0.849           0.928       0.969          0.457 0.539   0.539
#> MAD:pam     2 1.000           0.994       0.997          0.392 0.608   0.608
#> ATC:pam     2 1.000           0.987       0.993          0.359 0.633   0.633
#> SD:hclust   2 0.337           0.754       0.834          0.410 0.499   0.499
#> CV:hclust   2 0.898           0.953       0.975          0.247 0.724   0.724
#> MAD:hclust  2 0.318           0.530       0.762          0.392 0.494   0.494
#> ATC:hclust  2 0.583           0.871       0.936          0.474 0.514   0.514
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.961           0.941       0.976          0.281 0.784   0.595
#> CV:NMF      3 0.780           0.859       0.934          0.350 0.723   0.497
#> MAD:NMF     3 0.941           0.930       0.972          0.283 0.769   0.571
#> ATC:NMF     3 0.471           0.665       0.835          0.429 0.612   0.430
#> SD:skmeans  3 0.675           0.885       0.904          0.288 0.791   0.603
#> CV:skmeans  3 0.683           0.783       0.864          0.311 0.757   0.553
#> MAD:skmeans 3 0.766           0.896       0.920          0.288 0.791   0.603
#> ATC:skmeans 3 0.840           0.904       0.946          0.169 0.913   0.828
#> SD:mclust   3 0.534           0.787       0.855          0.312 0.848   0.701
#> CV:mclust   3 0.740           0.827       0.914          0.262 0.822   0.670
#> MAD:mclust  3 0.409           0.700       0.807          0.307 0.826   0.665
#> ATC:mclust  3 0.509           0.657       0.822          0.554 0.532   0.369
#> SD:kmeans   3 0.567           0.742       0.822          0.256 0.612   0.403
#> CV:kmeans   3 0.471           0.802       0.850          0.742 0.609   0.444
#> MAD:kmeans  3 0.579           0.754       0.832          0.239 0.638   0.426
#> ATC:kmeans  3 1.000           0.985       0.995          0.353 0.624   0.417
#> SD:pam      3 0.976           0.965       0.986          0.354 0.871   0.788
#> CV:pam      3 0.754           0.878       0.943          0.241 0.867   0.754
#> MAD:pam     3 1.000           0.977       0.990          0.347 0.871   0.788
#> ATC:pam     3 1.000           1.000       1.000          0.680 0.596   0.437
#> SD:hclust   3 0.580           0.649       0.834          0.455 0.611   0.391
#> CV:hclust   3 0.625           0.867       0.945          0.168 0.996   0.995
#> MAD:hclust  3 0.598           0.788       0.907          0.542 0.681   0.468
#> ATC:hclust  3 0.628           0.855       0.928          0.181 0.867   0.751
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.688           0.588       0.809         0.1203 0.942   0.841
#> CV:NMF      4 0.616           0.617       0.814         0.1130 0.869   0.632
#> MAD:NMF     4 0.668           0.579       0.798         0.1172 0.916   0.775
#> ATC:NMF     4 0.551           0.645       0.817         0.1621 0.722   0.401
#> SD:skmeans  4 0.735           0.767       0.860         0.1373 0.861   0.626
#> CV:skmeans  4 0.636           0.672       0.797         0.1147 0.889   0.694
#> MAD:skmeans 4 0.739           0.721       0.851         0.1370 0.868   0.640
#> ATC:skmeans 4 0.844           0.889       0.920         0.0965 0.919   0.809
#> SD:mclust   4 0.414           0.432       0.714         0.0813 0.747   0.434
#> CV:mclust   4 0.647           0.760       0.846         0.1501 0.761   0.464
#> MAD:mclust  4 0.405           0.534       0.701         0.1422 0.726   0.399
#> ATC:mclust  4 0.518           0.794       0.840         0.1341 0.727   0.409
#> SD:kmeans   4 0.634           0.636       0.748         0.1503 0.907   0.780
#> CV:kmeans   4 0.512           0.444       0.705         0.1761 0.911   0.780
#> MAD:kmeans  4 0.644           0.662       0.810         0.1435 0.932   0.835
#> ATC:kmeans  4 0.815           0.884       0.940         0.2005 0.778   0.490
#> SD:pam      4 0.783           0.909       0.945         0.1468 0.912   0.819
#> CV:pam      4 0.750           0.842       0.927         0.0351 0.978   0.948
#> MAD:pam     4 0.803           0.915       0.947         0.1547 0.912   0.819
#> ATC:pam     4 0.988           0.969       0.987         0.2187 0.772   0.487
#> SD:hclust   4 0.612           0.496       0.682         0.1743 0.876   0.714
#> CV:hclust   4 0.569           0.609       0.866         0.5052 0.884   0.839
#> MAD:hclust  4 0.502           0.640       0.791         0.1275 0.938   0.842
#> ATC:hclust  4 0.724           0.812       0.851         0.2836 0.785   0.530
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.726           0.732       0.854         0.0752 0.838   0.534
#> CV:NMF      5 0.672           0.579       0.782         0.0646 0.919   0.705
#> MAD:NMF     5 0.708           0.704       0.844         0.0792 0.857   0.575
#> ATC:NMF     5 0.626           0.706       0.824         0.0884 0.850   0.520
#> SD:skmeans  5 0.734           0.695       0.835         0.0630 0.962   0.852
#> CV:skmeans  5 0.750           0.652       0.818         0.0673 0.924   0.732
#> MAD:skmeans 5 0.759           0.727       0.841         0.0637 0.952   0.814
#> ATC:skmeans 5 0.823           0.866       0.923         0.0633 0.977   0.935
#> SD:mclust   5 0.607           0.709       0.785         0.1269 0.891   0.643
#> CV:mclust   5 0.662           0.625       0.729         0.0601 0.871   0.574
#> MAD:mclust  5 0.635           0.703       0.809         0.0986 0.904   0.684
#> ATC:mclust  5 0.534           0.577       0.740         0.0949 0.815   0.472
#> SD:kmeans   5 0.670           0.664       0.802         0.0948 0.861   0.611
#> CV:kmeans   5 0.538           0.379       0.683         0.0837 0.766   0.444
#> MAD:kmeans  5 0.679           0.723       0.827         0.0998 0.867   0.636
#> ATC:kmeans  5 0.828           0.874       0.908         0.0716 0.845   0.498
#> SD:pam      5 0.964           0.949       0.979         0.0996 0.932   0.833
#> CV:pam      5 0.707           0.796       0.900         0.0732 0.913   0.801
#> MAD:pam     5 0.998           0.960       0.982         0.0951 0.932   0.833
#> ATC:pam     5 0.841           0.825       0.887         0.0679 0.939   0.777
#> SD:hclust   5 0.635           0.634       0.749         0.0610 0.815   0.527
#> CV:hclust   5 0.566           0.651       0.864         0.0339 0.971   0.951
#> MAD:hclust  5 0.618           0.672       0.807         0.1081 0.847   0.582
#> ATC:hclust  5 0.735           0.757       0.862         0.0608 0.917   0.718
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.780           0.732       0.806         0.0475 0.923   0.679
#> CV:NMF      6 0.732           0.606       0.748         0.0357 0.924   0.678
#> MAD:NMF     6 0.768           0.691       0.798         0.0438 0.900   0.603
#> ATC:NMF     6 0.609           0.577       0.722         0.0346 0.932   0.703
#> SD:skmeans  6 0.802           0.756       0.856         0.0381 0.961   0.829
#> CV:skmeans  6 0.770           0.606       0.764         0.0393 0.929   0.696
#> MAD:skmeans 6 0.794           0.700       0.840         0.0397 0.941   0.746
#> ATC:skmeans 6 0.846           0.829       0.917         0.0479 0.959   0.874
#> SD:mclust   6 0.747           0.685       0.781         0.0491 0.880   0.548
#> CV:mclust   6 0.760           0.757       0.850         0.0503 0.916   0.658
#> MAD:mclust  6 0.719           0.590       0.801         0.0539 0.905   0.622
#> ATC:mclust  6 0.653           0.611       0.718         0.0383 0.919   0.677
#> SD:kmeans   6 0.697           0.541       0.770         0.0528 0.972   0.885
#> CV:kmeans   6 0.611           0.544       0.707         0.0534 0.904   0.681
#> MAD:kmeans  6 0.706           0.653       0.795         0.0501 0.948   0.797
#> ATC:kmeans  6 0.856           0.735       0.815         0.0430 0.976   0.889
#> SD:pam      6 0.924           0.925       0.970         0.0669 0.962   0.888
#> CV:pam      6 0.787           0.818       0.890         0.0750 0.965   0.906
#> MAD:pam     6 0.985           0.953       0.980         0.0741 0.951   0.855
#> ATC:pam     6 0.894           0.869       0.919         0.0540 0.903   0.603
#> SD:hclust   6 0.667           0.549       0.726         0.0544 0.832   0.487
#> CV:hclust   6 0.613           0.711       0.888         0.0772 0.973   0.954
#> MAD:hclust  6 0.683           0.711       0.809         0.0377 0.975   0.901
#> ATC:hclust  6 0.743           0.739       0.858         0.0201 0.986   0.938

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 15961 rows and 80 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.337           0.754       0.834         0.4105 0.499   0.499
#> 3 3 0.580           0.649       0.834         0.4551 0.611   0.391
#> 4 4 0.612           0.496       0.682         0.1743 0.876   0.714
#> 5 5 0.635           0.634       0.749         0.0610 0.815   0.527
#> 6 6 0.667           0.549       0.726         0.0544 0.832   0.487

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
#> SRR868806     1   0.917      0.769 0.668 0.332
#> SRR868807     1   0.917      0.769 0.668 0.332
#> SRR868808     1   0.917      0.769 0.668 0.332
#> SRR868809     1   0.917      0.769 0.668 0.332
#> SRR868810     2   0.000      0.853 0.000 1.000
#> SRR868811     2   0.000      0.853 0.000 1.000
#> SRR868812     1   0.917      0.769 0.668 0.332
#> SRR868813     1   0.925      0.757 0.660 0.340
#> SRR868814     1   0.900      0.769 0.684 0.316
#> SRR868815     1   0.900      0.769 0.684 0.316
#> SRR868816     1   0.000      0.665 1.000 0.000
#> SRR868817     1   0.000      0.665 1.000 0.000
#> SRR868818     1   0.000      0.665 1.000 0.000
#> SRR868819     2   0.689      0.760 0.184 0.816
#> SRR868820     2   0.689      0.760 0.184 0.816
#> SRR868821     2   0.689      0.760 0.184 0.816
#> SRR868822     1   0.917      0.769 0.668 0.332
#> SRR868824     1   0.204      0.677 0.968 0.032
#> SRR868823     1   0.242      0.680 0.960 0.040
#> SRR868825     1   0.494      0.700 0.892 0.108
#> SRR868826     1   0.000      0.665 1.000 0.000
#> SRR868827     1   0.909      0.771 0.676 0.324
#> SRR868835     1   0.913      0.771 0.672 0.328
#> SRR868836     1   0.997      0.467 0.532 0.468
#> SRR868837     1   0.981      0.593 0.580 0.420
#> SRR868838     1   0.913      0.771 0.672 0.328
#> SRR868839     2   0.745      0.726 0.212 0.788
#> SRR868840     1   0.917      0.768 0.668 0.332
#> SRR868841     1   0.917      0.768 0.668 0.332
#> SRR868842     2   0.706      0.752 0.192 0.808
#> SRR868843     2   0.760      0.713 0.220 0.780
#> SRR868844     1   0.000      0.665 1.000 0.000
#> SRR868845     2   0.775      0.537 0.228 0.772
#> SRR868846     2   0.706      0.752 0.192 0.808
#> SRR868847     1   0.913      0.771 0.672 0.328
#> SRR868848     1   0.913      0.771 0.672 0.328
#> SRR868849     2   0.689      0.760 0.184 0.816
#> SRR868850     2   0.775      0.537 0.228 0.772
#> SRR868851     2   0.760      0.557 0.220 0.780
#> SRR868852     2   0.680      0.765 0.180 0.820
#> SRR868853     2   0.745      0.726 0.212 0.788
#> SRR868855     2   0.745      0.727 0.212 0.788
#> SRR868856     2   0.000      0.853 0.000 1.000
#> SRR868857     2   0.722      0.743 0.200 0.800
#> SRR868858     2   0.760      0.713 0.220 0.780
#> SRR868874     2   0.000      0.853 0.000 1.000
#> SRR868875     2   0.000      0.853 0.000 1.000
#> SRR868876     2   0.000      0.853 0.000 1.000
#> SRR868877     2   0.000      0.853 0.000 1.000
#> SRR868878     2   0.000      0.853 0.000 1.000
#> SRR868879     2   0.000      0.853 0.000 1.000
#> SRR868880     2   0.000      0.853 0.000 1.000
#> SRR868881     2   0.000      0.853 0.000 1.000
#> SRR868882     2   0.000      0.853 0.000 1.000
#> SRR868883     2   0.000      0.853 0.000 1.000
#> SRR868884     2   0.000      0.853 0.000 1.000
#> SRR868885     2   0.000      0.853 0.000 1.000
#> SRR868829     1   0.917      0.769 0.668 0.332
#> SRR868830     1   0.917      0.769 0.668 0.332
#> SRR868831     1   0.000      0.665 1.000 0.000
#> SRR868828     1   0.000      0.665 1.000 0.000
#> SRR868832     1   0.000      0.665 1.000 0.000
#> SRR868833     1   0.000      0.665 1.000 0.000
#> SRR868834     1   0.998      0.441 0.524 0.476
#> SRR868854     2   0.000      0.853 0.000 1.000
#> SRR868859     2   0.000      0.853 0.000 1.000
#> SRR868860     2   0.000      0.853 0.000 1.000
#> SRR868861     2   0.753      0.720 0.216 0.784
#> SRR868862     2   0.689      0.760 0.184 0.816
#> SRR868863     2   0.000      0.853 0.000 1.000
#> SRR868864     2   0.821      0.639 0.256 0.744
#> SRR868865     2   0.000      0.853 0.000 1.000
#> SRR868866     1   0.917      0.769 0.668 0.332
#> SRR868867     2   0.689      0.760 0.184 0.816
#> SRR868868     1   0.917      0.769 0.668 0.332
#> SRR868869     1   0.917      0.769 0.668 0.332
#> SRR868870     2   0.000      0.853 0.000 1.000
#> SRR868871     2   0.000      0.853 0.000 1.000
#> SRR868873     2   0.000      0.853 0.000 1.000
#> SRR868872     2   0.000      0.853 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
#> SRR868806     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868807     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868808     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868809     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868810     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868811     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868812     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868813     1  0.6299     0.6037 0.524 0.000 0.476
#> SRR868814     3  0.5810    -0.3884 0.336 0.000 0.664
#> SRR868815     3  0.5810    -0.3884 0.336 0.000 0.664
#> SRR868816     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868817     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868818     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868819     1  0.3619     0.0414 0.864 0.136 0.000
#> SRR868820     1  0.3619     0.0414 0.864 0.136 0.000
#> SRR868821     1  0.3619     0.0414 0.864 0.136 0.000
#> SRR868822     1  0.6307     0.5997 0.512 0.000 0.488
#> SRR868824     3  0.9280     0.5722 0.168 0.352 0.480
#> SRR868823     3  0.9358     0.5055 0.192 0.312 0.496
#> SRR868825     3  0.9487     0.3366 0.244 0.260 0.496
#> SRR868826     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868827     1  0.6309     0.5928 0.504 0.000 0.496
#> SRR868835     1  0.6308     0.5967 0.508 0.000 0.492
#> SRR868836     1  0.5882     0.6062 0.652 0.000 0.348
#> SRR868837     1  0.6126     0.6028 0.600 0.000 0.400
#> SRR868838     1  0.6307     0.5997 0.512 0.000 0.488
#> SRR868839     1  0.1919     0.4444 0.956 0.020 0.024
#> SRR868840     1  0.6307     0.5988 0.512 0.000 0.488
#> SRR868841     1  0.6307     0.5988 0.512 0.000 0.488
#> SRR868842     1  0.0237     0.4467 0.996 0.000 0.004
#> SRR868843     1  0.1289     0.4835 0.968 0.000 0.032
#> SRR868844     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868845     1  0.9351     0.1924 0.516 0.256 0.228
#> SRR868846     1  0.0237     0.4467 0.996 0.000 0.004
#> SRR868847     1  0.6308     0.5967 0.508 0.000 0.492
#> SRR868848     1  0.6308     0.5967 0.508 0.000 0.492
#> SRR868849     1  0.0237     0.4330 0.996 0.004 0.000
#> SRR868850     1  0.9351     0.1915 0.516 0.256 0.228
#> SRR868851     1  0.9315     0.1599 0.520 0.260 0.220
#> SRR868852     1  0.1832     0.3823 0.956 0.036 0.008
#> SRR868853     1  0.1919     0.4439 0.956 0.020 0.024
#> SRR868855     1  0.1031     0.4747 0.976 0.000 0.024
#> SRR868856     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868857     1  0.0592     0.4588 0.988 0.000 0.012
#> SRR868858     1  0.1289     0.4835 0.968 0.000 0.032
#> SRR868874     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868875     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868876     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868877     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868878     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868879     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868880     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868881     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868882     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868883     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868884     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868885     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868829     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868830     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868831     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868828     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868832     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868833     3  0.6305     0.7830 0.000 0.484 0.516
#> SRR868834     1  0.5835     0.6066 0.660 0.000 0.340
#> SRR868854     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868859     2  0.6309     0.9815 0.496 0.504 0.000
#> SRR868860     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868861     1  0.1525     0.4789 0.964 0.004 0.032
#> SRR868862     1  0.0237     0.4330 0.996 0.004 0.000
#> SRR868863     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868864     1  0.2261     0.5174 0.932 0.000 0.068
#> SRR868865     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868866     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868867     1  0.0237     0.4330 0.996 0.004 0.000
#> SRR868868     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868869     1  0.6305     0.6022 0.516 0.000 0.484
#> SRR868870     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868871     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868873     2  0.6305     0.9992 0.484 0.516 0.000
#> SRR868872     2  0.6305     0.9992 0.484 0.516 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.0921     0.5506 0.972 0.000 0.000 0.028
#> SRR868807     1  0.0921     0.5506 0.972 0.000 0.000 0.028
#> SRR868808     1  0.0921     0.5506 0.972 0.000 0.000 0.028
#> SRR868809     1  0.0921     0.5506 0.972 0.000 0.000 0.028
#> SRR868810     2  0.0336     0.5632 0.000 0.992 0.000 0.008
#> SRR868811     2  0.4713     0.4185 0.000 0.640 0.000 0.360
#> SRR868812     1  0.0921     0.5506 0.972 0.000 0.000 0.028
#> SRR868813     1  0.1867     0.5277 0.928 0.000 0.000 0.072
#> SRR868814     1  0.7203    -0.0751 0.524 0.000 0.164 0.312
#> SRR868815     1  0.7203    -0.0751 0.524 0.000 0.164 0.312
#> SRR868816     3  0.0000     0.8681 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000     0.8681 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000     0.8681 0.000 0.000 1.000 0.000
#> SRR868819     2  0.7293    -0.2871 0.368 0.476 0.000 0.156
#> SRR868820     2  0.7293    -0.2871 0.368 0.476 0.000 0.156
#> SRR868821     2  0.7293    -0.2871 0.368 0.476 0.000 0.156
#> SRR868822     1  0.0524     0.5564 0.988 0.000 0.004 0.008
#> SRR868824     3  0.4857     0.5946 0.284 0.000 0.700 0.016
#> SRR868823     3  0.5289     0.5159 0.344 0.000 0.636 0.020
#> SRR868825     3  0.5488     0.2949 0.452 0.000 0.532 0.016
#> SRR868826     3  0.0000     0.8681 0.000 0.000 1.000 0.000
#> SRR868827     1  0.3764     0.4228 0.816 0.000 0.012 0.172
#> SRR868835     1  0.1042     0.5506 0.972 0.000 0.008 0.020
#> SRR868836     1  0.3745     0.5493 0.852 0.060 0.000 0.088
#> SRR868837     1  0.3344     0.5558 0.876 0.024 0.008 0.092
#> SRR868838     1  0.5147    -0.0260 0.536 0.000 0.004 0.460
#> SRR868839     1  0.7133     0.4714 0.512 0.344 0.000 0.144
#> SRR868840     1  0.1151     0.5491 0.968 0.000 0.008 0.024
#> SRR868841     1  0.1151     0.5491 0.968 0.000 0.008 0.024
#> SRR868842     1  0.7216     0.4726 0.508 0.336 0.000 0.156
#> SRR868843     1  0.7061     0.4881 0.540 0.312 0.000 0.148
#> SRR868844     3  0.0000     0.8681 0.000 0.000 1.000 0.000
#> SRR868845     4  0.7841     0.9846 0.312 0.284 0.000 0.404
#> SRR868846     1  0.7216     0.4726 0.508 0.336 0.000 0.156
#> SRR868847     1  0.1042     0.5506 0.972 0.000 0.008 0.020
#> SRR868848     1  0.1042     0.5506 0.972 0.000 0.008 0.020
#> SRR868849     1  0.7239     0.4662 0.500 0.344 0.000 0.156
#> SRR868850     4  0.7841     0.9855 0.312 0.284 0.000 0.404
#> SRR868851     4  0.7836     0.9772 0.304 0.288 0.000 0.408
#> SRR868852     1  0.7235     0.4407 0.480 0.372 0.000 0.148
#> SRR868853     1  0.7158     0.4702 0.512 0.340 0.000 0.148
#> SRR868855     1  0.7083     0.4820 0.528 0.328 0.000 0.144
#> SRR868856     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868857     1  0.7169     0.4782 0.516 0.332 0.000 0.152
#> SRR868858     1  0.7061     0.4881 0.540 0.312 0.000 0.148
#> SRR868874     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868875     2  0.0336     0.5632 0.000 0.992 0.000 0.008
#> SRR868876     2  0.0336     0.5642 0.000 0.992 0.000 0.008
#> SRR868877     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868878     2  0.0336     0.5642 0.000 0.992 0.000 0.008
#> SRR868879     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868880     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868881     2  0.0336     0.5632 0.000 0.992 0.000 0.008
#> SRR868882     2  0.0336     0.5632 0.000 0.992 0.000 0.008
#> SRR868883     2  0.0336     0.5632 0.000 0.992 0.000 0.008
#> SRR868884     2  0.0000     0.5641 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0336     0.5632 0.000 0.992 0.000 0.008
#> SRR868829     1  0.4713     0.1866 0.640 0.000 0.000 0.360
#> SRR868830     1  0.4713     0.1866 0.640 0.000 0.000 0.360
#> SRR868831     3  0.0000     0.8681 0.000 0.000 1.000 0.000
#> SRR868828     3  0.0592     0.8604 0.000 0.000 0.984 0.016
#> SRR868832     3  0.0000     0.8681 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000     0.8681 0.000 0.000 1.000 0.000
#> SRR868834     1  0.3894     0.5476 0.844 0.068 0.000 0.088
#> SRR868854     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868859     2  0.4776     0.3934 0.000 0.624 0.000 0.376
#> SRR868860     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868861     1  0.7059     0.4818 0.528 0.332 0.000 0.140
#> SRR868862     1  0.7272     0.4658 0.496 0.344 0.000 0.160
#> SRR868863     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868864     1  0.6765     0.4968 0.576 0.300 0.000 0.124
#> SRR868865     2  0.0000     0.5641 0.000 1.000 0.000 0.000
#> SRR868866     1  0.3801     0.3688 0.780 0.000 0.000 0.220
#> SRR868867     1  0.7304     0.4634 0.492 0.344 0.000 0.164
#> SRR868868     1  0.3801     0.3688 0.780 0.000 0.000 0.220
#> SRR868869     1  0.3801     0.3688 0.780 0.000 0.000 0.220
#> SRR868870     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868871     2  0.0336     0.5642 0.000 0.992 0.000 0.008
#> SRR868873     2  0.4730     0.4170 0.000 0.636 0.000 0.364
#> SRR868872     2  0.0336     0.5642 0.000 0.992 0.000 0.008

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.3807     0.7336 0.748 0.240 0.000 0.000 0.012
#> SRR868807     1  0.3807     0.7336 0.748 0.240 0.000 0.000 0.012
#> SRR868808     1  0.3807     0.7336 0.748 0.240 0.000 0.000 0.012
#> SRR868809     1  0.3807     0.7336 0.748 0.240 0.000 0.000 0.012
#> SRR868810     4  0.5778     0.5683 0.000 0.448 0.000 0.464 0.088
#> SRR868811     4  0.0566     0.6171 0.000 0.004 0.000 0.984 0.012
#> SRR868812     1  0.3807     0.7336 0.748 0.240 0.000 0.000 0.012
#> SRR868813     1  0.5163     0.6906 0.684 0.224 0.000 0.004 0.088
#> SRR868814     5  0.3213     0.8835 0.144 0.004 0.016 0.000 0.836
#> SRR868815     5  0.3213     0.8835 0.144 0.004 0.016 0.000 0.836
#> SRR868816     3  0.0000     0.8353 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000     0.8353 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000     0.8353 0.000 0.000 1.000 0.000 0.000
#> SRR868819     2  0.1493     0.6223 0.028 0.948 0.000 0.000 0.024
#> SRR868820     2  0.1493     0.6223 0.028 0.948 0.000 0.000 0.024
#> SRR868821     2  0.1493     0.6223 0.028 0.948 0.000 0.000 0.024
#> SRR868822     1  0.3730     0.7099 0.712 0.288 0.000 0.000 0.000
#> SRR868824     3  0.5083     0.5518 0.160 0.140 0.700 0.000 0.000
#> SRR868823     3  0.5797     0.4649 0.212 0.156 0.628 0.000 0.004
#> SRR868825     3  0.6206     0.2498 0.296 0.172 0.532 0.000 0.000
#> SRR868826     3  0.0000     0.8353 0.000 0.000 1.000 0.000 0.000
#> SRR868827     1  0.6511     0.3636 0.508 0.204 0.004 0.000 0.284
#> SRR868835     1  0.3942     0.7300 0.728 0.260 0.000 0.000 0.012
#> SRR868836     1  0.4249     0.4260 0.568 0.432 0.000 0.000 0.000
#> SRR868837     1  0.4298     0.5887 0.640 0.352 0.000 0.000 0.008
#> SRR868838     5  0.4138     0.7623 0.384 0.000 0.000 0.000 0.616
#> SRR868839     2  0.3305     0.8576 0.224 0.776 0.000 0.000 0.000
#> SRR868840     1  0.4260     0.7276 0.720 0.256 0.000 0.004 0.020
#> SRR868841     1  0.4260     0.7276 0.720 0.256 0.000 0.004 0.020
#> SRR868842     2  0.3585     0.8677 0.220 0.772 0.000 0.004 0.004
#> SRR868843     2  0.3790     0.8452 0.248 0.744 0.000 0.004 0.004
#> SRR868844     3  0.0000     0.8353 0.000 0.000 1.000 0.000 0.000
#> SRR868845     4  0.5646    -0.0330 0.004 0.064 0.000 0.488 0.444
#> SRR868846     2  0.3585     0.8677 0.220 0.772 0.000 0.004 0.004
#> SRR868847     1  0.3942     0.7300 0.728 0.260 0.000 0.000 0.012
#> SRR868848     1  0.3942     0.7300 0.728 0.260 0.000 0.000 0.012
#> SRR868849     2  0.3522     0.8669 0.212 0.780 0.000 0.004 0.004
#> SRR868850     4  0.5753    -0.0332 0.008 0.064 0.000 0.488 0.440
#> SRR868851     4  0.5637    -0.0130 0.004 0.064 0.000 0.500 0.432
#> SRR868852     2  0.3757     0.8490 0.208 0.772 0.000 0.020 0.000
#> SRR868853     2  0.3461     0.8559 0.224 0.772 0.000 0.004 0.000
#> SRR868855     2  0.4124     0.8562 0.232 0.744 0.000 0.008 0.016
#> SRR868856     4  0.0609     0.6073 0.000 0.000 0.000 0.980 0.020
#> SRR868857     2  0.3491     0.8652 0.228 0.768 0.000 0.004 0.000
#> SRR868858     2  0.3790     0.8452 0.248 0.744 0.000 0.004 0.004
#> SRR868874     4  0.0451     0.6167 0.000 0.008 0.000 0.988 0.004
#> SRR868875     4  0.5778     0.5683 0.000 0.448 0.000 0.464 0.088
#> SRR868876     4  0.5725     0.5758 0.000 0.428 0.000 0.488 0.084
#> SRR868877     4  0.0451     0.6167 0.000 0.008 0.000 0.988 0.004
#> SRR868878     4  0.5725     0.5758 0.000 0.428 0.000 0.488 0.084
#> SRR868879     4  0.0451     0.6167 0.000 0.008 0.000 0.988 0.004
#> SRR868880     4  0.0000     0.6149 0.000 0.000 0.000 1.000 0.000
#> SRR868881     4  0.5778     0.5683 0.000 0.448 0.000 0.464 0.088
#> SRR868882     4  0.5778     0.5683 0.000 0.448 0.000 0.464 0.088
#> SRR868883     4  0.5778     0.5683 0.000 0.448 0.000 0.464 0.088
#> SRR868884     4  0.5694     0.5660 0.000 0.456 0.000 0.464 0.080
#> SRR868885     4  0.5778     0.5683 0.000 0.448 0.000 0.464 0.088
#> SRR868829     1  0.4371    -0.3329 0.644 0.012 0.000 0.000 0.344
#> SRR868830     1  0.4371    -0.3329 0.644 0.012 0.000 0.000 0.344
#> SRR868831     3  0.0000     0.8353 0.000 0.000 1.000 0.000 0.000
#> SRR868828     3  0.2890     0.7207 0.004 0.000 0.836 0.000 0.160
#> SRR868832     3  0.0000     0.8353 0.000 0.000 1.000 0.000 0.000
#> SRR868833     3  0.0000     0.8353 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.4262     0.3975 0.560 0.440 0.000 0.000 0.000
#> SRR868854     4  0.0609     0.6073 0.000 0.000 0.000 0.980 0.020
#> SRR868859     4  0.0880     0.6003 0.000 0.000 0.000 0.968 0.032
#> SRR868860     4  0.0609     0.6073 0.000 0.000 0.000 0.980 0.020
#> SRR868861     2  0.3689     0.8472 0.256 0.740 0.000 0.004 0.000
#> SRR868862     2  0.3616     0.8659 0.224 0.768 0.000 0.004 0.004
#> SRR868863     4  0.0609     0.6073 0.000 0.000 0.000 0.980 0.020
#> SRR868864     2  0.3730     0.7877 0.288 0.712 0.000 0.000 0.000
#> SRR868865     4  0.5694     0.5660 0.000 0.456 0.000 0.464 0.080
#> SRR868866     1  0.1800     0.5816 0.932 0.048 0.000 0.000 0.020
#> SRR868867     2  0.3585     0.8646 0.220 0.772 0.000 0.004 0.004
#> SRR868868     1  0.1800     0.5816 0.932 0.048 0.000 0.000 0.020
#> SRR868869     1  0.1800     0.5816 0.932 0.048 0.000 0.000 0.020
#> SRR868870     4  0.0000     0.6149 0.000 0.000 0.000 1.000 0.000
#> SRR868871     4  0.5725     0.5758 0.000 0.428 0.000 0.488 0.084
#> SRR868873     4  0.0000     0.6149 0.000 0.000 0.000 1.000 0.000
#> SRR868872     4  0.5725     0.5758 0.000 0.428 0.000 0.488 0.084

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     1  0.2655     0.4867 0.884 0.060 0.000 0.000 0.020 0.036
#> SRR868807     1  0.2655     0.4867 0.884 0.060 0.000 0.000 0.020 0.036
#> SRR868808     1  0.2655     0.4867 0.884 0.060 0.000 0.000 0.020 0.036
#> SRR868809     1  0.2655     0.4867 0.884 0.060 0.000 0.000 0.020 0.036
#> SRR868810     2  0.2003     0.9818 0.000 0.884 0.000 0.116 0.000 0.000
#> SRR868811     4  0.2912     0.6324 0.000 0.216 0.000 0.784 0.000 0.000
#> SRR868812     1  0.2859     0.4800 0.872 0.060 0.000 0.000 0.020 0.048
#> SRR868813     1  0.4225     0.4361 0.780 0.056 0.000 0.000 0.108 0.056
#> SRR868814     5  0.0458     0.6860 0.016 0.000 0.000 0.000 0.984 0.000
#> SRR868815     5  0.0458     0.6860 0.016 0.000 0.000 0.000 0.984 0.000
#> SRR868816     3  0.0000     0.8383 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000     0.8383 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000     0.8383 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     6  0.5842     1.0000 0.240 0.272 0.000 0.000 0.000 0.488
#> SRR868820     6  0.5842     1.0000 0.240 0.272 0.000 0.000 0.000 0.488
#> SRR868821     6  0.5842     1.0000 0.240 0.272 0.000 0.000 0.000 0.488
#> SRR868822     1  0.0964     0.5081 0.968 0.016 0.000 0.000 0.004 0.012
#> SRR868824     3  0.3758     0.5630 0.284 0.000 0.700 0.000 0.016 0.000
#> SRR868823     3  0.4238     0.4805 0.344 0.000 0.628 0.000 0.028 0.000
#> SRR868825     3  0.4246     0.3353 0.452 0.000 0.532 0.000 0.016 0.000
#> SRR868826     3  0.0000     0.8383 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868827     1  0.6740    -0.2650 0.456 0.068 0.004 0.000 0.328 0.144
#> SRR868835     1  0.1341     0.5078 0.948 0.000 0.000 0.000 0.028 0.024
#> SRR868836     1  0.2740     0.4484 0.852 0.028 0.000 0.000 0.000 0.120
#> SRR868837     1  0.2807     0.4836 0.868 0.016 0.000 0.000 0.028 0.088
#> SRR868838     5  0.4492     0.7063 0.052 0.020 0.000 0.000 0.712 0.216
#> SRR868839     1  0.5472    -0.1144 0.504 0.132 0.000 0.000 0.000 0.364
#> SRR868840     1  0.1624     0.5062 0.936 0.000 0.000 0.004 0.040 0.020
#> SRR868841     1  0.1624     0.5062 0.936 0.000 0.000 0.004 0.040 0.020
#> SRR868842     1  0.5353    -0.1013 0.500 0.112 0.000 0.000 0.000 0.388
#> SRR868843     1  0.5467    -0.0321 0.528 0.100 0.000 0.004 0.004 0.364
#> SRR868844     3  0.0000     0.8383 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868845     4  0.4933     0.2937 0.000 0.000 0.000 0.504 0.432 0.064
#> SRR868846     1  0.5353    -0.1013 0.500 0.112 0.000 0.000 0.000 0.388
#> SRR868847     1  0.1341     0.5078 0.948 0.000 0.000 0.000 0.028 0.024
#> SRR868848     1  0.1341     0.5078 0.948 0.000 0.000 0.000 0.028 0.024
#> SRR868849     1  0.5418    -0.1296 0.492 0.120 0.000 0.000 0.000 0.388
#> SRR868850     4  0.5060     0.2934 0.004 0.000 0.000 0.504 0.428 0.064
#> SRR868851     4  0.5047     0.3133 0.004 0.000 0.000 0.516 0.416 0.064
#> SRR868852     1  0.5864    -0.2157 0.472 0.156 0.000 0.008 0.000 0.364
#> SRR868853     1  0.5572    -0.1153 0.504 0.128 0.000 0.004 0.000 0.364
#> SRR868855     1  0.5899    -0.0741 0.508 0.108 0.000 0.008 0.016 0.360
#> SRR868856     4  0.0000     0.8394 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868857     1  0.5341    -0.0810 0.508 0.112 0.000 0.000 0.000 0.380
#> SRR868858     1  0.5467    -0.0321 0.528 0.100 0.000 0.004 0.004 0.364
#> SRR868874     4  0.1461     0.8370 0.000 0.044 0.000 0.940 0.000 0.016
#> SRR868875     2  0.2003     0.9818 0.000 0.884 0.000 0.116 0.000 0.000
#> SRR868876     2  0.2664     0.9690 0.000 0.848 0.000 0.136 0.000 0.016
#> SRR868877     4  0.1461     0.8370 0.000 0.044 0.000 0.940 0.000 0.016
#> SRR868878     2  0.2664     0.9690 0.000 0.848 0.000 0.136 0.000 0.016
#> SRR868879     4  0.1461     0.8370 0.000 0.044 0.000 0.940 0.000 0.016
#> SRR868880     4  0.1007     0.8410 0.000 0.044 0.000 0.956 0.000 0.000
#> SRR868881     2  0.2003     0.9818 0.000 0.884 0.000 0.116 0.000 0.000
#> SRR868882     2  0.2003     0.9818 0.000 0.884 0.000 0.116 0.000 0.000
#> SRR868883     2  0.2003     0.9818 0.000 0.884 0.000 0.116 0.000 0.000
#> SRR868884     2  0.2257     0.9799 0.000 0.876 0.000 0.116 0.000 0.008
#> SRR868885     2  0.2003     0.9818 0.000 0.884 0.000 0.116 0.000 0.000
#> SRR868829     5  0.7119     0.6564 0.192 0.096 0.000 0.000 0.380 0.332
#> SRR868830     5  0.7119     0.6564 0.192 0.096 0.000 0.000 0.380 0.332
#> SRR868831     3  0.0000     0.8383 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868828     3  0.2631     0.7133 0.000 0.000 0.820 0.000 0.180 0.000
#> SRR868832     3  0.0000     0.8383 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868833     3  0.0000     0.8383 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     1  0.2858     0.4419 0.844 0.032 0.000 0.000 0.000 0.124
#> SRR868854     4  0.0000     0.8394 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868859     4  0.0363     0.8359 0.000 0.000 0.000 0.988 0.012 0.000
#> SRR868860     4  0.0000     0.8394 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868861     1  0.5379    -0.0757 0.516 0.120 0.000 0.000 0.000 0.364
#> SRR868862     1  0.5428    -0.1392 0.484 0.120 0.000 0.000 0.000 0.396
#> SRR868863     4  0.0000     0.8394 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868864     1  0.5121     0.0390 0.568 0.100 0.000 0.000 0.000 0.332
#> SRR868865     2  0.2257     0.9799 0.000 0.876 0.000 0.116 0.000 0.008
#> SRR868866     1  0.4345     0.1844 0.628 0.016 0.000 0.000 0.012 0.344
#> SRR868867     1  0.5432    -0.1497 0.480 0.120 0.000 0.000 0.000 0.400
#> SRR868868     1  0.4345     0.1844 0.628 0.016 0.000 0.000 0.012 0.344
#> SRR868869     1  0.4345     0.1844 0.628 0.016 0.000 0.000 0.012 0.344
#> SRR868870     4  0.1007     0.8410 0.000 0.044 0.000 0.956 0.000 0.000
#> SRR868871     2  0.2664     0.9690 0.000 0.848 0.000 0.136 0.000 0.016
#> SRR868873     4  0.1007     0.8410 0.000 0.044 0.000 0.956 0.000 0.000
#> SRR868872     2  0.2664     0.9690 0.000 0.848 0.000 0.136 0.000 0.016

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

plot of chunk SD-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.590           0.869       0.940         0.4860 0.499   0.499
#> 3 3 0.567           0.742       0.822         0.2557 0.612   0.403
#> 4 4 0.634           0.636       0.748         0.1503 0.907   0.780
#> 5 5 0.670           0.664       0.802         0.0948 0.861   0.611
#> 6 6 0.697           0.541       0.770         0.0528 0.972   0.885

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
#> SRR868806     1  0.6343     0.8276 0.840 0.160
#> SRR868807     1  0.0000     0.9121 1.000 0.000
#> SRR868808     1  0.9998     0.0767 0.508 0.492
#> SRR868809     1  0.0000     0.9121 1.000 0.000
#> SRR868810     2  0.0000     0.9461 0.000 1.000
#> SRR868811     2  0.0000     0.9461 0.000 1.000
#> SRR868812     1  0.0000     0.9121 1.000 0.000
#> SRR868813     1  0.6343     0.8276 0.840 0.160
#> SRR868814     1  0.0000     0.9121 1.000 0.000
#> SRR868815     1  0.0000     0.9121 1.000 0.000
#> SRR868816     1  0.0000     0.9121 1.000 0.000
#> SRR868817     1  0.0000     0.9121 1.000 0.000
#> SRR868818     1  0.0000     0.9121 1.000 0.000
#> SRR868819     2  0.5519     0.8515 0.128 0.872
#> SRR868820     2  0.9754     0.2779 0.408 0.592
#> SRR868821     2  0.9754     0.2779 0.408 0.592
#> SRR868822     1  0.0000     0.9121 1.000 0.000
#> SRR868824     1  0.0000     0.9121 1.000 0.000
#> SRR868823     1  0.0000     0.9121 1.000 0.000
#> SRR868825     1  0.0000     0.9121 1.000 0.000
#> SRR868826     1  0.0000     0.9121 1.000 0.000
#> SRR868827     1  0.0000     0.9121 1.000 0.000
#> SRR868835     1  0.5408     0.8540 0.876 0.124
#> SRR868836     1  0.5842     0.8436 0.860 0.140
#> SRR868837     1  0.6343     0.8276 0.840 0.160
#> SRR868838     1  0.0000     0.9121 1.000 0.000
#> SRR868839     2  0.1414     0.9383 0.020 0.980
#> SRR868840     1  0.6343     0.8276 0.840 0.160
#> SRR868841     1  0.6343     0.8276 0.840 0.160
#> SRR868842     1  0.9988     0.1242 0.520 0.480
#> SRR868843     2  0.1414     0.9383 0.020 0.980
#> SRR868844     1  0.0000     0.9121 1.000 0.000
#> SRR868845     2  0.0000     0.9461 0.000 1.000
#> SRR868846     2  0.7376     0.7413 0.208 0.792
#> SRR868847     1  0.5408     0.8540 0.876 0.124
#> SRR868848     1  0.6343     0.8276 0.840 0.160
#> SRR868849     2  0.1414     0.9383 0.020 0.980
#> SRR868850     2  0.2043     0.9311 0.032 0.968
#> SRR868851     2  0.0000     0.9461 0.000 1.000
#> SRR868852     2  0.0000     0.9461 0.000 1.000
#> SRR868853     2  0.0938     0.9417 0.012 0.988
#> SRR868855     2  0.5737     0.8425 0.136 0.864
#> SRR868856     2  0.0000     0.9461 0.000 1.000
#> SRR868857     2  0.5519     0.8515 0.128 0.872
#> SRR868858     2  0.1414     0.9383 0.020 0.980
#> SRR868874     2  0.0000     0.9461 0.000 1.000
#> SRR868875     2  0.0000     0.9461 0.000 1.000
#> SRR868876     2  0.0000     0.9461 0.000 1.000
#> SRR868877     2  0.0000     0.9461 0.000 1.000
#> SRR868878     2  0.0000     0.9461 0.000 1.000
#> SRR868879     2  0.0000     0.9461 0.000 1.000
#> SRR868880     2  0.0000     0.9461 0.000 1.000
#> SRR868881     2  0.0000     0.9461 0.000 1.000
#> SRR868882     2  0.0000     0.9461 0.000 1.000
#> SRR868883     2  0.0000     0.9461 0.000 1.000
#> SRR868884     2  0.0000     0.9461 0.000 1.000
#> SRR868885     2  0.0000     0.9461 0.000 1.000
#> SRR868829     1  0.0000     0.9121 1.000 0.000
#> SRR868830     1  0.0376     0.9107 0.996 0.004
#> SRR868831     1  0.0000     0.9121 1.000 0.000
#> SRR868828     1  0.0000     0.9121 1.000 0.000
#> SRR868832     1  0.0000     0.9121 1.000 0.000
#> SRR868833     1  0.0000     0.9121 1.000 0.000
#> SRR868834     1  0.5842     0.8436 0.860 0.140
#> SRR868854     2  0.0000     0.9461 0.000 1.000
#> SRR868859     2  0.0000     0.9461 0.000 1.000
#> SRR868860     2  0.0000     0.9461 0.000 1.000
#> SRR868861     2  0.5737     0.8425 0.136 0.864
#> SRR868862     2  0.1414     0.9383 0.020 0.980
#> SRR868863     2  0.0000     0.9461 0.000 1.000
#> SRR868864     1  0.8909     0.6001 0.692 0.308
#> SRR868865     2  0.0000     0.9461 0.000 1.000
#> SRR868866     2  0.5178     0.8639 0.116 0.884
#> SRR868867     2  0.5294     0.8596 0.120 0.880
#> SRR868868     2  0.5178     0.8639 0.116 0.884
#> SRR868869     1  0.0000     0.9121 1.000 0.000
#> SRR868870     2  0.0000     0.9461 0.000 1.000
#> SRR868871     2  0.0000     0.9461 0.000 1.000
#> SRR868873     2  0.0000     0.9461 0.000 1.000
#> SRR868872     2  0.0000     0.9461 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
#> SRR868806     1  0.4605      0.783 0.796 0.000 0.204
#> SRR868807     1  0.5363      0.749 0.724 0.000 0.276
#> SRR868808     1  0.0892      0.772 0.980 0.000 0.020
#> SRR868809     1  0.5216      0.762 0.740 0.000 0.260
#> SRR868810     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868811     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868812     1  0.5327      0.752 0.728 0.000 0.272
#> SRR868813     1  0.5493      0.775 0.756 0.012 0.232
#> SRR868814     1  0.5919      0.755 0.724 0.016 0.260
#> SRR868815     1  0.6215      0.544 0.572 0.000 0.428
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868819     1  0.0000      0.761 1.000 0.000 0.000
#> SRR868820     1  0.1964      0.783 0.944 0.000 0.056
#> SRR868821     1  0.1964      0.783 0.944 0.000 0.056
#> SRR868822     1  0.5216      0.762 0.740 0.000 0.260
#> SRR868824     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868823     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868825     1  0.6045      0.630 0.620 0.000 0.380
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868827     1  0.5363      0.749 0.724 0.000 0.276
#> SRR868835     1  0.5763      0.767 0.740 0.016 0.244
#> SRR868836     1  0.3686      0.789 0.860 0.000 0.140
#> SRR868837     1  0.5156      0.781 0.776 0.008 0.216
#> SRR868838     1  0.7410      0.570 0.576 0.040 0.384
#> SRR868839     1  0.1753      0.724 0.952 0.048 0.000
#> SRR868840     1  0.5156      0.781 0.776 0.008 0.216
#> SRR868841     1  0.5687      0.777 0.756 0.020 0.224
#> SRR868842     1  0.2384      0.783 0.936 0.008 0.056
#> SRR868843     1  0.0424      0.759 0.992 0.008 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868845     2  0.6045      0.120 0.380 0.620 0.000
#> SRR868846     1  0.1453      0.774 0.968 0.008 0.024
#> SRR868847     1  0.5461      0.770 0.748 0.008 0.244
#> SRR868848     1  0.5774      0.773 0.748 0.020 0.232
#> SRR868849     1  0.6192     -0.221 0.580 0.420 0.000
#> SRR868850     1  0.5517      0.682 0.728 0.268 0.004
#> SRR868851     2  0.6307     -0.252 0.488 0.512 0.000
#> SRR868852     1  0.6302     -0.389 0.520 0.480 0.000
#> SRR868853     1  0.1753      0.724 0.952 0.048 0.000
#> SRR868855     1  0.1877      0.778 0.956 0.012 0.032
#> SRR868856     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868857     1  0.0424      0.759 0.992 0.008 0.000
#> SRR868858     1  0.0424      0.759 0.992 0.008 0.000
#> SRR868874     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868875     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868876     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868877     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868878     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868879     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868880     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868881     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868882     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868883     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868884     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868885     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868829     1  0.5692      0.752 0.724 0.008 0.268
#> SRR868830     1  0.6875      0.757 0.724 0.080 0.196
#> SRR868831     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868834     1  0.4750      0.781 0.784 0.000 0.216
#> SRR868854     1  0.6308      0.264 0.508 0.492 0.000
#> SRR868859     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868860     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868861     1  0.1711      0.777 0.960 0.008 0.032
#> SRR868862     1  0.2796      0.671 0.908 0.092 0.000
#> SRR868863     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868864     1  0.2165      0.784 0.936 0.000 0.064
#> SRR868865     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868866     1  0.5541      0.694 0.740 0.252 0.008
#> SRR868867     1  0.0848      0.765 0.984 0.008 0.008
#> SRR868868     1  0.5541      0.694 0.740 0.252 0.008
#> SRR868869     1  0.6986      0.752 0.724 0.096 0.180
#> SRR868870     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868871     2  0.5291      0.801 0.268 0.732 0.000
#> SRR868873     2  0.0000      0.787 0.000 1.000 0.000
#> SRR868872     2  0.5291      0.801 0.268 0.732 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.2888     0.7770 0.872 0.000 0.004 0.124
#> SRR868807     1  0.3142     0.7744 0.860 0.000 0.008 0.132
#> SRR868808     1  0.2741     0.7832 0.892 0.012 0.000 0.096
#> SRR868809     1  0.3032     0.7758 0.868 0.000 0.008 0.124
#> SRR868810     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868811     2  0.4972    -0.0149 0.000 0.544 0.000 0.456
#> SRR868812     1  0.3300     0.7692 0.848 0.000 0.008 0.144
#> SRR868813     1  0.5150     0.5690 0.596 0.000 0.008 0.396
#> SRR868814     1  0.5212     0.5389 0.572 0.000 0.008 0.420
#> SRR868815     1  0.6366     0.4559 0.512 0.000 0.064 0.424
#> SRR868816     3  0.0657     0.9898 0.012 0.000 0.984 0.004
#> SRR868817     3  0.0657     0.9898 0.012 0.000 0.984 0.004
#> SRR868818     3  0.0657     0.9898 0.012 0.000 0.984 0.004
#> SRR868819     1  0.6624     0.5067 0.612 0.276 0.004 0.108
#> SRR868820     1  0.2922     0.7795 0.884 0.008 0.004 0.104
#> SRR868821     1  0.2922     0.7795 0.884 0.008 0.004 0.104
#> SRR868822     1  0.2918     0.7774 0.876 0.000 0.008 0.116
#> SRR868824     3  0.0804     0.9899 0.012 0.000 0.980 0.008
#> SRR868823     3  0.2060     0.9435 0.016 0.000 0.932 0.052
#> SRR868825     1  0.5550     0.5991 0.692 0.000 0.248 0.060
#> SRR868826     3  0.0657     0.9900 0.012 0.000 0.984 0.004
#> SRR868827     1  0.5050     0.5518 0.588 0.000 0.004 0.408
#> SRR868835     1  0.2714     0.7761 0.884 0.000 0.004 0.112
#> SRR868836     1  0.0188     0.7913 0.996 0.004 0.000 0.000
#> SRR868837     1  0.0779     0.7929 0.980 0.000 0.004 0.016
#> SRR868838     4  0.6257    -0.3687 0.436 0.000 0.056 0.508
#> SRR868839     1  0.4560     0.5274 0.700 0.296 0.000 0.004
#> SRR868840     1  0.1398     0.7931 0.956 0.000 0.004 0.040
#> SRR868841     1  0.3945     0.7062 0.780 0.000 0.004 0.216
#> SRR868842     1  0.0524     0.7902 0.988 0.008 0.000 0.004
#> SRR868843     1  0.1510     0.7901 0.956 0.016 0.000 0.028
#> SRR868844     3  0.0657     0.9900 0.012 0.000 0.984 0.004
#> SRR868845     4  0.3828     0.5999 0.068 0.084 0.000 0.848
#> SRR868846     1  0.0657     0.7895 0.984 0.012 0.000 0.004
#> SRR868847     1  0.1545     0.7921 0.952 0.000 0.008 0.040
#> SRR868848     1  0.2593     0.7757 0.892 0.000 0.004 0.104
#> SRR868849     1  0.5614     0.4387 0.628 0.336 0.000 0.036
#> SRR868850     1  0.4898     0.4478 0.584 0.000 0.000 0.416
#> SRR868851     4  0.4010     0.5808 0.156 0.028 0.000 0.816
#> SRR868852     2  0.5070     0.2316 0.372 0.620 0.000 0.008
#> SRR868853     1  0.5626     0.3645 0.588 0.384 0.000 0.028
#> SRR868855     1  0.1356     0.7912 0.960 0.008 0.000 0.032
#> SRR868856     4  0.4079     0.5997 0.020 0.180 0.000 0.800
#> SRR868857     1  0.0895     0.7881 0.976 0.020 0.000 0.004
#> SRR868858     1  0.1624     0.7893 0.952 0.020 0.000 0.028
#> SRR868874     2  0.5000    -0.1377 0.000 0.500 0.000 0.500
#> SRR868875     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868876     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868877     4  0.5000    -0.0143 0.000 0.500 0.000 0.500
#> SRR868878     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868879     2  0.5000    -0.1377 0.000 0.500 0.000 0.500
#> SRR868880     2  0.5000    -0.1377 0.000 0.500 0.000 0.500
#> SRR868881     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868882     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868883     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868884     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868885     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868829     1  0.5070     0.5413 0.580 0.000 0.004 0.416
#> SRR868830     1  0.5000     0.4162 0.504 0.000 0.000 0.496
#> SRR868831     3  0.0804     0.9899 0.012 0.000 0.980 0.008
#> SRR868828     3  0.0657     0.9900 0.012 0.000 0.984 0.004
#> SRR868832     3  0.0804     0.9899 0.012 0.000 0.980 0.008
#> SRR868833     3  0.0804     0.9899 0.012 0.000 0.980 0.008
#> SRR868834     1  0.0188     0.7916 0.996 0.000 0.004 0.000
#> SRR868854     4  0.3625     0.5721 0.160 0.012 0.000 0.828
#> SRR868859     4  0.4204     0.5954 0.020 0.192 0.000 0.788
#> SRR868860     4  0.5508     0.2490 0.020 0.408 0.000 0.572
#> SRR868861     1  0.2010     0.7804 0.940 0.012 0.008 0.040
#> SRR868862     1  0.5535     0.4879 0.656 0.304 0.000 0.040
#> SRR868863     4  0.4245     0.5923 0.020 0.196 0.000 0.784
#> SRR868864     1  0.0376     0.7918 0.992 0.004 0.000 0.004
#> SRR868865     2  0.0336     0.7463 0.008 0.992 0.000 0.000
#> SRR868866     1  0.4442     0.6673 0.752 0.004 0.008 0.236
#> SRR868867     1  0.2010     0.7804 0.940 0.012 0.008 0.040
#> SRR868868     1  0.4442     0.6673 0.752 0.004 0.008 0.236
#> SRR868869     1  0.4746     0.6584 0.712 0.004 0.008 0.276
#> SRR868870     4  0.5000    -0.0143 0.000 0.500 0.000 0.500
#> SRR868871     2  0.0188     0.7509 0.004 0.996 0.000 0.000
#> SRR868873     2  0.5000    -0.1377 0.000 0.500 0.000 0.500
#> SRR868872     2  0.0188     0.7509 0.004 0.996 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.4969  -0.053483 0.508 0.000 0.004 0.020 0.468
#> SRR868807     5  0.4794   0.099455 0.464 0.000 0.012 0.004 0.520
#> SRR868808     1  0.4610   0.386974 0.676 0.008 0.000 0.020 0.296
#> SRR868809     1  0.4798  -0.090686 0.512 0.000 0.004 0.012 0.472
#> SRR868810     2  0.0579   0.947669 0.008 0.984 0.000 0.000 0.008
#> SRR868811     4  0.4147   0.771582 0.000 0.316 0.000 0.676 0.008
#> SRR868812     5  0.4981   0.298135 0.412 0.000 0.004 0.024 0.560
#> SRR868813     5  0.5036   0.678761 0.200 0.000 0.004 0.092 0.704
#> SRR868814     5  0.4795   0.717574 0.148 0.000 0.008 0.100 0.744
#> SRR868815     5  0.4913   0.715203 0.132 0.000 0.024 0.092 0.752
#> SRR868816     3  0.0898   0.938002 0.000 0.000 0.972 0.020 0.008
#> SRR868817     3  0.0898   0.938002 0.000 0.000 0.972 0.020 0.008
#> SRR868818     3  0.0898   0.938002 0.000 0.000 0.972 0.020 0.008
#> SRR868819     1  0.6126   0.378630 0.628 0.052 0.000 0.076 0.244
#> SRR868820     1  0.5290   0.405228 0.672 0.004 0.004 0.076 0.244
#> SRR868821     1  0.5290   0.405228 0.672 0.004 0.004 0.076 0.244
#> SRR868822     1  0.4341   0.136516 0.592 0.000 0.004 0.000 0.404
#> SRR868824     3  0.1549   0.936967 0.000 0.000 0.944 0.016 0.040
#> SRR868823     3  0.4560   0.541996 0.016 0.000 0.672 0.008 0.304
#> SRR868825     1  0.7040  -0.017900 0.444 0.000 0.256 0.016 0.284
#> SRR868826     3  0.0162   0.942744 0.000 0.000 0.996 0.000 0.004
#> SRR868827     5  0.3723   0.719308 0.152 0.000 0.000 0.044 0.804
#> SRR868835     1  0.4787   0.245970 0.608 0.000 0.000 0.028 0.364
#> SRR868836     1  0.1202   0.676256 0.960 0.004 0.004 0.000 0.032
#> SRR868837     1  0.3111   0.632728 0.840 0.000 0.004 0.012 0.144
#> SRR868838     5  0.4700   0.701294 0.108 0.000 0.012 0.120 0.760
#> SRR868839     1  0.2199   0.657650 0.916 0.060 0.000 0.008 0.016
#> SRR868840     1  0.4095   0.546614 0.752 0.000 0.004 0.024 0.220
#> SRR868841     1  0.5524   0.266002 0.600 0.000 0.004 0.076 0.320
#> SRR868842     1  0.0451   0.676395 0.988 0.000 0.004 0.000 0.008
#> SRR868843     1  0.2694   0.664941 0.888 0.004 0.000 0.032 0.076
#> SRR868844     3  0.0162   0.942744 0.000 0.000 0.996 0.000 0.004
#> SRR868845     4  0.5052   0.617898 0.024 0.040 0.000 0.696 0.240
#> SRR868846     1  0.0613   0.675992 0.984 0.004 0.000 0.004 0.008
#> SRR868847     1  0.3844   0.501756 0.736 0.000 0.004 0.004 0.256
#> SRR868848     1  0.4437   0.383461 0.664 0.000 0.000 0.020 0.316
#> SRR868849     1  0.3309   0.611503 0.852 0.108 0.000 0.016 0.024
#> SRR868850     5  0.6330   0.320099 0.384 0.000 0.000 0.160 0.456
#> SRR868851     4  0.3863   0.734840 0.048 0.024 0.000 0.828 0.100
#> SRR868852     2  0.4721   0.447892 0.316 0.656 0.000 0.012 0.016
#> SRR868853     1  0.3862   0.635424 0.828 0.104 0.000 0.032 0.036
#> SRR868855     1  0.2813   0.664409 0.880 0.004 0.000 0.032 0.084
#> SRR868856     4  0.3847   0.779789 0.016 0.068 0.000 0.828 0.088
#> SRR868857     1  0.0960   0.675307 0.972 0.008 0.000 0.004 0.016
#> SRR868858     1  0.2819   0.665437 0.884 0.008 0.000 0.032 0.076
#> SRR868874     4  0.3816   0.794807 0.000 0.304 0.000 0.696 0.000
#> SRR868875     2  0.0451   0.947013 0.004 0.988 0.000 0.000 0.008
#> SRR868876     2  0.0000   0.947222 0.000 1.000 0.000 0.000 0.000
#> SRR868877     4  0.3816   0.794807 0.000 0.304 0.000 0.696 0.000
#> SRR868878     2  0.0000   0.947222 0.000 1.000 0.000 0.000 0.000
#> SRR868879     4  0.3816   0.794807 0.000 0.304 0.000 0.696 0.000
#> SRR868880     4  0.3774   0.798844 0.000 0.296 0.000 0.704 0.000
#> SRR868881     2  0.0324   0.945958 0.004 0.992 0.000 0.000 0.004
#> SRR868882     2  0.0451   0.947013 0.004 0.988 0.000 0.000 0.008
#> SRR868883     2  0.0579   0.947669 0.008 0.984 0.000 0.000 0.008
#> SRR868884     2  0.0324   0.945958 0.004 0.992 0.000 0.000 0.004
#> SRR868885     2  0.0579   0.947669 0.008 0.984 0.000 0.000 0.008
#> SRR868829     5  0.3821   0.720766 0.148 0.000 0.000 0.052 0.800
#> SRR868830     5  0.4111   0.714691 0.120 0.000 0.000 0.092 0.788
#> SRR868831     3  0.1549   0.936967 0.000 0.000 0.944 0.016 0.040
#> SRR868828     3  0.0162   0.942744 0.000 0.000 0.996 0.000 0.004
#> SRR868832     3  0.1469   0.938282 0.000 0.000 0.948 0.016 0.036
#> SRR868833     3  0.1469   0.938282 0.000 0.000 0.948 0.016 0.036
#> SRR868834     1  0.1041   0.675626 0.964 0.000 0.004 0.000 0.032
#> SRR868854     4  0.3910   0.716862 0.040 0.012 0.000 0.808 0.140
#> SRR868859     4  0.3908   0.781961 0.016 0.072 0.000 0.824 0.088
#> SRR868860     4  0.4048   0.802972 0.016 0.208 0.000 0.764 0.012
#> SRR868861     1  0.3130   0.632402 0.856 0.000 0.000 0.048 0.096
#> SRR868862     1  0.2941   0.637500 0.884 0.064 0.000 0.020 0.032
#> SRR868863     4  0.3913   0.786676 0.016 0.080 0.000 0.824 0.080
#> SRR868864     1  0.2392   0.660601 0.888 0.000 0.004 0.004 0.104
#> SRR868865     2  0.0451   0.942645 0.008 0.988 0.000 0.000 0.004
#> SRR868866     1  0.5122   0.464801 0.688 0.000 0.000 0.112 0.200
#> SRR868867     1  0.2843   0.629344 0.876 0.000 0.000 0.048 0.076
#> SRR868868     1  0.5122   0.464801 0.688 0.000 0.000 0.112 0.200
#> SRR868869     5  0.5889   0.000326 0.428 0.000 0.000 0.100 0.472
#> SRR868870     4  0.3774   0.798844 0.000 0.296 0.000 0.704 0.000
#> SRR868871     2  0.0324   0.947733 0.004 0.992 0.000 0.000 0.004
#> SRR868873     4  0.3774   0.798844 0.000 0.296 0.000 0.704 0.000
#> SRR868872     2  0.0000   0.947222 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     5  0.4905     0.1430 0.408 0.000 0.000 0.000 0.528 0.064
#> SRR868807     5  0.5004     0.2686 0.348 0.000 0.004 0.000 0.576 0.072
#> SRR868808     1  0.5216    -0.0441 0.484 0.000 0.000 0.000 0.424 0.092
#> SRR868809     5  0.5325     0.2071 0.392 0.000 0.000 0.000 0.500 0.108
#> SRR868810     2  0.1010     0.9425 0.000 0.960 0.000 0.000 0.004 0.036
#> SRR868811     4  0.4013     0.7791 0.000 0.228 0.000 0.728 0.004 0.040
#> SRR868812     5  0.5030     0.4000 0.268 0.000 0.000 0.000 0.616 0.116
#> SRR868813     5  0.4169     0.5285 0.080 0.000 0.000 0.056 0.788 0.076
#> SRR868814     5  0.5150     0.5136 0.056 0.000 0.000 0.108 0.700 0.136
#> SRR868815     5  0.5188     0.5117 0.052 0.000 0.004 0.104 0.704 0.136
#> SRR868816     3  0.0520     0.9041 0.000 0.000 0.984 0.000 0.008 0.008
#> SRR868817     3  0.0520     0.9041 0.000 0.000 0.984 0.000 0.008 0.008
#> SRR868818     3  0.0520     0.9041 0.000 0.000 0.984 0.000 0.008 0.008
#> SRR868819     1  0.6766     0.0408 0.424 0.024 0.000 0.012 0.252 0.288
#> SRR868820     1  0.6243     0.0729 0.448 0.000 0.000 0.012 0.252 0.288
#> SRR868821     1  0.6243     0.0729 0.448 0.000 0.000 0.012 0.252 0.288
#> SRR868822     1  0.4783    -0.0365 0.520 0.000 0.000 0.000 0.428 0.052
#> SRR868824     3  0.3095     0.8778 0.000 0.000 0.840 0.008 0.036 0.116
#> SRR868823     3  0.5561     0.5586 0.012 0.000 0.604 0.008 0.260 0.116
#> SRR868825     1  0.7607    -0.1507 0.384 0.000 0.228 0.008 0.236 0.144
#> SRR868826     3  0.0291     0.9043 0.000 0.000 0.992 0.000 0.004 0.004
#> SRR868827     5  0.4914     0.5012 0.060 0.000 0.000 0.056 0.708 0.176
#> SRR868835     1  0.5745     0.1369 0.612 0.000 0.000 0.036 0.196 0.156
#> SRR868836     1  0.1765     0.4850 0.924 0.000 0.000 0.000 0.024 0.052
#> SRR868837     1  0.3590     0.4750 0.800 0.000 0.000 0.020 0.152 0.028
#> SRR868838     5  0.5865     0.4368 0.036 0.000 0.000 0.124 0.572 0.268
#> SRR868839     1  0.1982     0.5024 0.924 0.020 0.000 0.004 0.012 0.040
#> SRR868840     1  0.4600     0.4141 0.708 0.000 0.000 0.024 0.212 0.056
#> SRR868841     1  0.5565     0.2797 0.608 0.000 0.000 0.048 0.268 0.076
#> SRR868842     1  0.0858     0.4919 0.968 0.000 0.000 0.000 0.004 0.028
#> SRR868843     1  0.3703     0.5101 0.820 0.004 0.000 0.036 0.100 0.040
#> SRR868844     3  0.0291     0.9043 0.000 0.000 0.992 0.000 0.004 0.004
#> SRR868845     4  0.5628     0.4410 0.020 0.012 0.000 0.628 0.224 0.116
#> SRR868846     1  0.0858     0.4919 0.968 0.000 0.000 0.000 0.004 0.028
#> SRR868847     1  0.4015     0.4280 0.744 0.000 0.000 0.012 0.208 0.036
#> SRR868848     1  0.5159     0.3068 0.672 0.000 0.000 0.028 0.192 0.108
#> SRR868849     1  0.4169     0.2802 0.744 0.080 0.000 0.000 0.004 0.172
#> SRR868850     5  0.7155     0.0373 0.312 0.000 0.000 0.184 0.396 0.108
#> SRR868851     4  0.2316     0.7529 0.020 0.004 0.000 0.908 0.024 0.044
#> SRR868852     2  0.4685     0.4953 0.240 0.692 0.000 0.016 0.008 0.044
#> SRR868853     1  0.4711     0.4856 0.772 0.060 0.000 0.036 0.080 0.052
#> SRR868855     1  0.3058     0.5060 0.848 0.000 0.000 0.036 0.104 0.012
#> SRR868856     4  0.2360     0.7665 0.008 0.020 0.000 0.908 0.024 0.040
#> SRR868857     1  0.1555     0.5065 0.940 0.008 0.000 0.000 0.012 0.040
#> SRR868858     1  0.3703     0.5101 0.820 0.004 0.000 0.036 0.100 0.040
#> SRR868874     4  0.3404     0.8020 0.000 0.224 0.000 0.760 0.000 0.016
#> SRR868875     2  0.1226     0.9398 0.000 0.952 0.000 0.004 0.004 0.040
#> SRR868876     2  0.0405     0.9411 0.000 0.988 0.000 0.004 0.000 0.008
#> SRR868877     4  0.3404     0.8020 0.000 0.224 0.000 0.760 0.000 0.016
#> SRR868878     2  0.0405     0.9411 0.000 0.988 0.000 0.004 0.000 0.008
#> SRR868879     4  0.3404     0.8020 0.000 0.224 0.000 0.760 0.000 0.016
#> SRR868880     4  0.3073     0.8144 0.000 0.204 0.000 0.788 0.000 0.008
#> SRR868881     2  0.0777     0.9399 0.000 0.972 0.000 0.000 0.004 0.024
#> SRR868882     2  0.0935     0.9422 0.000 0.964 0.000 0.000 0.004 0.032
#> SRR868883     2  0.1010     0.9425 0.000 0.960 0.000 0.000 0.004 0.036
#> SRR868884     2  0.0458     0.9379 0.000 0.984 0.000 0.000 0.000 0.016
#> SRR868885     2  0.1082     0.9422 0.000 0.956 0.000 0.000 0.004 0.040
#> SRR868829     5  0.4852     0.4983 0.048 0.000 0.000 0.064 0.712 0.176
#> SRR868830     5  0.5209     0.4946 0.048 0.000 0.000 0.096 0.684 0.172
#> SRR868831     3  0.2949     0.8820 0.000 0.000 0.848 0.008 0.028 0.116
#> SRR868828     3  0.0622     0.9014 0.000 0.000 0.980 0.000 0.008 0.012
#> SRR868832     3  0.2904     0.8855 0.000 0.000 0.852 0.008 0.028 0.112
#> SRR868833     3  0.2904     0.8855 0.000 0.000 0.852 0.008 0.028 0.112
#> SRR868834     1  0.1297     0.4896 0.948 0.000 0.000 0.000 0.012 0.040
#> SRR868854     4  0.2964     0.7150 0.020 0.000 0.000 0.856 0.024 0.100
#> SRR868859     4  0.2598     0.7689 0.008 0.024 0.000 0.896 0.032 0.040
#> SRR868860     4  0.2935     0.8044 0.004 0.112 0.000 0.852 0.004 0.028
#> SRR868861     1  0.3636    -0.0334 0.676 0.000 0.000 0.000 0.004 0.320
#> SRR868862     1  0.3916     0.2883 0.752 0.064 0.000 0.000 0.000 0.184
#> SRR868863     4  0.2443     0.7691 0.008 0.024 0.000 0.904 0.024 0.040
#> SRR868864     1  0.2971     0.5148 0.848 0.000 0.000 0.012 0.116 0.024
#> SRR868865     2  0.1003     0.9227 0.020 0.964 0.000 0.000 0.000 0.016
#> SRR868866     1  0.5660    -0.5858 0.492 0.000 0.000 0.048 0.052 0.408
#> SRR868867     1  0.3515    -0.0293 0.676 0.000 0.000 0.000 0.000 0.324
#> SRR868868     1  0.5660    -0.5858 0.492 0.000 0.000 0.048 0.052 0.408
#> SRR868869     6  0.6223     0.0000 0.324 0.000 0.000 0.048 0.124 0.504
#> SRR868870     4  0.3073     0.8144 0.000 0.204 0.000 0.788 0.000 0.008
#> SRR868871     2  0.0935     0.9414 0.000 0.964 0.000 0.004 0.000 0.032
#> SRR868873     4  0.3103     0.8129 0.000 0.208 0.000 0.784 0.000 0.008
#> SRR868872     2  0.0405     0.9411 0.000 0.988 0.000 0.004 0.000 0.008

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

plot of chunk SD-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.989       0.994         0.5058 0.495   0.495
#> 3 3 0.675           0.885       0.904         0.2877 0.791   0.603
#> 4 4 0.735           0.767       0.860         0.1373 0.861   0.626
#> 5 5 0.734           0.695       0.835         0.0630 0.962   0.852
#> 6 6 0.802           0.756       0.856         0.0381 0.961   0.829

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
#> SRR868806     1  0.0000      1.000 1.000 0.000
#> SRR868807     1  0.0000      1.000 1.000 0.000
#> SRR868808     1  0.0000      1.000 1.000 0.000
#> SRR868809     1  0.0000      1.000 1.000 0.000
#> SRR868810     2  0.0000      0.989 0.000 1.000
#> SRR868811     2  0.0000      0.989 0.000 1.000
#> SRR868812     1  0.0000      1.000 1.000 0.000
#> SRR868813     1  0.0000      1.000 1.000 0.000
#> SRR868814     1  0.0000      1.000 1.000 0.000
#> SRR868815     1  0.0000      1.000 1.000 0.000
#> SRR868816     1  0.0000      1.000 1.000 0.000
#> SRR868817     1  0.0000      1.000 1.000 0.000
#> SRR868818     1  0.0000      1.000 1.000 0.000
#> SRR868819     2  0.3431      0.930 0.064 0.936
#> SRR868820     1  0.0000      1.000 1.000 0.000
#> SRR868821     1  0.0000      1.000 1.000 0.000
#> SRR868822     1  0.0000      1.000 1.000 0.000
#> SRR868824     1  0.0000      1.000 1.000 0.000
#> SRR868823     1  0.0000      1.000 1.000 0.000
#> SRR868825     1  0.0000      1.000 1.000 0.000
#> SRR868826     1  0.0000      1.000 1.000 0.000
#> SRR868827     1  0.0000      1.000 1.000 0.000
#> SRR868835     1  0.0000      1.000 1.000 0.000
#> SRR868836     1  0.0000      1.000 1.000 0.000
#> SRR868837     1  0.0000      1.000 1.000 0.000
#> SRR868838     1  0.0000      1.000 1.000 0.000
#> SRR868839     2  0.0000      0.989 0.000 1.000
#> SRR868840     1  0.0000      1.000 1.000 0.000
#> SRR868841     1  0.0000      1.000 1.000 0.000
#> SRR868842     1  0.0000      1.000 1.000 0.000
#> SRR868843     2  0.0000      0.989 0.000 1.000
#> SRR868844     1  0.0000      1.000 1.000 0.000
#> SRR868845     2  0.0000      0.989 0.000 1.000
#> SRR868846     2  0.7219      0.760 0.200 0.800
#> SRR868847     1  0.0000      1.000 1.000 0.000
#> SRR868848     1  0.0000      1.000 1.000 0.000
#> SRR868849     2  0.0000      0.989 0.000 1.000
#> SRR868850     2  0.1633      0.969 0.024 0.976
#> SRR868851     2  0.0000      0.989 0.000 1.000
#> SRR868852     2  0.0000      0.989 0.000 1.000
#> SRR868853     2  0.0000      0.989 0.000 1.000
#> SRR868855     2  0.0938      0.980 0.012 0.988
#> SRR868856     2  0.0000      0.989 0.000 1.000
#> SRR868857     2  0.5737      0.848 0.136 0.864
#> SRR868858     2  0.0000      0.989 0.000 1.000
#> SRR868874     2  0.0000      0.989 0.000 1.000
#> SRR868875     2  0.0000      0.989 0.000 1.000
#> SRR868876     2  0.0000      0.989 0.000 1.000
#> SRR868877     2  0.0000      0.989 0.000 1.000
#> SRR868878     2  0.0000      0.989 0.000 1.000
#> SRR868879     2  0.0000      0.989 0.000 1.000
#> SRR868880     2  0.0000      0.989 0.000 1.000
#> SRR868881     2  0.0000      0.989 0.000 1.000
#> SRR868882     2  0.0000      0.989 0.000 1.000
#> SRR868883     2  0.0000      0.989 0.000 1.000
#> SRR868884     2  0.0000      0.989 0.000 1.000
#> SRR868885     2  0.0000      0.989 0.000 1.000
#> SRR868829     1  0.0000      1.000 1.000 0.000
#> SRR868830     1  0.0000      1.000 1.000 0.000
#> SRR868831     1  0.0000      1.000 1.000 0.000
#> SRR868828     1  0.0000      1.000 1.000 0.000
#> SRR868832     1  0.0000      1.000 1.000 0.000
#> SRR868833     1  0.0000      1.000 1.000 0.000
#> SRR868834     1  0.0000      1.000 1.000 0.000
#> SRR868854     2  0.0000      0.989 0.000 1.000
#> SRR868859     2  0.0000      0.989 0.000 1.000
#> SRR868860     2  0.0000      0.989 0.000 1.000
#> SRR868861     2  0.0672      0.983 0.008 0.992
#> SRR868862     2  0.0000      0.989 0.000 1.000
#> SRR868863     2  0.0000      0.989 0.000 1.000
#> SRR868864     1  0.0000      1.000 1.000 0.000
#> SRR868865     2  0.0000      0.989 0.000 1.000
#> SRR868866     2  0.0000      0.989 0.000 1.000
#> SRR868867     2  0.0000      0.989 0.000 1.000
#> SRR868868     2  0.0000      0.989 0.000 1.000
#> SRR868869     1  0.0000      1.000 1.000 0.000
#> SRR868870     2  0.0000      0.989 0.000 1.000
#> SRR868871     2  0.0000      0.989 0.000 1.000
#> SRR868873     2  0.0000      0.989 0.000 1.000
#> SRR868872     2  0.0000      0.989 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> SRR868806     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868807     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868808     1  0.5201      0.697 0.760 0.004 0.236
#> SRR868809     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868810     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868811     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868812     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868813     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868814     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868815     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868816     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868817     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868818     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868819     1  0.3482      0.841 0.872 0.128 0.000
#> SRR868820     1  0.7800      0.681 0.668 0.128 0.204
#> SRR868821     1  0.7800      0.681 0.668 0.128 0.204
#> SRR868822     3  0.0237      0.944 0.000 0.004 0.996
#> SRR868824     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868823     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868825     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868826     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868827     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868835     3  0.3038      0.903 0.000 0.104 0.896
#> SRR868836     3  0.4931      0.798 0.000 0.232 0.768
#> SRR868837     3  0.3038      0.903 0.000 0.104 0.896
#> SRR868838     3  0.4452      0.762 0.000 0.192 0.808
#> SRR868839     1  0.3551      0.840 0.868 0.132 0.000
#> SRR868840     3  0.3038      0.903 0.000 0.104 0.896
#> SRR868841     3  0.3038      0.903 0.000 0.104 0.896
#> SRR868842     1  0.8901      0.583 0.572 0.232 0.196
#> SRR868843     1  0.0237      0.875 0.996 0.004 0.000
#> SRR868844     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868845     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868846     1  0.4931      0.772 0.768 0.232 0.000
#> SRR868847     3  0.3038      0.903 0.000 0.104 0.896
#> SRR868848     3  0.3038      0.903 0.000 0.104 0.896
#> SRR868849     1  0.3551      0.840 0.868 0.132 0.000
#> SRR868850     2  0.5115      0.959 0.228 0.768 0.004
#> SRR868851     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868852     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868853     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868855     1  0.3120      0.807 0.908 0.012 0.080
#> SRR868856     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868857     1  0.3619      0.838 0.864 0.136 0.000
#> SRR868858     1  0.0237      0.875 0.996 0.004 0.000
#> SRR868874     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868875     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868876     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868877     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868878     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868879     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868880     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868881     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868882     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868883     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868884     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868885     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868829     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868830     3  0.4504      0.757 0.000 0.196 0.804
#> SRR868831     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868828     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868832     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868833     3  0.0000      0.946 0.000 0.000 1.000
#> SRR868834     3  0.4931      0.798 0.000 0.232 0.768
#> SRR868854     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868859     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868860     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868861     1  0.5016      0.770 0.760 0.240 0.000
#> SRR868862     1  0.3551      0.840 0.868 0.132 0.000
#> SRR868863     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868864     3  0.3618      0.897 0.012 0.104 0.884
#> SRR868865     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868866     2  0.0000      0.730 0.000 1.000 0.000
#> SRR868867     1  0.4931      0.772 0.768 0.232 0.000
#> SRR868868     2  0.0000      0.730 0.000 1.000 0.000
#> SRR868869     3  0.5560      0.701 0.000 0.300 0.700
#> SRR868870     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868871     1  0.0000      0.875 1.000 0.000 0.000
#> SRR868873     2  0.4931      0.964 0.232 0.768 0.000
#> SRR868872     1  0.0000      0.875 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
#> SRR868806     3  0.3134     0.8636 0.100 0.008 0.880 0.012
#> SRR868807     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868808     2  0.5547     0.6476 0.100 0.752 0.136 0.012
#> SRR868809     3  0.0524     0.9240 0.008 0.004 0.988 0.000
#> SRR868810     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868811     4  0.1118     0.9704 0.000 0.036 0.000 0.964
#> SRR868812     3  0.2546     0.8756 0.092 0.008 0.900 0.000
#> SRR868813     3  0.3257     0.8603 0.108 0.008 0.872 0.012
#> SRR868814     3  0.3113     0.8637 0.108 0.004 0.876 0.012
#> SRR868815     3  0.1474     0.9097 0.052 0.000 0.948 0.000
#> SRR868816     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868819     2  0.5300     0.5250 0.408 0.580 0.000 0.012
#> SRR868820     2  0.6699     0.4426 0.412 0.516 0.060 0.012
#> SRR868821     2  0.6699     0.4426 0.412 0.516 0.060 0.012
#> SRR868822     3  0.3311     0.7066 0.172 0.000 0.828 0.000
#> SRR868824     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868823     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868825     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868826     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868827     3  0.2011     0.8919 0.080 0.000 0.920 0.000
#> SRR868835     1  0.4933     0.5140 0.568 0.000 0.432 0.000
#> SRR868836     1  0.3161     0.6224 0.864 0.012 0.124 0.000
#> SRR868837     1  0.5268     0.5444 0.592 0.012 0.396 0.000
#> SRR868838     3  0.2796     0.8284 0.016 0.000 0.892 0.092
#> SRR868839     2  0.3649     0.7420 0.204 0.796 0.000 0.000
#> SRR868840     1  0.5399     0.4319 0.520 0.012 0.468 0.000
#> SRR868841     1  0.5409     0.3729 0.496 0.012 0.492 0.000
#> SRR868842     1  0.3004     0.5871 0.892 0.048 0.060 0.000
#> SRR868843     2  0.3591     0.7177 0.168 0.824 0.000 0.008
#> SRR868844     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868845     4  0.0524     0.9763 0.008 0.004 0.000 0.988
#> SRR868846     1  0.2469     0.5179 0.892 0.108 0.000 0.000
#> SRR868847     1  0.5337     0.5224 0.564 0.012 0.424 0.000
#> SRR868848     1  0.5337     0.5224 0.564 0.012 0.424 0.000
#> SRR868849     2  0.4564     0.6031 0.328 0.672 0.000 0.000
#> SRR868850     4  0.1124     0.9546 0.012 0.012 0.004 0.972
#> SRR868851     4  0.0469     0.9904 0.000 0.012 0.000 0.988
#> SRR868852     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868853     2  0.1256     0.8306 0.008 0.964 0.000 0.028
#> SRR868855     2  0.6778     0.1269 0.416 0.512 0.020 0.052
#> SRR868856     4  0.0469     0.9904 0.000 0.012 0.000 0.988
#> SRR868857     2  0.4134     0.7059 0.260 0.740 0.000 0.000
#> SRR868858     2  0.3249     0.7434 0.140 0.852 0.000 0.008
#> SRR868874     4  0.0592     0.9917 0.000 0.016 0.000 0.984
#> SRR868875     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868876     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868877     4  0.0592     0.9917 0.000 0.016 0.000 0.984
#> SRR868878     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868879     4  0.0592     0.9917 0.000 0.016 0.000 0.984
#> SRR868880     4  0.0592     0.9917 0.000 0.016 0.000 0.984
#> SRR868881     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868882     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868883     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868884     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868885     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868829     3  0.1940     0.8945 0.076 0.000 0.924 0.000
#> SRR868830     3  0.5653     0.6163 0.096 0.000 0.712 0.192
#> SRR868831     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868828     3  0.0188     0.9252 0.004 0.000 0.996 0.000
#> SRR868832     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000     0.9272 0.000 0.000 1.000 0.000
#> SRR868834     1  0.2469     0.6215 0.892 0.000 0.108 0.000
#> SRR868854     4  0.0469     0.9904 0.000 0.012 0.000 0.988
#> SRR868859     4  0.0592     0.9917 0.000 0.016 0.000 0.984
#> SRR868860     4  0.0469     0.9904 0.000 0.012 0.000 0.988
#> SRR868861     1  0.3893     0.4454 0.796 0.196 0.000 0.008
#> SRR868862     2  0.4564     0.6031 0.328 0.672 0.000 0.000
#> SRR868863     4  0.0592     0.9917 0.000 0.016 0.000 0.984
#> SRR868864     1  0.5784     0.5329 0.556 0.032 0.412 0.000
#> SRR868865     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868866     1  0.5774     0.0604 0.508 0.028 0.000 0.464
#> SRR868867     1  0.4155     0.3782 0.756 0.240 0.000 0.004
#> SRR868868     1  0.5774     0.0604 0.508 0.028 0.000 0.464
#> SRR868869     1  0.8174     0.4905 0.484 0.028 0.284 0.204
#> SRR868870     4  0.0592     0.9917 0.000 0.016 0.000 0.984
#> SRR868871     2  0.1389     0.8395 0.000 0.952 0.000 0.048
#> SRR868873     4  0.0592     0.9917 0.000 0.016 0.000 0.984
#> SRR868872     2  0.1389     0.8395 0.000 0.952 0.000 0.048

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     3  0.4817    0.41063 0.024 0.000 0.572 0.000 0.404
#> SRR868807     3  0.0324    0.86903 0.004 0.000 0.992 0.000 0.004
#> SRR868808     5  0.6840    0.22610 0.004 0.332 0.252 0.000 0.412
#> SRR868809     3  0.1952    0.82935 0.004 0.000 0.912 0.000 0.084
#> SRR868810     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868811     4  0.1478    0.91468 0.000 0.064 0.000 0.936 0.000
#> SRR868812     3  0.4310    0.45381 0.004 0.000 0.604 0.000 0.392
#> SRR868813     3  0.5431    0.35002 0.060 0.000 0.516 0.000 0.424
#> SRR868814     3  0.4588    0.75364 0.116 0.000 0.748 0.000 0.136
#> SRR868815     3  0.3002    0.80686 0.116 0.000 0.856 0.000 0.028
#> SRR868816     3  0.0000    0.87070 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000    0.87070 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000    0.87070 0.000 0.000 1.000 0.000 0.000
#> SRR868819     5  0.2471    0.55284 0.000 0.136 0.000 0.000 0.864
#> SRR868820     5  0.2848    0.56321 0.000 0.104 0.028 0.000 0.868
#> SRR868821     5  0.2848    0.56321 0.000 0.104 0.028 0.000 0.868
#> SRR868822     3  0.3160    0.70704 0.004 0.000 0.808 0.000 0.188
#> SRR868824     3  0.0000    0.87070 0.000 0.000 1.000 0.000 0.000
#> SRR868823     3  0.1270    0.85525 0.052 0.000 0.948 0.000 0.000
#> SRR868825     3  0.0000    0.87070 0.000 0.000 1.000 0.000 0.000
#> SRR868826     3  0.0609    0.86668 0.020 0.000 0.980 0.000 0.000
#> SRR868827     3  0.2795    0.83632 0.064 0.000 0.880 0.000 0.056
#> SRR868835     1  0.4028    0.53378 0.768 0.000 0.192 0.000 0.040
#> SRR868836     1  0.4415    0.27591 0.604 0.000 0.008 0.000 0.388
#> SRR868837     1  0.3053    0.53527 0.852 0.012 0.128 0.000 0.008
#> SRR868838     3  0.4346    0.75929 0.096 0.000 0.800 0.076 0.028
#> SRR868839     2  0.3231    0.68323 0.000 0.800 0.000 0.004 0.196
#> SRR868840     1  0.4818    0.43318 0.676 0.012 0.284 0.000 0.028
#> SRR868841     1  0.4839    0.42924 0.672 0.012 0.288 0.000 0.028
#> SRR868842     1  0.3932    0.34357 0.672 0.000 0.000 0.000 0.328
#> SRR868843     2  0.3796    0.58652 0.300 0.700 0.000 0.000 0.000
#> SRR868844     3  0.0794    0.86439 0.028 0.000 0.972 0.000 0.000
#> SRR868845     4  0.1560    0.94091 0.020 0.004 0.000 0.948 0.028
#> SRR868846     1  0.3913    0.34812 0.676 0.000 0.000 0.000 0.324
#> SRR868847     1  0.3565    0.54838 0.800 0.000 0.176 0.000 0.024
#> SRR868848     1  0.3241    0.54767 0.832 0.000 0.144 0.000 0.024
#> SRR868849     2  0.5850    0.25366 0.072 0.544 0.000 0.012 0.372
#> SRR868850     4  0.3344    0.83758 0.112 0.012 0.000 0.848 0.028
#> SRR868851     4  0.0000    0.97667 0.000 0.000 0.000 1.000 0.000
#> SRR868852     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868853     2  0.0794    0.83453 0.028 0.972 0.000 0.000 0.000
#> SRR868855     2  0.5262    0.39720 0.388 0.568 0.036 0.000 0.008
#> SRR868856     4  0.0000    0.97667 0.000 0.000 0.000 1.000 0.000
#> SRR868857     2  0.4058    0.61170 0.024 0.740 0.000 0.000 0.236
#> SRR868858     2  0.3109    0.69949 0.200 0.800 0.000 0.000 0.000
#> SRR868874     4  0.0162    0.97836 0.000 0.004 0.000 0.996 0.000
#> SRR868875     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868876     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868877     4  0.0162    0.97836 0.000 0.004 0.000 0.996 0.000
#> SRR868878     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868879     4  0.0162    0.97836 0.000 0.004 0.000 0.996 0.000
#> SRR868880     4  0.0162    0.97836 0.000 0.004 0.000 0.996 0.000
#> SRR868881     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868882     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868883     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868884     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868885     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868829     3  0.2859    0.83422 0.068 0.000 0.876 0.000 0.056
#> SRR868830     3  0.5348    0.71508 0.076 0.000 0.736 0.116 0.072
#> SRR868831     3  0.0000    0.87070 0.000 0.000 1.000 0.000 0.000
#> SRR868828     3  0.1121    0.85812 0.044 0.000 0.956 0.000 0.000
#> SRR868832     3  0.0000    0.87070 0.000 0.000 1.000 0.000 0.000
#> SRR868833     3  0.0000    0.87070 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.4101    0.34795 0.664 0.000 0.004 0.000 0.332
#> SRR868854     4  0.0162    0.97510 0.004 0.000 0.000 0.996 0.000
#> SRR868859     4  0.0162    0.97836 0.000 0.004 0.000 0.996 0.000
#> SRR868860     4  0.0000    0.97667 0.000 0.000 0.000 1.000 0.000
#> SRR868861     5  0.5218   -0.01968 0.424 0.036 0.000 0.004 0.536
#> SRR868862     2  0.6010    0.21330 0.096 0.532 0.000 0.008 0.364
#> SRR868863     4  0.0162    0.97836 0.000 0.004 0.000 0.996 0.000
#> SRR868864     1  0.4215    0.51794 0.748 0.008 0.220 0.000 0.024
#> SRR868865     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868866     1  0.6849    0.08841 0.404 0.004 0.000 0.252 0.340
#> SRR868867     5  0.5191   -0.00423 0.408 0.036 0.000 0.004 0.552
#> SRR868868     1  0.6849    0.08841 0.404 0.004 0.000 0.252 0.340
#> SRR868869     1  0.8077    0.09752 0.400 0.004 0.112 0.172 0.312
#> SRR868870     4  0.0162    0.97836 0.000 0.004 0.000 0.996 0.000
#> SRR868871     2  0.0510    0.85928 0.000 0.984 0.000 0.016 0.000
#> SRR868873     4  0.0162    0.97836 0.000 0.004 0.000 0.996 0.000
#> SRR868872     2  0.0510    0.85928 0.000 0.984 0.000 0.016 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
#> SRR868806     6  0.3867     0.6452 0.004 0.000 0.296 0.000 0.012 0.688
#> SRR868807     3  0.1349     0.8406 0.004 0.000 0.940 0.000 0.000 0.056
#> SRR868808     6  0.4631     0.6468 0.004 0.132 0.160 0.000 0.000 0.704
#> SRR868809     3  0.2703     0.7154 0.004 0.000 0.824 0.000 0.000 0.172
#> SRR868810     2  0.0146     0.8556 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868811     4  0.0858     0.9244 0.004 0.028 0.000 0.968 0.000 0.000
#> SRR868812     6  0.3830     0.5291 0.004 0.000 0.376 0.000 0.000 0.620
#> SRR868813     6  0.4354     0.6341 0.004 0.000 0.196 0.000 0.080 0.720
#> SRR868814     3  0.5679     0.4688 0.012 0.000 0.580 0.000 0.208 0.200
#> SRR868815     3  0.4780     0.6443 0.012 0.000 0.688 0.000 0.208 0.092
#> SRR868816     3  0.0000     0.8753 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000     0.8753 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000     0.8753 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     6  0.3653     0.6091 0.132 0.048 0.000 0.000 0.016 0.804
#> SRR868820     6  0.3704     0.6120 0.136 0.040 0.004 0.000 0.016 0.804
#> SRR868821     6  0.3704     0.6120 0.136 0.040 0.004 0.000 0.016 0.804
#> SRR868822     3  0.3627     0.6896 0.028 0.000 0.796 0.000 0.020 0.156
#> SRR868824     3  0.0000     0.8753 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868823     3  0.0632     0.8697 0.000 0.000 0.976 0.000 0.024 0.000
#> SRR868825     3  0.0000     0.8753 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868826     3  0.0260     0.8743 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR868827     3  0.3555     0.7924 0.060 0.000 0.832 0.000 0.056 0.052
#> SRR868835     5  0.5371     0.6116 0.188 0.000 0.112 0.000 0.660 0.040
#> SRR868836     5  0.6474     0.4248 0.332 0.000 0.032 0.000 0.436 0.200
#> SRR868837     5  0.2685     0.6503 0.052 0.000 0.040 0.000 0.884 0.024
#> SRR868838     3  0.5444     0.6691 0.064 0.000 0.688 0.012 0.160 0.076
#> SRR868839     2  0.3999     0.7055 0.032 0.776 0.000 0.000 0.036 0.156
#> SRR868840     5  0.2538     0.6252 0.020 0.000 0.040 0.000 0.892 0.048
#> SRR868841     5  0.2602     0.6225 0.020 0.000 0.040 0.000 0.888 0.052
#> SRR868842     5  0.5660     0.5078 0.308 0.000 0.000 0.000 0.512 0.180
#> SRR868843     2  0.4625     0.4111 0.004 0.572 0.000 0.000 0.388 0.036
#> SRR868844     3  0.0363     0.8734 0.000 0.000 0.988 0.000 0.012 0.000
#> SRR868845     4  0.3264     0.8022 0.004 0.000 0.000 0.832 0.088 0.076
#> SRR868846     5  0.5561     0.5209 0.308 0.000 0.000 0.000 0.528 0.164
#> SRR868847     5  0.4083     0.6711 0.108 0.000 0.116 0.000 0.768 0.008
#> SRR868848     5  0.4409     0.6504 0.156 0.000 0.068 0.000 0.748 0.028
#> SRR868849     2  0.5831     0.4586 0.208 0.588 0.000 0.000 0.028 0.176
#> SRR868850     4  0.5400     0.4897 0.016 0.000 0.000 0.596 0.284 0.104
#> SRR868851     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868852     2  0.0260     0.8532 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR868853     2  0.2000     0.8171 0.004 0.916 0.000 0.000 0.048 0.032
#> SRR868855     2  0.6610     0.0968 0.120 0.412 0.012 0.000 0.408 0.048
#> SRR868856     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868857     2  0.4977     0.6327 0.052 0.692 0.000 0.000 0.056 0.200
#> SRR868858     2  0.4023     0.6523 0.004 0.720 0.000 0.000 0.240 0.036
#> SRR868874     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868875     2  0.0146     0.8556 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000     0.8555 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868878     2  0.0000     0.8555 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868880     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868881     2  0.0146     0.8542 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR868882     2  0.0146     0.8556 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0146     0.8556 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868884     2  0.0000     0.8555 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.0146     0.8556 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868829     3  0.3848     0.7829 0.060 0.000 0.812 0.000 0.060 0.068
#> SRR868830     3  0.6253     0.6194 0.060 0.000 0.652 0.100 0.080 0.108
#> SRR868831     3  0.0000     0.8753 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868828     3  0.0632     0.8697 0.000 0.000 0.976 0.000 0.024 0.000
#> SRR868832     3  0.0000     0.8753 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868833     3  0.0000     0.8753 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     5  0.6163     0.5272 0.280 0.000 0.024 0.000 0.508 0.188
#> SRR868854     4  0.0653     0.9391 0.012 0.000 0.000 0.980 0.004 0.004
#> SRR868859     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868860     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868861     1  0.1890     0.8271 0.916 0.000 0.000 0.000 0.024 0.060
#> SRR868862     2  0.5271     0.3001 0.380 0.536 0.000 0.000 0.012 0.072
#> SRR868863     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868864     5  0.4167     0.6570 0.052 0.000 0.132 0.000 0.776 0.040
#> SRR868865     2  0.0000     0.8555 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868866     1  0.2199     0.8610 0.892 0.000 0.000 0.088 0.020 0.000
#> SRR868867     1  0.2344     0.7940 0.892 0.004 0.000 0.000 0.028 0.076
#> SRR868868     1  0.2199     0.8610 0.892 0.000 0.000 0.088 0.020 0.000
#> SRR868869     1  0.2472     0.8284 0.904 0.000 0.032 0.032 0.020 0.012
#> SRR868870     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868871     2  0.0146     0.8556 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868873     4  0.0000     0.9539 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868872     2  0.0000     0.8555 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

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 1.000           0.987       0.995         0.3898 0.608   0.608
#> 3 3 0.976           0.965       0.986         0.3541 0.871   0.788
#> 4 4 0.783           0.909       0.945         0.1468 0.912   0.819
#> 5 5 0.964           0.949       0.979         0.0996 0.932   0.833
#> 6 6 0.924           0.925       0.970         0.0669 0.962   0.888

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> SRR868806     1  0.0000      0.998 1.000 0.000
#> SRR868807     1  0.0000      0.998 1.000 0.000
#> SRR868808     1  0.0000      0.998 1.000 0.000
#> SRR868809     1  0.0000      0.998 1.000 0.000
#> SRR868810     2  0.0000      0.983 0.000 1.000
#> SRR868811     2  0.0000      0.983 0.000 1.000
#> SRR868812     1  0.0000      0.998 1.000 0.000
#> SRR868813     1  0.0000      0.998 1.000 0.000
#> SRR868814     1  0.0000      0.998 1.000 0.000
#> SRR868815     1  0.0000      0.998 1.000 0.000
#> SRR868816     1  0.0000      0.998 1.000 0.000
#> SRR868817     1  0.0000      0.998 1.000 0.000
#> SRR868818     1  0.0000      0.998 1.000 0.000
#> SRR868819     1  0.0000      0.998 1.000 0.000
#> SRR868820     1  0.0000      0.998 1.000 0.000
#> SRR868821     1  0.0000      0.998 1.000 0.000
#> SRR868822     1  0.0000      0.998 1.000 0.000
#> SRR868824     1  0.0000      0.998 1.000 0.000
#> SRR868823     1  0.0000      0.998 1.000 0.000
#> SRR868825     1  0.0000      0.998 1.000 0.000
#> SRR868826     1  0.0000      0.998 1.000 0.000
#> SRR868827     1  0.0000      0.998 1.000 0.000
#> SRR868835     1  0.0000      0.998 1.000 0.000
#> SRR868836     1  0.0000      0.998 1.000 0.000
#> SRR868837     1  0.0000      0.998 1.000 0.000
#> SRR868838     1  0.0000      0.998 1.000 0.000
#> SRR868839     1  0.0000      0.998 1.000 0.000
#> SRR868840     1  0.0000      0.998 1.000 0.000
#> SRR868841     1  0.0000      0.998 1.000 0.000
#> SRR868842     1  0.0000      0.998 1.000 0.000
#> SRR868843     1  0.0000      0.998 1.000 0.000
#> SRR868844     1  0.0000      0.998 1.000 0.000
#> SRR868845     1  0.0000      0.998 1.000 0.000
#> SRR868846     1  0.0000      0.998 1.000 0.000
#> SRR868847     1  0.0000      0.998 1.000 0.000
#> SRR868848     1  0.0000      0.998 1.000 0.000
#> SRR868849     1  0.0000      0.998 1.000 0.000
#> SRR868850     1  0.0000      0.998 1.000 0.000
#> SRR868851     1  0.0000      0.998 1.000 0.000
#> SRR868852     1  0.0000      0.998 1.000 0.000
#> SRR868853     1  0.0000      0.998 1.000 0.000
#> SRR868855     1  0.0000      0.998 1.000 0.000
#> SRR868856     1  0.0000      0.998 1.000 0.000
#> SRR868857     1  0.0000      0.998 1.000 0.000
#> SRR868858     1  0.0000      0.998 1.000 0.000
#> SRR868874     2  0.0000      0.983 0.000 1.000
#> SRR868875     2  0.0000      0.983 0.000 1.000
#> SRR868876     2  0.0000      0.983 0.000 1.000
#> SRR868877     2  0.0000      0.983 0.000 1.000
#> SRR868878     2  0.0000      0.983 0.000 1.000
#> SRR868879     2  0.0000      0.983 0.000 1.000
#> SRR868880     2  0.0000      0.983 0.000 1.000
#> SRR868881     2  0.0000      0.983 0.000 1.000
#> SRR868882     2  0.0000      0.983 0.000 1.000
#> SRR868883     2  0.0000      0.983 0.000 1.000
#> SRR868884     2  0.0000      0.983 0.000 1.000
#> SRR868885     2  0.0000      0.983 0.000 1.000
#> SRR868829     1  0.0000      0.998 1.000 0.000
#> SRR868830     1  0.0000      0.998 1.000 0.000
#> SRR868831     1  0.0000      0.998 1.000 0.000
#> SRR868828     1  0.0000      0.998 1.000 0.000
#> SRR868832     1  0.0000      0.998 1.000 0.000
#> SRR868833     1  0.0000      0.998 1.000 0.000
#> SRR868834     1  0.0000      0.998 1.000 0.000
#> SRR868854     1  0.0000      0.998 1.000 0.000
#> SRR868859     2  0.0376      0.980 0.004 0.996
#> SRR868860     2  0.0376      0.980 0.004 0.996
#> SRR868861     1  0.0000      0.998 1.000 0.000
#> SRR868862     1  0.0000      0.998 1.000 0.000
#> SRR868863     2  0.9087      0.519 0.324 0.676
#> SRR868864     1  0.0000      0.998 1.000 0.000
#> SRR868865     1  0.4815      0.881 0.896 0.104
#> SRR868866     1  0.0000      0.998 1.000 0.000
#> SRR868867     1  0.0000      0.998 1.000 0.000
#> SRR868868     1  0.0000      0.998 1.000 0.000
#> SRR868869     1  0.0000      0.998 1.000 0.000
#> SRR868870     2  0.0000      0.983 0.000 1.000
#> SRR868871     2  0.0000      0.983 0.000 1.000
#> SRR868873     2  0.0000      0.983 0.000 1.000
#> SRR868872     2  0.0000      0.983 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
#> SRR868806     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868807     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868808     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868809     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868810     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868811     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868812     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868813     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868814     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868815     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868819     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868820     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868821     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868822     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868824     1  0.5216      0.666 0.740 0.000 0.260
#> SRR868823     1  0.3879      0.823 0.848 0.000 0.152
#> SRR868825     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868827     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868835     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868836     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868837     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868838     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868839     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868840     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868841     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868842     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868843     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868845     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868846     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868847     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868848     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868849     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868850     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868851     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868852     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868853     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868855     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868856     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868857     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868858     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868874     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868875     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868876     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868877     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868878     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868879     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868880     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868881     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868882     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868883     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868884     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868885     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868829     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868830     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868831     1  0.5216      0.666 0.740 0.000 0.260
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868834     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868854     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868859     2  0.0237      0.969 0.004 0.996 0.000
#> SRR868860     2  0.0237      0.969 0.004 0.996 0.000
#> SRR868861     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868862     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868863     2  0.5733      0.431 0.324 0.676 0.000
#> SRR868864     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868865     1  0.3038      0.871 0.896 0.104 0.000
#> SRR868866     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868867     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868868     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868869     1  0.0000      0.984 1.000 0.000 0.000
#> SRR868870     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868871     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868873     2  0.0000      0.974 0.000 1.000 0.000
#> SRR868872     2  0.0000      0.974 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868807     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868808     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868809     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868810     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868811     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868812     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868813     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868814     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868815     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868819     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868820     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868821     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868822     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868824     1  0.4134      0.680 0.740 0.000 0.260 0.000
#> SRR868823     1  0.3074      0.823 0.848 0.000 0.152 0.000
#> SRR868825     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868827     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868835     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868836     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868837     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868838     1  0.2149      0.884 0.912 0.000 0.000 0.088
#> SRR868839     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868840     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868841     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868842     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868843     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868845     1  0.2589      0.858 0.884 0.000 0.000 0.116
#> SRR868846     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868847     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868848     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868849     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868850     1  0.2149      0.884 0.912 0.000 0.000 0.088
#> SRR868851     4  0.2647      0.749 0.120 0.000 0.000 0.880
#> SRR868852     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868853     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868855     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868856     4  0.3764      0.661 0.216 0.000 0.000 0.784
#> SRR868857     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868858     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868874     4  0.3123      0.819 0.000 0.156 0.000 0.844
#> SRR868875     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868876     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868877     4  0.3123      0.819 0.000 0.156 0.000 0.844
#> SRR868878     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868879     4  0.3907      0.749 0.000 0.232 0.000 0.768
#> SRR868880     4  0.3123      0.819 0.000 0.156 0.000 0.844
#> SRR868881     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868882     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868884     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868829     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868830     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> SRR868831     1  0.4134      0.680 0.740 0.000 0.260 0.000
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868834     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868854     4  0.3123      0.727 0.156 0.000 0.000 0.844
#> SRR868859     4  0.4907      0.464 0.000 0.420 0.000 0.580
#> SRR868860     4  0.0000      0.737 0.000 0.000 0.000 1.000
#> SRR868861     1  0.3123      0.832 0.844 0.000 0.000 0.156
#> SRR868862     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868863     4  0.6903      0.593 0.184 0.224 0.000 0.592
#> SRR868864     1  0.0000      0.954 1.000 0.000 0.000 0.000
#> SRR868865     1  0.2408      0.867 0.896 0.104 0.000 0.000
#> SRR868866     1  0.3975      0.747 0.760 0.000 0.000 0.240
#> SRR868867     1  0.3123      0.832 0.844 0.000 0.000 0.156
#> SRR868868     1  0.3942      0.752 0.764 0.000 0.000 0.236
#> SRR868869     1  0.4008      0.742 0.756 0.000 0.000 0.244
#> SRR868870     4  0.3123      0.819 0.000 0.156 0.000 0.844
#> SRR868871     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868873     4  0.3123      0.819 0.000 0.156 0.000 0.844
#> SRR868872     2  0.0000      1.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868807     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868808     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868809     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868810     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868811     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868812     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868813     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868814     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868815     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868819     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868820     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868821     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868822     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868824     1  0.3561      0.670 0.740 0.000 0.260 0.000 0.000
#> SRR868823     1  0.2648      0.824 0.848 0.000 0.152 0.000 0.000
#> SRR868825     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868827     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868835     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868836     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868837     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868838     1  0.0404      0.969 0.988 0.000 0.000 0.012 0.000
#> SRR868839     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868840     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868841     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868842     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868843     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868845     1  0.1478      0.919 0.936 0.000 0.000 0.064 0.000
#> SRR868846     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868847     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868848     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868849     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868850     1  0.0404      0.969 0.988 0.000 0.000 0.012 0.000
#> SRR868851     4  0.0000      0.898 0.000 0.000 0.000 1.000 0.000
#> SRR868852     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868853     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868855     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868856     4  0.1965      0.779 0.096 0.000 0.000 0.904 0.000
#> SRR868857     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868858     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868874     4  0.0000      0.898 0.000 0.000 0.000 1.000 0.000
#> SRR868875     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868877     4  0.0000      0.898 0.000 0.000 0.000 1.000 0.000
#> SRR868878     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868879     4  0.0290      0.892 0.000 0.008 0.000 0.992 0.000
#> SRR868880     4  0.0000      0.898 0.000 0.000 0.000 1.000 0.000
#> SRR868881     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868882     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868884     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868885     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868829     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868830     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868831     1  0.3561      0.670 0.740 0.000 0.260 0.000 0.000
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868854     4  0.0000      0.898 0.000 0.000 0.000 1.000 0.000
#> SRR868859     4  0.4030      0.460 0.000 0.352 0.000 0.648 0.000
#> SRR868860     4  0.0162      0.895 0.000 0.000 0.000 0.996 0.004
#> SRR868861     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868862     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868863     4  0.5358      0.458 0.248 0.104 0.000 0.648 0.000
#> SRR868864     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> SRR868865     1  0.2074      0.875 0.896 0.104 0.000 0.000 0.000
#> SRR868866     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868867     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868868     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868869     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868870     4  0.0000      0.898 0.000 0.000 0.000 1.000 0.000
#> SRR868871     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868873     4  0.0000      0.898 0.000 0.000 0.000 1.000 0.000
#> SRR868872     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868807     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868808     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868809     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868810     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868811     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868812     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868813     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868814     5  0.0146      0.956 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR868815     5  0.0146      0.956 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR868816     3  0.0000      0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000      0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000      0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     6  0.0363      1.000 0.000 0.000 0.000 0.000 0.012 0.988
#> SRR868820     6  0.0363      1.000 0.000 0.000 0.000 0.000 0.012 0.988
#> SRR868821     6  0.0363      1.000 0.000 0.000 0.000 0.000 0.012 0.988
#> SRR868822     5  0.2416      0.804 0.000 0.000 0.000 0.000 0.844 0.156
#> SRR868824     5  0.3445      0.652 0.000 0.000 0.260 0.000 0.732 0.008
#> SRR868823     5  0.2378      0.809 0.000 0.000 0.152 0.000 0.848 0.000
#> SRR868825     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868826     3  0.0260      0.994 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868827     5  0.3860      0.108 0.000 0.000 0.000 0.000 0.528 0.472
#> SRR868835     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868836     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868837     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868838     5  0.0508      0.947 0.000 0.000 0.000 0.012 0.984 0.004
#> SRR868839     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868840     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868841     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868842     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868843     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868844     3  0.0000      0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868845     5  0.1471      0.900 0.000 0.000 0.000 0.064 0.932 0.004
#> SRR868846     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868847     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868848     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868849     5  0.0146      0.956 0.000 0.000 0.000 0.000 0.996 0.004
#> SRR868850     5  0.0363      0.950 0.000 0.000 0.000 0.012 0.988 0.000
#> SRR868851     4  0.0000      0.894 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868852     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868853     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868855     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868856     4  0.1765      0.768 0.000 0.000 0.000 0.904 0.096 0.000
#> SRR868857     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868858     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868874     4  0.0000      0.894 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868875     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     4  0.0000      0.894 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868878     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     4  0.0260      0.888 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR868880     4  0.0000      0.894 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868881     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868829     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868830     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868831     5  0.3445      0.652 0.000 0.000 0.260 0.000 0.732 0.008
#> SRR868828     3  0.0146      0.994 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR868832     3  0.0260      0.994 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868833     3  0.0260      0.994 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868834     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868854     4  0.0000      0.894 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868859     4  0.3620      0.462 0.000 0.352 0.000 0.648 0.000 0.000
#> SRR868860     4  0.0146      0.892 0.004 0.000 0.000 0.996 0.000 0.000
#> SRR868861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868862     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868863     4  0.4813      0.424 0.000 0.104 0.000 0.648 0.248 0.000
#> SRR868864     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868865     5  0.1863      0.858 0.000 0.104 0.000 0.000 0.896 0.000
#> SRR868866     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868867     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868868     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868869     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868870     4  0.0000      0.894 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868871     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     4  0.0000      0.894 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868872     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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 15961 rows and 80 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.489           0.813       0.887         0.4791 0.495   0.495
#> 3 3 0.534           0.787       0.855         0.3117 0.848   0.701
#> 4 4 0.414           0.432       0.714         0.0813 0.747   0.434
#> 5 5 0.607           0.709       0.785         0.1269 0.891   0.643
#> 6 6 0.747           0.685       0.781         0.0491 0.880   0.548

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
#> SRR868806     2  0.8207      0.737 0.256 0.744
#> SRR868807     2  0.7745      0.678 0.228 0.772
#> SRR868808     2  0.3584      0.868 0.068 0.932
#> SRR868809     2  0.0000      0.902 0.000 1.000
#> SRR868810     2  0.4161      0.865 0.084 0.916
#> SRR868811     1  0.1414      0.839 0.980 0.020
#> SRR868812     2  0.4022      0.867 0.080 0.920
#> SRR868813     1  0.6048      0.781 0.852 0.148
#> SRR868814     1  0.4298      0.823 0.912 0.088
#> SRR868815     1  0.4298      0.823 0.912 0.088
#> SRR868816     1  0.9323      0.503 0.652 0.348
#> SRR868817     1  0.9710      0.513 0.600 0.400
#> SRR868818     1  0.9710      0.513 0.600 0.400
#> SRR868819     2  0.4022      0.863 0.080 0.920
#> SRR868820     2  0.4022      0.863 0.080 0.920
#> SRR868821     2  0.4022      0.863 0.080 0.920
#> SRR868822     2  0.0000      0.902 0.000 1.000
#> SRR868824     2  0.5408      0.825 0.124 0.876
#> SRR868823     1  0.8861      0.695 0.696 0.304
#> SRR868825     2  0.0000      0.902 0.000 1.000
#> SRR868826     1  0.9732      0.527 0.596 0.404
#> SRR868827     1  0.0000      0.834 1.000 0.000
#> SRR868835     1  0.4022      0.870 0.920 0.080
#> SRR868836     2  0.0376      0.901 0.004 0.996
#> SRR868837     1  0.9866      0.456 0.568 0.432
#> SRR868838     1  0.3584      0.870 0.932 0.068
#> SRR868839     2  0.0000      0.902 0.000 1.000
#> SRR868840     1  0.9732      0.526 0.596 0.404
#> SRR868841     1  0.6148      0.839 0.848 0.152
#> SRR868842     2  0.0000      0.902 0.000 1.000
#> SRR868843     2  0.8016      0.654 0.244 0.756
#> SRR868844     1  0.9552      0.581 0.624 0.376
#> SRR868845     1  0.1184      0.838 0.984 0.016
#> SRR868846     2  0.0376      0.901 0.004 0.996
#> SRR868847     1  0.8713      0.711 0.708 0.292
#> SRR868848     1  0.4022      0.870 0.920 0.080
#> SRR868849     2  0.1633      0.892 0.024 0.976
#> SRR868850     1  0.4431      0.861 0.908 0.092
#> SRR868851     1  0.3584      0.870 0.932 0.068
#> SRR868852     2  0.0376      0.901 0.004 0.996
#> SRR868853     2  0.3114      0.880 0.056 0.944
#> SRR868855     2  0.8144      0.637 0.252 0.748
#> SRR868856     1  0.3431      0.869 0.936 0.064
#> SRR868857     2  0.0000      0.902 0.000 1.000
#> SRR868858     2  0.5519      0.821 0.128 0.872
#> SRR868874     1  0.4022      0.870 0.920 0.080
#> SRR868875     2  0.2603      0.887 0.044 0.956
#> SRR868876     2  0.0000      0.902 0.000 1.000
#> SRR868877     1  0.4022      0.870 0.920 0.080
#> SRR868878     2  0.0000      0.902 0.000 1.000
#> SRR868879     1  0.4022      0.870 0.920 0.080
#> SRR868880     1  0.3584      0.870 0.932 0.068
#> SRR868881     2  0.4022      0.863 0.080 0.920
#> SRR868882     2  0.1843      0.898 0.028 0.972
#> SRR868883     2  0.7056      0.800 0.192 0.808
#> SRR868884     2  0.0000      0.902 0.000 1.000
#> SRR868885     2  0.4161      0.865 0.084 0.916
#> SRR868829     1  0.0000      0.834 1.000 0.000
#> SRR868830     1  0.0000      0.834 1.000 0.000
#> SRR868831     2  0.8608      0.562 0.284 0.716
#> SRR868828     1  0.7883      0.772 0.764 0.236
#> SRR868832     2  0.4815      0.847 0.104 0.896
#> SRR868833     2  0.5059      0.840 0.112 0.888
#> SRR868834     2  0.0000      0.902 0.000 1.000
#> SRR868854     1  0.3584      0.870 0.932 0.068
#> SRR868859     1  0.3431      0.869 0.936 0.064
#> SRR868860     1  0.3584      0.870 0.932 0.068
#> SRR868861     2  0.9358      0.471 0.352 0.648
#> SRR868862     2  0.0000      0.902 0.000 1.000
#> SRR868863     1  0.3584      0.870 0.932 0.068
#> SRR868864     2  0.3879      0.867 0.076 0.924
#> SRR868865     2  0.0000      0.902 0.000 1.000
#> SRR868866     1  0.4022      0.870 0.920 0.080
#> SRR868867     2  0.7139      0.703 0.196 0.804
#> SRR868868     1  0.4022      0.870 0.920 0.080
#> SRR868869     1  0.4022      0.870 0.920 0.080
#> SRR868870     1  0.3584      0.870 0.932 0.068
#> SRR868871     2  0.0376      0.901 0.004 0.996
#> SRR868873     1  0.3584      0.870 0.932 0.068
#> SRR868872     2  0.0000      0.902 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
#> SRR868806     1  0.3832      0.864 0.880 0.020 0.100
#> SRR868807     3  0.5859      0.459 0.344 0.000 0.656
#> SRR868808     1  0.2947      0.856 0.920 0.020 0.060
#> SRR868809     1  0.2625      0.869 0.916 0.000 0.084
#> SRR868810     1  0.3998      0.851 0.884 0.056 0.060
#> SRR868811     2  0.4172      0.778 0.004 0.840 0.156
#> SRR868812     1  0.5092      0.837 0.804 0.020 0.176
#> SRR868813     3  0.4821      0.745 0.040 0.120 0.840
#> SRR868814     2  0.5746      0.737 0.040 0.780 0.180
#> SRR868815     2  0.5798      0.732 0.040 0.776 0.184
#> SRR868816     3  0.1753      0.773 0.048 0.000 0.952
#> SRR868817     3  0.1753      0.773 0.048 0.000 0.952
#> SRR868818     3  0.1753      0.773 0.048 0.000 0.952
#> SRR868819     1  0.4179      0.861 0.876 0.052 0.072
#> SRR868820     1  0.3670      0.862 0.888 0.020 0.092
#> SRR868821     1  0.3670      0.862 0.888 0.020 0.092
#> SRR868822     1  0.3752      0.841 0.856 0.000 0.144
#> SRR868824     1  0.5733      0.700 0.676 0.000 0.324
#> SRR868823     3  0.2625      0.776 0.084 0.000 0.916
#> SRR868825     1  0.3879      0.835 0.848 0.000 0.152
#> SRR868826     3  0.1753      0.773 0.048 0.000 0.952
#> SRR868827     3  0.6793      0.646 0.036 0.292 0.672
#> SRR868835     3  0.7339      0.693 0.088 0.224 0.688
#> SRR868836     1  0.2711      0.865 0.912 0.000 0.088
#> SRR868837     3  0.3551      0.768 0.132 0.000 0.868
#> SRR868838     2  0.2564      0.876 0.036 0.936 0.028
#> SRR868839     1  0.1999      0.873 0.952 0.036 0.012
#> SRR868840     3  0.4047      0.768 0.148 0.004 0.848
#> SRR868841     3  0.6348      0.697 0.060 0.188 0.752
#> SRR868842     1  0.3619      0.846 0.864 0.000 0.136
#> SRR868843     1  0.6286      0.052 0.536 0.000 0.464
#> SRR868844     3  0.1753      0.773 0.048 0.000 0.952
#> SRR868845     2  0.5235      0.775 0.036 0.812 0.152
#> SRR868846     1  0.3619      0.846 0.864 0.000 0.136
#> SRR868847     3  0.3295      0.777 0.096 0.008 0.896
#> SRR868848     3  0.7523      0.668 0.080 0.260 0.660
#> SRR868849     1  0.4915      0.856 0.832 0.036 0.132
#> SRR868850     2  0.5847      0.755 0.048 0.780 0.172
#> SRR868851     2  0.1964      0.880 0.056 0.944 0.000
#> SRR868852     1  0.1999      0.873 0.952 0.036 0.012
#> SRR868853     1  0.2313      0.876 0.944 0.032 0.024
#> SRR868855     3  0.5948      0.428 0.360 0.000 0.640
#> SRR868856     2  0.0747      0.888 0.016 0.984 0.000
#> SRR868857     1  0.0424      0.875 0.992 0.000 0.008
#> SRR868858     1  0.1163      0.874 0.972 0.000 0.028
#> SRR868874     2  0.3765      0.833 0.028 0.888 0.084
#> SRR868875     1  0.1999      0.873 0.952 0.036 0.012
#> SRR868876     1  0.1411      0.872 0.964 0.036 0.000
#> SRR868877     2  0.2443      0.876 0.028 0.940 0.032
#> SRR868878     1  0.1411      0.872 0.964 0.036 0.000
#> SRR868879     2  0.4609      0.777 0.028 0.844 0.128
#> SRR868880     2  0.0892      0.889 0.020 0.980 0.000
#> SRR868881     1  0.3692      0.849 0.896 0.056 0.048
#> SRR868882     1  0.2297      0.874 0.944 0.036 0.020
#> SRR868883     1  0.2414      0.875 0.940 0.040 0.020
#> SRR868884     1  0.1411      0.872 0.964 0.036 0.000
#> SRR868885     1  0.3998      0.851 0.884 0.056 0.060
#> SRR868829     3  0.7107      0.589 0.036 0.340 0.624
#> SRR868830     2  0.1832      0.873 0.036 0.956 0.008
#> SRR868831     1  0.6180      0.533 0.584 0.000 0.416
#> SRR868828     3  0.5580      0.579 0.008 0.256 0.736
#> SRR868832     1  0.5397      0.748 0.720 0.000 0.280
#> SRR868833     1  0.5529      0.727 0.704 0.000 0.296
#> SRR868834     1  0.3686      0.842 0.860 0.000 0.140
#> SRR868854     2  0.1964      0.880 0.056 0.944 0.000
#> SRR868859     2  0.0892      0.889 0.020 0.980 0.000
#> SRR868860     2  0.1129      0.889 0.020 0.976 0.004
#> SRR868861     1  0.5625      0.806 0.808 0.076 0.116
#> SRR868862     1  0.4915      0.856 0.832 0.036 0.132
#> SRR868863     2  0.0892      0.889 0.020 0.980 0.000
#> SRR868864     1  0.3116      0.860 0.892 0.000 0.108
#> SRR868865     1  0.1411      0.872 0.964 0.036 0.000
#> SRR868866     3  0.8181      0.609 0.096 0.312 0.592
#> SRR868867     1  0.5060      0.814 0.836 0.100 0.064
#> SRR868868     3  0.8132      0.619 0.096 0.304 0.600
#> SRR868869     3  0.8439      0.511 0.096 0.368 0.536
#> SRR868870     2  0.0892      0.889 0.020 0.980 0.000
#> SRR868871     1  0.1411      0.872 0.964 0.036 0.000
#> SRR868873     2  0.0892      0.889 0.020 0.980 0.000
#> SRR868872     1  0.1411      0.872 0.964 0.036 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.6801     0.0756 0.456 0.448 0.096 0.000
#> SRR868807     1  0.5993     0.5116 0.628 0.064 0.308 0.000
#> SRR868808     2  0.5060     0.2368 0.412 0.584 0.004 0.000
#> SRR868809     2  0.5406     0.0987 0.480 0.508 0.012 0.000
#> SRR868810     2  0.0592     0.6629 0.000 0.984 0.016 0.000
#> SRR868811     4  0.4817     0.5354 0.088 0.000 0.128 0.784
#> SRR868812     1  0.6969     0.1149 0.452 0.436 0.112 0.000
#> SRR868813     1  0.7864     0.0463 0.392 0.000 0.288 0.320
#> SRR868814     4  0.7146     0.2448 0.336 0.000 0.148 0.516
#> SRR868815     4  0.7146     0.2448 0.336 0.000 0.148 0.516
#> SRR868816     3  0.0657     0.8253 0.012 0.004 0.984 0.000
#> SRR868817     3  0.0657     0.8253 0.012 0.004 0.984 0.000
#> SRR868818     3  0.0657     0.8253 0.012 0.004 0.984 0.000
#> SRR868819     2  0.5466     0.2055 0.436 0.548 0.016 0.000
#> SRR868820     2  0.5506     0.1409 0.472 0.512 0.016 0.000
#> SRR868821     2  0.5508     0.1283 0.476 0.508 0.016 0.000
#> SRR868822     1  0.5436     0.1956 0.620 0.356 0.024 0.000
#> SRR868824     3  0.6115     0.5583 0.148 0.172 0.680 0.000
#> SRR868823     1  0.5982     0.3439 0.524 0.000 0.436 0.040
#> SRR868825     1  0.6373     0.4770 0.648 0.216 0.136 0.000
#> SRR868826     3  0.1389     0.8241 0.048 0.000 0.952 0.000
#> SRR868827     1  0.7113    -0.0994 0.484 0.000 0.132 0.384
#> SRR868835     1  0.4990     0.2855 0.756 0.000 0.060 0.184
#> SRR868836     1  0.4730     0.1885 0.636 0.364 0.000 0.000
#> SRR868837     1  0.4661     0.4649 0.652 0.000 0.348 0.000
#> SRR868838     4  0.4661     0.3767 0.348 0.000 0.000 0.652
#> SRR868839     2  0.4877     0.2721 0.408 0.592 0.000 0.000
#> SRR868840     1  0.5272     0.5110 0.680 0.032 0.288 0.000
#> SRR868841     1  0.6673     0.3124 0.608 0.000 0.252 0.140
#> SRR868842     1  0.5436     0.1956 0.620 0.356 0.024 0.000
#> SRR868843     1  0.6112     0.5319 0.676 0.128 0.196 0.000
#> SRR868844     3  0.1629     0.8143 0.024 0.000 0.952 0.024
#> SRR868845     4  0.6867     0.3078 0.324 0.000 0.124 0.552
#> SRR868846     1  0.4538     0.4357 0.760 0.216 0.024 0.000
#> SRR868847     1  0.4990     0.4554 0.640 0.000 0.352 0.008
#> SRR868848     1  0.5118     0.2877 0.752 0.000 0.072 0.176
#> SRR868849     1  0.5626     0.1265 0.588 0.384 0.028 0.000
#> SRR868850     4  0.7236     0.2032 0.396 0.000 0.144 0.460
#> SRR868851     4  0.3801     0.5404 0.220 0.000 0.000 0.780
#> SRR868852     2  0.4855     0.2831 0.400 0.600 0.000 0.000
#> SRR868853     2  0.4961     0.1816 0.448 0.552 0.000 0.000
#> SRR868855     1  0.5792     0.5211 0.648 0.056 0.296 0.000
#> SRR868856     4  0.0000     0.6317 0.000 0.000 0.000 1.000
#> SRR868857     2  0.4999     0.1115 0.492 0.508 0.000 0.000
#> SRR868858     1  0.5326     0.2873 0.604 0.380 0.016 0.000
#> SRR868874     4  0.5403     0.4870 0.348 0.000 0.024 0.628
#> SRR868875     2  0.0817     0.6789 0.024 0.976 0.000 0.000
#> SRR868876     2  0.0921     0.6792 0.028 0.972 0.000 0.000
#> SRR868877     4  0.5403     0.4870 0.348 0.000 0.024 0.628
#> SRR868878     2  0.0921     0.6792 0.028 0.972 0.000 0.000
#> SRR868879     4  0.5403     0.4870 0.348 0.000 0.024 0.628
#> SRR868880     4  0.0000     0.6317 0.000 0.000 0.000 1.000
#> SRR868881     2  0.0592     0.6629 0.000 0.984 0.016 0.000
#> SRR868882     2  0.0336     0.6751 0.008 0.992 0.000 0.000
#> SRR868883     2  0.0336     0.6751 0.008 0.992 0.000 0.000
#> SRR868884     2  0.0921     0.6792 0.028 0.972 0.000 0.000
#> SRR868885     2  0.0592     0.6629 0.000 0.984 0.016 0.000
#> SRR868829     1  0.6655    -0.1940 0.476 0.000 0.084 0.440
#> SRR868830     4  0.4697     0.3743 0.356 0.000 0.000 0.644
#> SRR868831     3  0.2399     0.8147 0.048 0.032 0.920 0.000
#> SRR868828     3  0.5325     0.5947 0.096 0.000 0.744 0.160
#> SRR868832     3  0.5160     0.6765 0.072 0.180 0.748 0.000
#> SRR868833     3  0.5160     0.6765 0.072 0.180 0.748 0.000
#> SRR868834     1  0.4576     0.4186 0.748 0.232 0.020 0.000
#> SRR868854     4  0.4222     0.4799 0.272 0.000 0.000 0.728
#> SRR868859     4  0.0336     0.6303 0.008 0.000 0.000 0.992
#> SRR868860     4  0.5085     0.5145 0.304 0.000 0.020 0.676
#> SRR868861     1  0.6229     0.4996 0.704 0.188 0.080 0.028
#> SRR868862     1  0.5560     0.0985 0.584 0.392 0.024 0.000
#> SRR868863     4  0.0469     0.6316 0.012 0.000 0.000 0.988
#> SRR868864     1  0.6383     0.2770 0.568 0.356 0.076 0.000
#> SRR868865     2  0.0921     0.6792 0.028 0.972 0.000 0.000
#> SRR868866     1  0.4744     0.2212 0.736 0.000 0.024 0.240
#> SRR868867     1  0.7071     0.2828 0.560 0.344 0.060 0.036
#> SRR868868     1  0.4744     0.2212 0.736 0.000 0.024 0.240
#> SRR868869     1  0.4744     0.2212 0.736 0.000 0.024 0.240
#> SRR868870     4  0.0000     0.6317 0.000 0.000 0.000 1.000
#> SRR868871     2  0.1109     0.6777 0.028 0.968 0.004 0.000
#> SRR868873     4  0.0000     0.6317 0.000 0.000 0.000 1.000
#> SRR868872     2  0.0921     0.6792 0.028 0.972 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.4512     0.6709 0.744 0.204 0.012 0.000 0.040
#> SRR868807     1  0.5142     0.6870 0.716 0.020 0.188 0.000 0.076
#> SRR868808     2  0.5707     0.3314 0.364 0.544 0.000 0.000 0.092
#> SRR868809     1  0.4438     0.6696 0.748 0.204 0.012 0.000 0.036
#> SRR868810     2  0.0000     0.8091 0.000 1.000 0.000 0.000 0.000
#> SRR868811     4  0.2331     0.8189 0.000 0.000 0.020 0.900 0.080
#> SRR868812     1  0.5094     0.7135 0.740 0.156 0.048 0.000 0.056
#> SRR868813     5  0.5003     0.7548 0.076 0.000 0.172 0.020 0.732
#> SRR868814     5  0.5104     0.8535 0.076 0.000 0.032 0.156 0.736
#> SRR868815     5  0.5104     0.8535 0.076 0.000 0.032 0.156 0.736
#> SRR868816     3  0.0000     0.8737 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000     0.8737 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000     0.8737 0.000 0.000 1.000 0.000 0.000
#> SRR868819     2  0.5323     0.5040 0.296 0.624 0.000 0.000 0.080
#> SRR868820     2  0.6012     0.3169 0.376 0.504 0.000 0.000 0.120
#> SRR868821     2  0.6004     0.3224 0.372 0.508 0.000 0.000 0.120
#> SRR868822     1  0.1569     0.7212 0.944 0.008 0.004 0.000 0.044
#> SRR868824     3  0.4119     0.7208 0.212 0.000 0.752 0.000 0.036
#> SRR868823     3  0.5070     0.4886 0.160 0.000 0.712 0.004 0.124
#> SRR868825     1  0.3339     0.7015 0.852 0.004 0.072 0.000 0.072
#> SRR868826     3  0.0162     0.8733 0.000 0.000 0.996 0.000 0.004
#> SRR868827     5  0.5640     0.7717 0.080 0.000 0.156 0.060 0.704
#> SRR868835     1  0.5774     0.4811 0.548 0.000 0.020 0.052 0.380
#> SRR868836     1  0.2067     0.7263 0.920 0.032 0.000 0.000 0.048
#> SRR868837     1  0.4627     0.6814 0.732 0.000 0.188 0.000 0.080
#> SRR868838     5  0.5424     0.8092 0.072 0.000 0.012 0.264 0.652
#> SRR868839     2  0.5182     0.3526 0.412 0.544 0.000 0.000 0.044
#> SRR868840     1  0.5632     0.6961 0.704 0.056 0.156 0.000 0.084
#> SRR868841     1  0.6608     0.4136 0.524 0.000 0.136 0.024 0.316
#> SRR868842     1  0.0932     0.7141 0.972 0.004 0.004 0.000 0.020
#> SRR868843     1  0.4978     0.7136 0.752 0.076 0.136 0.000 0.036
#> SRR868844     3  0.0290     0.8729 0.000 0.000 0.992 0.000 0.008
#> SRR868845     5  0.6077     0.6008 0.060 0.000 0.032 0.364 0.544
#> SRR868846     1  0.0324     0.7143 0.992 0.004 0.004 0.000 0.000
#> SRR868847     1  0.5578     0.6183 0.644 0.000 0.180 0.000 0.176
#> SRR868848     1  0.5774     0.4811 0.548 0.000 0.020 0.052 0.380
#> SRR868849     1  0.4196     0.0377 0.640 0.356 0.004 0.000 0.000
#> SRR868850     5  0.5456     0.8479 0.100 0.000 0.032 0.160 0.708
#> SRR868851     4  0.0162     0.9066 0.004 0.000 0.000 0.996 0.000
#> SRR868852     2  0.5056     0.4555 0.360 0.596 0.000 0.000 0.044
#> SRR868853     1  0.4887     0.4823 0.660 0.288 0.000 0.000 0.052
#> SRR868855     1  0.3733     0.7050 0.804 0.004 0.160 0.000 0.032
#> SRR868856     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.000
#> SRR868857     1  0.3681     0.6621 0.808 0.148 0.000 0.000 0.044
#> SRR868858     1  0.4364     0.6064 0.736 0.216 0.000 0.000 0.048
#> SRR868874     4  0.2732     0.8400 0.000 0.000 0.000 0.840 0.160
#> SRR868875     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000
#> SRR868876     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000
#> SRR868877     4  0.2690     0.8400 0.000 0.000 0.000 0.844 0.156
#> SRR868878     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000
#> SRR868879     4  0.2852     0.8376 0.000 0.000 0.000 0.828 0.172
#> SRR868880     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.000
#> SRR868881     2  0.0000     0.8091 0.000 1.000 0.000 0.000 0.000
#> SRR868882     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000
#> SRR868883     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000
#> SRR868884     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000
#> SRR868885     2  0.0000     0.8091 0.000 1.000 0.000 0.000 0.000
#> SRR868829     5  0.5869     0.8107 0.080 0.000 0.116 0.108 0.696
#> SRR868830     5  0.5360     0.8156 0.076 0.000 0.012 0.244 0.668
#> SRR868831     3  0.1106     0.8649 0.012 0.000 0.964 0.000 0.024
#> SRR868828     3  0.2514     0.8104 0.000 0.000 0.896 0.060 0.044
#> SRR868832     3  0.2930     0.7847 0.164 0.000 0.832 0.000 0.004
#> SRR868833     3  0.2848     0.7885 0.156 0.000 0.840 0.000 0.004
#> SRR868834     1  0.1644     0.7205 0.940 0.008 0.004 0.000 0.048
#> SRR868854     4  0.1568     0.8460 0.020 0.000 0.000 0.944 0.036
#> SRR868859     4  0.0609     0.9049 0.000 0.000 0.000 0.980 0.020
#> SRR868860     4  0.2561     0.8448 0.000 0.000 0.000 0.856 0.144
#> SRR868861     1  0.2141     0.7113 0.916 0.000 0.004 0.016 0.064
#> SRR868862     1  0.3969     0.2164 0.692 0.304 0.004 0.000 0.000
#> SRR868863     4  0.0510     0.9062 0.000 0.000 0.000 0.984 0.016
#> SRR868864     1  0.3958     0.6848 0.776 0.184 0.000 0.000 0.040
#> SRR868865     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000
#> SRR868866     1  0.6186     0.4653 0.544 0.000 0.012 0.112 0.332
#> SRR868867     1  0.2490     0.7070 0.896 0.004 0.000 0.020 0.080
#> SRR868868     1  0.6103     0.4731 0.568 0.000 0.012 0.112 0.308
#> SRR868869     1  0.6186     0.4653 0.544 0.000 0.012 0.112 0.332
#> SRR868870     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.000
#> SRR868871     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000
#> SRR868873     4  0.0510     0.9062 0.000 0.000 0.000 0.984 0.016
#> SRR868872     2  0.0290     0.8135 0.008 0.992 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     1  0.5040     0.6000 0.672 0.152 0.012 0.000 0.000 0.164
#> SRR868807     1  0.6788     0.3797 0.472 0.008 0.160 0.000 0.060 0.300
#> SRR868808     1  0.1845     0.4442 0.916 0.072 0.000 0.000 0.008 0.004
#> SRR868809     1  0.5026     0.6093 0.656 0.160 0.004 0.000 0.000 0.180
#> SRR868810     2  0.1714     0.8853 0.092 0.908 0.000 0.000 0.000 0.000
#> SRR868811     4  0.2980     0.7801 0.000 0.012 0.000 0.808 0.180 0.000
#> SRR868812     1  0.2728     0.4583 0.884 0.048 0.016 0.000 0.004 0.048
#> SRR868813     5  0.1168     0.8514 0.000 0.000 0.016 0.000 0.956 0.028
#> SRR868814     5  0.0858     0.8546 0.000 0.000 0.000 0.004 0.968 0.028
#> SRR868815     5  0.0858     0.8546 0.000 0.000 0.000 0.004 0.968 0.028
#> SRR868816     3  0.0000     0.9319 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000     0.9319 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000     0.9319 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     1  0.2826     0.4037 0.844 0.128 0.000 0.000 0.000 0.028
#> SRR868820     1  0.1625     0.4425 0.928 0.060 0.000 0.000 0.012 0.000
#> SRR868821     1  0.1563     0.4433 0.932 0.056 0.000 0.000 0.012 0.000
#> SRR868822     1  0.5077     0.5708 0.564 0.092 0.000 0.000 0.000 0.344
#> SRR868824     3  0.1564     0.9047 0.040 0.000 0.936 0.000 0.000 0.024
#> SRR868823     3  0.3110     0.7440 0.000 0.000 0.792 0.000 0.012 0.196
#> SRR868825     1  0.5464     0.5229 0.524 0.092 0.012 0.000 0.000 0.372
#> SRR868826     3  0.0000     0.9319 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868827     5  0.4010     0.7898 0.004 0.000 0.020 0.004 0.708 0.264
#> SRR868835     6  0.0000     0.5923 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR868836     1  0.5277     0.5759 0.556 0.100 0.000 0.000 0.004 0.340
#> SRR868837     6  0.4831    -0.1007 0.392 0.000 0.060 0.000 0.000 0.548
#> SRR868838     5  0.5039     0.7410 0.000 0.000 0.000 0.176 0.640 0.184
#> SRR868839     1  0.5549     0.6141 0.556 0.212 0.000 0.000 0.000 0.232
#> SRR868840     6  0.5127    -0.2748 0.452 0.008 0.060 0.000 0.000 0.480
#> SRR868841     6  0.4222     0.0514 0.000 0.000 0.008 0.004 0.472 0.516
#> SRR868842     1  0.5258     0.5394 0.540 0.092 0.000 0.000 0.004 0.364
#> SRR868843     1  0.5153     0.4477 0.552 0.016 0.056 0.000 0.000 0.376
#> SRR868844     3  0.0458     0.9252 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR868845     5  0.3190     0.6514 0.000 0.000 0.000 0.220 0.772 0.008
#> SRR868846     1  0.5127     0.5425 0.544 0.092 0.000 0.000 0.000 0.364
#> SRR868847     6  0.4284     0.2990 0.256 0.000 0.056 0.000 0.000 0.688
#> SRR868848     6  0.0146     0.5926 0.004 0.000 0.000 0.000 0.000 0.996
#> SRR868849     1  0.5303     0.5765 0.600 0.204 0.000 0.000 0.000 0.196
#> SRR868850     5  0.1152     0.8490 0.000 0.000 0.000 0.004 0.952 0.044
#> SRR868851     4  0.0000     0.9202 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868852     1  0.4355     0.4230 0.556 0.420 0.000 0.000 0.000 0.024
#> SRR868853     1  0.5497     0.6257 0.556 0.176 0.000 0.000 0.000 0.268
#> SRR868855     1  0.4863     0.3866 0.528 0.000 0.060 0.000 0.000 0.412
#> SRR868856     4  0.0000     0.9202 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868857     1  0.5067     0.6257 0.612 0.120 0.000 0.000 0.000 0.268
#> SRR868858     1  0.5497     0.6257 0.556 0.176 0.000 0.000 0.000 0.268
#> SRR868874     4  0.2981     0.8496 0.000 0.000 0.000 0.820 0.020 0.160
#> SRR868875     2  0.0146     0.9603 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0146     0.9603 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868877     4  0.2945     0.8498 0.000 0.000 0.000 0.824 0.020 0.156
#> SRR868878     2  0.0146     0.9603 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868879     4  0.3053     0.8480 0.000 0.000 0.000 0.812 0.020 0.168
#> SRR868880     4  0.0000     0.9202 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868881     2  0.2219     0.8518 0.136 0.864 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000     0.9590 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000     0.9590 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     2  0.0146     0.9603 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868885     2  0.1714     0.8853 0.092 0.908 0.000 0.000 0.000 0.000
#> SRR868829     5  0.3136     0.8242 0.000 0.000 0.000 0.004 0.768 0.228
#> SRR868830     5  0.3201     0.8290 0.000 0.000 0.000 0.012 0.780 0.208
#> SRR868831     3  0.0146     0.9310 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR868828     3  0.3213     0.7371 0.000 0.000 0.784 0.004 0.204 0.008
#> SRR868832     3  0.1204     0.9057 0.056 0.000 0.944 0.000 0.000 0.000
#> SRR868833     3  0.1141     0.9089 0.052 0.000 0.948 0.000 0.000 0.000
#> SRR868834     1  0.5258     0.5394 0.540 0.092 0.000 0.000 0.004 0.364
#> SRR868854     4  0.0146     0.9191 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR868859     4  0.0725     0.9170 0.000 0.000 0.000 0.976 0.012 0.012
#> SRR868860     4  0.2178     0.8730 0.000 0.000 0.000 0.868 0.000 0.132
#> SRR868861     6  0.5216    -0.3523 0.424 0.092 0.000 0.000 0.000 0.484
#> SRR868862     1  0.4980     0.6071 0.608 0.100 0.000 0.000 0.000 0.292
#> SRR868863     4  0.0717     0.9172 0.000 0.000 0.000 0.976 0.008 0.016
#> SRR868864     1  0.5544     0.6246 0.556 0.152 0.004 0.000 0.000 0.288
#> SRR868865     2  0.0146     0.9603 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868866     6  0.0547     0.5941 0.000 0.000 0.000 0.020 0.000 0.980
#> SRR868867     6  0.5166    -0.2372 0.384 0.092 0.000 0.000 0.000 0.524
#> SRR868868     6  0.0692     0.5932 0.004 0.000 0.000 0.020 0.000 0.976
#> SRR868869     6  0.0547     0.5941 0.000 0.000 0.000 0.020 0.000 0.980
#> SRR868870     4  0.0000     0.9202 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868871     2  0.0146     0.9603 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR868873     4  0.0363     0.9178 0.000 0.000 0.000 0.988 0.000 0.012
#> SRR868872     2  0.0146     0.9603 0.004 0.996 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

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.921           0.936       0.974         0.5044 0.495   0.495
#> 3 3 0.961           0.941       0.976         0.2810 0.784   0.595
#> 4 4 0.688           0.588       0.809         0.1203 0.942   0.841
#> 5 5 0.726           0.732       0.854         0.0752 0.838   0.534
#> 6 6 0.780           0.732       0.806         0.0475 0.923   0.679

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
#> SRR868806     1  0.0000      0.968 1.000 0.000
#> SRR868807     1  0.0000      0.968 1.000 0.000
#> SRR868808     1  0.0000      0.968 1.000 0.000
#> SRR868809     1  0.0000      0.968 1.000 0.000
#> SRR868810     2  0.0000      0.976 0.000 1.000
#> SRR868811     2  0.0000      0.976 0.000 1.000
#> SRR868812     1  0.0000      0.968 1.000 0.000
#> SRR868813     1  0.0000      0.968 1.000 0.000
#> SRR868814     1  0.0000      0.968 1.000 0.000
#> SRR868815     1  0.0000      0.968 1.000 0.000
#> SRR868816     1  0.0000      0.968 1.000 0.000
#> SRR868817     1  0.0000      0.968 1.000 0.000
#> SRR868818     1  0.0000      0.968 1.000 0.000
#> SRR868819     1  0.3274      0.920 0.940 0.060
#> SRR868820     1  0.0000      0.968 1.000 0.000
#> SRR868821     1  0.0000      0.968 1.000 0.000
#> SRR868822     1  0.0000      0.968 1.000 0.000
#> SRR868824     1  0.0000      0.968 1.000 0.000
#> SRR868823     1  0.0000      0.968 1.000 0.000
#> SRR868825     1  0.0000      0.968 1.000 0.000
#> SRR868826     1  0.0000      0.968 1.000 0.000
#> SRR868827     1  0.0000      0.968 1.000 0.000
#> SRR868835     1  0.0000      0.968 1.000 0.000
#> SRR868836     1  0.0000      0.968 1.000 0.000
#> SRR868837     1  0.0000      0.968 1.000 0.000
#> SRR868838     1  0.0000      0.968 1.000 0.000
#> SRR868839     2  0.0000      0.976 0.000 1.000
#> SRR868840     1  0.1633      0.951 0.976 0.024
#> SRR868841     1  0.3733      0.910 0.928 0.072
#> SRR868842     1  0.7139      0.751 0.804 0.196
#> SRR868843     2  0.0000      0.976 0.000 1.000
#> SRR868844     1  0.0000      0.968 1.000 0.000
#> SRR868845     1  0.9358      0.472 0.648 0.352
#> SRR868846     2  0.0672      0.970 0.008 0.992
#> SRR868847     1  0.0000      0.968 1.000 0.000
#> SRR868848     1  0.3431      0.918 0.936 0.064
#> SRR868849     2  0.0000      0.976 0.000 1.000
#> SRR868850     1  0.3274      0.921 0.940 0.060
#> SRR868851     2  0.0000      0.976 0.000 1.000
#> SRR868852     2  0.0000      0.976 0.000 1.000
#> SRR868853     2  0.0000      0.976 0.000 1.000
#> SRR868855     2  0.9866      0.218 0.432 0.568
#> SRR868856     2  0.0000      0.976 0.000 1.000
#> SRR868857     2  0.1184      0.963 0.016 0.984
#> SRR868858     2  0.0000      0.976 0.000 1.000
#> SRR868874     2  0.0000      0.976 0.000 1.000
#> SRR868875     2  0.0000      0.976 0.000 1.000
#> SRR868876     2  0.0000      0.976 0.000 1.000
#> SRR868877     2  0.0000      0.976 0.000 1.000
#> SRR868878     2  0.0000      0.976 0.000 1.000
#> SRR868879     2  0.0000      0.976 0.000 1.000
#> SRR868880     2  0.0000      0.976 0.000 1.000
#> SRR868881     2  0.0000      0.976 0.000 1.000
#> SRR868882     2  0.0000      0.976 0.000 1.000
#> SRR868883     2  0.0000      0.976 0.000 1.000
#> SRR868884     2  0.0000      0.976 0.000 1.000
#> SRR868885     2  0.0000      0.976 0.000 1.000
#> SRR868829     1  0.0000      0.968 1.000 0.000
#> SRR868830     1  0.0000      0.968 1.000 0.000
#> SRR868831     1  0.0000      0.968 1.000 0.000
#> SRR868828     1  0.0000      0.968 1.000 0.000
#> SRR868832     1  0.0000      0.968 1.000 0.000
#> SRR868833     1  0.0000      0.968 1.000 0.000
#> SRR868834     1  0.0000      0.968 1.000 0.000
#> SRR868854     2  0.4939      0.870 0.108 0.892
#> SRR868859     2  0.0000      0.976 0.000 1.000
#> SRR868860     2  0.0000      0.976 0.000 1.000
#> SRR868861     1  0.9833      0.265 0.576 0.424
#> SRR868862     2  0.0000      0.976 0.000 1.000
#> SRR868863     2  0.0000      0.976 0.000 1.000
#> SRR868864     1  0.0000      0.968 1.000 0.000
#> SRR868865     2  0.0000      0.976 0.000 1.000
#> SRR868866     2  0.6531      0.793 0.168 0.832
#> SRR868867     2  0.0376      0.973 0.004 0.996
#> SRR868868     2  0.5408      0.852 0.124 0.876
#> SRR868869     1  0.0000      0.968 1.000 0.000
#> SRR868870     2  0.0000      0.976 0.000 1.000
#> SRR868871     2  0.0000      0.976 0.000 1.000
#> SRR868873     2  0.0000      0.976 0.000 1.000
#> SRR868872     2  0.0000      0.976 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
#> SRR868806     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868807     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868808     1  0.2448      0.901 0.924 0.000 0.076
#> SRR868809     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868810     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868811     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868812     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868813     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868814     1  0.1753      0.926 0.952 0.048 0.000
#> SRR868815     1  0.0237      0.957 0.996 0.004 0.000
#> SRR868816     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868817     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868818     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868819     3  0.0237      0.993 0.004 0.000 0.996
#> SRR868820     1  0.0237      0.957 0.996 0.000 0.004
#> SRR868821     1  0.0424      0.954 0.992 0.000 0.008
#> SRR868822     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868824     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868823     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868825     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868826     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868827     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868835     1  0.0237      0.957 0.996 0.004 0.000
#> SRR868836     1  0.1529      0.932 0.960 0.000 0.040
#> SRR868837     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868838     1  0.4931      0.705 0.768 0.232 0.000
#> SRR868839     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868840     1  0.0237      0.957 0.996 0.000 0.004
#> SRR868841     1  0.6307      0.065 0.512 0.488 0.000
#> SRR868842     3  0.1964      0.931 0.056 0.000 0.944
#> SRR868843     3  0.0237      0.993 0.000 0.004 0.996
#> SRR868844     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868845     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868846     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868847     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868848     2  0.6095      0.300 0.392 0.608 0.000
#> SRR868849     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868850     2  0.0424      0.965 0.008 0.992 0.000
#> SRR868851     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868852     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868853     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868855     1  0.3619      0.838 0.864 0.000 0.136
#> SRR868856     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868857     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868858     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868874     2  0.0237      0.969 0.000 0.996 0.004
#> SRR868875     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868876     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868877     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868878     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868879     2  0.0237      0.969 0.000 0.996 0.004
#> SRR868880     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868881     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868882     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868883     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868884     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868885     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868829     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868830     1  0.3116      0.869 0.892 0.108 0.000
#> SRR868831     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868828     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868832     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868833     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868834     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868854     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868859     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868860     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868861     1  0.4750      0.733 0.784 0.000 0.216
#> SRR868862     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868863     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868864     1  0.0747      0.950 0.984 0.000 0.016
#> SRR868865     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868866     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868867     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868868     2  0.0237      0.969 0.004 0.996 0.000
#> SRR868869     1  0.2796      0.885 0.908 0.092 0.000
#> SRR868870     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868871     3  0.0000      0.997 0.000 0.000 1.000
#> SRR868873     2  0.0000      0.972 0.000 1.000 0.000
#> SRR868872     3  0.0000      0.997 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
#> SRR868806     1  0.0937     0.7434 0.976 0.012 0.012 0.000
#> SRR868807     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868808     1  0.2345     0.6632 0.900 0.100 0.000 0.000
#> SRR868809     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868810     2  0.1637     0.8517 0.000 0.940 0.060 0.000
#> SRR868811     4  0.4972     0.4739 0.000 0.000 0.456 0.544
#> SRR868812     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868813     3  0.5126     0.1467 0.444 0.000 0.552 0.004
#> SRR868814     3  0.6449     0.1476 0.452 0.000 0.480 0.068
#> SRR868815     1  0.5277    -0.2144 0.532 0.000 0.460 0.008
#> SRR868816     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868817     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868818     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868819     2  0.4866     0.5015 0.000 0.596 0.404 0.000
#> SRR868820     1  0.5778     0.1347 0.500 0.028 0.472 0.000
#> SRR868821     1  0.5774     0.1495 0.508 0.028 0.464 0.000
#> SRR868822     1  0.2888     0.6611 0.872 0.004 0.124 0.000
#> SRR868824     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868823     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868825     1  0.1716     0.7178 0.936 0.000 0.064 0.000
#> SRR868826     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868827     1  0.4907     0.2808 0.580 0.000 0.420 0.000
#> SRR868835     4  0.7464    -0.1305 0.328 0.000 0.192 0.480
#> SRR868836     1  0.5279     0.4569 0.704 0.044 0.252 0.000
#> SRR868837     1  0.0524     0.7501 0.988 0.004 0.008 0.000
#> SRR868838     1  0.6115     0.3361 0.680 0.000 0.148 0.172
#> SRR868839     2  0.0000     0.8814 0.000 1.000 0.000 0.000
#> SRR868840     1  0.5105    -0.1331 0.564 0.004 0.432 0.000
#> SRR868841     1  0.6145    -0.2842 0.492 0.000 0.460 0.048
#> SRR868842     2  0.7590     0.0823 0.272 0.480 0.248 0.000
#> SRR868843     2  0.3123     0.7509 0.000 0.844 0.156 0.000
#> SRR868844     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868845     4  0.4981     0.4675 0.000 0.000 0.464 0.536
#> SRR868846     2  0.4413     0.7415 0.040 0.812 0.140 0.008
#> SRR868847     1  0.0188     0.7518 0.996 0.000 0.004 0.000
#> SRR868848     4  0.3984     0.5910 0.132 0.000 0.040 0.828
#> SRR868849     2  0.4761     0.5626 0.000 0.664 0.332 0.004
#> SRR868850     4  0.5597     0.4429 0.020 0.000 0.464 0.516
#> SRR868851     4  0.0921     0.7257 0.000 0.000 0.028 0.972
#> SRR868852     2  0.0000     0.8814 0.000 1.000 0.000 0.000
#> SRR868853     2  0.0000     0.8814 0.000 1.000 0.000 0.000
#> SRR868855     1  0.5004     0.1464 0.604 0.392 0.004 0.000
#> SRR868856     4  0.3801     0.6604 0.000 0.000 0.220 0.780
#> SRR868857     2  0.0000     0.8814 0.000 1.000 0.000 0.000
#> SRR868858     2  0.0000     0.8814 0.000 1.000 0.000 0.000
#> SRR868874     4  0.0524     0.7229 0.000 0.004 0.008 0.988
#> SRR868875     2  0.0376     0.8803 0.000 0.992 0.004 0.004
#> SRR868876     2  0.0188     0.8813 0.000 0.996 0.004 0.000
#> SRR868877     4  0.0336     0.7239 0.000 0.000 0.008 0.992
#> SRR868878     2  0.0188     0.8813 0.000 0.996 0.004 0.000
#> SRR868879     4  0.0524     0.7229 0.000 0.004 0.008 0.988
#> SRR868880     4  0.0000     0.7255 0.000 0.000 0.000 1.000
#> SRR868881     2  0.1940     0.8406 0.000 0.924 0.076 0.000
#> SRR868882     2  0.0000     0.8814 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0469     0.8776 0.000 0.988 0.012 0.000
#> SRR868884     2  0.0188     0.8813 0.000 0.996 0.004 0.000
#> SRR868885     2  0.3764     0.7302 0.000 0.784 0.216 0.000
#> SRR868829     1  0.1576     0.7284 0.948 0.000 0.048 0.004
#> SRR868830     1  0.4964     0.4943 0.764 0.000 0.068 0.168
#> SRR868831     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868828     1  0.0592     0.7446 0.984 0.000 0.016 0.000
#> SRR868832     1  0.0592     0.7478 0.984 0.000 0.016 0.000
#> SRR868833     1  0.0000     0.7529 1.000 0.000 0.000 0.000
#> SRR868834     1  0.4868     0.4201 0.684 0.012 0.304 0.000
#> SRR868854     4  0.1118     0.7203 0.000 0.000 0.036 0.964
#> SRR868859     4  0.4989     0.4708 0.000 0.000 0.472 0.528
#> SRR868860     4  0.0188     0.7249 0.000 0.000 0.004 0.996
#> SRR868861     1  0.6177     0.1655 0.528 0.020 0.432 0.020
#> SRR868862     2  0.4720     0.5744 0.000 0.672 0.324 0.004
#> SRR868863     4  0.4072     0.6454 0.000 0.000 0.252 0.748
#> SRR868864     1  0.1389     0.7225 0.952 0.048 0.000 0.000
#> SRR868865     2  0.0188     0.8813 0.000 0.996 0.004 0.000
#> SRR868866     4  0.4776     0.3281 0.000 0.000 0.376 0.624
#> SRR868867     3  0.8025    -0.2252 0.016 0.376 0.420 0.188
#> SRR868868     4  0.4907     0.2679 0.000 0.000 0.420 0.580
#> SRR868869     3  0.7916     0.0835 0.320 0.000 0.356 0.324
#> SRR868870     4  0.0336     0.7262 0.000 0.000 0.008 0.992
#> SRR868871     2  0.0376     0.8803 0.000 0.992 0.004 0.004
#> SRR868873     4  0.2345     0.7075 0.000 0.000 0.100 0.900
#> SRR868872     2  0.0376     0.8803 0.000 0.992 0.004 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
#> SRR868806     3  0.2366      0.843 0.028 0.028 0.916 0.000 0.028
#> SRR868807     3  0.0324      0.873 0.004 0.000 0.992 0.000 0.004
#> SRR868808     3  0.3551      0.663 0.000 0.220 0.772 0.000 0.008
#> SRR868809     3  0.0162      0.873 0.000 0.000 0.996 0.000 0.004
#> SRR868810     2  0.3642      0.702 0.008 0.760 0.000 0.000 0.232
#> SRR868811     5  0.3895      0.610 0.000 0.000 0.000 0.320 0.680
#> SRR868812     3  0.0451      0.871 0.008 0.000 0.988 0.000 0.004
#> SRR868813     5  0.2574      0.645 0.012 0.000 0.112 0.000 0.876
#> SRR868814     5  0.2690      0.643 0.000 0.000 0.156 0.000 0.844
#> SRR868815     5  0.3796      0.512 0.000 0.000 0.300 0.000 0.700
#> SRR868816     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868819     1  0.5283      0.551 0.672 0.124 0.000 0.000 0.204
#> SRR868820     1  0.4771      0.611 0.744 0.016 0.064 0.000 0.176
#> SRR868821     1  0.4959      0.608 0.728 0.016 0.072 0.000 0.184
#> SRR868822     3  0.4983      0.472 0.280 0.008 0.668 0.000 0.044
#> SRR868824     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868823     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868825     3  0.1478      0.833 0.064 0.000 0.936 0.000 0.000
#> SRR868826     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868827     1  0.5662      0.486 0.648 0.000 0.184 0.004 0.164
#> SRR868835     4  0.6747      0.574 0.144 0.000 0.128 0.616 0.112
#> SRR868836     1  0.5418      0.435 0.568 0.068 0.364 0.000 0.000
#> SRR868837     3  0.1997      0.852 0.028 0.016 0.932 0.000 0.024
#> SRR868838     3  0.6060      0.595 0.100 0.000 0.668 0.064 0.168
#> SRR868839     2  0.0000      0.920 0.000 1.000 0.000 0.000 0.000
#> SRR868840     3  0.4268      0.178 0.000 0.000 0.556 0.000 0.444
#> SRR868841     3  0.4517      0.194 0.000 0.000 0.556 0.008 0.436
#> SRR868842     1  0.5798      0.459 0.556 0.336 0.108 0.000 0.000
#> SRR868843     2  0.0963      0.898 0.000 0.964 0.000 0.000 0.036
#> SRR868844     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868845     5  0.3684      0.651 0.000 0.000 0.000 0.280 0.720
#> SRR868846     2  0.3838      0.524 0.280 0.716 0.004 0.000 0.000
#> SRR868847     3  0.0162      0.873 0.004 0.000 0.996 0.000 0.000
#> SRR868848     4  0.4449      0.785 0.076 0.000 0.028 0.792 0.104
#> SRR868849     1  0.2852      0.646 0.828 0.172 0.000 0.000 0.000
#> SRR868850     5  0.4080      0.670 0.000 0.000 0.020 0.252 0.728
#> SRR868851     4  0.0609      0.862 0.000 0.000 0.000 0.980 0.020
#> SRR868852     2  0.0000      0.920 0.000 1.000 0.000 0.000 0.000
#> SRR868853     2  0.0000      0.920 0.000 1.000 0.000 0.000 0.000
#> SRR868855     2  0.4464      0.282 0.000 0.584 0.408 0.000 0.008
#> SRR868856     4  0.4479      0.733 0.072 0.000 0.000 0.744 0.184
#> SRR868857     2  0.0000      0.920 0.000 1.000 0.000 0.000 0.000
#> SRR868858     2  0.0324      0.918 0.000 0.992 0.004 0.000 0.004
#> SRR868874     4  0.0451      0.863 0.004 0.008 0.000 0.988 0.000
#> SRR868875     2  0.0162      0.919 0.000 0.996 0.000 0.000 0.004
#> SRR868876     2  0.0162      0.920 0.000 0.996 0.000 0.004 0.000
#> SRR868877     4  0.0162      0.865 0.004 0.000 0.000 0.996 0.000
#> SRR868878     2  0.0162      0.920 0.000 0.996 0.000 0.004 0.000
#> SRR868879     4  0.0451      0.863 0.004 0.008 0.000 0.988 0.000
#> SRR868880     4  0.0162      0.865 0.004 0.000 0.000 0.996 0.000
#> SRR868881     2  0.2930      0.778 0.004 0.832 0.000 0.000 0.164
#> SRR868882     2  0.0162      0.919 0.000 0.996 0.000 0.000 0.004
#> SRR868883     2  0.0510      0.913 0.000 0.984 0.000 0.000 0.016
#> SRR868884     2  0.0000      0.920 0.000 1.000 0.000 0.000 0.000
#> SRR868885     5  0.4935      0.233 0.040 0.344 0.000 0.000 0.616
#> SRR868829     3  0.4606      0.711 0.108 0.000 0.768 0.012 0.112
#> SRR868830     3  0.6793      0.502 0.104 0.000 0.608 0.164 0.124
#> SRR868831     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868828     3  0.0290      0.872 0.000 0.000 0.992 0.000 0.008
#> SRR868832     3  0.1270      0.844 0.052 0.000 0.948 0.000 0.000
#> SRR868833     3  0.0000      0.874 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.4152      0.570 0.692 0.012 0.296 0.000 0.000
#> SRR868854     4  0.3916      0.791 0.092 0.000 0.000 0.804 0.104
#> SRR868859     5  0.4003      0.584 0.008 0.000 0.000 0.288 0.704
#> SRR868860     4  0.0579      0.865 0.008 0.000 0.000 0.984 0.008
#> SRR868861     1  0.3081      0.671 0.868 0.000 0.072 0.056 0.004
#> SRR868862     1  0.3884      0.561 0.708 0.288 0.000 0.000 0.004
#> SRR868863     4  0.4786      0.731 0.092 0.000 0.000 0.720 0.188
#> SRR868864     3  0.2230      0.793 0.000 0.116 0.884 0.000 0.000
#> SRR868865     2  0.0000      0.920 0.000 1.000 0.000 0.000 0.000
#> SRR868866     1  0.4166      0.487 0.648 0.000 0.000 0.348 0.004
#> SRR868867     1  0.2840      0.662 0.872 0.012 0.004 0.108 0.004
#> SRR868868     1  0.3689      0.591 0.740 0.000 0.000 0.256 0.004
#> SRR868869     1  0.5753      0.409 0.552 0.000 0.084 0.360 0.004
#> SRR868870     4  0.0290      0.865 0.000 0.000 0.000 0.992 0.008
#> SRR868871     2  0.0162      0.920 0.000 0.996 0.000 0.004 0.000
#> SRR868873     4  0.1410      0.834 0.000 0.000 0.000 0.940 0.060
#> SRR868872     2  0.0162      0.920 0.000 0.996 0.000 0.004 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     3  0.3721     0.7466 0.004 0.052 0.816 0.000 0.024 0.104
#> SRR868807     3  0.0260     0.8619 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868808     3  0.4064     0.4457 0.000 0.360 0.624 0.000 0.000 0.016
#> SRR868809     3  0.0146     0.8629 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR868810     2  0.3522     0.7881 0.000 0.800 0.000 0.000 0.128 0.072
#> SRR868811     5  0.1863     0.7317 0.000 0.000 0.000 0.104 0.896 0.000
#> SRR868812     3  0.1124     0.8465 0.008 0.000 0.956 0.000 0.000 0.036
#> SRR868813     5  0.3504     0.6478 0.004 0.000 0.024 0.000 0.776 0.196
#> SRR868814     5  0.0858     0.7445 0.000 0.000 0.028 0.000 0.968 0.004
#> SRR868815     5  0.2597     0.6952 0.000 0.000 0.176 0.000 0.824 0.000
#> SRR868816     3  0.0146     0.8629 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR868817     3  0.0146     0.8629 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR868818     3  0.0146     0.8629 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR868819     1  0.5408     0.4790 0.536 0.012 0.000 0.000 0.088 0.364
#> SRR868820     1  0.5309     0.4837 0.544 0.004 0.004 0.000 0.084 0.364
#> SRR868821     1  0.5359     0.4780 0.536 0.004 0.004 0.000 0.088 0.368
#> SRR868822     3  0.5809     0.0321 0.360 0.000 0.452 0.000 0.000 0.188
#> SRR868824     3  0.0291     0.8631 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR868823     3  0.0520     0.8599 0.008 0.000 0.984 0.000 0.000 0.008
#> SRR868825     3  0.0458     0.8612 0.016 0.000 0.984 0.000 0.000 0.000
#> SRR868826     3  0.0146     0.8626 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR868827     6  0.3620     0.1920 0.184 0.000 0.044 0.000 0.000 0.772
#> SRR868835     6  0.4296     0.5940 0.016 0.000 0.004 0.348 0.004 0.628
#> SRR868836     1  0.4164     0.5792 0.728 0.012 0.220 0.000 0.000 0.040
#> SRR868837     3  0.6571     0.3281 0.256 0.008 0.532 0.000 0.068 0.136
#> SRR868838     6  0.5218     0.4585 0.004 0.000 0.284 0.020 0.068 0.624
#> SRR868839     2  0.0820     0.9384 0.016 0.972 0.000 0.000 0.000 0.012
#> SRR868840     5  0.4134     0.5017 0.004 0.000 0.340 0.000 0.640 0.016
#> SRR868841     5  0.4445     0.5605 0.004 0.000 0.296 0.000 0.656 0.044
#> SRR868842     1  0.4970     0.5761 0.680 0.192 0.112 0.000 0.000 0.016
#> SRR868843     2  0.0964     0.9381 0.000 0.968 0.004 0.000 0.016 0.012
#> SRR868844     3  0.0972     0.8527 0.028 0.000 0.964 0.000 0.000 0.008
#> SRR868845     5  0.1556     0.7412 0.000 0.000 0.000 0.080 0.920 0.000
#> SRR868846     2  0.2848     0.7819 0.160 0.828 0.004 0.008 0.000 0.000
#> SRR868847     3  0.1480     0.8390 0.040 0.000 0.940 0.000 0.000 0.020
#> SRR868848     6  0.4390     0.4624 0.016 0.000 0.000 0.472 0.004 0.508
#> SRR868849     1  0.2078     0.6777 0.912 0.044 0.000 0.004 0.000 0.040
#> SRR868850     5  0.1556     0.7412 0.000 0.000 0.000 0.080 0.920 0.000
#> SRR868851     4  0.0935     0.9547 0.000 0.000 0.000 0.964 0.032 0.004
#> SRR868852     2  0.0000     0.9541 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868853     2  0.0000     0.9541 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868855     3  0.3996     0.4358 0.004 0.352 0.636 0.000 0.008 0.000
#> SRR868856     6  0.5771     0.4097 0.000 0.000 0.000 0.380 0.176 0.444
#> SRR868857     2  0.0000     0.9541 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868858     2  0.0146     0.9531 0.000 0.996 0.004 0.000 0.000 0.000
#> SRR868874     4  0.0000     0.9713 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868875     2  0.0405     0.9515 0.000 0.988 0.000 0.000 0.008 0.004
#> SRR868876     2  0.0260     0.9532 0.000 0.992 0.000 0.008 0.000 0.000
#> SRR868877     4  0.0000     0.9713 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868878     2  0.0260     0.9532 0.000 0.992 0.000 0.008 0.000 0.000
#> SRR868879     4  0.0000     0.9713 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868880     4  0.0146     0.9708 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR868881     2  0.4024     0.7046 0.000 0.744 0.000 0.000 0.072 0.184
#> SRR868882     2  0.0146     0.9535 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR868883     2  0.0603     0.9476 0.000 0.980 0.000 0.000 0.016 0.004
#> SRR868884     2  0.0000     0.9541 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     5  0.5149     0.5269 0.024 0.120 0.000 0.000 0.672 0.184
#> SRR868829     6  0.4350     0.4415 0.008 0.000 0.328 0.012 0.008 0.644
#> SRR868830     6  0.5161     0.6148 0.012 0.000 0.076 0.264 0.008 0.640
#> SRR868831     3  0.0291     0.8631 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR868828     3  0.0547     0.8553 0.000 0.000 0.980 0.000 0.020 0.000
#> SRR868832     3  0.0603     0.8606 0.016 0.000 0.980 0.000 0.000 0.004
#> SRR868833     3  0.0291     0.8631 0.004 0.000 0.992 0.000 0.000 0.004
#> SRR868834     1  0.3149     0.6474 0.824 0.000 0.132 0.000 0.000 0.044
#> SRR868854     6  0.3975     0.5026 0.000 0.000 0.000 0.452 0.004 0.544
#> SRR868859     5  0.3806     0.5840 0.000 0.000 0.000 0.048 0.752 0.200
#> SRR868860     4  0.0937     0.9285 0.000 0.000 0.000 0.960 0.000 0.040
#> SRR868861     1  0.1895     0.6805 0.912 0.000 0.016 0.072 0.000 0.000
#> SRR868862     1  0.2100     0.6637 0.884 0.112 0.004 0.000 0.000 0.000
#> SRR868863     6  0.4219     0.5706 0.000 0.000 0.000 0.388 0.020 0.592
#> SRR868864     3  0.4283     0.5622 0.032 0.280 0.680 0.000 0.000 0.008
#> SRR868865     2  0.0000     0.9541 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868866     1  0.3695     0.4213 0.624 0.000 0.000 0.376 0.000 0.000
#> SRR868867     1  0.0935     0.6825 0.964 0.000 0.000 0.032 0.000 0.004
#> SRR868868     1  0.3547     0.4941 0.668 0.000 0.000 0.332 0.000 0.000
#> SRR868869     1  0.4740     0.5040 0.632 0.000 0.064 0.300 0.000 0.004
#> SRR868870     4  0.0547     0.9658 0.000 0.000 0.000 0.980 0.020 0.000
#> SRR868871     2  0.0260     0.9532 0.000 0.992 0.000 0.008 0.000 0.000
#> SRR868873     4  0.1007     0.9413 0.000 0.000 0.000 0.956 0.044 0.000
#> SRR868872     2  0.0260     0.9532 0.000 0.992 0.000 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-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 15961 rows and 80 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.
#>   There is no best k.
#> 
#> 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.898           0.953       0.975         0.2466 0.724   0.724
#> 3 3 0.625           0.867       0.945         0.1676 0.996   0.995
#> 4 4 0.569           0.609       0.866         0.5052 0.884   0.839
#> 5 5 0.566           0.651       0.864         0.0339 0.971   0.951
#> 6 6 0.613           0.711       0.888         0.0772 0.973   0.954

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

suggest_best_k(res)
#> [1] NA

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
#> SRR868806     2   0.000      0.996 0.000 1.000
#> SRR868807     2   0.000      0.996 0.000 1.000
#> SRR868808     2   0.000      0.996 0.000 1.000
#> SRR868809     2   0.000      0.996 0.000 1.000
#> SRR868810     2   0.000      0.996 0.000 1.000
#> SRR868811     2   0.000      0.996 0.000 1.000
#> SRR868812     2   0.000      0.996 0.000 1.000
#> SRR868813     2   0.000      0.996 0.000 1.000
#> SRR868814     2   0.000      0.996 0.000 1.000
#> SRR868815     2   0.000      0.996 0.000 1.000
#> SRR868816     1   0.000      0.847 1.000 0.000
#> SRR868817     1   0.000      0.847 1.000 0.000
#> SRR868818     1   0.000      0.847 1.000 0.000
#> SRR868819     2   0.000      0.996 0.000 1.000
#> SRR868820     2   0.000      0.996 0.000 1.000
#> SRR868821     2   0.000      0.996 0.000 1.000
#> SRR868822     1   0.985      0.453 0.572 0.428
#> SRR868824     1   0.000      0.847 1.000 0.000
#> SRR868823     1   0.961      0.544 0.616 0.384
#> SRR868825     1   0.983      0.462 0.576 0.424
#> SRR868826     1   0.680      0.794 0.820 0.180
#> SRR868827     2   0.000      0.996 0.000 1.000
#> SRR868835     2   0.000      0.996 0.000 1.000
#> SRR868836     2   0.494      0.856 0.108 0.892
#> SRR868837     2   0.000      0.996 0.000 1.000
#> SRR868838     2   0.000      0.996 0.000 1.000
#> SRR868839     2   0.000      0.996 0.000 1.000
#> SRR868840     2   0.000      0.996 0.000 1.000
#> SRR868841     2   0.000      0.996 0.000 1.000
#> SRR868842     2   0.000      0.996 0.000 1.000
#> SRR868843     2   0.000      0.996 0.000 1.000
#> SRR868844     1   0.680      0.794 0.820 0.180
#> SRR868845     2   0.000      0.996 0.000 1.000
#> SRR868846     2   0.000      0.996 0.000 1.000
#> SRR868847     2   0.000      0.996 0.000 1.000
#> SRR868848     2   0.000      0.996 0.000 1.000
#> SRR868849     2   0.000      0.996 0.000 1.000
#> SRR868850     2   0.000      0.996 0.000 1.000
#> SRR868851     2   0.000      0.996 0.000 1.000
#> SRR868852     2   0.000      0.996 0.000 1.000
#> SRR868853     2   0.000      0.996 0.000 1.000
#> SRR868855     2   0.000      0.996 0.000 1.000
#> SRR868856     2   0.000      0.996 0.000 1.000
#> SRR868857     2   0.000      0.996 0.000 1.000
#> SRR868858     2   0.000      0.996 0.000 1.000
#> SRR868874     2   0.000      0.996 0.000 1.000
#> SRR868875     2   0.000      0.996 0.000 1.000
#> SRR868876     2   0.000      0.996 0.000 1.000
#> SRR868877     2   0.000      0.996 0.000 1.000
#> SRR868878     2   0.000      0.996 0.000 1.000
#> SRR868879     2   0.000      0.996 0.000 1.000
#> SRR868880     2   0.000      0.996 0.000 1.000
#> SRR868881     2   0.000      0.996 0.000 1.000
#> SRR868882     2   0.000      0.996 0.000 1.000
#> SRR868883     2   0.000      0.996 0.000 1.000
#> SRR868884     2   0.000      0.996 0.000 1.000
#> SRR868885     2   0.000      0.996 0.000 1.000
#> SRR868829     2   0.000      0.996 0.000 1.000
#> SRR868830     2   0.000      0.996 0.000 1.000
#> SRR868831     1   0.000      0.847 1.000 0.000
#> SRR868828     1   0.722      0.780 0.800 0.200
#> SRR868832     1   0.000      0.847 1.000 0.000
#> SRR868833     1   0.000      0.847 1.000 0.000
#> SRR868834     2   0.494      0.856 0.108 0.892
#> SRR868854     2   0.000      0.996 0.000 1.000
#> SRR868859     2   0.000      0.996 0.000 1.000
#> SRR868860     2   0.000      0.996 0.000 1.000
#> SRR868861     2   0.000      0.996 0.000 1.000
#> SRR868862     2   0.000      0.996 0.000 1.000
#> SRR868863     2   0.000      0.996 0.000 1.000
#> SRR868864     2   0.000      0.996 0.000 1.000
#> SRR868865     2   0.000      0.996 0.000 1.000
#> SRR868866     2   0.000      0.996 0.000 1.000
#> SRR868867     2   0.000      0.996 0.000 1.000
#> SRR868868     2   0.000      0.996 0.000 1.000
#> SRR868869     2   0.000      0.996 0.000 1.000
#> SRR868870     2   0.000      0.996 0.000 1.000
#> SRR868871     2   0.000      0.996 0.000 1.000
#> SRR868873     2   0.000      0.996 0.000 1.000
#> SRR868872     2   0.000      0.996 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
#> SRR868806     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868807     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868808     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868809     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868810     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868811     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868812     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868813     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868814     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868815     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868816     3  0.0000      0.545 0.000 0.000 1.000
#> SRR868817     3  0.0000      0.545 0.000 0.000 1.000
#> SRR868818     3  0.0000      0.545 0.000 0.000 1.000
#> SRR868819     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868820     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868821     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868822     3  0.8454      0.432 0.316 0.112 0.572
#> SRR868824     2  0.3412      0.000 0.000 0.876 0.124
#> SRR868823     3  0.7944      0.464 0.296 0.088 0.616
#> SRR868825     3  0.8432      0.436 0.312 0.112 0.576
#> SRR868826     3  0.4291      0.585 0.180 0.000 0.820
#> SRR868827     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868835     1  0.2959      0.908 0.900 0.100 0.000
#> SRR868836     1  0.4121      0.841 0.868 0.024 0.108
#> SRR868837     1  0.0892      0.954 0.980 0.020 0.000
#> SRR868838     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868839     1  0.0000      0.960 1.000 0.000 0.000
#> SRR868840     1  0.0892      0.954 0.980 0.020 0.000
#> SRR868841     1  0.0892      0.954 0.980 0.020 0.000
#> SRR868842     1  0.0237      0.959 0.996 0.004 0.000
#> SRR868843     1  0.0892      0.954 0.980 0.020 0.000
#> SRR868844     3  0.4291      0.585 0.180 0.000 0.820
#> SRR868845     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868846     1  0.0237      0.959 0.996 0.004 0.000
#> SRR868847     1  0.2878      0.911 0.904 0.096 0.000
#> SRR868848     1  0.2878      0.911 0.904 0.096 0.000
#> SRR868849     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868850     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868851     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868852     1  0.0000      0.960 1.000 0.000 0.000
#> SRR868853     1  0.0000      0.960 1.000 0.000 0.000
#> SRR868855     1  0.0237      0.959 0.996 0.004 0.000
#> SRR868856     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868857     1  0.0000      0.960 1.000 0.000 0.000
#> SRR868858     1  0.0000      0.960 1.000 0.000 0.000
#> SRR868874     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868875     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868876     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868877     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868878     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868879     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868880     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868881     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868882     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868883     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868884     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868885     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868829     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868830     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868831     3  0.0000      0.545 0.000 0.000 1.000
#> SRR868828     3  0.4555      0.570 0.200 0.000 0.800
#> SRR868832     3  0.0000      0.545 0.000 0.000 1.000
#> SRR868833     3  0.0000      0.545 0.000 0.000 1.000
#> SRR868834     1  0.4121      0.841 0.868 0.024 0.108
#> SRR868854     1  0.0424      0.960 0.992 0.008 0.000
#> SRR868859     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868860     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868861     1  0.0237      0.959 0.996 0.004 0.000
#> SRR868862     1  0.0237      0.959 0.996 0.004 0.000
#> SRR868863     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868864     1  0.0237      0.959 0.996 0.004 0.000
#> SRR868865     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868866     1  0.1529      0.944 0.960 0.040 0.000
#> SRR868867     1  0.0237      0.959 0.996 0.004 0.000
#> SRR868868     1  0.1529      0.944 0.960 0.040 0.000
#> SRR868869     1  0.3340      0.894 0.880 0.120 0.000
#> SRR868870     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868871     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868873     1  0.0237      0.961 0.996 0.004 0.000
#> SRR868872     1  0.0237      0.961 0.996 0.004 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> SRR868806     1  0.4866   -0.37346 0.596 0.404 0.000  0
#> SRR868807     1  0.4866   -0.37346 0.596 0.404 0.000  0
#> SRR868808     1  0.4866   -0.37346 0.596 0.404 0.000  0
#> SRR868809     1  0.4866   -0.37346 0.596 0.404 0.000  0
#> SRR868810     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868811     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868812     1  0.4866   -0.37346 0.596 0.404 0.000  0
#> SRR868813     1  0.4866   -0.37346 0.596 0.404 0.000  0
#> SRR868814     2  0.4855    0.76557 0.400 0.600 0.000  0
#> SRR868815     2  0.4855    0.76557 0.400 0.600 0.000  0
#> SRR868816     3  0.3649    0.61661 0.000 0.204 0.796  0
#> SRR868817     3  0.3649    0.61661 0.000 0.204 0.796  0
#> SRR868818     3  0.3649    0.61661 0.000 0.204 0.796  0
#> SRR868819     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868820     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868821     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868822     3  0.5508    0.51314 0.020 0.408 0.572  0
#> SRR868824     4  0.0000    0.00000 0.000 0.000 0.000  1
#> SRR868823     3  0.4804    0.57028 0.000 0.384 0.616  0
#> SRR868825     3  0.5408    0.51846 0.016 0.408 0.576  0
#> SRR868826     3  0.3400    0.71434 0.000 0.180 0.820  0
#> SRR868827     2  0.4866    0.85284 0.404 0.596 0.000  0
#> SRR868835     1  0.4998   -0.65204 0.512 0.488 0.000  0
#> SRR868836     1  0.5540    0.35054 0.728 0.164 0.108  0
#> SRR868837     1  0.2081    0.74980 0.916 0.084 0.000  0
#> SRR868838     2  0.4916    0.82833 0.424 0.576 0.000  0
#> SRR868839     1  0.0469    0.82304 0.988 0.012 0.000  0
#> SRR868840     1  0.2530    0.71032 0.888 0.112 0.000  0
#> SRR868841     1  0.2530    0.71032 0.888 0.112 0.000  0
#> SRR868842     1  0.0817    0.81618 0.976 0.024 0.000  0
#> SRR868843     1  0.2647    0.69847 0.880 0.120 0.000  0
#> SRR868844     3  0.3400    0.71434 0.000 0.180 0.820  0
#> SRR868845     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868846     1  0.0817    0.81618 0.976 0.024 0.000  0
#> SRR868847     1  0.4585    0.04974 0.668 0.332 0.000  0
#> SRR868848     1  0.4624    0.00784 0.660 0.340 0.000  0
#> SRR868849     1  0.0336    0.82495 0.992 0.008 0.000  0
#> SRR868850     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868851     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868852     1  0.0469    0.82304 0.988 0.012 0.000  0
#> SRR868853     1  0.0469    0.82304 0.988 0.012 0.000  0
#> SRR868855     1  0.0592    0.82033 0.984 0.016 0.000  0
#> SRR868856     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868857     1  0.0469    0.82304 0.988 0.012 0.000  0
#> SRR868858     1  0.0469    0.82304 0.988 0.012 0.000  0
#> SRR868874     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868875     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868876     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868877     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868878     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868879     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868880     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868881     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868882     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868883     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868884     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868885     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868829     2  0.4776    0.85766 0.376 0.624 0.000  0
#> SRR868830     2  0.4776    0.85766 0.376 0.624 0.000  0
#> SRR868831     3  0.0000    0.72076 0.000 0.000 1.000  0
#> SRR868828     3  0.3751    0.70823 0.004 0.196 0.800  0
#> SRR868832     3  0.0000    0.72076 0.000 0.000 1.000  0
#> SRR868833     3  0.0000    0.72076 0.000 0.000 1.000  0
#> SRR868834     1  0.5540    0.35054 0.728 0.164 0.108  0
#> SRR868854     1  0.3801    0.43341 0.780 0.220 0.000  0
#> SRR868859     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868860     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868861     1  0.0592    0.82033 0.984 0.016 0.000  0
#> SRR868862     1  0.0592    0.82033 0.984 0.016 0.000  0
#> SRR868863     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868864     1  0.0592    0.82033 0.984 0.016 0.000  0
#> SRR868865     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868866     1  0.4193    0.26088 0.732 0.268 0.000  0
#> SRR868867     1  0.0592    0.82033 0.984 0.016 0.000  0
#> SRR868868     1  0.4193    0.26088 0.732 0.268 0.000  0
#> SRR868869     1  0.4855   -0.35904 0.600 0.400 0.000  0
#> SRR868870     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868871     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868873     1  0.0000    0.82821 1.000 0.000 0.000  0
#> SRR868872     1  0.0000    0.82821 1.000 0.000 0.000  0

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> SRR868806     1  0.4192     -0.239 0.596 0.000 0.000  0 0.404
#> SRR868807     1  0.4192     -0.239 0.596 0.000 0.000  0 0.404
#> SRR868808     1  0.4192     -0.239 0.596 0.000 0.000  0 0.404
#> SRR868809     1  0.4192     -0.239 0.596 0.000 0.000  0 0.404
#> SRR868810     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868811     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868812     1  0.4192     -0.239 0.596 0.000 0.000  0 0.404
#> SRR868813     1  0.4192     -0.239 0.596 0.000 0.000  0 0.404
#> SRR868814     5  0.6289      0.684 0.396 0.000 0.152  0 0.452
#> SRR868815     5  0.6289      0.684 0.396 0.000 0.152  0 0.452
#> SRR868816     2  0.0000      1.000 0.000 1.000 0.000  0 0.000
#> SRR868817     2  0.0000      1.000 0.000 1.000 0.000  0 0.000
#> SRR868818     2  0.0000      1.000 0.000 1.000 0.000  0 0.000
#> SRR868819     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868820     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868821     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868822     3  0.4181      0.569 0.020 0.000 0.712  0 0.268
#> SRR868824     4  0.0000      0.000 0.000 0.000 0.000  1 0.000
#> SRR868823     3  0.3366      0.610 0.000 0.000 0.768  0 0.232
#> SRR868825     3  0.4114      0.574 0.016 0.000 0.712  0 0.272
#> SRR868826     3  0.3897      0.618 0.000 0.204 0.768  0 0.028
#> SRR868827     5  0.3932      0.820 0.328 0.000 0.000  0 0.672
#> SRR868835     5  0.4256      0.698 0.436 0.000 0.000  0 0.564
#> SRR868836     1  0.4781      0.397 0.728 0.000 0.160  0 0.112
#> SRR868837     1  0.2104      0.772 0.916 0.000 0.024  0 0.060
#> SRR868838     5  0.4101      0.800 0.372 0.000 0.000  0 0.628
#> SRR868839     1  0.0404      0.841 0.988 0.000 0.000  0 0.012
#> SRR868840     1  0.2645      0.735 0.888 0.000 0.044  0 0.068
#> SRR868841     1  0.2645      0.735 0.888 0.000 0.044  0 0.068
#> SRR868842     1  0.0798      0.835 0.976 0.000 0.008  0 0.016
#> SRR868843     1  0.2790      0.724 0.880 0.000 0.052  0 0.068
#> SRR868844     3  0.3897      0.618 0.000 0.204 0.768  0 0.028
#> SRR868845     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868846     1  0.0798      0.835 0.976 0.000 0.008  0 0.016
#> SRR868847     1  0.4885      0.158 0.668 0.000 0.056  0 0.276
#> SRR868848     1  0.4928      0.122 0.660 0.000 0.056  0 0.284
#> SRR868849     1  0.0290      0.843 0.992 0.000 0.000  0 0.008
#> SRR868850     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868851     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868852     1  0.0404      0.841 0.988 0.000 0.000  0 0.012
#> SRR868853     1  0.0404      0.841 0.988 0.000 0.000  0 0.012
#> SRR868855     1  0.0510      0.839 0.984 0.000 0.000  0 0.016
#> SRR868856     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868857     1  0.0404      0.841 0.988 0.000 0.000  0 0.012
#> SRR868858     1  0.0404      0.841 0.988 0.000 0.000  0 0.012
#> SRR868874     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868875     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868876     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868877     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868878     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868879     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868880     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868881     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868882     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868883     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868884     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868885     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868829     5  0.3752      0.791 0.292 0.000 0.000  0 0.708
#> SRR868830     5  0.3752      0.791 0.292 0.000 0.000  0 0.708
#> SRR868831     3  0.3612      0.490 0.000 0.000 0.732  0 0.268
#> SRR868828     3  0.4270      0.608 0.000 0.204 0.748  0 0.048
#> SRR868832     3  0.3612      0.490 0.000 0.000 0.732  0 0.268
#> SRR868833     3  0.3612      0.490 0.000 0.000 0.732  0 0.268
#> SRR868834     1  0.4781      0.397 0.728 0.000 0.160  0 0.112
#> SRR868854     1  0.3774      0.215 0.704 0.000 0.000  0 0.296
#> SRR868859     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868860     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868861     1  0.0510      0.839 0.984 0.000 0.000  0 0.016
#> SRR868862     1  0.0510      0.839 0.984 0.000 0.000  0 0.016
#> SRR868863     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868864     1  0.0510      0.839 0.984 0.000 0.000  0 0.016
#> SRR868865     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868866     1  0.3612      0.343 0.732 0.000 0.000  0 0.268
#> SRR868867     1  0.0510      0.839 0.984 0.000 0.000  0 0.016
#> SRR868868     1  0.3612      0.343 0.732 0.000 0.000  0 0.268
#> SRR868869     1  0.4182     -0.223 0.600 0.000 0.000  0 0.400
#> SRR868870     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868871     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868873     1  0.0000      0.846 1.000 0.000 0.000  0 0.000
#> SRR868872     1  0.0000      0.846 1.000 0.000 0.000  0 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> SRR868806     1  0.3993      0.189 0.592 0.000 0.008  0 0.400 0.000
#> SRR868807     1  0.3993      0.189 0.592 0.000 0.008  0 0.400 0.000
#> SRR868808     1  0.3993      0.189 0.592 0.000 0.008  0 0.400 0.000
#> SRR868809     1  0.3993      0.189 0.592 0.000 0.008  0 0.400 0.000
#> SRR868810     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868811     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868812     1  0.3993      0.189 0.592 0.000 0.008  0 0.400 0.000
#> SRR868813     1  0.3993      0.189 0.592 0.000 0.008  0 0.400 0.000
#> SRR868814     5  0.5939      0.377 0.392 0.008 0.164  0 0.436 0.000
#> SRR868815     5  0.5939      0.377 0.392 0.008 0.164  0 0.436 0.000
#> SRR868816     6  0.0000      1.000 0.000 0.000 0.000  0 0.000 1.000
#> SRR868817     6  0.0000      1.000 0.000 0.000 0.000  0 0.000 1.000
#> SRR868818     6  0.0000      1.000 0.000 0.000 0.000  0 0.000 1.000
#> SRR868819     1  0.0146      0.871 0.996 0.000 0.000  0 0.004 0.000
#> SRR868820     1  0.0146      0.871 0.996 0.000 0.000  0 0.004 0.000
#> SRR868821     1  0.0146      0.871 0.996 0.000 0.000  0 0.004 0.000
#> SRR868822     3  0.3284      0.724 0.020 0.000 0.784  0 0.196 0.000
#> SRR868824     4  0.0000      0.000 0.000 0.000 0.000  1 0.000 0.000
#> SRR868823     3  0.2416      0.756 0.000 0.000 0.844  0 0.156 0.000
#> SRR868825     3  0.3340      0.728 0.016 0.004 0.784  0 0.196 0.000
#> SRR868826     3  0.1757      0.746 0.000 0.000 0.916  0 0.008 0.076
#> SRR868827     5  0.2697      0.407 0.092 0.000 0.044  0 0.864 0.000
#> SRR868835     5  0.3394      0.470 0.200 0.000 0.024  0 0.776 0.000
#> SRR868836     1  0.4144      0.522 0.728 0.000 0.200  0 0.072 0.000
#> SRR868837     1  0.1995      0.816 0.912 0.000 0.036  0 0.052 0.000
#> SRR868838     5  0.4146      0.522 0.288 0.000 0.036  0 0.676 0.000
#> SRR868839     1  0.0363      0.869 0.988 0.000 0.000  0 0.012 0.000
#> SRR868840     1  0.2451      0.787 0.884 0.000 0.056  0 0.060 0.000
#> SRR868841     1  0.2451      0.787 0.884 0.000 0.056  0 0.060 0.000
#> SRR868842     1  0.0806      0.863 0.972 0.000 0.008  0 0.020 0.000
#> SRR868843     1  0.2571      0.779 0.876 0.000 0.064  0 0.060 0.000
#> SRR868844     3  0.1757      0.746 0.000 0.000 0.916  0 0.008 0.076
#> SRR868845     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868846     1  0.0806      0.863 0.972 0.000 0.008  0 0.020 0.000
#> SRR868847     1  0.4757      0.328 0.636 0.000 0.084  0 0.280 0.000
#> SRR868848     1  0.4987      0.149 0.584 0.000 0.088  0 0.328 0.000
#> SRR868849     1  0.0363      0.869 0.988 0.000 0.000  0 0.012 0.000
#> SRR868850     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868851     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868852     1  0.0363      0.869 0.988 0.000 0.000  0 0.012 0.000
#> SRR868853     1  0.0363      0.869 0.988 0.000 0.000  0 0.012 0.000
#> SRR868855     1  0.0547      0.866 0.980 0.000 0.000  0 0.020 0.000
#> SRR868856     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868857     1  0.0458      0.867 0.984 0.000 0.000  0 0.016 0.000
#> SRR868858     1  0.0458      0.867 0.984 0.000 0.000  0 0.016 0.000
#> SRR868874     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868875     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868876     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868877     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868878     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868879     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868880     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868881     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868882     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868883     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868884     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868885     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868829     5  0.2176      0.245 0.024 0.000 0.080  0 0.896 0.000
#> SRR868830     5  0.2176      0.245 0.024 0.000 0.080  0 0.896 0.000
#> SRR868831     2  0.0260      1.000 0.000 0.992 0.008  0 0.000 0.000
#> SRR868828     3  0.2604      0.716 0.000 0.008 0.880  0 0.036 0.076
#> SRR868832     2  0.0260      1.000 0.000 0.992 0.008  0 0.000 0.000
#> SRR868833     2  0.0260      1.000 0.000 0.992 0.008  0 0.000 0.000
#> SRR868834     1  0.4144      0.522 0.728 0.000 0.200  0 0.072 0.000
#> SRR868854     5  0.3993      0.290 0.476 0.000 0.004  0 0.520 0.000
#> SRR868859     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868860     1  0.0547      0.858 0.980 0.000 0.000  0 0.020 0.000
#> SRR868861     1  0.0547      0.866 0.980 0.000 0.000  0 0.020 0.000
#> SRR868862     1  0.0547      0.866 0.980 0.000 0.000  0 0.020 0.000
#> SRR868863     1  0.1444      0.807 0.928 0.000 0.000  0 0.072 0.000
#> SRR868864     1  0.0547      0.866 0.980 0.000 0.000  0 0.020 0.000
#> SRR868865     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868866     1  0.3383      0.527 0.728 0.000 0.004  0 0.268 0.000
#> SRR868867     1  0.0547      0.866 0.980 0.000 0.000  0 0.020 0.000
#> SRR868868     1  0.3383      0.527 0.728 0.000 0.004  0 0.268 0.000
#> SRR868869     1  0.3984      0.199 0.596 0.000 0.008  0 0.396 0.000
#> SRR868870     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868871     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868873     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000
#> SRR868872     1  0.0000      0.871 1.000 0.000 0.000  0 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

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.851           0.855       0.942         0.3355 0.633   0.633
#> 3 3 0.471           0.802       0.850         0.7422 0.609   0.444
#> 4 4 0.512           0.444       0.705         0.1761 0.911   0.780
#> 5 5 0.538           0.379       0.683         0.0837 0.766   0.444
#> 6 6 0.611           0.544       0.707         0.0534 0.904   0.681

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
#> SRR868806     2  0.0000      0.970 0.000 1.000
#> SRR868807     1  0.9922      0.419 0.552 0.448
#> SRR868808     2  0.0000      0.970 0.000 1.000
#> SRR868809     2  1.0000     -0.317 0.496 0.504
#> SRR868810     2  0.0000      0.970 0.000 1.000
#> SRR868811     2  0.0376      0.968 0.004 0.996
#> SRR868812     1  0.9933      0.412 0.548 0.452
#> SRR868813     2  0.0000      0.970 0.000 1.000
#> SRR868814     2  0.0000      0.970 0.000 1.000
#> SRR868815     1  0.9944      0.403 0.544 0.456
#> SRR868816     1  0.0376      0.809 0.996 0.004
#> SRR868817     1  0.0376      0.809 0.996 0.004
#> SRR868818     1  0.0376      0.809 0.996 0.004
#> SRR868819     2  0.0000      0.970 0.000 1.000
#> SRR868820     2  0.0000      0.970 0.000 1.000
#> SRR868821     2  0.0000      0.970 0.000 1.000
#> SRR868822     1  0.9954      0.394 0.540 0.460
#> SRR868824     1  0.0376      0.809 0.996 0.004
#> SRR868823     1  0.3584      0.783 0.932 0.068
#> SRR868825     1  0.0672      0.808 0.992 0.008
#> SRR868826     1  0.0376      0.809 0.996 0.004
#> SRR868827     1  1.0000      0.266 0.500 0.500
#> SRR868835     2  0.1843      0.944 0.028 0.972
#> SRR868836     2  0.0000      0.970 0.000 1.000
#> SRR868837     2  0.0000      0.970 0.000 1.000
#> SRR868838     2  0.9983     -0.237 0.476 0.524
#> SRR868839     2  0.0000      0.970 0.000 1.000
#> SRR868840     2  0.0000      0.970 0.000 1.000
#> SRR868841     2  0.0000      0.970 0.000 1.000
#> SRR868842     2  0.0000      0.970 0.000 1.000
#> SRR868843     2  0.0000      0.970 0.000 1.000
#> SRR868844     1  0.0376      0.809 0.996 0.004
#> SRR868845     2  0.0376      0.968 0.004 0.996
#> SRR868846     2  0.0000      0.970 0.000 1.000
#> SRR868847     2  0.1414      0.949 0.020 0.980
#> SRR868848     2  0.0938      0.961 0.012 0.988
#> SRR868849     2  0.0000      0.970 0.000 1.000
#> SRR868850     2  0.0000      0.970 0.000 1.000
#> SRR868851     2  0.0376      0.968 0.004 0.996
#> SRR868852     2  0.0000      0.970 0.000 1.000
#> SRR868853     2  0.0000      0.970 0.000 1.000
#> SRR868855     2  0.0000      0.970 0.000 1.000
#> SRR868856     2  0.0376      0.968 0.004 0.996
#> SRR868857     2  0.0000      0.970 0.000 1.000
#> SRR868858     2  0.0000      0.970 0.000 1.000
#> SRR868874     2  0.0376      0.968 0.004 0.996
#> SRR868875     2  0.0000      0.970 0.000 1.000
#> SRR868876     2  0.0000      0.970 0.000 1.000
#> SRR868877     2  0.0376      0.968 0.004 0.996
#> SRR868878     2  0.0000      0.970 0.000 1.000
#> SRR868879     2  0.0376      0.968 0.004 0.996
#> SRR868880     2  0.0376      0.968 0.004 0.996
#> SRR868881     2  0.0000      0.970 0.000 1.000
#> SRR868882     2  0.0000      0.970 0.000 1.000
#> SRR868883     2  0.0000      0.970 0.000 1.000
#> SRR868884     2  0.0000      0.970 0.000 1.000
#> SRR868885     2  0.0000      0.970 0.000 1.000
#> SRR868829     1  0.9129      0.583 0.672 0.328
#> SRR868830     1  0.9970      0.364 0.532 0.468
#> SRR868831     1  0.0376      0.809 0.996 0.004
#> SRR868828     1  0.0376      0.809 0.996 0.004
#> SRR868832     1  0.0376      0.809 0.996 0.004
#> SRR868833     1  0.0376      0.809 0.996 0.004
#> SRR868834     2  0.0000      0.970 0.000 1.000
#> SRR868854     2  0.0376      0.968 0.004 0.996
#> SRR868859     2  0.0376      0.968 0.004 0.996
#> SRR868860     2  0.0376      0.968 0.004 0.996
#> SRR868861     2  0.0000      0.970 0.000 1.000
#> SRR868862     2  0.0000      0.970 0.000 1.000
#> SRR868863     2  0.0376      0.968 0.004 0.996
#> SRR868864     2  0.0000      0.970 0.000 1.000
#> SRR868865     2  0.0000      0.970 0.000 1.000
#> SRR868866     2  0.0376      0.968 0.004 0.996
#> SRR868867     2  0.0000      0.970 0.000 1.000
#> SRR868868     2  0.0376      0.968 0.004 0.996
#> SRR868869     2  0.9248      0.298 0.340 0.660
#> SRR868870     2  0.0376      0.968 0.004 0.996
#> SRR868871     2  0.0000      0.970 0.000 1.000
#> SRR868873     2  0.0376      0.968 0.004 0.996
#> SRR868872     2  0.0000      0.970 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
#> SRR868806     1  0.4062      0.845 0.836 0.164 0.000
#> SRR868807     1  0.4099      0.842 0.852 0.140 0.008
#> SRR868808     1  0.4121      0.845 0.832 0.168 0.000
#> SRR868809     1  0.3983      0.843 0.852 0.144 0.004
#> SRR868810     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868811     2  0.3267      0.863 0.116 0.884 0.000
#> SRR868812     1  0.3918      0.835 0.868 0.120 0.012
#> SRR868813     1  0.3619      0.849 0.864 0.136 0.000
#> SRR868814     1  0.2625      0.837 0.916 0.084 0.000
#> SRR868815     1  0.2486      0.831 0.932 0.060 0.008
#> SRR868816     3  0.0592      0.948 0.012 0.000 0.988
#> SRR868817     3  0.0592      0.948 0.012 0.000 0.988
#> SRR868818     3  0.0592      0.948 0.012 0.000 0.988
#> SRR868819     2  0.3551      0.832 0.132 0.868 0.000
#> SRR868820     1  0.5650      0.719 0.688 0.312 0.000
#> SRR868821     1  0.5650      0.719 0.688 0.312 0.000
#> SRR868822     1  0.4099      0.842 0.852 0.140 0.008
#> SRR868824     3  0.1411      0.947 0.036 0.000 0.964
#> SRR868823     3  0.6359      0.372 0.404 0.004 0.592
#> SRR868825     1  0.5650      0.478 0.688 0.000 0.312
#> SRR868826     3  0.0747      0.951 0.016 0.000 0.984
#> SRR868827     1  0.3644      0.797 0.872 0.124 0.004
#> SRR868835     1  0.3551      0.801 0.868 0.132 0.000
#> SRR868836     1  0.4605      0.832 0.796 0.204 0.000
#> SRR868837     1  0.4605      0.832 0.796 0.204 0.000
#> SRR868838     1  0.3715      0.794 0.868 0.128 0.004
#> SRR868839     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868840     1  0.4605      0.832 0.796 0.204 0.000
#> SRR868841     1  0.2625      0.837 0.916 0.084 0.000
#> SRR868842     1  0.4178      0.844 0.828 0.172 0.000
#> SRR868843     1  0.3879      0.848 0.848 0.152 0.000
#> SRR868844     3  0.0747      0.951 0.016 0.000 0.984
#> SRR868845     2  0.3116      0.858 0.108 0.892 0.000
#> SRR868846     1  0.4062      0.845 0.836 0.164 0.000
#> SRR868847     1  0.3116      0.845 0.892 0.108 0.000
#> SRR868848     1  0.3619      0.803 0.864 0.136 0.000
#> SRR868849     2  0.3038      0.851 0.104 0.896 0.000
#> SRR868850     1  0.6244      0.253 0.560 0.440 0.000
#> SRR868851     2  0.3816      0.796 0.148 0.852 0.000
#> SRR868852     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868853     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868855     2  0.6299     -0.263 0.476 0.524 0.000
#> SRR868856     2  0.2537      0.847 0.080 0.920 0.000
#> SRR868857     1  0.5591      0.739 0.696 0.304 0.000
#> SRR868858     2  0.5650      0.419 0.312 0.688 0.000
#> SRR868874     2  0.2537      0.847 0.080 0.920 0.000
#> SRR868875     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868876     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868877     2  0.2537      0.847 0.080 0.920 0.000
#> SRR868878     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868879     2  0.2537      0.847 0.080 0.920 0.000
#> SRR868880     2  0.2537      0.847 0.080 0.920 0.000
#> SRR868881     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868882     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868883     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868884     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868885     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868829     1  0.3805      0.768 0.884 0.092 0.024
#> SRR868830     1  0.3618      0.781 0.884 0.104 0.012
#> SRR868831     3  0.1163      0.949 0.028 0.000 0.972
#> SRR868828     3  0.0747      0.951 0.016 0.000 0.984
#> SRR868832     3  0.0892      0.951 0.020 0.000 0.980
#> SRR868833     3  0.0892      0.951 0.020 0.000 0.980
#> SRR868834     1  0.4178      0.844 0.828 0.172 0.000
#> SRR868854     1  0.5497      0.695 0.708 0.292 0.000
#> SRR868859     2  0.2959      0.833 0.100 0.900 0.000
#> SRR868860     2  0.2625      0.846 0.084 0.916 0.000
#> SRR868861     1  0.6062      0.571 0.616 0.384 0.000
#> SRR868862     2  0.3038      0.851 0.104 0.896 0.000
#> SRR868863     2  0.2537      0.847 0.080 0.920 0.000
#> SRR868864     1  0.4235      0.843 0.824 0.176 0.000
#> SRR868865     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868866     1  0.5905      0.553 0.648 0.352 0.000
#> SRR868867     1  0.6079      0.562 0.612 0.388 0.000
#> SRR868868     1  0.5905      0.553 0.648 0.352 0.000
#> SRR868869     1  0.3851      0.809 0.860 0.136 0.004
#> SRR868870     2  0.2537      0.847 0.080 0.920 0.000
#> SRR868871     2  0.2165      0.885 0.064 0.936 0.000
#> SRR868873     2  0.2537      0.847 0.080 0.920 0.000
#> SRR868872     2  0.2165      0.885 0.064 0.936 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.6612     0.2838 0.612 0.132 0.000 0.256
#> SRR868807     1  0.3601     0.5619 0.860 0.084 0.000 0.056
#> SRR868808     1  0.7137     0.1487 0.556 0.188 0.000 0.256
#> SRR868809     1  0.4071     0.5460 0.832 0.104 0.000 0.064
#> SRR868810     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868811     2  0.5247     0.5550 0.032 0.684 0.000 0.284
#> SRR868812     1  0.2466     0.5747 0.916 0.056 0.000 0.028
#> SRR868813     1  0.4893     0.4930 0.768 0.064 0.000 0.168
#> SRR868814     1  0.2973     0.5617 0.884 0.020 0.000 0.096
#> SRR868815     1  0.2796     0.5610 0.892 0.016 0.000 0.092
#> SRR868816     3  0.1792     0.9470 0.000 0.000 0.932 0.068
#> SRR868817     3  0.1792     0.9470 0.000 0.000 0.932 0.068
#> SRR868818     3  0.1792     0.9470 0.000 0.000 0.932 0.068
#> SRR868819     2  0.6882    -0.3469 0.108 0.500 0.000 0.392
#> SRR868820     4  0.7851     0.5207 0.280 0.324 0.000 0.396
#> SRR868821     4  0.7851     0.5207 0.280 0.324 0.000 0.396
#> SRR868822     1  0.3486     0.5573 0.864 0.092 0.000 0.044
#> SRR868824     3  0.2376     0.9555 0.016 0.000 0.916 0.068
#> SRR868823     1  0.5627     0.3715 0.684 0.008 0.268 0.040
#> SRR868825     1  0.5459     0.4044 0.700 0.008 0.256 0.036
#> SRR868826     3  0.0707     0.9621 0.020 0.000 0.980 0.000
#> SRR868827     1  0.2401     0.5497 0.904 0.004 0.000 0.092
#> SRR868835     1  0.2401     0.5497 0.904 0.004 0.000 0.092
#> SRR868836     1  0.7138     0.0926 0.552 0.180 0.000 0.268
#> SRR868837     1  0.7082     0.1300 0.564 0.184 0.000 0.252
#> SRR868838     1  0.2773     0.5369 0.880 0.004 0.000 0.116
#> SRR868839     2  0.5156     0.1527 0.044 0.720 0.000 0.236
#> SRR868840     1  0.7082     0.1300 0.564 0.184 0.000 0.252
#> SRR868841     1  0.3279     0.5462 0.872 0.032 0.000 0.096
#> SRR868842     1  0.6994     0.1313 0.560 0.152 0.000 0.288
#> SRR868843     1  0.4499     0.5107 0.804 0.072 0.000 0.124
#> SRR868844     3  0.0707     0.9621 0.020 0.000 0.980 0.000
#> SRR868845     2  0.6016     0.4557 0.044 0.544 0.000 0.412
#> SRR868846     1  0.6916     0.1626 0.572 0.148 0.000 0.280
#> SRR868847     1  0.2060     0.5767 0.932 0.052 0.000 0.016
#> SRR868848     1  0.2546     0.5508 0.900 0.008 0.000 0.092
#> SRR868849     2  0.6544    -0.1973 0.112 0.604 0.000 0.284
#> SRR868850     4  0.7799     0.4829 0.308 0.272 0.000 0.420
#> SRR868851     2  0.6646     0.3986 0.084 0.488 0.000 0.428
#> SRR868852     2  0.4576     0.2264 0.020 0.748 0.000 0.232
#> SRR868853     2  0.5137     0.1435 0.040 0.716 0.000 0.244
#> SRR868855     2  0.7362    -0.4660 0.220 0.524 0.000 0.256
#> SRR868856     2  0.5827     0.5426 0.052 0.632 0.000 0.316
#> SRR868857     1  0.7896    -0.4992 0.360 0.348 0.000 0.292
#> SRR868858     2  0.6957    -0.3310 0.172 0.580 0.000 0.248
#> SRR868874     2  0.5742     0.5473 0.052 0.648 0.000 0.300
#> SRR868875     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868876     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868877     2  0.5742     0.5473 0.052 0.648 0.000 0.300
#> SRR868878     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868879     2  0.5742     0.5473 0.052 0.648 0.000 0.300
#> SRR868880     2  0.5742     0.5473 0.052 0.648 0.000 0.300
#> SRR868881     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868882     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868884     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868829     1  0.2281     0.5474 0.904 0.000 0.000 0.096
#> SRR868830     1  0.2281     0.5474 0.904 0.000 0.000 0.096
#> SRR868831     3  0.2060     0.9600 0.016 0.000 0.932 0.052
#> SRR868828     3  0.1284     0.9604 0.024 0.000 0.964 0.012
#> SRR868832     3  0.2060     0.9600 0.016 0.000 0.932 0.052
#> SRR868833     3  0.2060     0.9600 0.016 0.000 0.932 0.052
#> SRR868834     1  0.6890     0.1911 0.580 0.152 0.000 0.268
#> SRR868854     1  0.6611    -0.0632 0.464 0.080 0.000 0.456
#> SRR868859     2  0.6356     0.5198 0.084 0.596 0.000 0.320
#> SRR868860     2  0.5884     0.5376 0.052 0.620 0.000 0.328
#> SRR868861     4  0.7919     0.5250 0.324 0.324 0.000 0.352
#> SRR868862     2  0.6674    -0.2591 0.116 0.584 0.000 0.300
#> SRR868863     2  0.6120     0.5379 0.076 0.628 0.000 0.296
#> SRR868864     1  0.6971     0.1609 0.568 0.156 0.000 0.276
#> SRR868865     2  0.0376     0.5903 0.004 0.992 0.000 0.004
#> SRR868866     4  0.6939     0.5352 0.332 0.128 0.000 0.540
#> SRR868867     2  0.7806    -0.6483 0.252 0.392 0.000 0.356
#> SRR868868     4  0.6939     0.5352 0.332 0.128 0.000 0.540
#> SRR868869     1  0.5755     0.1763 0.624 0.044 0.000 0.332
#> SRR868870     2  0.5742     0.5473 0.052 0.648 0.000 0.300
#> SRR868871     2  0.0000     0.5978 0.000 1.000 0.000 0.000
#> SRR868873     2  0.5742     0.5473 0.052 0.648 0.000 0.300
#> SRR868872     2  0.0000     0.5978 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.3591    0.49283 0.836 0.028 0.000 0.020 0.116
#> SRR868807     1  0.5015   -0.10669 0.576 0.004 0.000 0.028 0.392
#> SRR868808     1  0.4432    0.52835 0.788 0.080 0.000 0.020 0.112
#> SRR868809     1  0.5334   -0.02781 0.588 0.020 0.000 0.028 0.364
#> SRR868810     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868811     2  0.4227   -0.51305 0.000 0.580 0.000 0.420 0.000
#> SRR868812     1  0.5303   -0.27255 0.516 0.004 0.000 0.040 0.440
#> SRR868813     1  0.4508    0.35856 0.740 0.008 0.000 0.044 0.208
#> SRR868814     5  0.6207    0.59593 0.348 0.008 0.000 0.120 0.524
#> SRR868815     5  0.6186    0.60661 0.340 0.008 0.000 0.120 0.532
#> SRR868816     3  0.2221    0.92373 0.000 0.000 0.912 0.036 0.052
#> SRR868817     3  0.2221    0.92373 0.000 0.000 0.912 0.036 0.052
#> SRR868818     3  0.2221    0.92373 0.000 0.000 0.912 0.036 0.052
#> SRR868819     1  0.7502    0.32963 0.432 0.332 0.000 0.172 0.064
#> SRR868820     1  0.7207    0.45279 0.524 0.240 0.000 0.172 0.064
#> SRR868821     1  0.7207    0.45279 0.524 0.240 0.000 0.172 0.064
#> SRR868822     1  0.4837   -0.08661 0.604 0.012 0.000 0.012 0.372
#> SRR868824     3  0.2556    0.92871 0.004 0.004 0.900 0.068 0.024
#> SRR868823     5  0.7101    0.56851 0.288 0.000 0.200 0.032 0.480
#> SRR868825     1  0.6808   -0.29801 0.460 0.000 0.196 0.012 0.332
#> SRR868826     3  0.0510    0.93601 0.000 0.000 0.984 0.000 0.016
#> SRR868827     5  0.4495    0.77251 0.244 0.000 0.000 0.044 0.712
#> SRR868835     5  0.4495    0.77251 0.244 0.000 0.000 0.044 0.712
#> SRR868836     1  0.2990    0.56975 0.868 0.100 0.000 0.008 0.024
#> SRR868837     1  0.2769    0.55510 0.892 0.064 0.000 0.020 0.024
#> SRR868838     5  0.4944    0.74973 0.208 0.000 0.000 0.092 0.700
#> SRR868839     2  0.4697    0.00847 0.388 0.592 0.000 0.020 0.000
#> SRR868840     1  0.3097    0.54623 0.876 0.068 0.000 0.024 0.032
#> SRR868841     1  0.5175    0.20292 0.680 0.008 0.000 0.072 0.240
#> SRR868842     1  0.2243    0.56204 0.916 0.056 0.000 0.012 0.016
#> SRR868843     1  0.4408    0.30576 0.736 0.008 0.000 0.032 0.224
#> SRR868844     3  0.0510    0.93601 0.000 0.000 0.984 0.000 0.016
#> SRR868845     4  0.6456    0.77252 0.112 0.372 0.000 0.496 0.020
#> SRR868846     1  0.2363    0.55967 0.912 0.052 0.000 0.012 0.024
#> SRR868847     1  0.4705   -0.19363 0.580 0.004 0.000 0.012 0.404
#> SRR868848     5  0.5002    0.69376 0.344 0.000 0.000 0.044 0.612
#> SRR868849     1  0.5042    0.23676 0.508 0.460 0.000 0.032 0.000
#> SRR868850     1  0.6294    0.37735 0.608 0.140 0.000 0.224 0.028
#> SRR868851     4  0.6537    0.77151 0.120 0.340 0.000 0.516 0.024
#> SRR868852     2  0.4318    0.25354 0.292 0.688 0.000 0.020 0.000
#> SRR868853     2  0.4686    0.00871 0.384 0.596 0.000 0.020 0.000
#> SRR868855     1  0.4380    0.52653 0.676 0.304 0.000 0.020 0.000
#> SRR868856     2  0.5002   -0.67955 0.008 0.492 0.000 0.484 0.016
#> SRR868857     1  0.4521    0.54459 0.716 0.248 0.000 0.024 0.012
#> SRR868858     1  0.4774    0.37556 0.556 0.424 0.000 0.020 0.000
#> SRR868874     2  0.4300   -0.59638 0.000 0.524 0.000 0.476 0.000
#> SRR868875     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868876     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868877     2  0.4300   -0.59638 0.000 0.524 0.000 0.476 0.000
#> SRR868878     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868879     2  0.4300   -0.59638 0.000 0.524 0.000 0.476 0.000
#> SRR868880     2  0.4300   -0.59638 0.000 0.524 0.000 0.476 0.000
#> SRR868881     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868882     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868883     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868884     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868885     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868829     5  0.4575    0.77027 0.236 0.000 0.000 0.052 0.712
#> SRR868830     5  0.4575    0.77027 0.236 0.000 0.000 0.052 0.712
#> SRR868831     3  0.2426    0.93142 0.008 0.004 0.908 0.064 0.016
#> SRR868828     3  0.2235    0.91204 0.004 0.004 0.920 0.032 0.040
#> SRR868832     3  0.2426    0.93142 0.008 0.004 0.908 0.064 0.016
#> SRR868833     3  0.2426    0.93142 0.008 0.004 0.908 0.064 0.016
#> SRR868834     1  0.2297    0.55991 0.912 0.060 0.000 0.008 0.020
#> SRR868854     5  0.6802    0.07763 0.152 0.020 0.000 0.412 0.416
#> SRR868859     4  0.6245    0.77264 0.048 0.408 0.000 0.496 0.048
#> SRR868860     4  0.5366    0.62772 0.008 0.464 0.000 0.492 0.036
#> SRR868861     1  0.5639    0.52670 0.708 0.100 0.000 0.136 0.056
#> SRR868862     1  0.5142    0.37489 0.564 0.392 0.000 0.044 0.000
#> SRR868863     2  0.5302   -0.69295 0.008 0.488 0.000 0.472 0.032
#> SRR868864     1  0.2388    0.56010 0.900 0.072 0.000 0.000 0.028
#> SRR868865     2  0.0880    0.50462 0.032 0.968 0.000 0.000 0.000
#> SRR868866     1  0.5667    0.42410 0.636 0.028 0.000 0.276 0.060
#> SRR868867     1  0.5911    0.52304 0.684 0.124 0.000 0.136 0.056
#> SRR868868     1  0.5667    0.42410 0.636 0.028 0.000 0.276 0.060
#> SRR868869     1  0.6354    0.24509 0.560 0.008 0.000 0.240 0.192
#> SRR868870     2  0.4300   -0.59638 0.000 0.524 0.000 0.476 0.000
#> SRR868871     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000
#> SRR868873     2  0.4300   -0.59638 0.000 0.524 0.000 0.476 0.000
#> SRR868872     2  0.0404    0.52371 0.012 0.988 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     1  0.4093    0.46171 0.776 0.040 0.000 0.000 0.040 0.144
#> SRR868807     1  0.6058    0.04391 0.532 0.028 0.000 0.000 0.280 0.160
#> SRR868808     1  0.4613    0.48499 0.736 0.084 0.000 0.000 0.032 0.148
#> SRR868809     1  0.6217    0.12264 0.540 0.044 0.000 0.000 0.252 0.164
#> SRR868810     2  0.4092    0.72690 0.020 0.636 0.000 0.344 0.000 0.000
#> SRR868811     4  0.1910    0.78471 0.000 0.108 0.000 0.892 0.000 0.000
#> SRR868812     1  0.6161   -0.02746 0.504 0.028 0.000 0.000 0.304 0.164
#> SRR868813     1  0.5690    0.31823 0.616 0.032 0.000 0.004 0.116 0.232
#> SRR868814     5  0.6807    0.42662 0.260 0.028 0.000 0.016 0.452 0.244
#> SRR868815     5  0.6781    0.43664 0.252 0.028 0.000 0.016 0.460 0.244
#> SRR868816     3  0.3858    0.82842 0.000 0.084 0.796 0.000 0.016 0.104
#> SRR868817     3  0.3858    0.82842 0.000 0.084 0.796 0.000 0.016 0.104
#> SRR868818     3  0.3858    0.82842 0.000 0.084 0.796 0.000 0.016 0.104
#> SRR868819     2  0.6485    0.06954 0.328 0.452 0.000 0.040 0.000 0.180
#> SRR868820     2  0.6231   -0.12106 0.396 0.408 0.000 0.012 0.004 0.180
#> SRR868821     2  0.6123   -0.12085 0.396 0.408 0.000 0.012 0.000 0.184
#> SRR868822     1  0.5542    0.03237 0.560 0.028 0.000 0.000 0.332 0.080
#> SRR868824     3  0.3879    0.83951 0.000 0.072 0.808 0.000 0.044 0.076
#> SRR868823     5  0.6900    0.42306 0.308 0.004 0.124 0.000 0.460 0.104
#> SRR868825     1  0.6916   -0.15764 0.456 0.004 0.156 0.000 0.300 0.084
#> SRR868826     3  0.1448    0.86397 0.012 0.000 0.948 0.000 0.024 0.016
#> SRR868827     5  0.2981    0.71510 0.160 0.000 0.000 0.020 0.820 0.000
#> SRR868835     5  0.3122    0.71514 0.160 0.004 0.000 0.020 0.816 0.000
#> SRR868836     1  0.3193    0.55314 0.840 0.112 0.000 0.004 0.008 0.036
#> SRR868837     1  0.3477    0.53788 0.844 0.056 0.000 0.012 0.024 0.064
#> SRR868838     5  0.3413    0.70569 0.112 0.000 0.000 0.052 0.824 0.012
#> SRR868839     2  0.5298    0.41447 0.348 0.548 0.000 0.100 0.000 0.004
#> SRR868840     1  0.4223    0.50727 0.792 0.048 0.000 0.016 0.036 0.108
#> SRR868841     1  0.5728    0.26631 0.640 0.008 0.000 0.036 0.168 0.148
#> SRR868842     1  0.2670    0.55422 0.876 0.084 0.000 0.004 0.004 0.032
#> SRR868843     1  0.4706    0.36047 0.716 0.016 0.000 0.000 0.144 0.124
#> SRR868844     3  0.1448    0.86397 0.012 0.000 0.948 0.000 0.024 0.016
#> SRR868845     4  0.4853    0.70339 0.088 0.012 0.000 0.744 0.044 0.112
#> SRR868846     1  0.2775    0.55249 0.876 0.076 0.000 0.004 0.012 0.032
#> SRR868847     1  0.4788    0.00100 0.600 0.008 0.000 0.000 0.344 0.048
#> SRR868848     5  0.4463    0.57966 0.316 0.004 0.000 0.016 0.648 0.016
#> SRR868849     1  0.6141   -0.10402 0.464 0.392 0.000 0.084 0.000 0.060
#> SRR868850     1  0.6602    0.28380 0.532 0.020 0.000 0.256 0.044 0.148
#> SRR868851     4  0.4329    0.71592 0.096 0.008 0.000 0.780 0.032 0.084
#> SRR868852     2  0.5154    0.49548 0.292 0.600 0.000 0.104 0.000 0.004
#> SRR868853     2  0.5110    0.32049 0.396 0.528 0.000 0.072 0.000 0.004
#> SRR868855     1  0.4507    0.44428 0.720 0.212 0.000 0.044 0.008 0.016
#> SRR868856     4  0.1293    0.88558 0.004 0.004 0.000 0.956 0.016 0.020
#> SRR868857     1  0.4224    0.42416 0.700 0.256 0.000 0.008 0.000 0.036
#> SRR868858     1  0.5013    0.00846 0.536 0.408 0.000 0.044 0.008 0.004
#> SRR868874     4  0.0458    0.89506 0.000 0.016 0.000 0.984 0.000 0.000
#> SRR868875     2  0.4092    0.72690 0.020 0.636 0.000 0.344 0.000 0.000
#> SRR868876     2  0.4012    0.72714 0.016 0.640 0.000 0.344 0.000 0.000
#> SRR868877     4  0.0458    0.89506 0.000 0.016 0.000 0.984 0.000 0.000
#> SRR868878     2  0.4012    0.72714 0.016 0.640 0.000 0.344 0.000 0.000
#> SRR868879     4  0.0458    0.89506 0.000 0.016 0.000 0.984 0.000 0.000
#> SRR868880     4  0.0363    0.89574 0.000 0.012 0.000 0.988 0.000 0.000
#> SRR868881     2  0.4012    0.72714 0.016 0.640 0.000 0.344 0.000 0.000
#> SRR868882     2  0.4092    0.72690 0.020 0.636 0.000 0.344 0.000 0.000
#> SRR868883     2  0.4092    0.72690 0.020 0.636 0.000 0.344 0.000 0.000
#> SRR868884     2  0.3998    0.72751 0.016 0.644 0.000 0.340 0.000 0.000
#> SRR868885     2  0.4078    0.72750 0.020 0.640 0.000 0.340 0.000 0.000
#> SRR868829     5  0.3019    0.71352 0.128 0.000 0.000 0.020 0.840 0.012
#> SRR868830     5  0.3019    0.71352 0.128 0.000 0.000 0.020 0.840 0.012
#> SRR868831     3  0.3487    0.85295 0.004 0.068 0.840 0.000 0.036 0.052
#> SRR868828     3  0.3195    0.82949 0.008 0.008 0.852 0.000 0.068 0.064
#> SRR868832     3  0.3039    0.85838 0.000 0.068 0.860 0.000 0.020 0.052
#> SRR868833     3  0.3039    0.85838 0.000 0.068 0.860 0.000 0.020 0.052
#> SRR868834     1  0.2692    0.55377 0.880 0.072 0.000 0.004 0.008 0.036
#> SRR868854     5  0.5944    0.16216 0.064 0.008 0.000 0.380 0.504 0.044
#> SRR868859     4  0.3132    0.82788 0.032 0.008 0.000 0.864 0.032 0.064
#> SRR868860     4  0.2067    0.86608 0.004 0.004 0.000 0.916 0.048 0.028
#> SRR868861     1  0.5228    0.44556 0.572 0.072 0.000 0.008 0.004 0.344
#> SRR868862     1  0.5865    0.07786 0.520 0.356 0.000 0.052 0.000 0.072
#> SRR868863     4  0.1699    0.88308 0.004 0.012 0.000 0.936 0.040 0.008
#> SRR868864     1  0.1644    0.55530 0.920 0.076 0.000 0.004 0.000 0.000
#> SRR868865     2  0.4236    0.71616 0.036 0.656 0.000 0.308 0.000 0.000
#> SRR868866     1  0.6262    0.33351 0.468 0.016 0.000 0.120 0.020 0.376
#> SRR868867     1  0.5493    0.44015 0.544 0.096 0.000 0.008 0.004 0.348
#> SRR868868     1  0.6262    0.33351 0.468 0.016 0.000 0.120 0.020 0.376
#> SRR868869     1  0.6814    0.22617 0.404 0.008 0.000 0.088 0.104 0.396
#> SRR868870     4  0.0146    0.89607 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR868871     2  0.4092    0.72690 0.020 0.636 0.000 0.344 0.000 0.000
#> SRR868873     4  0.0458    0.89506 0.000 0.016 0.000 0.984 0.000 0.000
#> SRR868872     2  0.4012    0.72714 0.016 0.640 0.000 0.344 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-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 15961 rows and 80 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.875           0.943       0.973         0.5010 0.495   0.495
#> 3 3 0.683           0.783       0.864         0.3111 0.757   0.553
#> 4 4 0.636           0.672       0.797         0.1147 0.889   0.694
#> 5 5 0.750           0.652       0.818         0.0673 0.924   0.732
#> 6 6 0.770           0.606       0.764         0.0393 0.929   0.696

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
#> SRR868806     1  0.5842      0.831 0.860 0.140
#> SRR868807     1  0.0000      0.941 1.000 0.000
#> SRR868808     1  0.8909      0.593 0.692 0.308
#> SRR868809     1  0.0000      0.941 1.000 0.000
#> SRR868810     2  0.0000      0.999 0.000 1.000
#> SRR868811     2  0.0000      0.999 0.000 1.000
#> SRR868812     1  0.0000      0.941 1.000 0.000
#> SRR868813     1  0.2603      0.913 0.956 0.044
#> SRR868814     1  0.0000      0.941 1.000 0.000
#> SRR868815     1  0.0000      0.941 1.000 0.000
#> SRR868816     1  0.0000      0.941 1.000 0.000
#> SRR868817     1  0.0000      0.941 1.000 0.000
#> SRR868818     1  0.0000      0.941 1.000 0.000
#> SRR868819     2  0.0000      0.999 0.000 1.000
#> SRR868820     2  0.0000      0.999 0.000 1.000
#> SRR868821     2  0.0000      0.999 0.000 1.000
#> SRR868822     1  0.0000      0.941 1.000 0.000
#> SRR868824     1  0.0000      0.941 1.000 0.000
#> SRR868823     1  0.0000      0.941 1.000 0.000
#> SRR868825     1  0.0000      0.941 1.000 0.000
#> SRR868826     1  0.0000      0.941 1.000 0.000
#> SRR868827     1  0.0000      0.941 1.000 0.000
#> SRR868835     1  0.0000      0.941 1.000 0.000
#> SRR868836     1  0.7219      0.773 0.800 0.200
#> SRR868837     1  0.7219      0.773 0.800 0.200
#> SRR868838     1  0.0000      0.941 1.000 0.000
#> SRR868839     2  0.0000      0.999 0.000 1.000
#> SRR868840     1  0.7219      0.773 0.800 0.200
#> SRR868841     1  0.3274      0.903 0.940 0.060
#> SRR868842     1  0.9427      0.471 0.640 0.360
#> SRR868843     1  0.0000      0.941 1.000 0.000
#> SRR868844     1  0.0000      0.941 1.000 0.000
#> SRR868845     2  0.0000      0.999 0.000 1.000
#> SRR868846     1  0.9661      0.393 0.608 0.392
#> SRR868847     1  0.0000      0.941 1.000 0.000
#> SRR868848     1  0.0000      0.941 1.000 0.000
#> SRR868849     2  0.0000      0.999 0.000 1.000
#> SRR868850     2  0.0000      0.999 0.000 1.000
#> SRR868851     2  0.0000      0.999 0.000 1.000
#> SRR868852     2  0.0000      0.999 0.000 1.000
#> SRR868853     2  0.0000      0.999 0.000 1.000
#> SRR868855     2  0.0000      0.999 0.000 1.000
#> SRR868856     2  0.0000      0.999 0.000 1.000
#> SRR868857     2  0.0000      0.999 0.000 1.000
#> SRR868858     2  0.0000      0.999 0.000 1.000
#> SRR868874     2  0.0000      0.999 0.000 1.000
#> SRR868875     2  0.0000      0.999 0.000 1.000
#> SRR868876     2  0.0000      0.999 0.000 1.000
#> SRR868877     2  0.0000      0.999 0.000 1.000
#> SRR868878     2  0.0000      0.999 0.000 1.000
#> SRR868879     2  0.0000      0.999 0.000 1.000
#> SRR868880     2  0.0000      0.999 0.000 1.000
#> SRR868881     2  0.0000      0.999 0.000 1.000
#> SRR868882     2  0.0000      0.999 0.000 1.000
#> SRR868883     2  0.0000      0.999 0.000 1.000
#> SRR868884     2  0.0000      0.999 0.000 1.000
#> SRR868885     2  0.0000      0.999 0.000 1.000
#> SRR868829     1  0.0000      0.941 1.000 0.000
#> SRR868830     1  0.0000      0.941 1.000 0.000
#> SRR868831     1  0.0000      0.941 1.000 0.000
#> SRR868828     1  0.0000      0.941 1.000 0.000
#> SRR868832     1  0.0000      0.941 1.000 0.000
#> SRR868833     1  0.0000      0.941 1.000 0.000
#> SRR868834     1  0.0000      0.941 1.000 0.000
#> SRR868854     2  0.2778      0.945 0.048 0.952
#> SRR868859     2  0.0000      0.999 0.000 1.000
#> SRR868860     2  0.0000      0.999 0.000 1.000
#> SRR868861     2  0.0000      0.999 0.000 1.000
#> SRR868862     2  0.0000      0.999 0.000 1.000
#> SRR868863     2  0.0000      0.999 0.000 1.000
#> SRR868864     1  0.0672      0.937 0.992 0.008
#> SRR868865     2  0.0000      0.999 0.000 1.000
#> SRR868866     2  0.0000      0.999 0.000 1.000
#> SRR868867     2  0.0000      0.999 0.000 1.000
#> SRR868868     2  0.0000      0.999 0.000 1.000
#> SRR868869     1  0.7219      0.773 0.800 0.200
#> SRR868870     2  0.0000      0.999 0.000 1.000
#> SRR868871     2  0.0000      0.999 0.000 1.000
#> SRR868873     2  0.0000      0.999 0.000 1.000
#> SRR868872     2  0.0000      0.999 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
#> SRR868806     1  0.5639      0.594 0.752 0.016 0.232
#> SRR868807     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868808     1  0.5416      0.722 0.820 0.100 0.080
#> SRR868809     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868810     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868811     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868812     3  0.0237      0.903 0.004 0.000 0.996
#> SRR868813     3  0.5929      0.561 0.004 0.320 0.676
#> SRR868814     3  0.5431      0.632 0.000 0.284 0.716
#> SRR868815     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868816     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868817     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868818     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868819     1  0.1964      0.720 0.944 0.056 0.000
#> SRR868820     1  0.1411      0.711 0.964 0.036 0.000
#> SRR868821     1  0.1411      0.711 0.964 0.036 0.000
#> SRR868822     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868824     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868823     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868825     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868826     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868827     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868835     3  0.0424      0.901 0.008 0.000 0.992
#> SRR868836     1  0.5529      0.303 0.704 0.000 0.296
#> SRR868837     3  0.8156      0.602 0.196 0.160 0.644
#> SRR868838     3  0.5706      0.578 0.000 0.320 0.680
#> SRR868839     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868840     3  0.7671      0.333 0.380 0.052 0.568
#> SRR868841     3  0.6282      0.566 0.012 0.324 0.664
#> SRR868842     1  0.5905      0.220 0.648 0.000 0.352
#> SRR868843     3  0.0892      0.895 0.020 0.000 0.980
#> SRR868844     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868845     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868846     1  0.5835      0.252 0.660 0.000 0.340
#> SRR868847     3  0.0424      0.901 0.008 0.000 0.992
#> SRR868848     3  0.0424      0.901 0.008 0.000 0.992
#> SRR868849     1  0.2165      0.722 0.936 0.064 0.000
#> SRR868850     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868851     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868852     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868853     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868855     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868856     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868857     1  0.1643      0.717 0.956 0.044 0.000
#> SRR868858     1  0.5678      0.769 0.684 0.316 0.000
#> SRR868874     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868875     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868876     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868877     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868878     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868879     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868880     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868881     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868882     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868883     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868884     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868885     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868829     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868830     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868831     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868828     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868832     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868833     3  0.0000      0.904 0.000 0.000 1.000
#> SRR868834     3  0.5926      0.558 0.356 0.000 0.644
#> SRR868854     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868859     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868860     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868861     1  0.2625      0.665 0.916 0.084 0.000
#> SRR868862     1  0.1643      0.714 0.956 0.044 0.000
#> SRR868863     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868864     1  0.0747      0.691 0.984 0.000 0.016
#> SRR868865     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868866     2  0.5560      0.593 0.300 0.700 0.000
#> SRR868867     1  0.2625      0.665 0.916 0.084 0.000
#> SRR868868     2  0.5560      0.593 0.300 0.700 0.000
#> SRR868869     3  0.9391      0.227 0.176 0.368 0.456
#> SRR868870     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868871     1  0.5706      0.771 0.680 0.320 0.000
#> SRR868873     2  0.0000      0.948 0.000 1.000 0.000
#> SRR868872     1  0.5706      0.771 0.680 0.320 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     2  0.9154     0.0723 0.200 0.460 0.216 0.124
#> SRR868807     3  0.2214     0.8298 0.044 0.000 0.928 0.028
#> SRR868808     2  0.7110     0.4622 0.152 0.668 0.072 0.108
#> SRR868809     3  0.4585     0.7484 0.088 0.048 0.828 0.036
#> SRR868810     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868811     4  0.4250     0.8419 0.000 0.276 0.000 0.724
#> SRR868812     3  0.2660     0.8245 0.056 0.000 0.908 0.036
#> SRR868813     3  0.7608     0.2604 0.176 0.004 0.452 0.368
#> SRR868814     3  0.6432     0.5721 0.128 0.000 0.636 0.236
#> SRR868815     3  0.3934     0.7899 0.116 0.000 0.836 0.048
#> SRR868816     3  0.0000     0.8578 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000     0.8578 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000     0.8578 0.000 0.000 1.000 0.000
#> SRR868819     2  0.6278     0.2125 0.408 0.532 0.000 0.060
#> SRR868820     2  0.6323     0.1359 0.440 0.500 0.000 0.060
#> SRR868821     2  0.6323     0.1359 0.440 0.500 0.000 0.060
#> SRR868822     3  0.1118     0.8439 0.036 0.000 0.964 0.000
#> SRR868824     3  0.0000     0.8578 0.000 0.000 1.000 0.000
#> SRR868823     3  0.0188     0.8576 0.004 0.000 0.996 0.000
#> SRR868825     3  0.0000     0.8578 0.000 0.000 1.000 0.000
#> SRR868826     3  0.0188     0.8576 0.004 0.000 0.996 0.000
#> SRR868827     3  0.3229     0.8197 0.072 0.000 0.880 0.048
#> SRR868835     3  0.5533     0.6810 0.220 0.000 0.708 0.072
#> SRR868836     1  0.5442     0.6031 0.764 0.092 0.128 0.016
#> SRR868837     1  0.8518     0.3114 0.512 0.068 0.216 0.204
#> SRR868838     3  0.5962     0.5852 0.080 0.000 0.660 0.260
#> SRR868839     2  0.0188     0.7951 0.004 0.996 0.000 0.000
#> SRR868840     1  0.9577     0.2291 0.388 0.260 0.192 0.160
#> SRR868841     4  0.7860    -0.2329 0.340 0.000 0.276 0.384
#> SRR868842     1  0.4429     0.6163 0.832 0.060 0.088 0.020
#> SRR868843     3  0.7354     0.3148 0.388 0.000 0.452 0.160
#> SRR868844     3  0.0188     0.8576 0.004 0.000 0.996 0.000
#> SRR868845     4  0.4050     0.8057 0.036 0.144 0.000 0.820
#> SRR868846     1  0.4429     0.6108 0.832 0.060 0.088 0.020
#> SRR868847     3  0.4472     0.7130 0.220 0.000 0.760 0.020
#> SRR868848     3  0.5631     0.6726 0.224 0.000 0.700 0.076
#> SRR868849     2  0.5212     0.2781 0.420 0.572 0.000 0.008
#> SRR868850     4  0.4758     0.7550 0.064 0.156 0.000 0.780
#> SRR868851     4  0.3528     0.8815 0.000 0.192 0.000 0.808
#> SRR868852     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868853     2  0.0336     0.7930 0.000 0.992 0.000 0.008
#> SRR868855     2  0.0336     0.7930 0.000 0.992 0.000 0.008
#> SRR868856     4  0.3801     0.8957 0.000 0.220 0.000 0.780
#> SRR868857     2  0.4804     0.5313 0.276 0.708 0.000 0.016
#> SRR868858     2  0.0524     0.7908 0.004 0.988 0.000 0.008
#> SRR868874     4  0.3837     0.8966 0.000 0.224 0.000 0.776
#> SRR868875     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868876     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868877     4  0.3837     0.8966 0.000 0.224 0.000 0.776
#> SRR868878     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868879     4  0.3837     0.8966 0.000 0.224 0.000 0.776
#> SRR868880     4  0.3837     0.8966 0.000 0.224 0.000 0.776
#> SRR868881     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868882     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868884     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868829     3  0.3071     0.8225 0.068 0.000 0.888 0.044
#> SRR868830     3  0.3239     0.8183 0.068 0.000 0.880 0.052
#> SRR868831     3  0.0000     0.8578 0.000 0.000 1.000 0.000
#> SRR868828     3  0.0188     0.8576 0.004 0.000 0.996 0.000
#> SRR868832     3  0.0000     0.8578 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000     0.8578 0.000 0.000 1.000 0.000
#> SRR868834     1  0.3257     0.6224 0.844 0.000 0.152 0.004
#> SRR868854     4  0.4579     0.8706 0.032 0.200 0.000 0.768
#> SRR868859     4  0.4707     0.8766 0.036 0.204 0.000 0.760
#> SRR868860     4  0.4248     0.8921 0.012 0.220 0.000 0.768
#> SRR868861     1  0.6517     0.3543 0.604 0.288 0.000 0.108
#> SRR868862     2  0.5996     0.1490 0.448 0.512 0.000 0.040
#> SRR868863     4  0.4248     0.8921 0.012 0.220 0.000 0.768
#> SRR868864     2  0.7566     0.0847 0.388 0.484 0.028 0.100
#> SRR868865     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868866     1  0.4994     0.2913 0.520 0.000 0.000 0.480
#> SRR868867     1  0.6544     0.3608 0.604 0.284 0.000 0.112
#> SRR868868     1  0.4994     0.2913 0.520 0.000 0.000 0.480
#> SRR868869     1  0.7613     0.4592 0.472 0.000 0.288 0.240
#> SRR868870     4  0.3837     0.8966 0.000 0.224 0.000 0.776
#> SRR868871     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> SRR868873     4  0.3837     0.8966 0.000 0.224 0.000 0.776
#> SRR868872     2  0.0000     0.7969 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     5  0.7967     0.3582 0.068 0.304 0.180 0.016 0.432
#> SRR868807     3  0.3280     0.6392 0.012 0.000 0.824 0.004 0.160
#> SRR868808     2  0.5441     0.4751 0.032 0.668 0.020 0.016 0.264
#> SRR868809     3  0.4171     0.5658 0.012 0.016 0.764 0.004 0.204
#> SRR868810     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868811     4  0.2605     0.8351 0.000 0.148 0.000 0.852 0.000
#> SRR868812     3  0.3616     0.5972 0.004 0.000 0.768 0.004 0.224
#> SRR868813     5  0.5585     0.5977 0.004 0.000 0.208 0.136 0.652
#> SRR868814     5  0.5951     0.2994 0.004 0.000 0.424 0.092 0.480
#> SRR868815     3  0.4813     0.1323 0.004 0.000 0.600 0.020 0.376
#> SRR868816     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868819     2  0.5187    -0.1247 0.460 0.504 0.000 0.004 0.032
#> SRR868820     1  0.5294     0.2306 0.524 0.432 0.000 0.004 0.040
#> SRR868821     1  0.5299     0.2211 0.520 0.436 0.000 0.004 0.040
#> SRR868822     3  0.1661     0.7574 0.036 0.000 0.940 0.000 0.024
#> SRR868824     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868823     3  0.0290     0.7775 0.000 0.000 0.992 0.000 0.008
#> SRR868825     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868826     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868827     3  0.5683     0.5582 0.048 0.000 0.648 0.044 0.260
#> SRR868835     3  0.6903     0.3176 0.088 0.000 0.476 0.064 0.372
#> SRR868836     1  0.4761     0.5690 0.776 0.028 0.080 0.004 0.112
#> SRR868837     5  0.6796     0.5823 0.132 0.032 0.104 0.080 0.652
#> SRR868838     3  0.6751     0.4448 0.048 0.000 0.568 0.140 0.244
#> SRR868839     2  0.0162     0.8718 0.000 0.996 0.000 0.004 0.000
#> SRR868840     5  0.6662     0.6180 0.048 0.128 0.096 0.060 0.668
#> SRR868841     5  0.5122     0.6667 0.020 0.000 0.124 0.124 0.732
#> SRR868842     1  0.4270     0.5171 0.764 0.008 0.040 0.000 0.188
#> SRR868843     5  0.2853     0.6025 0.040 0.000 0.076 0.004 0.880
#> SRR868844     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868845     4  0.4167     0.6089 0.000 0.024 0.000 0.724 0.252
#> SRR868846     1  0.5353     0.3415 0.612 0.040 0.016 0.000 0.332
#> SRR868847     3  0.5523     0.4717 0.084 0.000 0.616 0.004 0.296
#> SRR868848     3  0.6987     0.3073 0.092 0.000 0.472 0.068 0.368
#> SRR868849     2  0.4796    -0.1032 0.468 0.516 0.000 0.004 0.012
#> SRR868850     4  0.4380     0.3318 0.000 0.008 0.000 0.616 0.376
#> SRR868851     4  0.1502     0.8832 0.000 0.056 0.000 0.940 0.004
#> SRR868852     2  0.0162     0.8718 0.000 0.996 0.000 0.004 0.000
#> SRR868853     2  0.0000     0.8692 0.000 1.000 0.000 0.000 0.000
#> SRR868855     2  0.0671     0.8595 0.004 0.980 0.000 0.016 0.000
#> SRR868856     4  0.1892     0.8973 0.000 0.080 0.000 0.916 0.004
#> SRR868857     2  0.4096     0.6004 0.200 0.760 0.000 0.000 0.040
#> SRR868858     2  0.0162     0.8680 0.000 0.996 0.000 0.000 0.004
#> SRR868874     4  0.1732     0.8984 0.000 0.080 0.000 0.920 0.000
#> SRR868875     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868876     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868877     4  0.1732     0.8984 0.000 0.080 0.000 0.920 0.000
#> SRR868878     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868879     4  0.1732     0.8984 0.000 0.080 0.000 0.920 0.000
#> SRR868880     4  0.1732     0.8984 0.000 0.080 0.000 0.920 0.000
#> SRR868881     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868882     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868883     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868884     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868885     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868829     3  0.5566     0.5635 0.048 0.000 0.652 0.036 0.264
#> SRR868830     3  0.5976     0.5350 0.048 0.000 0.624 0.060 0.268
#> SRR868831     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868828     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868832     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868833     3  0.0000     0.7800 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.4530     0.5393 0.764 0.004 0.072 0.004 0.156
#> SRR868854     4  0.5214     0.6777 0.044 0.052 0.000 0.720 0.184
#> SRR868859     4  0.3869     0.8539 0.012 0.080 0.000 0.824 0.084
#> SRR868860     4  0.2754     0.8818 0.000 0.080 0.000 0.880 0.040
#> SRR868861     1  0.3266     0.6221 0.860 0.056 0.000 0.076 0.008
#> SRR868862     1  0.4892     0.1187 0.496 0.484 0.000 0.016 0.004
#> SRR868863     4  0.3439     0.8667 0.024 0.080 0.000 0.856 0.040
#> SRR868864     2  0.7577    -0.0678 0.164 0.452 0.048 0.012 0.324
#> SRR868865     2  0.0290     0.8735 0.000 0.992 0.000 0.008 0.000
#> SRR868866     1  0.3756     0.5361 0.744 0.000 0.000 0.248 0.008
#> SRR868867     1  0.3257     0.6219 0.860 0.052 0.000 0.080 0.008
#> SRR868868     1  0.3756     0.5361 0.744 0.000 0.000 0.248 0.008
#> SRR868869     1  0.4936     0.5219 0.728 0.000 0.096 0.168 0.008
#> SRR868870     4  0.1732     0.8984 0.000 0.080 0.000 0.920 0.000
#> SRR868871     2  0.0404     0.8748 0.000 0.988 0.000 0.012 0.000
#> SRR868873     4  0.1732     0.8984 0.000 0.080 0.000 0.920 0.000
#> SRR868872     2  0.0404     0.8748 0.000 0.988 0.000 0.012 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
#> SRR868806     6  0.7791    0.23059 0.056 0.128 0.136 0.016 0.156 0.508
#> SRR868807     3  0.4968    0.51285 0.016 0.000 0.672 0.004 0.076 0.232
#> SRR868808     2  0.6873   -0.00986 0.024 0.404 0.004 0.024 0.164 0.380
#> SRR868809     3  0.5588    0.38367 0.016 0.000 0.584 0.004 0.108 0.288
#> SRR868810     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868811     4  0.2597    0.80443 0.000 0.176 0.000 0.824 0.000 0.000
#> SRR868812     3  0.5530    0.39771 0.012 0.000 0.596 0.004 0.120 0.268
#> SRR868813     6  0.5806    0.40903 0.024 0.000 0.080 0.060 0.176 0.660
#> SRR868814     6  0.6356    0.36584 0.004 0.000 0.292 0.080 0.092 0.532
#> SRR868815     6  0.5381    0.19878 0.000 0.000 0.452 0.016 0.068 0.464
#> SRR868816     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     2  0.7688   -0.30484 0.324 0.380 0.000 0.032 0.132 0.132
#> SRR868820     1  0.7782    0.31294 0.356 0.332 0.000 0.032 0.144 0.136
#> SRR868821     1  0.7800    0.32004 0.356 0.328 0.000 0.032 0.148 0.136
#> SRR868822     3  0.2641    0.76586 0.032 0.000 0.888 0.000 0.040 0.040
#> SRR868824     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868823     3  0.0291    0.87423 0.000 0.000 0.992 0.000 0.004 0.004
#> SRR868825     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868826     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868827     5  0.4899    0.44371 0.000 0.000 0.448 0.036 0.504 0.012
#> SRR868835     5  0.4289    0.51857 0.000 0.000 0.256 0.040 0.696 0.008
#> SRR868836     1  0.7584    0.40827 0.460 0.016 0.100 0.016 0.248 0.160
#> SRR868837     6  0.6707    0.42298 0.052 0.024 0.052 0.068 0.196 0.608
#> SRR868838     5  0.5479    0.47255 0.000 0.000 0.408 0.080 0.496 0.016
#> SRR868839     2  0.0146    0.86700 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR868840     6  0.5325    0.46984 0.000 0.048 0.032 0.048 0.172 0.700
#> SRR868841     6  0.5206    0.46868 0.000 0.000 0.044 0.088 0.192 0.676
#> SRR868842     1  0.6469    0.34287 0.408 0.008 0.008 0.012 0.400 0.164
#> SRR868843     5  0.4488   -0.26538 0.000 0.000 0.016 0.008 0.508 0.468
#> SRR868844     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868845     4  0.3898    0.45427 0.000 0.020 0.000 0.684 0.000 0.296
#> SRR868846     5  0.6184   -0.18597 0.256 0.012 0.016 0.012 0.572 0.132
#> SRR868847     5  0.4974    0.35358 0.004 0.000 0.440 0.000 0.500 0.056
#> SRR868848     5  0.4204    0.51824 0.000 0.000 0.260 0.040 0.696 0.004
#> SRR868849     2  0.6148   -0.09748 0.384 0.484 0.000 0.008 0.068 0.056
#> SRR868850     6  0.4185   -0.00964 0.000 0.012 0.000 0.492 0.000 0.496
#> SRR868851     4  0.1398    0.86697 0.000 0.052 0.000 0.940 0.000 0.008
#> SRR868852     2  0.0146    0.86688 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868853     2  0.0653    0.85693 0.000 0.980 0.000 0.004 0.004 0.012
#> SRR868855     2  0.1515    0.83666 0.000 0.944 0.000 0.020 0.008 0.028
#> SRR868856     4  0.1700    0.88943 0.000 0.080 0.000 0.916 0.004 0.000
#> SRR868857     2  0.6485    0.37047 0.128 0.608 0.000 0.024 0.136 0.104
#> SRR868858     2  0.1434    0.83305 0.000 0.948 0.000 0.008 0.024 0.020
#> SRR868874     4  0.1714    0.89164 0.000 0.092 0.000 0.908 0.000 0.000
#> SRR868875     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868876     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868877     4  0.1714    0.89164 0.000 0.092 0.000 0.908 0.000 0.000
#> SRR868878     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868879     4  0.1714    0.89164 0.000 0.092 0.000 0.908 0.000 0.000
#> SRR868880     4  0.1663    0.89223 0.000 0.088 0.000 0.912 0.000 0.000
#> SRR868881     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868882     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868883     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868884     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868885     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868829     5  0.4820    0.47380 0.000 0.000 0.428 0.032 0.528 0.012
#> SRR868830     5  0.5001    0.49054 0.000 0.000 0.412 0.040 0.532 0.016
#> SRR868831     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868828     3  0.0260    0.87437 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868832     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868833     3  0.0000    0.88104 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     1  0.7014    0.37817 0.436 0.000 0.052 0.016 0.312 0.184
#> SRR868854     4  0.4461    0.40267 0.000 0.032 0.000 0.564 0.404 0.000
#> SRR868859     4  0.3401    0.84953 0.000 0.072 0.000 0.840 0.052 0.036
#> SRR868860     4  0.2625    0.86574 0.000 0.072 0.000 0.872 0.056 0.000
#> SRR868861     1  0.0692    0.56833 0.976 0.020 0.000 0.004 0.000 0.000
#> SRR868862     1  0.3907    0.24785 0.588 0.408 0.000 0.004 0.000 0.000
#> SRR868863     4  0.3469    0.83426 0.000 0.088 0.000 0.808 0.104 0.000
#> SRR868864     5  0.7662   -0.19997 0.036 0.248 0.028 0.020 0.368 0.300
#> SRR868865     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868866     1  0.2346    0.51450 0.868 0.000 0.000 0.124 0.000 0.008
#> SRR868867     1  0.0692    0.56833 0.976 0.020 0.000 0.004 0.000 0.000
#> SRR868868     1  0.2346    0.51450 0.868 0.000 0.000 0.124 0.000 0.008
#> SRR868869     1  0.2999    0.50109 0.856 0.000 0.068 0.068 0.000 0.008
#> SRR868870     4  0.1663    0.89223 0.000 0.088 0.000 0.912 0.000 0.000
#> SRR868871     2  0.0146    0.87092 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868873     4  0.1663    0.89223 0.000 0.088 0.000 0.912 0.000 0.000
#> SRR868872     2  0.0146    0.87092 0.000 0.996 0.000 0.004 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-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 15961 rows and 80 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.849           0.928       0.969         0.4575 0.539   0.539
#> 3 3 0.754           0.878       0.943         0.2408 0.867   0.754
#> 4 4 0.750           0.842       0.927         0.0351 0.978   0.948
#> 5 5 0.707           0.796       0.900         0.0732 0.913   0.801
#> 6 6 0.787           0.818       0.890         0.0750 0.965   0.906

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
#> SRR868806     1  0.0000      0.978 1.000 0.000
#> SRR868807     1  0.0000      0.978 1.000 0.000
#> SRR868808     1  0.0000      0.978 1.000 0.000
#> SRR868809     1  0.0000      0.978 1.000 0.000
#> SRR868810     2  0.0000      0.943 0.000 1.000
#> SRR868811     2  0.0000      0.943 0.000 1.000
#> SRR868812     1  0.0000      0.978 1.000 0.000
#> SRR868813     1  0.0000      0.978 1.000 0.000
#> SRR868814     1  0.1184      0.964 0.984 0.016
#> SRR868815     1  0.0000      0.978 1.000 0.000
#> SRR868816     1  0.0000      0.978 1.000 0.000
#> SRR868817     1  0.0000      0.978 1.000 0.000
#> SRR868818     1  0.0000      0.978 1.000 0.000
#> SRR868819     2  0.8608      0.639 0.284 0.716
#> SRR868820     1  0.0000      0.978 1.000 0.000
#> SRR868821     1  0.0000      0.978 1.000 0.000
#> SRR868822     1  0.0000      0.978 1.000 0.000
#> SRR868824     1  0.0000      0.978 1.000 0.000
#> SRR868823     1  0.0000      0.978 1.000 0.000
#> SRR868825     1  0.0000      0.978 1.000 0.000
#> SRR868826     1  0.0000      0.978 1.000 0.000
#> SRR868827     1  0.0000      0.978 1.000 0.000
#> SRR868835     1  0.0000      0.978 1.000 0.000
#> SRR868836     1  0.0000      0.978 1.000 0.000
#> SRR868837     1  0.0000      0.978 1.000 0.000
#> SRR868838     1  0.0000      0.978 1.000 0.000
#> SRR868839     2  0.2236      0.918 0.036 0.964
#> SRR868840     1  0.0000      0.978 1.000 0.000
#> SRR868841     1  0.0000      0.978 1.000 0.000
#> SRR868842     1  0.0000      0.978 1.000 0.000
#> SRR868843     1  0.0000      0.978 1.000 0.000
#> SRR868844     1  0.0000      0.978 1.000 0.000
#> SRR868845     2  0.7745      0.695 0.228 0.772
#> SRR868846     1  0.0000      0.978 1.000 0.000
#> SRR868847     1  0.0000      0.978 1.000 0.000
#> SRR868848     1  0.0000      0.978 1.000 0.000
#> SRR868849     2  0.9775      0.371 0.412 0.588
#> SRR868850     1  0.5408      0.850 0.876 0.124
#> SRR868851     1  0.8443      0.625 0.728 0.272
#> SRR868852     2  0.0000      0.943 0.000 1.000
#> SRR868853     1  0.9491      0.416 0.632 0.368
#> SRR868855     1  0.0000      0.978 1.000 0.000
#> SRR868856     2  0.0000      0.943 0.000 1.000
#> SRR868857     1  0.0000      0.978 1.000 0.000
#> SRR868858     1  0.0000      0.978 1.000 0.000
#> SRR868874     2  0.0000      0.943 0.000 1.000
#> SRR868875     2  0.0000      0.943 0.000 1.000
#> SRR868876     2  0.0000      0.943 0.000 1.000
#> SRR868877     2  0.0000      0.943 0.000 1.000
#> SRR868878     2  0.0000      0.943 0.000 1.000
#> SRR868879     2  0.0000      0.943 0.000 1.000
#> SRR868880     2  0.0000      0.943 0.000 1.000
#> SRR868881     2  0.0000      0.943 0.000 1.000
#> SRR868882     2  0.0000      0.943 0.000 1.000
#> SRR868883     2  0.0000      0.943 0.000 1.000
#> SRR868884     2  0.0000      0.943 0.000 1.000
#> SRR868885     2  0.0000      0.943 0.000 1.000
#> SRR868829     1  0.0000      0.978 1.000 0.000
#> SRR868830     1  0.0000      0.978 1.000 0.000
#> SRR868831     1  0.0000      0.978 1.000 0.000
#> SRR868828     1  0.0000      0.978 1.000 0.000
#> SRR868832     1  0.0000      0.978 1.000 0.000
#> SRR868833     1  0.0000      0.978 1.000 0.000
#> SRR868834     1  0.0000      0.978 1.000 0.000
#> SRR868854     1  0.0000      0.978 1.000 0.000
#> SRR868859     2  0.0000      0.943 0.000 1.000
#> SRR868860     2  0.6531      0.794 0.168 0.832
#> SRR868861     1  0.0000      0.978 1.000 0.000
#> SRR868862     1  0.0000      0.978 1.000 0.000
#> SRR868863     2  0.0376      0.941 0.004 0.996
#> SRR868864     1  0.0000      0.978 1.000 0.000
#> SRR868865     2  0.9393      0.505 0.356 0.644
#> SRR868866     1  0.5408      0.850 0.876 0.124
#> SRR868867     1  0.0000      0.978 1.000 0.000
#> SRR868868     1  0.5519      0.845 0.872 0.128
#> SRR868869     1  0.0000      0.978 1.000 0.000
#> SRR868870     2  0.0000      0.943 0.000 1.000
#> SRR868871     2  0.0000      0.943 0.000 1.000
#> SRR868873     2  0.0000      0.943 0.000 1.000
#> SRR868872     2  0.0000      0.943 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
#> SRR868806     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868807     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868808     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868809     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868810     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868811     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868812     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868813     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868814     1  0.0747      0.944 0.984 0.016 0.000
#> SRR868815     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868816     3  0.0237      0.725 0.004 0.000 0.996
#> SRR868817     3  0.0237      0.725 0.004 0.000 0.996
#> SRR868818     3  0.0237      0.725 0.004 0.000 0.996
#> SRR868819     2  0.5431      0.526 0.284 0.716 0.000
#> SRR868820     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868821     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868822     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868824     3  0.4555      0.832 0.200 0.000 0.800
#> SRR868823     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868825     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868826     3  0.5254      0.839 0.264 0.000 0.736
#> SRR868827     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868835     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868836     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868837     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868838     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868839     2  0.1411      0.888 0.036 0.964 0.000
#> SRR868840     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868841     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868842     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868843     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868844     3  0.5254      0.839 0.264 0.000 0.736
#> SRR868845     2  0.4887      0.621 0.228 0.772 0.000
#> SRR868846     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868847     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868848     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868849     2  0.6168      0.266 0.412 0.588 0.000
#> SRR868850     1  0.3412      0.799 0.876 0.124 0.000
#> SRR868851     1  0.5327      0.551 0.728 0.272 0.000
#> SRR868852     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868853     1  0.5988      0.371 0.632 0.368 0.000
#> SRR868855     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868856     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868857     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868858     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868874     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868875     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868876     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868877     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868878     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868879     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868880     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868881     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868882     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868883     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868884     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868885     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868829     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868830     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868831     3  0.6295      0.447 0.472 0.000 0.528
#> SRR868828     3  0.5254      0.839 0.264 0.000 0.736
#> SRR868832     3  0.5254      0.839 0.264 0.000 0.736
#> SRR868833     3  0.5216      0.840 0.260 0.000 0.740
#> SRR868834     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868854     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868859     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868860     2  0.4121      0.713 0.168 0.832 0.000
#> SRR868861     1  0.0237      0.958 0.996 0.000 0.004
#> SRR868862     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868863     2  0.0237      0.919 0.004 0.996 0.000
#> SRR868864     1  0.0000      0.962 1.000 0.000 0.000
#> SRR868865     2  0.5926      0.386 0.356 0.644 0.000
#> SRR868866     1  0.3573      0.801 0.876 0.120 0.004
#> SRR868867     1  0.0237      0.958 0.996 0.000 0.004
#> SRR868868     1  0.3644      0.795 0.872 0.124 0.004
#> SRR868869     1  0.0237      0.958 0.996 0.000 0.004
#> SRR868870     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868871     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868873     2  0.0000      0.922 0.000 1.000 0.000
#> SRR868872     2  0.0000      0.922 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868807     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868808     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868809     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868810     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868811     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868812     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868813     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868814     1  0.0592      0.911 0.984 0.016 0.000 0.000
#> SRR868815     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868816     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> SRR868817     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> SRR868818     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> SRR868819     2  0.4304      0.506 0.284 0.716 0.000 0.000
#> SRR868820     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868821     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868822     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868824     3  0.4175      0.845 0.200 0.000 0.784 0.016
#> SRR868823     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868825     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868826     3  0.5220      0.762 0.352 0.000 0.632 0.016
#> SRR868827     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868835     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868836     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868837     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868838     1  0.0592      0.912 0.984 0.000 0.016 0.000
#> SRR868839     2  0.1118      0.877 0.036 0.964 0.000 0.000
#> SRR868840     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868841     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868842     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868843     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868844     3  0.5253      0.751 0.360 0.000 0.624 0.016
#> SRR868845     2  0.3873      0.590 0.228 0.772 0.000 0.000
#> SRR868846     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868847     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868848     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868849     2  0.4888      0.205 0.412 0.588 0.000 0.000
#> SRR868850     1  0.2704      0.780 0.876 0.124 0.000 0.000
#> SRR868851     1  0.5384      0.548 0.728 0.196 0.076 0.000
#> SRR868852     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868853     1  0.4746      0.329 0.632 0.368 0.000 0.000
#> SRR868855     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868856     2  0.1792      0.879 0.000 0.932 0.068 0.000
#> SRR868857     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868858     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868874     2  0.1940      0.876 0.000 0.924 0.076 0.000
#> SRR868875     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868876     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868877     2  0.1940      0.876 0.000 0.924 0.076 0.000
#> SRR868878     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868879     2  0.1940      0.876 0.000 0.924 0.076 0.000
#> SRR868880     2  0.1940      0.876 0.000 0.924 0.076 0.000
#> SRR868881     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868882     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868884     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868829     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868830     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868831     3  0.3907      0.842 0.232 0.000 0.768 0.000
#> SRR868828     1  0.6727     -0.227 0.520 0.000 0.096 0.384
#> SRR868832     3  0.4175      0.845 0.200 0.000 0.784 0.016
#> SRR868833     3  0.4175      0.845 0.200 0.000 0.784 0.016
#> SRR868834     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868854     1  0.1940      0.851 0.924 0.000 0.076 0.000
#> SRR868859     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868860     2  0.4224      0.776 0.100 0.824 0.076 0.000
#> SRR868861     1  0.2921      0.788 0.860 0.000 0.140 0.000
#> SRR868862     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868863     2  0.0188      0.898 0.004 0.996 0.000 0.000
#> SRR868864     1  0.0000      0.925 1.000 0.000 0.000 0.000
#> SRR868865     2  0.4697      0.345 0.356 0.644 0.000 0.000
#> SRR868866     1  0.3870      0.700 0.788 0.004 0.208 0.000
#> SRR868867     1  0.2921      0.788 0.860 0.000 0.140 0.000
#> SRR868868     1  0.4238      0.712 0.796 0.028 0.176 0.000
#> SRR868869     1  0.3311      0.752 0.828 0.000 0.172 0.000
#> SRR868870     2  0.1940      0.876 0.000 0.924 0.076 0.000
#> SRR868871     2  0.0000      0.899 0.000 1.000 0.000 0.000
#> SRR868873     2  0.1940      0.876 0.000 0.924 0.076 0.000
#> SRR868872     2  0.0000      0.899 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868807     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868808     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868809     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868810     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868811     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868812     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868813     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868814     1  0.0510      0.874 0.984 0.016 0.000 0.000 0.000
#> SRR868815     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868816     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> SRR868817     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> SRR868818     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> SRR868819     2  0.3707      0.520 0.284 0.716 0.000 0.000 0.000
#> SRR868820     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868821     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868822     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868824     3  0.3074      0.988 0.196 0.000 0.804 0.000 0.000
#> SRR868823     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868825     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868826     1  0.6800     -0.591 0.364 0.000 0.344 0.000 0.292
#> SRR868827     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868835     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868836     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868837     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868838     1  0.0609      0.871 0.980 0.000 0.020 0.000 0.000
#> SRR868839     2  0.0963      0.847 0.036 0.964 0.000 0.000 0.000
#> SRR868840     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868841     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868842     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868843     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868844     1  0.6796     -0.575 0.372 0.000 0.336 0.000 0.292
#> SRR868845     2  0.3336      0.532 0.228 0.772 0.000 0.000 0.000
#> SRR868846     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868847     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868848     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868849     2  0.4210      0.249 0.412 0.588 0.000 0.000 0.000
#> SRR868850     1  0.2329      0.699 0.876 0.124 0.000 0.000 0.000
#> SRR868851     1  0.4854      0.396 0.724 0.072 0.196 0.000 0.008
#> SRR868852     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868853     1  0.4088      0.121 0.632 0.368 0.000 0.000 0.000
#> SRR868855     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868856     2  0.2753      0.819 0.000 0.856 0.136 0.000 0.008
#> SRR868857     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868858     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868874     2  0.3353      0.792 0.000 0.796 0.196 0.000 0.008
#> SRR868875     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868877     2  0.3353      0.792 0.000 0.796 0.196 0.000 0.008
#> SRR868878     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868879     2  0.3353      0.792 0.000 0.796 0.196 0.000 0.008
#> SRR868880     2  0.3353      0.792 0.000 0.796 0.196 0.000 0.008
#> SRR868881     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868882     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868884     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868885     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868829     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868830     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868831     3  0.3210      0.965 0.212 0.000 0.788 0.000 0.000
#> SRR868828     1  0.7083     -0.154 0.508 0.000 0.052 0.148 0.292
#> SRR868832     3  0.3074      0.988 0.196 0.000 0.804 0.000 0.000
#> SRR868833     3  0.3074      0.988 0.196 0.000 0.804 0.000 0.000
#> SRR868834     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868854     1  0.3353      0.557 0.796 0.000 0.196 0.000 0.008
#> SRR868859     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868860     2  0.3353      0.792 0.000 0.796 0.196 0.000 0.008
#> SRR868861     5  0.3796      0.993 0.300 0.000 0.000 0.000 0.700
#> SRR868862     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868863     2  0.0162      0.865 0.004 0.996 0.000 0.000 0.000
#> SRR868864     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> SRR868865     2  0.4045      0.374 0.356 0.644 0.000 0.000 0.000
#> SRR868866     5  0.3774      0.994 0.296 0.000 0.000 0.000 0.704
#> SRR868867     5  0.3796      0.993 0.300 0.000 0.000 0.000 0.700
#> SRR868868     5  0.3928      0.992 0.296 0.004 0.000 0.000 0.700
#> SRR868869     5  0.3774      0.994 0.296 0.000 0.000 0.000 0.704
#> SRR868870     2  0.3353      0.792 0.000 0.796 0.196 0.000 0.008
#> SRR868871     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000
#> SRR868873     2  0.3353      0.792 0.000 0.796 0.196 0.000 0.008
#> SRR868872     2  0.0000      0.866 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868807     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868808     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868809     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868810     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868811     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868812     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868813     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868814     5  0.0458     0.9068 0.000 0.016 0.000 0.000 0.984 0.000
#> SRR868815     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868816     4  0.3547     1.0000 0.000 0.000 0.000 0.668 0.000 0.332
#> SRR868817     4  0.3547     1.0000 0.000 0.000 0.000 0.668 0.000 0.332
#> SRR868818     4  0.3547     1.0000 0.000 0.000 0.000 0.668 0.000 0.332
#> SRR868819     2  0.5025     0.3566 0.108 0.608 0.000 0.000 0.284 0.000
#> SRR868820     5  0.1910     0.7826 0.108 0.000 0.000 0.000 0.892 0.000
#> SRR868821     5  0.1910     0.7826 0.108 0.000 0.000 0.000 0.892 0.000
#> SRR868822     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868824     3  0.0000     0.9967 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868823     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868825     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868826     6  0.4028     0.9707 0.000 0.000 0.024 0.000 0.308 0.668
#> SRR868827     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868835     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868836     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868837     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868838     5  0.0547     0.9035 0.000 0.000 0.000 0.020 0.980 0.000
#> SRR868839     2  0.2752     0.7296 0.108 0.856 0.000 0.000 0.036 0.000
#> SRR868840     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868841     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868842     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868843     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868844     6  0.3969     0.9752 0.000 0.000 0.020 0.000 0.312 0.668
#> SRR868845     2  0.3845     0.6105 0.088 0.772 0.000 0.000 0.140 0.000
#> SRR868846     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868847     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868848     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868849     2  0.5347     0.0155 0.108 0.480 0.000 0.000 0.412 0.000
#> SRR868850     5  0.2092     0.7323 0.000 0.124 0.000 0.000 0.876 0.000
#> SRR868851     5  0.5486     0.0895 0.088 0.020 0.000 0.332 0.560 0.000
#> SRR868852     2  0.1910     0.7427 0.108 0.892 0.000 0.000 0.000 0.000
#> SRR868853     5  0.3672     0.1934 0.000 0.368 0.000 0.000 0.632 0.000
#> SRR868855     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868856     2  0.3244     0.7025 0.000 0.732 0.000 0.268 0.000 0.000
#> SRR868857     5  0.0547     0.9039 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868858     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868874     2  0.3547     0.6680 0.000 0.668 0.000 0.332 0.000 0.000
#> SRR868875     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     2  0.3547     0.6680 0.000 0.668 0.000 0.332 0.000 0.000
#> SRR868878     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     2  0.3547     0.6680 0.000 0.668 0.000 0.332 0.000 0.000
#> SRR868880     2  0.3547     0.6680 0.000 0.668 0.000 0.332 0.000 0.000
#> SRR868881     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868829     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868830     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868831     3  0.0146     0.9901 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR868828     6  0.3668     0.9625 0.000 0.000 0.004 0.000 0.328 0.668
#> SRR868832     3  0.0000     0.9967 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868833     3  0.0000     0.9967 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868854     5  0.3969     0.2862 0.016 0.000 0.000 0.332 0.652 0.000
#> SRR868859     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868860     2  0.5197     0.5898 0.108 0.560 0.000 0.332 0.000 0.000
#> SRR868861     1  0.0000     0.9975 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868862     5  0.1910     0.7826 0.108 0.000 0.000 0.000 0.892 0.000
#> SRR868863     2  0.0146     0.8048 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR868864     5  0.0000     0.9251 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868865     2  0.5259     0.1820 0.108 0.536 0.000 0.000 0.356 0.000
#> SRR868866     1  0.0000     0.9975 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868867     1  0.0000     0.9975 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868868     1  0.0000     0.9975 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868869     1  0.0146     0.9902 0.996 0.000 0.000 0.000 0.004 0.000
#> SRR868870     2  0.3547     0.6680 0.000 0.668 0.000 0.332 0.000 0.000
#> SRR868871     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     2  0.3547     0.6680 0.000 0.668 0.000 0.332 0.000 0.000
#> SRR868872     2  0.0000     0.8063 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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 15961 rows and 80 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.873           0.898       0.961         0.4906 0.505   0.505
#> 3 3 0.740           0.827       0.914         0.2620 0.822   0.670
#> 4 4 0.647           0.760       0.846         0.1501 0.761   0.464
#> 5 5 0.662           0.625       0.729         0.0601 0.871   0.574
#> 6 6 0.760           0.757       0.850         0.0503 0.916   0.658

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
#> SRR868806     2  0.0000      0.944 0.000 1.000
#> SRR868807     1  0.9833      0.229 0.576 0.424
#> SRR868808     2  0.8861      0.554 0.304 0.696
#> SRR868809     2  0.9881      0.239 0.436 0.564
#> SRR868810     2  0.0000      0.944 0.000 1.000
#> SRR868811     1  0.0376      0.963 0.996 0.004
#> SRR868812     1  0.5946      0.812 0.856 0.144
#> SRR868813     1  0.4690      0.865 0.900 0.100
#> SRR868814     1  0.0000      0.967 1.000 0.000
#> SRR868815     1  0.0000      0.967 1.000 0.000
#> SRR868816     1  0.0000      0.967 1.000 0.000
#> SRR868817     1  0.0000      0.967 1.000 0.000
#> SRR868818     1  0.0000      0.967 1.000 0.000
#> SRR868819     2  0.0000      0.944 0.000 1.000
#> SRR868820     2  0.0000      0.944 0.000 1.000
#> SRR868821     2  0.0000      0.944 0.000 1.000
#> SRR868822     2  0.9896      0.226 0.440 0.560
#> SRR868824     1  0.0000      0.967 1.000 0.000
#> SRR868823     1  0.0000      0.967 1.000 0.000
#> SRR868825     1  0.0672      0.960 0.992 0.008
#> SRR868826     1  0.0000      0.967 1.000 0.000
#> SRR868827     1  0.0000      0.967 1.000 0.000
#> SRR868835     1  0.0000      0.967 1.000 0.000
#> SRR868836     2  0.0000      0.944 0.000 1.000
#> SRR868837     1  0.9170      0.480 0.668 0.332
#> SRR868838     1  0.0000      0.967 1.000 0.000
#> SRR868839     2  0.0000      0.944 0.000 1.000
#> SRR868840     1  0.9491      0.391 0.632 0.368
#> SRR868841     1  0.0000      0.967 1.000 0.000
#> SRR868842     2  0.1633      0.926 0.024 0.976
#> SRR868843     1  0.0000      0.967 1.000 0.000
#> SRR868844     1  0.0000      0.967 1.000 0.000
#> SRR868845     1  0.0000      0.967 1.000 0.000
#> SRR868846     2  0.9944      0.176 0.456 0.544
#> SRR868847     1  0.0000      0.967 1.000 0.000
#> SRR868848     1  0.0000      0.967 1.000 0.000
#> SRR868849     2  0.0000      0.944 0.000 1.000
#> SRR868850     1  0.0000      0.967 1.000 0.000
#> SRR868851     1  0.0000      0.967 1.000 0.000
#> SRR868852     2  0.0000      0.944 0.000 1.000
#> SRR868853     2  0.0000      0.944 0.000 1.000
#> SRR868855     2  0.0672      0.938 0.008 0.992
#> SRR868856     1  0.0000      0.967 1.000 0.000
#> SRR868857     2  0.2423      0.912 0.040 0.960
#> SRR868858     2  0.0000      0.944 0.000 1.000
#> SRR868874     1  0.0000      0.967 1.000 0.000
#> SRR868875     2  0.0000      0.944 0.000 1.000
#> SRR868876     2  0.0000      0.944 0.000 1.000
#> SRR868877     1  0.0000      0.967 1.000 0.000
#> SRR868878     2  0.0000      0.944 0.000 1.000
#> SRR868879     1  0.0000      0.967 1.000 0.000
#> SRR868880     1  0.0000      0.967 1.000 0.000
#> SRR868881     2  0.0000      0.944 0.000 1.000
#> SRR868882     2  0.0000      0.944 0.000 1.000
#> SRR868883     2  0.0000      0.944 0.000 1.000
#> SRR868884     2  0.0000      0.944 0.000 1.000
#> SRR868885     2  0.0000      0.944 0.000 1.000
#> SRR868829     1  0.0000      0.967 1.000 0.000
#> SRR868830     1  0.0000      0.967 1.000 0.000
#> SRR868831     1  0.0000      0.967 1.000 0.000
#> SRR868828     1  0.0000      0.967 1.000 0.000
#> SRR868832     1  0.0000      0.967 1.000 0.000
#> SRR868833     1  0.0000      0.967 1.000 0.000
#> SRR868834     2  0.0000      0.944 0.000 1.000
#> SRR868854     1  0.0000      0.967 1.000 0.000
#> SRR868859     1  0.0000      0.967 1.000 0.000
#> SRR868860     1  0.0000      0.967 1.000 0.000
#> SRR868861     2  0.0000      0.944 0.000 1.000
#> SRR868862     2  0.0000      0.944 0.000 1.000
#> SRR868863     1  0.0000      0.967 1.000 0.000
#> SRR868864     2  0.0000      0.944 0.000 1.000
#> SRR868865     2  0.0000      0.944 0.000 1.000
#> SRR868866     1  0.0000      0.967 1.000 0.000
#> SRR868867     2  0.0000      0.944 0.000 1.000
#> SRR868868     1  0.0000      0.967 1.000 0.000
#> SRR868869     1  0.0000      0.967 1.000 0.000
#> SRR868870     1  0.0000      0.967 1.000 0.000
#> SRR868871     2  0.0000      0.944 0.000 1.000
#> SRR868873     1  0.0000      0.967 1.000 0.000
#> SRR868872     2  0.0000      0.944 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
#> SRR868806     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868807     1  0.6452     0.5724 0.704 0.032 0.264
#> SRR868808     1  0.1411     0.9198 0.964 0.000 0.036
#> SRR868809     1  0.5201     0.6660 0.760 0.004 0.236
#> SRR868810     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868811     2  0.2682     0.8096 0.076 0.920 0.004
#> SRR868812     1  0.7644     0.3482 0.604 0.060 0.336
#> SRR868813     2  0.5798     0.6953 0.176 0.780 0.044
#> SRR868814     2  0.4178     0.7769 0.000 0.828 0.172
#> SRR868815     2  0.4842     0.7448 0.000 0.776 0.224
#> SRR868816     3  0.0892     0.9213 0.000 0.020 0.980
#> SRR868817     3  0.0892     0.9213 0.000 0.020 0.980
#> SRR868818     3  0.0892     0.9213 0.000 0.020 0.980
#> SRR868819     1  0.0237     0.9434 0.996 0.000 0.004
#> SRR868820     1  0.0237     0.9434 0.996 0.000 0.004
#> SRR868821     1  0.0237     0.9434 0.996 0.000 0.004
#> SRR868822     1  0.4099     0.7999 0.852 0.008 0.140
#> SRR868824     3  0.2681     0.9080 0.040 0.028 0.932
#> SRR868823     2  0.7674     0.1726 0.044 0.480 0.476
#> SRR868825     1  0.7471     0.0418 0.516 0.036 0.448
#> SRR868826     3  0.1129     0.9217 0.004 0.020 0.976
#> SRR868827     2  0.2711     0.8390 0.000 0.912 0.088
#> SRR868835     2  0.4002     0.7971 0.000 0.840 0.160
#> SRR868836     1  0.0237     0.9434 0.996 0.000 0.004
#> SRR868837     2  0.6910     0.3800 0.396 0.584 0.020
#> SRR868838     2  0.5327     0.6727 0.000 0.728 0.272
#> SRR868839     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868840     2  0.6935     0.4163 0.372 0.604 0.024
#> SRR868841     2  0.2486     0.8461 0.008 0.932 0.060
#> SRR868842     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868843     2  0.8390     0.3968 0.100 0.560 0.340
#> SRR868844     3  0.0892     0.9213 0.000 0.020 0.980
#> SRR868845     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868846     1  0.1482     0.9229 0.968 0.020 0.012
#> SRR868847     2  0.4902     0.7988 0.064 0.844 0.092
#> SRR868848     2  0.2448     0.8417 0.000 0.924 0.076
#> SRR868849     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868850     2  0.1753     0.8393 0.000 0.952 0.048
#> SRR868851     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868852     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868853     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868855     1  0.0592     0.9372 0.988 0.012 0.000
#> SRR868856     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868857     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868858     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868874     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868875     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868876     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868877     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868878     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868879     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868880     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868881     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868882     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868883     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868884     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868885     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868829     2  0.6008     0.5098 0.000 0.628 0.372
#> SRR868830     2  0.6008     0.5098 0.000 0.628 0.372
#> SRR868831     3  0.4865     0.8482 0.136 0.032 0.832
#> SRR868828     3  0.1643     0.9089 0.000 0.044 0.956
#> SRR868832     3  0.4931     0.8446 0.140 0.032 0.828
#> SRR868833     3  0.4931     0.8446 0.140 0.032 0.828
#> SRR868834     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868854     2  0.2711     0.8379 0.000 0.912 0.088
#> SRR868859     2  0.1964     0.8470 0.000 0.944 0.056
#> SRR868860     2  0.1964     0.8470 0.000 0.944 0.056
#> SRR868861     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868862     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868863     2  0.1529     0.8490 0.000 0.960 0.040
#> SRR868864     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868865     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868866     2  0.0237     0.8500 0.000 0.996 0.004
#> SRR868867     1  0.0000     0.9444 1.000 0.000 0.000
#> SRR868868     2  0.0237     0.8500 0.000 0.996 0.004
#> SRR868869     2  0.0892     0.8508 0.000 0.980 0.020
#> SRR868870     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868871     1  0.0747     0.9420 0.984 0.000 0.016
#> SRR868873     2  0.0000     0.8496 0.000 1.000 0.000
#> SRR868872     1  0.0747     0.9420 0.984 0.000 0.016

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.4746     0.8801 0.688 0.304 0.008 0.000
#> SRR868807     3  0.4900     0.6940 0.116 0.092 0.788 0.004
#> SRR868808     1  0.6025     0.7049 0.688 0.140 0.172 0.000
#> SRR868809     3  0.6089     0.3334 0.328 0.064 0.608 0.000
#> SRR868810     2  0.0188     0.9892 0.004 0.996 0.000 0.000
#> SRR868811     4  0.0992     0.8053 0.008 0.012 0.004 0.976
#> SRR868812     3  0.1878     0.8075 0.008 0.040 0.944 0.008
#> SRR868813     4  0.8254     0.3544 0.208 0.036 0.260 0.496
#> SRR868814     4  0.5290     0.5972 0.024 0.004 0.292 0.680
#> SRR868815     4  0.5721     0.4377 0.024 0.004 0.388 0.584
#> SRR868816     3  0.4331     0.6953 0.288 0.000 0.712 0.000
#> SRR868817     3  0.4331     0.6953 0.288 0.000 0.712 0.000
#> SRR868818     3  0.4331     0.6953 0.288 0.000 0.712 0.000
#> SRR868819     1  0.4500     0.8813 0.684 0.316 0.000 0.000
#> SRR868820     1  0.4500     0.8813 0.684 0.316 0.000 0.000
#> SRR868821     1  0.4500     0.8813 0.684 0.316 0.000 0.000
#> SRR868822     1  0.7076     0.2022 0.460 0.124 0.416 0.000
#> SRR868824     3  0.0524     0.8101 0.008 0.004 0.988 0.000
#> SRR868823     3  0.3046     0.7713 0.004 0.016 0.884 0.096
#> SRR868825     3  0.2255     0.7966 0.012 0.068 0.920 0.000
#> SRR868826     3  0.2408     0.8039 0.036 0.000 0.920 0.044
#> SRR868827     4  0.5105     0.4029 0.004 0.000 0.432 0.564
#> SRR868835     3  0.5345    -0.0429 0.012 0.000 0.560 0.428
#> SRR868836     1  0.4477     0.8810 0.688 0.312 0.000 0.000
#> SRR868837     1  0.7924     0.5275 0.596 0.108 0.100 0.196
#> SRR868838     3  0.5165    -0.1471 0.004 0.000 0.512 0.484
#> SRR868839     1  0.4522     0.8814 0.680 0.320 0.000 0.000
#> SRR868840     1  0.8649     0.3273 0.480 0.108 0.112 0.300
#> SRR868841     4  0.4923     0.6263 0.008 0.004 0.304 0.684
#> SRR868842     1  0.4746     0.8768 0.688 0.304 0.008 0.000
#> SRR868843     3  0.4865     0.6858 0.040 0.020 0.792 0.148
#> SRR868844     3  0.2197     0.8040 0.024 0.000 0.928 0.048
#> SRR868845     4  0.0188     0.8104 0.004 0.000 0.000 0.996
#> SRR868846     1  0.6031     0.7279 0.688 0.168 0.144 0.000
#> SRR868847     4  0.5586     0.2773 0.008 0.008 0.472 0.512
#> SRR868848     4  0.4855     0.5510 0.004 0.000 0.352 0.644
#> SRR868849     1  0.4500     0.8843 0.684 0.316 0.000 0.000
#> SRR868850     4  0.2983     0.7816 0.008 0.004 0.108 0.880
#> SRR868851     4  0.0000     0.8109 0.000 0.000 0.000 1.000
#> SRR868852     1  0.4500     0.8843 0.684 0.316 0.000 0.000
#> SRR868853     1  0.4500     0.8843 0.684 0.316 0.000 0.000
#> SRR868855     1  0.4500     0.8843 0.684 0.316 0.000 0.000
#> SRR868856     4  0.0000     0.8109 0.000 0.000 0.000 1.000
#> SRR868857     1  0.4933     0.8746 0.688 0.296 0.016 0.000
#> SRR868858     1  0.4500     0.8843 0.684 0.316 0.000 0.000
#> SRR868874     4  0.0188     0.8107 0.004 0.000 0.000 0.996
#> SRR868875     2  0.0188     0.9949 0.004 0.996 0.000 0.000
#> SRR868876     2  0.0000     0.9941 0.000 1.000 0.000 0.000
#> SRR868877     4  0.0188     0.8107 0.004 0.000 0.000 0.996
#> SRR868878     2  0.0000     0.9941 0.000 1.000 0.000 0.000
#> SRR868879     4  0.0188     0.8104 0.004 0.000 0.000 0.996
#> SRR868880     4  0.0000     0.8109 0.000 0.000 0.000 1.000
#> SRR868881     2  0.0188     0.9949 0.004 0.996 0.000 0.000
#> SRR868882     2  0.0188     0.9949 0.004 0.996 0.000 0.000
#> SRR868883     2  0.0188     0.9949 0.004 0.996 0.000 0.000
#> SRR868884     2  0.0000     0.9941 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0188     0.9949 0.004 0.996 0.000 0.000
#> SRR868829     3  0.1584     0.8057 0.012 0.000 0.952 0.036
#> SRR868830     3  0.1584     0.8057 0.012 0.000 0.952 0.036
#> SRR868831     3  0.1174     0.8123 0.012 0.020 0.968 0.000
#> SRR868828     3  0.2965     0.7910 0.036 0.000 0.892 0.072
#> SRR868832     3  0.1059     0.8125 0.012 0.016 0.972 0.000
#> SRR868833     3  0.1059     0.8125 0.012 0.016 0.972 0.000
#> SRR868834     1  0.4477     0.8838 0.688 0.312 0.000 0.000
#> SRR868854     4  0.4936     0.6047 0.012 0.000 0.316 0.672
#> SRR868859     4  0.2593     0.7844 0.004 0.000 0.104 0.892
#> SRR868860     4  0.2654     0.7822 0.004 0.000 0.108 0.888
#> SRR868861     1  0.4500     0.8843 0.684 0.316 0.000 0.000
#> SRR868862     1  0.4500     0.8843 0.684 0.316 0.000 0.000
#> SRR868863     4  0.1576     0.8048 0.004 0.000 0.048 0.948
#> SRR868864     1  0.4477     0.8838 0.688 0.312 0.000 0.000
#> SRR868865     1  0.4697     0.8377 0.644 0.356 0.000 0.000
#> SRR868866     4  0.1822     0.8066 0.008 0.004 0.044 0.944
#> SRR868867     1  0.4500     0.8843 0.684 0.316 0.000 0.000
#> SRR868868     4  0.1543     0.8090 0.008 0.004 0.032 0.956
#> SRR868869     4  0.4303     0.7018 0.008 0.004 0.220 0.768
#> SRR868870     4  0.0000     0.8109 0.000 0.000 0.000 1.000
#> SRR868871     2  0.0188     0.9892 0.004 0.996 0.000 0.000
#> SRR868873     4  0.0000     0.8109 0.000 0.000 0.000 1.000
#> SRR868872     2  0.0188     0.9949 0.004 0.996 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.0290    0.90455 0.992 0.000 0.008 0.000 0.000
#> SRR868807     5  0.6629   -0.05531 0.232 0.000 0.332 0.000 0.436
#> SRR868808     1  0.2179    0.83960 0.896 0.000 0.100 0.000 0.004
#> SRR868809     5  0.6749   -0.02319 0.304 0.000 0.288 0.000 0.408
#> SRR868810     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868811     4  0.4249    0.97418 0.000 0.000 0.000 0.568 0.432
#> SRR868812     3  0.4235    0.23860 0.000 0.000 0.576 0.000 0.424
#> SRR868813     5  0.3745    0.43380 0.196 0.000 0.024 0.000 0.780
#> SRR868814     5  0.2859    0.44465 0.000 0.000 0.068 0.056 0.876
#> SRR868815     5  0.2561    0.47493 0.000 0.000 0.096 0.020 0.884
#> SRR868816     3  0.5542    0.41609 0.000 0.072 0.532 0.396 0.000
#> SRR868817     3  0.5542    0.41609 0.000 0.072 0.532 0.396 0.000
#> SRR868818     3  0.5542    0.41609 0.000 0.072 0.532 0.396 0.000
#> SRR868819     1  0.0963    0.90941 0.964 0.036 0.000 0.000 0.000
#> SRR868820     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868821     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868822     1  0.6072    0.00028 0.484 0.000 0.124 0.000 0.392
#> SRR868824     3  0.3639    0.64295 0.000 0.024 0.792 0.000 0.184
#> SRR868823     5  0.4434   -0.11517 0.000 0.000 0.460 0.004 0.536
#> SRR868825     3  0.5409    0.44291 0.080 0.000 0.604 0.000 0.316
#> SRR868826     3  0.4059    0.58559 0.000 0.004 0.700 0.004 0.292
#> SRR868827     5  0.2127    0.51128 0.000 0.000 0.108 0.000 0.892
#> SRR868835     5  0.5300    0.07108 0.000 0.032 0.312 0.024 0.632
#> SRR868836     1  0.0162    0.90694 0.996 0.000 0.000 0.000 0.004
#> SRR868837     1  0.4481    0.21608 0.576 0.000 0.008 0.000 0.416
#> SRR868838     5  0.1444    0.50654 0.000 0.012 0.040 0.000 0.948
#> SRR868839     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868840     5  0.4297    0.08214 0.472 0.000 0.000 0.000 0.528
#> SRR868841     5  0.2237    0.40228 0.008 0.000 0.004 0.084 0.904
#> SRR868842     1  0.0955    0.89232 0.968 0.000 0.028 0.000 0.004
#> SRR868843     5  0.5825   -0.06668 0.080 0.004 0.428 0.000 0.488
#> SRR868844     3  0.4059    0.58559 0.000 0.004 0.700 0.004 0.292
#> SRR868845     4  0.4242    0.97746 0.000 0.000 0.000 0.572 0.428
#> SRR868846     1  0.2079    0.85654 0.916 0.000 0.064 0.000 0.020
#> SRR868847     5  0.4067    0.40673 0.020 0.000 0.228 0.004 0.748
#> SRR868848     5  0.0162    0.47531 0.000 0.000 0.004 0.000 0.996
#> SRR868849     1  0.0510    0.91088 0.984 0.016 0.000 0.000 0.000
#> SRR868850     5  0.3177    0.11810 0.000 0.000 0.000 0.208 0.792
#> SRR868851     4  0.4291    0.92741 0.000 0.000 0.000 0.536 0.464
#> SRR868852     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868853     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868855     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868856     4  0.4242    0.97716 0.000 0.000 0.000 0.572 0.428
#> SRR868857     1  0.1270    0.87789 0.948 0.000 0.052 0.000 0.000
#> SRR868858     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868874     4  0.4235    0.98013 0.000 0.000 0.000 0.576 0.424
#> SRR868875     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868876     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868877     4  0.4235    0.98013 0.000 0.000 0.000 0.576 0.424
#> SRR868878     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868879     4  0.4235    0.98013 0.000 0.000 0.000 0.576 0.424
#> SRR868880     4  0.4235    0.98013 0.000 0.000 0.000 0.576 0.424
#> SRR868881     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868882     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868883     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868884     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868885     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868829     5  0.5727   -0.12366 0.000 0.036 0.404 0.028 0.532
#> SRR868830     5  0.5727   -0.12366 0.000 0.036 0.404 0.028 0.532
#> SRR868831     3  0.2929    0.64739 0.000 0.000 0.820 0.000 0.180
#> SRR868828     3  0.4081    0.58087 0.000 0.004 0.696 0.004 0.296
#> SRR868832     3  0.2929    0.64739 0.000 0.000 0.820 0.000 0.180
#> SRR868833     3  0.2929    0.64739 0.000 0.000 0.820 0.000 0.180
#> SRR868834     1  0.0955    0.89399 0.968 0.000 0.004 0.000 0.028
#> SRR868854     5  0.0880    0.48247 0.000 0.032 0.000 0.000 0.968
#> SRR868859     5  0.4166   -0.48341 0.000 0.004 0.000 0.348 0.648
#> SRR868860     5  0.4341   -0.65819 0.000 0.004 0.000 0.404 0.592
#> SRR868861     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868862     1  0.0880    0.91194 0.968 0.032 0.000 0.000 0.000
#> SRR868863     4  0.4304    0.90365 0.000 0.000 0.000 0.516 0.484
#> SRR868864     1  0.0162    0.90620 0.996 0.000 0.000 0.000 0.004
#> SRR868865     1  0.2020    0.84813 0.900 0.100 0.000 0.000 0.000
#> SRR868866     5  0.3395   -0.01119 0.000 0.000 0.000 0.236 0.764
#> SRR868867     1  0.0609    0.91141 0.980 0.020 0.000 0.000 0.000
#> SRR868868     5  0.3579   -0.03769 0.004 0.000 0.000 0.240 0.756
#> SRR868869     5  0.2377    0.33338 0.000 0.000 0.000 0.128 0.872
#> SRR868870     4  0.4235    0.98013 0.000 0.000 0.000 0.576 0.424
#> SRR868871     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000
#> SRR868873     4  0.4235    0.98013 0.000 0.000 0.000 0.576 0.424
#> SRR868872     2  0.2127    1.00000 0.108 0.892 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     1  0.1490     0.9442 0.948 0.004 0.000 0.024 0.008 0.016
#> SRR868807     3  0.7462     0.5242 0.148 0.000 0.424 0.036 0.308 0.084
#> SRR868808     1  0.2131     0.9248 0.920 0.000 0.016 0.036 0.012 0.016
#> SRR868809     3  0.7388     0.5341 0.140 0.000 0.444 0.036 0.296 0.084
#> SRR868810     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868811     4  0.2135     0.8864 0.000 0.000 0.000 0.872 0.128 0.000
#> SRR868812     3  0.5440     0.6059 0.012 0.000 0.588 0.008 0.308 0.084
#> SRR868813     5  0.3791     0.6295 0.148 0.000 0.016 0.008 0.796 0.032
#> SRR868814     5  0.2862     0.7347 0.000 0.000 0.056 0.052 0.872 0.020
#> SRR868815     5  0.2405     0.7111 0.000 0.000 0.100 0.004 0.880 0.016
#> SRR868816     6  0.2048     1.0000 0.000 0.000 0.120 0.000 0.000 0.880
#> SRR868817     6  0.2048     1.0000 0.000 0.000 0.120 0.000 0.000 0.880
#> SRR868818     6  0.2048     1.0000 0.000 0.000 0.120 0.000 0.000 0.880
#> SRR868819     1  0.0603     0.9612 0.980 0.016 0.000 0.000 0.000 0.004
#> SRR868820     1  0.0458     0.9614 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR868821     1  0.0363     0.9609 0.988 0.012 0.000 0.000 0.000 0.000
#> SRR868822     3  0.7741     0.4547 0.216 0.000 0.368 0.036 0.296 0.084
#> SRR868824     3  0.0000     0.5744 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868823     3  0.4903     0.5115 0.004 0.000 0.540 0.008 0.412 0.036
#> SRR868825     3  0.6087     0.6113 0.060 0.000 0.568 0.036 0.300 0.036
#> SRR868826     3  0.1901     0.5701 0.000 0.000 0.924 0.008 0.040 0.028
#> SRR868827     5  0.1285     0.7277 0.000 0.000 0.052 0.000 0.944 0.004
#> SRR868835     5  0.2703     0.6565 0.000 0.000 0.064 0.052 0.876 0.008
#> SRR868836     1  0.0692     0.9514 0.976 0.000 0.000 0.020 0.004 0.000
#> SRR868837     5  0.4580     0.3690 0.384 0.000 0.004 0.020 0.584 0.008
#> SRR868838     5  0.1942     0.7161 0.000 0.000 0.064 0.012 0.916 0.008
#> SRR868839     1  0.0692     0.9590 0.976 0.020 0.000 0.000 0.000 0.004
#> SRR868840     5  0.4056     0.3401 0.416 0.000 0.004 0.000 0.576 0.004
#> SRR868841     5  0.2086     0.7417 0.008 0.000 0.028 0.036 0.920 0.008
#> SRR868842     1  0.1749     0.9307 0.932 0.000 0.000 0.036 0.008 0.024
#> SRR868843     5  0.4966    -0.3096 0.016 0.000 0.432 0.000 0.516 0.036
#> SRR868844     3  0.1737     0.5724 0.000 0.000 0.932 0.008 0.040 0.020
#> SRR868845     4  0.3828     0.3803 0.000 0.000 0.000 0.560 0.440 0.000
#> SRR868846     1  0.2188     0.9162 0.912 0.000 0.000 0.036 0.020 0.032
#> SRR868847     5  0.2669     0.7109 0.016 0.000 0.072 0.000 0.880 0.032
#> SRR868848     5  0.0790     0.7337 0.000 0.000 0.032 0.000 0.968 0.000
#> SRR868849     1  0.0508     0.9611 0.984 0.012 0.000 0.000 0.000 0.004
#> SRR868850     5  0.2703     0.7009 0.000 0.000 0.008 0.116 0.860 0.016
#> SRR868851     5  0.3817    -0.0274 0.000 0.000 0.000 0.432 0.568 0.000
#> SRR868852     1  0.0603     0.9612 0.980 0.016 0.000 0.000 0.000 0.004
#> SRR868853     1  0.0603     0.9612 0.980 0.016 0.000 0.000 0.000 0.004
#> SRR868855     1  0.0458     0.9614 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR868856     4  0.2219     0.8815 0.000 0.000 0.000 0.864 0.136 0.000
#> SRR868857     1  0.1268     0.9416 0.952 0.000 0.000 0.036 0.004 0.008
#> SRR868858     1  0.0603     0.9612 0.980 0.016 0.000 0.000 0.000 0.004
#> SRR868874     4  0.2092     0.8889 0.000 0.000 0.000 0.876 0.124 0.000
#> SRR868875     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     4  0.2092     0.8889 0.000 0.000 0.000 0.876 0.124 0.000
#> SRR868878     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     4  0.2092     0.8889 0.000 0.000 0.000 0.876 0.124 0.000
#> SRR868880     4  0.2092     0.8889 0.000 0.000 0.000 0.876 0.124 0.000
#> SRR868881     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868829     3  0.5312     0.5134 0.000 0.000 0.504 0.080 0.408 0.008
#> SRR868830     3  0.5312     0.5134 0.000 0.000 0.504 0.080 0.408 0.008
#> SRR868831     3  0.0000     0.5744 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868828     3  0.2764     0.5936 0.000 0.000 0.864 0.008 0.100 0.028
#> SRR868832     3  0.0146     0.5742 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR868833     3  0.0000     0.5744 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     1  0.2287     0.9012 0.904 0.000 0.000 0.036 0.048 0.012
#> SRR868854     5  0.0976     0.7245 0.000 0.000 0.008 0.016 0.968 0.008
#> SRR868859     5  0.3547     0.2112 0.000 0.000 0.000 0.332 0.668 0.000
#> SRR868860     5  0.3464     0.2774 0.000 0.000 0.000 0.312 0.688 0.000
#> SRR868861     1  0.0458     0.9614 0.984 0.016 0.000 0.000 0.000 0.000
#> SRR868862     1  0.0603     0.9612 0.980 0.016 0.000 0.000 0.000 0.004
#> SRR868863     4  0.3864     0.2510 0.000 0.000 0.000 0.520 0.480 0.000
#> SRR868864     1  0.0692     0.9513 0.976 0.000 0.000 0.020 0.004 0.000
#> SRR868865     1  0.2520     0.8203 0.844 0.152 0.000 0.000 0.000 0.004
#> SRR868866     5  0.2932     0.6530 0.000 0.000 0.000 0.164 0.820 0.016
#> SRR868867     1  0.0603     0.9612 0.980 0.016 0.000 0.000 0.000 0.004
#> SRR868868     5  0.2981     0.6560 0.000 0.000 0.000 0.160 0.820 0.020
#> SRR868869     5  0.2513     0.7357 0.000 0.000 0.044 0.060 0.888 0.008
#> SRR868870     4  0.2092     0.8889 0.000 0.000 0.000 0.876 0.124 0.000
#> SRR868871     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     4  0.2092     0.8889 0.000 0.000 0.000 0.876 0.124 0.000
#> SRR868872     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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 15961 rows and 80 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 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-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.687           0.813       0.925         0.4916 0.497   0.497
#> 3 3 0.780           0.859       0.934         0.3500 0.723   0.497
#> 4 4 0.616           0.617       0.814         0.1130 0.869   0.632
#> 5 5 0.672           0.579       0.782         0.0646 0.919   0.705
#> 6 6 0.732           0.606       0.748         0.0357 0.924   0.678

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
#> SRR868806     1  0.5842     0.8083 0.860 0.140
#> SRR868807     1  0.0000     0.8985 1.000 0.000
#> SRR868808     1  0.2236     0.8822 0.964 0.036
#> SRR868809     1  0.0000     0.8985 1.000 0.000
#> SRR868810     2  0.0000     0.9226 0.000 1.000
#> SRR868811     2  0.0000     0.9226 0.000 1.000
#> SRR868812     1  0.0000     0.8985 1.000 0.000
#> SRR868813     1  0.9087     0.5645 0.676 0.324
#> SRR868814     1  0.4431     0.8462 0.908 0.092
#> SRR868815     1  0.0376     0.8970 0.996 0.004
#> SRR868816     1  0.0000     0.8985 1.000 0.000
#> SRR868817     1  0.0000     0.8985 1.000 0.000
#> SRR868818     1  0.0000     0.8985 1.000 0.000
#> SRR868819     1  0.0000     0.8985 1.000 0.000
#> SRR868820     1  0.0000     0.8985 1.000 0.000
#> SRR868821     1  0.0000     0.8985 1.000 0.000
#> SRR868822     1  0.0000     0.8985 1.000 0.000
#> SRR868824     1  0.0000     0.8985 1.000 0.000
#> SRR868823     1  0.0000     0.8985 1.000 0.000
#> SRR868825     1  0.0000     0.8985 1.000 0.000
#> SRR868826     1  0.0000     0.8985 1.000 0.000
#> SRR868827     1  0.0000     0.8985 1.000 0.000
#> SRR868835     2  0.9922     0.1014 0.448 0.552
#> SRR868836     1  0.0000     0.8985 1.000 0.000
#> SRR868837     1  0.8327     0.6699 0.736 0.264
#> SRR868838     1  0.7883     0.7068 0.764 0.236
#> SRR868839     2  0.0000     0.9226 0.000 1.000
#> SRR868840     1  0.9815     0.3466 0.580 0.420
#> SRR868841     2  0.9608     0.3173 0.384 0.616
#> SRR868842     2  0.9996     0.0398 0.488 0.512
#> SRR868843     2  0.0000     0.9226 0.000 1.000
#> SRR868844     1  0.0000     0.8985 1.000 0.000
#> SRR868845     2  0.0000     0.9226 0.000 1.000
#> SRR868846     2  0.0938     0.9130 0.012 0.988
#> SRR868847     1  0.9170     0.5547 0.668 0.332
#> SRR868848     2  0.9815     0.2042 0.420 0.580
#> SRR868849     2  0.0000     0.9226 0.000 1.000
#> SRR868850     1  0.9998     0.1030 0.508 0.492
#> SRR868851     2  0.0000     0.9226 0.000 1.000
#> SRR868852     2  0.0000     0.9226 0.000 1.000
#> SRR868853     2  0.0000     0.9226 0.000 1.000
#> SRR868855     2  0.8861     0.5160 0.304 0.696
#> SRR868856     2  0.0000     0.9226 0.000 1.000
#> SRR868857     2  0.1184     0.9093 0.016 0.984
#> SRR868858     2  0.0000     0.9226 0.000 1.000
#> SRR868874     2  0.0000     0.9226 0.000 1.000
#> SRR868875     2  0.0000     0.9226 0.000 1.000
#> SRR868876     2  0.0000     0.9226 0.000 1.000
#> SRR868877     2  0.0000     0.9226 0.000 1.000
#> SRR868878     2  0.0000     0.9226 0.000 1.000
#> SRR868879     2  0.0000     0.9226 0.000 1.000
#> SRR868880     2  0.0000     0.9226 0.000 1.000
#> SRR868881     2  0.0000     0.9226 0.000 1.000
#> SRR868882     2  0.0000     0.9226 0.000 1.000
#> SRR868883     2  0.0000     0.9226 0.000 1.000
#> SRR868884     2  0.0000     0.9226 0.000 1.000
#> SRR868885     2  0.0000     0.9226 0.000 1.000
#> SRR868829     1  0.2603     0.8777 0.956 0.044
#> SRR868830     1  0.9552     0.4608 0.624 0.376
#> SRR868831     1  0.0000     0.8985 1.000 0.000
#> SRR868828     1  0.0000     0.8985 1.000 0.000
#> SRR868832     1  0.0000     0.8985 1.000 0.000
#> SRR868833     1  0.0000     0.8985 1.000 0.000
#> SRR868834     1  0.0000     0.8985 1.000 0.000
#> SRR868854     2  0.0000     0.9226 0.000 1.000
#> SRR868859     2  0.0000     0.9226 0.000 1.000
#> SRR868860     2  0.0000     0.9226 0.000 1.000
#> SRR868861     1  0.8608     0.6389 0.716 0.284
#> SRR868862     2  0.3114     0.8726 0.056 0.944
#> SRR868863     2  0.0000     0.9226 0.000 1.000
#> SRR868864     1  0.2043     0.8846 0.968 0.032
#> SRR868865     2  0.0000     0.9226 0.000 1.000
#> SRR868866     2  0.9358     0.4038 0.352 0.648
#> SRR868867     2  0.0000     0.9226 0.000 1.000
#> SRR868868     2  0.8861     0.5135 0.304 0.696
#> SRR868869     1  0.6712     0.7725 0.824 0.176
#> SRR868870     2  0.0000     0.9226 0.000 1.000
#> SRR868871     2  0.0000     0.9226 0.000 1.000
#> SRR868873     2  0.0000     0.9226 0.000 1.000
#> SRR868872     2  0.0000     0.9226 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
#> SRR868806     1  0.5650      0.469 0.688 0.000 0.312
#> SRR868807     3  0.4555      0.749 0.200 0.000 0.800
#> SRR868808     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868809     3  0.6235      0.355 0.436 0.000 0.564
#> SRR868810     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868811     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868812     3  0.0592      0.857 0.012 0.000 0.988
#> SRR868813     3  0.5304      0.797 0.068 0.108 0.824
#> SRR868814     2  0.5760      0.435 0.000 0.672 0.328
#> SRR868815     3  0.4452      0.739 0.000 0.192 0.808
#> SRR868816     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868817     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868818     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868819     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868820     3  0.0592      0.857 0.012 0.000 0.988
#> SRR868821     3  0.4842      0.726 0.224 0.000 0.776
#> SRR868822     3  0.0592      0.857 0.012 0.000 0.988
#> SRR868824     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868823     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868825     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868826     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868827     3  0.4750      0.714 0.000 0.216 0.784
#> SRR868835     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868836     3  0.5497      0.645 0.292 0.000 0.708
#> SRR868837     3  0.5554      0.795 0.076 0.112 0.812
#> SRR868838     2  0.2959      0.867 0.000 0.900 0.100
#> SRR868839     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868840     3  0.6062      0.483 0.384 0.000 0.616
#> SRR868841     2  0.2165      0.910 0.000 0.936 0.064
#> SRR868842     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868843     1  0.0592      0.947 0.988 0.012 0.000
#> SRR868844     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868845     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868846     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868847     3  0.2313      0.848 0.024 0.032 0.944
#> SRR868848     2  0.0237      0.971 0.000 0.996 0.004
#> SRR868849     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868850     2  0.0424      0.967 0.000 0.992 0.008
#> SRR868851     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868852     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868853     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868855     1  0.5560      0.498 0.700 0.000 0.300
#> SRR868856     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868857     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868858     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868874     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868875     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868876     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868877     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868878     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868879     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868880     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868881     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868882     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868883     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868884     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868885     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868829     3  0.6299      0.200 0.000 0.476 0.524
#> SRR868830     2  0.0237      0.971 0.000 0.996 0.004
#> SRR868831     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868828     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868832     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868833     3  0.0000      0.858 0.000 0.000 1.000
#> SRR868834     3  0.5363      0.667 0.276 0.000 0.724
#> SRR868854     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868859     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868860     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868861     3  0.6045      0.491 0.380 0.000 0.620
#> SRR868862     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868863     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868864     1  0.5621      0.479 0.692 0.000 0.308
#> SRR868865     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868866     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868867     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868868     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868869     3  0.5760      0.557 0.000 0.328 0.672
#> SRR868870     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868871     1  0.0000      0.958 1.000 0.000 0.000
#> SRR868873     2  0.0000      0.973 0.000 1.000 0.000
#> SRR868872     1  0.0000      0.958 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
#> SRR868806     2  0.5184    0.65307 0.204 0.736 0.060 0.000
#> SRR868807     3  0.5693    0.45227 0.072 0.240 0.688 0.000
#> SRR868808     2  0.3764    0.70461 0.216 0.784 0.000 0.000
#> SRR868809     2  0.7325    0.22503 0.236 0.532 0.232 0.000
#> SRR868810     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868811     4  0.0592    0.85667 0.016 0.000 0.000 0.984
#> SRR868812     1  0.6367    0.09192 0.584 0.080 0.336 0.000
#> SRR868813     1  0.8823    0.04772 0.424 0.064 0.316 0.196
#> SRR868814     4  0.6867    0.20349 0.108 0.000 0.384 0.508
#> SRR868815     3  0.4985    0.53139 0.080 0.000 0.768 0.152
#> SRR868816     3  0.0000    0.68893 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000    0.68893 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000    0.68893 0.000 0.000 1.000 0.000
#> SRR868819     1  0.3688    0.42783 0.792 0.208 0.000 0.000
#> SRR868820     1  0.3852    0.38669 0.808 0.012 0.180 0.000
#> SRR868821     1  0.4483    0.43853 0.808 0.104 0.088 0.000
#> SRR868822     1  0.5476    0.06021 0.584 0.020 0.396 0.000
#> SRR868824     3  0.3764    0.58715 0.216 0.000 0.784 0.000
#> SRR868823     3  0.0592    0.69042 0.016 0.000 0.984 0.000
#> SRR868825     3  0.3907    0.58968 0.232 0.000 0.768 0.000
#> SRR868826     3  0.4072    0.57802 0.252 0.000 0.748 0.000
#> SRR868827     1  0.2227    0.44768 0.928 0.000 0.036 0.036
#> SRR868835     1  0.4972   -0.09271 0.544 0.000 0.000 0.456
#> SRR868836     1  0.7236    0.20629 0.520 0.168 0.312 0.000
#> SRR868837     3  0.7824    0.40252 0.248 0.064 0.576 0.112
#> SRR868838     4  0.4436    0.74764 0.216 0.000 0.020 0.764
#> SRR868839     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868840     3  0.6689    0.31665 0.020 0.320 0.596 0.064
#> SRR868841     4  0.2751    0.81450 0.056 0.000 0.040 0.904
#> SRR868842     2  0.2976    0.80544 0.120 0.872 0.008 0.000
#> SRR868843     2  0.4164    0.64594 0.264 0.736 0.000 0.000
#> SRR868844     3  0.2345    0.67775 0.100 0.000 0.900 0.000
#> SRR868845     4  0.0817    0.85346 0.024 0.000 0.000 0.976
#> SRR868846     2  0.2011    0.84418 0.080 0.920 0.000 0.000
#> SRR868847     3  0.5609    0.60069 0.080 0.068 0.776 0.076
#> SRR868848     4  0.2868    0.82400 0.136 0.000 0.000 0.864
#> SRR868849     2  0.3688    0.70386 0.208 0.792 0.000 0.000
#> SRR868850     4  0.4225    0.67877 0.024 0.000 0.184 0.792
#> SRR868851     4  0.0000    0.86134 0.000 0.000 0.000 1.000
#> SRR868852     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868853     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868855     2  0.4713    0.42476 0.000 0.640 0.360 0.000
#> SRR868856     4  0.1637    0.85707 0.060 0.000 0.000 0.940
#> SRR868857     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868858     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868874     4  0.1389    0.85963 0.048 0.000 0.000 0.952
#> SRR868875     2  0.0188    0.89119 0.004 0.996 0.000 0.000
#> SRR868876     2  0.0188    0.89119 0.004 0.996 0.000 0.000
#> SRR868877     4  0.1389    0.85963 0.048 0.000 0.000 0.952
#> SRR868878     2  0.0188    0.89119 0.004 0.996 0.000 0.000
#> SRR868879     4  0.0707    0.86258 0.020 0.000 0.000 0.980
#> SRR868880     4  0.1302    0.86059 0.044 0.000 0.000 0.956
#> SRR868881     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868882     2  0.0188    0.89119 0.004 0.996 0.000 0.000
#> SRR868883     2  0.0188    0.89119 0.004 0.996 0.000 0.000
#> SRR868884     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868829     1  0.5598    0.36582 0.704 0.000 0.076 0.220
#> SRR868830     1  0.4888    0.00498 0.588 0.000 0.000 0.412
#> SRR868831     3  0.5000    0.13459 0.496 0.000 0.504 0.000
#> SRR868828     3  0.0672    0.68368 0.008 0.000 0.984 0.008
#> SRR868832     3  0.4624    0.45624 0.340 0.000 0.660 0.000
#> SRR868833     3  0.4804    0.38612 0.384 0.000 0.616 0.000
#> SRR868834     1  0.6791    0.22164 0.564 0.120 0.316 0.000
#> SRR868854     4  0.3610    0.77265 0.200 0.000 0.000 0.800
#> SRR868859     4  0.1302    0.85601 0.044 0.000 0.000 0.956
#> SRR868860     4  0.2011    0.85106 0.080 0.000 0.000 0.920
#> SRR868861     1  0.7408    0.19099 0.544 0.092 0.332 0.032
#> SRR868862     2  0.4406    0.55864 0.300 0.700 0.000 0.000
#> SRR868863     4  0.3123    0.81109 0.156 0.000 0.000 0.844
#> SRR868864     2  0.2530    0.80626 0.000 0.888 0.112 0.000
#> SRR868865     2  0.0000    0.89179 0.000 1.000 0.000 0.000
#> SRR868866     4  0.5590    0.09464 0.456 0.000 0.020 0.524
#> SRR868867     1  0.6652    0.33031 0.580 0.348 0.032 0.040
#> SRR868868     1  0.5250    0.09246 0.552 0.000 0.008 0.440
#> SRR868869     1  0.6770    0.23018 0.580 0.000 0.292 0.128
#> SRR868870     4  0.0336    0.86155 0.008 0.000 0.000 0.992
#> SRR868871     2  0.0188    0.89119 0.004 0.996 0.000 0.000
#> SRR868873     4  0.0336    0.85973 0.008 0.000 0.000 0.992
#> SRR868872     2  0.0188    0.89119 0.004 0.996 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     2  0.4796     0.5716 0.012 0.680 0.028 0.000 0.280
#> SRR868807     3  0.7382     0.4092 0.140 0.240 0.520 0.000 0.100
#> SRR868808     2  0.4438     0.4359 0.004 0.608 0.004 0.000 0.384
#> SRR868809     2  0.7207     0.2146 0.056 0.488 0.152 0.000 0.304
#> SRR868810     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868811     4  0.3707     0.6998 0.008 0.000 0.108 0.828 0.056
#> SRR868812     5  0.4151     0.5483 0.028 0.048 0.116 0.000 0.808
#> SRR868813     5  0.6758     0.3632 0.032 0.024 0.280 0.088 0.576
#> SRR868814     3  0.6924    -0.0664 0.036 0.000 0.480 0.344 0.140
#> SRR868815     3  0.4804     0.4447 0.032 0.000 0.768 0.096 0.104
#> SRR868816     3  0.3318     0.6399 0.180 0.000 0.808 0.000 0.012
#> SRR868817     3  0.3318     0.6399 0.180 0.000 0.808 0.000 0.012
#> SRR868818     3  0.3318     0.6399 0.180 0.000 0.808 0.000 0.012
#> SRR868819     1  0.5586     0.3250 0.508 0.052 0.008 0.000 0.432
#> SRR868820     1  0.4769     0.3361 0.544 0.004 0.012 0.000 0.440
#> SRR868821     1  0.4882     0.3385 0.540 0.012 0.008 0.000 0.440
#> SRR868822     1  0.5961     0.2245 0.456 0.004 0.092 0.000 0.448
#> SRR868824     3  0.5854     0.4868 0.160 0.000 0.600 0.000 0.240
#> SRR868823     3  0.3922     0.6372 0.180 0.000 0.780 0.000 0.040
#> SRR868825     3  0.4555     0.3702 0.472 0.000 0.520 0.000 0.008
#> SRR868826     1  0.5337    -0.3205 0.508 0.000 0.440 0.000 0.052
#> SRR868827     5  0.2370     0.6087 0.056 0.000 0.000 0.040 0.904
#> SRR868835     5  0.4182     0.3962 0.004 0.000 0.000 0.352 0.644
#> SRR868836     1  0.4452     0.5337 0.796 0.100 0.040 0.000 0.064
#> SRR868837     1  0.7851    -0.0231 0.420 0.052 0.384 0.064 0.080
#> SRR868838     5  0.5594    -0.0258 0.004 0.000 0.060 0.444 0.492
#> SRR868839     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868840     3  0.6847     0.3673 0.032 0.160 0.640 0.068 0.100
#> SRR868841     4  0.6092     0.5337 0.020 0.000 0.192 0.628 0.160
#> SRR868842     2  0.3636     0.5804 0.272 0.728 0.000 0.000 0.000
#> SRR868843     2  0.4617     0.3105 0.000 0.552 0.012 0.000 0.436
#> SRR868844     3  0.4511     0.5390 0.356 0.000 0.628 0.000 0.016
#> SRR868845     4  0.5452     0.5884 0.020 0.000 0.188 0.692 0.100
#> SRR868846     2  0.1670     0.8356 0.052 0.936 0.000 0.000 0.012
#> SRR868847     3  0.8132     0.4474 0.288 0.080 0.460 0.036 0.136
#> SRR868848     4  0.3612     0.5434 0.000 0.000 0.000 0.732 0.268
#> SRR868849     2  0.4138     0.3254 0.384 0.616 0.000 0.000 0.000
#> SRR868850     4  0.6282     0.4517 0.028 0.000 0.300 0.572 0.100
#> SRR868851     4  0.0854     0.7772 0.008 0.000 0.012 0.976 0.004
#> SRR868852     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868853     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868855     2  0.4780     0.5361 0.060 0.692 0.248 0.000 0.000
#> SRR868856     4  0.1197     0.7698 0.000 0.000 0.000 0.952 0.048
#> SRR868857     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868858     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868874     4  0.0865     0.7775 0.004 0.000 0.000 0.972 0.024
#> SRR868875     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868877     4  0.0865     0.7775 0.004 0.000 0.000 0.972 0.024
#> SRR868878     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868879     4  0.0162     0.7800 0.004 0.000 0.000 0.996 0.000
#> SRR868880     4  0.0865     0.7775 0.004 0.000 0.000 0.972 0.024
#> SRR868881     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868882     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868884     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868885     2  0.0162     0.8787 0.000 0.996 0.004 0.000 0.000
#> SRR868829     5  0.2304     0.6348 0.020 0.000 0.004 0.068 0.908
#> SRR868830     5  0.2648     0.6399 0.000 0.000 0.000 0.152 0.848
#> SRR868831     5  0.5067     0.3382 0.064 0.000 0.288 0.000 0.648
#> SRR868828     3  0.3574     0.5572 0.072 0.000 0.836 0.004 0.088
#> SRR868832     3  0.5759     0.4886 0.324 0.000 0.568 0.000 0.108
#> SRR868833     3  0.6274     0.4710 0.256 0.000 0.536 0.000 0.208
#> SRR868834     1  0.3134     0.5648 0.876 0.044 0.024 0.000 0.056
#> SRR868854     4  0.4291     0.0465 0.000 0.000 0.000 0.536 0.464
#> SRR868859     4  0.4471     0.6852 0.008 0.000 0.132 0.772 0.088
#> SRR868860     4  0.2136     0.7382 0.008 0.000 0.000 0.904 0.088
#> SRR868861     1  0.2095     0.5588 0.928 0.020 0.024 0.028 0.000
#> SRR868862     1  0.3816     0.4472 0.696 0.304 0.000 0.000 0.000
#> SRR868863     4  0.3876     0.4739 0.000 0.000 0.000 0.684 0.316
#> SRR868864     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868865     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868866     1  0.4084     0.4633 0.668 0.000 0.000 0.328 0.004
#> SRR868867     1  0.3641     0.5870 0.820 0.060 0.000 0.120 0.000
#> SRR868868     1  0.3715     0.5166 0.736 0.000 0.000 0.260 0.004
#> SRR868869     1  0.3059     0.5654 0.860 0.000 0.028 0.108 0.004
#> SRR868870     4  0.0162     0.7805 0.000 0.000 0.004 0.996 0.000
#> SRR868871     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000
#> SRR868873     4  0.0451     0.7795 0.000 0.000 0.008 0.988 0.004
#> SRR868872     2  0.0000     0.8812 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     2  0.5525    0.00476 0.000 0.484 0.004 0.000 0.396 0.116
#> SRR868807     3  0.7876    0.25556 0.036 0.184 0.404 0.000 0.240 0.136
#> SRR868808     5  0.5237    0.17754 0.000 0.396 0.004 0.000 0.516 0.084
#> SRR868809     5  0.7057    0.17471 0.004 0.300 0.168 0.000 0.436 0.092
#> SRR868810     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868811     4  0.2969    0.60619 0.000 0.000 0.000 0.776 0.000 0.224
#> SRR868812     5  0.3537    0.44430 0.004 0.012 0.060 0.000 0.824 0.100
#> SRR868813     6  0.5090    0.18555 0.004 0.004 0.012 0.036 0.392 0.552
#> SRR868814     6  0.4217    0.67127 0.000 0.000 0.124 0.096 0.016 0.764
#> SRR868815     6  0.4384    0.62579 0.000 0.000 0.268 0.036 0.012 0.684
#> SRR868816     3  0.0146    0.61847 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR868817     3  0.0146    0.61847 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR868818     3  0.0146    0.61847 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR868819     1  0.6418    0.47189 0.452 0.024 0.000 0.000 0.272 0.252
#> SRR868820     1  0.6240    0.48049 0.472 0.000 0.016 0.000 0.260 0.252
#> SRR868821     1  0.6288    0.48668 0.476 0.008 0.008 0.000 0.260 0.248
#> SRR868822     1  0.6361    0.18186 0.428 0.008 0.136 0.000 0.400 0.028
#> SRR868824     3  0.4993    0.33978 0.004 0.000 0.600 0.000 0.316 0.080
#> SRR868823     3  0.3299    0.59234 0.048 0.000 0.844 0.000 0.028 0.080
#> SRR868825     3  0.4171    0.49273 0.320 0.000 0.656 0.000 0.012 0.012
#> SRR868826     3  0.5730    0.29414 0.364 0.000 0.524 0.000 0.068 0.044
#> SRR868827     5  0.2313    0.58088 0.004 0.000 0.000 0.100 0.884 0.012
#> SRR868835     5  0.3925    0.42847 0.008 0.000 0.000 0.332 0.656 0.004
#> SRR868836     1  0.5090    0.56949 0.740 0.100 0.064 0.000 0.068 0.028
#> SRR868837     6  0.6650    0.34037 0.292 0.012 0.096 0.028 0.036 0.536
#> SRR868838     5  0.5676    0.37406 0.012 0.000 0.000 0.288 0.556 0.144
#> SRR868839     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868840     6  0.5094    0.63256 0.000 0.056 0.208 0.040 0.008 0.688
#> SRR868841     6  0.4165    0.57259 0.000 0.000 0.000 0.292 0.036 0.672
#> SRR868842     2  0.3695    0.38192 0.376 0.624 0.000 0.000 0.000 0.000
#> SRR868843     2  0.4520    0.07397 0.000 0.520 0.000 0.000 0.448 0.032
#> SRR868844     3  0.3940    0.54583 0.272 0.000 0.704 0.000 0.008 0.016
#> SRR868845     6  0.3684    0.46861 0.000 0.000 0.000 0.372 0.000 0.628
#> SRR868846     2  0.1594    0.84731 0.052 0.932 0.000 0.000 0.000 0.016
#> SRR868847     3  0.8136    0.39615 0.224 0.072 0.452 0.080 0.148 0.024
#> SRR868848     4  0.3991    0.48944 0.008 0.000 0.000 0.680 0.300 0.012
#> SRR868849     2  0.3937    0.25622 0.424 0.572 0.000 0.000 0.000 0.004
#> SRR868850     6  0.4572    0.62363 0.000 0.000 0.064 0.264 0.004 0.668
#> SRR868851     4  0.1910    0.76893 0.000 0.000 0.000 0.892 0.000 0.108
#> SRR868852     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868853     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868855     2  0.3306    0.70890 0.000 0.796 0.184 0.008 0.004 0.008
#> SRR868856     4  0.1531    0.79194 0.000 0.000 0.000 0.928 0.068 0.004
#> SRR868857     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868858     2  0.0146    0.89551 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR868874     4  0.0458    0.81825 0.000 0.000 0.000 0.984 0.016 0.000
#> SRR868875     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     4  0.0405    0.81920 0.004 0.000 0.000 0.988 0.008 0.000
#> SRR868878     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     4  0.1387    0.80208 0.000 0.000 0.000 0.932 0.000 0.068
#> SRR868880     4  0.0146    0.81976 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR868881     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868829     5  0.2544    0.59579 0.004 0.000 0.000 0.120 0.864 0.012
#> SRR868830     5  0.3398    0.56593 0.004 0.000 0.000 0.216 0.768 0.012
#> SRR868831     5  0.4730    0.27129 0.008 0.000 0.208 0.000 0.688 0.096
#> SRR868828     6  0.4195    0.38081 0.008 0.000 0.440 0.000 0.004 0.548
#> SRR868832     3  0.6242    0.55253 0.164 0.000 0.584 0.000 0.168 0.084
#> SRR868833     3  0.6184    0.53560 0.112 0.000 0.576 0.000 0.228 0.084
#> SRR868834     1  0.3445    0.64575 0.848 0.016 0.024 0.000 0.064 0.048
#> SRR868854     5  0.4070    0.21357 0.004 0.000 0.000 0.424 0.568 0.004
#> SRR868859     4  0.4513    0.64905 0.000 0.000 0.000 0.704 0.124 0.172
#> SRR868860     4  0.2350    0.75689 0.020 0.000 0.000 0.880 0.100 0.000
#> SRR868861     1  0.1268    0.65537 0.952 0.000 0.036 0.008 0.000 0.004
#> SRR868862     1  0.1814    0.63167 0.900 0.100 0.000 0.000 0.000 0.000
#> SRR868863     4  0.3795    0.37032 0.000 0.000 0.000 0.632 0.364 0.004
#> SRR868864     2  0.0653    0.88484 0.004 0.980 0.000 0.000 0.004 0.012
#> SRR868865     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868866     1  0.3337    0.50563 0.736 0.000 0.000 0.260 0.000 0.004
#> SRR868867     1  0.0146    0.66450 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR868868     1  0.2668    0.59670 0.828 0.000 0.000 0.168 0.000 0.004
#> SRR868869     1  0.2101    0.64358 0.912 0.000 0.052 0.028 0.000 0.008
#> SRR868870     4  0.1327    0.80418 0.000 0.000 0.000 0.936 0.000 0.064
#> SRR868871     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     4  0.1501    0.79637 0.000 0.000 0.000 0.924 0.000 0.076
#> SRR868872     2  0.0000    0.89841 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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 15961 rows and 80 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.318           0.530       0.762         0.3915 0.494   0.494
#> 3 3 0.598           0.788       0.907         0.5420 0.681   0.468
#> 4 4 0.502           0.640       0.791         0.1275 0.938   0.842
#> 5 5 0.618           0.672       0.807         0.1081 0.847   0.582
#> 6 6 0.683           0.711       0.809         0.0377 0.975   0.901

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
#> SRR868806     1   0.946     0.7083 0.636 0.364
#> SRR868807     1   0.946     0.7083 0.636 0.364
#> SRR868808     1   0.949     0.7052 0.632 0.368
#> SRR868809     1   0.949     0.7052 0.632 0.368
#> SRR868810     2   0.000     0.7347 0.000 1.000
#> SRR868811     2   0.000     0.7347 0.000 1.000
#> SRR868812     1   0.946     0.7083 0.636 0.364
#> SRR868813     1   0.946     0.7083 0.636 0.364
#> SRR868814     1   0.891     0.7088 0.692 0.308
#> SRR868815     1   0.891     0.7088 0.692 0.308
#> SRR868816     1   0.000     0.5742 1.000 0.000
#> SRR868817     1   0.000     0.5742 1.000 0.000
#> SRR868818     1   0.000     0.5742 1.000 0.000
#> SRR868819     2   0.963     0.0339 0.388 0.612
#> SRR868820     2   0.963     0.0339 0.388 0.612
#> SRR868821     2   0.963     0.0339 0.388 0.612
#> SRR868822     1   0.949     0.7052 0.632 0.368
#> SRR868824     1   0.000     0.5742 1.000 0.000
#> SRR868823     1   0.184     0.5846 0.972 0.028
#> SRR868825     1   0.584     0.6242 0.860 0.140
#> SRR868826     1   0.000     0.5742 1.000 0.000
#> SRR868827     1   0.891     0.7088 0.692 0.308
#> SRR868835     1   0.946     0.7083 0.636 0.364
#> SRR868836     1   0.958     0.6882 0.620 0.380
#> SRR868837     1   0.969     0.6606 0.604 0.396
#> SRR868838     1   0.895     0.7090 0.688 0.312
#> SRR868839     2   1.000    -0.3725 0.496 0.504
#> SRR868840     1   0.969     0.6606 0.604 0.396
#> SRR868841     1   0.969     0.6606 0.604 0.396
#> SRR868842     2   1.000    -0.3610 0.496 0.504
#> SRR868843     1   0.985     0.5902 0.572 0.428
#> SRR868844     1   0.000     0.5742 1.000 0.000
#> SRR868845     2   0.730     0.5297 0.204 0.796
#> SRR868846     2   1.000    -0.3610 0.496 0.504
#> SRR868847     1   0.946     0.7083 0.636 0.364
#> SRR868848     1   0.946     0.7083 0.636 0.364
#> SRR868849     2   1.000    -0.3610 0.496 0.504
#> SRR868850     2   0.745     0.5171 0.212 0.788
#> SRR868851     2   0.738     0.5237 0.208 0.792
#> SRR868852     2   0.821     0.4200 0.256 0.744
#> SRR868853     2   0.999    -0.3212 0.480 0.520
#> SRR868855     1   1.000     0.3808 0.508 0.492
#> SRR868856     2   0.000     0.7347 0.000 1.000
#> SRR868857     2   1.000    -0.3610 0.496 0.504
#> SRR868858     1   0.985     0.5902 0.572 0.428
#> SRR868874     2   0.000     0.7347 0.000 1.000
#> SRR868875     2   0.000     0.7347 0.000 1.000
#> SRR868876     2   0.000     0.7347 0.000 1.000
#> SRR868877     2   0.000     0.7347 0.000 1.000
#> SRR868878     2   0.000     0.7347 0.000 1.000
#> SRR868879     2   0.000     0.7347 0.000 1.000
#> SRR868880     2   0.000     0.7347 0.000 1.000
#> SRR868881     2   0.000     0.7347 0.000 1.000
#> SRR868882     2   0.000     0.7347 0.000 1.000
#> SRR868883     2   0.000     0.7347 0.000 1.000
#> SRR868884     2   0.000     0.7347 0.000 1.000
#> SRR868885     2   0.000     0.7347 0.000 1.000
#> SRR868829     1   0.895     0.7090 0.688 0.312
#> SRR868830     1   0.895     0.7090 0.688 0.312
#> SRR868831     1   0.000     0.5742 1.000 0.000
#> SRR868828     1   0.000     0.5742 1.000 0.000
#> SRR868832     1   0.000     0.5742 1.000 0.000
#> SRR868833     1   0.000     0.5742 1.000 0.000
#> SRR868834     1   0.958     0.6882 0.620 0.380
#> SRR868854     2   0.000     0.7347 0.000 1.000
#> SRR868859     2   0.000     0.7347 0.000 1.000
#> SRR868860     2   0.000     0.7347 0.000 1.000
#> SRR868861     2   1.000    -0.3610 0.496 0.504
#> SRR868862     2   1.000    -0.3610 0.496 0.504
#> SRR868863     2   0.000     0.7347 0.000 1.000
#> SRR868864     1   0.983     0.6005 0.576 0.424
#> SRR868865     2   0.000     0.7347 0.000 1.000
#> SRR868866     1   0.949     0.7052 0.632 0.368
#> SRR868867     2   1.000    -0.3610 0.496 0.504
#> SRR868868     1   0.949     0.7052 0.632 0.368
#> SRR868869     1   0.949     0.7052 0.632 0.368
#> SRR868870     2   0.000     0.7347 0.000 1.000
#> SRR868871     2   0.000     0.7347 0.000 1.000
#> SRR868873     2   0.000     0.7347 0.000 1.000
#> SRR868872     2   0.000     0.7347 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
#> SRR868806     1  0.0237     0.8701 0.996 0.000 0.004
#> SRR868807     1  0.0237     0.8701 0.996 0.000 0.004
#> SRR868808     1  0.0000     0.8708 1.000 0.000 0.000
#> SRR868809     1  0.0000     0.8708 1.000 0.000 0.000
#> SRR868810     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868811     2  0.0000     0.8836 0.000 1.000 0.000
#> SRR868812     1  0.0592     0.8690 0.988 0.000 0.012
#> SRR868813     1  0.0592     0.8690 0.988 0.000 0.012
#> SRR868814     1  0.4887     0.6531 0.772 0.000 0.228
#> SRR868815     1  0.4887     0.6531 0.772 0.000 0.228
#> SRR868816     3  0.0000     0.9230 0.000 0.000 1.000
#> SRR868817     3  0.0000     0.9230 0.000 0.000 1.000
#> SRR868818     3  0.0000     0.9230 0.000 0.000 1.000
#> SRR868819     1  0.6260     0.2374 0.552 0.448 0.000
#> SRR868820     1  0.6260     0.2374 0.552 0.448 0.000
#> SRR868821     1  0.6260     0.2374 0.552 0.448 0.000
#> SRR868822     1  0.0000     0.8708 1.000 0.000 0.000
#> SRR868824     3  0.4235     0.7857 0.176 0.000 0.824
#> SRR868823     3  0.4842     0.7314 0.224 0.000 0.776
#> SRR868825     3  0.5905     0.5101 0.352 0.000 0.648
#> SRR868826     3  0.0000     0.9230 0.000 0.000 1.000
#> SRR868827     1  0.2356     0.8313 0.928 0.000 0.072
#> SRR868835     1  0.1031     0.8655 0.976 0.000 0.024
#> SRR868836     1  0.0592     0.8728 0.988 0.012 0.000
#> SRR868837     1  0.2550     0.8690 0.936 0.040 0.024
#> SRR868838     1  0.2301     0.8376 0.936 0.004 0.060
#> SRR868839     1  0.5397     0.6393 0.720 0.280 0.000
#> SRR868840     1  0.2550     0.8690 0.936 0.040 0.024
#> SRR868841     1  0.2550     0.8690 0.936 0.040 0.024
#> SRR868842     1  0.3619     0.8294 0.864 0.136 0.000
#> SRR868843     1  0.2165     0.8660 0.936 0.064 0.000
#> SRR868844     3  0.0000     0.9230 0.000 0.000 1.000
#> SRR868845     2  0.6299     0.0699 0.476 0.524 0.000
#> SRR868846     1  0.3619     0.8294 0.864 0.136 0.000
#> SRR868847     1  0.1031     0.8655 0.976 0.000 0.024
#> SRR868848     1  0.1031     0.8655 0.976 0.000 0.024
#> SRR868849     1  0.3619     0.8294 0.864 0.136 0.000
#> SRR868850     2  0.6305     0.0371 0.484 0.516 0.000
#> SRR868851     2  0.6302     0.0543 0.480 0.520 0.000
#> SRR868852     2  0.6260     0.1270 0.448 0.552 0.000
#> SRR868853     1  0.5529     0.6136 0.704 0.296 0.000
#> SRR868855     1  0.3551     0.8334 0.868 0.132 0.000
#> SRR868856     2  0.3038     0.8263 0.104 0.896 0.000
#> SRR868857     1  0.3619     0.8294 0.864 0.136 0.000
#> SRR868858     1  0.2165     0.8660 0.936 0.064 0.000
#> SRR868874     2  0.0000     0.8836 0.000 1.000 0.000
#> SRR868875     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868876     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868877     2  0.0000     0.8836 0.000 1.000 0.000
#> SRR868878     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868879     2  0.0000     0.8836 0.000 1.000 0.000
#> SRR868880     2  0.0000     0.8836 0.000 1.000 0.000
#> SRR868881     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868882     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868883     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868884     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868885     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868829     1  0.2200     0.8398 0.940 0.004 0.056
#> SRR868830     1  0.2200     0.8398 0.940 0.004 0.056
#> SRR868831     3  0.0000     0.9230 0.000 0.000 1.000
#> SRR868828     3  0.0237     0.9210 0.004 0.000 0.996
#> SRR868832     3  0.0000     0.9230 0.000 0.000 1.000
#> SRR868833     3  0.0000     0.9230 0.000 0.000 1.000
#> SRR868834     1  0.0592     0.8728 0.988 0.012 0.000
#> SRR868854     2  0.3038     0.8263 0.104 0.896 0.000
#> SRR868859     2  0.3038     0.8263 0.104 0.896 0.000
#> SRR868860     2  0.3038     0.8263 0.104 0.896 0.000
#> SRR868861     1  0.3619     0.8294 0.864 0.136 0.000
#> SRR868862     1  0.3619     0.8294 0.864 0.136 0.000
#> SRR868863     2  0.3038     0.8263 0.104 0.896 0.000
#> SRR868864     1  0.2066     0.8672 0.940 0.060 0.000
#> SRR868865     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868866     1  0.0237     0.8706 0.996 0.004 0.000
#> SRR868867     1  0.3619     0.8294 0.864 0.136 0.000
#> SRR868868     1  0.0237     0.8706 0.996 0.004 0.000
#> SRR868869     1  0.0237     0.8706 0.996 0.004 0.000
#> SRR868870     2  0.0000     0.8836 0.000 1.000 0.000
#> SRR868871     2  0.0237     0.8847 0.004 0.996 0.000
#> SRR868873     2  0.0000     0.8836 0.000 1.000 0.000
#> SRR868872     2  0.0237     0.8847 0.004 0.996 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.0657      0.750 0.984 0.000 0.004 0.012
#> SRR868807     1  0.0657      0.750 0.984 0.000 0.004 0.012
#> SRR868808     1  0.0469      0.751 0.988 0.000 0.000 0.012
#> SRR868809     1  0.0469      0.751 0.988 0.000 0.000 0.012
#> SRR868810     2  0.3157      0.696 0.004 0.852 0.000 0.144
#> SRR868811     2  0.3266      0.736 0.000 0.832 0.000 0.168
#> SRR868812     1  0.0937      0.749 0.976 0.000 0.012 0.012
#> SRR868813     1  0.1059      0.749 0.972 0.000 0.012 0.016
#> SRR868814     4  0.7253      0.402 0.308 0.000 0.172 0.520
#> SRR868815     4  0.7253      0.402 0.308 0.000 0.172 0.520
#> SRR868816     3  0.0000      0.903 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000      0.903 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000      0.903 0.000 0.000 1.000 0.000
#> SRR868819     1  0.7028      0.189 0.548 0.304 0.000 0.148
#> SRR868820     1  0.7028      0.189 0.548 0.304 0.000 0.148
#> SRR868821     1  0.7028      0.189 0.548 0.304 0.000 0.148
#> SRR868822     1  0.1022      0.746 0.968 0.000 0.000 0.032
#> SRR868824     3  0.3862      0.723 0.152 0.000 0.824 0.024
#> SRR868823     3  0.4500      0.660 0.192 0.000 0.776 0.032
#> SRR868825     3  0.5384      0.384 0.324 0.000 0.648 0.028
#> SRR868826     3  0.0000      0.903 0.000 0.000 1.000 0.000
#> SRR868827     1  0.5167      0.236 0.644 0.000 0.016 0.340
#> SRR868835     1  0.2021      0.730 0.936 0.000 0.024 0.040
#> SRR868836     1  0.1389      0.751 0.952 0.000 0.000 0.048
#> SRR868837     1  0.3550      0.730 0.880 0.040 0.024 0.056
#> SRR868838     4  0.4991      0.278 0.388 0.000 0.004 0.608
#> SRR868839     1  0.5486      0.532 0.720 0.200 0.000 0.080
#> SRR868840     1  0.3550      0.730 0.880 0.040 0.024 0.056
#> SRR868841     1  0.3550      0.730 0.880 0.040 0.024 0.056
#> SRR868842     1  0.3638      0.708 0.848 0.120 0.000 0.032
#> SRR868843     1  0.2739      0.740 0.904 0.060 0.000 0.036
#> SRR868844     3  0.0000      0.903 0.000 0.000 1.000 0.000
#> SRR868845     4  0.7883      0.320 0.288 0.336 0.000 0.376
#> SRR868846     1  0.3638      0.708 0.848 0.120 0.000 0.032
#> SRR868847     1  0.2021      0.730 0.936 0.000 0.024 0.040
#> SRR868848     1  0.2021      0.730 0.936 0.000 0.024 0.040
#> SRR868849     1  0.3638      0.708 0.848 0.120 0.000 0.032
#> SRR868850     4  0.7894      0.338 0.296 0.332 0.000 0.372
#> SRR868851     4  0.7896      0.331 0.296 0.336 0.000 0.368
#> SRR868852     2  0.6609     -0.140 0.448 0.472 0.000 0.080
#> SRR868853     1  0.5628      0.508 0.704 0.216 0.000 0.080
#> SRR868855     1  0.4072      0.705 0.828 0.120 0.000 0.052
#> SRR868856     2  0.5944      0.625 0.104 0.684 0.000 0.212
#> SRR868857     1  0.3638      0.708 0.848 0.120 0.000 0.032
#> SRR868858     1  0.2739      0.740 0.904 0.060 0.000 0.036
#> SRR868874     2  0.3837      0.723 0.000 0.776 0.000 0.224
#> SRR868875     2  0.3157      0.696 0.004 0.852 0.000 0.144
#> SRR868876     2  0.0657      0.746 0.004 0.984 0.000 0.012
#> SRR868877     2  0.3837      0.723 0.000 0.776 0.000 0.224
#> SRR868878     2  0.0657      0.746 0.004 0.984 0.000 0.012
#> SRR868879     2  0.3837      0.723 0.000 0.776 0.000 0.224
#> SRR868880     2  0.3726      0.723 0.000 0.788 0.000 0.212
#> SRR868881     2  0.3157      0.696 0.004 0.852 0.000 0.144
#> SRR868882     2  0.3157      0.696 0.004 0.852 0.000 0.144
#> SRR868883     2  0.3157      0.696 0.004 0.852 0.000 0.144
#> SRR868884     2  0.2197      0.726 0.004 0.916 0.000 0.080
#> SRR868885     2  0.3157      0.696 0.004 0.852 0.000 0.144
#> SRR868829     1  0.4985     -0.056 0.532 0.000 0.000 0.468
#> SRR868830     1  0.4985     -0.056 0.532 0.000 0.000 0.468
#> SRR868831     3  0.0000      0.903 0.000 0.000 1.000 0.000
#> SRR868828     3  0.0188      0.901 0.000 0.000 0.996 0.004
#> SRR868832     3  0.0000      0.903 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000      0.903 0.000 0.000 1.000 0.000
#> SRR868834     1  0.1389      0.751 0.952 0.000 0.000 0.048
#> SRR868854     2  0.5944      0.625 0.104 0.684 0.000 0.212
#> SRR868859     2  0.5944      0.625 0.104 0.684 0.000 0.212
#> SRR868860     2  0.5944      0.625 0.104 0.684 0.000 0.212
#> SRR868861     1  0.3542      0.709 0.852 0.120 0.000 0.028
#> SRR868862     1  0.3542      0.709 0.852 0.120 0.000 0.028
#> SRR868863     2  0.5944      0.625 0.104 0.684 0.000 0.212
#> SRR868864     1  0.2644      0.741 0.908 0.060 0.000 0.032
#> SRR868865     2  0.2197      0.726 0.004 0.916 0.000 0.080
#> SRR868866     1  0.3486      0.614 0.812 0.000 0.000 0.188
#> SRR868867     1  0.3638      0.708 0.848 0.120 0.000 0.032
#> SRR868868     1  0.3486      0.614 0.812 0.000 0.000 0.188
#> SRR868869     1  0.3486      0.614 0.812 0.000 0.000 0.188
#> SRR868870     2  0.3726      0.723 0.000 0.788 0.000 0.212
#> SRR868871     2  0.0657      0.746 0.004 0.984 0.000 0.012
#> SRR868873     2  0.3726      0.723 0.000 0.788 0.000 0.212
#> SRR868872     2  0.0657      0.746 0.004 0.984 0.000 0.012

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.2890     0.7799 0.836 0.000 0.004 0.000 0.160
#> SRR868807     1  0.2890     0.7799 0.836 0.000 0.004 0.000 0.160
#> SRR868808     1  0.2732     0.7805 0.840 0.000 0.000 0.000 0.160
#> SRR868809     1  0.2732     0.7805 0.840 0.000 0.000 0.000 0.160
#> SRR868810     2  0.0000     0.6923 0.000 1.000 0.000 0.000 0.000
#> SRR868811     4  0.4126     0.6534 0.000 0.380 0.000 0.620 0.000
#> SRR868812     1  0.3391     0.7672 0.800 0.000 0.012 0.000 0.188
#> SRR868813     1  0.3496     0.7615 0.788 0.000 0.012 0.000 0.200
#> SRR868814     5  0.4523     0.6787 0.012 0.000 0.160 0.064 0.764
#> SRR868815     5  0.4523     0.6787 0.012 0.000 0.160 0.064 0.764
#> SRR868816     3  0.0000     0.9034 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000     0.9034 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000     0.9034 0.000 0.000 1.000 0.000 0.000
#> SRR868819     2  0.7513     0.1630 0.304 0.420 0.000 0.228 0.048
#> SRR868820     2  0.7513     0.1630 0.304 0.420 0.000 0.228 0.048
#> SRR868821     2  0.7513     0.1630 0.304 0.420 0.000 0.228 0.048
#> SRR868822     1  0.3123     0.7718 0.812 0.000 0.000 0.004 0.184
#> SRR868824     3  0.3620     0.7313 0.108 0.000 0.824 0.000 0.068
#> SRR868823     3  0.4269     0.6630 0.116 0.000 0.776 0.000 0.108
#> SRR868825     3  0.5434     0.3865 0.232 0.000 0.648 0.000 0.120
#> SRR868826     3  0.0000     0.9034 0.000 0.000 1.000 0.000 0.000
#> SRR868827     5  0.4763     0.3116 0.352 0.000 0.016 0.008 0.624
#> SRR868835     1  0.3845     0.7385 0.768 0.000 0.024 0.000 0.208
#> SRR868836     1  0.2719     0.7793 0.852 0.000 0.000 0.004 0.144
#> SRR868837     1  0.4790     0.7349 0.732 0.000 0.024 0.040 0.204
#> SRR868838     5  0.2005     0.7299 0.016 0.000 0.004 0.056 0.924
#> SRR868839     1  0.3569     0.6306 0.816 0.152 0.000 0.028 0.004
#> SRR868840     1  0.4821     0.7321 0.728 0.000 0.024 0.040 0.208
#> SRR868841     1  0.4821     0.7321 0.728 0.000 0.024 0.040 0.208
#> SRR868842     1  0.0981     0.7536 0.972 0.008 0.000 0.012 0.008
#> SRR868843     1  0.3602     0.7656 0.820 0.004 0.000 0.036 0.140
#> SRR868844     3  0.0000     0.9034 0.000 0.000 1.000 0.000 0.000
#> SRR868845     4  0.3752     0.4727 0.004 0.016 0.000 0.780 0.200
#> SRR868846     1  0.0981     0.7536 0.972 0.008 0.000 0.012 0.008
#> SRR868847     1  0.3845     0.7385 0.768 0.000 0.024 0.000 0.208
#> SRR868848     1  0.3845     0.7385 0.768 0.000 0.024 0.000 0.208
#> SRR868849     1  0.0981     0.7536 0.972 0.008 0.000 0.012 0.008
#> SRR868850     4  0.3982     0.4610 0.012 0.016 0.000 0.772 0.200
#> SRR868851     4  0.3948     0.4663 0.012 0.016 0.000 0.776 0.196
#> SRR868852     1  0.4924     0.0902 0.552 0.420 0.000 0.028 0.000
#> SRR868853     1  0.3691     0.6115 0.804 0.164 0.000 0.028 0.004
#> SRR868855     1  0.3113     0.7456 0.868 0.008 0.000 0.044 0.080
#> SRR868856     4  0.2966     0.7755 0.000 0.184 0.000 0.816 0.000
#> SRR868857     1  0.0981     0.7536 0.972 0.008 0.000 0.012 0.008
#> SRR868858     1  0.3602     0.7656 0.820 0.004 0.000 0.036 0.140
#> SRR868874     4  0.5498     0.6819 0.096 0.292 0.000 0.612 0.000
#> SRR868875     2  0.0000     0.6923 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.4647     0.5076 0.092 0.736 0.000 0.172 0.000
#> SRR868877     4  0.5498     0.6819 0.096 0.292 0.000 0.612 0.000
#> SRR868878     2  0.4647     0.5076 0.092 0.736 0.000 0.172 0.000
#> SRR868879     4  0.5498     0.6819 0.096 0.292 0.000 0.612 0.000
#> SRR868880     4  0.3752     0.7515 0.000 0.292 0.000 0.708 0.000
#> SRR868881     2  0.0162     0.6902 0.000 0.996 0.000 0.004 0.000
#> SRR868882     2  0.0000     0.6923 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0000     0.6923 0.000 1.000 0.000 0.000 0.000
#> SRR868884     2  0.2450     0.6600 0.076 0.896 0.000 0.028 0.000
#> SRR868885     2  0.0000     0.6923 0.000 1.000 0.000 0.000 0.000
#> SRR868829     5  0.2605     0.7270 0.148 0.000 0.000 0.000 0.852
#> SRR868830     5  0.2605     0.7270 0.148 0.000 0.000 0.000 0.852
#> SRR868831     3  0.0000     0.9034 0.000 0.000 1.000 0.000 0.000
#> SRR868828     3  0.0579     0.8935 0.000 0.000 0.984 0.008 0.008
#> SRR868832     3  0.0000     0.9034 0.000 0.000 1.000 0.000 0.000
#> SRR868833     3  0.0000     0.9034 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.2719     0.7793 0.852 0.000 0.000 0.004 0.144
#> SRR868854     4  0.2966     0.7755 0.000 0.184 0.000 0.816 0.000
#> SRR868859     4  0.3003     0.7763 0.000 0.188 0.000 0.812 0.000
#> SRR868860     4  0.2966     0.7755 0.000 0.184 0.000 0.816 0.000
#> SRR868861     1  0.0740     0.7564 0.980 0.008 0.000 0.008 0.004
#> SRR868862     1  0.0740     0.7564 0.980 0.008 0.000 0.008 0.004
#> SRR868863     4  0.3003     0.7763 0.000 0.188 0.000 0.812 0.000
#> SRR868864     1  0.3602     0.7680 0.820 0.004 0.000 0.036 0.140
#> SRR868865     2  0.2450     0.6600 0.076 0.896 0.000 0.028 0.000
#> SRR868866     1  0.4291     0.2525 0.536 0.000 0.000 0.000 0.464
#> SRR868867     1  0.0981     0.7536 0.972 0.008 0.000 0.012 0.008
#> SRR868868     1  0.4291     0.2525 0.536 0.000 0.000 0.000 0.464
#> SRR868869     1  0.4291     0.2525 0.536 0.000 0.000 0.000 0.464
#> SRR868870     4  0.3752     0.7515 0.000 0.292 0.000 0.708 0.000
#> SRR868871     2  0.4647     0.5076 0.092 0.736 0.000 0.172 0.000
#> SRR868873     4  0.3752     0.7515 0.000 0.292 0.000 0.708 0.000
#> SRR868872     2  0.4647     0.5076 0.092 0.736 0.000 0.172 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     1  0.1753      0.761 0.912 0.000 0.000 0.000 0.084 0.004
#> SRR868807     1  0.1753      0.761 0.912 0.000 0.000 0.000 0.084 0.004
#> SRR868808     1  0.1610      0.762 0.916 0.000 0.000 0.000 0.084 0.000
#> SRR868809     1  0.1610      0.762 0.916 0.000 0.000 0.000 0.084 0.000
#> SRR868810     2  0.1610      0.749 0.000 0.916 0.000 0.000 0.000 0.084
#> SRR868811     4  0.2912      0.715 0.000 0.216 0.000 0.784 0.000 0.000
#> SRR868812     1  0.2402      0.734 0.868 0.000 0.000 0.000 0.120 0.012
#> SRR868813     1  0.2623      0.724 0.852 0.000 0.000 0.000 0.132 0.016
#> SRR868814     5  0.5138      0.696 0.060 0.000 0.000 0.012 0.544 0.384
#> SRR868815     5  0.5138      0.696 0.060 0.000 0.000 0.012 0.544 0.384
#> SRR868816     3  0.0000      0.890 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000      0.890 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000      0.890 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     6  0.6683      1.000 0.288 0.300 0.000 0.000 0.032 0.380
#> SRR868820     6  0.6683      1.000 0.288 0.300 0.000 0.000 0.032 0.380
#> SRR868821     6  0.6683      1.000 0.288 0.300 0.000 0.000 0.032 0.380
#> SRR868822     1  0.1594      0.771 0.932 0.000 0.000 0.000 0.016 0.052
#> SRR868824     3  0.3763      0.738 0.108 0.000 0.808 0.000 0.028 0.056
#> SRR868823     3  0.4299      0.679 0.148 0.000 0.760 0.000 0.032 0.060
#> SRR868825     3  0.5123      0.455 0.280 0.000 0.632 0.000 0.032 0.056
#> SRR868826     3  0.0000      0.890 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868827     5  0.5025      0.277 0.356 0.000 0.000 0.000 0.560 0.084
#> SRR868835     1  0.2294      0.752 0.892 0.000 0.000 0.000 0.036 0.072
#> SRR868836     1  0.2136      0.770 0.904 0.000 0.000 0.000 0.048 0.048
#> SRR868837     1  0.3319      0.747 0.836 0.000 0.000 0.016 0.052 0.096
#> SRR868838     5  0.4353      0.711 0.060 0.000 0.000 0.012 0.724 0.204
#> SRR868839     1  0.4080      0.528 0.728 0.236 0.000 0.012 0.012 0.012
#> SRR868840     1  0.3366      0.745 0.832 0.000 0.000 0.016 0.052 0.100
#> SRR868841     1  0.3366      0.745 0.832 0.000 0.000 0.016 0.052 0.100
#> SRR868842     1  0.3470      0.724 0.836 0.072 0.000 0.000 0.040 0.052
#> SRR868843     1  0.2545      0.760 0.892 0.004 0.000 0.012 0.032 0.060
#> SRR868844     3  0.0000      0.890 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868845     4  0.4674      0.472 0.000 0.000 0.000 0.608 0.060 0.332
#> SRR868846     1  0.3470      0.724 0.836 0.072 0.000 0.000 0.040 0.052
#> SRR868847     1  0.2294      0.752 0.892 0.000 0.000 0.000 0.036 0.072
#> SRR868848     1  0.2294      0.752 0.892 0.000 0.000 0.000 0.036 0.072
#> SRR868849     1  0.3470      0.724 0.836 0.072 0.000 0.000 0.040 0.052
#> SRR868850     4  0.4911      0.463 0.008 0.000 0.000 0.600 0.060 0.332
#> SRR868851     4  0.4898      0.468 0.008 0.000 0.000 0.604 0.060 0.328
#> SRR868852     2  0.4887     -0.384 0.456 0.504 0.000 0.012 0.012 0.016
#> SRR868853     1  0.4323      0.499 0.708 0.248 0.000 0.012 0.012 0.020
#> SRR868855     1  0.4089      0.728 0.804 0.032 0.000 0.016 0.056 0.092
#> SRR868856     4  0.0363      0.791 0.000 0.012 0.000 0.988 0.000 0.000
#> SRR868857     1  0.3470      0.724 0.836 0.072 0.000 0.000 0.040 0.052
#> SRR868858     1  0.2545      0.760 0.892 0.004 0.000 0.012 0.032 0.060
#> SRR868874     4  0.4683      0.678 0.000 0.204 0.000 0.688 0.004 0.104
#> SRR868875     2  0.1610      0.749 0.000 0.916 0.000 0.000 0.000 0.084
#> SRR868876     2  0.3315      0.695 0.000 0.820 0.000 0.076 0.000 0.104
#> SRR868877     4  0.4683      0.678 0.000 0.204 0.000 0.688 0.004 0.104
#> SRR868878     2  0.3315      0.695 0.000 0.820 0.000 0.076 0.000 0.104
#> SRR868879     4  0.4683      0.678 0.000 0.204 0.000 0.688 0.004 0.104
#> SRR868880     4  0.2048      0.789 0.000 0.120 0.000 0.880 0.000 0.000
#> SRR868881     2  0.1663      0.744 0.000 0.912 0.000 0.000 0.000 0.088
#> SRR868882     2  0.1610      0.749 0.000 0.916 0.000 0.000 0.000 0.084
#> SRR868883     2  0.1610      0.749 0.000 0.916 0.000 0.000 0.000 0.084
#> SRR868884     2  0.0622      0.738 0.000 0.980 0.000 0.012 0.008 0.000
#> SRR868885     2  0.1610      0.749 0.000 0.916 0.000 0.000 0.000 0.084
#> SRR868829     5  0.1814      0.694 0.100 0.000 0.000 0.000 0.900 0.000
#> SRR868830     5  0.1814      0.694 0.100 0.000 0.000 0.000 0.900 0.000
#> SRR868831     3  0.0000      0.890 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868828     3  0.2597      0.773 0.000 0.000 0.824 0.000 0.000 0.176
#> SRR868832     3  0.0000      0.890 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868833     3  0.0000      0.890 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     1  0.2136      0.770 0.904 0.000 0.000 0.000 0.048 0.048
#> SRR868854     4  0.0363      0.791 0.000 0.012 0.000 0.988 0.000 0.000
#> SRR868859     4  0.0458      0.792 0.000 0.016 0.000 0.984 0.000 0.000
#> SRR868860     4  0.0363      0.791 0.000 0.012 0.000 0.988 0.000 0.000
#> SRR868861     1  0.3342      0.729 0.844 0.072 0.000 0.000 0.040 0.044
#> SRR868862     1  0.3342      0.729 0.844 0.072 0.000 0.000 0.040 0.044
#> SRR868863     4  0.0458      0.792 0.000 0.016 0.000 0.984 0.000 0.000
#> SRR868864     1  0.2408      0.763 0.900 0.004 0.000 0.012 0.028 0.056
#> SRR868865     2  0.0622      0.738 0.000 0.980 0.000 0.012 0.008 0.000
#> SRR868866     1  0.5240      0.370 0.584 0.000 0.000 0.000 0.284 0.132
#> SRR868867     1  0.3470      0.724 0.836 0.072 0.000 0.000 0.040 0.052
#> SRR868868     1  0.5240      0.370 0.584 0.000 0.000 0.000 0.284 0.132
#> SRR868869     1  0.5240      0.370 0.584 0.000 0.000 0.000 0.284 0.132
#> SRR868870     4  0.2048      0.789 0.000 0.120 0.000 0.880 0.000 0.000
#> SRR868871     2  0.3315      0.695 0.000 0.820 0.000 0.076 0.000 0.104
#> SRR868873     4  0.2048      0.789 0.000 0.120 0.000 0.880 0.000 0.000
#> SRR868872     2  0.3315      0.695 0.000 0.820 0.000 0.076 0.000 0.104

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

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

collect_plots(res)

plot of chunk MAD-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.753           0.894       0.947         0.4935 0.495   0.495
#> 3 3 0.579           0.754       0.832         0.2392 0.638   0.426
#> 4 4 0.644           0.662       0.810         0.1435 0.932   0.835
#> 5 5 0.679           0.723       0.827         0.0998 0.867   0.636
#> 6 6 0.706           0.653       0.795         0.0501 0.948   0.797

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
#> SRR868806     1  0.4022      0.906 0.920 0.080
#> SRR868807     1  0.0000      0.936 1.000 0.000
#> SRR868808     1  0.8955      0.577 0.688 0.312
#> SRR868809     1  0.0000      0.936 1.000 0.000
#> SRR868810     2  0.0000      0.944 0.000 1.000
#> SRR868811     2  0.0000      0.944 0.000 1.000
#> SRR868812     1  0.0000      0.936 1.000 0.000
#> SRR868813     1  0.4022      0.906 0.920 0.080
#> SRR868814     1  0.0000      0.936 1.000 0.000
#> SRR868815     1  0.0000      0.936 1.000 0.000
#> SRR868816     1  0.0000      0.936 1.000 0.000
#> SRR868817     1  0.0000      0.936 1.000 0.000
#> SRR868818     1  0.0000      0.936 1.000 0.000
#> SRR868819     2  0.6247      0.825 0.156 0.844
#> SRR868820     1  0.9427      0.468 0.640 0.360
#> SRR868821     1  0.9427      0.468 0.640 0.360
#> SRR868822     1  0.0000      0.936 1.000 0.000
#> SRR868824     1  0.0000      0.936 1.000 0.000
#> SRR868823     1  0.0000      0.936 1.000 0.000
#> SRR868825     1  0.0000      0.936 1.000 0.000
#> SRR868826     1  0.0000      0.936 1.000 0.000
#> SRR868827     1  0.0000      0.936 1.000 0.000
#> SRR868835     1  0.3274      0.916 0.940 0.060
#> SRR868836     1  0.3879      0.908 0.924 0.076
#> SRR868837     1  0.4022      0.906 0.920 0.080
#> SRR868838     1  0.0000      0.936 1.000 0.000
#> SRR868839     2  0.4815      0.874 0.104 0.896
#> SRR868840     1  0.4022      0.906 0.920 0.080
#> SRR868841     1  0.4022      0.906 0.920 0.080
#> SRR868842     1  0.8499      0.646 0.724 0.276
#> SRR868843     2  0.2043      0.928 0.032 0.968
#> SRR868844     1  0.0000      0.936 1.000 0.000
#> SRR868845     2  0.0000      0.944 0.000 1.000
#> SRR868846     2  0.8661      0.630 0.288 0.712
#> SRR868847     1  0.3274      0.916 0.940 0.060
#> SRR868848     1  0.4022      0.906 0.920 0.080
#> SRR868849     2  0.1184      0.937 0.016 0.984
#> SRR868850     2  0.5737      0.842 0.136 0.864
#> SRR868851     2  0.0000      0.944 0.000 1.000
#> SRR868852     2  0.0000      0.944 0.000 1.000
#> SRR868853     2  0.0672      0.941 0.008 0.992
#> SRR868855     2  0.6343      0.821 0.160 0.840
#> SRR868856     2  0.0000      0.944 0.000 1.000
#> SRR868857     2  0.7056      0.783 0.192 0.808
#> SRR868858     2  0.2043      0.928 0.032 0.968
#> SRR868874     2  0.0000      0.944 0.000 1.000
#> SRR868875     2  0.0000      0.944 0.000 1.000
#> SRR868876     2  0.0000      0.944 0.000 1.000
#> SRR868877     2  0.0000      0.944 0.000 1.000
#> SRR868878     2  0.0000      0.944 0.000 1.000
#> SRR868879     2  0.0000      0.944 0.000 1.000
#> SRR868880     2  0.0000      0.944 0.000 1.000
#> SRR868881     2  0.0000      0.944 0.000 1.000
#> SRR868882     2  0.0000      0.944 0.000 1.000
#> SRR868883     2  0.0000      0.944 0.000 1.000
#> SRR868884     2  0.0000      0.944 0.000 1.000
#> SRR868885     2  0.0000      0.944 0.000 1.000
#> SRR868829     1  0.0000      0.936 1.000 0.000
#> SRR868830     1  0.0000      0.936 1.000 0.000
#> SRR868831     1  0.0000      0.936 1.000 0.000
#> SRR868828     1  0.0000      0.936 1.000 0.000
#> SRR868832     1  0.0000      0.936 1.000 0.000
#> SRR868833     1  0.0000      0.936 1.000 0.000
#> SRR868834     1  0.3879      0.908 0.924 0.076
#> SRR868854     2  0.0000      0.944 0.000 1.000
#> SRR868859     2  0.0000      0.944 0.000 1.000
#> SRR868860     2  0.0000      0.944 0.000 1.000
#> SRR868861     2  0.8327      0.675 0.264 0.736
#> SRR868862     2  0.1184      0.937 0.016 0.984
#> SRR868863     2  0.0000      0.944 0.000 1.000
#> SRR868864     1  0.4022      0.906 0.920 0.080
#> SRR868865     2  0.0000      0.944 0.000 1.000
#> SRR868866     2  0.8144      0.696 0.252 0.748
#> SRR868867     2  0.6247      0.825 0.156 0.844
#> SRR868868     2  0.8144      0.696 0.252 0.748
#> SRR868869     1  0.0000      0.936 1.000 0.000
#> SRR868870     2  0.0000      0.944 0.000 1.000
#> SRR868871     2  0.0000      0.944 0.000 1.000
#> SRR868873     2  0.0000      0.944 0.000 1.000
#> SRR868872     2  0.0000      0.944 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
#> SRR868806     1  0.0000     0.7801 1.000 0.000 0.000
#> SRR868807     1  0.1031     0.7669 0.976 0.000 0.024
#> SRR868808     1  0.5178     0.7482 0.744 0.000 0.256
#> SRR868809     1  0.0592     0.7747 0.988 0.000 0.012
#> SRR868810     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868811     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868812     1  0.0892     0.7696 0.980 0.000 0.020
#> SRR868813     1  0.0475     0.7783 0.992 0.004 0.004
#> SRR868814     1  0.1129     0.7688 0.976 0.004 0.020
#> SRR868815     1  0.4931     0.4245 0.768 0.000 0.232
#> SRR868816     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868817     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868818     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868819     1  0.5291     0.7424 0.732 0.000 0.268
#> SRR868820     1  0.4605     0.7693 0.796 0.000 0.204
#> SRR868821     1  0.4605     0.7693 0.796 0.000 0.204
#> SRR868822     1  0.0747     0.7721 0.984 0.000 0.016
#> SRR868824     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868823     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868825     1  0.3038     0.6792 0.896 0.000 0.104
#> SRR868826     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868827     1  0.1163     0.7639 0.972 0.000 0.028
#> SRR868835     1  0.0661     0.7760 0.988 0.004 0.008
#> SRR868836     1  0.0892     0.7831 0.980 0.000 0.020
#> SRR868837     1  0.0237     0.7799 0.996 0.004 0.000
#> SRR868838     1  0.6099     0.4302 0.740 0.032 0.228
#> SRR868839     1  0.5618     0.7410 0.732 0.008 0.260
#> SRR868840     1  0.0237     0.7799 0.996 0.004 0.000
#> SRR868841     1  0.0475     0.7783 0.992 0.004 0.004
#> SRR868842     1  0.4235     0.7744 0.824 0.000 0.176
#> SRR868843     1  0.5618     0.7410 0.732 0.008 0.260
#> SRR868844     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868845     2  0.5835     0.2705 0.340 0.660 0.000
#> SRR868846     1  0.5202     0.7610 0.772 0.008 0.220
#> SRR868847     1  0.0661     0.7760 0.988 0.004 0.008
#> SRR868848     1  0.0475     0.7783 0.992 0.004 0.004
#> SRR868849     1  0.9885    -0.1414 0.372 0.368 0.260
#> SRR868850     1  0.5327     0.6642 0.728 0.272 0.000
#> SRR868851     2  0.6252    -0.0851 0.444 0.556 0.000
#> SRR868852     2  0.9376     0.5043 0.228 0.512 0.260
#> SRR868853     1  0.5618     0.7410 0.732 0.008 0.260
#> SRR868855     1  0.5156     0.7628 0.776 0.008 0.216
#> SRR868856     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868857     1  0.5618     0.7410 0.732 0.008 0.260
#> SRR868858     1  0.5618     0.7410 0.732 0.008 0.260
#> SRR868874     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868875     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868876     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868877     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868878     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868879     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868880     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868881     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868882     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868883     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868884     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868885     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868829     1  0.1163     0.7639 0.972 0.000 0.028
#> SRR868830     1  0.2152     0.7683 0.948 0.036 0.016
#> SRR868831     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868828     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868832     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868833     3  0.5291     1.0000 0.268 0.000 0.732
#> SRR868834     1  0.0000     0.7801 1.000 0.000 0.000
#> SRR868854     1  0.6309     0.2356 0.504 0.496 0.000
#> SRR868859     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868860     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868861     1  0.5109     0.7643 0.780 0.008 0.212
#> SRR868862     1  0.5919     0.7337 0.724 0.016 0.260
#> SRR868863     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868864     1  0.3412     0.7813 0.876 0.000 0.124
#> SRR868865     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868866     1  0.5938     0.6819 0.732 0.248 0.020
#> SRR868867     1  0.5502     0.7486 0.744 0.008 0.248
#> SRR868868     1  0.5938     0.6819 0.732 0.248 0.020
#> SRR868869     1  0.2313     0.7657 0.944 0.032 0.024
#> SRR868870     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868871     2  0.5919     0.8003 0.016 0.724 0.260
#> SRR868873     2  0.0000     0.7805 0.000 1.000 0.000
#> SRR868872     2  0.5919     0.8003 0.016 0.724 0.260

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.3351     0.7749 0.844 0.000 0.008 0.148
#> SRR868807     1  0.3479     0.7734 0.840 0.000 0.012 0.148
#> SRR868808     1  0.3325     0.7823 0.864 0.024 0.000 0.112
#> SRR868809     1  0.3249     0.7757 0.852 0.000 0.008 0.140
#> SRR868810     2  0.0469     0.7126 0.000 0.988 0.000 0.012
#> SRR868811     2  0.4955     0.2749 0.000 0.556 0.000 0.444
#> SRR868812     1  0.3681     0.7608 0.816 0.000 0.008 0.176
#> SRR868813     1  0.5220     0.5029 0.568 0.000 0.008 0.424
#> SRR868814     1  0.5229     0.4968 0.564 0.000 0.008 0.428
#> SRR868815     1  0.7221     0.2508 0.436 0.000 0.140 0.424
#> SRR868816     3  0.1059     0.9844 0.016 0.000 0.972 0.012
#> SRR868817     3  0.1059     0.9844 0.016 0.000 0.972 0.012
#> SRR868818     3  0.1059     0.9844 0.016 0.000 0.972 0.012
#> SRR868819     1  0.6303     0.6487 0.660 0.108 0.004 0.228
#> SRR868820     1  0.4444     0.7350 0.764 0.008 0.008 0.220
#> SRR868821     1  0.4444     0.7350 0.764 0.008 0.008 0.220
#> SRR868822     1  0.3032     0.7846 0.868 0.000 0.008 0.124
#> SRR868824     3  0.0779     0.9875 0.016 0.000 0.980 0.004
#> SRR868823     3  0.2578     0.9132 0.036 0.000 0.912 0.052
#> SRR868825     1  0.5221     0.6528 0.732 0.000 0.208 0.060
#> SRR868826     3  0.0592     0.9877 0.016 0.000 0.984 0.000
#> SRR868827     1  0.5080     0.5085 0.576 0.000 0.004 0.420
#> SRR868835     1  0.2124     0.7939 0.924 0.000 0.008 0.068
#> SRR868836     1  0.0657     0.7950 0.984 0.000 0.004 0.012
#> SRR868837     1  0.1635     0.7955 0.948 0.000 0.008 0.044
#> SRR868838     4  0.7162    -0.2521 0.392 0.000 0.136 0.472
#> SRR868839     1  0.3803     0.7100 0.836 0.132 0.000 0.032
#> SRR868840     1  0.1807     0.7963 0.940 0.000 0.008 0.052
#> SRR868841     1  0.2737     0.7846 0.888 0.000 0.008 0.104
#> SRR868842     1  0.1191     0.7918 0.968 0.004 0.004 0.024
#> SRR868843     1  0.1837     0.7880 0.944 0.028 0.000 0.028
#> SRR868844     3  0.0592     0.9877 0.016 0.000 0.984 0.000
#> SRR868845     4  0.4354     0.6094 0.088 0.084 0.004 0.824
#> SRR868846     1  0.1191     0.7918 0.968 0.004 0.004 0.024
#> SRR868847     1  0.1722     0.7950 0.944 0.000 0.008 0.048
#> SRR868848     1  0.1970     0.7945 0.932 0.000 0.008 0.060
#> SRR868849     1  0.5614     0.4757 0.652 0.304 0.000 0.044
#> SRR868850     1  0.5070     0.4628 0.580 0.000 0.004 0.416
#> SRR868851     4  0.4656     0.6122 0.160 0.056 0.000 0.784
#> SRR868852     2  0.5681     0.1096 0.404 0.568 0.000 0.028
#> SRR868853     1  0.5430     0.4960 0.664 0.300 0.000 0.036
#> SRR868855     1  0.1396     0.7940 0.960 0.004 0.004 0.032
#> SRR868856     4  0.4422     0.5392 0.008 0.256 0.000 0.736
#> SRR868857     1  0.2313     0.7774 0.924 0.044 0.000 0.032
#> SRR868858     1  0.2214     0.7821 0.928 0.044 0.000 0.028
#> SRR868874     2  0.4955     0.2749 0.000 0.556 0.000 0.444
#> SRR868875     2  0.0376     0.7196 0.004 0.992 0.000 0.004
#> SRR868876     2  0.0376     0.7196 0.004 0.992 0.000 0.004
#> SRR868877     2  0.4955     0.2749 0.000 0.556 0.000 0.444
#> SRR868878     2  0.0376     0.7196 0.004 0.992 0.000 0.004
#> SRR868879     2  0.4955     0.2749 0.000 0.556 0.000 0.444
#> SRR868880     2  0.4961     0.2655 0.000 0.552 0.000 0.448
#> SRR868881     2  0.0707     0.7084 0.000 0.980 0.000 0.020
#> SRR868882     2  0.0376     0.7196 0.004 0.992 0.000 0.004
#> SRR868883     2  0.0376     0.7196 0.004 0.992 0.000 0.004
#> SRR868884     2  0.0672     0.7119 0.008 0.984 0.000 0.008
#> SRR868885     2  0.0592     0.7109 0.000 0.984 0.000 0.016
#> SRR868829     1  0.5220     0.5031 0.568 0.000 0.008 0.424
#> SRR868830     1  0.5273     0.4497 0.536 0.000 0.008 0.456
#> SRR868831     3  0.0779     0.9875 0.016 0.000 0.980 0.004
#> SRR868828     3  0.0592     0.9877 0.016 0.000 0.984 0.000
#> SRR868832     3  0.0779     0.9875 0.016 0.000 0.980 0.004
#> SRR868833     3  0.0779     0.9875 0.016 0.000 0.980 0.004
#> SRR868834     1  0.0672     0.7952 0.984 0.000 0.008 0.008
#> SRR868854     4  0.4507     0.6071 0.168 0.044 0.000 0.788
#> SRR868859     4  0.4511     0.5276 0.008 0.268 0.000 0.724
#> SRR868860     4  0.5244     0.0437 0.008 0.436 0.000 0.556
#> SRR868861     1  0.2040     0.7883 0.936 0.004 0.012 0.048
#> SRR868862     1  0.5123     0.5852 0.724 0.232 0.000 0.044
#> SRR868863     4  0.4673     0.4851 0.008 0.292 0.000 0.700
#> SRR868864     1  0.0524     0.7959 0.988 0.000 0.004 0.008
#> SRR868865     2  0.0804     0.7085 0.012 0.980 0.000 0.008
#> SRR868866     1  0.4011     0.7039 0.784 0.000 0.008 0.208
#> SRR868867     1  0.2271     0.7835 0.928 0.012 0.008 0.052
#> SRR868868     1  0.4011     0.7039 0.784 0.000 0.008 0.208
#> SRR868869     1  0.4420     0.7000 0.748 0.000 0.012 0.240
#> SRR868870     2  0.4961     0.2655 0.000 0.552 0.000 0.448
#> SRR868871     2  0.0376     0.7196 0.004 0.992 0.000 0.004
#> SRR868873     2  0.4961     0.2655 0.000 0.552 0.000 0.448
#> SRR868872     2  0.0376     0.7196 0.004 0.992 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
#> SRR868806     1  0.4367     0.2561 0.580 0.000 0.000 0.004 0.416
#> SRR868807     1  0.4909     0.0475 0.508 0.000 0.012 0.008 0.472
#> SRR868808     1  0.4512     0.4658 0.676 0.020 0.000 0.004 0.300
#> SRR868809     1  0.4489     0.2415 0.572 0.000 0.000 0.008 0.420
#> SRR868810     2  0.1168     0.9360 0.000 0.960 0.000 0.008 0.032
#> SRR868811     4  0.4040     0.8073 0.000 0.260 0.000 0.724 0.016
#> SRR868812     5  0.4604     0.3143 0.404 0.000 0.008 0.004 0.584
#> SRR868813     5  0.5144     0.8056 0.176 0.000 0.000 0.132 0.692
#> SRR868814     5  0.5543     0.8191 0.156 0.000 0.008 0.164 0.672
#> SRR868815     5  0.5901     0.8096 0.120 0.000 0.044 0.160 0.676
#> SRR868816     3  0.0324     0.9581 0.000 0.000 0.992 0.004 0.004
#> SRR868817     3  0.0324     0.9581 0.000 0.000 0.992 0.004 0.004
#> SRR868818     3  0.0324     0.9581 0.000 0.000 0.992 0.004 0.004
#> SRR868819     1  0.5920     0.3552 0.572 0.040 0.000 0.044 0.344
#> SRR868820     1  0.5536     0.3745 0.596 0.020 0.000 0.044 0.340
#> SRR868821     1  0.5536     0.3745 0.596 0.020 0.000 0.044 0.340
#> SRR868822     1  0.4183     0.4328 0.668 0.000 0.000 0.008 0.324
#> SRR868824     3  0.1281     0.9523 0.000 0.000 0.956 0.012 0.032
#> SRR868823     3  0.4082     0.7163 0.016 0.000 0.768 0.016 0.200
#> SRR868825     1  0.5813     0.4777 0.656 0.000 0.160 0.016 0.168
#> SRR868826     3  0.0162     0.9588 0.000 0.000 0.996 0.000 0.004
#> SRR868827     5  0.4883     0.8175 0.152 0.000 0.008 0.104 0.736
#> SRR868835     1  0.4106     0.5598 0.724 0.000 0.000 0.020 0.256
#> SRR868836     1  0.0579     0.7175 0.984 0.008 0.000 0.000 0.008
#> SRR868837     1  0.2411     0.6983 0.884 0.000 0.000 0.008 0.108
#> SRR868838     5  0.5691     0.7975 0.096 0.000 0.036 0.184 0.684
#> SRR868839     1  0.2054     0.6998 0.916 0.072 0.000 0.004 0.008
#> SRR868840     1  0.3456     0.6429 0.800 0.000 0.000 0.016 0.184
#> SRR868841     1  0.5068     0.4088 0.640 0.000 0.000 0.060 0.300
#> SRR868842     1  0.0290     0.7180 0.992 0.000 0.000 0.000 0.008
#> SRR868843     1  0.2390     0.7089 0.896 0.000 0.000 0.020 0.084
#> SRR868844     3  0.0162     0.9588 0.000 0.000 0.996 0.000 0.004
#> SRR868845     4  0.4261     0.5622 0.012 0.024 0.000 0.752 0.212
#> SRR868846     1  0.0290     0.7180 0.992 0.000 0.000 0.000 0.008
#> SRR868847     1  0.3048     0.6509 0.820 0.000 0.000 0.004 0.176
#> SRR868848     1  0.3789     0.5986 0.760 0.000 0.000 0.016 0.224
#> SRR868849     1  0.3427     0.6539 0.836 0.128 0.000 0.008 0.028
#> SRR868850     5  0.6463     0.5391 0.300 0.000 0.000 0.212 0.488
#> SRR868851     4  0.2316     0.7459 0.036 0.012 0.000 0.916 0.036
#> SRR868852     2  0.4387     0.5260 0.272 0.704 0.000 0.008 0.016
#> SRR868853     1  0.4073     0.6451 0.800 0.144 0.000 0.020 0.036
#> SRR868855     1  0.2208     0.7106 0.908 0.000 0.000 0.020 0.072
#> SRR868856     4  0.2291     0.7823 0.012 0.048 0.000 0.916 0.024
#> SRR868857     1  0.0898     0.7163 0.972 0.020 0.000 0.000 0.008
#> SRR868858     1  0.2550     0.7091 0.892 0.004 0.000 0.020 0.084
#> SRR868874     4  0.3586     0.8096 0.000 0.264 0.000 0.736 0.000
#> SRR868875     2  0.1211     0.9392 0.000 0.960 0.000 0.024 0.016
#> SRR868876     2  0.0703     0.9416 0.000 0.976 0.000 0.024 0.000
#> SRR868877     4  0.3586     0.8096 0.000 0.264 0.000 0.736 0.000
#> SRR868878     2  0.0703     0.9416 0.000 0.976 0.000 0.024 0.000
#> SRR868879     4  0.3586     0.8096 0.000 0.264 0.000 0.736 0.000
#> SRR868880     4  0.3480     0.8187 0.000 0.248 0.000 0.752 0.000
#> SRR868881     2  0.0609     0.9332 0.000 0.980 0.000 0.000 0.020
#> SRR868882     2  0.1018     0.9405 0.000 0.968 0.000 0.016 0.016
#> SRR868883     2  0.1018     0.9405 0.000 0.968 0.000 0.016 0.016
#> SRR868884     2  0.0000     0.9387 0.000 1.000 0.000 0.000 0.000
#> SRR868885     2  0.1168     0.9360 0.000 0.960 0.000 0.008 0.032
#> SRR868829     5  0.4834     0.8154 0.152 0.000 0.008 0.100 0.740
#> SRR868830     5  0.5122     0.8243 0.140 0.000 0.008 0.136 0.716
#> SRR868831     3  0.1281     0.9523 0.000 0.000 0.956 0.012 0.032
#> SRR868828     3  0.0162     0.9588 0.000 0.000 0.996 0.000 0.004
#> SRR868832     3  0.1281     0.9523 0.000 0.000 0.956 0.012 0.032
#> SRR868833     3  0.1281     0.9523 0.000 0.000 0.956 0.012 0.032
#> SRR868834     1  0.0162     0.7178 0.996 0.000 0.000 0.000 0.004
#> SRR868854     4  0.2451     0.7321 0.036 0.004 0.000 0.904 0.056
#> SRR868859     4  0.2633     0.7951 0.012 0.068 0.000 0.896 0.024
#> SRR868860     4  0.3450     0.8228 0.008 0.176 0.000 0.808 0.008
#> SRR868861     1  0.2189     0.7007 0.904 0.000 0.000 0.012 0.084
#> SRR868862     1  0.3298     0.6710 0.856 0.096 0.000 0.012 0.036
#> SRR868863     4  0.2266     0.7978 0.008 0.064 0.000 0.912 0.016
#> SRR868864     1  0.1270     0.7132 0.948 0.000 0.000 0.000 0.052
#> SRR868865     2  0.0162     0.9364 0.000 0.996 0.000 0.000 0.004
#> SRR868866     1  0.4649     0.5495 0.716 0.000 0.000 0.064 0.220
#> SRR868867     1  0.2291     0.6990 0.908 0.012 0.000 0.008 0.072
#> SRR868868     1  0.4649     0.5495 0.716 0.000 0.000 0.064 0.220
#> SRR868869     1  0.5687     0.1530 0.496 0.000 0.004 0.068 0.432
#> SRR868870     4  0.3480     0.8187 0.000 0.248 0.000 0.752 0.000
#> SRR868871     2  0.0703     0.9416 0.000 0.976 0.000 0.024 0.000
#> SRR868873     4  0.3480     0.8187 0.000 0.248 0.000 0.752 0.000
#> SRR868872     2  0.0703     0.9416 0.000 0.976 0.000 0.024 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     5  0.5804    -0.1151 0.404 0.000 0.000 0.004 0.436 0.156
#> SRR868807     5  0.5721     0.0803 0.368 0.000 0.004 0.000 0.480 0.148
#> SRR868808     1  0.5544    -0.2614 0.500 0.000 0.000 0.000 0.356 0.144
#> SRR868809     1  0.5681    -0.2095 0.424 0.000 0.000 0.000 0.420 0.156
#> SRR868810     2  0.1563     0.9410 0.000 0.932 0.000 0.000 0.012 0.056
#> SRR868811     4  0.3756     0.8158 0.000 0.152 0.000 0.788 0.012 0.048
#> SRR868812     5  0.5296     0.0755 0.260 0.000 0.000 0.000 0.588 0.152
#> SRR868813     5  0.5327     0.5683 0.064 0.000 0.000 0.060 0.656 0.220
#> SRR868814     5  0.5313     0.5934 0.052 0.000 0.000 0.080 0.664 0.204
#> SRR868815     5  0.5333     0.5934 0.052 0.000 0.000 0.084 0.664 0.200
#> SRR868816     3  0.0260     0.9332 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868817     3  0.0260     0.9332 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868818     3  0.0260     0.9332 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868819     6  0.6477     0.9798 0.364 0.004 0.000 0.016 0.228 0.388
#> SRR868820     6  0.6467     0.9899 0.372 0.004 0.000 0.016 0.224 0.384
#> SRR868821     6  0.6467     0.9899 0.372 0.004 0.000 0.016 0.224 0.384
#> SRR868822     1  0.5133    -0.0795 0.564 0.000 0.000 0.000 0.336 0.100
#> SRR868824     3  0.2444     0.9178 0.000 0.000 0.892 0.012 0.028 0.068
#> SRR868823     3  0.4983     0.6559 0.008 0.000 0.692 0.016 0.196 0.088
#> SRR868825     1  0.6777     0.2508 0.556 0.000 0.160 0.012 0.148 0.124
#> SRR868826     3  0.0260     0.9332 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR868827     5  0.2183     0.5820 0.040 0.000 0.000 0.028 0.912 0.020
#> SRR868835     1  0.4265     0.4806 0.660 0.000 0.000 0.000 0.300 0.040
#> SRR868836     1  0.1789     0.5872 0.924 0.000 0.000 0.000 0.032 0.044
#> SRR868837     1  0.3576     0.5960 0.812 0.000 0.000 0.008 0.096 0.084
#> SRR868838     5  0.4420     0.5777 0.040 0.000 0.000 0.076 0.760 0.124
#> SRR868839     1  0.1942     0.5674 0.916 0.012 0.000 0.000 0.008 0.064
#> SRR868840     1  0.4622     0.5474 0.720 0.000 0.000 0.012 0.136 0.132
#> SRR868841     1  0.5569     0.4629 0.628 0.000 0.000 0.028 0.172 0.172
#> SRR868842     1  0.0603     0.5910 0.980 0.000 0.000 0.000 0.004 0.016
#> SRR868843     1  0.2961     0.5911 0.860 0.000 0.000 0.012 0.048 0.080
#> SRR868844     3  0.0260     0.9332 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR868845     4  0.5525     0.4541 0.012 0.000 0.000 0.604 0.176 0.208
#> SRR868846     1  0.0603     0.5910 0.980 0.000 0.000 0.000 0.004 0.016
#> SRR868847     1  0.3909     0.5679 0.772 0.000 0.000 0.004 0.148 0.076
#> SRR868848     1  0.4204     0.5171 0.696 0.000 0.000 0.000 0.252 0.052
#> SRR868849     1  0.3605     0.4523 0.804 0.060 0.000 0.008 0.000 0.128
#> SRR868850     5  0.7339     0.3475 0.208 0.000 0.000 0.128 0.380 0.284
#> SRR868851     4  0.2566     0.8115 0.020 0.000 0.000 0.888 0.028 0.064
#> SRR868852     2  0.4035     0.5776 0.204 0.740 0.000 0.000 0.004 0.052
#> SRR868853     1  0.3789     0.5616 0.820 0.068 0.000 0.012 0.020 0.080
#> SRR868855     1  0.2619     0.6062 0.884 0.000 0.000 0.012 0.048 0.056
#> SRR868856     4  0.2450     0.8167 0.012 0.004 0.000 0.896 0.024 0.064
#> SRR868857     1  0.1769     0.5677 0.924 0.004 0.000 0.000 0.012 0.060
#> SRR868858     1  0.3103     0.5898 0.856 0.004 0.000 0.012 0.048 0.080
#> SRR868874     4  0.2932     0.8388 0.000 0.164 0.000 0.820 0.000 0.016
#> SRR868875     2  0.1462     0.9422 0.000 0.936 0.000 0.000 0.008 0.056
#> SRR868876     2  0.0363     0.9413 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR868877     4  0.2932     0.8388 0.000 0.164 0.000 0.820 0.000 0.016
#> SRR868878     2  0.0363     0.9413 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR868879     4  0.2932     0.8388 0.000 0.164 0.000 0.820 0.000 0.016
#> SRR868880     4  0.2300     0.8530 0.000 0.144 0.000 0.856 0.000 0.000
#> SRR868881     2  0.0622     0.9434 0.000 0.980 0.000 0.000 0.008 0.012
#> SRR868882     2  0.1500     0.9421 0.000 0.936 0.000 0.000 0.012 0.052
#> SRR868883     2  0.1500     0.9421 0.000 0.936 0.000 0.000 0.012 0.052
#> SRR868884     2  0.0000     0.9426 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.1563     0.9410 0.000 0.932 0.000 0.000 0.012 0.056
#> SRR868829     5  0.1636     0.5783 0.036 0.000 0.000 0.024 0.936 0.004
#> SRR868830     5  0.2119     0.5836 0.036 0.000 0.000 0.044 0.912 0.008
#> SRR868831     3  0.2365     0.9197 0.000 0.000 0.896 0.012 0.024 0.068
#> SRR868828     3  0.0405     0.9323 0.000 0.000 0.988 0.008 0.000 0.004
#> SRR868832     3  0.2307     0.9212 0.000 0.000 0.900 0.012 0.024 0.064
#> SRR868833     3  0.2307     0.9212 0.000 0.000 0.900 0.012 0.024 0.064
#> SRR868834     1  0.1633     0.5943 0.932 0.000 0.000 0.000 0.024 0.044
#> SRR868854     4  0.3448     0.7848 0.016 0.000 0.000 0.828 0.092 0.064
#> SRR868859     4  0.2734     0.8171 0.016 0.008 0.000 0.884 0.028 0.064
#> SRR868860     4  0.2971     0.8479 0.012 0.080 0.000 0.864 0.004 0.040
#> SRR868861     1  0.3541     0.4031 0.728 0.000 0.000 0.012 0.000 0.260
#> SRR868862     1  0.3465     0.4642 0.812 0.048 0.000 0.008 0.000 0.132
#> SRR868863     4  0.2834     0.8196 0.016 0.012 0.000 0.880 0.028 0.064
#> SRR868864     1  0.2888     0.5981 0.852 0.000 0.000 0.000 0.056 0.092
#> SRR868865     2  0.0363     0.9378 0.012 0.988 0.000 0.000 0.000 0.000
#> SRR868866     1  0.5779     0.3120 0.580 0.000 0.000 0.040 0.104 0.276
#> SRR868867     1  0.3656     0.3973 0.728 0.004 0.000 0.012 0.000 0.256
#> SRR868868     1  0.5779     0.3120 0.580 0.000 0.000 0.040 0.104 0.276
#> SRR868869     1  0.6650     0.1039 0.364 0.000 0.000 0.028 0.292 0.316
#> SRR868870     4  0.2300     0.8530 0.000 0.144 0.000 0.856 0.000 0.000
#> SRR868871     2  0.1285     0.9426 0.000 0.944 0.000 0.000 0.004 0.052
#> SRR868873     4  0.2300     0.8530 0.000 0.144 0.000 0.856 0.000 0.000
#> SRR868872     2  0.0363     0.9413 0.000 0.988 0.000 0.000 0.000 0.012

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 15961 rows and 80 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.983       0.992         0.5059 0.495   0.495
#> 3 3 0.766           0.896       0.920         0.2880 0.791   0.603
#> 4 4 0.739           0.721       0.851         0.1370 0.868   0.640
#> 5 5 0.759           0.727       0.841         0.0637 0.952   0.814
#> 6 6 0.794           0.700       0.840         0.0397 0.941   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
#> SRR868806     1  0.0000      1.000 1.000 0.000
#> SRR868807     1  0.0000      1.000 1.000 0.000
#> SRR868808     1  0.0000      1.000 1.000 0.000
#> SRR868809     1  0.0000      1.000 1.000 0.000
#> SRR868810     2  0.0000      0.985 0.000 1.000
#> SRR868811     2  0.0000      0.985 0.000 1.000
#> SRR868812     1  0.0000      1.000 1.000 0.000
#> SRR868813     1  0.0000      1.000 1.000 0.000
#> SRR868814     1  0.0000      1.000 1.000 0.000
#> SRR868815     1  0.0000      1.000 1.000 0.000
#> SRR868816     1  0.0000      1.000 1.000 0.000
#> SRR868817     1  0.0000      1.000 1.000 0.000
#> SRR868818     1  0.0000      1.000 1.000 0.000
#> SRR868819     2  0.1633      0.966 0.024 0.976
#> SRR868820     1  0.0000      1.000 1.000 0.000
#> SRR868821     1  0.0000      1.000 1.000 0.000
#> SRR868822     1  0.0000      1.000 1.000 0.000
#> SRR868824     1  0.0000      1.000 1.000 0.000
#> SRR868823     1  0.0000      1.000 1.000 0.000
#> SRR868825     1  0.0000      1.000 1.000 0.000
#> SRR868826     1  0.0000      1.000 1.000 0.000
#> SRR868827     1  0.0000      1.000 1.000 0.000
#> SRR868835     1  0.0000      1.000 1.000 0.000
#> SRR868836     1  0.0000      1.000 1.000 0.000
#> SRR868837     1  0.0000      1.000 1.000 0.000
#> SRR868838     1  0.0000      1.000 1.000 0.000
#> SRR868839     2  0.0000      0.985 0.000 1.000
#> SRR868840     1  0.0000      1.000 1.000 0.000
#> SRR868841     1  0.0000      1.000 1.000 0.000
#> SRR868842     1  0.0000      1.000 1.000 0.000
#> SRR868843     2  0.0000      0.985 0.000 1.000
#> SRR868844     1  0.0000      1.000 1.000 0.000
#> SRR868845     2  0.0000      0.985 0.000 1.000
#> SRR868846     2  0.8813      0.587 0.300 0.700
#> SRR868847     1  0.0000      1.000 1.000 0.000
#> SRR868848     1  0.0000      1.000 1.000 0.000
#> SRR868849     2  0.0000      0.985 0.000 1.000
#> SRR868850     2  0.3274      0.931 0.060 0.940
#> SRR868851     2  0.0000      0.985 0.000 1.000
#> SRR868852     2  0.0000      0.985 0.000 1.000
#> SRR868853     2  0.0000      0.985 0.000 1.000
#> SRR868855     2  0.0000      0.985 0.000 1.000
#> SRR868856     2  0.0000      0.985 0.000 1.000
#> SRR868857     2  0.6973      0.775 0.188 0.812
#> SRR868858     2  0.0000      0.985 0.000 1.000
#> SRR868874     2  0.0000      0.985 0.000 1.000
#> SRR868875     2  0.0000      0.985 0.000 1.000
#> SRR868876     2  0.0000      0.985 0.000 1.000
#> SRR868877     2  0.0000      0.985 0.000 1.000
#> SRR868878     2  0.0000      0.985 0.000 1.000
#> SRR868879     2  0.0000      0.985 0.000 1.000
#> SRR868880     2  0.0000      0.985 0.000 1.000
#> SRR868881     2  0.0000      0.985 0.000 1.000
#> SRR868882     2  0.0000      0.985 0.000 1.000
#> SRR868883     2  0.0000      0.985 0.000 1.000
#> SRR868884     2  0.0000      0.985 0.000 1.000
#> SRR868885     2  0.0000      0.985 0.000 1.000
#> SRR868829     1  0.0000      1.000 1.000 0.000
#> SRR868830     1  0.0000      1.000 1.000 0.000
#> SRR868831     1  0.0000      1.000 1.000 0.000
#> SRR868828     1  0.0000      1.000 1.000 0.000
#> SRR868832     1  0.0000      1.000 1.000 0.000
#> SRR868833     1  0.0000      1.000 1.000 0.000
#> SRR868834     1  0.0000      1.000 1.000 0.000
#> SRR868854     2  0.0000      0.985 0.000 1.000
#> SRR868859     2  0.0000      0.985 0.000 1.000
#> SRR868860     2  0.0000      0.985 0.000 1.000
#> SRR868861     2  0.1633      0.967 0.024 0.976
#> SRR868862     2  0.0000      0.985 0.000 1.000
#> SRR868863     2  0.0000      0.985 0.000 1.000
#> SRR868864     1  0.0000      1.000 1.000 0.000
#> SRR868865     2  0.0000      0.985 0.000 1.000
#> SRR868866     2  0.0672      0.979 0.008 0.992
#> SRR868867     2  0.1414      0.970 0.020 0.980
#> SRR868868     2  0.0672      0.979 0.008 0.992
#> SRR868869     1  0.0000      1.000 1.000 0.000
#> SRR868870     2  0.0000      0.985 0.000 1.000
#> SRR868871     2  0.0000      0.985 0.000 1.000
#> SRR868873     2  0.0000      0.985 0.000 1.000
#> SRR868872     2  0.0000      0.985 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
#> SRR868806     3  0.0237      0.955 0.000 0.004 0.996
#> SRR868807     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868808     1  0.4575      0.754 0.812 0.004 0.184
#> SRR868809     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868810     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868811     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868812     3  0.0237      0.955 0.000 0.004 0.996
#> SRR868813     3  0.0237      0.955 0.000 0.004 0.996
#> SRR868814     3  0.0237      0.955 0.000 0.004 0.996
#> SRR868815     3  0.0237      0.955 0.000 0.004 0.996
#> SRR868816     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868817     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868818     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868819     1  0.2356      0.855 0.928 0.072 0.000
#> SRR868820     1  0.4351      0.724 0.828 0.004 0.168
#> SRR868821     1  0.4351      0.724 0.828 0.004 0.168
#> SRR868822     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868824     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868823     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868825     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868826     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868827     3  0.0237      0.955 0.000 0.004 0.996
#> SRR868835     3  0.2261      0.929 0.068 0.000 0.932
#> SRR868836     3  0.4399      0.831 0.188 0.000 0.812
#> SRR868837     3  0.2261      0.929 0.068 0.000 0.932
#> SRR868838     3  0.4555      0.756 0.000 0.200 0.800
#> SRR868839     1  0.1964      0.851 0.944 0.056 0.000
#> SRR868840     3  0.2261      0.929 0.068 0.000 0.932
#> SRR868841     3  0.2165      0.931 0.064 0.000 0.936
#> SRR868842     1  0.6126      0.146 0.600 0.000 0.400
#> SRR868843     1  0.4235      0.887 0.824 0.176 0.000
#> SRR868844     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868845     2  0.0000      0.968 0.000 1.000 0.000
#> SRR868846     1  0.0000      0.816 1.000 0.000 0.000
#> SRR868847     3  0.2261      0.929 0.068 0.000 0.932
#> SRR868848     3  0.2261      0.929 0.068 0.000 0.932
#> SRR868849     1  0.2165      0.854 0.936 0.064 0.000
#> SRR868850     2  0.0000      0.968 0.000 1.000 0.000
#> SRR868851     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868852     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868853     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868855     1  0.4629      0.880 0.808 0.188 0.004
#> SRR868856     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868857     1  0.1753      0.847 0.952 0.048 0.000
#> SRR868858     1  0.4235      0.887 0.824 0.176 0.000
#> SRR868874     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868875     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868876     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868877     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868878     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868879     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868880     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868881     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868882     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868883     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868884     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868885     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868829     3  0.0237      0.955 0.000 0.004 0.996
#> SRR868830     3  0.4605      0.754 0.000 0.204 0.796
#> SRR868831     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868828     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868832     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868833     3  0.0000      0.956 0.000 0.000 1.000
#> SRR868834     3  0.4399      0.831 0.188 0.000 0.812
#> SRR868854     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868859     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868860     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868861     1  0.0592      0.813 0.988 0.012 0.000
#> SRR868862     1  0.2165      0.854 0.936 0.064 0.000
#> SRR868863     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868864     3  0.2261      0.929 0.068 0.000 0.932
#> SRR868865     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868866     2  0.4452      0.790 0.192 0.808 0.000
#> SRR868867     1  0.0000      0.816 1.000 0.000 0.000
#> SRR868868     2  0.4452      0.790 0.192 0.808 0.000
#> SRR868869     3  0.6402      0.729 0.056 0.200 0.744
#> SRR868870     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868871     1  0.4399      0.889 0.812 0.188 0.000
#> SRR868873     2  0.0237      0.971 0.004 0.996 0.000
#> SRR868872     1  0.4399      0.889 0.812 0.188 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     3  0.3174     0.8435 0.076 0.008 0.888 0.028
#> SRR868807     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868808     2  0.5978     0.5799 0.088 0.732 0.152 0.028
#> SRR868809     3  0.0524     0.8950 0.008 0.004 0.988 0.000
#> SRR868810     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868811     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868812     3  0.2660     0.8576 0.072 0.008 0.908 0.012
#> SRR868813     3  0.3245     0.8417 0.080 0.008 0.884 0.028
#> SRR868814     3  0.3030     0.8485 0.076 0.004 0.892 0.028
#> SRR868815     3  0.1978     0.8706 0.068 0.000 0.928 0.004
#> SRR868816     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868819     2  0.5681     0.3790 0.404 0.568 0.000 0.028
#> SRR868820     1  0.8402     0.0416 0.404 0.352 0.216 0.028
#> SRR868821     1  0.8402     0.0416 0.404 0.352 0.216 0.028
#> SRR868822     3  0.3266     0.6904 0.168 0.000 0.832 0.000
#> SRR868824     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868823     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868825     3  0.0188     0.8969 0.004 0.000 0.996 0.000
#> SRR868826     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868827     3  0.2384     0.8625 0.072 0.004 0.916 0.008
#> SRR868835     1  0.4916     0.4658 0.576 0.000 0.424 0.000
#> SRR868836     1  0.3245     0.6048 0.872 0.028 0.100 0.000
#> SRR868837     1  0.4888     0.4790 0.588 0.000 0.412 0.000
#> SRR868838     3  0.2704     0.7654 0.000 0.000 0.876 0.124
#> SRR868839     2  0.4164     0.6654 0.264 0.736 0.000 0.000
#> SRR868840     1  0.5000     0.3065 0.504 0.000 0.496 0.000
#> SRR868841     3  0.5000    -0.3589 0.496 0.000 0.504 0.000
#> SRR868842     1  0.2011     0.6019 0.920 0.000 0.080 0.000
#> SRR868843     2  0.4262     0.6526 0.236 0.756 0.000 0.008
#> SRR868844     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868845     4  0.0188     0.9049 0.004 0.000 0.000 0.996
#> SRR868846     1  0.2011     0.5253 0.920 0.080 0.000 0.000
#> SRR868847     1  0.4907     0.4689 0.580 0.000 0.420 0.000
#> SRR868848     1  0.4907     0.4689 0.580 0.000 0.420 0.000
#> SRR868849     2  0.4730     0.4705 0.364 0.636 0.000 0.000
#> SRR868850     4  0.0336     0.9033 0.008 0.000 0.000 0.992
#> SRR868851     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868852     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868853     2  0.1624     0.8343 0.020 0.952 0.000 0.028
#> SRR868855     2  0.6302     0.3571 0.368 0.564 0.000 0.068
#> SRR868856     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868857     2  0.4761     0.5513 0.372 0.628 0.000 0.000
#> SRR868858     2  0.4086     0.6751 0.216 0.776 0.000 0.008
#> SRR868874     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868875     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868876     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868877     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868878     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868879     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868880     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868881     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868882     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868883     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868884     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868885     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868829     3  0.2164     0.8668 0.068 0.004 0.924 0.004
#> SRR868830     3  0.5559     0.6282 0.072 0.008 0.732 0.188
#> SRR868831     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868828     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868832     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000     0.8989 0.000 0.000 1.000 0.000
#> SRR868834     1  0.2081     0.6039 0.916 0.000 0.084 0.000
#> SRR868854     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868859     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868860     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868861     1  0.3831     0.4450 0.792 0.204 0.000 0.004
#> SRR868862     2  0.4643     0.4988 0.344 0.656 0.000 0.000
#> SRR868863     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868864     1  0.5125     0.4993 0.604 0.008 0.388 0.000
#> SRR868865     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868866     4  0.5992     0.2487 0.444 0.040 0.000 0.516
#> SRR868867     1  0.4072     0.3828 0.748 0.252 0.000 0.000
#> SRR868868     4  0.5992     0.2487 0.444 0.040 0.000 0.516
#> SRR868869     1  0.8518     0.3474 0.424 0.040 0.336 0.200
#> SRR868870     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868871     2  0.1389     0.8459 0.000 0.952 0.000 0.048
#> SRR868873     4  0.0921     0.9316 0.000 0.028 0.000 0.972
#> SRR868872     2  0.1389     0.8459 0.000 0.952 0.000 0.048

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     3  0.5221     0.4748 0.048 0.000 0.552 0.000 0.400
#> SRR868807     3  0.0290     0.8564 0.008 0.000 0.992 0.000 0.000
#> SRR868808     2  0.6633     0.0442 0.008 0.436 0.168 0.000 0.388
#> SRR868809     3  0.1628     0.8322 0.008 0.000 0.936 0.000 0.056
#> SRR868810     2  0.0609     0.8361 0.000 0.980 0.000 0.020 0.000
#> SRR868811     4  0.0880     0.9688 0.000 0.032 0.000 0.968 0.000
#> SRR868812     3  0.4182     0.5797 0.004 0.000 0.644 0.000 0.352
#> SRR868813     3  0.6065     0.4061 0.084 0.000 0.488 0.012 0.416
#> SRR868814     3  0.5926     0.6151 0.116 0.000 0.612 0.012 0.260
#> SRR868815     3  0.3548     0.7812 0.112 0.000 0.836 0.008 0.044
#> SRR868816     3  0.0000     0.8587 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000     0.8587 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000     0.8587 0.000 0.000 1.000 0.000 0.000
#> SRR868819     5  0.1357     0.5278 0.004 0.048 0.000 0.000 0.948
#> SRR868820     5  0.1547     0.5299 0.004 0.032 0.016 0.000 0.948
#> SRR868821     5  0.1547     0.5299 0.004 0.032 0.016 0.000 0.948
#> SRR868822     3  0.3163     0.7118 0.012 0.000 0.824 0.000 0.164
#> SRR868824     3  0.0000     0.8587 0.000 0.000 1.000 0.000 0.000
#> SRR868823     3  0.0404     0.8547 0.012 0.000 0.988 0.000 0.000
#> SRR868825     3  0.0000     0.8587 0.000 0.000 1.000 0.000 0.000
#> SRR868826     3  0.0162     0.8578 0.004 0.000 0.996 0.000 0.000
#> SRR868827     3  0.3825     0.7771 0.060 0.000 0.804 0.000 0.136
#> SRR868835     1  0.3074     0.6996 0.804 0.000 0.196 0.000 0.000
#> SRR868836     1  0.5283     0.3588 0.644 0.004 0.048 0.008 0.296
#> SRR868837     1  0.3387     0.6863 0.832 0.008 0.140 0.000 0.020
#> SRR868838     3  0.4393     0.7373 0.100 0.000 0.792 0.088 0.020
#> SRR868839     2  0.4465     0.6370 0.060 0.736 0.000 0.000 0.204
#> SRR868840     1  0.4627     0.6169 0.704 0.008 0.256 0.000 0.032
#> SRR868841     1  0.4829     0.6061 0.692 0.008 0.264 0.004 0.032
#> SRR868842     1  0.3706     0.4992 0.756 0.004 0.004 0.000 0.236
#> SRR868843     2  0.4811     0.1987 0.452 0.528 0.000 0.000 0.020
#> SRR868844     3  0.0162     0.8578 0.004 0.000 0.996 0.000 0.000
#> SRR868845     4  0.1915     0.9078 0.040 0.000 0.000 0.928 0.032
#> SRR868846     1  0.3642     0.4971 0.760 0.008 0.000 0.000 0.232
#> SRR868847     1  0.3143     0.7048 0.796 0.000 0.204 0.000 0.000
#> SRR868848     1  0.2929     0.7019 0.820 0.000 0.180 0.000 0.000
#> SRR868849     2  0.5376     0.4193 0.080 0.612 0.000 0.000 0.308
#> SRR868850     4  0.3521     0.8161 0.080 0.008 0.000 0.844 0.068
#> SRR868851     4  0.0404     0.9703 0.000 0.012 0.000 0.988 0.000
#> SRR868852     2  0.0510     0.8367 0.000 0.984 0.000 0.016 0.000
#> SRR868853     2  0.0898     0.8194 0.008 0.972 0.000 0.000 0.020
#> SRR868855     2  0.4948     0.4597 0.356 0.612 0.008 0.000 0.024
#> SRR868856     4  0.0404     0.9703 0.000 0.012 0.000 0.988 0.000
#> SRR868857     2  0.5107     0.5944 0.108 0.688 0.000 0.000 0.204
#> SRR868858     2  0.3550     0.6983 0.184 0.796 0.000 0.000 0.020
#> SRR868874     4  0.0794     0.9723 0.000 0.028 0.000 0.972 0.000
#> SRR868875     2  0.0609     0.8361 0.000 0.980 0.000 0.020 0.000
#> SRR868876     2  0.0510     0.8367 0.000 0.984 0.000 0.016 0.000
#> SRR868877     4  0.0794     0.9723 0.000 0.028 0.000 0.972 0.000
#> SRR868878     2  0.0510     0.8367 0.000 0.984 0.000 0.016 0.000
#> SRR868879     4  0.0794     0.9723 0.000 0.028 0.000 0.972 0.000
#> SRR868880     4  0.0703     0.9740 0.000 0.024 0.000 0.976 0.000
#> SRR868881     2  0.0609     0.8361 0.000 0.980 0.000 0.020 0.000
#> SRR868882     2  0.0609     0.8361 0.000 0.980 0.000 0.020 0.000
#> SRR868883     2  0.0609     0.8361 0.000 0.980 0.000 0.020 0.000
#> SRR868884     2  0.0510     0.8367 0.000 0.984 0.000 0.016 0.000
#> SRR868885     2  0.0609     0.8361 0.000 0.980 0.000 0.020 0.000
#> SRR868829     3  0.3558     0.7926 0.064 0.000 0.828 0.000 0.108
#> SRR868830     3  0.6382     0.6190 0.064 0.000 0.640 0.148 0.148
#> SRR868831     3  0.0000     0.8587 0.000 0.000 1.000 0.000 0.000
#> SRR868828     3  0.0290     0.8564 0.008 0.000 0.992 0.000 0.000
#> SRR868832     3  0.0000     0.8587 0.000 0.000 1.000 0.000 0.000
#> SRR868833     3  0.0000     0.8587 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.3779     0.5090 0.752 0.000 0.012 0.000 0.236
#> SRR868854     4  0.0404     0.9703 0.000 0.012 0.000 0.988 0.000
#> SRR868859     4  0.0404     0.9703 0.000 0.012 0.000 0.988 0.000
#> SRR868860     4  0.0703     0.9740 0.000 0.024 0.000 0.976 0.000
#> SRR868861     5  0.6119     0.3977 0.384 0.080 0.004 0.012 0.520
#> SRR868862     2  0.5865     0.4023 0.096 0.600 0.000 0.012 0.292
#> SRR868863     4  0.0609     0.9734 0.000 0.020 0.000 0.980 0.000
#> SRR868864     1  0.4598     0.6791 0.716 0.008 0.240 0.000 0.036
#> SRR868865     2  0.0510     0.8367 0.000 0.984 0.000 0.016 0.000
#> SRR868866     5  0.7050     0.4448 0.336 0.008 0.000 0.304 0.352
#> SRR868867     5  0.6056     0.4144 0.344 0.096 0.000 0.012 0.548
#> SRR868868     5  0.7050     0.4448 0.336 0.008 0.000 0.304 0.352
#> SRR868869     5  0.8478     0.3474 0.324 0.008 0.196 0.140 0.332
#> SRR868870     4  0.0703     0.9740 0.000 0.024 0.000 0.976 0.000
#> SRR868871     2  0.0510     0.8367 0.000 0.984 0.000 0.016 0.000
#> SRR868873     4  0.0703     0.9740 0.000 0.024 0.000 0.976 0.000
#> SRR868872     2  0.0510     0.8367 0.000 0.984 0.000 0.016 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
#> SRR868806     6  0.4438     0.5442 0.000 0.000 0.328 0.000 0.044 0.628
#> SRR868807     3  0.0820     0.8382 0.000 0.000 0.972 0.000 0.016 0.012
#> SRR868808     6  0.5445     0.5531 0.000 0.188 0.160 0.000 0.020 0.632
#> SRR868809     3  0.2147     0.7741 0.000 0.000 0.896 0.000 0.020 0.084
#> SRR868810     2  0.0146     0.8810 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR868811     4  0.0547     0.9402 0.000 0.020 0.000 0.980 0.000 0.000
#> SRR868812     6  0.4406     0.2470 0.000 0.000 0.476 0.000 0.024 0.500
#> SRR868813     6  0.5238     0.5524 0.020 0.000 0.168 0.004 0.136 0.672
#> SRR868814     3  0.6489     0.1389 0.020 0.000 0.460 0.008 0.208 0.304
#> SRR868815     3  0.5585     0.5243 0.020 0.000 0.632 0.008 0.208 0.132
#> SRR868816     3  0.0000     0.8514 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000     0.8514 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000     0.8514 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     6  0.2983     0.5442 0.136 0.032 0.000 0.000 0.000 0.832
#> SRR868820     6  0.3084     0.5531 0.136 0.024 0.008 0.000 0.000 0.832
#> SRR868821     6  0.3084     0.5531 0.136 0.024 0.008 0.000 0.000 0.832
#> SRR868822     3  0.3370     0.6238 0.004 0.000 0.772 0.000 0.012 0.212
#> SRR868824     3  0.0000     0.8514 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868823     3  0.0547     0.8462 0.000 0.000 0.980 0.000 0.020 0.000
#> SRR868825     3  0.0000     0.8514 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868826     3  0.0260     0.8502 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR868827     3  0.4564     0.6798 0.076 0.000 0.748 0.000 0.044 0.132
#> SRR868835     5  0.5770     0.5201 0.192 0.000 0.096 0.000 0.632 0.080
#> SRR868836     1  0.7246    -0.1864 0.316 0.000 0.088 0.000 0.316 0.280
#> SRR868837     5  0.2007     0.5908 0.044 0.000 0.036 0.000 0.916 0.004
#> SRR868838     3  0.6033     0.5776 0.088 0.000 0.648 0.020 0.148 0.096
#> SRR868839     2  0.4601     0.6472 0.024 0.712 0.000 0.000 0.060 0.204
#> SRR868840     5  0.1977     0.5683 0.008 0.000 0.040 0.000 0.920 0.032
#> SRR868841     5  0.2384     0.5561 0.016 0.000 0.040 0.000 0.900 0.044
#> SRR868842     5  0.5805     0.3301 0.276 0.000 0.000 0.000 0.496 0.228
#> SRR868843     5  0.3998     0.3451 0.000 0.340 0.000 0.000 0.644 0.016
#> SRR868844     3  0.0260     0.8502 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR868845     4  0.2966     0.8208 0.008 0.000 0.000 0.856 0.048 0.088
#> SRR868846     5  0.5830     0.3174 0.284 0.000 0.000 0.000 0.488 0.228
#> SRR868847     5  0.4731     0.5818 0.120 0.000 0.100 0.000 0.736 0.044
#> SRR868848     5  0.4901     0.5628 0.168 0.000 0.068 0.000 0.712 0.052
#> SRR868849     2  0.5277     0.5108 0.172 0.620 0.000 0.000 0.004 0.204
#> SRR868850     4  0.6314     0.3481 0.064 0.000 0.000 0.512 0.308 0.116
#> SRR868851     4  0.0000     0.9449 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868852     2  0.0363     0.8765 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR868853     2  0.2489     0.7768 0.000 0.860 0.000 0.000 0.128 0.012
#> SRR868855     5  0.5962    -0.0569 0.128 0.416 0.000 0.000 0.436 0.020
#> SRR868856     4  0.0000     0.9449 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868857     2  0.5585     0.4996 0.036 0.604 0.000 0.000 0.096 0.264
#> SRR868858     2  0.4099     0.3993 0.000 0.612 0.000 0.000 0.372 0.016
#> SRR868874     4  0.0363     0.9461 0.000 0.012 0.000 0.988 0.000 0.000
#> SRR868875     2  0.0146     0.8810 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR868876     2  0.0000     0.8814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     4  0.0363     0.9461 0.000 0.012 0.000 0.988 0.000 0.000
#> SRR868878     2  0.0000     0.8814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     4  0.0363     0.9461 0.000 0.012 0.000 0.988 0.000 0.000
#> SRR868880     4  0.0260     0.9473 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR868881     2  0.0146     0.8802 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR868882     2  0.0146     0.8810 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR868883     2  0.0146     0.8810 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR868884     2  0.0000     0.8814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.0291     0.8798 0.000 0.992 0.000 0.000 0.004 0.004
#> SRR868829     3  0.4506     0.6963 0.080 0.000 0.760 0.000 0.056 0.104
#> SRR868830     3  0.6861     0.4674 0.084 0.000 0.584 0.112 0.060 0.160
#> SRR868831     3  0.0000     0.8514 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868828     3  0.0632     0.8444 0.000 0.000 0.976 0.000 0.024 0.000
#> SRR868832     3  0.0000     0.8514 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868833     3  0.0000     0.8514 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     5  0.6159     0.3112 0.268 0.000 0.012 0.000 0.476 0.244
#> SRR868854     4  0.0713     0.9267 0.028 0.000 0.000 0.972 0.000 0.000
#> SRR868859     4  0.0000     0.9449 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868860     4  0.0260     0.9473 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR868861     1  0.1909     0.7396 0.920 0.000 0.004 0.000 0.024 0.052
#> SRR868862     2  0.4999     0.5178 0.240 0.632 0.000 0.000 0.000 0.128
#> SRR868863     4  0.0146     0.9465 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR868864     5  0.4165     0.5642 0.036 0.000 0.152 0.000 0.768 0.044
#> SRR868865     2  0.0000     0.8814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868866     1  0.1411     0.7531 0.936 0.000 0.000 0.060 0.004 0.000
#> SRR868867     1  0.2734     0.6831 0.840 0.004 0.000 0.000 0.008 0.148
#> SRR868868     1  0.1411     0.7531 0.936 0.000 0.000 0.060 0.004 0.000
#> SRR868869     1  0.1232     0.7357 0.956 0.000 0.024 0.016 0.004 0.000
#> SRR868870     4  0.0260     0.9473 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR868871     2  0.0000     0.8814 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     4  0.0260     0.9473 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR868872     2  0.0000     0.8814 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

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 1.000           0.994       0.997         0.3916 0.608   0.608
#> 3 3 1.000           0.977       0.990         0.3473 0.871   0.788
#> 4 4 0.803           0.915       0.947         0.1547 0.912   0.819
#> 5 5 0.998           0.960       0.982         0.0951 0.932   0.833
#> 6 6 0.985           0.953       0.980         0.0741 0.951   0.855

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> SRR868806     1  0.0000      0.999 1.000 0.000
#> SRR868807     1  0.0000      0.999 1.000 0.000
#> SRR868808     1  0.0000      0.999 1.000 0.000
#> SRR868809     1  0.0000      0.999 1.000 0.000
#> SRR868810     2  0.0000      0.992 0.000 1.000
#> SRR868811     2  0.0000      0.992 0.000 1.000
#> SRR868812     1  0.0000      0.999 1.000 0.000
#> SRR868813     1  0.0000      0.999 1.000 0.000
#> SRR868814     1  0.0000      0.999 1.000 0.000
#> SRR868815     1  0.0000      0.999 1.000 0.000
#> SRR868816     1  0.0000      0.999 1.000 0.000
#> SRR868817     1  0.0000      0.999 1.000 0.000
#> SRR868818     1  0.0000      0.999 1.000 0.000
#> SRR868819     1  0.0000      0.999 1.000 0.000
#> SRR868820     1  0.0000      0.999 1.000 0.000
#> SRR868821     1  0.0000      0.999 1.000 0.000
#> SRR868822     1  0.0000      0.999 1.000 0.000
#> SRR868824     1  0.0000      0.999 1.000 0.000
#> SRR868823     1  0.0000      0.999 1.000 0.000
#> SRR868825     1  0.0000      0.999 1.000 0.000
#> SRR868826     1  0.0000      0.999 1.000 0.000
#> SRR868827     1  0.0000      0.999 1.000 0.000
#> SRR868835     1  0.0000      0.999 1.000 0.000
#> SRR868836     1  0.0000      0.999 1.000 0.000
#> SRR868837     1  0.0000      0.999 1.000 0.000
#> SRR868838     1  0.0000      0.999 1.000 0.000
#> SRR868839     1  0.0000      0.999 1.000 0.000
#> SRR868840     1  0.0000      0.999 1.000 0.000
#> SRR868841     1  0.0000      0.999 1.000 0.000
#> SRR868842     1  0.0000      0.999 1.000 0.000
#> SRR868843     1  0.0000      0.999 1.000 0.000
#> SRR868844     1  0.0000      0.999 1.000 0.000
#> SRR868845     1  0.3431      0.932 0.936 0.064
#> SRR868846     1  0.0000      0.999 1.000 0.000
#> SRR868847     1  0.0000      0.999 1.000 0.000
#> SRR868848     1  0.0000      0.999 1.000 0.000
#> SRR868849     1  0.0376      0.995 0.996 0.004
#> SRR868850     1  0.0000      0.999 1.000 0.000
#> SRR868851     1  0.0000      0.999 1.000 0.000
#> SRR868852     1  0.0000      0.999 1.000 0.000
#> SRR868853     1  0.0000      0.999 1.000 0.000
#> SRR868855     1  0.0000      0.999 1.000 0.000
#> SRR868856     1  0.0672      0.991 0.992 0.008
#> SRR868857     1  0.0000      0.999 1.000 0.000
#> SRR868858     1  0.0000      0.999 1.000 0.000
#> SRR868874     2  0.0000      0.992 0.000 1.000
#> SRR868875     2  0.0000      0.992 0.000 1.000
#> SRR868876     2  0.0000      0.992 0.000 1.000
#> SRR868877     2  0.0000      0.992 0.000 1.000
#> SRR868878     2  0.0000      0.992 0.000 1.000
#> SRR868879     2  0.0000      0.992 0.000 1.000
#> SRR868880     2  0.0000      0.992 0.000 1.000
#> SRR868881     2  0.0000      0.992 0.000 1.000
#> SRR868882     2  0.0000      0.992 0.000 1.000
#> SRR868883     2  0.0000      0.992 0.000 1.000
#> SRR868884     2  0.0000      0.992 0.000 1.000
#> SRR868885     2  0.0000      0.992 0.000 1.000
#> SRR868829     1  0.0000      0.999 1.000 0.000
#> SRR868830     1  0.0000      0.999 1.000 0.000
#> SRR868831     1  0.0000      0.999 1.000 0.000
#> SRR868828     1  0.0000      0.999 1.000 0.000
#> SRR868832     1  0.0000      0.999 1.000 0.000
#> SRR868833     1  0.0000      0.999 1.000 0.000
#> SRR868834     1  0.0000      0.999 1.000 0.000
#> SRR868854     1  0.0000      0.999 1.000 0.000
#> SRR868859     2  0.0376      0.989 0.004 0.996
#> SRR868860     2  0.0376      0.989 0.004 0.996
#> SRR868861     1  0.0000      0.999 1.000 0.000
#> SRR868862     1  0.0000      0.999 1.000 0.000
#> SRR868863     2  0.6247      0.815 0.156 0.844
#> SRR868864     1  0.0000      0.999 1.000 0.000
#> SRR868865     1  0.0000      0.999 1.000 0.000
#> SRR868866     1  0.0000      0.999 1.000 0.000
#> SRR868867     1  0.0000      0.999 1.000 0.000
#> SRR868868     1  0.0000      0.999 1.000 0.000
#> SRR868869     1  0.0000      0.999 1.000 0.000
#> SRR868870     2  0.0000      0.992 0.000 1.000
#> SRR868871     2  0.0000      0.992 0.000 1.000
#> SRR868873     2  0.0000      0.992 0.000 1.000
#> SRR868872     2  0.0000      0.992 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
#> SRR868806     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868807     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868808     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868809     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868810     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868811     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868812     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868813     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868814     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868815     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868819     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868820     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868821     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868822     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868824     1  0.4974      0.702 0.764 0.000 0.236
#> SRR868823     1  0.1964      0.935 0.944 0.000 0.056
#> SRR868825     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868827     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868835     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868836     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868837     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868838     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868839     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868840     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868841     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868842     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868843     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868845     1  0.2165      0.920 0.936 0.064 0.000
#> SRR868846     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868847     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868848     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868849     1  0.0237      0.984 0.996 0.004 0.000
#> SRR868850     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868851     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868852     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868853     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868855     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868856     1  0.0424      0.980 0.992 0.008 0.000
#> SRR868857     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868858     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868874     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868875     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868876     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868877     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868878     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868879     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868880     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868881     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868882     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868883     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868884     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868885     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868829     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868830     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868831     1  0.4974      0.702 0.764 0.000 0.236
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868834     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868854     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868859     2  0.0237      0.982 0.004 0.996 0.000
#> SRR868860     2  0.0237      0.982 0.004 0.996 0.000
#> SRR868861     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868862     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868863     2  0.3941      0.733 0.156 0.844 0.000
#> SRR868864     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868865     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868866     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868867     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868868     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868869     1  0.0000      0.988 1.000 0.000 0.000
#> SRR868870     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868871     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868873     2  0.0000      0.987 0.000 1.000 0.000
#> SRR868872     2  0.0000      0.987 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868807     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868808     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868809     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868810     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868811     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868812     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868813     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868814     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868815     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868819     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868820     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868821     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868822     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868824     1  0.3942      0.713 0.764 0.000 0.236 0.000
#> SRR868823     1  0.1557      0.910 0.944 0.000 0.056 0.000
#> SRR868825     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868827     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868835     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868836     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868837     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868838     1  0.3219      0.798 0.836 0.000 0.000 0.164
#> SRR868839     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868840     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868841     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868842     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868843     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868845     1  0.3668      0.766 0.808 0.004 0.000 0.188
#> SRR868846     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868847     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868848     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868849     1  0.0188      0.948 0.996 0.004 0.000 0.000
#> SRR868850     1  0.3219      0.798 0.836 0.000 0.000 0.164
#> SRR868851     4  0.2973      0.768 0.144 0.000 0.000 0.856
#> SRR868852     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868853     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868855     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868856     4  0.3123      0.756 0.156 0.000 0.000 0.844
#> SRR868857     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868858     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868874     4  0.3024      0.870 0.000 0.148 0.000 0.852
#> SRR868875     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868876     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868877     4  0.3024      0.870 0.000 0.148 0.000 0.852
#> SRR868878     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868879     4  0.3837      0.800 0.000 0.224 0.000 0.776
#> SRR868880     4  0.3024      0.870 0.000 0.148 0.000 0.852
#> SRR868881     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868882     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868884     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868829     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868830     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868831     1  0.3942      0.713 0.764 0.000 0.236 0.000
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000 0.000
#> SRR868834     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868854     4  0.3024      0.765 0.148 0.000 0.000 0.852
#> SRR868859     4  0.4741      0.666 0.004 0.328 0.000 0.668
#> SRR868860     4  0.0000      0.780 0.000 0.000 0.000 1.000
#> SRR868861     1  0.3024      0.836 0.852 0.000 0.000 0.148
#> SRR868862     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868863     4  0.4057      0.855 0.028 0.160 0.000 0.812
#> SRR868864     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868865     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR868866     1  0.4477      0.647 0.688 0.000 0.000 0.312
#> SRR868867     1  0.3024      0.836 0.852 0.000 0.000 0.148
#> SRR868868     1  0.4477      0.647 0.688 0.000 0.000 0.312
#> SRR868869     1  0.4477      0.647 0.688 0.000 0.000 0.312
#> SRR868870     4  0.3024      0.870 0.000 0.148 0.000 0.852
#> SRR868871     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR868873     4  0.3024      0.870 0.000 0.148 0.000 0.852
#> SRR868872     2  0.0000      1.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868807     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868808     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868809     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868810     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868811     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868812     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868813     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868814     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868815     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868819     1  0.0290      0.975 0.992 0.000 0.000 0.008 0.000
#> SRR868820     1  0.0290      0.975 0.992 0.000 0.000 0.008 0.000
#> SRR868821     1  0.0290      0.975 0.992 0.000 0.000 0.008 0.000
#> SRR868822     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868824     1  0.3395      0.706 0.764 0.000 0.236 0.000 0.000
#> SRR868823     1  0.1341      0.931 0.944 0.000 0.056 0.000 0.000
#> SRR868825     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868827     1  0.0290      0.975 0.992 0.000 0.000 0.008 0.000
#> SRR868835     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868836     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868837     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868838     1  0.1582      0.934 0.944 0.000 0.000 0.028 0.028
#> SRR868839     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868840     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868841     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868842     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868843     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868845     1  0.3478      0.799 0.828 0.032 0.000 0.136 0.004
#> SRR868846     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868847     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868848     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868849     1  0.0162      0.977 0.996 0.004 0.000 0.000 0.000
#> SRR868850     1  0.0794      0.956 0.972 0.000 0.000 0.028 0.000
#> SRR868851     4  0.1121      0.894 0.044 0.000 0.000 0.956 0.000
#> SRR868852     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868853     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868855     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868856     4  0.1764      0.865 0.064 0.000 0.000 0.928 0.008
#> SRR868857     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868858     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868874     4  0.0290      0.930 0.000 0.008 0.000 0.992 0.000
#> SRR868875     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868877     4  0.0290      0.930 0.000 0.008 0.000 0.992 0.000
#> SRR868878     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868879     4  0.0510      0.926 0.000 0.016 0.000 0.984 0.000
#> SRR868880     4  0.0290      0.930 0.000 0.008 0.000 0.992 0.000
#> SRR868881     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868882     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868884     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868885     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868829     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868830     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868831     1  0.3395      0.706 0.764 0.000 0.236 0.000 0.000
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868854     4  0.0290      0.925 0.008 0.000 0.000 0.992 0.000
#> SRR868859     4  0.4060      0.471 0.000 0.360 0.000 0.640 0.000
#> SRR868860     4  0.0290      0.926 0.000 0.000 0.000 0.992 0.008
#> SRR868861     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868862     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868863     4  0.2520      0.860 0.048 0.056 0.000 0.896 0.000
#> SRR868864     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868865     1  0.0000      0.980 1.000 0.000 0.000 0.000 0.000
#> SRR868866     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868867     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868868     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868869     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> SRR868870     4  0.0290      0.930 0.000 0.008 0.000 0.992 0.000
#> SRR868871     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> SRR868873     4  0.0290      0.930 0.000 0.008 0.000 0.992 0.000
#> SRR868872     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868807     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868808     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868809     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868810     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868811     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868812     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868813     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868814     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868815     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     6  0.0000      0.951 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR868820     6  0.0000      0.951 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR868821     6  0.0000      0.951 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR868822     5  0.2378      0.821 0.000 0.000 0.000 0.000 0.848 0.152
#> SRR868824     5  0.3050      0.703 0.000 0.000 0.236 0.000 0.764 0.000
#> SRR868823     5  0.1204      0.925 0.000 0.000 0.056 0.000 0.944 0.000
#> SRR868825     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868827     6  0.1387      0.853 0.000 0.000 0.000 0.000 0.068 0.932
#> SRR868835     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868836     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868837     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868838     5  0.1421      0.929 0.028 0.000 0.000 0.028 0.944 0.000
#> SRR868839     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868840     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868841     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868842     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868843     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868845     5  0.3125      0.794 0.004 0.032 0.000 0.136 0.828 0.000
#> SRR868846     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868847     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868848     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868849     5  0.0146      0.971 0.000 0.004 0.000 0.000 0.996 0.000
#> SRR868850     5  0.0713      0.950 0.000 0.000 0.000 0.028 0.972 0.000
#> SRR868851     4  0.0865      0.901 0.000 0.000 0.000 0.964 0.036 0.000
#> SRR868852     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868853     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868855     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868856     4  0.1462      0.873 0.008 0.000 0.000 0.936 0.056 0.000
#> SRR868857     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868858     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868874     4  0.0000      0.933 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868875     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     4  0.0000      0.933 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868878     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     4  0.0260      0.928 0.000 0.008 0.000 0.992 0.000 0.000
#> SRR868880     4  0.0000      0.933 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868881     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868829     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868830     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868831     5  0.3050      0.703 0.000 0.000 0.236 0.000 0.764 0.000
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868854     4  0.0000      0.933 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868859     4  0.3620      0.480 0.000 0.352 0.000 0.648 0.000 0.000
#> SRR868860     4  0.0000      0.933 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868861     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868862     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868863     4  0.2136      0.857 0.000 0.048 0.000 0.904 0.048 0.000
#> SRR868864     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868865     5  0.0000      0.974 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868866     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868867     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868868     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868869     1  0.0000      1.000 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868870     4  0.0000      0.933 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868871     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     4  0.0000      0.933 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868872     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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 15961 rows and 80 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.432           0.835       0.889         0.4648 0.499   0.499
#> 3 3 0.409           0.700       0.807         0.3073 0.826   0.665
#> 4 4 0.405           0.534       0.701         0.1422 0.726   0.399
#> 5 5 0.635           0.703       0.809         0.0986 0.904   0.684
#> 6 6 0.719           0.590       0.801         0.0539 0.905   0.622

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
#> SRR868806     2  0.7299     0.8436 0.204 0.796
#> SRR868807     2  0.7528     0.8191 0.216 0.784
#> SRR868808     2  0.6801     0.8538 0.180 0.820
#> SRR868809     2  0.0672     0.8514 0.008 0.992
#> SRR868810     2  0.7950     0.8264 0.240 0.760
#> SRR868811     1  0.2043     0.8998 0.968 0.032
#> SRR868812     2  0.7299     0.8441 0.204 0.796
#> SRR868813     1  0.3431     0.8882 0.936 0.064
#> SRR868814     1  0.2778     0.8956 0.952 0.048
#> SRR868815     1  0.2778     0.8956 0.952 0.048
#> SRR868816     1  0.8016     0.7130 0.756 0.244
#> SRR868817     1  0.8267     0.7087 0.740 0.260
#> SRR868818     1  0.8267     0.7087 0.740 0.260
#> SRR868819     2  0.7528     0.8404 0.216 0.784
#> SRR868820     2  0.7528     0.8404 0.216 0.784
#> SRR868821     2  0.7528     0.8404 0.216 0.784
#> SRR868822     2  0.0376     0.8503 0.004 0.996
#> SRR868824     2  0.6048     0.8574 0.148 0.852
#> SRR868823     1  0.8081     0.7278 0.752 0.248
#> SRR868825     2  0.0672     0.8514 0.008 0.992
#> SRR868826     1  0.9170     0.5545 0.668 0.332
#> SRR868827     1  0.0376     0.8977 0.996 0.004
#> SRR868835     1  0.4022     0.8946 0.920 0.080
#> SRR868836     2  0.2948     0.8554 0.052 0.948
#> SRR868837     2  0.9427     0.5534 0.360 0.640
#> SRR868838     1  0.1184     0.9045 0.984 0.016
#> SRR868839     2  0.0000     0.8491 0.000 1.000
#> SRR868840     2  0.9998     0.0949 0.492 0.508
#> SRR868841     1  0.4690     0.8866 0.900 0.100
#> SRR868842     2  0.5178     0.8601 0.116 0.884
#> SRR868843     2  0.7139     0.8379 0.196 0.804
#> SRR868844     1  0.8144     0.7217 0.748 0.252
#> SRR868845     1  0.2043     0.8998 0.968 0.032
#> SRR868846     2  0.6343     0.8547 0.160 0.840
#> SRR868847     1  0.9129     0.5635 0.672 0.328
#> SRR868848     1  0.2948     0.9023 0.948 0.052
#> SRR868849     2  0.0938     0.8451 0.012 0.988
#> SRR868850     1  0.3431     0.8984 0.936 0.064
#> SRR868851     1  0.1184     0.9045 0.984 0.016
#> SRR868852     2  0.0000     0.8491 0.000 1.000
#> SRR868853     2  0.6801     0.8470 0.180 0.820
#> SRR868855     2  0.7453     0.8235 0.212 0.788
#> SRR868856     1  0.1184     0.9045 0.984 0.016
#> SRR868857     2  0.0000     0.8491 0.000 1.000
#> SRR868858     2  0.6887     0.8451 0.184 0.816
#> SRR868874     1  0.2948     0.9023 0.948 0.052
#> SRR868875     2  0.6973     0.8426 0.188 0.812
#> SRR868876     2  0.0000     0.8491 0.000 1.000
#> SRR868877     1  0.2948     0.9023 0.948 0.052
#> SRR868878     2  0.0000     0.8491 0.000 1.000
#> SRR868879     1  0.2948     0.9023 0.948 0.052
#> SRR868880     1  0.1184     0.9045 0.984 0.016
#> SRR868881     2  0.7528     0.8404 0.216 0.784
#> SRR868882     2  0.7453     0.8374 0.212 0.788
#> SRR868883     2  0.7674     0.8308 0.224 0.776
#> SRR868884     2  0.0000     0.8491 0.000 1.000
#> SRR868885     2  0.7950     0.8264 0.240 0.760
#> SRR868829     1  0.0672     0.9003 0.992 0.008
#> SRR868830     1  0.0000     0.8947 1.000 0.000
#> SRR868831     2  0.7139     0.8383 0.196 0.804
#> SRR868828     1  0.6048     0.8473 0.852 0.148
#> SRR868832     2  0.0672     0.8514 0.008 0.992
#> SRR868833     2  0.0672     0.8514 0.008 0.992
#> SRR868834     2  0.0000     0.8491 0.000 1.000
#> SRR868854     1  0.1184     0.9045 0.984 0.016
#> SRR868859     1  0.1184     0.9045 0.984 0.016
#> SRR868860     1  0.1633     0.9053 0.976 0.024
#> SRR868861     2  0.7745     0.8147 0.228 0.772
#> SRR868862     2  0.0000     0.8491 0.000 1.000
#> SRR868863     1  0.1184     0.9045 0.984 0.016
#> SRR868864     2  0.6887     0.8452 0.184 0.816
#> SRR868865     2  0.0000     0.8491 0.000 1.000
#> SRR868866     1  0.3879     0.8962 0.924 0.076
#> SRR868867     2  0.4431     0.7868 0.092 0.908
#> SRR868868     1  0.4298     0.8900 0.912 0.088
#> SRR868869     1  0.4022     0.8946 0.920 0.080
#> SRR868870     1  0.1184     0.9045 0.984 0.016
#> SRR868871     2  0.0000     0.8491 0.000 1.000
#> SRR868873     1  0.1184     0.9045 0.984 0.016
#> SRR868872     2  0.0000     0.8491 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
#> SRR868806     1  0.4473      0.771 0.828 0.008 0.164
#> SRR868807     3  0.5098      0.753 0.248 0.000 0.752
#> SRR868808     1  0.3213      0.767 0.900 0.008 0.092
#> SRR868809     1  0.1529      0.809 0.960 0.000 0.040
#> SRR868810     1  0.5987      0.662 0.756 0.036 0.208
#> SRR868811     2  0.4002      0.746 0.000 0.840 0.160
#> SRR868812     1  0.5292      0.755 0.764 0.008 0.228
#> SRR868813     3  0.6441      0.475 0.028 0.276 0.696
#> SRR868814     2  0.5348      0.729 0.028 0.796 0.176
#> SRR868815     2  0.5348      0.729 0.028 0.796 0.176
#> SRR868816     3  0.4702      0.759 0.212 0.000 0.788
#> SRR868817     3  0.4702      0.759 0.212 0.000 0.788
#> SRR868818     3  0.4702      0.759 0.212 0.000 0.788
#> SRR868819     1  0.5874      0.663 0.760 0.032 0.208
#> SRR868820     1  0.5335      0.672 0.760 0.008 0.232
#> SRR868821     1  0.5156      0.669 0.776 0.008 0.216
#> SRR868822     1  0.4062      0.770 0.836 0.000 0.164
#> SRR868824     1  0.5497      0.649 0.708 0.000 0.292
#> SRR868823     3  0.5016      0.759 0.240 0.000 0.760
#> SRR868825     1  0.4062      0.770 0.836 0.000 0.164
#> SRR868826     3  0.4702      0.759 0.212 0.000 0.788
#> SRR868827     3  0.7050      0.359 0.028 0.372 0.600
#> SRR868835     3  0.8894      0.667 0.236 0.192 0.572
#> SRR868836     1  0.3941      0.773 0.844 0.000 0.156
#> SRR868837     3  0.5098      0.756 0.248 0.000 0.752
#> SRR868838     2  0.2187      0.823 0.028 0.948 0.024
#> SRR868839     1  0.1163      0.811 0.972 0.028 0.000
#> SRR868840     3  0.5098      0.756 0.248 0.000 0.752
#> SRR868841     3  0.7244      0.605 0.092 0.208 0.700
#> SRR868842     1  0.4062      0.770 0.836 0.000 0.164
#> SRR868843     1  0.5882      0.306 0.652 0.000 0.348
#> SRR868844     3  0.4702      0.759 0.212 0.000 0.788
#> SRR868845     2  0.5178      0.736 0.028 0.808 0.164
#> SRR868846     1  0.3941      0.773 0.844 0.000 0.156
#> SRR868847     3  0.5016      0.760 0.240 0.000 0.760
#> SRR868848     3  0.8392      0.712 0.236 0.148 0.616
#> SRR868849     1  0.5060      0.778 0.816 0.028 0.156
#> SRR868850     2  0.5526      0.734 0.036 0.792 0.172
#> SRR868851     2  0.1411      0.826 0.036 0.964 0.000
#> SRR868852     1  0.1163      0.811 0.972 0.028 0.000
#> SRR868853     1  0.0661      0.811 0.988 0.008 0.004
#> SRR868855     3  0.6295      0.272 0.472 0.000 0.528
#> SRR868856     2  0.0424      0.827 0.008 0.992 0.000
#> SRR868857     1  0.0000      0.810 1.000 0.000 0.000
#> SRR868858     1  0.1163      0.803 0.972 0.000 0.028
#> SRR868874     2  0.8765      0.124 0.200 0.588 0.212
#> SRR868875     1  0.1585      0.811 0.964 0.028 0.008
#> SRR868876     1  0.1163      0.811 0.972 0.028 0.000
#> SRR868877     2  0.7509      0.440 0.152 0.696 0.152
#> SRR868878     1  0.1163      0.811 0.972 0.028 0.000
#> SRR868879     2  0.8148      0.315 0.156 0.644 0.200
#> SRR868880     2  0.0424      0.827 0.008 0.992 0.000
#> SRR868881     1  0.5987      0.662 0.756 0.036 0.208
#> SRR868882     1  0.1585      0.811 0.964 0.028 0.008
#> SRR868883     1  0.1711      0.811 0.960 0.032 0.008
#> SRR868884     1  0.1163      0.811 0.972 0.028 0.000
#> SRR868885     1  0.5987      0.662 0.756 0.036 0.208
#> SRR868829     3  0.7248      0.212 0.028 0.436 0.536
#> SRR868830     2  0.2050      0.822 0.028 0.952 0.020
#> SRR868831     1  0.6260      0.240 0.552 0.000 0.448
#> SRR868828     3  0.5493      0.529 0.012 0.232 0.756
#> SRR868832     1  0.5465      0.656 0.712 0.000 0.288
#> SRR868833     1  0.5497      0.649 0.708 0.000 0.292
#> SRR868834     1  0.3941      0.773 0.844 0.000 0.156
#> SRR868854     2  0.1411      0.826 0.036 0.964 0.000
#> SRR868859     2  0.2680      0.810 0.008 0.924 0.068
#> SRR868860     2  0.0848      0.827 0.008 0.984 0.008
#> SRR868861     1  0.4291      0.761 0.820 0.000 0.180
#> SRR868862     1  0.4744      0.787 0.836 0.028 0.136
#> SRR868863     2  0.0424      0.827 0.008 0.992 0.000
#> SRR868864     1  0.4062      0.770 0.836 0.000 0.164
#> SRR868865     1  0.1163      0.811 0.972 0.028 0.000
#> SRR868866     3  0.9690      0.537 0.236 0.316 0.448
#> SRR868867     1  0.4121      0.769 0.832 0.000 0.168
#> SRR868868     3  0.9690      0.537 0.236 0.316 0.448
#> SRR868869     3  0.9792      0.434 0.236 0.372 0.392
#> SRR868870     2  0.0424      0.827 0.008 0.992 0.000
#> SRR868871     1  0.1163      0.811 0.972 0.028 0.000
#> SRR868873     2  0.0424      0.827 0.008 0.992 0.000
#> SRR868872     1  0.1163      0.811 0.972 0.028 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.5247     0.6114 0.752 0.148 0.100 0.000
#> SRR868807     1  0.5097     0.1633 0.568 0.004 0.428 0.000
#> SRR868808     2  0.5231     0.3804 0.384 0.604 0.012 0.000
#> SRR868809     1  0.3852     0.5486 0.808 0.180 0.012 0.000
#> SRR868810     2  0.1610     0.6829 0.032 0.952 0.016 0.000
#> SRR868811     4  0.3577     0.6044 0.000 0.012 0.156 0.832
#> SRR868812     1  0.6080     0.4293 0.664 0.236 0.100 0.000
#> SRR868813     4  0.7927     0.4286 0.280 0.012 0.228 0.480
#> SRR868814     4  0.7497     0.4948 0.276 0.012 0.168 0.544
#> SRR868815     4  0.7497     0.4948 0.276 0.012 0.168 0.544
#> SRR868816     3  0.1557     0.6945 0.056 0.000 0.944 0.000
#> SRR868817     3  0.1557     0.6945 0.056 0.000 0.944 0.000
#> SRR868818     3  0.1557     0.6945 0.056 0.000 0.944 0.000
#> SRR868819     2  0.4599     0.5368 0.248 0.736 0.016 0.000
#> SRR868820     2  0.5127     0.3609 0.356 0.632 0.012 0.000
#> SRR868821     2  0.5075     0.3784 0.344 0.644 0.012 0.000
#> SRR868822     1  0.1059     0.6522 0.972 0.016 0.012 0.000
#> SRR868824     1  0.4964     0.0901 0.616 0.004 0.380 0.000
#> SRR868823     3  0.5565     0.1878 0.344 0.000 0.624 0.032
#> SRR868825     1  0.1042     0.6556 0.972 0.008 0.020 0.000
#> SRR868826     3  0.2466     0.6904 0.056 0.000 0.916 0.028
#> SRR868827     4  0.8046     0.0960 0.292 0.004 0.332 0.372
#> SRR868835     1  0.8288     0.2766 0.456 0.028 0.304 0.212
#> SRR868836     1  0.1510     0.6533 0.956 0.028 0.016 0.000
#> SRR868837     1  0.5473     0.3067 0.576 0.012 0.408 0.004
#> SRR868838     4  0.4869     0.5590 0.276 0.004 0.012 0.708
#> SRR868839     1  0.3945     0.4926 0.780 0.216 0.004 0.000
#> SRR868840     1  0.6598     0.3172 0.500 0.068 0.428 0.004
#> SRR868841     3  0.7642    -0.1556 0.380 0.024 0.480 0.116
#> SRR868842     1  0.0592     0.6489 0.984 0.016 0.000 0.000
#> SRR868843     1  0.5518     0.5880 0.740 0.156 0.100 0.004
#> SRR868844     3  0.2565     0.6884 0.056 0.000 0.912 0.032
#> SRR868845     4  0.7114     0.5535 0.200 0.016 0.168 0.616
#> SRR868846     1  0.0336     0.6520 0.992 0.008 0.000 0.000
#> SRR868847     1  0.6224     0.2496 0.532 0.012 0.424 0.032
#> SRR868848     1  0.8120     0.2736 0.464 0.028 0.336 0.172
#> SRR868849     1  0.2149     0.5746 0.912 0.088 0.000 0.000
#> SRR868850     4  0.7497     0.4948 0.276 0.012 0.168 0.544
#> SRR868851     4  0.0779     0.6856 0.016 0.004 0.000 0.980
#> SRR868852     2  0.5151     0.3949 0.464 0.532 0.004 0.000
#> SRR868853     1  0.4252     0.4266 0.744 0.252 0.004 0.000
#> SRR868855     1  0.4114     0.5606 0.788 0.008 0.200 0.004
#> SRR868856     4  0.0188     0.6812 0.000 0.004 0.000 0.996
#> SRR868857     1  0.3870     0.5044 0.788 0.208 0.004 0.000
#> SRR868858     1  0.4332     0.5624 0.792 0.176 0.032 0.000
#> SRR868874     4  0.5616     0.5347 0.164 0.016 0.076 0.744
#> SRR868875     2  0.4040     0.7722 0.248 0.752 0.000 0.000
#> SRR868876     2  0.4072     0.7718 0.252 0.748 0.000 0.000
#> SRR868877     4  0.5434     0.5521 0.148 0.016 0.076 0.760
#> SRR868878     2  0.4072     0.7718 0.252 0.748 0.000 0.000
#> SRR868879     4  0.5434     0.5521 0.148 0.016 0.076 0.760
#> SRR868880     4  0.0188     0.6812 0.000 0.004 0.000 0.996
#> SRR868881     2  0.1488     0.6829 0.032 0.956 0.012 0.000
#> SRR868882     2  0.3873     0.7694 0.228 0.772 0.000 0.000
#> SRR868883     2  0.4137     0.7613 0.208 0.780 0.012 0.000
#> SRR868884     2  0.4252     0.7707 0.252 0.744 0.004 0.000
#> SRR868885     2  0.1488     0.6829 0.032 0.956 0.012 0.000
#> SRR868829     4  0.8091     0.1674 0.280 0.008 0.300 0.412
#> SRR868830     4  0.4690     0.5582 0.276 0.000 0.012 0.712
#> SRR868831     3  0.4746     0.4514 0.368 0.000 0.632 0.000
#> SRR868828     3  0.2992     0.6113 0.016 0.008 0.892 0.084
#> SRR868832     3  0.5119     0.3661 0.440 0.004 0.556 0.000
#> SRR868833     3  0.5112     0.3701 0.436 0.004 0.560 0.000
#> SRR868834     1  0.0336     0.6520 0.992 0.008 0.000 0.000
#> SRR868854     4  0.2125     0.6843 0.076 0.004 0.000 0.920
#> SRR868859     4  0.2737     0.6461 0.000 0.008 0.104 0.888
#> SRR868860     4  0.1247     0.6752 0.012 0.016 0.004 0.968
#> SRR868861     1  0.1978     0.6393 0.928 0.000 0.068 0.004
#> SRR868862     1  0.1867     0.5971 0.928 0.072 0.000 0.000
#> SRR868863     4  0.0000     0.6813 0.000 0.000 0.000 1.000
#> SRR868864     1  0.3842     0.5988 0.836 0.128 0.036 0.000
#> SRR868865     2  0.4252     0.7707 0.252 0.744 0.004 0.000
#> SRR868866     1  0.8360     0.2633 0.444 0.028 0.300 0.228
#> SRR868867     1  0.2074     0.6573 0.940 0.012 0.032 0.016
#> SRR868868     1  0.8360     0.2633 0.444 0.028 0.300 0.228
#> SRR868869     1  0.8360     0.2633 0.444 0.028 0.300 0.228
#> SRR868870     4  0.0188     0.6812 0.000 0.004 0.000 0.996
#> SRR868871     2  0.4072     0.7718 0.252 0.748 0.000 0.000
#> SRR868873     4  0.0188     0.6812 0.000 0.004 0.000 0.996
#> SRR868872     2  0.4072     0.7718 0.252 0.748 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.6070      0.694 0.656 0.196 0.056 0.000 0.092
#> SRR868807     1  0.5750      0.599 0.612 0.004 0.268 0.000 0.116
#> SRR868808     1  0.5803      0.419 0.488 0.420 0.000 0.000 0.092
#> SRR868809     1  0.5167      0.650 0.668 0.240 0.000 0.000 0.092
#> SRR868810     2  0.0000      0.855 0.000 1.000 0.000 0.000 0.000
#> SRR868811     4  0.3086      0.686 0.000 0.000 0.004 0.816 0.180
#> SRR868812     1  0.6854      0.659 0.604 0.156 0.124 0.000 0.116
#> SRR868813     5  0.3102      0.712 0.000 0.000 0.084 0.056 0.860
#> SRR868814     5  0.2629      0.732 0.000 0.000 0.004 0.136 0.860
#> SRR868815     5  0.2629      0.732 0.000 0.000 0.004 0.136 0.860
#> SRR868816     3  0.0000      0.904 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000      0.904 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000      0.904 0.000 0.000 1.000 0.000 0.000
#> SRR868819     2  0.4851      0.436 0.196 0.712 0.000 0.000 0.092
#> SRR868820     1  0.6028      0.440 0.468 0.416 0.000 0.000 0.116
#> SRR868821     1  0.6037      0.404 0.444 0.440 0.000 0.000 0.116
#> SRR868822     1  0.1908      0.702 0.908 0.000 0.000 0.000 0.092
#> SRR868824     3  0.2848      0.833 0.156 0.004 0.840 0.000 0.000
#> SRR868823     3  0.3554      0.682 0.004 0.004 0.776 0.000 0.216
#> SRR868825     1  0.1908      0.702 0.908 0.000 0.000 0.000 0.092
#> SRR868826     3  0.0671      0.903 0.000 0.004 0.980 0.000 0.016
#> SRR868827     5  0.6306      0.654 0.056 0.000 0.100 0.216 0.628
#> SRR868835     1  0.6517      0.466 0.508 0.000 0.008 0.172 0.312
#> SRR868836     1  0.2068      0.703 0.904 0.004 0.000 0.000 0.092
#> SRR868837     1  0.5818      0.625 0.628 0.004 0.196 0.000 0.172
#> SRR868838     5  0.3876      0.665 0.000 0.000 0.000 0.316 0.684
#> SRR868839     1  0.3730      0.560 0.712 0.288 0.000 0.000 0.000
#> SRR868840     1  0.6636      0.665 0.616 0.080 0.124 0.000 0.180
#> SRR868841     5  0.5646     -0.388 0.444 0.000 0.076 0.000 0.480
#> SRR868842     1  0.1908      0.702 0.908 0.000 0.000 0.000 0.092
#> SRR868843     1  0.5281      0.664 0.680 0.224 0.008 0.000 0.088
#> SRR868844     3  0.0510      0.903 0.000 0.000 0.984 0.000 0.016
#> SRR868845     5  0.3928      0.556 0.000 0.000 0.004 0.296 0.700
#> SRR868846     1  0.0000      0.685 1.000 0.000 0.000 0.000 0.000
#> SRR868847     1  0.6026      0.585 0.580 0.000 0.192 0.000 0.228
#> SRR868848     1  0.6561      0.440 0.492 0.000 0.008 0.172 0.328
#> SRR868849     1  0.2929      0.526 0.820 0.180 0.000 0.000 0.000
#> SRR868850     5  0.2629      0.732 0.000 0.000 0.004 0.136 0.860
#> SRR868851     4  0.0290      0.871 0.000 0.000 0.000 0.992 0.008
#> SRR868852     2  0.4300      0.103 0.476 0.524 0.000 0.000 0.000
#> SRR868853     1  0.3452      0.623 0.756 0.244 0.000 0.000 0.000
#> SRR868855     1  0.4814      0.633 0.724 0.004 0.192 0.000 0.080
#> SRR868856     4  0.0000      0.876 0.000 0.000 0.000 1.000 0.000
#> SRR868857     1  0.3143      0.648 0.796 0.204 0.000 0.000 0.000
#> SRR868858     1  0.3835      0.629 0.744 0.244 0.000 0.000 0.012
#> SRR868874     4  0.2471      0.820 0.000 0.000 0.000 0.864 0.136
#> SRR868875     2  0.1732      0.899 0.080 0.920 0.000 0.000 0.000
#> SRR868876     2  0.1792      0.900 0.084 0.916 0.000 0.000 0.000
#> SRR868877     4  0.2471      0.820 0.000 0.000 0.000 0.864 0.136
#> SRR868878     2  0.1792      0.900 0.084 0.916 0.000 0.000 0.000
#> SRR868879     4  0.2471      0.820 0.000 0.000 0.000 0.864 0.136
#> SRR868880     4  0.0000      0.876 0.000 0.000 0.000 1.000 0.000
#> SRR868881     2  0.0162      0.856 0.004 0.996 0.000 0.000 0.000
#> SRR868882     2  0.1671      0.899 0.076 0.924 0.000 0.000 0.000
#> SRR868883     2  0.1430      0.890 0.052 0.944 0.004 0.000 0.000
#> SRR868884     2  0.1792      0.900 0.084 0.916 0.000 0.000 0.000
#> SRR868885     2  0.0000      0.855 0.000 1.000 0.000 0.000 0.000
#> SRR868829     5  0.5683      0.673 0.024 0.000 0.088 0.228 0.660
#> SRR868830     5  0.3876      0.665 0.000 0.000 0.000 0.316 0.684
#> SRR868831     3  0.0865      0.903 0.024 0.004 0.972 0.000 0.000
#> SRR868828     3  0.1894      0.856 0.000 0.000 0.920 0.072 0.008
#> SRR868832     3  0.2605      0.840 0.148 0.000 0.852 0.000 0.000
#> SRR868833     3  0.2471      0.847 0.136 0.000 0.864 0.000 0.000
#> SRR868834     1  0.1908      0.702 0.908 0.000 0.000 0.000 0.092
#> SRR868854     4  0.2020      0.751 0.000 0.000 0.000 0.900 0.100
#> SRR868859     4  0.2813      0.708 0.000 0.000 0.000 0.832 0.168
#> SRR868860     4  0.2280      0.831 0.000 0.000 0.000 0.880 0.120
#> SRR868861     1  0.0290      0.685 0.992 0.000 0.000 0.000 0.008
#> SRR868862     1  0.1671      0.657 0.924 0.076 0.000 0.000 0.000
#> SRR868863     4  0.0000      0.876 0.000 0.000 0.000 1.000 0.000
#> SRR868864     1  0.4883      0.683 0.708 0.200 0.000 0.000 0.092
#> SRR868865     2  0.1792      0.900 0.084 0.916 0.000 0.000 0.000
#> SRR868866     1  0.6314      0.461 0.508 0.000 0.000 0.180 0.312
#> SRR868867     1  0.0162      0.685 0.996 0.000 0.000 0.000 0.004
#> SRR868868     1  0.6314      0.461 0.508 0.000 0.000 0.180 0.312
#> SRR868869     1  0.6409      0.389 0.468 0.000 0.000 0.180 0.352
#> SRR868870     4  0.0000      0.876 0.000 0.000 0.000 1.000 0.000
#> SRR868871     2  0.1732      0.899 0.080 0.920 0.000 0.000 0.000
#> SRR868873     4  0.0000      0.876 0.000 0.000 0.000 1.000 0.000
#> SRR868872     2  0.1792      0.900 0.084 0.916 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     6  0.4806    0.28090 0.236 0.016 0.072 0.000 0.000 0.676
#> SRR868807     1  0.5728    0.22669 0.484 0.000 0.336 0.000 0.000 0.180
#> SRR868808     6  0.0363    0.42442 0.000 0.012 0.000 0.000 0.000 0.988
#> SRR868809     6  0.5318    0.25121 0.272 0.148 0.000 0.000 0.000 0.580
#> SRR868810     2  0.2823    0.74951 0.000 0.796 0.000 0.000 0.000 0.204
#> SRR868811     4  0.2340    0.82695 0.000 0.000 0.000 0.852 0.148 0.000
#> SRR868812     6  0.1036    0.40973 0.024 0.008 0.004 0.000 0.000 0.964
#> SRR868813     5  0.0000    0.86102 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868814     5  0.0000    0.86102 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868815     5  0.0000    0.86102 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868816     3  0.0000    0.90846 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000    0.90846 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000    0.90846 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     6  0.0508    0.42542 0.004 0.012 0.000 0.000 0.000 0.984
#> SRR868820     6  0.0260    0.42479 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR868821     6  0.0260    0.42479 0.000 0.008 0.000 0.000 0.000 0.992
#> SRR868822     1  0.5431    0.26180 0.532 0.136 0.000 0.000 0.000 0.332
#> SRR868824     3  0.1814    0.87312 0.000 0.100 0.900 0.000 0.000 0.000
#> SRR868823     3  0.2883    0.76450 0.212 0.000 0.788 0.000 0.000 0.000
#> SRR868825     1  0.5421    0.26736 0.536 0.136 0.000 0.000 0.000 0.328
#> SRR868826     3  0.1007    0.90164 0.044 0.000 0.956 0.000 0.000 0.000
#> SRR868827     5  0.3847    0.75111 0.348 0.000 0.008 0.000 0.644 0.000
#> SRR868835     1  0.0000    0.43873 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868836     6  0.5562   -0.05648 0.432 0.136 0.000 0.000 0.000 0.432
#> SRR868837     1  0.3650    0.41552 0.708 0.000 0.012 0.000 0.000 0.280
#> SRR868838     5  0.5008    0.74426 0.212 0.000 0.000 0.148 0.640 0.000
#> SRR868839     6  0.5862    0.09009 0.376 0.196 0.000 0.000 0.000 0.428
#> SRR868840     1  0.3912    0.35880 0.648 0.000 0.012 0.000 0.000 0.340
#> SRR868841     1  0.3534    0.33752 0.716 0.000 0.008 0.000 0.276 0.000
#> SRR868842     1  0.5521    0.16240 0.488 0.136 0.000 0.000 0.000 0.376
#> SRR868843     1  0.4452    0.20827 0.548 0.008 0.016 0.000 0.000 0.428
#> SRR868844     3  0.1444    0.88835 0.072 0.000 0.928 0.000 0.000 0.000
#> SRR868845     5  0.0547    0.85187 0.000 0.000 0.000 0.020 0.980 0.000
#> SRR868846     1  0.5527    0.15013 0.484 0.136 0.000 0.000 0.000 0.380
#> SRR868847     1  0.3110    0.44329 0.792 0.000 0.012 0.000 0.000 0.196
#> SRR868848     1  0.0000    0.43873 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868849     6  0.5987    0.15728 0.300 0.260 0.000 0.000 0.000 0.440
#> SRR868850     5  0.0000    0.86102 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868851     4  0.0000    0.93432 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868852     2  0.3944   -0.14142 0.004 0.568 0.000 0.000 0.000 0.428
#> SRR868853     6  0.5868   -0.00839 0.424 0.136 0.012 0.000 0.000 0.428
#> SRR868855     1  0.4136    0.23470 0.560 0.000 0.012 0.000 0.000 0.428
#> SRR868856     4  0.0000    0.93432 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868857     6  0.5612   -0.01345 0.424 0.144 0.000 0.000 0.000 0.432
#> SRR868858     1  0.5730   -0.04855 0.444 0.116 0.012 0.000 0.000 0.428
#> SRR868874     4  0.2340    0.86310 0.148 0.000 0.000 0.852 0.000 0.000
#> SRR868875     2  0.0363    0.85665 0.000 0.988 0.012 0.000 0.000 0.000
#> SRR868876     2  0.0000    0.86053 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     4  0.2340    0.86310 0.148 0.000 0.000 0.852 0.000 0.000
#> SRR868878     2  0.0000    0.86053 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     4  0.2340    0.86310 0.148 0.000 0.000 0.852 0.000 0.000
#> SRR868880     4  0.0000    0.93432 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868881     2  0.3515    0.65015 0.000 0.676 0.000 0.000 0.000 0.324
#> SRR868882     2  0.1418    0.84061 0.000 0.944 0.032 0.000 0.000 0.024
#> SRR868883     2  0.2376    0.80636 0.000 0.888 0.044 0.000 0.000 0.068
#> SRR868884     2  0.0000    0.86053 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.2823    0.74951 0.000 0.796 0.000 0.000 0.000 0.204
#> SRR868829     5  0.3672    0.78172 0.304 0.000 0.008 0.000 0.688 0.000
#> SRR868830     5  0.3245    0.81479 0.228 0.000 0.000 0.008 0.764 0.000
#> SRR868831     3  0.0000    0.90846 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868828     3  0.2844    0.84446 0.016 0.000 0.860 0.020 0.104 0.000
#> SRR868832     3  0.1958    0.87116 0.000 0.100 0.896 0.000 0.000 0.004
#> SRR868833     3  0.1958    0.87116 0.000 0.100 0.896 0.000 0.000 0.004
#> SRR868834     1  0.5431    0.26094 0.532 0.136 0.000 0.000 0.000 0.332
#> SRR868854     4  0.0000    0.93432 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868859     4  0.0146    0.93297 0.000 0.000 0.000 0.996 0.004 0.000
#> SRR868860     4  0.1863    0.89143 0.104 0.000 0.000 0.896 0.000 0.000
#> SRR868861     1  0.5622    0.16312 0.488 0.132 0.004 0.000 0.000 0.376
#> SRR868862     6  0.5902    0.11563 0.348 0.212 0.000 0.000 0.000 0.440
#> SRR868863     4  0.0000    0.93432 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868864     6  0.5919   -0.01514 0.424 0.132 0.016 0.000 0.000 0.428
#> SRR868865     2  0.0000    0.86053 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868866     1  0.0000    0.43873 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868867     1  0.5521    0.16240 0.488 0.136 0.000 0.000 0.000 0.376
#> SRR868868     1  0.0000    0.43873 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868869     1  0.0000    0.43873 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868870     4  0.0000    0.93432 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868871     2  0.0000    0.86053 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     4  0.0000    0.93432 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR868872     2  0.0000    0.86053 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

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.922           0.932       0.972         0.5032 0.495   0.495
#> 3 3 0.941           0.930       0.972         0.2833 0.769   0.571
#> 4 4 0.668           0.579       0.798         0.1172 0.916   0.775
#> 5 5 0.708           0.704       0.844         0.0792 0.857   0.575
#> 6 6 0.768           0.691       0.798         0.0438 0.900   0.603

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
#> SRR868806     1  0.0000      0.976 1.000 0.000
#> SRR868807     1  0.0000      0.976 1.000 0.000
#> SRR868808     1  0.0000      0.976 1.000 0.000
#> SRR868809     1  0.0000      0.976 1.000 0.000
#> SRR868810     2  0.0000      0.963 0.000 1.000
#> SRR868811     2  0.0000      0.963 0.000 1.000
#> SRR868812     1  0.0000      0.976 1.000 0.000
#> SRR868813     1  0.0000      0.976 1.000 0.000
#> SRR868814     1  0.0000      0.976 1.000 0.000
#> SRR868815     1  0.0000      0.976 1.000 0.000
#> SRR868816     1  0.0000      0.976 1.000 0.000
#> SRR868817     1  0.0000      0.976 1.000 0.000
#> SRR868818     1  0.0000      0.976 1.000 0.000
#> SRR868819     1  0.2043      0.950 0.968 0.032
#> SRR868820     1  0.0000      0.976 1.000 0.000
#> SRR868821     1  0.0000      0.976 1.000 0.000
#> SRR868822     1  0.0000      0.976 1.000 0.000
#> SRR868824     1  0.0000      0.976 1.000 0.000
#> SRR868823     1  0.0000      0.976 1.000 0.000
#> SRR868825     1  0.0000      0.976 1.000 0.000
#> SRR868826     1  0.0000      0.976 1.000 0.000
#> SRR868827     1  0.0000      0.976 1.000 0.000
#> SRR868835     1  0.0000      0.976 1.000 0.000
#> SRR868836     1  0.0000      0.976 1.000 0.000
#> SRR868837     1  0.0376      0.974 0.996 0.004
#> SRR868838     1  0.0000      0.976 1.000 0.000
#> SRR868839     2  0.0000      0.963 0.000 1.000
#> SRR868840     1  0.0672      0.971 0.992 0.008
#> SRR868841     1  0.1184      0.965 0.984 0.016
#> SRR868842     1  0.8016      0.671 0.756 0.244
#> SRR868843     2  0.0000      0.963 0.000 1.000
#> SRR868844     1  0.0000      0.976 1.000 0.000
#> SRR868845     1  0.8813      0.572 0.700 0.300
#> SRR868846     2  0.0000      0.963 0.000 1.000
#> SRR868847     1  0.0000      0.976 1.000 0.000
#> SRR868848     1  0.2423      0.942 0.960 0.040
#> SRR868849     2  0.0000      0.963 0.000 1.000
#> SRR868850     1  0.1414      0.962 0.980 0.020
#> SRR868851     2  0.0000      0.963 0.000 1.000
#> SRR868852     2  0.0000      0.963 0.000 1.000
#> SRR868853     2  0.0000      0.963 0.000 1.000
#> SRR868855     2  0.7745      0.700 0.228 0.772
#> SRR868856     2  0.0000      0.963 0.000 1.000
#> SRR868857     2  0.0000      0.963 0.000 1.000
#> SRR868858     2  0.0000      0.963 0.000 1.000
#> SRR868874     2  0.0000      0.963 0.000 1.000
#> SRR868875     2  0.0000      0.963 0.000 1.000
#> SRR868876     2  0.0000      0.963 0.000 1.000
#> SRR868877     2  0.0000      0.963 0.000 1.000
#> SRR868878     2  0.0000      0.963 0.000 1.000
#> SRR868879     2  0.0000      0.963 0.000 1.000
#> SRR868880     2  0.0000      0.963 0.000 1.000
#> SRR868881     2  0.0000      0.963 0.000 1.000
#> SRR868882     2  0.0000      0.963 0.000 1.000
#> SRR868883     2  0.0000      0.963 0.000 1.000
#> SRR868884     2  0.0000      0.963 0.000 1.000
#> SRR868885     2  0.0000      0.963 0.000 1.000
#> SRR868829     1  0.0000      0.976 1.000 0.000
#> SRR868830     1  0.0000      0.976 1.000 0.000
#> SRR868831     1  0.0000      0.976 1.000 0.000
#> SRR868828     1  0.0000      0.976 1.000 0.000
#> SRR868832     1  0.0000      0.976 1.000 0.000
#> SRR868833     1  0.0000      0.976 1.000 0.000
#> SRR868834     1  0.0000      0.976 1.000 0.000
#> SRR868854     2  0.7453      0.724 0.212 0.788
#> SRR868859     2  0.0000      0.963 0.000 1.000
#> SRR868860     2  0.0000      0.963 0.000 1.000
#> SRR868861     1  0.8207      0.651 0.744 0.256
#> SRR868862     2  0.0000      0.963 0.000 1.000
#> SRR868863     2  0.0000      0.963 0.000 1.000
#> SRR868864     1  0.0000      0.976 1.000 0.000
#> SRR868865     2  0.0000      0.963 0.000 1.000
#> SRR868866     2  0.9922      0.196 0.448 0.552
#> SRR868867     2  0.0938      0.953 0.012 0.988
#> SRR868868     2  0.9775      0.306 0.412 0.588
#> SRR868869     1  0.0000      0.976 1.000 0.000
#> SRR868870     2  0.0000      0.963 0.000 1.000
#> SRR868871     2  0.0000      0.963 0.000 1.000
#> SRR868873     2  0.0000      0.963 0.000 1.000
#> SRR868872     2  0.0000      0.963 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
#> SRR868806     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868807     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868808     1  0.4235     0.7942 0.824 0.000 0.176
#> SRR868809     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868810     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868811     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868812     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868813     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868814     1  0.3752     0.8264 0.856 0.144 0.000
#> SRR868815     1  0.0237     0.9650 0.996 0.004 0.000
#> SRR868816     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868817     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868818     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868819     3  0.1411     0.9551 0.036 0.000 0.964
#> SRR868820     1  0.0237     0.9651 0.996 0.000 0.004
#> SRR868821     1  0.0237     0.9650 0.996 0.000 0.004
#> SRR868822     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868824     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868823     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868825     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868826     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868827     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868835     1  0.0892     0.9536 0.980 0.020 0.000
#> SRR868836     1  0.2261     0.9133 0.932 0.000 0.068
#> SRR868837     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868838     1  0.4887     0.6989 0.772 0.228 0.000
#> SRR868839     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868840     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868841     2  0.6302     0.0701 0.480 0.520 0.000
#> SRR868842     3  0.2165     0.9218 0.064 0.000 0.936
#> SRR868843     3  0.1711     0.9599 0.008 0.032 0.960
#> SRR868844     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868845     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868846     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868847     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868848     2  0.6307     0.0396 0.488 0.512 0.000
#> SRR868849     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868850     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868851     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868852     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868853     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868855     1  0.4887     0.7238 0.772 0.000 0.228
#> SRR868856     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868857     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868858     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868874     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868875     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868876     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868877     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868878     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868879     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868880     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868881     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868882     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868883     3  0.0237     0.9898 0.000 0.004 0.996
#> SRR868884     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868885     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868829     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868830     1  0.2261     0.9119 0.932 0.068 0.000
#> SRR868831     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868828     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868832     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868833     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868834     1  0.0000     0.9671 1.000 0.000 0.000
#> SRR868854     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868859     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868860     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868861     1  0.3192     0.8664 0.888 0.000 0.112
#> SRR868862     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868863     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868864     1  0.1031     0.9509 0.976 0.000 0.024
#> SRR868865     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868866     2  0.0592     0.9271 0.012 0.988 0.000
#> SRR868867     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868868     2  0.0892     0.9202 0.020 0.980 0.000
#> SRR868869     1  0.0237     0.9650 0.996 0.004 0.000
#> SRR868870     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868871     3  0.0000     0.9929 0.000 0.000 1.000
#> SRR868873     2  0.0000     0.9360 0.000 1.000 0.000
#> SRR868872     3  0.0000     0.9929 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
#> SRR868806     1  0.1940     0.6821 0.924 0.000 0.076 0.000
#> SRR868807     1  0.0000     0.7436 1.000 0.000 0.000 0.000
#> SRR868808     1  0.3024     0.5690 0.852 0.148 0.000 0.000
#> SRR868809     1  0.0000     0.7436 1.000 0.000 0.000 0.000
#> SRR868810     2  0.3311     0.7079 0.000 0.828 0.172 0.000
#> SRR868811     4  0.4817     0.6449 0.000 0.000 0.388 0.612
#> SRR868812     1  0.0000     0.7436 1.000 0.000 0.000 0.000
#> SRR868813     3  0.4955    -0.1124 0.444 0.000 0.556 0.000
#> SRR868814     1  0.6633     0.0555 0.500 0.000 0.416 0.084
#> SRR868815     1  0.5016     0.2231 0.600 0.000 0.396 0.004
#> SRR868816     1  0.0188     0.7438 0.996 0.000 0.004 0.000
#> SRR868817     1  0.0188     0.7438 0.996 0.000 0.004 0.000
#> SRR868818     1  0.0188     0.7438 0.996 0.000 0.004 0.000
#> SRR868819     3  0.5165    -0.3674 0.004 0.484 0.512 0.000
#> SRR868820     3  0.5971     0.4199 0.428 0.040 0.532 0.000
#> SRR868821     3  0.5977     0.4171 0.432 0.040 0.528 0.000
#> SRR868822     1  0.3873     0.4206 0.772 0.000 0.228 0.000
#> SRR868824     1  0.0188     0.7438 0.996 0.000 0.004 0.000
#> SRR868823     1  0.0000     0.7436 1.000 0.000 0.000 0.000
#> SRR868825     1  0.2868     0.5998 0.864 0.000 0.136 0.000
#> SRR868826     1  0.0188     0.7438 0.996 0.000 0.004 0.000
#> SRR868827     3  0.5000     0.2517 0.496 0.000 0.504 0.000
#> SRR868835     1  0.7526    -0.0641 0.440 0.000 0.188 0.372
#> SRR868836     1  0.6238     0.1206 0.652 0.112 0.236 0.000
#> SRR868837     1  0.0000     0.7436 1.000 0.000 0.000 0.000
#> SRR868838     1  0.4804     0.5217 0.780 0.000 0.072 0.148
#> SRR868839     2  0.0000     0.8275 0.000 1.000 0.000 0.000
#> SRR868840     1  0.4406     0.3886 0.700 0.000 0.300 0.000
#> SRR868841     1  0.5848     0.2649 0.616 0.000 0.336 0.048
#> SRR868842     2  0.7796    -0.3060 0.360 0.392 0.248 0.000
#> SRR868843     2  0.3189     0.7564 0.012 0.884 0.088 0.016
#> SRR868844     1  0.0188     0.7438 0.996 0.000 0.004 0.000
#> SRR868845     4  0.4817     0.6449 0.000 0.000 0.388 0.612
#> SRR868846     2  0.4518     0.6851 0.036 0.812 0.136 0.016
#> SRR868847     1  0.0188     0.7429 0.996 0.000 0.004 0.000
#> SRR868848     4  0.4464     0.5749 0.208 0.000 0.024 0.768
#> SRR868849     2  0.4677     0.5165 0.000 0.680 0.316 0.004
#> SRR868850     4  0.5746     0.6073 0.032 0.000 0.396 0.572
#> SRR868851     4  0.0707     0.8128 0.000 0.000 0.020 0.980
#> SRR868852     2  0.0000     0.8275 0.000 1.000 0.000 0.000
#> SRR868853     2  0.0000     0.8275 0.000 1.000 0.000 0.000
#> SRR868855     2  0.5292    -0.1098 0.480 0.512 0.000 0.008
#> SRR868856     4  0.3486     0.7631 0.000 0.000 0.188 0.812
#> SRR868857     2  0.0000     0.8275 0.000 1.000 0.000 0.000
#> SRR868858     2  0.0000     0.8275 0.000 1.000 0.000 0.000
#> SRR868874     4  0.0376     0.8119 0.000 0.004 0.004 0.992
#> SRR868875     2  0.0188     0.8270 0.000 0.996 0.000 0.004
#> SRR868876     2  0.0188     0.8270 0.000 0.996 0.000 0.004
#> SRR868877     4  0.0188     0.8129 0.000 0.000 0.004 0.996
#> SRR868878     2  0.0188     0.8270 0.000 0.996 0.000 0.004
#> SRR868879     4  0.0376     0.8119 0.000 0.004 0.004 0.992
#> SRR868880     4  0.0000     0.8134 0.000 0.000 0.000 1.000
#> SRR868881     2  0.3024     0.7296 0.000 0.852 0.148 0.000
#> SRR868882     2  0.0000     0.8275 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0707     0.8193 0.000 0.980 0.020 0.000
#> SRR868884     2  0.0000     0.8275 0.000 1.000 0.000 0.000
#> SRR868885     2  0.4454     0.5719 0.000 0.692 0.308 0.000
#> SRR868829     1  0.0707     0.7362 0.980 0.000 0.020 0.000
#> SRR868830     1  0.3485     0.6227 0.856 0.000 0.028 0.116
#> SRR868831     1  0.0000     0.7436 1.000 0.000 0.000 0.000
#> SRR868828     1  0.0188     0.7438 0.996 0.000 0.004 0.000
#> SRR868832     1  0.1118     0.7219 0.964 0.000 0.036 0.000
#> SRR868833     1  0.0469     0.7402 0.988 0.000 0.012 0.000
#> SRR868834     1  0.4800     0.1239 0.656 0.004 0.340 0.000
#> SRR868854     4  0.0707     0.8105 0.000 0.000 0.020 0.980
#> SRR868859     4  0.4804     0.6475 0.000 0.000 0.384 0.616
#> SRR868860     4  0.0188     0.8129 0.000 0.000 0.004 0.996
#> SRR868861     1  0.5296    -0.3738 0.496 0.008 0.496 0.000
#> SRR868862     2  0.4564     0.5022 0.000 0.672 0.328 0.000
#> SRR868863     4  0.3074     0.7796 0.000 0.000 0.152 0.848
#> SRR868864     1  0.1474     0.7023 0.948 0.052 0.000 0.000
#> SRR868865     2  0.0000     0.8275 0.000 1.000 0.000 0.000
#> SRR868866     4  0.4855     0.3952 0.000 0.000 0.400 0.600
#> SRR868867     2  0.7634     0.1273 0.020 0.440 0.420 0.120
#> SRR868868     4  0.4967     0.3177 0.000 0.000 0.452 0.548
#> SRR868869     1  0.7020    -0.1699 0.500 0.000 0.376 0.124
#> SRR868870     4  0.0188     0.8136 0.000 0.000 0.004 0.996
#> SRR868871     2  0.0188     0.8270 0.000 0.996 0.000 0.004
#> SRR868873     4  0.0336     0.8142 0.000 0.000 0.008 0.992
#> SRR868872     2  0.0188     0.8270 0.000 0.996 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
#> SRR868806     3  0.2751     0.7884 0.052 0.004 0.888 0.000 0.056
#> SRR868807     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868808     3  0.3857     0.5026 0.000 0.312 0.688 0.000 0.000
#> SRR868809     3  0.0162     0.8378 0.000 0.004 0.996 0.000 0.000
#> SRR868810     2  0.4206     0.6266 0.020 0.708 0.000 0.000 0.272
#> SRR868811     5  0.3508     0.7042 0.000 0.000 0.000 0.252 0.748
#> SRR868812     3  0.0290     0.8370 0.008 0.000 0.992 0.000 0.000
#> SRR868813     5  0.2011     0.7244 0.004 0.000 0.088 0.000 0.908
#> SRR868814     5  0.2377     0.7207 0.000 0.000 0.128 0.000 0.872
#> SRR868815     5  0.3707     0.5834 0.000 0.000 0.284 0.000 0.716
#> SRR868816     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868819     1  0.5155     0.5373 0.692 0.140 0.000 0.000 0.168
#> SRR868820     1  0.4988     0.5891 0.744 0.032 0.068 0.000 0.156
#> SRR868821     1  0.4941     0.5879 0.744 0.024 0.076 0.000 0.156
#> SRR868822     3  0.5390     0.0636 0.432 0.016 0.524 0.000 0.028
#> SRR868824     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868823     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868825     3  0.3109     0.6536 0.200 0.000 0.800 0.000 0.000
#> SRR868826     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868827     1  0.4868     0.5737 0.740 0.000 0.128 0.008 0.124
#> SRR868835     4  0.5715     0.6709 0.140 0.000 0.084 0.704 0.072
#> SRR868836     3  0.5858    -0.1736 0.452 0.096 0.452 0.000 0.000
#> SRR868837     3  0.1087     0.8324 0.016 0.008 0.968 0.000 0.008
#> SRR868838     3  0.5385     0.6439 0.084 0.000 0.724 0.048 0.144
#> SRR868839     2  0.0000     0.9108 0.000 1.000 0.000 0.000 0.000
#> SRR868840     3  0.4288     0.3207 0.000 0.004 0.612 0.000 0.384
#> SRR868841     3  0.4516     0.2180 0.004 0.000 0.576 0.004 0.416
#> SRR868842     1  0.6781     0.2598 0.400 0.396 0.196 0.008 0.000
#> SRR868843     2  0.1329     0.8853 0.004 0.956 0.008 0.000 0.032
#> SRR868844     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868845     5  0.3242     0.7351 0.000 0.000 0.000 0.216 0.784
#> SRR868846     2  0.5449     0.2448 0.328 0.600 0.004 0.068 0.000
#> SRR868847     3  0.0404     0.8351 0.012 0.000 0.988 0.000 0.000
#> SRR868848     4  0.3812     0.8162 0.080 0.000 0.012 0.828 0.080
#> SRR868849     1  0.3550     0.5959 0.760 0.236 0.000 0.004 0.000
#> SRR868850     5  0.3391     0.7493 0.000 0.000 0.012 0.188 0.800
#> SRR868851     4  0.1043     0.8707 0.000 0.000 0.000 0.960 0.040
#> SRR868852     2  0.0000     0.9108 0.000 1.000 0.000 0.000 0.000
#> SRR868853     2  0.0162     0.9102 0.000 0.996 0.000 0.000 0.004
#> SRR868855     2  0.4846     0.3855 0.012 0.640 0.332 0.004 0.012
#> SRR868856     4  0.4780     0.6525 0.060 0.000 0.000 0.692 0.248
#> SRR868857     2  0.0000     0.9108 0.000 1.000 0.000 0.000 0.000
#> SRR868858     2  0.0162     0.9102 0.000 0.996 0.000 0.000 0.004
#> SRR868874     4  0.0451     0.8696 0.000 0.008 0.000 0.988 0.004
#> SRR868875     2  0.0324     0.9102 0.000 0.992 0.000 0.004 0.004
#> SRR868876     2  0.0290     0.9095 0.000 0.992 0.000 0.008 0.000
#> SRR868877     4  0.0162     0.8712 0.000 0.000 0.000 0.996 0.004
#> SRR868878     2  0.0290     0.9095 0.000 0.992 0.000 0.008 0.000
#> SRR868879     4  0.0451     0.8696 0.000 0.008 0.000 0.988 0.004
#> SRR868880     4  0.0609     0.8733 0.000 0.000 0.000 0.980 0.020
#> SRR868881     2  0.3123     0.7636 0.012 0.828 0.000 0.000 0.160
#> SRR868882     2  0.0324     0.9102 0.000 0.992 0.000 0.004 0.004
#> SRR868883     2  0.1041     0.8936 0.000 0.964 0.000 0.004 0.032
#> SRR868884     2  0.0000     0.9108 0.000 1.000 0.000 0.000 0.000
#> SRR868885     5  0.4763     0.5036 0.104 0.152 0.000 0.004 0.740
#> SRR868829     3  0.3911     0.7277 0.104 0.000 0.816 0.008 0.072
#> SRR868830     3  0.6540     0.4992 0.100 0.000 0.624 0.188 0.088
#> SRR868831     3  0.0000     0.8387 0.000 0.000 1.000 0.000 0.000
#> SRR868828     3  0.0290     0.8369 0.000 0.000 0.992 0.000 0.008
#> SRR868832     3  0.2424     0.7383 0.132 0.000 0.868 0.000 0.000
#> SRR868833     3  0.0703     0.8300 0.024 0.000 0.976 0.000 0.000
#> SRR868834     1  0.4367     0.3588 0.620 0.008 0.372 0.000 0.000
#> SRR868854     4  0.3532     0.8202 0.076 0.000 0.000 0.832 0.092
#> SRR868859     5  0.3916     0.6587 0.012 0.000 0.000 0.256 0.732
#> SRR868860     4  0.0579     0.8721 0.008 0.000 0.000 0.984 0.008
#> SRR868861     1  0.2879     0.6392 0.868 0.000 0.100 0.032 0.000
#> SRR868862     1  0.4331     0.3400 0.596 0.400 0.000 0.004 0.000
#> SRR868863     4  0.5112     0.6449 0.080 0.000 0.000 0.664 0.256
#> SRR868864     3  0.2020     0.7763 0.000 0.100 0.900 0.000 0.000
#> SRR868865     2  0.0000     0.9108 0.000 1.000 0.000 0.000 0.000
#> SRR868866     1  0.4201     0.3739 0.592 0.000 0.000 0.408 0.000
#> SRR868867     1  0.3256     0.6310 0.832 0.004 0.016 0.148 0.000
#> SRR868868     1  0.4101     0.4837 0.664 0.000 0.004 0.332 0.000
#> SRR868869     1  0.6260     0.4302 0.516 0.000 0.172 0.312 0.000
#> SRR868870     4  0.1197     0.8674 0.000 0.000 0.000 0.952 0.048
#> SRR868871     2  0.0404     0.9082 0.000 0.988 0.000 0.012 0.000
#> SRR868873     4  0.1341     0.8625 0.000 0.000 0.000 0.944 0.056
#> SRR868872     2  0.0404     0.9082 0.000 0.988 0.000 0.012 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
#> SRR868806     3  0.6071      0.554 0.032 0.000 0.652 0.144 0.072 0.100
#> SRR868807     3  0.0405      0.872 0.004 0.000 0.988 0.000 0.000 0.008
#> SRR868808     2  0.4797      0.089 0.012 0.512 0.452 0.008 0.000 0.016
#> SRR868809     3  0.1007      0.866 0.004 0.008 0.968 0.004 0.000 0.016
#> SRR868810     2  0.4411      0.696 0.016 0.740 0.000 0.084 0.160 0.000
#> SRR868811     5  0.1806      0.716 0.000 0.000 0.000 0.088 0.908 0.004
#> SRR868812     3  0.2395      0.828 0.020 0.000 0.904 0.028 0.004 0.044
#> SRR868813     5  0.2841      0.657 0.004 0.000 0.004 0.156 0.832 0.004
#> SRR868814     5  0.0964      0.730 0.000 0.000 0.016 0.004 0.968 0.012
#> SRR868815     5  0.3136      0.659 0.000 0.000 0.188 0.000 0.796 0.016
#> SRR868816     3  0.0291      0.873 0.004 0.000 0.992 0.000 0.004 0.000
#> SRR868817     3  0.0436      0.873 0.004 0.000 0.988 0.004 0.004 0.000
#> SRR868818     3  0.0291      0.873 0.004 0.000 0.992 0.000 0.004 0.000
#> SRR868819     1  0.5386      0.413 0.576 0.012 0.000 0.332 0.072 0.008
#> SRR868820     1  0.5373      0.414 0.580 0.008 0.000 0.332 0.064 0.016
#> SRR868821     1  0.5373      0.414 0.580 0.008 0.000 0.332 0.064 0.016
#> SRR868822     3  0.6869      0.100 0.308 0.004 0.468 0.072 0.004 0.144
#> SRR868824     3  0.0146      0.873 0.000 0.000 0.996 0.004 0.000 0.000
#> SRR868823     3  0.0291      0.872 0.000 0.000 0.992 0.004 0.000 0.004
#> SRR868825     3  0.2146      0.796 0.116 0.000 0.880 0.004 0.000 0.000
#> SRR868826     3  0.0146      0.873 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR868827     6  0.6902      0.101 0.236 0.000 0.040 0.308 0.008 0.408
#> SRR868835     6  0.0520      0.553 0.008 0.000 0.000 0.008 0.000 0.984
#> SRR868836     1  0.5071      0.340 0.576 0.048 0.360 0.008 0.000 0.008
#> SRR868837     3  0.4776      0.666 0.140 0.008 0.748 0.008 0.064 0.032
#> SRR868838     6  0.4436      0.447 0.000 0.000 0.332 0.008 0.028 0.632
#> SRR868839     2  0.0582      0.909 0.004 0.984 0.004 0.004 0.000 0.004
#> SRR868840     5  0.4509      0.219 0.004 0.000 0.452 0.004 0.524 0.016
#> SRR868841     5  0.4452      0.381 0.000 0.000 0.400 0.004 0.572 0.024
#> SRR868842     1  0.6193      0.423 0.500 0.228 0.256 0.008 0.000 0.008
#> SRR868843     2  0.1843      0.874 0.004 0.924 0.004 0.004 0.004 0.060
#> SRR868844     3  0.0665      0.869 0.008 0.000 0.980 0.004 0.000 0.008
#> SRR868845     5  0.1657      0.728 0.000 0.000 0.000 0.056 0.928 0.016
#> SRR868846     2  0.2825      0.784 0.136 0.844 0.000 0.012 0.000 0.008
#> SRR868847     3  0.1536      0.856 0.040 0.000 0.940 0.004 0.000 0.016
#> SRR868848     6  0.2006      0.427 0.004 0.000 0.000 0.104 0.000 0.892
#> SRR868849     1  0.1716      0.581 0.932 0.036 0.000 0.028 0.000 0.004
#> SRR868850     5  0.1411      0.727 0.000 0.000 0.000 0.060 0.936 0.004
#> SRR868851     4  0.4724      0.920 0.000 0.000 0.000 0.592 0.060 0.348
#> SRR868852     2  0.0291      0.910 0.004 0.992 0.004 0.000 0.000 0.000
#> SRR868853     2  0.0436      0.910 0.004 0.988 0.004 0.004 0.000 0.000
#> SRR868855     3  0.4785      0.397 0.016 0.328 0.624 0.020 0.012 0.000
#> SRR868856     6  0.4836      0.383 0.000 0.000 0.000 0.140 0.196 0.664
#> SRR868857     2  0.0436      0.910 0.004 0.988 0.004 0.000 0.000 0.004
#> SRR868858     2  0.0405      0.909 0.004 0.988 0.008 0.000 0.000 0.000
#> SRR868874     4  0.4004      0.962 0.000 0.012 0.000 0.620 0.000 0.368
#> SRR868875     2  0.0260      0.909 0.000 0.992 0.000 0.008 0.000 0.000
#> SRR868876     2  0.0363      0.909 0.000 0.988 0.000 0.012 0.000 0.000
#> SRR868877     4  0.4004      0.962 0.000 0.012 0.000 0.620 0.000 0.368
#> SRR868878     2  0.0363      0.909 0.000 0.988 0.000 0.012 0.000 0.000
#> SRR868879     4  0.3992      0.959 0.000 0.012 0.000 0.624 0.000 0.364
#> SRR868880     4  0.4026      0.961 0.000 0.000 0.000 0.612 0.012 0.376
#> SRR868881     2  0.4445      0.645 0.008 0.712 0.000 0.208 0.072 0.000
#> SRR868882     2  0.0146      0.909 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR868883     2  0.1700      0.862 0.000 0.916 0.000 0.004 0.080 0.000
#> SRR868884     2  0.0146      0.910 0.000 0.996 0.004 0.000 0.000 0.000
#> SRR868885     5  0.4471      0.589 0.060 0.048 0.000 0.124 0.764 0.004
#> SRR868829     6  0.4420      0.473 0.000 0.000 0.320 0.036 0.004 0.640
#> SRR868830     6  0.3090      0.592 0.000 0.000 0.140 0.028 0.004 0.828
#> SRR868831     3  0.0146      0.873 0.000 0.000 0.996 0.004 0.000 0.000
#> SRR868828     3  0.0146      0.873 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR868832     3  0.1411      0.845 0.060 0.000 0.936 0.004 0.000 0.000
#> SRR868833     3  0.0508      0.870 0.012 0.000 0.984 0.004 0.000 0.000
#> SRR868834     1  0.4403      0.501 0.684 0.000 0.268 0.032 0.000 0.016
#> SRR868854     6  0.1387      0.492 0.000 0.000 0.000 0.068 0.000 0.932
#> SRR868859     5  0.3602      0.575 0.000 0.000 0.000 0.032 0.760 0.208
#> SRR868860     4  0.4168      0.929 0.016 0.000 0.000 0.584 0.000 0.400
#> SRR868861     1  0.2542      0.590 0.876 0.000 0.044 0.080 0.000 0.000
#> SRR868862     1  0.4177      0.468 0.684 0.280 0.004 0.032 0.000 0.000
#> SRR868863     6  0.1003      0.547 0.000 0.000 0.000 0.016 0.020 0.964
#> SRR868864     3  0.3997      0.577 0.012 0.256 0.716 0.004 0.000 0.012
#> SRR868865     2  0.0291      0.910 0.004 0.992 0.004 0.000 0.000 0.000
#> SRR868866     1  0.4165      0.301 0.568 0.000 0.008 0.420 0.000 0.004
#> SRR868867     1  0.1588      0.586 0.924 0.004 0.000 0.072 0.000 0.000
#> SRR868868     1  0.3965      0.348 0.604 0.000 0.000 0.388 0.000 0.008
#> SRR868869     1  0.5750      0.482 0.552 0.000 0.244 0.196 0.000 0.008
#> SRR868870     4  0.4178      0.961 0.000 0.000 0.000 0.608 0.020 0.372
#> SRR868871     2  0.0547      0.905 0.000 0.980 0.000 0.020 0.000 0.000
#> SRR868873     4  0.4490      0.951 0.000 0.004 0.000 0.604 0.032 0.360
#> SRR868872     2  0.0458      0.907 0.000 0.984 0.000 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-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 15961 rows and 80 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk ATC-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.583           0.871       0.936         0.4739 0.514   0.514
#> 3 3 0.628           0.855       0.928         0.1813 0.867   0.751
#> 4 4 0.724           0.812       0.851         0.2836 0.785   0.530
#> 5 5 0.735           0.757       0.862         0.0608 0.917   0.718
#> 6 6 0.743           0.739       0.858         0.0201 0.986   0.938

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
#> SRR868806     2  0.9970      0.132 0.468 0.532
#> SRR868807     1  0.0938      0.931 0.988 0.012
#> SRR868808     2  0.9977      0.117 0.472 0.528
#> SRR868809     1  0.0938      0.931 0.988 0.012
#> SRR868810     2  0.0000      0.927 0.000 1.000
#> SRR868811     2  0.0000      0.927 0.000 1.000
#> SRR868812     1  0.0938      0.931 0.988 0.012
#> SRR868813     2  0.9977      0.117 0.472 0.528
#> SRR868814     1  0.2778      0.917 0.952 0.048
#> SRR868815     1  0.0938      0.931 0.988 0.012
#> SRR868816     1  0.0000      0.927 1.000 0.000
#> SRR868817     1  0.0000      0.927 1.000 0.000
#> SRR868818     1  0.0000      0.927 1.000 0.000
#> SRR868819     2  0.0000      0.927 0.000 1.000
#> SRR868820     2  0.4022      0.894 0.080 0.920
#> SRR868821     2  0.4022      0.894 0.080 0.920
#> SRR868822     1  0.0938      0.931 0.988 0.012
#> SRR868824     1  0.0000      0.927 1.000 0.000
#> SRR868823     1  0.0938      0.931 0.988 0.012
#> SRR868825     1  0.0938      0.931 0.988 0.012
#> SRR868826     1  0.0000      0.927 1.000 0.000
#> SRR868827     1  0.2778      0.917 0.952 0.048
#> SRR868835     1  0.6531      0.833 0.832 0.168
#> SRR868836     1  0.6531      0.833 0.832 0.168
#> SRR868837     1  0.6531      0.833 0.832 0.168
#> SRR868838     1  0.0938      0.931 0.988 0.012
#> SRR868839     2  0.0000      0.927 0.000 1.000
#> SRR868840     1  0.6531      0.833 0.832 0.168
#> SRR868841     1  0.6531      0.833 0.832 0.168
#> SRR868842     2  0.5294      0.870 0.120 0.880
#> SRR868843     2  0.5294      0.870 0.120 0.880
#> SRR868844     1  0.0000      0.927 1.000 0.000
#> SRR868845     2  0.4939      0.878 0.108 0.892
#> SRR868846     2  0.5294      0.870 0.120 0.880
#> SRR868847     1  0.6531      0.833 0.832 0.168
#> SRR868848     1  0.6531      0.833 0.832 0.168
#> SRR868849     2  0.0000      0.927 0.000 1.000
#> SRR868850     2  0.5629      0.858 0.132 0.868
#> SRR868851     2  0.4939      0.878 0.108 0.892
#> SRR868852     2  0.0000      0.927 0.000 1.000
#> SRR868853     2  0.0000      0.927 0.000 1.000
#> SRR868855     2  0.5294      0.870 0.120 0.880
#> SRR868856     2  0.0000      0.927 0.000 1.000
#> SRR868857     2  0.5294      0.870 0.120 0.880
#> SRR868858     2  0.5294      0.870 0.120 0.880
#> SRR868874     2  0.0000      0.927 0.000 1.000
#> SRR868875     2  0.0000      0.927 0.000 1.000
#> SRR868876     2  0.0000      0.927 0.000 1.000
#> SRR868877     2  0.0000      0.927 0.000 1.000
#> SRR868878     2  0.0000      0.927 0.000 1.000
#> SRR868879     2  0.0000      0.927 0.000 1.000
#> SRR868880     2  0.0000      0.927 0.000 1.000
#> SRR868881     2  0.0000      0.927 0.000 1.000
#> SRR868882     2  0.0000      0.927 0.000 1.000
#> SRR868883     2  0.0000      0.927 0.000 1.000
#> SRR868884     2  0.0000      0.927 0.000 1.000
#> SRR868885     2  0.0000      0.927 0.000 1.000
#> SRR868829     1  0.0938      0.931 0.988 0.012
#> SRR868830     1  0.2778      0.917 0.952 0.048
#> SRR868831     1  0.0000      0.927 1.000 0.000
#> SRR868828     1  0.0000      0.927 1.000 0.000
#> SRR868832     1  0.0000      0.927 1.000 0.000
#> SRR868833     1  0.0000      0.927 1.000 0.000
#> SRR868834     1  0.6531      0.833 0.832 0.168
#> SRR868854     2  0.3584      0.900 0.068 0.932
#> SRR868859     2  0.0000      0.927 0.000 1.000
#> SRR868860     2  0.0000      0.927 0.000 1.000
#> SRR868861     2  0.5294      0.870 0.120 0.880
#> SRR868862     2  0.0000      0.927 0.000 1.000
#> SRR868863     2  0.0000      0.927 0.000 1.000
#> SRR868864     1  0.9732      0.344 0.596 0.404
#> SRR868865     2  0.0000      0.927 0.000 1.000
#> SRR868866     2  0.5294      0.870 0.120 0.880
#> SRR868867     2  0.0000      0.927 0.000 1.000
#> SRR868868     2  0.5294      0.870 0.120 0.880
#> SRR868869     1  0.0938      0.931 0.988 0.012
#> SRR868870     2  0.0000      0.927 0.000 1.000
#> SRR868871     2  0.0000      0.927 0.000 1.000
#> SRR868873     2  0.0000      0.927 0.000 1.000
#> SRR868872     2  0.0000      0.927 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> SRR868806     1   0.630     0.0775 0.516 0.484 0.000
#> SRR868807     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868808     1   0.630     0.0942 0.520 0.480 0.000
#> SRR868809     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868810     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868811     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868812     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868813     1   0.630     0.0942 0.520 0.480 0.000
#> SRR868814     1   0.000     0.8084 1.000 0.000 0.000
#> SRR868815     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868816     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868817     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868818     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868819     2   0.141     0.9235 0.036 0.964 0.000
#> SRR868820     2   0.348     0.8809 0.128 0.872 0.000
#> SRR868821     2   0.348     0.8809 0.128 0.872 0.000
#> SRR868822     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868824     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868823     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868825     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868826     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868827     1   0.000     0.8084 1.000 0.000 0.000
#> SRR868835     1   0.334     0.8040 0.880 0.120 0.000
#> SRR868836     1   0.334     0.8040 0.880 0.120 0.000
#> SRR868837     1   0.334     0.8040 0.880 0.120 0.000
#> SRR868838     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868839     2   0.175     0.9212 0.048 0.952 0.000
#> SRR868840     1   0.334     0.8040 0.880 0.120 0.000
#> SRR868841     1   0.334     0.8040 0.880 0.120 0.000
#> SRR868842     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868843     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868844     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868845     2   0.394     0.8605 0.156 0.844 0.000
#> SRR868846     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868847     1   0.334     0.8040 0.880 0.120 0.000
#> SRR868848     1   0.334     0.8040 0.880 0.120 0.000
#> SRR868849     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868850     2   0.429     0.8353 0.180 0.820 0.000
#> SRR868851     2   0.375     0.8687 0.144 0.856 0.000
#> SRR868852     2   0.175     0.9212 0.048 0.952 0.000
#> SRR868853     2   0.175     0.9212 0.048 0.952 0.000
#> SRR868855     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868856     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868857     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868858     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868874     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868875     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868876     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868877     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868878     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868879     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868880     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868881     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868882     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868883     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868884     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868885     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868829     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868830     1   0.000     0.8084 1.000 0.000 0.000
#> SRR868831     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868828     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868832     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868833     3   0.000     1.0000 0.000 0.000 1.000
#> SRR868834     1   0.334     0.8040 0.880 0.120 0.000
#> SRR868854     2   0.304     0.8945 0.104 0.896 0.000
#> SRR868859     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868860     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868861     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868862     2   0.175     0.9212 0.048 0.952 0.000
#> SRR868863     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868864     1   0.593     0.4682 0.644 0.356 0.000
#> SRR868865     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868866     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868867     2   0.175     0.9212 0.048 0.952 0.000
#> SRR868868     2   0.412     0.8501 0.168 0.832 0.000
#> SRR868869     1   0.141     0.8036 0.964 0.000 0.036
#> SRR868870     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868871     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868873     2   0.000     0.9306 0.000 1.000 0.000
#> SRR868872     2   0.000     0.9306 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2 p3    p4
#> SRR868806     4  0.4661      0.256 0.348 0.000  0 0.652
#> SRR868807     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868808     4  0.4679      0.244 0.352 0.000  0 0.648
#> SRR868809     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868810     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868811     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868812     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868813     4  0.4679      0.244 0.352 0.000  0 0.648
#> SRR868814     1  0.1940      0.847 0.924 0.000  0 0.076
#> SRR868815     1  0.1211      0.850 0.960 0.000  0 0.040
#> SRR868816     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868817     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868818     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868819     4  0.2921      0.791 0.000 0.140  0 0.860
#> SRR868820     4  0.1211      0.819 0.000 0.040  0 0.960
#> SRR868821     4  0.1211      0.819 0.000 0.040  0 0.960
#> SRR868822     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868824     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868823     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868825     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868826     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868827     1  0.1118      0.852 0.964 0.000  0 0.036
#> SRR868835     1  0.4331      0.753 0.712 0.000  0 0.288
#> SRR868836     1  0.4331      0.753 0.712 0.000  0 0.288
#> SRR868837     1  0.4331      0.753 0.712 0.000  0 0.288
#> SRR868838     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868839     4  0.3024      0.788 0.000 0.148  0 0.852
#> SRR868840     1  0.4331      0.753 0.712 0.000  0 0.288
#> SRR868841     1  0.4331      0.753 0.712 0.000  0 0.288
#> SRR868842     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868843     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868844     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868845     4  0.0469      0.817 0.000 0.012  0 0.988
#> SRR868846     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868847     1  0.4331      0.753 0.712 0.000  0 0.288
#> SRR868848     1  0.4331      0.753 0.712 0.000  0 0.288
#> SRR868849     4  0.4888      0.435 0.000 0.412  0 0.588
#> SRR868850     4  0.0469      0.807 0.012 0.000  0 0.988
#> SRR868851     4  0.0817      0.818 0.000 0.024  0 0.976
#> SRR868852     4  0.3024      0.788 0.000 0.148  0 0.852
#> SRR868853     4  0.3024      0.788 0.000 0.148  0 0.852
#> SRR868855     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868856     4  0.4250      0.666 0.000 0.276  0 0.724
#> SRR868857     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868858     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868874     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868875     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868876     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868877     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868878     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868879     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868880     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868881     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868882     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868883     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868884     2  0.4382      0.485 0.000 0.704  0 0.296
#> SRR868885     2  0.2149      0.874 0.000 0.912  0 0.088
#> SRR868829     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868830     1  0.1118      0.852 0.964 0.000  0 0.036
#> SRR868831     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868828     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868832     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868833     3  0.0000      1.000 0.000 0.000  1 0.000
#> SRR868834     1  0.4331      0.753 0.712 0.000  0 0.288
#> SRR868854     4  0.1792      0.817 0.000 0.068  0 0.932
#> SRR868859     4  0.4250      0.666 0.000 0.276  0 0.724
#> SRR868860     4  0.4500      0.611 0.000 0.316  0 0.684
#> SRR868861     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868862     4  0.2814      0.795 0.000 0.132  0 0.868
#> SRR868863     4  0.4250      0.666 0.000 0.276  0 0.724
#> SRR868864     4  0.4992     -0.238 0.476 0.000  0 0.524
#> SRR868865     4  0.4888      0.435 0.000 0.412  0 0.588
#> SRR868866     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868867     4  0.2814      0.795 0.000 0.132  0 0.868
#> SRR868868     4  0.0000      0.814 0.000 0.000  0 1.000
#> SRR868869     1  0.0000      0.850 1.000 0.000  0 0.000
#> SRR868870     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868871     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868873     2  0.0000      0.971 0.000 1.000  0 0.000
#> SRR868872     2  0.0000      0.971 0.000 1.000  0 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2 p3    p4    p5
#> SRR868806     1  0.4283     0.1568 0.544 0.000  0 0.456 0.000
#> SRR868807     5  0.3508     0.8875 0.252 0.000  0 0.000 0.748
#> SRR868808     1  0.4278     0.1716 0.548 0.000  0 0.452 0.000
#> SRR868809     5  0.3534     0.8844 0.256 0.000  0 0.000 0.744
#> SRR868810     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868811     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868812     1  0.3932     0.1088 0.672 0.000  0 0.000 0.328
#> SRR868813     1  0.4278     0.1716 0.548 0.000  0 0.452 0.000
#> SRR868814     1  0.2424     0.4721 0.868 0.000  0 0.000 0.132
#> SRR868815     1  0.3480     0.3110 0.752 0.000  0 0.000 0.248
#> SRR868816     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868817     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868818     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868819     4  0.1792     0.7753 0.000 0.084  0 0.916 0.000
#> SRR868820     4  0.0510     0.7827 0.016 0.000  0 0.984 0.000
#> SRR868821     4  0.0510     0.7827 0.016 0.000  0 0.984 0.000
#> SRR868822     5  0.3508     0.8875 0.252 0.000  0 0.000 0.748
#> SRR868824     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868823     5  0.0404     0.7532 0.012 0.000  0 0.000 0.988
#> SRR868825     5  0.3508     0.8875 0.252 0.000  0 0.000 0.748
#> SRR868826     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868827     1  0.3913     0.0522 0.676 0.000  0 0.000 0.324
#> SRR868835     1  0.1908     0.6859 0.908 0.000  0 0.092 0.000
#> SRR868836     1  0.1908     0.6859 0.908 0.000  0 0.092 0.000
#> SRR868837     1  0.1908     0.6859 0.908 0.000  0 0.092 0.000
#> SRR868838     5  0.0404     0.7532 0.012 0.000  0 0.000 0.988
#> SRR868839     4  0.1908     0.7732 0.000 0.092  0 0.908 0.000
#> SRR868840     1  0.1908     0.6859 0.908 0.000  0 0.092 0.000
#> SRR868841     1  0.1908     0.6859 0.908 0.000  0 0.092 0.000
#> SRR868842     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868843     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868844     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868845     4  0.2605     0.7751 0.148 0.000  0 0.852 0.000
#> SRR868846     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868847     1  0.1908     0.6859 0.908 0.000  0 0.092 0.000
#> SRR868848     1  0.1908     0.6859 0.908 0.000  0 0.092 0.000
#> SRR868849     4  0.4060     0.4613 0.000 0.360  0 0.640 0.000
#> SRR868850     4  0.2891     0.7562 0.176 0.000  0 0.824 0.000
#> SRR868851     4  0.3098     0.7776 0.148 0.016  0 0.836 0.000
#> SRR868852     4  0.1908     0.7732 0.000 0.092  0 0.908 0.000
#> SRR868853     4  0.1908     0.7732 0.000 0.092  0 0.908 0.000
#> SRR868855     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868856     4  0.3274     0.6936 0.000 0.220  0 0.780 0.000
#> SRR868857     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868858     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868874     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868875     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868876     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868877     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868878     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868879     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868880     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868881     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868882     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868883     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868884     2  0.3857     0.4942 0.000 0.688  0 0.312 0.000
#> SRR868885     2  0.2020     0.8566 0.000 0.900  0 0.100 0.000
#> SRR868829     1  0.3932     0.1088 0.672 0.000  0 0.000 0.328
#> SRR868830     1  0.2929     0.3960 0.820 0.000  0 0.000 0.180
#> SRR868831     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868828     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868832     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868833     3  0.0000     1.0000 0.000 0.000  1 0.000 0.000
#> SRR868834     1  0.1908     0.6859 0.908 0.000  0 0.092 0.000
#> SRR868854     4  0.2505     0.7873 0.092 0.020  0 0.888 0.000
#> SRR868859     4  0.3274     0.6936 0.000 0.220  0 0.780 0.000
#> SRR868860     4  0.3586     0.6370 0.000 0.264  0 0.736 0.000
#> SRR868861     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868862     4  0.1671     0.7772 0.000 0.076  0 0.924 0.000
#> SRR868863     4  0.3274     0.6936 0.000 0.220  0 0.780 0.000
#> SRR868864     1  0.4045     0.4425 0.644 0.000  0 0.356 0.000
#> SRR868865     4  0.4060     0.4613 0.000 0.360  0 0.640 0.000
#> SRR868866     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868867     4  0.1671     0.7772 0.000 0.076  0 0.924 0.000
#> SRR868868     4  0.2732     0.7718 0.160 0.000  0 0.840 0.000
#> SRR868869     5  0.3508     0.8875 0.252 0.000  0 0.000 0.748
#> SRR868870     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868871     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868873     2  0.0000     0.9695 0.000 1.000  0 0.000 0.000
#> SRR868872     2  0.0000     0.9695 0.000 1.000  0 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
#> SRR868806     5  0.3717     0.2642 0.384 0.000 0.000 0.000 0.616 0.000
#> SRR868807     6  0.5186     0.7764 0.000 0.000 0.000 0.168 0.216 0.616
#> SRR868808     5  0.3841     0.2739 0.380 0.000 0.000 0.004 0.616 0.000
#> SRR868809     6  0.5296     0.7588 0.000 0.000 0.000 0.184 0.216 0.600
#> SRR868810     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868811     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868812     4  0.3141     0.7968 0.000 0.000 0.000 0.788 0.200 0.012
#> SRR868813     5  0.3841     0.2739 0.380 0.000 0.000 0.004 0.616 0.000
#> SRR868814     5  0.3695     0.0805 0.000 0.000 0.000 0.376 0.624 0.000
#> SRR868815     5  0.5368    -0.1158 0.000 0.000 0.000 0.376 0.508 0.116
#> SRR868816     3  0.0000     0.9834 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000     0.9834 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000     0.9834 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     1  0.0713     0.7513 0.972 0.028 0.000 0.000 0.000 0.000
#> SRR868820     1  0.1757     0.7655 0.916 0.000 0.000 0.008 0.076 0.000
#> SRR868821     1  0.1757     0.7655 0.916 0.000 0.000 0.008 0.076 0.000
#> SRR868822     6  0.5186     0.7764 0.000 0.000 0.000 0.168 0.216 0.616
#> SRR868824     3  0.1151     0.9750 0.000 0.000 0.956 0.032 0.000 0.012
#> SRR868823     6  0.0363     0.5351 0.000 0.000 0.000 0.000 0.012 0.988
#> SRR868825     6  0.5186     0.7764 0.000 0.000 0.000 0.168 0.216 0.616
#> SRR868826     3  0.0000     0.9834 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868827     5  0.5530    -0.3570 0.000 0.000 0.000 0.220 0.560 0.220
#> SRR868835     5  0.0547     0.6517 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868836     5  0.0547     0.6517 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868837     5  0.0547     0.6517 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868838     6  0.0363     0.5351 0.000 0.000 0.000 0.000 0.012 0.988
#> SRR868839     1  0.1434     0.7508 0.940 0.048 0.000 0.000 0.012 0.000
#> SRR868840     5  0.0547     0.6517 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868841     5  0.0547     0.6517 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868842     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868843     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868844     3  0.0000     0.9834 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868845     1  0.2912     0.7494 0.784 0.000 0.000 0.000 0.216 0.000
#> SRR868846     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868847     5  0.0547     0.6517 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868848     5  0.0547     0.6517 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868849     1  0.3547     0.4627 0.668 0.332 0.000 0.000 0.000 0.000
#> SRR868850     1  0.3373     0.7256 0.744 0.000 0.000 0.008 0.248 0.000
#> SRR868851     1  0.2933     0.7515 0.796 0.000 0.000 0.004 0.200 0.000
#> SRR868852     1  0.1434     0.7508 0.940 0.048 0.000 0.000 0.012 0.000
#> SRR868853     1  0.1434     0.7508 0.940 0.048 0.000 0.000 0.012 0.000
#> SRR868855     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868856     1  0.2491     0.6754 0.836 0.164 0.000 0.000 0.000 0.000
#> SRR868857     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868858     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868874     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868875     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868878     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868880     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868881     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     2  0.3578     0.4651 0.340 0.660 0.000 0.000 0.000 0.000
#> SRR868885     2  0.2092     0.8217 0.124 0.876 0.000 0.000 0.000 0.000
#> SRR868829     4  0.3171     0.7975 0.000 0.000 0.000 0.784 0.204 0.012
#> SRR868830     4  0.3737     0.6496 0.000 0.000 0.000 0.608 0.392 0.000
#> SRR868831     3  0.1151     0.9750 0.000 0.000 0.956 0.032 0.000 0.012
#> SRR868828     3  0.0000     0.9834 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868832     3  0.1151     0.9750 0.000 0.000 0.956 0.032 0.000 0.012
#> SRR868833     3  0.1151     0.9750 0.000 0.000 0.956 0.032 0.000 0.012
#> SRR868834     5  0.0547     0.6517 0.020 0.000 0.000 0.000 0.980 0.000
#> SRR868854     1  0.2584     0.7636 0.848 0.004 0.000 0.004 0.144 0.000
#> SRR868859     1  0.2491     0.6754 0.836 0.164 0.000 0.000 0.000 0.000
#> SRR868860     1  0.3050     0.6208 0.764 0.236 0.000 0.000 0.000 0.000
#> SRR868861     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868862     1  0.1151     0.7543 0.956 0.032 0.000 0.000 0.012 0.000
#> SRR868863     1  0.2491     0.6754 0.836 0.164 0.000 0.000 0.000 0.000
#> SRR868864     5  0.3534     0.4549 0.276 0.000 0.000 0.008 0.716 0.000
#> SRR868865     1  0.3547     0.4627 0.668 0.332 0.000 0.000 0.000 0.000
#> SRR868866     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868867     1  0.1151     0.7543 0.956 0.032 0.000 0.000 0.012 0.000
#> SRR868868     1  0.3271     0.7433 0.760 0.000 0.000 0.008 0.232 0.000
#> SRR868869     6  0.5186     0.7764 0.000 0.000 0.000 0.168 0.216 0.616
#> SRR868870     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868871     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868872     2  0.0000     0.9647 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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 15961 rows and 80 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 0.811           0.903       0.956         0.4512 0.525   0.525
#> 3 3 1.000           0.985       0.995         0.3527 0.624   0.417
#> 4 4 0.815           0.884       0.940         0.2005 0.778   0.490
#> 5 5 0.828           0.874       0.908         0.0716 0.845   0.498
#> 6 6 0.856           0.735       0.815         0.0430 0.976   0.889

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

suggest_best_k(res)
#> [1] 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
#> SRR868806     2   0.430      0.890 0.088 0.912
#> SRR868807     1   0.000      0.888 1.000 0.000
#> SRR868808     2   0.430      0.890 0.088 0.912
#> SRR868809     1   0.000      0.888 1.000 0.000
#> SRR868810     2   0.000      0.989 0.000 1.000
#> SRR868811     2   0.000      0.989 0.000 1.000
#> SRR868812     1   0.000      0.888 1.000 0.000
#> SRR868813     2   0.430      0.890 0.088 0.912
#> SRR868814     1   0.978      0.441 0.588 0.412
#> SRR868815     1   0.000      0.888 1.000 0.000
#> SRR868816     1   0.000      0.888 1.000 0.000
#> SRR868817     1   0.000      0.888 1.000 0.000
#> SRR868818     1   0.000      0.888 1.000 0.000
#> SRR868819     2   0.000      0.989 0.000 1.000
#> SRR868820     2   0.000      0.989 0.000 1.000
#> SRR868821     2   0.000      0.989 0.000 1.000
#> SRR868822     1   0.000      0.888 1.000 0.000
#> SRR868824     1   0.000      0.888 1.000 0.000
#> SRR868823     1   0.000      0.888 1.000 0.000
#> SRR868825     1   0.000      0.888 1.000 0.000
#> SRR868826     1   0.000      0.888 1.000 0.000
#> SRR868827     1   0.000      0.888 1.000 0.000
#> SRR868835     1   0.978      0.441 0.588 0.412
#> SRR868836     1   0.978      0.441 0.588 0.412
#> SRR868837     1   0.978      0.441 0.588 0.412
#> SRR868838     1   0.000      0.888 1.000 0.000
#> SRR868839     2   0.000      0.989 0.000 1.000
#> SRR868840     1   0.980      0.431 0.584 0.416
#> SRR868841     1   0.689      0.748 0.816 0.184
#> SRR868842     2   0.000      0.989 0.000 1.000
#> SRR868843     2   0.000      0.989 0.000 1.000
#> SRR868844     1   0.000      0.888 1.000 0.000
#> SRR868845     2   0.000      0.989 0.000 1.000
#> SRR868846     2   0.000      0.989 0.000 1.000
#> SRR868847     1   0.966      0.477 0.608 0.392
#> SRR868848     2   0.722      0.714 0.200 0.800
#> SRR868849     2   0.000      0.989 0.000 1.000
#> SRR868850     2   0.000      0.989 0.000 1.000
#> SRR868851     2   0.000      0.989 0.000 1.000
#> SRR868852     2   0.000      0.989 0.000 1.000
#> SRR868853     2   0.000      0.989 0.000 1.000
#> SRR868855     2   0.000      0.989 0.000 1.000
#> SRR868856     2   0.000      0.989 0.000 1.000
#> SRR868857     2   0.000      0.989 0.000 1.000
#> SRR868858     2   0.000      0.989 0.000 1.000
#> SRR868874     2   0.000      0.989 0.000 1.000
#> SRR868875     2   0.000      0.989 0.000 1.000
#> SRR868876     2   0.000      0.989 0.000 1.000
#> SRR868877     2   0.000      0.989 0.000 1.000
#> SRR868878     2   0.000      0.989 0.000 1.000
#> SRR868879     2   0.000      0.989 0.000 1.000
#> SRR868880     2   0.000      0.989 0.000 1.000
#> SRR868881     2   0.000      0.989 0.000 1.000
#> SRR868882     2   0.000      0.989 0.000 1.000
#> SRR868883     2   0.000      0.989 0.000 1.000
#> SRR868884     2   0.000      0.989 0.000 1.000
#> SRR868885     2   0.000      0.989 0.000 1.000
#> SRR868829     1   0.000      0.888 1.000 0.000
#> SRR868830     1   0.000      0.888 1.000 0.000
#> SRR868831     1   0.000      0.888 1.000 0.000
#> SRR868828     1   0.000      0.888 1.000 0.000
#> SRR868832     1   0.000      0.888 1.000 0.000
#> SRR868833     1   0.000      0.888 1.000 0.000
#> SRR868834     1   0.978      0.441 0.588 0.412
#> SRR868854     2   0.000      0.989 0.000 1.000
#> SRR868859     2   0.000      0.989 0.000 1.000
#> SRR868860     2   0.000      0.989 0.000 1.000
#> SRR868861     2   0.000      0.989 0.000 1.000
#> SRR868862     2   0.000      0.989 0.000 1.000
#> SRR868863     2   0.000      0.989 0.000 1.000
#> SRR868864     2   0.000      0.989 0.000 1.000
#> SRR868865     2   0.000      0.989 0.000 1.000
#> SRR868866     2   0.000      0.989 0.000 1.000
#> SRR868867     2   0.000      0.989 0.000 1.000
#> SRR868868     2   0.000      0.989 0.000 1.000
#> SRR868869     1   0.000      0.888 1.000 0.000
#> SRR868870     2   0.000      0.989 0.000 1.000
#> SRR868871     2   0.000      0.989 0.000 1.000
#> SRR868873     2   0.000      0.989 0.000 1.000
#> SRR868872     2   0.000      0.989 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> SRR868806     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868807     1  0.0237      0.995 0.996 0.000 0.004
#> SRR868808     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868809     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868810     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868811     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868812     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868813     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868814     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868815     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868816     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868817     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868818     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868819     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868820     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868821     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868822     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868824     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868823     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868825     1  0.0237      0.995 0.996 0.000 0.004
#> SRR868826     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868827     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868835     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868836     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868837     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868838     1  0.0237      0.995 0.996 0.000 0.004
#> SRR868839     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868840     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868841     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868842     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868843     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868844     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868845     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868846     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868847     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868848     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868849     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868850     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868851     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868852     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868853     2  0.5948      0.439 0.360 0.640 0.000
#> SRR868855     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868856     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868857     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868858     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868874     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868875     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868876     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868877     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868878     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868879     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868880     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868881     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868882     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868883     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868884     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868885     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868829     1  0.2165      0.932 0.936 0.000 0.064
#> SRR868830     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868831     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868828     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868832     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868833     3  0.0000      1.000 0.000 0.000 1.000
#> SRR868834     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868854     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868859     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868860     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868861     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868862     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868863     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868864     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868865     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868866     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868867     2  0.0237      0.979 0.004 0.996 0.000
#> SRR868868     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868869     1  0.0000      0.998 1.000 0.000 0.000
#> SRR868870     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868871     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868873     2  0.0000      0.984 0.000 1.000 0.000
#> SRR868872     2  0.0000      0.984 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.4941      0.445 0.564 0.000 0.000 0.436
#> SRR868807     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868808     1  0.4941      0.445 0.564 0.000 0.000 0.436
#> SRR868809     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868810     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868811     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868812     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868813     1  0.4925      0.463 0.572 0.000 0.000 0.428
#> SRR868814     1  0.2281      0.842 0.904 0.000 0.000 0.096
#> SRR868815     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868816     3  0.0336      0.955 0.000 0.000 0.992 0.008
#> SRR868817     3  0.0336      0.955 0.000 0.000 0.992 0.008
#> SRR868818     3  0.0336      0.955 0.000 0.000 0.992 0.008
#> SRR868819     4  0.3219      0.811 0.000 0.164 0.000 0.836
#> SRR868820     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868821     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868822     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868824     3  0.0000      0.957 0.000 0.000 1.000 0.000
#> SRR868823     3  0.4941      0.348 0.436 0.000 0.564 0.000
#> SRR868825     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868826     3  0.0000      0.957 0.000 0.000 1.000 0.000
#> SRR868827     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868835     1  0.2921      0.834 0.860 0.000 0.000 0.140
#> SRR868836     1  0.3569      0.811 0.804 0.000 0.000 0.196
#> SRR868837     1  0.3569      0.811 0.804 0.000 0.000 0.196
#> SRR868838     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868839     4  0.2149      0.886 0.000 0.088 0.000 0.912
#> SRR868840     1  0.3569      0.811 0.804 0.000 0.000 0.196
#> SRR868841     1  0.1118      0.849 0.964 0.000 0.000 0.036
#> SRR868842     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868843     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868844     3  0.0000      0.957 0.000 0.000 1.000 0.000
#> SRR868845     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868846     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868847     1  0.2921      0.834 0.860 0.000 0.000 0.140
#> SRR868848     1  0.3801      0.793 0.780 0.000 0.000 0.220
#> SRR868849     2  0.3219      0.799 0.000 0.836 0.000 0.164
#> SRR868850     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868851     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868852     4  0.2216      0.883 0.000 0.092 0.000 0.908
#> SRR868853     4  0.0336      0.936 0.000 0.008 0.000 0.992
#> SRR868855     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868856     4  0.3801      0.736 0.000 0.220 0.000 0.780
#> SRR868857     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868858     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868874     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868875     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868876     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868877     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868878     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868879     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868880     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868881     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868882     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868884     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868829     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868830     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868831     3  0.0000      0.957 0.000 0.000 1.000 0.000
#> SRR868828     3  0.0000      0.957 0.000 0.000 1.000 0.000
#> SRR868832     3  0.0000      0.957 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000      0.957 0.000 0.000 1.000 0.000
#> SRR868834     1  0.3569      0.811 0.804 0.000 0.000 0.196
#> SRR868854     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868859     4  0.2469      0.868 0.000 0.108 0.000 0.892
#> SRR868860     2  0.3219      0.799 0.000 0.836 0.000 0.164
#> SRR868861     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868862     4  0.1389      0.913 0.000 0.048 0.000 0.952
#> SRR868863     4  0.3801      0.736 0.000 0.220 0.000 0.780
#> SRR868864     4  0.3311      0.717 0.172 0.000 0.000 0.828
#> SRR868865     2  0.0707      0.960 0.000 0.980 0.000 0.020
#> SRR868866     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868867     4  0.0336      0.936 0.000 0.008 0.000 0.992
#> SRR868868     4  0.0336      0.940 0.008 0.000 0.000 0.992
#> SRR868869     1  0.0000      0.850 1.000 0.000 0.000 0.000
#> SRR868870     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868871     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868873     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> SRR868872     2  0.0000      0.979 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.2378      0.839 0.904 0.000 0.000 0.048 0.048
#> SRR868807     5  0.0404      0.983 0.012 0.000 0.000 0.000 0.988
#> SRR868808     1  0.2376      0.840 0.904 0.000 0.000 0.044 0.052
#> SRR868809     5  0.0579      0.979 0.008 0.000 0.000 0.008 0.984
#> SRR868810     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868811     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868812     5  0.0798      0.976 0.016 0.000 0.000 0.008 0.976
#> SRR868813     1  0.2359      0.841 0.904 0.000 0.000 0.036 0.060
#> SRR868814     1  0.3010      0.786 0.824 0.000 0.000 0.004 0.172
#> SRR868815     5  0.0566      0.982 0.012 0.000 0.000 0.004 0.984
#> SRR868816     3  0.1059      0.970 0.008 0.000 0.968 0.020 0.004
#> SRR868817     3  0.0992      0.970 0.008 0.000 0.968 0.024 0.000
#> SRR868818     3  0.0992      0.970 0.008 0.000 0.968 0.024 0.000
#> SRR868819     4  0.2659      0.824 0.052 0.060 0.000 0.888 0.000
#> SRR868820     4  0.3932      0.614 0.328 0.000 0.000 0.672 0.000
#> SRR868821     4  0.3932      0.614 0.328 0.000 0.000 0.672 0.000
#> SRR868822     5  0.0510      0.982 0.016 0.000 0.000 0.000 0.984
#> SRR868824     3  0.1493      0.970 0.028 0.000 0.948 0.024 0.000
#> SRR868823     5  0.2388      0.884 0.028 0.000 0.072 0.000 0.900
#> SRR868825     5  0.0404      0.983 0.012 0.000 0.000 0.000 0.988
#> SRR868826     3  0.0324      0.975 0.004 0.000 0.992 0.004 0.000
#> SRR868827     5  0.0510      0.982 0.016 0.000 0.000 0.000 0.984
#> SRR868835     1  0.2929      0.786 0.820 0.000 0.000 0.000 0.180
#> SRR868836     1  0.2536      0.831 0.868 0.000 0.000 0.004 0.128
#> SRR868837     1  0.2536      0.831 0.868 0.000 0.000 0.004 0.128
#> SRR868838     5  0.0404      0.983 0.012 0.000 0.000 0.000 0.988
#> SRR868839     4  0.2054      0.859 0.052 0.028 0.000 0.920 0.000
#> SRR868840     1  0.2536      0.831 0.868 0.000 0.000 0.004 0.128
#> SRR868841     1  0.3074      0.765 0.804 0.000 0.000 0.000 0.196
#> SRR868842     1  0.3003      0.758 0.812 0.000 0.000 0.188 0.000
#> SRR868843     1  0.3242      0.729 0.784 0.000 0.000 0.216 0.000
#> SRR868844     3  0.0324      0.975 0.004 0.000 0.992 0.004 0.000
#> SRR868845     4  0.2230      0.848 0.116 0.000 0.000 0.884 0.000
#> SRR868846     1  0.3949      0.547 0.668 0.000 0.000 0.332 0.000
#> SRR868847     1  0.2929      0.786 0.820 0.000 0.000 0.000 0.180
#> SRR868848     1  0.2068      0.840 0.904 0.000 0.000 0.004 0.092
#> SRR868849     4  0.3508      0.666 0.000 0.252 0.000 0.748 0.000
#> SRR868850     1  0.2127      0.811 0.892 0.000 0.000 0.108 0.000
#> SRR868851     4  0.2230      0.848 0.116 0.000 0.000 0.884 0.000
#> SRR868852     4  0.2054      0.859 0.052 0.028 0.000 0.920 0.000
#> SRR868853     4  0.1952      0.856 0.084 0.004 0.000 0.912 0.000
#> SRR868855     4  0.2852      0.808 0.172 0.000 0.000 0.828 0.000
#> SRR868856     4  0.1792      0.833 0.000 0.084 0.000 0.916 0.000
#> SRR868857     4  0.2852      0.808 0.172 0.000 0.000 0.828 0.000
#> SRR868858     4  0.2852      0.808 0.172 0.000 0.000 0.828 0.000
#> SRR868874     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868875     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868877     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868878     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868879     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868880     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868881     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868882     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868884     2  0.2891      0.779 0.000 0.824 0.000 0.176 0.000
#> SRR868885     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868829     5  0.0451      0.980 0.004 0.000 0.000 0.008 0.988
#> SRR868830     5  0.0798      0.976 0.016 0.000 0.000 0.008 0.976
#> SRR868831     3  0.1493      0.970 0.028 0.000 0.948 0.024 0.000
#> SRR868828     3  0.0324      0.975 0.004 0.000 0.992 0.004 0.000
#> SRR868832     3  0.1493      0.970 0.028 0.000 0.948 0.024 0.000
#> SRR868833     3  0.1493      0.970 0.028 0.000 0.948 0.024 0.000
#> SRR868834     1  0.2536      0.831 0.868 0.000 0.000 0.004 0.128
#> SRR868854     4  0.2230      0.848 0.116 0.000 0.000 0.884 0.000
#> SRR868859     4  0.2054      0.859 0.052 0.028 0.000 0.920 0.000
#> SRR868860     4  0.3508      0.666 0.000 0.252 0.000 0.748 0.000
#> SRR868861     1  0.4060      0.481 0.640 0.000 0.000 0.360 0.000
#> SRR868862     4  0.1981      0.859 0.064 0.016 0.000 0.920 0.000
#> SRR868863     4  0.1792      0.833 0.000 0.084 0.000 0.916 0.000
#> SRR868864     1  0.2351      0.823 0.896 0.000 0.000 0.088 0.016
#> SRR868865     4  0.3876      0.556 0.000 0.316 0.000 0.684 0.000
#> SRR868866     1  0.2966      0.760 0.816 0.000 0.000 0.184 0.000
#> SRR868867     4  0.1892      0.857 0.080 0.004 0.000 0.916 0.000
#> SRR868868     1  0.4060      0.481 0.640 0.000 0.000 0.360 0.000
#> SRR868869     5  0.0404      0.983 0.012 0.000 0.000 0.000 0.988
#> SRR868870     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868871     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868873     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000
#> SRR868872     2  0.0000      0.989 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5 p6
#> SRR868806     1  0.4468      0.706 0.604 0.000 0.000 0.008 0.024 NA
#> SRR868807     5  0.0458      0.938 0.000 0.000 0.000 0.000 0.984 NA
#> SRR868808     1  0.4474      0.691 0.560 0.000 0.000 0.004 0.024 NA
#> SRR868809     5  0.2491      0.907 0.000 0.000 0.000 0.000 0.836 NA
#> SRR868810     2  0.0937      0.947 0.000 0.960 0.000 0.000 0.000 NA
#> SRR868811     2  0.1141      0.944 0.000 0.948 0.000 0.000 0.000 NA
#> SRR868812     5  0.2778      0.901 0.008 0.000 0.000 0.000 0.824 NA
#> SRR868813     1  0.4410      0.690 0.560 0.000 0.000 0.000 0.028 NA
#> SRR868814     1  0.4829      0.673 0.520 0.000 0.000 0.000 0.056 NA
#> SRR868815     5  0.0865      0.938 0.000 0.000 0.000 0.000 0.964 NA
#> SRR868816     3  0.0767      0.957 0.004 0.000 0.976 0.008 0.000 NA
#> SRR868817     3  0.0767      0.957 0.004 0.000 0.976 0.008 0.000 NA
#> SRR868818     3  0.0767      0.957 0.004 0.000 0.976 0.008 0.000 NA
#> SRR868819     4  0.3535      0.585 0.008 0.012 0.000 0.760 0.000 NA
#> SRR868820     1  0.5979     -0.432 0.424 0.000 0.000 0.340 0.000 NA
#> SRR868821     1  0.5979     -0.432 0.424 0.000 0.000 0.340 0.000 NA
#> SRR868822     5  0.0146      0.940 0.000 0.000 0.000 0.000 0.996 NA
#> SRR868824     3  0.1908      0.945 0.000 0.000 0.900 0.004 0.000 NA
#> SRR868823     5  0.1480      0.915 0.000 0.000 0.020 0.000 0.940 NA
#> SRR868825     5  0.0458      0.938 0.000 0.000 0.000 0.000 0.984 NA
#> SRR868826     3  0.0458      0.958 0.000 0.000 0.984 0.000 0.000 NA
#> SRR868827     5  0.1765      0.928 0.000 0.000 0.000 0.000 0.904 NA
#> SRR868835     1  0.4876      0.697 0.564 0.000 0.000 0.000 0.068 NA
#> SRR868836     1  0.4818      0.701 0.572 0.000 0.000 0.000 0.064 NA
#> SRR868837     1  0.4818      0.701 0.572 0.000 0.000 0.000 0.064 NA
#> SRR868838     5  0.0632      0.936 0.000 0.000 0.000 0.000 0.976 NA
#> SRR868839     4  0.0862      0.712 0.016 0.008 0.000 0.972 0.000 NA
#> SRR868840     1  0.4818      0.701 0.572 0.000 0.000 0.000 0.064 NA
#> SRR868841     1  0.4964      0.683 0.540 0.000 0.000 0.000 0.072 NA
#> SRR868842     1  0.1714      0.380 0.908 0.000 0.000 0.092 0.000 NA
#> SRR868843     1  0.2048      0.338 0.880 0.000 0.000 0.120 0.000 NA
#> SRR868844     3  0.0458      0.958 0.000 0.000 0.984 0.000 0.000 NA
#> SRR868845     4  0.4269      0.633 0.412 0.000 0.000 0.568 0.000 NA
#> SRR868846     1  0.3023      0.149 0.784 0.000 0.000 0.212 0.000 NA
#> SRR868847     1  0.4913      0.696 0.564 0.000 0.000 0.000 0.072 NA
#> SRR868848     1  0.4367      0.707 0.604 0.000 0.000 0.000 0.032 NA
#> SRR868849     4  0.2404      0.646 0.000 0.112 0.000 0.872 0.000 NA
#> SRR868850     1  0.4092      0.695 0.636 0.000 0.000 0.020 0.000 NA
#> SRR868851     4  0.4276      0.631 0.416 0.000 0.000 0.564 0.000 NA
#> SRR868852     4  0.0862      0.712 0.016 0.008 0.000 0.972 0.000 NA
#> SRR868853     4  0.4168      0.639 0.400 0.000 0.000 0.584 0.000 NA
#> SRR868855     4  0.4256      0.584 0.464 0.000 0.000 0.520 0.000 NA
#> SRR868856     4  0.1262      0.712 0.008 0.016 0.000 0.956 0.000 NA
#> SRR868857     4  0.4325      0.593 0.456 0.000 0.000 0.524 0.000 NA
#> SRR868858     4  0.4256      0.584 0.464 0.000 0.000 0.520 0.000 NA
#> SRR868874     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868875     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868876     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868877     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868878     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868879     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868880     2  0.1141      0.944 0.000 0.948 0.000 0.000 0.000 NA
#> SRR868881     2  0.0937      0.947 0.000 0.960 0.000 0.000 0.000 NA
#> SRR868882     2  0.0937      0.947 0.000 0.960 0.000 0.000 0.000 NA
#> SRR868883     2  0.1141      0.944 0.000 0.948 0.000 0.000 0.000 NA
#> SRR868884     2  0.4787      0.328 0.000 0.516 0.000 0.432 0.000 NA
#> SRR868885     2  0.2618      0.884 0.000 0.872 0.000 0.076 0.000 NA
#> SRR868829     5  0.2135      0.919 0.000 0.000 0.000 0.000 0.872 NA
#> SRR868830     5  0.2814      0.900 0.008 0.000 0.000 0.000 0.820 NA
#> SRR868831     3  0.1908      0.945 0.000 0.000 0.900 0.004 0.000 NA
#> SRR868828     3  0.0547      0.958 0.000 0.000 0.980 0.000 0.000 NA
#> SRR868832     3  0.1908      0.945 0.000 0.000 0.900 0.004 0.000 NA
#> SRR868833     3  0.1908      0.945 0.000 0.000 0.900 0.004 0.000 NA
#> SRR868834     1  0.4818      0.701 0.572 0.000 0.000 0.000 0.064 NA
#> SRR868854     4  0.4276      0.631 0.416 0.000 0.000 0.564 0.000 NA
#> SRR868859     4  0.1262      0.712 0.016 0.008 0.000 0.956 0.000 NA
#> SRR868860     4  0.2450      0.643 0.000 0.116 0.000 0.868 0.000 NA
#> SRR868861     1  0.3421      0.026 0.736 0.000 0.000 0.256 0.000 NA
#> SRR868862     4  0.0837      0.711 0.020 0.004 0.000 0.972 0.000 NA
#> SRR868863     4  0.1262      0.712 0.008 0.016 0.000 0.956 0.000 NA
#> SRR868864     1  0.4155      0.700 0.616 0.000 0.000 0.020 0.000 NA
#> SRR868865     4  0.3771      0.521 0.000 0.180 0.000 0.764 0.000 NA
#> SRR868866     1  0.1970      0.375 0.900 0.000 0.000 0.092 0.000 NA
#> SRR868867     4  0.3945      0.645 0.380 0.000 0.000 0.612 0.000 NA
#> SRR868868     1  0.3421      0.026 0.736 0.000 0.000 0.256 0.000 NA
#> SRR868869     5  0.0146      0.940 0.000 0.000 0.000 0.000 0.996 NA
#> SRR868870     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868871     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868873     2  0.0713      0.949 0.000 0.972 0.000 0.000 0.000 NA
#> SRR868872     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000 NA

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

consensus_heatmap(res, k = 2)

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 15961 rows and 80 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.985       0.995         0.5001 0.502   0.502
#> 3 3 0.840           0.904       0.946         0.1686 0.913   0.828
#> 4 4 0.844           0.889       0.920         0.0965 0.919   0.809
#> 5 5 0.823           0.866       0.923         0.0633 0.977   0.935
#> 6 6 0.846           0.829       0.917         0.0479 0.959   0.874

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
#> SRR868806     1   0.000      1.000 1.000 0.000
#> SRR868807     1   0.000      1.000 1.000 0.000
#> SRR868808     1   0.000      1.000 1.000 0.000
#> SRR868809     1   0.000      1.000 1.000 0.000
#> SRR868810     2   0.000      0.990 0.000 1.000
#> SRR868811     2   0.000      0.990 0.000 1.000
#> SRR868812     1   0.000      1.000 1.000 0.000
#> SRR868813     1   0.000      1.000 1.000 0.000
#> SRR868814     1   0.000      1.000 1.000 0.000
#> SRR868815     1   0.000      1.000 1.000 0.000
#> SRR868816     1   0.000      1.000 1.000 0.000
#> SRR868817     1   0.000      1.000 1.000 0.000
#> SRR868818     1   0.000      1.000 1.000 0.000
#> SRR868819     2   0.000      0.990 0.000 1.000
#> SRR868820     2   0.000      0.990 0.000 1.000
#> SRR868821     2   0.000      0.990 0.000 1.000
#> SRR868822     1   0.000      1.000 1.000 0.000
#> SRR868824     1   0.000      1.000 1.000 0.000
#> SRR868823     1   0.000      1.000 1.000 0.000
#> SRR868825     1   0.000      1.000 1.000 0.000
#> SRR868826     1   0.000      1.000 1.000 0.000
#> SRR868827     1   0.000      1.000 1.000 0.000
#> SRR868835     1   0.000      1.000 1.000 0.000
#> SRR868836     1   0.000      1.000 1.000 0.000
#> SRR868837     1   0.000      1.000 1.000 0.000
#> SRR868838     1   0.000      1.000 1.000 0.000
#> SRR868839     2   0.000      0.990 0.000 1.000
#> SRR868840     1   0.000      1.000 1.000 0.000
#> SRR868841     1   0.000      1.000 1.000 0.000
#> SRR868842     2   0.000      0.990 0.000 1.000
#> SRR868843     2   0.000      0.990 0.000 1.000
#> SRR868844     1   0.000      1.000 1.000 0.000
#> SRR868845     2   0.000      0.990 0.000 1.000
#> SRR868846     2   0.000      0.990 0.000 1.000
#> SRR868847     1   0.000      1.000 1.000 0.000
#> SRR868848     1   0.000      1.000 1.000 0.000
#> SRR868849     2   0.000      0.990 0.000 1.000
#> SRR868850     2   0.987      0.239 0.432 0.568
#> SRR868851     2   0.000      0.990 0.000 1.000
#> SRR868852     2   0.000      0.990 0.000 1.000
#> SRR868853     2   0.000      0.990 0.000 1.000
#> SRR868855     2   0.000      0.990 0.000 1.000
#> SRR868856     2   0.000      0.990 0.000 1.000
#> SRR868857     2   0.000      0.990 0.000 1.000
#> SRR868858     2   0.000      0.990 0.000 1.000
#> SRR868874     2   0.000      0.990 0.000 1.000
#> SRR868875     2   0.000      0.990 0.000 1.000
#> SRR868876     2   0.000      0.990 0.000 1.000
#> SRR868877     2   0.000      0.990 0.000 1.000
#> SRR868878     2   0.000      0.990 0.000 1.000
#> SRR868879     2   0.000      0.990 0.000 1.000
#> SRR868880     2   0.000      0.990 0.000 1.000
#> SRR868881     2   0.000      0.990 0.000 1.000
#> SRR868882     2   0.000      0.990 0.000 1.000
#> SRR868883     2   0.000      0.990 0.000 1.000
#> SRR868884     2   0.000      0.990 0.000 1.000
#> SRR868885     2   0.000      0.990 0.000 1.000
#> SRR868829     1   0.000      1.000 1.000 0.000
#> SRR868830     1   0.000      1.000 1.000 0.000
#> SRR868831     1   0.000      1.000 1.000 0.000
#> SRR868828     1   0.000      1.000 1.000 0.000
#> SRR868832     1   0.000      1.000 1.000 0.000
#> SRR868833     1   0.000      1.000 1.000 0.000
#> SRR868834     1   0.000      1.000 1.000 0.000
#> SRR868854     2   0.000      0.990 0.000 1.000
#> SRR868859     2   0.000      0.990 0.000 1.000
#> SRR868860     2   0.000      0.990 0.000 1.000
#> SRR868861     2   0.000      0.990 0.000 1.000
#> SRR868862     2   0.000      0.990 0.000 1.000
#> SRR868863     2   0.000      0.990 0.000 1.000
#> SRR868864     1   0.000      1.000 1.000 0.000
#> SRR868865     2   0.000      0.990 0.000 1.000
#> SRR868866     2   0.000      0.990 0.000 1.000
#> SRR868867     2   0.000      0.990 0.000 1.000
#> SRR868868     2   0.000      0.990 0.000 1.000
#> SRR868869     1   0.000      1.000 1.000 0.000
#> SRR868870     2   0.000      0.990 0.000 1.000
#> SRR868871     2   0.000      0.990 0.000 1.000
#> SRR868873     2   0.000      0.990 0.000 1.000
#> SRR868872     2   0.000      0.990 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
#> SRR868806     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868807     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868808     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868809     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868810     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868811     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868812     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868813     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868814     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868815     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868816     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868817     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868818     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868819     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868820     2  0.1753      0.937 0.000 0.952 0.048
#> SRR868821     2  0.1753      0.937 0.000 0.952 0.048
#> SRR868822     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868824     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868823     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868825     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868826     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868827     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868835     1  0.5835      0.630 0.660 0.000 0.340
#> SRR868836     1  0.5835      0.630 0.660 0.000 0.340
#> SRR868837     1  0.5835      0.630 0.660 0.000 0.340
#> SRR868838     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868839     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868840     1  0.5835      0.630 0.660 0.000 0.340
#> SRR868841     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868842     3  0.4002      0.781 0.000 0.160 0.840
#> SRR868843     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868844     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868845     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868846     3  0.5968      0.654 0.000 0.364 0.636
#> SRR868847     1  0.5835      0.630 0.660 0.000 0.340
#> SRR868848     1  0.5835      0.630 0.660 0.000 0.340
#> SRR868849     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868850     3  0.3966      0.699 0.024 0.100 0.876
#> SRR868851     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868852     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868853     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868855     2  0.2537      0.888 0.000 0.920 0.080
#> SRR868856     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868857     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868858     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868874     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868875     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868876     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868877     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868878     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868879     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868880     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868881     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868882     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868883     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868884     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868885     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868829     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868830     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868831     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868828     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868832     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868833     1  0.0000      0.924 1.000 0.000 0.000
#> SRR868834     1  0.5835      0.630 0.660 0.000 0.340
#> SRR868854     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868859     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868860     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868861     3  0.5835      0.687 0.000 0.340 0.660
#> SRR868862     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868863     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868864     3  0.4452      0.452 0.192 0.000 0.808
#> SRR868865     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868866     3  0.3686      0.780 0.000 0.140 0.860
#> SRR868867     2  0.3267      0.833 0.000 0.884 0.116
#> SRR868868     3  0.5835      0.687 0.000 0.340 0.660
#> SRR868869     1  0.0892      0.911 0.980 0.000 0.020
#> SRR868870     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868871     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868873     2  0.0000      0.990 0.000 1.000 0.000
#> SRR868872     2  0.0000      0.990 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     3  0.5865      0.484 0.340 0.000 0.612 0.048
#> SRR868807     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868808     3  0.5882      0.479 0.344 0.000 0.608 0.048
#> SRR868809     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868810     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868811     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868812     3  0.4182      0.708 0.180 0.000 0.796 0.024
#> SRR868813     3  0.5865      0.484 0.340 0.000 0.612 0.048
#> SRR868814     3  0.3791      0.704 0.200 0.000 0.796 0.004
#> SRR868815     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868816     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868819     2  0.0376      0.975 0.004 0.992 0.000 0.004
#> SRR868820     2  0.5174      0.676 0.092 0.756 0.000 0.152
#> SRR868821     2  0.5128      0.682 0.092 0.760 0.000 0.148
#> SRR868822     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868824     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868823     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868825     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868826     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868827     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868835     1  0.4790      0.891 0.620 0.000 0.380 0.000
#> SRR868836     1  0.4776      0.896 0.624 0.000 0.376 0.000
#> SRR868837     1  0.4776      0.896 0.624 0.000 0.376 0.000
#> SRR868838     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868839     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868840     1  0.4776      0.896 0.624 0.000 0.376 0.000
#> SRR868841     3  0.2647      0.715 0.120 0.000 0.880 0.000
#> SRR868842     4  0.2844      0.847 0.052 0.048 0.000 0.900
#> SRR868843     2  0.2413      0.900 0.064 0.916 0.000 0.020
#> SRR868844     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868845     2  0.0188      0.980 0.004 0.996 0.000 0.000
#> SRR868846     4  0.2647      0.833 0.000 0.120 0.000 0.880
#> SRR868847     1  0.4746      0.898 0.632 0.000 0.368 0.000
#> SRR868848     1  0.4730      0.896 0.636 0.000 0.364 0.000
#> SRR868849     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868850     1  0.5716      0.275 0.740 0.136 0.012 0.112
#> SRR868851     2  0.0188      0.980 0.004 0.996 0.000 0.000
#> SRR868852     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868853     2  0.0188      0.980 0.004 0.996 0.000 0.000
#> SRR868855     2  0.1109      0.953 0.004 0.968 0.000 0.028
#> SRR868856     2  0.0188      0.980 0.004 0.996 0.000 0.000
#> SRR868857     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868858     2  0.0188      0.980 0.004 0.996 0.000 0.000
#> SRR868874     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868875     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868876     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868877     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868878     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868879     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868880     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868881     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868882     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868883     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868884     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868885     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868829     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868830     3  0.2469      0.803 0.108 0.000 0.892 0.000
#> SRR868831     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868828     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868832     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868834     1  0.4746      0.898 0.632 0.000 0.368 0.000
#> SRR868854     2  0.0188      0.980 0.004 0.996 0.000 0.000
#> SRR868859     2  0.0188      0.980 0.004 0.996 0.000 0.000
#> SRR868860     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868861     4  0.1557      0.867 0.000 0.056 0.000 0.944
#> SRR868862     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868863     2  0.0188      0.980 0.004 0.996 0.000 0.000
#> SRR868864     1  0.5837      0.789 0.668 0.000 0.260 0.072
#> SRR868865     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868866     4  0.1837      0.839 0.028 0.028 0.000 0.944
#> SRR868867     4  0.4564      0.588 0.000 0.328 0.000 0.672
#> SRR868868     4  0.1557      0.867 0.000 0.056 0.000 0.944
#> SRR868869     3  0.0000      0.901 0.000 0.000 1.000 0.000
#> SRR868870     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868871     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868873     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> SRR868872     2  0.0000      0.981 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     5  0.3949      0.944 0.004 0.000 0.300 0.000 0.696
#> SRR868807     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868808     5  0.3942      0.956 0.012 0.000 0.260 0.000 0.728
#> SRR868809     3  0.0162      0.944 0.000 0.000 0.996 0.000 0.004
#> SRR868810     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868811     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868812     3  0.4171     -0.131 0.000 0.000 0.604 0.000 0.396
#> SRR868813     5  0.4016      0.965 0.012 0.000 0.272 0.000 0.716
#> SRR868814     3  0.3366      0.581 0.004 0.000 0.784 0.000 0.212
#> SRR868815     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868816     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868819     2  0.2536      0.861 0.044 0.900 0.000 0.004 0.052
#> SRR868820     2  0.6562      0.136 0.056 0.480 0.000 0.064 0.400
#> SRR868821     2  0.6516      0.137 0.056 0.480 0.000 0.060 0.404
#> SRR868822     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868824     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868823     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868825     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868826     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868827     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868835     1  0.3521      0.846 0.764 0.000 0.232 0.000 0.004
#> SRR868836     1  0.2891      0.927 0.824 0.000 0.176 0.000 0.000
#> SRR868837     1  0.2852      0.928 0.828 0.000 0.172 0.000 0.000
#> SRR868838     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868839     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868840     1  0.2813      0.926 0.832 0.000 0.168 0.000 0.000
#> SRR868841     3  0.2424      0.750 0.132 0.000 0.868 0.000 0.000
#> SRR868842     4  0.4378      0.756 0.088 0.032 0.000 0.800 0.080
#> SRR868843     2  0.5476      0.526 0.088 0.632 0.000 0.004 0.276
#> SRR868844     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868845     2  0.2795      0.865 0.064 0.880 0.000 0.000 0.056
#> SRR868846     4  0.3767      0.731 0.032 0.132 0.000 0.820 0.016
#> SRR868847     1  0.2891      0.927 0.824 0.000 0.176 0.000 0.000
#> SRR868848     1  0.2852      0.928 0.828 0.000 0.172 0.000 0.000
#> SRR868849     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868850     1  0.2906      0.652 0.880 0.012 0.000 0.028 0.080
#> SRR868851     2  0.2520      0.876 0.056 0.896 0.000 0.000 0.048
#> SRR868852     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868853     2  0.0912      0.924 0.012 0.972 0.000 0.000 0.016
#> SRR868855     2  0.3501      0.840 0.056 0.856 0.000 0.028 0.060
#> SRR868856     2  0.1750      0.904 0.028 0.936 0.000 0.000 0.036
#> SRR868857     2  0.0579      0.929 0.008 0.984 0.000 0.000 0.008
#> SRR868858     2  0.2922      0.857 0.072 0.872 0.000 0.000 0.056
#> SRR868874     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868875     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868877     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868878     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868879     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868880     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868881     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868882     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868884     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868885     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868829     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868830     3  0.1410      0.871 0.000 0.000 0.940 0.000 0.060
#> SRR868831     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868828     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868832     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868833     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868834     1  0.2852      0.928 0.828 0.000 0.172 0.000 0.000
#> SRR868854     2  0.2153      0.890 0.044 0.916 0.000 0.000 0.040
#> SRR868859     2  0.1493      0.911 0.028 0.948 0.000 0.000 0.024
#> SRR868860     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868861     4  0.0000      0.799 0.000 0.000 0.000 1.000 0.000
#> SRR868862     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868863     2  0.1211      0.918 0.016 0.960 0.000 0.000 0.024
#> SRR868864     1  0.2561      0.852 0.884 0.000 0.096 0.020 0.000
#> SRR868865     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868866     4  0.0000      0.799 0.000 0.000 0.000 1.000 0.000
#> SRR868867     4  0.3752      0.530 0.000 0.292 0.000 0.708 0.000
#> SRR868868     4  0.0000      0.799 0.000 0.000 0.000 1.000 0.000
#> SRR868869     3  0.0000      0.949 0.000 0.000 1.000 0.000 0.000
#> SRR868870     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868871     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868873     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000
#> SRR868872     2  0.0000      0.937 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     4  0.2070     0.7456 0.000 0.000 0.100 0.892 0.000 0.008
#> SRR868807     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868808     4  0.1745     0.7310 0.000 0.000 0.068 0.920 0.000 0.012
#> SRR868809     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868810     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868811     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868812     4  0.3843     0.2965 0.000 0.000 0.452 0.548 0.000 0.000
#> SRR868813     4  0.1556     0.7467 0.000 0.000 0.080 0.920 0.000 0.000
#> SRR868814     3  0.3431     0.6100 0.000 0.000 0.756 0.228 0.000 0.016
#> SRR868815     3  0.0260     0.9669 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868816     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868817     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     2  0.3954     0.0411 0.000 0.636 0.000 0.012 0.000 0.352
#> SRR868820     6  0.5521     0.7303 0.024 0.252 0.000 0.116 0.000 0.608
#> SRR868821     6  0.5521     0.7303 0.024 0.252 0.000 0.116 0.000 0.608
#> SRR868822     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868824     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868823     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868825     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868826     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868827     3  0.0146     0.9695 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR868835     5  0.2902     0.7711 0.000 0.000 0.196 0.000 0.800 0.004
#> SRR868836     5  0.1918     0.9006 0.000 0.000 0.088 0.000 0.904 0.008
#> SRR868837     5  0.1806     0.9005 0.000 0.000 0.088 0.000 0.908 0.004
#> SRR868838     3  0.0260     0.9669 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR868839     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868840     5  0.2019     0.8996 0.000 0.000 0.088 0.000 0.900 0.012
#> SRR868841     3  0.2692     0.7605 0.000 0.000 0.840 0.000 0.148 0.012
#> SRR868842     1  0.5716     0.6281 0.652 0.028 0.000 0.020 0.132 0.168
#> SRR868843     6  0.4993     0.4755 0.000 0.324 0.000 0.044 0.024 0.608
#> SRR868844     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868845     2  0.4856     0.3940 0.000 0.656 0.000 0.036 0.036 0.272
#> SRR868846     1  0.4783     0.6500 0.744 0.104 0.000 0.020 0.020 0.112
#> SRR868847     5  0.2003     0.8822 0.000 0.000 0.116 0.000 0.884 0.000
#> SRR868848     5  0.1714     0.8959 0.000 0.000 0.092 0.000 0.908 0.000
#> SRR868849     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868850     5  0.4822     0.4556 0.004 0.000 0.000 0.072 0.628 0.296
#> SRR868851     2  0.3960     0.5868 0.000 0.736 0.000 0.008 0.032 0.224
#> SRR868852     2  0.0146     0.9112 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR868853     2  0.0937     0.8861 0.000 0.960 0.000 0.000 0.000 0.040
#> SRR868855     2  0.5287     0.4655 0.060 0.680 0.000 0.028 0.024 0.208
#> SRR868856     2  0.2110     0.8310 0.000 0.900 0.000 0.004 0.012 0.084
#> SRR868857     2  0.2114     0.8171 0.000 0.904 0.000 0.008 0.012 0.076
#> SRR868858     2  0.4395     0.4621 0.000 0.676 0.000 0.016 0.028 0.280
#> SRR868874     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868875     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868878     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868880     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868881     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868885     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868829     3  0.0146     0.9695 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR868830     3  0.1531     0.8947 0.000 0.000 0.928 0.068 0.000 0.004
#> SRR868831     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868828     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868832     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868833     3  0.0000     0.9717 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868834     5  0.1918     0.9006 0.000 0.000 0.088 0.000 0.904 0.008
#> SRR868854     2  0.2766     0.7763 0.000 0.852 0.000 0.004 0.020 0.124
#> SRR868859     2  0.1946     0.8431 0.000 0.912 0.000 0.004 0.012 0.072
#> SRR868860     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868861     1  0.0000     0.7666 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868862     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868863     2  0.1524     0.8610 0.000 0.932 0.000 0.000 0.008 0.060
#> SRR868864     5  0.1440     0.8394 0.004 0.000 0.032 0.004 0.948 0.012
#> SRR868865     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868866     1  0.0000     0.7666 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868867     1  0.3330     0.2897 0.716 0.284 0.000 0.000 0.000 0.000
#> SRR868868     1  0.0000     0.7666 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868869     3  0.0146     0.9684 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR868870     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868871     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868872     2  0.0000     0.9139 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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 15961 rows and 80 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 1.000           0.987       0.993         0.3594 0.633   0.633
#> 3 3 1.000           1.000       1.000         0.6802 0.596   0.437
#> 4 4 0.988           0.969       0.987         0.2187 0.772   0.487
#> 5 5 0.841           0.825       0.887         0.0679 0.939   0.777
#> 6 6 0.894           0.869       0.919         0.0540 0.903   0.603

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
#> SRR868806     2   0.000      1.000 0.00 1.00
#> SRR868807     1   0.141      0.965 0.98 0.02
#> SRR868808     2   0.000      1.000 0.00 1.00
#> SRR868809     1   0.141      0.965 0.98 0.02
#> SRR868810     2   0.000      1.000 0.00 1.00
#> SRR868811     2   0.000      1.000 0.00 1.00
#> SRR868812     1   0.141      0.965 0.98 0.02
#> SRR868813     2   0.000      1.000 0.00 1.00
#> SRR868814     2   0.000      1.000 0.00 1.00
#> SRR868815     1   0.722      0.771 0.80 0.20
#> SRR868816     1   0.000      0.969 1.00 0.00
#> SRR868817     1   0.000      0.969 1.00 0.00
#> SRR868818     1   0.000      0.969 1.00 0.00
#> SRR868819     2   0.000      1.000 0.00 1.00
#> SRR868820     2   0.000      1.000 0.00 1.00
#> SRR868821     2   0.000      1.000 0.00 1.00
#> SRR868822     2   0.000      1.000 0.00 1.00
#> SRR868824     1   0.000      0.969 1.00 0.00
#> SRR868823     1   0.000      0.969 1.00 0.00
#> SRR868825     1   0.141      0.965 0.98 0.02
#> SRR868826     1   0.000      0.969 1.00 0.00
#> SRR868827     2   0.000      1.000 0.00 1.00
#> SRR868835     2   0.000      1.000 0.00 1.00
#> SRR868836     2   0.000      1.000 0.00 1.00
#> SRR868837     2   0.000      1.000 0.00 1.00
#> SRR868838     1   0.141      0.965 0.98 0.02
#> SRR868839     2   0.000      1.000 0.00 1.00
#> SRR868840     2   0.000      1.000 0.00 1.00
#> SRR868841     2   0.000      1.000 0.00 1.00
#> SRR868842     2   0.000      1.000 0.00 1.00
#> SRR868843     2   0.000      1.000 0.00 1.00
#> SRR868844     1   0.000      0.969 1.00 0.00
#> SRR868845     2   0.000      1.000 0.00 1.00
#> SRR868846     2   0.000      1.000 0.00 1.00
#> SRR868847     2   0.000      1.000 0.00 1.00
#> SRR868848     2   0.000      1.000 0.00 1.00
#> SRR868849     2   0.000      1.000 0.00 1.00
#> SRR868850     2   0.000      1.000 0.00 1.00
#> SRR868851     2   0.000      1.000 0.00 1.00
#> SRR868852     2   0.000      1.000 0.00 1.00
#> SRR868853     2   0.000      1.000 0.00 1.00
#> SRR868855     2   0.000      1.000 0.00 1.00
#> SRR868856     2   0.000      1.000 0.00 1.00
#> SRR868857     2   0.000      1.000 0.00 1.00
#> SRR868858     2   0.000      1.000 0.00 1.00
#> SRR868874     2   0.000      1.000 0.00 1.00
#> SRR868875     2   0.000      1.000 0.00 1.00
#> SRR868876     2   0.000      1.000 0.00 1.00
#> SRR868877     2   0.000      1.000 0.00 1.00
#> SRR868878     2   0.000      1.000 0.00 1.00
#> SRR868879     2   0.000      1.000 0.00 1.00
#> SRR868880     2   0.000      1.000 0.00 1.00
#> SRR868881     2   0.000      1.000 0.00 1.00
#> SRR868882     2   0.000      1.000 0.00 1.00
#> SRR868883     2   0.000      1.000 0.00 1.00
#> SRR868884     2   0.000      1.000 0.00 1.00
#> SRR868885     2   0.000      1.000 0.00 1.00
#> SRR868829     1   0.141      0.965 0.98 0.02
#> SRR868830     2   0.000      1.000 0.00 1.00
#> SRR868831     1   0.000      0.969 1.00 0.00
#> SRR868828     1   0.000      0.969 1.00 0.00
#> SRR868832     1   0.000      0.969 1.00 0.00
#> SRR868833     1   0.000      0.969 1.00 0.00
#> SRR868834     2   0.000      1.000 0.00 1.00
#> SRR868854     2   0.000      1.000 0.00 1.00
#> SRR868859     2   0.000      1.000 0.00 1.00
#> SRR868860     2   0.000      1.000 0.00 1.00
#> SRR868861     2   0.000      1.000 0.00 1.00
#> SRR868862     2   0.000      1.000 0.00 1.00
#> SRR868863     2   0.000      1.000 0.00 1.00
#> SRR868864     2   0.000      1.000 0.00 1.00
#> SRR868865     2   0.000      1.000 0.00 1.00
#> SRR868866     2   0.000      1.000 0.00 1.00
#> SRR868867     2   0.000      1.000 0.00 1.00
#> SRR868868     2   0.000      1.000 0.00 1.00
#> SRR868869     1   0.795      0.711 0.76 0.24
#> SRR868870     2   0.000      1.000 0.00 1.00
#> SRR868871     2   0.000      1.000 0.00 1.00
#> SRR868873     2   0.000      1.000 0.00 1.00
#> SRR868872     2   0.000      1.000 0.00 1.00

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2 p3
#> SRR868806     1  0.0000      1.000 1.000 0.000  0
#> SRR868807     1  0.0000      1.000 1.000 0.000  0
#> SRR868808     1  0.0000      1.000 1.000 0.000  0
#> SRR868809     1  0.0000      1.000 1.000 0.000  0
#> SRR868810     2  0.0000      1.000 0.000 1.000  0
#> SRR868811     2  0.0000      1.000 0.000 1.000  0
#> SRR868812     1  0.0000      1.000 1.000 0.000  0
#> SRR868813     1  0.0000      1.000 1.000 0.000  0
#> SRR868814     1  0.0000      1.000 1.000 0.000  0
#> SRR868815     1  0.0000      1.000 1.000 0.000  0
#> SRR868816     3  0.0000      1.000 0.000 0.000  1
#> SRR868817     3  0.0000      1.000 0.000 0.000  1
#> SRR868818     3  0.0000      1.000 0.000 0.000  1
#> SRR868819     2  0.0000      1.000 0.000 1.000  0
#> SRR868820     1  0.0000      1.000 1.000 0.000  0
#> SRR868821     1  0.0000      1.000 1.000 0.000  0
#> SRR868822     1  0.0000      1.000 1.000 0.000  0
#> SRR868824     3  0.0000      1.000 0.000 0.000  1
#> SRR868823     3  0.0000      1.000 0.000 0.000  1
#> SRR868825     1  0.0000      1.000 1.000 0.000  0
#> SRR868826     3  0.0000      1.000 0.000 0.000  1
#> SRR868827     1  0.0000      1.000 1.000 0.000  0
#> SRR868835     1  0.0000      1.000 1.000 0.000  0
#> SRR868836     1  0.0000      1.000 1.000 0.000  0
#> SRR868837     1  0.0000      1.000 1.000 0.000  0
#> SRR868838     1  0.0000      1.000 1.000 0.000  0
#> SRR868839     2  0.0000      1.000 0.000 1.000  0
#> SRR868840     1  0.0000      1.000 1.000 0.000  0
#> SRR868841     1  0.0000      1.000 1.000 0.000  0
#> SRR868842     1  0.0000      1.000 1.000 0.000  0
#> SRR868843     1  0.0000      1.000 1.000 0.000  0
#> SRR868844     3  0.0000      1.000 0.000 0.000  1
#> SRR868845     1  0.0000      1.000 1.000 0.000  0
#> SRR868846     1  0.0000      1.000 1.000 0.000  0
#> SRR868847     1  0.0000      1.000 1.000 0.000  0
#> SRR868848     1  0.0000      1.000 1.000 0.000  0
#> SRR868849     2  0.0000      1.000 0.000 1.000  0
#> SRR868850     1  0.0000      1.000 1.000 0.000  0
#> SRR868851     1  0.0000      1.000 1.000 0.000  0
#> SRR868852     2  0.0000      1.000 0.000 1.000  0
#> SRR868853     1  0.0000      1.000 1.000 0.000  0
#> SRR868855     1  0.0000      1.000 1.000 0.000  0
#> SRR868856     2  0.0000      1.000 0.000 1.000  0
#> SRR868857     1  0.0000      1.000 1.000 0.000  0
#> SRR868858     1  0.0000      1.000 1.000 0.000  0
#> SRR868874     2  0.0000      1.000 0.000 1.000  0
#> SRR868875     2  0.0000      1.000 0.000 1.000  0
#> SRR868876     2  0.0000      1.000 0.000 1.000  0
#> SRR868877     2  0.0000      1.000 0.000 1.000  0
#> SRR868878     2  0.0000      1.000 0.000 1.000  0
#> SRR868879     2  0.0000      1.000 0.000 1.000  0
#> SRR868880     2  0.0000      1.000 0.000 1.000  0
#> SRR868881     2  0.0000      1.000 0.000 1.000  0
#> SRR868882     2  0.0000      1.000 0.000 1.000  0
#> SRR868883     2  0.0000      1.000 0.000 1.000  0
#> SRR868884     2  0.0000      1.000 0.000 1.000  0
#> SRR868885     2  0.0000      1.000 0.000 1.000  0
#> SRR868829     1  0.0000      1.000 1.000 0.000  0
#> SRR868830     1  0.0000      1.000 1.000 0.000  0
#> SRR868831     3  0.0000      1.000 0.000 0.000  1
#> SRR868828     3  0.0000      1.000 0.000 0.000  1
#> SRR868832     3  0.0000      1.000 0.000 0.000  1
#> SRR868833     3  0.0000      1.000 0.000 0.000  1
#> SRR868834     1  0.0000      1.000 1.000 0.000  0
#> SRR868854     1  0.0000      1.000 1.000 0.000  0
#> SRR868859     2  0.0000      1.000 0.000 1.000  0
#> SRR868860     2  0.0000      1.000 0.000 1.000  0
#> SRR868861     1  0.0000      1.000 1.000 0.000  0
#> SRR868862     2  0.0000      1.000 0.000 1.000  0
#> SRR868863     2  0.0000      1.000 0.000 1.000  0
#> SRR868864     1  0.0000      1.000 1.000 0.000  0
#> SRR868865     2  0.0000      1.000 0.000 1.000  0
#> SRR868866     1  0.0000      1.000 1.000 0.000  0
#> SRR868867     1  0.0592      0.986 0.988 0.012  0
#> SRR868868     1  0.0000      1.000 1.000 0.000  0
#> SRR868869     1  0.0000      1.000 1.000 0.000  0
#> SRR868870     2  0.0000      1.000 0.000 1.000  0
#> SRR868871     2  0.0000      1.000 0.000 1.000  0
#> SRR868873     2  0.0000      1.000 0.000 1.000  0
#> SRR868872     2  0.0000      1.000 0.000 1.000  0

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1 p2    p3    p4
#> SRR868806     1  0.2589      0.850 0.884  0 0.000 0.116
#> SRR868807     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868808     1  0.3649      0.738 0.796  0 0.000 0.204
#> SRR868809     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868810     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868811     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868812     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868813     1  0.0336      0.965 0.992  0 0.000 0.008
#> SRR868814     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868815     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868816     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868817     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868818     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868819     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868820     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868821     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868822     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868824     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868823     3  0.2704      0.857 0.124  0 0.876 0.000
#> SRR868825     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868826     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868827     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868835     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868836     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868837     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868838     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868839     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868840     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868841     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868842     4  0.4431      0.554 0.304  0 0.000 0.696
#> SRR868843     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868844     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868845     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868846     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868847     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868848     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868849     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868850     1  0.0336      0.965 0.992  0 0.000 0.008
#> SRR868851     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868852     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868853     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868855     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868856     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868857     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868858     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868874     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868875     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868876     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868877     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868878     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868879     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868880     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868881     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868882     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868883     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868884     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868885     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868829     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868830     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868831     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868828     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868832     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868833     3  0.0000      0.986 0.000  0 1.000 0.000
#> SRR868834     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868854     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868859     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868860     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868861     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868862     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868863     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868864     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868865     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868866     1  0.4040      0.668 0.752  0 0.000 0.248
#> SRR868867     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868868     4  0.0000      0.985 0.000  0 0.000 1.000
#> SRR868869     1  0.0000      0.972 1.000  0 0.000 0.000
#> SRR868870     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868871     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868873     2  0.0000      1.000 0.000  1 0.000 0.000
#> SRR868872     2  0.0000      1.000 0.000  1 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     1  0.3895     0.5270 0.680 0.000 0.000 0.320 0.000
#> SRR868807     5  0.3752     0.8820 0.292 0.000 0.000 0.000 0.708
#> SRR868808     1  0.5506     0.4948 0.616 0.000 0.000 0.284 0.100
#> SRR868809     5  0.3752     0.8820 0.292 0.000 0.000 0.000 0.708
#> SRR868810     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868811     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868812     1  0.4249    -0.3171 0.568 0.000 0.000 0.000 0.432
#> SRR868813     1  0.2280     0.7277 0.880 0.000 0.000 0.120 0.000
#> SRR868814     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868815     5  0.4161     0.8281 0.392 0.000 0.000 0.000 0.608
#> SRR868816     3  0.0000     0.9987 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000     0.9987 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000     0.9987 0.000 0.000 1.000 0.000 0.000
#> SRR868819     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868820     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868821     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868822     5  0.4201     0.8075 0.408 0.000 0.000 0.000 0.592
#> SRR868824     3  0.0162     0.9980 0.000 0.000 0.996 0.000 0.004
#> SRR868823     5  0.4971     0.6763 0.116 0.000 0.176 0.000 0.708
#> SRR868825     5  0.3752     0.8820 0.292 0.000 0.000 0.000 0.708
#> SRR868826     3  0.0000     0.9987 0.000 0.000 1.000 0.000 0.000
#> SRR868827     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868835     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868836     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868837     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868838     5  0.4161     0.8281 0.392 0.000 0.000 0.000 0.608
#> SRR868839     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868840     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868841     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868842     4  0.2329     0.7252 0.124 0.000 0.000 0.876 0.000
#> SRR868843     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868844     3  0.0000     0.9987 0.000 0.000 1.000 0.000 0.000
#> SRR868845     4  0.2471     0.8375 0.000 0.000 0.000 0.864 0.136
#> SRR868846     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868847     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868848     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868849     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868850     1  0.2230     0.7311 0.884 0.000 0.000 0.116 0.000
#> SRR868851     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868852     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868853     4  0.3508     0.8213 0.000 0.000 0.000 0.748 0.252
#> SRR868855     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868856     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868857     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868858     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868874     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868875     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868877     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868878     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868879     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868880     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868881     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868882     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868884     2  0.3730     0.6486 0.000 0.712 0.000 0.000 0.288
#> SRR868885     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868829     5  0.3752     0.8820 0.292 0.000 0.000 0.000 0.708
#> SRR868830     1  0.1965     0.7075 0.904 0.000 0.000 0.000 0.096
#> SRR868831     3  0.0162     0.9980 0.000 0.000 0.996 0.000 0.004
#> SRR868828     3  0.0000     0.9987 0.000 0.000 1.000 0.000 0.000
#> SRR868832     3  0.0162     0.9980 0.000 0.000 0.996 0.000 0.004
#> SRR868833     3  0.0162     0.9980 0.000 0.000 0.996 0.000 0.004
#> SRR868834     1  0.0000     0.8048 1.000 0.000 0.000 0.000 0.000
#> SRR868854     4  0.0000     0.8393 0.000 0.000 0.000 1.000 0.000
#> SRR868859     4  0.3508     0.8213 0.000 0.000 0.000 0.748 0.252
#> SRR868860     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868861     4  0.0963     0.8406 0.000 0.000 0.000 0.964 0.036
#> SRR868862     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868863     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868864     1  0.3452     0.6052 0.756 0.000 0.000 0.244 0.000
#> SRR868865     4  0.3730     0.8175 0.000 0.000 0.000 0.712 0.288
#> SRR868866     4  0.4300    -0.1766 0.476 0.000 0.000 0.524 0.000
#> SRR868867     4  0.1197     0.8414 0.000 0.000 0.000 0.952 0.048
#> SRR868868     4  0.0963     0.8406 0.000 0.000 0.000 0.964 0.036
#> SRR868869     1  0.3857     0.0545 0.688 0.000 0.000 0.000 0.312
#> SRR868870     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868871     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868873     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000
#> SRR868872     2  0.0000     0.9823 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR868806     1  0.3810      0.303 0.572 0.000 0.000 0.000 0.428 0.000
#> SRR868807     6  0.1863      0.890 0.000 0.000 0.000 0.000 0.104 0.896
#> SRR868808     1  0.4578      0.473 0.624 0.000 0.000 0.000 0.320 0.056
#> SRR868809     6  0.1863      0.890 0.000 0.000 0.000 0.000 0.104 0.896
#> SRR868810     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868811     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868812     6  0.3862      0.270 0.000 0.000 0.000 0.000 0.476 0.524
#> SRR868813     5  0.2219      0.760 0.136 0.000 0.000 0.000 0.864 0.000
#> SRR868814     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868815     6  0.2854      0.850 0.000 0.000 0.000 0.000 0.208 0.792
#> SRR868816     3  0.0146      0.943 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR868817     3  0.0000      0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868818     3  0.0000      0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868819     4  0.1267      0.977 0.060 0.000 0.000 0.940 0.000 0.000
#> SRR868820     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868821     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868822     6  0.3101      0.820 0.000 0.000 0.000 0.000 0.244 0.756
#> SRR868824     3  0.3092      0.915 0.000 0.000 0.836 0.060 0.000 0.104
#> SRR868823     6  0.1863      0.890 0.000 0.000 0.000 0.000 0.104 0.896
#> SRR868825     6  0.1863      0.890 0.000 0.000 0.000 0.000 0.104 0.896
#> SRR868826     3  0.0000      0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868827     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868835     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868836     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868837     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868838     6  0.2854      0.850 0.000 0.000 0.000 0.000 0.208 0.792
#> SRR868839     4  0.1267      0.977 0.060 0.000 0.000 0.940 0.000 0.000
#> SRR868840     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868841     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868842     1  0.1141      0.827 0.948 0.000 0.000 0.000 0.052 0.000
#> SRR868843     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868844     3  0.0000      0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868845     1  0.3482      0.430 0.684 0.000 0.000 0.316 0.000 0.000
#> SRR868846     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868847     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868848     5  0.0146      0.906 0.004 0.000 0.000 0.000 0.996 0.000
#> SRR868849     4  0.1267      0.977 0.060 0.000 0.000 0.940 0.000 0.000
#> SRR868850     5  0.3266      0.585 0.272 0.000 0.000 0.000 0.728 0.000
#> SRR868851     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868852     4  0.1387      0.973 0.068 0.000 0.000 0.932 0.000 0.000
#> SRR868853     4  0.2300      0.901 0.144 0.000 0.000 0.856 0.000 0.000
#> SRR868855     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868856     4  0.1267      0.977 0.060 0.000 0.000 0.940 0.000 0.000
#> SRR868857     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868858     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868874     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868875     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868876     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868877     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868878     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868879     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868880     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868881     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868882     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868883     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868884     4  0.1267      0.903 0.000 0.060 0.000 0.940 0.000 0.000
#> SRR868885     2  0.0260      0.992 0.000 0.992 0.000 0.008 0.000 0.000
#> SRR868829     6  0.1863      0.890 0.000 0.000 0.000 0.000 0.104 0.896
#> SRR868830     5  0.1663      0.821 0.000 0.000 0.000 0.000 0.912 0.088
#> SRR868831     3  0.3092      0.915 0.000 0.000 0.836 0.060 0.000 0.104
#> SRR868828     3  0.0000      0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR868832     3  0.3092      0.915 0.000 0.000 0.836 0.060 0.000 0.104
#> SRR868833     3  0.3092      0.915 0.000 0.000 0.836 0.060 0.000 0.104
#> SRR868834     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR868854     1  0.0000      0.860 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR868859     4  0.1814      0.944 0.100 0.000 0.000 0.900 0.000 0.000
#> SRR868860     4  0.1267      0.977 0.060 0.000 0.000 0.940 0.000 0.000
#> SRR868861     1  0.1141      0.831 0.948 0.000 0.000 0.052 0.000 0.000
#> SRR868862     4  0.1387      0.973 0.068 0.000 0.000 0.932 0.000 0.000
#> SRR868863     4  0.1267      0.977 0.060 0.000 0.000 0.940 0.000 0.000
#> SRR868864     1  0.3804      0.304 0.576 0.000 0.000 0.000 0.424 0.000
#> SRR868865     4  0.1267      0.977 0.060 0.000 0.000 0.940 0.000 0.000
#> SRR868866     1  0.1267      0.821 0.940 0.000 0.000 0.000 0.060 0.000
#> SRR868867     1  0.3647      0.402 0.640 0.000 0.000 0.360 0.000 0.000
#> SRR868868     1  0.1204      0.828 0.944 0.000 0.000 0.056 0.000 0.000
#> SRR868869     5  0.3578      0.265 0.000 0.000 0.000 0.000 0.660 0.340
#> SRR868870     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868871     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868873     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR868872     2  0.0000      0.999 0.000 1.000 0.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

plot of chunk ATC-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.362           0.644       0.756         0.3894 0.676   0.676
#> 3 3 0.509           0.657       0.822         0.5541 0.532   0.369
#> 4 4 0.518           0.794       0.840         0.1341 0.727   0.409
#> 5 5 0.534           0.577       0.740         0.0949 0.815   0.472
#> 6 6 0.653           0.611       0.718         0.0383 0.919   0.677

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
#> SRR868806     2  0.8499      0.197 0.276 0.724
#> SRR868807     2  0.8555      0.184 0.280 0.720
#> SRR868808     1  0.9460      0.995 0.636 0.364
#> SRR868809     1  0.9460      0.995 0.636 0.364
#> SRR868810     2  0.8499      0.641 0.276 0.724
#> SRR868811     2  0.8661      0.638 0.288 0.712
#> SRR868812     1  0.9460      0.995 0.636 0.364
#> SRR868813     1  0.9460      0.995 0.636 0.364
#> SRR868814     2  0.8661      0.153 0.288 0.712
#> SRR868815     2  0.8661      0.153 0.288 0.712
#> SRR868816     1  0.9460      0.995 0.636 0.364
#> SRR868817     1  0.9460      0.995 0.636 0.364
#> SRR868818     1  0.9460      0.995 0.636 0.364
#> SRR868819     2  0.8081      0.267 0.248 0.752
#> SRR868820     2  0.8081      0.267 0.248 0.752
#> SRR868821     2  0.8081      0.267 0.248 0.752
#> SRR868822     2  0.2423      0.658 0.040 0.960
#> SRR868824     1  0.9460      0.995 0.636 0.364
#> SRR868823     2  0.8555      0.184 0.280 0.720
#> SRR868825     2  0.5842      0.519 0.140 0.860
#> SRR868826     1  0.9460      0.995 0.636 0.364
#> SRR868827     2  0.8555      0.184 0.280 0.720
#> SRR868835     2  0.1843      0.668 0.028 0.972
#> SRR868836     2  0.0376      0.685 0.004 0.996
#> SRR868837     2  0.0376      0.685 0.004 0.996
#> SRR868838     2  0.8661      0.153 0.288 0.712
#> SRR868839     2  0.8608      0.639 0.284 0.716
#> SRR868840     2  0.1843      0.668 0.028 0.972
#> SRR868841     2  0.8499      0.197 0.276 0.724
#> SRR868842     2  0.0000      0.687 0.000 1.000
#> SRR868843     2  0.8081      0.267 0.248 0.752
#> SRR868844     1  0.9460      0.995 0.636 0.364
#> SRR868845     2  0.8555      0.184 0.280 0.720
#> SRR868846     2  0.0000      0.687 0.000 1.000
#> SRR868847     2  0.0376      0.685 0.004 0.996
#> SRR868848     2  0.0376      0.685 0.004 0.996
#> SRR868849     2  0.9460      0.605 0.364 0.636
#> SRR868850     2  0.0376      0.685 0.004 0.996
#> SRR868851     2  0.0000      0.687 0.000 1.000
#> SRR868852     2  0.9427      0.607 0.360 0.640
#> SRR868853     2  0.0000      0.687 0.000 1.000
#> SRR868855     2  0.0000      0.687 0.000 1.000
#> SRR868856     2  0.2423      0.658 0.040 0.960
#> SRR868857     2  0.0376      0.687 0.004 0.996
#> SRR868858     2  0.0000      0.687 0.000 1.000
#> SRR868874     2  0.9460      0.605 0.364 0.636
#> SRR868875     2  0.9460      0.605 0.364 0.636
#> SRR868876     2  0.9460      0.605 0.364 0.636
#> SRR868877     2  0.9460      0.605 0.364 0.636
#> SRR868878     2  0.9460      0.605 0.364 0.636
#> SRR868879     2  0.9460      0.605 0.364 0.636
#> SRR868880     2  0.8661      0.638 0.288 0.712
#> SRR868881     2  0.8763      0.618 0.296 0.704
#> SRR868882     2  0.9460      0.605 0.364 0.636
#> SRR868883     2  0.9460      0.605 0.364 0.636
#> SRR868884     2  0.9460      0.605 0.364 0.636
#> SRR868885     2  0.8661      0.638 0.288 0.712
#> SRR868829     1  0.9460      0.995 0.636 0.364
#> SRR868830     1  0.9460      0.995 0.636 0.364
#> SRR868831     1  0.9460      0.995 0.636 0.364
#> SRR868828     1  0.9754      0.916 0.592 0.408
#> SRR868832     1  0.9460      0.995 0.636 0.364
#> SRR868833     1  0.9460      0.995 0.636 0.364
#> SRR868834     2  0.0376      0.685 0.004 0.996
#> SRR868854     2  0.1843      0.668 0.028 0.972
#> SRR868859     2  0.4562      0.591 0.096 0.904
#> SRR868860     2  0.8661      0.638 0.288 0.712
#> SRR868861     2  0.0000      0.687 0.000 1.000
#> SRR868862     2  0.8081      0.647 0.248 0.752
#> SRR868863     2  0.2043      0.665 0.032 0.968
#> SRR868864     2  0.0000      0.687 0.000 1.000
#> SRR868865     2  0.9460      0.605 0.364 0.636
#> SRR868866     2  0.0000      0.687 0.000 1.000
#> SRR868867     2  0.0000      0.687 0.000 1.000
#> SRR868868     2  0.0000      0.687 0.000 1.000
#> SRR868869     2  0.2043      0.665 0.032 0.968
#> SRR868870     2  0.8661      0.638 0.288 0.712
#> SRR868871     2  0.9460      0.605 0.364 0.636
#> SRR868873     2  0.0672      0.687 0.008 0.992
#> SRR868872     2  0.9460      0.605 0.364 0.636

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> SRR868806     1  0.6305     0.2350 0.516 0.000 0.484
#> SRR868807     3  0.2448     0.7706 0.076 0.000 0.924
#> SRR868808     3  0.1964     0.8101 0.000 0.056 0.944
#> SRR868809     3  0.1964     0.8101 0.000 0.056 0.944
#> SRR868810     2  0.6976     0.7356 0.236 0.700 0.064
#> SRR868811     2  0.5881     0.7559 0.256 0.728 0.016
#> SRR868812     3  0.1964     0.8101 0.000 0.056 0.944
#> SRR868813     3  0.1964     0.8101 0.000 0.056 0.944
#> SRR868814     3  0.1964     0.8101 0.000 0.056 0.944
#> SRR868815     3  0.1964     0.8101 0.000 0.056 0.944
#> SRR868816     3  0.0000     0.8106 0.000 0.000 1.000
#> SRR868817     3  0.0000     0.8106 0.000 0.000 1.000
#> SRR868818     3  0.0000     0.8106 0.000 0.000 1.000
#> SRR868819     3  0.6309    -0.2189 0.496 0.000 0.504
#> SRR868820     3  0.6309    -0.2189 0.496 0.000 0.504
#> SRR868821     3  0.6307    -0.1903 0.488 0.000 0.512
#> SRR868822     3  0.6647    -0.0763 0.452 0.008 0.540
#> SRR868824     3  0.0000     0.8106 0.000 0.000 1.000
#> SRR868823     3  0.2261     0.7781 0.068 0.000 0.932
#> SRR868825     3  0.6577     0.0528 0.420 0.008 0.572
#> SRR868826     3  0.0592     0.8085 0.012 0.000 0.988
#> SRR868827     3  0.5763     0.5333 0.244 0.016 0.740
#> SRR868835     1  0.5497     0.6797 0.708 0.000 0.292
#> SRR868836     1  0.0424     0.7056 0.992 0.008 0.000
#> SRR868837     1  0.5327     0.6934 0.728 0.000 0.272
#> SRR868838     3  0.2846     0.8047 0.020 0.056 0.924
#> SRR868839     1  0.5896     0.5344 0.700 0.292 0.008
#> SRR868840     1  0.5497     0.6797 0.708 0.000 0.292
#> SRR868841     3  0.5859     0.3305 0.344 0.000 0.656
#> SRR868842     1  0.0424     0.7056 0.992 0.008 0.000
#> SRR868843     1  0.6180     0.4518 0.584 0.000 0.416
#> SRR868844     3  0.0892     0.8055 0.020 0.000 0.980
#> SRR868845     1  0.6308     0.1904 0.508 0.000 0.492
#> SRR868846     1  0.0424     0.7056 0.992 0.008 0.000
#> SRR868847     1  0.4228     0.7395 0.844 0.008 0.148
#> SRR868848     1  0.4702     0.7227 0.788 0.000 0.212
#> SRR868849     2  0.5760     0.5234 0.328 0.672 0.000
#> SRR868850     1  0.5497     0.6797 0.708 0.000 0.292
#> SRR868851     1  0.5497     0.6797 0.708 0.000 0.292
#> SRR868852     1  0.5591     0.5159 0.696 0.304 0.000
#> SRR868853     1  0.7101     0.6441 0.704 0.216 0.080
#> SRR868855     1  0.3129     0.7429 0.904 0.008 0.088
#> SRR868856     1  0.5497     0.6797 0.708 0.000 0.292
#> SRR868857     1  0.6622     0.6934 0.748 0.164 0.088
#> SRR868858     1  0.5292     0.7183 0.764 0.008 0.228
#> SRR868874     2  0.2448     0.8634 0.076 0.924 0.000
#> SRR868875     2  0.1964     0.8693 0.056 0.944 0.000
#> SRR868876     2  0.1964     0.8693 0.056 0.944 0.000
#> SRR868877     2  0.1964     0.8693 0.056 0.944 0.000
#> SRR868878     2  0.1964     0.8693 0.056 0.944 0.000
#> SRR868879     2  0.1964     0.8693 0.056 0.944 0.000
#> SRR868880     2  0.5881     0.7559 0.256 0.728 0.016
#> SRR868881     2  0.7603     0.6848 0.236 0.668 0.096
#> SRR868882     2  0.1964     0.8693 0.056 0.944 0.000
#> SRR868883     2  0.1964     0.8693 0.056 0.944 0.000
#> SRR868884     2  0.4974     0.7822 0.236 0.764 0.000
#> SRR868885     2  0.6295     0.7666 0.236 0.728 0.036
#> SRR868829     3  0.1964     0.8101 0.000 0.056 0.944
#> SRR868830     3  0.1964     0.8101 0.000 0.056 0.944
#> SRR868831     3  0.0000     0.8106 0.000 0.000 1.000
#> SRR868828     3  0.0892     0.8055 0.020 0.000 0.980
#> SRR868832     3  0.0000     0.8106 0.000 0.000 1.000
#> SRR868833     3  0.0000     0.8106 0.000 0.000 1.000
#> SRR868834     1  0.0424     0.7056 0.992 0.008 0.000
#> SRR868854     1  0.5497     0.6797 0.708 0.000 0.292
#> SRR868859     1  0.5560     0.6721 0.700 0.000 0.300
#> SRR868860     1  0.6648     0.3638 0.620 0.364 0.016
#> SRR868861     1  0.0424     0.7056 0.992 0.008 0.000
#> SRR868862     1  0.5397     0.5461 0.720 0.280 0.000
#> SRR868863     1  0.5497     0.6797 0.708 0.000 0.292
#> SRR868864     1  0.1950     0.7286 0.952 0.008 0.040
#> SRR868865     2  0.2165     0.8665 0.064 0.936 0.000
#> SRR868866     1  0.0424     0.7056 0.992 0.008 0.000
#> SRR868867     1  0.1585     0.7226 0.964 0.008 0.028
#> SRR868868     1  0.0424     0.7056 0.992 0.008 0.000
#> SRR868869     3  0.6587     0.0375 0.424 0.008 0.568
#> SRR868870     2  0.5881     0.7559 0.256 0.728 0.016
#> SRR868871     2  0.1964     0.8693 0.056 0.944 0.000
#> SRR868873     1  0.8548     0.4530 0.568 0.312 0.120
#> SRR868872     2  0.1964     0.8693 0.056 0.944 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.4659    0.70573 0.804 0.004 0.084 0.108
#> SRR868807     1  0.4578    0.68833 0.788 0.000 0.160 0.052
#> SRR868808     4  0.6598    0.91704 0.064 0.076 0.160 0.700
#> SRR868809     4  0.6598    0.91704 0.064 0.076 0.160 0.700
#> SRR868810     2  0.2706    0.80770 0.020 0.900 0.080 0.000
#> SRR868811     2  0.3486    0.85124 0.188 0.812 0.000 0.000
#> SRR868812     4  0.6598    0.91704 0.064 0.076 0.160 0.700
#> SRR868813     4  0.4804    0.94786 0.064 0.000 0.160 0.776
#> SRR868814     4  0.4804    0.94786 0.064 0.000 0.160 0.776
#> SRR868815     4  0.4804    0.94786 0.064 0.000 0.160 0.776
#> SRR868816     3  0.0000    0.98961 0.000 0.000 1.000 0.000
#> SRR868817     3  0.0000    0.98961 0.000 0.000 1.000 0.000
#> SRR868818     3  0.0000    0.98961 0.000 0.000 1.000 0.000
#> SRR868819     2  0.6452    0.65429 0.180 0.696 0.088 0.036
#> SRR868820     2  0.6452    0.65429 0.180 0.696 0.088 0.036
#> SRR868821     2  0.6491    0.64977 0.184 0.692 0.088 0.036
#> SRR868822     1  0.5403    0.71436 0.768 0.100 0.116 0.016
#> SRR868824     3  0.0000    0.98961 0.000 0.000 1.000 0.000
#> SRR868823     1  0.4911    0.70144 0.764 0.024 0.196 0.016
#> SRR868825     1  0.4070    0.75960 0.836 0.024 0.124 0.016
#> SRR868826     3  0.0779    0.97530 0.004 0.000 0.980 0.016
#> SRR868827     1  0.6594    0.43149 0.624 0.000 0.148 0.228
#> SRR868835     1  0.0469    0.79311 0.988 0.000 0.000 0.012
#> SRR868836     1  0.3958    0.77781 0.816 0.024 0.000 0.160
#> SRR868837     1  0.0592    0.79632 0.984 0.016 0.000 0.000
#> SRR868838     4  0.5551    0.89189 0.112 0.000 0.160 0.728
#> SRR868839     2  0.4220    0.76573 0.248 0.748 0.000 0.004
#> SRR868840     1  0.0469    0.79311 0.988 0.000 0.000 0.012
#> SRR868841     1  0.3996    0.70545 0.836 0.000 0.060 0.104
#> SRR868842     1  0.4004    0.77673 0.812 0.024 0.000 0.164
#> SRR868843     2  0.7711    0.62091 0.184 0.616 0.088 0.112
#> SRR868844     3  0.0779    0.97530 0.004 0.000 0.980 0.016
#> SRR868845     1  0.4662    0.69579 0.796 0.000 0.092 0.112
#> SRR868846     1  0.4004    0.77673 0.812 0.024 0.000 0.164
#> SRR868847     1  0.4533    0.78276 0.828 0.024 0.088 0.060
#> SRR868848     1  0.1929    0.79451 0.940 0.024 0.000 0.036
#> SRR868849     2  0.2704    0.86839 0.124 0.876 0.000 0.000
#> SRR868850     1  0.0469    0.79311 0.988 0.000 0.000 0.012
#> SRR868851     1  0.0469    0.79311 0.988 0.000 0.000 0.012
#> SRR868852     2  0.3649    0.82812 0.204 0.796 0.000 0.000
#> SRR868853     1  0.5268   -0.00804 0.592 0.396 0.000 0.012
#> SRR868855     1  0.2521    0.78804 0.912 0.024 0.000 0.064
#> SRR868856     1  0.5558   -0.22683 0.548 0.432 0.000 0.020
#> SRR868857     2  0.7019    0.74137 0.212 0.652 0.072 0.064
#> SRR868858     1  0.1004    0.79634 0.972 0.024 0.000 0.004
#> SRR868874     2  0.1940    0.87286 0.076 0.924 0.000 0.000
#> SRR868875     2  0.1940    0.87286 0.076 0.924 0.000 0.000
#> SRR868876     2  0.1022    0.85153 0.032 0.968 0.000 0.000
#> SRR868877     2  0.1940    0.87286 0.076 0.924 0.000 0.000
#> SRR868878     2  0.1940    0.87286 0.076 0.924 0.000 0.000
#> SRR868879     2  0.1940    0.87286 0.076 0.924 0.000 0.000
#> SRR868880     2  0.3400    0.85422 0.180 0.820 0.000 0.000
#> SRR868881     2  0.2775    0.80451 0.020 0.896 0.084 0.000
#> SRR868882     2  0.1940    0.87286 0.076 0.924 0.000 0.000
#> SRR868883     2  0.2011    0.87331 0.080 0.920 0.000 0.000
#> SRR868884     2  0.1022    0.84301 0.032 0.968 0.000 0.000
#> SRR868885     2  0.2563    0.81326 0.020 0.908 0.072 0.000
#> SRR868829     4  0.4804    0.94786 0.064 0.000 0.160 0.776
#> SRR868830     4  0.4804    0.94786 0.064 0.000 0.160 0.776
#> SRR868831     3  0.0000    0.98961 0.000 0.000 1.000 0.000
#> SRR868828     3  0.0779    0.97530 0.004 0.000 0.980 0.016
#> SRR868832     3  0.0000    0.98961 0.000 0.000 1.000 0.000
#> SRR868833     3  0.0000    0.98961 0.000 0.000 1.000 0.000
#> SRR868834     1  0.3958    0.77781 0.816 0.024 0.000 0.160
#> SRR868854     1  0.0469    0.79311 0.988 0.000 0.000 0.012
#> SRR868859     1  0.0895    0.79105 0.976 0.000 0.004 0.020
#> SRR868860     2  0.4134    0.80185 0.260 0.740 0.000 0.000
#> SRR868861     1  0.5932    0.71010 0.680 0.096 0.000 0.224
#> SRR868862     2  0.4711    0.82924 0.152 0.784 0.000 0.064
#> SRR868863     1  0.3969    0.60997 0.804 0.180 0.000 0.016
#> SRR868864     1  0.4113    0.78433 0.828 0.024 0.012 0.136
#> SRR868865     2  0.2530    0.87093 0.112 0.888 0.000 0.000
#> SRR868866     1  0.5900    0.71312 0.684 0.096 0.000 0.220
#> SRR868867     1  0.7386    0.39998 0.536 0.300 0.008 0.156
#> SRR868868     1  0.5988    0.70673 0.676 0.100 0.000 0.224
#> SRR868869     1  0.4948    0.72815 0.776 0.100 0.124 0.000
#> SRR868870     2  0.3266    0.85679 0.168 0.832 0.000 0.000
#> SRR868871     2  0.1940    0.87286 0.076 0.924 0.000 0.000
#> SRR868873     2  0.3764    0.83791 0.216 0.784 0.000 0.000
#> SRR868872     2  0.1940    0.87286 0.076 0.924 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> SRR868806     4  0.5900     0.5429 0.376 0.016 0.000 0.540 0.068
#> SRR868807     1  0.8857    -0.1163 0.336 0.016 0.208 0.220 0.220
#> SRR868808     5  0.4513     0.7792 0.044 0.000 0.104 0.060 0.792
#> SRR868809     5  0.6069     0.7696 0.020 0.000 0.128 0.232 0.620
#> SRR868810     2  0.4931     0.7349 0.024 0.752 0.000 0.104 0.120
#> SRR868811     2  0.3488     0.7420 0.024 0.808 0.000 0.168 0.000
#> SRR868812     5  0.3509     0.7924 0.020 0.000 0.132 0.016 0.832
#> SRR868813     5  0.4449     0.8302 0.016 0.000 0.112 0.088 0.784
#> SRR868814     5  0.6018     0.7826 0.008 0.000 0.112 0.312 0.568
#> SRR868815     5  0.6018     0.7826 0.008 0.000 0.112 0.312 0.568
#> SRR868816     3  0.0000     0.7993 0.000 0.000 1.000 0.000 0.000
#> SRR868817     3  0.0000     0.7993 0.000 0.000 1.000 0.000 0.000
#> SRR868818     3  0.0000     0.7993 0.000 0.000 1.000 0.000 0.000
#> SRR868819     4  0.7215     0.4254 0.108 0.164 0.000 0.560 0.168
#> SRR868820     4  0.7393     0.4500 0.152 0.144 0.000 0.544 0.160
#> SRR868821     4  0.7393     0.4500 0.152 0.144 0.000 0.544 0.160
#> SRR868822     1  0.6419     0.3472 0.612 0.004 0.220 0.032 0.132
#> SRR868824     3  0.0693     0.7997 0.000 0.000 0.980 0.012 0.008
#> SRR868823     3  0.7259     0.2173 0.252 0.000 0.504 0.056 0.188
#> SRR868825     3  0.7128     0.2370 0.344 0.004 0.476 0.044 0.132
#> SRR868826     3  0.0992     0.7881 0.000 0.000 0.968 0.008 0.024
#> SRR868827     4  0.8433     0.2056 0.268 0.008 0.108 0.312 0.304
#> SRR868835     4  0.6084     0.4656 0.404 0.020 0.000 0.504 0.072
#> SRR868836     1  0.1461     0.6194 0.952 0.004 0.000 0.016 0.028
#> SRR868837     1  0.5419    -0.0412 0.580 0.020 0.000 0.368 0.032
#> SRR868838     5  0.5998     0.7782 0.004 0.000 0.112 0.340 0.544
#> SRR868839     4  0.6300     0.3921 0.168 0.336 0.000 0.496 0.000
#> SRR868840     4  0.5439     0.4488 0.432 0.012 0.000 0.520 0.036
#> SRR868841     4  0.6881     0.4108 0.308 0.004 0.004 0.448 0.236
#> SRR868842     1  0.1012     0.6242 0.968 0.012 0.000 0.020 0.000
#> SRR868843     4  0.7178     0.5532 0.228 0.144 0.012 0.560 0.056
#> SRR868844     3  0.1493     0.7817 0.000 0.000 0.948 0.028 0.024
#> SRR868845     4  0.7123     0.4693 0.324 0.000 0.088 0.496 0.092
#> SRR868846     1  0.0992     0.6213 0.968 0.024 0.000 0.008 0.000
#> SRR868847     1  0.5167     0.5055 0.768 0.020 0.088 0.040 0.084
#> SRR868848     1  0.4748     0.2612 0.680 0.020 0.000 0.284 0.016
#> SRR868849     2  0.5136     0.5583 0.128 0.692 0.000 0.180 0.000
#> SRR868850     4  0.4903     0.5207 0.400 0.008 0.000 0.576 0.016
#> SRR868851     4  0.4787     0.5903 0.324 0.036 0.000 0.640 0.000
#> SRR868852     2  0.6538    -0.1474 0.208 0.452 0.000 0.340 0.000
#> SRR868853     4  0.5905     0.5274 0.336 0.104 0.000 0.556 0.004
#> SRR868855     1  0.4339     0.3245 0.684 0.020 0.000 0.296 0.000
#> SRR868856     4  0.4170     0.5838 0.192 0.048 0.000 0.760 0.000
#> SRR868857     1  0.6620    -0.2583 0.408 0.184 0.000 0.404 0.004
#> SRR868858     1  0.4893    -0.0488 0.568 0.028 0.000 0.404 0.000
#> SRR868874     2  0.0000     0.8267 0.000 1.000 0.000 0.000 0.000
#> SRR868875     2  0.0000     0.8267 0.000 1.000 0.000 0.000 0.000
#> SRR868876     2  0.0510     0.8201 0.016 0.984 0.000 0.000 0.000
#> SRR868877     2  0.0000     0.8267 0.000 1.000 0.000 0.000 0.000
#> SRR868878     2  0.0162     0.8255 0.004 0.996 0.000 0.000 0.000
#> SRR868879     2  0.0000     0.8267 0.000 1.000 0.000 0.000 0.000
#> SRR868880     2  0.3574     0.7378 0.028 0.804 0.000 0.168 0.000
#> SRR868881     2  0.4931     0.7349 0.024 0.752 0.000 0.104 0.120
#> SRR868882     2  0.0000     0.8267 0.000 1.000 0.000 0.000 0.000
#> SRR868883     2  0.0566     0.8242 0.004 0.984 0.000 0.012 0.000
#> SRR868884     2  0.2951     0.7842 0.028 0.860 0.000 0.112 0.000
#> SRR868885     2  0.4521     0.7585 0.024 0.784 0.000 0.080 0.112
#> SRR868829     5  0.3115     0.8218 0.000 0.000 0.112 0.036 0.852
#> SRR868830     5  0.3192     0.8221 0.000 0.000 0.112 0.040 0.848
#> SRR868831     3  0.0693     0.7997 0.000 0.000 0.980 0.012 0.008
#> SRR868828     3  0.1743     0.7778 0.004 0.000 0.940 0.028 0.028
#> SRR868832     3  0.0693     0.7997 0.000 0.000 0.980 0.012 0.008
#> SRR868833     3  0.0693     0.7997 0.000 0.000 0.980 0.012 0.008
#> SRR868834     1  0.1913     0.6202 0.936 0.020 0.000 0.020 0.024
#> SRR868854     4  0.4565     0.5967 0.308 0.028 0.000 0.664 0.000
#> SRR868859     4  0.4617     0.5897 0.304 0.024 0.000 0.668 0.004
#> SRR868860     2  0.5998     0.0865 0.112 0.464 0.000 0.424 0.000
#> SRR868861     1  0.0162     0.6209 0.996 0.000 0.000 0.004 0.000
#> SRR868862     1  0.6477     0.0657 0.456 0.352 0.000 0.192 0.000
#> SRR868863     4  0.4404     0.6005 0.264 0.032 0.000 0.704 0.000
#> SRR868864     1  0.1893     0.6194 0.936 0.024 0.000 0.028 0.012
#> SRR868865     2  0.3081     0.7520 0.012 0.832 0.000 0.156 0.000
#> SRR868866     1  0.0162     0.6209 0.996 0.000 0.000 0.004 0.000
#> SRR868867     1  0.4531     0.4617 0.760 0.092 0.000 0.144 0.004
#> SRR868868     1  0.0162     0.6209 0.996 0.000 0.000 0.004 0.000
#> SRR868869     3  0.6707     0.1345 0.396 0.000 0.456 0.028 0.120
#> SRR868870     2  0.3194     0.7572 0.020 0.832 0.000 0.148 0.000
#> SRR868871     2  0.0404     0.8223 0.012 0.988 0.000 0.000 0.000
#> SRR868873     2  0.5726     0.4576 0.140 0.612 0.000 0.248 0.000
#> SRR868872     2  0.0000     0.8267 0.000 1.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5 p6
#> SRR868806     4  0.1406     0.5820 0.020 0.004 0.000 0.952 0.016 NA
#> SRR868807     4  0.6358     0.2084 0.136 0.000 0.056 0.540 0.264 NA
#> SRR868808     5  0.2912     0.5517 0.000 0.000 0.000 0.172 0.816 NA
#> SRR868809     5  0.1526     0.6857 0.004 0.000 0.008 0.036 0.944 NA
#> SRR868810     2  0.1508     0.8354 0.004 0.948 0.000 0.016 0.012 NA
#> SRR868811     2  0.1225     0.8370 0.000 0.952 0.000 0.036 0.000 NA
#> SRR868812     5  0.0405     0.6814 0.000 0.000 0.004 0.008 0.988 NA
#> SRR868813     5  0.3248     0.6809 0.000 0.000 0.004 0.116 0.828 NA
#> SRR868814     5  0.7341     0.5983 0.096 0.000 0.004 0.224 0.344 NA
#> SRR868815     5  0.7341     0.5983 0.096 0.000 0.004 0.224 0.344 NA
#> SRR868816     3  0.0692     0.8111 0.000 0.000 0.976 0.000 0.004 NA
#> SRR868817     3  0.0603     0.8110 0.000 0.000 0.980 0.000 0.004 NA
#> SRR868818     3  0.0603     0.8110 0.000 0.000 0.980 0.000 0.004 NA
#> SRR868819     2  0.7525     0.1565 0.016 0.400 0.000 0.296 0.124 NA
#> SRR868820     4  0.6364     0.2581 0.004 0.316 0.000 0.504 0.128 NA
#> SRR868821     4  0.6269     0.3445 0.004 0.268 0.000 0.544 0.136 NA
#> SRR868822     1  0.6620     0.4387 0.536 0.000 0.100 0.124 0.236 NA
#> SRR868824     3  0.3706     0.7235 0.000 0.000 0.620 0.000 0.000 NA
#> SRR868823     3  0.5717     0.2625 0.052 0.000 0.616 0.060 0.260 NA
#> SRR868825     1  0.6611     0.3063 0.516 0.000 0.184 0.060 0.236 NA
#> SRR868826     3  0.0603     0.8053 0.000 0.000 0.980 0.000 0.004 NA
#> SRR868827     4  0.4146     0.3153 0.028 0.000 0.004 0.680 0.288 NA
#> SRR868835     4  0.3586     0.4503 0.268 0.000 0.000 0.720 0.012 NA
#> SRR868836     1  0.2593     0.6625 0.844 0.000 0.000 0.148 0.008 NA
#> SRR868837     1  0.3997     0.0618 0.508 0.000 0.000 0.488 0.004 NA
#> SRR868838     5  0.7350     0.5931 0.096 0.000 0.004 0.228 0.340 NA
#> SRR868839     2  0.5854     0.2675 0.016 0.496 0.000 0.356 0.000 NA
#> SRR868840     4  0.3405     0.4505 0.272 0.000 0.000 0.724 0.004 NA
#> SRR868841     4  0.3863     0.3651 0.028 0.000 0.000 0.712 0.260 NA
#> SRR868842     1  0.4332     0.6798 0.616 0.000 0.000 0.352 0.000 NA
#> SRR868843     4  0.3873     0.4944 0.004 0.180 0.004 0.776 0.016 NA
#> SRR868844     3  0.0603     0.8053 0.000 0.000 0.980 0.000 0.004 NA
#> SRR868845     4  0.1910     0.5801 0.016 0.004 0.004 0.932 0.016 NA
#> SRR868846     1  0.4264     0.6943 0.636 0.000 0.000 0.332 0.000 NA
#> SRR868847     1  0.3086     0.6429 0.820 0.000 0.004 0.156 0.020 NA
#> SRR868848     1  0.3528     0.5311 0.700 0.000 0.000 0.296 0.004 NA
#> SRR868849     2  0.5061     0.6762 0.028 0.680 0.000 0.096 0.000 NA
#> SRR868850     4  0.1155     0.5717 0.036 0.004 0.000 0.956 0.004 NA
#> SRR868851     4  0.0508     0.5935 0.004 0.012 0.000 0.984 0.000 NA
#> SRR868852     2  0.6250     0.2490 0.044 0.492 0.000 0.332 0.000 NA
#> SRR868853     4  0.4887     0.1131 0.044 0.412 0.000 0.536 0.000 NA
#> SRR868855     1  0.3923     0.6240 0.580 0.000 0.000 0.416 0.004 NA
#> SRR868856     4  0.2791     0.5887 0.016 0.008 0.000 0.852 0.000 NA
#> SRR868857     4  0.6087     0.1230 0.212 0.324 0.000 0.456 0.000 NA
#> SRR868858     4  0.3733     0.0906 0.288 0.008 0.000 0.700 0.000 NA
#> SRR868874     2  0.0363     0.8428 0.000 0.988 0.000 0.012 0.000 NA
#> SRR868875     2  0.0000     0.8424 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868876     2  0.0000     0.8424 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868877     2  0.0000     0.8424 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868878     2  0.0000     0.8424 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868879     2  0.0000     0.8424 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868880     2  0.1151     0.8383 0.000 0.956 0.000 0.032 0.000 NA
#> SRR868881     2  0.1508     0.8354 0.004 0.948 0.000 0.016 0.012 NA
#> SRR868882     2  0.0000     0.8424 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868883     2  0.0260     0.8426 0.000 0.992 0.000 0.000 0.000 NA
#> SRR868884     2  0.4151     0.7332 0.012 0.744 0.000 0.052 0.000 NA
#> SRR868885     2  0.1321     0.8394 0.000 0.952 0.000 0.020 0.004 NA
#> SRR868829     5  0.3411     0.7035 0.000 0.000 0.004 0.008 0.756 NA
#> SRR868830     5  0.4094     0.7101 0.000 0.000 0.004 0.036 0.708 NA
#> SRR868831     3  0.4144     0.7230 0.000 0.000 0.620 0.000 0.020 NA
#> SRR868828     3  0.0748     0.8037 0.004 0.000 0.976 0.000 0.004 NA
#> SRR868832     3  0.3706     0.7235 0.000 0.000 0.620 0.000 0.000 NA
#> SRR868833     3  0.3672     0.7282 0.000 0.000 0.632 0.000 0.000 NA
#> SRR868834     1  0.2378     0.6644 0.848 0.000 0.000 0.152 0.000 NA
#> SRR868854     4  0.0405     0.5945 0.004 0.008 0.000 0.988 0.000 NA
#> SRR868859     4  0.3199     0.5884 0.024 0.012 0.000 0.836 0.004 NA
#> SRR868860     2  0.5276     0.6201 0.020 0.652 0.000 0.192 0.000 NA
#> SRR868861     1  0.4249     0.6973 0.640 0.000 0.000 0.328 0.000 NA
#> SRR868862     2  0.6509     0.4661 0.120 0.556 0.000 0.188 0.000 NA
#> SRR868863     4  0.2791     0.5887 0.016 0.008 0.000 0.852 0.000 NA
#> SRR868864     1  0.3288     0.6991 0.724 0.000 0.000 0.276 0.000 NA
#> SRR868865     2  0.4492     0.7147 0.016 0.720 0.000 0.068 0.000 NA
#> SRR868866     1  0.4234     0.6987 0.644 0.000 0.000 0.324 0.000 NA
#> SRR868867     1  0.4332     0.6542 0.628 0.020 0.000 0.344 0.000 NA
#> SRR868868     1  0.4249     0.6973 0.640 0.000 0.000 0.328 0.000 NA
#> SRR868869     1  0.6710     0.3567 0.520 0.000 0.160 0.084 0.232 NA
#> SRR868870     2  0.0858     0.8395 0.000 0.968 0.000 0.028 0.000 NA
#> SRR868871     2  0.0000     0.8424 0.000 1.000 0.000 0.000 0.000 NA
#> SRR868873     2  0.3703     0.7617 0.004 0.796 0.000 0.092 0.000 NA
#> SRR868872     2  0.0146     0.8424 0.000 0.996 0.000 0.004 0.000 NA

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

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.293           0.574       0.791         0.4348 0.596   0.596
#> 3 3 0.471           0.665       0.835         0.4292 0.612   0.430
#> 4 4 0.551           0.645       0.817         0.1621 0.722   0.401
#> 5 5 0.626           0.706       0.824         0.0884 0.850   0.520
#> 6 6 0.609           0.577       0.722         0.0346 0.932   0.703

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

suggest_best_k(res)
#> [1] 5

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
#> SRR868806     1  0.8207      0.700 0.744 0.256
#> SRR868807     1  0.8207      0.700 0.744 0.256
#> SRR868808     1  0.0000      0.666 1.000 0.000
#> SRR868809     1  0.0000      0.666 1.000 0.000
#> SRR868810     1  0.9896     -0.229 0.560 0.440
#> SRR868811     2  0.0000      0.743 0.000 1.000
#> SRR868812     1  0.0000      0.666 1.000 0.000
#> SRR868813     1  0.4161      0.697 0.916 0.084
#> SRR868814     1  0.9710      0.606 0.600 0.400
#> SRR868815     1  0.9635      0.621 0.612 0.388
#> SRR868816     1  0.1184      0.674 0.984 0.016
#> SRR868817     1  0.1414      0.675 0.980 0.020
#> SRR868818     1  0.0938      0.672 0.988 0.012
#> SRR868819     1  0.0000      0.666 1.000 0.000
#> SRR868820     1  0.0000      0.666 1.000 0.000
#> SRR868821     1  0.0000      0.666 1.000 0.000
#> SRR868822     1  0.0376      0.668 0.996 0.004
#> SRR868824     1  0.0000      0.666 1.000 0.000
#> SRR868823     1  0.8661      0.691 0.712 0.288
#> SRR868825     1  0.3114      0.688 0.944 0.056
#> SRR868826     1  0.4022      0.694 0.920 0.080
#> SRR868827     1  0.8267      0.699 0.740 0.260
#> SRR868835     1  0.9710      0.606 0.600 0.400
#> SRR868836     1  0.6343      0.706 0.840 0.160
#> SRR868837     1  0.9358      0.655 0.648 0.352
#> SRR868838     1  0.9795      0.583 0.584 0.416
#> SRR868839     1  0.9358      0.656 0.648 0.352
#> SRR868840     1  0.9732      0.601 0.596 0.404
#> SRR868841     1  0.9635      0.621 0.612 0.388
#> SRR868842     1  0.9460      0.645 0.636 0.364
#> SRR868843     1  0.3114      0.689 0.944 0.056
#> SRR868844     1  0.5737      0.705 0.864 0.136
#> SRR868845     1  0.9996      0.434 0.512 0.488
#> SRR868846     1  0.9044      0.675 0.680 0.320
#> SRR868847     1  0.9552      0.634 0.624 0.376
#> SRR868848     1  0.9580      0.630 0.620 0.380
#> SRR868849     2  0.7453      0.475 0.212 0.788
#> SRR868850     1  0.9815      0.576 0.580 0.420
#> SRR868851     2  0.9970     -0.355 0.468 0.532
#> SRR868852     1  0.9552      0.635 0.624 0.376
#> SRR868853     1  0.9732      0.601 0.596 0.404
#> SRR868855     2  0.9998     -0.418 0.492 0.508
#> SRR868856     2  0.0672      0.739 0.008 0.992
#> SRR868857     1  0.5946      0.705 0.856 0.144
#> SRR868858     1  0.9795      0.583 0.584 0.416
#> SRR868874     2  0.3431      0.722 0.064 0.936
#> SRR868875     2  0.7376      0.636 0.208 0.792
#> SRR868876     2  0.9170      0.520 0.332 0.668
#> SRR868877     2  0.4562      0.706 0.096 0.904
#> SRR868878     2  0.9522      0.477 0.372 0.628
#> SRR868879     2  0.0672      0.742 0.008 0.992
#> SRR868880     2  0.0000      0.743 0.000 1.000
#> SRR868881     1  0.9775     -0.152 0.588 0.412
#> SRR868882     2  0.1184      0.741 0.016 0.984
#> SRR868883     2  0.0000      0.743 0.000 1.000
#> SRR868884     1  0.9988     -0.311 0.520 0.480
#> SRR868885     1  0.8499      0.193 0.724 0.276
#> SRR868829     1  0.0376      0.668 0.996 0.004
#> SRR868830     1  0.6623      0.706 0.828 0.172
#> SRR868831     1  0.0000      0.666 1.000 0.000
#> SRR868828     1  0.8661      0.691 0.712 0.288
#> SRR868832     1  0.0000      0.666 1.000 0.000
#> SRR868833     1  0.0000      0.666 1.000 0.000
#> SRR868834     1  0.8813      0.687 0.700 0.300
#> SRR868854     2  0.9909     -0.288 0.444 0.556
#> SRR868859     2  0.7528      0.441 0.216 0.784
#> SRR868860     2  0.0376      0.742 0.004 0.996
#> SRR868861     1  0.8955      0.680 0.688 0.312
#> SRR868862     1  0.4298      0.698 0.912 0.088
#> SRR868863     2  0.0000      0.743 0.000 1.000
#> SRR868864     1  0.8861      0.684 0.696 0.304
#> SRR868865     1  0.9686      0.141 0.604 0.396
#> SRR868866     1  0.9460      0.645 0.636 0.364
#> SRR868867     1  0.6973      0.707 0.812 0.188
#> SRR868868     1  0.9427      0.648 0.640 0.360
#> SRR868869     1  0.8813      0.686 0.700 0.300
#> SRR868870     2  0.0000      0.743 0.000 1.000
#> SRR868871     2  0.8861      0.550 0.304 0.696
#> SRR868873     2  0.0000      0.743 0.000 1.000
#> SRR868872     2  0.9248      0.512 0.340 0.660

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> SRR868806     3  0.5785     0.4753 0.332 0.000 0.668
#> SRR868807     1  0.6489     0.1612 0.540 0.004 0.456
#> SRR868808     3  0.0747     0.8168 0.016 0.000 0.984
#> SRR868809     3  0.0983     0.8175 0.016 0.004 0.980
#> SRR868810     3  0.6824     0.2849 0.016 0.408 0.576
#> SRR868811     1  0.6291    -0.1907 0.532 0.468 0.000
#> SRR868812     3  0.0747     0.8168 0.016 0.000 0.984
#> SRR868813     3  0.2959     0.8014 0.100 0.000 0.900
#> SRR868814     1  0.1753     0.7875 0.952 0.000 0.048
#> SRR868815     1  0.1964     0.7873 0.944 0.000 0.056
#> SRR868816     3  0.2773     0.8208 0.048 0.024 0.928
#> SRR868817     3  0.3589     0.8143 0.048 0.052 0.900
#> SRR868818     3  0.3253     0.8189 0.052 0.036 0.912
#> SRR868819     3  0.0747     0.8168 0.016 0.000 0.984
#> SRR868820     3  0.0747     0.8168 0.016 0.000 0.984
#> SRR868821     3  0.0747     0.8168 0.016 0.000 0.984
#> SRR868822     3  0.3434     0.8072 0.032 0.064 0.904
#> SRR868824     3  0.2749     0.8065 0.012 0.064 0.924
#> SRR868823     1  0.5734     0.7141 0.788 0.048 0.164
#> SRR868825     3  0.5454     0.7543 0.044 0.152 0.804
#> SRR868826     3  0.6920     0.7210 0.164 0.104 0.732
#> SRR868827     1  0.5859     0.4911 0.656 0.000 0.344
#> SRR868835     1  0.0475     0.7888 0.992 0.004 0.004
#> SRR868836     3  0.6585     0.6801 0.200 0.064 0.736
#> SRR868837     1  0.3038     0.7717 0.896 0.000 0.104
#> SRR868838     1  0.0829     0.7857 0.984 0.012 0.004
#> SRR868839     3  0.6540     0.2472 0.408 0.008 0.584
#> SRR868840     1  0.1015     0.7895 0.980 0.008 0.012
#> SRR868841     1  0.2165     0.7860 0.936 0.000 0.064
#> SRR868842     1  0.6556     0.5899 0.692 0.032 0.276
#> SRR868843     3  0.1031     0.8168 0.024 0.000 0.976
#> SRR868844     3  0.8243     0.3541 0.368 0.084 0.548
#> SRR868845     1  0.1170     0.7862 0.976 0.016 0.008
#> SRR868846     1  0.6142     0.6870 0.748 0.040 0.212
#> SRR868847     1  0.1781     0.7853 0.960 0.020 0.020
#> SRR868848     1  0.1399     0.7907 0.968 0.004 0.028
#> SRR868849     1  0.7640     0.2067 0.592 0.352 0.056
#> SRR868850     1  0.1015     0.7879 0.980 0.012 0.008
#> SRR868851     1  0.0892     0.7828 0.980 0.020 0.000
#> SRR868852     1  0.7533     0.5969 0.668 0.088 0.244
#> SRR868853     1  0.2056     0.7904 0.952 0.024 0.024
#> SRR868855     1  0.1267     0.7816 0.972 0.024 0.004
#> SRR868856     1  0.1289     0.7777 0.968 0.032 0.000
#> SRR868857     3  0.4749     0.7349 0.172 0.012 0.816
#> SRR868858     1  0.1482     0.7890 0.968 0.020 0.012
#> SRR868874     2  0.0747     0.8081 0.016 0.984 0.000
#> SRR868875     2  0.0000     0.8057 0.000 1.000 0.000
#> SRR868876     2  0.2527     0.7848 0.020 0.936 0.044
#> SRR868877     2  0.0747     0.8081 0.016 0.984 0.000
#> SRR868878     2  0.0237     0.8042 0.004 0.996 0.000
#> SRR868879     2  0.2356     0.7965 0.072 0.928 0.000
#> SRR868880     1  0.6168     0.0267 0.588 0.412 0.000
#> SRR868881     3  0.4663     0.7248 0.016 0.156 0.828
#> SRR868882     2  0.8065     0.5379 0.304 0.604 0.092
#> SRR868883     2  0.6244     0.3880 0.440 0.560 0.000
#> SRR868884     3  0.6442     0.2518 0.004 0.432 0.564
#> SRR868885     3  0.4539     0.7363 0.016 0.148 0.836
#> SRR868829     3  0.2066     0.8158 0.060 0.000 0.940
#> SRR868830     1  0.6062     0.3803 0.616 0.000 0.384
#> SRR868831     3  0.0983     0.8175 0.016 0.004 0.980
#> SRR868828     1  0.6034     0.7098 0.780 0.068 0.152
#> SRR868832     3  0.2446     0.8104 0.012 0.052 0.936
#> SRR868833     3  0.2116     0.8127 0.012 0.040 0.948
#> SRR868834     1  0.7360     0.1853 0.528 0.032 0.440
#> SRR868854     1  0.0892     0.7828 0.980 0.020 0.000
#> SRR868859     1  0.1031     0.7818 0.976 0.024 0.000
#> SRR868860     1  0.2356     0.7548 0.928 0.072 0.000
#> SRR868861     1  0.6062     0.7193 0.780 0.072 0.148
#> SRR868862     3  0.4443     0.7981 0.084 0.052 0.864
#> SRR868863     1  0.1411     0.7747 0.964 0.036 0.000
#> SRR868864     1  0.7001     0.4706 0.628 0.032 0.340
#> SRR868865     3  0.7533     0.4587 0.052 0.348 0.600
#> SRR868866     1  0.4628     0.7535 0.856 0.088 0.056
#> SRR868867     3  0.8902     0.3712 0.320 0.144 0.536
#> SRR868868     1  0.4544     0.7565 0.860 0.084 0.056
#> SRR868869     1  0.7058     0.6524 0.720 0.180 0.100
#> SRR868870     2  0.5968     0.5349 0.364 0.636 0.000
#> SRR868871     2  0.0000     0.8057 0.000 1.000 0.000
#> SRR868873     2  0.6299     0.2903 0.476 0.524 0.000
#> SRR868872     2  0.0661     0.7982 0.008 0.988 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> SRR868806     1  0.5663    0.56603 0.676 0.000 0.060 0.264
#> SRR868807     3  0.7398    0.50464 0.180 0.008 0.552 0.260
#> SRR868808     1  0.0524    0.83025 0.988 0.000 0.004 0.008
#> SRR868809     1  0.1151    0.82910 0.968 0.000 0.024 0.008
#> SRR868810     1  0.4284    0.65350 0.780 0.200 0.020 0.000
#> SRR868811     4  0.4244    0.65226 0.000 0.160 0.036 0.804
#> SRR868812     1  0.0657    0.82972 0.984 0.000 0.004 0.012
#> SRR868813     1  0.2281    0.80159 0.904 0.000 0.000 0.096
#> SRR868814     4  0.3591    0.66086 0.168 0.000 0.008 0.824
#> SRR868815     4  0.2076    0.74606 0.056 0.004 0.008 0.932
#> SRR868816     3  0.6282    0.37311 0.392 0.024 0.560 0.024
#> SRR868817     3  0.6223    0.53275 0.292 0.036 0.644 0.028
#> SRR868818     3  0.6066    0.51678 0.312 0.028 0.636 0.024
#> SRR868819     1  0.1940    0.82065 0.924 0.000 0.076 0.000
#> SRR868820     1  0.3837    0.69528 0.776 0.000 0.224 0.000
#> SRR868821     1  0.3266    0.75697 0.832 0.000 0.168 0.000
#> SRR868822     3  0.3894    0.71691 0.088 0.068 0.844 0.000
#> SRR868824     3  0.6219    0.41589 0.372 0.028 0.580 0.020
#> SRR868823     4  0.7408   -0.17244 0.052 0.052 0.448 0.448
#> SRR868825     3  0.3962    0.72292 0.052 0.100 0.844 0.004
#> SRR868826     3  0.6365    0.62353 0.180 0.088 0.700 0.032
#> SRR868827     4  0.5920    0.30946 0.348 0.004 0.040 0.608
#> SRR868835     4  0.4103    0.65403 0.000 0.000 0.256 0.744
#> SRR868836     3  0.1139    0.76470 0.008 0.008 0.972 0.012
#> SRR868837     3  0.5119    0.07598 0.004 0.000 0.556 0.440
#> SRR868838     4  0.1082    0.76783 0.004 0.004 0.020 0.972
#> SRR868839     3  0.7712    0.27415 0.272 0.008 0.504 0.216
#> SRR868840     4  0.3400    0.72158 0.000 0.000 0.180 0.820
#> SRR868841     4  0.1724    0.77131 0.020 0.000 0.032 0.948
#> SRR868842     3  0.2266    0.74181 0.000 0.004 0.912 0.084
#> SRR868843     1  0.1004    0.83398 0.972 0.000 0.004 0.024
#> SRR868844     3  0.5363    0.70595 0.096 0.084 0.784 0.036
#> SRR868845     4  0.1767    0.75772 0.044 0.000 0.012 0.944
#> SRR868846     3  0.1743    0.75563 0.000 0.004 0.940 0.056
#> SRR868847     3  0.4134    0.54848 0.000 0.000 0.740 0.260
#> SRR868848     3  0.4985   -0.00481 0.000 0.000 0.532 0.468
#> SRR868849     3  0.2542    0.73792 0.000 0.012 0.904 0.084
#> SRR868850     4  0.2011    0.76946 0.000 0.000 0.080 0.920
#> SRR868851     4  0.1474    0.77330 0.000 0.000 0.052 0.948
#> SRR868852     3  0.4587    0.61363 0.004 0.028 0.776 0.192
#> SRR868853     4  0.4594    0.62591 0.000 0.008 0.280 0.712
#> SRR868855     4  0.4955    0.24726 0.000 0.000 0.444 0.556
#> SRR868856     4  0.1716    0.77217 0.000 0.000 0.064 0.936
#> SRR868857     3  0.2594    0.75875 0.036 0.004 0.916 0.044
#> SRR868858     4  0.4277    0.62835 0.000 0.000 0.280 0.720
#> SRR868874     2  0.1545    0.81147 0.000 0.952 0.008 0.040
#> SRR868875     2  0.0707    0.81119 0.000 0.980 0.020 0.000
#> SRR868876     2  0.3408    0.78409 0.016 0.860 0.120 0.004
#> SRR868877     2  0.1452    0.81193 0.000 0.956 0.008 0.036
#> SRR868878     2  0.1302    0.81222 0.000 0.956 0.044 0.000
#> SRR868879     2  0.2918    0.78899 0.000 0.876 0.008 0.116
#> SRR868880     4  0.3450    0.63949 0.000 0.156 0.008 0.836
#> SRR868881     1  0.1118    0.82878 0.964 0.000 0.036 0.000
#> SRR868882     2  0.7381    0.58159 0.032 0.612 0.196 0.160
#> SRR868883     2  0.7252    0.35246 0.000 0.528 0.180 0.292
#> SRR868884     2  0.6833    0.45188 0.288 0.588 0.120 0.004
#> SRR868885     1  0.2238    0.82103 0.920 0.004 0.072 0.004
#> SRR868829     1  0.1576    0.82503 0.948 0.000 0.004 0.048
#> SRR868830     1  0.4679    0.46842 0.648 0.000 0.000 0.352
#> SRR868831     1  0.4664    0.56507 0.736 0.004 0.248 0.012
#> SRR868828     4  0.7703   -0.16365 0.064 0.060 0.436 0.440
#> SRR868832     3  0.5583    0.52765 0.320 0.024 0.648 0.008
#> SRR868833     3  0.5505    0.52467 0.324 0.020 0.648 0.008
#> SRR868834     3  0.1675    0.75973 0.004 0.004 0.948 0.044
#> SRR868854     4  0.1867    0.77179 0.000 0.000 0.072 0.928
#> SRR868859     4  0.0927    0.76163 0.016 0.000 0.008 0.976
#> SRR868860     4  0.1059    0.76297 0.000 0.012 0.016 0.972
#> SRR868861     3  0.1151    0.76355 0.000 0.008 0.968 0.024
#> SRR868862     3  0.0992    0.76405 0.008 0.012 0.976 0.004
#> SRR868863     4  0.1389    0.77207 0.000 0.000 0.048 0.952
#> SRR868864     3  0.2125    0.74554 0.000 0.004 0.920 0.076
#> SRR868865     3  0.2667    0.73949 0.020 0.060 0.912 0.008
#> SRR868866     3  0.1576    0.76102 0.000 0.004 0.948 0.048
#> SRR868867     3  0.0336    0.76360 0.000 0.008 0.992 0.000
#> SRR868868     3  0.1256    0.76347 0.000 0.008 0.964 0.028
#> SRR868869     3  0.1767    0.76034 0.000 0.044 0.944 0.012
#> SRR868870     2  0.4836    0.59962 0.000 0.672 0.008 0.320
#> SRR868871     2  0.1637    0.81033 0.000 0.940 0.060 0.000
#> SRR868873     4  0.4175    0.58031 0.000 0.200 0.016 0.784
#> SRR868872     2  0.0817    0.81334 0.000 0.976 0.024 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
#> SRR868806     5  0.5500     0.5806 0.076 0.000 0.024 0.224 0.676
#> SRR868807     3  0.6190     0.6165 0.148 0.000 0.600 0.236 0.016
#> SRR868808     5  0.1492     0.7838 0.008 0.000 0.040 0.004 0.948
#> SRR868809     5  0.3790     0.5996 0.000 0.000 0.272 0.004 0.724
#> SRR868810     5  0.2805     0.7535 0.020 0.072 0.020 0.000 0.888
#> SRR868811     4  0.3849     0.7554 0.052 0.116 0.000 0.820 0.012
#> SRR868812     5  0.3266     0.6893 0.000 0.000 0.200 0.004 0.796
#> SRR868813     5  0.2659     0.7676 0.000 0.000 0.052 0.060 0.888
#> SRR868814     4  0.2364     0.7888 0.008 0.000 0.020 0.908 0.064
#> SRR868815     4  0.2437     0.7759 0.004 0.000 0.060 0.904 0.032
#> SRR868816     3  0.1911     0.7990 0.004 0.000 0.932 0.028 0.036
#> SRR868817     3  0.1882     0.8127 0.016 0.004 0.940 0.020 0.020
#> SRR868818     3  0.1498     0.8101 0.008 0.000 0.952 0.016 0.024
#> SRR868819     5  0.3975     0.7475 0.144 0.000 0.064 0.000 0.792
#> SRR868820     5  0.5235     0.5362 0.312 0.000 0.068 0.000 0.620
#> SRR868821     5  0.4755     0.6568 0.244 0.000 0.060 0.000 0.696
#> SRR868822     3  0.4402     0.4623 0.372 0.000 0.620 0.004 0.004
#> SRR868824     3  0.1554     0.8078 0.012 0.004 0.952 0.008 0.024
#> SRR868823     3  0.4284     0.7129 0.040 0.000 0.752 0.204 0.004
#> SRR868825     3  0.3917     0.6760 0.244 0.004 0.744 0.004 0.004
#> SRR868826     3  0.2011     0.8147 0.044 0.008 0.928 0.020 0.000
#> SRR868827     4  0.6449     0.0804 0.008 0.000 0.368 0.480 0.144
#> SRR868835     1  0.4450     0.1574 0.508 0.000 0.000 0.488 0.004
#> SRR868836     1  0.1282     0.8139 0.952 0.000 0.044 0.004 0.000
#> SRR868837     1  0.3412     0.7746 0.812 0.000 0.008 0.172 0.008
#> SRR868838     4  0.1300     0.8076 0.016 0.000 0.028 0.956 0.000
#> SRR868839     1  0.5323     0.5336 0.644 0.004 0.000 0.076 0.276
#> SRR868840     4  0.4220     0.4804 0.300 0.000 0.004 0.688 0.008
#> SRR868841     4  0.1788     0.8144 0.056 0.000 0.008 0.932 0.004
#> SRR868842     1  0.2582     0.8180 0.904 0.008 0.008 0.060 0.020
#> SRR868843     5  0.1717     0.7820 0.004 0.000 0.052 0.008 0.936
#> SRR868844     3  0.2825     0.7814 0.124 0.000 0.860 0.016 0.000
#> SRR868845     4  0.1673     0.8078 0.016 0.000 0.008 0.944 0.032
#> SRR868846     1  0.1750     0.8195 0.936 0.000 0.036 0.028 0.000
#> SRR868847     1  0.4022     0.7733 0.804 0.000 0.100 0.092 0.004
#> SRR868848     1  0.4644     0.7044 0.720 0.000 0.052 0.224 0.004
#> SRR868849     1  0.1605     0.8197 0.944 0.004 0.000 0.040 0.012
#> SRR868850     4  0.2787     0.7695 0.136 0.000 0.004 0.856 0.004
#> SRR868851     4  0.2170     0.8070 0.088 0.000 0.004 0.904 0.004
#> SRR868852     1  0.3972     0.7811 0.828 0.020 0.004 0.088 0.060
#> SRR868853     1  0.5825     0.5791 0.632 0.028 0.000 0.264 0.076
#> SRR868855     1  0.4015     0.6846 0.724 0.000 0.008 0.264 0.004
#> SRR868856     4  0.2597     0.7883 0.120 0.000 0.004 0.872 0.004
#> SRR868857     1  0.3164     0.7864 0.876 0.016 0.012 0.020 0.076
#> SRR868858     1  0.5369     0.4480 0.580 0.004 0.008 0.372 0.036
#> SRR868874     2  0.0955     0.8206 0.000 0.968 0.004 0.028 0.000
#> SRR868875     2  0.0451     0.8214 0.004 0.988 0.008 0.000 0.000
#> SRR868876     2  0.2011     0.8085 0.044 0.928 0.008 0.000 0.020
#> SRR868877     2  0.1043     0.8191 0.000 0.960 0.000 0.040 0.000
#> SRR868878     2  0.0854     0.8222 0.012 0.976 0.004 0.000 0.008
#> SRR868879     2  0.1544     0.8105 0.000 0.932 0.000 0.068 0.000
#> SRR868880     4  0.3340     0.7171 0.004 0.156 0.016 0.824 0.000
#> SRR868881     5  0.1618     0.7790 0.040 0.008 0.008 0.000 0.944
#> SRR868882     2  0.6808     0.5262 0.236 0.580 0.000 0.092 0.092
#> SRR868883     2  0.6745     0.3922 0.248 0.528 0.000 0.204 0.020
#> SRR868884     2  0.6126     0.4241 0.116 0.580 0.008 0.004 0.292
#> SRR868885     5  0.2588     0.7630 0.100 0.008 0.008 0.000 0.884
#> SRR868829     5  0.5759     0.4621 0.000 0.000 0.276 0.128 0.596
#> SRR868830     4  0.5862     0.2494 0.000 0.000 0.112 0.544 0.344
#> SRR868831     3  0.3963     0.5480 0.004 0.000 0.732 0.008 0.256
#> SRR868828     3  0.4132     0.7139 0.032 0.004 0.760 0.204 0.000
#> SRR868832     3  0.2067     0.8108 0.044 0.004 0.924 0.000 0.028
#> SRR868833     3  0.1901     0.8120 0.040 0.004 0.932 0.000 0.024
#> SRR868834     1  0.1651     0.8232 0.944 0.000 0.012 0.036 0.008
#> SRR868854     4  0.2516     0.7767 0.140 0.000 0.000 0.860 0.000
#> SRR868859     4  0.1710     0.8111 0.024 0.012 0.000 0.944 0.020
#> SRR868860     4  0.4743     0.7213 0.048 0.132 0.020 0.780 0.020
#> SRR868861     1  0.2517     0.7752 0.884 0.000 0.104 0.008 0.004
#> SRR868862     1  0.0968     0.8147 0.972 0.004 0.012 0.000 0.012
#> SRR868863     4  0.1671     0.8114 0.076 0.000 0.000 0.924 0.000
#> SRR868864     1  0.2199     0.8248 0.916 0.000 0.016 0.060 0.008
#> SRR868865     1  0.3579     0.7640 0.852 0.048 0.008 0.012 0.080
#> SRR868866     1  0.2972     0.7797 0.864 0.000 0.108 0.024 0.004
#> SRR868867     1  0.1357     0.8064 0.948 0.004 0.048 0.000 0.000
#> SRR868868     1  0.2664     0.7908 0.884 0.000 0.092 0.020 0.004
#> SRR868869     1  0.3317     0.6836 0.804 0.000 0.188 0.004 0.004
#> SRR868870     2  0.4617     0.5546 0.000 0.668 0.024 0.304 0.004
#> SRR868871     2  0.0854     0.8222 0.012 0.976 0.004 0.000 0.008
#> SRR868873     4  0.3893     0.6376 0.004 0.224 0.008 0.760 0.004
#> SRR868872     2  0.0486     0.8211 0.004 0.988 0.004 0.000 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
#> SRR868806     5  0.7119   -0.00677 0.052 0.000 0.024 0.316 0.432 0.176
#> SRR868807     3  0.5912    0.62748 0.144 0.000 0.632 0.168 0.012 0.044
#> SRR868808     5  0.2527    0.59310 0.008 0.000 0.056 0.004 0.892 0.040
#> SRR868809     5  0.4920    0.45342 0.016 0.000 0.260 0.004 0.660 0.060
#> SRR868810     5  0.3319    0.52438 0.016 0.072 0.008 0.008 0.856 0.040
#> SRR868811     4  0.3360    0.69256 0.036 0.068 0.004 0.856 0.020 0.016
#> SRR868812     5  0.3658    0.57140 0.004 0.000 0.104 0.000 0.800 0.092
#> SRR868813     5  0.4674    0.54069 0.004 0.000 0.052 0.080 0.752 0.112
#> SRR868814     4  0.5163    0.45383 0.004 0.000 0.044 0.692 0.080 0.180
#> SRR868815     4  0.3359    0.58092 0.000 0.000 0.128 0.820 0.008 0.044
#> SRR868816     3  0.2189    0.77668 0.004 0.000 0.916 0.028 0.024 0.028
#> SRR868817     3  0.1596    0.78432 0.004 0.000 0.944 0.020 0.020 0.012
#> SRR868818     3  0.1779    0.78286 0.004 0.000 0.936 0.020 0.020 0.020
#> SRR868819     6  0.4846    0.58874 0.060 0.000 0.004 0.000 0.344 0.592
#> SRR868820     6  0.5567    0.61553 0.144 0.000 0.008 0.004 0.252 0.592
#> SRR868821     6  0.5175    0.63510 0.100 0.000 0.004 0.000 0.308 0.588
#> SRR868822     3  0.5071    0.48097 0.356 0.000 0.564 0.004 0.000 0.076
#> SRR868824     3  0.2688    0.76851 0.024 0.000 0.884 0.004 0.068 0.020
#> SRR868823     3  0.3989    0.68892 0.036 0.000 0.768 0.172 0.000 0.024
#> SRR868825     3  0.4449    0.61731 0.272 0.000 0.672 0.004 0.000 0.052
#> SRR868826     3  0.1777    0.78820 0.032 0.000 0.932 0.024 0.000 0.012
#> SRR868827     6  0.6945    0.19017 0.012 0.000 0.212 0.176 0.088 0.512
#> SRR868835     1  0.5408    0.15299 0.508 0.000 0.004 0.396 0.004 0.088
#> SRR868836     1  0.2994    0.72247 0.872 0.000 0.044 0.040 0.004 0.040
#> SRR868837     1  0.4654    0.29848 0.560 0.000 0.008 0.408 0.008 0.016
#> SRR868838     4  0.1820    0.67641 0.012 0.000 0.044 0.928 0.000 0.016
#> SRR868839     1  0.6911    0.45424 0.520 0.008 0.004 0.144 0.232 0.092
#> SRR868840     4  0.3686    0.58841 0.208 0.000 0.012 0.764 0.012 0.004
#> SRR868841     4  0.2911    0.70688 0.076 0.000 0.020 0.872 0.024 0.008
#> SRR868842     1  0.3407    0.71561 0.840 0.004 0.004 0.100 0.024 0.028
#> SRR868843     5  0.3316    0.58501 0.024 0.000 0.044 0.028 0.860 0.044
#> SRR868844     3  0.3058    0.76625 0.124 0.000 0.840 0.024 0.000 0.012
#> SRR868845     4  0.2431    0.67848 0.004 0.000 0.016 0.896 0.068 0.016
#> SRR868846     1  0.2022    0.72298 0.916 0.000 0.024 0.052 0.000 0.008
#> SRR868847     1  0.4598    0.66673 0.736 0.000 0.116 0.124 0.000 0.024
#> SRR868848     1  0.4636    0.57521 0.672 0.000 0.048 0.264 0.000 0.016
#> SRR868849     1  0.3129    0.71987 0.852 0.004 0.000 0.080 0.008 0.056
#> SRR868850     4  0.2766    0.68306 0.124 0.000 0.020 0.852 0.000 0.004
#> SRR868851     4  0.3103    0.70369 0.100 0.000 0.016 0.848 0.000 0.036
#> SRR868852     1  0.7122    0.49665 0.544 0.020 0.016 0.196 0.144 0.080
#> SRR868853     4  0.6926    0.13378 0.320 0.004 0.016 0.468 0.136 0.056
#> SRR868855     4  0.4300    0.00224 0.456 0.000 0.012 0.528 0.004 0.000
#> SRR868856     4  0.2620    0.69725 0.108 0.000 0.012 0.868 0.000 0.012
#> SRR868857     1  0.6554    0.59946 0.624 0.012 0.028 0.100 0.148 0.088
#> SRR868858     4  0.6208    0.24226 0.312 0.000 0.012 0.532 0.108 0.036
#> SRR868874     2  0.2187    0.78485 0.004 0.908 0.012 0.012 0.000 0.064
#> SRR868875     2  0.0767    0.79998 0.004 0.976 0.012 0.000 0.000 0.008
#> SRR868876     2  0.2215    0.77372 0.032 0.916 0.008 0.000 0.024 0.020
#> SRR868877     2  0.2452    0.77716 0.000 0.884 0.004 0.028 0.000 0.084
#> SRR868878     2  0.0622    0.79999 0.012 0.980 0.008 0.000 0.000 0.000
#> SRR868879     2  0.2333    0.78096 0.004 0.896 0.000 0.040 0.000 0.060
#> SRR868880     4  0.5178    0.53424 0.000 0.188 0.044 0.692 0.008 0.068
#> SRR868881     5  0.2800    0.52727 0.032 0.012 0.004 0.008 0.884 0.060
#> SRR868882     2  0.7456    0.32713 0.144 0.492 0.000 0.136 0.192 0.036
#> SRR868883     4  0.7590    0.16762 0.164 0.352 0.016 0.376 0.076 0.016
#> SRR868884     2  0.7467    0.17462 0.052 0.436 0.036 0.016 0.324 0.136
#> SRR868885     5  0.3912    0.49224 0.044 0.024 0.008 0.012 0.820 0.092
#> SRR868829     5  0.6074    0.40773 0.000 0.000 0.212 0.052 0.580 0.156
#> SRR868830     5  0.7371    0.13511 0.000 0.000 0.144 0.260 0.392 0.204
#> SRR868831     3  0.4516    0.49547 0.008 0.000 0.668 0.000 0.276 0.048
#> SRR868828     3  0.3856    0.70688 0.032 0.000 0.784 0.156 0.000 0.028
#> SRR868832     3  0.3296    0.76984 0.072 0.000 0.844 0.004 0.068 0.012
#> SRR868833     3  0.2907    0.77663 0.064 0.000 0.868 0.004 0.056 0.008
#> SRR868834     1  0.3147    0.72287 0.852 0.000 0.016 0.092 0.004 0.036
#> SRR868854     4  0.4848    0.64410 0.164 0.004 0.012 0.704 0.000 0.116
#> SRR868859     4  0.3256    0.68174 0.028 0.004 0.008 0.860 0.032 0.068
#> SRR868860     4  0.7712    0.21927 0.124 0.104 0.024 0.440 0.020 0.288
#> SRR868861     1  0.3253    0.65075 0.832 0.000 0.068 0.004 0.000 0.096
#> SRR868862     1  0.2460    0.70063 0.896 0.000 0.016 0.020 0.004 0.064
#> SRR868863     4  0.2506    0.70922 0.068 0.000 0.000 0.880 0.000 0.052
#> SRR868864     1  0.4973    0.66384 0.724 0.000 0.040 0.164 0.020 0.052
#> SRR868865     1  0.7266    0.55239 0.584 0.056 0.032 0.092 0.148 0.088
#> SRR868866     1  0.3588    0.62200 0.788 0.000 0.060 0.000 0.000 0.152
#> SRR868867     1  0.3135    0.65989 0.836 0.000 0.028 0.012 0.000 0.124
#> SRR868868     1  0.3608    0.62489 0.788 0.000 0.064 0.000 0.000 0.148
#> SRR868869     1  0.3940    0.58867 0.764 0.000 0.096 0.000 0.000 0.140
#> SRR868870     2  0.6036    0.50947 0.004 0.596 0.016 0.212 0.016 0.156
#> SRR868871     2  0.0508    0.80087 0.012 0.984 0.004 0.000 0.000 0.000
#> SRR868873     4  0.5018    0.40653 0.004 0.280 0.016 0.640 0.000 0.060
#> SRR868872     2  0.0405    0.80119 0.008 0.988 0.004 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-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