cola Report for recount2:SRP049820

Date: 2019-12-26 00:28:00 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 9409 rows and 83 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] 9409   83

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
CV:kmeans 2 1.000 0.979 0.989 **
CV:skmeans 2 1.000 0.945 0.980 **
ATC:pam 2 1.000 0.945 0.979 **
SD:NMF 2 0.974 0.957 0.982 **
ATC:kmeans 3 0.967 0.912 0.958 ** 2
CV:pam 2 0.948 0.947 0.975 *
ATC:skmeans 4 0.931 0.883 0.949 * 2,3
MAD:skmeans 4 0.904 0.890 0.950 *
CV:mclust 2 0.900 0.922 0.969 *
MAD:mclust 5 0.862 0.812 0.916
MAD:pam 2 0.833 0.899 0.958
MAD:NMF 2 0.830 0.914 0.963
MAD:kmeans 4 0.800 0.877 0.903
SD:skmeans 2 0.770 0.890 0.951
SD:kmeans 2 0.761 0.861 0.945
SD:mclust 5 0.751 0.745 0.866
ATC:NMF 2 0.739 0.869 0.943
CV:NMF 2 0.712 0.873 0.942
SD:pam 2 0.706 0.880 0.944
ATC:hclust 2 0.564 0.864 0.916
MAD:hclust 2 0.493 0.771 0.891
CV:hclust 2 0.366 0.746 0.833
ATC:mclust 4 0.357 0.639 0.749
SD:hclust 2 0.330 0.789 0.869

**: 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.974           0.957       0.982          0.501 0.498   0.498
#> CV:NMF      2 0.712           0.873       0.942          0.477 0.510   0.510
#> MAD:NMF     2 0.830           0.914       0.963          0.493 0.503   0.503
#> ATC:NMF     2 0.739           0.869       0.943          0.501 0.494   0.494
#> SD:skmeans  2 0.770           0.890       0.951          0.506 0.495   0.495
#> CV:skmeans  2 1.000           0.945       0.980          0.504 0.496   0.496
#> MAD:skmeans 2 0.648           0.851       0.934          0.506 0.494   0.494
#> ATC:skmeans 2 1.000           0.982       0.992          0.502 0.500   0.500
#> SD:mclust   2 0.487           0.903       0.918          0.229 0.804   0.804
#> CV:mclust   2 0.900           0.922       0.969          0.223 0.785   0.785
#> MAD:mclust  2 0.488           0.830       0.902          0.310 0.685   0.685
#> ATC:mclust  2 0.582           0.711       0.900          0.228 0.824   0.824
#> SD:kmeans   2 0.761           0.861       0.945          0.484 0.515   0.515
#> CV:kmeans   2 1.000           0.979       0.989          0.480 0.520   0.520
#> MAD:kmeans  2 0.545           0.770       0.904          0.490 0.495   0.495
#> ATC:kmeans  2 1.000           0.988       0.995          0.476 0.526   0.526
#> SD:pam      2 0.706           0.880       0.944          0.491 0.503   0.503
#> CV:pam      2 0.948           0.947       0.975          0.436 0.547   0.547
#> MAD:pam     2 0.833           0.899       0.958          0.481 0.515   0.515
#> ATC:pam     2 1.000           0.945       0.979          0.503 0.496   0.496
#> SD:hclust   2 0.330           0.789       0.869          0.463 0.496   0.496
#> CV:hclust   2 0.366           0.746       0.833          0.434 0.526   0.526
#> MAD:hclust  2 0.493           0.771       0.891          0.479 0.495   0.495
#> ATC:hclust  2 0.564           0.864       0.916          0.466 0.526   0.526
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.653           0.808       0.880         0.2486 0.843   0.693
#> CV:NMF      3 0.724           0.805       0.910         0.1878 0.916   0.837
#> MAD:NMF     3 0.552           0.596       0.801         0.2467 0.804   0.639
#> ATC:NMF     3 0.463           0.658       0.817         0.1980 0.918   0.842
#> SD:skmeans  3 0.825           0.843       0.938         0.3023 0.743   0.529
#> CV:skmeans  3 0.756           0.778       0.901         0.2499 0.864   0.731
#> MAD:skmeans 3 0.899           0.861       0.943         0.2989 0.760   0.555
#> ATC:skmeans 3 1.000           0.934       0.976         0.2581 0.852   0.709
#> SD:mclust   3 0.189           0.470       0.723         1.3275 0.637   0.559
#> CV:mclust   3 0.351           0.642       0.784         1.0325 0.906   0.881
#> MAD:mclust  3 0.346           0.797       0.827         0.7952 0.568   0.434
#> ATC:mclust  3 0.402           0.397       0.679         1.3722 0.520   0.465
#> SD:kmeans   3 0.598           0.739       0.858         0.3705 0.717   0.496
#> CV:kmeans   3 0.618           0.732       0.808         0.2858 0.730   0.519
#> MAD:kmeans  3 0.783           0.798       0.899         0.3611 0.702   0.467
#> ATC:kmeans  3 0.967           0.912       0.958         0.4098 0.745   0.540
#> SD:pam      3 0.849           0.855       0.943         0.3457 0.740   0.526
#> CV:pam      3 0.689           0.832       0.905         0.3341 0.820   0.686
#> MAD:pam     3 0.633           0.641       0.848         0.3120 0.750   0.551
#> ATC:pam     3 0.870           0.870       0.940         0.3239 0.760   0.550
#> SD:hclust   3 0.445           0.704       0.805         0.3239 0.888   0.775
#> CV:hclust   3 0.392           0.737       0.827         0.0901 0.957   0.918
#> MAD:hclust  3 0.397           0.497       0.750         0.2670 0.989   0.977
#> ATC:hclust  3 0.521           0.764       0.845         0.3659 0.797   0.622
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.566           0.705       0.840         0.0827 0.947   0.860
#> CV:NMF      4 0.563           0.697       0.852         0.0921 0.955   0.898
#> MAD:NMF     4 0.526           0.660       0.818         0.0936 0.848   0.652
#> ATC:NMF     4 0.417           0.444       0.737         0.1242 0.847   0.699
#> SD:skmeans  4 0.872           0.881       0.946         0.1361 0.879   0.658
#> CV:skmeans  4 0.698           0.690       0.851         0.0996 0.900   0.743
#> MAD:skmeans 4 0.904           0.890       0.950         0.1344 0.863   0.629
#> ATC:skmeans 4 0.931           0.883       0.949         0.0990 0.906   0.752
#> SD:mclust   4 0.533           0.771       0.836         0.3395 0.616   0.308
#> CV:mclust   4 0.349           0.525       0.721         0.3271 0.632   0.495
#> MAD:mclust  4 0.314           0.484       0.712         0.1386 0.774   0.518
#> ATC:mclust  4 0.357           0.639       0.749         0.1520 0.713   0.473
#> SD:kmeans   4 0.768           0.847       0.900         0.1176 0.857   0.600
#> CV:kmeans   4 0.743           0.772       0.874         0.1195 0.922   0.779
#> MAD:kmeans  4 0.800           0.877       0.903         0.1088 0.851   0.589
#> ATC:kmeans  4 0.760           0.805       0.865         0.0988 0.887   0.678
#> SD:pam      4 0.832           0.803       0.927         0.1006 0.934   0.802
#> CV:pam      4 0.795           0.796       0.916         0.0448 0.996   0.989
#> MAD:pam     4 0.645           0.588       0.834         0.1222 0.888   0.699
#> ATC:pam     4 0.872           0.864       0.940         0.0713 0.953   0.857
#> SD:hclust   4 0.584           0.691       0.785         0.1579 0.858   0.636
#> CV:hclust   4 0.397           0.689       0.828         0.0512 0.977   0.952
#> MAD:hclust  4 0.435           0.598       0.715         0.1162 0.736   0.473
#> ATC:hclust  4 0.640           0.685       0.807         0.1364 0.891   0.704
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.566           0.601       0.817         0.0462 0.953   0.867
#> CV:NMF      5 0.495           0.570       0.801         0.0596 0.962   0.910
#> MAD:NMF     5 0.512           0.611       0.806         0.0533 0.966   0.901
#> ATC:NMF     5 0.420           0.397       0.668         0.0721 0.857   0.668
#> SD:skmeans  5 0.773           0.698       0.842         0.0438 0.955   0.829
#> CV:skmeans  5 0.689           0.652       0.836         0.0533 0.960   0.869
#> MAD:skmeans 5 0.763           0.743       0.871         0.0445 0.967   0.873
#> ATC:skmeans 5 0.844           0.782       0.899         0.0433 0.956   0.859
#> SD:mclust   5 0.751           0.745       0.866         0.0915 0.916   0.694
#> CV:mclust   5 0.393           0.603       0.693         0.1561 0.835   0.594
#> MAD:mclust  5 0.862           0.812       0.916         0.2218 0.836   0.519
#> ATC:mclust  5 0.607           0.793       0.842         0.0368 0.656   0.344
#> SD:kmeans   5 0.817           0.790       0.868         0.0504 0.964   0.863
#> CV:kmeans   5 0.689           0.627       0.809         0.0647 0.909   0.723
#> MAD:kmeans  5 0.828           0.811       0.887         0.0489 0.989   0.957
#> ATC:kmeans  5 0.702           0.622       0.771         0.0559 0.957   0.837
#> SD:pam      5 0.744           0.609       0.846         0.0433 0.988   0.954
#> CV:pam      5 0.788           0.733       0.892         0.0457 1.000   1.000
#> MAD:pam     5 0.747           0.718       0.863         0.0650 0.856   0.555
#> ATC:pam     5 0.802           0.816       0.900         0.0747 0.927   0.756
#> SD:hclust   5 0.617           0.668       0.819         0.0342 0.978   0.915
#> CV:hclust   5 0.387           0.730       0.828         0.0289 1.000   0.999
#> MAD:hclust  5 0.500           0.517       0.729         0.0598 0.907   0.697
#> ATC:hclust  5 0.675           0.708       0.805         0.0553 0.923   0.736
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.572           0.570       0.802        0.04063 0.954   0.865
#> CV:NMF      6 0.506           0.516       0.763        0.03669 0.917   0.802
#> MAD:NMF     6 0.510           0.542       0.776        0.03700 0.963   0.886
#> ATC:NMF     6 0.451           0.366       0.637        0.04637 0.940   0.817
#> SD:skmeans  6 0.736           0.534       0.761        0.03218 0.966   0.858
#> CV:skmeans  6 0.696           0.601       0.807        0.03587 0.979   0.926
#> MAD:skmeans 6 0.743           0.548       0.805        0.03004 0.966   0.857
#> ATC:skmeans 6 0.836           0.727       0.871        0.02648 0.976   0.914
#> SD:mclust   6 0.825           0.818       0.896        0.04853 0.934   0.711
#> CV:mclust   6 0.611           0.469       0.685        0.13451 0.809   0.408
#> MAD:mclust  6 0.816           0.743       0.875        0.04970 0.935   0.720
#> ATC:mclust  6 0.662           0.685       0.797        0.16998 0.785   0.471
#> SD:kmeans   6 0.761           0.618       0.808        0.03432 0.975   0.896
#> CV:kmeans   6 0.704           0.708       0.793        0.03714 0.874   0.596
#> MAD:kmeans  6 0.781           0.607       0.815        0.03377 0.980   0.917
#> ATC:kmeans  6 0.701           0.461       0.729        0.03685 0.910   0.651
#> SD:pam      6 0.727           0.661       0.837        0.03846 0.882   0.588
#> CV:pam      6 0.797           0.844       0.919        0.05067 0.876   0.708
#> MAD:pam     6 0.743           0.714       0.881        0.01590 0.996   0.983
#> ATC:pam     6 0.763           0.741       0.873        0.02122 0.996   0.982
#> SD:hclust   6 0.613           0.653       0.830        0.01362 0.995   0.981
#> CV:hclust   6 0.348           0.700       0.824        0.00781 0.999   0.999
#> MAD:hclust  6 0.543           0.535       0.720        0.03618 0.836   0.516
#> ATC:hclust  6 0.699           0.666       0.812        0.01774 0.976   0.896

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 = 941, method = "euler")

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

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

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

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

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

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

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

top_rows_overlap(res_list, top_n = 4704, 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 = 941, method = "correspondance")

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

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

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

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

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

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

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

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

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

Heatmaps of the top rows:

top_rows_heatmap(res_list, top_n = 941)

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

top_rows_heatmap(res_list, top_n = 1882)

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

top_rows_heatmap(res_list, top_n = 2822)

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

top_rows_heatmap(res_list, top_n = 3763)

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

top_rows_heatmap(res_list, top_n = 4704)

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

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

collect_plots(res)

plot of chunk SD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.330           0.789       0.869         0.4628 0.496   0.496
#> 3 3 0.445           0.704       0.805         0.3239 0.888   0.775
#> 4 4 0.584           0.691       0.785         0.1579 0.858   0.636
#> 5 5 0.617           0.668       0.819         0.0342 0.978   0.915
#> 6 6 0.613           0.653       0.830         0.0136 0.995   0.981

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
#> SRR1652895     1  0.0000      0.890 1.000 0.000
#> SRR1652896     1  0.9000      0.594 0.684 0.316
#> SRR1652897     1  0.8327      0.558 0.736 0.264
#> SRR1652898     1  0.0376      0.890 0.996 0.004
#> SRR1652899     1  0.0376      0.890 0.996 0.004
#> SRR1652900     2  0.2236      0.805 0.036 0.964
#> SRR1652901     2  0.9000      0.729 0.316 0.684
#> SRR1652902     1  0.0376      0.890 0.996 0.004
#> SRR1652903     1  0.0000      0.890 1.000 0.000
#> SRR1652904     1  0.0000      0.890 1.000 0.000
#> SRR1652905     2  0.5629      0.817 0.132 0.868
#> SRR1652906     1  0.0938      0.889 0.988 0.012
#> SRR1652907     1  0.0000      0.890 1.000 0.000
#> SRR1652908     2  0.4690      0.822 0.100 0.900
#> SRR1652909     1  0.1843      0.883 0.972 0.028
#> SRR1652910     1  0.0000      0.890 1.000 0.000
#> SRR1652911     1  0.0000      0.890 1.000 0.000
#> SRR1652912     2  0.0000      0.791 0.000 1.000
#> SRR1652913     2  0.9044      0.740 0.320 0.680
#> SRR1652914     1  0.6048      0.825 0.852 0.148
#> SRR1652915     1  0.5842      0.831 0.860 0.140
#> SRR1652916     1  0.3879      0.843 0.924 0.076
#> SRR1652917     2  0.9358      0.700 0.352 0.648
#> SRR1652918     2  0.6973      0.817 0.188 0.812
#> SRR1652919     1  0.7139      0.777 0.804 0.196
#> SRR1652920     2  0.0000      0.791 0.000 1.000
#> SRR1652921     2  0.9286      0.713 0.344 0.656
#> SRR1652922     1  0.4562      0.858 0.904 0.096
#> SRR1652923     1  0.6048      0.825 0.852 0.148
#> SRR1652924     2  0.9044      0.740 0.320 0.680
#> SRR1652925     2  0.5059      0.823 0.112 0.888
#> SRR1652926     2  0.7602      0.805 0.220 0.780
#> SRR1652927     1  0.0000      0.890 1.000 0.000
#> SRR1652928     1  0.0000      0.890 1.000 0.000
#> SRR1652929     1  0.6048      0.825 0.852 0.148
#> SRR1652930     1  0.0000      0.890 1.000 0.000
#> SRR1652931     1  0.9944      0.194 0.544 0.456
#> SRR1652932     1  0.0000      0.890 1.000 0.000
#> SRR1652933     2  0.7815      0.801 0.232 0.768
#> SRR1652934     2  0.9358      0.700 0.352 0.648
#> SRR1652935     2  0.3733      0.813 0.072 0.928
#> SRR1652936     2  0.0000      0.791 0.000 1.000
#> SRR1652937     1  0.0376      0.890 0.996 0.004
#> SRR1652938     2  0.8763      0.758 0.296 0.704
#> SRR1652939     2  0.8763      0.758 0.296 0.704
#> SRR1652940     1  0.0000      0.890 1.000 0.000
#> SRR1652941     1  0.9710      0.114 0.600 0.400
#> SRR1652942     2  0.0000      0.791 0.000 1.000
#> SRR1652943     2  0.6973      0.817 0.188 0.812
#> SRR1652944     1  0.6048      0.825 0.852 0.148
#> SRR1652945     2  0.6973      0.817 0.188 0.812
#> SRR1652946     2  0.9044      0.740 0.320 0.680
#> SRR1652947     1  0.0000      0.890 1.000 0.000
#> SRR1652948     1  0.9393      0.516 0.644 0.356
#> SRR1652949     1  0.0376      0.890 0.996 0.004
#> SRR1652950     1  0.4562      0.858 0.904 0.096
#> SRR1652951     2  0.0000      0.791 0.000 1.000
#> SRR1652953     1  0.0000      0.890 1.000 0.000
#> SRR1652952     2  0.0000      0.791 0.000 1.000
#> SRR1652954     2  0.9358      0.700 0.352 0.648
#> SRR1652955     1  0.4815      0.854 0.896 0.104
#> SRR1652958     1  0.0376      0.890 0.996 0.004
#> SRR1652956     2  0.0000      0.791 0.000 1.000
#> SRR1652957     2  0.9358      0.700 0.352 0.648
#> SRR1652959     2  0.4431      0.816 0.092 0.908
#> SRR1652960     2  0.4690      0.822 0.100 0.900
#> SRR1652961     2  0.0000      0.791 0.000 1.000
#> SRR1652962     2  0.0000      0.791 0.000 1.000
#> SRR1652963     2  0.2236      0.805 0.036 0.964
#> SRR1652965     1  0.4431      0.860 0.908 0.092
#> SRR1652964     2  0.8499      0.678 0.276 0.724
#> SRR1652966     1  0.0000      0.890 1.000 0.000
#> SRR1652967     2  0.7056      0.700 0.192 0.808
#> SRR1652969     2  0.9358      0.700 0.352 0.648
#> SRR1652968     1  0.6048      0.825 0.852 0.148
#> SRR1652970     1  0.0000      0.890 1.000 0.000
#> SRR1652971     1  0.9427      0.530 0.640 0.360
#> SRR1652972     1  0.2043      0.882 0.968 0.032
#> SRR1652973     2  0.9358      0.700 0.352 0.648
#> SRR1652974     1  0.0000      0.890 1.000 0.000
#> SRR1652975     2  0.6343      0.822 0.160 0.840
#> SRR1652976     2  0.8499      0.678 0.276 0.724
#> SRR1652977     1  0.6048      0.825 0.852 0.148

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652896     1  0.9372     0.4791 0.500 0.300 0.200
#> SRR1652897     1  0.6209     0.2862 0.628 0.368 0.004
#> SRR1652898     1  0.0237     0.8254 0.996 0.000 0.004
#> SRR1652899     1  0.0592     0.8242 0.988 0.012 0.000
#> SRR1652900     3  0.2774     0.7955 0.008 0.072 0.920
#> SRR1652901     2  0.7926     0.7040 0.216 0.656 0.128
#> SRR1652902     1  0.0592     0.8242 0.988 0.012 0.000
#> SRR1652903     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652904     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652905     2  0.7310     0.2617 0.040 0.600 0.360
#> SRR1652906     1  0.0592     0.8253 0.988 0.012 0.000
#> SRR1652907     1  0.0000     0.8249 1.000 0.000 0.000
#> SRR1652908     3  0.5526     0.7001 0.036 0.172 0.792
#> SRR1652909     1  0.2066     0.8020 0.940 0.060 0.000
#> SRR1652910     1  0.0000     0.8249 1.000 0.000 0.000
#> SRR1652911     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652912     3  0.0424     0.8097 0.000 0.008 0.992
#> SRR1652913     2  0.5147     0.8270 0.180 0.800 0.020
#> SRR1652914     1  0.6714     0.6914 0.672 0.296 0.032
#> SRR1652915     1  0.6653     0.6978 0.680 0.288 0.032
#> SRR1652916     1  0.3851     0.7286 0.860 0.136 0.004
#> SRR1652917     2  0.5633     0.8251 0.208 0.768 0.024
#> SRR1652918     2  0.6495     0.6872 0.060 0.740 0.200
#> SRR1652919     1  0.7931     0.6444 0.624 0.284 0.092
#> SRR1652920     3  0.2448     0.7824 0.000 0.076 0.924
#> SRR1652921     2  0.5455     0.8248 0.204 0.776 0.020
#> SRR1652922     1  0.5633     0.7397 0.768 0.208 0.024
#> SRR1652923     1  0.6714     0.6914 0.672 0.296 0.032
#> SRR1652924     2  0.5147     0.8270 0.180 0.800 0.020
#> SRR1652925     2  0.6969     0.3275 0.024 0.596 0.380
#> SRR1652926     2  0.6144     0.7545 0.088 0.780 0.132
#> SRR1652927     1  0.0000     0.8249 1.000 0.000 0.000
#> SRR1652928     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652929     1  0.6714     0.6914 0.672 0.296 0.032
#> SRR1652930     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652931     1  0.9864     0.2166 0.416 0.288 0.296
#> SRR1652932     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652933     2  0.8349     0.5397 0.108 0.584 0.308
#> SRR1652934     2  0.5633     0.8251 0.208 0.768 0.024
#> SRR1652935     3  0.3083     0.7844 0.024 0.060 0.916
#> SRR1652936     3  0.0424     0.8097 0.000 0.008 0.992
#> SRR1652937     1  0.0892     0.8232 0.980 0.020 0.000
#> SRR1652938     2  0.4411     0.8145 0.140 0.844 0.016
#> SRR1652939     2  0.4475     0.8169 0.144 0.840 0.016
#> SRR1652940     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652941     1  0.7841    -0.2171 0.480 0.468 0.052
#> SRR1652942     3  0.0424     0.8097 0.000 0.008 0.992
#> SRR1652943     2  0.6495     0.6872 0.060 0.740 0.200
#> SRR1652944     1  0.6714     0.6914 0.672 0.296 0.032
#> SRR1652945     2  0.6495     0.6872 0.060 0.740 0.200
#> SRR1652946     2  0.5147     0.8270 0.180 0.800 0.020
#> SRR1652947     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652948     1  0.9431     0.4175 0.500 0.220 0.280
#> SRR1652949     1  0.0237     0.8254 0.996 0.000 0.004
#> SRR1652950     1  0.6105     0.7229 0.724 0.252 0.024
#> SRR1652951     3  0.0424     0.8097 0.000 0.008 0.992
#> SRR1652953     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652952     3  0.0424     0.8097 0.000 0.008 0.992
#> SRR1652954     2  0.5633     0.8251 0.208 0.768 0.024
#> SRR1652955     1  0.6341     0.7193 0.716 0.252 0.032
#> SRR1652958     1  0.0592     0.8242 0.988 0.012 0.000
#> SRR1652956     3  0.0424     0.8097 0.000 0.008 0.992
#> SRR1652957     2  0.5551     0.8231 0.212 0.768 0.020
#> SRR1652959     3  0.6794     0.4841 0.028 0.324 0.648
#> SRR1652960     3  0.5526     0.7001 0.036 0.172 0.792
#> SRR1652961     3  0.0892     0.8075 0.000 0.020 0.980
#> SRR1652962     3  0.0424     0.8097 0.000 0.008 0.992
#> SRR1652963     3  0.3532     0.7795 0.008 0.108 0.884
#> SRR1652965     1  0.3752     0.7940 0.884 0.096 0.020
#> SRR1652964     3  0.9419     0.2165 0.192 0.328 0.480
#> SRR1652966     1  0.0000     0.8249 1.000 0.000 0.000
#> SRR1652967     3  0.7327     0.5641 0.160 0.132 0.708
#> SRR1652969     2  0.5633     0.8251 0.208 0.768 0.024
#> SRR1652968     1  0.6714     0.6914 0.672 0.296 0.032
#> SRR1652970     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652971     1  0.7442     0.4312 0.588 0.044 0.368
#> SRR1652972     1  0.2301     0.8015 0.936 0.060 0.004
#> SRR1652973     2  0.5633     0.8251 0.208 0.768 0.024
#> SRR1652974     1  0.0424     0.8245 0.992 0.008 0.000
#> SRR1652975     3  0.7901     0.0291 0.056 0.440 0.504
#> SRR1652976     3  0.9419     0.2165 0.192 0.328 0.480
#> SRR1652977     1  0.6714     0.6914 0.672 0.296 0.032

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652896     3  0.5560    0.64222 0.116 0.156 0.728 0.000
#> SRR1652897     1  0.4985    0.04780 0.532 0.000 0.000 0.468
#> SRR1652898     1  0.3123    0.77074 0.844 0.000 0.156 0.000
#> SRR1652899     1  0.3610    0.71529 0.800 0.000 0.200 0.000
#> SRR1652900     2  0.2675    0.79938 0.000 0.908 0.048 0.044
#> SRR1652901     4  0.7114    0.65357 0.064 0.100 0.176 0.660
#> SRR1652902     1  0.3610    0.71529 0.800 0.000 0.200 0.000
#> SRR1652903     1  0.0779    0.81759 0.980 0.000 0.016 0.004
#> SRR1652904     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652905     4  0.7250    0.21996 0.000 0.316 0.168 0.516
#> SRR1652906     1  0.3123    0.77081 0.844 0.000 0.156 0.000
#> SRR1652907     1  0.2973    0.77890 0.856 0.000 0.144 0.000
#> SRR1652908     2  0.4011    0.68794 0.000 0.784 0.008 0.208
#> SRR1652909     1  0.4713    0.30996 0.640 0.000 0.360 0.000
#> SRR1652910     1  0.2973    0.77802 0.856 0.000 0.144 0.000
#> SRR1652911     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652912     2  0.0188    0.81694 0.000 0.996 0.004 0.000
#> SRR1652913     4  0.2266    0.81018 0.084 0.004 0.000 0.912
#> SRR1652914     3  0.4222    0.77857 0.272 0.000 0.728 0.000
#> SRR1652915     3  0.4406    0.76164 0.300 0.000 0.700 0.000
#> SRR1652916     1  0.3494    0.62571 0.824 0.000 0.004 0.172
#> SRR1652917     4  0.3945    0.81441 0.076 0.008 0.064 0.852
#> SRR1652918     4  0.3528    0.68811 0.000 0.192 0.000 0.808
#> SRR1652919     3  0.5298    0.76048 0.244 0.048 0.708 0.000
#> SRR1652920     2  0.1792    0.78682 0.000 0.932 0.000 0.068
#> SRR1652921     4  0.3427    0.81349 0.088 0.004 0.036 0.872
#> SRR1652922     3  0.4624    0.63991 0.340 0.000 0.660 0.000
#> SRR1652923     3  0.4356    0.76924 0.292 0.000 0.708 0.000
#> SRR1652924     4  0.2266    0.81018 0.084 0.004 0.000 0.912
#> SRR1652925     4  0.4776    0.35276 0.000 0.376 0.000 0.624
#> SRR1652926     4  0.3231    0.75512 0.012 0.116 0.004 0.868
#> SRR1652927     1  0.2973    0.77802 0.856 0.000 0.144 0.000
#> SRR1652928     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652929     3  0.4356    0.76924 0.292 0.000 0.708 0.000
#> SRR1652930     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652931     3  0.8364    0.43558 0.120 0.248 0.536 0.096
#> SRR1652932     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652933     4  0.6480    0.54258 0.048 0.296 0.028 0.628
#> SRR1652934     4  0.3945    0.81441 0.076 0.008 0.064 0.852
#> SRR1652935     2  0.2530    0.78363 0.000 0.888 0.112 0.000
#> SRR1652936     2  0.0000    0.81729 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.1661    0.81040 0.944 0.000 0.052 0.004
#> SRR1652938     4  0.1118    0.80114 0.036 0.000 0.000 0.964
#> SRR1652939     4  0.1211    0.80224 0.040 0.000 0.000 0.960
#> SRR1652940     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652941     4  0.8155    0.28408 0.176 0.036 0.288 0.500
#> SRR1652942     2  0.0000    0.81729 0.000 1.000 0.000 0.000
#> SRR1652943     4  0.3528    0.68811 0.000 0.192 0.000 0.808
#> SRR1652944     3  0.4222    0.77857 0.272 0.000 0.728 0.000
#> SRR1652945     4  0.3528    0.68811 0.000 0.192 0.000 0.808
#> SRR1652946     4  0.2266    0.81018 0.084 0.004 0.000 0.912
#> SRR1652947     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652948     3  0.6317    0.54454 0.116 0.240 0.644 0.000
#> SRR1652949     1  0.3123    0.77074 0.844 0.000 0.156 0.000
#> SRR1652950     3  0.4605    0.71161 0.336 0.000 0.664 0.000
#> SRR1652951     2  0.0000    0.81729 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652952     2  0.0000    0.81729 0.000 1.000 0.000 0.000
#> SRR1652954     4  0.3945    0.81441 0.076 0.008 0.064 0.852
#> SRR1652955     3  0.4855    0.59019 0.400 0.000 0.600 0.000
#> SRR1652958     1  0.3486    0.73216 0.812 0.000 0.188 0.000
#> SRR1652956     2  0.0000    0.81729 0.000 1.000 0.000 0.000
#> SRR1652957     4  0.3717    0.81406 0.080 0.004 0.056 0.860
#> SRR1652959     2  0.6201    0.48692 0.000 0.620 0.080 0.300
#> SRR1652960     2  0.4011    0.68794 0.000 0.784 0.008 0.208
#> SRR1652961     2  0.0469    0.81441 0.000 0.988 0.000 0.012
#> SRR1652962     2  0.0000    0.81729 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.3453    0.78190 0.000 0.868 0.052 0.080
#> SRR1652965     1  0.3636    0.65677 0.820 0.008 0.172 0.000
#> SRR1652964     2  0.8508    0.29244 0.044 0.444 0.320 0.192
#> SRR1652966     1  0.2814    0.78542 0.868 0.000 0.132 0.000
#> SRR1652967     2  0.6109    0.65837 0.040 0.700 0.216 0.044
#> SRR1652969     4  0.3945    0.81441 0.076 0.008 0.064 0.852
#> SRR1652968     3  0.4222    0.77857 0.272 0.000 0.728 0.000
#> SRR1652970     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652971     3  0.8706    0.05564 0.316 0.276 0.372 0.036
#> SRR1652972     1  0.4761    0.27456 0.628 0.000 0.372 0.000
#> SRR1652973     4  0.3945    0.81441 0.076 0.008 0.064 0.852
#> SRR1652974     1  0.0188    0.81868 0.996 0.000 0.000 0.004
#> SRR1652975     2  0.6012    0.00879 0.012 0.496 0.020 0.472
#> SRR1652976     2  0.8508    0.29244 0.044 0.444 0.320 0.192
#> SRR1652977     3  0.4222    0.77857 0.272 0.000 0.728 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
#> SRR1652895     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652896     3  0.2077    0.56543 0.000 0.084 0.908 0.000 0.008
#> SRR1652897     1  0.4300    0.03343 0.524 0.000 0.000 0.476 0.000
#> SRR1652898     1  0.2966    0.77759 0.816 0.000 0.184 0.000 0.000
#> SRR1652899     1  0.3395    0.72115 0.764 0.000 0.236 0.000 0.000
#> SRR1652900     2  0.2450    0.80418 0.000 0.900 0.052 0.048 0.000
#> SRR1652901     4  0.5995    0.62720 0.052 0.096 0.188 0.664 0.000
#> SRR1652902     1  0.3395    0.72115 0.764 0.000 0.236 0.000 0.000
#> SRR1652903     1  0.0671    0.80189 0.980 0.000 0.016 0.004 0.000
#> SRR1652904     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652905     4  0.6594    0.31445 0.000 0.260 0.216 0.516 0.008
#> SRR1652906     1  0.2966    0.77765 0.816 0.000 0.184 0.000 0.000
#> SRR1652907     1  0.2852    0.78449 0.828 0.000 0.172 0.000 0.000
#> SRR1652908     2  0.3578    0.71342 0.000 0.784 0.008 0.204 0.004
#> SRR1652909     1  0.4219    0.33093 0.584 0.000 0.416 0.000 0.000
#> SRR1652910     1  0.2852    0.78373 0.828 0.000 0.172 0.000 0.000
#> SRR1652911     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652912     2  0.0451    0.82678 0.000 0.988 0.008 0.004 0.000
#> SRR1652913     4  0.1608    0.78997 0.072 0.000 0.000 0.928 0.000
#> SRR1652914     3  0.2648    0.72912 0.152 0.000 0.848 0.000 0.000
#> SRR1652915     3  0.3452    0.67961 0.244 0.000 0.756 0.000 0.000
#> SRR1652916     1  0.3010    0.60908 0.824 0.000 0.004 0.172 0.000
#> SRR1652917     4  0.2983    0.79735 0.056 0.000 0.076 0.868 0.000
#> SRR1652918     4  0.3160    0.69565 0.000 0.188 0.000 0.808 0.004
#> SRR1652919     3  0.3573    0.70961 0.124 0.032 0.832 0.000 0.012
#> SRR1652920     2  0.1704    0.79310 0.000 0.928 0.000 0.068 0.004
#> SRR1652921     4  0.2632    0.79501 0.072 0.000 0.040 0.888 0.000
#> SRR1652922     3  0.3563    0.61009 0.208 0.000 0.780 0.000 0.012
#> SRR1652923     3  0.3336    0.69638 0.228 0.000 0.772 0.000 0.000
#> SRR1652924     4  0.1608    0.78997 0.072 0.000 0.000 0.928 0.000
#> SRR1652925     4  0.4251    0.35958 0.000 0.372 0.000 0.624 0.004
#> SRR1652926     4  0.2411    0.75780 0.000 0.108 0.008 0.884 0.000
#> SRR1652927     1  0.2852    0.78373 0.828 0.000 0.172 0.000 0.000
#> SRR1652928     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652929     3  0.3366    0.69311 0.232 0.000 0.768 0.000 0.000
#> SRR1652930     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652931     3  0.5368    0.44848 0.004 0.188 0.700 0.096 0.012
#> SRR1652932     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652933     4  0.5525    0.54804 0.040 0.296 0.032 0.632 0.000
#> SRR1652934     4  0.2983    0.79735 0.056 0.000 0.076 0.868 0.000
#> SRR1652935     2  0.2976    0.75151 0.000 0.852 0.132 0.004 0.012
#> SRR1652936     2  0.0162    0.82810 0.000 0.996 0.000 0.004 0.000
#> SRR1652937     1  0.1638    0.80054 0.932 0.000 0.064 0.004 0.000
#> SRR1652938     4  0.0162    0.77370 0.000 0.000 0.004 0.996 0.000
#> SRR1652939     4  0.0955    0.78573 0.028 0.000 0.004 0.968 0.000
#> SRR1652940     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652941     4  0.5981    0.27301 0.100 0.004 0.384 0.512 0.000
#> SRR1652942     2  0.0162    0.82810 0.000 0.996 0.000 0.004 0.000
#> SRR1652943     4  0.3160    0.69565 0.000 0.188 0.000 0.808 0.004
#> SRR1652944     3  0.2648    0.72912 0.152 0.000 0.848 0.000 0.000
#> SRR1652945     4  0.3160    0.69565 0.000 0.188 0.000 0.808 0.004
#> SRR1652946     4  0.1608    0.78997 0.072 0.000 0.000 0.928 0.000
#> SRR1652947     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652948     3  0.3242    0.51340 0.000 0.172 0.816 0.000 0.012
#> SRR1652949     1  0.2966    0.77759 0.816 0.000 0.184 0.000 0.000
#> SRR1652950     3  0.3242    0.70085 0.216 0.000 0.784 0.000 0.000
#> SRR1652951     2  0.0162    0.82810 0.000 0.996 0.000 0.004 0.000
#> SRR1652953     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652952     2  0.0162    0.82810 0.000 0.996 0.000 0.004 0.000
#> SRR1652954     4  0.2983    0.79735 0.056 0.000 0.076 0.868 0.000
#> SRR1652955     3  0.3730    0.60227 0.288 0.000 0.712 0.000 0.000
#> SRR1652958     1  0.3274    0.74023 0.780 0.000 0.220 0.000 0.000
#> SRR1652956     2  0.0162    0.82810 0.000 0.996 0.000 0.004 0.000
#> SRR1652957     4  0.2863    0.79723 0.060 0.000 0.064 0.876 0.000
#> SRR1652959     2  0.5655    0.45951 0.000 0.600 0.092 0.304 0.004
#> SRR1652960     2  0.3578    0.71342 0.000 0.784 0.008 0.204 0.004
#> SRR1652961     2  0.0510    0.82512 0.000 0.984 0.000 0.016 0.000
#> SRR1652962     2  0.0162    0.82810 0.000 0.996 0.000 0.004 0.000
#> SRR1652963     2  0.3043    0.78509 0.000 0.864 0.056 0.080 0.000
#> SRR1652965     1  0.3343    0.66961 0.812 0.000 0.172 0.000 0.016
#> SRR1652964     3  0.7097   -0.09126 0.008 0.384 0.404 0.192 0.012
#> SRR1652966     1  0.2690    0.78949 0.844 0.000 0.156 0.000 0.000
#> SRR1652967     2  0.6183    0.31454 0.000 0.544 0.180 0.000 0.276
#> SRR1652969     4  0.2983    0.79735 0.056 0.000 0.076 0.868 0.000
#> SRR1652968     3  0.2648    0.72912 0.152 0.000 0.848 0.000 0.000
#> SRR1652970     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652971     5  0.3660    0.00000 0.176 0.016 0.008 0.000 0.800
#> SRR1652972     1  0.4242    0.30103 0.572 0.000 0.428 0.000 0.000
#> SRR1652973     4  0.2983    0.79735 0.056 0.000 0.076 0.868 0.000
#> SRR1652974     1  0.0162    0.80079 0.996 0.000 0.000 0.004 0.000
#> SRR1652975     2  0.5226    0.00754 0.008 0.496 0.020 0.472 0.004
#> SRR1652976     3  0.7097   -0.09126 0.008 0.384 0.404 0.192 0.012
#> SRR1652977     3  0.2648    0.72912 0.152 0.000 0.848 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
#> SRR1652895     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.2433   0.545902 0.000 0.072 0.884 0.000 0.000 0.044
#> SRR1652897     1  0.3860   0.055987 0.528 0.000 0.000 0.472 0.000 0.000
#> SRR1652898     1  0.2912   0.754628 0.784 0.000 0.216 0.000 0.000 0.000
#> SRR1652899     1  0.3244   0.697027 0.732 0.000 0.268 0.000 0.000 0.000
#> SRR1652900     2  0.2325   0.777764 0.000 0.900 0.048 0.044 0.000 0.008
#> SRR1652901     4  0.5432   0.618542 0.044 0.096 0.192 0.664 0.000 0.004
#> SRR1652902     1  0.3244   0.697027 0.732 0.000 0.268 0.000 0.000 0.000
#> SRR1652903     1  0.0458   0.811897 0.984 0.000 0.016 0.000 0.000 0.000
#> SRR1652904     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     4  0.6362   0.283520 0.000 0.244 0.204 0.512 0.000 0.040
#> SRR1652906     1  0.2912   0.754754 0.784 0.000 0.216 0.000 0.000 0.000
#> SRR1652907     1  0.2823   0.761993 0.796 0.000 0.204 0.000 0.000 0.000
#> SRR1652908     2  0.3359   0.668176 0.000 0.784 0.008 0.196 0.000 0.012
#> SRR1652909     1  0.3838   0.305674 0.552 0.000 0.448 0.000 0.000 0.000
#> SRR1652910     1  0.2823   0.761133 0.796 0.000 0.204 0.000 0.000 0.000
#> SRR1652911     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0436   0.811551 0.000 0.988 0.004 0.004 0.000 0.004
#> SRR1652913     4  0.1501   0.782955 0.076 0.000 0.000 0.924 0.000 0.000
#> SRR1652914     3  0.2003   0.732638 0.116 0.000 0.884 0.000 0.000 0.000
#> SRR1652915     3  0.2854   0.687246 0.208 0.000 0.792 0.000 0.000 0.000
#> SRR1652916     1  0.2778   0.669152 0.824 0.000 0.008 0.168 0.000 0.000
#> SRR1652917     4  0.2828   0.788975 0.060 0.000 0.072 0.864 0.000 0.004
#> SRR1652918     4  0.3555   0.659930 0.000 0.184 0.000 0.776 0.000 0.040
#> SRR1652919     3  0.2948   0.707128 0.092 0.024 0.860 0.000 0.000 0.024
#> SRR1652920     2  0.1794   0.761291 0.000 0.924 0.000 0.036 0.000 0.040
#> SRR1652921     4  0.2420   0.787461 0.076 0.000 0.040 0.884 0.000 0.000
#> SRR1652922     3  0.4159   0.540710 0.140 0.000 0.744 0.000 0.000 0.116
#> SRR1652923     3  0.2730   0.707176 0.192 0.000 0.808 0.000 0.000 0.000
#> SRR1652924     4  0.1501   0.782955 0.076 0.000 0.000 0.924 0.000 0.000
#> SRR1652925     4  0.4504   0.323873 0.000 0.368 0.000 0.592 0.000 0.040
#> SRR1652926     4  0.2308   0.737973 0.000 0.108 0.004 0.880 0.000 0.008
#> SRR1652927     1  0.2823   0.761133 0.796 0.000 0.204 0.000 0.000 0.000
#> SRR1652928     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.2762   0.702610 0.196 0.000 0.804 0.000 0.000 0.000
#> SRR1652930     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652931     3  0.5286   0.381607 0.004 0.172 0.684 0.096 0.000 0.044
#> SRR1652932     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.5023   0.545919 0.044 0.296 0.032 0.628 0.000 0.000
#> SRR1652934     4  0.2828   0.788975 0.060 0.000 0.072 0.864 0.000 0.004
#> SRR1652935     2  0.3054   0.685432 0.000 0.840 0.116 0.004 0.000 0.040
#> SRR1652936     2  0.0146   0.813863 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652937     1  0.1327   0.804280 0.936 0.000 0.064 0.000 0.000 0.000
#> SRR1652938     4  0.0363   0.759040 0.000 0.000 0.000 0.988 0.000 0.012
#> SRR1652939     4  0.0935   0.776721 0.032 0.000 0.000 0.964 0.000 0.004
#> SRR1652940     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     4  0.5528   0.262876 0.092 0.004 0.384 0.512 0.000 0.008
#> SRR1652942     2  0.0146   0.813863 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652943     4  0.3555   0.659930 0.000 0.184 0.000 0.776 0.000 0.040
#> SRR1652944     3  0.2003   0.732638 0.116 0.000 0.884 0.000 0.000 0.000
#> SRR1652945     4  0.3488   0.662738 0.000 0.184 0.000 0.780 0.000 0.036
#> SRR1652946     4  0.1501   0.782955 0.076 0.000 0.000 0.924 0.000 0.000
#> SRR1652947     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652948     3  0.3445   0.471118 0.000 0.156 0.796 0.000 0.000 0.048
#> SRR1652949     1  0.2912   0.754628 0.784 0.000 0.216 0.000 0.000 0.000
#> SRR1652950     3  0.2631   0.711165 0.180 0.000 0.820 0.000 0.000 0.000
#> SRR1652951     2  0.0146   0.813863 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652953     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0146   0.813863 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652954     4  0.2828   0.788975 0.060 0.000 0.072 0.864 0.000 0.004
#> SRR1652955     3  0.3151   0.614424 0.252 0.000 0.748 0.000 0.000 0.000
#> SRR1652958     1  0.3151   0.716420 0.748 0.000 0.252 0.000 0.000 0.000
#> SRR1652956     2  0.0146   0.813863 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652957     4  0.2630   0.789221 0.064 0.000 0.064 0.872 0.000 0.000
#> SRR1652959     2  0.5471   0.388661 0.000 0.588 0.076 0.304 0.000 0.032
#> SRR1652960     2  0.3359   0.668176 0.000 0.784 0.008 0.196 0.000 0.012
#> SRR1652961     2  0.0520   0.808603 0.000 0.984 0.000 0.008 0.000 0.008
#> SRR1652962     2  0.0146   0.813863 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652963     2  0.2872   0.752080 0.000 0.864 0.052 0.076 0.000 0.008
#> SRR1652965     1  0.3794   0.674367 0.792 0.000 0.080 0.000 0.008 0.120
#> SRR1652964     3  0.6809  -0.082005 0.004 0.372 0.384 0.192 0.000 0.048
#> SRR1652966     1  0.2697   0.769955 0.812 0.000 0.188 0.000 0.000 0.000
#> SRR1652967     6  0.3612   0.000000 0.000 0.168 0.052 0.000 0.000 0.780
#> SRR1652969     4  0.2828   0.788975 0.060 0.000 0.072 0.864 0.000 0.004
#> SRR1652968     3  0.2003   0.732638 0.116 0.000 0.884 0.000 0.000 0.000
#> SRR1652970     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.0146   0.000000 0.000 0.004 0.000 0.000 0.996 0.000
#> SRR1652972     1  0.3851   0.275739 0.540 0.000 0.460 0.000 0.000 0.000
#> SRR1652973     4  0.2828   0.788975 0.060 0.000 0.072 0.864 0.000 0.004
#> SRR1652974     1  0.0000   0.812751 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.4780   0.000318 0.012 0.496 0.020 0.468 0.000 0.004
#> SRR1652976     3  0.6809  -0.082005 0.004 0.372 0.384 0.192 0.000 0.048
#> SRR1652977     3  0.2003   0.732638 0.116 0.000 0.884 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-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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.761           0.861       0.945         0.4836 0.515   0.515
#> 3 3 0.598           0.739       0.858         0.3705 0.717   0.496
#> 4 4 0.768           0.847       0.900         0.1176 0.857   0.600
#> 5 5 0.817           0.790       0.868         0.0504 0.964   0.863
#> 6 6 0.761           0.618       0.808         0.0343 0.975   0.896

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
#> SRR1652895     1  0.0000     0.9426 1.000 0.000
#> SRR1652896     2  0.9754     0.3147 0.408 0.592
#> SRR1652897     1  0.0000     0.9426 1.000 0.000
#> SRR1652898     1  0.0000     0.9426 1.000 0.000
#> SRR1652899     1  0.0000     0.9426 1.000 0.000
#> SRR1652900     2  0.0000     0.9291 0.000 1.000
#> SRR1652901     2  0.6438     0.7607 0.164 0.836
#> SRR1652902     1  0.0000     0.9426 1.000 0.000
#> SRR1652903     1  0.0000     0.9426 1.000 0.000
#> SRR1652904     1  0.0000     0.9426 1.000 0.000
#> SRR1652905     2  0.0000     0.9291 0.000 1.000
#> SRR1652906     1  0.0000     0.9426 1.000 0.000
#> SRR1652907     1  0.0000     0.9426 1.000 0.000
#> SRR1652908     2  0.0000     0.9291 0.000 1.000
#> SRR1652909     1  0.0000     0.9426 1.000 0.000
#> SRR1652910     1  0.0000     0.9426 1.000 0.000
#> SRR1652911     1  0.0000     0.9426 1.000 0.000
#> SRR1652912     2  0.0000     0.9291 0.000 1.000
#> SRR1652913     1  0.9988     0.0911 0.520 0.480
#> SRR1652914     1  0.0376     0.9401 0.996 0.004
#> SRR1652915     1  0.0000     0.9426 1.000 0.000
#> SRR1652916     1  0.0000     0.9426 1.000 0.000
#> SRR1652917     1  0.4690     0.8662 0.900 0.100
#> SRR1652918     2  0.0000     0.9291 0.000 1.000
#> SRR1652919     1  0.0000     0.9426 1.000 0.000
#> SRR1652920     2  0.0000     0.9291 0.000 1.000
#> SRR1652921     1  0.4690     0.8662 0.900 0.100
#> SRR1652922     1  0.5737     0.8163 0.864 0.136
#> SRR1652923     1  0.0000     0.9426 1.000 0.000
#> SRR1652924     2  0.0000     0.9291 0.000 1.000
#> SRR1652925     2  0.0000     0.9291 0.000 1.000
#> SRR1652926     2  0.0000     0.9291 0.000 1.000
#> SRR1652927     1  0.0000     0.9426 1.000 0.000
#> SRR1652928     1  0.0000     0.9426 1.000 0.000
#> SRR1652929     1  0.0000     0.9426 1.000 0.000
#> SRR1652930     1  0.0000     0.9426 1.000 0.000
#> SRR1652931     2  0.9954     0.1471 0.460 0.540
#> SRR1652932     1  0.0000     0.9426 1.000 0.000
#> SRR1652933     2  0.0000     0.9291 0.000 1.000
#> SRR1652934     1  0.4690     0.8662 0.900 0.100
#> SRR1652935     2  0.0000     0.9291 0.000 1.000
#> SRR1652936     2  0.0000     0.9291 0.000 1.000
#> SRR1652937     1  0.0000     0.9426 1.000 0.000
#> SRR1652938     1  0.9427     0.4370 0.640 0.360
#> SRR1652939     1  0.4690     0.8662 0.900 0.100
#> SRR1652940     1  0.0000     0.9426 1.000 0.000
#> SRR1652941     1  0.0000     0.9426 1.000 0.000
#> SRR1652942     2  0.0000     0.9291 0.000 1.000
#> SRR1652943     2  0.0000     0.9291 0.000 1.000
#> SRR1652944     1  0.2778     0.9079 0.952 0.048
#> SRR1652945     2  0.0000     0.9291 0.000 1.000
#> SRR1652946     2  0.0376     0.9262 0.004 0.996
#> SRR1652947     1  0.0000     0.9426 1.000 0.000
#> SRR1652948     2  0.9358     0.4555 0.352 0.648
#> SRR1652949     1  0.0000     0.9426 1.000 0.000
#> SRR1652950     1  0.0000     0.9426 1.000 0.000
#> SRR1652951     2  0.0000     0.9291 0.000 1.000
#> SRR1652953     1  0.0000     0.9426 1.000 0.000
#> SRR1652952     2  0.0000     0.9291 0.000 1.000
#> SRR1652954     1  0.4562     0.8700 0.904 0.096
#> SRR1652955     1  0.0000     0.9426 1.000 0.000
#> SRR1652958     1  0.0000     0.9426 1.000 0.000
#> SRR1652956     2  0.0000     0.9291 0.000 1.000
#> SRR1652957     1  0.9323     0.4710 0.652 0.348
#> SRR1652959     2  0.0000     0.9291 0.000 1.000
#> SRR1652960     2  0.0000     0.9291 0.000 1.000
#> SRR1652961     2  0.0000     0.9291 0.000 1.000
#> SRR1652962     2  0.0000     0.9291 0.000 1.000
#> SRR1652963     2  0.0000     0.9291 0.000 1.000
#> SRR1652965     1  0.4431     0.8672 0.908 0.092
#> SRR1652964     2  0.0000     0.9291 0.000 1.000
#> SRR1652966     1  0.0000     0.9426 1.000 0.000
#> SRR1652967     2  0.8144     0.6429 0.252 0.748
#> SRR1652969     2  0.1843     0.9069 0.028 0.972
#> SRR1652968     1  0.0000     0.9426 1.000 0.000
#> SRR1652970     1  0.0000     0.9426 1.000 0.000
#> SRR1652971     1  0.9998    -0.0137 0.508 0.492
#> SRR1652972     1  0.0000     0.9426 1.000 0.000
#> SRR1652973     1  0.4562     0.8700 0.904 0.096
#> SRR1652974     1  0.0000     0.9426 1.000 0.000
#> SRR1652975     2  0.0000     0.9291 0.000 1.000
#> SRR1652976     2  0.9427     0.4374 0.360 0.640
#> SRR1652977     1  0.0000     0.9426 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652896     3  0.2772      0.683 0.004 0.080 0.916
#> SRR1652897     1  0.2356      0.847 0.928 0.000 0.072
#> SRR1652898     1  0.5905      0.265 0.648 0.000 0.352
#> SRR1652899     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652900     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652901     3  0.5254      0.384 0.000 0.264 0.736
#> SRR1652902     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652903     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652904     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652905     2  0.2959      0.864 0.000 0.900 0.100
#> SRR1652906     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652907     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652908     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652909     1  0.5591      0.344 0.696 0.000 0.304
#> SRR1652910     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652911     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652912     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652913     1  0.9184      0.205 0.528 0.284 0.188
#> SRR1652914     3  0.4164      0.716 0.144 0.008 0.848
#> SRR1652915     3  0.4178      0.706 0.172 0.000 0.828
#> SRR1652916     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652917     3  0.8411      0.265 0.404 0.088 0.508
#> SRR1652918     2  0.4178      0.846 0.000 0.828 0.172
#> SRR1652919     3  0.4178      0.706 0.172 0.000 0.828
#> SRR1652920     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652921     3  0.8445      0.220 0.424 0.088 0.488
#> SRR1652922     3  0.4982      0.713 0.136 0.036 0.828
#> SRR1652923     3  0.4178      0.706 0.172 0.000 0.828
#> SRR1652924     2  0.4555      0.826 0.000 0.800 0.200
#> SRR1652925     2  0.2448      0.872 0.000 0.924 0.076
#> SRR1652926     2  0.4504      0.829 0.000 0.804 0.196
#> SRR1652927     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652928     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652929     3  0.4178      0.706 0.172 0.000 0.828
#> SRR1652930     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652931     3  0.2590      0.685 0.004 0.072 0.924
#> SRR1652932     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652933     2  0.4702      0.816 0.000 0.788 0.212
#> SRR1652934     3  0.7937      0.346 0.364 0.068 0.568
#> SRR1652935     2  0.5254      0.558 0.000 0.736 0.264
#> SRR1652936     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652937     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652938     3  0.9517      0.336 0.280 0.232 0.488
#> SRR1652939     3  0.8427      0.249 0.412 0.088 0.500
#> SRR1652940     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652941     3  0.2165      0.713 0.064 0.000 0.936
#> SRR1652942     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652943     2  0.4178      0.846 0.000 0.828 0.172
#> SRR1652944     3  0.4636      0.718 0.116 0.036 0.848
#> SRR1652945     2  0.4178      0.846 0.000 0.828 0.172
#> SRR1652946     2  0.5269      0.814 0.016 0.784 0.200
#> SRR1652947     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652948     3  0.3272      0.672 0.004 0.104 0.892
#> SRR1652949     1  0.0747      0.919 0.984 0.000 0.016
#> SRR1652950     3  0.3879      0.714 0.152 0.000 0.848
#> SRR1652951     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652953     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652952     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652954     3  0.8427      0.249 0.412 0.088 0.500
#> SRR1652955     3  0.4235      0.704 0.176 0.000 0.824
#> SRR1652958     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652956     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652957     3  0.9021      0.199 0.416 0.132 0.452
#> SRR1652959     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652960     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652961     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652962     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652963     2  0.0000      0.897 0.000 1.000 0.000
#> SRR1652965     3  0.6452      0.610 0.252 0.036 0.712
#> SRR1652964     3  0.6204      0.149 0.000 0.424 0.576
#> SRR1652966     1  0.0747      0.919 0.984 0.000 0.016
#> SRR1652967     3  0.4291      0.612 0.000 0.180 0.820
#> SRR1652969     2  0.6664      0.306 0.008 0.528 0.464
#> SRR1652968     3  0.4178      0.706 0.172 0.000 0.828
#> SRR1652970     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652971     3  0.6211      0.583 0.036 0.228 0.736
#> SRR1652972     3  0.4235      0.705 0.176 0.000 0.824
#> SRR1652973     3  0.8427      0.249 0.412 0.088 0.500
#> SRR1652974     1  0.0000      0.935 1.000 0.000 0.000
#> SRR1652975     2  0.4178      0.846 0.000 0.828 0.172
#> SRR1652976     3  0.2448      0.682 0.000 0.076 0.924
#> SRR1652977     3  0.3879      0.714 0.152 0.000 0.848

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.1557     0.9051 0.000 0.000 0.944 0.056
#> SRR1652897     1  0.2973     0.8119 0.856 0.000 0.000 0.144
#> SRR1652898     1  0.2859     0.8719 0.880 0.000 0.112 0.008
#> SRR1652899     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652900     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652901     4  0.6268     0.2491 0.000 0.056 0.448 0.496
#> SRR1652902     1  0.0895     0.9579 0.976 0.000 0.020 0.004
#> SRR1652903     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.4961    -0.0967 0.000 0.552 0.000 0.448
#> SRR1652906     1  0.1109     0.9534 0.968 0.000 0.028 0.004
#> SRR1652907     1  0.1109     0.9527 0.968 0.000 0.028 0.004
#> SRR1652908     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652909     1  0.4831     0.6942 0.752 0.000 0.208 0.040
#> SRR1652910     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652911     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652913     4  0.4969     0.7980 0.112 0.076 0.016 0.796
#> SRR1652914     3  0.1211     0.9324 0.000 0.000 0.960 0.040
#> SRR1652915     3  0.1302     0.9321 0.000 0.000 0.956 0.044
#> SRR1652916     1  0.0657     0.9593 0.984 0.000 0.004 0.012
#> SRR1652917     4  0.4894     0.8097 0.104 0.020 0.072 0.804
#> SRR1652918     4  0.3975     0.7650 0.000 0.240 0.000 0.760
#> SRR1652919     3  0.1022     0.9166 0.000 0.000 0.968 0.032
#> SRR1652920     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652921     4  0.4894     0.8097 0.104 0.020 0.072 0.804
#> SRR1652922     3  0.2589     0.8708 0.000 0.000 0.884 0.116
#> SRR1652923     3  0.1302     0.9321 0.000 0.000 0.956 0.044
#> SRR1652924     4  0.3975     0.7650 0.000 0.240 0.000 0.760
#> SRR1652925     2  0.4998    -0.2003 0.000 0.512 0.000 0.488
#> SRR1652926     4  0.3975     0.7650 0.000 0.240 0.000 0.760
#> SRR1652927     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652928     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652929     3  0.1302     0.9321 0.000 0.000 0.956 0.044
#> SRR1652930     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652931     3  0.1557     0.9247 0.000 0.000 0.944 0.056
#> SRR1652932     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652933     4  0.3942     0.7673 0.000 0.236 0.000 0.764
#> SRR1652934     4  0.4903     0.8042 0.076 0.020 0.100 0.804
#> SRR1652935     2  0.4907     0.6683 0.000 0.764 0.176 0.060
#> SRR1652936     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652938     4  0.4964     0.8127 0.052 0.064 0.072 0.812
#> SRR1652939     4  0.4894     0.8097 0.104 0.020 0.072 0.804
#> SRR1652940     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652941     3  0.1302     0.9307 0.000 0.000 0.956 0.044
#> SRR1652942     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652943     4  0.3975     0.7650 0.000 0.240 0.000 0.760
#> SRR1652944     3  0.1211     0.9324 0.000 0.000 0.960 0.040
#> SRR1652945     4  0.3975     0.7650 0.000 0.240 0.000 0.760
#> SRR1652946     4  0.4364     0.7727 0.016 0.220 0.000 0.764
#> SRR1652947     1  0.0188     0.9667 0.996 0.000 0.000 0.004
#> SRR1652948     3  0.1557     0.9051 0.000 0.000 0.944 0.056
#> SRR1652949     1  0.1545     0.9426 0.952 0.000 0.040 0.008
#> SRR1652950     3  0.1211     0.9324 0.000 0.000 0.960 0.040
#> SRR1652951     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652954     4  0.4894     0.8097 0.104 0.020 0.072 0.804
#> SRR1652955     3  0.1302     0.9321 0.000 0.000 0.956 0.044
#> SRR1652958     1  0.0779     0.9576 0.980 0.000 0.004 0.016
#> SRR1652956     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652957     4  0.4894     0.8097 0.104 0.020 0.072 0.804
#> SRR1652959     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652962     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.0000     0.9102 0.000 1.000 0.000 0.000
#> SRR1652965     3  0.3219     0.8453 0.000 0.000 0.836 0.164
#> SRR1652964     4  0.6666     0.3292 0.000 0.088 0.404 0.508
#> SRR1652966     1  0.1807     0.9326 0.940 0.000 0.052 0.008
#> SRR1652967     3  0.5951     0.6942 0.000 0.152 0.696 0.152
#> SRR1652969     4  0.4499     0.7977 0.000 0.124 0.072 0.804
#> SRR1652968     3  0.1211     0.9324 0.000 0.000 0.960 0.040
#> SRR1652970     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652971     3  0.6388     0.6502 0.000 0.156 0.652 0.192
#> SRR1652972     3  0.1489     0.9305 0.004 0.000 0.952 0.044
#> SRR1652973     4  0.4894     0.8097 0.104 0.020 0.072 0.804
#> SRR1652974     1  0.0000     0.9683 1.000 0.000 0.000 0.000
#> SRR1652975     4  0.3975     0.7650 0.000 0.240 0.000 0.760
#> SRR1652976     3  0.1557     0.9247 0.000 0.000 0.944 0.056
#> SRR1652977     3  0.1211     0.9324 0.000 0.000 0.960 0.040

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.3988      0.481 0.000 0.000 0.732 0.016 0.252
#> SRR1652897     1  0.3521      0.659 0.764 0.000 0.000 0.232 0.004
#> SRR1652898     1  0.6066      0.364 0.504 0.000 0.368 0.000 0.128
#> SRR1652899     1  0.1732      0.885 0.920 0.000 0.000 0.000 0.080
#> SRR1652900     2  0.0865      0.937 0.000 0.972 0.000 0.004 0.024
#> SRR1652901     4  0.5431      0.391 0.000 0.008 0.356 0.584 0.052
#> SRR1652902     1  0.3558      0.842 0.828 0.000 0.064 0.000 0.108
#> SRR1652903     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     4  0.6253      0.326 0.000 0.388 0.000 0.464 0.148
#> SRR1652906     1  0.4410      0.794 0.764 0.000 0.112 0.000 0.124
#> SRR1652907     1  0.2612      0.866 0.868 0.000 0.008 0.000 0.124
#> SRR1652908     2  0.2389      0.866 0.000 0.880 0.000 0.004 0.116
#> SRR1652909     1  0.5685      0.638 0.640 0.000 0.236 0.008 0.116
#> SRR1652910     1  0.2179      0.875 0.888 0.000 0.000 0.000 0.112
#> SRR1652911     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0162      0.945 0.000 0.996 0.000 0.004 0.000
#> SRR1652913     4  0.3117      0.817 0.036 0.016 0.012 0.884 0.052
#> SRR1652914     3  0.0000      0.815 0.000 0.000 1.000 0.000 0.000
#> SRR1652915     3  0.1121      0.792 0.000 0.000 0.956 0.000 0.044
#> SRR1652916     1  0.1278      0.888 0.960 0.000 0.004 0.016 0.020
#> SRR1652917     4  0.2040      0.813 0.032 0.000 0.032 0.928 0.008
#> SRR1652918     4  0.4335      0.800 0.000 0.072 0.000 0.760 0.168
#> SRR1652919     3  0.2230      0.737 0.000 0.000 0.884 0.000 0.116
#> SRR1652920     2  0.0324      0.944 0.000 0.992 0.000 0.004 0.004
#> SRR1652921     4  0.2040      0.813 0.032 0.000 0.032 0.928 0.008
#> SRR1652922     3  0.3885      0.477 0.000 0.000 0.724 0.008 0.268
#> SRR1652923     3  0.0000      0.815 0.000 0.000 1.000 0.000 0.000
#> SRR1652924     4  0.4138      0.806 0.000 0.072 0.000 0.780 0.148
#> SRR1652925     4  0.6308      0.389 0.000 0.352 0.000 0.484 0.164
#> SRR1652926     4  0.4219      0.804 0.000 0.072 0.000 0.772 0.156
#> SRR1652927     1  0.1792      0.884 0.916 0.000 0.000 0.000 0.084
#> SRR1652928     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.1121      0.792 0.000 0.000 0.956 0.000 0.044
#> SRR1652930     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652931     3  0.2909      0.701 0.000 0.000 0.848 0.012 0.140
#> SRR1652932     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.3921      0.810 0.000 0.072 0.000 0.800 0.128
#> SRR1652934     4  0.2140      0.812 0.024 0.000 0.040 0.924 0.012
#> SRR1652935     2  0.5756      0.317 0.000 0.588 0.076 0.012 0.324
#> SRR1652936     2  0.0162      0.945 0.000 0.996 0.000 0.004 0.000
#> SRR1652937     1  0.0703      0.894 0.976 0.000 0.000 0.000 0.024
#> SRR1652938     4  0.1587      0.813 0.012 0.008 0.008 0.952 0.020
#> SRR1652939     4  0.1772      0.813 0.020 0.000 0.032 0.940 0.008
#> SRR1652940     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.3081      0.588 0.000 0.000 0.832 0.156 0.012
#> SRR1652942     2  0.0162      0.945 0.000 0.996 0.000 0.004 0.000
#> SRR1652943     4  0.4335      0.800 0.000 0.072 0.000 0.760 0.168
#> SRR1652944     3  0.0162      0.814 0.000 0.000 0.996 0.000 0.004
#> SRR1652945     4  0.4297      0.801 0.000 0.072 0.000 0.764 0.164
#> SRR1652946     4  0.3558      0.814 0.000 0.064 0.000 0.828 0.108
#> SRR1652947     1  0.2248      0.881 0.900 0.000 0.012 0.000 0.088
#> SRR1652948     3  0.3988      0.481 0.000 0.000 0.732 0.016 0.252
#> SRR1652949     1  0.4720      0.765 0.736 0.000 0.140 0.000 0.124
#> SRR1652950     3  0.0162      0.814 0.000 0.000 0.996 0.000 0.004
#> SRR1652951     2  0.0162      0.945 0.000 0.996 0.000 0.004 0.000
#> SRR1652953     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0162      0.945 0.000 0.996 0.000 0.004 0.000
#> SRR1652954     4  0.2040      0.813 0.032 0.000 0.032 0.928 0.008
#> SRR1652955     3  0.2329      0.694 0.000 0.000 0.876 0.000 0.124
#> SRR1652958     1  0.2362      0.882 0.900 0.000 0.008 0.008 0.084
#> SRR1652956     2  0.0162      0.945 0.000 0.996 0.000 0.004 0.000
#> SRR1652957     4  0.1914      0.814 0.032 0.000 0.032 0.932 0.004
#> SRR1652959     2  0.2036      0.907 0.000 0.920 0.000 0.024 0.056
#> SRR1652960     2  0.1502      0.920 0.000 0.940 0.000 0.004 0.056
#> SRR1652961     2  0.0162      0.945 0.000 0.996 0.000 0.004 0.000
#> SRR1652962     2  0.0162      0.945 0.000 0.996 0.000 0.004 0.000
#> SRR1652963     2  0.1571      0.920 0.000 0.936 0.000 0.004 0.060
#> SRR1652965     5  0.4276      0.632 0.000 0.000 0.380 0.004 0.616
#> SRR1652964     4  0.6090      0.427 0.000 0.020 0.292 0.588 0.100
#> SRR1652966     1  0.4884      0.749 0.720 0.000 0.152 0.000 0.128
#> SRR1652967     5  0.5358      0.830 0.000 0.040 0.264 0.032 0.664
#> SRR1652969     4  0.2040      0.819 0.000 0.032 0.032 0.928 0.008
#> SRR1652968     3  0.0000      0.815 0.000 0.000 1.000 0.000 0.000
#> SRR1652970     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.4823      0.836 0.000 0.040 0.264 0.008 0.688
#> SRR1652972     3  0.2020      0.728 0.000 0.000 0.900 0.000 0.100
#> SRR1652973     4  0.2152      0.813 0.032 0.000 0.032 0.924 0.012
#> SRR1652974     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     4  0.3966      0.809 0.000 0.072 0.000 0.796 0.132
#> SRR1652976     3  0.2848      0.694 0.000 0.000 0.840 0.004 0.156
#> SRR1652977     3  0.0000      0.815 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652896     3  0.4122     0.5502 0.000 0.000 0.704 0.000 0.248 0.048
#> SRR1652897     4  0.5808    -0.1808 0.360 0.000 0.000 0.472 0.004 0.164
#> SRR1652898     1  0.4622     0.3803 0.648 0.000 0.300 0.000 0.016 0.036
#> SRR1652899     1  0.0405     0.7782 0.988 0.000 0.000 0.000 0.004 0.008
#> SRR1652900     2  0.2277     0.8242 0.000 0.892 0.000 0.000 0.032 0.076
#> SRR1652901     4  0.5569     0.1142 0.000 0.000 0.328 0.564 0.036 0.072
#> SRR1652902     1  0.2322     0.7329 0.896 0.000 0.072 0.000 0.008 0.024
#> SRR1652903     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652904     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652905     6  0.6728     0.5685 0.000 0.264 0.000 0.336 0.036 0.364
#> SRR1652906     1  0.2983     0.7036 0.856 0.000 0.092 0.000 0.012 0.040
#> SRR1652907     1  0.1151     0.7684 0.956 0.000 0.000 0.000 0.012 0.032
#> SRR1652908     2  0.4115     0.5459 0.000 0.696 0.000 0.004 0.032 0.268
#> SRR1652909     1  0.4566     0.5534 0.732 0.000 0.192 0.036 0.012 0.028
#> SRR1652910     1  0.0891     0.7719 0.968 0.000 0.000 0.000 0.008 0.024
#> SRR1652911     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652912     2  0.0000     0.8771 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     4  0.2686     0.4838 0.000 0.004 0.004 0.848 0.004 0.140
#> SRR1652914     3  0.0000     0.7913 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652915     3  0.2231     0.7388 0.048 0.000 0.908 0.000 0.016 0.028
#> SRR1652916     1  0.4747     0.7356 0.716 0.000 0.004 0.116 0.012 0.152
#> SRR1652917     4  0.0665     0.5674 0.000 0.000 0.008 0.980 0.004 0.008
#> SRR1652918     4  0.4695    -0.0251 0.000 0.032 0.000 0.556 0.008 0.404
#> SRR1652919     3  0.2412     0.7433 0.000 0.000 0.880 0.000 0.092 0.028
#> SRR1652920     2  0.0260     0.8737 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1652921     4  0.0862     0.5660 0.000 0.000 0.008 0.972 0.004 0.016
#> SRR1652922     3  0.4655     0.5420 0.000 0.000 0.680 0.000 0.208 0.112
#> SRR1652923     3  0.0000     0.7913 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652924     4  0.4386     0.1463 0.000 0.028 0.000 0.620 0.004 0.348
#> SRR1652925     6  0.6273     0.5356 0.000 0.228 0.000 0.356 0.012 0.404
#> SRR1652926     4  0.4333     0.0767 0.000 0.028 0.000 0.596 0.000 0.376
#> SRR1652927     1  0.0405     0.7782 0.988 0.000 0.000 0.000 0.004 0.008
#> SRR1652928     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652929     3  0.1167     0.7763 0.008 0.000 0.960 0.000 0.012 0.020
#> SRR1652930     1  0.3835     0.7989 0.748 0.000 0.000 0.000 0.048 0.204
#> SRR1652931     3  0.3495     0.6849 0.000 0.000 0.808 0.004 0.128 0.060
#> SRR1652932     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652933     4  0.4824     0.0416 0.000 0.028 0.000 0.616 0.028 0.328
#> SRR1652934     4  0.0665     0.5674 0.000 0.000 0.008 0.980 0.004 0.008
#> SRR1652935     2  0.5394     0.3050 0.000 0.548 0.028 0.000 0.364 0.060
#> SRR1652936     2  0.0000     0.8771 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.2558     0.7993 0.868 0.000 0.000 0.000 0.028 0.104
#> SRR1652938     4  0.2019     0.5028 0.000 0.000 0.000 0.900 0.012 0.088
#> SRR1652939     4  0.0551     0.5685 0.000 0.000 0.008 0.984 0.004 0.004
#> SRR1652940     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652941     3  0.4115     0.2953 0.000 0.000 0.624 0.360 0.004 0.012
#> SRR1652942     2  0.0146     0.8772 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1652943     4  0.4598     0.0472 0.000 0.028 0.000 0.576 0.008 0.388
#> SRR1652944     3  0.0000     0.7913 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652945     4  0.4672     0.0223 0.000 0.032 0.000 0.568 0.008 0.392
#> SRR1652946     4  0.3536     0.3555 0.000 0.008 0.000 0.736 0.004 0.252
#> SRR1652947     1  0.1579     0.7659 0.944 0.000 0.024 0.008 0.004 0.020
#> SRR1652948     3  0.4239     0.5414 0.000 0.000 0.696 0.000 0.248 0.056
#> SRR1652949     1  0.3170     0.6883 0.840 0.000 0.112 0.000 0.016 0.032
#> SRR1652950     3  0.0146     0.7902 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR1652951     2  0.0146     0.8772 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1652953     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652952     2  0.0146     0.8772 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1652954     4  0.0665     0.5674 0.000 0.000 0.008 0.980 0.004 0.008
#> SRR1652955     3  0.3789     0.5775 0.176 0.000 0.776 0.000 0.016 0.032
#> SRR1652958     1  0.1542     0.7586 0.936 0.000 0.004 0.052 0.000 0.008
#> SRR1652956     2  0.0146     0.8772 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1652957     4  0.0405     0.5683 0.000 0.000 0.008 0.988 0.000 0.004
#> SRR1652959     2  0.3450     0.7517 0.000 0.808 0.000 0.012 0.032 0.148
#> SRR1652960     2  0.3062     0.7676 0.000 0.824 0.000 0.000 0.032 0.144
#> SRR1652961     2  0.0000     0.8771 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652962     2  0.0146     0.8772 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1652963     2  0.3475     0.7679 0.000 0.800 0.000 0.000 0.060 0.140
#> SRR1652965     5  0.6318     0.5394 0.092 0.000 0.224 0.000 0.564 0.120
#> SRR1652964     4  0.6837     0.0358 0.000 0.008 0.228 0.520 0.100 0.144
#> SRR1652966     1  0.3301     0.6755 0.828 0.000 0.124 0.000 0.016 0.032
#> SRR1652967     5  0.3608     0.7553 0.000 0.016 0.072 0.000 0.816 0.096
#> SRR1652969     4  0.0405     0.5679 0.000 0.000 0.008 0.988 0.000 0.004
#> SRR1652968     3  0.0000     0.7913 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652970     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652971     5  0.3514     0.7671 0.000 0.016 0.076 0.000 0.824 0.084
#> SRR1652972     3  0.4061     0.4849 0.248 0.000 0.716 0.000 0.012 0.024
#> SRR1652973     4  0.0405     0.5685 0.000 0.000 0.008 0.988 0.004 0.000
#> SRR1652974     1  0.3806     0.8007 0.752 0.000 0.000 0.000 0.048 0.200
#> SRR1652975     4  0.4824     0.0545 0.000 0.028 0.000 0.616 0.028 0.328
#> SRR1652976     3  0.3213     0.7028 0.000 0.000 0.820 0.000 0.132 0.048
#> SRR1652977     3  0.0000     0.7913 0.000 0.000 1.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

plot of chunk SD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.770           0.890       0.951         0.5056 0.495   0.495
#> 3 3 0.825           0.843       0.938         0.3023 0.743   0.529
#> 4 4 0.872           0.881       0.946         0.1361 0.879   0.658
#> 5 5 0.773           0.698       0.842         0.0438 0.955   0.829
#> 6 6 0.736           0.534       0.761         0.0322 0.966   0.858

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
#> SRR1652895     1  0.0000      0.979 1.000 0.000
#> SRR1652896     2  0.9686      0.354 0.396 0.604
#> SRR1652897     1  0.0000      0.979 1.000 0.000
#> SRR1652898     1  0.0000      0.979 1.000 0.000
#> SRR1652899     1  0.0000      0.979 1.000 0.000
#> SRR1652900     2  0.0000      0.916 0.000 1.000
#> SRR1652901     2  0.0000      0.916 0.000 1.000
#> SRR1652902     1  0.0000      0.979 1.000 0.000
#> SRR1652903     1  0.0000      0.979 1.000 0.000
#> SRR1652904     1  0.0000      0.979 1.000 0.000
#> SRR1652905     2  0.0000      0.916 0.000 1.000
#> SRR1652906     1  0.0000      0.979 1.000 0.000
#> SRR1652907     1  0.0000      0.979 1.000 0.000
#> SRR1652908     2  0.0000      0.916 0.000 1.000
#> SRR1652909     1  0.0000      0.979 1.000 0.000
#> SRR1652910     1  0.0000      0.979 1.000 0.000
#> SRR1652911     1  0.0000      0.979 1.000 0.000
#> SRR1652912     2  0.0000      0.916 0.000 1.000
#> SRR1652913     2  0.7219      0.753 0.200 0.800
#> SRR1652914     1  0.5178      0.855 0.884 0.116
#> SRR1652915     1  0.0000      0.979 1.000 0.000
#> SRR1652916     1  0.0000      0.979 1.000 0.000
#> SRR1652917     2  0.9286      0.548 0.344 0.656
#> SRR1652918     2  0.0000      0.916 0.000 1.000
#> SRR1652919     1  0.0000      0.979 1.000 0.000
#> SRR1652920     2  0.0000      0.916 0.000 1.000
#> SRR1652921     2  0.9635      0.459 0.388 0.612
#> SRR1652922     1  0.7219      0.741 0.800 0.200
#> SRR1652923     1  0.0000      0.979 1.000 0.000
#> SRR1652924     2  0.0000      0.916 0.000 1.000
#> SRR1652925     2  0.0000      0.916 0.000 1.000
#> SRR1652926     2  0.0000      0.916 0.000 1.000
#> SRR1652927     1  0.0000      0.979 1.000 0.000
#> SRR1652928     1  0.0000      0.979 1.000 0.000
#> SRR1652929     1  0.0000      0.979 1.000 0.000
#> SRR1652930     1  0.0000      0.979 1.000 0.000
#> SRR1652931     2  0.9580      0.395 0.380 0.620
#> SRR1652932     1  0.0000      0.979 1.000 0.000
#> SRR1652933     2  0.0000      0.916 0.000 1.000
#> SRR1652934     2  0.6801      0.774 0.180 0.820
#> SRR1652935     2  0.0000      0.916 0.000 1.000
#> SRR1652936     2  0.0000      0.916 0.000 1.000
#> SRR1652937     1  0.0000      0.979 1.000 0.000
#> SRR1652938     2  0.0000      0.916 0.000 1.000
#> SRR1652939     2  0.5737      0.816 0.136 0.864
#> SRR1652940     1  0.0000      0.979 1.000 0.000
#> SRR1652941     1  0.0000      0.979 1.000 0.000
#> SRR1652942     2  0.0000      0.916 0.000 1.000
#> SRR1652943     2  0.0000      0.916 0.000 1.000
#> SRR1652944     1  0.7139      0.747 0.804 0.196
#> SRR1652945     2  0.0000      0.916 0.000 1.000
#> SRR1652946     2  0.0000      0.916 0.000 1.000
#> SRR1652947     1  0.0000      0.979 1.000 0.000
#> SRR1652948     2  0.0938      0.908 0.012 0.988
#> SRR1652949     1  0.0000      0.979 1.000 0.000
#> SRR1652950     1  0.0000      0.979 1.000 0.000
#> SRR1652951     2  0.0000      0.916 0.000 1.000
#> SRR1652953     1  0.0000      0.979 1.000 0.000
#> SRR1652952     2  0.0000      0.916 0.000 1.000
#> SRR1652954     2  0.9710      0.431 0.400 0.600
#> SRR1652955     1  0.0000      0.979 1.000 0.000
#> SRR1652958     1  0.0000      0.979 1.000 0.000
#> SRR1652956     2  0.0000      0.916 0.000 1.000
#> SRR1652957     2  0.7219      0.753 0.200 0.800
#> SRR1652959     2  0.0000      0.916 0.000 1.000
#> SRR1652960     2  0.0000      0.916 0.000 1.000
#> SRR1652961     2  0.0000      0.916 0.000 1.000
#> SRR1652962     2  0.0000      0.916 0.000 1.000
#> SRR1652963     2  0.0000      0.916 0.000 1.000
#> SRR1652965     1  0.7139      0.747 0.804 0.196
#> SRR1652964     2  0.0000      0.916 0.000 1.000
#> SRR1652966     1  0.0000      0.979 1.000 0.000
#> SRR1652967     2  0.0000      0.916 0.000 1.000
#> SRR1652969     2  0.0000      0.916 0.000 1.000
#> SRR1652968     1  0.0000      0.979 1.000 0.000
#> SRR1652970     1  0.0000      0.979 1.000 0.000
#> SRR1652971     2  0.9795      0.299 0.416 0.584
#> SRR1652972     1  0.0000      0.979 1.000 0.000
#> SRR1652973     2  0.8555      0.653 0.280 0.720
#> SRR1652974     1  0.0000      0.979 1.000 0.000
#> SRR1652975     2  0.0000      0.916 0.000 1.000
#> SRR1652976     2  0.0000      0.916 0.000 1.000
#> SRR1652977     1  0.0000      0.979 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652896     3  0.0000     0.9473 0.000 0.000 1.000
#> SRR1652897     1  0.0237     0.9158 0.996 0.004 0.000
#> SRR1652898     3  0.3192     0.8676 0.112 0.000 0.888
#> SRR1652899     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652900     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652901     2  0.4555     0.7237 0.000 0.800 0.200
#> SRR1652902     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652903     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652905     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652906     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652907     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652908     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652909     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652910     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652911     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652912     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652913     2  0.6126     0.3062 0.400 0.600 0.000
#> SRR1652914     3  0.0000     0.9473 0.000 0.000 1.000
#> SRR1652915     3  0.0237     0.9481 0.004 0.000 0.996
#> SRR1652916     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652917     2  0.6215     0.2220 0.428 0.572 0.000
#> SRR1652918     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652919     3  0.0237     0.9481 0.004 0.000 0.996
#> SRR1652920     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652921     1  0.6111     0.3411 0.604 0.396 0.000
#> SRR1652922     3  0.0000     0.9473 0.000 0.000 1.000
#> SRR1652923     3  0.0237     0.9481 0.004 0.000 0.996
#> SRR1652924     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652925     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652926     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652927     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652928     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652929     3  0.0237     0.9481 0.004 0.000 0.996
#> SRR1652930     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652931     3  0.0000     0.9473 0.000 0.000 1.000
#> SRR1652932     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652933     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652934     2  0.5327     0.5974 0.272 0.728 0.000
#> SRR1652935     2  0.1163     0.9071 0.000 0.972 0.028
#> SRR1652936     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652937     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652938     2  0.1031     0.9065 0.024 0.976 0.000
#> SRR1652939     1  0.6299     0.0931 0.524 0.476 0.000
#> SRR1652940     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652941     3  0.4002     0.8058 0.160 0.000 0.840
#> SRR1652942     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652943     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652944     3  0.0000     0.9473 0.000 0.000 1.000
#> SRR1652945     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652946     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652947     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652948     3  0.0747     0.9388 0.000 0.016 0.984
#> SRR1652949     1  0.4062     0.7398 0.836 0.000 0.164
#> SRR1652950     3  0.0237     0.9481 0.004 0.000 0.996
#> SRR1652951     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652953     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652952     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652954     1  0.6008     0.4019 0.628 0.372 0.000
#> SRR1652955     3  0.0237     0.9481 0.004 0.000 0.996
#> SRR1652958     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652956     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652957     2  0.6111     0.3171 0.396 0.604 0.000
#> SRR1652959     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652960     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652961     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652962     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652963     2  0.0237     0.9237 0.000 0.996 0.004
#> SRR1652965     3  0.3619     0.8373 0.136 0.000 0.864
#> SRR1652964     2  0.0424     0.9216 0.000 0.992 0.008
#> SRR1652966     1  0.3879     0.7562 0.848 0.000 0.152
#> SRR1652967     2  0.6274     0.0663 0.000 0.544 0.456
#> SRR1652969     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652968     3  0.0237     0.9481 0.004 0.000 0.996
#> SRR1652970     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652971     3  0.7505     0.3534 0.044 0.384 0.572
#> SRR1652972     3  0.1964     0.9151 0.056 0.000 0.944
#> SRR1652973     1  0.5882     0.4539 0.652 0.348 0.000
#> SRR1652974     1  0.0000     0.9189 1.000 0.000 0.000
#> SRR1652975     2  0.0000     0.9232 0.000 1.000 0.000
#> SRR1652976     3  0.1411     0.9239 0.000 0.036 0.964
#> SRR1652977     3  0.0237     0.9481 0.004 0.000 0.996

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652896     3   0.241      0.809 0.000 0.104 0.896 0.000
#> SRR1652897     1   0.164      0.931 0.940 0.000 0.000 0.060
#> SRR1652898     3   0.499      0.177 0.472 0.000 0.528 0.000
#> SRR1652899     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652900     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652901     2   0.357      0.754 0.000 0.804 0.196 0.000
#> SRR1652902     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652903     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652904     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652905     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652906     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652907     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652908     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652909     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652910     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652911     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652912     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652913     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652914     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652915     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652916     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652917     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652918     4   0.475      0.443 0.000 0.368 0.000 0.632
#> SRR1652919     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652920     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652921     4   0.172      0.879 0.064 0.000 0.000 0.936
#> SRR1652922     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652923     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652924     4   0.297      0.839 0.000 0.144 0.000 0.856
#> SRR1652925     2   0.373      0.722 0.000 0.788 0.000 0.212
#> SRR1652926     4   0.208      0.892 0.000 0.084 0.000 0.916
#> SRR1652927     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652928     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652929     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652930     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652931     3   0.270      0.796 0.000 0.124 0.876 0.000
#> SRR1652932     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652933     2   0.361      0.739 0.000 0.800 0.000 0.200
#> SRR1652934     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652935     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652936     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652937     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652938     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652939     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652940     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652941     3   0.430      0.604 0.284 0.000 0.716 0.000
#> SRR1652942     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652943     4   0.187      0.901 0.000 0.072 0.000 0.928
#> SRR1652944     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652945     4   0.317      0.821 0.000 0.160 0.000 0.840
#> SRR1652946     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652947     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652948     3   0.365      0.727 0.000 0.204 0.796 0.000
#> SRR1652949     1   0.208      0.904 0.916 0.000 0.084 0.000
#> SRR1652950     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652951     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652953     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652952     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652954     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652955     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652958     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652956     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652957     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652959     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652960     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652961     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652962     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652963     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652965     3   0.331      0.754 0.156 0.004 0.840 0.000
#> SRR1652964     2   0.000      0.948 0.000 1.000 0.000 0.000
#> SRR1652966     1   0.179      0.922 0.932 0.000 0.068 0.000
#> SRR1652967     2   0.281      0.803 0.000 0.868 0.132 0.000
#> SRR1652969     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652968     3   0.000      0.855 0.000 0.000 1.000 0.000
#> SRR1652970     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652971     3   0.566      0.399 0.028 0.396 0.576 0.000
#> SRR1652972     3   0.492      0.317 0.424 0.000 0.576 0.000
#> SRR1652973     4   0.000      0.934 0.000 0.000 0.000 1.000
#> SRR1652974     1   0.000      0.990 1.000 0.000 0.000 0.000
#> SRR1652975     2   0.384      0.703 0.000 0.776 0.000 0.224
#> SRR1652976     3   0.410      0.666 0.000 0.256 0.744 0.000
#> SRR1652977     3   0.000      0.855 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.5022     0.1845 0.000 0.048 0.620 0.000 0.332
#> SRR1652897     1  0.3993     0.6435 0.756 0.000 0.000 0.216 0.028
#> SRR1652898     1  0.6619    -0.0774 0.392 0.000 0.392 0.000 0.216
#> SRR1652899     1  0.0290     0.9040 0.992 0.000 0.000 0.000 0.008
#> SRR1652900     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652901     2  0.4786     0.6076 0.000 0.720 0.188 0.000 0.092
#> SRR1652902     1  0.2813     0.8304 0.832 0.000 0.000 0.000 0.168
#> SRR1652903     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.2605     0.7883 0.000 0.852 0.000 0.000 0.148
#> SRR1652906     1  0.3359     0.8195 0.816 0.000 0.020 0.000 0.164
#> SRR1652907     1  0.3003     0.8159 0.812 0.000 0.000 0.000 0.188
#> SRR1652908     2  0.1965     0.8228 0.000 0.904 0.000 0.000 0.096
#> SRR1652909     1  0.3003     0.8169 0.812 0.000 0.000 0.000 0.188
#> SRR1652910     1  0.2377     0.8522 0.872 0.000 0.000 0.000 0.128
#> SRR1652911     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652913     4  0.0324     0.8182 0.004 0.000 0.000 0.992 0.004
#> SRR1652914     3  0.0000     0.6601 0.000 0.000 1.000 0.000 0.000
#> SRR1652915     3  0.2605     0.6039 0.000 0.000 0.852 0.000 0.148
#> SRR1652916     1  0.0162     0.9038 0.996 0.000 0.000 0.000 0.004
#> SRR1652917     4  0.2891     0.8058 0.000 0.000 0.000 0.824 0.176
#> SRR1652918     2  0.5814    -0.0258 0.000 0.472 0.000 0.436 0.092
#> SRR1652919     3  0.4074     0.3309 0.000 0.000 0.636 0.000 0.364
#> SRR1652920     2  0.0880     0.8569 0.000 0.968 0.000 0.000 0.032
#> SRR1652921     4  0.1502     0.7878 0.056 0.000 0.000 0.940 0.004
#> SRR1652922     3  0.4455     0.2854 0.000 0.008 0.588 0.000 0.404
#> SRR1652923     3  0.0290     0.6603 0.000 0.000 0.992 0.000 0.008
#> SRR1652924     4  0.4547     0.6099 0.000 0.252 0.000 0.704 0.044
#> SRR1652925     2  0.4400     0.6542 0.000 0.736 0.000 0.212 0.052
#> SRR1652926     4  0.5653     0.6360 0.000 0.208 0.000 0.632 0.160
#> SRR1652927     1  0.0703     0.8995 0.976 0.000 0.000 0.000 0.024
#> SRR1652928     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.2179     0.6268 0.000 0.000 0.888 0.000 0.112
#> SRR1652930     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652931     3  0.5052     0.1727 0.000 0.048 0.612 0.000 0.340
#> SRR1652932     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     2  0.4521     0.6923 0.000 0.748 0.000 0.088 0.164
#> SRR1652934     4  0.3305     0.7896 0.000 0.000 0.000 0.776 0.224
#> SRR1652935     2  0.3586     0.4700 0.000 0.736 0.000 0.000 0.264
#> SRR1652936     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652938     4  0.1357     0.8213 0.000 0.004 0.000 0.948 0.048
#> SRR1652939     4  0.2074     0.8179 0.000 0.000 0.000 0.896 0.104
#> SRR1652940     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.6826     0.1498 0.176 0.000 0.452 0.016 0.356
#> SRR1652942     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     4  0.4612     0.6853 0.000 0.180 0.000 0.736 0.084
#> SRR1652944     3  0.0000     0.6601 0.000 0.000 1.000 0.000 0.000
#> SRR1652945     4  0.4972     0.4368 0.000 0.336 0.000 0.620 0.044
#> SRR1652946     4  0.0404     0.8185 0.000 0.000 0.000 0.988 0.012
#> SRR1652947     1  0.1270     0.8888 0.948 0.000 0.000 0.000 0.052
#> SRR1652948     3  0.5664    -0.0167 0.000 0.092 0.560 0.000 0.348
#> SRR1652949     1  0.3977     0.7743 0.764 0.000 0.032 0.000 0.204
#> SRR1652950     3  0.0510     0.6595 0.000 0.000 0.984 0.000 0.016
#> SRR1652951     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652953     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     4  0.1831     0.8208 0.004 0.000 0.000 0.920 0.076
#> SRR1652955     3  0.2471     0.6093 0.000 0.000 0.864 0.000 0.136
#> SRR1652958     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652956     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     4  0.0609     0.8217 0.000 0.000 0.000 0.980 0.020
#> SRR1652959     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652960     2  0.0703     0.8600 0.000 0.976 0.000 0.000 0.024
#> SRR1652961     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     2  0.0162     0.8652 0.000 0.996 0.000 0.000 0.004
#> SRR1652965     5  0.6013    -0.0272 0.076 0.020 0.348 0.000 0.556
#> SRR1652964     2  0.0963     0.8408 0.000 0.964 0.000 0.000 0.036
#> SRR1652966     1  0.4779     0.7170 0.716 0.000 0.084 0.000 0.200
#> SRR1652967     5  0.5329     0.3919 0.000 0.432 0.052 0.000 0.516
#> SRR1652969     4  0.3395     0.7905 0.000 0.000 0.000 0.764 0.236
#> SRR1652968     3  0.0000     0.6601 0.000 0.000 1.000 0.000 0.000
#> SRR1652970     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.6081     0.5402 0.008 0.220 0.152 0.004 0.616
#> SRR1652972     3  0.6752     0.0946 0.316 0.000 0.404 0.000 0.280
#> SRR1652973     4  0.2929     0.7998 0.000 0.000 0.000 0.820 0.180
#> SRR1652974     1  0.0000     0.9057 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.4343     0.7120 0.000 0.768 0.000 0.096 0.136
#> SRR1652976     5  0.6650     0.4074 0.000 0.228 0.360 0.000 0.412
#> SRR1652977     3  0.0000     0.6601 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0000     0.8522 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.4899     0.2257 0.000 0.036 0.560 0.000 0.388 0.016
#> SRR1652897     1  0.4604     0.5471 0.720 0.000 0.000 0.192 0.032 0.056
#> SRR1652898     3  0.7719    -0.2160 0.268 0.000 0.272 0.000 0.232 0.228
#> SRR1652899     1  0.1088     0.8458 0.960 0.000 0.000 0.000 0.016 0.024
#> SRR1652900     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652901     2  0.5793     0.5274 0.000 0.592 0.164 0.000 0.028 0.216
#> SRR1652902     1  0.4558     0.6765 0.700 0.000 0.000 0.000 0.132 0.168
#> SRR1652903     1  0.0000     0.8522 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.8522 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.3886     0.6838 0.000 0.708 0.000 0.000 0.028 0.264
#> SRR1652906     1  0.5615     0.6001 0.636 0.000 0.040 0.000 0.156 0.168
#> SRR1652907     1  0.5138     0.5896 0.624 0.000 0.000 0.000 0.168 0.208
#> SRR1652908     2  0.2692     0.7783 0.000 0.840 0.000 0.000 0.012 0.148
#> SRR1652909     1  0.5123     0.5967 0.628 0.000 0.000 0.000 0.184 0.188
#> SRR1652910     1  0.3878     0.7368 0.772 0.000 0.000 0.000 0.116 0.112
#> SRR1652911     1  0.0146     0.8510 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1652912     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     4  0.0508     0.4054 0.000 0.000 0.000 0.984 0.004 0.012
#> SRR1652914     3  0.0405     0.6256 0.000 0.000 0.988 0.000 0.008 0.004
#> SRR1652915     3  0.4356     0.4478 0.000 0.000 0.724 0.000 0.140 0.136
#> SRR1652916     1  0.0291     0.8496 0.992 0.000 0.000 0.000 0.004 0.004
#> SRR1652917     4  0.4700    -0.6414 0.000 0.000 0.000 0.500 0.044 0.456
#> SRR1652918     2  0.6215    -0.1158 0.000 0.404 0.000 0.392 0.016 0.188
#> SRR1652919     3  0.5077     0.1617 0.000 0.000 0.516 0.000 0.404 0.080
#> SRR1652920     2  0.1524     0.8224 0.000 0.932 0.000 0.000 0.008 0.060
#> SRR1652921     4  0.2051     0.3780 0.036 0.000 0.000 0.916 0.008 0.040
#> SRR1652922     5  0.5383    -0.1589 0.000 0.012 0.440 0.000 0.472 0.076
#> SRR1652923     3  0.0260     0.6274 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR1652924     4  0.4282     0.3465 0.000 0.180 0.000 0.732 0.004 0.084
#> SRR1652925     2  0.4650     0.5953 0.000 0.688 0.000 0.224 0.008 0.080
#> SRR1652926     4  0.6072    -0.0280 0.000 0.176 0.000 0.440 0.012 0.372
#> SRR1652927     1  0.2263     0.8187 0.896 0.000 0.000 0.000 0.048 0.056
#> SRR1652928     1  0.0146     0.8510 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1652929     3  0.3828     0.5061 0.000 0.000 0.776 0.000 0.124 0.100
#> SRR1652930     1  0.0551     0.8449 0.984 0.000 0.000 0.008 0.004 0.004
#> SRR1652931     3  0.5309     0.2133 0.000 0.052 0.548 0.000 0.372 0.028
#> SRR1652932     1  0.0000     0.8522 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     2  0.4610     0.5039 0.000 0.580 0.000 0.024 0.012 0.384
#> SRR1652934     6  0.4576     0.7450 0.000 0.000 0.000 0.400 0.040 0.560
#> SRR1652935     2  0.3970     0.4915 0.000 0.692 0.000 0.000 0.280 0.028
#> SRR1652936     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.0717     0.8492 0.976 0.000 0.000 0.000 0.008 0.016
#> SRR1652938     4  0.3771     0.3362 0.004 0.020 0.000 0.812 0.064 0.100
#> SRR1652939     4  0.4300    -0.2950 0.000 0.000 0.000 0.640 0.036 0.324
#> SRR1652940     1  0.0000     0.8522 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     5  0.7908     0.1209 0.172 0.000 0.276 0.012 0.288 0.252
#> SRR1652942     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     4  0.5023     0.2900 0.000 0.140 0.000 0.664 0.008 0.188
#> SRR1652944     3  0.0260     0.6263 0.000 0.000 0.992 0.000 0.008 0.000
#> SRR1652945     4  0.4576     0.3214 0.000 0.220 0.000 0.696 0.008 0.076
#> SRR1652946     4  0.0458     0.4092 0.000 0.000 0.000 0.984 0.000 0.016
#> SRR1652947     1  0.2448     0.8152 0.884 0.000 0.000 0.000 0.052 0.064
#> SRR1652948     3  0.5091     0.2091 0.000 0.068 0.564 0.000 0.360 0.008
#> SRR1652949     1  0.6487     0.4128 0.516 0.000 0.056 0.000 0.204 0.224
#> SRR1652950     3  0.1418     0.6129 0.000 0.000 0.944 0.000 0.032 0.024
#> SRR1652951     2  0.0146     0.8436 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652953     1  0.0291     0.8518 0.992 0.000 0.000 0.000 0.004 0.004
#> SRR1652952     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     4  0.3905     0.1033 0.016 0.000 0.000 0.756 0.028 0.200
#> SRR1652955     3  0.4242     0.4521 0.000 0.000 0.736 0.000 0.128 0.136
#> SRR1652958     1  0.0806     0.8487 0.972 0.000 0.000 0.000 0.008 0.020
#> SRR1652956     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652957     4  0.1757     0.3523 0.000 0.000 0.000 0.916 0.008 0.076
#> SRR1652959     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652960     2  0.1124     0.8323 0.000 0.956 0.000 0.000 0.008 0.036
#> SRR1652961     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000     0.8442 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0458     0.8377 0.000 0.984 0.000 0.000 0.016 0.000
#> SRR1652965     5  0.5670     0.2694 0.056 0.008 0.164 0.000 0.660 0.112
#> SRR1652964     2  0.1765     0.8001 0.000 0.924 0.000 0.000 0.052 0.024
#> SRR1652966     1  0.6776     0.3642 0.496 0.000 0.088 0.000 0.196 0.220
#> SRR1652967     5  0.5063     0.2346 0.000 0.364 0.028 0.000 0.572 0.036
#> SRR1652969     6  0.4067     0.7267 0.000 0.000 0.000 0.444 0.008 0.548
#> SRR1652968     3  0.0146     0.6269 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1652970     1  0.0000     0.8522 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.4530     0.3536 0.012 0.164 0.064 0.000 0.744 0.016
#> SRR1652972     5  0.7695     0.0637 0.208 0.000 0.268 0.000 0.288 0.236
#> SRR1652973     4  0.4467    -0.7173 0.000 0.000 0.000 0.508 0.028 0.464
#> SRR1652974     1  0.0146     0.8510 0.996 0.000 0.000 0.000 0.000 0.004
#> SRR1652975     2  0.4462     0.6770 0.000 0.708 0.000 0.060 0.012 0.220
#> SRR1652976     5  0.6675     0.1755 0.000 0.248 0.316 0.000 0.400 0.036
#> SRR1652977     3  0.0260     0.6261 0.000 0.000 0.992 0.000 0.008 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

plot of chunk SD-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.706           0.880       0.944         0.4911 0.503   0.503
#> 3 3 0.849           0.855       0.943         0.3457 0.740   0.526
#> 4 4 0.832           0.803       0.927         0.1006 0.934   0.802
#> 5 5 0.744           0.609       0.846         0.0433 0.988   0.954
#> 6 6 0.727           0.661       0.837         0.0385 0.882   0.588

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
#> SRR1652895     1  0.0000      0.948 1.000 0.000
#> SRR1652896     2  0.4562      0.878 0.096 0.904
#> SRR1652897     1  0.0000      0.948 1.000 0.000
#> SRR1652898     1  0.0000      0.948 1.000 0.000
#> SRR1652899     1  0.0000      0.948 1.000 0.000
#> SRR1652900     2  0.0000      0.928 0.000 1.000
#> SRR1652901     2  0.0000      0.928 0.000 1.000
#> SRR1652902     1  0.0000      0.948 1.000 0.000
#> SRR1652903     1  0.0000      0.948 1.000 0.000
#> SRR1652904     1  0.0000      0.948 1.000 0.000
#> SRR1652905     2  0.0000      0.928 0.000 1.000
#> SRR1652906     1  0.0000      0.948 1.000 0.000
#> SRR1652907     1  0.0000      0.948 1.000 0.000
#> SRR1652908     2  0.0000      0.928 0.000 1.000
#> SRR1652909     1  0.0000      0.948 1.000 0.000
#> SRR1652910     1  0.0000      0.948 1.000 0.000
#> SRR1652911     1  0.0000      0.948 1.000 0.000
#> SRR1652912     2  0.0000      0.928 0.000 1.000
#> SRR1652913     2  0.4022      0.871 0.080 0.920
#> SRR1652914     2  0.7139      0.790 0.196 0.804
#> SRR1652915     1  0.7219      0.734 0.800 0.200
#> SRR1652916     1  0.0000      0.948 1.000 0.000
#> SRR1652917     2  0.6247      0.830 0.156 0.844
#> SRR1652918     2  0.0000      0.928 0.000 1.000
#> SRR1652919     1  0.0672      0.942 0.992 0.008
#> SRR1652920     2  0.0000      0.928 0.000 1.000
#> SRR1652921     1  0.7219      0.720 0.800 0.200
#> SRR1652922     1  0.7950      0.670 0.760 0.240
#> SRR1652923     1  0.9815      0.215 0.580 0.420
#> SRR1652924     2  0.0000      0.928 0.000 1.000
#> SRR1652925     2  0.0000      0.928 0.000 1.000
#> SRR1652926     2  0.0000      0.928 0.000 1.000
#> SRR1652927     1  0.0000      0.948 1.000 0.000
#> SRR1652928     1  0.0000      0.948 1.000 0.000
#> SRR1652929     1  0.1414      0.933 0.980 0.020
#> SRR1652930     1  0.0000      0.948 1.000 0.000
#> SRR1652931     2  0.4022      0.888 0.080 0.920
#> SRR1652932     1  0.0000      0.948 1.000 0.000
#> SRR1652933     2  0.0000      0.928 0.000 1.000
#> SRR1652934     2  0.2948      0.905 0.052 0.948
#> SRR1652935     2  0.0000      0.928 0.000 1.000
#> SRR1652936     2  0.0000      0.928 0.000 1.000
#> SRR1652937     1  0.0000      0.948 1.000 0.000
#> SRR1652938     2  0.7674      0.756 0.224 0.776
#> SRR1652939     2  0.7299      0.782 0.204 0.796
#> SRR1652940     1  0.0000      0.948 1.000 0.000
#> SRR1652941     2  0.7299      0.782 0.204 0.796
#> SRR1652942     2  0.0000      0.928 0.000 1.000
#> SRR1652943     2  0.0000      0.928 0.000 1.000
#> SRR1652944     2  0.7299      0.782 0.204 0.796
#> SRR1652945     2  0.0000      0.928 0.000 1.000
#> SRR1652946     2  0.0000      0.928 0.000 1.000
#> SRR1652947     1  0.0000      0.948 1.000 0.000
#> SRR1652948     2  0.0938      0.923 0.012 0.988
#> SRR1652949     1  0.0000      0.948 1.000 0.000
#> SRR1652950     1  0.8861      0.542 0.696 0.304
#> SRR1652951     2  0.0000      0.928 0.000 1.000
#> SRR1652953     1  0.0000      0.948 1.000 0.000
#> SRR1652952     2  0.0000      0.928 0.000 1.000
#> SRR1652954     2  0.7299      0.782 0.204 0.796
#> SRR1652955     1  0.0938      0.940 0.988 0.012
#> SRR1652958     1  0.0000      0.948 1.000 0.000
#> SRR1652956     2  0.0000      0.928 0.000 1.000
#> SRR1652957     2  0.0000      0.928 0.000 1.000
#> SRR1652959     2  0.0000      0.928 0.000 1.000
#> SRR1652960     2  0.0000      0.928 0.000 1.000
#> SRR1652961     2  0.0000      0.928 0.000 1.000
#> SRR1652962     2  0.0000      0.928 0.000 1.000
#> SRR1652963     2  0.0000      0.928 0.000 1.000
#> SRR1652965     1  0.7219      0.734 0.800 0.200
#> SRR1652964     2  0.0000      0.928 0.000 1.000
#> SRR1652966     1  0.0000      0.948 1.000 0.000
#> SRR1652967     2  0.1633      0.918 0.024 0.976
#> SRR1652969     2  0.0000      0.928 0.000 1.000
#> SRR1652968     2  0.9881      0.301 0.436 0.564
#> SRR1652970     1  0.0000      0.948 1.000 0.000
#> SRR1652971     2  0.8861      0.627 0.304 0.696
#> SRR1652972     1  0.0000      0.948 1.000 0.000
#> SRR1652973     2  0.6438      0.823 0.164 0.836
#> SRR1652974     1  0.0000      0.948 1.000 0.000
#> SRR1652975     2  0.0000      0.928 0.000 1.000
#> SRR1652976     2  0.4939      0.869 0.108 0.892
#> SRR1652977     2  0.8763      0.643 0.296 0.704

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652896     3  0.5363     0.6229 0.000 0.276 0.724
#> SRR1652897     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652898     3  0.6235     0.1582 0.436 0.000 0.564
#> SRR1652899     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652900     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652901     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652902     1  0.4504     0.7370 0.804 0.000 0.196
#> SRR1652903     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652905     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652906     1  0.3879     0.7898 0.848 0.000 0.152
#> SRR1652907     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652908     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652909     3  0.3267     0.7755 0.116 0.000 0.884
#> SRR1652910     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652911     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652913     1  0.6309     0.0224 0.504 0.496 0.000
#> SRR1652914     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652915     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652916     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652917     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652918     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652919     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652920     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652921     1  0.6244     0.1430 0.560 0.000 0.440
#> SRR1652922     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652923     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652924     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652925     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652926     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652927     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652928     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652929     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652930     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652931     2  0.6225     0.1544 0.000 0.568 0.432
#> SRR1652932     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652933     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652934     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652935     3  0.5706     0.5214 0.000 0.320 0.680
#> SRR1652936     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652937     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652938     3  0.5835     0.5082 0.000 0.340 0.660
#> SRR1652939     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652940     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652941     3  0.4399     0.7338 0.000 0.188 0.812
#> SRR1652942     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652943     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652944     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652945     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652946     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652947     1  0.0747     0.9180 0.984 0.000 0.016
#> SRR1652948     3  0.1860     0.8412 0.000 0.052 0.948
#> SRR1652949     1  0.4555     0.7317 0.800 0.000 0.200
#> SRR1652950     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652951     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652953     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652952     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652954     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652955     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652958     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652956     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652957     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652959     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652960     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652961     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652962     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652963     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652965     3  0.6111     0.2722 0.396 0.000 0.604
#> SRR1652964     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652966     1  0.1753     0.8932 0.952 0.000 0.048
#> SRR1652967     2  0.5431     0.5529 0.000 0.716 0.284
#> SRR1652969     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652968     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652970     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652971     3  0.5678     0.5556 0.000 0.316 0.684
#> SRR1652972     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652973     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652974     1  0.0000     0.9284 1.000 0.000 0.000
#> SRR1652975     2  0.0000     0.9755 0.000 1.000 0.000
#> SRR1652976     3  0.0000     0.8686 0.000 0.000 1.000
#> SRR1652977     3  0.0000     0.8686 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
#> SRR1652895     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.4250      0.603 0.000 0.000 0.724 0.276
#> SRR1652897     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652898     3  0.4941      0.163 0.436 0.000 0.564 0.000
#> SRR1652899     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652900     4  0.0336      0.930 0.000 0.008 0.000 0.992
#> SRR1652901     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652902     1  0.3569      0.739 0.804 0.000 0.196 0.000
#> SRR1652903     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652905     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652906     1  0.3074      0.792 0.848 0.000 0.152 0.000
#> SRR1652907     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652908     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652909     3  0.2589      0.761 0.116 0.000 0.884 0.000
#> SRR1652910     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652911     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.4972      0.200 0.000 0.544 0.000 0.456
#> SRR1652913     1  0.5000      0.037 0.504 0.000 0.000 0.496
#> SRR1652914     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652915     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652916     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652917     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652918     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652919     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652920     2  0.0000      0.873 0.000 1.000 0.000 0.000
#> SRR1652921     1  0.4948      0.141 0.560 0.000 0.440 0.000
#> SRR1652922     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652923     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652924     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652925     4  0.4925      0.104 0.000 0.428 0.000 0.572
#> SRR1652926     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652927     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652928     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652929     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652930     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652931     4  0.4933      0.175 0.000 0.000 0.432 0.568
#> SRR1652932     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652933     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652934     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652935     3  0.4522      0.506 0.000 0.000 0.680 0.320
#> SRR1652936     2  0.0000      0.873 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652938     3  0.4624      0.486 0.000 0.000 0.660 0.340
#> SRR1652939     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652940     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652941     3  0.3486      0.698 0.000 0.000 0.812 0.188
#> SRR1652942     2  0.0000      0.873 0.000 1.000 0.000 0.000
#> SRR1652943     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652944     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652945     4  0.0188      0.934 0.000 0.004 0.000 0.996
#> SRR1652946     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652947     1  0.0592      0.915 0.984 0.000 0.016 0.000
#> SRR1652948     3  0.1474      0.820 0.000 0.000 0.948 0.052
#> SRR1652949     1  0.3610      0.734 0.800 0.000 0.200 0.000
#> SRR1652950     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652951     2  0.0469      0.865 0.000 0.988 0.000 0.012
#> SRR1652953     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000      0.873 0.000 1.000 0.000 0.000
#> SRR1652954     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652955     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652958     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652956     2  0.0000      0.873 0.000 1.000 0.000 0.000
#> SRR1652957     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652959     4  0.0921      0.910 0.000 0.028 0.000 0.972
#> SRR1652960     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652961     2  0.4888      0.308 0.000 0.588 0.000 0.412
#> SRR1652962     2  0.0000      0.873 0.000 1.000 0.000 0.000
#> SRR1652963     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652965     3  0.4843      0.277 0.396 0.000 0.604 0.000
#> SRR1652964     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652966     1  0.1389      0.890 0.952 0.000 0.048 0.000
#> SRR1652967     4  0.4304      0.554 0.000 0.000 0.284 0.716
#> SRR1652969     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652968     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652970     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652971     3  0.4500      0.532 0.000 0.000 0.684 0.316
#> SRR1652972     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652973     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652974     1  0.0000      0.926 1.000 0.000 0.000 0.000
#> SRR1652975     4  0.0000      0.937 0.000 0.000 0.000 1.000
#> SRR1652976     3  0.0000      0.854 0.000 0.000 1.000 0.000
#> SRR1652977     3  0.0000      0.854 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.3661     0.2343 0.000 0.000 0.724 0.276 0.000
#> SRR1652897     1  0.2020     0.7050 0.900 0.000 0.000 0.000 0.100
#> SRR1652898     3  0.6068     0.0549 0.140 0.000 0.532 0.000 0.328
#> SRR1652899     1  0.4030     0.5861 0.648 0.000 0.000 0.000 0.352
#> SRR1652900     4  0.0290     0.8140 0.000 0.008 0.000 0.992 0.000
#> SRR1652901     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652902     1  0.6433     0.2977 0.464 0.000 0.184 0.000 0.352
#> SRR1652903     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652906     1  0.6066     0.4002 0.516 0.000 0.132 0.000 0.352
#> SRR1652907     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652908     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652909     3  0.5630     0.0951 0.088 0.000 0.560 0.000 0.352
#> SRR1652910     1  0.4030     0.5861 0.648 0.000 0.000 0.000 0.352
#> SRR1652911     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.4283     0.1627 0.000 0.544 0.000 0.456 0.000
#> SRR1652913     1  0.5858     0.0226 0.452 0.000 0.000 0.452 0.096
#> SRR1652914     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652915     3  0.3857     0.3380 0.000 0.000 0.688 0.000 0.312
#> SRR1652916     1  0.4015     0.5883 0.652 0.000 0.000 0.000 0.348
#> SRR1652917     4  0.3661     0.4760 0.000 0.000 0.000 0.724 0.276
#> SRR1652918     4  0.0162     0.8164 0.000 0.000 0.000 0.996 0.004
#> SRR1652919     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652920     2  0.0000     0.8336 0.000 1.000 0.000 0.000 0.000
#> SRR1652921     1  0.5778     0.3146 0.464 0.000 0.088 0.000 0.448
#> SRR1652922     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652923     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652924     4  0.1965     0.7733 0.000 0.000 0.000 0.904 0.096
#> SRR1652925     4  0.4504     0.1304 0.000 0.428 0.000 0.564 0.008
#> SRR1652926     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652927     1  0.4030     0.5861 0.648 0.000 0.000 0.000 0.352
#> SRR1652928     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652930     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652931     4  0.4249     0.0904 0.000 0.000 0.432 0.568 0.000
#> SRR1652932     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652934     4  0.1792     0.7532 0.000 0.000 0.000 0.916 0.084
#> SRR1652935     3  0.3895     0.2529 0.000 0.000 0.680 0.320 0.000
#> SRR1652936     2  0.0000     0.8336 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652938     5  0.6649     0.2998 0.000 0.000 0.268 0.284 0.448
#> SRR1652939     4  0.4249     0.1811 0.000 0.000 0.000 0.568 0.432
#> SRR1652940     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.6441    -0.2864 0.000 0.000 0.468 0.188 0.344
#> SRR1652942     2  0.0000     0.8336 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     4  0.0162     0.8164 0.000 0.000 0.000 0.996 0.004
#> SRR1652944     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652945     4  0.2124     0.7722 0.000 0.004 0.000 0.900 0.096
#> SRR1652946     4  0.1965     0.7733 0.000 0.000 0.000 0.904 0.096
#> SRR1652947     1  0.1300     0.7506 0.956 0.000 0.016 0.000 0.028
#> SRR1652948     3  0.1270     0.6919 0.000 0.000 0.948 0.052 0.000
#> SRR1652949     1  0.6455     0.2888 0.460 0.000 0.188 0.000 0.352
#> SRR1652950     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652951     2  0.0404     0.8227 0.000 0.988 0.000 0.012 0.000
#> SRR1652953     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.8336 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     4  0.4262     0.1601 0.000 0.000 0.000 0.560 0.440
#> SRR1652955     3  0.2732     0.5833 0.000 0.000 0.840 0.000 0.160
#> SRR1652958     1  0.4030     0.5861 0.648 0.000 0.000 0.000 0.352
#> SRR1652956     2  0.0000     0.8336 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     4  0.2230     0.7591 0.000 0.000 0.000 0.884 0.116
#> SRR1652959     4  0.0955     0.8004 0.000 0.028 0.000 0.968 0.004
#> SRR1652960     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652961     2  0.4455     0.2710 0.000 0.588 0.000 0.404 0.008
#> SRR1652962     2  0.0000     0.8336 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652965     3  0.5490     0.1794 0.084 0.000 0.592 0.000 0.324
#> SRR1652964     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652966     1  0.5094     0.5346 0.600 0.000 0.048 0.000 0.352
#> SRR1652967     4  0.3707     0.4464 0.000 0.000 0.284 0.716 0.000
#> SRR1652969     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652968     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652970     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.4100     0.2812 0.000 0.000 0.192 0.044 0.764
#> SRR1652972     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652973     4  0.4088     0.3518 0.000 0.000 0.000 0.632 0.368
#> SRR1652974     1  0.0000     0.7652 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     4  0.0000     0.8174 0.000 0.000 0.000 1.000 0.000
#> SRR1652976     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000
#> SRR1652977     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4 p5    p6
#> SRR1652895     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652896     3  0.3405     0.4788 0.000 0.000 0.724 0.272  0 0.004
#> SRR1652897     1  0.2697     0.7050 0.812 0.000 0.000 0.000  0 0.188
#> SRR1652898     6  0.5260     0.2966 0.100 0.000 0.396 0.000  0 0.504
#> SRR1652899     6  0.3860     0.4962 0.472 0.000 0.000 0.000  0 0.528
#> SRR1652900     4  0.0260     0.7878 0.000 0.008 0.000 0.992  0 0.000
#> SRR1652901     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652902     6  0.5588     0.5873 0.300 0.000 0.172 0.000  0 0.528
#> SRR1652903     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652904     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652905     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652906     6  0.5104     0.5709 0.372 0.000 0.088 0.000  0 0.540
#> SRR1652907     1  0.0146     0.9702 0.996 0.000 0.000 0.000  0 0.004
#> SRR1652908     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652909     6  0.5022     0.3059 0.076 0.000 0.396 0.000  0 0.528
#> SRR1652910     6  0.3860     0.4962 0.472 0.000 0.000 0.000  0 0.528
#> SRR1652911     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652912     2  0.3847     0.1864 0.000 0.544 0.000 0.456  0 0.000
#> SRR1652913     4  0.5890     0.2186 0.208 0.000 0.000 0.440  0 0.352
#> SRR1652914     3  0.0000     0.8505 0.000 0.000 1.000 0.000  0 0.000
#> SRR1652915     3  0.3782     0.1796 0.000 0.000 0.588 0.000  0 0.412
#> SRR1652916     6  0.3862     0.4903 0.476 0.000 0.000 0.000  0 0.524
#> SRR1652917     4  0.3531     0.3884 0.000 0.000 0.000 0.672  0 0.328
#> SRR1652918     4  0.0713     0.7820 0.000 0.000 0.000 0.972  0 0.028
#> SRR1652919     3  0.0000     0.8505 0.000 0.000 1.000 0.000  0 0.000
#> SRR1652920     2  0.0000     0.8165 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652921     6  0.2048     0.4466 0.120 0.000 0.000 0.000  0 0.880
#> SRR1652922     3  0.0146     0.8488 0.000 0.000 0.996 0.000  0 0.004
#> SRR1652923     3  0.0363     0.8469 0.000 0.000 0.988 0.000  0 0.012
#> SRR1652924     4  0.3620     0.5637 0.000 0.000 0.000 0.648  0 0.352
#> SRR1652925     4  0.5102    -0.0328 0.000 0.428 0.000 0.492  0 0.080
#> SRR1652926     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652927     6  0.3860     0.4962 0.472 0.000 0.000 0.000  0 0.528
#> SRR1652928     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652929     3  0.0000     0.8505 0.000 0.000 1.000 0.000  0 0.000
#> SRR1652930     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652931     4  0.3817     0.2448 0.000 0.000 0.432 0.568  0 0.000
#> SRR1652932     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652933     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652934     4  0.1663     0.7279 0.000 0.000 0.000 0.912  0 0.088
#> SRR1652935     3  0.3499     0.4375 0.000 0.000 0.680 0.320  0 0.000
#> SRR1652936     2  0.0000     0.8165 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652937     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652938     6  0.2257     0.3892 0.000 0.000 0.008 0.116  0 0.876
#> SRR1652939     6  0.2912     0.3813 0.000 0.000 0.000 0.216  0 0.784
#> SRR1652940     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652941     6  0.5670     0.3223 0.000 0.000 0.296 0.188  0 0.516
#> SRR1652942     2  0.0000     0.8165 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652943     4  0.0458     0.7863 0.000 0.000 0.000 0.984  0 0.016
#> SRR1652944     3  0.0363     0.8469 0.000 0.000 0.988 0.000  0 0.012
#> SRR1652945     4  0.3756     0.5611 0.000 0.004 0.000 0.644  0 0.352
#> SRR1652946     4  0.3620     0.5637 0.000 0.000 0.000 0.648  0 0.352
#> SRR1652947     1  0.1594     0.8948 0.932 0.000 0.016 0.000  0 0.052
#> SRR1652948     3  0.1141     0.8044 0.000 0.000 0.948 0.052  0 0.000
#> SRR1652949     6  0.5523     0.5885 0.296 0.000 0.164 0.000  0 0.540
#> SRR1652950     3  0.0000     0.8505 0.000 0.000 1.000 0.000  0 0.000
#> SRR1652951     2  0.0363     0.8036 0.000 0.988 0.000 0.012  0 0.000
#> SRR1652953     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652952     2  0.0000     0.8165 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652954     6  0.2762     0.3947 0.000 0.000 0.000 0.196  0 0.804
#> SRR1652955     3  0.2664     0.6800 0.000 0.000 0.816 0.000  0 0.184
#> SRR1652958     6  0.3860     0.4962 0.472 0.000 0.000 0.000  0 0.528
#> SRR1652956     2  0.0000     0.8165 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652957     4  0.3684     0.5369 0.000 0.000 0.000 0.628  0 0.372
#> SRR1652959     4  0.1908     0.7515 0.000 0.028 0.000 0.916  0 0.056
#> SRR1652960     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652961     2  0.4926     0.3593 0.000 0.584 0.000 0.336  0 0.080
#> SRR1652962     2  0.0000     0.8165 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652963     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652965     3  0.3991    -0.0245 0.004 0.000 0.524 0.000  0 0.472
#> SRR1652964     3  0.0000     0.8505 0.000 0.000 1.000 0.000  0 0.000
#> SRR1652966     6  0.4660     0.5443 0.416 0.000 0.044 0.000  0 0.540
#> SRR1652967     4  0.4986     0.3585 0.000 0.000 0.284 0.612  0 0.104
#> SRR1652969     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652968     3  0.0363     0.8469 0.000 0.000 0.988 0.000  0 0.012
#> SRR1652970     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652971     5  0.0000     0.0000 0.000 0.000 0.000 0.000  1 0.000
#> SRR1652972     3  0.0363     0.8453 0.000 0.000 0.988 0.000  0 0.012
#> SRR1652973     6  0.3747    -0.0294 0.000 0.000 0.000 0.396  0 0.604
#> SRR1652974     1  0.0000     0.9745 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652975     4  0.0000     0.7907 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652976     3  0.0000     0.8505 0.000 0.000 1.000 0.000  0 0.000
#> SRR1652977     3  0.0000     0.8505 0.000 0.000 1.000 0.000  0 0.000

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

consensus_heatmap(res, k = 2)

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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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 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 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.487           0.903       0.918         0.2286 0.804   0.804
#> 3 3 0.189           0.470       0.723         1.3275 0.637   0.559
#> 4 4 0.533           0.771       0.836         0.3395 0.616   0.308
#> 5 5 0.751           0.745       0.866         0.0915 0.916   0.694
#> 6 6 0.825           0.818       0.896         0.0485 0.934   0.711

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
#> SRR1652895     1  0.8016      0.976 0.756 0.244
#> SRR1652896     2  0.5842      0.837 0.140 0.860
#> SRR1652897     2  0.0000      0.924 0.000 1.000
#> SRR1652898     2  0.2043      0.914 0.032 0.968
#> SRR1652899     2  0.0000      0.924 0.000 1.000
#> SRR1652900     2  0.4562      0.894 0.096 0.904
#> SRR1652901     2  0.1184      0.923 0.016 0.984
#> SRR1652902     2  0.0000      0.924 0.000 1.000
#> SRR1652903     1  0.8016      0.976 0.756 0.244
#> SRR1652904     1  0.8016      0.976 0.756 0.244
#> SRR1652905     2  0.3274      0.910 0.060 0.940
#> SRR1652906     2  0.0000      0.924 0.000 1.000
#> SRR1652907     2  0.0000      0.924 0.000 1.000
#> SRR1652908     2  0.3274      0.910 0.060 0.940
#> SRR1652909     2  0.0000      0.924 0.000 1.000
#> SRR1652910     2  0.1843      0.910 0.028 0.972
#> SRR1652911     1  0.8016      0.976 0.756 0.244
#> SRR1652912     2  0.4815      0.889 0.104 0.896
#> SRR1652913     2  0.0376      0.924 0.004 0.996
#> SRR1652914     2  0.5842      0.837 0.140 0.860
#> SRR1652915     2  0.5294      0.854 0.120 0.880
#> SRR1652916     2  0.0000      0.924 0.000 1.000
#> SRR1652917     2  0.0000      0.924 0.000 1.000
#> SRR1652918     2  0.3274      0.910 0.060 0.940
#> SRR1652919     2  0.6247      0.834 0.156 0.844
#> SRR1652920     2  0.4562      0.894 0.096 0.904
#> SRR1652921     2  0.0000      0.924 0.000 1.000
#> SRR1652922     2  0.6247      0.834 0.156 0.844
#> SRR1652923     2  0.5842      0.837 0.140 0.860
#> SRR1652924     2  0.3274      0.910 0.060 0.940
#> SRR1652925     2  0.3879      0.906 0.076 0.924
#> SRR1652926     2  0.2948      0.914 0.052 0.948
#> SRR1652927     2  0.0000      0.924 0.000 1.000
#> SRR1652928     2  0.0000      0.924 0.000 1.000
#> SRR1652929     2  0.5629      0.844 0.132 0.868
#> SRR1652930     2  0.0000      0.924 0.000 1.000
#> SRR1652931     2  0.1414      0.919 0.020 0.980
#> SRR1652932     1  0.8016      0.976 0.756 0.244
#> SRR1652933     2  0.2603      0.917 0.044 0.956
#> SRR1652934     2  0.0000      0.924 0.000 1.000
#> SRR1652935     2  0.6531      0.836 0.168 0.832
#> SRR1652936     2  0.4815      0.889 0.104 0.896
#> SRR1652937     1  0.9635      0.758 0.612 0.388
#> SRR1652938     2  0.0938      0.924 0.012 0.988
#> SRR1652939     2  0.0000      0.924 0.000 1.000
#> SRR1652940     1  0.8016      0.976 0.756 0.244
#> SRR1652941     2  0.0000      0.924 0.000 1.000
#> SRR1652942     2  0.4815      0.889 0.104 0.896
#> SRR1652943     2  0.3274      0.910 0.060 0.940
#> SRR1652944     2  0.5842      0.837 0.140 0.860
#> SRR1652945     2  0.3733      0.908 0.072 0.928
#> SRR1652946     2  0.1184      0.923 0.016 0.984
#> SRR1652947     2  0.0000      0.924 0.000 1.000
#> SRR1652948     2  0.6148      0.837 0.152 0.848
#> SRR1652949     2  0.0376      0.923 0.004 0.996
#> SRR1652950     2  0.0000      0.924 0.000 1.000
#> SRR1652951     2  0.4690      0.892 0.100 0.900
#> SRR1652953     2  0.2423      0.900 0.040 0.960
#> SRR1652952     2  0.4815      0.889 0.104 0.896
#> SRR1652954     2  0.0000      0.924 0.000 1.000
#> SRR1652955     2  0.5842      0.837 0.140 0.860
#> SRR1652958     2  0.0000      0.924 0.000 1.000
#> SRR1652956     2  0.4815      0.889 0.104 0.896
#> SRR1652957     2  0.0000      0.924 0.000 1.000
#> SRR1652959     2  0.4022      0.904 0.080 0.920
#> SRR1652960     2  0.3733      0.906 0.072 0.928
#> SRR1652961     2  0.4562      0.894 0.096 0.904
#> SRR1652962     2  0.4815      0.889 0.104 0.896
#> SRR1652963     2  0.4161      0.902 0.084 0.916
#> SRR1652965     2  0.6247      0.834 0.156 0.844
#> SRR1652964     2  0.2236      0.921 0.036 0.964
#> SRR1652966     2  0.0376      0.923 0.004 0.996
#> SRR1652967     2  0.6247      0.834 0.156 0.844
#> SRR1652969     2  0.0938      0.923 0.012 0.988
#> SRR1652968     2  0.5842      0.837 0.140 0.860
#> SRR1652970     1  0.8016      0.976 0.756 0.244
#> SRR1652971     2  0.6247      0.834 0.156 0.844
#> SRR1652972     2  0.0938      0.924 0.012 0.988
#> SRR1652973     2  0.0000      0.924 0.000 1.000
#> SRR1652974     1  0.8016      0.976 0.756 0.244
#> SRR1652975     2  0.3274      0.910 0.060 0.940
#> SRR1652976     2  0.1633      0.922 0.024 0.976
#> SRR1652977     2  0.5842      0.837 0.140 0.860

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0592    0.60257 0.988 0.012 0.000
#> SRR1652896     3  0.8137    0.63856 0.120 0.252 0.628
#> SRR1652897     2  0.6756    0.52060 0.232 0.712 0.056
#> SRR1652898     2  0.9978   -0.36345 0.304 0.360 0.336
#> SRR1652899     1  0.7858    0.25780 0.572 0.364 0.064
#> SRR1652900     2  0.5268    0.58368 0.012 0.776 0.212
#> SRR1652901     2  0.6621    0.52771 0.032 0.684 0.284
#> SRR1652902     1  0.9773   -0.07738 0.396 0.372 0.232
#> SRR1652903     1  0.0592    0.60257 0.988 0.012 0.000
#> SRR1652904     1  0.0592    0.60257 0.988 0.012 0.000
#> SRR1652905     2  0.5325    0.55571 0.004 0.748 0.248
#> SRR1652906     3  0.9920    0.24603 0.272 0.364 0.364
#> SRR1652907     1  0.9884   -0.13683 0.376 0.364 0.260
#> SRR1652908     2  0.4931    0.56908 0.004 0.784 0.212
#> SRR1652909     2  0.8491    0.30354 0.312 0.572 0.116
#> SRR1652910     1  0.9319    0.09156 0.484 0.340 0.176
#> SRR1652911     1  0.0592    0.60257 0.988 0.012 0.000
#> SRR1652912     2  0.5171    0.58261 0.012 0.784 0.204
#> SRR1652913     2  0.4353    0.61434 0.156 0.836 0.008
#> SRR1652914     3  0.6107    0.68969 0.116 0.100 0.784
#> SRR1652915     3  0.7695    0.66866 0.124 0.200 0.676
#> SRR1652916     2  0.8857    0.21325 0.344 0.524 0.132
#> SRR1652917     2  0.6511    0.58159 0.104 0.760 0.136
#> SRR1652918     2  0.4745    0.63177 0.080 0.852 0.068
#> SRR1652919     2  0.5859    0.40828 0.000 0.656 0.344
#> SRR1652920     2  0.2959    0.61372 0.000 0.900 0.100
#> SRR1652921     2  0.4473    0.60935 0.164 0.828 0.008
#> SRR1652922     2  0.6577    0.18751 0.008 0.572 0.420
#> SRR1652923     3  0.5554    0.67389 0.112 0.076 0.812
#> SRR1652924     2  0.2955    0.64106 0.080 0.912 0.008
#> SRR1652925     2  0.1989    0.64424 0.048 0.948 0.004
#> SRR1652926     2  0.5558    0.59149 0.048 0.800 0.152
#> SRR1652927     2  0.9938   -0.23708 0.352 0.368 0.280
#> SRR1652928     1  0.6280    0.19469 0.540 0.460 0.000
#> SRR1652929     3  0.9239    0.49319 0.172 0.328 0.500
#> SRR1652930     2  0.6062    0.25804 0.384 0.616 0.000
#> SRR1652931     3  0.8233    0.62532 0.120 0.264 0.616
#> SRR1652932     1  0.0892    0.60132 0.980 0.020 0.000
#> SRR1652933     2  0.5558    0.59149 0.048 0.800 0.152
#> SRR1652934     2  0.6122    0.58464 0.072 0.776 0.152
#> SRR1652935     2  0.5327    0.51203 0.000 0.728 0.272
#> SRR1652936     2  0.5220    0.58135 0.012 0.780 0.208
#> SRR1652937     1  0.4033    0.53226 0.856 0.136 0.008
#> SRR1652938     2  0.3607    0.63444 0.112 0.880 0.008
#> SRR1652939     2  0.6122    0.58464 0.072 0.776 0.152
#> SRR1652940     1  0.0592    0.60257 0.988 0.012 0.000
#> SRR1652941     2  0.9168    0.20338 0.184 0.528 0.288
#> SRR1652942     2  0.5220    0.58135 0.012 0.780 0.208
#> SRR1652943     2  0.5096    0.62695 0.084 0.836 0.080
#> SRR1652944     3  0.6023    0.68028 0.120 0.092 0.788
#> SRR1652945     2  0.1964    0.64471 0.056 0.944 0.000
#> SRR1652946     2  0.4099    0.62206 0.140 0.852 0.008
#> SRR1652947     1  0.8165    0.15897 0.512 0.416 0.072
#> SRR1652948     2  0.7633    0.35958 0.084 0.652 0.264
#> SRR1652949     2  0.9964   -0.32877 0.352 0.356 0.292
#> SRR1652950     3  0.9462    0.27067 0.180 0.400 0.420
#> SRR1652951     2  0.5812    0.58648 0.012 0.724 0.264
#> SRR1652953     1  0.6730    0.36566 0.680 0.284 0.036
#> SRR1652952     2  0.5220    0.58135 0.012 0.780 0.208
#> SRR1652954     2  0.6380    0.57807 0.164 0.760 0.076
#> SRR1652955     3  0.5780    0.67928 0.120 0.080 0.800
#> SRR1652958     2  0.9550    0.00264 0.368 0.436 0.196
#> SRR1652956     2  0.5220    0.58135 0.012 0.780 0.208
#> SRR1652957     2  0.6100    0.59828 0.096 0.784 0.120
#> SRR1652959     2  0.3267    0.62564 0.000 0.884 0.116
#> SRR1652960     2  0.4346    0.62958 0.000 0.816 0.184
#> SRR1652961     2  0.4473    0.59099 0.008 0.828 0.164
#> SRR1652962     2  0.5220    0.58135 0.012 0.780 0.208
#> SRR1652963     2  0.4968    0.61302 0.012 0.800 0.188
#> SRR1652965     2  0.5859    0.40828 0.000 0.656 0.344
#> SRR1652964     2  0.3816    0.61542 0.000 0.852 0.148
#> SRR1652966     3  0.9946    0.29242 0.284 0.348 0.368
#> SRR1652967     2  0.5760    0.43414 0.000 0.672 0.328
#> SRR1652969     2  0.6034    0.58620 0.068 0.780 0.152
#> SRR1652968     3  0.5407    0.67030 0.104 0.076 0.820
#> SRR1652970     1  0.0592    0.60257 0.988 0.012 0.000
#> SRR1652971     2  0.5760    0.43414 0.000 0.672 0.328
#> SRR1652972     2  0.8955    0.12198 0.140 0.516 0.344
#> SRR1652973     2  0.6122    0.58464 0.072 0.776 0.152
#> SRR1652974     1  0.0747    0.60260 0.984 0.016 0.000
#> SRR1652975     2  0.5558    0.59149 0.048 0.800 0.152
#> SRR1652976     2  0.5178    0.53484 0.000 0.744 0.256
#> SRR1652977     3  0.5793    0.68351 0.116 0.084 0.800

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0000      0.820 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.1917      0.848 0.036 0.008 0.944 0.012
#> SRR1652897     1  0.5571      0.673 0.712 0.024 0.028 0.236
#> SRR1652898     3  0.6534      0.250 0.360 0.032 0.576 0.032
#> SRR1652899     1  0.4830      0.816 0.804 0.024 0.124 0.048
#> SRR1652900     2  0.2647      0.881 0.000 0.880 0.000 0.120
#> SRR1652901     4  0.6990      0.474 0.024 0.080 0.312 0.584
#> SRR1652902     1  0.5748      0.780 0.736 0.024 0.176 0.064
#> SRR1652903     1  0.0000      0.820 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000      0.820 1.000 0.000 0.000 0.000
#> SRR1652905     4  0.6831      0.281 0.016 0.320 0.080 0.584
#> SRR1652906     1  0.6112      0.716 0.676 0.024 0.252 0.048
#> SRR1652907     1  0.6273      0.682 0.656 0.032 0.272 0.040
#> SRR1652908     2  0.6626      0.637 0.028 0.628 0.060 0.284
#> SRR1652909     3  0.6988      0.327 0.340 0.024 0.564 0.072
#> SRR1652910     1  0.5229      0.800 0.772 0.024 0.156 0.048
#> SRR1652911     1  0.0000      0.820 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.2408      0.885 0.000 0.896 0.000 0.104
#> SRR1652913     4  0.2750      0.846 0.056 0.032 0.004 0.908
#> SRR1652914     3  0.1174      0.846 0.020 0.000 0.968 0.012
#> SRR1652915     3  0.2915      0.844 0.044 0.024 0.908 0.024
#> SRR1652916     1  0.5687      0.798 0.748 0.020 0.144 0.088
#> SRR1652917     4  0.4074      0.839 0.132 0.020 0.016 0.832
#> SRR1652918     4  0.1798      0.839 0.016 0.040 0.000 0.944
#> SRR1652919     3  0.4376      0.792 0.004 0.172 0.796 0.028
#> SRR1652920     2  0.3688      0.825 0.000 0.792 0.000 0.208
#> SRR1652921     4  0.2982      0.848 0.064 0.024 0.012 0.900
#> SRR1652922     3  0.4324      0.805 0.008 0.140 0.816 0.036
#> SRR1652923     3  0.1174      0.846 0.020 0.000 0.968 0.012
#> SRR1652924     4  0.1798      0.839 0.016 0.040 0.000 0.944
#> SRR1652925     4  0.1767      0.835 0.012 0.044 0.000 0.944
#> SRR1652926     4  0.2989      0.847 0.100 0.012 0.004 0.884
#> SRR1652927     1  0.5461      0.799 0.764 0.024 0.144 0.068
#> SRR1652928     1  0.3200      0.824 0.880 0.024 0.004 0.092
#> SRR1652929     3  0.3316      0.840 0.044 0.032 0.892 0.032
#> SRR1652930     1  0.4481      0.814 0.820 0.024 0.032 0.124
#> SRR1652931     3  0.1767      0.843 0.044 0.000 0.944 0.012
#> SRR1652932     1  0.0336      0.823 0.992 0.000 0.000 0.008
#> SRR1652933     4  0.4187      0.825 0.092 0.056 0.012 0.840
#> SRR1652934     4  0.3963      0.837 0.132 0.016 0.016 0.836
#> SRR1652935     2  0.5495      0.160 0.000 0.624 0.348 0.028
#> SRR1652936     2  0.2408      0.885 0.000 0.896 0.000 0.104
#> SRR1652937     1  0.1022      0.828 0.968 0.000 0.000 0.032
#> SRR1652938     4  0.2762      0.845 0.048 0.028 0.012 0.912
#> SRR1652939     4  0.3845      0.838 0.132 0.012 0.016 0.840
#> SRR1652940     1  0.0000      0.820 1.000 0.000 0.000 0.000
#> SRR1652941     3  0.5614      0.730 0.140 0.024 0.756 0.080
#> SRR1652942     2  0.2281      0.883 0.000 0.904 0.000 0.096
#> SRR1652943     4  0.1798      0.839 0.016 0.040 0.000 0.944
#> SRR1652944     3  0.1488      0.846 0.032 0.000 0.956 0.012
#> SRR1652945     4  0.1798      0.839 0.016 0.040 0.000 0.944
#> SRR1652946     4  0.1892      0.840 0.016 0.036 0.004 0.944
#> SRR1652947     1  0.5208      0.810 0.784 0.024 0.124 0.068
#> SRR1652948     3  0.4515      0.827 0.036 0.100 0.828 0.036
#> SRR1652949     1  0.6322      0.670 0.648 0.032 0.280 0.040
#> SRR1652950     3  0.3475      0.832 0.044 0.024 0.884 0.048
#> SRR1652951     2  0.2469      0.885 0.000 0.892 0.000 0.108
#> SRR1652953     1  0.2996      0.834 0.904 0.020 0.028 0.048
#> SRR1652952     2  0.2281      0.883 0.000 0.904 0.000 0.096
#> SRR1652954     4  0.4113      0.836 0.136 0.024 0.012 0.828
#> SRR1652955     3  0.1488      0.846 0.032 0.000 0.956 0.012
#> SRR1652958     1  0.5577      0.795 0.756 0.024 0.148 0.072
#> SRR1652956     2  0.2281      0.883 0.000 0.904 0.000 0.096
#> SRR1652957     4  0.3956      0.840 0.132 0.020 0.012 0.836
#> SRR1652959     2  0.4916      0.381 0.000 0.576 0.000 0.424
#> SRR1652960     2  0.4485      0.806 0.028 0.772 0.000 0.200
#> SRR1652961     2  0.2760      0.879 0.000 0.872 0.000 0.128
#> SRR1652962     2  0.2281      0.883 0.000 0.904 0.000 0.096
#> SRR1652963     2  0.3108      0.875 0.000 0.872 0.016 0.112
#> SRR1652965     3  0.4692      0.744 0.000 0.212 0.756 0.032
#> SRR1652964     4  0.7413      0.184 0.000 0.176 0.352 0.472
#> SRR1652966     1  0.6431      0.635 0.624 0.024 0.304 0.048
#> SRR1652967     3  0.5389      0.635 0.000 0.308 0.660 0.032
#> SRR1652969     4  0.3502      0.844 0.100 0.016 0.016 0.868
#> SRR1652968     3  0.0937      0.844 0.012 0.000 0.976 0.012
#> SRR1652970     1  0.0188      0.822 0.996 0.000 0.000 0.004
#> SRR1652971     3  0.5389      0.635 0.000 0.308 0.660 0.032
#> SRR1652972     3  0.4733      0.822 0.072 0.056 0.824 0.048
#> SRR1652973     4  0.3963      0.837 0.132 0.016 0.016 0.836
#> SRR1652974     1  0.0336      0.823 0.992 0.000 0.000 0.008
#> SRR1652975     4  0.3795      0.825 0.080 0.060 0.004 0.856
#> SRR1652976     3  0.4706      0.768 0.000 0.140 0.788 0.072
#> SRR1652977     3  0.1059      0.845 0.016 0.000 0.972 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
#> SRR1652895     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.0162      0.846 0.000 0.000 0.996 0.000 0.004
#> SRR1652897     1  0.4418      0.438 0.652 0.000 0.016 0.332 0.000
#> SRR1652898     3  0.3511      0.677 0.184 0.012 0.800 0.000 0.004
#> SRR1652899     1  0.0451      0.871 0.988 0.008 0.000 0.004 0.000
#> SRR1652900     2  0.0162      0.821 0.000 0.996 0.000 0.004 0.000
#> SRR1652901     4  0.4343      0.709 0.096 0.000 0.136 0.768 0.000
#> SRR1652902     1  0.4365      0.567 0.676 0.012 0.308 0.000 0.004
#> SRR1652903     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     4  0.0992      0.853 0.000 0.024 0.000 0.968 0.008
#> SRR1652906     3  0.4109      0.572 0.260 0.008 0.724 0.008 0.000
#> SRR1652907     1  0.4764      0.284 0.548 0.012 0.436 0.000 0.004
#> SRR1652908     4  0.2753      0.748 0.000 0.136 0.000 0.856 0.008
#> SRR1652909     1  0.4474      0.529 0.652 0.012 0.332 0.000 0.004
#> SRR1652910     1  0.3001      0.775 0.844 0.008 0.144 0.000 0.004
#> SRR1652911     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0162      0.822 0.000 0.996 0.000 0.000 0.004
#> SRR1652913     4  0.5118      0.789 0.092 0.024 0.000 0.732 0.152
#> SRR1652914     3  0.0000      0.847 0.000 0.000 1.000 0.000 0.000
#> SRR1652915     3  0.0162      0.846 0.000 0.004 0.996 0.000 0.000
#> SRR1652916     1  0.1579      0.847 0.944 0.000 0.032 0.024 0.000
#> SRR1652917     4  0.0510      0.859 0.000 0.000 0.016 0.984 0.000
#> SRR1652918     4  0.3386      0.838 0.000 0.040 0.000 0.832 0.128
#> SRR1652919     5  0.5511      0.520 0.000 0.080 0.344 0.000 0.576
#> SRR1652920     2  0.5889      0.238 0.000 0.544 0.000 0.340 0.116
#> SRR1652921     4  0.5563      0.606 0.292 0.028 0.000 0.632 0.048
#> SRR1652922     5  0.5632      0.420 0.000 0.080 0.392 0.000 0.528
#> SRR1652923     3  0.0000      0.847 0.000 0.000 1.000 0.000 0.000
#> SRR1652924     4  0.4751      0.781 0.000 0.116 0.000 0.732 0.152
#> SRR1652925     4  0.5002      0.767 0.000 0.132 0.000 0.708 0.160
#> SRR1652926     4  0.0290      0.861 0.000 0.000 0.000 0.992 0.008
#> SRR1652927     1  0.1173      0.861 0.964 0.004 0.020 0.012 0.000
#> SRR1652928     1  0.0613      0.870 0.984 0.008 0.000 0.004 0.004
#> SRR1652929     3  0.1173      0.831 0.020 0.012 0.964 0.000 0.004
#> SRR1652930     1  0.0740      0.870 0.980 0.008 0.000 0.004 0.008
#> SRR1652931     3  0.0162      0.846 0.000 0.000 0.996 0.000 0.004
#> SRR1652932     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.0290      0.861 0.000 0.000 0.000 0.992 0.008
#> SRR1652934     4  0.0000      0.862 0.000 0.000 0.000 1.000 0.000
#> SRR1652935     5  0.3928      0.607 0.000 0.296 0.004 0.000 0.700
#> SRR1652936     2  0.0162      0.822 0.000 0.996 0.000 0.000 0.004
#> SRR1652937     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652938     4  0.5407      0.781 0.096 0.036 0.000 0.716 0.152
#> SRR1652939     4  0.0162      0.862 0.000 0.000 0.000 0.996 0.004
#> SRR1652940     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.5789      0.334 0.304 0.004 0.588 0.104 0.000
#> SRR1652942     2  0.0162      0.822 0.000 0.996 0.000 0.000 0.004
#> SRR1652943     4  0.2424      0.848 0.000 0.000 0.000 0.868 0.132
#> SRR1652944     3  0.0000      0.847 0.000 0.000 1.000 0.000 0.000
#> SRR1652945     4  0.4916      0.774 0.000 0.124 0.000 0.716 0.160
#> SRR1652946     4  0.4990      0.788 0.012 0.104 0.000 0.732 0.152
#> SRR1652947     1  0.2407      0.819 0.896 0.012 0.088 0.000 0.004
#> SRR1652948     3  0.4492      0.524 0.004 0.052 0.740 0.000 0.204
#> SRR1652949     1  0.4791      0.216 0.524 0.012 0.460 0.000 0.004
#> SRR1652950     3  0.0566      0.841 0.000 0.012 0.984 0.000 0.004
#> SRR1652951     2  0.1270      0.790 0.000 0.948 0.000 0.052 0.000
#> SRR1652953     1  0.0566      0.869 0.984 0.012 0.000 0.000 0.004
#> SRR1652952     2  0.0162      0.822 0.000 0.996 0.000 0.000 0.004
#> SRR1652954     4  0.2669      0.822 0.104 0.000 0.020 0.876 0.000
#> SRR1652955     3  0.0000      0.847 0.000 0.000 1.000 0.000 0.000
#> SRR1652958     1  0.1186      0.862 0.964 0.008 0.020 0.008 0.000
#> SRR1652956     2  0.0162      0.822 0.000 0.996 0.000 0.000 0.004
#> SRR1652957     4  0.2645      0.853 0.044 0.000 0.000 0.888 0.068
#> SRR1652959     2  0.1251      0.797 0.000 0.956 0.000 0.036 0.008
#> SRR1652960     2  0.4974      0.130 0.000 0.508 0.000 0.464 0.028
#> SRR1652961     2  0.0865      0.810 0.000 0.972 0.000 0.004 0.024
#> SRR1652962     2  0.0162      0.822 0.000 0.996 0.000 0.000 0.004
#> SRR1652963     2  0.0486      0.820 0.000 0.988 0.004 0.004 0.004
#> SRR1652965     5  0.3479      0.746 0.000 0.080 0.084 0.000 0.836
#> SRR1652964     2  0.6059      0.209 0.000 0.540 0.040 0.372 0.048
#> SRR1652966     3  0.2464      0.782 0.092 0.012 0.892 0.000 0.004
#> SRR1652967     5  0.2848      0.732 0.000 0.156 0.004 0.000 0.840
#> SRR1652969     4  0.0000      0.862 0.000 0.000 0.000 1.000 0.000
#> SRR1652968     3  0.0000      0.847 0.000 0.000 1.000 0.000 0.000
#> SRR1652970     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.2848      0.732 0.000 0.156 0.004 0.000 0.840
#> SRR1652972     3  0.4256      0.696 0.120 0.016 0.796 0.000 0.068
#> SRR1652973     4  0.0000      0.862 0.000 0.000 0.000 1.000 0.000
#> SRR1652974     1  0.0000      0.873 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     4  0.0290      0.861 0.000 0.000 0.000 0.992 0.008
#> SRR1652976     3  0.6158      0.305 0.020 0.140 0.612 0.000 0.228
#> SRR1652977     3  0.0162      0.846 0.004 0.000 0.996 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0000     0.9259 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.0000     0.8515 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652897     1  0.1007     0.9025 0.956 0.000 0.000 0.044 0.000 0.000
#> SRR1652898     3  0.5837     0.4848 0.176 0.000 0.624 0.152 0.044 0.004
#> SRR1652899     1  0.2404     0.8869 0.872 0.000 0.016 0.112 0.000 0.000
#> SRR1652900     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652901     4  0.5048     0.7158 0.024 0.000 0.136 0.688 0.000 0.152
#> SRR1652902     1  0.3129     0.8551 0.820 0.000 0.024 0.152 0.000 0.004
#> SRR1652903     1  0.0000     0.9259 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9259 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652906     3  0.4462     0.6063 0.136 0.000 0.712 0.152 0.000 0.000
#> SRR1652907     1  0.4902     0.6613 0.672 0.000 0.172 0.152 0.000 0.004
#> SRR1652908     4  0.3023     0.7141 0.000 0.140 0.000 0.828 0.000 0.032
#> SRR1652909     1  0.3206     0.8521 0.816 0.000 0.028 0.152 0.000 0.004
#> SRR1652910     1  0.2963     0.8599 0.828 0.000 0.016 0.152 0.000 0.004
#> SRR1652911     1  0.0000     0.9259 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     6  0.0547     0.8921 0.000 0.000 0.000 0.020 0.000 0.980
#> SRR1652914     3  0.0458     0.8478 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1652915     3  0.0790     0.8361 0.000 0.000 0.968 0.032 0.000 0.000
#> SRR1652916     1  0.1913     0.9035 0.908 0.000 0.012 0.080 0.000 0.000
#> SRR1652917     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652918     6  0.3151     0.6442 0.000 0.000 0.000 0.252 0.000 0.748
#> SRR1652919     5  0.3247     0.7534 0.000 0.000 0.156 0.036 0.808 0.000
#> SRR1652920     2  0.1524     0.9013 0.000 0.932 0.000 0.008 0.000 0.060
#> SRR1652921     6  0.3637     0.6982 0.164 0.000 0.000 0.056 0.000 0.780
#> SRR1652922     5  0.3646     0.7372 0.000 0.000 0.172 0.052 0.776 0.000
#> SRR1652923     3  0.0458     0.8478 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1652924     6  0.0547     0.8921 0.000 0.000 0.000 0.020 0.000 0.980
#> SRR1652925     6  0.0547     0.8921 0.000 0.000 0.000 0.020 0.000 0.980
#> SRR1652926     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652927     1  0.2744     0.8673 0.840 0.000 0.016 0.144 0.000 0.000
#> SRR1652928     1  0.0146     0.9248 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652929     3  0.0146     0.8507 0.000 0.000 0.996 0.004 0.000 0.000
#> SRR1652930     1  0.0458     0.9198 0.984 0.000 0.000 0.016 0.000 0.000
#> SRR1652931     3  0.0000     0.8515 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652932     1  0.0000     0.9259 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652934     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652935     5  0.2257     0.7183 0.000 0.116 0.008 0.000 0.876 0.000
#> SRR1652936     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.0291     0.9259 0.992 0.000 0.004 0.004 0.000 0.000
#> SRR1652938     6  0.1845     0.8645 0.028 0.000 0.000 0.052 0.000 0.920
#> SRR1652939     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652940     1  0.0000     0.9259 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     4  0.4344     0.1101 0.032 0.000 0.356 0.612 0.000 0.000
#> SRR1652942     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     6  0.2793     0.7308 0.000 0.000 0.000 0.200 0.000 0.800
#> SRR1652944     3  0.0458     0.8478 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1652945     6  0.0547     0.8921 0.000 0.000 0.000 0.020 0.000 0.980
#> SRR1652946     6  0.0547     0.8921 0.000 0.000 0.000 0.020 0.000 0.980
#> SRR1652947     1  0.1464     0.9159 0.944 0.000 0.016 0.036 0.000 0.004
#> SRR1652948     3  0.0458     0.8435 0.000 0.000 0.984 0.000 0.016 0.000
#> SRR1652949     3  0.5785    -0.0154 0.420 0.000 0.424 0.152 0.000 0.004
#> SRR1652950     3  0.0458     0.8456 0.000 0.000 0.984 0.016 0.000 0.000
#> SRR1652951     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.0291     0.9255 0.992 0.000 0.004 0.000 0.000 0.004
#> SRR1652952     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     4  0.4308     0.7328 0.120 0.000 0.000 0.728 0.000 0.152
#> SRR1652955     3  0.0000     0.8515 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652958     1  0.2572     0.8764 0.852 0.000 0.012 0.136 0.000 0.000
#> SRR1652956     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652957     4  0.3101     0.7821 0.000 0.000 0.000 0.756 0.000 0.244
#> SRR1652959     2  0.0458     0.9402 0.000 0.984 0.000 0.016 0.000 0.000
#> SRR1652960     2  0.2964     0.7409 0.000 0.792 0.000 0.204 0.000 0.004
#> SRR1652961     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0000     0.9527 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652965     5  0.0000     0.7591 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652964     2  0.4107     0.6879 0.000 0.776 0.000 0.052 0.032 0.140
#> SRR1652966     3  0.4279     0.6336 0.104 0.000 0.740 0.152 0.000 0.004
#> SRR1652967     5  0.0000     0.7591 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652969     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652968     3  0.0458     0.8478 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1652970     1  0.0000     0.9259 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.0000     0.7591 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652972     5  0.7511     0.2427 0.192 0.000 0.268 0.152 0.384 0.004
#> SRR1652973     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652974     1  0.0000     0.9259 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652975     4  0.2378     0.8796 0.000 0.000 0.000 0.848 0.000 0.152
#> SRR1652976     5  0.4882     0.4644 0.000 0.036 0.380 0.016 0.568 0.000
#> SRR1652977     3  0.0458     0.8478 0.000 0.000 0.984 0.000 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-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) are extracted by 'SD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.974           0.957       0.982         0.5006 0.498   0.498
#> 3 3 0.653           0.808       0.880         0.2486 0.843   0.693
#> 4 4 0.566           0.705       0.840         0.0827 0.947   0.860
#> 5 5 0.566           0.601       0.817         0.0462 0.953   0.867
#> 6 6 0.572           0.570       0.802         0.0406 0.954   0.865

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
#> SRR1652895     1  0.0000      0.989 1.000 0.000
#> SRR1652896     2  0.0000      0.971 0.000 1.000
#> SRR1652897     1  0.0000      0.989 1.000 0.000
#> SRR1652898     2  0.0000      0.971 0.000 1.000
#> SRR1652899     1  0.0000      0.989 1.000 0.000
#> SRR1652900     2  0.0000      0.971 0.000 1.000
#> SRR1652901     2  0.1184      0.961 0.016 0.984
#> SRR1652902     1  0.0000      0.989 1.000 0.000
#> SRR1652903     1  0.0000      0.989 1.000 0.000
#> SRR1652904     1  0.0000      0.989 1.000 0.000
#> SRR1652905     2  0.0000      0.971 0.000 1.000
#> SRR1652906     1  0.8608      0.589 0.716 0.284
#> SRR1652907     1  0.2236      0.954 0.964 0.036
#> SRR1652908     2  0.0000      0.971 0.000 1.000
#> SRR1652909     1  0.0000      0.989 1.000 0.000
#> SRR1652910     1  0.0938      0.978 0.988 0.012
#> SRR1652911     1  0.0000      0.989 1.000 0.000
#> SRR1652912     2  0.0000      0.971 0.000 1.000
#> SRR1652913     1  0.0000      0.989 1.000 0.000
#> SRR1652914     2  0.0000      0.971 0.000 1.000
#> SRR1652915     2  0.0000      0.971 0.000 1.000
#> SRR1652916     1  0.0000      0.989 1.000 0.000
#> SRR1652917     1  0.0000      0.989 1.000 0.000
#> SRR1652918     1  0.0000      0.989 1.000 0.000
#> SRR1652919     2  0.0000      0.971 0.000 1.000
#> SRR1652920     1  0.0000      0.989 1.000 0.000
#> SRR1652921     1  0.0000      0.989 1.000 0.000
#> SRR1652922     2  0.0000      0.971 0.000 1.000
#> SRR1652923     2  0.0000      0.971 0.000 1.000
#> SRR1652924     1  0.0000      0.989 1.000 0.000
#> SRR1652925     1  0.0000      0.989 1.000 0.000
#> SRR1652926     1  0.0000      0.989 1.000 0.000
#> SRR1652927     1  0.0000      0.989 1.000 0.000
#> SRR1652928     1  0.0000      0.989 1.000 0.000
#> SRR1652929     2  0.0000      0.971 0.000 1.000
#> SRR1652930     1  0.0000      0.989 1.000 0.000
#> SRR1652931     2  0.0000      0.971 0.000 1.000
#> SRR1652932     1  0.0000      0.989 1.000 0.000
#> SRR1652933     1  0.0376      0.985 0.996 0.004
#> SRR1652934     1  0.0000      0.989 1.000 0.000
#> SRR1652935     2  0.0000      0.971 0.000 1.000
#> SRR1652936     2  0.0000      0.971 0.000 1.000
#> SRR1652937     1  0.0000      0.989 1.000 0.000
#> SRR1652938     1  0.0000      0.989 1.000 0.000
#> SRR1652939     1  0.0000      0.989 1.000 0.000
#> SRR1652940     1  0.0000      0.989 1.000 0.000
#> SRR1652941     1  0.5737      0.836 0.864 0.136
#> SRR1652942     2  0.0000      0.971 0.000 1.000
#> SRR1652943     1  0.0000      0.989 1.000 0.000
#> SRR1652944     2  0.0000      0.971 0.000 1.000
#> SRR1652945     1  0.0000      0.989 1.000 0.000
#> SRR1652946     1  0.0000      0.989 1.000 0.000
#> SRR1652947     1  0.0000      0.989 1.000 0.000
#> SRR1652948     2  0.0000      0.971 0.000 1.000
#> SRR1652949     2  0.5629      0.851 0.132 0.868
#> SRR1652950     2  0.0938      0.964 0.012 0.988
#> SRR1652951     2  0.0000      0.971 0.000 1.000
#> SRR1652953     1  0.0000      0.989 1.000 0.000
#> SRR1652952     2  0.0000      0.971 0.000 1.000
#> SRR1652954     1  0.0000      0.989 1.000 0.000
#> SRR1652955     2  0.0000      0.971 0.000 1.000
#> SRR1652958     1  0.0000      0.989 1.000 0.000
#> SRR1652956     2  0.0000      0.971 0.000 1.000
#> SRR1652957     1  0.0000      0.989 1.000 0.000
#> SRR1652959     2  0.9970      0.135 0.468 0.532
#> SRR1652960     2  0.6343      0.816 0.160 0.840
#> SRR1652961     1  0.0000      0.989 1.000 0.000
#> SRR1652962     2  0.0000      0.971 0.000 1.000
#> SRR1652963     2  0.0000      0.971 0.000 1.000
#> SRR1652965     2  0.0000      0.971 0.000 1.000
#> SRR1652964     2  0.1843      0.952 0.028 0.972
#> SRR1652966     2  0.5408      0.861 0.124 0.876
#> SRR1652967     2  0.0000      0.971 0.000 1.000
#> SRR1652969     1  0.0000      0.989 1.000 0.000
#> SRR1652968     2  0.0000      0.971 0.000 1.000
#> SRR1652970     1  0.0000      0.989 1.000 0.000
#> SRR1652971     2  0.3584      0.917 0.068 0.932
#> SRR1652972     2  0.2948      0.933 0.052 0.948
#> SRR1652973     1  0.0000      0.989 1.000 0.000
#> SRR1652974     1  0.0000      0.989 1.000 0.000
#> SRR1652975     1  0.0000      0.989 1.000 0.000
#> SRR1652976     2  0.0000      0.971 0.000 1.000
#> SRR1652977     2  0.0000      0.971 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0237     0.9440 0.996 0.004 0.000
#> SRR1652896     3  0.3038     0.8399 0.000 0.104 0.896
#> SRR1652897     1  0.0424     0.9439 0.992 0.008 0.000
#> SRR1652898     3  0.3769     0.8133 0.016 0.104 0.880
#> SRR1652899     1  0.0424     0.9423 0.992 0.008 0.000
#> SRR1652900     3  0.3752     0.8197 0.000 0.144 0.856
#> SRR1652901     2  0.6018     0.4559 0.008 0.684 0.308
#> SRR1652902     1  0.2564     0.8950 0.936 0.036 0.028
#> SRR1652903     1  0.0000     0.9450 1.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9450 1.000 0.000 0.000
#> SRR1652905     2  0.4062     0.6454 0.000 0.836 0.164
#> SRR1652906     1  0.5216     0.5604 0.740 0.000 0.260
#> SRR1652907     1  0.6374     0.6699 0.768 0.100 0.132
#> SRR1652908     2  0.4233     0.6501 0.004 0.836 0.160
#> SRR1652909     1  0.4379     0.8153 0.868 0.072 0.060
#> SRR1652910     1  0.1751     0.9186 0.960 0.012 0.028
#> SRR1652911     1  0.0000     0.9450 1.000 0.000 0.000
#> SRR1652912     3  0.3038     0.8380 0.000 0.104 0.896
#> SRR1652913     1  0.0424     0.9439 0.992 0.008 0.000
#> SRR1652914     3  0.3038     0.8380 0.000 0.104 0.896
#> SRR1652915     3  0.1964     0.8437 0.000 0.056 0.944
#> SRR1652916     1  0.0424     0.9439 0.992 0.008 0.000
#> SRR1652917     1  0.2448     0.8816 0.924 0.076 0.000
#> SRR1652918     2  0.5948     0.6401 0.360 0.640 0.000
#> SRR1652919     3  0.4047     0.7945 0.004 0.148 0.848
#> SRR1652920     2  0.4683     0.7449 0.140 0.836 0.024
#> SRR1652921     1  0.0000     0.9450 1.000 0.000 0.000
#> SRR1652922     3  0.4233     0.7882 0.004 0.160 0.836
#> SRR1652923     3  0.2537     0.8452 0.000 0.080 0.920
#> SRR1652924     1  0.0424     0.9439 0.992 0.008 0.000
#> SRR1652925     1  0.1031     0.9347 0.976 0.024 0.000
#> SRR1652926     2  0.5733     0.6823 0.324 0.676 0.000
#> SRR1652927     1  0.0424     0.9439 0.992 0.008 0.000
#> SRR1652928     1  0.0237     0.9440 0.996 0.004 0.000
#> SRR1652929     3  0.1860     0.8346 0.000 0.052 0.948
#> SRR1652930     1  0.0000     0.9450 1.000 0.000 0.000
#> SRR1652931     3  0.4178     0.7935 0.000 0.172 0.828
#> SRR1652932     1  0.0000     0.9450 1.000 0.000 0.000
#> SRR1652933     2  0.4945     0.7298 0.104 0.840 0.056
#> SRR1652934     2  0.5760     0.6814 0.328 0.672 0.000
#> SRR1652935     3  0.4233     0.7882 0.004 0.160 0.836
#> SRR1652936     3  0.3192     0.8369 0.000 0.112 0.888
#> SRR1652937     1  0.0237     0.9440 0.996 0.004 0.000
#> SRR1652938     1  0.1289     0.9343 0.968 0.032 0.000
#> SRR1652939     1  0.2711     0.8667 0.912 0.088 0.000
#> SRR1652940     1  0.0237     0.9440 0.996 0.004 0.000
#> SRR1652941     1  0.5826     0.6177 0.764 0.032 0.204
#> SRR1652942     3  0.2878     0.8412 0.000 0.096 0.904
#> SRR1652943     2  0.5948     0.6392 0.360 0.640 0.000
#> SRR1652944     3  0.3267     0.8325 0.000 0.116 0.884
#> SRR1652945     1  0.0237     0.9446 0.996 0.004 0.000
#> SRR1652946     1  0.0424     0.9439 0.992 0.008 0.000
#> SRR1652947     1  0.3375     0.8471 0.892 0.100 0.008
#> SRR1652948     3  0.0892     0.8471 0.000 0.020 0.980
#> SRR1652949     3  0.7775     0.6185 0.168 0.156 0.676
#> SRR1652950     3  0.2152     0.8480 0.016 0.036 0.948
#> SRR1652951     2  0.5882     0.3551 0.000 0.652 0.348
#> SRR1652953     1  0.0747     0.9377 0.984 0.016 0.000
#> SRR1652952     3  0.2625     0.8445 0.000 0.084 0.916
#> SRR1652954     1  0.0747     0.9399 0.984 0.016 0.000
#> SRR1652955     3  0.2625     0.8450 0.000 0.084 0.916
#> SRR1652958     1  0.0424     0.9439 0.992 0.008 0.000
#> SRR1652956     3  0.2261     0.8450 0.000 0.068 0.932
#> SRR1652957     1  0.1031     0.9346 0.976 0.024 0.000
#> SRR1652959     3  0.7188     0.0273 0.484 0.024 0.492
#> SRR1652960     2  0.4413     0.6530 0.008 0.832 0.160
#> SRR1652961     1  0.0829     0.9423 0.984 0.012 0.004
#> SRR1652962     3  0.2448     0.8459 0.000 0.076 0.924
#> SRR1652963     3  0.2878     0.8423 0.000 0.096 0.904
#> SRR1652965     3  0.4575     0.7839 0.012 0.160 0.828
#> SRR1652964     3  0.3141     0.8176 0.068 0.020 0.912
#> SRR1652966     3  0.5931     0.7330 0.124 0.084 0.792
#> SRR1652967     3  0.4755     0.7787 0.008 0.184 0.808
#> SRR1652969     2  0.5178     0.7300 0.256 0.744 0.000
#> SRR1652968     3  0.3619     0.8213 0.000 0.136 0.864
#> SRR1652970     1  0.0424     0.9423 0.992 0.008 0.000
#> SRR1652971     3  0.6424     0.7312 0.068 0.180 0.752
#> SRR1652972     3  0.7862     0.6059 0.184 0.148 0.668
#> SRR1652973     2  0.6252     0.4618 0.444 0.556 0.000
#> SRR1652974     1  0.0237     0.9446 0.996 0.004 0.000
#> SRR1652975     2  0.5363     0.7203 0.276 0.724 0.000
#> SRR1652976     3  0.1860     0.8346 0.000 0.052 0.948
#> SRR1652977     3  0.4452     0.7744 0.000 0.192 0.808

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.1576    0.87600 0.948 0.004 0.000 0.048
#> SRR1652896     3  0.5558    0.53357 0.000 0.080 0.712 0.208
#> SRR1652897     1  0.2300    0.86831 0.920 0.016 0.000 0.064
#> SRR1652898     3  0.4540    0.64047 0.104 0.008 0.816 0.072
#> SRR1652899     1  0.1256    0.86932 0.964 0.008 0.000 0.028
#> SRR1652900     3  0.3170    0.74776 0.044 0.044 0.896 0.016
#> SRR1652901     2  0.4991    0.31197 0.004 0.608 0.388 0.000
#> SRR1652902     1  0.2558    0.85192 0.920 0.008 0.036 0.036
#> SRR1652903     1  0.0817    0.87587 0.976 0.000 0.000 0.024
#> SRR1652904     1  0.1722    0.87448 0.944 0.008 0.000 0.048
#> SRR1652905     2  0.2149    0.67736 0.000 0.912 0.088 0.000
#> SRR1652906     1  0.5120    0.55825 0.700 0.008 0.276 0.016
#> SRR1652907     1  0.4475    0.77262 0.816 0.004 0.100 0.080
#> SRR1652908     2  0.2345    0.67362 0.000 0.900 0.100 0.000
#> SRR1652909     1  0.3299    0.83571 0.888 0.012 0.044 0.056
#> SRR1652910     1  0.3411    0.82097 0.876 0.008 0.084 0.032
#> SRR1652911     1  0.1576    0.87678 0.948 0.004 0.000 0.048
#> SRR1652912     3  0.1488    0.77522 0.000 0.032 0.956 0.012
#> SRR1652913     1  0.2805    0.85698 0.888 0.012 0.000 0.100
#> SRR1652914     3  0.2076    0.77158 0.008 0.056 0.932 0.004
#> SRR1652915     3  0.3208    0.69635 0.000 0.004 0.848 0.148
#> SRR1652916     1  0.2466    0.87421 0.916 0.028 0.000 0.056
#> SRR1652917     1  0.4440    0.77201 0.804 0.136 0.000 0.060
#> SRR1652918     2  0.5848    0.60717 0.228 0.684 0.000 0.088
#> SRR1652919     3  0.3627    0.67238 0.008 0.008 0.840 0.144
#> SRR1652920     2  0.2032    0.69866 0.036 0.936 0.028 0.000
#> SRR1652921     1  0.0921    0.87269 0.972 0.000 0.000 0.028
#> SRR1652922     4  0.5105    0.45212 0.004 0.000 0.432 0.564
#> SRR1652923     3  0.0336    0.77196 0.000 0.008 0.992 0.000
#> SRR1652924     1  0.1975    0.87415 0.936 0.016 0.000 0.048
#> SRR1652925     1  0.2399    0.86766 0.920 0.032 0.000 0.048
#> SRR1652926     2  0.3554    0.69297 0.136 0.844 0.000 0.020
#> SRR1652927     1  0.1732    0.87435 0.948 0.008 0.004 0.040
#> SRR1652928     1  0.1661    0.87613 0.944 0.004 0.000 0.052
#> SRR1652929     3  0.2384    0.73608 0.004 0.008 0.916 0.072
#> SRR1652930     1  0.2610    0.86331 0.900 0.012 0.000 0.088
#> SRR1652931     3  0.4605    0.68290 0.000 0.132 0.796 0.072
#> SRR1652932     1  0.1109    0.87662 0.968 0.004 0.000 0.028
#> SRR1652933     2  0.2489    0.69245 0.020 0.912 0.068 0.000
#> SRR1652934     2  0.4319    0.65877 0.228 0.760 0.012 0.000
#> SRR1652935     3  0.3937    0.61537 0.000 0.012 0.800 0.188
#> SRR1652936     3  0.2775    0.75242 0.000 0.084 0.896 0.020
#> SRR1652937     1  0.0927    0.87126 0.976 0.008 0.000 0.016
#> SRR1652938     1  0.6351    0.59158 0.628 0.104 0.000 0.268
#> SRR1652939     1  0.4908    0.77418 0.788 0.108 0.004 0.100
#> SRR1652940     1  0.1890    0.87647 0.936 0.008 0.000 0.056
#> SRR1652941     1  0.5763    0.62699 0.708 0.084 0.204 0.004
#> SRR1652942     3  0.1902    0.76789 0.000 0.064 0.932 0.004
#> SRR1652943     2  0.5132    0.64989 0.184 0.748 0.000 0.068
#> SRR1652944     3  0.1970    0.76822 0.000 0.060 0.932 0.008
#> SRR1652945     1  0.4508    0.78426 0.780 0.036 0.000 0.184
#> SRR1652946     1  0.3325    0.84640 0.864 0.024 0.000 0.112
#> SRR1652947     1  0.5487    0.51423 0.580 0.020 0.000 0.400
#> SRR1652948     3  0.2805    0.73572 0.000 0.012 0.888 0.100
#> SRR1652949     3  0.8348   -0.31314 0.280 0.016 0.364 0.340
#> SRR1652950     3  0.2353    0.75472 0.040 0.008 0.928 0.024
#> SRR1652951     2  0.5159    0.33070 0.000 0.624 0.364 0.012
#> SRR1652953     1  0.1854    0.86812 0.940 0.012 0.000 0.048
#> SRR1652952     3  0.1151    0.77550 0.000 0.024 0.968 0.008
#> SRR1652954     1  0.1510    0.87735 0.956 0.016 0.000 0.028
#> SRR1652955     3  0.1929    0.77165 0.000 0.036 0.940 0.024
#> SRR1652958     1  0.1305    0.86936 0.960 0.004 0.000 0.036
#> SRR1652956     3  0.4939    0.53902 0.000 0.040 0.740 0.220
#> SRR1652957     1  0.2670    0.86448 0.908 0.040 0.000 0.052
#> SRR1652959     1  0.6440    0.00679 0.484 0.004 0.456 0.056
#> SRR1652960     2  0.3326    0.65709 0.008 0.856 0.132 0.004
#> SRR1652961     1  0.3945    0.81209 0.852 0.008 0.076 0.064
#> SRR1652962     3  0.1474    0.77384 0.000 0.052 0.948 0.000
#> SRR1652963     3  0.2589    0.76452 0.000 0.044 0.912 0.044
#> SRR1652965     4  0.4302    0.78574 0.004 0.004 0.236 0.756
#> SRR1652964     3  0.5454    0.47255 0.224 0.008 0.720 0.048
#> SRR1652966     3  0.6066    0.43727 0.212 0.004 0.684 0.100
#> SRR1652967     4  0.5449    0.78303 0.012 0.040 0.228 0.720
#> SRR1652969     2  0.3384    0.71303 0.116 0.860 0.024 0.000
#> SRR1652968     3  0.2546    0.75350 0.000 0.092 0.900 0.008
#> SRR1652970     1  0.1767    0.86848 0.944 0.012 0.000 0.044
#> SRR1652971     4  0.4640    0.70283 0.064 0.012 0.112 0.812
#> SRR1652972     3  0.6837    0.14862 0.352 0.016 0.560 0.072
#> SRR1652973     2  0.4985    0.13238 0.468 0.532 0.000 0.000
#> SRR1652974     1  0.1888    0.87518 0.940 0.016 0.000 0.044
#> SRR1652975     2  0.4436    0.67247 0.216 0.764 0.020 0.000
#> SRR1652976     3  0.1743    0.74901 0.000 0.004 0.940 0.056
#> SRR1652977     3  0.2999    0.72256 0.000 0.132 0.864 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
#> SRR1652895     1  0.0955     0.7838 0.968 0.028 0.000 0.000 0.004
#> SRR1652896     3  0.7395     0.0975 0.000 0.120 0.464 0.088 0.328
#> SRR1652897     1  0.3474     0.6811 0.824 0.148 0.000 0.020 0.008
#> SRR1652898     3  0.4473     0.6148 0.160 0.044 0.772 0.000 0.024
#> SRR1652899     1  0.0960     0.7753 0.972 0.016 0.004 0.000 0.008
#> SRR1652900     3  0.4295     0.7118 0.052 0.080 0.820 0.036 0.012
#> SRR1652901     4  0.3835     0.5461 0.012 0.000 0.244 0.744 0.000
#> SRR1652902     1  0.1772     0.7648 0.940 0.032 0.020 0.000 0.008
#> SRR1652903     1  0.0324     0.7819 0.992 0.004 0.000 0.004 0.000
#> SRR1652904     1  0.1285     0.7802 0.956 0.036 0.000 0.004 0.004
#> SRR1652905     4  0.1484     0.7268 0.000 0.008 0.048 0.944 0.000
#> SRR1652906     1  0.4513     0.3074 0.688 0.024 0.284 0.000 0.004
#> SRR1652907     1  0.3377     0.6928 0.864 0.060 0.036 0.000 0.040
#> SRR1652908     4  0.1341     0.7268 0.000 0.000 0.056 0.944 0.000
#> SRR1652909     1  0.2417     0.7423 0.912 0.040 0.032 0.000 0.016
#> SRR1652910     1  0.2656     0.7220 0.896 0.028 0.064 0.000 0.012
#> SRR1652911     1  0.1492     0.7771 0.948 0.040 0.000 0.008 0.004
#> SRR1652912     3  0.1989     0.7507 0.000 0.020 0.932 0.016 0.032
#> SRR1652913     1  0.3010     0.7356 0.868 0.100 0.000 0.020 0.012
#> SRR1652914     3  0.2140     0.7455 0.000 0.012 0.924 0.040 0.024
#> SRR1652915     3  0.4739     0.5936 0.000 0.056 0.724 0.008 0.212
#> SRR1652916     1  0.2864     0.7402 0.884 0.064 0.000 0.044 0.008
#> SRR1652917     1  0.4687     0.5615 0.748 0.164 0.000 0.080 0.008
#> SRR1652918     4  0.6102     0.2727 0.152 0.272 0.000 0.572 0.004
#> SRR1652919     3  0.4655     0.6570 0.016 0.080 0.764 0.000 0.140
#> SRR1652920     4  0.1209     0.7336 0.012 0.012 0.012 0.964 0.000
#> SRR1652921     1  0.1364     0.7820 0.952 0.036 0.000 0.000 0.012
#> SRR1652922     5  0.5807     0.5268 0.004 0.128 0.256 0.000 0.612
#> SRR1652923     3  0.1682     0.7520 0.000 0.012 0.944 0.032 0.012
#> SRR1652924     1  0.1934     0.7739 0.928 0.052 0.000 0.016 0.004
#> SRR1652925     1  0.3866     0.6135 0.780 0.192 0.000 0.024 0.004
#> SRR1652926     4  0.2569     0.7098 0.068 0.032 0.000 0.896 0.004
#> SRR1652927     1  0.2699     0.7649 0.892 0.080 0.008 0.012 0.008
#> SRR1652928     1  0.0912     0.7814 0.972 0.016 0.000 0.000 0.012
#> SRR1652929     3  0.3012     0.7218 0.000 0.052 0.872 0.004 0.072
#> SRR1652930     1  0.2291     0.7594 0.908 0.072 0.000 0.012 0.008
#> SRR1652931     3  0.6129     0.5206 0.000 0.028 0.636 0.180 0.156
#> SRR1652932     1  0.0854     0.7827 0.976 0.012 0.000 0.004 0.008
#> SRR1652933     4  0.1364     0.7380 0.012 0.000 0.036 0.952 0.000
#> SRR1652934     4  0.3509     0.5825 0.196 0.008 0.004 0.792 0.000
#> SRR1652935     3  0.5499     0.5029 0.004 0.112 0.652 0.000 0.232
#> SRR1652936     3  0.2941     0.7362 0.000 0.032 0.884 0.064 0.020
#> SRR1652937     1  0.0451     0.7790 0.988 0.004 0.000 0.000 0.008
#> SRR1652938     2  0.6044     0.0000 0.332 0.568 0.000 0.076 0.024
#> SRR1652939     1  0.6032     0.2420 0.660 0.196 0.004 0.104 0.036
#> SRR1652940     1  0.0579     0.7832 0.984 0.008 0.000 0.000 0.008
#> SRR1652941     1  0.6112     0.2942 0.664 0.012 0.180 0.116 0.028
#> SRR1652942     3  0.1885     0.7482 0.000 0.012 0.936 0.032 0.020
#> SRR1652943     4  0.5533     0.4564 0.176 0.124 0.000 0.684 0.016
#> SRR1652944     3  0.1731     0.7461 0.000 0.008 0.940 0.040 0.012
#> SRR1652945     1  0.4944     0.3095 0.668 0.288 0.000 0.024 0.020
#> SRR1652946     1  0.3685     0.6748 0.816 0.148 0.000 0.020 0.016
#> SRR1652947     1  0.6712    -0.4249 0.448 0.188 0.000 0.008 0.356
#> SRR1652948     3  0.3759     0.6809 0.000 0.056 0.808 0.000 0.136
#> SRR1652949     1  0.7611    -0.2976 0.412 0.076 0.164 0.000 0.348
#> SRR1652950     3  0.2158     0.7344 0.052 0.020 0.920 0.000 0.008
#> SRR1652951     4  0.4338     0.4391 0.000 0.008 0.300 0.684 0.008
#> SRR1652953     1  0.1757     0.7651 0.936 0.048 0.004 0.000 0.012
#> SRR1652952     3  0.1908     0.7488 0.000 0.024 0.936 0.016 0.024
#> SRR1652954     1  0.1772     0.7797 0.940 0.032 0.000 0.020 0.008
#> SRR1652955     3  0.2522     0.7395 0.000 0.012 0.904 0.028 0.056
#> SRR1652958     1  0.1200     0.7789 0.964 0.016 0.000 0.008 0.012
#> SRR1652956     3  0.7019     0.0238 0.000 0.236 0.468 0.020 0.276
#> SRR1652957     1  0.3309     0.6939 0.836 0.128 0.000 0.036 0.000
#> SRR1652959     3  0.6057     0.2674 0.336 0.076 0.564 0.000 0.024
#> SRR1652960     4  0.2568     0.7199 0.016 0.004 0.092 0.888 0.000
#> SRR1652961     1  0.4644     0.4983 0.760 0.068 0.156 0.000 0.016
#> SRR1652962     3  0.1356     0.7498 0.000 0.012 0.956 0.028 0.004
#> SRR1652963     3  0.3871     0.7055 0.000 0.040 0.824 0.024 0.112
#> SRR1652965     5  0.3610     0.7363 0.020 0.056 0.068 0.004 0.852
#> SRR1652964     3  0.4947     0.5840 0.176 0.076 0.732 0.000 0.016
#> SRR1652966     3  0.7199     0.2655 0.284 0.056 0.500 0.000 0.160
#> SRR1652967     5  0.5174     0.6867 0.000 0.196 0.096 0.008 0.700
#> SRR1652969     4  0.1788     0.7305 0.056 0.008 0.004 0.932 0.000
#> SRR1652968     3  0.2206     0.7418 0.000 0.004 0.912 0.068 0.016
#> SRR1652970     1  0.1492     0.7677 0.948 0.040 0.004 0.000 0.008
#> SRR1652971     5  0.4168     0.6775 0.036 0.116 0.032 0.004 0.812
#> SRR1652972     3  0.7285    -0.0404 0.412 0.100 0.412 0.004 0.072
#> SRR1652973     4  0.4897     0.1131 0.352 0.028 0.004 0.616 0.000
#> SRR1652974     1  0.1074     0.7814 0.968 0.016 0.000 0.012 0.004
#> SRR1652975     4  0.3340     0.6418 0.156 0.016 0.004 0.824 0.000
#> SRR1652976     3  0.2157     0.7399 0.000 0.036 0.920 0.004 0.040
#> SRR1652977     3  0.2959     0.7215 0.000 0.008 0.864 0.112 0.016

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0891     0.8007 0.968 0.000 0.000 0.000 0.008 0.024
#> SRR1652896     2  0.6842     0.2731 0.000 0.420 0.384 0.056 0.120 0.020
#> SRR1652897     1  0.3023     0.6816 0.784 0.000 0.000 0.000 0.004 0.212
#> SRR1652898     3  0.5089     0.4697 0.176 0.088 0.700 0.000 0.012 0.024
#> SRR1652899     1  0.1572     0.7920 0.936 0.036 0.000 0.000 0.000 0.028
#> SRR1652900     3  0.4241     0.5798 0.012 0.172 0.764 0.016 0.004 0.032
#> SRR1652901     4  0.2320     0.7299 0.000 0.004 0.132 0.864 0.000 0.000
#> SRR1652902     1  0.2272     0.7829 0.900 0.056 0.000 0.000 0.004 0.040
#> SRR1652903     1  0.0291     0.8003 0.992 0.004 0.000 0.000 0.000 0.004
#> SRR1652904     1  0.0632     0.7992 0.976 0.000 0.000 0.000 0.000 0.024
#> SRR1652905     4  0.0458     0.7994 0.000 0.000 0.016 0.984 0.000 0.000
#> SRR1652906     1  0.4709     0.3894 0.632 0.024 0.316 0.000 0.000 0.028
#> SRR1652907     1  0.3551     0.7439 0.836 0.064 0.004 0.000 0.036 0.060
#> SRR1652908     4  0.0937     0.7958 0.000 0.000 0.040 0.960 0.000 0.000
#> SRR1652909     1  0.2713     0.7775 0.888 0.048 0.012 0.000 0.012 0.040
#> SRR1652910     1  0.3514     0.7152 0.824 0.036 0.108 0.000 0.000 0.032
#> SRR1652911     1  0.0858     0.7999 0.968 0.000 0.000 0.000 0.004 0.028
#> SRR1652912     3  0.1484     0.7213 0.000 0.040 0.944 0.004 0.004 0.008
#> SRR1652913     1  0.1967     0.7780 0.904 0.000 0.000 0.000 0.012 0.084
#> SRR1652914     3  0.1598     0.7183 0.000 0.040 0.940 0.008 0.008 0.004
#> SRR1652915     3  0.5319     0.1624 0.000 0.300 0.588 0.004 0.104 0.004
#> SRR1652916     1  0.3306     0.7592 0.856 0.016 0.000 0.028 0.032 0.068
#> SRR1652917     1  0.4807     0.6112 0.724 0.032 0.000 0.080 0.004 0.160
#> SRR1652918     4  0.6160     0.0772 0.116 0.036 0.000 0.504 0.004 0.340
#> SRR1652919     3  0.6970     0.2279 0.020 0.200 0.536 0.004 0.164 0.076
#> SRR1652920     4  0.0551     0.7974 0.000 0.004 0.004 0.984 0.000 0.008
#> SRR1652921     1  0.1464     0.8017 0.944 0.016 0.000 0.000 0.004 0.036
#> SRR1652922     5  0.6842    -0.0453 0.008 0.236 0.156 0.000 0.512 0.088
#> SRR1652923     3  0.1067     0.7209 0.000 0.024 0.964 0.004 0.004 0.004
#> SRR1652924     1  0.1296     0.7971 0.948 0.004 0.000 0.000 0.004 0.044
#> SRR1652925     1  0.3591     0.6091 0.732 0.004 0.000 0.004 0.004 0.256
#> SRR1652926     4  0.1092     0.7956 0.020 0.000 0.000 0.960 0.000 0.020
#> SRR1652927     1  0.2890     0.7694 0.856 0.020 0.016 0.000 0.000 0.108
#> SRR1652928     1  0.0363     0.8006 0.988 0.000 0.000 0.000 0.000 0.012
#> SRR1652929     3  0.3528     0.6660 0.000 0.124 0.820 0.004 0.032 0.020
#> SRR1652930     1  0.1524     0.7897 0.932 0.000 0.000 0.000 0.008 0.060
#> SRR1652931     3  0.6059     0.1967 0.000 0.184 0.596 0.156 0.064 0.000
#> SRR1652932     1  0.0909     0.8014 0.968 0.012 0.000 0.000 0.000 0.020
#> SRR1652933     4  0.0363     0.7988 0.000 0.000 0.012 0.988 0.000 0.000
#> SRR1652934     4  0.2815     0.7064 0.132 0.004 0.004 0.848 0.000 0.012
#> SRR1652935     3  0.7422    -0.1055 0.020 0.312 0.424 0.004 0.148 0.092
#> SRR1652936     3  0.2485     0.7045 0.000 0.064 0.896 0.016 0.008 0.016
#> SRR1652937     1  0.0993     0.8003 0.964 0.024 0.000 0.000 0.000 0.012
#> SRR1652938     6  0.5276     0.0000 0.168 0.060 0.000 0.036 0.032 0.704
#> SRR1652939     1  0.6792    -0.2120 0.460 0.068 0.000 0.072 0.036 0.364
#> SRR1652940     1  0.0993     0.7997 0.964 0.012 0.000 0.000 0.000 0.024
#> SRR1652941     1  0.6104     0.4641 0.652 0.056 0.104 0.156 0.008 0.024
#> SRR1652942     3  0.1218     0.7186 0.000 0.028 0.956 0.012 0.004 0.000
#> SRR1652943     4  0.5008     0.4977 0.168 0.008 0.000 0.688 0.008 0.128
#> SRR1652944     3  0.1367     0.7145 0.000 0.044 0.944 0.012 0.000 0.000
#> SRR1652945     1  0.5009     0.1679 0.556 0.016 0.000 0.000 0.044 0.384
#> SRR1652946     1  0.3409     0.6705 0.780 0.000 0.000 0.000 0.028 0.192
#> SRR1652947     5  0.6026    -0.2949 0.408 0.024 0.000 0.000 0.440 0.128
#> SRR1652948     3  0.4039     0.5033 0.000 0.208 0.732 0.000 0.060 0.000
#> SRR1652949     1  0.7127     0.0431 0.476 0.264 0.040 0.000 0.176 0.044
#> SRR1652950     3  0.0665     0.7203 0.008 0.008 0.980 0.000 0.000 0.004
#> SRR1652951     4  0.3898     0.4268 0.000 0.020 0.296 0.684 0.000 0.000
#> SRR1652953     1  0.2606     0.7785 0.888 0.044 0.000 0.000 0.020 0.048
#> SRR1652952     3  0.2686     0.6678 0.000 0.140 0.848 0.004 0.004 0.004
#> SRR1652954     1  0.1988     0.8011 0.920 0.024 0.000 0.004 0.004 0.048
#> SRR1652955     3  0.2306     0.6914 0.000 0.092 0.888 0.004 0.016 0.000
#> SRR1652958     1  0.1938     0.7971 0.920 0.040 0.000 0.000 0.004 0.036
#> SRR1652956     2  0.6087     0.4299 0.000 0.548 0.320 0.016 0.056 0.060
#> SRR1652957     1  0.3212     0.6935 0.800 0.000 0.000 0.016 0.004 0.180
#> SRR1652959     3  0.4880     0.4175 0.208 0.068 0.692 0.000 0.000 0.032
#> SRR1652960     4  0.1931     0.7845 0.004 0.004 0.068 0.916 0.000 0.008
#> SRR1652961     1  0.4964     0.5643 0.704 0.068 0.176 0.000 0.000 0.052
#> SRR1652962     3  0.1929     0.7190 0.000 0.048 0.924 0.008 0.016 0.004
#> SRR1652963     3  0.3874     0.5555 0.000 0.224 0.744 0.008 0.020 0.004
#> SRR1652965     5  0.3936     0.2795 0.012 0.116 0.024 0.000 0.804 0.044
#> SRR1652964     3  0.4176     0.5498 0.136 0.076 0.768 0.000 0.000 0.020
#> SRR1652966     3  0.7591     0.0852 0.256 0.136 0.460 0.000 0.088 0.060
#> SRR1652967     2  0.5253    -0.1324 0.000 0.520 0.016 0.000 0.404 0.060
#> SRR1652969     4  0.1312     0.8015 0.020 0.004 0.008 0.956 0.000 0.012
#> SRR1652968     3  0.0622     0.7168 0.000 0.012 0.980 0.008 0.000 0.000
#> SRR1652970     1  0.2583     0.7785 0.888 0.044 0.000 0.000 0.016 0.052
#> SRR1652971     5  0.2365     0.2902 0.012 0.032 0.004 0.004 0.908 0.040
#> SRR1652972     1  0.6694     0.0649 0.460 0.240 0.256 0.000 0.004 0.040
#> SRR1652973     4  0.3970     0.5899 0.192 0.004 0.004 0.760 0.004 0.036
#> SRR1652974     1  0.0692     0.8018 0.976 0.000 0.000 0.000 0.004 0.020
#> SRR1652975     4  0.2847     0.7598 0.076 0.004 0.012 0.872 0.000 0.036
#> SRR1652976     3  0.1483     0.7191 0.000 0.036 0.944 0.000 0.012 0.008
#> SRR1652977     3  0.1442     0.7134 0.000 0.012 0.944 0.040 0.000 0.004

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

plot of chunk CV-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.366           0.746       0.833        0.43447 0.526   0.526
#> 3 3 0.392           0.737       0.827        0.09009 0.957   0.918
#> 4 4 0.397           0.689       0.828        0.05117 0.977   0.952
#> 5 5 0.387           0.730       0.828        0.02891 1.000   0.999
#> 6 6 0.348           0.700       0.824        0.00781 0.999   0.999

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
#> SRR1652895     1  0.0938      0.709 0.988 0.012
#> SRR1652896     2  0.0000      0.934 0.000 1.000
#> SRR1652897     1  0.0938      0.709 0.988 0.012
#> SRR1652898     1  0.8267      0.755 0.740 0.260
#> SRR1652899     1  0.7950      0.755 0.760 0.240
#> SRR1652900     2  0.0000      0.934 0.000 1.000
#> SRR1652901     2  0.9850     -0.302 0.428 0.572
#> SRR1652902     1  0.8267      0.754 0.740 0.260
#> SRR1652903     1  0.4298      0.733 0.912 0.088
#> SRR1652904     1  0.0938      0.709 0.988 0.012
#> SRR1652905     2  0.0000      0.934 0.000 1.000
#> SRR1652906     1  0.8386      0.753 0.732 0.268
#> SRR1652907     1  0.0938      0.709 0.988 0.012
#> SRR1652908     2  0.0000      0.934 0.000 1.000
#> SRR1652909     1  0.8813      0.745 0.700 0.300
#> SRR1652910     1  0.7950      0.755 0.760 0.240
#> SRR1652911     1  0.0938      0.709 0.988 0.012
#> SRR1652912     2  0.0000      0.934 0.000 1.000
#> SRR1652913     1  0.9129      0.733 0.672 0.328
#> SRR1652914     1  0.9944      0.601 0.544 0.456
#> SRR1652915     1  0.9635      0.691 0.612 0.388
#> SRR1652916     1  0.8386      0.754 0.732 0.268
#> SRR1652917     1  0.9881      0.635 0.564 0.436
#> SRR1652918     2  0.0000      0.934 0.000 1.000
#> SRR1652919     1  0.9000      0.738 0.684 0.316
#> SRR1652920     2  0.0000      0.934 0.000 1.000
#> SRR1652921     1  0.9209      0.729 0.664 0.336
#> SRR1652922     1  0.9815      0.596 0.580 0.420
#> SRR1652923     2  0.0376      0.931 0.004 0.996
#> SRR1652924     1  0.9833      0.646 0.576 0.424
#> SRR1652925     2  0.0000      0.934 0.000 1.000
#> SRR1652926     2  0.4939      0.787 0.108 0.892
#> SRR1652927     1  0.6712      0.750 0.824 0.176
#> SRR1652928     1  0.0938      0.709 0.988 0.012
#> SRR1652929     2  0.2236      0.897 0.036 0.964
#> SRR1652930     1  0.0938      0.709 0.988 0.012
#> SRR1652931     1  0.9686      0.683 0.604 0.396
#> SRR1652932     1  0.0938      0.709 0.988 0.012
#> SRR1652933     1  0.9977      0.560 0.528 0.472
#> SRR1652934     1  0.9922      0.616 0.552 0.448
#> SRR1652935     2  0.0000      0.934 0.000 1.000
#> SRR1652936     2  0.0000      0.934 0.000 1.000
#> SRR1652937     1  0.5737      0.743 0.864 0.136
#> SRR1652938     2  0.0000      0.934 0.000 1.000
#> SRR1652939     2  0.4815      0.804 0.104 0.896
#> SRR1652940     1  0.0938      0.709 0.988 0.012
#> SRR1652941     1  0.9732      0.675 0.596 0.404
#> SRR1652942     2  0.0000      0.934 0.000 1.000
#> SRR1652943     2  0.0000      0.934 0.000 1.000
#> SRR1652944     1  0.9970      0.577 0.532 0.468
#> SRR1652945     2  0.0000      0.934 0.000 1.000
#> SRR1652946     1  0.9170      0.731 0.668 0.332
#> SRR1652947     1  0.0000      0.700 1.000 0.000
#> SRR1652948     2  0.0000      0.934 0.000 1.000
#> SRR1652949     1  0.3584      0.728 0.932 0.068
#> SRR1652950     1  0.9970      0.577 0.532 0.468
#> SRR1652951     2  0.0000      0.934 0.000 1.000
#> SRR1652953     1  0.0938      0.709 0.988 0.012
#> SRR1652952     2  0.0000      0.934 0.000 1.000
#> SRR1652954     1  0.9983      0.555 0.524 0.476
#> SRR1652955     1  0.9686      0.684 0.604 0.396
#> SRR1652958     1  0.8555      0.751 0.720 0.280
#> SRR1652956     2  0.0000      0.934 0.000 1.000
#> SRR1652957     1  0.9815      0.650 0.580 0.420
#> SRR1652959     2  0.0000      0.934 0.000 1.000
#> SRR1652960     2  0.0000      0.934 0.000 1.000
#> SRR1652961     2  0.0000      0.934 0.000 1.000
#> SRR1652962     2  0.0000      0.934 0.000 1.000
#> SRR1652963     2  0.0000      0.934 0.000 1.000
#> SRR1652965     1  0.0000      0.700 1.000 0.000
#> SRR1652964     2  0.0672      0.927 0.008 0.992
#> SRR1652966     1  0.1843      0.715 0.972 0.028
#> SRR1652967     2  0.9129      0.226 0.328 0.672
#> SRR1652969     1  0.9993      0.541 0.516 0.484
#> SRR1652968     1  0.9896      0.627 0.560 0.440
#> SRR1652970     1  0.0938      0.709 0.988 0.012
#> SRR1652971     1  0.0000      0.700 1.000 0.000
#> SRR1652972     1  0.9129      0.733 0.672 0.328
#> SRR1652973     1  0.9552      0.701 0.624 0.376
#> SRR1652974     1  0.4690      0.736 0.900 0.100
#> SRR1652975     2  0.8813      0.268 0.300 0.700
#> SRR1652976     1  0.9775      0.665 0.588 0.412
#> SRR1652977     1  0.9896      0.627 0.560 0.440

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652896     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652897     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652898     1  0.5058      0.766 0.756 0.244 0.000
#> SRR1652899     1  0.4842      0.764 0.776 0.224 0.000
#> SRR1652900     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652901     2  0.6244     -0.345 0.440 0.560 0.000
#> SRR1652902     1  0.5058      0.766 0.756 0.244 0.000
#> SRR1652903     1  0.2356      0.673 0.928 0.072 0.000
#> SRR1652904     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652905     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652906     1  0.5138      0.765 0.748 0.252 0.000
#> SRR1652907     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652908     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652909     1  0.5431      0.760 0.716 0.284 0.000
#> SRR1652910     1  0.4842      0.764 0.776 0.224 0.000
#> SRR1652911     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652912     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652913     1  0.5650      0.751 0.688 0.312 0.000
#> SRR1652914     1  0.6252      0.628 0.556 0.444 0.000
#> SRR1652915     1  0.6008      0.714 0.628 0.372 0.000
#> SRR1652916     1  0.5138      0.766 0.748 0.252 0.000
#> SRR1652917     1  0.6204      0.659 0.576 0.424 0.000
#> SRR1652918     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652919     1  0.5560      0.754 0.700 0.300 0.000
#> SRR1652920     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652921     1  0.5706      0.747 0.680 0.320 0.000
#> SRR1652922     1  0.8769      0.544 0.528 0.348 0.124
#> SRR1652923     2  0.0424      0.924 0.008 0.992 0.000
#> SRR1652924     1  0.6154      0.673 0.592 0.408 0.000
#> SRR1652925     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652926     2  0.3192      0.780 0.112 0.888 0.000
#> SRR1652927     1  0.4002      0.736 0.840 0.160 0.000
#> SRR1652928     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652929     2  0.1643      0.886 0.044 0.956 0.000
#> SRR1652930     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652931     1  0.6062      0.704 0.616 0.384 0.000
#> SRR1652932     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652933     1  0.6280      0.588 0.540 0.460 0.000
#> SRR1652934     1  0.6225      0.647 0.568 0.432 0.000
#> SRR1652935     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652936     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652937     1  0.3340      0.711 0.880 0.120 0.000
#> SRR1652938     2  0.0424      0.923 0.008 0.992 0.000
#> SRR1652939     2  0.3340      0.780 0.120 0.880 0.000
#> SRR1652940     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652941     1  0.6079      0.700 0.612 0.388 0.000
#> SRR1652942     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652943     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652944     1  0.6274      0.604 0.544 0.456 0.000
#> SRR1652945     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652946     1  0.5678      0.749 0.684 0.316 0.000
#> SRR1652947     3  0.5835      0.813 0.340 0.000 0.660
#> SRR1652948     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652949     1  0.1860      0.654 0.948 0.052 0.000
#> SRR1652950     1  0.6274      0.605 0.544 0.456 0.000
#> SRR1652951     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652953     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652952     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652954     1  0.6280      0.590 0.540 0.460 0.000
#> SRR1652955     1  0.6045      0.708 0.620 0.380 0.000
#> SRR1652958     1  0.5254      0.764 0.736 0.264 0.000
#> SRR1652956     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652957     1  0.6140      0.677 0.596 0.404 0.000
#> SRR1652959     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652960     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652961     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652962     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652963     2  0.0000      0.930 0.000 1.000 0.000
#> SRR1652965     3  0.3267      0.915 0.116 0.000 0.884
#> SRR1652964     2  0.0592      0.920 0.012 0.988 0.000
#> SRR1652966     1  0.0983      0.615 0.980 0.016 0.004
#> SRR1652967     2  0.8372      0.105 0.336 0.564 0.100
#> SRR1652969     1  0.6295      0.570 0.528 0.472 0.000
#> SRR1652968     1  0.6215      0.651 0.572 0.428 0.000
#> SRR1652970     1  0.0237      0.597 0.996 0.000 0.004
#> SRR1652971     3  0.3267      0.915 0.116 0.000 0.884
#> SRR1652972     1  0.5650      0.750 0.688 0.312 0.000
#> SRR1652973     1  0.5948      0.723 0.640 0.360 0.000
#> SRR1652974     1  0.2625      0.683 0.916 0.084 0.000
#> SRR1652975     2  0.5621      0.230 0.308 0.692 0.000
#> SRR1652976     1  0.6126      0.687 0.600 0.400 0.000
#> SRR1652977     1  0.6215      0.651 0.572 0.428 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652896     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652897     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652898     1  0.4018     0.6953 0.772 0.224 0.004 0.000
#> SRR1652899     1  0.3610     0.6844 0.800 0.200 0.000 0.000
#> SRR1652900     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652901     2  0.4972    -0.3679 0.456 0.544 0.000 0.000
#> SRR1652902     1  0.3801     0.6950 0.780 0.220 0.000 0.000
#> SRR1652903     1  0.1389     0.5510 0.952 0.048 0.000 0.000
#> SRR1652904     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652905     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652906     1  0.3873     0.6981 0.772 0.228 0.000 0.000
#> SRR1652907     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652908     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652909     1  0.4134     0.7043 0.740 0.260 0.000 0.000
#> SRR1652910     1  0.3610     0.6844 0.800 0.200 0.000 0.000
#> SRR1652911     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652912     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652913     1  0.4331     0.7037 0.712 0.288 0.000 0.000
#> SRR1652914     1  0.4925     0.6249 0.572 0.428 0.000 0.000
#> SRR1652915     1  0.4679     0.6849 0.648 0.352 0.000 0.000
#> SRR1652916     1  0.3873     0.6986 0.772 0.228 0.000 0.000
#> SRR1652917     1  0.4866     0.6497 0.596 0.404 0.000 0.000
#> SRR1652918     2  0.0188     0.9349 0.004 0.996 0.000 0.000
#> SRR1652919     1  0.4456     0.7007 0.716 0.280 0.004 0.000
#> SRR1652920     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652921     1  0.4382     0.7024 0.704 0.296 0.000 0.000
#> SRR1652922     3  0.5801     0.2983 0.468 0.008 0.508 0.016
#> SRR1652923     2  0.0592     0.9256 0.016 0.984 0.000 0.000
#> SRR1652924     1  0.4817     0.6535 0.612 0.388 0.000 0.000
#> SRR1652925     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652926     2  0.2647     0.7796 0.120 0.880 0.000 0.000
#> SRR1652927     1  0.3105     0.6365 0.856 0.140 0.004 0.000
#> SRR1652928     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652929     2  0.1792     0.8707 0.068 0.932 0.000 0.000
#> SRR1652930     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652931     1  0.4730     0.6791 0.636 0.364 0.000 0.000
#> SRR1652932     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652933     1  0.4948     0.5961 0.560 0.440 0.000 0.000
#> SRR1652934     1  0.4888     0.6408 0.588 0.412 0.000 0.000
#> SRR1652935     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652936     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.2281     0.6008 0.904 0.096 0.000 0.000
#> SRR1652938     2  0.0592     0.9252 0.016 0.984 0.000 0.000
#> SRR1652939     2  0.2921     0.7652 0.140 0.860 0.000 0.000
#> SRR1652940     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652941     1  0.4730     0.6779 0.636 0.364 0.000 0.000
#> SRR1652942     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652943     2  0.0188     0.9349 0.004 0.996 0.000 0.000
#> SRR1652944     1  0.4941     0.6112 0.564 0.436 0.000 0.000
#> SRR1652945     2  0.0188     0.9349 0.004 0.996 0.000 0.000
#> SRR1652946     1  0.4356     0.7029 0.708 0.292 0.000 0.000
#> SRR1652947     4  0.5036     0.5032 0.280 0.000 0.024 0.696
#> SRR1652948     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652949     1  0.1888     0.5348 0.940 0.044 0.016 0.000
#> SRR1652950     1  0.4941     0.6115 0.564 0.436 0.000 0.000
#> SRR1652951     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652952     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652954     1  0.4961     0.5921 0.552 0.448 0.000 0.000
#> SRR1652955     1  0.4697     0.6825 0.644 0.356 0.000 0.000
#> SRR1652958     1  0.3975     0.7012 0.760 0.240 0.000 0.000
#> SRR1652956     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652957     1  0.4804     0.6561 0.616 0.384 0.000 0.000
#> SRR1652959     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652962     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.0000     0.9373 0.000 1.000 0.000 0.000
#> SRR1652965     4  0.0592     0.7846 0.016 0.000 0.000 0.984
#> SRR1652964     2  0.0707     0.9216 0.020 0.980 0.000 0.000
#> SRR1652966     1  0.1510     0.4923 0.956 0.016 0.028 0.000
#> SRR1652967     3  0.4552    -0.0282 0.128 0.072 0.800 0.000
#> SRR1652969     1  0.4972     0.5835 0.544 0.456 0.000 0.000
#> SRR1652968     1  0.4877     0.6434 0.592 0.408 0.000 0.000
#> SRR1652970     1  0.0921     0.4712 0.972 0.000 0.028 0.000
#> SRR1652971     4  0.0592     0.7846 0.016 0.000 0.000 0.984
#> SRR1652972     1  0.4331     0.7040 0.712 0.288 0.000 0.000
#> SRR1652973     1  0.4661     0.6890 0.652 0.348 0.000 0.000
#> SRR1652974     1  0.1637     0.5643 0.940 0.060 0.000 0.000
#> SRR1652975     2  0.4522     0.2086 0.320 0.680 0.000 0.000
#> SRR1652976     1  0.4804     0.6666 0.616 0.384 0.000 0.000
#> SRR1652977     1  0.4877     0.6434 0.592 0.408 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
#> SRR1652895     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652896     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652897     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652898     1  0.3300      0.783 0.792 0.204 0.000 0.004 0.000
#> SRR1652899     1  0.2929      0.778 0.820 0.180 0.000 0.000 0.000
#> SRR1652900     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652901     2  0.4297     -0.384 0.472 0.528 0.000 0.000 0.000
#> SRR1652902     1  0.3109      0.782 0.800 0.200 0.000 0.000 0.000
#> SRR1652903     1  0.0794      0.693 0.972 0.028 0.000 0.000 0.000
#> SRR1652904     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652905     2  0.0162      0.932 0.004 0.996 0.000 0.000 0.000
#> SRR1652906     1  0.3177      0.782 0.792 0.208 0.000 0.000 0.000
#> SRR1652907     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652908     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652909     1  0.3424      0.777 0.760 0.240 0.000 0.000 0.000
#> SRR1652910     1  0.2929      0.778 0.820 0.180 0.000 0.000 0.000
#> SRR1652911     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652912     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652913     1  0.3612      0.769 0.732 0.268 0.000 0.000 0.000
#> SRR1652914     1  0.4219      0.643 0.584 0.416 0.000 0.000 0.000
#> SRR1652915     1  0.3966      0.733 0.664 0.336 0.000 0.000 0.000
#> SRR1652916     1  0.3177      0.783 0.792 0.208 0.000 0.000 0.000
#> SRR1652917     1  0.4161      0.677 0.608 0.392 0.000 0.000 0.000
#> SRR1652918     2  0.0162      0.932 0.004 0.996 0.000 0.000 0.000
#> SRR1652919     1  0.3715      0.772 0.736 0.260 0.000 0.004 0.000
#> SRR1652920     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652921     1  0.3684      0.765 0.720 0.280 0.000 0.000 0.000
#> SRR1652922     3  0.1282      0.000 0.044 0.004 0.952 0.000 0.000
#> SRR1652923     2  0.0794      0.915 0.028 0.972 0.000 0.000 0.000
#> SRR1652924     1  0.4114      0.690 0.624 0.376 0.000 0.000 0.000
#> SRR1652925     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652926     2  0.2329      0.781 0.124 0.876 0.000 0.000 0.000
#> SRR1652927     1  0.2612      0.751 0.868 0.124 0.000 0.008 0.000
#> SRR1652928     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652929     2  0.1792      0.860 0.084 0.916 0.000 0.000 0.000
#> SRR1652930     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652931     1  0.3999      0.725 0.656 0.344 0.000 0.000 0.000
#> SRR1652932     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652933     1  0.4242      0.610 0.572 0.428 0.000 0.000 0.000
#> SRR1652934     1  0.4171      0.670 0.604 0.396 0.000 0.000 0.000
#> SRR1652935     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652936     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1  0.1671      0.726 0.924 0.076 0.000 0.000 0.000
#> SRR1652938     2  0.1756      0.894 0.016 0.940 0.036 0.008 0.000
#> SRR1652939     2  0.2648      0.758 0.152 0.848 0.000 0.000 0.000
#> SRR1652940     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652941     1  0.3999      0.723 0.656 0.344 0.000 0.000 0.000
#> SRR1652942     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     2  0.0162      0.932 0.004 0.996 0.000 0.000 0.000
#> SRR1652944     1  0.4227      0.629 0.580 0.420 0.000 0.000 0.000
#> SRR1652945     2  0.0162      0.932 0.004 0.996 0.000 0.000 0.000
#> SRR1652946     1  0.3684      0.766 0.720 0.280 0.000 0.000 0.000
#> SRR1652947     5  0.4665      0.353 0.260 0.000 0.000 0.048 0.692
#> SRR1652948     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652949     1  0.1750      0.689 0.936 0.036 0.000 0.028 0.000
#> SRR1652950     1  0.4227      0.630 0.580 0.420 0.000 0.000 0.000
#> SRR1652951     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652953     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652952     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     1  0.4256      0.600 0.564 0.436 0.000 0.000 0.000
#> SRR1652955     1  0.3983      0.729 0.660 0.340 0.000 0.000 0.000
#> SRR1652958     1  0.3274      0.782 0.780 0.220 0.000 0.000 0.000
#> SRR1652956     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     1  0.4101      0.695 0.628 0.372 0.000 0.000 0.000
#> SRR1652959     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652960     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652961     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     2  0.0000      0.934 0.000 1.000 0.000 0.000 0.000
#> SRR1652965     5  0.0865      0.588 0.000 0.000 0.004 0.024 0.972
#> SRR1652964     2  0.0794      0.913 0.028 0.972 0.000 0.000 0.000
#> SRR1652966     1  0.1522      0.660 0.944 0.012 0.000 0.044 0.000
#> SRR1652967     4  0.4025      0.000 0.028 0.036 0.124 0.812 0.000
#> SRR1652969     1  0.4273      0.581 0.552 0.448 0.000 0.000 0.000
#> SRR1652968     1  0.4161      0.673 0.608 0.392 0.000 0.000 0.000
#> SRR1652970     1  0.1197      0.647 0.952 0.000 0.000 0.048 0.000
#> SRR1652971     5  0.2358      0.592 0.000 0.000 0.008 0.104 0.888
#> SRR1652972     1  0.3612      0.769 0.732 0.268 0.000 0.000 0.000
#> SRR1652973     1  0.3983      0.735 0.660 0.340 0.000 0.000 0.000
#> SRR1652974     1  0.1043      0.702 0.960 0.040 0.000 0.000 0.000
#> SRR1652975     2  0.3913      0.218 0.324 0.676 0.000 0.000 0.000
#> SRR1652976     1  0.4088      0.705 0.632 0.368 0.000 0.000 0.000
#> SRR1652977     1  0.4161      0.673 0.608 0.392 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
#> SRR1652895     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652896     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652897     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652898     1  0.2964      0.782 0.792 0.204 0.000 0.004 0.000 0.000
#> SRR1652899     1  0.2631      0.777 0.820 0.180 0.000 0.000 0.000 0.000
#> SRR1652900     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652901     2  0.3860     -0.381 0.472 0.528 0.000 0.000 0.000 0.000
#> SRR1652902     1  0.2793      0.781 0.800 0.200 0.000 0.000 0.000 0.000
#> SRR1652903     1  0.0713      0.686 0.972 0.028 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652905     2  0.0146      0.923 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1652906     1  0.2854      0.781 0.792 0.208 0.000 0.000 0.000 0.000
#> SRR1652907     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652908     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652909     1  0.3076      0.776 0.760 0.240 0.000 0.000 0.000 0.000
#> SRR1652910     1  0.2631      0.777 0.820 0.180 0.000 0.000 0.000 0.000
#> SRR1652911     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652912     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     1  0.3244      0.768 0.732 0.268 0.000 0.000 0.000 0.000
#> SRR1652914     1  0.3789      0.641 0.584 0.416 0.000 0.000 0.000 0.000
#> SRR1652915     1  0.3563      0.732 0.664 0.336 0.000 0.000 0.000 0.000
#> SRR1652916     1  0.2854      0.782 0.792 0.208 0.000 0.000 0.000 0.000
#> SRR1652917     1  0.3737      0.676 0.608 0.392 0.000 0.000 0.000 0.000
#> SRR1652918     2  0.0146      0.923 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1652919     1  0.3337      0.770 0.736 0.260 0.000 0.004 0.000 0.000
#> SRR1652920     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652921     1  0.3309      0.763 0.720 0.280 0.000 0.000 0.000 0.000
#> SRR1652922     3  0.0000      0.000 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652923     2  0.0713      0.906 0.028 0.972 0.000 0.000 0.000 0.000
#> SRR1652924     1  0.3695      0.689 0.624 0.376 0.000 0.000 0.000 0.000
#> SRR1652925     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652926     2  0.2092      0.775 0.124 0.876 0.000 0.000 0.000 0.000
#> SRR1652927     1  0.2346      0.748 0.868 0.124 0.000 0.008 0.000 0.000
#> SRR1652928     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652929     2  0.1610      0.855 0.084 0.916 0.000 0.000 0.000 0.000
#> SRR1652930     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652931     1  0.3592      0.724 0.656 0.344 0.000 0.000 0.000 0.000
#> SRR1652932     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652933     1  0.3810      0.608 0.572 0.428 0.000 0.000 0.000 0.000
#> SRR1652934     1  0.3747      0.668 0.604 0.396 0.000 0.000 0.000 0.000
#> SRR1652935     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652936     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.1501      0.721 0.924 0.076 0.000 0.000 0.000 0.000
#> SRR1652938     2  0.4026      0.492 0.016 0.636 0.000 0.000 0.000 0.348
#> SRR1652939     2  0.2378      0.754 0.152 0.848 0.000 0.000 0.000 0.000
#> SRR1652940     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652941     1  0.3592      0.722 0.656 0.344 0.000 0.000 0.000 0.000
#> SRR1652942     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     2  0.0146      0.923 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1652944     1  0.3797      0.627 0.580 0.420 0.000 0.000 0.000 0.000
#> SRR1652945     2  0.0146      0.923 0.004 0.996 0.000 0.000 0.000 0.000
#> SRR1652946     1  0.3309      0.764 0.720 0.280 0.000 0.000 0.000 0.000
#> SRR1652947     5  0.5024      0.152 0.256 0.000 0.000 0.044 0.656 0.044
#> SRR1652948     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652949     1  0.1572      0.681 0.936 0.036 0.000 0.028 0.000 0.000
#> SRR1652950     1  0.3797      0.628 0.580 0.420 0.000 0.000 0.000 0.000
#> SRR1652951     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652952     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     1  0.3823      0.598 0.564 0.436 0.000 0.000 0.000 0.000
#> SRR1652955     1  0.3578      0.727 0.660 0.340 0.000 0.000 0.000 0.000
#> SRR1652958     1  0.2941      0.780 0.780 0.220 0.000 0.000 0.000 0.000
#> SRR1652956     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652957     1  0.3684      0.693 0.628 0.372 0.000 0.000 0.000 0.000
#> SRR1652959     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652960     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652961     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0000      0.925 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652965     5  0.0000     -0.246 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652964     2  0.0713      0.905 0.028 0.972 0.000 0.000 0.000 0.000
#> SRR1652966     1  0.1367      0.649 0.944 0.012 0.000 0.044 0.000 0.000
#> SRR1652967     4  0.1426      0.000 0.028 0.016 0.008 0.948 0.000 0.000
#> SRR1652969     1  0.3838      0.579 0.552 0.448 0.000 0.000 0.000 0.000
#> SRR1652968     1  0.3737      0.671 0.608 0.392 0.000 0.000 0.000 0.000
#> SRR1652970     1  0.1075      0.635 0.952 0.000 0.000 0.048 0.000 0.000
#> SRR1652971     6  0.3634      0.000 0.000 0.000 0.000 0.000 0.356 0.644
#> SRR1652972     1  0.3244      0.767 0.732 0.268 0.000 0.000 0.000 0.000
#> SRR1652973     1  0.3578      0.733 0.660 0.340 0.000 0.000 0.000 0.000
#> SRR1652974     1  0.0937      0.695 0.960 0.040 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.3515      0.220 0.324 0.676 0.000 0.000 0.000 0.000
#> SRR1652976     1  0.3672      0.703 0.632 0.368 0.000 0.000 0.000 0.000
#> SRR1652977     1  0.3737      0.671 0.608 0.392 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-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) are extracted by 'CV' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.979       0.989         0.4800 0.520   0.520
#> 3 3 0.618           0.732       0.808         0.2858 0.730   0.519
#> 4 4 0.743           0.772       0.874         0.1195 0.922   0.779
#> 5 5 0.689           0.627       0.809         0.0647 0.909   0.723
#> 6 6 0.704           0.708       0.793         0.0371 0.874   0.596

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
#> SRR1652895     1  0.0376      0.991 0.996 0.004
#> SRR1652896     2  0.0000      0.990 0.000 1.000
#> SRR1652897     1  0.0376      0.991 0.996 0.004
#> SRR1652898     1  0.0376      0.991 0.996 0.004
#> SRR1652899     1  0.0376      0.991 0.996 0.004
#> SRR1652900     2  0.0000      0.990 0.000 1.000
#> SRR1652901     2  0.0000      0.990 0.000 1.000
#> SRR1652902     1  0.0376      0.991 0.996 0.004
#> SRR1652903     1  0.0376      0.991 0.996 0.004
#> SRR1652904     1  0.0376      0.991 0.996 0.004
#> SRR1652905     2  0.0000      0.990 0.000 1.000
#> SRR1652906     1  0.0376      0.991 0.996 0.004
#> SRR1652907     1  0.0376      0.991 0.996 0.004
#> SRR1652908     2  0.0000      0.990 0.000 1.000
#> SRR1652909     1  0.0376      0.991 0.996 0.004
#> SRR1652910     1  0.0376      0.991 0.996 0.004
#> SRR1652911     1  0.0376      0.991 0.996 0.004
#> SRR1652912     2  0.0000      0.990 0.000 1.000
#> SRR1652913     1  0.0376      0.991 0.996 0.004
#> SRR1652914     2  0.0000      0.990 0.000 1.000
#> SRR1652915     2  0.0000      0.990 0.000 1.000
#> SRR1652916     1  0.0376      0.991 0.996 0.004
#> SRR1652917     2  0.0000      0.990 0.000 1.000
#> SRR1652918     2  0.0000      0.990 0.000 1.000
#> SRR1652919     1  0.1184      0.980 0.984 0.016
#> SRR1652920     2  0.0000      0.990 0.000 1.000
#> SRR1652921     2  0.6148      0.827 0.152 0.848
#> SRR1652922     1  0.8327      0.644 0.736 0.264
#> SRR1652923     2  0.0000      0.990 0.000 1.000
#> SRR1652924     2  0.0000      0.990 0.000 1.000
#> SRR1652925     2  0.0000      0.990 0.000 1.000
#> SRR1652926     2  0.0000      0.990 0.000 1.000
#> SRR1652927     1  0.0376      0.991 0.996 0.004
#> SRR1652928     1  0.0376      0.991 0.996 0.004
#> SRR1652929     2  0.0000      0.990 0.000 1.000
#> SRR1652930     1  0.0376      0.991 0.996 0.004
#> SRR1652931     2  0.0000      0.990 0.000 1.000
#> SRR1652932     1  0.0376      0.991 0.996 0.004
#> SRR1652933     2  0.0000      0.990 0.000 1.000
#> SRR1652934     2  0.0000      0.990 0.000 1.000
#> SRR1652935     2  0.0000      0.990 0.000 1.000
#> SRR1652936     2  0.0000      0.990 0.000 1.000
#> SRR1652937     1  0.0376      0.991 0.996 0.004
#> SRR1652938     2  0.0000      0.990 0.000 1.000
#> SRR1652939     2  0.0000      0.990 0.000 1.000
#> SRR1652940     1  0.0376      0.991 0.996 0.004
#> SRR1652941     2  0.0000      0.990 0.000 1.000
#> SRR1652942     2  0.0000      0.990 0.000 1.000
#> SRR1652943     2  0.0000      0.990 0.000 1.000
#> SRR1652944     2  0.0000      0.990 0.000 1.000
#> SRR1652945     2  0.0000      0.990 0.000 1.000
#> SRR1652946     2  0.2603      0.949 0.044 0.956
#> SRR1652947     1  0.0000      0.987 1.000 0.000
#> SRR1652948     2  0.0000      0.990 0.000 1.000
#> SRR1652949     1  0.0376      0.991 0.996 0.004
#> SRR1652950     2  0.0000      0.990 0.000 1.000
#> SRR1652951     2  0.0000      0.990 0.000 1.000
#> SRR1652953     1  0.0376      0.991 0.996 0.004
#> SRR1652952     2  0.0000      0.990 0.000 1.000
#> SRR1652954     2  0.0000      0.990 0.000 1.000
#> SRR1652955     1  0.0376      0.991 0.996 0.004
#> SRR1652958     1  0.0376      0.991 0.996 0.004
#> SRR1652956     2  0.0000      0.990 0.000 1.000
#> SRR1652957     2  0.5519      0.857 0.128 0.872
#> SRR1652959     2  0.0000      0.990 0.000 1.000
#> SRR1652960     2  0.0000      0.990 0.000 1.000
#> SRR1652961     2  0.0000      0.990 0.000 1.000
#> SRR1652962     2  0.0000      0.990 0.000 1.000
#> SRR1652963     2  0.0000      0.990 0.000 1.000
#> SRR1652965     1  0.0000      0.987 1.000 0.000
#> SRR1652964     2  0.0000      0.990 0.000 1.000
#> SRR1652966     1  0.0376      0.991 0.996 0.004
#> SRR1652967     2  0.0376      0.986 0.004 0.996
#> SRR1652969     2  0.0000      0.990 0.000 1.000
#> SRR1652968     2  0.0000      0.990 0.000 1.000
#> SRR1652970     1  0.0376      0.991 0.996 0.004
#> SRR1652971     1  0.0376      0.987 0.996 0.004
#> SRR1652972     2  0.6973      0.776 0.188 0.812
#> SRR1652973     2  0.0000      0.990 0.000 1.000
#> SRR1652974     1  0.0376      0.991 0.996 0.004
#> SRR1652975     2  0.0000      0.990 0.000 1.000
#> SRR1652976     2  0.0000      0.990 0.000 1.000
#> SRR1652977     2  0.0000      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
#> SRR1652895     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652896     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652897     1  0.1289      0.838 0.968 0.000 0.032
#> SRR1652898     3  0.6309     -0.189 0.496 0.000 0.504
#> SRR1652899     1  0.0892      0.845 0.980 0.000 0.020
#> SRR1652900     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652901     3  0.3482      0.611 0.000 0.128 0.872
#> SRR1652902     1  0.6180      0.362 0.584 0.000 0.416
#> SRR1652903     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652904     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652905     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652906     1  0.6252      0.299 0.556 0.000 0.444
#> SRR1652907     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652908     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652909     3  0.5760      0.324 0.328 0.000 0.672
#> SRR1652910     1  0.0892      0.845 0.980 0.000 0.020
#> SRR1652911     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652912     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652913     1  0.6215      0.332 0.572 0.000 0.428
#> SRR1652914     3  0.0424      0.790 0.000 0.008 0.992
#> SRR1652915     3  0.0983      0.796 0.016 0.004 0.980
#> SRR1652916     1  0.6309      0.158 0.504 0.000 0.496
#> SRR1652917     3  0.0237      0.793 0.000 0.004 0.996
#> SRR1652918     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652919     3  0.5929      0.339 0.320 0.004 0.676
#> SRR1652920     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652921     3  0.2711      0.753 0.088 0.000 0.912
#> SRR1652922     3  0.5982      0.484 0.004 0.328 0.668
#> SRR1652923     3  0.0424      0.790 0.000 0.008 0.992
#> SRR1652924     3  0.0000      0.796 0.000 0.000 1.000
#> SRR1652925     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652926     3  0.6302     -0.616 0.000 0.480 0.520
#> SRR1652927     1  0.0424      0.850 0.992 0.000 0.008
#> SRR1652928     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652929     3  0.0237      0.796 0.000 0.004 0.996
#> SRR1652930     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652931     3  0.0983      0.796 0.016 0.004 0.980
#> SRR1652932     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652933     3  0.6274     -0.551 0.000 0.456 0.544
#> SRR1652934     3  0.0424      0.798 0.008 0.000 0.992
#> SRR1652935     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652936     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652937     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652938     3  0.4291      0.517 0.000 0.180 0.820
#> SRR1652939     3  0.0237      0.793 0.000 0.004 0.996
#> SRR1652940     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652941     3  0.0424      0.798 0.008 0.000 0.992
#> SRR1652942     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652943     2  0.5859      0.976 0.000 0.656 0.344
#> SRR1652944     3  0.0237      0.793 0.000 0.004 0.996
#> SRR1652945     2  0.5859      0.976 0.000 0.656 0.344
#> SRR1652946     3  0.1753      0.781 0.048 0.000 0.952
#> SRR1652947     1  0.5678      0.652 0.684 0.316 0.000
#> SRR1652948     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652949     1  0.0424      0.850 0.992 0.000 0.008
#> SRR1652950     3  0.0424      0.798 0.008 0.000 0.992
#> SRR1652951     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652953     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652952     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652954     3  0.0747      0.797 0.016 0.000 0.984
#> SRR1652955     3  0.5956      0.330 0.324 0.004 0.672
#> SRR1652958     1  0.6286      0.249 0.536 0.000 0.464
#> SRR1652956     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652957     3  0.2537      0.760 0.080 0.000 0.920
#> SRR1652959     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652960     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652961     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652962     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652963     2  0.5760      0.997 0.000 0.672 0.328
#> SRR1652965     1  0.5982      0.642 0.668 0.328 0.004
#> SRR1652964     3  0.6307     -0.637 0.000 0.488 0.512
#> SRR1652966     1  0.4399      0.707 0.812 0.000 0.188
#> SRR1652967     3  0.3686      0.722 0.000 0.140 0.860
#> SRR1652969     3  0.0000      0.796 0.000 0.000 1.000
#> SRR1652968     3  0.0000      0.796 0.000 0.000 1.000
#> SRR1652970     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652971     1  0.9239      0.484 0.500 0.328 0.172
#> SRR1652972     3  0.2496      0.768 0.068 0.004 0.928
#> SRR1652973     3  0.0747      0.797 0.016 0.000 0.984
#> SRR1652974     1  0.0000      0.852 1.000 0.000 0.000
#> SRR1652975     2  0.5835      0.982 0.000 0.660 0.340
#> SRR1652976     3  0.0237      0.796 0.000 0.004 0.996
#> SRR1652977     3  0.0000      0.796 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
#> SRR1652895     1  0.0469     0.7702 0.988 0.000 0.000 0.012
#> SRR1652896     2  0.0469     0.9018 0.000 0.988 0.000 0.012
#> SRR1652897     1  0.3948     0.7338 0.840 0.000 0.064 0.096
#> SRR1652898     1  0.7065     0.3474 0.472 0.000 0.404 0.124
#> SRR1652899     1  0.3647     0.7399 0.852 0.000 0.040 0.108
#> SRR1652900     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652901     3  0.3638     0.8508 0.000 0.120 0.848 0.032
#> SRR1652902     1  0.6031     0.5955 0.676 0.000 0.216 0.108
#> SRR1652903     1  0.0469     0.7702 0.988 0.000 0.000 0.012
#> SRR1652904     1  0.0469     0.7702 0.988 0.000 0.000 0.012
#> SRR1652905     2  0.0469     0.9018 0.000 0.988 0.000 0.012
#> SRR1652906     1  0.6875     0.3933 0.504 0.000 0.388 0.108
#> SRR1652907     1  0.0469     0.7702 0.988 0.000 0.000 0.012
#> SRR1652908     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652909     3  0.4655     0.7104 0.088 0.000 0.796 0.116
#> SRR1652910     1  0.3497     0.7436 0.860 0.000 0.036 0.104
#> SRR1652911     1  0.0000     0.7724 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652913     1  0.6775     0.3855 0.516 0.000 0.384 0.100
#> SRR1652914     3  0.2845     0.8924 0.000 0.076 0.896 0.028
#> SRR1652915     3  0.3705     0.8693 0.012 0.060 0.868 0.060
#> SRR1652916     1  0.6830     0.4211 0.524 0.000 0.368 0.108
#> SRR1652917     3  0.2563     0.8929 0.000 0.072 0.908 0.020
#> SRR1652918     2  0.1356     0.8860 0.000 0.960 0.008 0.032
#> SRR1652919     3  0.4482     0.7257 0.068 0.000 0.804 0.128
#> SRR1652920     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652921     3  0.3103     0.8861 0.024 0.048 0.900 0.028
#> SRR1652922     4  0.4343     0.6490 0.004 0.000 0.264 0.732
#> SRR1652923     3  0.3013     0.8903 0.000 0.080 0.888 0.032
#> SRR1652924     3  0.2871     0.8890 0.000 0.072 0.896 0.032
#> SRR1652925     2  0.1724     0.8773 0.000 0.948 0.020 0.032
#> SRR1652926     2  0.5850     0.0705 0.000 0.512 0.456 0.032
#> SRR1652927     1  0.3143     0.7487 0.876 0.000 0.024 0.100
#> SRR1652928     1  0.0469     0.7702 0.988 0.000 0.000 0.012
#> SRR1652929     3  0.2670     0.8938 0.000 0.072 0.904 0.024
#> SRR1652930     1  0.0000     0.7724 1.000 0.000 0.000 0.000
#> SRR1652931     3  0.3622     0.8647 0.012 0.052 0.872 0.064
#> SRR1652932     1  0.0469     0.7702 0.988 0.000 0.000 0.012
#> SRR1652933     3  0.5856     0.0662 0.000 0.464 0.504 0.032
#> SRR1652934     3  0.2234     0.8964 0.008 0.064 0.924 0.004
#> SRR1652935     2  0.0469     0.9018 0.000 0.988 0.000 0.012
#> SRR1652936     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.1389     0.7664 0.952 0.000 0.000 0.048
#> SRR1652938     3  0.5282     0.6383 0.000 0.276 0.688 0.036
#> SRR1652939     3  0.2965     0.8881 0.000 0.072 0.892 0.036
#> SRR1652940     1  0.0469     0.7702 0.988 0.000 0.000 0.012
#> SRR1652941     3  0.2101     0.8947 0.012 0.060 0.928 0.000
#> SRR1652942     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652943     2  0.4418     0.7152 0.000 0.784 0.184 0.032
#> SRR1652944     3  0.3082     0.8879 0.000 0.084 0.884 0.032
#> SRR1652945     2  0.4459     0.7119 0.000 0.780 0.188 0.032
#> SRR1652946     3  0.3048     0.8909 0.016 0.056 0.900 0.028
#> SRR1652947     4  0.3907     0.7558 0.232 0.000 0.000 0.768
#> SRR1652948     2  0.0469     0.9018 0.000 0.988 0.000 0.012
#> SRR1652949     1  0.2654     0.7500 0.888 0.000 0.004 0.108
#> SRR1652950     3  0.2631     0.8936 0.008 0.064 0.912 0.016
#> SRR1652951     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0469     0.7702 0.988 0.000 0.000 0.012
#> SRR1652952     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652954     3  0.2797     0.8937 0.012 0.060 0.908 0.020
#> SRR1652955     3  0.4552     0.7267 0.072 0.000 0.800 0.128
#> SRR1652958     1  0.6918     0.3513 0.472 0.000 0.420 0.108
#> SRR1652956     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652957     3  0.3080     0.8888 0.020 0.052 0.900 0.028
#> SRR1652959     2  0.0336     0.9024 0.000 0.992 0.008 0.000
#> SRR1652960     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652962     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.0000     0.9048 0.000 1.000 0.000 0.000
#> SRR1652965     4  0.2530     0.8369 0.112 0.000 0.000 0.888
#> SRR1652964     2  0.5833     0.1324 0.000 0.528 0.440 0.032
#> SRR1652966     1  0.5731     0.6316 0.712 0.000 0.172 0.116
#> SRR1652967     3  0.5515     0.5719 0.000 0.116 0.732 0.152
#> SRR1652969     3  0.2871     0.8890 0.000 0.072 0.896 0.032
#> SRR1652968     3  0.2773     0.8941 0.000 0.072 0.900 0.028
#> SRR1652970     1  0.0000     0.7724 1.000 0.000 0.000 0.000
#> SRR1652971     4  0.2216     0.8365 0.092 0.000 0.000 0.908
#> SRR1652972     3  0.4207     0.8431 0.020 0.052 0.844 0.084
#> SRR1652973     3  0.2797     0.8937 0.012 0.060 0.908 0.020
#> SRR1652974     1  0.0000     0.7724 1.000 0.000 0.000 0.000
#> SRR1652975     2  0.4540     0.7012 0.000 0.772 0.196 0.032
#> SRR1652976     3  0.2563     0.8944 0.000 0.072 0.908 0.020
#> SRR1652977     3  0.2670     0.8940 0.000 0.072 0.904 0.024

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.0290    0.81480 0.992 0.000 0.000 0.000 0.008
#> SRR1652896     2  0.1442    0.88702 0.000 0.952 0.004 0.032 0.012
#> SRR1652897     1  0.5388    0.32465 0.580 0.000 0.360 0.056 0.004
#> SRR1652898     3  0.6477    0.49204 0.176 0.000 0.492 0.328 0.004
#> SRR1652899     1  0.4824    0.36766 0.596 0.000 0.380 0.020 0.004
#> SRR1652900     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652901     4  0.2499    0.69920 0.000 0.036 0.040 0.908 0.016
#> SRR1652902     3  0.6529    0.33032 0.392 0.000 0.436 0.168 0.004
#> SRR1652903     1  0.0290    0.81480 0.992 0.000 0.000 0.000 0.008
#> SRR1652904     1  0.0290    0.81480 0.992 0.000 0.000 0.000 0.008
#> SRR1652905     2  0.1538    0.88477 0.000 0.948 0.008 0.036 0.008
#> SRR1652906     3  0.6740    0.56337 0.232 0.000 0.448 0.316 0.004
#> SRR1652907     1  0.0290    0.81480 0.992 0.000 0.000 0.000 0.008
#> SRR1652908     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652909     4  0.4889   -0.05838 0.016 0.000 0.476 0.504 0.004
#> SRR1652910     1  0.4824    0.36781 0.596 0.000 0.380 0.020 0.004
#> SRR1652911     1  0.0000    0.81397 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652913     4  0.6852   -0.49296 0.260 0.000 0.324 0.412 0.004
#> SRR1652914     4  0.3063    0.70756 0.000 0.012 0.104 0.864 0.020
#> SRR1652915     4  0.4146    0.56816 0.000 0.004 0.268 0.716 0.012
#> SRR1652916     3  0.6815    0.56619 0.260 0.000 0.432 0.304 0.004
#> SRR1652917     4  0.1205    0.71745 0.000 0.004 0.040 0.956 0.000
#> SRR1652918     2  0.2786    0.83567 0.000 0.884 0.020 0.084 0.012
#> SRR1652919     4  0.4596    0.00786 0.004 0.000 0.496 0.496 0.004
#> SRR1652920     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652921     4  0.1768    0.70754 0.000 0.004 0.072 0.924 0.000
#> SRR1652922     3  0.5221   -0.53493 0.000 0.000 0.552 0.048 0.400
#> SRR1652923     4  0.3216    0.70409 0.000 0.012 0.116 0.852 0.020
#> SRR1652924     4  0.1116    0.70608 0.000 0.004 0.028 0.964 0.004
#> SRR1652925     2  0.3297    0.79186 0.000 0.840 0.020 0.132 0.008
#> SRR1652926     4  0.4682    0.22035 0.000 0.356 0.024 0.620 0.000
#> SRR1652927     1  0.4661    0.42416 0.624 0.000 0.356 0.016 0.004
#> SRR1652928     1  0.0290    0.81480 0.992 0.000 0.000 0.000 0.008
#> SRR1652929     4  0.3219    0.70180 0.000 0.004 0.136 0.840 0.020
#> SRR1652930     1  0.0000    0.81397 1.000 0.000 0.000 0.000 0.000
#> SRR1652931     4  0.4026    0.60194 0.000 0.000 0.244 0.736 0.020
#> SRR1652932     1  0.0290    0.81480 0.992 0.000 0.000 0.000 0.008
#> SRR1652933     4  0.4387    0.29806 0.000 0.336 0.008 0.652 0.004
#> SRR1652934     4  0.1704    0.71802 0.000 0.004 0.068 0.928 0.000
#> SRR1652935     2  0.1168    0.89074 0.000 0.960 0.000 0.032 0.008
#> SRR1652936     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652937     1  0.3452    0.60683 0.756 0.000 0.244 0.000 0.000
#> SRR1652938     4  0.4145    0.51827 0.000 0.188 0.028 0.772 0.012
#> SRR1652939     4  0.1329    0.70156 0.000 0.004 0.032 0.956 0.008
#> SRR1652940     1  0.0290    0.81480 0.992 0.000 0.000 0.000 0.008
#> SRR1652941     4  0.2124    0.71516 0.000 0.004 0.096 0.900 0.000
#> SRR1652942     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652943     2  0.5111    0.44839 0.000 0.588 0.024 0.376 0.012
#> SRR1652944     4  0.3166    0.70500 0.000 0.012 0.112 0.856 0.020
#> SRR1652945     2  0.5122    0.44122 0.000 0.584 0.024 0.380 0.012
#> SRR1652946     4  0.1731    0.71215 0.000 0.004 0.060 0.932 0.004
#> SRR1652947     5  0.3010    0.82017 0.172 0.000 0.004 0.000 0.824
#> SRR1652948     2  0.1168    0.89074 0.000 0.960 0.000 0.032 0.008
#> SRR1652949     1  0.4238    0.43616 0.628 0.000 0.368 0.000 0.004
#> SRR1652950     4  0.3264    0.69997 0.000 0.004 0.140 0.836 0.020
#> SRR1652951     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652953     1  0.0290    0.81480 0.992 0.000 0.000 0.000 0.008
#> SRR1652952     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652954     4  0.1282    0.71710 0.000 0.004 0.044 0.952 0.000
#> SRR1652955     4  0.4706   -0.01071 0.008 0.000 0.492 0.496 0.004
#> SRR1652958     3  0.6655    0.52604 0.200 0.000 0.448 0.348 0.004
#> SRR1652956     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652957     4  0.1502    0.71443 0.000 0.004 0.056 0.940 0.000
#> SRR1652959     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652960     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652961     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652962     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652963     2  0.0162    0.90462 0.000 0.996 0.000 0.004 0.000
#> SRR1652965     5  0.0955    0.90920 0.028 0.000 0.004 0.000 0.968
#> SRR1652964     4  0.5557    0.17901 0.000 0.376 0.044 0.564 0.016
#> SRR1652966     3  0.6353    0.28883 0.404 0.000 0.452 0.140 0.004
#> SRR1652967     3  0.6578   -0.24517 0.000 0.052 0.608 0.168 0.172
#> SRR1652969     4  0.0865    0.70813 0.000 0.004 0.024 0.972 0.000
#> SRR1652968     4  0.3174    0.70240 0.000 0.004 0.132 0.844 0.020
#> SRR1652970     1  0.0000    0.81397 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.0992    0.90700 0.024 0.000 0.008 0.000 0.968
#> SRR1652972     4  0.4680    0.16467 0.000 0.004 0.448 0.540 0.008
#> SRR1652973     4  0.1430    0.71534 0.000 0.004 0.052 0.944 0.000
#> SRR1652974     1  0.0000    0.81397 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.4821    0.25582 0.000 0.516 0.020 0.464 0.000
#> SRR1652976     4  0.3174    0.70620 0.000 0.004 0.132 0.844 0.020
#> SRR1652977     4  0.2775    0.70984 0.000 0.004 0.100 0.876 0.020

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0000     0.9558 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     2  0.1760     0.9162 0.000 0.928 0.000 0.020 0.004 0.048
#> SRR1652897     3  0.5238     0.3422 0.436 0.000 0.492 0.056 0.000 0.016
#> SRR1652898     3  0.4670     0.6305 0.076 0.000 0.692 0.220 0.000 0.012
#> SRR1652899     3  0.3966     0.3597 0.444 0.000 0.552 0.004 0.000 0.000
#> SRR1652900     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652901     4  0.3555     0.6757 0.000 0.028 0.052 0.832 0.004 0.084
#> SRR1652902     3  0.4641     0.6397 0.248 0.000 0.664 0.088 0.000 0.000
#> SRR1652903     1  0.0000     0.9558 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9558 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.2670     0.8638 0.000 0.872 0.000 0.084 0.004 0.040
#> SRR1652906     3  0.4707     0.6645 0.120 0.000 0.676 0.204 0.000 0.000
#> SRR1652907     1  0.0146     0.9527 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1652908     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652909     3  0.3565     0.5443 0.004 0.000 0.716 0.276 0.000 0.004
#> SRR1652910     3  0.3966     0.3597 0.444 0.000 0.552 0.004 0.000 0.000
#> SRR1652911     1  0.0146     0.9546 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1652912     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652913     3  0.5952     0.4909 0.144 0.000 0.476 0.364 0.000 0.016
#> SRR1652914     4  0.4225     0.6627 0.000 0.004 0.124 0.748 0.000 0.124
#> SRR1652915     4  0.5178     0.4427 0.000 0.000 0.304 0.580 0.000 0.116
#> SRR1652916     3  0.5087     0.6608 0.132 0.000 0.652 0.208 0.000 0.008
#> SRR1652917     4  0.2070     0.6910 0.000 0.000 0.100 0.892 0.000 0.008
#> SRR1652918     2  0.3591     0.7783 0.000 0.804 0.012 0.148 0.004 0.032
#> SRR1652919     3  0.4806     0.4650 0.004 0.000 0.624 0.304 0.000 0.068
#> SRR1652920     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652921     4  0.2783     0.6608 0.000 0.000 0.148 0.836 0.000 0.016
#> SRR1652922     6  0.4379     0.7129 0.000 0.004 0.104 0.008 0.136 0.748
#> SRR1652923     4  0.4381     0.6556 0.000 0.004 0.136 0.732 0.000 0.128
#> SRR1652924     4  0.1152     0.6806 0.000 0.000 0.044 0.952 0.000 0.004
#> SRR1652925     2  0.4411     0.6113 0.000 0.692 0.012 0.260 0.004 0.032
#> SRR1652926     4  0.4175     0.4634 0.000 0.232 0.012 0.724 0.004 0.028
#> SRR1652927     3  0.4124     0.2898 0.476 0.000 0.516 0.004 0.000 0.004
#> SRR1652928     1  0.0000     0.9558 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652929     4  0.4545     0.6327 0.000 0.000 0.176 0.700 0.000 0.124
#> SRR1652930     1  0.0146     0.9546 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1652931     4  0.5156     0.4917 0.000 0.000 0.272 0.600 0.000 0.128
#> SRR1652932     1  0.0000     0.9558 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.4433     0.4753 0.000 0.236 0.008 0.704 0.004 0.048
#> SRR1652934     4  0.2572     0.6833 0.000 0.000 0.136 0.852 0.000 0.012
#> SRR1652935     2  0.1693     0.9189 0.000 0.932 0.000 0.020 0.004 0.044
#> SRR1652936     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652937     1  0.3672     0.1603 0.632 0.000 0.368 0.000 0.000 0.000
#> SRR1652938     4  0.4999     0.4572 0.000 0.056 0.180 0.700 0.000 0.064
#> SRR1652939     4  0.2393     0.6504 0.000 0.004 0.064 0.892 0.000 0.040
#> SRR1652940     1  0.0000     0.9558 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     4  0.2983     0.6809 0.000 0.000 0.136 0.832 0.000 0.032
#> SRR1652942     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652943     4  0.5012     0.0681 0.000 0.428 0.012 0.520 0.004 0.036
#> SRR1652944     4  0.4303     0.6577 0.000 0.004 0.132 0.740 0.000 0.124
#> SRR1652945     4  0.5395     0.1747 0.000 0.376 0.040 0.540 0.000 0.044
#> SRR1652946     4  0.2311     0.6680 0.000 0.000 0.104 0.880 0.000 0.016
#> SRR1652947     5  0.0632     0.9596 0.024 0.000 0.000 0.000 0.976 0.000
#> SRR1652948     2  0.1760     0.9162 0.000 0.928 0.000 0.020 0.004 0.048
#> SRR1652949     3  0.4222     0.2872 0.472 0.000 0.516 0.004 0.000 0.008
#> SRR1652950     4  0.4536     0.6351 0.000 0.000 0.180 0.700 0.000 0.120
#> SRR1652951     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652953     1  0.0000     0.9558 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652954     4  0.2300     0.6771 0.000 0.000 0.144 0.856 0.000 0.000
#> SRR1652955     3  0.4463     0.4993 0.004 0.000 0.652 0.300 0.000 0.044
#> SRR1652958     3  0.4695     0.6634 0.116 0.000 0.676 0.208 0.000 0.000
#> SRR1652956     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652957     4  0.2704     0.6669 0.000 0.000 0.140 0.844 0.000 0.016
#> SRR1652959     2  0.0748     0.9410 0.000 0.976 0.004 0.016 0.004 0.000
#> SRR1652960     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652961     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652962     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652963     2  0.0146     0.9508 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652965     5  0.0436     0.9740 0.004 0.000 0.004 0.000 0.988 0.004
#> SRR1652964     4  0.5825     0.4397 0.000 0.244 0.044 0.604 0.004 0.104
#> SRR1652966     3  0.4548     0.6248 0.260 0.000 0.676 0.056 0.000 0.008
#> SRR1652967     6  0.1608     0.7458 0.000 0.004 0.004 0.036 0.016 0.940
#> SRR1652969     4  0.1297     0.6794 0.000 0.000 0.040 0.948 0.000 0.012
#> SRR1652968     4  0.4410     0.6440 0.000 0.000 0.164 0.716 0.000 0.120
#> SRR1652970     1  0.0146     0.9546 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1652971     5  0.0405     0.9740 0.004 0.000 0.008 0.000 0.988 0.000
#> SRR1652972     3  0.4961     0.3371 0.000 0.000 0.572 0.348 0.000 0.080
#> SRR1652973     4  0.2664     0.6696 0.000 0.000 0.136 0.848 0.000 0.016
#> SRR1652974     1  0.0146     0.9546 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1652975     4  0.4672     0.2805 0.000 0.364 0.008 0.596 0.004 0.028
#> SRR1652976     4  0.4548     0.6477 0.000 0.004 0.164 0.712 0.000 0.120
#> SRR1652977     4  0.4001     0.6664 0.000 0.000 0.128 0.760 0.000 0.112

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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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 1.000           0.945       0.980         0.5044 0.496   0.496
#> 3 3 0.756           0.778       0.901         0.2499 0.864   0.731
#> 4 4 0.698           0.690       0.851         0.0996 0.900   0.743
#> 5 5 0.689           0.652       0.836         0.0533 0.960   0.869
#> 6 6 0.696           0.601       0.807         0.0359 0.979   0.926

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
#> SRR1652895     1  0.0000     0.9757 1.000 0.000
#> SRR1652896     2  0.0000     0.9811 0.000 1.000
#> SRR1652897     1  0.0000     0.9757 1.000 0.000
#> SRR1652898     1  0.0000     0.9757 1.000 0.000
#> SRR1652899     1  0.0000     0.9757 1.000 0.000
#> SRR1652900     2  0.0000     0.9811 0.000 1.000
#> SRR1652901     2  0.0000     0.9811 0.000 1.000
#> SRR1652902     1  0.0000     0.9757 1.000 0.000
#> SRR1652903     1  0.0000     0.9757 1.000 0.000
#> SRR1652904     1  0.0000     0.9757 1.000 0.000
#> SRR1652905     2  0.0000     0.9811 0.000 1.000
#> SRR1652906     1  0.0000     0.9757 1.000 0.000
#> SRR1652907     1  0.0000     0.9757 1.000 0.000
#> SRR1652908     2  0.0000     0.9811 0.000 1.000
#> SRR1652909     1  0.0000     0.9757 1.000 0.000
#> SRR1652910     1  0.0000     0.9757 1.000 0.000
#> SRR1652911     1  0.0000     0.9757 1.000 0.000
#> SRR1652912     2  0.0000     0.9811 0.000 1.000
#> SRR1652913     1  0.0000     0.9757 1.000 0.000
#> SRR1652914     2  0.0000     0.9811 0.000 1.000
#> SRR1652915     1  0.9996     0.0375 0.512 0.488
#> SRR1652916     1  0.0000     0.9757 1.000 0.000
#> SRR1652917     2  0.0000     0.9811 0.000 1.000
#> SRR1652918     2  0.0000     0.9811 0.000 1.000
#> SRR1652919     1  0.0000     0.9757 1.000 0.000
#> SRR1652920     2  0.0000     0.9811 0.000 1.000
#> SRR1652921     1  0.0000     0.9757 1.000 0.000
#> SRR1652922     1  0.2948     0.9263 0.948 0.052
#> SRR1652923     2  0.0000     0.9811 0.000 1.000
#> SRR1652924     2  0.0000     0.9811 0.000 1.000
#> SRR1652925     2  0.0000     0.9811 0.000 1.000
#> SRR1652926     2  0.0000     0.9811 0.000 1.000
#> SRR1652927     1  0.0000     0.9757 1.000 0.000
#> SRR1652928     1  0.0000     0.9757 1.000 0.000
#> SRR1652929     2  0.0000     0.9811 0.000 1.000
#> SRR1652930     1  0.0000     0.9757 1.000 0.000
#> SRR1652931     2  0.9922     0.1583 0.448 0.552
#> SRR1652932     1  0.0000     0.9757 1.000 0.000
#> SRR1652933     2  0.0000     0.9811 0.000 1.000
#> SRR1652934     2  0.0000     0.9811 0.000 1.000
#> SRR1652935     2  0.0000     0.9811 0.000 1.000
#> SRR1652936     2  0.0000     0.9811 0.000 1.000
#> SRR1652937     1  0.0000     0.9757 1.000 0.000
#> SRR1652938     2  0.0000     0.9811 0.000 1.000
#> SRR1652939     2  0.0000     0.9811 0.000 1.000
#> SRR1652940     1  0.0000     0.9757 1.000 0.000
#> SRR1652941     2  0.0672     0.9736 0.008 0.992
#> SRR1652942     2  0.0000     0.9811 0.000 1.000
#> SRR1652943     2  0.0000     0.9811 0.000 1.000
#> SRR1652944     2  0.0000     0.9811 0.000 1.000
#> SRR1652945     2  0.0000     0.9811 0.000 1.000
#> SRR1652946     1  0.0000     0.9757 1.000 0.000
#> SRR1652947     1  0.0000     0.9757 1.000 0.000
#> SRR1652948     2  0.0000     0.9811 0.000 1.000
#> SRR1652949     1  0.0000     0.9757 1.000 0.000
#> SRR1652950     2  0.9087     0.5059 0.324 0.676
#> SRR1652951     2  0.0000     0.9811 0.000 1.000
#> SRR1652953     1  0.0000     0.9757 1.000 0.000
#> SRR1652952     2  0.0000     0.9811 0.000 1.000
#> SRR1652954     1  0.9129     0.5035 0.672 0.328
#> SRR1652955     1  0.0000     0.9757 1.000 0.000
#> SRR1652958     1  0.0000     0.9757 1.000 0.000
#> SRR1652956     2  0.0000     0.9811 0.000 1.000
#> SRR1652957     1  0.0000     0.9757 1.000 0.000
#> SRR1652959     2  0.0000     0.9811 0.000 1.000
#> SRR1652960     2  0.0000     0.9811 0.000 1.000
#> SRR1652961     2  0.0000     0.9811 0.000 1.000
#> SRR1652962     2  0.0000     0.9811 0.000 1.000
#> SRR1652963     2  0.0000     0.9811 0.000 1.000
#> SRR1652965     1  0.0000     0.9757 1.000 0.000
#> SRR1652964     2  0.0000     0.9811 0.000 1.000
#> SRR1652966     1  0.0000     0.9757 1.000 0.000
#> SRR1652967     2  0.0000     0.9811 0.000 1.000
#> SRR1652969     2  0.0000     0.9811 0.000 1.000
#> SRR1652968     2  0.0000     0.9811 0.000 1.000
#> SRR1652970     1  0.0000     0.9757 1.000 0.000
#> SRR1652971     1  0.0000     0.9757 1.000 0.000
#> SRR1652972     1  0.0000     0.9757 1.000 0.000
#> SRR1652973     1  0.1843     0.9504 0.972 0.028
#> SRR1652974     1  0.0000     0.9757 1.000 0.000
#> SRR1652975     2  0.0000     0.9811 0.000 1.000
#> SRR1652976     2  0.0000     0.9811 0.000 1.000
#> SRR1652977     2  0.0000     0.9811 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
#> SRR1652895     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652896     2  0.0592     0.9040 0.000 0.988 0.012
#> SRR1652897     1  0.0237     0.9133 0.996 0.000 0.004
#> SRR1652898     1  0.5785     0.5124 0.668 0.000 0.332
#> SRR1652899     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652900     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652901     2  0.0424     0.9066 0.000 0.992 0.008
#> SRR1652902     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652903     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652905     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652906     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652907     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652908     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652909     1  0.1411     0.8934 0.964 0.000 0.036
#> SRR1652910     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652911     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652913     1  0.2537     0.8615 0.920 0.000 0.080
#> SRR1652914     2  0.5760     0.4299 0.000 0.672 0.328
#> SRR1652915     3  0.3377     0.7295 0.092 0.012 0.896
#> SRR1652916     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652917     2  0.3267     0.8359 0.000 0.884 0.116
#> SRR1652918     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652919     3  0.5431     0.5069 0.284 0.000 0.716
#> SRR1652920     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652921     1  0.3038     0.8423 0.896 0.000 0.104
#> SRR1652922     3  0.6553     0.1988 0.412 0.008 0.580
#> SRR1652923     2  0.6095     0.2444 0.000 0.608 0.392
#> SRR1652924     2  0.2711     0.8516 0.000 0.912 0.088
#> SRR1652925     2  0.0237     0.9095 0.000 0.996 0.004
#> SRR1652926     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652927     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652928     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652929     3  0.4062     0.7068 0.000 0.164 0.836
#> SRR1652930     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652931     3  0.3590     0.7369 0.076 0.028 0.896
#> SRR1652932     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652933     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652934     2  0.6280     0.1750 0.000 0.540 0.460
#> SRR1652935     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652936     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652937     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652938     2  0.2796     0.8476 0.000 0.908 0.092
#> SRR1652939     2  0.2878     0.8437 0.000 0.904 0.096
#> SRR1652940     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652941     2  0.7169     0.2257 0.028 0.568 0.404
#> SRR1652942     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652943     2  0.1964     0.8770 0.000 0.944 0.056
#> SRR1652944     3  0.6180     0.3399 0.000 0.416 0.584
#> SRR1652945     2  0.2066     0.8740 0.000 0.940 0.060
#> SRR1652946     1  0.3618     0.8323 0.884 0.012 0.104
#> SRR1652947     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652948     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652949     1  0.3816     0.7933 0.852 0.000 0.148
#> SRR1652950     3  0.3618     0.7300 0.012 0.104 0.884
#> SRR1652951     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652953     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652952     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652954     1  0.9684    -0.0539 0.428 0.220 0.352
#> SRR1652955     3  0.3116     0.7190 0.108 0.000 0.892
#> SRR1652958     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652956     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652957     1  0.3038     0.8423 0.896 0.000 0.104
#> SRR1652959     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652960     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652961     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652962     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652963     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652965     1  0.5363     0.6161 0.724 0.000 0.276
#> SRR1652964     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652966     1  0.3551     0.8103 0.868 0.000 0.132
#> SRR1652967     3  0.6625     0.3069 0.008 0.440 0.552
#> SRR1652969     2  0.2625     0.8547 0.000 0.916 0.084
#> SRR1652968     3  0.5591     0.5607 0.000 0.304 0.696
#> SRR1652970     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652971     1  0.6111     0.3650 0.604 0.000 0.396
#> SRR1652972     3  0.3038     0.7205 0.104 0.000 0.896
#> SRR1652973     1  0.6025     0.7216 0.784 0.076 0.140
#> SRR1652974     1  0.0000     0.9156 1.000 0.000 0.000
#> SRR1652975     2  0.0000     0.9117 0.000 1.000 0.000
#> SRR1652976     3  0.6192     0.3565 0.000 0.420 0.580
#> SRR1652977     2  0.6299    -0.0596 0.000 0.524 0.476

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652896     2  0.0921     0.8800 0.000 0.972 0.028 0.000
#> SRR1652897     1  0.2469     0.8248 0.892 0.000 0.000 0.108
#> SRR1652898     1  0.4675     0.6633 0.736 0.000 0.244 0.020
#> SRR1652899     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652900     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652901     2  0.1610     0.8672 0.000 0.952 0.032 0.016
#> SRR1652902     1  0.0336     0.9156 0.992 0.000 0.008 0.000
#> SRR1652903     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.0336     0.8941 0.000 0.992 0.000 0.008
#> SRR1652906     1  0.0188     0.9170 0.996 0.000 0.004 0.000
#> SRR1652907     1  0.0336     0.9154 0.992 0.000 0.008 0.000
#> SRR1652908     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652909     1  0.2335     0.8716 0.920 0.000 0.060 0.020
#> SRR1652910     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652911     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652913     1  0.4776     0.3182 0.624 0.000 0.000 0.376
#> SRR1652914     2  0.5728     0.2147 0.000 0.600 0.364 0.036
#> SRR1652915     3  0.4979     0.5334 0.048 0.040 0.804 0.108
#> SRR1652916     1  0.0592     0.9088 0.984 0.000 0.000 0.016
#> SRR1652917     2  0.6383     0.3202 0.000 0.612 0.096 0.292
#> SRR1652918     2  0.0707     0.8871 0.000 0.980 0.000 0.020
#> SRR1652919     3  0.6859     0.3323 0.256 0.000 0.588 0.156
#> SRR1652920     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652921     4  0.4382     0.4888 0.296 0.000 0.000 0.704
#> SRR1652922     3  0.8059     0.1551 0.360 0.012 0.412 0.216
#> SRR1652923     2  0.5371     0.2568 0.000 0.616 0.364 0.020
#> SRR1652924     2  0.4994    -0.0855 0.000 0.520 0.000 0.480
#> SRR1652925     2  0.0707     0.8867 0.000 0.980 0.000 0.020
#> SRR1652926     2  0.1637     0.8602 0.000 0.940 0.000 0.060
#> SRR1652927     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652928     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652929     3  0.5619     0.4780 0.000 0.248 0.688 0.064
#> SRR1652930     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652931     3  0.4215     0.5239 0.012 0.024 0.820 0.144
#> SRR1652932     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652933     2  0.0336     0.8941 0.000 0.992 0.000 0.008
#> SRR1652934     4  0.7738    -0.0172 0.000 0.240 0.336 0.424
#> SRR1652935     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652936     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652938     2  0.4382     0.5117 0.000 0.704 0.000 0.296
#> SRR1652939     4  0.5402     0.1176 0.000 0.472 0.012 0.516
#> SRR1652940     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652941     4  0.8742     0.0356 0.040 0.324 0.260 0.376
#> SRR1652942     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652943     2  0.3024     0.7569 0.000 0.852 0.000 0.148
#> SRR1652944     3  0.5630     0.3767 0.000 0.360 0.608 0.032
#> SRR1652945     2  0.3907     0.6346 0.000 0.768 0.000 0.232
#> SRR1652946     4  0.4188     0.5147 0.244 0.004 0.000 0.752
#> SRR1652947     1  0.1610     0.8925 0.952 0.000 0.016 0.032
#> SRR1652948     2  0.0779     0.8862 0.000 0.980 0.016 0.004
#> SRR1652949     1  0.2987     0.8337 0.880 0.000 0.104 0.016
#> SRR1652950     3  0.3076     0.5350 0.016 0.036 0.900 0.048
#> SRR1652951     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652954     4  0.8130     0.4056 0.192 0.104 0.124 0.580
#> SRR1652955     3  0.3013     0.5286 0.080 0.000 0.888 0.032
#> SRR1652958     1  0.0188     0.9171 0.996 0.000 0.004 0.000
#> SRR1652956     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652957     4  0.4222     0.5049 0.272 0.000 0.000 0.728
#> SRR1652959     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652962     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.0000     0.8969 0.000 1.000 0.000 0.000
#> SRR1652965     1  0.6472     0.5051 0.640 0.000 0.212 0.148
#> SRR1652964     2  0.0657     0.8905 0.000 0.984 0.012 0.004
#> SRR1652966     1  0.3706     0.8060 0.848 0.000 0.112 0.040
#> SRR1652967     3  0.7830     0.2229 0.008 0.400 0.404 0.188
#> SRR1652969     4  0.4985     0.1380 0.000 0.468 0.000 0.532
#> SRR1652968     3  0.5218     0.4896 0.000 0.200 0.736 0.064
#> SRR1652970     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652971     1  0.7269     0.2504 0.524 0.000 0.296 0.180
#> SRR1652972     3  0.3117     0.5230 0.092 0.000 0.880 0.028
#> SRR1652973     4  0.4382     0.4926 0.140 0.016 0.028 0.816
#> SRR1652974     1  0.0000     0.9184 1.000 0.000 0.000 0.000
#> SRR1652975     2  0.0592     0.8900 0.000 0.984 0.000 0.016
#> SRR1652976     3  0.7045     0.3725 0.000 0.328 0.532 0.140
#> SRR1652977     3  0.6658     0.3077 0.000 0.376 0.532 0.092

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     2  0.2077     0.8181 0.000 0.908 0.084 0.000 0.008
#> SRR1652897     1  0.2848     0.7748 0.840 0.000 0.000 0.156 0.004
#> SRR1652898     1  0.5780     0.5478 0.676 0.000 0.148 0.028 0.148
#> SRR1652899     1  0.0324     0.9145 0.992 0.000 0.000 0.004 0.004
#> SRR1652900     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652901     2  0.2677     0.7868 0.000 0.872 0.112 0.016 0.000
#> SRR1652902     1  0.1280     0.9021 0.960 0.000 0.024 0.008 0.008
#> SRR1652903     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.0798     0.8662 0.000 0.976 0.008 0.016 0.000
#> SRR1652906     1  0.1059     0.9056 0.968 0.000 0.020 0.004 0.008
#> SRR1652907     1  0.1200     0.9020 0.964 0.000 0.008 0.012 0.016
#> SRR1652908     2  0.0162     0.8714 0.000 0.996 0.000 0.004 0.000
#> SRR1652909     1  0.3315     0.8189 0.856 0.000 0.052 0.008 0.084
#> SRR1652910     1  0.0451     0.9141 0.988 0.000 0.000 0.004 0.008
#> SRR1652911     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652913     1  0.4262     0.1722 0.560 0.000 0.000 0.440 0.000
#> SRR1652914     2  0.5608    -0.0194 0.000 0.516 0.428 0.020 0.036
#> SRR1652915     5  0.6802     0.0210 0.032 0.036 0.408 0.048 0.476
#> SRR1652916     1  0.1830     0.8788 0.932 0.000 0.000 0.040 0.028
#> SRR1652917     2  0.7745    -0.1059 0.000 0.432 0.224 0.268 0.076
#> SRR1652918     2  0.0727     0.8676 0.000 0.980 0.004 0.012 0.004
#> SRR1652919     5  0.4754     0.4722 0.100 0.000 0.144 0.008 0.748
#> SRR1652920     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652921     4  0.3740     0.5274 0.196 0.000 0.008 0.784 0.012
#> SRR1652922     5  0.4207     0.5127 0.140 0.000 0.032 0.032 0.796
#> SRR1652923     2  0.5943    -0.0577 0.000 0.508 0.416 0.032 0.044
#> SRR1652924     2  0.5426    -0.1226 0.000 0.488 0.024 0.468 0.020
#> SRR1652925     2  0.0693     0.8659 0.000 0.980 0.008 0.012 0.000
#> SRR1652926     2  0.2297     0.8256 0.000 0.912 0.020 0.060 0.008
#> SRR1652927     1  0.0290     0.9131 0.992 0.000 0.000 0.008 0.000
#> SRR1652928     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.6667     0.4217 0.000 0.172 0.592 0.048 0.188
#> SRR1652930     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652931     5  0.4590     0.3049 0.000 0.016 0.272 0.016 0.696
#> SRR1652932     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     2  0.0912     0.8643 0.000 0.972 0.012 0.016 0.000
#> SRR1652934     3  0.7966     0.1904 0.000 0.148 0.396 0.324 0.132
#> SRR1652935     2  0.0671     0.8668 0.000 0.980 0.016 0.004 0.000
#> SRR1652936     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1  0.0162     0.9154 0.996 0.000 0.000 0.004 0.000
#> SRR1652938     2  0.5763     0.3875 0.000 0.628 0.032 0.280 0.060
#> SRR1652939     4  0.6799     0.1838 0.000 0.392 0.064 0.468 0.076
#> SRR1652940     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.8926     0.1905 0.024 0.260 0.332 0.216 0.168
#> SRR1652942     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     2  0.3489     0.7331 0.000 0.824 0.016 0.148 0.012
#> SRR1652944     3  0.5104     0.4273 0.000 0.324 0.632 0.016 0.028
#> SRR1652945     2  0.4245     0.5965 0.000 0.736 0.020 0.236 0.008
#> SRR1652946     4  0.2621     0.5630 0.112 0.000 0.004 0.876 0.008
#> SRR1652947     1  0.2930     0.7685 0.832 0.000 0.000 0.004 0.164
#> SRR1652948     2  0.2166     0.8229 0.000 0.912 0.072 0.004 0.012
#> SRR1652949     1  0.4233     0.7556 0.804 0.000 0.084 0.020 0.092
#> SRR1652950     3  0.2935     0.4352 0.004 0.000 0.860 0.016 0.120
#> SRR1652951     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652953     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     4  0.8799     0.2577 0.148 0.124 0.136 0.476 0.116
#> SRR1652955     3  0.5088     0.3460 0.064 0.000 0.720 0.024 0.192
#> SRR1652958     1  0.0727     0.9115 0.980 0.000 0.004 0.012 0.004
#> SRR1652956     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     4  0.3123     0.5451 0.184 0.000 0.000 0.812 0.004
#> SRR1652959     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652960     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652961     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     2  0.0000     0.8723 0.000 1.000 0.000 0.000 0.000
#> SRR1652965     5  0.4182     0.3270 0.400 0.000 0.000 0.000 0.600
#> SRR1652964     2  0.1662     0.8415 0.000 0.936 0.056 0.004 0.004
#> SRR1652966     1  0.4967     0.6572 0.736 0.000 0.076 0.020 0.168
#> SRR1652967     5  0.5109     0.3031 0.004 0.164 0.092 0.012 0.728
#> SRR1652969     4  0.5041     0.1946 0.000 0.428 0.020 0.544 0.008
#> SRR1652968     3  0.3924     0.5184 0.000 0.096 0.824 0.020 0.060
#> SRR1652970     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.4241     0.4831 0.264 0.000 0.008 0.012 0.716
#> SRR1652972     3  0.5262     0.3411 0.044 0.000 0.700 0.040 0.216
#> SRR1652973     4  0.3105     0.5283 0.056 0.012 0.016 0.884 0.032
#> SRR1652974     1  0.0000     0.9163 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.0510     0.8695 0.000 0.984 0.000 0.016 0.000
#> SRR1652976     5  0.7399    -0.1424 0.000 0.252 0.292 0.036 0.420
#> SRR1652977     3  0.5297     0.5054 0.000 0.204 0.704 0.056 0.036

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     2  0.3560     0.7162 0.000 0.820 0.096 0.004 0.008 0.072
#> SRR1652897     1  0.3754     0.6830 0.756 0.000 0.000 0.212 0.016 0.016
#> SRR1652898     1  0.5317     0.4696 0.612 0.000 0.288 0.012 0.080 0.008
#> SRR1652899     1  0.0520     0.8985 0.984 0.000 0.008 0.008 0.000 0.000
#> SRR1652900     2  0.0260     0.8348 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1652901     2  0.4051     0.6509 0.000 0.760 0.056 0.012 0.000 0.172
#> SRR1652902     1  0.1699     0.8804 0.936 0.000 0.040 0.012 0.004 0.008
#> SRR1652903     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.1946     0.8058 0.000 0.912 0.012 0.004 0.000 0.072
#> SRR1652906     1  0.1226     0.8881 0.952 0.000 0.040 0.004 0.004 0.000
#> SRR1652907     1  0.1440     0.8852 0.948 0.000 0.032 0.012 0.004 0.004
#> SRR1652908     2  0.0363     0.8347 0.000 0.988 0.000 0.000 0.000 0.012
#> SRR1652909     1  0.4987     0.6894 0.740 0.000 0.100 0.032 0.100 0.028
#> SRR1652910     1  0.1053     0.8927 0.964 0.000 0.020 0.012 0.000 0.004
#> SRR1652911     1  0.0146     0.8998 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652912     2  0.0146     0.8348 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652913     1  0.4165     0.1619 0.536 0.000 0.000 0.452 0.000 0.012
#> SRR1652914     2  0.6982    -0.2686 0.000 0.408 0.332 0.016 0.040 0.204
#> SRR1652915     3  0.7343     0.0160 0.032 0.028 0.404 0.028 0.372 0.136
#> SRR1652916     1  0.2956     0.8290 0.872 0.000 0.012 0.072 0.020 0.024
#> SRR1652917     6  0.7799     0.3444 0.000 0.272 0.116 0.148 0.048 0.416
#> SRR1652918     2  0.2279     0.7968 0.000 0.900 0.000 0.048 0.004 0.048
#> SRR1652919     5  0.4792     0.4411 0.044 0.000 0.188 0.004 0.716 0.048
#> SRR1652920     2  0.0000     0.8349 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652921     4  0.4186     0.4131 0.148 0.000 0.012 0.772 0.012 0.056
#> SRR1652922     5  0.2990     0.5181 0.052 0.000 0.020 0.008 0.872 0.048
#> SRR1652923     2  0.6938    -0.2439 0.000 0.420 0.316 0.016 0.036 0.212
#> SRR1652924     2  0.5921    -0.2033 0.000 0.432 0.000 0.400 0.008 0.160
#> SRR1652925     2  0.2209     0.7993 0.000 0.904 0.000 0.052 0.004 0.040
#> SRR1652926     2  0.3883     0.7004 0.000 0.788 0.004 0.052 0.012 0.144
#> SRR1652927     1  0.0405     0.8996 0.988 0.000 0.004 0.008 0.000 0.000
#> SRR1652928     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.6864     0.2880 0.000 0.160 0.552 0.016 0.140 0.132
#> SRR1652930     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652931     5  0.5151     0.3698 0.000 0.016 0.200 0.012 0.680 0.092
#> SRR1652932     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     2  0.1643     0.8105 0.000 0.924 0.008 0.000 0.000 0.068
#> SRR1652934     6  0.7370     0.2769 0.000 0.100 0.188 0.132 0.060 0.520
#> SRR1652935     2  0.1864     0.8119 0.000 0.924 0.032 0.000 0.004 0.040
#> SRR1652936     2  0.0000     0.8349 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.0260     0.8994 0.992 0.000 0.000 0.008 0.000 0.000
#> SRR1652938     2  0.6791     0.2122 0.000 0.552 0.020 0.172 0.080 0.176
#> SRR1652939     4  0.7413    -0.1373 0.000 0.296 0.028 0.388 0.056 0.232
#> SRR1652940     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     6  0.8608     0.2659 0.008 0.216 0.144 0.120 0.136 0.376
#> SRR1652942     2  0.0000     0.8349 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     2  0.4126     0.6597 0.000 0.764 0.000 0.116 0.008 0.112
#> SRR1652944     3  0.5455     0.1653 0.000 0.296 0.572 0.000 0.008 0.124
#> SRR1652945     2  0.5260     0.4709 0.000 0.660 0.004 0.192 0.016 0.128
#> SRR1652946     4  0.1367     0.4546 0.044 0.000 0.000 0.944 0.000 0.012
#> SRR1652947     1  0.3074     0.7144 0.792 0.000 0.004 0.004 0.200 0.000
#> SRR1652948     2  0.2448     0.7818 0.000 0.884 0.052 0.000 0.000 0.064
#> SRR1652949     1  0.4052     0.7412 0.780 0.000 0.144 0.012 0.056 0.008
#> SRR1652950     3  0.4293     0.4283 0.000 0.000 0.752 0.024 0.060 0.164
#> SRR1652951     2  0.0000     0.8349 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.8349 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     6  0.8577     0.0448 0.092 0.068 0.084 0.308 0.076 0.372
#> SRR1652955     3  0.3622     0.4249 0.072 0.000 0.820 0.008 0.092 0.008
#> SRR1652958     1  0.0862     0.8963 0.972 0.000 0.016 0.008 0.000 0.004
#> SRR1652956     2  0.0146     0.8348 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652957     4  0.3134     0.4355 0.144 0.000 0.000 0.820 0.000 0.036
#> SRR1652959     2  0.0653     0.8339 0.000 0.980 0.004 0.000 0.004 0.012
#> SRR1652960     2  0.0146     0.8348 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652961     2  0.0146     0.8348 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652962     2  0.0000     0.8349 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0405     0.8332 0.000 0.988 0.008 0.000 0.000 0.004
#> SRR1652965     5  0.3742     0.3685 0.348 0.000 0.004 0.000 0.648 0.000
#> SRR1652964     2  0.2639     0.7894 0.000 0.880 0.048 0.000 0.008 0.064
#> SRR1652966     1  0.4323     0.7318 0.772 0.000 0.084 0.008 0.116 0.020
#> SRR1652967     5  0.5097     0.3395 0.000 0.132 0.060 0.008 0.720 0.080
#> SRR1652969     4  0.6202    -0.0868 0.000 0.304 0.004 0.480 0.012 0.200
#> SRR1652968     3  0.5062     0.4082 0.000 0.084 0.688 0.004 0.028 0.196
#> SRR1652970     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.3420     0.4961 0.204 0.000 0.012 0.000 0.776 0.008
#> SRR1652972     3  0.4922     0.3923 0.048 0.000 0.744 0.016 0.096 0.096
#> SRR1652973     4  0.3768     0.3863 0.012 0.004 0.008 0.800 0.028 0.148
#> SRR1652974     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.1485     0.8217 0.000 0.944 0.000 0.028 0.004 0.024
#> SRR1652976     5  0.8127    -0.1941 0.000 0.220 0.252 0.028 0.316 0.184
#> SRR1652977     3  0.6395     0.1921 0.000 0.184 0.496 0.024 0.008 0.288

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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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.948           0.947       0.975         0.4362 0.547   0.547
#> 3 3 0.689           0.832       0.905         0.3341 0.820   0.686
#> 4 4 0.795           0.796       0.916         0.0448 0.996   0.989
#> 5 5 0.788           0.733       0.892         0.0457 1.000   1.000
#> 6 6 0.797           0.844       0.919         0.0507 0.876   0.708

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
#> SRR1652895     1  0.0000      0.927 1.000 0.000
#> SRR1652896     2  0.0000      0.997 0.000 1.000
#> SRR1652897     1  0.0000      0.927 1.000 0.000
#> SRR1652898     1  0.5408      0.848 0.876 0.124
#> SRR1652899     1  0.0672      0.924 0.992 0.008
#> SRR1652900     2  0.0000      0.997 0.000 1.000
#> SRR1652901     2  0.0000      0.997 0.000 1.000
#> SRR1652902     1  0.7883      0.732 0.764 0.236
#> SRR1652903     1  0.0000      0.927 1.000 0.000
#> SRR1652904     1  0.0000      0.927 1.000 0.000
#> SRR1652905     2  0.0000      0.997 0.000 1.000
#> SRR1652906     1  0.3733      0.886 0.928 0.072
#> SRR1652907     1  0.0000      0.927 1.000 0.000
#> SRR1652908     2  0.0000      0.997 0.000 1.000
#> SRR1652909     2  0.2778      0.947 0.048 0.952
#> SRR1652910     1  0.0000      0.927 1.000 0.000
#> SRR1652911     1  0.0000      0.927 1.000 0.000
#> SRR1652912     2  0.0000      0.997 0.000 1.000
#> SRR1652913     1  0.8267      0.695 0.740 0.260
#> SRR1652914     2  0.0000      0.997 0.000 1.000
#> SRR1652915     2  0.0000      0.997 0.000 1.000
#> SRR1652916     1  0.9427      0.520 0.640 0.360
#> SRR1652917     2  0.0000      0.997 0.000 1.000
#> SRR1652918     2  0.0000      0.997 0.000 1.000
#> SRR1652919     2  0.2043      0.965 0.032 0.968
#> SRR1652920     2  0.0000      0.997 0.000 1.000
#> SRR1652921     2  0.0000      0.997 0.000 1.000
#> SRR1652922     2  0.2603      0.952 0.044 0.956
#> SRR1652923     2  0.0000      0.997 0.000 1.000
#> SRR1652924     2  0.0000      0.997 0.000 1.000
#> SRR1652925     2  0.0000      0.997 0.000 1.000
#> SRR1652926     2  0.0000      0.997 0.000 1.000
#> SRR1652927     1  0.0000      0.927 1.000 0.000
#> SRR1652928     1  0.0000      0.927 1.000 0.000
#> SRR1652929     2  0.0000      0.997 0.000 1.000
#> SRR1652930     1  0.0000      0.927 1.000 0.000
#> SRR1652931     2  0.0000      0.997 0.000 1.000
#> SRR1652932     1  0.0000      0.927 1.000 0.000
#> SRR1652933     2  0.0000      0.997 0.000 1.000
#> SRR1652934     2  0.0000      0.997 0.000 1.000
#> SRR1652935     2  0.0000      0.997 0.000 1.000
#> SRR1652936     2  0.0000      0.997 0.000 1.000
#> SRR1652937     1  0.0000      0.927 1.000 0.000
#> SRR1652938     2  0.0000      0.997 0.000 1.000
#> SRR1652939     2  0.0000      0.997 0.000 1.000
#> SRR1652940     1  0.0000      0.927 1.000 0.000
#> SRR1652941     2  0.0000      0.997 0.000 1.000
#> SRR1652942     2  0.0000      0.997 0.000 1.000
#> SRR1652943     2  0.0000      0.997 0.000 1.000
#> SRR1652944     2  0.0000      0.997 0.000 1.000
#> SRR1652945     2  0.0000      0.997 0.000 1.000
#> SRR1652946     2  0.0000      0.997 0.000 1.000
#> SRR1652947     1  0.0000      0.927 1.000 0.000
#> SRR1652948     2  0.0000      0.997 0.000 1.000
#> SRR1652949     1  0.0000      0.927 1.000 0.000
#> SRR1652950     2  0.0000      0.997 0.000 1.000
#> SRR1652951     2  0.0000      0.997 0.000 1.000
#> SRR1652953     1  0.0000      0.927 1.000 0.000
#> SRR1652952     2  0.0000      0.997 0.000 1.000
#> SRR1652954     2  0.0000      0.997 0.000 1.000
#> SRR1652955     2  0.2043      0.965 0.032 0.968
#> SRR1652958     1  1.0000      0.130 0.504 0.496
#> SRR1652956     2  0.0000      0.997 0.000 1.000
#> SRR1652957     2  0.0000      0.997 0.000 1.000
#> SRR1652959     2  0.0000      0.997 0.000 1.000
#> SRR1652960     2  0.0000      0.997 0.000 1.000
#> SRR1652961     2  0.0000      0.997 0.000 1.000
#> SRR1652962     2  0.0000      0.997 0.000 1.000
#> SRR1652963     2  0.0000      0.997 0.000 1.000
#> SRR1652965     1  0.0000      0.927 1.000 0.000
#> SRR1652964     2  0.0000      0.997 0.000 1.000
#> SRR1652966     1  0.6887      0.794 0.816 0.184
#> SRR1652967     2  0.0000      0.997 0.000 1.000
#> SRR1652969     2  0.0000      0.997 0.000 1.000
#> SRR1652968     2  0.0000      0.997 0.000 1.000
#> SRR1652970     1  0.0000      0.927 1.000 0.000
#> SRR1652971     1  0.7376      0.767 0.792 0.208
#> SRR1652972     2  0.0000      0.997 0.000 1.000
#> SRR1652973     2  0.0000      0.997 0.000 1.000
#> SRR1652974     1  0.0000      0.927 1.000 0.000
#> SRR1652975     2  0.0000      0.997 0.000 1.000
#> SRR1652976     2  0.0000      0.997 0.000 1.000
#> SRR1652977     2  0.0000      0.997 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
#> SRR1652895     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652896     2  0.0747     0.9088 0.000 0.984 0.016
#> SRR1652897     3  0.4504     0.7400 0.196 0.000 0.804
#> SRR1652898     3  0.5576     0.8281 0.084 0.104 0.812
#> SRR1652899     3  0.4700     0.7571 0.180 0.008 0.812
#> SRR1652900     2  0.0892     0.9065 0.000 0.980 0.020
#> SRR1652901     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652902     3  0.4700     0.8359 0.008 0.180 0.812
#> SRR1652903     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652905     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652906     3  0.4897     0.7655 0.172 0.016 0.812
#> SRR1652907     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652908     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652909     3  0.4808     0.8320 0.008 0.188 0.804
#> SRR1652910     3  0.4399     0.7468 0.188 0.000 0.812
#> SRR1652911     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652912     2  0.4291     0.7948 0.000 0.820 0.180
#> SRR1652913     3  0.5931     0.8125 0.124 0.084 0.792
#> SRR1652914     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652915     2  0.5810     0.3465 0.000 0.664 0.336
#> SRR1652916     3  0.4700     0.8359 0.008 0.180 0.812
#> SRR1652917     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652918     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652919     3  0.4700     0.8359 0.008 0.180 0.812
#> SRR1652920     2  0.4291     0.7948 0.000 0.820 0.180
#> SRR1652921     3  0.4702     0.8155 0.000 0.212 0.788
#> SRR1652922     3  0.6513     0.5316 0.008 0.400 0.592
#> SRR1652923     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652924     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652925     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652926     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652927     3  0.5138     0.6752 0.252 0.000 0.748
#> SRR1652928     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652929     2  0.1411     0.8861 0.000 0.964 0.036
#> SRR1652930     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652931     2  0.0592     0.9075 0.000 0.988 0.012
#> SRR1652932     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652933     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652934     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652935     2  0.0424     0.9128 0.000 0.992 0.008
#> SRR1652936     2  0.4291     0.7948 0.000 0.820 0.180
#> SRR1652937     1  0.1289     0.9357 0.968 0.000 0.032
#> SRR1652938     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652939     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652940     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652941     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652942     2  0.4291     0.7948 0.000 0.820 0.180
#> SRR1652943     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652944     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652945     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652946     2  0.6244    -0.0437 0.000 0.560 0.440
#> SRR1652947     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652948     2  0.1411     0.8967 0.000 0.964 0.036
#> SRR1652949     3  0.4399     0.7468 0.188 0.000 0.812
#> SRR1652950     2  0.5591     0.4359 0.000 0.696 0.304
#> SRR1652951     2  0.4291     0.7948 0.000 0.820 0.180
#> SRR1652953     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652952     2  0.4291     0.7948 0.000 0.820 0.180
#> SRR1652954     2  0.6305    -0.2152 0.000 0.516 0.484
#> SRR1652955     3  0.4700     0.8359 0.008 0.180 0.812
#> SRR1652958     3  0.5330     0.8364 0.044 0.144 0.812
#> SRR1652956     2  0.4291     0.7948 0.000 0.820 0.180
#> SRR1652957     3  0.6026     0.5860 0.000 0.376 0.624
#> SRR1652959     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652960     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652961     2  0.3879     0.8157 0.000 0.848 0.152
#> SRR1652962     2  0.4291     0.7948 0.000 0.820 0.180
#> SRR1652963     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652965     1  0.0237     0.9638 0.996 0.000 0.004
#> SRR1652964     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652966     3  0.5585     0.8250 0.092 0.096 0.812
#> SRR1652967     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652969     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652968     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652970     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652971     1  0.8763     0.3118 0.588 0.196 0.216
#> SRR1652972     3  0.5216     0.7736 0.000 0.260 0.740
#> SRR1652973     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652974     1  0.0000     0.9670 1.000 0.000 0.000
#> SRR1652975     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652976     2  0.0000     0.9163 0.000 1.000 0.000
#> SRR1652977     2  0.0000     0.9163 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
#> SRR1652895     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652896     2  0.0592     0.8762 0.000 0.984 0.000 0.016
#> SRR1652897     3  0.2408     0.7829 0.104 0.000 0.896 0.000
#> SRR1652898     3  0.2300     0.8193 0.048 0.028 0.924 0.000
#> SRR1652899     3  0.1940     0.8005 0.076 0.000 0.924 0.000
#> SRR1652900     2  0.0921     0.8681 0.000 0.972 0.000 0.028
#> SRR1652901     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652902     3  0.2053     0.8183 0.004 0.072 0.924 0.000
#> SRR1652903     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652906     3  0.2053     0.8043 0.072 0.004 0.924 0.000
#> SRR1652907     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652908     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652909     3  0.2197     0.8130 0.004 0.080 0.916 0.000
#> SRR1652910     3  0.1940     0.8005 0.076 0.000 0.924 0.000
#> SRR1652911     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.4164     0.6513 0.000 0.736 0.000 0.264
#> SRR1652913     3  0.4224     0.7656 0.100 0.076 0.824 0.000
#> SRR1652914     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652915     2  0.4624     0.3305 0.000 0.660 0.340 0.000
#> SRR1652916     3  0.2053     0.8183 0.004 0.072 0.924 0.000
#> SRR1652917     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652918     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652919     3  0.2125     0.8160 0.004 0.076 0.920 0.000
#> SRR1652920     2  0.4164     0.6513 0.000 0.736 0.000 0.264
#> SRR1652921     3  0.3610     0.6564 0.000 0.200 0.800 0.000
#> SRR1652922     3  0.4855     0.2595 0.000 0.400 0.600 0.000
#> SRR1652923     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652924     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652925     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652926     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652927     3  0.2973     0.7311 0.144 0.000 0.856 0.000
#> SRR1652928     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652929     2  0.1118     0.8521 0.000 0.964 0.036 0.000
#> SRR1652930     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652931     2  0.0469     0.8751 0.000 0.988 0.012 0.000
#> SRR1652932     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652933     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652934     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652935     2  0.0336     0.8807 0.000 0.992 0.000 0.008
#> SRR1652936     2  0.4164     0.6513 0.000 0.736 0.000 0.264
#> SRR1652937     1  0.1022     0.9493 0.968 0.000 0.032 0.000
#> SRR1652938     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652939     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652940     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652941     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652942     2  0.4164     0.6513 0.000 0.736 0.000 0.264
#> SRR1652943     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652944     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652945     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652946     2  0.4955     0.0427 0.000 0.556 0.444 0.000
#> SRR1652947     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652948     2  0.1211     0.8587 0.000 0.960 0.000 0.040
#> SRR1652949     3  0.1940     0.8005 0.076 0.000 0.924 0.000
#> SRR1652950     2  0.4454     0.4029 0.000 0.692 0.308 0.000
#> SRR1652951     2  0.4164     0.6513 0.000 0.736 0.000 0.264
#> SRR1652953     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.4164     0.6513 0.000 0.736 0.000 0.264
#> SRR1652954     2  0.4998    -0.1346 0.000 0.512 0.488 0.000
#> SRR1652955     3  0.2053     0.8183 0.004 0.072 0.924 0.000
#> SRR1652958     3  0.2300     0.8221 0.028 0.048 0.924 0.000
#> SRR1652956     2  0.4164     0.6513 0.000 0.736 0.000 0.264
#> SRR1652957     3  0.4730     0.3357 0.000 0.364 0.636 0.000
#> SRR1652959     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.3907     0.6858 0.000 0.768 0.000 0.232
#> SRR1652962     2  0.4164     0.6513 0.000 0.736 0.000 0.264
#> SRR1652963     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652965     1  0.2266     0.9006 0.912 0.000 0.084 0.004
#> SRR1652964     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652966     3  0.2282     0.8177 0.052 0.024 0.924 0.000
#> SRR1652967     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652969     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652968     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652970     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652971     4  0.5922     0.0000 0.032 0.168 0.068 0.732
#> SRR1652972     3  0.3726     0.6313 0.000 0.212 0.788 0.000
#> SRR1652973     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652974     1  0.0000     0.9901 1.000 0.000 0.000 0.000
#> SRR1652975     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652976     2  0.0000     0.8848 0.000 1.000 0.000 0.000
#> SRR1652977     2  0.0000     0.8848 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
#> SRR1652895     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652896     2  0.0510     0.8315 0.000 0.984 0.000 NA 0.000
#> SRR1652897     3  0.1732     0.8094 0.080 0.000 0.920 NA 0.000
#> SRR1652898     3  0.1281     0.8370 0.032 0.012 0.956 NA 0.000
#> SRR1652899     3  0.1121     0.8301 0.044 0.000 0.956 NA 0.000
#> SRR1652900     2  0.0794     0.8229 0.000 0.972 0.000 NA 0.000
#> SRR1652901     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652902     3  0.1121     0.8383 0.000 0.044 0.956 NA 0.000
#> SRR1652903     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652904     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652905     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652906     3  0.1121     0.8301 0.044 0.000 0.956 NA 0.000
#> SRR1652907     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652908     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652909     3  0.1341     0.8316 0.000 0.056 0.944 NA 0.000
#> SRR1652910     3  0.1121     0.8301 0.044 0.000 0.956 NA 0.000
#> SRR1652911     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652912     2  0.4300     0.3360 0.000 0.524 0.000 NA 0.000
#> SRR1652913     3  0.3410     0.7704 0.092 0.068 0.840 NA 0.000
#> SRR1652914     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652915     2  0.3999     0.3829 0.000 0.656 0.344 NA 0.000
#> SRR1652916     3  0.1121     0.8383 0.000 0.044 0.956 NA 0.000
#> SRR1652917     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652918     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652919     3  0.1270     0.8343 0.000 0.052 0.948 NA 0.000
#> SRR1652920     2  0.4300     0.3360 0.000 0.524 0.000 NA 0.000
#> SRR1652921     3  0.3074     0.6610 0.000 0.196 0.804 NA 0.000
#> SRR1652922     3  0.6519     0.0110 0.000 0.400 0.408 NA 0.000
#> SRR1652923     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652924     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652925     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652926     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652927     3  0.2179     0.7690 0.112 0.000 0.888 NA 0.000
#> SRR1652928     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652929     2  0.1043     0.8065 0.000 0.960 0.040 NA 0.000
#> SRR1652930     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652931     2  0.0404     0.8323 0.000 0.988 0.012 NA 0.000
#> SRR1652932     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652933     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652934     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652935     2  0.0290     0.8363 0.000 0.992 0.000 NA 0.000
#> SRR1652936     2  0.4300     0.3360 0.000 0.524 0.000 NA 0.000
#> SRR1652937     1  0.0880     0.9203 0.968 0.000 0.032 NA 0.000
#> SRR1652938     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652939     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652940     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652941     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652942     2  0.4300     0.3360 0.000 0.524 0.000 NA 0.000
#> SRR1652943     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652944     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652945     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652946     2  0.4273     0.0901 0.000 0.552 0.448 NA 0.000
#> SRR1652947     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652948     2  0.1043     0.8133 0.000 0.960 0.000 NA 0.000
#> SRR1652949     3  0.1121     0.8301 0.044 0.000 0.956 NA 0.000
#> SRR1652950     2  0.3857     0.4404 0.000 0.688 0.312 NA 0.000
#> SRR1652951     2  0.4300     0.3360 0.000 0.524 0.000 NA 0.000
#> SRR1652953     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652952     2  0.4300     0.3360 0.000 0.524 0.000 NA 0.000
#> SRR1652954     2  0.4307    -0.0929 0.000 0.504 0.496 NA 0.000
#> SRR1652955     3  0.1121     0.8383 0.000 0.044 0.956 NA 0.000
#> SRR1652958     3  0.1281     0.8398 0.012 0.032 0.956 NA 0.000
#> SRR1652956     2  0.4300     0.3360 0.000 0.524 0.000 NA 0.000
#> SRR1652957     3  0.4060     0.3646 0.000 0.360 0.640 NA 0.000
#> SRR1652959     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652960     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652961     2  0.4268     0.3791 0.000 0.556 0.000 NA 0.000
#> SRR1652962     2  0.4300     0.3360 0.000 0.524 0.000 NA 0.000
#> SRR1652963     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652965     1  0.7109     0.1511 0.472 0.000 0.044 NA 0.152
#> SRR1652964     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652966     3  0.1251     0.8353 0.036 0.008 0.956 NA 0.000
#> SRR1652967     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652969     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652968     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652970     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652971     5  0.3099     0.0000 0.000 0.124 0.028 NA 0.848
#> SRR1652972     3  0.3109     0.6505 0.000 0.200 0.800 NA 0.000
#> SRR1652973     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652974     1  0.0000     0.9600 1.000 0.000 0.000 NA 0.000
#> SRR1652975     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652976     2  0.0000     0.8407 0.000 1.000 0.000 NA 0.000
#> SRR1652977     2  0.0000     0.8407 0.000 1.000 0.000 NA 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
#> SRR1652895     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652896     4  0.0458     0.8916 0.000 0.016 0.000 0.984 0.00  0
#> SRR1652897     3  0.1141     0.8675 0.052 0.000 0.948 0.000 0.00  0
#> SRR1652898     3  0.0146     0.8997 0.004 0.000 0.996 0.000 0.00  0
#> SRR1652899     3  0.0146     0.8997 0.004 0.000 0.996 0.000 0.00  0
#> SRR1652900     4  0.0713     0.8761 0.000 0.028 0.000 0.972 0.00  0
#> SRR1652901     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652902     3  0.0146     0.9002 0.000 0.000 0.996 0.004 0.00  0
#> SRR1652903     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652904     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652905     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652906     3  0.0146     0.8997 0.004 0.000 0.996 0.000 0.00  0
#> SRR1652907     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652908     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652909     3  0.0632     0.8886 0.000 0.000 0.976 0.024 0.00  0
#> SRR1652910     3  0.0146     0.8997 0.004 0.000 0.996 0.000 0.00  0
#> SRR1652911     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652912     2  0.3390     0.9904 0.000 0.704 0.000 0.296 0.00  0
#> SRR1652913     3  0.3013     0.7840 0.088 0.000 0.844 0.068 0.00  0
#> SRR1652914     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652915     4  0.3592     0.3699 0.000 0.000 0.344 0.656 0.00  0
#> SRR1652916     3  0.0146     0.9002 0.000 0.000 0.996 0.004 0.00  0
#> SRR1652917     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652918     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652919     3  0.0458     0.8944 0.000 0.000 0.984 0.016 0.00  0
#> SRR1652920     2  0.3390     0.9904 0.000 0.704 0.000 0.296 0.00  0
#> SRR1652921     3  0.2697     0.6875 0.000 0.000 0.812 0.188 0.00  0
#> SRR1652922     4  0.6589    -0.2771 0.000 0.288 0.024 0.368 0.32  0
#> SRR1652923     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652924     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652925     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652926     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652927     3  0.1501     0.8340 0.076 0.000 0.924 0.000 0.00  0
#> SRR1652928     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652929     4  0.0937     0.8620 0.000 0.000 0.040 0.960 0.00  0
#> SRR1652930     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652931     4  0.0363     0.8964 0.000 0.000 0.012 0.988 0.00  0
#> SRR1652932     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652933     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652934     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652935     4  0.0260     0.9002 0.000 0.008 0.000 0.992 0.00  0
#> SRR1652936     2  0.3390     0.9904 0.000 0.704 0.000 0.296 0.00  0
#> SRR1652937     1  0.0790     0.9290 0.968 0.000 0.032 0.000 0.00  0
#> SRR1652938     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652939     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652940     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652941     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652942     2  0.3390     0.9904 0.000 0.704 0.000 0.296 0.00  0
#> SRR1652943     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652944     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652945     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652946     4  0.3838     0.1611 0.000 0.000 0.448 0.552 0.00  0
#> SRR1652947     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652948     4  0.0937     0.8591 0.000 0.040 0.000 0.960 0.00  0
#> SRR1652949     3  0.0146     0.8997 0.004 0.000 0.996 0.000 0.00  0
#> SRR1652950     4  0.3464     0.4263 0.000 0.000 0.312 0.688 0.00  0
#> SRR1652951     2  0.3390     0.9904 0.000 0.704 0.000 0.296 0.00  0
#> SRR1652953     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652952     2  0.3390     0.9904 0.000 0.704 0.000 0.296 0.00  0
#> SRR1652954     4  0.3868    -0.0161 0.000 0.000 0.496 0.504 0.00  0
#> SRR1652955     3  0.0146     0.9002 0.000 0.000 0.996 0.004 0.00  0
#> SRR1652958     3  0.0146     0.9002 0.000 0.000 0.996 0.004 0.00  0
#> SRR1652956     2  0.3390     0.9904 0.000 0.704 0.000 0.296 0.00  0
#> SRR1652957     3  0.3647     0.4025 0.000 0.000 0.640 0.360 0.00  0
#> SRR1652959     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652960     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652961     2  0.3563     0.9239 0.000 0.664 0.000 0.336 0.00  0
#> SRR1652962     2  0.3390     0.9904 0.000 0.704 0.000 0.296 0.00  0
#> SRR1652963     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652965     5  0.3499     0.0000 0.320 0.000 0.000 0.000 0.68  0
#> SRR1652964     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652966     3  0.0146     0.8997 0.004 0.000 0.996 0.000 0.00  0
#> SRR1652967     4  0.0260     0.9013 0.000 0.008 0.000 0.992 0.00  0
#> SRR1652969     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652968     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652970     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652971     6  0.0000     0.0000 0.000 0.000 0.000 0.000 0.00  1
#> SRR1652972     3  0.2631     0.6960 0.000 0.000 0.820 0.180 0.00  0
#> SRR1652973     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652974     1  0.0000     0.9947 1.000 0.000 0.000 0.000 0.00  0
#> SRR1652975     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652976     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0
#> SRR1652977     4  0.0000     0.9080 0.000 0.000 0.000 1.000 0.00  0

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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.900           0.922       0.969          0.223 0.785   0.785
#> 3 3 0.351           0.642       0.784          1.032 0.906   0.881
#> 4 4 0.349           0.525       0.721          0.327 0.632   0.495
#> 5 5 0.393           0.603       0.693          0.156 0.835   0.594
#> 6 6 0.611           0.469       0.685          0.135 0.809   0.408

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
#> SRR1652895     2  0.0000     0.9756 0.000 1.000
#> SRR1652896     1  0.6531     0.8218 0.832 0.168
#> SRR1652897     2  0.0376     0.9726 0.004 0.996
#> SRR1652898     2  0.0938     0.9661 0.012 0.988
#> SRR1652899     2  0.0672     0.9696 0.008 0.992
#> SRR1652900     2  0.0000     0.9756 0.000 1.000
#> SRR1652901     2  0.0000     0.9756 0.000 1.000
#> SRR1652902     2  0.0000     0.9756 0.000 1.000
#> SRR1652903     2  0.0000     0.9756 0.000 1.000
#> SRR1652904     2  0.0000     0.9756 0.000 1.000
#> SRR1652905     2  0.5519     0.8342 0.128 0.872
#> SRR1652906     2  0.0000     0.9756 0.000 1.000
#> SRR1652907     2  0.5178     0.8501 0.116 0.884
#> SRR1652908     2  0.0000     0.9756 0.000 1.000
#> SRR1652909     2  0.0000     0.9756 0.000 1.000
#> SRR1652910     2  0.0000     0.9756 0.000 1.000
#> SRR1652911     2  0.0000     0.9756 0.000 1.000
#> SRR1652912     2  0.0000     0.9756 0.000 1.000
#> SRR1652913     2  0.0000     0.9756 0.000 1.000
#> SRR1652914     2  0.0000     0.9756 0.000 1.000
#> SRR1652915     2  0.6148     0.7998 0.152 0.848
#> SRR1652916     2  0.0000     0.9756 0.000 1.000
#> SRR1652917     2  0.1414     0.9586 0.020 0.980
#> SRR1652918     2  0.0672     0.9695 0.008 0.992
#> SRR1652919     1  0.2948     0.8747 0.948 0.052
#> SRR1652920     2  0.0000     0.9756 0.000 1.000
#> SRR1652921     2  0.0376     0.9727 0.004 0.996
#> SRR1652922     1  0.0000     0.8820 1.000 0.000
#> SRR1652923     2  0.0376     0.9726 0.004 0.996
#> SRR1652924     2  0.0000     0.9756 0.000 1.000
#> SRR1652925     2  0.0000     0.9756 0.000 1.000
#> SRR1652926     2  0.0000     0.9756 0.000 1.000
#> SRR1652927     2  0.0000     0.9756 0.000 1.000
#> SRR1652928     2  0.0000     0.9756 0.000 1.000
#> SRR1652929     2  0.0376     0.9727 0.004 0.996
#> SRR1652930     2  0.0000     0.9756 0.000 1.000
#> SRR1652931     1  0.6438     0.8254 0.836 0.164
#> SRR1652932     2  0.0000     0.9756 0.000 1.000
#> SRR1652933     2  0.0000     0.9756 0.000 1.000
#> SRR1652934     2  0.0000     0.9756 0.000 1.000
#> SRR1652935     2  0.9970    -0.0447 0.468 0.532
#> SRR1652936     2  0.0000     0.9756 0.000 1.000
#> SRR1652937     2  0.0000     0.9756 0.000 1.000
#> SRR1652938     2  0.9977    -0.0601 0.472 0.528
#> SRR1652939     2  0.0000     0.9756 0.000 1.000
#> SRR1652940     2  0.0000     0.9756 0.000 1.000
#> SRR1652941     2  0.0000     0.9756 0.000 1.000
#> SRR1652942     2  0.0000     0.9756 0.000 1.000
#> SRR1652943     2  0.0000     0.9756 0.000 1.000
#> SRR1652944     2  0.0000     0.9756 0.000 1.000
#> SRR1652945     2  0.0938     0.9659 0.012 0.988
#> SRR1652946     2  0.0000     0.9756 0.000 1.000
#> SRR1652947     1  0.0000     0.8820 1.000 0.000
#> SRR1652948     1  0.9922     0.2679 0.552 0.448
#> SRR1652949     2  0.2603     0.9342 0.044 0.956
#> SRR1652950     2  0.0000     0.9756 0.000 1.000
#> SRR1652951     2  0.0000     0.9756 0.000 1.000
#> SRR1652953     2  0.0000     0.9756 0.000 1.000
#> SRR1652952     2  0.0000     0.9756 0.000 1.000
#> SRR1652954     2  0.0000     0.9756 0.000 1.000
#> SRR1652955     2  0.1414     0.9586 0.020 0.980
#> SRR1652958     2  0.0000     0.9756 0.000 1.000
#> SRR1652956     2  0.0000     0.9756 0.000 1.000
#> SRR1652957     2  0.0000     0.9756 0.000 1.000
#> SRR1652959     2  0.0000     0.9756 0.000 1.000
#> SRR1652960     2  0.0000     0.9756 0.000 1.000
#> SRR1652961     2  0.0000     0.9756 0.000 1.000
#> SRR1652962     2  0.0000     0.9756 0.000 1.000
#> SRR1652963     2  0.0000     0.9756 0.000 1.000
#> SRR1652965     1  0.0000     0.8820 1.000 0.000
#> SRR1652964     2  0.0000     0.9756 0.000 1.000
#> SRR1652966     2  0.4298     0.8853 0.088 0.912
#> SRR1652967     1  0.0000     0.8820 1.000 0.000
#> SRR1652969     2  0.0000     0.9756 0.000 1.000
#> SRR1652968     2  0.0000     0.9756 0.000 1.000
#> SRR1652970     2  0.0000     0.9756 0.000 1.000
#> SRR1652971     1  0.0000     0.8820 1.000 0.000
#> SRR1652972     2  0.0000     0.9756 0.000 1.000
#> SRR1652973     2  0.0000     0.9756 0.000 1.000
#> SRR1652974     2  0.0000     0.9756 0.000 1.000
#> SRR1652975     2  0.0000     0.9756 0.000 1.000
#> SRR1652976     1  0.6887     0.8053 0.816 0.184
#> SRR1652977     2  0.0000     0.9756 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
#> SRR1652895     2  0.4504      0.722 0.000 0.804 0.196
#> SRR1652896     3  0.5797      0.560 0.280 0.008 0.712
#> SRR1652897     2  0.1643      0.719 0.000 0.956 0.044
#> SRR1652898     2  0.6252      0.439 0.000 0.556 0.444
#> SRR1652899     2  0.4733      0.720 0.004 0.800 0.196
#> SRR1652900     2  0.5291      0.565 0.000 0.732 0.268
#> SRR1652901     2  0.1964      0.728 0.000 0.944 0.056
#> SRR1652902     2  0.4346      0.727 0.000 0.816 0.184
#> SRR1652903     2  0.4504      0.722 0.000 0.804 0.196
#> SRR1652904     2  0.4504      0.722 0.000 0.804 0.196
#> SRR1652905     3  0.8179      0.542 0.152 0.208 0.640
#> SRR1652906     2  0.4121      0.730 0.000 0.832 0.168
#> SRR1652907     2  0.6654      0.402 0.008 0.536 0.456
#> SRR1652908     2  0.5138      0.584 0.000 0.748 0.252
#> SRR1652909     2  0.4178      0.730 0.000 0.828 0.172
#> SRR1652910     2  0.4121      0.730 0.000 0.832 0.168
#> SRR1652911     2  0.4452      0.724 0.000 0.808 0.192
#> SRR1652912     2  0.5560      0.526 0.000 0.700 0.300
#> SRR1652913     2  0.0000      0.725 0.000 1.000 0.000
#> SRR1652914     2  0.5859      0.629 0.000 0.656 0.344
#> SRR1652915     3  0.8203      0.344 0.116 0.268 0.616
#> SRR1652916     2  0.4002      0.731 0.000 0.840 0.160
#> SRR1652917     2  0.2096      0.718 0.004 0.944 0.052
#> SRR1652918     2  0.5722      0.478 0.004 0.704 0.292
#> SRR1652919     3  0.5785      0.472 0.332 0.000 0.668
#> SRR1652920     2  0.5560      0.526 0.000 0.700 0.300
#> SRR1652921     2  0.0747      0.727 0.000 0.984 0.016
#> SRR1652922     1  0.0000      1.000 1.000 0.000 0.000
#> SRR1652923     2  0.6189      0.528 0.004 0.632 0.364
#> SRR1652924     2  0.1411      0.717 0.000 0.964 0.036
#> SRR1652925     2  0.4504      0.616 0.000 0.804 0.196
#> SRR1652926     2  0.3038      0.695 0.000 0.896 0.104
#> SRR1652927     2  0.4235      0.729 0.000 0.824 0.176
#> SRR1652928     2  0.4504      0.722 0.000 0.804 0.196
#> SRR1652929     2  0.6804      0.420 0.012 0.528 0.460
#> SRR1652930     2  0.4346      0.727 0.000 0.816 0.184
#> SRR1652931     3  0.5988      0.532 0.304 0.008 0.688
#> SRR1652932     2  0.4504      0.722 0.000 0.804 0.196
#> SRR1652933     2  0.2261      0.711 0.000 0.932 0.068
#> SRR1652934     2  0.3879      0.735 0.000 0.848 0.152
#> SRR1652935     3  0.6229      0.616 0.172 0.064 0.764
#> SRR1652936     2  0.5591      0.520 0.000 0.696 0.304
#> SRR1652937     2  0.4399      0.725 0.000 0.812 0.188
#> SRR1652938     3  0.6816      0.144 0.012 0.472 0.516
#> SRR1652939     2  0.1964      0.711 0.000 0.944 0.056
#> SRR1652940     2  0.4504      0.722 0.000 0.804 0.196
#> SRR1652941     2  0.4178      0.736 0.000 0.828 0.172
#> SRR1652942     2  0.5560      0.524 0.000 0.700 0.300
#> SRR1652943     2  0.4974      0.576 0.000 0.764 0.236
#> SRR1652944     2  0.6819      0.407 0.012 0.512 0.476
#> SRR1652945     2  0.5058      0.565 0.000 0.756 0.244
#> SRR1652946     2  0.2625      0.697 0.000 0.916 0.084
#> SRR1652947     1  0.0000      1.000 1.000 0.000 0.000
#> SRR1652948     3  0.6400      0.615 0.208 0.052 0.740
#> SRR1652949     2  0.6489      0.409 0.004 0.540 0.456
#> SRR1652950     2  0.4452      0.729 0.000 0.808 0.192
#> SRR1652951     2  0.5591      0.520 0.000 0.696 0.304
#> SRR1652953     2  0.4504      0.722 0.000 0.804 0.196
#> SRR1652952     2  0.5591      0.520 0.000 0.696 0.304
#> SRR1652954     2  0.2356      0.735 0.000 0.928 0.072
#> SRR1652955     2  0.6489      0.409 0.004 0.540 0.456
#> SRR1652958     2  0.4002      0.731 0.000 0.840 0.160
#> SRR1652956     2  0.5591      0.520 0.000 0.696 0.304
#> SRR1652957     2  0.0237      0.724 0.000 0.996 0.004
#> SRR1652959     2  0.4750      0.613 0.000 0.784 0.216
#> SRR1652960     2  0.5058      0.593 0.000 0.756 0.244
#> SRR1652961     2  0.5178      0.580 0.000 0.744 0.256
#> SRR1652962     2  0.5591      0.520 0.000 0.696 0.304
#> SRR1652963     2  0.5138      0.582 0.000 0.748 0.252
#> SRR1652965     1  0.0000      1.000 1.000 0.000 0.000
#> SRR1652964     2  0.3038      0.698 0.000 0.896 0.104
#> SRR1652966     2  0.6919      0.403 0.016 0.536 0.448
#> SRR1652967     1  0.0000      1.000 1.000 0.000 0.000
#> SRR1652969     2  0.1753      0.715 0.000 0.952 0.048
#> SRR1652968     2  0.6398      0.511 0.008 0.620 0.372
#> SRR1652970     2  0.4504      0.722 0.000 0.804 0.196
#> SRR1652971     1  0.0000      1.000 1.000 0.000 0.000
#> SRR1652972     2  0.5431      0.665 0.000 0.716 0.284
#> SRR1652973     2  0.1411      0.718 0.000 0.964 0.036
#> SRR1652974     2  0.4399      0.725 0.000 0.812 0.188
#> SRR1652975     2  0.4235      0.636 0.000 0.824 0.176
#> SRR1652976     3  0.5650      0.505 0.312 0.000 0.688
#> SRR1652977     2  0.4062      0.735 0.000 0.836 0.164

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.3925     0.5093 0.808 0.176 0.016 0.000
#> SRR1652896     3  0.2074     0.6418 0.016 0.012 0.940 0.032
#> SRR1652897     1  0.5004     0.2996 0.604 0.392 0.000 0.004
#> SRR1652898     3  0.4304     0.7135 0.284 0.000 0.716 0.000
#> SRR1652899     1  0.4646     0.4973 0.796 0.120 0.084 0.000
#> SRR1652900     2  0.6417     0.7472 0.388 0.540 0.072 0.000
#> SRR1652901     1  0.5063     0.4397 0.768 0.124 0.108 0.000
#> SRR1652902     1  0.0707     0.5734 0.980 0.000 0.020 0.000
#> SRR1652903     1  0.3881     0.5117 0.812 0.172 0.016 0.000
#> SRR1652904     1  0.3925     0.5093 0.808 0.176 0.016 0.000
#> SRR1652905     3  0.5554     0.5429 0.056 0.204 0.728 0.012
#> SRR1652906     1  0.0469     0.5762 0.988 0.000 0.012 0.000
#> SRR1652907     3  0.4222     0.7146 0.272 0.000 0.728 0.000
#> SRR1652908     2  0.6727     0.7135 0.412 0.496 0.092 0.000
#> SRR1652909     1  0.1824     0.5575 0.936 0.004 0.060 0.000
#> SRR1652910     1  0.0336     0.5783 0.992 0.000 0.008 0.000
#> SRR1652911     1  0.2473     0.5656 0.908 0.080 0.012 0.000
#> SRR1652912     2  0.6005     0.7982 0.324 0.616 0.060 0.000
#> SRR1652913     1  0.4872     0.3380 0.640 0.356 0.000 0.004
#> SRR1652914     3  0.5268     0.4617 0.452 0.008 0.540 0.000
#> SRR1652915     3  0.2334     0.6943 0.088 0.004 0.908 0.000
#> SRR1652916     1  0.1356     0.5782 0.960 0.032 0.008 0.000
#> SRR1652917     1  0.5943     0.2918 0.656 0.280 0.060 0.004
#> SRR1652918     1  0.5163     0.0260 0.516 0.480 0.000 0.004
#> SRR1652919     3  0.1821     0.6411 0.012 0.008 0.948 0.032
#> SRR1652920     2  0.5980     0.6937 0.396 0.560 0.044 0.000
#> SRR1652921     1  0.4699     0.3226 0.676 0.320 0.000 0.004
#> SRR1652922     4  0.0336     0.9956 0.000 0.000 0.008 0.992
#> SRR1652923     3  0.4961     0.6062 0.448 0.000 0.552 0.000
#> SRR1652924     1  0.5134     0.2920 0.664 0.320 0.012 0.004
#> SRR1652925     1  0.4872     0.2738 0.640 0.356 0.000 0.004
#> SRR1652926     1  0.5713     0.2529 0.640 0.320 0.036 0.004
#> SRR1652927     1  0.0000     0.5794 1.000 0.000 0.000 0.000
#> SRR1652928     1  0.3836     0.5146 0.816 0.168 0.016 0.000
#> SRR1652929     3  0.4920     0.6533 0.368 0.004 0.628 0.000
#> SRR1652930     1  0.2466     0.5703 0.900 0.096 0.004 0.000
#> SRR1652931     3  0.1843     0.6450 0.016 0.008 0.948 0.028
#> SRR1652932     1  0.3925     0.5093 0.808 0.176 0.016 0.000
#> SRR1652933     1  0.6377     0.1416 0.632 0.256 0.112 0.000
#> SRR1652934     1  0.4036     0.5122 0.836 0.076 0.088 0.000
#> SRR1652935     3  0.4760     0.5715 0.028 0.172 0.784 0.016
#> SRR1652936     2  0.6356     0.8107 0.320 0.596 0.084 0.000
#> SRR1652937     1  0.0707     0.5790 0.980 0.020 0.000 0.000
#> SRR1652938     2  0.5974     0.0551 0.332 0.624 0.020 0.024
#> SRR1652939     1  0.5112     0.2615 0.648 0.340 0.008 0.004
#> SRR1652940     1  0.3925     0.5093 0.808 0.176 0.016 0.000
#> SRR1652941     1  0.4292     0.4882 0.820 0.080 0.100 0.000
#> SRR1652942     2  0.7198     0.7692 0.320 0.520 0.160 0.000
#> SRR1652943     1  0.5155     0.0847 0.528 0.468 0.000 0.004
#> SRR1652944     3  0.4991     0.6515 0.388 0.004 0.608 0.000
#> SRR1652945     1  0.5161     0.0894 0.520 0.476 0.000 0.004
#> SRR1652946     1  0.4964     0.2908 0.616 0.380 0.000 0.004
#> SRR1652947     4  0.0188     0.9966 0.000 0.000 0.004 0.996
#> SRR1652948     3  0.2107     0.6462 0.016 0.024 0.940 0.020
#> SRR1652949     3  0.4193     0.7154 0.268 0.000 0.732 0.000
#> SRR1652950     1  0.1716     0.5556 0.936 0.000 0.064 0.000
#> SRR1652951     2  0.6620     0.8115 0.320 0.576 0.104 0.000
#> SRR1652953     1  0.3925     0.5093 0.808 0.176 0.016 0.000
#> SRR1652952     2  0.7128     0.7802 0.320 0.528 0.152 0.000
#> SRR1652954     1  0.4036     0.5050 0.836 0.088 0.076 0.000
#> SRR1652955     3  0.4304     0.7118 0.284 0.000 0.716 0.000
#> SRR1652958     1  0.0000     0.5794 1.000 0.000 0.000 0.000
#> SRR1652956     2  0.6552     0.8112 0.328 0.576 0.096 0.000
#> SRR1652957     1  0.4781     0.3193 0.660 0.336 0.000 0.004
#> SRR1652959     1  0.6315    -0.2591 0.540 0.396 0.064 0.000
#> SRR1652960     2  0.6407     0.6984 0.412 0.520 0.068 0.000
#> SRR1652961     1  0.7191    -0.4307 0.516 0.328 0.156 0.000
#> SRR1652962     2  0.6763     0.8078 0.320 0.564 0.116 0.000
#> SRR1652963     2  0.7429     0.7483 0.360 0.464 0.176 0.000
#> SRR1652965     4  0.0188     0.9966 0.000 0.000 0.004 0.996
#> SRR1652964     1  0.6435     0.1830 0.640 0.224 0.136 0.000
#> SRR1652966     3  0.4356     0.7145 0.292 0.000 0.708 0.000
#> SRR1652967     4  0.0592     0.9901 0.000 0.000 0.016 0.984
#> SRR1652969     1  0.4819     0.2739 0.652 0.344 0.000 0.004
#> SRR1652968     3  0.4977     0.5889 0.460 0.000 0.540 0.000
#> SRR1652970     1  0.3335     0.5394 0.856 0.128 0.016 0.000
#> SRR1652971     4  0.0188     0.9966 0.000 0.000 0.004 0.996
#> SRR1652972     1  0.4008     0.3450 0.756 0.000 0.244 0.000
#> SRR1652973     1  0.4889     0.3039 0.636 0.360 0.000 0.004
#> SRR1652974     1  0.2266     0.5667 0.912 0.084 0.004 0.000
#> SRR1652975     1  0.5285     0.2408 0.632 0.352 0.012 0.004
#> SRR1652976     3  0.4675     0.5754 0.016 0.080 0.816 0.088
#> SRR1652977     1  0.3278     0.5129 0.864 0.020 0.116 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
#> SRR1652895     1  0.3496     0.8712 0.788 0.012 0.000 0.200 0.000
#> SRR1652896     3  0.1915     0.6429 0.000 0.032 0.928 0.000 0.040
#> SRR1652897     4  0.2104     0.4931 0.060 0.024 0.000 0.916 0.000
#> SRR1652898     3  0.4135     0.7159 0.096 0.016 0.808 0.080 0.000
#> SRR1652899     3  0.7653    -0.0327 0.336 0.036 0.344 0.280 0.004
#> SRR1652900     2  0.3895     0.6230 0.000 0.680 0.000 0.320 0.000
#> SRR1652901     4  0.6762     0.5800 0.064 0.136 0.212 0.588 0.000
#> SRR1652902     4  0.6502     0.4031 0.280 0.012 0.172 0.536 0.000
#> SRR1652903     1  0.3366     0.8758 0.784 0.004 0.000 0.212 0.000
#> SRR1652904     1  0.3496     0.8712 0.788 0.012 0.000 0.200 0.000
#> SRR1652905     3  0.6787     0.5592 0.096 0.172 0.640 0.032 0.060
#> SRR1652906     4  0.6486     0.4110 0.276 0.012 0.172 0.540 0.000
#> SRR1652907     3  0.3639     0.7174 0.100 0.000 0.824 0.076 0.000
#> SRR1652908     2  0.4196     0.5521 0.000 0.640 0.004 0.356 0.000
#> SRR1652909     4  0.6969     0.4963 0.204 0.048 0.200 0.548 0.000
#> SRR1652910     4  0.6519     0.4152 0.276 0.016 0.164 0.544 0.000
#> SRR1652911     1  0.3949     0.7872 0.668 0.000 0.000 0.332 0.000
#> SRR1652912     2  0.1851     0.7721 0.000 0.912 0.000 0.088 0.000
#> SRR1652913     4  0.1568     0.5236 0.036 0.020 0.000 0.944 0.000
#> SRR1652914     3  0.6482     0.4527 0.060 0.088 0.592 0.260 0.000
#> SRR1652915     3  0.3630     0.7093 0.024 0.044 0.860 0.056 0.016
#> SRR1652916     4  0.6698     0.4206 0.276 0.028 0.156 0.540 0.000
#> SRR1652917     4  0.4790     0.6325 0.040 0.060 0.120 0.776 0.004
#> SRR1652918     4  0.5661     0.3289 0.204 0.060 0.032 0.692 0.012
#> SRR1652919     3  0.2012     0.6107 0.000 0.020 0.920 0.000 0.060
#> SRR1652920     2  0.2813     0.7496 0.000 0.832 0.000 0.168 0.000
#> SRR1652921     4  0.3823     0.6013 0.052 0.052 0.056 0.840 0.000
#> SRR1652922     5  0.0609     0.9960 0.000 0.000 0.020 0.000 0.980
#> SRR1652923     3  0.6290     0.3911 0.108 0.024 0.568 0.300 0.000
#> SRR1652924     4  0.3636     0.6324 0.004 0.080 0.084 0.832 0.000
#> SRR1652925     4  0.1806     0.5645 0.020 0.032 0.004 0.940 0.004
#> SRR1652926     4  0.3683     0.6352 0.004 0.072 0.096 0.828 0.000
#> SRR1652927     4  0.6147     0.3391 0.320 0.012 0.112 0.556 0.000
#> SRR1652928     1  0.3452     0.8587 0.756 0.000 0.000 0.244 0.000
#> SRR1652929     3  0.6178     0.5105 0.080 0.052 0.624 0.244 0.000
#> SRR1652930     1  0.4262     0.6023 0.560 0.000 0.000 0.440 0.000
#> SRR1652931     3  0.1830     0.6420 0.000 0.028 0.932 0.000 0.040
#> SRR1652932     1  0.3496     0.8712 0.788 0.012 0.000 0.200 0.000
#> SRR1652933     4  0.6503     0.5920 0.044 0.156 0.192 0.608 0.000
#> SRR1652934     4  0.6789     0.5944 0.120 0.096 0.180 0.604 0.000
#> SRR1652935     3  0.5550     0.5582 0.092 0.120 0.720 0.000 0.068
#> SRR1652936     2  0.1792     0.7724 0.000 0.916 0.000 0.084 0.000
#> SRR1652937     1  0.6447     0.1497 0.456 0.004 0.156 0.384 0.000
#> SRR1652938     4  0.6881     0.1872 0.212 0.060 0.064 0.620 0.044
#> SRR1652939     4  0.1630     0.5817 0.004 0.036 0.016 0.944 0.000
#> SRR1652940     1  0.3487     0.8757 0.780 0.008 0.000 0.212 0.000
#> SRR1652941     4  0.6537     0.5962 0.108 0.088 0.176 0.628 0.000
#> SRR1652942     2  0.2046     0.7583 0.000 0.916 0.016 0.068 0.000
#> SRR1652943     4  0.4551     0.3498 0.200 0.044 0.000 0.744 0.012
#> SRR1652944     3  0.6210     0.5008 0.076 0.056 0.620 0.248 0.000
#> SRR1652945     4  0.4958     0.3288 0.208 0.048 0.008 0.724 0.012
#> SRR1652946     4  0.1568     0.5253 0.020 0.036 0.000 0.944 0.000
#> SRR1652947     5  0.0404     0.9973 0.000 0.000 0.012 0.000 0.988
#> SRR1652948     3  0.1836     0.6498 0.000 0.036 0.932 0.000 0.032
#> SRR1652949     3  0.4241     0.7186 0.084 0.028 0.808 0.080 0.000
#> SRR1652950     4  0.7006     0.5453 0.132 0.084 0.216 0.568 0.000
#> SRR1652951     2  0.1831     0.7705 0.000 0.920 0.004 0.076 0.000
#> SRR1652953     1  0.3366     0.8756 0.784 0.004 0.000 0.212 0.000
#> SRR1652952     2  0.1704     0.7648 0.000 0.928 0.004 0.068 0.000
#> SRR1652954     4  0.6337     0.6068 0.092 0.092 0.168 0.648 0.000
#> SRR1652955     3  0.4241     0.7186 0.084 0.028 0.808 0.080 0.000
#> SRR1652958     4  0.6633     0.4150 0.276 0.020 0.168 0.536 0.000
#> SRR1652956     2  0.2482     0.7637 0.000 0.892 0.024 0.084 0.000
#> SRR1652957     4  0.2902     0.5967 0.028 0.056 0.028 0.888 0.000
#> SRR1652959     4  0.5100    -0.0781 0.000 0.448 0.036 0.516 0.000
#> SRR1652960     2  0.4118     0.5919 0.000 0.660 0.004 0.336 0.000
#> SRR1652961     2  0.4798     0.3300 0.000 0.540 0.020 0.440 0.000
#> SRR1652962     2  0.1831     0.7706 0.000 0.920 0.004 0.076 0.000
#> SRR1652963     2  0.7491     0.1563 0.068 0.456 0.172 0.304 0.000
#> SRR1652965     5  0.0404     0.9973 0.000 0.000 0.012 0.000 0.988
#> SRR1652964     4  0.6364     0.5918 0.036 0.140 0.212 0.612 0.000
#> SRR1652966     3  0.3741     0.7149 0.108 0.000 0.816 0.076 0.000
#> SRR1652967     5  0.0609     0.9960 0.000 0.000 0.020 0.000 0.980
#> SRR1652969     4  0.3253     0.6206 0.012 0.068 0.056 0.864 0.000
#> SRR1652968     3  0.6387     0.3003 0.116 0.020 0.536 0.328 0.000
#> SRR1652970     1  0.3635     0.8600 0.748 0.004 0.000 0.248 0.000
#> SRR1652971     5  0.0404     0.9973 0.000 0.000 0.012 0.000 0.988
#> SRR1652972     4  0.6706     0.3545 0.140 0.024 0.340 0.496 0.000
#> SRR1652973     4  0.3566     0.6220 0.028 0.064 0.056 0.852 0.000
#> SRR1652974     1  0.3934     0.8323 0.716 0.000 0.008 0.276 0.000
#> SRR1652975     4  0.3535     0.6306 0.000 0.088 0.080 0.832 0.000
#> SRR1652976     3  0.4504     0.5551 0.032 0.048 0.780 0.000 0.140
#> SRR1652977     4  0.6762     0.5554 0.104 0.072 0.248 0.576 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
#> SRR1652895     1  0.0000     0.7852 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.4439     0.2204 0.000 0.028 0.540 0.000 0.432 0.000
#> SRR1652897     4  0.4899     0.5445 0.220 0.000 0.088 0.676 0.000 0.016
#> SRR1652898     3  0.3528     0.3568 0.000 0.004 0.700 0.000 0.296 0.000
#> SRR1652899     6  0.7737     0.4132 0.256 0.000 0.280 0.008 0.144 0.312
#> SRR1652900     2  0.2401     0.8496 0.016 0.900 0.060 0.004 0.000 0.020
#> SRR1652901     3  0.5935     0.1264 0.032 0.216 0.592 0.004 0.000 0.156
#> SRR1652902     6  0.6179     0.8280 0.344 0.008 0.228 0.000 0.000 0.420
#> SRR1652903     1  0.0000     0.7852 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.7852 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     5  0.5968    -0.2305 0.000 0.144 0.376 0.000 0.464 0.016
#> SRR1652906     6  0.6137     0.8327 0.360 0.008 0.212 0.000 0.000 0.420
#> SRR1652907     3  0.3690     0.3475 0.000 0.000 0.684 0.000 0.308 0.008
#> SRR1652908     2  0.3103     0.8127 0.016 0.848 0.112 0.008 0.000 0.016
#> SRR1652909     3  0.6241    -0.5880 0.204 0.008 0.412 0.004 0.000 0.372
#> SRR1652910     6  0.6168     0.8092 0.376 0.012 0.196 0.000 0.000 0.416
#> SRR1652911     1  0.2002     0.7322 0.920 0.000 0.040 0.028 0.000 0.012
#> SRR1652912     2  0.0000     0.8767 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     4  0.5172     0.5821 0.192 0.008 0.108 0.676 0.000 0.016
#> SRR1652914     3  0.5289     0.4285 0.012 0.060 0.684 0.004 0.204 0.036
#> SRR1652915     3  0.4692     0.3019 0.004 0.020 0.600 0.000 0.360 0.016
#> SRR1652916     6  0.6564     0.7830 0.364 0.004 0.216 0.016 0.004 0.396
#> SRR1652917     3  0.7991    -0.4521 0.052 0.084 0.328 0.288 0.000 0.248
#> SRR1652918     4  0.0405     0.5810 0.000 0.008 0.000 0.988 0.000 0.004
#> SRR1652919     3  0.3979     0.2224 0.000 0.004 0.540 0.000 0.456 0.000
#> SRR1652920     2  0.1268     0.8671 0.000 0.952 0.008 0.036 0.000 0.004
#> SRR1652921     4  0.7714     0.5195 0.196 0.068 0.108 0.500 0.008 0.120
#> SRR1652922     5  0.3862     0.5841 0.000 0.000 0.000 0.000 0.524 0.476
#> SRR1652923     3  0.2268     0.4643 0.016 0.004 0.904 0.004 0.068 0.004
#> SRR1652924     4  0.7198     0.5804 0.020 0.072 0.340 0.412 0.000 0.156
#> SRR1652925     4  0.4878     0.6787 0.020 0.028 0.260 0.672 0.000 0.020
#> SRR1652926     4  0.7106     0.6048 0.016 0.080 0.320 0.440 0.000 0.144
#> SRR1652927     1  0.7139    -0.7038 0.420 0.028 0.172 0.048 0.000 0.332
#> SRR1652928     1  0.0363     0.7829 0.988 0.000 0.000 0.012 0.000 0.000
#> SRR1652929     3  0.2964     0.4553 0.012 0.012 0.852 0.000 0.116 0.008
#> SRR1652930     1  0.4025     0.5022 0.760 0.000 0.052 0.176 0.000 0.012
#> SRR1652931     3  0.4242     0.2240 0.000 0.016 0.536 0.000 0.448 0.000
#> SRR1652932     1  0.0260     0.7815 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR1652933     3  0.7294     0.0313 0.032 0.264 0.472 0.084 0.000 0.148
#> SRR1652934     3  0.7644    -0.1650 0.064 0.072 0.460 0.104 0.012 0.288
#> SRR1652935     5  0.5018    -0.2848 0.000 0.044 0.464 0.000 0.480 0.012
#> SRR1652936     2  0.0000     0.8767 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.5804    -0.7355 0.436 0.004 0.156 0.000 0.000 0.404
#> SRR1652938     4  0.0146     0.5754 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1652939     4  0.4994     0.6806 0.028 0.016 0.256 0.668 0.000 0.032
#> SRR1652940     1  0.0260     0.7863 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR1652941     3  0.7245    -0.1220 0.048 0.072 0.492 0.104 0.004 0.280
#> SRR1652942     2  0.0260     0.8725 0.000 0.992 0.000 0.000 0.008 0.000
#> SRR1652943     4  0.0551     0.5847 0.000 0.008 0.004 0.984 0.000 0.004
#> SRR1652944     3  0.2358     0.4674 0.012 0.012 0.896 0.004 0.076 0.000
#> SRR1652945     4  0.0146     0.5754 0.000 0.000 0.000 0.996 0.000 0.004
#> SRR1652946     4  0.4571     0.6801 0.028 0.008 0.252 0.692 0.000 0.020
#> SRR1652947     5  0.3867     0.5838 0.000 0.000 0.000 0.000 0.512 0.488
#> SRR1652948     3  0.4444     0.2182 0.000 0.028 0.536 0.000 0.436 0.000
#> SRR1652949     3  0.3409     0.3537 0.000 0.000 0.700 0.000 0.300 0.000
#> SRR1652950     3  0.5430     0.0405 0.084 0.044 0.656 0.004 0.000 0.212
#> SRR1652951     2  0.0000     0.8767 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.0146     0.7867 0.996 0.000 0.004 0.000 0.000 0.000
#> SRR1652952     2  0.0146     0.8766 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652954     3  0.7790    -0.2230 0.064 0.080 0.364 0.148 0.000 0.344
#> SRR1652955     3  0.3508     0.3590 0.000 0.004 0.704 0.000 0.292 0.000
#> SRR1652958     6  0.6122     0.8318 0.360 0.008 0.208 0.000 0.000 0.424
#> SRR1652956     2  0.0363     0.8686 0.000 0.988 0.000 0.000 0.012 0.000
#> SRR1652957     4  0.7549     0.5682 0.168 0.072 0.160 0.504 0.000 0.096
#> SRR1652959     2  0.5673     0.4347 0.016 0.612 0.272 0.064 0.000 0.036
#> SRR1652960     2  0.2814     0.8347 0.016 0.872 0.088 0.008 0.000 0.016
#> SRR1652961     2  0.4089     0.7617 0.016 0.792 0.136 0.032 0.004 0.020
#> SRR1652962     2  0.0146     0.8752 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1652963     2  0.4443     0.7081 0.008 0.752 0.172 0.004 0.040 0.024
#> SRR1652965     5  0.3866     0.5841 0.000 0.000 0.000 0.000 0.516 0.484
#> SRR1652964     3  0.6186     0.1524 0.020 0.256 0.576 0.016 0.008 0.124
#> SRR1652966     3  0.4237     0.3479 0.004 0.000 0.660 0.000 0.308 0.028
#> SRR1652967     5  0.3862     0.5841 0.000 0.000 0.000 0.000 0.524 0.476
#> SRR1652969     4  0.7142     0.6127 0.028 0.076 0.324 0.448 0.000 0.124
#> SRR1652968     3  0.1546     0.4354 0.028 0.004 0.944 0.004 0.020 0.000
#> SRR1652970     1  0.1168     0.7620 0.956 0.000 0.028 0.000 0.000 0.016
#> SRR1652971     5  0.3867     0.5838 0.000 0.000 0.000 0.000 0.512 0.488
#> SRR1652972     3  0.3912     0.3226 0.080 0.008 0.816 0.004 0.024 0.068
#> SRR1652973     4  0.7250     0.5831 0.032 0.072 0.348 0.416 0.000 0.132
#> SRR1652974     1  0.1225     0.7557 0.952 0.000 0.036 0.000 0.000 0.012
#> SRR1652975     4  0.7406     0.5861 0.016 0.100 0.320 0.416 0.004 0.144
#> SRR1652976     5  0.4712    -0.2697 0.000 0.012 0.452 0.000 0.512 0.024
#> SRR1652977     3  0.5521     0.2052 0.084 0.064 0.700 0.004 0.016 0.132

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

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

collect_plots(res)

plot of chunk CV-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.712           0.873       0.942         0.4773 0.510   0.510
#> 3 3 0.724           0.805       0.910         0.1878 0.916   0.837
#> 4 4 0.563           0.697       0.852         0.0921 0.955   0.898
#> 5 5 0.495           0.570       0.801         0.0596 0.962   0.910
#> 6 6 0.506           0.516       0.763         0.0367 0.917   0.802

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
#> SRR1652895     1  0.0000      0.965 1.000 0.000
#> SRR1652896     2  0.0000      0.893 0.000 1.000
#> SRR1652897     1  0.0000      0.965 1.000 0.000
#> SRR1652898     2  0.7950      0.723 0.240 0.760
#> SRR1652899     1  0.0000      0.965 1.000 0.000
#> SRR1652900     2  0.7674      0.739 0.224 0.776
#> SRR1652901     2  0.4562      0.850 0.096 0.904
#> SRR1652902     1  0.0000      0.965 1.000 0.000
#> SRR1652903     1  0.0000      0.965 1.000 0.000
#> SRR1652904     1  0.0000      0.965 1.000 0.000
#> SRR1652905     2  0.0000      0.893 0.000 1.000
#> SRR1652906     1  0.0376      0.962 0.996 0.004
#> SRR1652907     1  0.0000      0.965 1.000 0.000
#> SRR1652908     2  0.0376      0.892 0.004 0.996
#> SRR1652909     1  0.0000      0.965 1.000 0.000
#> SRR1652910     1  0.0000      0.965 1.000 0.000
#> SRR1652911     1  0.0000      0.965 1.000 0.000
#> SRR1652912     2  0.0000      0.893 0.000 1.000
#> SRR1652913     1  0.0000      0.965 1.000 0.000
#> SRR1652914     2  0.0000      0.893 0.000 1.000
#> SRR1652915     2  0.6623      0.795 0.172 0.828
#> SRR1652916     1  0.0000      0.965 1.000 0.000
#> SRR1652917     1  0.0000      0.965 1.000 0.000
#> SRR1652918     1  0.0000      0.965 1.000 0.000
#> SRR1652919     2  0.4690      0.844 0.100 0.900
#> SRR1652920     2  0.0376      0.892 0.004 0.996
#> SRR1652921     1  0.0000      0.965 1.000 0.000
#> SRR1652922     1  0.9491      0.348 0.632 0.368
#> SRR1652923     2  0.0000      0.893 0.000 1.000
#> SRR1652924     1  0.0000      0.965 1.000 0.000
#> SRR1652925     1  0.0000      0.965 1.000 0.000
#> SRR1652926     1  0.0000      0.965 1.000 0.000
#> SRR1652927     1  0.0000      0.965 1.000 0.000
#> SRR1652928     1  0.0000      0.965 1.000 0.000
#> SRR1652929     2  0.1633      0.886 0.024 0.976
#> SRR1652930     1  0.0000      0.965 1.000 0.000
#> SRR1652931     2  0.0000      0.893 0.000 1.000
#> SRR1652932     1  0.0000      0.965 1.000 0.000
#> SRR1652933     2  0.9922      0.297 0.448 0.552
#> SRR1652934     1  0.0938      0.955 0.988 0.012
#> SRR1652935     2  0.0000      0.893 0.000 1.000
#> SRR1652936     2  0.0000      0.893 0.000 1.000
#> SRR1652937     1  0.0000      0.965 1.000 0.000
#> SRR1652938     1  0.0000      0.965 1.000 0.000
#> SRR1652939     1  0.0000      0.965 1.000 0.000
#> SRR1652940     1  0.0000      0.965 1.000 0.000
#> SRR1652941     1  0.0376      0.962 0.996 0.004
#> SRR1652942     2  0.0000      0.893 0.000 1.000
#> SRR1652943     1  0.0000      0.965 1.000 0.000
#> SRR1652944     2  0.0000      0.893 0.000 1.000
#> SRR1652945     1  0.0000      0.965 1.000 0.000
#> SRR1652946     1  0.0000      0.965 1.000 0.000
#> SRR1652947     1  0.0000      0.965 1.000 0.000
#> SRR1652948     2  0.0000      0.893 0.000 1.000
#> SRR1652949     2  0.9522      0.507 0.372 0.628
#> SRR1652950     1  0.7219      0.717 0.800 0.200
#> SRR1652951     2  0.0000      0.893 0.000 1.000
#> SRR1652953     1  0.0000      0.965 1.000 0.000
#> SRR1652952     2  0.0000      0.893 0.000 1.000
#> SRR1652954     1  0.0000      0.965 1.000 0.000
#> SRR1652955     2  0.0000      0.893 0.000 1.000
#> SRR1652958     1  0.0000      0.965 1.000 0.000
#> SRR1652956     2  0.0000      0.893 0.000 1.000
#> SRR1652957     1  0.0000      0.965 1.000 0.000
#> SRR1652959     1  0.8763      0.524 0.704 0.296
#> SRR1652960     2  0.6531      0.796 0.168 0.832
#> SRR1652961     1  0.6801      0.749 0.820 0.180
#> SRR1652962     2  0.0000      0.893 0.000 1.000
#> SRR1652963     2  0.0000      0.893 0.000 1.000
#> SRR1652965     1  0.7745      0.674 0.772 0.228
#> SRR1652964     2  0.8813      0.634 0.300 0.700
#> SRR1652966     1  0.2236      0.933 0.964 0.036
#> SRR1652967     2  0.8861      0.608 0.304 0.696
#> SRR1652969     1  0.0376      0.962 0.996 0.004
#> SRR1652968     2  0.0000      0.893 0.000 1.000
#> SRR1652970     1  0.0000      0.965 1.000 0.000
#> SRR1652971     1  0.5178      0.844 0.884 0.116
#> SRR1652972     2  0.9922      0.310 0.448 0.552
#> SRR1652973     1  0.0000      0.965 1.000 0.000
#> SRR1652974     1  0.0000      0.965 1.000 0.000
#> SRR1652975     1  0.0000      0.965 1.000 0.000
#> SRR1652976     2  0.9686      0.432 0.396 0.604
#> SRR1652977     2  0.3431      0.868 0.064 0.936

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0892     0.9330 0.980 0.000 0.020
#> SRR1652896     2  0.3192     0.7256 0.000 0.888 0.112
#> SRR1652897     1  0.1289     0.9260 0.968 0.000 0.032
#> SRR1652898     2  0.4452     0.7086 0.192 0.808 0.000
#> SRR1652899     1  0.0747     0.9355 0.984 0.000 0.016
#> SRR1652900     2  0.5431     0.5959 0.284 0.716 0.000
#> SRR1652901     2  0.4121     0.7318 0.168 0.832 0.000
#> SRR1652902     1  0.1267     0.9356 0.972 0.024 0.004
#> SRR1652903     1  0.0592     0.9344 0.988 0.000 0.012
#> SRR1652904     1  0.0892     0.9330 0.980 0.000 0.020
#> SRR1652905     2  0.0747     0.7997 0.000 0.984 0.016
#> SRR1652906     1  0.1529     0.9268 0.960 0.040 0.000
#> SRR1652907     1  0.1267     0.9346 0.972 0.024 0.004
#> SRR1652908     2  0.1860     0.8077 0.052 0.948 0.000
#> SRR1652909     1  0.1129     0.9364 0.976 0.020 0.004
#> SRR1652910     1  0.1031     0.9345 0.976 0.024 0.000
#> SRR1652911     1  0.0747     0.9334 0.984 0.000 0.016
#> SRR1652912     2  0.0829     0.8044 0.004 0.984 0.012
#> SRR1652913     1  0.1031     0.9300 0.976 0.000 0.024
#> SRR1652914     2  0.1031     0.8093 0.024 0.976 0.000
#> SRR1652915     2  0.3587     0.7855 0.088 0.892 0.020
#> SRR1652916     1  0.1129     0.9356 0.976 0.020 0.004
#> SRR1652917     1  0.1267     0.9341 0.972 0.024 0.004
#> SRR1652918     1  0.2066     0.9068 0.940 0.000 0.060
#> SRR1652919     3  0.5882     0.5286 0.000 0.348 0.652
#> SRR1652920     2  0.2173     0.8088 0.048 0.944 0.008
#> SRR1652921     1  0.0983     0.9368 0.980 0.016 0.004
#> SRR1652922     3  0.1015     0.8518 0.012 0.008 0.980
#> SRR1652923     2  0.1878     0.8089 0.044 0.952 0.004
#> SRR1652924     1  0.0592     0.9369 0.988 0.012 0.000
#> SRR1652925     1  0.1163     0.9298 0.972 0.000 0.028
#> SRR1652926     1  0.1585     0.9315 0.964 0.028 0.008
#> SRR1652927     1  0.1129     0.9364 0.976 0.020 0.004
#> SRR1652928     1  0.1031     0.9303 0.976 0.000 0.024
#> SRR1652929     2  0.2749     0.8021 0.064 0.924 0.012
#> SRR1652930     1  0.0747     0.9334 0.984 0.000 0.016
#> SRR1652931     2  0.6225     0.0248 0.000 0.568 0.432
#> SRR1652932     1  0.0747     0.9348 0.984 0.000 0.016
#> SRR1652933     2  0.6104     0.5100 0.348 0.648 0.004
#> SRR1652934     1  0.1860     0.9178 0.948 0.052 0.000
#> SRR1652935     2  0.5216     0.5119 0.000 0.740 0.260
#> SRR1652936     2  0.0237     0.8045 0.000 0.996 0.004
#> SRR1652937     1  0.1031     0.9345 0.976 0.024 0.000
#> SRR1652938     1  0.6500     0.1492 0.532 0.004 0.464
#> SRR1652939     1  0.0983     0.9359 0.980 0.004 0.016
#> SRR1652940     1  0.0592     0.9344 0.988 0.000 0.012
#> SRR1652941     1  0.2446     0.9144 0.936 0.052 0.012
#> SRR1652942     2  0.0747     0.7995 0.000 0.984 0.016
#> SRR1652943     1  0.2165     0.9035 0.936 0.000 0.064
#> SRR1652944     2  0.0424     0.8035 0.000 0.992 0.008
#> SRR1652945     1  0.3038     0.8643 0.896 0.000 0.104
#> SRR1652946     1  0.1411     0.9232 0.964 0.000 0.036
#> SRR1652947     3  0.2711     0.8053 0.088 0.000 0.912
#> SRR1652948     2  0.1964     0.7753 0.000 0.944 0.056
#> SRR1652949     2  0.5706     0.5556 0.320 0.680 0.000
#> SRR1652950     1  0.6045     0.3248 0.620 0.380 0.000
#> SRR1652951     2  0.1031     0.7940 0.000 0.976 0.024
#> SRR1652953     1  0.0892     0.9345 0.980 0.000 0.020
#> SRR1652952     2  0.0892     0.7971 0.000 0.980 0.020
#> SRR1652954     1  0.1289     0.9318 0.968 0.032 0.000
#> SRR1652955     2  0.0661     0.8053 0.004 0.988 0.008
#> SRR1652958     1  0.1031     0.9345 0.976 0.024 0.000
#> SRR1652956     2  0.2959     0.7446 0.000 0.900 0.100
#> SRR1652957     1  0.0475     0.9364 0.992 0.004 0.004
#> SRR1652959     1  0.5928     0.5406 0.696 0.296 0.008
#> SRR1652960     2  0.4702     0.6890 0.212 0.788 0.000
#> SRR1652961     1  0.5450     0.6758 0.760 0.228 0.012
#> SRR1652962     2  0.0592     0.8018 0.000 0.988 0.012
#> SRR1652963     2  0.1647     0.8109 0.036 0.960 0.004
#> SRR1652965     3  0.0892     0.8516 0.020 0.000 0.980
#> SRR1652964     2  0.5835     0.5174 0.340 0.660 0.000
#> SRR1652966     1  0.3425     0.8586 0.884 0.112 0.004
#> SRR1652967     3  0.2384     0.8385 0.008 0.056 0.936
#> SRR1652969     1  0.1399     0.9329 0.968 0.028 0.004
#> SRR1652968     2  0.1529     0.8100 0.040 0.960 0.000
#> SRR1652970     1  0.0592     0.9356 0.988 0.000 0.012
#> SRR1652971     3  0.1399     0.8493 0.028 0.004 0.968
#> SRR1652972     2  0.6267     0.2630 0.452 0.548 0.000
#> SRR1652973     1  0.1170     0.9370 0.976 0.016 0.008
#> SRR1652974     1  0.0237     0.9359 0.996 0.000 0.004
#> SRR1652975     1  0.1751     0.9306 0.960 0.028 0.012
#> SRR1652976     3  0.5988     0.6055 0.008 0.304 0.688
#> SRR1652977     2  0.3340     0.7711 0.120 0.880 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.1211   0.853247 0.960 0.000 0.000 0.040
#> SRR1652896     2  0.5051   0.629932 0.000 0.768 0.132 0.100
#> SRR1652897     1  0.2675   0.820799 0.892 0.000 0.008 0.100
#> SRR1652898     2  0.5537   0.606423 0.256 0.688 0.000 0.056
#> SRR1652899     1  0.0524   0.860378 0.988 0.004 0.000 0.008
#> SRR1652900     2  0.6770   0.410759 0.340 0.560 0.004 0.096
#> SRR1652901     2  0.4332   0.709681 0.160 0.800 0.000 0.040
#> SRR1652902     1  0.1256   0.860183 0.964 0.008 0.000 0.028
#> SRR1652903     1  0.1211   0.853266 0.960 0.000 0.000 0.040
#> SRR1652904     1  0.1022   0.855947 0.968 0.000 0.000 0.032
#> SRR1652905     2  0.2140   0.762960 0.008 0.932 0.008 0.052
#> SRR1652906     1  0.2224   0.831128 0.928 0.040 0.000 0.032
#> SRR1652907     1  0.1994   0.847440 0.936 0.008 0.004 0.052
#> SRR1652908     2  0.2644   0.766929 0.032 0.908 0.000 0.060
#> SRR1652909     1  0.1004   0.858577 0.972 0.004 0.000 0.024
#> SRR1652910     1  0.1059   0.857896 0.972 0.012 0.000 0.016
#> SRR1652911     1  0.1637   0.849502 0.940 0.000 0.000 0.060
#> SRR1652912     2  0.2053   0.757762 0.000 0.924 0.004 0.072
#> SRR1652913     1  0.2345   0.825748 0.900 0.000 0.000 0.100
#> SRR1652914     2  0.1284   0.766637 0.012 0.964 0.000 0.024
#> SRR1652915     2  0.4995   0.732852 0.072 0.808 0.040 0.080
#> SRR1652916     1  0.1256   0.861377 0.964 0.008 0.000 0.028
#> SRR1652917     1  0.1798   0.855760 0.944 0.016 0.000 0.040
#> SRR1652918     1  0.5339   0.231156 0.624 0.000 0.020 0.356
#> SRR1652919     3  0.3932   0.736099 0.004 0.128 0.836 0.032
#> SRR1652920     2  0.3898   0.756131 0.048 0.852 0.008 0.092
#> SRR1652921     1  0.1211   0.858984 0.960 0.000 0.000 0.040
#> SRR1652922     3  0.2412   0.769951 0.008 0.000 0.908 0.084
#> SRR1652923     2  0.3938   0.756046 0.064 0.848 0.004 0.084
#> SRR1652924     1  0.0779   0.861199 0.980 0.004 0.000 0.016
#> SRR1652925     1  0.2973   0.783318 0.856 0.000 0.000 0.144
#> SRR1652926     1  0.2282   0.847518 0.924 0.024 0.000 0.052
#> SRR1652927     1  0.0657   0.861090 0.984 0.004 0.000 0.012
#> SRR1652928     1  0.1635   0.851651 0.948 0.000 0.008 0.044
#> SRR1652929     2  0.6365   0.624170 0.204 0.676 0.012 0.108
#> SRR1652930     1  0.1716   0.844760 0.936 0.000 0.000 0.064
#> SRR1652931     3  0.5130   0.519325 0.000 0.332 0.652 0.016
#> SRR1652932     1  0.0895   0.860127 0.976 0.004 0.000 0.020
#> SRR1652933     2  0.5592   0.579881 0.264 0.680 0.000 0.056
#> SRR1652934     1  0.3383   0.782010 0.872 0.076 0.000 0.052
#> SRR1652935     2  0.7351  -0.176051 0.004 0.440 0.420 0.136
#> SRR1652936     2  0.1452   0.762797 0.000 0.956 0.008 0.036
#> SRR1652937     1  0.0524   0.859340 0.988 0.004 0.000 0.008
#> SRR1652938     4  0.6522   0.000000 0.224 0.000 0.144 0.632
#> SRR1652939     1  0.4720   0.431407 0.672 0.000 0.004 0.324
#> SRR1652940     1  0.0817   0.858575 0.976 0.000 0.000 0.024
#> SRR1652941     1  0.3071   0.792462 0.888 0.068 0.000 0.044
#> SRR1652942     2  0.1978   0.759397 0.000 0.928 0.004 0.068
#> SRR1652943     1  0.4957   0.401039 0.668 0.000 0.012 0.320
#> SRR1652944     2  0.1118   0.757626 0.000 0.964 0.000 0.036
#> SRR1652945     1  0.5894  -0.000968 0.568 0.000 0.040 0.392
#> SRR1652946     1  0.3052   0.784499 0.860 0.000 0.004 0.136
#> SRR1652947     3  0.3370   0.690436 0.048 0.000 0.872 0.080
#> SRR1652948     2  0.4203   0.697309 0.000 0.824 0.068 0.108
#> SRR1652949     2  0.6067   0.415941 0.376 0.572 0.000 0.052
#> SRR1652950     2  0.5643   0.334769 0.428 0.548 0.000 0.024
#> SRR1652951     2  0.1209   0.761832 0.000 0.964 0.004 0.032
#> SRR1652953     1  0.0817   0.861811 0.976 0.000 0.000 0.024
#> SRR1652952     2  0.2197   0.751315 0.000 0.916 0.004 0.080
#> SRR1652954     1  0.1610   0.855246 0.952 0.016 0.000 0.032
#> SRR1652955     2  0.0707   0.761238 0.000 0.980 0.000 0.020
#> SRR1652958     1  0.1182   0.856031 0.968 0.016 0.000 0.016
#> SRR1652956     2  0.6325   0.586062 0.012 0.676 0.100 0.212
#> SRR1652957     1  0.1557   0.854917 0.944 0.000 0.000 0.056
#> SRR1652959     1  0.6384   0.082861 0.532 0.400 0.000 0.068
#> SRR1652960     2  0.5147   0.665579 0.200 0.740 0.000 0.060
#> SRR1652961     1  0.6382   0.232542 0.580 0.340 0.000 0.080
#> SRR1652962     2  0.1211   0.761091 0.000 0.960 0.000 0.040
#> SRR1652963     2  0.1114   0.766488 0.008 0.972 0.004 0.016
#> SRR1652965     3  0.0524   0.782496 0.004 0.000 0.988 0.008
#> SRR1652964     2  0.5444   0.590823 0.264 0.688 0.000 0.048
#> SRR1652966     1  0.5169   0.452279 0.696 0.272 0.000 0.032
#> SRR1652967     3  0.2198   0.777222 0.000 0.008 0.920 0.072
#> SRR1652969     1  0.2699   0.839604 0.904 0.028 0.000 0.068
#> SRR1652968     2  0.1174   0.769517 0.020 0.968 0.000 0.012
#> SRR1652970     1  0.0817   0.861023 0.976 0.000 0.000 0.024
#> SRR1652971     3  0.1305   0.777840 0.004 0.000 0.960 0.036
#> SRR1652972     2  0.6365   0.279948 0.440 0.504 0.004 0.052
#> SRR1652973     1  0.2412   0.844398 0.908 0.008 0.000 0.084
#> SRR1652974     1  0.0469   0.860282 0.988 0.000 0.000 0.012
#> SRR1652975     1  0.2329   0.844336 0.916 0.012 0.000 0.072
#> SRR1652976     3  0.5077   0.674168 0.028 0.192 0.760 0.020
#> SRR1652977     2  0.2385   0.768586 0.052 0.920 0.000 0.028

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.1492     0.8315 0.948 0.000 0.008 0.040 0.004
#> SRR1652896     2  0.5939    -0.3109 0.000 0.548 0.060 0.024 0.368
#> SRR1652897     1  0.2407     0.8068 0.896 0.000 0.004 0.088 0.012
#> SRR1652898     2  0.6151     0.2701 0.300 0.568 0.000 0.012 0.120
#> SRR1652899     1  0.1854     0.8354 0.936 0.000 0.008 0.036 0.020
#> SRR1652900     2  0.7831     0.0350 0.360 0.364 0.004 0.064 0.208
#> SRR1652901     2  0.4480     0.5032 0.128 0.772 0.000 0.008 0.092
#> SRR1652902     1  0.2344     0.8259 0.904 0.000 0.000 0.064 0.032
#> SRR1652903     1  0.1285     0.8332 0.956 0.000 0.004 0.036 0.004
#> SRR1652904     1  0.1243     0.8324 0.960 0.000 0.008 0.028 0.004
#> SRR1652905     2  0.3147     0.4976 0.008 0.848 0.004 0.008 0.132
#> SRR1652906     1  0.2610     0.8213 0.904 0.024 0.000 0.036 0.036
#> SRR1652907     1  0.3359     0.8083 0.868 0.012 0.012 0.068 0.040
#> SRR1652908     2  0.3078     0.5133 0.016 0.848 0.000 0.004 0.132
#> SRR1652909     1  0.2227     0.8314 0.916 0.000 0.004 0.048 0.032
#> SRR1652910     1  0.2067     0.8291 0.924 0.004 0.000 0.044 0.028
#> SRR1652911     1  0.0960     0.8333 0.972 0.000 0.004 0.016 0.008
#> SRR1652912     2  0.2770     0.5158 0.008 0.864 0.004 0.000 0.124
#> SRR1652913     1  0.1830     0.8240 0.924 0.000 0.008 0.068 0.000
#> SRR1652914     2  0.2295     0.5499 0.008 0.900 0.000 0.004 0.088
#> SRR1652915     2  0.5236     0.3428 0.096 0.692 0.008 0.000 0.204
#> SRR1652916     1  0.1717     0.8375 0.936 0.004 0.000 0.052 0.008
#> SRR1652917     1  0.2544     0.8258 0.900 0.008 0.000 0.064 0.028
#> SRR1652918     1  0.7364    -0.2506 0.424 0.016 0.052 0.404 0.104
#> SRR1652919     3  0.4300     0.7020 0.004 0.092 0.796 0.008 0.100
#> SRR1652920     2  0.5063     0.3373 0.020 0.704 0.008 0.032 0.236
#> SRR1652921     1  0.1522     0.8377 0.944 0.000 0.000 0.044 0.012
#> SRR1652922     3  0.3832     0.7190 0.004 0.004 0.824 0.068 0.100
#> SRR1652923     2  0.5337     0.3337 0.036 0.676 0.000 0.040 0.248
#> SRR1652924     1  0.0955     0.8365 0.968 0.000 0.000 0.028 0.004
#> SRR1652925     1  0.3098     0.7639 0.836 0.000 0.000 0.148 0.016
#> SRR1652926     1  0.3569     0.7970 0.852 0.036 0.000 0.072 0.040
#> SRR1652927     1  0.1282     0.8360 0.952 0.000 0.000 0.044 0.004
#> SRR1652928     1  0.1329     0.8322 0.956 0.000 0.008 0.032 0.004
#> SRR1652929     2  0.7172     0.1549 0.192 0.540 0.004 0.052 0.212
#> SRR1652930     1  0.1569     0.8304 0.944 0.000 0.004 0.044 0.008
#> SRR1652931     3  0.4867     0.2290 0.000 0.308 0.652 0.004 0.036
#> SRR1652932     1  0.1772     0.8369 0.940 0.000 0.008 0.032 0.020
#> SRR1652933     2  0.5877     0.3966 0.184 0.668 0.000 0.036 0.112
#> SRR1652934     1  0.4455     0.7150 0.788 0.128 0.000 0.040 0.044
#> SRR1652935     5  0.7339     0.4948 0.004 0.284 0.208 0.036 0.468
#> SRR1652936     2  0.1965     0.5374 0.000 0.904 0.000 0.000 0.096
#> SRR1652937     1  0.1399     0.8347 0.952 0.000 0.000 0.028 0.020
#> SRR1652938     4  0.6095     0.0000 0.136 0.004 0.088 0.684 0.088
#> SRR1652939     1  0.6217     0.1918 0.544 0.004 0.016 0.348 0.088
#> SRR1652940     1  0.1461     0.8363 0.952 0.000 0.004 0.028 0.016
#> SRR1652941     1  0.3804     0.7896 0.844 0.040 0.004 0.072 0.040
#> SRR1652942     2  0.3170     0.4973 0.000 0.828 0.008 0.004 0.160
#> SRR1652943     1  0.5204     0.3552 0.608 0.000 0.020 0.348 0.024
#> SRR1652944     2  0.1121     0.5393 0.000 0.956 0.000 0.000 0.044
#> SRR1652945     1  0.6003    -0.0555 0.504 0.000 0.048 0.416 0.032
#> SRR1652946     1  0.2407     0.8088 0.896 0.000 0.004 0.088 0.012
#> SRR1652947     3  0.2244     0.7207 0.040 0.000 0.920 0.024 0.016
#> SRR1652948     2  0.4887     0.0923 0.004 0.664 0.020 0.012 0.300
#> SRR1652949     2  0.6115     0.1805 0.424 0.476 0.000 0.012 0.088
#> SRR1652950     2  0.5394     0.2687 0.364 0.580 0.000 0.008 0.048
#> SRR1652951     2  0.2389     0.5195 0.000 0.880 0.000 0.004 0.116
#> SRR1652953     1  0.1630     0.8361 0.944 0.000 0.004 0.036 0.016
#> SRR1652952     2  0.3353     0.4478 0.000 0.796 0.000 0.008 0.196
#> SRR1652954     1  0.2228     0.8282 0.912 0.008 0.000 0.068 0.012
#> SRR1652955     2  0.1571     0.5424 0.004 0.936 0.000 0.000 0.060
#> SRR1652958     1  0.2104     0.8300 0.924 0.008 0.000 0.044 0.024
#> SRR1652956     5  0.7196     0.4732 0.024 0.400 0.052 0.072 0.452
#> SRR1652957     1  0.1408     0.8318 0.948 0.000 0.000 0.044 0.008
#> SRR1652959     1  0.7085    -0.0571 0.448 0.384 0.000 0.068 0.100
#> SRR1652960     2  0.5282     0.4371 0.164 0.716 0.000 0.024 0.096
#> SRR1652961     1  0.6961     0.1586 0.504 0.332 0.000 0.072 0.092
#> SRR1652962     2  0.1671     0.5377 0.000 0.924 0.000 0.000 0.076
#> SRR1652963     2  0.2102     0.5480 0.012 0.916 0.000 0.004 0.068
#> SRR1652965     3  0.0771     0.7576 0.000 0.000 0.976 0.004 0.020
#> SRR1652964     2  0.6126     0.2984 0.264 0.604 0.000 0.024 0.108
#> SRR1652966     1  0.5620     0.5264 0.672 0.236 0.004 0.048 0.040
#> SRR1652967     3  0.4866     0.6329 0.004 0.004 0.716 0.060 0.216
#> SRR1652969     1  0.3191     0.8089 0.868 0.040 0.000 0.076 0.016
#> SRR1652968     2  0.1386     0.5604 0.016 0.952 0.000 0.000 0.032
#> SRR1652970     1  0.1695     0.8380 0.940 0.000 0.008 0.044 0.008
#> SRR1652971     3  0.1074     0.7548 0.004 0.000 0.968 0.012 0.016
#> SRR1652972     1  0.6861     0.0894 0.492 0.332 0.000 0.032 0.144
#> SRR1652973     1  0.3459     0.7707 0.832 0.016 0.000 0.136 0.016
#> SRR1652974     1  0.0671     0.8347 0.980 0.000 0.000 0.016 0.004
#> SRR1652975     1  0.2878     0.8157 0.880 0.024 0.000 0.084 0.012
#> SRR1652976     3  0.4579     0.6600 0.028 0.132 0.788 0.012 0.040
#> SRR1652977     2  0.2234     0.5598 0.036 0.916 0.000 0.004 0.044

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0777    0.76406 0.972 0.000 0.004 0.024 0.000 0.000
#> SRR1652896     5  0.6102    0.44910 0.000 0.336 0.032 0.012 0.524 0.096
#> SRR1652897     1  0.2225    0.72333 0.892 0.000 0.008 0.092 0.000 0.008
#> SRR1652898     2  0.6329    0.12909 0.372 0.452 0.000 0.024 0.144 0.008
#> SRR1652899     1  0.1628    0.77288 0.940 0.000 0.008 0.036 0.012 0.004
#> SRR1652900     1  0.7136   -0.29316 0.344 0.296 0.000 0.032 0.308 0.020
#> SRR1652901     2  0.5051    0.44251 0.140 0.716 0.004 0.024 0.108 0.008
#> SRR1652902     1  0.2504    0.75369 0.892 0.008 0.000 0.064 0.032 0.004
#> SRR1652903     1  0.0547    0.76593 0.980 0.000 0.000 0.020 0.000 0.000
#> SRR1652904     1  0.0692    0.76565 0.976 0.000 0.004 0.020 0.000 0.000
#> SRR1652905     2  0.4004    0.39106 0.004 0.744 0.004 0.028 0.216 0.004
#> SRR1652906     1  0.2683    0.74673 0.884 0.032 0.000 0.056 0.028 0.000
#> SRR1652907     1  0.3416    0.72034 0.848 0.020 0.004 0.076 0.044 0.008
#> SRR1652908     2  0.3986    0.42175 0.016 0.764 0.000 0.024 0.188 0.008
#> SRR1652909     1  0.2675    0.74414 0.880 0.004 0.000 0.080 0.024 0.012
#> SRR1652910     1  0.2220    0.76069 0.908 0.012 0.000 0.044 0.036 0.000
#> SRR1652911     1  0.0713    0.76383 0.972 0.000 0.000 0.028 0.000 0.000
#> SRR1652912     2  0.4112    0.36808 0.008 0.728 0.008 0.000 0.232 0.024
#> SRR1652913     1  0.1913    0.73650 0.908 0.000 0.000 0.080 0.000 0.012
#> SRR1652914     2  0.2552    0.50470 0.016 0.896 0.000 0.012 0.056 0.020
#> SRR1652915     2  0.6431   -0.00352 0.112 0.488 0.028 0.000 0.348 0.024
#> SRR1652916     1  0.2202    0.76876 0.904 0.008 0.000 0.072 0.012 0.004
#> SRR1652917     1  0.2649    0.75899 0.880 0.016 0.000 0.076 0.028 0.000
#> SRR1652918     4  0.7113    0.47194 0.340 0.012 0.036 0.460 0.044 0.108
#> SRR1652919     3  0.3602    0.74504 0.000 0.060 0.828 0.000 0.068 0.044
#> SRR1652920     2  0.5822    0.23081 0.024 0.608 0.000 0.072 0.264 0.032
#> SRR1652921     1  0.0858    0.76971 0.968 0.000 0.000 0.028 0.000 0.004
#> SRR1652922     3  0.5208    0.58515 0.004 0.000 0.648 0.036 0.056 0.256
#> SRR1652923     2  0.6501    0.06969 0.020 0.560 0.000 0.052 0.236 0.132
#> SRR1652924     1  0.1333    0.77318 0.944 0.000 0.000 0.048 0.008 0.000
#> SRR1652925     1  0.3369    0.57363 0.800 0.004 0.004 0.172 0.000 0.020
#> SRR1652926     1  0.4148    0.66060 0.784 0.048 0.000 0.112 0.056 0.000
#> SRR1652927     1  0.1082    0.77035 0.956 0.000 0.000 0.040 0.000 0.004
#> SRR1652928     1  0.0858    0.76484 0.968 0.000 0.004 0.028 0.000 0.000
#> SRR1652929     2  0.7870    0.02863 0.216 0.372 0.004 0.064 0.292 0.052
#> SRR1652930     1  0.1555    0.74617 0.932 0.000 0.004 0.060 0.000 0.004
#> SRR1652931     3  0.4281    0.54369 0.000 0.208 0.736 0.016 0.032 0.008
#> SRR1652932     1  0.1082    0.77140 0.956 0.000 0.004 0.040 0.000 0.000
#> SRR1652933     2  0.6064    0.33745 0.156 0.612 0.000 0.044 0.176 0.012
#> SRR1652934     1  0.4885    0.48108 0.700 0.196 0.000 0.044 0.060 0.000
#> SRR1652935     5  0.8137    0.46527 0.016 0.264 0.136 0.024 0.376 0.184
#> SRR1652936     2  0.4317    0.39459 0.000 0.744 0.004 0.016 0.184 0.052
#> SRR1652937     1  0.1453    0.76909 0.944 0.008 0.000 0.040 0.008 0.000
#> SRR1652938     6  0.6567    0.00000 0.092 0.000 0.060 0.360 0.016 0.472
#> SRR1652939     4  0.6108    0.44790 0.332 0.004 0.004 0.512 0.020 0.128
#> SRR1652940     1  0.1003    0.77201 0.964 0.000 0.000 0.028 0.004 0.004
#> SRR1652941     1  0.3873    0.70161 0.828 0.064 0.004 0.052 0.036 0.016
#> SRR1652942     2  0.4324    0.35859 0.000 0.744 0.008 0.008 0.180 0.060
#> SRR1652943     1  0.5496   -0.38735 0.544 0.000 0.008 0.368 0.020 0.060
#> SRR1652944     2  0.1788    0.48549 0.000 0.916 0.004 0.000 0.076 0.004
#> SRR1652945     4  0.5977    0.50308 0.396 0.000 0.016 0.480 0.016 0.092
#> SRR1652946     1  0.2212    0.69364 0.880 0.000 0.008 0.112 0.000 0.000
#> SRR1652947     3  0.2265    0.75132 0.032 0.000 0.912 0.028 0.004 0.024
#> SRR1652948     2  0.5332   -0.04164 0.000 0.576 0.036 0.004 0.344 0.040
#> SRR1652949     1  0.5956    0.17726 0.556 0.308 0.000 0.028 0.096 0.012
#> SRR1652950     2  0.5666    0.10319 0.420 0.484 0.000 0.020 0.068 0.008
#> SRR1652951     2  0.3159    0.43199 0.000 0.812 0.004 0.004 0.168 0.012
#> SRR1652953     1  0.1452    0.77321 0.948 0.000 0.004 0.032 0.008 0.008
#> SRR1652952     2  0.4243    0.31497 0.000 0.720 0.016 0.008 0.236 0.020
#> SRR1652954     1  0.2172    0.76671 0.912 0.024 0.000 0.044 0.020 0.000
#> SRR1652955     2  0.1814    0.48266 0.000 0.900 0.000 0.000 0.100 0.000
#> SRR1652958     1  0.1914    0.76440 0.920 0.008 0.000 0.056 0.016 0.000
#> SRR1652956     5  0.6938    0.51012 0.016 0.284 0.012 0.052 0.504 0.132
#> SRR1652957     1  0.1219    0.76030 0.948 0.000 0.000 0.048 0.000 0.004
#> SRR1652959     1  0.6928   -0.16187 0.404 0.388 0.000 0.068 0.124 0.016
#> SRR1652960     2  0.6165    0.34002 0.180 0.608 0.000 0.040 0.152 0.020
#> SRR1652961     1  0.6741    0.11580 0.532 0.272 0.000 0.068 0.096 0.032
#> SRR1652962     2  0.2813    0.47016 0.000 0.864 0.000 0.008 0.092 0.036
#> SRR1652963     2  0.3184    0.47477 0.024 0.832 0.000 0.004 0.132 0.008
#> SRR1652965     3  0.0520    0.77343 0.008 0.000 0.984 0.000 0.000 0.008
#> SRR1652964     2  0.6329    0.24995 0.284 0.560 0.004 0.028 0.092 0.032
#> SRR1652966     1  0.5249    0.44684 0.692 0.196 0.004 0.052 0.044 0.012
#> SRR1652967     3  0.4909    0.58793 0.000 0.000 0.664 0.012 0.088 0.236
#> SRR1652969     1  0.3639    0.67055 0.828 0.080 0.000 0.056 0.032 0.004
#> SRR1652968     2  0.1881    0.50296 0.008 0.928 0.000 0.012 0.044 0.008
#> SRR1652970     1  0.1644    0.77109 0.932 0.000 0.004 0.052 0.012 0.000
#> SRR1652971     3  0.1210    0.77128 0.008 0.000 0.960 0.008 0.004 0.020
#> SRR1652972     1  0.6167    0.15797 0.548 0.232 0.000 0.028 0.188 0.004
#> SRR1652973     1  0.3413    0.61707 0.800 0.008 0.000 0.172 0.008 0.012
#> SRR1652974     1  0.0713    0.77019 0.972 0.000 0.000 0.028 0.000 0.000
#> SRR1652975     1  0.3519    0.70427 0.836 0.028 0.000 0.096 0.016 0.024
#> SRR1652976     3  0.3469    0.74158 0.032 0.080 0.844 0.000 0.028 0.016
#> SRR1652977     2  0.2862    0.51521 0.036 0.880 0.000 0.016 0.056 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-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) are extracted by 'MAD' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.493           0.771       0.891         0.4790 0.495   0.495
#> 3 3 0.397           0.497       0.750         0.2670 0.989   0.977
#> 4 4 0.435           0.598       0.715         0.1162 0.736   0.473
#> 5 5 0.500           0.517       0.729         0.0598 0.907   0.697
#> 6 6 0.543           0.535       0.720         0.0362 0.836   0.516

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
#> SRR1652895     1  0.0000     0.8545 1.000 0.000
#> SRR1652896     2  0.9710     0.3021 0.400 0.600
#> SRR1652897     1  0.9795     0.3043 0.584 0.416
#> SRR1652898     1  0.0938     0.8564 0.988 0.012
#> SRR1652899     1  0.1414     0.8561 0.980 0.020
#> SRR1652900     2  0.0000     0.8770 0.000 1.000
#> SRR1652901     2  0.6531     0.7903 0.168 0.832
#> SRR1652902     1  0.1184     0.8564 0.984 0.016
#> SRR1652903     1  0.0000     0.8545 1.000 0.000
#> SRR1652904     1  0.0000     0.8545 1.000 0.000
#> SRR1652905     2  0.4161     0.8471 0.084 0.916
#> SRR1652906     1  0.2236     0.8500 0.964 0.036
#> SRR1652907     1  0.0000     0.8545 1.000 0.000
#> SRR1652908     2  0.0000     0.8770 0.000 1.000
#> SRR1652909     1  0.1633     0.8551 0.976 0.024
#> SRR1652910     1  0.1184     0.8565 0.984 0.016
#> SRR1652911     1  0.0000     0.8545 1.000 0.000
#> SRR1652912     2  0.0000     0.8770 0.000 1.000
#> SRR1652913     2  0.3274     0.8596 0.060 0.940
#> SRR1652914     1  0.9580     0.4647 0.620 0.380
#> SRR1652915     1  0.9209     0.5573 0.664 0.336
#> SRR1652916     1  0.4022     0.8235 0.920 0.080
#> SRR1652917     2  0.6973     0.7785 0.188 0.812
#> SRR1652918     2  0.0000     0.8770 0.000 1.000
#> SRR1652919     1  0.9248     0.5433 0.660 0.340
#> SRR1652920     2  0.0000     0.8770 0.000 1.000
#> SRR1652921     2  0.3584     0.8587 0.068 0.932
#> SRR1652922     1  0.9000     0.6007 0.684 0.316
#> SRR1652923     1  0.8661     0.6324 0.712 0.288
#> SRR1652924     2  0.3274     0.8596 0.060 0.940
#> SRR1652925     2  0.0000     0.8770 0.000 1.000
#> SRR1652926     2  0.0000     0.8770 0.000 1.000
#> SRR1652927     1  0.1843     0.8538 0.972 0.028
#> SRR1652928     1  0.0000     0.8545 1.000 0.000
#> SRR1652929     1  0.8661     0.6324 0.712 0.288
#> SRR1652930     1  0.0000     0.8545 1.000 0.000
#> SRR1652931     2  0.9970     0.0669 0.468 0.532
#> SRR1652932     1  0.0000     0.8545 1.000 0.000
#> SRR1652933     2  0.4431     0.8524 0.092 0.908
#> SRR1652934     2  0.7056     0.7748 0.192 0.808
#> SRR1652935     2  0.1414     0.8743 0.020 0.980
#> SRR1652936     2  0.0000     0.8770 0.000 1.000
#> SRR1652937     1  0.0672     0.8559 0.992 0.008
#> SRR1652938     2  0.2603     0.8702 0.044 0.956
#> SRR1652939     2  0.5178     0.8379 0.116 0.884
#> SRR1652940     1  0.0000     0.8545 1.000 0.000
#> SRR1652941     2  0.9522     0.4402 0.372 0.628
#> SRR1652942     2  0.0000     0.8770 0.000 1.000
#> SRR1652943     2  0.0000     0.8770 0.000 1.000
#> SRR1652944     1  0.9580     0.4647 0.620 0.380
#> SRR1652945     2  0.0000     0.8770 0.000 1.000
#> SRR1652946     2  0.3274     0.8596 0.060 0.940
#> SRR1652947     1  0.0000     0.8545 1.000 0.000
#> SRR1652948     2  0.9710     0.3021 0.400 0.600
#> SRR1652949     1  0.0938     0.8564 0.988 0.012
#> SRR1652950     1  0.7950     0.6950 0.760 0.240
#> SRR1652951     2  0.0000     0.8770 0.000 1.000
#> SRR1652953     1  0.0000     0.8545 1.000 0.000
#> SRR1652952     2  0.0000     0.8770 0.000 1.000
#> SRR1652954     2  0.7139     0.7715 0.196 0.804
#> SRR1652955     1  0.7453     0.7227 0.788 0.212
#> SRR1652958     1  0.1414     0.8561 0.980 0.020
#> SRR1652956     2  0.0000     0.8770 0.000 1.000
#> SRR1652957     2  0.6801     0.7934 0.180 0.820
#> SRR1652959     2  0.0672     0.8764 0.008 0.992
#> SRR1652960     2  0.0000     0.8770 0.000 1.000
#> SRR1652961     2  0.0000     0.8770 0.000 1.000
#> SRR1652962     2  0.0000     0.8770 0.000 1.000
#> SRR1652963     2  0.0000     0.8770 0.000 1.000
#> SRR1652965     1  0.4022     0.8270 0.920 0.080
#> SRR1652964     2  0.8327     0.6347 0.264 0.736
#> SRR1652966     1  0.1184     0.8567 0.984 0.016
#> SRR1652967     2  0.6048     0.8066 0.148 0.852
#> SRR1652969     2  0.6712     0.7853 0.176 0.824
#> SRR1652968     1  0.9580     0.4647 0.620 0.380
#> SRR1652970     1  0.0000     0.8545 1.000 0.000
#> SRR1652971     1  0.9460     0.5107 0.636 0.364
#> SRR1652972     1  0.1414     0.8559 0.980 0.020
#> SRR1652973     2  0.7056     0.7748 0.192 0.808
#> SRR1652974     1  0.0000     0.8545 1.000 0.000
#> SRR1652975     2  0.3733     0.8582 0.072 0.928
#> SRR1652976     2  0.8443     0.6224 0.272 0.728
#> SRR1652977     1  0.9580     0.4647 0.620 0.380

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652896     2  0.9089     0.0850 0.176 0.536 0.288
#> SRR1652897     1  0.9792    -0.1606 0.408 0.240 0.352
#> SRR1652898     1  0.0424     0.5699 0.992 0.000 0.008
#> SRR1652899     1  0.2200     0.5570 0.940 0.004 0.056
#> SRR1652900     2  0.0592     0.7042 0.000 0.988 0.012
#> SRR1652901     2  0.8129     0.6605 0.124 0.632 0.244
#> SRR1652902     1  0.1964     0.5582 0.944 0.000 0.056
#> SRR1652903     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652904     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652905     2  0.4605     0.7004 0.000 0.796 0.204
#> SRR1652906     1  0.3091     0.5312 0.912 0.016 0.072
#> SRR1652907     1  0.0237     0.5671 0.996 0.000 0.004
#> SRR1652908     2  0.3192     0.7275 0.000 0.888 0.112
#> SRR1652909     1  0.2400     0.5521 0.932 0.004 0.064
#> SRR1652910     1  0.0661     0.5699 0.988 0.004 0.008
#> SRR1652911     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652912     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652913     2  0.6927     0.6968 0.060 0.700 0.240
#> SRR1652914     1  0.9895    -0.0349 0.404 0.284 0.312
#> SRR1652915     1  0.9700     0.0239 0.448 0.240 0.312
#> SRR1652916     1  0.5466     0.4829 0.800 0.040 0.160
#> SRR1652917     2  0.8771     0.6317 0.140 0.556 0.304
#> SRR1652918     2  0.5480     0.7075 0.004 0.732 0.264
#> SRR1652919     1  0.9709     0.0206 0.448 0.244 0.308
#> SRR1652920     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652921     2  0.7053     0.6965 0.064 0.692 0.244
#> SRR1652922     1  0.9624    -0.0803 0.468 0.240 0.292
#> SRR1652923     1  0.9026     0.1410 0.556 0.196 0.248
#> SRR1652924     2  0.6927     0.6968 0.060 0.700 0.240
#> SRR1652925     2  0.3038     0.7250 0.000 0.896 0.104
#> SRR1652926     2  0.5244     0.7156 0.004 0.756 0.240
#> SRR1652927     1  0.1129     0.5679 0.976 0.004 0.020
#> SRR1652928     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652929     1  0.8868     0.1455 0.576 0.196 0.228
#> SRR1652930     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652931     2  0.9681    -0.0120 0.256 0.460 0.284
#> SRR1652932     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652933     2  0.7091     0.7085 0.064 0.688 0.248
#> SRR1652934     2  0.8677     0.6370 0.144 0.576 0.280
#> SRR1652935     2  0.1525     0.6883 0.004 0.964 0.032
#> SRR1652936     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652937     1  0.1289     0.5680 0.968 0.000 0.032
#> SRR1652938     2  0.6839     0.7023 0.044 0.684 0.272
#> SRR1652939     2  0.8173     0.6797 0.116 0.620 0.264
#> SRR1652940     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652941     2  0.9659     0.3569 0.220 0.440 0.340
#> SRR1652942     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652943     2  0.5480     0.7075 0.004 0.732 0.264
#> SRR1652944     1  0.9895    -0.0349 0.404 0.284 0.312
#> SRR1652945     2  0.5480     0.7075 0.004 0.732 0.264
#> SRR1652946     2  0.6927     0.6968 0.060 0.700 0.240
#> SRR1652947     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652948     2  0.9089     0.0850 0.176 0.536 0.288
#> SRR1652949     1  0.0424     0.5699 0.992 0.000 0.008
#> SRR1652950     1  0.9058     0.1278 0.544 0.180 0.276
#> SRR1652951     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652953     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652952     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652954     2  0.8825     0.6285 0.148 0.556 0.296
#> SRR1652955     1  0.8666     0.1676 0.584 0.152 0.264
#> SRR1652958     1  0.1525     0.5662 0.964 0.004 0.032
#> SRR1652956     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652957     2  0.8694     0.6414 0.152 0.580 0.268
#> SRR1652959     2  0.2261     0.7203 0.000 0.932 0.068
#> SRR1652960     2  0.2796     0.7264 0.000 0.908 0.092
#> SRR1652961     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652962     2  0.0424     0.7025 0.000 0.992 0.008
#> SRR1652963     2  0.1031     0.7084 0.000 0.976 0.024
#> SRR1652965     1  0.6646     0.3934 0.712 0.048 0.240
#> SRR1652964     2  0.8042     0.4046 0.148 0.652 0.200
#> SRR1652966     1  0.1529     0.5619 0.960 0.000 0.040
#> SRR1652967     2  0.5060     0.6012 0.064 0.836 0.100
#> SRR1652969     2  0.8597     0.6450 0.132 0.576 0.292
#> SRR1652968     1  0.9895    -0.0349 0.404 0.284 0.312
#> SRR1652970     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652971     3  0.9007     0.0000 0.180 0.268 0.552
#> SRR1652972     1  0.2301     0.5536 0.936 0.004 0.060
#> SRR1652973     2  0.8776     0.6326 0.144 0.560 0.296
#> SRR1652974     1  0.4605     0.4959 0.796 0.000 0.204
#> SRR1652975     2  0.6255     0.7240 0.048 0.748 0.204
#> SRR1652976     2  0.8148     0.3950 0.156 0.644 0.200
#> SRR1652977     1  0.9895    -0.0349 0.404 0.284 0.312

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.5285    0.30062 0.000 0.468 0.524 0.008
#> SRR1652897     1  0.6468    0.13016 0.576 0.072 0.004 0.348
#> SRR1652898     1  0.4401    0.69311 0.724 0.000 0.272 0.004
#> SRR1652899     1  0.4936    0.64229 0.672 0.000 0.316 0.012
#> SRR1652900     2  0.0188    0.75273 0.000 0.996 0.000 0.004
#> SRR1652901     4  0.7685    0.53733 0.004 0.352 0.192 0.452
#> SRR1652902     1  0.4814    0.64503 0.676 0.000 0.316 0.008
#> SRR1652903     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.6706    0.18466 0.000 0.588 0.124 0.288
#> SRR1652906     1  0.5349    0.57882 0.644 0.012 0.336 0.008
#> SRR1652907     1  0.4103    0.70403 0.744 0.000 0.256 0.000
#> SRR1652908     2  0.3494    0.55123 0.000 0.824 0.004 0.172
#> SRR1652909     1  0.5134    0.62971 0.664 0.004 0.320 0.012
#> SRR1652910     1  0.4539    0.69170 0.720 0.000 0.272 0.008
#> SRR1652911     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652913     4  0.6021    0.74984 0.052 0.320 0.004 0.624
#> SRR1652914     3  0.7092    0.70706 0.164 0.216 0.608 0.012
#> SRR1652915     3  0.7078    0.68272 0.200 0.176 0.612 0.012
#> SRR1652916     1  0.4222    0.70274 0.832 0.004 0.084 0.080
#> SRR1652917     4  0.7642    0.71023 0.020 0.252 0.176 0.552
#> SRR1652918     4  0.4804    0.69577 0.000 0.384 0.000 0.616
#> SRR1652919     3  0.6943    0.68633 0.184 0.176 0.628 0.012
#> SRR1652920     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652921     4  0.6236    0.75385 0.052 0.312 0.012 0.624
#> SRR1652922     3  0.7740    0.40574 0.376 0.160 0.452 0.012
#> SRR1652923     3  0.7098    0.56369 0.288 0.132 0.572 0.008
#> SRR1652924     4  0.6021    0.74984 0.052 0.320 0.004 0.624
#> SRR1652925     2  0.4713   -0.00128 0.000 0.640 0.000 0.360
#> SRR1652926     4  0.5070    0.66530 0.000 0.416 0.004 0.580
#> SRR1652927     1  0.4826    0.69104 0.716 0.000 0.264 0.020
#> SRR1652928     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652929     3  0.7189    0.53741 0.308 0.132 0.552 0.008
#> SRR1652930     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652931     3  0.6602    0.47647 0.040 0.388 0.548 0.024
#> SRR1652932     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652933     2  0.7155   -0.56824 0.020 0.452 0.076 0.452
#> SRR1652934     4  0.7786    0.69607 0.024 0.268 0.172 0.536
#> SRR1652935     2  0.1022    0.73611 0.000 0.968 0.032 0.000
#> SRR1652936     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.4188    0.70282 0.752 0.000 0.244 0.004
#> SRR1652938     4  0.5074    0.72560 0.000 0.236 0.040 0.724
#> SRR1652939     4  0.6423    0.74989 0.012 0.224 0.100 0.664
#> SRR1652940     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652941     3  0.9029   -0.18934 0.060 0.264 0.364 0.312
#> SRR1652942     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652943     4  0.4804    0.69577 0.000 0.384 0.000 0.616
#> SRR1652944     3  0.7092    0.70706 0.164 0.216 0.608 0.012
#> SRR1652945     4  0.4804    0.69577 0.000 0.384 0.000 0.616
#> SRR1652946     4  0.6021    0.74984 0.052 0.320 0.004 0.624
#> SRR1652947     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652948     3  0.5285    0.30062 0.000 0.468 0.524 0.008
#> SRR1652949     1  0.4401    0.69311 0.724 0.000 0.272 0.004
#> SRR1652950     3  0.7359    0.56246 0.296 0.132 0.556 0.016
#> SRR1652951     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652954     4  0.7789    0.71020 0.028 0.252 0.172 0.548
#> SRR1652955     3  0.7019    0.49044 0.332 0.108 0.552 0.008
#> SRR1652958     1  0.4795    0.67048 0.696 0.000 0.292 0.012
#> SRR1652956     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652957     4  0.7599    0.73837 0.056 0.220 0.120 0.604
#> SRR1652959     2  0.3768    0.53257 0.000 0.808 0.008 0.184
#> SRR1652960     2  0.3052    0.61295 0.000 0.860 0.004 0.136
#> SRR1652961     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652962     2  0.0000    0.75495 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.0657    0.74766 0.000 0.984 0.004 0.012
#> SRR1652965     1  0.2790    0.69797 0.904 0.012 0.072 0.012
#> SRR1652964     2  0.7299    0.00812 0.056 0.548 0.344 0.052
#> SRR1652966     1  0.4608    0.66238 0.692 0.000 0.304 0.004
#> SRR1652967     2  0.3662    0.59487 0.004 0.836 0.148 0.012
#> SRR1652969     4  0.7448    0.70902 0.012 0.260 0.172 0.556
#> SRR1652968     3  0.7092    0.70706 0.164 0.216 0.608 0.012
#> SRR1652970     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652971     3  0.9740    0.06551 0.232 0.164 0.352 0.252
#> SRR1652972     1  0.5012    0.63286 0.668 0.004 0.320 0.008
#> SRR1652973     4  0.7701    0.71256 0.024 0.252 0.172 0.552
#> SRR1652974     1  0.0000    0.76358 1.000 0.000 0.000 0.000
#> SRR1652975     2  0.6612   -0.34989 0.004 0.524 0.072 0.400
#> SRR1652976     2  0.7256   -0.02112 0.056 0.544 0.352 0.048
#> SRR1652977     3  0.7092    0.70706 0.164 0.216 0.608 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
#> SRR1652895     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652896     3  0.7552     0.5052 0.164 0.372 0.412 0.036 0.016
#> SRR1652897     4  0.6673    -0.0756 0.244 0.000 0.332 0.424 0.000
#> SRR1652898     1  0.0162     0.5646 0.996 0.000 0.004 0.000 0.000
#> SRR1652899     1  0.1626     0.5189 0.940 0.000 0.044 0.016 0.000
#> SRR1652900     2  0.0162     0.7903 0.000 0.996 0.000 0.004 0.000
#> SRR1652901     4  0.7215     0.6042 0.128 0.220 0.104 0.548 0.000
#> SRR1652902     1  0.1522     0.5214 0.944 0.000 0.044 0.012 0.000
#> SRR1652903     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652904     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652905     2  0.6240    -0.0385 0.000 0.488 0.152 0.360 0.000
#> SRR1652906     1  0.2052     0.4577 0.912 0.004 0.080 0.004 0.000
#> SRR1652907     1  0.0609     0.5762 0.980 0.000 0.020 0.000 0.000
#> SRR1652908     2  0.3455     0.5643 0.000 0.784 0.008 0.208 0.000
#> SRR1652909     1  0.1774     0.5089 0.932 0.000 0.052 0.016 0.000
#> SRR1652910     1  0.0162     0.5656 0.996 0.000 0.000 0.004 0.000
#> SRR1652911     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652912     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652913     4  0.4312     0.7216 0.032 0.176 0.020 0.772 0.000
#> SRR1652914     3  0.6649     0.8032 0.384 0.156 0.448 0.012 0.000
#> SRR1652915     3  0.6379     0.7570 0.428 0.116 0.444 0.012 0.000
#> SRR1652916     1  0.4714     0.5650 0.724 0.000 0.192 0.084 0.000
#> SRR1652917     4  0.6211     0.7122 0.132 0.140 0.068 0.660 0.000
#> SRR1652918     4  0.3424     0.6853 0.000 0.240 0.000 0.760 0.000
#> SRR1652919     3  0.6379     0.7579 0.428 0.116 0.444 0.012 0.000
#> SRR1652920     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652921     4  0.4314     0.7254 0.036 0.168 0.020 0.776 0.000
#> SRR1652922     3  0.7203     0.4402 0.400 0.144 0.416 0.008 0.032
#> SRR1652923     1  0.5783    -0.6145 0.540 0.084 0.372 0.004 0.000
#> SRR1652924     4  0.4312     0.7216 0.032 0.176 0.020 0.772 0.000
#> SRR1652925     2  0.4305    -0.2038 0.000 0.512 0.000 0.488 0.000
#> SRR1652926     4  0.3910     0.6719 0.000 0.272 0.008 0.720 0.000
#> SRR1652927     1  0.0671     0.5648 0.980 0.000 0.004 0.016 0.000
#> SRR1652928     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652929     1  0.5731    -0.5855 0.560 0.084 0.352 0.004 0.000
#> SRR1652930     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652931     3  0.7401     0.6333 0.252 0.332 0.384 0.032 0.000
#> SRR1652932     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652933     4  0.6263     0.5919 0.056 0.336 0.052 0.556 0.000
#> SRR1652934     4  0.6378     0.7039 0.132 0.152 0.072 0.644 0.000
#> SRR1652935     2  0.1124     0.7709 0.000 0.960 0.036 0.004 0.000
#> SRR1652936     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1  0.2358     0.5824 0.888 0.000 0.104 0.008 0.000
#> SRR1652938     4  0.1356     0.6168 0.028 0.012 0.004 0.956 0.000
#> SRR1652939     4  0.4028     0.7236 0.104 0.080 0.008 0.808 0.000
#> SRR1652940     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652941     4  0.8319     0.0979 0.212 0.164 0.248 0.376 0.000
#> SRR1652942     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     4  0.3424     0.6853 0.000 0.240 0.000 0.760 0.000
#> SRR1652944     3  0.6649     0.8032 0.384 0.156 0.448 0.012 0.000
#> SRR1652945     4  0.3424     0.6853 0.000 0.240 0.000 0.760 0.000
#> SRR1652946     4  0.4312     0.7216 0.032 0.176 0.020 0.772 0.000
#> SRR1652947     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652948     3  0.7550     0.5115 0.164 0.368 0.416 0.036 0.016
#> SRR1652949     1  0.0000     0.5668 1.000 0.000 0.000 0.000 0.000
#> SRR1652950     1  0.6213    -0.6211 0.520 0.088 0.372 0.020 0.000
#> SRR1652951     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652953     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652952     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     4  0.6250     0.7124 0.136 0.140 0.068 0.656 0.000
#> SRR1652955     1  0.5595    -0.5502 0.568 0.072 0.356 0.004 0.000
#> SRR1652958     1  0.1012     0.5472 0.968 0.000 0.020 0.012 0.000
#> SRR1652956     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     4  0.5262     0.7253 0.124 0.096 0.044 0.736 0.000
#> SRR1652959     2  0.3878     0.5102 0.000 0.748 0.016 0.236 0.000
#> SRR1652960     2  0.3048     0.6178 0.000 0.820 0.004 0.176 0.000
#> SRR1652961     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000     0.7918 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     2  0.0898     0.7825 0.000 0.972 0.008 0.020 0.000
#> SRR1652965     1  0.5550     0.4583 0.528 0.000 0.400 0.000 0.072
#> SRR1652964     2  0.7201    -0.2333 0.144 0.476 0.324 0.056 0.000
#> SRR1652966     1  0.1341     0.5209 0.944 0.000 0.056 0.000 0.000
#> SRR1652967     2  0.6853     0.3758 0.060 0.640 0.140 0.032 0.128
#> SRR1652969     4  0.6205     0.7093 0.124 0.148 0.068 0.660 0.000
#> SRR1652968     3  0.6649     0.8032 0.384 0.156 0.448 0.012 0.000
#> SRR1652970     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652971     5  0.3722     0.0000 0.020 0.032 0.120 0.000 0.828
#> SRR1652972     1  0.1670     0.5115 0.936 0.000 0.052 0.012 0.000
#> SRR1652973     4  0.6211     0.7136 0.132 0.140 0.068 0.660 0.000
#> SRR1652974     1  0.4192     0.5633 0.596 0.000 0.404 0.000 0.000
#> SRR1652975     4  0.6131     0.4306 0.044 0.412 0.044 0.500 0.000
#> SRR1652976     2  0.7205    -0.2594 0.152 0.472 0.324 0.052 0.000
#> SRR1652977     3  0.6649     0.8032 0.384 0.156 0.448 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
#> SRR1652895     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.5889     0.1183 0.000 0.264 0.476 0.000 0.000 0.260
#> SRR1652897     1  0.3804     0.1136 0.576 0.000 0.000 0.424 0.000 0.000
#> SRR1652898     3  0.4855     0.2080 0.460 0.000 0.484 0.000 0.000 0.056
#> SRR1652899     3  0.4940     0.2771 0.428 0.000 0.520 0.012 0.000 0.040
#> SRR1652900     2  0.0146     0.8270 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652901     4  0.6024     0.6670 0.000 0.164 0.264 0.544 0.000 0.028
#> SRR1652902     3  0.4856     0.2736 0.432 0.000 0.520 0.008 0.000 0.040
#> SRR1652903     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.6882    -0.2362 0.000 0.396 0.164 0.360 0.000 0.080
#> SRR1652906     3  0.5012     0.3289 0.376 0.004 0.560 0.004 0.000 0.056
#> SRR1652907     1  0.4855    -0.2285 0.484 0.000 0.460 0.000 0.000 0.056
#> SRR1652908     2  0.3103     0.5998 0.000 0.784 0.008 0.208 0.000 0.000
#> SRR1652909     3  0.4820     0.2792 0.428 0.000 0.528 0.012 0.000 0.032
#> SRR1652910     3  0.4984     0.2043 0.460 0.000 0.480 0.004 0.000 0.056
#> SRR1652911     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     4  0.3758     0.7731 0.048 0.176 0.004 0.772 0.000 0.000
#> SRR1652914     3  0.2711     0.4979 0.000 0.084 0.872 0.008 0.000 0.036
#> SRR1652915     3  0.2420     0.5125 0.008 0.056 0.900 0.008 0.000 0.028
#> SRR1652916     1  0.5291     0.3667 0.640 0.000 0.244 0.084 0.000 0.032
#> SRR1652917     4  0.5493     0.7585 0.012 0.100 0.204 0.656 0.000 0.028
#> SRR1652918     4  0.3076     0.7355 0.000 0.240 0.000 0.760 0.000 0.000
#> SRR1652919     3  0.2458     0.5100 0.012 0.052 0.900 0.008 0.000 0.028
#> SRR1652920     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652921     4  0.3897     0.7767 0.048 0.168 0.012 0.772 0.000 0.000
#> SRR1652922     3  0.6783     0.0682 0.076 0.104 0.464 0.004 0.008 0.344
#> SRR1652923     3  0.1972     0.5106 0.000 0.024 0.916 0.004 0.000 0.056
#> SRR1652924     4  0.3758     0.7731 0.048 0.176 0.004 0.772 0.000 0.000
#> SRR1652925     2  0.3867    -0.2035 0.000 0.512 0.000 0.488 0.000 0.000
#> SRR1652926     4  0.3932     0.7376 0.000 0.248 0.028 0.720 0.000 0.004
#> SRR1652927     3  0.5246     0.2044 0.456 0.000 0.472 0.016 0.000 0.056
#> SRR1652928     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.2510     0.5106 0.020 0.024 0.896 0.004 0.000 0.056
#> SRR1652930     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652931     3  0.5404     0.3475 0.000 0.224 0.636 0.028 0.000 0.112
#> SRR1652932     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.6133     0.6684 0.016 0.292 0.112 0.552 0.000 0.028
#> SRR1652934     4  0.5671     0.7517 0.016 0.104 0.212 0.640 0.000 0.028
#> SRR1652935     2  0.1257     0.7982 0.000 0.952 0.028 0.000 0.000 0.020
#> SRR1652936     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.4680    -0.0262 0.564 0.000 0.396 0.008 0.000 0.032
#> SRR1652938     4  0.0520     0.6300 0.000 0.008 0.000 0.984 0.000 0.008
#> SRR1652939     4  0.3458     0.7723 0.000 0.080 0.112 0.808 0.000 0.000
#> SRR1652940     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.6519    -0.2675 0.016 0.076 0.468 0.372 0.000 0.068
#> SRR1652942     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     4  0.3076     0.7355 0.000 0.240 0.000 0.760 0.000 0.000
#> SRR1652944     3  0.2711     0.4979 0.000 0.084 0.872 0.008 0.000 0.036
#> SRR1652945     4  0.3076     0.7355 0.000 0.240 0.000 0.760 0.000 0.000
#> SRR1652946     4  0.3758     0.7731 0.048 0.176 0.004 0.772 0.000 0.000
#> SRR1652947     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652948     3  0.5876     0.1209 0.000 0.260 0.480 0.000 0.000 0.260
#> SRR1652949     3  0.4856     0.1994 0.464 0.000 0.480 0.000 0.000 0.056
#> SRR1652950     3  0.3858     0.5363 0.100 0.040 0.816 0.016 0.000 0.028
#> SRR1652951     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     4  0.5633     0.7583 0.020 0.100 0.200 0.652 0.000 0.028
#> SRR1652955     3  0.3210     0.5371 0.108 0.032 0.840 0.000 0.000 0.020
#> SRR1652958     3  0.5114     0.2419 0.444 0.000 0.492 0.012 0.000 0.052
#> SRR1652956     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652957     4  0.4788     0.7716 0.048 0.096 0.124 0.732 0.000 0.000
#> SRR1652959     2  0.3642     0.5377 0.000 0.744 0.012 0.236 0.000 0.008
#> SRR1652960     2  0.2738     0.6539 0.000 0.820 0.004 0.176 0.000 0.000
#> SRR1652961     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000     0.8287 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0806     0.8181 0.000 0.972 0.008 0.020 0.000 0.000
#> SRR1652965     1  0.3253     0.6055 0.788 0.000 0.000 0.000 0.020 0.192
#> SRR1652964     3  0.5678     0.0604 0.000 0.384 0.512 0.056 0.000 0.048
#> SRR1652966     3  0.4819     0.2766 0.416 0.000 0.528 0.000 0.000 0.056
#> SRR1652967     2  0.5346     0.0510 0.000 0.460 0.072 0.000 0.012 0.456
#> SRR1652969     4  0.5377     0.7580 0.004 0.108 0.204 0.656 0.000 0.028
#> SRR1652968     3  0.2711     0.4979 0.000 0.084 0.872 0.008 0.000 0.036
#> SRR1652970     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.0717     0.0000 0.016 0.008 0.000 0.000 0.976 0.000
#> SRR1652972     3  0.4736     0.2766 0.432 0.000 0.528 0.008 0.000 0.032
#> SRR1652973     4  0.5553     0.7598 0.016 0.100 0.200 0.656 0.000 0.028
#> SRR1652974     1  0.0000     0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652975     4  0.5838     0.5111 0.000 0.376 0.100 0.496 0.000 0.028
#> SRR1652976     3  0.5614     0.0891 0.000 0.376 0.524 0.052 0.000 0.048
#> SRR1652977     3  0.2711     0.4979 0.000 0.084 0.872 0.008 0.000 0.036

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

consensus_heatmap(res, k = 2)

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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-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.545           0.770       0.904         0.4904 0.495   0.495
#> 3 3 0.783           0.798       0.899         0.3611 0.702   0.467
#> 4 4 0.800           0.877       0.903         0.1088 0.851   0.589
#> 5 5 0.828           0.811       0.887         0.0489 0.989   0.957
#> 6 6 0.781           0.607       0.815         0.0338 0.980   0.917

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
#> SRR1652895     1  0.0000     0.8911 1.000 0.000
#> SRR1652896     2  0.6973     0.7389 0.188 0.812
#> SRR1652897     1  0.0000     0.8911 1.000 0.000
#> SRR1652898     1  0.0000     0.8911 1.000 0.000
#> SRR1652899     1  0.0000     0.8911 1.000 0.000
#> SRR1652900     2  0.0000     0.8782 0.000 1.000
#> SRR1652901     2  0.0000     0.8782 0.000 1.000
#> SRR1652902     1  0.0000     0.8911 1.000 0.000
#> SRR1652903     1  0.0000     0.8911 1.000 0.000
#> SRR1652904     1  0.0000     0.8911 1.000 0.000
#> SRR1652905     2  0.0000     0.8782 0.000 1.000
#> SRR1652906     1  0.0000     0.8911 1.000 0.000
#> SRR1652907     1  0.0000     0.8911 1.000 0.000
#> SRR1652908     2  0.0000     0.8782 0.000 1.000
#> SRR1652909     1  0.0000     0.8911 1.000 0.000
#> SRR1652910     1  0.0000     0.8911 1.000 0.000
#> SRR1652911     1  0.0000     0.8911 1.000 0.000
#> SRR1652912     2  0.0000     0.8782 0.000 1.000
#> SRR1652913     1  0.9850     0.1123 0.572 0.428
#> SRR1652914     2  0.9993     0.0416 0.484 0.516
#> SRR1652915     1  0.7299     0.7241 0.796 0.204
#> SRR1652916     1  0.0000     0.8911 1.000 0.000
#> SRR1652917     2  0.9358     0.5028 0.352 0.648
#> SRR1652918     2  0.0000     0.8782 0.000 1.000
#> SRR1652919     1  0.7139     0.7328 0.804 0.196
#> SRR1652920     2  0.0000     0.8782 0.000 1.000
#> SRR1652921     2  0.9988     0.1897 0.480 0.520
#> SRR1652922     1  0.7883     0.6826 0.764 0.236
#> SRR1652923     1  0.9000     0.5479 0.684 0.316
#> SRR1652924     2  0.0000     0.8782 0.000 1.000
#> SRR1652925     2  0.0000     0.8782 0.000 1.000
#> SRR1652926     2  0.0000     0.8782 0.000 1.000
#> SRR1652927     1  0.0000     0.8911 1.000 0.000
#> SRR1652928     1  0.0000     0.8911 1.000 0.000
#> SRR1652929     1  0.7299     0.7241 0.796 0.204
#> SRR1652930     1  0.0000     0.8911 1.000 0.000
#> SRR1652931     2  0.7883     0.6781 0.236 0.764
#> SRR1652932     1  0.0000     0.8911 1.000 0.000
#> SRR1652933     2  0.0000     0.8782 0.000 1.000
#> SRR1652934     2  0.8861     0.5771 0.304 0.696
#> SRR1652935     2  0.0000     0.8782 0.000 1.000
#> SRR1652936     2  0.0000     0.8782 0.000 1.000
#> SRR1652937     1  0.0000     0.8911 1.000 0.000
#> SRR1652938     2  0.6801     0.7456 0.180 0.820
#> SRR1652939     2  0.8499     0.6218 0.276 0.724
#> SRR1652940     1  0.0000     0.8911 1.000 0.000
#> SRR1652941     1  0.9170     0.5138 0.668 0.332
#> SRR1652942     2  0.0000     0.8782 0.000 1.000
#> SRR1652943     2  0.0000     0.8782 0.000 1.000
#> SRR1652944     2  0.9970     0.1051 0.468 0.532
#> SRR1652945     2  0.0000     0.8782 0.000 1.000
#> SRR1652946     2  0.0376     0.8758 0.004 0.996
#> SRR1652947     1  0.0000     0.8911 1.000 0.000
#> SRR1652948     2  0.4161     0.8286 0.084 0.916
#> SRR1652949     1  0.0000     0.8911 1.000 0.000
#> SRR1652950     1  0.8267     0.6462 0.740 0.260
#> SRR1652951     2  0.0000     0.8782 0.000 1.000
#> SRR1652953     1  0.0000     0.8911 1.000 0.000
#> SRR1652952     2  0.0000     0.8782 0.000 1.000
#> SRR1652954     2  0.9866     0.3232 0.432 0.568
#> SRR1652955     1  0.0000     0.8911 1.000 0.000
#> SRR1652958     1  0.0000     0.8911 1.000 0.000
#> SRR1652956     2  0.0000     0.8782 0.000 1.000
#> SRR1652957     2  0.9833     0.3397 0.424 0.576
#> SRR1652959     2  0.0000     0.8782 0.000 1.000
#> SRR1652960     2  0.0000     0.8782 0.000 1.000
#> SRR1652961     2  0.0000     0.8782 0.000 1.000
#> SRR1652962     2  0.0000     0.8782 0.000 1.000
#> SRR1652963     2  0.0000     0.8782 0.000 1.000
#> SRR1652965     1  0.6531     0.7609 0.832 0.168
#> SRR1652964     2  0.0000     0.8782 0.000 1.000
#> SRR1652966     1  0.0000     0.8911 1.000 0.000
#> SRR1652967     2  0.5178     0.8053 0.116 0.884
#> SRR1652969     2  0.0000     0.8782 0.000 1.000
#> SRR1652968     1  0.8955     0.5556 0.688 0.312
#> SRR1652970     1  0.0000     0.8911 1.000 0.000
#> SRR1652971     1  0.9866     0.2553 0.568 0.432
#> SRR1652972     1  0.0000     0.8911 1.000 0.000
#> SRR1652973     2  0.8909     0.5714 0.308 0.692
#> SRR1652974     1  0.0000     0.8911 1.000 0.000
#> SRR1652975     2  0.0000     0.8782 0.000 1.000
#> SRR1652976     2  0.5178     0.8053 0.116 0.884
#> SRR1652977     1  0.9850     0.2481 0.572 0.428

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652896     3  0.2537     0.7712 0.000 0.080 0.920
#> SRR1652897     1  0.2063     0.9031 0.948 0.044 0.008
#> SRR1652898     1  0.3267     0.8327 0.884 0.000 0.116
#> SRR1652899     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652900     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652901     3  0.6045     0.4047 0.000 0.380 0.620
#> SRR1652902     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652903     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652905     2  0.1860     0.9262 0.000 0.948 0.052
#> SRR1652906     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652907     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652908     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652909     1  0.6286     0.0129 0.536 0.000 0.464
#> SRR1652910     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652911     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652912     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652913     1  0.9098     0.1620 0.492 0.360 0.148
#> SRR1652914     3  0.0829     0.8045 0.004 0.012 0.984
#> SRR1652915     3  0.1643     0.8025 0.044 0.000 0.956
#> SRR1652916     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652917     3  0.7308     0.5837 0.056 0.296 0.648
#> SRR1652918     2  0.1031     0.9021 0.000 0.976 0.024
#> SRR1652919     3  0.1411     0.8051 0.036 0.000 0.964
#> SRR1652920     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652921     3  0.9050     0.4840 0.168 0.296 0.536
#> SRR1652922     3  0.1525     0.8060 0.032 0.004 0.964
#> SRR1652923     3  0.0892     0.8072 0.020 0.000 0.980
#> SRR1652924     2  0.2625     0.8625 0.000 0.916 0.084
#> SRR1652925     2  0.0892     0.9026 0.000 0.980 0.020
#> SRR1652926     2  0.1529     0.8962 0.000 0.960 0.040
#> SRR1652927     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652928     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652929     3  0.1643     0.8025 0.044 0.000 0.956
#> SRR1652930     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652931     3  0.0892     0.8026 0.000 0.020 0.980
#> SRR1652932     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652933     2  0.2625     0.8625 0.000 0.916 0.084
#> SRR1652934     3  0.5919     0.6431 0.016 0.260 0.724
#> SRR1652935     2  0.6026     0.3720 0.000 0.624 0.376
#> SRR1652936     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652937     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652938     3  0.7581     0.4048 0.044 0.408 0.548
#> SRR1652939     3  0.7712     0.4325 0.052 0.392 0.556
#> SRR1652940     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652941     3  0.1753     0.7864 0.000 0.048 0.952
#> SRR1652942     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652943     2  0.1163     0.9014 0.000 0.972 0.028
#> SRR1652944     3  0.0892     0.8026 0.000 0.020 0.980
#> SRR1652945     2  0.1163     0.9014 0.000 0.972 0.028
#> SRR1652946     2  0.2625     0.8625 0.000 0.916 0.084
#> SRR1652947     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652948     3  0.2537     0.7712 0.000 0.080 0.920
#> SRR1652949     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652950     3  0.1289     0.8060 0.032 0.000 0.968
#> SRR1652951     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652953     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652952     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652954     3  0.8186     0.5539 0.104 0.292 0.604
#> SRR1652955     3  0.2448     0.7874 0.076 0.000 0.924
#> SRR1652958     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652956     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652957     3  0.9332     0.2620 0.164 0.404 0.432
#> SRR1652959     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652960     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652961     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652962     2  0.1753     0.9275 0.000 0.952 0.048
#> SRR1652963     2  0.2066     0.9186 0.000 0.940 0.060
#> SRR1652965     3  0.6062     0.3156 0.384 0.000 0.616
#> SRR1652964     3  0.6309     0.0577 0.000 0.496 0.504
#> SRR1652966     1  0.0424     0.9444 0.992 0.000 0.008
#> SRR1652967     3  0.1289     0.7990 0.000 0.032 0.968
#> SRR1652969     2  0.5785     0.3778 0.000 0.668 0.332
#> SRR1652968     3  0.0892     0.8072 0.020 0.000 0.980
#> SRR1652970     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652971     3  0.1129     0.8066 0.020 0.004 0.976
#> SRR1652972     3  0.2537     0.7859 0.080 0.000 0.920
#> SRR1652973     3  0.7726     0.4681 0.056 0.372 0.572
#> SRR1652974     1  0.0000     0.9515 1.000 0.000 0.000
#> SRR1652975     2  0.1163     0.9014 0.000 0.972 0.028
#> SRR1652976     3  0.0892     0.8026 0.000 0.020 0.980
#> SRR1652977     3  0.0747     0.8070 0.016 0.000 0.984

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652896     3  0.2500      0.908 0.000 0.040 0.916 0.044
#> SRR1652897     1  0.4008      0.684 0.756 0.000 0.000 0.244
#> SRR1652898     1  0.4182      0.786 0.796 0.000 0.180 0.024
#> SRR1652899     1  0.1297      0.955 0.964 0.000 0.016 0.020
#> SRR1652900     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652901     4  0.6659      0.293 0.000 0.084 0.448 0.468
#> SRR1652902     1  0.1297      0.955 0.964 0.000 0.016 0.020
#> SRR1652903     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652904     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652905     2  0.3356      0.703 0.000 0.824 0.000 0.176
#> SRR1652906     1  0.1406      0.953 0.960 0.000 0.016 0.024
#> SRR1652907     1  0.0779      0.957 0.980 0.000 0.016 0.004
#> SRR1652908     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652909     1  0.4728      0.720 0.752 0.000 0.216 0.032
#> SRR1652910     1  0.1297      0.955 0.964 0.000 0.016 0.020
#> SRR1652911     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652912     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652913     4  0.5588      0.781 0.112 0.052 0.064 0.772
#> SRR1652914     3  0.1022      0.937 0.000 0.000 0.968 0.032
#> SRR1652915     3  0.0817      0.936 0.000 0.000 0.976 0.024
#> SRR1652916     1  0.0592      0.957 0.984 0.000 0.000 0.016
#> SRR1652917     4  0.4933      0.830 0.024 0.056 0.120 0.800
#> SRR1652918     4  0.4103      0.775 0.000 0.256 0.000 0.744
#> SRR1652919     3  0.0921      0.926 0.000 0.000 0.972 0.028
#> SRR1652920     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652921     4  0.5015      0.830 0.032 0.056 0.112 0.800
#> SRR1652922     3  0.2647      0.873 0.000 0.000 0.880 0.120
#> SRR1652923     3  0.1022      0.937 0.000 0.000 0.968 0.032
#> SRR1652924     4  0.3764      0.803 0.000 0.216 0.000 0.784
#> SRR1652925     4  0.4977      0.412 0.000 0.460 0.000 0.540
#> SRR1652926     4  0.3942      0.794 0.000 0.236 0.000 0.764
#> SRR1652927     1  0.1297      0.955 0.964 0.000 0.016 0.020
#> SRR1652928     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652929     3  0.0707      0.936 0.000 0.000 0.980 0.020
#> SRR1652930     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652931     3  0.0707      0.937 0.000 0.000 0.980 0.020
#> SRR1652932     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652933     4  0.4053      0.799 0.000 0.228 0.004 0.768
#> SRR1652934     4  0.4708      0.821 0.012 0.048 0.140 0.800
#> SRR1652935     2  0.5090      0.631 0.000 0.728 0.228 0.044
#> SRR1652936     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.0000      0.960 1.000 0.000 0.000 0.000
#> SRR1652938     4  0.5210      0.835 0.020 0.084 0.112 0.784
#> SRR1652939     4  0.4939      0.834 0.020 0.068 0.112 0.800
#> SRR1652940     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652941     3  0.1474      0.930 0.000 0.000 0.948 0.052
#> SRR1652942     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652943     4  0.4008      0.787 0.000 0.244 0.000 0.756
#> SRR1652944     3  0.1022      0.937 0.000 0.000 0.968 0.032
#> SRR1652945     4  0.4008      0.787 0.000 0.244 0.000 0.756
#> SRR1652946     4  0.3726      0.805 0.000 0.212 0.000 0.788
#> SRR1652947     1  0.0895      0.957 0.976 0.000 0.004 0.020
#> SRR1652948     3  0.3354      0.869 0.000 0.084 0.872 0.044
#> SRR1652949     1  0.0927      0.956 0.976 0.000 0.016 0.008
#> SRR1652950     3  0.1118      0.936 0.000 0.000 0.964 0.036
#> SRR1652951     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652952     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652954     4  0.4977      0.831 0.028 0.056 0.116 0.800
#> SRR1652955     3  0.1042      0.932 0.008 0.000 0.972 0.020
#> SRR1652958     1  0.1297      0.955 0.964 0.000 0.016 0.020
#> SRR1652956     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652957     4  0.5049      0.833 0.032 0.064 0.104 0.800
#> SRR1652959     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652962     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.0336      0.953 0.000 0.992 0.008 0.000
#> SRR1652965     3  0.6621      0.621 0.188 0.000 0.628 0.184
#> SRR1652964     4  0.6826      0.371 0.000 0.100 0.416 0.484
#> SRR1652966     1  0.1929      0.943 0.940 0.000 0.036 0.024
#> SRR1652967     3  0.2530      0.902 0.000 0.004 0.896 0.100
#> SRR1652969     4  0.4669      0.833 0.000 0.100 0.104 0.796
#> SRR1652968     3  0.1022      0.937 0.000 0.000 0.968 0.032
#> SRR1652970     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652971     3  0.3649      0.831 0.000 0.000 0.796 0.204
#> SRR1652972     3  0.1452      0.923 0.008 0.000 0.956 0.036
#> SRR1652973     4  0.4924      0.833 0.020 0.064 0.116 0.800
#> SRR1652974     1  0.0188      0.960 0.996 0.000 0.000 0.004
#> SRR1652975     4  0.4008      0.787 0.000 0.244 0.000 0.756
#> SRR1652976     3  0.0592      0.936 0.000 0.000 0.984 0.016
#> SRR1652977     3  0.1022      0.937 0.000 0.000 0.968 0.032

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652896     3  0.3181      0.719 0.000 0.072 0.856 0.000 0.072
#> SRR1652897     1  0.6080      0.419 0.528 0.000 0.000 0.332 0.140
#> SRR1652898     1  0.3902      0.652 0.808 0.000 0.136 0.008 0.048
#> SRR1652899     1  0.0290      0.837 0.992 0.000 0.000 0.008 0.000
#> SRR1652900     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652901     4  0.4649      0.285 0.000 0.000 0.404 0.580 0.016
#> SRR1652902     1  0.0798      0.831 0.976 0.000 0.000 0.008 0.016
#> SRR1652903     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652904     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652905     2  0.4830      0.578 0.000 0.684 0.000 0.256 0.060
#> SRR1652906     1  0.1299      0.823 0.960 0.000 0.012 0.008 0.020
#> SRR1652907     1  0.1121      0.845 0.956 0.000 0.000 0.000 0.044
#> SRR1652908     2  0.1992      0.915 0.000 0.924 0.000 0.044 0.032
#> SRR1652909     1  0.4160      0.653 0.804 0.000 0.120 0.020 0.056
#> SRR1652910     1  0.0579      0.834 0.984 0.000 0.000 0.008 0.008
#> SRR1652911     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652912     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652913     4  0.1485      0.864 0.020 0.000 0.000 0.948 0.032
#> SRR1652914     3  0.0609      0.857 0.000 0.000 0.980 0.020 0.000
#> SRR1652915     3  0.1648      0.843 0.000 0.000 0.940 0.020 0.040
#> SRR1652916     1  0.2036      0.839 0.920 0.000 0.000 0.024 0.056
#> SRR1652917     4  0.0912      0.877 0.000 0.000 0.012 0.972 0.016
#> SRR1652918     4  0.3033      0.849 0.000 0.052 0.000 0.864 0.084
#> SRR1652919     3  0.1877      0.835 0.000 0.000 0.924 0.012 0.064
#> SRR1652920     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652921     4  0.0960      0.877 0.004 0.000 0.008 0.972 0.016
#> SRR1652922     3  0.3844      0.537 0.000 0.004 0.736 0.004 0.256
#> SRR1652923     3  0.0609      0.857 0.000 0.000 0.980 0.020 0.000
#> SRR1652924     4  0.2172      0.873 0.000 0.020 0.004 0.916 0.060
#> SRR1652925     4  0.5275      0.556 0.000 0.276 0.000 0.640 0.084
#> SRR1652926     4  0.2535      0.866 0.000 0.032 0.000 0.892 0.076
#> SRR1652927     1  0.0290      0.837 0.992 0.000 0.000 0.008 0.000
#> SRR1652928     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652929     3  0.1710      0.840 0.004 0.000 0.940 0.016 0.040
#> SRR1652930     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652931     3  0.0912      0.853 0.000 0.000 0.972 0.016 0.012
#> SRR1652932     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652933     4  0.2419      0.870 0.000 0.028 0.004 0.904 0.064
#> SRR1652934     4  0.1018      0.875 0.000 0.000 0.016 0.968 0.016
#> SRR1652935     2  0.5050      0.578 0.000 0.720 0.188 0.016 0.076
#> SRR1652936     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652937     1  0.2127      0.850 0.892 0.000 0.000 0.000 0.108
#> SRR1652938     4  0.1251      0.878 0.000 0.008 0.000 0.956 0.036
#> SRR1652939     4  0.0798      0.878 0.000 0.000 0.008 0.976 0.016
#> SRR1652940     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652941     3  0.2351      0.778 0.000 0.000 0.896 0.088 0.016
#> SRR1652942     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652943     4  0.2735      0.861 0.000 0.036 0.000 0.880 0.084
#> SRR1652944     3  0.0609      0.857 0.000 0.000 0.980 0.020 0.000
#> SRR1652945     4  0.2676      0.863 0.000 0.036 0.000 0.884 0.080
#> SRR1652946     4  0.1885      0.876 0.000 0.020 0.004 0.932 0.044
#> SRR1652947     1  0.1168      0.843 0.960 0.000 0.000 0.008 0.032
#> SRR1652948     3  0.3526      0.686 0.000 0.096 0.832 0.000 0.072
#> SRR1652949     1  0.1357      0.812 0.948 0.000 0.004 0.000 0.048
#> SRR1652950     3  0.0771      0.858 0.004 0.000 0.976 0.020 0.000
#> SRR1652951     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652953     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652952     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652954     4  0.0912      0.877 0.000 0.000 0.012 0.972 0.016
#> SRR1652955     3  0.4112      0.667 0.136 0.000 0.800 0.016 0.048
#> SRR1652958     1  0.0798      0.833 0.976 0.000 0.000 0.016 0.008
#> SRR1652956     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652957     4  0.0960      0.877 0.004 0.000 0.008 0.972 0.016
#> SRR1652959     2  0.1493      0.935 0.000 0.948 0.000 0.028 0.024
#> SRR1652960     2  0.1582      0.932 0.000 0.944 0.000 0.028 0.028
#> SRR1652961     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652962     2  0.0794      0.946 0.000 0.972 0.000 0.028 0.000
#> SRR1652963     2  0.1356      0.940 0.000 0.956 0.004 0.028 0.012
#> SRR1652965     5  0.5616      0.821 0.132 0.016 0.176 0.000 0.676
#> SRR1652964     4  0.5209      0.323 0.000 0.020 0.376 0.584 0.020
#> SRR1652966     1  0.3186      0.733 0.864 0.000 0.080 0.008 0.048
#> SRR1652967     3  0.4552      0.174 0.000 0.012 0.632 0.004 0.352
#> SRR1652969     4  0.0579      0.880 0.000 0.008 0.008 0.984 0.000
#> SRR1652968     3  0.0771      0.858 0.004 0.000 0.976 0.020 0.000
#> SRR1652970     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652971     5  0.4952      0.803 0.040 0.016 0.252 0.000 0.692
#> SRR1652972     3  0.4473      0.616 0.160 0.000 0.772 0.024 0.044
#> SRR1652973     4  0.0912      0.877 0.000 0.000 0.012 0.972 0.016
#> SRR1652974     1  0.3109      0.847 0.800 0.000 0.000 0.000 0.200
#> SRR1652975     4  0.2616      0.864 0.000 0.036 0.000 0.888 0.076
#> SRR1652976     3  0.0912      0.854 0.000 0.000 0.972 0.016 0.012
#> SRR1652977     3  0.0771      0.858 0.004 0.000 0.976 0.020 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
#> SRR1652895     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.4314     0.5908 0.000 0.032 0.764 0.008 0.040 0.156
#> SRR1652897     1  0.4086     0.0556 0.528 0.000 0.000 0.464 0.008 0.000
#> SRR1652898     6  0.6141     0.8891 0.364 0.000 0.192 0.000 0.012 0.432
#> SRR1652899     1  0.3807     0.1535 0.628 0.000 0.000 0.004 0.000 0.368
#> SRR1652900     2  0.1478     0.8875 0.000 0.944 0.000 0.004 0.020 0.032
#> SRR1652901     4  0.6163     0.1935 0.000 0.008 0.420 0.448 0.048 0.076
#> SRR1652902     1  0.4151    -0.0434 0.576 0.000 0.008 0.004 0.000 0.412
#> SRR1652903     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.5915     0.4983 0.000 0.616 0.000 0.172 0.064 0.148
#> SRR1652906     1  0.4356    -0.1796 0.548 0.000 0.016 0.004 0.000 0.432
#> SRR1652907     1  0.3899     0.1339 0.628 0.000 0.008 0.000 0.000 0.364
#> SRR1652908     2  0.2889     0.8300 0.000 0.856 0.000 0.004 0.044 0.096
#> SRR1652909     6  0.6636     0.8869 0.360 0.000 0.168 0.036 0.008 0.428
#> SRR1652910     1  0.4144    -0.0182 0.580 0.000 0.008 0.004 0.000 0.408
#> SRR1652911     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0146     0.9025 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652913     4  0.2522     0.7993 0.012 0.008 0.004 0.900 0.024 0.052
#> SRR1652914     3  0.0260     0.8131 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR1652915     3  0.1745     0.7815 0.000 0.000 0.920 0.000 0.012 0.068
#> SRR1652916     1  0.5130     0.1088 0.600 0.000 0.000 0.100 0.004 0.296
#> SRR1652917     4  0.0551     0.8037 0.000 0.008 0.004 0.984 0.000 0.004
#> SRR1652918     4  0.5050     0.7528 0.000 0.036 0.000 0.676 0.072 0.216
#> SRR1652919     3  0.1391     0.8035 0.000 0.000 0.944 0.000 0.016 0.040
#> SRR1652920     2  0.0291     0.9017 0.000 0.992 0.000 0.004 0.004 0.000
#> SRR1652921     4  0.0551     0.8031 0.000 0.008 0.004 0.984 0.004 0.000
#> SRR1652922     3  0.5418     0.2967 0.000 0.004 0.600 0.004 0.256 0.136
#> SRR1652923     3  0.0146     0.8147 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR1652924     4  0.4018     0.7911 0.000 0.024 0.000 0.780 0.056 0.140
#> SRR1652925     4  0.6729     0.5208 0.000 0.224 0.000 0.488 0.072 0.216
#> SRR1652926     4  0.4749     0.7698 0.000 0.028 0.000 0.708 0.072 0.192
#> SRR1652927     1  0.3819     0.1449 0.624 0.000 0.000 0.004 0.000 0.372
#> SRR1652928     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.1625     0.7871 0.000 0.000 0.928 0.000 0.012 0.060
#> SRR1652930     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652931     3  0.1194     0.8009 0.000 0.000 0.956 0.008 0.004 0.032
#> SRR1652932     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.4263     0.7823 0.000 0.028 0.000 0.760 0.060 0.152
#> SRR1652934     4  0.0551     0.8037 0.000 0.008 0.004 0.984 0.000 0.004
#> SRR1652935     2  0.6643     0.2679 0.000 0.536 0.212 0.008 0.068 0.176
#> SRR1652936     2  0.0146     0.9025 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652937     1  0.2912     0.4299 0.784 0.000 0.000 0.000 0.000 0.216
#> SRR1652938     4  0.2597     0.7691 0.000 0.004 0.004 0.868 0.012 0.112
#> SRR1652939     4  0.0291     0.7990 0.000 0.000 0.004 0.992 0.004 0.000
#> SRR1652940     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.3245     0.6244 0.000 0.000 0.796 0.184 0.004 0.016
#> SRR1652942     2  0.0291     0.9022 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR1652943     4  0.4810     0.7646 0.000 0.028 0.000 0.696 0.068 0.208
#> SRR1652944     3  0.0260     0.8131 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR1652945     4  0.4726     0.7725 0.000 0.028 0.000 0.708 0.068 0.196
#> SRR1652946     4  0.3140     0.8007 0.000 0.020 0.000 0.848 0.036 0.096
#> SRR1652947     1  0.3329     0.4008 0.756 0.000 0.000 0.004 0.004 0.236
#> SRR1652948     3  0.4773     0.5488 0.000 0.064 0.736 0.008 0.040 0.152
#> SRR1652949     1  0.4274    -0.1672 0.552 0.000 0.012 0.000 0.004 0.432
#> SRR1652950     3  0.0806     0.8145 0.000 0.000 0.972 0.008 0.000 0.020
#> SRR1652951     2  0.0436     0.9017 0.000 0.988 0.000 0.004 0.004 0.004
#> SRR1652953     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0291     0.9022 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR1652954     4  0.0405     0.8039 0.000 0.008 0.004 0.988 0.000 0.000
#> SRR1652955     3  0.3927     0.4050 0.000 0.000 0.644 0.000 0.012 0.344
#> SRR1652958     1  0.4583     0.0184 0.580 0.000 0.000 0.044 0.000 0.376
#> SRR1652956     2  0.0291     0.9022 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR1652957     4  0.0551     0.8031 0.000 0.008 0.004 0.984 0.004 0.000
#> SRR1652959     2  0.2007     0.8759 0.000 0.916 0.000 0.004 0.036 0.044
#> SRR1652960     2  0.2263     0.8668 0.000 0.900 0.000 0.004 0.036 0.060
#> SRR1652961     2  0.0146     0.9025 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652962     2  0.0291     0.9022 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR1652963     2  0.2808     0.8572 0.000 0.880 0.024 0.004 0.032 0.060
#> SRR1652965     5  0.3277     0.6622 0.012 0.004 0.028 0.000 0.832 0.124
#> SRR1652964     4  0.6643     0.2198 0.000 0.020 0.384 0.444 0.052 0.100
#> SRR1652966     1  0.5533    -0.6217 0.464 0.000 0.092 0.000 0.012 0.432
#> SRR1652967     5  0.6267     0.2505 0.000 0.000 0.356 0.008 0.380 0.256
#> SRR1652969     4  0.1862     0.8097 0.000 0.008 0.004 0.928 0.016 0.044
#> SRR1652968     3  0.0260     0.8143 0.000 0.000 0.992 0.000 0.000 0.008
#> SRR1652970     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.2285     0.7057 0.000 0.000 0.064 0.008 0.900 0.028
#> SRR1652972     3  0.3934     0.3334 0.000 0.000 0.616 0.000 0.008 0.376
#> SRR1652973     4  0.0405     0.8039 0.000 0.008 0.004 0.988 0.000 0.000
#> SRR1652974     1  0.0000     0.5996 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652975     4  0.4600     0.7712 0.000 0.032 0.000 0.724 0.060 0.184
#> SRR1652976     3  0.1251     0.8006 0.000 0.000 0.956 0.008 0.012 0.024
#> SRR1652977     3  0.0405     0.8141 0.000 0.000 0.988 0.008 0.000 0.004

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

consensus_heatmap(res, k = 2)

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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.648           0.851       0.934         0.5060 0.494   0.494
#> 3 3 0.899           0.861       0.943         0.2989 0.760   0.555
#> 4 4 0.904           0.890       0.950         0.1344 0.863   0.629
#> 5 5 0.763           0.743       0.871         0.0445 0.967   0.873
#> 6 6 0.743           0.548       0.805         0.0300 0.966   0.857

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
#> SRR1652895     1  0.0000      0.923 1.000 0.000
#> SRR1652896     2  0.6801      0.732 0.180 0.820
#> SRR1652897     1  0.0000      0.923 1.000 0.000
#> SRR1652898     1  0.0000      0.923 1.000 0.000
#> SRR1652899     1  0.0000      0.923 1.000 0.000
#> SRR1652900     2  0.0000      0.927 0.000 1.000
#> SRR1652901     2  0.0000      0.927 0.000 1.000
#> SRR1652902     1  0.0000      0.923 1.000 0.000
#> SRR1652903     1  0.0000      0.923 1.000 0.000
#> SRR1652904     1  0.0000      0.923 1.000 0.000
#> SRR1652905     2  0.0000      0.927 0.000 1.000
#> SRR1652906     1  0.0000      0.923 1.000 0.000
#> SRR1652907     1  0.0000      0.923 1.000 0.000
#> SRR1652908     2  0.0000      0.927 0.000 1.000
#> SRR1652909     1  0.0000      0.923 1.000 0.000
#> SRR1652910     1  0.0000      0.923 1.000 0.000
#> SRR1652911     1  0.0000      0.923 1.000 0.000
#> SRR1652912     2  0.0000      0.927 0.000 1.000
#> SRR1652913     2  0.9710      0.414 0.400 0.600
#> SRR1652914     1  0.9732      0.415 0.596 0.404
#> SRR1652915     1  0.7139      0.758 0.804 0.196
#> SRR1652916     1  0.0000      0.923 1.000 0.000
#> SRR1652917     2  0.7602      0.720 0.220 0.780
#> SRR1652918     2  0.0000      0.927 0.000 1.000
#> SRR1652919     1  0.0376      0.920 0.996 0.004
#> SRR1652920     2  0.0000      0.927 0.000 1.000
#> SRR1652921     2  0.9710      0.414 0.400 0.600
#> SRR1652922     1  0.7219      0.753 0.800 0.200
#> SRR1652923     1  0.8608      0.640 0.716 0.284
#> SRR1652924     2  0.0000      0.927 0.000 1.000
#> SRR1652925     2  0.0000      0.927 0.000 1.000
#> SRR1652926     2  0.0000      0.927 0.000 1.000
#> SRR1652927     1  0.0000      0.923 1.000 0.000
#> SRR1652928     1  0.0000      0.923 1.000 0.000
#> SRR1652929     1  0.4815      0.845 0.896 0.104
#> SRR1652930     1  0.0000      0.923 1.000 0.000
#> SRR1652931     2  0.7139      0.707 0.196 0.804
#> SRR1652932     1  0.0000      0.923 1.000 0.000
#> SRR1652933     2  0.0000      0.927 0.000 1.000
#> SRR1652934     2  0.5408      0.826 0.124 0.876
#> SRR1652935     2  0.0000      0.927 0.000 1.000
#> SRR1652936     2  0.0000      0.927 0.000 1.000
#> SRR1652937     1  0.0000      0.923 1.000 0.000
#> SRR1652938     2  0.0000      0.927 0.000 1.000
#> SRR1652939     2  0.0376      0.924 0.004 0.996
#> SRR1652940     1  0.0000      0.923 1.000 0.000
#> SRR1652941     1  0.6531      0.788 0.832 0.168
#> SRR1652942     2  0.0000      0.927 0.000 1.000
#> SRR1652943     2  0.0000      0.927 0.000 1.000
#> SRR1652944     1  0.9732      0.415 0.596 0.404
#> SRR1652945     2  0.0000      0.927 0.000 1.000
#> SRR1652946     2  0.6623      0.777 0.172 0.828
#> SRR1652947     1  0.0000      0.923 1.000 0.000
#> SRR1652948     2  0.0000      0.927 0.000 1.000
#> SRR1652949     1  0.0000      0.923 1.000 0.000
#> SRR1652950     1  0.0000      0.923 1.000 0.000
#> SRR1652951     2  0.0000      0.927 0.000 1.000
#> SRR1652953     1  0.0000      0.923 1.000 0.000
#> SRR1652952     2  0.0000      0.927 0.000 1.000
#> SRR1652954     2  0.9710      0.414 0.400 0.600
#> SRR1652955     1  0.0000      0.923 1.000 0.000
#> SRR1652958     1  0.0000      0.923 1.000 0.000
#> SRR1652956     2  0.0000      0.927 0.000 1.000
#> SRR1652957     2  0.9710      0.414 0.400 0.600
#> SRR1652959     2  0.0000      0.927 0.000 1.000
#> SRR1652960     2  0.0000      0.927 0.000 1.000
#> SRR1652961     2  0.0000      0.927 0.000 1.000
#> SRR1652962     2  0.0000      0.927 0.000 1.000
#> SRR1652963     2  0.0000      0.927 0.000 1.000
#> SRR1652965     1  0.0000      0.923 1.000 0.000
#> SRR1652964     2  0.0000      0.927 0.000 1.000
#> SRR1652966     1  0.0000      0.923 1.000 0.000
#> SRR1652967     2  0.0000      0.927 0.000 1.000
#> SRR1652969     2  0.0000      0.927 0.000 1.000
#> SRR1652968     1  0.7299      0.749 0.796 0.204
#> SRR1652970     1  0.0000      0.923 1.000 0.000
#> SRR1652971     1  0.9710      0.424 0.600 0.400
#> SRR1652972     1  0.0000      0.923 1.000 0.000
#> SRR1652973     2  0.6712      0.773 0.176 0.824
#> SRR1652974     1  0.0000      0.923 1.000 0.000
#> SRR1652975     2  0.0000      0.927 0.000 1.000
#> SRR1652976     2  0.0000      0.927 0.000 1.000
#> SRR1652977     1  0.9710      0.424 0.600 0.400

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652896     3  0.0237     0.9525 0.000 0.004 0.996
#> SRR1652897     1  0.1031     0.8893 0.976 0.024 0.000
#> SRR1652898     1  0.5560     0.5181 0.700 0.000 0.300
#> SRR1652899     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652900     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652901     2  0.4178     0.8145 0.000 0.828 0.172
#> SRR1652902     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652903     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652905     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652906     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652907     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652908     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652909     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652910     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652911     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652912     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652913     1  0.6291     0.1290 0.532 0.468 0.000
#> SRR1652914     3  0.0000     0.9540 0.000 0.000 1.000
#> SRR1652915     3  0.0000     0.9540 0.000 0.000 1.000
#> SRR1652916     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652917     2  0.4346     0.7497 0.184 0.816 0.000
#> SRR1652918     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652919     3  0.0892     0.9450 0.020 0.000 0.980
#> SRR1652920     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652921     1  0.6291     0.1290 0.532 0.468 0.000
#> SRR1652922     3  0.0000     0.9540 0.000 0.000 1.000
#> SRR1652923     3  0.0000     0.9540 0.000 0.000 1.000
#> SRR1652924     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652925     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652926     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652927     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652928     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652929     3  0.0747     0.9475 0.016 0.000 0.984
#> SRR1652930     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652931     3  0.0000     0.9540 0.000 0.000 1.000
#> SRR1652932     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652933     2  0.0892     0.9499 0.000 0.980 0.020
#> SRR1652934     2  0.2711     0.8734 0.088 0.912 0.000
#> SRR1652935     2  0.6026     0.4572 0.000 0.624 0.376
#> SRR1652936     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652937     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652938     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652939     2  0.0237     0.9456 0.004 0.996 0.000
#> SRR1652940     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652941     3  0.1585     0.9387 0.028 0.008 0.964
#> SRR1652942     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652943     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652944     3  0.0000     0.9540 0.000 0.000 1.000
#> SRR1652945     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652946     2  0.0237     0.9453 0.004 0.996 0.000
#> SRR1652947     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652948     3  0.0237     0.9525 0.000 0.004 0.996
#> SRR1652949     1  0.0237     0.9050 0.996 0.000 0.004
#> SRR1652950     3  0.1163     0.9389 0.028 0.000 0.972
#> SRR1652951     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652953     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652952     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652954     1  0.6307     0.0388 0.512 0.488 0.000
#> SRR1652955     3  0.1163     0.9389 0.028 0.000 0.972
#> SRR1652958     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652956     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652957     2  0.5948     0.3992 0.360 0.640 0.000
#> SRR1652959     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652960     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652961     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652962     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652963     2  0.1163     0.9506 0.000 0.972 0.028
#> SRR1652965     1  0.6309    -0.1023 0.504 0.000 0.496
#> SRR1652964     2  0.1411     0.9463 0.000 0.964 0.036
#> SRR1652966     1  0.0592     0.8985 0.988 0.000 0.012
#> SRR1652967     3  0.1411     0.9274 0.000 0.036 0.964
#> SRR1652969     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652968     3  0.0000     0.9540 0.000 0.000 1.000
#> SRR1652970     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652971     3  0.5156     0.7142 0.216 0.008 0.776
#> SRR1652972     3  0.5968     0.4055 0.364 0.000 0.636
#> SRR1652973     2  0.1031     0.9334 0.024 0.976 0.000
#> SRR1652974     1  0.0000     0.9081 1.000 0.000 0.000
#> SRR1652975     2  0.0000     0.9469 0.000 1.000 0.000
#> SRR1652976     3  0.0237     0.9525 0.000 0.004 0.996
#> SRR1652977     3  0.0000     0.9540 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
#> SRR1652895     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.2469      0.870 0.000 0.108 0.892 0.000
#> SRR1652897     1  0.3610      0.739 0.800 0.000 0.000 0.200
#> SRR1652898     1  0.3444      0.757 0.816 0.000 0.184 0.000
#> SRR1652899     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652900     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652901     2  0.3074      0.799 0.000 0.848 0.152 0.000
#> SRR1652902     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652903     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652906     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652907     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652908     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652909     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652910     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652911     1  0.0188      0.950 0.996 0.000 0.000 0.004
#> SRR1652912     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652913     4  0.0895      0.953 0.020 0.004 0.000 0.976
#> SRR1652914     3  0.0000      0.926 0.000 0.000 1.000 0.000
#> SRR1652915     3  0.0000      0.926 0.000 0.000 1.000 0.000
#> SRR1652916     1  0.0188      0.950 0.996 0.000 0.000 0.004
#> SRR1652917     4  0.0336      0.962 0.000 0.008 0.000 0.992
#> SRR1652918     2  0.4948      0.194 0.000 0.560 0.000 0.440
#> SRR1652919     3  0.0188      0.925 0.000 0.000 0.996 0.004
#> SRR1652920     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652921     4  0.0895      0.953 0.020 0.004 0.000 0.976
#> SRR1652922     3  0.0469      0.923 0.000 0.012 0.988 0.000
#> SRR1652923     3  0.0000      0.926 0.000 0.000 1.000 0.000
#> SRR1652924     4  0.1022      0.955 0.000 0.032 0.000 0.968
#> SRR1652925     2  0.2281      0.864 0.000 0.904 0.000 0.096
#> SRR1652926     4  0.2408      0.897 0.000 0.104 0.000 0.896
#> SRR1652927     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652928     1  0.0188      0.950 0.996 0.000 0.000 0.004
#> SRR1652929     3  0.0000      0.926 0.000 0.000 1.000 0.000
#> SRR1652930     1  0.0188      0.950 0.996 0.000 0.000 0.004
#> SRR1652931     3  0.2334      0.884 0.000 0.088 0.908 0.004
#> SRR1652932     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652933     2  0.1302      0.911 0.000 0.956 0.000 0.044
#> SRR1652934     4  0.0336      0.962 0.000 0.008 0.000 0.992
#> SRR1652935     2  0.0376      0.936 0.000 0.992 0.004 0.004
#> SRR1652936     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652938     4  0.1867      0.927 0.000 0.072 0.000 0.928
#> SRR1652939     4  0.0188      0.962 0.000 0.004 0.000 0.996
#> SRR1652940     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652941     3  0.2797      0.873 0.060 0.012 0.908 0.020
#> SRR1652942     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652943     4  0.1022      0.955 0.000 0.032 0.000 0.968
#> SRR1652944     3  0.0000      0.926 0.000 0.000 1.000 0.000
#> SRR1652945     4  0.2760      0.870 0.000 0.128 0.000 0.872
#> SRR1652946     4  0.0188      0.962 0.000 0.004 0.000 0.996
#> SRR1652947     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652948     3  0.3355      0.819 0.000 0.160 0.836 0.004
#> SRR1652949     1  0.0188      0.949 0.996 0.000 0.004 0.000
#> SRR1652950     3  0.0000      0.926 0.000 0.000 1.000 0.000
#> SRR1652951     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652954     4  0.2125      0.900 0.076 0.004 0.000 0.920
#> SRR1652955     3  0.0000      0.926 0.000 0.000 1.000 0.000
#> SRR1652958     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652956     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652957     4  0.0188      0.962 0.000 0.004 0.000 0.996
#> SRR1652959     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652962     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652965     1  0.4855      0.350 0.600 0.000 0.400 0.000
#> SRR1652964     2  0.0000      0.942 0.000 1.000 0.000 0.000
#> SRR1652966     1  0.0469      0.943 0.988 0.000 0.012 0.000
#> SRR1652967     2  0.4889      0.366 0.000 0.636 0.360 0.004
#> SRR1652969     4  0.0336      0.962 0.000 0.008 0.000 0.992
#> SRR1652968     3  0.0000      0.926 0.000 0.000 1.000 0.000
#> SRR1652970     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> SRR1652971     3  0.7243      0.500 0.268 0.172 0.556 0.004
#> SRR1652972     1  0.4961      0.194 0.552 0.000 0.448 0.000
#> SRR1652973     4  0.0188      0.962 0.000 0.004 0.000 0.996
#> SRR1652974     1  0.0188      0.950 0.996 0.000 0.000 0.004
#> SRR1652975     2  0.2081      0.876 0.000 0.916 0.000 0.084
#> SRR1652976     3  0.4252      0.697 0.000 0.252 0.744 0.004
#> SRR1652977     3  0.0000      0.926 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.3862     0.6138 0.000 0.104 0.808 0.000 0.088
#> SRR1652897     1  0.4010     0.5965 0.760 0.000 0.000 0.208 0.032
#> SRR1652898     1  0.6196     0.1570 0.508 0.000 0.152 0.000 0.340
#> SRR1652899     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652900     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652901     2  0.3835     0.7528 0.000 0.796 0.156 0.000 0.048
#> SRR1652902     1  0.2773     0.7923 0.836 0.000 0.000 0.000 0.164
#> SRR1652903     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.1618     0.9087 0.000 0.944 0.008 0.008 0.040
#> SRR1652906     1  0.3427     0.7537 0.796 0.000 0.012 0.000 0.192
#> SRR1652907     1  0.3074     0.7602 0.804 0.000 0.000 0.000 0.196
#> SRR1652908     2  0.0880     0.9205 0.000 0.968 0.000 0.000 0.032
#> SRR1652909     1  0.3305     0.7315 0.776 0.000 0.000 0.000 0.224
#> SRR1652910     1  0.2280     0.8225 0.880 0.000 0.000 0.000 0.120
#> SRR1652911     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652913     4  0.1753     0.8677 0.032 0.000 0.000 0.936 0.032
#> SRR1652914     3  0.0898     0.7042 0.000 0.008 0.972 0.000 0.020
#> SRR1652915     3  0.3534     0.5707 0.000 0.000 0.744 0.000 0.256
#> SRR1652916     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652917     4  0.2707     0.8651 0.008 0.000 0.000 0.860 0.132
#> SRR1652918     2  0.5036     0.4425 0.000 0.628 0.000 0.320 0.052
#> SRR1652919     5  0.4283    -0.2419 0.000 0.000 0.456 0.000 0.544
#> SRR1652920     2  0.0290     0.9313 0.000 0.992 0.000 0.000 0.008
#> SRR1652921     4  0.1753     0.8677 0.032 0.000 0.000 0.936 0.032
#> SRR1652922     3  0.4829     0.1737 0.000 0.020 0.496 0.000 0.484
#> SRR1652923     3  0.0510     0.7083 0.000 0.000 0.984 0.000 0.016
#> SRR1652924     4  0.2423     0.8551 0.000 0.080 0.000 0.896 0.024
#> SRR1652925     2  0.3197     0.8004 0.000 0.836 0.000 0.140 0.024
#> SRR1652926     4  0.4795     0.6707 0.000 0.224 0.000 0.704 0.072
#> SRR1652927     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652928     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.3336     0.5907 0.000 0.000 0.772 0.000 0.228
#> SRR1652930     1  0.0162     0.8881 0.996 0.000 0.000 0.000 0.004
#> SRR1652931     3  0.4541     0.5724 0.000 0.084 0.744 0.000 0.172
#> SRR1652932     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     2  0.2790     0.8604 0.000 0.880 0.000 0.052 0.068
#> SRR1652934     4  0.2930     0.8567 0.000 0.000 0.004 0.832 0.164
#> SRR1652935     2  0.2462     0.8264 0.000 0.880 0.008 0.000 0.112
#> SRR1652936     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652938     4  0.3116     0.8585 0.000 0.064 0.000 0.860 0.076
#> SRR1652939     4  0.1197     0.8815 0.000 0.000 0.000 0.952 0.048
#> SRR1652940     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.6446     0.1440 0.064 0.016 0.476 0.020 0.424
#> SRR1652942     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     4  0.3130     0.8336 0.000 0.096 0.000 0.856 0.048
#> SRR1652944     3  0.0000     0.7073 0.000 0.000 1.000 0.000 0.000
#> SRR1652945     4  0.3710     0.7415 0.000 0.192 0.000 0.784 0.024
#> SRR1652946     4  0.0703     0.8777 0.000 0.000 0.000 0.976 0.024
#> SRR1652947     1  0.0703     0.8804 0.976 0.000 0.000 0.000 0.024
#> SRR1652948     3  0.4404     0.5542 0.000 0.152 0.760 0.000 0.088
#> SRR1652949     1  0.4249     0.6054 0.688 0.000 0.016 0.000 0.296
#> SRR1652950     3  0.1965     0.6795 0.000 0.000 0.904 0.000 0.096
#> SRR1652951     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652953     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     4  0.3543     0.7870 0.112 0.000 0.000 0.828 0.060
#> SRR1652955     3  0.3534     0.5377 0.000 0.000 0.744 0.000 0.256
#> SRR1652958     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652956     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     4  0.0963     0.8785 0.000 0.000 0.000 0.964 0.036
#> SRR1652959     2  0.0162     0.9322 0.000 0.996 0.000 0.000 0.004
#> SRR1652960     2  0.0290     0.9313 0.000 0.992 0.000 0.000 0.008
#> SRR1652961     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     2  0.0162     0.9314 0.000 0.996 0.004 0.000 0.000
#> SRR1652965     5  0.4803     0.3770 0.184 0.000 0.096 0.000 0.720
#> SRR1652964     2  0.0609     0.9219 0.000 0.980 0.000 0.000 0.020
#> SRR1652966     1  0.5068     0.5154 0.640 0.000 0.060 0.000 0.300
#> SRR1652967     5  0.6299     0.1332 0.000 0.380 0.156 0.000 0.464
#> SRR1652969     4  0.1892     0.8786 0.000 0.004 0.000 0.916 0.080
#> SRR1652968     3  0.0290     0.7075 0.000 0.000 0.992 0.000 0.008
#> SRR1652970     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.5631     0.3189 0.044 0.120 0.132 0.000 0.704
#> SRR1652972     5  0.6563     0.1720 0.356 0.000 0.208 0.000 0.436
#> SRR1652973     4  0.1544     0.8798 0.000 0.000 0.000 0.932 0.068
#> SRR1652974     1  0.0000     0.8909 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.2889     0.8488 0.000 0.872 0.000 0.084 0.044
#> SRR1652976     3  0.6543     0.0646 0.000 0.212 0.456 0.000 0.332
#> SRR1652977     3  0.0404     0.7072 0.000 0.000 0.988 0.000 0.012

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.4864    0.58280 0.000 0.112 0.732 0.000 0.080 0.076
#> SRR1652897     1  0.4229    0.51478 0.732 0.000 0.000 0.200 0.008 0.060
#> SRR1652898     5  0.5098    0.26382 0.352 0.000 0.092 0.000 0.556 0.000
#> SRR1652899     1  0.1387    0.83160 0.932 0.000 0.000 0.000 0.068 0.000
#> SRR1652900     2  0.0146    0.87750 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652901     2  0.4732    0.69570 0.000 0.724 0.136 0.004 0.016 0.120
#> SRR1652902     1  0.3464    0.58318 0.688 0.000 0.000 0.000 0.312 0.000
#> SRR1652903     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.2473    0.80882 0.000 0.856 0.000 0.000 0.008 0.136
#> SRR1652906     1  0.3578    0.53437 0.660 0.000 0.000 0.000 0.340 0.000
#> SRR1652907     1  0.3515    0.56076 0.676 0.000 0.000 0.000 0.324 0.000
#> SRR1652908     2  0.1285    0.86132 0.000 0.944 0.000 0.000 0.004 0.052
#> SRR1652909     1  0.3804    0.51249 0.656 0.000 0.000 0.000 0.336 0.008
#> SRR1652910     1  0.3151    0.66487 0.748 0.000 0.000 0.000 0.252 0.000
#> SRR1652911     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000    0.87774 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     4  0.1332    0.41982 0.012 0.000 0.000 0.952 0.008 0.028
#> SRR1652914     3  0.1082    0.68276 0.000 0.000 0.956 0.000 0.040 0.004
#> SRR1652915     3  0.4049    0.43696 0.000 0.000 0.648 0.000 0.332 0.020
#> SRR1652916     1  0.0603    0.84322 0.980 0.000 0.000 0.000 0.004 0.016
#> SRR1652917     4  0.4779   -0.57642 0.004 0.004 0.000 0.516 0.032 0.444
#> SRR1652918     2  0.5978    0.13631 0.000 0.500 0.000 0.324 0.016 0.160
#> SRR1652919     5  0.5353   -0.10413 0.000 0.000 0.368 0.000 0.516 0.116
#> SRR1652920     2  0.0891    0.87087 0.000 0.968 0.000 0.000 0.008 0.024
#> SRR1652921     4  0.1649    0.41345 0.016 0.000 0.000 0.936 0.008 0.040
#> SRR1652922     5  0.5891   -0.12022 0.000 0.020 0.352 0.000 0.500 0.128
#> SRR1652923     3  0.1549    0.68164 0.000 0.000 0.936 0.000 0.044 0.020
#> SRR1652924     4  0.3230    0.40819 0.000 0.084 0.000 0.844 0.016 0.056
#> SRR1652925     2  0.4551    0.60655 0.000 0.708 0.000 0.212 0.016 0.064
#> SRR1652926     4  0.6140    0.00872 0.000 0.224 0.000 0.476 0.012 0.288
#> SRR1652927     1  0.1957    0.80289 0.888 0.000 0.000 0.000 0.112 0.000
#> SRR1652928     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.3853    0.47769 0.000 0.000 0.680 0.000 0.304 0.016
#> SRR1652930     1  0.0291    0.85020 0.992 0.000 0.000 0.004 0.000 0.004
#> SRR1652931     3  0.5371    0.55956 0.000 0.096 0.688 0.000 0.116 0.100
#> SRR1652932     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     2  0.3755    0.69605 0.000 0.732 0.000 0.020 0.004 0.244
#> SRR1652934     6  0.4268    0.00000 0.000 0.000 0.004 0.428 0.012 0.556
#> SRR1652935     2  0.3093    0.78532 0.000 0.852 0.012 0.000 0.060 0.076
#> SRR1652936     2  0.0000    0.87774 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.0632    0.84972 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR1652938     4  0.4924    0.19677 0.000 0.048 0.000 0.648 0.028 0.276
#> SRR1652939     4  0.3729    0.12845 0.000 0.000 0.000 0.692 0.012 0.296
#> SRR1652940     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.7661   -0.00467 0.068 0.012 0.320 0.012 0.308 0.280
#> SRR1652942     2  0.0000    0.87774 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     4  0.4648    0.31897 0.000 0.108 0.000 0.720 0.016 0.156
#> SRR1652944     3  0.0146    0.68285 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1652945     4  0.4377    0.34373 0.000 0.164 0.000 0.744 0.020 0.072
#> SRR1652946     4  0.0000    0.43049 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1652947     1  0.1644    0.82412 0.920 0.000 0.000 0.000 0.076 0.004
#> SRR1652948     3  0.5524    0.52081 0.000 0.176 0.660 0.000 0.088 0.076
#> SRR1652949     1  0.3996    0.11501 0.512 0.000 0.004 0.000 0.484 0.000
#> SRR1652950     3  0.1908    0.65983 0.000 0.000 0.900 0.000 0.096 0.004
#> SRR1652951     2  0.0000    0.87774 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.0260    0.85333 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1652952     2  0.0000    0.87774 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     4  0.5026   -0.06804 0.064 0.000 0.000 0.664 0.032 0.240
#> SRR1652955     3  0.3684    0.36334 0.000 0.000 0.628 0.000 0.372 0.000
#> SRR1652958     1  0.0790    0.84741 0.968 0.000 0.000 0.000 0.032 0.000
#> SRR1652956     2  0.0146    0.87661 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652957     4  0.1563    0.40071 0.000 0.000 0.000 0.932 0.012 0.056
#> SRR1652959     2  0.0146    0.87753 0.000 0.996 0.000 0.000 0.004 0.000
#> SRR1652960     2  0.0806    0.87212 0.000 0.972 0.000 0.000 0.008 0.020
#> SRR1652961     2  0.0291    0.87688 0.000 0.992 0.000 0.000 0.004 0.004
#> SRR1652962     2  0.0000    0.87774 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0405    0.87500 0.000 0.988 0.000 0.000 0.008 0.004
#> SRR1652965     5  0.4854    0.39374 0.104 0.000 0.044 0.000 0.724 0.128
#> SRR1652964     2  0.1232    0.86221 0.000 0.956 0.004 0.000 0.016 0.024
#> SRR1652966     5  0.4722   -0.11304 0.468 0.000 0.036 0.000 0.492 0.004
#> SRR1652967     2  0.7249   -0.14423 0.000 0.336 0.092 0.000 0.316 0.256
#> SRR1652969     4  0.4209   -0.16174 0.000 0.020 0.000 0.596 0.000 0.384
#> SRR1652968     3  0.0632    0.68208 0.000 0.000 0.976 0.000 0.024 0.000
#> SRR1652970     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.6485    0.16971 0.024 0.084 0.072 0.000 0.560 0.260
#> SRR1652972     5  0.5473    0.41541 0.224 0.000 0.156 0.000 0.608 0.012
#> SRR1652973     4  0.3861   -0.17603 0.000 0.000 0.000 0.640 0.008 0.352
#> SRR1652974     1  0.0000    0.85405 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.3892    0.74637 0.000 0.784 0.000 0.056 0.016 0.144
#> SRR1652976     3  0.7461    0.19059 0.000 0.260 0.372 0.000 0.212 0.156
#> SRR1652977     3  0.0692    0.68306 0.000 0.000 0.976 0.000 0.020 0.004

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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 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-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.833           0.899       0.958         0.4807 0.515   0.515
#> 3 3 0.633           0.641       0.848         0.3120 0.750   0.551
#> 4 4 0.645           0.588       0.834         0.1222 0.888   0.699
#> 5 5 0.747           0.718       0.863         0.0650 0.856   0.555
#> 6 6 0.743           0.714       0.881         0.0159 0.996   0.983

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
#> SRR1652895     1  0.0000      0.938 1.000 0.000
#> SRR1652896     2  0.0000      0.963 0.000 1.000
#> SRR1652897     1  0.0000      0.938 1.000 0.000
#> SRR1652898     1  0.0000      0.938 1.000 0.000
#> SRR1652899     1  0.0000      0.938 1.000 0.000
#> SRR1652900     2  0.0000      0.963 0.000 1.000
#> SRR1652901     2  0.0000      0.963 0.000 1.000
#> SRR1652902     1  0.0000      0.938 1.000 0.000
#> SRR1652903     1  0.0000      0.938 1.000 0.000
#> SRR1652904     1  0.0000      0.938 1.000 0.000
#> SRR1652905     2  0.0000      0.963 0.000 1.000
#> SRR1652906     1  0.0000      0.938 1.000 0.000
#> SRR1652907     1  0.0000      0.938 1.000 0.000
#> SRR1652908     2  0.0000      0.963 0.000 1.000
#> SRR1652909     1  0.0000      0.938 1.000 0.000
#> SRR1652910     1  0.0000      0.938 1.000 0.000
#> SRR1652911     1  0.0000      0.938 1.000 0.000
#> SRR1652912     2  0.0000      0.963 0.000 1.000
#> SRR1652913     2  0.7219      0.725 0.200 0.800
#> SRR1652914     2  0.0000      0.963 0.000 1.000
#> SRR1652915     1  0.9710      0.386 0.600 0.400
#> SRR1652916     1  0.0000      0.938 1.000 0.000
#> SRR1652917     2  0.0000      0.963 0.000 1.000
#> SRR1652918     2  0.0000      0.963 0.000 1.000
#> SRR1652919     1  0.7299      0.757 0.796 0.204
#> SRR1652920     2  0.0000      0.963 0.000 1.000
#> SRR1652921     2  0.2948      0.913 0.052 0.948
#> SRR1652922     1  0.9710      0.386 0.600 0.400
#> SRR1652923     2  0.9460      0.385 0.364 0.636
#> SRR1652924     2  0.0000      0.963 0.000 1.000
#> SRR1652925     2  0.0000      0.963 0.000 1.000
#> SRR1652926     2  0.0000      0.963 0.000 1.000
#> SRR1652927     1  0.0000      0.938 1.000 0.000
#> SRR1652928     1  0.0000      0.938 1.000 0.000
#> SRR1652929     1  0.8499      0.649 0.724 0.276
#> SRR1652930     1  0.0000      0.938 1.000 0.000
#> SRR1652931     2  0.0000      0.963 0.000 1.000
#> SRR1652932     1  0.0000      0.938 1.000 0.000
#> SRR1652933     2  0.0000      0.963 0.000 1.000
#> SRR1652934     2  0.0000      0.963 0.000 1.000
#> SRR1652935     2  0.0000      0.963 0.000 1.000
#> SRR1652936     2  0.0000      0.963 0.000 1.000
#> SRR1652937     1  0.0000      0.938 1.000 0.000
#> SRR1652938     2  0.0000      0.963 0.000 1.000
#> SRR1652939     2  0.0000      0.963 0.000 1.000
#> SRR1652940     1  0.0000      0.938 1.000 0.000
#> SRR1652941     2  0.0000      0.963 0.000 1.000
#> SRR1652942     2  0.0000      0.963 0.000 1.000
#> SRR1652943     2  0.0000      0.963 0.000 1.000
#> SRR1652944     2  0.0000      0.963 0.000 1.000
#> SRR1652945     2  0.0000      0.963 0.000 1.000
#> SRR1652946     2  0.0000      0.963 0.000 1.000
#> SRR1652947     1  0.0000      0.938 1.000 0.000
#> SRR1652948     2  0.0000      0.963 0.000 1.000
#> SRR1652949     1  0.0000      0.938 1.000 0.000
#> SRR1652950     2  0.9686      0.296 0.396 0.604
#> SRR1652951     2  0.0000      0.963 0.000 1.000
#> SRR1652953     1  0.0000      0.938 1.000 0.000
#> SRR1652952     2  0.0000      0.963 0.000 1.000
#> SRR1652954     2  0.0376      0.960 0.004 0.996
#> SRR1652955     1  0.6887      0.781 0.816 0.184
#> SRR1652958     1  0.0000      0.938 1.000 0.000
#> SRR1652956     2  0.0000      0.963 0.000 1.000
#> SRR1652957     2  0.0000      0.963 0.000 1.000
#> SRR1652959     2  0.0000      0.963 0.000 1.000
#> SRR1652960     2  0.0000      0.963 0.000 1.000
#> SRR1652961     2  0.0000      0.963 0.000 1.000
#> SRR1652962     2  0.0000      0.963 0.000 1.000
#> SRR1652963     2  0.0000      0.963 0.000 1.000
#> SRR1652965     1  0.7056      0.771 0.808 0.192
#> SRR1652964     2  0.0000      0.963 0.000 1.000
#> SRR1652966     1  0.0000      0.938 1.000 0.000
#> SRR1652967     2  0.0000      0.963 0.000 1.000
#> SRR1652969     2  0.0000      0.963 0.000 1.000
#> SRR1652968     2  0.7376      0.708 0.208 0.792
#> SRR1652970     1  0.0000      0.938 1.000 0.000
#> SRR1652971     2  0.9710      0.283 0.400 0.600
#> SRR1652972     1  0.6887      0.781 0.816 0.184
#> SRR1652973     2  0.0000      0.963 0.000 1.000
#> SRR1652974     1  0.0000      0.938 1.000 0.000
#> SRR1652975     2  0.0000      0.963 0.000 1.000
#> SRR1652976     2  0.0000      0.963 0.000 1.000
#> SRR1652977     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
#> SRR1652895     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652896     3  0.6126     0.4178 0.000 0.400 0.600
#> SRR1652897     1  0.5254     0.7059 0.736 0.000 0.264
#> SRR1652898     3  0.5859    -0.0656 0.344 0.000 0.656
#> SRR1652899     1  0.5835     0.6571 0.660 0.000 0.340
#> SRR1652900     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652901     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652902     1  0.5882     0.6486 0.652 0.000 0.348
#> SRR1652903     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652904     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652905     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652906     3  0.5905    -0.0878 0.352 0.000 0.648
#> SRR1652907     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652908     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652909     3  0.5926    -0.0496 0.356 0.000 0.644
#> SRR1652910     1  0.5835     0.6571 0.660 0.000 0.340
#> SRR1652911     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652912     2  0.0592     0.8993 0.000 0.988 0.012
#> SRR1652913     1  0.6215     0.1731 0.572 0.428 0.000
#> SRR1652914     3  0.6045     0.4479 0.000 0.380 0.620
#> SRR1652915     3  0.4399     0.6027 0.000 0.188 0.812
#> SRR1652916     1  0.5835     0.6571 0.660 0.000 0.340
#> SRR1652917     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652918     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652919     3  0.0661     0.5239 0.004 0.008 0.988
#> SRR1652920     2  0.0592     0.8993 0.000 0.988 0.012
#> SRR1652921     3  0.6962     0.2154 0.020 0.412 0.568
#> SRR1652922     3  0.4504     0.5995 0.000 0.196 0.804
#> SRR1652923     3  0.5760     0.5097 0.000 0.328 0.672
#> SRR1652924     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652925     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652926     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652927     1  0.5835     0.6571 0.660 0.000 0.340
#> SRR1652928     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652929     3  0.1643     0.5493 0.000 0.044 0.956
#> SRR1652930     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652931     2  0.6168     0.0868 0.000 0.588 0.412
#> SRR1652932     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652933     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652934     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652935     2  0.1163     0.8835 0.000 0.972 0.028
#> SRR1652936     2  0.0592     0.8993 0.000 0.988 0.012
#> SRR1652937     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652938     2  0.6154     0.1070 0.000 0.592 0.408
#> SRR1652939     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652940     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652941     2  0.6274    -0.0728 0.000 0.544 0.456
#> SRR1652942     2  0.0592     0.8993 0.000 0.988 0.012
#> SRR1652943     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652944     3  0.5905     0.4822 0.000 0.352 0.648
#> SRR1652945     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652946     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652947     1  0.4291     0.7502 0.820 0.000 0.180
#> SRR1652948     3  0.6309     0.1897 0.000 0.496 0.504
#> SRR1652949     1  0.6305     0.4335 0.516 0.000 0.484
#> SRR1652950     3  0.0747     0.5297 0.000 0.016 0.984
#> SRR1652951     2  0.0592     0.8993 0.000 0.988 0.012
#> SRR1652953     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652952     2  0.0592     0.8993 0.000 0.988 0.012
#> SRR1652954     2  0.5835     0.3261 0.000 0.660 0.340
#> SRR1652955     3  0.0592     0.5160 0.012 0.000 0.988
#> SRR1652958     1  0.5835     0.6571 0.660 0.000 0.340
#> SRR1652956     2  0.0592     0.8993 0.000 0.988 0.012
#> SRR1652957     2  0.4974     0.5429 0.000 0.764 0.236
#> SRR1652959     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652960     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652961     2  0.0237     0.9033 0.000 0.996 0.004
#> SRR1652962     2  0.0592     0.8993 0.000 0.988 0.012
#> SRR1652963     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652965     3  0.6598    -0.2873 0.428 0.008 0.564
#> SRR1652964     2  0.5560     0.4279 0.000 0.700 0.300
#> SRR1652966     3  0.6260    -0.3334 0.448 0.000 0.552
#> SRR1652967     2  0.5016     0.5584 0.000 0.760 0.240
#> SRR1652969     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652968     3  0.5785     0.5057 0.000 0.332 0.668
#> SRR1652970     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652971     3  0.6521     0.2009 0.004 0.492 0.504
#> SRR1652972     3  0.0592     0.5160 0.012 0.000 0.988
#> SRR1652973     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652974     1  0.0000     0.8161 1.000 0.000 0.000
#> SRR1652975     2  0.0000     0.9052 0.000 1.000 0.000
#> SRR1652976     3  0.6309     0.1897 0.000 0.496 0.504
#> SRR1652977     3  0.6079     0.4357 0.000 0.388 0.612

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.5660     0.2548 0.000 0.028 0.576 0.396
#> SRR1652897     1  0.4250     0.6574 0.724 0.000 0.276 0.000
#> SRR1652898     3  0.4477     0.1306 0.312 0.000 0.688 0.000
#> SRR1652899     1  0.4776     0.5738 0.624 0.000 0.376 0.000
#> SRR1652900     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652901     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652902     1  0.4804     0.5625 0.616 0.000 0.384 0.000
#> SRR1652903     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652905     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652906     3  0.4522     0.1105 0.320 0.000 0.680 0.000
#> SRR1652907     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652908     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652909     3  0.4564     0.1220 0.328 0.000 0.672 0.000
#> SRR1652910     1  0.4776     0.5738 0.624 0.000 0.376 0.000
#> SRR1652911     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.4989     0.2117 0.000 0.528 0.000 0.472
#> SRR1652913     1  0.4925     0.1735 0.572 0.000 0.000 0.428
#> SRR1652914     3  0.5523     0.2889 0.000 0.024 0.596 0.380
#> SRR1652915     3  0.3444     0.5366 0.000 0.000 0.816 0.184
#> SRR1652916     1  0.4776     0.5738 0.624 0.000 0.376 0.000
#> SRR1652917     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652918     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652919     3  0.0817     0.5628 0.000 0.024 0.976 0.000
#> SRR1652920     2  0.0817     0.9206 0.000 0.976 0.000 0.024
#> SRR1652921     3  0.5428     0.1858 0.020 0.000 0.600 0.380
#> SRR1652922     3  0.3751     0.5273 0.000 0.004 0.800 0.196
#> SRR1652923     3  0.5311     0.3767 0.000 0.024 0.648 0.328
#> SRR1652924     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652925     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652926     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652927     1  0.4776     0.5738 0.624 0.000 0.376 0.000
#> SRR1652928     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652929     3  0.1833     0.5700 0.000 0.024 0.944 0.032
#> SRR1652930     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652931     4  0.5548     0.2571 0.000 0.024 0.388 0.588
#> SRR1652932     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652933     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652934     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652935     4  0.2949     0.7440 0.000 0.088 0.024 0.888
#> SRR1652936     2  0.0817     0.9206 0.000 0.976 0.000 0.024
#> SRR1652937     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652938     4  0.4877     0.2708 0.000 0.000 0.408 0.592
#> SRR1652939     4  0.0707     0.8156 0.000 0.000 0.020 0.980
#> SRR1652940     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652941     4  0.4972     0.1453 0.000 0.000 0.456 0.544
#> SRR1652942     2  0.0817     0.9206 0.000 0.976 0.000 0.024
#> SRR1652943     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652944     3  0.5420     0.3373 0.000 0.024 0.624 0.352
#> SRR1652945     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652946     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652947     1  0.3528     0.7174 0.808 0.000 0.192 0.000
#> SRR1652948     4  0.5696    -0.0120 0.000 0.024 0.480 0.496
#> SRR1652949     3  0.4994    -0.3377 0.480 0.000 0.520 0.000
#> SRR1652950     3  0.0188     0.5634 0.000 0.000 0.996 0.004
#> SRR1652951     2  0.0817     0.9206 0.000 0.976 0.000 0.024
#> SRR1652953     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.0817     0.9206 0.000 0.976 0.000 0.024
#> SRR1652954     4  0.4776     0.2579 0.000 0.000 0.376 0.624
#> SRR1652955     3  0.0817     0.5628 0.000 0.024 0.976 0.000
#> SRR1652958     1  0.4776     0.5738 0.624 0.000 0.376 0.000
#> SRR1652956     2  0.0817     0.9206 0.000 0.976 0.000 0.024
#> SRR1652957     4  0.3975     0.5129 0.000 0.000 0.240 0.760
#> SRR1652959     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652960     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652961     4  0.4916     0.2487 0.000 0.424 0.000 0.576
#> SRR1652962     2  0.0817     0.9206 0.000 0.976 0.000 0.024
#> SRR1652963     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652965     3  0.4855    -0.1230 0.400 0.000 0.600 0.000
#> SRR1652964     4  0.4331     0.5088 0.000 0.000 0.288 0.712
#> SRR1652966     3  0.4888    -0.1556 0.412 0.000 0.588 0.000
#> SRR1652967     4  0.3873     0.5978 0.000 0.000 0.228 0.772
#> SRR1652969     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652968     3  0.5331     0.3709 0.000 0.024 0.644 0.332
#> SRR1652970     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652971     3  0.5168    -0.0437 0.004 0.000 0.504 0.492
#> SRR1652972     3  0.0000     0.5615 0.000 0.000 1.000 0.000
#> SRR1652973     4  0.0188     0.8288 0.000 0.000 0.004 0.996
#> SRR1652974     1  0.0000     0.8116 1.000 0.000 0.000 0.000
#> SRR1652975     4  0.0000     0.8317 0.000 0.000 0.000 1.000
#> SRR1652976     4  0.5696    -0.0120 0.000 0.024 0.480 0.496
#> SRR1652977     3  0.5548     0.2717 0.000 0.024 0.588 0.388

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3   0.478     0.4313 0.000 0.004 0.532 0.452 0.012
#> SRR1652897     5   0.431     0.0385 0.496 0.000 0.000 0.000 0.504
#> SRR1652898     5   0.157     0.7887 0.020 0.000 0.036 0.000 0.944
#> SRR1652899     5   0.148     0.8033 0.064 0.000 0.000 0.000 0.936
#> SRR1652900     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652901     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652902     5   0.134     0.8039 0.056 0.000 0.000 0.000 0.944
#> SRR1652903     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652906     5   0.122     0.7951 0.020 0.000 0.020 0.000 0.960
#> SRR1652907     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652908     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652909     5   0.167     0.8034 0.052 0.000 0.012 0.000 0.936
#> SRR1652910     5   0.148     0.8033 0.064 0.000 0.000 0.000 0.936
#> SRR1652911     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2   0.430     0.1419 0.000 0.528 0.000 0.472 0.000
#> SRR1652913     1   0.422     0.3108 0.584 0.000 0.000 0.416 0.000
#> SRR1652914     3   0.386     0.7007 0.000 0.000 0.688 0.312 0.000
#> SRR1652915     5   0.634    -0.0665 0.000 0.000 0.312 0.184 0.504
#> SRR1652916     5   0.148     0.8033 0.064 0.000 0.000 0.000 0.936
#> SRR1652917     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652918     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652919     3   0.386     0.4917 0.000 0.000 0.688 0.000 0.312
#> SRR1652920     2   0.000     0.9146 0.000 1.000 0.000 0.000 0.000
#> SRR1652921     5   0.172     0.7758 0.004 0.000 0.008 0.052 0.936
#> SRR1652922     3   0.576     0.6670 0.000 0.000 0.620 0.196 0.184
#> SRR1652923     3   0.455     0.7207 0.000 0.000 0.688 0.276 0.036
#> SRR1652924     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652925     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652926     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652927     5   0.148     0.8033 0.064 0.000 0.000 0.000 0.936
#> SRR1652928     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652929     3   0.456     0.5325 0.000 0.000 0.676 0.032 0.292
#> SRR1652930     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652931     4   0.421    -0.0186 0.000 0.000 0.412 0.588 0.000
#> SRR1652932     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652934     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652935     4   0.359     0.7128 0.000 0.088 0.084 0.828 0.000
#> SRR1652936     2   0.000     0.9146 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652938     5   0.489     0.1051 0.000 0.000 0.024 0.448 0.528
#> SRR1652939     4   0.402     0.3621 0.000 0.000 0.000 0.652 0.348
#> SRR1652940     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     5   0.488     0.1895 0.000 0.000 0.028 0.396 0.576
#> SRR1652942     2   0.000     0.9146 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652944     3   0.438     0.7158 0.000 0.000 0.688 0.288 0.024
#> SRR1652945     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652946     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652947     1   0.307     0.6940 0.804 0.000 0.000 0.000 0.196
#> SRR1652948     3   0.410     0.6184 0.000 0.000 0.628 0.372 0.000
#> SRR1652949     5   0.130     0.7978 0.028 0.000 0.016 0.000 0.956
#> SRR1652950     3   0.430     0.3757 0.000 0.000 0.608 0.004 0.388
#> SRR1652951     2   0.000     0.9146 0.000 1.000 0.000 0.000 0.000
#> SRR1652953     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     2   0.000     0.9146 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     5   0.148     0.7688 0.000 0.000 0.000 0.064 0.936
#> SRR1652955     3   0.386     0.4917 0.000 0.000 0.688 0.000 0.312
#> SRR1652958     5   0.148     0.8033 0.064 0.000 0.000 0.000 0.936
#> SRR1652956     2   0.000     0.9146 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     4   0.353     0.5180 0.000 0.000 0.000 0.744 0.256
#> SRR1652959     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652960     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652961     4   0.425     0.2664 0.000 0.432 0.000 0.568 0.000
#> SRR1652962     2   0.000     0.9146 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652965     5   0.230     0.7788 0.024 0.000 0.072 0.000 0.904
#> SRR1652964     4   0.398     0.2754 0.000 0.000 0.340 0.660 0.000
#> SRR1652966     5   0.131     0.7961 0.024 0.000 0.020 0.000 0.956
#> SRR1652967     4   0.321     0.5935 0.000 0.000 0.212 0.788 0.000
#> SRR1652969     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652968     3   0.444     0.7182 0.000 0.000 0.688 0.284 0.028
#> SRR1652970     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     3   0.547     0.1804 0.000 0.000 0.596 0.084 0.320
#> SRR1652972     5   0.417     0.1778 0.000 0.000 0.396 0.000 0.604
#> SRR1652973     4   0.228     0.7509 0.000 0.000 0.000 0.880 0.120
#> SRR1652974     1   0.000     0.9431 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     4   0.000     0.8788 0.000 0.000 0.000 1.000 0.000
#> SRR1652976     3   0.395     0.6771 0.000 0.000 0.668 0.332 0.000
#> SRR1652977     3   0.386     0.7007 0.000 0.000 0.688 0.312 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
#> SRR1652895     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652896     3  0.3950     0.4731 0.000 0.004 0.564 0.432  0 0.000
#> SRR1652897     6  0.3860     0.0596 0.472 0.000 0.000 0.000  0 0.528
#> SRR1652898     6  0.0790     0.7874 0.000 0.000 0.032 0.000  0 0.968
#> SRR1652899     6  0.0363     0.8027 0.012 0.000 0.000 0.000  0 0.988
#> SRR1652900     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652901     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652902     6  0.0146     0.8017 0.004 0.000 0.000 0.000  0 0.996
#> SRR1652903     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652904     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652905     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652906     6  0.0000     0.8002 0.000 0.000 0.000 0.000  0 1.000
#> SRR1652907     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652908     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652909     6  0.0363     0.8027 0.012 0.000 0.000 0.000  0 0.988
#> SRR1652910     6  0.0363     0.8027 0.012 0.000 0.000 0.000  0 0.988
#> SRR1652911     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652912     2  0.3860     0.1288 0.000 0.528 0.000 0.472  0 0.000
#> SRR1652913     1  0.3789     0.2105 0.584 0.000 0.000 0.416  0 0.000
#> SRR1652914     3  0.3198     0.7621 0.000 0.000 0.740 0.260  0 0.000
#> SRR1652915     6  0.5683     0.0342 0.000 0.000 0.308 0.184  0 0.508
#> SRR1652916     6  0.0363     0.8027 0.012 0.000 0.000 0.000  0 0.988
#> SRR1652917     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652918     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652919     3  0.3175     0.5431 0.000 0.000 0.744 0.000  0 0.256
#> SRR1652920     2  0.0000     0.8710 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652921     6  0.0405     0.8011 0.004 0.000 0.000 0.008  0 0.988
#> SRR1652922     3  0.4094     0.6960 0.000 0.000 0.740 0.180  0 0.080
#> SRR1652923     3  0.3566     0.7645 0.000 0.000 0.744 0.236  0 0.020
#> SRR1652924     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652925     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652926     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652927     6  0.0363     0.8027 0.012 0.000 0.000 0.000  0 0.988
#> SRR1652928     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652929     3  0.3911     0.5720 0.000 0.000 0.712 0.032  0 0.256
#> SRR1652930     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652931     4  0.3797    -0.0410 0.000 0.000 0.420 0.580  0 0.000
#> SRR1652932     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652933     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652934     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652935     4  0.3845     0.6346 0.000 0.088 0.140 0.772  0 0.000
#> SRR1652936     2  0.0000     0.8710 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652937     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652938     6  0.3833     0.1607 0.000 0.000 0.000 0.444  0 0.556
#> SRR1652939     4  0.3672     0.3556 0.000 0.000 0.000 0.632  0 0.368
#> SRR1652940     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652941     6  0.3727     0.2961 0.000 0.000 0.000 0.388  0 0.612
#> SRR1652942     2  0.0000     0.8710 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652943     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652944     3  0.3445     0.7647 0.000 0.000 0.744 0.244  0 0.012
#> SRR1652945     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652946     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652947     1  0.2762     0.6410 0.804 0.000 0.000 0.000  0 0.196
#> SRR1652948     3  0.3620     0.6590 0.000 0.000 0.648 0.352  0 0.000
#> SRR1652949     6  0.0547     0.7942 0.000 0.000 0.020 0.000  0 0.980
#> SRR1652950     3  0.3841     0.4023 0.000 0.000 0.616 0.004  0 0.380
#> SRR1652951     2  0.0000     0.8710 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652953     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652952     2  0.0000     0.8710 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652954     6  0.0363     0.7987 0.000 0.000 0.000 0.012  0 0.988
#> SRR1652955     3  0.3175     0.5431 0.000 0.000 0.744 0.000  0 0.256
#> SRR1652958     6  0.0363     0.8027 0.012 0.000 0.000 0.000  0 0.988
#> SRR1652956     2  0.0000     0.8710 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652957     4  0.3198     0.5351 0.000 0.000 0.000 0.740  0 0.260
#> SRR1652959     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652960     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652961     4  0.3817     0.2588 0.000 0.432 0.000 0.568  0 0.000
#> SRR1652962     2  0.0000     0.8710 0.000 1.000 0.000 0.000  0 0.000
#> SRR1652963     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652965     6  0.2631     0.6453 0.000 0.000 0.180 0.000  0 0.820
#> SRR1652964     4  0.3727     0.1175 0.000 0.000 0.388 0.612  0 0.000
#> SRR1652966     6  0.0547     0.7942 0.000 0.000 0.020 0.000  0 0.980
#> SRR1652967     4  0.2883     0.5956 0.000 0.000 0.212 0.788  0 0.000
#> SRR1652969     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652968     3  0.3509     0.7653 0.000 0.000 0.744 0.240  0 0.016
#> SRR1652970     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652971     5  0.0000     0.0000 0.000 0.000 0.000 0.000  1 0.000
#> SRR1652972     6  0.3737     0.2133 0.000 0.000 0.392 0.000  0 0.608
#> SRR1652973     4  0.2178     0.7383 0.000 0.000 0.000 0.868  0 0.132
#> SRR1652974     1  0.0000     0.9321 1.000 0.000 0.000 0.000  0 0.000
#> SRR1652975     4  0.0000     0.8744 0.000 0.000 0.000 1.000  0 0.000
#> SRR1652976     3  0.3390     0.7411 0.000 0.000 0.704 0.296  0 0.000
#> SRR1652977     3  0.3244     0.7596 0.000 0.000 0.732 0.268  0 0.000

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

consensus_heatmap(res, k = 2)

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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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 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 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.488           0.830       0.902         0.3104 0.685   0.685
#> 3 3 0.346           0.797       0.827         0.7952 0.568   0.434
#> 4 4 0.314           0.484       0.712         0.1386 0.774   0.518
#> 5 5 0.862           0.812       0.916         0.2218 0.836   0.519
#> 6 6 0.816           0.743       0.875         0.0497 0.935   0.720

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
#> SRR1652895     2  0.6712     0.7543 0.176 0.824
#> SRR1652896     1  0.8955     0.8414 0.688 0.312
#> SRR1652897     2  0.0000     0.9131 0.000 1.000
#> SRR1652898     2  0.9933    -0.2939 0.452 0.548
#> SRR1652899     2  0.0000     0.9131 0.000 1.000
#> SRR1652900     2  0.0000     0.9131 0.000 1.000
#> SRR1652901     2  0.0000     0.9131 0.000 1.000
#> SRR1652902     2  0.0000     0.9131 0.000 1.000
#> SRR1652903     2  0.6712     0.7543 0.176 0.824
#> SRR1652904     2  0.6712     0.7543 0.176 0.824
#> SRR1652905     2  0.0000     0.9131 0.000 1.000
#> SRR1652906     2  0.0000     0.9131 0.000 1.000
#> SRR1652907     2  0.4939     0.7882 0.108 0.892
#> SRR1652908     2  0.0000     0.9131 0.000 1.000
#> SRR1652909     2  0.0000     0.9131 0.000 1.000
#> SRR1652910     2  0.0000     0.9131 0.000 1.000
#> SRR1652911     2  0.6712     0.7543 0.176 0.824
#> SRR1652912     2  0.1843     0.8946 0.028 0.972
#> SRR1652913     2  0.0000     0.9131 0.000 1.000
#> SRR1652914     1  0.7453     0.9304 0.788 0.212
#> SRR1652915     1  0.9732     0.6994 0.596 0.404
#> SRR1652916     2  0.0000     0.9131 0.000 1.000
#> SRR1652917     2  0.0000     0.9131 0.000 1.000
#> SRR1652918     2  0.0000     0.9131 0.000 1.000
#> SRR1652919     1  0.7299     0.9324 0.796 0.204
#> SRR1652920     2  0.0000     0.9131 0.000 1.000
#> SRR1652921     2  0.0000     0.9131 0.000 1.000
#> SRR1652922     1  0.7299     0.9324 0.796 0.204
#> SRR1652923     1  0.7299     0.9324 0.796 0.204
#> SRR1652924     2  0.0000     0.9131 0.000 1.000
#> SRR1652925     2  0.0000     0.9131 0.000 1.000
#> SRR1652926     2  0.0000     0.9131 0.000 1.000
#> SRR1652927     2  0.0000     0.9131 0.000 1.000
#> SRR1652928     2  0.0672     0.9086 0.008 0.992
#> SRR1652929     1  0.7674     0.9255 0.776 0.224
#> SRR1652930     2  0.0672     0.9086 0.008 0.992
#> SRR1652931     2  0.9754    -0.1054 0.408 0.592
#> SRR1652932     2  0.6712     0.7543 0.176 0.824
#> SRR1652933     2  0.0000     0.9131 0.000 1.000
#> SRR1652934     2  0.0000     0.9131 0.000 1.000
#> SRR1652935     1  0.9686     0.7163 0.604 0.396
#> SRR1652936     2  0.1843     0.8946 0.028 0.972
#> SRR1652937     2  0.6623     0.7585 0.172 0.828
#> SRR1652938     2  0.0000     0.9131 0.000 1.000
#> SRR1652939     2  0.0000     0.9131 0.000 1.000
#> SRR1652940     2  0.6712     0.7543 0.176 0.824
#> SRR1652941     2  0.0000     0.9131 0.000 1.000
#> SRR1652942     2  0.1843     0.8946 0.028 0.972
#> SRR1652943     2  0.0000     0.9131 0.000 1.000
#> SRR1652944     1  0.7528     0.9304 0.784 0.216
#> SRR1652945     2  0.0000     0.9131 0.000 1.000
#> SRR1652946     2  0.0000     0.9131 0.000 1.000
#> SRR1652947     2  0.2603     0.8750 0.044 0.956
#> SRR1652948     1  0.9608     0.7387 0.616 0.384
#> SRR1652949     2  0.7745     0.5600 0.228 0.772
#> SRR1652950     2  0.0376     0.9102 0.004 0.996
#> SRR1652951     2  0.0000     0.9131 0.000 1.000
#> SRR1652953     2  0.6148     0.7788 0.152 0.848
#> SRR1652952     2  0.1843     0.8946 0.028 0.972
#> SRR1652954     2  0.0000     0.9131 0.000 1.000
#> SRR1652955     1  0.7528     0.9304 0.784 0.216
#> SRR1652958     2  0.0000     0.9131 0.000 1.000
#> SRR1652956     2  0.1843     0.8946 0.028 0.972
#> SRR1652957     2  0.0000     0.9131 0.000 1.000
#> SRR1652959     2  0.0000     0.9131 0.000 1.000
#> SRR1652960     2  0.0000     0.9131 0.000 1.000
#> SRR1652961     2  0.0000     0.9131 0.000 1.000
#> SRR1652962     2  0.1843     0.8946 0.028 0.972
#> SRR1652963     2  0.0000     0.9131 0.000 1.000
#> SRR1652965     1  0.7299     0.9324 0.796 0.204
#> SRR1652964     2  0.0000     0.9131 0.000 1.000
#> SRR1652966     2  0.9522     0.0717 0.372 0.628
#> SRR1652967     1  0.7299     0.9324 0.796 0.204
#> SRR1652969     2  0.0000     0.9131 0.000 1.000
#> SRR1652968     1  0.7299     0.9324 0.796 0.204
#> SRR1652970     2  0.6712     0.7543 0.176 0.824
#> SRR1652971     1  0.7299     0.9324 0.796 0.204
#> SRR1652972     2  0.7602     0.5789 0.220 0.780
#> SRR1652973     2  0.0000     0.9131 0.000 1.000
#> SRR1652974     2  0.6712     0.7543 0.176 0.824
#> SRR1652975     2  0.0000     0.9131 0.000 1.000
#> SRR1652976     2  0.9491     0.0878 0.368 0.632
#> SRR1652977     1  0.7376     0.9319 0.792 0.208

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.1753     0.7122 0.952 0.048 0.000
#> SRR1652896     1  0.9112     0.0982 0.432 0.140 0.428
#> SRR1652897     2  0.3686     0.7977 0.140 0.860 0.000
#> SRR1652898     1  0.8350     0.6974 0.628 0.196 0.176
#> SRR1652899     1  0.5318     0.7660 0.780 0.204 0.016
#> SRR1652900     2  0.2636     0.9174 0.020 0.932 0.048
#> SRR1652901     2  0.3484     0.8592 0.048 0.904 0.048
#> SRR1652902     1  0.6400     0.7638 0.740 0.208 0.052
#> SRR1652903     1  0.1753     0.7122 0.952 0.048 0.000
#> SRR1652904     1  0.1753     0.7122 0.952 0.048 0.000
#> SRR1652905     2  0.2173     0.8977 0.008 0.944 0.048
#> SRR1652906     1  0.6981     0.7550 0.704 0.228 0.068
#> SRR1652907     1  0.7345     0.7580 0.700 0.192 0.108
#> SRR1652908     2  0.1315     0.9227 0.008 0.972 0.020
#> SRR1652909     1  0.6854     0.7590 0.716 0.216 0.068
#> SRR1652910     1  0.5551     0.7647 0.768 0.212 0.020
#> SRR1652911     1  0.1753     0.7122 0.952 0.048 0.000
#> SRR1652912     2  0.3141     0.8922 0.020 0.912 0.068
#> SRR1652913     2  0.2448     0.9076 0.076 0.924 0.000
#> SRR1652914     1  0.8107     0.6026 0.604 0.096 0.300
#> SRR1652915     1  0.7495     0.7091 0.692 0.120 0.188
#> SRR1652916     1  0.6482     0.7567 0.716 0.244 0.040
#> SRR1652917     2  0.1411     0.9234 0.036 0.964 0.000
#> SRR1652918     2  0.1529     0.9259 0.040 0.960 0.000
#> SRR1652919     3  0.4291     0.9008 0.008 0.152 0.840
#> SRR1652920     2  0.3028     0.9128 0.032 0.920 0.048
#> SRR1652921     2  0.2165     0.9165 0.064 0.936 0.000
#> SRR1652922     3  0.4291     0.9008 0.008 0.152 0.840
#> SRR1652923     1  0.7481     0.6161 0.640 0.064 0.296
#> SRR1652924     2  0.2492     0.9229 0.048 0.936 0.016
#> SRR1652925     2  0.2383     0.9243 0.044 0.940 0.016
#> SRR1652926     2  0.1289     0.9247 0.032 0.968 0.000
#> SRR1652927     1  0.5595     0.7649 0.756 0.228 0.016
#> SRR1652928     1  0.4555     0.7537 0.800 0.200 0.000
#> SRR1652929     1  0.7545     0.7219 0.692 0.136 0.172
#> SRR1652930     1  0.4750     0.7475 0.784 0.216 0.000
#> SRR1652931     1  0.8630     0.5171 0.552 0.120 0.328
#> SRR1652932     1  0.1860     0.7136 0.948 0.052 0.000
#> SRR1652933     2  0.0475     0.9268 0.004 0.992 0.004
#> SRR1652934     2  0.1163     0.9267 0.028 0.972 0.000
#> SRR1652935     3  0.4589     0.8899 0.008 0.172 0.820
#> SRR1652936     2  0.3670     0.8934 0.020 0.888 0.092
#> SRR1652937     1  0.2878     0.7372 0.904 0.096 0.000
#> SRR1652938     2  0.2339     0.9238 0.048 0.940 0.012
#> SRR1652939     2  0.0237     0.9270 0.004 0.996 0.000
#> SRR1652940     1  0.1753     0.7122 0.952 0.048 0.000
#> SRR1652941     1  0.6798     0.7404 0.696 0.256 0.048
#> SRR1652942     2  0.4280     0.8772 0.020 0.856 0.124
#> SRR1652943     2  0.1411     0.9234 0.036 0.964 0.000
#> SRR1652944     1  0.7226     0.6729 0.688 0.076 0.236
#> SRR1652945     2  0.2492     0.9229 0.048 0.936 0.016
#> SRR1652946     2  0.2492     0.9229 0.048 0.936 0.016
#> SRR1652947     1  0.6402     0.7721 0.744 0.200 0.056
#> SRR1652948     3  0.9612    -0.0588 0.372 0.204 0.424
#> SRR1652949     1  0.7316     0.7539 0.704 0.184 0.112
#> SRR1652950     1  0.7496     0.7403 0.672 0.240 0.088
#> SRR1652951     2  0.3445     0.8967 0.016 0.896 0.088
#> SRR1652953     1  0.3340     0.7474 0.880 0.120 0.000
#> SRR1652952     2  0.4280     0.8772 0.020 0.856 0.124
#> SRR1652954     2  0.2165     0.9097 0.064 0.936 0.000
#> SRR1652955     1  0.7244     0.6930 0.700 0.092 0.208
#> SRR1652958     1  0.6099     0.7641 0.740 0.228 0.032
#> SRR1652956     2  0.4280     0.8772 0.020 0.856 0.124
#> SRR1652957     2  0.1529     0.9224 0.040 0.960 0.000
#> SRR1652959     2  0.1774     0.9262 0.016 0.960 0.024
#> SRR1652960     2  0.0661     0.9279 0.004 0.988 0.008
#> SRR1652961     2  0.3112     0.9061 0.028 0.916 0.056
#> SRR1652962     2  0.4136     0.8827 0.020 0.864 0.116
#> SRR1652963     2  0.2998     0.8970 0.016 0.916 0.068
#> SRR1652965     3  0.4291     0.9008 0.008 0.152 0.840
#> SRR1652964     2  0.3406     0.8950 0.028 0.904 0.068
#> SRR1652966     1  0.7014     0.7534 0.712 0.208 0.080
#> SRR1652967     3  0.4353     0.8995 0.008 0.156 0.836
#> SRR1652969     2  0.0237     0.9270 0.004 0.996 0.000
#> SRR1652968     1  0.7937     0.5053 0.568 0.068 0.364
#> SRR1652970     1  0.1753     0.7122 0.952 0.048 0.000
#> SRR1652971     3  0.4291     0.9008 0.008 0.152 0.840
#> SRR1652972     1  0.7657     0.7483 0.676 0.208 0.116
#> SRR1652973     2  0.0237     0.9270 0.004 0.996 0.000
#> SRR1652974     1  0.1753     0.7122 0.952 0.048 0.000
#> SRR1652975     2  0.0237     0.9270 0.004 0.996 0.000
#> SRR1652976     3  0.5366     0.8407 0.016 0.208 0.776
#> SRR1652977     1  0.8280     0.5319 0.564 0.092 0.344

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0707     0.5852 0.980 0.000 0.020 0.000
#> SRR1652896     3  0.1732     0.6222 0.004 0.008 0.948 0.040
#> SRR1652897     1  0.8395     0.2883 0.460 0.208 0.296 0.036
#> SRR1652898     3  0.6245     0.2723 0.300 0.056 0.632 0.012
#> SRR1652899     1  0.6164     0.5731 0.644 0.092 0.264 0.000
#> SRR1652900     2  0.0376     0.6282 0.004 0.992 0.000 0.004
#> SRR1652901     3  0.6300    -0.1154 0.008 0.404 0.544 0.044
#> SRR1652902     1  0.6265     0.5061 0.588 0.072 0.340 0.000
#> SRR1652903     1  0.0707     0.5852 0.980 0.000 0.020 0.000
#> SRR1652904     1  0.0707     0.5852 0.980 0.000 0.020 0.000
#> SRR1652905     2  0.5579     0.5675 0.004 0.640 0.328 0.028
#> SRR1652906     3  0.4685     0.5457 0.156 0.060 0.784 0.000
#> SRR1652907     1  0.6197     0.4275 0.544 0.056 0.400 0.000
#> SRR1652908     2  0.5405     0.5837 0.004 0.660 0.312 0.024
#> SRR1652909     1  0.6907     0.4501 0.532 0.120 0.348 0.000
#> SRR1652910     1  0.6293     0.5629 0.628 0.096 0.276 0.000
#> SRR1652911     1  0.0707     0.5852 0.980 0.000 0.020 0.000
#> SRR1652912     2  0.0336     0.6234 0.000 0.992 0.000 0.008
#> SRR1652913     1  0.9450     0.1139 0.376 0.268 0.244 0.112
#> SRR1652914     3  0.1109     0.6318 0.028 0.000 0.968 0.004
#> SRR1652915     3  0.1114     0.6388 0.016 0.008 0.972 0.004
#> SRR1652916     3  0.7047    -0.2548 0.436 0.120 0.444 0.000
#> SRR1652917     3  0.8724    -0.3452 0.100 0.392 0.396 0.112
#> SRR1652918     2  0.7173     0.6568 0.048 0.648 0.180 0.124
#> SRR1652919     3  0.6134     0.0121 0.004 0.040 0.532 0.424
#> SRR1652920     2  0.1648     0.6302 0.016 0.956 0.012 0.016
#> SRR1652921     2  0.9082     0.4308 0.168 0.464 0.244 0.124
#> SRR1652922     3  0.5863    -0.1202 0.004 0.024 0.496 0.476
#> SRR1652923     3  0.1406     0.6248 0.024 0.000 0.960 0.016
#> SRR1652924     2  0.6936     0.6632 0.048 0.672 0.156 0.124
#> SRR1652925     2  0.6887     0.6640 0.048 0.676 0.156 0.120
#> SRR1652926     2  0.7889     0.5438 0.048 0.524 0.316 0.112
#> SRR1652927     1  0.7008     0.2192 0.448 0.116 0.436 0.000
#> SRR1652928     1  0.6147     0.5871 0.664 0.112 0.224 0.000
#> SRR1652929     3  0.2418     0.6396 0.016 0.032 0.928 0.024
#> SRR1652930     1  0.6267     0.5631 0.648 0.112 0.240 0.000
#> SRR1652931     3  0.0937     0.6390 0.012 0.012 0.976 0.000
#> SRR1652932     1  0.0707     0.5852 0.980 0.000 0.020 0.000
#> SRR1652933     2  0.7093     0.4358 0.004 0.492 0.392 0.112
#> SRR1652934     2  0.8640     0.3096 0.092 0.408 0.388 0.112
#> SRR1652935     4  0.7726     0.0476 0.004 0.200 0.348 0.448
#> SRR1652936     2  0.0336     0.6234 0.000 0.992 0.000 0.008
#> SRR1652937     1  0.4678     0.6032 0.744 0.024 0.232 0.000
#> SRR1652938     2  0.8480     0.5190 0.104 0.528 0.244 0.124
#> SRR1652939     2  0.8408     0.3363 0.072 0.424 0.392 0.112
#> SRR1652940     1  0.0707     0.5852 0.980 0.000 0.020 0.000
#> SRR1652941     3  0.5611     0.5353 0.096 0.128 0.756 0.020
#> SRR1652942     2  0.0336     0.6234 0.000 0.992 0.000 0.008
#> SRR1652943     2  0.7504     0.6364 0.048 0.608 0.220 0.124
#> SRR1652944     3  0.1004     0.6305 0.024 0.000 0.972 0.004
#> SRR1652945     2  0.6936     0.6632 0.048 0.672 0.156 0.124
#> SRR1652946     2  0.7755     0.5856 0.056 0.584 0.236 0.124
#> SRR1652947     1  0.6990     0.5467 0.588 0.112 0.288 0.012
#> SRR1652948     3  0.5044     0.5269 0.004 0.172 0.764 0.060
#> SRR1652949     3  0.6007     0.1735 0.340 0.056 0.604 0.000
#> SRR1652950     3  0.2996     0.6411 0.044 0.064 0.892 0.000
#> SRR1652951     2  0.0712     0.6276 0.004 0.984 0.004 0.008
#> SRR1652953     1  0.4153     0.6227 0.820 0.048 0.132 0.000
#> SRR1652952     2  0.0336     0.6234 0.000 0.992 0.000 0.008
#> SRR1652954     3  0.8938    -0.3217 0.124 0.372 0.392 0.112
#> SRR1652955     3  0.0592     0.6349 0.016 0.000 0.984 0.000
#> SRR1652958     1  0.6938     0.3189 0.488 0.112 0.400 0.000
#> SRR1652956     2  0.0336     0.6234 0.000 0.992 0.000 0.008
#> SRR1652957     3  0.8870    -0.3290 0.116 0.376 0.396 0.112
#> SRR1652959     2  0.3484     0.6735 0.004 0.844 0.144 0.008
#> SRR1652960     2  0.3519     0.6771 0.004 0.852 0.128 0.016
#> SRR1652961     2  0.0376     0.6251 0.000 0.992 0.004 0.004
#> SRR1652962     2  0.0336     0.6234 0.000 0.992 0.000 0.008
#> SRR1652963     2  0.2944     0.6691 0.004 0.868 0.128 0.000
#> SRR1652965     4  0.3105     0.8047 0.000 0.012 0.120 0.868
#> SRR1652964     2  0.6103     0.5514 0.008 0.640 0.296 0.056
#> SRR1652966     3  0.3694     0.5857 0.124 0.032 0.844 0.000
#> SRR1652967     4  0.3105     0.8047 0.000 0.012 0.120 0.868
#> SRR1652969     2  0.7697     0.4082 0.028 0.472 0.388 0.112
#> SRR1652968     3  0.1284     0.6271 0.024 0.000 0.964 0.012
#> SRR1652970     1  0.0707     0.5852 0.980 0.000 0.020 0.000
#> SRR1652971     4  0.3105     0.8047 0.000 0.012 0.120 0.868
#> SRR1652972     3  0.6591     0.4751 0.172 0.068 0.696 0.064
#> SRR1652973     2  0.8642     0.3002 0.092 0.404 0.392 0.112
#> SRR1652974     1  0.0707     0.5852 0.980 0.000 0.020 0.000
#> SRR1652975     2  0.7023     0.5541 0.004 0.552 0.320 0.124
#> SRR1652976     3  0.8172     0.3459 0.064 0.180 0.556 0.200
#> SRR1652977     3  0.1109     0.6318 0.028 0.000 0.968 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
#> SRR1652895     1  0.0000     0.9122 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.0579     0.8957 0.000 0.000 0.984 0.008 0.008
#> SRR1652897     1  0.4294     0.1883 0.532 0.000 0.000 0.468 0.000
#> SRR1652898     3  0.2474     0.8330 0.084 0.000 0.896 0.008 0.012
#> SRR1652899     1  0.0579     0.9112 0.984 0.000 0.008 0.008 0.000
#> SRR1652900     2  0.0290     0.9069 0.000 0.992 0.000 0.008 0.000
#> SRR1652901     4  0.5062     0.5494 0.000 0.068 0.276 0.656 0.000
#> SRR1652902     1  0.2753     0.8097 0.856 0.000 0.136 0.008 0.000
#> SRR1652903     1  0.0000     0.9122 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9122 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.5484     0.2733 0.000 0.540 0.068 0.392 0.000
#> SRR1652906     3  0.3519     0.6938 0.216 0.000 0.776 0.008 0.000
#> SRR1652907     1  0.3612     0.7163 0.764 0.000 0.228 0.008 0.000
#> SRR1652908     2  0.3074     0.7312 0.000 0.804 0.000 0.196 0.000
#> SRR1652909     1  0.2753     0.8096 0.856 0.000 0.136 0.008 0.000
#> SRR1652910     1  0.0798     0.9083 0.976 0.000 0.016 0.008 0.000
#> SRR1652911     1  0.0000     0.9122 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9070 0.000 1.000 0.000 0.000 0.000
#> SRR1652913     4  0.0703     0.9166 0.024 0.000 0.000 0.976 0.000
#> SRR1652914     3  0.1043     0.9018 0.040 0.000 0.960 0.000 0.000
#> SRR1652915     3  0.0290     0.8950 0.000 0.000 0.992 0.008 0.000
#> SRR1652916     1  0.1168     0.8986 0.960 0.000 0.008 0.032 0.000
#> SRR1652917     4  0.0671     0.9203 0.016 0.000 0.004 0.980 0.000
#> SRR1652918     4  0.0404     0.9230 0.000 0.012 0.000 0.988 0.000
#> SRR1652919     5  0.4560     0.1535 0.000 0.000 0.484 0.008 0.508
#> SRR1652920     2  0.2127     0.8318 0.000 0.892 0.000 0.108 0.000
#> SRR1652921     4  0.1043     0.9123 0.040 0.000 0.000 0.960 0.000
#> SRR1652922     5  0.4533     0.2006 0.000 0.000 0.448 0.008 0.544
#> SRR1652923     3  0.1043     0.9018 0.040 0.000 0.960 0.000 0.000
#> SRR1652924     4  0.0703     0.9212 0.000 0.024 0.000 0.976 0.000
#> SRR1652925     4  0.0794     0.9202 0.000 0.028 0.000 0.972 0.000
#> SRR1652926     4  0.0162     0.9227 0.000 0.004 0.000 0.996 0.000
#> SRR1652927     1  0.0798     0.9089 0.976 0.000 0.008 0.016 0.000
#> SRR1652928     1  0.0290     0.9128 0.992 0.000 0.000 0.008 0.000
#> SRR1652929     3  0.0898     0.9031 0.020 0.000 0.972 0.008 0.000
#> SRR1652930     1  0.0404     0.9120 0.988 0.000 0.000 0.012 0.000
#> SRR1652931     3  0.0579     0.8942 0.000 0.008 0.984 0.008 0.000
#> SRR1652932     1  0.0000     0.9122 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.1831     0.8927 0.000 0.076 0.004 0.920 0.000
#> SRR1652934     4  0.1597     0.9177 0.020 0.024 0.008 0.948 0.000
#> SRR1652935     5  0.5349     0.0786 0.000 0.440 0.036 0.008 0.516
#> SRR1652936     2  0.0000     0.9070 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1  0.0290     0.9128 0.992 0.000 0.000 0.008 0.000
#> SRR1652938     4  0.1211     0.9229 0.016 0.024 0.000 0.960 0.000
#> SRR1652939     4  0.1836     0.9130 0.016 0.040 0.008 0.936 0.000
#> SRR1652940     1  0.0000     0.9122 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.3730     0.7941 0.108 0.020 0.832 0.040 0.000
#> SRR1652942     2  0.0000     0.9070 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     4  0.0000     0.9212 0.000 0.000 0.000 1.000 0.000
#> SRR1652944     3  0.1043     0.9018 0.040 0.000 0.960 0.000 0.000
#> SRR1652945     4  0.0794     0.9202 0.000 0.028 0.000 0.972 0.000
#> SRR1652946     4  0.0703     0.9212 0.000 0.024 0.000 0.976 0.000
#> SRR1652947     1  0.1788     0.8802 0.932 0.000 0.056 0.008 0.004
#> SRR1652948     3  0.1538     0.8772 0.000 0.008 0.948 0.008 0.036
#> SRR1652949     1  0.4552     0.1924 0.524 0.000 0.468 0.008 0.000
#> SRR1652950     3  0.1331     0.9005 0.040 0.000 0.952 0.008 0.000
#> SRR1652951     2  0.0290     0.9069 0.000 0.992 0.000 0.008 0.000
#> SRR1652953     1  0.0290     0.9128 0.992 0.000 0.000 0.008 0.000
#> SRR1652952     2  0.0000     0.9070 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     4  0.1282     0.9087 0.044 0.000 0.004 0.952 0.000
#> SRR1652955     3  0.0290     0.8950 0.000 0.000 0.992 0.008 0.000
#> SRR1652958     1  0.0579     0.9112 0.984 0.000 0.008 0.008 0.000
#> SRR1652956     2  0.0000     0.9070 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     4  0.0162     0.9219 0.004 0.000 0.000 0.996 0.000
#> SRR1652959     2  0.0404     0.9059 0.000 0.988 0.000 0.012 0.000
#> SRR1652960     2  0.2471     0.8009 0.000 0.864 0.000 0.136 0.000
#> SRR1652961     2  0.0510     0.9021 0.000 0.984 0.000 0.016 0.000
#> SRR1652962     2  0.0000     0.9070 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     2  0.0290     0.9069 0.000 0.992 0.000 0.008 0.000
#> SRR1652965     5  0.0000     0.6865 0.000 0.000 0.000 0.000 1.000
#> SRR1652964     4  0.4443     0.1572 0.000 0.472 0.004 0.524 0.000
#> SRR1652966     3  0.0693     0.9008 0.012 0.000 0.980 0.008 0.000
#> SRR1652967     5  0.0000     0.6865 0.000 0.000 0.000 0.000 1.000
#> SRR1652969     4  0.1710     0.9146 0.016 0.040 0.004 0.940 0.000
#> SRR1652968     3  0.1043     0.9018 0.040 0.000 0.960 0.000 0.000
#> SRR1652970     1  0.0000     0.9122 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.0000     0.6865 0.000 0.000 0.000 0.000 1.000
#> SRR1652972     3  0.2899     0.8322 0.080 0.008 0.884 0.008 0.020
#> SRR1652973     4  0.1710     0.9146 0.016 0.040 0.004 0.940 0.000
#> SRR1652974     1  0.0000     0.9122 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     4  0.1270     0.9110 0.000 0.052 0.000 0.948 0.000
#> SRR1652976     3  0.4859     0.2811 0.000 0.024 0.636 0.008 0.332
#> SRR1652977     3  0.1043     0.9018 0.040 0.000 0.960 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.0146     0.8642 0.000 0.000 0.996 0.004 0.000 0.000
#> SRR1652897     1  0.4888     0.4623 0.644 0.000 0.000 0.240 0.000 0.116
#> SRR1652898     3  0.4387     0.6762 0.104 0.000 0.748 0.000 0.016 0.132
#> SRR1652899     1  0.3351     0.8333 0.800 0.000 0.040 0.000 0.000 0.160
#> SRR1652900     2  0.0000     0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652901     4  0.2902     0.5953 0.000 0.004 0.196 0.800 0.000 0.000
#> SRR1652902     1  0.3587     0.8185 0.772 0.000 0.040 0.000 0.000 0.188
#> SRR1652903     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     4  0.4252     0.2451 0.000 0.372 0.024 0.604 0.000 0.000
#> SRR1652906     3  0.2838     0.7430 0.004 0.000 0.808 0.000 0.000 0.188
#> SRR1652907     1  0.4344     0.7654 0.716 0.000 0.096 0.000 0.000 0.188
#> SRR1652908     2  0.3854     0.1696 0.000 0.536 0.000 0.464 0.000 0.000
#> SRR1652909     1  0.3695     0.8194 0.772 0.000 0.040 0.004 0.000 0.184
#> SRR1652910     1  0.3422     0.8298 0.792 0.000 0.040 0.000 0.000 0.168
#> SRR1652911     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     6  0.2823     0.9246 0.000 0.000 0.000 0.204 0.000 0.796
#> SRR1652914     3  0.0603     0.8605 0.004 0.000 0.980 0.000 0.000 0.016
#> SRR1652915     3  0.0146     0.8643 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR1652916     1  0.4833     0.7759 0.716 0.000 0.036 0.088 0.000 0.160
#> SRR1652917     4  0.0000     0.7840 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1652918     6  0.3620     0.7758 0.000 0.000 0.000 0.352 0.000 0.648
#> SRR1652919     5  0.4114     0.2085 0.000 0.000 0.460 0.004 0.532 0.004
#> SRR1652920     2  0.0622     0.8944 0.000 0.980 0.000 0.012 0.000 0.008
#> SRR1652921     4  0.3833    -0.1622 0.000 0.000 0.000 0.556 0.000 0.444
#> SRR1652922     5  0.3975     0.2325 0.000 0.000 0.452 0.000 0.544 0.004
#> SRR1652923     3  0.0458     0.8600 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1652924     6  0.2823     0.9246 0.000 0.000 0.000 0.204 0.000 0.796
#> SRR1652925     6  0.2823     0.9246 0.000 0.000 0.000 0.204 0.000 0.796
#> SRR1652926     4  0.1007     0.7528 0.000 0.000 0.000 0.956 0.000 0.044
#> SRR1652927     1  0.3527     0.8308 0.792 0.000 0.040 0.004 0.000 0.164
#> SRR1652928     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.0000     0.8643 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652930     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652931     3  0.0146     0.8642 0.000 0.000 0.996 0.004 0.000 0.000
#> SRR1652932     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.0146     0.7859 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR1652934     4  0.0146     0.7859 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR1652935     5  0.4550     0.1785 0.000 0.420 0.036 0.000 0.544 0.000
#> SRR1652936     2  0.0000     0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.1267     0.8777 0.940 0.000 0.000 0.000 0.000 0.060
#> SRR1652938     4  0.3797    -0.0666 0.000 0.000 0.000 0.580 0.000 0.420
#> SRR1652939     4  0.0146     0.7859 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR1652940     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     4  0.5180     0.4060 0.000 0.000 0.220 0.616 0.000 0.164
#> SRR1652942     2  0.0000     0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     6  0.3634     0.7687 0.000 0.000 0.000 0.356 0.000 0.644
#> SRR1652944     3  0.0458     0.8600 0.000 0.000 0.984 0.000 0.000 0.016
#> SRR1652945     6  0.2823     0.9246 0.000 0.000 0.000 0.204 0.000 0.796
#> SRR1652946     6  0.2823     0.9246 0.000 0.000 0.000 0.204 0.000 0.796
#> SRR1652947     1  0.1151     0.8792 0.956 0.000 0.032 0.000 0.012 0.000
#> SRR1652948     3  0.0508     0.8603 0.000 0.012 0.984 0.004 0.000 0.000
#> SRR1652949     3  0.4474     0.6198 0.108 0.000 0.704 0.000 0.000 0.188
#> SRR1652950     3  0.0146     0.8643 0.004 0.000 0.996 0.000 0.000 0.000
#> SRR1652951     2  0.0000     0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     4  0.0000     0.7840 0.000 0.000 0.000 1.000 0.000 0.000
#> SRR1652955     3  0.0547     0.8588 0.000 0.000 0.980 0.000 0.000 0.020
#> SRR1652958     1  0.3422     0.8298 0.792 0.000 0.040 0.000 0.000 0.168
#> SRR1652956     2  0.0000     0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652957     4  0.1814     0.6842 0.000 0.000 0.000 0.900 0.000 0.100
#> SRR1652959     2  0.0458     0.8952 0.000 0.984 0.000 0.016 0.000 0.000
#> SRR1652960     2  0.1610     0.8331 0.000 0.916 0.000 0.084 0.000 0.000
#> SRR1652961     2  0.0146     0.9022 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652962     2  0.0000     0.9051 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0146     0.9034 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652965     5  0.0000     0.6465 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652964     2  0.3944     0.1838 0.000 0.568 0.004 0.428 0.000 0.000
#> SRR1652966     3  0.2697     0.7434 0.000 0.000 0.812 0.000 0.000 0.188
#> SRR1652967     5  0.0000     0.6465 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652969     4  0.0146     0.7859 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR1652968     3  0.0603     0.8605 0.004 0.000 0.980 0.000 0.000 0.016
#> SRR1652970     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     5  0.0000     0.6465 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652972     3  0.5188     0.6354 0.104 0.000 0.708 0.004 0.060 0.124
#> SRR1652973     4  0.0146     0.7859 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR1652974     1  0.0000     0.8884 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652975     4  0.0146     0.7859 0.000 0.004 0.000 0.996 0.000 0.000
#> SRR1652976     3  0.4601    -0.0384 0.000 0.032 0.556 0.004 0.408 0.000
#> SRR1652977     3  0.0603     0.8605 0.004 0.000 0.980 0.000 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-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) are extracted by 'MAD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.830           0.914       0.963         0.4931 0.503   0.503
#> 3 3 0.552           0.596       0.801         0.2467 0.804   0.639
#> 4 4 0.526           0.660       0.818         0.0936 0.848   0.652
#> 5 5 0.512           0.611       0.806         0.0533 0.966   0.901
#> 6 6 0.510           0.542       0.776         0.0370 0.963   0.886

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
#> SRR1652895     1  0.0000      0.973 1.000 0.000
#> SRR1652896     2  0.0000      0.942 0.000 1.000
#> SRR1652897     1  0.0000      0.973 1.000 0.000
#> SRR1652898     2  0.5946      0.832 0.144 0.856
#> SRR1652899     1  0.0000      0.973 1.000 0.000
#> SRR1652900     2  0.2948      0.909 0.052 0.948
#> SRR1652901     2  0.0000      0.942 0.000 1.000
#> SRR1652902     1  0.0000      0.973 1.000 0.000
#> SRR1652903     1  0.0000      0.973 1.000 0.000
#> SRR1652904     1  0.0000      0.973 1.000 0.000
#> SRR1652905     2  0.0000      0.942 0.000 1.000
#> SRR1652906     1  0.6531      0.778 0.832 0.168
#> SRR1652907     1  0.0000      0.973 1.000 0.000
#> SRR1652908     2  0.0000      0.942 0.000 1.000
#> SRR1652909     1  0.0000      0.973 1.000 0.000
#> SRR1652910     1  0.0000      0.973 1.000 0.000
#> SRR1652911     1  0.0000      0.973 1.000 0.000
#> SRR1652912     2  0.0000      0.942 0.000 1.000
#> SRR1652913     1  0.0000      0.973 1.000 0.000
#> SRR1652914     2  0.0000      0.942 0.000 1.000
#> SRR1652915     2  0.0000      0.942 0.000 1.000
#> SRR1652916     1  0.0000      0.973 1.000 0.000
#> SRR1652917     1  0.0000      0.973 1.000 0.000
#> SRR1652918     1  0.0000      0.973 1.000 0.000
#> SRR1652919     2  0.0000      0.942 0.000 1.000
#> SRR1652920     1  0.7453      0.725 0.788 0.212
#> SRR1652921     1  0.0000      0.973 1.000 0.000
#> SRR1652922     2  0.0000      0.942 0.000 1.000
#> SRR1652923     2  0.0000      0.942 0.000 1.000
#> SRR1652924     1  0.0000      0.973 1.000 0.000
#> SRR1652925     1  0.0000      0.973 1.000 0.000
#> SRR1652926     1  0.0000      0.973 1.000 0.000
#> SRR1652927     1  0.0000      0.973 1.000 0.000
#> SRR1652928     1  0.0000      0.973 1.000 0.000
#> SRR1652929     2  0.0000      0.942 0.000 1.000
#> SRR1652930     1  0.0000      0.973 1.000 0.000
#> SRR1652931     2  0.0000      0.942 0.000 1.000
#> SRR1652932     1  0.0000      0.973 1.000 0.000
#> SRR1652933     1  0.0672      0.966 0.992 0.008
#> SRR1652934     1  0.0000      0.973 1.000 0.000
#> SRR1652935     2  0.0000      0.942 0.000 1.000
#> SRR1652936     2  0.0000      0.942 0.000 1.000
#> SRR1652937     1  0.0000      0.973 1.000 0.000
#> SRR1652938     1  0.0000      0.973 1.000 0.000
#> SRR1652939     1  0.0000      0.973 1.000 0.000
#> SRR1652940     1  0.0000      0.973 1.000 0.000
#> SRR1652941     1  0.4022      0.892 0.920 0.080
#> SRR1652942     2  0.0000      0.942 0.000 1.000
#> SRR1652943     1  0.0000      0.973 1.000 0.000
#> SRR1652944     2  0.0000      0.942 0.000 1.000
#> SRR1652945     1  0.0000      0.973 1.000 0.000
#> SRR1652946     1  0.0000      0.973 1.000 0.000
#> SRR1652947     1  0.0000      0.973 1.000 0.000
#> SRR1652948     2  0.0000      0.942 0.000 1.000
#> SRR1652949     1  0.9896      0.143 0.560 0.440
#> SRR1652950     2  0.6531      0.805 0.168 0.832
#> SRR1652951     2  0.0000      0.942 0.000 1.000
#> SRR1652953     1  0.0000      0.973 1.000 0.000
#> SRR1652952     2  0.0000      0.942 0.000 1.000
#> SRR1652954     1  0.0000      0.973 1.000 0.000
#> SRR1652955     2  0.0000      0.942 0.000 1.000
#> SRR1652958     1  0.0000      0.973 1.000 0.000
#> SRR1652956     2  0.0000      0.942 0.000 1.000
#> SRR1652957     1  0.0000      0.973 1.000 0.000
#> SRR1652959     2  0.9954      0.217 0.460 0.540
#> SRR1652960     2  0.5519      0.849 0.128 0.872
#> SRR1652961     1  0.0000      0.973 1.000 0.000
#> SRR1652962     2  0.0000      0.942 0.000 1.000
#> SRR1652963     2  0.0000      0.942 0.000 1.000
#> SRR1652965     2  0.9129      0.523 0.328 0.672
#> SRR1652964     2  0.5059      0.863 0.112 0.888
#> SRR1652966     2  0.8144      0.695 0.252 0.748
#> SRR1652967     2  0.0000      0.942 0.000 1.000
#> SRR1652969     1  0.0000      0.973 1.000 0.000
#> SRR1652968     2  0.0000      0.942 0.000 1.000
#> SRR1652970     1  0.0000      0.973 1.000 0.000
#> SRR1652971     1  0.7950      0.679 0.760 0.240
#> SRR1652972     2  0.8813      0.612 0.300 0.700
#> SRR1652973     1  0.0000      0.973 1.000 0.000
#> SRR1652974     1  0.0000      0.973 1.000 0.000
#> SRR1652975     1  0.0000      0.973 1.000 0.000
#> SRR1652976     2  0.0000      0.942 0.000 1.000
#> SRR1652977     2  0.0000      0.942 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
#> SRR1652895     1  0.0424     0.8603 0.992 0.000 0.008
#> SRR1652896     3  0.5926     0.7197 0.000 0.356 0.644
#> SRR1652897     1  0.1411     0.8522 0.964 0.036 0.000
#> SRR1652898     3  0.7441     0.5368 0.164 0.136 0.700
#> SRR1652899     1  0.0592     0.8592 0.988 0.000 0.012
#> SRR1652900     3  0.7236     0.7008 0.032 0.392 0.576
#> SRR1652901     2  0.4504     0.0763 0.000 0.804 0.196
#> SRR1652902     1  0.1163     0.8508 0.972 0.000 0.028
#> SRR1652903     1  0.0000     0.8614 1.000 0.000 0.000
#> SRR1652904     1  0.0237     0.8611 0.996 0.000 0.004
#> SRR1652905     2  0.2066     0.3363 0.000 0.940 0.060
#> SRR1652906     1  0.5955     0.5709 0.772 0.048 0.180
#> SRR1652907     1  0.5461     0.5999 0.748 0.008 0.244
#> SRR1652908     2  0.2066     0.3364 0.000 0.940 0.060
#> SRR1652909     1  0.3193     0.7839 0.896 0.004 0.100
#> SRR1652910     1  0.0747     0.8580 0.984 0.000 0.016
#> SRR1652911     1  0.0000     0.8614 1.000 0.000 0.000
#> SRR1652912     3  0.6252     0.6892 0.000 0.444 0.556
#> SRR1652913     1  0.0592     0.8605 0.988 0.012 0.000
#> SRR1652914     3  0.6140     0.7106 0.000 0.404 0.596
#> SRR1652915     3  0.5560     0.7130 0.000 0.300 0.700
#> SRR1652916     1  0.1031     0.8577 0.976 0.024 0.000
#> SRR1652917     1  0.2796     0.8123 0.908 0.092 0.000
#> SRR1652918     2  0.6308     0.0495 0.492 0.508 0.000
#> SRR1652919     3  0.1877     0.5560 0.032 0.012 0.956
#> SRR1652920     2  0.5098     0.4953 0.248 0.752 0.000
#> SRR1652921     1  0.0592     0.8605 0.988 0.012 0.000
#> SRR1652922     3  0.1525     0.5315 0.004 0.032 0.964
#> SRR1652923     3  0.6026     0.7179 0.000 0.376 0.624
#> SRR1652924     1  0.0747     0.8599 0.984 0.016 0.000
#> SRR1652925     1  0.2796     0.8124 0.908 0.092 0.000
#> SRR1652926     2  0.6302     0.0882 0.480 0.520 0.000
#> SRR1652927     1  0.0892     0.8594 0.980 0.020 0.000
#> SRR1652928     1  0.0592     0.8592 0.988 0.000 0.012
#> SRR1652929     3  0.5178     0.7017 0.000 0.256 0.744
#> SRR1652930     1  0.0000     0.8614 1.000 0.000 0.000
#> SRR1652931     3  0.6111     0.7138 0.000 0.396 0.604
#> SRR1652932     1  0.0237     0.8611 0.996 0.000 0.004
#> SRR1652933     2  0.5397     0.4685 0.280 0.720 0.000
#> SRR1652934     1  0.6192     0.1641 0.580 0.420 0.000
#> SRR1652935     3  0.1163     0.5796 0.000 0.028 0.972
#> SRR1652936     2  0.6307    -0.6250 0.000 0.512 0.488
#> SRR1652937     1  0.0237     0.8611 0.996 0.000 0.004
#> SRR1652938     1  0.4002     0.7359 0.840 0.160 0.000
#> SRR1652939     1  0.4931     0.6259 0.768 0.232 0.000
#> SRR1652940     1  0.0592     0.8592 0.988 0.000 0.012
#> SRR1652941     1  0.6562     0.5592 0.744 0.072 0.184
#> SRR1652942     3  0.6140     0.7099 0.000 0.404 0.596
#> SRR1652943     1  0.6309    -0.1209 0.500 0.500 0.000
#> SRR1652944     3  0.6154     0.7075 0.000 0.408 0.592
#> SRR1652945     1  0.1860     0.8419 0.948 0.052 0.000
#> SRR1652946     1  0.1163     0.8564 0.972 0.028 0.000
#> SRR1652947     1  0.6621     0.5193 0.684 0.032 0.284
#> SRR1652948     3  0.5810     0.7185 0.000 0.336 0.664
#> SRR1652949     3  0.6193     0.2421 0.292 0.016 0.692
#> SRR1652950     3  0.8703     0.6410 0.124 0.332 0.544
#> SRR1652951     2  0.5497    -0.2046 0.000 0.708 0.292
#> SRR1652953     1  0.0892     0.8554 0.980 0.000 0.020
#> SRR1652952     3  0.6168     0.7058 0.000 0.412 0.588
#> SRR1652954     1  0.0892     0.8592 0.980 0.020 0.000
#> SRR1652955     3  0.6045     0.7172 0.000 0.380 0.620
#> SRR1652958     1  0.0747     0.8599 0.984 0.016 0.000
#> SRR1652956     3  0.5968     0.6960 0.000 0.364 0.636
#> SRR1652957     1  0.1860     0.8432 0.948 0.052 0.000
#> SRR1652959     1  0.9566    -0.2833 0.440 0.200 0.360
#> SRR1652960     2  0.2651     0.3482 0.012 0.928 0.060
#> SRR1652961     1  0.1964     0.8414 0.944 0.056 0.000
#> SRR1652962     3  0.6168     0.7052 0.000 0.412 0.588
#> SRR1652963     3  0.6095     0.7148 0.000 0.392 0.608
#> SRR1652965     3  0.5874     0.3115 0.208 0.032 0.760
#> SRR1652964     3  0.8803     0.6352 0.136 0.320 0.544
#> SRR1652966     3  0.8984     0.5138 0.224 0.212 0.564
#> SRR1652967     3  0.2939     0.4917 0.012 0.072 0.916
#> SRR1652969     2  0.6235     0.2120 0.436 0.564 0.000
#> SRR1652968     3  0.6154     0.7075 0.000 0.408 0.592
#> SRR1652970     1  0.0592     0.8592 0.988 0.000 0.012
#> SRR1652971     3  0.7996    -0.0124 0.380 0.068 0.552
#> SRR1652972     3  0.8479     0.3626 0.300 0.120 0.580
#> SRR1652973     1  0.6286     0.0118 0.536 0.464 0.000
#> SRR1652974     1  0.0000     0.8614 1.000 0.000 0.000
#> SRR1652975     2  0.6244     0.2025 0.440 0.560 0.000
#> SRR1652976     3  0.4483     0.6365 0.024 0.128 0.848
#> SRR1652977     3  0.6252     0.6833 0.000 0.444 0.556

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.1635    0.85165 0.948 0.008 0.000 0.044
#> SRR1652896     3  0.4188    0.72437 0.000 0.064 0.824 0.112
#> SRR1652897     1  0.2565    0.84096 0.912 0.056 0.000 0.032
#> SRR1652898     3  0.6895    0.46019 0.204 0.036 0.656 0.104
#> SRR1652899     1  0.1109    0.85373 0.968 0.004 0.000 0.028
#> SRR1652900     3  0.2627    0.77047 0.024 0.036 0.920 0.020
#> SRR1652901     3  0.5296    0.06863 0.008 0.492 0.500 0.000
#> SRR1652902     1  0.2405    0.84013 0.928 0.016 0.020 0.036
#> SRR1652903     1  0.1042    0.85701 0.972 0.008 0.000 0.020
#> SRR1652904     1  0.1109    0.85589 0.968 0.004 0.000 0.028
#> SRR1652905     2  0.4088    0.49381 0.000 0.764 0.232 0.004
#> SRR1652906     1  0.4851    0.59456 0.748 0.004 0.220 0.028
#> SRR1652907     1  0.4549    0.73749 0.820 0.016 0.056 0.108
#> SRR1652908     2  0.4122    0.49357 0.000 0.760 0.236 0.004
#> SRR1652909     1  0.3508    0.80496 0.880 0.020 0.036 0.064
#> SRR1652910     1  0.3468    0.80765 0.880 0.012 0.056 0.052
#> SRR1652911     1  0.1545    0.85344 0.952 0.008 0.000 0.040
#> SRR1652912     3  0.2002    0.77274 0.000 0.044 0.936 0.020
#> SRR1652913     1  0.2399    0.84694 0.920 0.032 0.000 0.048
#> SRR1652914     3  0.1356    0.77210 0.000 0.032 0.960 0.008
#> SRR1652915     3  0.2714    0.74268 0.000 0.004 0.884 0.112
#> SRR1652916     1  0.2179    0.84629 0.924 0.064 0.000 0.012
#> SRR1652917     1  0.4446    0.69038 0.776 0.196 0.000 0.028
#> SRR1652918     2  0.5267    0.63243 0.240 0.712 0.000 0.048
#> SRR1652919     3  0.5545    0.52695 0.016 0.028 0.696 0.260
#> SRR1652920     2  0.3383    0.59361 0.052 0.872 0.076 0.000
#> SRR1652921     1  0.2124    0.84655 0.932 0.028 0.000 0.040
#> SRR1652922     4  0.5505    0.36917 0.008 0.020 0.324 0.648
#> SRR1652923     3  0.1151    0.77088 0.000 0.024 0.968 0.008
#> SRR1652924     1  0.1833    0.85519 0.944 0.032 0.000 0.024
#> SRR1652925     1  0.4458    0.76967 0.808 0.116 0.000 0.076
#> SRR1652926     2  0.3801    0.65617 0.220 0.780 0.000 0.000
#> SRR1652927     1  0.2207    0.84688 0.932 0.024 0.004 0.040
#> SRR1652928     1  0.1722    0.85073 0.944 0.008 0.000 0.048
#> SRR1652929     3  0.3446    0.72936 0.008 0.028 0.872 0.092
#> SRR1652930     1  0.1576    0.85192 0.948 0.004 0.000 0.048
#> SRR1652931     3  0.3308    0.74574 0.000 0.092 0.872 0.036
#> SRR1652932     1  0.0707    0.85627 0.980 0.000 0.000 0.020
#> SRR1652933     2  0.4312    0.58457 0.056 0.812 0.132 0.000
#> SRR1652934     2  0.5004    0.49526 0.392 0.604 0.004 0.000
#> SRR1652935     3  0.5305    0.60202 0.008 0.044 0.732 0.216
#> SRR1652936     3  0.2924    0.74800 0.000 0.100 0.884 0.016
#> SRR1652937     1  0.0895    0.85435 0.976 0.004 0.000 0.020
#> SRR1652938     1  0.7381    0.12965 0.492 0.328 0.000 0.180
#> SRR1652939     1  0.6596    0.42400 0.612 0.280 0.004 0.104
#> SRR1652940     1  0.1022    0.85526 0.968 0.000 0.000 0.032
#> SRR1652941     1  0.6025    0.55356 0.696 0.048 0.228 0.028
#> SRR1652942     3  0.1938    0.77120 0.000 0.052 0.936 0.012
#> SRR1652943     2  0.5364    0.59535 0.320 0.652 0.000 0.028
#> SRR1652944     3  0.1545    0.77034 0.000 0.040 0.952 0.008
#> SRR1652945     1  0.5160    0.71294 0.760 0.136 0.000 0.104
#> SRR1652946     1  0.2928    0.83838 0.896 0.052 0.000 0.052
#> SRR1652947     4  0.5543    0.22906 0.424 0.020 0.000 0.556
#> SRR1652948     3  0.2797    0.76011 0.000 0.032 0.900 0.068
#> SRR1652949     1  0.8451   -0.17175 0.440 0.036 0.316 0.208
#> SRR1652950     3  0.3319    0.71338 0.096 0.012 0.876 0.016
#> SRR1652951     3  0.5285    0.14368 0.000 0.468 0.524 0.008
#> SRR1652953     1  0.1635    0.85019 0.948 0.008 0.000 0.044
#> SRR1652952     3  0.1610    0.77428 0.000 0.032 0.952 0.016
#> SRR1652954     1  0.2021    0.85086 0.936 0.040 0.000 0.024
#> SRR1652955     3  0.1733    0.77045 0.000 0.024 0.948 0.028
#> SRR1652958     1  0.1888    0.84631 0.940 0.016 0.000 0.044
#> SRR1652956     3  0.5569    0.62979 0.000 0.104 0.724 0.172
#> SRR1652957     1  0.3598    0.79082 0.848 0.124 0.000 0.028
#> SRR1652959     3  0.7367    0.07028 0.424 0.028 0.468 0.080
#> SRR1652960     2  0.5186    0.32066 0.016 0.640 0.344 0.000
#> SRR1652961     1  0.5576    0.71482 0.772 0.040 0.092 0.096
#> SRR1652962     3  0.1807    0.76988 0.000 0.052 0.940 0.008
#> SRR1652963     3  0.2586    0.76901 0.000 0.040 0.912 0.048
#> SRR1652965     4  0.4442    0.67131 0.128 0.004 0.056 0.812
#> SRR1652964     3  0.5797    0.51079 0.224 0.020 0.708 0.048
#> SRR1652966     3  0.6109    0.48150 0.240 0.016 0.680 0.064
#> SRR1652967     4  0.5326    0.60405 0.024 0.044 0.172 0.760
#> SRR1652969     2  0.4284    0.66345 0.224 0.764 0.012 0.000
#> SRR1652968     3  0.1722    0.76976 0.000 0.048 0.944 0.008
#> SRR1652970     1  0.1151    0.85362 0.968 0.008 0.000 0.024
#> SRR1652971     4  0.3880    0.65370 0.136 0.008 0.020 0.836
#> SRR1652972     3  0.7848    0.00919 0.420 0.044 0.440 0.096
#> SRR1652973     2  0.5244    0.35380 0.436 0.556 0.000 0.008
#> SRR1652974     1  0.1256    0.85579 0.964 0.008 0.000 0.028
#> SRR1652975     2  0.4744    0.64219 0.284 0.704 0.012 0.000
#> SRR1652976     3  0.3900    0.71037 0.024 0.016 0.848 0.112
#> SRR1652977     3  0.2334    0.75848 0.000 0.088 0.908 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
#> SRR1652895     1  0.1300     0.8238 0.956 0.016 0.000 0.000 0.028
#> SRR1652896     3  0.6588     0.5892 0.000 0.140 0.632 0.112 0.116
#> SRR1652897     1  0.3609     0.7438 0.836 0.112 0.000 0.036 0.016
#> SRR1652898     3  0.4779     0.6045 0.192 0.032 0.744 0.004 0.028
#> SRR1652899     1  0.1569     0.8188 0.944 0.044 0.004 0.000 0.008
#> SRR1652900     3  0.4074     0.7467 0.064 0.052 0.836 0.032 0.016
#> SRR1652901     4  0.4240     0.4331 0.012 0.004 0.284 0.700 0.000
#> SRR1652902     1  0.2661     0.7928 0.896 0.052 0.044 0.000 0.008
#> SRR1652903     1  0.0162     0.8261 0.996 0.004 0.000 0.000 0.000
#> SRR1652904     1  0.1106     0.8251 0.964 0.012 0.000 0.000 0.024
#> SRR1652905     4  0.1768     0.5803 0.000 0.004 0.072 0.924 0.000
#> SRR1652906     1  0.4928     0.4799 0.684 0.036 0.268 0.004 0.008
#> SRR1652907     1  0.3753     0.7492 0.844 0.048 0.056 0.000 0.052
#> SRR1652908     4  0.1768     0.5816 0.000 0.004 0.072 0.924 0.000
#> SRR1652909     1  0.3134     0.7757 0.876 0.044 0.056 0.000 0.024
#> SRR1652910     1  0.3576     0.7410 0.840 0.048 0.100 0.000 0.012
#> SRR1652911     1  0.1200     0.8246 0.964 0.012 0.000 0.008 0.016
#> SRR1652912     3  0.2987     0.7715 0.000 0.056 0.880 0.052 0.012
#> SRR1652913     1  0.2313     0.8122 0.916 0.040 0.000 0.012 0.032
#> SRR1652914     3  0.2262     0.7714 0.004 0.012 0.912 0.068 0.004
#> SRR1652915     3  0.4618     0.7098 0.000 0.104 0.780 0.028 0.088
#> SRR1652916     1  0.3164     0.7926 0.872 0.040 0.000 0.068 0.020
#> SRR1652917     1  0.4028     0.7224 0.808 0.104 0.000 0.080 0.008
#> SRR1652918     4  0.6462    -0.0851 0.160 0.292 0.000 0.536 0.012
#> SRR1652919     3  0.5854     0.5010 0.024 0.088 0.632 0.000 0.256
#> SRR1652920     4  0.1209     0.5752 0.012 0.012 0.012 0.964 0.000
#> SRR1652921     1  0.1525     0.8230 0.948 0.036 0.000 0.004 0.012
#> SRR1652922     5  0.6178     0.4541 0.008 0.188 0.192 0.004 0.608
#> SRR1652923     3  0.1983     0.7699 0.000 0.008 0.924 0.060 0.008
#> SRR1652924     1  0.1200     0.8262 0.964 0.016 0.000 0.008 0.012
#> SRR1652925     1  0.4644     0.5653 0.720 0.224 0.000 0.052 0.004
#> SRR1652926     4  0.3871     0.4853 0.132 0.056 0.000 0.808 0.004
#> SRR1652927     1  0.1644     0.8225 0.940 0.048 0.004 0.008 0.000
#> SRR1652928     1  0.1216     0.8255 0.960 0.020 0.000 0.000 0.020
#> SRR1652929     3  0.3708     0.7278 0.020 0.100 0.840 0.004 0.036
#> SRR1652930     1  0.1914     0.8151 0.932 0.032 0.000 0.004 0.032
#> SRR1652931     3  0.5369     0.6796 0.000 0.040 0.704 0.196 0.060
#> SRR1652932     1  0.1117     0.8278 0.964 0.016 0.000 0.000 0.020
#> SRR1652933     4  0.1412     0.5846 0.008 0.004 0.036 0.952 0.000
#> SRR1652934     4  0.4365     0.2942 0.308 0.012 0.004 0.676 0.000
#> SRR1652935     3  0.5084     0.6169 0.004 0.144 0.712 0.000 0.140
#> SRR1652936     3  0.3733     0.7356 0.000 0.028 0.808 0.156 0.008
#> SRR1652937     1  0.0510     0.8247 0.984 0.016 0.000 0.000 0.000
#> SRR1652938     2  0.6152     0.0000 0.192 0.636 0.000 0.140 0.032
#> SRR1652939     1  0.6929    -0.4178 0.428 0.392 0.012 0.160 0.008
#> SRR1652940     1  0.0693     0.8259 0.980 0.008 0.000 0.000 0.012
#> SRR1652941     1  0.6682     0.3890 0.628 0.032 0.188 0.124 0.028
#> SRR1652942     3  0.3095     0.7672 0.000 0.016 0.868 0.092 0.024
#> SRR1652943     4  0.6161     0.0869 0.276 0.132 0.000 0.580 0.012
#> SRR1652944     3  0.2967     0.7603 0.000 0.012 0.868 0.104 0.016
#> SRR1652945     1  0.6274     0.1231 0.564 0.324 0.000 0.064 0.048
#> SRR1652946     1  0.3738     0.7439 0.836 0.096 0.000 0.024 0.044
#> SRR1652947     5  0.5049     0.1733 0.296 0.060 0.000 0.000 0.644
#> SRR1652948     3  0.4024     0.7426 0.000 0.080 0.824 0.032 0.064
#> SRR1652949     1  0.7363     0.2527 0.552 0.104 0.192 0.004 0.148
#> SRR1652950     3  0.2907     0.7319 0.096 0.008 0.876 0.004 0.016
#> SRR1652951     4  0.4449     0.3035 0.000 0.008 0.352 0.636 0.004
#> SRR1652953     1  0.1885     0.8165 0.932 0.044 0.004 0.000 0.020
#> SRR1652952     3  0.2728     0.7676 0.000 0.040 0.896 0.048 0.016
#> SRR1652954     1  0.2165     0.8218 0.924 0.036 0.000 0.024 0.016
#> SRR1652955     3  0.3248     0.7615 0.000 0.020 0.864 0.084 0.032
#> SRR1652958     1  0.1364     0.8233 0.952 0.036 0.000 0.000 0.012
#> SRR1652956     3  0.6707     0.5024 0.000 0.188 0.600 0.064 0.148
#> SRR1652957     1  0.3683     0.7262 0.828 0.096 0.000 0.072 0.004
#> SRR1652959     3  0.6353     0.2227 0.368 0.096 0.516 0.004 0.016
#> SRR1652960     4  0.3742     0.5254 0.020 0.000 0.188 0.788 0.004
#> SRR1652961     1  0.5525     0.5675 0.704 0.092 0.176 0.008 0.020
#> SRR1652962     3  0.2621     0.7621 0.000 0.004 0.876 0.112 0.008
#> SRR1652963     3  0.3623     0.7614 0.000 0.052 0.848 0.072 0.028
#> SRR1652965     5  0.3363     0.6236 0.076 0.044 0.020 0.000 0.860
#> SRR1652964     3  0.5179     0.5143 0.252 0.048 0.680 0.000 0.020
#> SRR1652966     3  0.5898     0.4474 0.300 0.048 0.612 0.004 0.036
#> SRR1652967     5  0.5134     0.5528 0.012 0.196 0.052 0.016 0.724
#> SRR1652969     4  0.3078     0.5352 0.132 0.016 0.000 0.848 0.004
#> SRR1652968     3  0.2533     0.7645 0.000 0.008 0.888 0.096 0.008
#> SRR1652970     1  0.1626     0.8202 0.940 0.044 0.000 0.000 0.016
#> SRR1652971     5  0.2584     0.6129 0.052 0.032 0.004 0.008 0.904
#> SRR1652972     3  0.6444     0.2058 0.384 0.080 0.504 0.004 0.028
#> SRR1652973     4  0.5057     0.1330 0.356 0.036 0.000 0.604 0.004
#> SRR1652974     1  0.1095     0.8264 0.968 0.012 0.000 0.008 0.012
#> SRR1652975     4  0.4077     0.4768 0.172 0.044 0.004 0.780 0.000
#> SRR1652976     3  0.3327     0.7329 0.028 0.036 0.864 0.000 0.072
#> SRR1652977     3  0.3098     0.7520 0.000 0.016 0.836 0.148 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
#> SRR1652895     1  0.1980     0.7899 0.920 0.008 0.000 0.000 0.036 0.036
#> SRR1652896     3  0.6393     0.0239 0.000 0.380 0.472 0.076 0.056 0.016
#> SRR1652897     1  0.3940     0.6576 0.772 0.016 0.000 0.020 0.012 0.180
#> SRR1652898     3  0.4603     0.5302 0.172 0.084 0.728 0.004 0.004 0.008
#> SRR1652899     1  0.2231     0.7831 0.908 0.048 0.000 0.000 0.016 0.028
#> SRR1652900     3  0.4785     0.5668 0.048 0.224 0.700 0.008 0.004 0.016
#> SRR1652901     4  0.3536     0.4888 0.000 0.008 0.252 0.736 0.000 0.004
#> SRR1652902     1  0.2103     0.7846 0.912 0.056 0.000 0.000 0.020 0.012
#> SRR1652903     1  0.0964     0.7971 0.968 0.004 0.000 0.000 0.012 0.016
#> SRR1652904     1  0.1555     0.7903 0.940 0.008 0.000 0.000 0.012 0.040
#> SRR1652905     4  0.1988     0.6508 0.000 0.008 0.072 0.912 0.004 0.004
#> SRR1652906     1  0.4341     0.4628 0.692 0.036 0.260 0.000 0.000 0.012
#> SRR1652907     1  0.3455     0.7408 0.848 0.068 0.020 0.000 0.040 0.024
#> SRR1652908     4  0.1757     0.6531 0.000 0.008 0.076 0.916 0.000 0.000
#> SRR1652909     1  0.3218     0.7553 0.860 0.068 0.020 0.000 0.016 0.036
#> SRR1652910     1  0.3139     0.7354 0.852 0.048 0.080 0.000 0.000 0.020
#> SRR1652911     1  0.2024     0.7863 0.920 0.016 0.000 0.000 0.028 0.036
#> SRR1652912     3  0.2966     0.6718 0.000 0.068 0.868 0.016 0.004 0.044
#> SRR1652913     1  0.2869     0.7510 0.868 0.008 0.000 0.008 0.028 0.088
#> SRR1652914     3  0.2487     0.6768 0.004 0.052 0.892 0.048 0.000 0.004
#> SRR1652915     3  0.5333     0.3773 0.000 0.280 0.628 0.028 0.052 0.012
#> SRR1652916     1  0.3231     0.7644 0.860 0.032 0.000 0.032 0.012 0.064
#> SRR1652917     1  0.4678     0.6369 0.756 0.028 0.000 0.100 0.016 0.100
#> SRR1652918     4  0.6062    -0.1853 0.124 0.020 0.000 0.428 0.004 0.424
#> SRR1652919     3  0.6443     0.2766 0.024 0.204 0.556 0.000 0.188 0.028
#> SRR1652920     4  0.0951     0.6498 0.004 0.000 0.020 0.968 0.000 0.008
#> SRR1652921     1  0.1461     0.7956 0.940 0.016 0.000 0.000 0.000 0.044
#> SRR1652922     5  0.7214     0.0217 0.004 0.296 0.132 0.000 0.424 0.144
#> SRR1652923     3  0.2798     0.6755 0.012 0.096 0.868 0.020 0.000 0.004
#> SRR1652924     1  0.1799     0.7857 0.928 0.008 0.000 0.004 0.008 0.052
#> SRR1652925     1  0.4676     0.3537 0.640 0.004 0.000 0.040 0.008 0.308
#> SRR1652926     4  0.2692     0.6160 0.072 0.004 0.000 0.880 0.008 0.036
#> SRR1652927     1  0.1672     0.7954 0.932 0.016 0.004 0.000 0.000 0.048
#> SRR1652928     1  0.1630     0.7960 0.940 0.016 0.000 0.000 0.024 0.020
#> SRR1652929     3  0.4904     0.5454 0.020 0.216 0.700 0.000 0.028 0.036
#> SRR1652930     1  0.2247     0.7762 0.904 0.012 0.000 0.000 0.024 0.060
#> SRR1652931     3  0.5508     0.4747 0.000 0.136 0.656 0.160 0.048 0.000
#> SRR1652932     1  0.0984     0.7979 0.968 0.008 0.000 0.000 0.012 0.012
#> SRR1652933     4  0.1511     0.6610 0.012 0.004 0.044 0.940 0.000 0.000
#> SRR1652934     4  0.3890     0.3599 0.292 0.008 0.000 0.692 0.004 0.004
#> SRR1652935     3  0.6507     0.1548 0.016 0.340 0.504 0.004 0.068 0.068
#> SRR1652936     3  0.3891     0.6373 0.004 0.108 0.788 0.096 0.000 0.004
#> SRR1652937     1  0.1155     0.7935 0.956 0.036 0.000 0.000 0.004 0.004
#> SRR1652938     6  0.5190     0.2635 0.104 0.056 0.004 0.076 0.024 0.736
#> SRR1652939     6  0.7417     0.3977 0.332 0.136 0.004 0.116 0.012 0.400
#> SRR1652940     1  0.1275     0.7975 0.956 0.012 0.000 0.000 0.016 0.016
#> SRR1652941     1  0.6306     0.3656 0.632 0.088 0.136 0.120 0.020 0.004
#> SRR1652942     3  0.2173     0.6710 0.000 0.064 0.904 0.028 0.000 0.004
#> SRR1652943     4  0.6337    -0.0885 0.308 0.012 0.000 0.480 0.012 0.188
#> SRR1652944     3  0.2773     0.6605 0.000 0.064 0.868 0.064 0.000 0.004
#> SRR1652945     1  0.5766    -0.2351 0.476 0.020 0.000 0.032 0.040 0.432
#> SRR1652946     1  0.3746     0.6880 0.804 0.008 0.000 0.016 0.036 0.136
#> SRR1652947     5  0.4167     0.2382 0.256 0.012 0.000 0.004 0.708 0.020
#> SRR1652948     3  0.4811     0.4984 0.000 0.236 0.692 0.028 0.028 0.016
#> SRR1652949     1  0.6032     0.4147 0.644 0.176 0.088 0.004 0.072 0.016
#> SRR1652950     3  0.3227     0.6336 0.096 0.052 0.840 0.000 0.000 0.012
#> SRR1652951     4  0.4268     0.4060 0.000 0.040 0.272 0.684 0.004 0.000
#> SRR1652953     1  0.2763     0.7666 0.880 0.052 0.000 0.000 0.028 0.040
#> SRR1652952     3  0.3124     0.6523 0.000 0.140 0.828 0.024 0.000 0.008
#> SRR1652954     1  0.2313     0.7922 0.904 0.036 0.000 0.016 0.000 0.044
#> SRR1652955     3  0.3523     0.6445 0.000 0.124 0.816 0.048 0.008 0.004
#> SRR1652958     1  0.1391     0.7906 0.944 0.040 0.000 0.000 0.000 0.016
#> SRR1652956     2  0.6864     0.0960 0.000 0.444 0.376 0.080 0.052 0.048
#> SRR1652957     1  0.4005     0.6638 0.780 0.012 0.000 0.048 0.008 0.152
#> SRR1652959     3  0.5604     0.3118 0.292 0.100 0.584 0.000 0.004 0.020
#> SRR1652960     4  0.3715     0.5965 0.012 0.012 0.164 0.792 0.000 0.020
#> SRR1652961     1  0.5525     0.4536 0.656 0.088 0.208 0.004 0.004 0.040
#> SRR1652962     3  0.2493     0.6760 0.000 0.076 0.884 0.036 0.000 0.004
#> SRR1652963     3  0.4562     0.5434 0.000 0.232 0.708 0.020 0.016 0.024
#> SRR1652965     5  0.3612     0.5070 0.040 0.076 0.012 0.000 0.836 0.036
#> SRR1652964     3  0.4991     0.5075 0.156 0.120 0.700 0.000 0.004 0.020
#> SRR1652966     3  0.6075     0.3411 0.264 0.128 0.564 0.000 0.040 0.004
#> SRR1652967     2  0.6630    -0.1749 0.004 0.480 0.044 0.020 0.352 0.100
#> SRR1652969     4  0.2757     0.6315 0.104 0.000 0.016 0.864 0.000 0.016
#> SRR1652968     3  0.2078     0.6695 0.000 0.044 0.912 0.040 0.000 0.004
#> SRR1652970     1  0.2583     0.7724 0.888 0.052 0.000 0.000 0.016 0.044
#> SRR1652971     5  0.1854     0.4974 0.028 0.028 0.004 0.004 0.932 0.004
#> SRR1652972     1  0.6053     0.0350 0.480 0.156 0.348 0.000 0.004 0.012
#> SRR1652973     4  0.4949     0.1796 0.328 0.008 0.000 0.600 0.000 0.064
#> SRR1652974     1  0.0603     0.7954 0.980 0.000 0.000 0.000 0.004 0.016
#> SRR1652975     4  0.3794     0.5763 0.128 0.000 0.016 0.796 0.000 0.060
#> SRR1652976     3  0.3548     0.6480 0.028 0.088 0.840 0.004 0.028 0.012
#> SRR1652977     3  0.2680     0.6531 0.000 0.032 0.860 0.108 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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.564           0.864       0.916         0.4660 0.526   0.526
#> 3 3 0.521           0.764       0.845         0.3659 0.797   0.622
#> 4 4 0.640           0.685       0.807         0.1364 0.891   0.704
#> 5 5 0.675           0.708       0.805         0.0553 0.923   0.736
#> 6 6 0.699           0.666       0.812         0.0177 0.976   0.896

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
#> SRR1652895     1  0.0000      0.866 1.000 0.000
#> SRR1652896     1  0.7453      0.825 0.788 0.212
#> SRR1652897     1  0.0000      0.866 1.000 0.000
#> SRR1652898     1  0.0000      0.866 1.000 0.000
#> SRR1652899     1  0.7219      0.830 0.800 0.200
#> SRR1652900     2  0.0000      0.965 0.000 1.000
#> SRR1652901     2  0.0376      0.965 0.004 0.996
#> SRR1652902     1  0.7219      0.830 0.800 0.200
#> SRR1652903     1  0.0000      0.866 1.000 0.000
#> SRR1652904     1  0.0000      0.866 1.000 0.000
#> SRR1652905     2  0.0376      0.965 0.004 0.996
#> SRR1652906     1  0.2043      0.862 0.968 0.032
#> SRR1652907     1  0.0000      0.866 1.000 0.000
#> SRR1652908     2  0.0000      0.965 0.000 1.000
#> SRR1652909     1  0.7219      0.830 0.800 0.200
#> SRR1652910     1  0.0000      0.866 1.000 0.000
#> SRR1652911     1  0.0000      0.866 1.000 0.000
#> SRR1652912     2  0.0000      0.965 0.000 1.000
#> SRR1652913     2  0.3584      0.909 0.068 0.932
#> SRR1652914     1  0.7453      0.825 0.788 0.212
#> SRR1652915     1  0.1184      0.864 0.984 0.016
#> SRR1652916     1  0.0000      0.866 1.000 0.000
#> SRR1652917     1  0.9427      0.620 0.640 0.360
#> SRR1652918     2  0.0938      0.961 0.012 0.988
#> SRR1652919     1  0.7453      0.825 0.788 0.212
#> SRR1652920     2  0.0000      0.965 0.000 1.000
#> SRR1652921     2  0.8207      0.593 0.256 0.744
#> SRR1652922     1  0.0000      0.866 1.000 0.000
#> SRR1652923     1  0.7453      0.825 0.788 0.212
#> SRR1652924     2  0.0938      0.961 0.012 0.988
#> SRR1652925     2  0.0000      0.965 0.000 1.000
#> SRR1652926     2  0.0672      0.963 0.008 0.992
#> SRR1652927     1  0.0000      0.866 1.000 0.000
#> SRR1652928     1  0.0000      0.866 1.000 0.000
#> SRR1652929     1  0.6623      0.838 0.828 0.172
#> SRR1652930     1  0.0000      0.866 1.000 0.000
#> SRR1652931     1  0.7453      0.825 0.788 0.212
#> SRR1652932     1  0.0000      0.866 1.000 0.000
#> SRR1652933     2  0.0376      0.965 0.004 0.996
#> SRR1652934     1  0.9552      0.589 0.624 0.376
#> SRR1652935     2  0.0000      0.965 0.000 1.000
#> SRR1652936     2  0.0000      0.965 0.000 1.000
#> SRR1652937     1  0.0000      0.866 1.000 0.000
#> SRR1652938     1  0.7883      0.803 0.764 0.236
#> SRR1652939     1  0.8327      0.772 0.736 0.264
#> SRR1652940     1  0.0000      0.866 1.000 0.000
#> SRR1652941     1  0.7528      0.822 0.784 0.216
#> SRR1652942     2  0.0000      0.965 0.000 1.000
#> SRR1652943     2  0.0938      0.961 0.012 0.988
#> SRR1652944     1  0.7453      0.825 0.788 0.212
#> SRR1652945     2  0.2236      0.941 0.036 0.964
#> SRR1652946     2  0.3584      0.909 0.068 0.932
#> SRR1652947     1  0.0000      0.866 1.000 0.000
#> SRR1652948     1  0.7453      0.825 0.788 0.212
#> SRR1652949     1  0.0000      0.866 1.000 0.000
#> SRR1652950     1  0.7453      0.825 0.788 0.212
#> SRR1652951     2  0.0000      0.965 0.000 1.000
#> SRR1652953     1  0.0000      0.866 1.000 0.000
#> SRR1652952     2  0.0000      0.965 0.000 1.000
#> SRR1652954     1  0.9608      0.572 0.616 0.384
#> SRR1652955     1  0.0000      0.866 1.000 0.000
#> SRR1652958     1  0.7219      0.830 0.800 0.200
#> SRR1652956     2  0.0000      0.965 0.000 1.000
#> SRR1652957     2  0.8081      0.612 0.248 0.752
#> SRR1652959     2  0.0000      0.965 0.000 1.000
#> SRR1652960     2  0.0000      0.965 0.000 1.000
#> SRR1652961     2  0.0000      0.965 0.000 1.000
#> SRR1652962     2  0.0000      0.965 0.000 1.000
#> SRR1652963     2  0.0000      0.965 0.000 1.000
#> SRR1652965     1  0.0000      0.866 1.000 0.000
#> SRR1652964     2  0.0938      0.960 0.012 0.988
#> SRR1652966     1  0.0000      0.866 1.000 0.000
#> SRR1652967     1  0.7453      0.825 0.788 0.212
#> SRR1652969     2  0.4815      0.863 0.104 0.896
#> SRR1652968     1  0.7453      0.825 0.788 0.212
#> SRR1652970     1  0.0000      0.866 1.000 0.000
#> SRR1652971     1  0.0000      0.866 1.000 0.000
#> SRR1652972     1  0.7453      0.825 0.788 0.212
#> SRR1652973     1  0.9933      0.403 0.548 0.452
#> SRR1652974     1  0.0000      0.866 1.000 0.000
#> SRR1652975     2  0.0376      0.965 0.004 0.996
#> SRR1652976     1  0.8081      0.791 0.752 0.248
#> SRR1652977     1  0.7453      0.825 0.788 0.212

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652896     3  0.2261      0.805 0.068 0.000 0.932
#> SRR1652897     3  0.5591      0.518 0.304 0.000 0.696
#> SRR1652898     1  0.3816      0.904 0.852 0.000 0.148
#> SRR1652899     3  0.3192      0.783 0.112 0.000 0.888
#> SRR1652900     2  0.2625      0.863 0.000 0.916 0.084
#> SRR1652901     2  0.5947      0.838 0.052 0.776 0.172
#> SRR1652902     3  0.3192      0.783 0.112 0.000 0.888
#> SRR1652903     3  0.6111      0.317 0.396 0.000 0.604
#> SRR1652904     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652905     2  0.6722      0.809 0.060 0.720 0.220
#> SRR1652906     1  0.6307      0.101 0.512 0.000 0.488
#> SRR1652907     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652908     2  0.2625      0.863 0.000 0.916 0.084
#> SRR1652909     3  0.1860      0.808 0.052 0.000 0.948
#> SRR1652910     1  0.4121      0.884 0.832 0.000 0.168
#> SRR1652911     3  0.5591      0.518 0.304 0.000 0.696
#> SRR1652912     2  0.2651      0.857 0.012 0.928 0.060
#> SRR1652913     2  0.7607      0.742 0.076 0.644 0.280
#> SRR1652914     3  0.0892      0.812 0.020 0.000 0.980
#> SRR1652915     1  0.5650      0.643 0.688 0.000 0.312
#> SRR1652916     3  0.5591      0.518 0.304 0.000 0.696
#> SRR1652917     3  0.4270      0.700 0.024 0.116 0.860
#> SRR1652918     2  0.7022      0.796 0.068 0.700 0.232
#> SRR1652919     3  0.0424      0.809 0.008 0.000 0.992
#> SRR1652920     2  0.0892      0.835 0.020 0.980 0.000
#> SRR1652921     3  0.8277     -0.381 0.076 0.456 0.468
#> SRR1652922     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652923     3  0.2165      0.806 0.064 0.000 0.936
#> SRR1652924     2  0.6232      0.815 0.040 0.740 0.220
#> SRR1652925     2  0.2711      0.863 0.000 0.912 0.088
#> SRR1652926     2  0.6203      0.832 0.056 0.760 0.184
#> SRR1652927     1  0.4121      0.884 0.832 0.000 0.168
#> SRR1652928     3  0.5678      0.499 0.316 0.000 0.684
#> SRR1652929     3  0.3482      0.766 0.128 0.000 0.872
#> SRR1652930     3  0.5591      0.518 0.304 0.000 0.696
#> SRR1652931     3  0.0892      0.812 0.020 0.000 0.980
#> SRR1652932     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652933     2  0.5637      0.840 0.040 0.788 0.172
#> SRR1652934     3  0.4892      0.677 0.048 0.112 0.840
#> SRR1652935     2  0.2301      0.839 0.060 0.936 0.004
#> SRR1652936     2  0.0892      0.835 0.020 0.980 0.000
#> SRR1652937     3  0.6111      0.317 0.396 0.000 0.604
#> SRR1652938     3  0.1781      0.798 0.020 0.020 0.960
#> SRR1652939     3  0.2176      0.775 0.032 0.020 0.948
#> SRR1652940     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652941     3  0.0237      0.808 0.004 0.000 0.996
#> SRR1652942     2  0.0892      0.835 0.020 0.980 0.000
#> SRR1652943     2  0.6936      0.798 0.064 0.704 0.232
#> SRR1652944     3  0.0592      0.811 0.012 0.000 0.988
#> SRR1652945     2  0.7340      0.779 0.076 0.676 0.248
#> SRR1652946     2  0.7607      0.742 0.076 0.644 0.280
#> SRR1652947     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652948     3  0.1163      0.812 0.028 0.000 0.972
#> SRR1652949     1  0.3116      0.930 0.892 0.000 0.108
#> SRR1652950     3  0.0747      0.812 0.016 0.000 0.984
#> SRR1652951     2  0.0892      0.835 0.020 0.980 0.000
#> SRR1652953     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652952     2  0.0892      0.835 0.020 0.980 0.000
#> SRR1652954     3  0.4891      0.668 0.040 0.124 0.836
#> SRR1652955     1  0.3816      0.904 0.852 0.000 0.148
#> SRR1652958     3  0.3192      0.783 0.112 0.000 0.888
#> SRR1652956     2  0.0892      0.835 0.020 0.980 0.000
#> SRR1652957     2  0.8277      0.365 0.076 0.464 0.460
#> SRR1652959     2  0.2625      0.863 0.000 0.916 0.084
#> SRR1652960     2  0.2625      0.863 0.000 0.916 0.084
#> SRR1652961     2  0.0892      0.835 0.020 0.980 0.000
#> SRR1652962     2  0.0892      0.835 0.020 0.980 0.000
#> SRR1652963     2  0.2625      0.863 0.000 0.916 0.084
#> SRR1652965     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652964     2  0.4665      0.859 0.048 0.852 0.100
#> SRR1652966     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652967     3  0.2261      0.805 0.068 0.000 0.932
#> SRR1652969     2  0.7576      0.736 0.076 0.648 0.276
#> SRR1652968     3  0.0892      0.812 0.020 0.000 0.980
#> SRR1652970     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652971     1  0.2878      0.936 0.904 0.000 0.096
#> SRR1652972     3  0.0892      0.813 0.020 0.000 0.980
#> SRR1652973     3  0.6107      0.547 0.052 0.184 0.764
#> SRR1652974     3  0.6111      0.317 0.396 0.000 0.604
#> SRR1652975     2  0.5637      0.840 0.040 0.788 0.172
#> SRR1652976     3  0.1751      0.793 0.028 0.012 0.960
#> SRR1652977     3  0.0892      0.812 0.020 0.000 0.980

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.2578      0.805 0.052 0.000 0.912 0.036
#> SRR1652897     4  0.7793      0.775 0.300 0.000 0.276 0.424
#> SRR1652898     1  0.2179      0.761 0.924 0.000 0.064 0.012
#> SRR1652899     3  0.4669      0.658 0.104 0.000 0.796 0.100
#> SRR1652900     2  0.0000      0.807 0.000 1.000 0.000 0.000
#> SRR1652901     2  0.3583      0.791 0.000 0.816 0.004 0.180
#> SRR1652902     3  0.4669      0.658 0.104 0.000 0.796 0.100
#> SRR1652903     1  0.7816     -0.624 0.400 0.000 0.260 0.340
#> SRR1652904     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.4072      0.768 0.000 0.748 0.000 0.252
#> SRR1652906     1  0.6120     -0.147 0.520 0.000 0.432 0.048
#> SRR1652907     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652908     2  0.0000      0.807 0.000 1.000 0.000 0.000
#> SRR1652909     3  0.2816      0.788 0.036 0.000 0.900 0.064
#> SRR1652910     1  0.2775      0.737 0.896 0.000 0.084 0.020
#> SRR1652911     4  0.7793      0.775 0.300 0.000 0.276 0.424
#> SRR1652912     2  0.1474      0.796 0.000 0.948 0.000 0.052
#> SRR1652913     2  0.4720      0.721 0.000 0.672 0.004 0.324
#> SRR1652914     3  0.0376      0.839 0.004 0.000 0.992 0.004
#> SRR1652915     1  0.4319      0.525 0.760 0.000 0.228 0.012
#> SRR1652916     4  0.7805      0.772 0.300 0.000 0.280 0.420
#> SRR1652917     3  0.5272      0.601 0.000 0.136 0.752 0.112
#> SRR1652918     2  0.4372      0.758 0.000 0.728 0.004 0.268
#> SRR1652919     3  0.0469      0.837 0.000 0.000 0.988 0.012
#> SRR1652920     2  0.3975      0.722 0.000 0.760 0.000 0.240
#> SRR1652921     2  0.7544      0.263 0.000 0.452 0.352 0.196
#> SRR1652922     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652923     3  0.2408      0.810 0.044 0.000 0.920 0.036
#> SRR1652924     2  0.3668      0.789 0.000 0.808 0.004 0.188
#> SRR1652925     2  0.0188      0.807 0.000 0.996 0.000 0.004
#> SRR1652926     2  0.3791      0.786 0.000 0.796 0.004 0.200
#> SRR1652927     1  0.2775      0.737 0.896 0.000 0.084 0.020
#> SRR1652928     4  0.7777      0.751 0.316 0.000 0.260 0.424
#> SRR1652929     3  0.3441      0.723 0.120 0.000 0.856 0.024
#> SRR1652930     4  0.7793      0.775 0.300 0.000 0.276 0.424
#> SRR1652931     3  0.0376      0.839 0.004 0.000 0.992 0.004
#> SRR1652932     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652933     2  0.3355      0.795 0.000 0.836 0.004 0.160
#> SRR1652934     3  0.5116      0.625 0.000 0.108 0.764 0.128
#> SRR1652935     2  0.3569      0.793 0.000 0.804 0.000 0.196
#> SRR1652936     2  0.3975      0.722 0.000 0.760 0.000 0.240
#> SRR1652937     1  0.7816     -0.624 0.400 0.000 0.260 0.340
#> SRR1652938     4  0.6585      0.467 0.000 0.104 0.312 0.584
#> SRR1652939     4  0.6399      0.450 0.000 0.104 0.276 0.620
#> SRR1652940     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652941     3  0.1022      0.830 0.000 0.000 0.968 0.032
#> SRR1652942     2  0.2704      0.772 0.000 0.876 0.000 0.124
#> SRR1652943     2  0.4343      0.760 0.000 0.732 0.004 0.264
#> SRR1652944     3  0.0336      0.838 0.000 0.000 0.992 0.008
#> SRR1652945     2  0.4535      0.745 0.000 0.704 0.004 0.292
#> SRR1652946     2  0.4720      0.721 0.000 0.672 0.004 0.324
#> SRR1652947     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652948     3  0.1256      0.831 0.008 0.000 0.964 0.028
#> SRR1652949     1  0.0524      0.801 0.988 0.000 0.008 0.004
#> SRR1652950     3  0.0657      0.839 0.004 0.000 0.984 0.012
#> SRR1652951     2  0.3975      0.722 0.000 0.760 0.000 0.240
#> SRR1652953     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.3975      0.722 0.000 0.760 0.000 0.240
#> SRR1652954     3  0.5624      0.563 0.000 0.148 0.724 0.128
#> SRR1652955     1  0.2179      0.761 0.924 0.000 0.064 0.012
#> SRR1652958     3  0.4669      0.658 0.104 0.000 0.796 0.100
#> SRR1652956     2  0.3975      0.722 0.000 0.760 0.000 0.240
#> SRR1652957     2  0.7610      0.333 0.000 0.460 0.320 0.220
#> SRR1652959     2  0.0000      0.807 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000      0.807 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.3975      0.722 0.000 0.760 0.000 0.240
#> SRR1652962     2  0.3975      0.722 0.000 0.760 0.000 0.240
#> SRR1652963     2  0.0000      0.807 0.000 1.000 0.000 0.000
#> SRR1652965     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652964     2  0.2530      0.805 0.000 0.896 0.004 0.100
#> SRR1652966     1  0.0336      0.802 0.992 0.000 0.008 0.000
#> SRR1652967     3  0.2494      0.808 0.048 0.000 0.916 0.036
#> SRR1652969     2  0.5472      0.715 0.000 0.676 0.044 0.280
#> SRR1652968     3  0.0376      0.839 0.004 0.000 0.992 0.004
#> SRR1652970     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652971     1  0.0000      0.805 1.000 0.000 0.000 0.000
#> SRR1652972     3  0.0804      0.840 0.008 0.000 0.980 0.012
#> SRR1652973     3  0.6364      0.449 0.000 0.204 0.652 0.144
#> SRR1652974     1  0.7816     -0.624 0.400 0.000 0.260 0.340
#> SRR1652975     2  0.3355      0.795 0.000 0.836 0.004 0.160
#> SRR1652976     3  0.1557      0.814 0.000 0.000 0.944 0.056
#> SRR1652977     3  0.0376      0.839 0.004 0.000 0.992 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
#> SRR1652895     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.2286     0.7938 0.004 0.000 0.888 0.000 0.108
#> SRR1652897     5  0.5074     0.8244 0.268 0.000 0.072 0.000 0.660
#> SRR1652898     1  0.2079     0.8430 0.916 0.000 0.064 0.000 0.020
#> SRR1652899     3  0.5051     0.5673 0.072 0.000 0.664 0.000 0.264
#> SRR1652900     4  0.4150     0.4680 0.000 0.388 0.000 0.612 0.000
#> SRR1652901     4  0.2561     0.6730 0.000 0.144 0.000 0.856 0.000
#> SRR1652902     3  0.5051     0.5673 0.072 0.000 0.664 0.000 0.264
#> SRR1652903     5  0.5480     0.7472 0.368 0.000 0.072 0.000 0.560
#> SRR1652904     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     4  0.1410     0.6724 0.000 0.060 0.000 0.940 0.000
#> SRR1652906     1  0.6455    -0.1414 0.484 0.000 0.312 0.000 0.204
#> SRR1652907     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652908     4  0.4150     0.4680 0.000 0.388 0.000 0.612 0.000
#> SRR1652909     3  0.3421     0.7424 0.016 0.000 0.816 0.004 0.164
#> SRR1652910     1  0.2570     0.8129 0.888 0.000 0.084 0.000 0.028
#> SRR1652911     5  0.5074     0.8244 0.268 0.000 0.072 0.000 0.660
#> SRR1652912     4  0.4307     0.0952 0.000 0.496 0.000 0.504 0.000
#> SRR1652913     4  0.0794     0.6348 0.000 0.000 0.000 0.972 0.028
#> SRR1652914     3  0.0290     0.8274 0.000 0.000 0.992 0.000 0.008
#> SRR1652915     1  0.3912     0.5687 0.752 0.000 0.228 0.000 0.020
#> SRR1652916     5  0.5128     0.8226 0.268 0.000 0.076 0.000 0.656
#> SRR1652917     3  0.4618     0.6565 0.000 0.000 0.724 0.208 0.068
#> SRR1652918     4  0.0794     0.6650 0.000 0.028 0.000 0.972 0.000
#> SRR1652919     3  0.0992     0.8241 0.000 0.000 0.968 0.008 0.024
#> SRR1652920     2  0.2690     0.9495 0.000 0.844 0.000 0.156 0.000
#> SRR1652921     4  0.5338     0.2328 0.000 0.000 0.324 0.604 0.072
#> SRR1652922     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652923     3  0.2424     0.7859 0.000 0.000 0.868 0.000 0.132
#> SRR1652924     4  0.2377     0.6708 0.000 0.128 0.000 0.872 0.000
#> SRR1652925     4  0.4138     0.4739 0.000 0.384 0.000 0.616 0.000
#> SRR1652926     4  0.2329     0.6757 0.000 0.124 0.000 0.876 0.000
#> SRR1652927     1  0.2570     0.8129 0.888 0.000 0.084 0.000 0.028
#> SRR1652928     5  0.4928     0.8144 0.284 0.000 0.056 0.000 0.660
#> SRR1652929     3  0.3888     0.7281 0.076 0.000 0.804 0.000 0.120
#> SRR1652930     5  0.5074     0.8244 0.268 0.000 0.072 0.000 0.660
#> SRR1652931     3  0.0290     0.8274 0.000 0.000 0.992 0.000 0.008
#> SRR1652932     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.2773     0.6676 0.000 0.164 0.000 0.836 0.000
#> SRR1652934     3  0.4522     0.6754 0.000 0.000 0.736 0.196 0.068
#> SRR1652935     4  0.4304     0.0220 0.000 0.484 0.000 0.516 0.000
#> SRR1652936     2  0.2690     0.9495 0.000 0.844 0.000 0.156 0.000
#> SRR1652937     5  0.5480     0.7472 0.368 0.000 0.072 0.000 0.560
#> SRR1652938     5  0.4269     0.5208 0.000 0.000 0.108 0.116 0.776
#> SRR1652939     5  0.5708     0.4472 0.000 0.000 0.112 0.300 0.588
#> SRR1652940     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.1661     0.8179 0.000 0.000 0.940 0.024 0.036
#> SRR1652942     2  0.4015     0.5132 0.000 0.652 0.000 0.348 0.000
#> SRR1652943     4  0.0880     0.6662 0.000 0.032 0.000 0.968 0.000
#> SRR1652944     3  0.0566     0.8268 0.000 0.000 0.984 0.004 0.012
#> SRR1652945     4  0.0451     0.6547 0.000 0.008 0.000 0.988 0.004
#> SRR1652946     4  0.0794     0.6348 0.000 0.000 0.000 0.972 0.028
#> SRR1652947     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652948     3  0.1410     0.8131 0.000 0.000 0.940 0.000 0.060
#> SRR1652949     1  0.0451     0.8972 0.988 0.000 0.008 0.000 0.004
#> SRR1652950     3  0.0566     0.8280 0.000 0.000 0.984 0.012 0.004
#> SRR1652951     2  0.2690     0.9495 0.000 0.844 0.000 0.156 0.000
#> SRR1652953     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.2690     0.9495 0.000 0.844 0.000 0.156 0.000
#> SRR1652954     3  0.4820     0.6284 0.000 0.000 0.696 0.236 0.068
#> SRR1652955     1  0.2079     0.8430 0.916 0.000 0.064 0.000 0.020
#> SRR1652958     3  0.5051     0.5673 0.072 0.000 0.664 0.000 0.264
#> SRR1652956     2  0.2690     0.9495 0.000 0.844 0.000 0.156 0.000
#> SRR1652957     4  0.5199     0.3111 0.000 0.000 0.292 0.636 0.072
#> SRR1652959     4  0.4150     0.4680 0.000 0.388 0.000 0.612 0.000
#> SRR1652960     4  0.4150     0.4680 0.000 0.388 0.000 0.612 0.000
#> SRR1652961     2  0.2690     0.9495 0.000 0.844 0.000 0.156 0.000
#> SRR1652962     2  0.2690     0.9495 0.000 0.844 0.000 0.156 0.000
#> SRR1652963     4  0.4150     0.4680 0.000 0.388 0.000 0.612 0.000
#> SRR1652965     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652964     4  0.3884     0.5717 0.000 0.288 0.004 0.708 0.000
#> SRR1652966     1  0.0290     0.8980 0.992 0.000 0.008 0.000 0.000
#> SRR1652967     3  0.5619     0.5708 0.000 0.156 0.636 0.000 0.208
#> SRR1652969     4  0.3595     0.6333 0.000 0.064 0.044 0.852 0.040
#> SRR1652968     3  0.0290     0.8274 0.000 0.000 0.992 0.000 0.008
#> SRR1652970     1  0.0000     0.9021 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     1  0.0510     0.8894 0.984 0.000 0.000 0.000 0.016
#> SRR1652972     3  0.1106     0.8274 0.000 0.000 0.964 0.012 0.024
#> SRR1652973     3  0.5218     0.5428 0.000 0.000 0.624 0.308 0.068
#> SRR1652974     5  0.5480     0.7472 0.368 0.000 0.072 0.000 0.560
#> SRR1652975     4  0.2773     0.6676 0.000 0.164 0.000 0.836 0.000
#> SRR1652976     3  0.1965     0.8148 0.000 0.000 0.924 0.052 0.024
#> SRR1652977     3  0.0290     0.8274 0.000 0.000 0.992 0.000 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.2702     0.7445 0.004 0.000 0.868 0.000 0.036 0.092
#> SRR1652897     6  0.4233     0.8039 0.268 0.000 0.048 0.000 0.000 0.684
#> SRR1652898     1  0.1951     0.8449 0.916 0.000 0.060 0.000 0.004 0.020
#> SRR1652899     3  0.4634     0.5363 0.072 0.000 0.644 0.000 0.000 0.284
#> SRR1652900     4  0.3804     0.3967 0.000 0.424 0.000 0.576 0.000 0.000
#> SRR1652901     4  0.2632     0.6653 0.000 0.164 0.000 0.832 0.004 0.000
#> SRR1652902     3  0.4634     0.5363 0.072 0.000 0.644 0.000 0.000 0.284
#> SRR1652903     6  0.4620     0.7443 0.368 0.000 0.048 0.000 0.000 0.584
#> SRR1652904     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652905     4  0.1349     0.6774 0.000 0.056 0.000 0.940 0.004 0.000
#> SRR1652906     1  0.5942    -0.1217 0.484 0.000 0.296 0.000 0.004 0.216
#> SRR1652907     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652908     4  0.3804     0.3967 0.000 0.424 0.000 0.576 0.000 0.000
#> SRR1652909     3  0.3178     0.7057 0.016 0.000 0.804 0.000 0.004 0.176
#> SRR1652910     1  0.2398     0.8156 0.888 0.000 0.080 0.000 0.004 0.028
#> SRR1652911     6  0.4233     0.8039 0.268 0.000 0.048 0.000 0.000 0.684
#> SRR1652912     2  0.3817     0.0619 0.000 0.568 0.000 0.432 0.000 0.000
#> SRR1652913     4  0.1565     0.6428 0.000 0.000 0.004 0.940 0.028 0.028
#> SRR1652914     3  0.0405     0.7972 0.000 0.000 0.988 0.000 0.004 0.008
#> SRR1652915     1  0.3627     0.5764 0.752 0.000 0.224 0.000 0.004 0.020
#> SRR1652916     6  0.4291     0.8019 0.268 0.000 0.052 0.000 0.000 0.680
#> SRR1652917     3  0.4375     0.5922 0.000 0.000 0.728 0.192 0.012 0.068
#> SRR1652918     4  0.0405     0.6668 0.000 0.004 0.000 0.988 0.008 0.000
#> SRR1652919     3  0.0806     0.7953 0.000 0.000 0.972 0.000 0.008 0.020
#> SRR1652920     2  0.1075     0.8370 0.000 0.952 0.000 0.048 0.000 0.000
#> SRR1652921     4  0.5393     0.2258 0.000 0.000 0.328 0.576 0.028 0.068
#> SRR1652922     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652923     3  0.2667     0.7392 0.000 0.000 0.852 0.000 0.020 0.128
#> SRR1652924     4  0.1910     0.6719 0.000 0.108 0.000 0.892 0.000 0.000
#> SRR1652925     4  0.3797     0.4037 0.000 0.420 0.000 0.580 0.000 0.000
#> SRR1652926     4  0.2320     0.6744 0.000 0.132 0.000 0.864 0.004 0.000
#> SRR1652927     1  0.2398     0.8156 0.888 0.000 0.080 0.000 0.004 0.028
#> SRR1652928     6  0.4060     0.7966 0.284 0.000 0.032 0.000 0.000 0.684
#> SRR1652929     3  0.3882     0.6785 0.076 0.000 0.788 0.000 0.012 0.124
#> SRR1652930     6  0.4233     0.8039 0.268 0.000 0.048 0.000 0.000 0.684
#> SRR1652931     3  0.0405     0.7972 0.000 0.000 0.988 0.000 0.004 0.008
#> SRR1652932     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652933     4  0.2664     0.6583 0.000 0.184 0.000 0.816 0.000 0.000
#> SRR1652934     3  0.4390     0.6149 0.000 0.000 0.740 0.172 0.020 0.068
#> SRR1652935     2  0.3838     0.1185 0.000 0.552 0.000 0.448 0.000 0.000
#> SRR1652936     2  0.1075     0.8370 0.000 0.952 0.000 0.048 0.000 0.000
#> SRR1652937     6  0.4620     0.7443 0.368 0.000 0.048 0.000 0.000 0.584
#> SRR1652938     6  0.2882     0.1469 0.000 0.000 0.060 0.004 0.076 0.860
#> SRR1652939     6  0.5839     0.1311 0.000 0.000 0.116 0.264 0.040 0.580
#> SRR1652940     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.1511     0.7890 0.000 0.000 0.944 0.012 0.012 0.032
#> SRR1652942     2  0.3126     0.5986 0.000 0.752 0.000 0.248 0.000 0.000
#> SRR1652943     4  0.0291     0.6675 0.000 0.004 0.000 0.992 0.004 0.000
#> SRR1652944     3  0.0363     0.7975 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1652945     4  0.1003     0.6593 0.000 0.004 0.004 0.964 0.028 0.000
#> SRR1652946     4  0.1565     0.6428 0.000 0.000 0.004 0.940 0.028 0.028
#> SRR1652947     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652948     3  0.1765     0.7694 0.000 0.000 0.924 0.000 0.024 0.052
#> SRR1652949     1  0.0405     0.8943 0.988 0.000 0.004 0.000 0.000 0.008
#> SRR1652950     3  0.0405     0.7977 0.000 0.000 0.988 0.008 0.000 0.004
#> SRR1652951     2  0.1075     0.8370 0.000 0.952 0.000 0.048 0.000 0.000
#> SRR1652953     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.1075     0.8370 0.000 0.952 0.000 0.048 0.000 0.000
#> SRR1652954     3  0.4569     0.5575 0.000 0.000 0.700 0.220 0.012 0.068
#> SRR1652955     1  0.1951     0.8449 0.916 0.000 0.060 0.000 0.004 0.020
#> SRR1652958     3  0.4634     0.5363 0.072 0.000 0.644 0.000 0.000 0.284
#> SRR1652956     2  0.1075     0.8370 0.000 0.952 0.000 0.048 0.000 0.000
#> SRR1652957     4  0.5279     0.2776 0.000 0.000 0.296 0.608 0.028 0.068
#> SRR1652959     4  0.3804     0.3967 0.000 0.424 0.000 0.576 0.000 0.000
#> SRR1652960     4  0.3804     0.3967 0.000 0.424 0.000 0.576 0.000 0.000
#> SRR1652961     2  0.1075     0.8370 0.000 0.952 0.000 0.048 0.000 0.000
#> SRR1652962     2  0.1075     0.8370 0.000 0.952 0.000 0.048 0.000 0.000
#> SRR1652963     4  0.3804     0.3967 0.000 0.424 0.000 0.576 0.000 0.000
#> SRR1652965     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652964     4  0.4255     0.5074 0.000 0.336 0.004 0.640 0.016 0.004
#> SRR1652966     1  0.0260     0.8946 0.992 0.000 0.008 0.000 0.000 0.000
#> SRR1652967     5  0.2956     0.0000 0.000 0.000 0.120 0.000 0.840 0.040
#> SRR1652969     4  0.3992     0.6464 0.000 0.088 0.044 0.812 0.016 0.040
#> SRR1652968     3  0.0405     0.7972 0.000 0.000 0.988 0.000 0.004 0.008
#> SRR1652970     1  0.0000     0.8986 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     1  0.2257     0.8232 0.904 0.048 0.000 0.000 0.040 0.008
#> SRR1652972     3  0.1003     0.7987 0.000 0.000 0.964 0.004 0.004 0.028
#> SRR1652973     3  0.5083     0.4529 0.000 0.000 0.628 0.284 0.020 0.068
#> SRR1652974     6  0.4620     0.7443 0.368 0.000 0.048 0.000 0.000 0.584
#> SRR1652975     4  0.2664     0.6583 0.000 0.184 0.000 0.816 0.000 0.000
#> SRR1652976     3  0.1886     0.7847 0.000 0.000 0.928 0.024 0.024 0.024
#> SRR1652977     3  0.0405     0.7972 0.000 0.000 0.988 0.000 0.004 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-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) are extracted by 'ATC' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk ATC-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.988       0.995         0.4763 0.526   0.526
#> 3 3 0.967           0.912       0.958         0.4098 0.745   0.540
#> 4 4 0.760           0.805       0.865         0.0988 0.887   0.678
#> 5 5 0.702           0.622       0.771         0.0559 0.957   0.837
#> 6 6 0.701           0.461       0.729         0.0368 0.910   0.651

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
#> SRR1652895     1   0.000      0.993 1.000 0.000
#> SRR1652896     1   0.000      0.993 1.000 0.000
#> SRR1652897     1   0.000      0.993 1.000 0.000
#> SRR1652898     1   0.000      0.993 1.000 0.000
#> SRR1652899     1   0.000      0.993 1.000 0.000
#> SRR1652900     2   0.000      0.999 0.000 1.000
#> SRR1652901     2   0.000      0.999 0.000 1.000
#> SRR1652902     1   0.000      0.993 1.000 0.000
#> SRR1652903     1   0.000      0.993 1.000 0.000
#> SRR1652904     1   0.000      0.993 1.000 0.000
#> SRR1652905     2   0.000      0.999 0.000 1.000
#> SRR1652906     1   0.000      0.993 1.000 0.000
#> SRR1652907     1   0.000      0.993 1.000 0.000
#> SRR1652908     2   0.000      0.999 0.000 1.000
#> SRR1652909     1   0.000      0.993 1.000 0.000
#> SRR1652910     1   0.000      0.993 1.000 0.000
#> SRR1652911     1   0.000      0.993 1.000 0.000
#> SRR1652912     2   0.000      0.999 0.000 1.000
#> SRR1652913     2   0.000      0.999 0.000 1.000
#> SRR1652914     1   0.000      0.993 1.000 0.000
#> SRR1652915     1   0.000      0.993 1.000 0.000
#> SRR1652916     1   0.000      0.993 1.000 0.000
#> SRR1652917     1   0.000      0.993 1.000 0.000
#> SRR1652918     2   0.000      0.999 0.000 1.000
#> SRR1652919     1   0.000      0.993 1.000 0.000
#> SRR1652920     2   0.000      0.999 0.000 1.000
#> SRR1652921     2   0.118      0.984 0.016 0.984
#> SRR1652922     1   0.000      0.993 1.000 0.000
#> SRR1652923     1   0.000      0.993 1.000 0.000
#> SRR1652924     2   0.000      0.999 0.000 1.000
#> SRR1652925     2   0.000      0.999 0.000 1.000
#> SRR1652926     2   0.000      0.999 0.000 1.000
#> SRR1652927     1   0.000      0.993 1.000 0.000
#> SRR1652928     1   0.000      0.993 1.000 0.000
#> SRR1652929     1   0.000      0.993 1.000 0.000
#> SRR1652930     1   0.000      0.993 1.000 0.000
#> SRR1652931     1   0.000      0.993 1.000 0.000
#> SRR1652932     1   0.000      0.993 1.000 0.000
#> SRR1652933     2   0.000      0.999 0.000 1.000
#> SRR1652934     1   0.000      0.993 1.000 0.000
#> SRR1652935     2   0.000      0.999 0.000 1.000
#> SRR1652936     2   0.000      0.999 0.000 1.000
#> SRR1652937     1   0.000      0.993 1.000 0.000
#> SRR1652938     1   0.000      0.993 1.000 0.000
#> SRR1652939     1   0.000      0.993 1.000 0.000
#> SRR1652940     1   0.000      0.993 1.000 0.000
#> SRR1652941     1   0.000      0.993 1.000 0.000
#> SRR1652942     2   0.000      0.999 0.000 1.000
#> SRR1652943     2   0.000      0.999 0.000 1.000
#> SRR1652944     1   0.000      0.993 1.000 0.000
#> SRR1652945     2   0.000      0.999 0.000 1.000
#> SRR1652946     2   0.000      0.999 0.000 1.000
#> SRR1652947     1   0.000      0.993 1.000 0.000
#> SRR1652948     1   0.000      0.993 1.000 0.000
#> SRR1652949     1   0.000      0.993 1.000 0.000
#> SRR1652950     1   0.000      0.993 1.000 0.000
#> SRR1652951     2   0.000      0.999 0.000 1.000
#> SRR1652953     1   0.000      0.993 1.000 0.000
#> SRR1652952     2   0.000      0.999 0.000 1.000
#> SRR1652954     1   0.000      0.993 1.000 0.000
#> SRR1652955     1   0.000      0.993 1.000 0.000
#> SRR1652958     1   0.000      0.993 1.000 0.000
#> SRR1652956     2   0.000      0.999 0.000 1.000
#> SRR1652957     2   0.000      0.999 0.000 1.000
#> SRR1652959     2   0.000      0.999 0.000 1.000
#> SRR1652960     2   0.000      0.999 0.000 1.000
#> SRR1652961     2   0.000      0.999 0.000 1.000
#> SRR1652962     2   0.000      0.999 0.000 1.000
#> SRR1652963     2   0.000      0.999 0.000 1.000
#> SRR1652965     1   0.000      0.993 1.000 0.000
#> SRR1652964     2   0.000      0.999 0.000 1.000
#> SRR1652966     1   0.000      0.993 1.000 0.000
#> SRR1652967     1   0.000      0.993 1.000 0.000
#> SRR1652969     2   0.000      0.999 0.000 1.000
#> SRR1652968     1   0.000      0.993 1.000 0.000
#> SRR1652970     1   0.000      0.993 1.000 0.000
#> SRR1652971     1   0.000      0.993 1.000 0.000
#> SRR1652972     1   0.000      0.993 1.000 0.000
#> SRR1652973     1   0.000      0.993 1.000 0.000
#> SRR1652974     1   0.000      0.993 1.000 0.000
#> SRR1652975     2   0.000      0.999 0.000 1.000
#> SRR1652976     1   0.952      0.407 0.628 0.372
#> SRR1652977     1   0.000      0.993 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652896     3   0.296     0.8995 0.100 0.000 0.900
#> SRR1652897     1   0.631     0.0891 0.512 0.000 0.488
#> SRR1652898     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652899     1   0.296     0.8569 0.900 0.000 0.100
#> SRR1652900     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652901     2   0.236     0.9514 0.000 0.928 0.072
#> SRR1652902     1   0.622     0.2822 0.568 0.000 0.432
#> SRR1652903     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652904     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652905     2   0.129     0.9772 0.000 0.968 0.032
#> SRR1652906     1   0.153     0.9122 0.960 0.000 0.040
#> SRR1652907     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652908     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652909     3   0.236     0.9240 0.072 0.000 0.928
#> SRR1652910     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652911     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652912     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652913     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652914     3   0.129     0.9496 0.032 0.000 0.968
#> SRR1652915     1   0.164     0.9095 0.956 0.000 0.044
#> SRR1652916     1   0.604     0.4179 0.620 0.000 0.380
#> SRR1652917     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652918     2   0.129     0.9772 0.000 0.968 0.032
#> SRR1652919     3   0.129     0.9496 0.032 0.000 0.968
#> SRR1652920     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652921     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652922     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652923     3   0.236     0.9240 0.072 0.000 0.928
#> SRR1652924     2   0.129     0.9772 0.000 0.968 0.032
#> SRR1652925     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652926     2   0.129     0.9772 0.000 0.968 0.032
#> SRR1652927     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652928     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652929     3   0.280     0.9072 0.092 0.000 0.908
#> SRR1652930     1   0.362     0.8195 0.864 0.000 0.136
#> SRR1652931     3   0.129     0.9496 0.032 0.000 0.968
#> SRR1652932     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652933     2   0.129     0.9772 0.000 0.968 0.032
#> SRR1652934     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652935     2   0.129     0.9772 0.000 0.968 0.032
#> SRR1652936     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652937     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652938     3   0.129     0.9496 0.032 0.000 0.968
#> SRR1652939     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652940     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652941     3   0.103     0.9491 0.024 0.000 0.976
#> SRR1652942     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652943     2   0.129     0.9772 0.000 0.968 0.032
#> SRR1652944     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652945     2   0.245     0.9478 0.000 0.924 0.076
#> SRR1652946     2   0.236     0.9514 0.000 0.928 0.072
#> SRR1652947     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652948     3   0.129     0.9496 0.032 0.000 0.968
#> SRR1652949     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652950     3   0.129     0.9496 0.032 0.000 0.968
#> SRR1652951     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652953     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652952     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652954     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652955     1   0.164     0.9095 0.956 0.000 0.044
#> SRR1652958     3   0.236     0.9240 0.072 0.000 0.928
#> SRR1652956     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652957     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652959     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652960     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652961     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652962     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652963     2   0.000     0.9820 0.000 1.000 0.000
#> SRR1652965     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652964     2   0.236     0.9514 0.000 0.928 0.072
#> SRR1652966     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652967     3   0.236     0.9240 0.072 0.000 0.928
#> SRR1652969     3   0.629     0.0097 0.000 0.468 0.532
#> SRR1652968     3   0.129     0.9496 0.032 0.000 0.968
#> SRR1652970     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652971     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652972     3   0.129     0.9496 0.032 0.000 0.968
#> SRR1652973     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652974     1   0.000     0.9369 1.000 0.000 0.000
#> SRR1652975     2   0.129     0.9772 0.000 0.968 0.032
#> SRR1652976     3   0.000     0.9447 0.000 0.000 1.000
#> SRR1652977     3   0.129     0.9496 0.032 0.000 0.968

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0336      0.893 0.992 0.008 0.000 0.000
#> SRR1652896     3  0.0336      0.887 0.000 0.008 0.992 0.000
#> SRR1652897     1  0.6966      0.342 0.560 0.036 0.352 0.052
#> SRR1652898     1  0.1209      0.891 0.964 0.032 0.004 0.000
#> SRR1652899     1  0.4800      0.715 0.760 0.044 0.196 0.000
#> SRR1652900     2  0.3219      0.962 0.000 0.836 0.000 0.164
#> SRR1652901     4  0.1474      0.746 0.000 0.052 0.000 0.948
#> SRR1652902     3  0.6865      0.112 0.396 0.044 0.528 0.032
#> SRR1652903     1  0.1022      0.889 0.968 0.032 0.000 0.000
#> SRR1652904     1  0.0000      0.893 1.000 0.000 0.000 0.000
#> SRR1652905     4  0.3726      0.752 0.000 0.212 0.000 0.788
#> SRR1652906     1  0.5678      0.558 0.640 0.044 0.316 0.000
#> SRR1652907     1  0.0707      0.892 0.980 0.020 0.000 0.000
#> SRR1652908     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652909     3  0.2224      0.873 0.000 0.040 0.928 0.032
#> SRR1652910     1  0.1004      0.893 0.972 0.024 0.004 0.000
#> SRR1652911     1  0.1209      0.888 0.964 0.032 0.004 0.000
#> SRR1652912     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652913     4  0.2921      0.621 0.000 0.000 0.140 0.860
#> SRR1652914     3  0.0188      0.890 0.000 0.000 0.996 0.004
#> SRR1652915     1  0.5344      0.583 0.668 0.032 0.300 0.000
#> SRR1652916     1  0.6698      0.411 0.584 0.044 0.340 0.032
#> SRR1652917     3  0.4605      0.670 0.000 0.000 0.664 0.336
#> SRR1652918     4  0.3444      0.756 0.000 0.184 0.000 0.816
#> SRR1652919     3  0.0188      0.890 0.000 0.000 0.996 0.004
#> SRR1652920     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652921     4  0.2921      0.621 0.000 0.000 0.140 0.860
#> SRR1652922     1  0.1576      0.887 0.948 0.048 0.004 0.000
#> SRR1652923     3  0.0188      0.888 0.000 0.004 0.996 0.000
#> SRR1652924     4  0.3801      0.750 0.000 0.220 0.000 0.780
#> SRR1652925     4  0.4804      0.479 0.000 0.384 0.000 0.616
#> SRR1652926     4  0.3801      0.750 0.000 0.220 0.000 0.780
#> SRR1652927     1  0.1109      0.892 0.968 0.028 0.004 0.000
#> SRR1652928     1  0.1022      0.889 0.968 0.032 0.000 0.000
#> SRR1652929     3  0.1302      0.871 0.000 0.044 0.956 0.000
#> SRR1652930     1  0.5462      0.687 0.744 0.032 0.192 0.032
#> SRR1652931     3  0.0188      0.890 0.000 0.000 0.996 0.004
#> SRR1652932     1  0.0000      0.893 1.000 0.000 0.000 0.000
#> SRR1652933     4  0.3801      0.750 0.000 0.220 0.000 0.780
#> SRR1652934     3  0.3726      0.791 0.000 0.000 0.788 0.212
#> SRR1652935     4  0.4222      0.687 0.000 0.272 0.000 0.728
#> SRR1652936     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652937     1  0.1118      0.889 0.964 0.036 0.000 0.000
#> SRR1652938     3  0.4799      0.773 0.000 0.032 0.744 0.224
#> SRR1652939     3  0.4624      0.665 0.000 0.000 0.660 0.340
#> SRR1652940     1  0.0000      0.893 1.000 0.000 0.000 0.000
#> SRR1652941     3  0.1211      0.884 0.000 0.000 0.960 0.040
#> SRR1652942     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652943     4  0.3801      0.750 0.000 0.220 0.000 0.780
#> SRR1652944     3  0.0188      0.890 0.000 0.000 0.996 0.004
#> SRR1652945     4  0.1022      0.739 0.000 0.032 0.000 0.968
#> SRR1652946     4  0.1022      0.739 0.000 0.032 0.000 0.968
#> SRR1652947     1  0.0817      0.891 0.976 0.024 0.000 0.000
#> SRR1652948     3  0.0376      0.889 0.000 0.004 0.992 0.004
#> SRR1652949     1  0.1022      0.892 0.968 0.032 0.000 0.000
#> SRR1652950     3  0.0188      0.890 0.000 0.000 0.996 0.004
#> SRR1652951     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652953     1  0.0469      0.893 0.988 0.012 0.000 0.000
#> SRR1652952     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652954     3  0.4624      0.665 0.000 0.000 0.660 0.340
#> SRR1652955     1  0.5530      0.521 0.632 0.032 0.336 0.000
#> SRR1652958     3  0.2224      0.873 0.000 0.040 0.928 0.032
#> SRR1652956     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652957     4  0.2921      0.621 0.000 0.000 0.140 0.860
#> SRR1652959     4  0.4624      0.572 0.000 0.340 0.000 0.660
#> SRR1652960     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652961     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652962     2  0.2921      0.997 0.000 0.860 0.000 0.140
#> SRR1652963     4  0.4804      0.479 0.000 0.384 0.000 0.616
#> SRR1652965     1  0.1118      0.888 0.964 0.036 0.000 0.000
#> SRR1652964     4  0.1474      0.746 0.000 0.052 0.000 0.948
#> SRR1652966     1  0.1209      0.891 0.964 0.032 0.004 0.000
#> SRR1652967     3  0.2408      0.876 0.000 0.044 0.920 0.036
#> SRR1652969     4  0.3342      0.674 0.000 0.032 0.100 0.868
#> SRR1652968     3  0.0000      0.889 0.000 0.000 1.000 0.000
#> SRR1652970     1  0.0592      0.892 0.984 0.016 0.000 0.000
#> SRR1652971     1  0.1557      0.880 0.944 0.056 0.000 0.000
#> SRR1652972     3  0.1118      0.884 0.000 0.000 0.964 0.036
#> SRR1652973     3  0.4605      0.670 0.000 0.000 0.664 0.336
#> SRR1652974     1  0.1022      0.889 0.968 0.032 0.000 0.000
#> SRR1652975     4  0.3801      0.750 0.000 0.220 0.000 0.780
#> SRR1652976     3  0.1022      0.882 0.000 0.000 0.968 0.032
#> SRR1652977     3  0.0188      0.890 0.000 0.000 0.996 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
#> SRR1652895     1  0.0162     0.7759 0.996 0.004 0.000 0.000 0.000
#> SRR1652896     3  0.1597     0.6592 0.000 0.012 0.940 0.000 0.048
#> SRR1652897     5  0.6380     0.5715 0.336 0.000 0.144 0.008 0.512
#> SRR1652898     1  0.2068     0.7632 0.904 0.004 0.000 0.000 0.092
#> SRR1652899     1  0.5703    -0.1043 0.508 0.000 0.084 0.000 0.408
#> SRR1652900     2  0.4565     0.6325 0.000 0.664 0.000 0.308 0.028
#> SRR1652901     4  0.0404     0.7498 0.000 0.012 0.000 0.988 0.000
#> SRR1652902     5  0.6428     0.5941 0.272 0.000 0.224 0.000 0.504
#> SRR1652903     1  0.3177     0.6625 0.792 0.000 0.000 0.000 0.208
#> SRR1652904     1  0.0880     0.7744 0.968 0.000 0.000 0.000 0.032
#> SRR1652905     4  0.2648     0.7541 0.000 0.152 0.000 0.848 0.000
#> SRR1652906     1  0.6339     0.1326 0.512 0.004 0.156 0.000 0.328
#> SRR1652907     1  0.0865     0.7733 0.972 0.004 0.000 0.000 0.024
#> SRR1652908     2  0.3193     0.9068 0.000 0.840 0.000 0.132 0.028
#> SRR1652909     3  0.4451    -0.1280 0.004 0.000 0.504 0.000 0.492
#> SRR1652910     1  0.2338     0.7616 0.884 0.004 0.000 0.000 0.112
#> SRR1652911     1  0.4491     0.3742 0.652 0.000 0.020 0.000 0.328
#> SRR1652912     2  0.3412     0.8879 0.000 0.820 0.000 0.152 0.028
#> SRR1652913     4  0.4619     0.5650 0.000 0.000 0.064 0.720 0.216
#> SRR1652914     3  0.0000     0.6920 0.000 0.000 1.000 0.000 0.000
#> SRR1652915     1  0.5982     0.3328 0.584 0.004 0.276 0.000 0.136
#> SRR1652916     5  0.6215     0.5440 0.348 0.000 0.152 0.000 0.500
#> SRR1652917     3  0.6705     0.2389 0.000 0.000 0.412 0.252 0.336
#> SRR1652918     4  0.2727     0.7604 0.000 0.116 0.000 0.868 0.016
#> SRR1652919     3  0.0000     0.6920 0.000 0.000 1.000 0.000 0.000
#> SRR1652920     2  0.2130     0.9379 0.000 0.908 0.000 0.080 0.012
#> SRR1652921     4  0.4793     0.5382 0.000 0.000 0.068 0.700 0.232
#> SRR1652922     1  0.2966     0.7267 0.848 0.016 0.000 0.000 0.136
#> SRR1652923     3  0.0963     0.6726 0.000 0.000 0.964 0.000 0.036
#> SRR1652924     4  0.3123     0.7530 0.000 0.160 0.000 0.828 0.012
#> SRR1652925     4  0.4506     0.5475 0.000 0.296 0.000 0.676 0.028
#> SRR1652926     4  0.3123     0.7530 0.000 0.160 0.000 0.828 0.012
#> SRR1652927     1  0.3086     0.7277 0.816 0.004 0.000 0.000 0.180
#> SRR1652928     1  0.2891     0.6933 0.824 0.000 0.000 0.000 0.176
#> SRR1652929     3  0.2806     0.5421 0.000 0.004 0.844 0.000 0.152
#> SRR1652930     5  0.5693     0.3212 0.452 0.000 0.080 0.000 0.468
#> SRR1652931     3  0.0000     0.6920 0.000 0.000 1.000 0.000 0.000
#> SRR1652932     1  0.0290     0.7766 0.992 0.000 0.000 0.000 0.008
#> SRR1652933     4  0.2732     0.7496 0.000 0.160 0.000 0.840 0.000
#> SRR1652934     3  0.6215     0.3128 0.000 0.000 0.508 0.156 0.336
#> SRR1652935     4  0.4254     0.6640 0.000 0.220 0.000 0.740 0.040
#> SRR1652936     2  0.2130     0.9379 0.000 0.908 0.000 0.080 0.012
#> SRR1652937     1  0.3366     0.6589 0.768 0.000 0.000 0.000 0.232
#> SRR1652938     5  0.6424    -0.1918 0.000 0.004 0.388 0.152 0.456
#> SRR1652939     3  0.6705     0.2389 0.000 0.000 0.412 0.252 0.336
#> SRR1652940     1  0.0880     0.7744 0.968 0.000 0.000 0.000 0.032
#> SRR1652941     3  0.4455     0.4672 0.000 0.000 0.704 0.036 0.260
#> SRR1652942     2  0.2795     0.9231 0.000 0.872 0.000 0.100 0.028
#> SRR1652943     4  0.3278     0.7551 0.000 0.156 0.000 0.824 0.020
#> SRR1652944     3  0.0000     0.6920 0.000 0.000 1.000 0.000 0.000
#> SRR1652945     4  0.1965     0.7171 0.000 0.000 0.000 0.904 0.096
#> SRR1652946     4  0.2020     0.7153 0.000 0.000 0.000 0.900 0.100
#> SRR1652947     1  0.0798     0.7723 0.976 0.008 0.000 0.000 0.016
#> SRR1652948     3  0.0000     0.6920 0.000 0.000 1.000 0.000 0.000
#> SRR1652949     1  0.1544     0.7699 0.932 0.000 0.000 0.000 0.068
#> SRR1652950     3  0.0000     0.6920 0.000 0.000 1.000 0.000 0.000
#> SRR1652951     2  0.2130     0.9379 0.000 0.908 0.000 0.080 0.012
#> SRR1652953     1  0.0162     0.7759 0.996 0.004 0.000 0.000 0.000
#> SRR1652952     2  0.2130     0.9379 0.000 0.908 0.000 0.080 0.012
#> SRR1652954     3  0.6705     0.2389 0.000 0.000 0.412 0.252 0.336
#> SRR1652955     1  0.6215     0.1040 0.480 0.004 0.392 0.000 0.124
#> SRR1652958     5  0.4562    -0.0577 0.008 0.000 0.492 0.000 0.500
#> SRR1652956     2  0.1732     0.9363 0.000 0.920 0.000 0.080 0.000
#> SRR1652957     4  0.4619     0.5650 0.000 0.000 0.064 0.720 0.216
#> SRR1652959     4  0.4301     0.6099 0.000 0.260 0.000 0.712 0.028
#> SRR1652960     2  0.3099     0.9120 0.000 0.848 0.000 0.124 0.028
#> SRR1652961     2  0.2130     0.9379 0.000 0.908 0.000 0.080 0.012
#> SRR1652962     2  0.2130     0.9379 0.000 0.908 0.000 0.080 0.012
#> SRR1652963     4  0.4620     0.4956 0.000 0.320 0.000 0.652 0.028
#> SRR1652965     1  0.2331     0.7336 0.900 0.020 0.000 0.000 0.080
#> SRR1652964     4  0.0693     0.7499 0.000 0.012 0.000 0.980 0.008
#> SRR1652966     1  0.1768     0.7673 0.924 0.004 0.000 0.000 0.072
#> SRR1652967     3  0.5314     0.2531 0.000 0.052 0.528 0.000 0.420
#> SRR1652969     4  0.3390     0.6774 0.000 0.000 0.060 0.840 0.100
#> SRR1652968     3  0.0162     0.6900 0.000 0.000 0.996 0.000 0.004
#> SRR1652970     1  0.1965     0.7527 0.904 0.000 0.000 0.000 0.096
#> SRR1652971     1  0.3193     0.6890 0.840 0.028 0.000 0.000 0.132
#> SRR1652972     3  0.3039     0.5552 0.000 0.000 0.808 0.000 0.192
#> SRR1652973     3  0.6705     0.2389 0.000 0.000 0.412 0.252 0.336
#> SRR1652974     1  0.3177     0.6625 0.792 0.000 0.000 0.000 0.208
#> SRR1652975     4  0.2732     0.7496 0.000 0.160 0.000 0.840 0.000
#> SRR1652976     3  0.1943     0.6562 0.000 0.000 0.924 0.020 0.056
#> SRR1652977     3  0.0000     0.6920 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.3835    -0.0509 0.668 0.000 0.000 0.000 0.320 0.012
#> SRR1652896     3  0.2925     0.6991 0.012 0.000 0.864 0.000 0.064 0.060
#> SRR1652897     1  0.5551    -0.0606 0.528 0.000 0.072 0.000 0.028 0.372
#> SRR1652898     1  0.3866    -0.2777 0.516 0.000 0.000 0.000 0.484 0.000
#> SRR1652899     1  0.5037     0.2910 0.676 0.000 0.040 0.000 0.064 0.220
#> SRR1652900     2  0.5769     0.3211 0.000 0.504 0.000 0.360 0.120 0.016
#> SRR1652901     4  0.0551     0.7745 0.000 0.004 0.004 0.984 0.008 0.000
#> SRR1652902     1  0.6459    -0.0220 0.512 0.000 0.140 0.000 0.068 0.280
#> SRR1652903     1  0.0790     0.3643 0.968 0.000 0.000 0.000 0.000 0.032
#> SRR1652904     1  0.3043     0.1971 0.792 0.000 0.000 0.000 0.200 0.008
#> SRR1652905     4  0.1918     0.7807 0.000 0.088 0.000 0.904 0.008 0.000
#> SRR1652906     1  0.5416     0.2184 0.676 0.000 0.080 0.000 0.156 0.088
#> SRR1652907     1  0.3940    -0.1170 0.640 0.000 0.000 0.000 0.348 0.012
#> SRR1652908     2  0.4129     0.8085 0.000 0.772 0.000 0.092 0.120 0.016
#> SRR1652909     6  0.6909     0.3502 0.308 0.000 0.312 0.000 0.048 0.332
#> SRR1652910     1  0.3804    -0.1623 0.576 0.000 0.000 0.000 0.424 0.000
#> SRR1652911     1  0.2513     0.3421 0.852 0.000 0.000 0.000 0.008 0.140
#> SRR1652912     2  0.4311     0.7932 0.000 0.756 0.000 0.108 0.120 0.016
#> SRR1652913     4  0.4177     0.4940 0.000 0.000 0.008 0.668 0.020 0.304
#> SRR1652914     3  0.0146     0.7797 0.000 0.000 0.996 0.000 0.000 0.004
#> SRR1652915     5  0.6276     0.2713 0.292 0.000 0.296 0.000 0.404 0.008
#> SRR1652916     1  0.5873     0.1232 0.572 0.000 0.088 0.000 0.056 0.284
#> SRR1652917     6  0.5648     0.6387 0.000 0.000 0.304 0.180 0.000 0.516
#> SRR1652918     4  0.2001     0.7862 0.000 0.068 0.000 0.912 0.008 0.012
#> SRR1652919     3  0.0937     0.7654 0.000 0.000 0.960 0.000 0.000 0.040
#> SRR1652920     2  0.0146     0.8817 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652921     4  0.4698     0.2990 0.000 0.000 0.020 0.576 0.020 0.384
#> SRR1652922     5  0.3817     0.3026 0.432 0.000 0.000 0.000 0.568 0.000
#> SRR1652923     3  0.1777     0.7478 0.012 0.000 0.932 0.000 0.032 0.024
#> SRR1652924     4  0.2001     0.7820 0.000 0.092 0.000 0.900 0.004 0.004
#> SRR1652925     4  0.5168     0.5309 0.000 0.216 0.000 0.652 0.116 0.016
#> SRR1652926     4  0.1858     0.7815 0.000 0.092 0.000 0.904 0.000 0.004
#> SRR1652927     1  0.3023     0.2503 0.784 0.000 0.000 0.000 0.212 0.004
#> SRR1652928     1  0.0632     0.3510 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR1652929     3  0.3679     0.6445 0.060 0.000 0.820 0.000 0.084 0.036
#> SRR1652930     1  0.4303     0.2793 0.676 0.000 0.032 0.000 0.008 0.284
#> SRR1652931     3  0.0632     0.7748 0.000 0.000 0.976 0.000 0.000 0.024
#> SRR1652932     1  0.3468     0.0773 0.728 0.000 0.000 0.000 0.264 0.008
#> SRR1652933     4  0.1970     0.7788 0.000 0.092 0.000 0.900 0.008 0.000
#> SRR1652934     6  0.5179     0.5346 0.000 0.000 0.392 0.092 0.000 0.516
#> SRR1652935     4  0.4931     0.6586 0.000 0.128 0.000 0.712 0.124 0.036
#> SRR1652936     2  0.0146     0.8817 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652937     1  0.1528     0.3556 0.936 0.000 0.000 0.000 0.048 0.016
#> SRR1652938     6  0.6510     0.5476 0.080 0.000 0.164 0.084 0.056 0.616
#> SRR1652939     6  0.5648     0.6387 0.000 0.000 0.304 0.180 0.000 0.516
#> SRR1652940     1  0.3043     0.1971 0.792 0.000 0.000 0.000 0.200 0.008
#> SRR1652941     3  0.4871    -0.3497 0.008 0.000 0.520 0.032 0.004 0.436
#> SRR1652942     2  0.3329     0.8395 0.000 0.828 0.000 0.036 0.120 0.016
#> SRR1652943     4  0.2647     0.7830 0.000 0.088 0.000 0.876 0.016 0.020
#> SRR1652944     3  0.0363     0.7787 0.000 0.000 0.988 0.000 0.000 0.012
#> SRR1652945     4  0.2809     0.7011 0.000 0.000 0.004 0.848 0.020 0.128
#> SRR1652946     4  0.3086     0.6808 0.000 0.000 0.004 0.820 0.020 0.156
#> SRR1652947     1  0.3954    -0.1364 0.636 0.000 0.000 0.000 0.352 0.012
#> SRR1652948     3  0.0291     0.7789 0.000 0.000 0.992 0.000 0.004 0.004
#> SRR1652949     1  0.3823    -0.2093 0.564 0.000 0.000 0.000 0.436 0.000
#> SRR1652950     3  0.0937     0.7654 0.000 0.000 0.960 0.000 0.000 0.040
#> SRR1652951     2  0.0146     0.8817 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652953     1  0.3867    -0.0708 0.660 0.000 0.000 0.000 0.328 0.012
#> SRR1652952     2  0.0146     0.8817 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652954     6  0.5648     0.6387 0.000 0.000 0.304 0.180 0.000 0.516
#> SRR1652955     3  0.6424    -0.4217 0.208 0.000 0.392 0.000 0.376 0.024
#> SRR1652958     6  0.6905     0.3577 0.320 0.000 0.296 0.000 0.048 0.336
#> SRR1652956     2  0.0951     0.8783 0.000 0.968 0.000 0.004 0.020 0.008
#> SRR1652957     4  0.4177     0.4940 0.000 0.000 0.008 0.668 0.020 0.304
#> SRR1652959     4  0.4962     0.5857 0.000 0.180 0.000 0.684 0.120 0.016
#> SRR1652960     2  0.3877     0.8221 0.000 0.792 0.000 0.072 0.120 0.016
#> SRR1652961     2  0.0146     0.8817 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652962     2  0.0146     0.8817 0.000 0.996 0.000 0.004 0.000 0.000
#> SRR1652963     4  0.5230     0.5194 0.000 0.220 0.000 0.644 0.120 0.016
#> SRR1652965     1  0.4234    -0.3882 0.544 0.000 0.000 0.000 0.440 0.016
#> SRR1652964     4  0.1299     0.7764 0.000 0.004 0.004 0.952 0.036 0.004
#> SRR1652966     1  0.3857    -0.2598 0.532 0.000 0.000 0.000 0.468 0.000
#> SRR1652967     6  0.6897     0.0887 0.052 0.004 0.332 0.004 0.180 0.428
#> SRR1652969     4  0.3159     0.6777 0.000 0.000 0.008 0.820 0.020 0.152
#> SRR1652968     3  0.0508     0.7767 0.000 0.000 0.984 0.000 0.012 0.004
#> SRR1652970     1  0.2003     0.2905 0.884 0.000 0.000 0.000 0.116 0.000
#> SRR1652971     5  0.4705     0.3160 0.440 0.000 0.000 0.004 0.520 0.036
#> SRR1652972     3  0.3644     0.3431 0.008 0.000 0.732 0.000 0.008 0.252
#> SRR1652973     6  0.5648     0.6387 0.000 0.000 0.304 0.180 0.000 0.516
#> SRR1652974     1  0.0713     0.3644 0.972 0.000 0.000 0.000 0.000 0.028
#> SRR1652975     4  0.1970     0.7788 0.000 0.092 0.000 0.900 0.008 0.000
#> SRR1652976     3  0.2118     0.6924 0.000 0.000 0.888 0.008 0.000 0.104
#> SRR1652977     3  0.0146     0.7797 0.000 0.000 0.996 0.000 0.004 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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 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-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.982       0.992         0.5019 0.500   0.500
#> 3 3 1.000           0.934       0.976         0.2581 0.852   0.709
#> 4 4 0.931           0.883       0.949         0.0990 0.906   0.752
#> 5 5 0.844           0.782       0.899         0.0433 0.956   0.859
#> 6 6 0.836           0.727       0.871         0.0265 0.976   0.914

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
#> SRR1652895     1   0.000      0.987 1.000 0.000
#> SRR1652896     1   0.000      0.987 1.000 0.000
#> SRR1652897     1   0.000      0.987 1.000 0.000
#> SRR1652898     1   0.000      0.987 1.000 0.000
#> SRR1652899     1   0.000      0.987 1.000 0.000
#> SRR1652900     2   0.000      0.999 0.000 1.000
#> SRR1652901     2   0.000      0.999 0.000 1.000
#> SRR1652902     1   0.000      0.987 1.000 0.000
#> SRR1652903     1   0.000      0.987 1.000 0.000
#> SRR1652904     1   0.000      0.987 1.000 0.000
#> SRR1652905     2   0.000      0.999 0.000 1.000
#> SRR1652906     1   0.000      0.987 1.000 0.000
#> SRR1652907     1   0.000      0.987 1.000 0.000
#> SRR1652908     2   0.000      0.999 0.000 1.000
#> SRR1652909     1   0.000      0.987 1.000 0.000
#> SRR1652910     1   0.000      0.987 1.000 0.000
#> SRR1652911     1   0.000      0.987 1.000 0.000
#> SRR1652912     2   0.000      0.999 0.000 1.000
#> SRR1652913     2   0.000      0.999 0.000 1.000
#> SRR1652914     1   0.000      0.987 1.000 0.000
#> SRR1652915     1   0.000      0.987 1.000 0.000
#> SRR1652916     1   0.000      0.987 1.000 0.000
#> SRR1652917     2   0.000      0.999 0.000 1.000
#> SRR1652918     2   0.000      0.999 0.000 1.000
#> SRR1652919     1   0.000      0.987 1.000 0.000
#> SRR1652920     2   0.000      0.999 0.000 1.000
#> SRR1652921     2   0.000      0.999 0.000 1.000
#> SRR1652922     1   0.000      0.987 1.000 0.000
#> SRR1652923     1   0.000      0.987 1.000 0.000
#> SRR1652924     2   0.000      0.999 0.000 1.000
#> SRR1652925     2   0.000      0.999 0.000 1.000
#> SRR1652926     2   0.000      0.999 0.000 1.000
#> SRR1652927     1   0.000      0.987 1.000 0.000
#> SRR1652928     1   0.000      0.987 1.000 0.000
#> SRR1652929     1   0.000      0.987 1.000 0.000
#> SRR1652930     1   0.000      0.987 1.000 0.000
#> SRR1652931     1   0.000      0.987 1.000 0.000
#> SRR1652932     1   0.000      0.987 1.000 0.000
#> SRR1652933     2   0.000      0.999 0.000 1.000
#> SRR1652934     1   0.917      0.514 0.668 0.332
#> SRR1652935     2   0.000      0.999 0.000 1.000
#> SRR1652936     2   0.000      0.999 0.000 1.000
#> SRR1652937     1   0.000      0.987 1.000 0.000
#> SRR1652938     1   0.000      0.987 1.000 0.000
#> SRR1652939     2   0.163      0.975 0.024 0.976
#> SRR1652940     1   0.000      0.987 1.000 0.000
#> SRR1652941     1   0.000      0.987 1.000 0.000
#> SRR1652942     2   0.000      0.999 0.000 1.000
#> SRR1652943     2   0.000      0.999 0.000 1.000
#> SRR1652944     2   0.000      0.999 0.000 1.000
#> SRR1652945     2   0.000      0.999 0.000 1.000
#> SRR1652946     2   0.000      0.999 0.000 1.000
#> SRR1652947     1   0.000      0.987 1.000 0.000
#> SRR1652948     1   0.839      0.640 0.732 0.268
#> SRR1652949     1   0.000      0.987 1.000 0.000
#> SRR1652950     1   0.000      0.987 1.000 0.000
#> SRR1652951     2   0.000      0.999 0.000 1.000
#> SRR1652953     1   0.000      0.987 1.000 0.000
#> SRR1652952     2   0.000      0.999 0.000 1.000
#> SRR1652954     2   0.000      0.999 0.000 1.000
#> SRR1652955     1   0.000      0.987 1.000 0.000
#> SRR1652958     1   0.000      0.987 1.000 0.000
#> SRR1652956     2   0.000      0.999 0.000 1.000
#> SRR1652957     2   0.000      0.999 0.000 1.000
#> SRR1652959     2   0.000      0.999 0.000 1.000
#> SRR1652960     2   0.000      0.999 0.000 1.000
#> SRR1652961     2   0.000      0.999 0.000 1.000
#> SRR1652962     2   0.000      0.999 0.000 1.000
#> SRR1652963     2   0.000      0.999 0.000 1.000
#> SRR1652965     1   0.000      0.987 1.000 0.000
#> SRR1652964     2   0.000      0.999 0.000 1.000
#> SRR1652966     1   0.000      0.987 1.000 0.000
#> SRR1652967     1   0.000      0.987 1.000 0.000
#> SRR1652969     2   0.000      0.999 0.000 1.000
#> SRR1652968     1   0.000      0.987 1.000 0.000
#> SRR1652970     1   0.000      0.987 1.000 0.000
#> SRR1652971     1   0.000      0.987 1.000 0.000
#> SRR1652972     1   0.000      0.987 1.000 0.000
#> SRR1652973     2   0.000      0.999 0.000 1.000
#> SRR1652974     1   0.000      0.987 1.000 0.000
#> SRR1652975     2   0.000      0.999 0.000 1.000
#> SRR1652976     2   0.000      0.999 0.000 1.000
#> SRR1652977     1   0.000      0.987 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652896     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652897     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652898     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652899     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652900     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652901     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652902     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652903     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652904     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652905     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652906     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652907     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652908     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652909     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652910     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652911     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652912     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652913     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652914     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652915     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652916     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652917     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652918     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652919     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652920     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652921     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652922     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652923     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652924     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652925     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652926     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652927     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652928     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652929     3  0.6192      0.293 0.420 0.000 0.580
#> SRR1652930     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652931     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652932     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652933     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652934     3  0.1182      0.898 0.012 0.012 0.976
#> SRR1652935     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652936     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652937     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652938     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652939     2  0.2400      0.913 0.064 0.932 0.004
#> SRR1652940     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652941     1  0.5591      0.513 0.696 0.000 0.304
#> SRR1652942     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652943     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652944     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652945     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652946     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652947     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652948     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652949     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652950     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652951     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652953     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652952     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652954     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652955     3  0.6215      0.270 0.428 0.000 0.572
#> SRR1652958     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652956     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652957     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652959     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652960     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652961     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652962     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652963     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652965     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652964     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652966     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652967     1  0.1529      0.931 0.960 0.000 0.040
#> SRR1652969     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652968     3  0.0000      0.912 0.000 0.000 1.000
#> SRR1652970     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652971     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652972     1  0.6309     -0.107 0.500 0.000 0.500
#> SRR1652973     2  0.0424      0.990 0.000 0.992 0.008
#> SRR1652974     1  0.0000      0.972 1.000 0.000 0.000
#> SRR1652975     2  0.0000      0.997 0.000 1.000 0.000
#> SRR1652976     3  0.4702      0.695 0.000 0.212 0.788
#> SRR1652977     3  0.0000      0.912 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
#> SRR1652895     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.0524      0.864 0.008 0.000 0.988 0.004
#> SRR1652897     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652898     1  0.0376      0.965 0.992 0.000 0.004 0.004
#> SRR1652899     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652900     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652901     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652902     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652903     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652906     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652907     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652908     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652909     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652910     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652911     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652913     4  0.4454      0.724 0.000 0.308 0.000 0.692
#> SRR1652914     3  0.0188      0.869 0.000 0.000 0.996 0.004
#> SRR1652915     1  0.1004      0.947 0.972 0.000 0.024 0.004
#> SRR1652916     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652917     4  0.1792      0.781 0.000 0.068 0.000 0.932
#> SRR1652918     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652919     3  0.0188      0.868 0.000 0.000 0.996 0.004
#> SRR1652920     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652921     4  0.4500      0.717 0.000 0.316 0.000 0.684
#> SRR1652922     1  0.0188      0.968 0.996 0.000 0.004 0.000
#> SRR1652923     3  0.0188      0.868 0.000 0.000 0.996 0.004
#> SRR1652924     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652925     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652926     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652927     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652928     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652929     3  0.4632      0.588 0.308 0.000 0.688 0.004
#> SRR1652930     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652931     3  0.0188      0.868 0.000 0.000 0.996 0.004
#> SRR1652932     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652933     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652934     4  0.1792      0.713 0.000 0.000 0.068 0.932
#> SRR1652935     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652936     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652937     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652938     1  0.4955      0.249 0.556 0.000 0.000 0.444
#> SRR1652939     4  0.0524      0.760 0.004 0.008 0.000 0.988
#> SRR1652940     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652941     1  0.5537      0.529 0.688 0.000 0.256 0.056
#> SRR1652942     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652943     2  0.0592      0.946 0.000 0.984 0.000 0.016
#> SRR1652944     3  0.0188      0.869 0.000 0.000 0.996 0.004
#> SRR1652945     2  0.4564      0.342 0.000 0.672 0.000 0.328
#> SRR1652946     4  0.4522      0.712 0.000 0.320 0.000 0.680
#> SRR1652947     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652948     3  0.0188      0.869 0.000 0.000 0.996 0.004
#> SRR1652949     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652950     3  0.0188      0.869 0.000 0.000 0.996 0.004
#> SRR1652951     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652953     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652954     4  0.1022      0.774 0.000 0.032 0.000 0.968
#> SRR1652955     3  0.4761      0.559 0.332 0.000 0.664 0.004
#> SRR1652958     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652956     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652957     4  0.4522      0.712 0.000 0.320 0.000 0.680
#> SRR1652959     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652961     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652962     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652963     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652965     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652964     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652966     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652967     1  0.2342      0.881 0.912 0.000 0.080 0.008
#> SRR1652969     2  0.0469      0.950 0.000 0.988 0.000 0.012
#> SRR1652968     3  0.0188      0.869 0.000 0.000 0.996 0.004
#> SRR1652970     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652971     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652972     3  0.5007      0.507 0.356 0.000 0.636 0.008
#> SRR1652973     4  0.0524      0.760 0.004 0.008 0.000 0.988
#> SRR1652974     1  0.0000      0.971 1.000 0.000 0.000 0.000
#> SRR1652975     2  0.0000      0.962 0.000 1.000 0.000 0.000
#> SRR1652976     2  0.5244      0.222 0.000 0.556 0.436 0.008
#> SRR1652977     3  0.0188      0.869 0.000 0.000 0.996 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
#> SRR1652895     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.1410     0.8238 0.000 0.000 0.940 0.000 0.060
#> SRR1652897     1  0.0290     0.8954 0.992 0.000 0.000 0.000 0.008
#> SRR1652898     1  0.3282     0.7502 0.804 0.000 0.008 0.000 0.188
#> SRR1652899     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652900     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652901     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652902     1  0.1270     0.8827 0.948 0.000 0.000 0.000 0.052
#> SRR1652903     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652906     1  0.2674     0.8130 0.856 0.000 0.004 0.000 0.140
#> SRR1652907     1  0.1478     0.8758 0.936 0.000 0.000 0.000 0.064
#> SRR1652908     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652909     1  0.1197     0.8848 0.952 0.000 0.000 0.000 0.048
#> SRR1652910     1  0.2329     0.8314 0.876 0.000 0.000 0.000 0.124
#> SRR1652911     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652912     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652913     4  0.2127     0.6818 0.000 0.108 0.000 0.892 0.000
#> SRR1652914     3  0.0290     0.8361 0.000 0.000 0.992 0.000 0.008
#> SRR1652915     1  0.4238     0.6749 0.756 0.000 0.052 0.000 0.192
#> SRR1652916     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652917     4  0.4779     0.3776 0.000 0.024 0.000 0.588 0.388
#> SRR1652918     2  0.0609     0.9535 0.000 0.980 0.000 0.020 0.000
#> SRR1652919     3  0.2719     0.7746 0.000 0.000 0.852 0.004 0.144
#> SRR1652920     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652921     4  0.2488     0.6784 0.000 0.124 0.000 0.872 0.004
#> SRR1652922     1  0.2773     0.7907 0.836 0.000 0.000 0.000 0.164
#> SRR1652923     3  0.1270     0.8264 0.000 0.000 0.948 0.000 0.052
#> SRR1652924     2  0.0609     0.9534 0.000 0.980 0.000 0.020 0.000
#> SRR1652925     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652926     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652927     1  0.0703     0.8953 0.976 0.000 0.000 0.000 0.024
#> SRR1652928     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.6339     0.0984 0.304 0.000 0.508 0.000 0.188
#> SRR1652930     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652931     3  0.1851     0.8151 0.000 0.000 0.912 0.000 0.088
#> SRR1652932     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652934     5  0.5400    -0.2874 0.000 0.000 0.096 0.272 0.632
#> SRR1652935     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652936     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652938     5  0.6844     0.3699 0.364 0.000 0.004 0.244 0.388
#> SRR1652939     4  0.4201     0.3969 0.000 0.000 0.000 0.592 0.408
#> SRR1652940     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     5  0.6569     0.3559 0.372 0.000 0.108 0.028 0.492
#> SRR1652942     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     2  0.2648     0.7903 0.000 0.848 0.000 0.152 0.000
#> SRR1652944     3  0.0404     0.8351 0.000 0.000 0.988 0.000 0.012
#> SRR1652945     4  0.4249     0.2995 0.000 0.432 0.000 0.568 0.000
#> SRR1652946     4  0.2179     0.6826 0.000 0.112 0.000 0.888 0.000
#> SRR1652947     1  0.0162     0.8995 0.996 0.000 0.000 0.000 0.004
#> SRR1652948     3  0.0290     0.8368 0.000 0.000 0.992 0.000 0.008
#> SRR1652949     1  0.2280     0.8349 0.880 0.000 0.000 0.000 0.120
#> SRR1652950     3  0.0290     0.8384 0.000 0.000 0.992 0.000 0.008
#> SRR1652951     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652953     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     4  0.2929     0.5492 0.000 0.008 0.000 0.840 0.152
#> SRR1652955     3  0.6351     0.0991 0.300 0.000 0.508 0.000 0.192
#> SRR1652958     1  0.0290     0.8988 0.992 0.000 0.000 0.000 0.008
#> SRR1652956     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     4  0.2280     0.6817 0.000 0.120 0.000 0.880 0.000
#> SRR1652959     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652960     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652961     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652965     1  0.0703     0.8948 0.976 0.000 0.000 0.000 0.024
#> SRR1652964     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652966     1  0.2424     0.8240 0.868 0.000 0.000 0.000 0.132
#> SRR1652967     1  0.5498     0.2239 0.580 0.000 0.080 0.000 0.340
#> SRR1652969     2  0.1270     0.9209 0.000 0.948 0.000 0.052 0.000
#> SRR1652968     3  0.0162     0.8380 0.000 0.000 0.996 0.000 0.004
#> SRR1652970     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     1  0.0794     0.8939 0.972 0.000 0.000 0.000 0.028
#> SRR1652972     1  0.6729    -0.2615 0.376 0.000 0.372 0.000 0.252
#> SRR1652973     4  0.4297     0.3228 0.000 0.000 0.000 0.528 0.472
#> SRR1652974     1  0.0000     0.9000 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.0000     0.9697 0.000 1.000 0.000 0.000 0.000
#> SRR1652976     2  0.5176     0.2767 0.000 0.572 0.380 0.000 0.048
#> SRR1652977     3  0.0162     0.8380 0.000 0.000 0.996 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
#> SRR1652895     1  0.0458      0.883 0.984 0.000 0.000 0.000 0.016 0.000
#> SRR1652896     3  0.3111      0.711 0.008 0.000 0.820 0.000 0.156 0.016
#> SRR1652897     1  0.0865      0.868 0.964 0.000 0.000 0.000 0.036 0.000
#> SRR1652898     1  0.3290      0.641 0.744 0.000 0.004 0.000 0.252 0.000
#> SRR1652899     1  0.0260      0.887 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1652900     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652901     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652902     1  0.1556      0.865 0.920 0.000 0.000 0.000 0.080 0.000
#> SRR1652903     1  0.0547      0.881 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1652904     1  0.0547      0.881 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1652905     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652906     1  0.2631      0.773 0.820 0.000 0.000 0.000 0.180 0.000
#> SRR1652907     1  0.1957      0.843 0.888 0.000 0.000 0.000 0.112 0.000
#> SRR1652908     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652909     1  0.1556      0.867 0.920 0.000 0.000 0.000 0.080 0.000
#> SRR1652910     1  0.2378      0.805 0.848 0.000 0.000 0.000 0.152 0.000
#> SRR1652911     1  0.0547      0.881 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1652912     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     4  0.1204      0.654 0.000 0.056 0.000 0.944 0.000 0.000
#> SRR1652914     3  0.0790      0.759 0.000 0.000 0.968 0.000 0.032 0.000
#> SRR1652915     1  0.4408      0.419 0.664 0.000 0.056 0.000 0.280 0.000
#> SRR1652916     1  0.0632      0.885 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR1652917     4  0.6161     -0.135 0.000 0.016 0.000 0.416 0.176 0.392
#> SRR1652918     2  0.1910      0.852 0.000 0.892 0.000 0.108 0.000 0.000
#> SRR1652919     3  0.4029      0.615 0.000 0.000 0.680 0.000 0.292 0.028
#> SRR1652920     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652921     4  0.1531      0.652 0.000 0.068 0.000 0.928 0.000 0.004
#> SRR1652922     1  0.2941      0.711 0.780 0.000 0.000 0.000 0.220 0.000
#> SRR1652923     3  0.1753      0.748 0.004 0.000 0.912 0.000 0.084 0.000
#> SRR1652924     2  0.1714      0.870 0.000 0.908 0.000 0.092 0.000 0.000
#> SRR1652925     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652926     2  0.0632      0.930 0.000 0.976 0.000 0.024 0.000 0.000
#> SRR1652927     1  0.1204      0.877 0.944 0.000 0.000 0.000 0.056 0.000
#> SRR1652928     1  0.0547      0.881 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1652929     3  0.5936     -0.318 0.284 0.000 0.460 0.000 0.256 0.000
#> SRR1652930     1  0.0547      0.881 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1652931     3  0.4045      0.638 0.000 0.000 0.696 0.000 0.268 0.036
#> SRR1652932     1  0.0260      0.885 0.992 0.000 0.000 0.000 0.008 0.000
#> SRR1652933     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652934     6  0.4402      0.384 0.000 0.000 0.040 0.108 0.088 0.764
#> SRR1652935     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652936     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     1  0.0000      0.886 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652938     6  0.7258     -0.205 0.308 0.000 0.004 0.080 0.248 0.360
#> SRR1652939     6  0.5154      0.227 0.004 0.000 0.000 0.396 0.076 0.524
#> SRR1652940     1  0.0458      0.883 0.984 0.000 0.000 0.000 0.016 0.000
#> SRR1652941     5  0.7270      0.083 0.228 0.000 0.064 0.020 0.432 0.256
#> SRR1652942     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     2  0.3499      0.498 0.000 0.680 0.000 0.320 0.000 0.000
#> SRR1652944     3  0.1219      0.754 0.000 0.000 0.948 0.000 0.048 0.004
#> SRR1652945     4  0.3742      0.325 0.000 0.348 0.000 0.648 0.004 0.000
#> SRR1652946     4  0.1267      0.658 0.000 0.060 0.000 0.940 0.000 0.000
#> SRR1652947     1  0.0865      0.883 0.964 0.000 0.000 0.000 0.036 0.000
#> SRR1652948     3  0.1625      0.754 0.000 0.000 0.928 0.000 0.060 0.012
#> SRR1652949     1  0.2664      0.767 0.816 0.000 0.000 0.000 0.184 0.000
#> SRR1652950     3  0.1075      0.760 0.000 0.000 0.952 0.000 0.048 0.000
#> SRR1652951     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.0363      0.886 0.988 0.000 0.000 0.000 0.012 0.000
#> SRR1652952     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     4  0.4793      0.243 0.000 0.000 0.000 0.648 0.100 0.252
#> SRR1652955     3  0.6071     -0.398 0.300 0.000 0.404 0.000 0.296 0.000
#> SRR1652958     1  0.0632      0.885 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR1652956     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652957     4  0.1267      0.658 0.000 0.060 0.000 0.940 0.000 0.000
#> SRR1652959     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652960     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652961     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652965     1  0.1714      0.857 0.908 0.000 0.000 0.000 0.092 0.000
#> SRR1652964     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652966     1  0.2697      0.762 0.812 0.000 0.000 0.000 0.188 0.000
#> SRR1652967     5  0.5483      0.422 0.408 0.000 0.024 0.008 0.512 0.048
#> SRR1652969     2  0.2743      0.773 0.000 0.828 0.000 0.164 0.000 0.008
#> SRR1652968     3  0.0146      0.762 0.000 0.000 0.996 0.000 0.004 0.000
#> SRR1652970     1  0.0000      0.886 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     1  0.1714      0.859 0.908 0.000 0.000 0.000 0.092 0.000
#> SRR1652972     5  0.6638      0.357 0.252 0.000 0.288 0.000 0.424 0.036
#> SRR1652973     6  0.3835      0.366 0.000 0.000 0.000 0.300 0.016 0.684
#> SRR1652974     1  0.0547      0.881 0.980 0.000 0.000 0.000 0.020 0.000
#> SRR1652975     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652976     2  0.5942      0.193 0.000 0.520 0.328 0.000 0.124 0.028
#> SRR1652977     3  0.0458      0.762 0.000 0.000 0.984 0.000 0.016 0.000

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

consensus_heatmap(res, k = 2)

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

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

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.945       0.979         0.5028 0.496   0.496
#> 3 3 0.870           0.870       0.940         0.3239 0.760   0.550
#> 4 4 0.872           0.864       0.940         0.0713 0.953   0.857
#> 5 5 0.802           0.816       0.900         0.0747 0.927   0.756
#> 6 6 0.763           0.741       0.873         0.0212 0.996   0.982

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
#> SRR1652895     1  0.0000    0.98552 1.000 0.000
#> SRR1652896     1  0.0000    0.98552 1.000 0.000
#> SRR1652897     1  0.0000    0.98552 1.000 0.000
#> SRR1652898     1  0.0000    0.98552 1.000 0.000
#> SRR1652899     1  0.0000    0.98552 1.000 0.000
#> SRR1652900     2  0.0000    0.96976 0.000 1.000
#> SRR1652901     2  0.0000    0.96976 0.000 1.000
#> SRR1652902     1  0.0000    0.98552 1.000 0.000
#> SRR1652903     1  0.0000    0.98552 1.000 0.000
#> SRR1652904     1  0.0000    0.98552 1.000 0.000
#> SRR1652905     2  0.0000    0.96976 0.000 1.000
#> SRR1652906     1  0.0000    0.98552 1.000 0.000
#> SRR1652907     1  0.0000    0.98552 1.000 0.000
#> SRR1652908     2  0.0000    0.96976 0.000 1.000
#> SRR1652909     1  0.0000    0.98552 1.000 0.000
#> SRR1652910     1  0.0000    0.98552 1.000 0.000
#> SRR1652911     1  0.0000    0.98552 1.000 0.000
#> SRR1652912     2  0.0000    0.96976 0.000 1.000
#> SRR1652913     2  0.0000    0.96976 0.000 1.000
#> SRR1652914     1  0.9993    0.00095 0.516 0.484
#> SRR1652915     1  0.0000    0.98552 1.000 0.000
#> SRR1652916     1  0.0000    0.98552 1.000 0.000
#> SRR1652917     2  0.0376    0.96730 0.004 0.996
#> SRR1652918     2  0.0000    0.96976 0.000 1.000
#> SRR1652919     1  0.0000    0.98552 1.000 0.000
#> SRR1652920     2  0.0000    0.96976 0.000 1.000
#> SRR1652921     2  0.0376    0.96730 0.004 0.996
#> SRR1652922     1  0.0000    0.98552 1.000 0.000
#> SRR1652923     1  0.0000    0.98552 1.000 0.000
#> SRR1652924     2  0.0000    0.96976 0.000 1.000
#> SRR1652925     2  0.0000    0.96976 0.000 1.000
#> SRR1652926     2  0.0000    0.96976 0.000 1.000
#> SRR1652927     1  0.0000    0.98552 1.000 0.000
#> SRR1652928     1  0.0000    0.98552 1.000 0.000
#> SRR1652929     1  0.0000    0.98552 1.000 0.000
#> SRR1652930     1  0.0000    0.98552 1.000 0.000
#> SRR1652931     1  0.4939    0.86456 0.892 0.108
#> SRR1652932     1  0.0000    0.98552 1.000 0.000
#> SRR1652933     2  0.0000    0.96976 0.000 1.000
#> SRR1652934     2  0.8909    0.55989 0.308 0.692
#> SRR1652935     2  0.0000    0.96976 0.000 1.000
#> SRR1652936     2  0.0000    0.96976 0.000 1.000
#> SRR1652937     1  0.0000    0.98552 1.000 0.000
#> SRR1652938     1  0.0000    0.98552 1.000 0.000
#> SRR1652939     2  0.9552    0.41138 0.376 0.624
#> SRR1652940     1  0.0000    0.98552 1.000 0.000
#> SRR1652941     1  0.0000    0.98552 1.000 0.000
#> SRR1652942     2  0.0000    0.96976 0.000 1.000
#> SRR1652943     2  0.0000    0.96976 0.000 1.000
#> SRR1652944     2  0.0376    0.96730 0.004 0.996
#> SRR1652945     2  0.0000    0.96976 0.000 1.000
#> SRR1652946     2  0.0000    0.96976 0.000 1.000
#> SRR1652947     1  0.0000    0.98552 1.000 0.000
#> SRR1652948     2  0.9732    0.33844 0.404 0.596
#> SRR1652949     1  0.0000    0.98552 1.000 0.000
#> SRR1652950     1  0.0000    0.98552 1.000 0.000
#> SRR1652951     2  0.0000    0.96976 0.000 1.000
#> SRR1652953     1  0.0000    0.98552 1.000 0.000
#> SRR1652952     2  0.0000    0.96976 0.000 1.000
#> SRR1652954     2  0.0376    0.96730 0.004 0.996
#> SRR1652955     1  0.0000    0.98552 1.000 0.000
#> SRR1652958     1  0.0000    0.98552 1.000 0.000
#> SRR1652956     2  0.0000    0.96976 0.000 1.000
#> SRR1652957     2  0.0000    0.96976 0.000 1.000
#> SRR1652959     2  0.0000    0.96976 0.000 1.000
#> SRR1652960     2  0.0000    0.96976 0.000 1.000
#> SRR1652961     2  0.0000    0.96976 0.000 1.000
#> SRR1652962     2  0.0000    0.96976 0.000 1.000
#> SRR1652963     2  0.0000    0.96976 0.000 1.000
#> SRR1652965     1  0.0000    0.98552 1.000 0.000
#> SRR1652964     2  0.0000    0.96976 0.000 1.000
#> SRR1652966     1  0.0000    0.98552 1.000 0.000
#> SRR1652967     1  0.0000    0.98552 1.000 0.000
#> SRR1652969     2  0.0000    0.96976 0.000 1.000
#> SRR1652968     1  0.0000    0.98552 1.000 0.000
#> SRR1652970     1  0.0000    0.98552 1.000 0.000
#> SRR1652971     1  0.0000    0.98552 1.000 0.000
#> SRR1652972     1  0.0000    0.98552 1.000 0.000
#> SRR1652973     2  0.0376    0.96730 0.004 0.996
#> SRR1652974     1  0.0000    0.98552 1.000 0.000
#> SRR1652975     2  0.0000    0.96976 0.000 1.000
#> SRR1652976     2  0.0376    0.96730 0.004 0.996
#> SRR1652977     1  0.0000    0.98552 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>            class entropy silhouette    p1    p2    p3
#> SRR1652895     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652896     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652897     1  0.5178      0.683 0.744 0.000 0.256
#> SRR1652898     1  0.4750      0.714 0.784 0.000 0.216
#> SRR1652899     1  0.6215      0.464 0.572 0.000 0.428
#> SRR1652900     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652901     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652902     1  0.6280      0.396 0.540 0.000 0.460
#> SRR1652903     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652904     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652905     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652906     1  0.6215      0.464 0.572 0.000 0.428
#> SRR1652907     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652908     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652909     3  0.6308     -0.309 0.492 0.000 0.508
#> SRR1652910     1  0.4002      0.760 0.840 0.000 0.160
#> SRR1652911     1  0.4555      0.732 0.800 0.000 0.200
#> SRR1652912     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652913     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652914     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652915     1  0.6215      0.463 0.572 0.000 0.428
#> SRR1652916     1  0.6280      0.396 0.540 0.000 0.460
#> SRR1652917     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652918     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652919     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652920     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652921     3  0.4504      0.713 0.000 0.196 0.804
#> SRR1652922     1  0.2711      0.802 0.912 0.000 0.088
#> SRR1652923     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652924     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652925     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652926     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652927     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652928     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652929     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652930     1  0.4842      0.712 0.776 0.000 0.224
#> SRR1652931     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652932     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652933     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652934     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652935     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652936     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652937     1  0.0237      0.837 0.996 0.000 0.004
#> SRR1652938     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652939     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652940     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652941     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652942     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652943     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652944     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652945     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652946     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652947     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652948     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652949     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652950     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652951     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652953     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652952     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652954     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652955     1  0.6215      0.464 0.572 0.000 0.428
#> SRR1652958     1  0.6280      0.396 0.540 0.000 0.460
#> SRR1652956     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652957     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652959     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652960     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652961     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652962     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652963     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652965     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652964     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652966     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652967     3  0.0424      0.950 0.008 0.000 0.992
#> SRR1652969     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652968     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652970     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652971     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652972     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652973     3  0.0000      0.959 0.000 0.000 1.000
#> SRR1652974     1  0.0000      0.838 1.000 0.000 0.000
#> SRR1652975     2  0.0000      1.000 0.000 1.000 0.000
#> SRR1652976     3  0.0592      0.945 0.000 0.012 0.988
#> SRR1652977     3  0.0000      0.959 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
#> SRR1652895     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652897     1  0.4103      0.683 0.744 0.000 0.256 0.000
#> SRR1652898     1  0.3764      0.714 0.784 0.000 0.216 0.000
#> SRR1652899     1  0.4925      0.464 0.572 0.000 0.428 0.000
#> SRR1652900     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652901     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652902     1  0.4977      0.396 0.540 0.000 0.460 0.000
#> SRR1652903     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652906     1  0.4925      0.464 0.572 0.000 0.428 0.000
#> SRR1652907     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652908     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652909     3  0.4999     -0.309 0.492 0.000 0.508 0.000
#> SRR1652910     1  0.3172      0.755 0.840 0.000 0.160 0.000
#> SRR1652911     1  0.3610      0.732 0.800 0.000 0.200 0.000
#> SRR1652912     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652913     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652914     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652915     1  0.4925      0.463 0.572 0.000 0.428 0.000
#> SRR1652916     1  0.4977      0.396 0.540 0.000 0.460 0.000
#> SRR1652917     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652918     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652919     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652920     4  0.0000      0.992 0.000 0.000 0.000 1.000
#> SRR1652921     3  0.3569      0.713 0.000 0.196 0.804 0.000
#> SRR1652922     1  0.2149      0.787 0.912 0.000 0.088 0.000
#> SRR1652923     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652924     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652925     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652926     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652927     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652928     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652929     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652930     1  0.3837      0.712 0.776 0.000 0.224 0.000
#> SRR1652931     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652932     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652933     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652934     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652935     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652936     4  0.0000      0.992 0.000 0.000 0.000 1.000
#> SRR1652937     1  0.0188      0.815 0.996 0.000 0.004 0.000
#> SRR1652938     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652939     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652940     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652941     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652942     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652943     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652944     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652945     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652946     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652947     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652948     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652949     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652950     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652951     4  0.0000      0.992 0.000 0.000 0.000 1.000
#> SRR1652953     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652952     4  0.0000      0.992 0.000 0.000 0.000 1.000
#> SRR1652954     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652955     1  0.4925      0.464 0.572 0.000 0.428 0.000
#> SRR1652958     1  0.4977      0.396 0.540 0.000 0.460 0.000
#> SRR1652956     4  0.1389      0.950 0.000 0.048 0.000 0.952
#> SRR1652957     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652959     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652960     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652961     4  0.0000      0.992 0.000 0.000 0.000 1.000
#> SRR1652962     4  0.0000      0.992 0.000 0.000 0.000 1.000
#> SRR1652963     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652965     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652964     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652966     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652967     3  0.0336      0.950 0.008 0.000 0.992 0.000
#> SRR1652969     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652968     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652970     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652971     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652972     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652973     3  0.0000      0.959 0.000 0.000 1.000 0.000
#> SRR1652974     1  0.0000      0.816 1.000 0.000 0.000 0.000
#> SRR1652975     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> SRR1652976     3  0.0469      0.945 0.000 0.012 0.988 0.000
#> SRR1652977     3  0.0000      0.959 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>            class entropy silhouette    p1    p2    p3    p4    p5
#> SRR1652895     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652896     3  0.1197     0.8723 0.000 0.000 0.952 0.048 0.000
#> SRR1652897     1  0.4054     0.7181 0.760 0.000 0.204 0.036 0.000
#> SRR1652898     1  0.3242     0.7396 0.784 0.000 0.000 0.216 0.000
#> SRR1652899     1  0.6071     0.5878 0.572 0.000 0.236 0.192 0.000
#> SRR1652900     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652901     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652902     1  0.6155     0.5667 0.556 0.000 0.252 0.192 0.000
#> SRR1652903     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652905     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652906     1  0.6071     0.5878 0.572 0.000 0.236 0.192 0.000
#> SRR1652907     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652908     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652909     1  0.6363     0.4713 0.504 0.000 0.304 0.192 0.000
#> SRR1652910     1  0.3317     0.7653 0.840 0.000 0.044 0.116 0.000
#> SRR1652911     1  0.3391     0.7412 0.800 0.000 0.188 0.012 0.000
#> SRR1652912     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652913     4  0.3424     0.6794 0.000 0.240 0.000 0.760 0.000
#> SRR1652914     3  0.0000     0.8875 0.000 0.000 1.000 0.000 0.000
#> SRR1652915     1  0.6038     0.6102 0.576 0.000 0.184 0.240 0.000
#> SRR1652916     1  0.6155     0.5667 0.556 0.000 0.252 0.192 0.000
#> SRR1652917     4  0.1197     0.7463 0.000 0.000 0.048 0.952 0.000
#> SRR1652918     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652919     3  0.0290     0.8875 0.000 0.000 0.992 0.008 0.000
#> SRR1652920     5  0.0000     0.9899 0.000 0.000 0.000 0.000 1.000
#> SRR1652921     4  0.1197     0.7463 0.000 0.000 0.048 0.952 0.000
#> SRR1652922     1  0.2127     0.7974 0.892 0.000 0.000 0.108 0.000
#> SRR1652923     3  0.1197     0.8723 0.000 0.000 0.952 0.048 0.000
#> SRR1652924     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652925     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652926     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652927     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652928     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652929     3  0.1410     0.8787 0.000 0.000 0.940 0.060 0.000
#> SRR1652930     1  0.3530     0.7288 0.784 0.000 0.204 0.012 0.000
#> SRR1652931     3  0.1197     0.8718 0.000 0.000 0.952 0.048 0.000
#> SRR1652932     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652933     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652934     3  0.3039     0.7637 0.000 0.000 0.808 0.192 0.000
#> SRR1652935     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652936     5  0.0000     0.9899 0.000 0.000 0.000 0.000 1.000
#> SRR1652937     1  0.0162     0.8272 0.996 0.000 0.004 0.000 0.000
#> SRR1652938     4  0.4210     0.0931 0.000 0.000 0.412 0.588 0.000
#> SRR1652939     4  0.2852     0.6175 0.000 0.000 0.172 0.828 0.000
#> SRR1652940     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652941     3  0.3039     0.7637 0.000 0.000 0.808 0.192 0.000
#> SRR1652942     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652943     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652944     3  0.0000     0.8875 0.000 0.000 1.000 0.000 0.000
#> SRR1652945     4  0.3424     0.6794 0.000 0.240 0.000 0.760 0.000
#> SRR1652946     4  0.3424     0.6794 0.000 0.240 0.000 0.760 0.000
#> SRR1652947     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652948     3  0.0880     0.8804 0.000 0.000 0.968 0.032 0.000
#> SRR1652949     1  0.1197     0.8145 0.952 0.000 0.000 0.048 0.000
#> SRR1652950     3  0.0290     0.8875 0.000 0.000 0.992 0.008 0.000
#> SRR1652951     5  0.0000     0.9899 0.000 0.000 0.000 0.000 1.000
#> SRR1652953     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652952     5  0.0000     0.9899 0.000 0.000 0.000 0.000 1.000
#> SRR1652954     4  0.1197     0.7463 0.000 0.000 0.048 0.952 0.000
#> SRR1652955     1  0.6066     0.6056 0.572 0.000 0.188 0.240 0.000
#> SRR1652958     1  0.6155     0.5667 0.556 0.000 0.252 0.192 0.000
#> SRR1652956     5  0.1197     0.9382 0.000 0.048 0.000 0.000 0.952
#> SRR1652957     4  0.3424     0.6794 0.000 0.240 0.000 0.760 0.000
#> SRR1652959     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652960     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652961     5  0.0000     0.9899 0.000 0.000 0.000 0.000 1.000
#> SRR1652962     5  0.0000     0.9899 0.000 0.000 0.000 0.000 1.000
#> SRR1652963     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652965     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652964     2  0.2074     0.8615 0.000 0.896 0.000 0.104 0.000
#> SRR1652966     1  0.1197     0.8145 0.952 0.000 0.000 0.048 0.000
#> SRR1652967     3  0.3318     0.7555 0.008 0.000 0.800 0.192 0.000
#> SRR1652969     2  0.3636     0.5878 0.000 0.728 0.000 0.272 0.000
#> SRR1652968     3  0.1197     0.8723 0.000 0.000 0.952 0.048 0.000
#> SRR1652970     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652971     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652972     3  0.3039     0.7637 0.000 0.000 0.808 0.192 0.000
#> SRR1652973     4  0.1270     0.7449 0.000 0.000 0.052 0.948 0.000
#> SRR1652974     1  0.0000     0.8277 1.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.0000     0.9762 0.000 1.000 0.000 0.000 0.000
#> SRR1652976     3  0.3143     0.6038 0.000 0.000 0.796 0.204 0.000
#> SRR1652977     3  0.0000     0.8875 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     1  0.2048      0.724 0.880 0.000 0.000 0.000 0.120 0.000
#> SRR1652896     3  0.1501      0.807 0.000 0.000 0.924 0.000 0.076 0.000
#> SRR1652897     1  0.3724      0.659 0.780 0.000 0.176 0.020 0.024 0.000
#> SRR1652898     1  0.5108      0.596 0.628 0.000 0.000 0.164 0.208 0.000
#> SRR1652899     1  0.5734      0.478 0.596 0.000 0.208 0.172 0.024 0.000
#> SRR1652900     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652901     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652902     1  0.5823      0.460 0.580 0.000 0.224 0.172 0.024 0.000
#> SRR1652903     1  0.0000      0.749 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652904     1  0.2048      0.724 0.880 0.000 0.000 0.000 0.120 0.000
#> SRR1652905     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652906     1  0.5734      0.478 0.596 0.000 0.208 0.172 0.024 0.000
#> SRR1652907     1  0.2048      0.724 0.880 0.000 0.000 0.000 0.120 0.000
#> SRR1652908     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652909     1  0.6054      0.339 0.528 0.000 0.276 0.172 0.024 0.000
#> SRR1652910     1  0.5262      0.637 0.680 0.000 0.044 0.116 0.160 0.000
#> SRR1652911     1  0.3062      0.680 0.816 0.000 0.160 0.000 0.024 0.000
#> SRR1652912     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652913     4  0.2941      0.652 0.000 0.220 0.000 0.780 0.000 0.000
#> SRR1652914     3  0.0000      0.836 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652915     1  0.5303      0.567 0.596 0.000 0.000 0.172 0.232 0.000
#> SRR1652916     1  0.5823      0.460 0.580 0.000 0.224 0.172 0.024 0.000
#> SRR1652917     4  0.1075      0.660 0.000 0.000 0.048 0.952 0.000 0.000
#> SRR1652918     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652919     3  0.0260      0.835 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR1652920     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1652921     4  0.1075      0.660 0.000 0.000 0.048 0.952 0.000 0.000
#> SRR1652922     1  0.4631      0.657 0.620 0.000 0.000 0.060 0.320 0.000
#> SRR1652923     3  0.1141      0.811 0.000 0.000 0.948 0.000 0.052 0.000
#> SRR1652924     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652925     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652926     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652927     1  0.2454      0.720 0.840 0.000 0.000 0.000 0.160 0.000
#> SRR1652928     1  0.1556      0.735 0.920 0.000 0.000 0.000 0.080 0.000
#> SRR1652929     3  0.1643      0.815 0.000 0.000 0.924 0.008 0.068 0.000
#> SRR1652930     1  0.3202      0.670 0.800 0.000 0.176 0.000 0.024 0.000
#> SRR1652931     3  0.1616      0.782 0.000 0.000 0.932 0.048 0.020 0.000
#> SRR1652932     1  0.0632      0.748 0.976 0.000 0.000 0.000 0.024 0.000
#> SRR1652933     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652934     3  0.2703      0.564 0.000 0.000 0.824 0.172 0.004 0.000
#> SRR1652935     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652936     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1652937     1  0.0000      0.749 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652938     4  0.4319     -0.326 0.000 0.000 0.400 0.576 0.024 0.000
#> SRR1652939     4  0.2805      0.429 0.000 0.000 0.160 0.828 0.012 0.000
#> SRR1652940     1  0.2003      0.725 0.884 0.000 0.000 0.000 0.116 0.000
#> SRR1652941     3  0.3168      0.533 0.000 0.000 0.804 0.172 0.024 0.000
#> SRR1652942     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652943     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652944     3  0.0000      0.836 0.000 0.000 1.000 0.000 0.000 0.000
#> SRR1652945     4  0.2941      0.652 0.000 0.220 0.000 0.780 0.000 0.000
#> SRR1652946     4  0.2941      0.652 0.000 0.220 0.000 0.780 0.000 0.000
#> SRR1652947     1  0.2048      0.724 0.880 0.000 0.000 0.000 0.120 0.000
#> SRR1652948     3  0.0790      0.825 0.000 0.000 0.968 0.000 0.032 0.000
#> SRR1652949     1  0.1204      0.748 0.944 0.000 0.000 0.000 0.056 0.000
#> SRR1652950     3  0.0260      0.835 0.000 0.000 0.992 0.008 0.000 0.000
#> SRR1652951     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1652953     1  0.2048      0.724 0.880 0.000 0.000 0.000 0.120 0.000
#> SRR1652952     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1652954     4  0.1075      0.660 0.000 0.000 0.048 0.952 0.000 0.000
#> SRR1652955     1  0.5303      0.567 0.596 0.000 0.000 0.172 0.232 0.000
#> SRR1652958     1  0.5823      0.460 0.580 0.000 0.224 0.172 0.024 0.000
#> SRR1652956     6  0.1075      0.929 0.000 0.048 0.000 0.000 0.000 0.952
#> SRR1652957     4  0.2941      0.652 0.000 0.220 0.000 0.780 0.000 0.000
#> SRR1652959     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652960     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652961     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1652962     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> SRR1652963     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652965     1  0.2048      0.724 0.880 0.000 0.000 0.000 0.120 0.000
#> SRR1652964     2  0.1863      0.863 0.000 0.896 0.000 0.104 0.000 0.000
#> SRR1652966     1  0.3126      0.703 0.752 0.000 0.000 0.000 0.248 0.000
#> SRR1652967     5  0.5774      0.000 0.008 0.000 0.320 0.156 0.516 0.000
#> SRR1652969     2  0.3288      0.584 0.000 0.724 0.000 0.276 0.000 0.000
#> SRR1652968     3  0.1075      0.810 0.000 0.000 0.952 0.000 0.048 0.000
#> SRR1652970     1  0.0000      0.749 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652971     1  0.3445      0.675 0.796 0.000 0.000 0.048 0.156 0.000
#> SRR1652972     3  0.3168      0.533 0.000 0.000 0.804 0.172 0.024 0.000
#> SRR1652973     4  0.1141      0.656 0.000 0.000 0.052 0.948 0.000 0.000
#> SRR1652974     1  0.0000      0.749 1.000 0.000 0.000 0.000 0.000 0.000
#> SRR1652975     2  0.0000      0.976 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652976     3  0.2597      0.514 0.000 0.000 0.824 0.176 0.000 0.000
#> SRR1652977     3  0.0000      0.836 0.000 0.000 1.000 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 9409 rows and 83 columns.
#>   Top rows (941, 1882, 2822, 3763, 4704) 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.582           0.711       0.900         0.2283 0.824   0.824
#> 3 3 0.402           0.397       0.679         1.3722 0.520   0.465
#> 4 4 0.357           0.639       0.749         0.1520 0.713   0.473
#> 5 5 0.607           0.793       0.842         0.0368 0.656   0.344
#> 6 6 0.662           0.685       0.797         0.1700 0.785   0.471

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
#> SRR1652895     2  0.0000     0.8780 0.000 1.000
#> SRR1652896     1  0.9866     0.3883 0.568 0.432
#> SRR1652897     2  0.0000     0.8780 0.000 1.000
#> SRR1652898     2  0.9044     0.3748 0.320 0.680
#> SRR1652899     2  0.0000     0.8780 0.000 1.000
#> SRR1652900     2  0.0000     0.8780 0.000 1.000
#> SRR1652901     2  0.0000     0.8780 0.000 1.000
#> SRR1652902     2  0.0000     0.8780 0.000 1.000
#> SRR1652903     2  0.0000     0.8780 0.000 1.000
#> SRR1652904     2  0.0000     0.8780 0.000 1.000
#> SRR1652905     2  0.6973     0.6524 0.188 0.812
#> SRR1652906     2  0.5737     0.7366 0.136 0.864
#> SRR1652907     2  0.9087     0.3634 0.324 0.676
#> SRR1652908     2  0.0000     0.8780 0.000 1.000
#> SRR1652909     2  0.0000     0.8780 0.000 1.000
#> SRR1652910     2  0.5842     0.7308 0.140 0.860
#> SRR1652911     2  0.0000     0.8780 0.000 1.000
#> SRR1652912     2  0.0000     0.8780 0.000 1.000
#> SRR1652913     2  0.0000     0.8780 0.000 1.000
#> SRR1652914     2  0.7950     0.5605 0.240 0.760
#> SRR1652915     2  0.9491     0.2358 0.368 0.632
#> SRR1652916     2  0.0000     0.8780 0.000 1.000
#> SRR1652917     2  0.0000     0.8780 0.000 1.000
#> SRR1652918     2  0.0000     0.8780 0.000 1.000
#> SRR1652919     2  0.9775     0.0505 0.412 0.588
#> SRR1652920     2  0.0000     0.8780 0.000 1.000
#> SRR1652921     2  0.0938     0.8686 0.012 0.988
#> SRR1652922     1  1.0000     0.2214 0.504 0.496
#> SRR1652923     2  0.9580     0.1975 0.380 0.620
#> SRR1652924     2  0.0000     0.8780 0.000 1.000
#> SRR1652925     2  0.0000     0.8780 0.000 1.000
#> SRR1652926     2  0.0000     0.8780 0.000 1.000
#> SRR1652927     2  0.2778     0.8315 0.048 0.952
#> SRR1652928     2  0.0000     0.8780 0.000 1.000
#> SRR1652929     2  0.9686     0.1332 0.396 0.604
#> SRR1652930     2  0.0000     0.8780 0.000 1.000
#> SRR1652931     2  0.9988    -0.2353 0.480 0.520
#> SRR1652932     2  0.0000     0.8780 0.000 1.000
#> SRR1652933     2  0.0000     0.8780 0.000 1.000
#> SRR1652934     2  0.0000     0.8780 0.000 1.000
#> SRR1652935     2  0.0000     0.8780 0.000 1.000
#> SRR1652936     2  0.0000     0.8780 0.000 1.000
#> SRR1652937     2  0.0000     0.8780 0.000 1.000
#> SRR1652938     1  0.9044     0.5520 0.680 0.320
#> SRR1652939     1  0.9944     0.3765 0.544 0.456
#> SRR1652940     2  0.0000     0.8780 0.000 1.000
#> SRR1652941     2  0.0000     0.8780 0.000 1.000
#> SRR1652942     2  0.0000     0.8780 0.000 1.000
#> SRR1652943     2  0.0000     0.8780 0.000 1.000
#> SRR1652944     2  0.7883     0.5652 0.236 0.764
#> SRR1652945     2  0.0000     0.8780 0.000 1.000
#> SRR1652946     2  0.0000     0.8780 0.000 1.000
#> SRR1652947     1  0.9998     0.2654 0.508 0.492
#> SRR1652948     2  0.9129     0.3539 0.328 0.672
#> SRR1652949     2  0.9983    -0.2240 0.476 0.524
#> SRR1652950     2  0.1414     0.8619 0.020 0.980
#> SRR1652951     2  0.0000     0.8780 0.000 1.000
#> SRR1652953     2  0.0000     0.8780 0.000 1.000
#> SRR1652952     2  0.0000     0.8780 0.000 1.000
#> SRR1652954     2  0.0000     0.8780 0.000 1.000
#> SRR1652955     2  0.9460     0.2517 0.364 0.636
#> SRR1652958     2  0.0000     0.8780 0.000 1.000
#> SRR1652956     2  0.0000     0.8780 0.000 1.000
#> SRR1652957     2  0.0000     0.8780 0.000 1.000
#> SRR1652959     2  0.1414     0.8619 0.020 0.980
#> SRR1652960     2  0.0000     0.8780 0.000 1.000
#> SRR1652961     2  0.0000     0.8780 0.000 1.000
#> SRR1652962     2  0.0000     0.8780 0.000 1.000
#> SRR1652963     2  0.0000     0.8780 0.000 1.000
#> SRR1652965     1  0.0000     0.6347 1.000 0.000
#> SRR1652964     2  0.1633     0.8584 0.024 0.976
#> SRR1652966     2  0.9000     0.3844 0.316 0.684
#> SRR1652967     1  0.0000     0.6347 1.000 0.000
#> SRR1652969     2  0.0000     0.8780 0.000 1.000
#> SRR1652968     2  0.9522     0.2263 0.372 0.628
#> SRR1652970     2  0.0000     0.8780 0.000 1.000
#> SRR1652971     1  0.0000     0.6347 1.000 0.000
#> SRR1652972     2  0.0000     0.8780 0.000 1.000
#> SRR1652973     2  0.0000     0.8780 0.000 1.000
#> SRR1652974     2  0.0000     0.8780 0.000 1.000
#> SRR1652975     2  0.0000     0.8780 0.000 1.000
#> SRR1652976     2  0.6712     0.6686 0.176 0.824
#> SRR1652977     2  0.9460     0.2526 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
#> SRR1652895     1  0.6769     0.5199 0.592 0.016 0.392
#> SRR1652896     1  0.4796     0.3197 0.780 0.000 0.220
#> SRR1652897     1  0.7175     0.5126 0.592 0.032 0.376
#> SRR1652898     1  0.2711     0.4633 0.912 0.000 0.088
#> SRR1652899     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652900     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652901     2  0.9978    -0.0390 0.328 0.364 0.308
#> SRR1652902     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652903     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652904     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652905     1  0.8296    -0.0961 0.508 0.412 0.080
#> SRR1652906     1  0.0000     0.5013 1.000 0.000 0.000
#> SRR1652907     1  0.3267     0.4792 0.884 0.000 0.116
#> SRR1652908     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652909     1  0.6648     0.5207 0.620 0.016 0.364
#> SRR1652910     1  0.0237     0.5024 0.996 0.000 0.004
#> SRR1652911     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652912     2  0.0592     0.6056 0.012 0.988 0.000
#> SRR1652913     2  0.9999    -0.0718 0.332 0.340 0.328
#> SRR1652914     1  0.2537     0.4642 0.920 0.000 0.080
#> SRR1652915     1  0.2878     0.4539 0.904 0.000 0.096
#> SRR1652916     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652917     1  0.7756     0.4741 0.564 0.056 0.380
#> SRR1652918     3  0.9956    -0.1614 0.288 0.352 0.360
#> SRR1652919     1  0.4235     0.3823 0.824 0.000 0.176
#> SRR1652920     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652921     1  0.8848     0.3728 0.504 0.124 0.372
#> SRR1652922     1  0.5216     0.2306 0.740 0.000 0.260
#> SRR1652923     1  0.2711     0.4587 0.912 0.000 0.088
#> SRR1652924     2  0.9888     0.0749 0.272 0.400 0.328
#> SRR1652925     2  0.9873     0.0814 0.268 0.404 0.328
#> SRR1652926     2  0.9888     0.0749 0.272 0.400 0.328
#> SRR1652927     1  0.1774     0.5093 0.960 0.016 0.024
#> SRR1652928     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652929     1  0.0892     0.4954 0.980 0.000 0.020
#> SRR1652930     1  0.7083     0.5137 0.592 0.028 0.380
#> SRR1652931     1  0.4842     0.3181 0.776 0.000 0.224
#> SRR1652932     1  0.6737     0.5221 0.600 0.016 0.384
#> SRR1652933     2  0.7382     0.3846 0.184 0.700 0.116
#> SRR1652934     1  0.7295     0.5002 0.584 0.036 0.380
#> SRR1652935     2  0.3619     0.5125 0.136 0.864 0.000
#> SRR1652936     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652937     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652938     1  0.4249     0.4347 0.864 0.028 0.108
#> SRR1652939     1  0.4206     0.4444 0.872 0.040 0.088
#> SRR1652940     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652941     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652942     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652943     2  0.9888     0.0749 0.272 0.400 0.328
#> SRR1652944     1  0.2625     0.4624 0.916 0.000 0.084
#> SRR1652945     2  0.9956     0.0144 0.296 0.376 0.328
#> SRR1652946     2  0.9999    -0.0718 0.332 0.340 0.328
#> SRR1652947     1  0.4235     0.3774 0.824 0.000 0.176
#> SRR1652948     1  0.4002     0.3990 0.840 0.000 0.160
#> SRR1652949     1  0.3038     0.4456 0.896 0.000 0.104
#> SRR1652950     1  0.1620     0.5083 0.964 0.012 0.024
#> SRR1652951     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652953     1  0.6737     0.5221 0.600 0.016 0.384
#> SRR1652952     2  0.0000     0.6054 0.000 1.000 0.000
#> SRR1652954     1  0.8597     0.3985 0.516 0.104 0.380
#> SRR1652955     1  0.3192     0.4441 0.888 0.000 0.112
#> SRR1652958     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652956     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652957     3  0.9914    -0.1361 0.348 0.272 0.380
#> SRR1652959     1  0.9964    -0.0440 0.372 0.300 0.328
#> SRR1652960     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652961     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652962     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652963     2  0.0237     0.6096 0.004 0.996 0.000
#> SRR1652965     3  0.6062     0.2773 0.384 0.000 0.616
#> SRR1652964     1  0.8160     0.1606 0.608 0.288 0.104
#> SRR1652966     1  0.2878     0.4682 0.904 0.000 0.096
#> SRR1652967     3  0.6045     0.2804 0.380 0.000 0.620
#> SRR1652969     3  0.9941    -0.1203 0.340 0.284 0.376
#> SRR1652968     1  0.2711     0.4587 0.912 0.000 0.088
#> SRR1652970     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652971     3  0.6045     0.2804 0.380 0.000 0.620
#> SRR1652972     1  0.6422     0.5232 0.660 0.016 0.324
#> SRR1652973     1  0.7582     0.4859 0.572 0.048 0.380
#> SRR1652974     1  0.6721     0.5227 0.604 0.016 0.380
#> SRR1652975     2  0.9920     0.0112 0.272 0.368 0.360
#> SRR1652976     1  0.5212     0.3867 0.828 0.064 0.108
#> SRR1652977     1  0.2711     0.4587 0.912 0.000 0.088

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1  0.0000     0.7352 1.000 0.000 0.000 0.000
#> SRR1652896     3  0.3447     0.7879 0.128 0.000 0.852 0.020
#> SRR1652897     1  0.4060     0.7650 0.828 0.012 0.140 0.020
#> SRR1652898     3  0.4040     0.7953 0.248 0.000 0.752 0.000
#> SRR1652899     1  0.2973     0.7661 0.856 0.000 0.144 0.000
#> SRR1652900     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652901     2  0.8331     0.4716 0.264 0.524 0.140 0.072
#> SRR1652902     1  0.3024     0.7647 0.852 0.000 0.148 0.000
#> SRR1652903     1  0.0188     0.7372 0.996 0.000 0.004 0.000
#> SRR1652904     1  0.0000     0.7352 1.000 0.000 0.000 0.000
#> SRR1652905     2  0.7805     0.4575 0.136 0.584 0.224 0.056
#> SRR1652906     3  0.4454     0.7403 0.308 0.000 0.692 0.000
#> SRR1652907     1  0.5345     0.2116 0.560 0.000 0.428 0.012
#> SRR1652908     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652909     1  0.4560     0.5688 0.700 0.000 0.296 0.004
#> SRR1652910     3  0.4585     0.6995 0.332 0.000 0.668 0.000
#> SRR1652911     1  0.0000     0.7352 1.000 0.000 0.000 0.000
#> SRR1652912     2  0.2076     0.6668 0.056 0.932 0.004 0.008
#> SRR1652913     1  0.9138     0.2838 0.472 0.200 0.144 0.184
#> SRR1652914     3  0.2011     0.6987 0.080 0.000 0.920 0.000
#> SRR1652915     3  0.3975     0.7995 0.240 0.000 0.760 0.000
#> SRR1652916     1  0.2868     0.7681 0.864 0.000 0.136 0.000
#> SRR1652917     1  0.3658     0.7622 0.836 0.000 0.144 0.020
#> SRR1652918     2  0.8531     0.3415 0.336 0.464 0.108 0.092
#> SRR1652919     3  0.4020     0.8049 0.156 0.016 0.820 0.008
#> SRR1652920     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652921     1  0.6665     0.6862 0.700 0.072 0.148 0.080
#> SRR1652922     3  0.5862     0.6811 0.148 0.000 0.704 0.148
#> SRR1652923     3  0.1940     0.6936 0.076 0.000 0.924 0.000
#> SRR1652924     2  0.8938     0.5800 0.176 0.500 0.140 0.184
#> SRR1652925     2  0.8923     0.5687 0.200 0.500 0.140 0.160
#> SRR1652926     2  0.8938     0.5800 0.176 0.500 0.140 0.184
#> SRR1652927     1  0.4543     0.5117 0.676 0.000 0.324 0.000
#> SRR1652928     1  0.0000     0.7352 1.000 0.000 0.000 0.000
#> SRR1652929     3  0.2973     0.7852 0.144 0.000 0.856 0.000
#> SRR1652930     1  0.2053     0.7624 0.924 0.004 0.072 0.000
#> SRR1652931     3  0.4100     0.8014 0.152 0.016 0.820 0.012
#> SRR1652932     1  0.0000     0.7352 1.000 0.000 0.000 0.000
#> SRR1652933     2  0.6869     0.6405 0.140 0.688 0.100 0.072
#> SRR1652934     1  0.3647     0.7598 0.832 0.000 0.152 0.016
#> SRR1652935     2  0.5274     0.6454 0.092 0.772 0.124 0.012
#> SRR1652936     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652937     1  0.2921     0.7674 0.860 0.000 0.140 0.000
#> SRR1652938     1  0.7075     0.3001 0.516 0.068 0.392 0.024
#> SRR1652939     1  0.6878     0.3411 0.528 0.068 0.388 0.016
#> SRR1652940     1  0.0000     0.7352 1.000 0.000 0.000 0.000
#> SRR1652941     1  0.3577     0.7585 0.832 0.000 0.156 0.012
#> SRR1652942     2  0.1909     0.6664 0.048 0.940 0.004 0.008
#> SRR1652943     2  0.8938     0.5800 0.176 0.500 0.140 0.184
#> SRR1652944     3  0.3528     0.8165 0.192 0.000 0.808 0.000
#> SRR1652945     2  0.9164     0.5297 0.220 0.464 0.140 0.176
#> SRR1652946     2  0.9631     0.2584 0.312 0.344 0.160 0.184
#> SRR1652947     1  0.7785     0.0625 0.428 0.000 0.284 0.288
#> SRR1652948     3  0.3577     0.8093 0.156 0.012 0.832 0.000
#> SRR1652949     3  0.6015     0.7079 0.268 0.000 0.652 0.080
#> SRR1652950     3  0.4500     0.7199 0.316 0.000 0.684 0.000
#> SRR1652951     2  0.1302     0.6619 0.044 0.956 0.000 0.000
#> SRR1652953     1  0.2281     0.7607 0.904 0.000 0.096 0.000
#> SRR1652952     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652954     1  0.4339     0.7565 0.816 0.020 0.144 0.020
#> SRR1652955     3  0.3942     0.8021 0.236 0.000 0.764 0.000
#> SRR1652958     1  0.3024     0.7647 0.852 0.000 0.148 0.000
#> SRR1652956     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652957     1  0.6506     0.6870 0.712 0.068 0.140 0.080
#> SRR1652959     2  0.9074     0.0137 0.336 0.384 0.200 0.080
#> SRR1652960     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652961     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652962     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652963     2  0.1389     0.6658 0.048 0.952 0.000 0.000
#> SRR1652965     4  0.4501     0.9065 0.024 0.000 0.212 0.764
#> SRR1652964     2  0.9099    -0.0832 0.348 0.352 0.228 0.072
#> SRR1652966     3  0.4382     0.7428 0.296 0.000 0.704 0.000
#> SRR1652967     4  0.3528     0.9528 0.000 0.000 0.192 0.808
#> SRR1652969     1  0.8801     0.0982 0.420 0.348 0.152 0.080
#> SRR1652968     3  0.2011     0.6987 0.080 0.000 0.920 0.000
#> SRR1652970     1  0.0592     0.7433 0.984 0.000 0.016 0.000
#> SRR1652971     4  0.3444     0.9527 0.000 0.000 0.184 0.816
#> SRR1652972     3  0.4981     0.3507 0.464 0.000 0.536 0.000
#> SRR1652973     1  0.5217     0.7326 0.768 0.048 0.164 0.020
#> SRR1652974     1  0.0000     0.7352 1.000 0.000 0.000 0.000
#> SRR1652975     2  0.8254     0.4434 0.296 0.516 0.108 0.080
#> SRR1652976     3  0.6589     0.6750 0.176 0.148 0.664 0.012
#> SRR1652977     3  0.1940     0.6936 0.076 0.000 0.924 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
#> SRR1652895     1  0.1043      0.958 0.960 0.000 0.040 0.000 0.000
#> SRR1652896     3  0.1012      0.759 0.000 0.012 0.968 0.000 0.020
#> SRR1652897     3  0.4402      0.671 0.352 0.000 0.636 0.000 0.012
#> SRR1652898     3  0.0162      0.763 0.004 0.000 0.996 0.000 0.000
#> SRR1652899     3  0.4249      0.726 0.296 0.000 0.688 0.000 0.016
#> SRR1652900     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652901     3  0.5072      0.669 0.016 0.260 0.688 0.024 0.012
#> SRR1652902     3  0.4227      0.728 0.292 0.000 0.692 0.000 0.016
#> SRR1652903     1  0.1043      0.958 0.960 0.000 0.040 0.000 0.000
#> SRR1652904     1  0.1043      0.958 0.960 0.000 0.040 0.000 0.000
#> SRR1652905     3  0.5098      0.420 0.000 0.404 0.564 0.020 0.012
#> SRR1652906     3  0.0671      0.767 0.016 0.000 0.980 0.000 0.004
#> SRR1652907     3  0.3756      0.747 0.248 0.000 0.744 0.000 0.008
#> SRR1652908     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652909     3  0.3861      0.736 0.284 0.000 0.712 0.000 0.004
#> SRR1652910     3  0.0865      0.769 0.024 0.000 0.972 0.000 0.004
#> SRR1652911     1  0.1043      0.958 0.960 0.000 0.040 0.000 0.000
#> SRR1652912     2  0.0290      0.924 0.000 0.992 0.008 0.000 0.000
#> SRR1652913     4  0.2304      0.980 0.004 0.020 0.068 0.908 0.000
#> SRR1652914     3  0.2726      0.701 0.052 0.000 0.884 0.064 0.000
#> SRR1652915     3  0.0000      0.765 0.000 0.000 1.000 0.000 0.000
#> SRR1652916     3  0.4249      0.726 0.296 0.000 0.688 0.000 0.016
#> SRR1652917     3  0.4977      0.738 0.256 0.000 0.688 0.040 0.016
#> SRR1652918     3  0.5696      0.489 0.032 0.016 0.572 0.368 0.012
#> SRR1652919     3  0.0566      0.766 0.000 0.000 0.984 0.012 0.004
#> SRR1652920     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652921     3  0.5079      0.739 0.236 0.000 0.692 0.060 0.012
#> SRR1652922     3  0.3318      0.628 0.000 0.000 0.808 0.012 0.180
#> SRR1652923     3  0.2726      0.701 0.052 0.000 0.884 0.064 0.000
#> SRR1652924     4  0.2172      0.988 0.004 0.020 0.060 0.916 0.000
#> SRR1652925     4  0.2569      0.973 0.004 0.032 0.068 0.896 0.000
#> SRR1652926     4  0.2484      0.977 0.004 0.028 0.068 0.900 0.000
#> SRR1652927     3  0.4194      0.739 0.276 0.000 0.708 0.004 0.012
#> SRR1652928     1  0.1043      0.958 0.960 0.000 0.040 0.000 0.000
#> SRR1652929     3  0.1725      0.743 0.020 0.000 0.936 0.044 0.000
#> SRR1652930     3  0.4300      0.445 0.476 0.000 0.524 0.000 0.000
#> SRR1652931     3  0.1444      0.754 0.000 0.000 0.948 0.012 0.040
#> SRR1652932     1  0.1043      0.958 0.960 0.000 0.040 0.000 0.000
#> SRR1652933     2  0.3741      0.490 0.000 0.732 0.264 0.004 0.000
#> SRR1652934     3  0.4905      0.739 0.256 0.000 0.692 0.036 0.016
#> SRR1652935     2  0.3519      0.580 0.000 0.776 0.216 0.008 0.000
#> SRR1652936     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652937     3  0.4309      0.717 0.308 0.000 0.676 0.000 0.016
#> SRR1652938     3  0.5006      0.751 0.212 0.000 0.712 0.060 0.016
#> SRR1652939     3  0.5036      0.751 0.208 0.000 0.712 0.064 0.016
#> SRR1652940     1  0.1043      0.958 0.960 0.000 0.040 0.000 0.000
#> SRR1652941     3  0.4743      0.736 0.268 0.000 0.692 0.024 0.016
#> SRR1652942     2  0.0290      0.925 0.000 0.992 0.008 0.000 0.000
#> SRR1652943     4  0.2172      0.988 0.004 0.020 0.060 0.916 0.000
#> SRR1652944     3  0.0609      0.764 0.020 0.000 0.980 0.000 0.000
#> SRR1652945     4  0.2172      0.988 0.004 0.020 0.060 0.916 0.000
#> SRR1652946     4  0.2172      0.988 0.004 0.020 0.060 0.916 0.000
#> SRR1652947     3  0.6106      0.573 0.228 0.000 0.568 0.000 0.204
#> SRR1652948     3  0.0162      0.763 0.004 0.000 0.996 0.000 0.000
#> SRR1652949     3  0.3544      0.761 0.200 0.000 0.788 0.008 0.004
#> SRR1652950     3  0.1331      0.772 0.040 0.000 0.952 0.000 0.008
#> SRR1652951     2  0.0404      0.921 0.000 0.988 0.000 0.012 0.000
#> SRR1652953     3  0.4227      0.729 0.292 0.000 0.692 0.000 0.016
#> SRR1652952     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652954     3  0.4950      0.738 0.256 0.000 0.688 0.044 0.012
#> SRR1652955     3  0.0162      0.763 0.004 0.000 0.996 0.000 0.000
#> SRR1652958     3  0.4227      0.728 0.292 0.000 0.692 0.000 0.016
#> SRR1652956     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652957     3  0.5185      0.692 0.052 0.004 0.684 0.248 0.012
#> SRR1652959     3  0.5352      0.680 0.024 0.236 0.692 0.032 0.016
#> SRR1652960     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652961     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652962     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652963     2  0.0000      0.932 0.000 1.000 0.000 0.000 0.000
#> SRR1652965     5  0.2389      0.769 0.004 0.000 0.116 0.000 0.880
#> SRR1652964     3  0.5516      0.706 0.036 0.192 0.708 0.052 0.012
#> SRR1652966     3  0.0290      0.768 0.008 0.000 0.992 0.000 0.000
#> SRR1652967     5  0.0510      0.887 0.000 0.000 0.016 0.000 0.984
#> SRR1652969     3  0.5852      0.704 0.052 0.184 0.692 0.060 0.012
#> SRR1652968     3  0.2726      0.701 0.052 0.000 0.884 0.064 0.000
#> SRR1652970     1  0.3266      0.673 0.796 0.000 0.200 0.000 0.004
#> SRR1652971     5  0.0510      0.887 0.000 0.000 0.016 0.000 0.984
#> SRR1652972     3  0.1597      0.773 0.048 0.000 0.940 0.000 0.012
#> SRR1652973     3  0.4905      0.739 0.256 0.000 0.692 0.036 0.016
#> SRR1652974     1  0.1043      0.958 0.960 0.000 0.040 0.000 0.000
#> SRR1652975     3  0.5610      0.687 0.028 0.216 0.688 0.056 0.012
#> SRR1652976     3  0.1173      0.767 0.000 0.020 0.964 0.012 0.004
#> SRR1652977     3  0.2726      0.701 0.052 0.000 0.884 0.064 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
#> SRR1652895     1  0.0146     0.7301 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652896     3  0.3770     0.7790 0.000 0.000 0.728 0.244 0.028 0.000
#> SRR1652897     4  0.4666     0.1962 0.480 0.004 0.004 0.488 0.000 0.024
#> SRR1652898     3  0.3636     0.7854 0.004 0.000 0.676 0.320 0.000 0.000
#> SRR1652899     4  0.5124     0.5202 0.288 0.000 0.084 0.616 0.000 0.012
#> SRR1652900     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652901     4  0.4187     0.4927 0.000 0.356 0.016 0.624 0.000 0.004
#> SRR1652902     4  0.5227     0.5390 0.256 0.000 0.108 0.624 0.000 0.012
#> SRR1652903     1  0.0146     0.7301 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652904     1  0.0146     0.7301 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652905     2  0.6673     0.0333 0.012 0.500 0.220 0.236 0.028 0.004
#> SRR1652906     3  0.4191     0.6667 0.004 0.000 0.596 0.388 0.000 0.012
#> SRR1652907     3  0.6382     0.2814 0.312 0.000 0.384 0.292 0.000 0.012
#> SRR1652908     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652909     4  0.5960     0.3184 0.268 0.000 0.200 0.520 0.000 0.012
#> SRR1652910     3  0.3988     0.7595 0.004 0.000 0.660 0.324 0.000 0.012
#> SRR1652911     1  0.0146     0.7301 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652912     2  0.0291     0.9233 0.000 0.992 0.000 0.004 0.000 0.004
#> SRR1652913     6  0.1588     0.9822 0.000 0.004 0.000 0.072 0.000 0.924
#> SRR1652914     3  0.2630     0.5749 0.000 0.000 0.872 0.064 0.000 0.064
#> SRR1652915     3  0.3528     0.7846 0.004 0.000 0.700 0.296 0.000 0.000
#> SRR1652916     4  0.4909     0.4978 0.320 0.000 0.056 0.612 0.000 0.012
#> SRR1652917     4  0.1194     0.7131 0.032 0.004 0.000 0.956 0.000 0.008
#> SRR1652918     4  0.4697     0.2964 0.008 0.012 0.012 0.536 0.000 0.432
#> SRR1652919     3  0.3330     0.7890 0.000 0.000 0.716 0.284 0.000 0.000
#> SRR1652920     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652921     4  0.1686     0.7070 0.016 0.004 0.016 0.940 0.000 0.024
#> SRR1652922     3  0.5627     0.6632 0.004 0.000 0.544 0.288 0.164 0.000
#> SRR1652923     3  0.2630     0.5749 0.000 0.000 0.872 0.064 0.000 0.064
#> SRR1652924     6  0.1701     0.9803 0.000 0.008 0.000 0.072 0.000 0.920
#> SRR1652925     6  0.2094     0.9664 0.000 0.020 0.000 0.080 0.000 0.900
#> SRR1652926     6  0.2509     0.9388 0.000 0.036 0.000 0.088 0.000 0.876
#> SRR1652927     4  0.5791     0.3997 0.288 0.000 0.160 0.540 0.000 0.012
#> SRR1652928     1  0.0146     0.7301 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652929     3  0.3766     0.7425 0.000 0.000 0.748 0.212 0.000 0.040
#> SRR1652930     1  0.4592    -0.0314 0.564 0.004 0.004 0.404 0.000 0.024
#> SRR1652931     3  0.3710     0.7845 0.000 0.000 0.696 0.292 0.012 0.000
#> SRR1652932     1  0.0146     0.7301 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652933     2  0.2531     0.7599 0.000 0.856 0.000 0.132 0.000 0.012
#> SRR1652934     4  0.1124     0.7128 0.036 0.000 0.000 0.956 0.000 0.008
#> SRR1652935     2  0.1956     0.8228 0.000 0.908 0.004 0.080 0.000 0.008
#> SRR1652936     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652937     4  0.5060     0.2958 0.440 0.000 0.048 0.500 0.000 0.012
#> SRR1652938     4  0.2245     0.6914 0.008 0.004 0.052 0.908 0.000 0.028
#> SRR1652939     4  0.2000     0.6941 0.004 0.004 0.044 0.920 0.000 0.028
#> SRR1652940     1  0.0146     0.7301 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652941     4  0.1297     0.7105 0.040 0.000 0.012 0.948 0.000 0.000
#> SRR1652942     2  0.0260     0.9226 0.000 0.992 0.000 0.000 0.000 0.008
#> SRR1652943     6  0.1588     0.9822 0.000 0.004 0.000 0.072 0.000 0.924
#> SRR1652944     3  0.3398     0.7820 0.000 0.000 0.740 0.252 0.000 0.008
#> SRR1652945     6  0.1588     0.9822 0.000 0.004 0.000 0.072 0.000 0.924
#> SRR1652946     6  0.1588     0.9822 0.000 0.004 0.000 0.072 0.000 0.924
#> SRR1652947     1  0.7631    -0.1889 0.304 0.000 0.244 0.276 0.176 0.000
#> SRR1652948     3  0.3351     0.7912 0.000 0.000 0.712 0.288 0.000 0.000
#> SRR1652949     3  0.6090     0.4082 0.252 0.000 0.444 0.300 0.000 0.004
#> SRR1652950     3  0.3565     0.7724 0.000 0.000 0.692 0.304 0.000 0.004
#> SRR1652951     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652953     1  0.6279    -0.1947 0.408 0.000 0.232 0.348 0.000 0.012
#> SRR1652952     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652954     4  0.1338     0.7132 0.032 0.004 0.004 0.952 0.000 0.008
#> SRR1652955     3  0.3508     0.7908 0.004 0.000 0.704 0.292 0.000 0.000
#> SRR1652958     4  0.3038     0.6923 0.072 0.000 0.060 0.856 0.000 0.012
#> SRR1652956     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652957     4  0.3698     0.6346 0.008 0.008 0.016 0.772 0.000 0.196
#> SRR1652959     4  0.4585     0.5053 0.004 0.336 0.028 0.624 0.000 0.008
#> SRR1652960     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652961     2  0.0146     0.9255 0.000 0.996 0.000 0.000 0.000 0.004
#> SRR1652962     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652963     2  0.0000     0.9279 0.000 1.000 0.000 0.000 0.000 0.000
#> SRR1652965     5  0.3030     0.7801 0.004 0.000 0.092 0.056 0.848 0.000
#> SRR1652964     4  0.3075     0.6685 0.004 0.108 0.032 0.848 0.000 0.008
#> SRR1652966     3  0.3894     0.7808 0.004 0.000 0.664 0.324 0.000 0.008
#> SRR1652967     5  0.0000     0.8901 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652969     4  0.1729     0.7070 0.012 0.016 0.016 0.940 0.000 0.016
#> SRR1652968     3  0.2630     0.5749 0.000 0.000 0.872 0.064 0.000 0.064
#> SRR1652970     1  0.3589     0.4861 0.752 0.000 0.008 0.228 0.000 0.012
#> SRR1652971     5  0.0000     0.8901 0.000 0.000 0.000 0.000 1.000 0.000
#> SRR1652972     3  0.4297     0.5131 0.012 0.000 0.532 0.452 0.000 0.004
#> SRR1652973     4  0.1082     0.7132 0.040 0.000 0.000 0.956 0.000 0.004
#> SRR1652974     1  0.0146     0.7301 0.996 0.000 0.000 0.004 0.000 0.000
#> SRR1652975     4  0.4543     0.5166 0.008 0.332 0.016 0.632 0.000 0.012
#> SRR1652976     3  0.3508     0.7815 0.004 0.000 0.704 0.292 0.000 0.000
#> SRR1652977     3  0.2630     0.5749 0.000 0.000 0.872 0.064 0.000 0.064

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

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

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.739           0.869       0.943         0.5011 0.494   0.494
#> 3 3 0.463           0.658       0.817         0.1980 0.918   0.842
#> 4 4 0.417           0.444       0.737         0.1242 0.847   0.699
#> 5 5 0.420           0.397       0.668         0.0721 0.857   0.668
#> 6 6 0.451           0.366       0.637         0.0464 0.940   0.817

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
#> SRR1652895     1  0.0000      0.943 1.000 0.000
#> SRR1652896     2  0.0000      0.930 0.000 1.000
#> SRR1652897     1  0.0000      0.943 1.000 0.000
#> SRR1652898     2  0.0000      0.930 0.000 1.000
#> SRR1652899     1  0.4562      0.875 0.904 0.096
#> SRR1652900     2  0.7139      0.749 0.196 0.804
#> SRR1652901     2  0.5294      0.833 0.120 0.880
#> SRR1652902     1  0.9393      0.477 0.644 0.356
#> SRR1652903     1  0.0000      0.943 1.000 0.000
#> SRR1652904     1  0.0000      0.943 1.000 0.000
#> SRR1652905     2  0.9427      0.492 0.360 0.640
#> SRR1652906     2  0.0000      0.930 0.000 1.000
#> SRR1652907     2  0.7453      0.708 0.212 0.788
#> SRR1652908     2  0.9881      0.292 0.436 0.564
#> SRR1652909     1  0.8144      0.680 0.748 0.252
#> SRR1652910     2  0.0000      0.930 0.000 1.000
#> SRR1652911     1  0.0000      0.943 1.000 0.000
#> SRR1652912     2  0.0000      0.930 0.000 1.000
#> SRR1652913     1  0.0000      0.943 1.000 0.000
#> SRR1652914     2  0.0000      0.930 0.000 1.000
#> SRR1652915     2  0.0000      0.930 0.000 1.000
#> SRR1652916     1  0.0938      0.938 0.988 0.012
#> SRR1652917     1  0.1843      0.927 0.972 0.028
#> SRR1652918     1  0.0000      0.943 1.000 0.000
#> SRR1652919     2  0.0000      0.930 0.000 1.000
#> SRR1652920     1  0.0000      0.943 1.000 0.000
#> SRR1652921     1  0.0000      0.943 1.000 0.000
#> SRR1652922     2  0.0000      0.930 0.000 1.000
#> SRR1652923     2  0.0000      0.930 0.000 1.000
#> SRR1652924     1  0.0000      0.943 1.000 0.000
#> SRR1652925     1  0.0000      0.943 1.000 0.000
#> SRR1652926     1  0.0000      0.943 1.000 0.000
#> SRR1652927     2  0.9754      0.282 0.408 0.592
#> SRR1652928     1  0.0000      0.943 1.000 0.000
#> SRR1652929     2  0.0000      0.930 0.000 1.000
#> SRR1652930     1  0.0000      0.943 1.000 0.000
#> SRR1652931     2  0.0000      0.930 0.000 1.000
#> SRR1652932     1  0.0376      0.941 0.996 0.004
#> SRR1652933     1  0.0000      0.943 1.000 0.000
#> SRR1652934     1  0.9580      0.411 0.620 0.380
#> SRR1652935     2  0.0000      0.930 0.000 1.000
#> SRR1652936     2  0.0000      0.930 0.000 1.000
#> SRR1652937     1  0.4690      0.872 0.900 0.100
#> SRR1652938     1  0.0000      0.943 1.000 0.000
#> SRR1652939     1  0.0938      0.938 0.988 0.012
#> SRR1652940     1  0.0000      0.943 1.000 0.000
#> SRR1652941     2  0.9661      0.363 0.392 0.608
#> SRR1652942     2  0.0000      0.930 0.000 1.000
#> SRR1652943     1  0.0000      0.943 1.000 0.000
#> SRR1652944     2  0.0000      0.930 0.000 1.000
#> SRR1652945     1  0.0000      0.943 1.000 0.000
#> SRR1652946     1  0.0000      0.943 1.000 0.000
#> SRR1652947     1  0.3733      0.895 0.928 0.072
#> SRR1652948     2  0.0000      0.930 0.000 1.000
#> SRR1652949     2  0.0376      0.928 0.004 0.996
#> SRR1652950     2  0.0000      0.930 0.000 1.000
#> SRR1652951     2  0.0000      0.930 0.000 1.000
#> SRR1652953     1  0.8016      0.697 0.756 0.244
#> SRR1652952     2  0.0000      0.930 0.000 1.000
#> SRR1652954     1  0.0000      0.943 1.000 0.000
#> SRR1652955     2  0.0000      0.930 0.000 1.000
#> SRR1652958     1  0.6623      0.795 0.828 0.172
#> SRR1652956     2  0.0376      0.928 0.004 0.996
#> SRR1652957     1  0.0000      0.943 1.000 0.000
#> SRR1652959     2  0.0000      0.930 0.000 1.000
#> SRR1652960     2  0.9393      0.493 0.356 0.644
#> SRR1652961     1  0.0000      0.943 1.000 0.000
#> SRR1652962     2  0.0000      0.930 0.000 1.000
#> SRR1652963     2  0.1414      0.917 0.020 0.980
#> SRR1652965     1  0.8861      0.595 0.696 0.304
#> SRR1652964     2  0.0000      0.930 0.000 1.000
#> SRR1652966     2  0.0000      0.930 0.000 1.000
#> SRR1652967     2  0.4562      0.855 0.096 0.904
#> SRR1652969     1  0.0000      0.943 1.000 0.000
#> SRR1652968     2  0.0000      0.930 0.000 1.000
#> SRR1652970     1  0.4690      0.872 0.900 0.100
#> SRR1652971     1  0.0000      0.943 1.000 0.000
#> SRR1652972     2  0.0000      0.930 0.000 1.000
#> SRR1652973     1  0.0672      0.940 0.992 0.008
#> SRR1652974     1  0.0000      0.943 1.000 0.000
#> SRR1652975     1  0.0000      0.943 1.000 0.000
#> SRR1652976     2  0.0000      0.930 0.000 1.000
#> SRR1652977     2  0.0000      0.930 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
#> SRR1652895     1  0.4399     0.7281 0.812 0.000 0.188
#> SRR1652896     2  0.3941     0.7297 0.000 0.844 0.156
#> SRR1652897     1  0.1163     0.8268 0.972 0.000 0.028
#> SRR1652898     2  0.2537     0.7558 0.000 0.920 0.080
#> SRR1652899     1  0.6775     0.6365 0.744 0.144 0.112
#> SRR1652900     2  0.7568     0.6134 0.108 0.680 0.212
#> SRR1652901     2  0.6309     0.6806 0.100 0.772 0.128
#> SRR1652902     2  0.8972    -0.0274 0.412 0.460 0.128
#> SRR1652903     1  0.2448     0.8125 0.924 0.000 0.076
#> SRR1652904     1  0.4235     0.7379 0.824 0.000 0.176
#> SRR1652905     2  0.8513     0.4327 0.140 0.596 0.264
#> SRR1652906     2  0.1399     0.7578 0.004 0.968 0.028
#> SRR1652907     2  0.8548     0.3903 0.120 0.568 0.312
#> SRR1652908     2  0.8055     0.0601 0.440 0.496 0.064
#> SRR1652909     1  0.8512     0.0356 0.552 0.340 0.108
#> SRR1652910     2  0.1585     0.7581 0.008 0.964 0.028
#> SRR1652911     1  0.2711     0.8058 0.912 0.000 0.088
#> SRR1652912     2  0.1529     0.7563 0.000 0.960 0.040
#> SRR1652913     1  0.2165     0.8170 0.936 0.000 0.064
#> SRR1652914     2  0.0892     0.7593 0.000 0.980 0.020
#> SRR1652915     2  0.3619     0.7376 0.000 0.864 0.136
#> SRR1652916     1  0.2636     0.8217 0.932 0.020 0.048
#> SRR1652917     1  0.2280     0.8115 0.940 0.008 0.052
#> SRR1652918     1  0.3116     0.7726 0.892 0.000 0.108
#> SRR1652919     2  0.5216     0.6882 0.000 0.740 0.260
#> SRR1652920     1  0.1163     0.8272 0.972 0.000 0.028
#> SRR1652921     1  0.1643     0.8160 0.956 0.000 0.044
#> SRR1652922     2  0.5363     0.6330 0.000 0.724 0.276
#> SRR1652923     2  0.1860     0.7631 0.000 0.948 0.052
#> SRR1652924     1  0.1643     0.8252 0.956 0.000 0.044
#> SRR1652925     1  0.0892     0.8220 0.980 0.000 0.020
#> SRR1652926     1  0.0747     0.8245 0.984 0.000 0.016
#> SRR1652927     2  0.6414     0.4655 0.248 0.716 0.036
#> SRR1652928     1  0.3816     0.7627 0.852 0.000 0.148
#> SRR1652929     2  0.2066     0.7559 0.000 0.940 0.060
#> SRR1652930     1  0.1860     0.8207 0.948 0.000 0.052
#> SRR1652931     2  0.4399     0.7113 0.000 0.812 0.188
#> SRR1652932     1  0.4555     0.7110 0.800 0.000 0.200
#> SRR1652933     1  0.2269     0.8158 0.944 0.016 0.040
#> SRR1652934     2  0.8316     0.0174 0.424 0.496 0.080
#> SRR1652935     2  0.5431     0.6770 0.000 0.716 0.284
#> SRR1652936     2  0.4261     0.7193 0.012 0.848 0.140
#> SRR1652937     1  0.4489     0.7466 0.856 0.108 0.036
#> SRR1652938     1  0.5635     0.6577 0.784 0.036 0.180
#> SRR1652939     1  0.6728     0.5806 0.736 0.080 0.184
#> SRR1652940     1  0.4235     0.7422 0.824 0.000 0.176
#> SRR1652941     2  0.7640     0.2739 0.352 0.592 0.056
#> SRR1652942     2  0.2261     0.7555 0.000 0.932 0.068
#> SRR1652943     1  0.1031     0.8260 0.976 0.000 0.024
#> SRR1652944     2  0.0592     0.7602 0.000 0.988 0.012
#> SRR1652945     1  0.1163     0.8272 0.972 0.000 0.028
#> SRR1652946     1  0.1643     0.8225 0.956 0.000 0.044
#> SRR1652947     1  0.7067    -0.1150 0.512 0.020 0.468
#> SRR1652948     2  0.3192     0.7425 0.000 0.888 0.112
#> SRR1652949     2  0.6008     0.5467 0.000 0.628 0.372
#> SRR1652950     2  0.1163     0.7580 0.000 0.972 0.028
#> SRR1652951     2  0.5070     0.6948 0.004 0.772 0.224
#> SRR1652953     1  0.9510    -0.0416 0.492 0.264 0.244
#> SRR1652952     2  0.5948     0.6128 0.000 0.640 0.360
#> SRR1652954     1  0.0747     0.8248 0.984 0.000 0.016
#> SRR1652955     2  0.3412     0.7407 0.000 0.876 0.124
#> SRR1652958     1  0.6355     0.4205 0.696 0.280 0.024
#> SRR1652956     2  0.6467     0.5375 0.008 0.604 0.388
#> SRR1652957     1  0.0892     0.8208 0.980 0.000 0.020
#> SRR1652959     2  0.7762     0.5163 0.120 0.668 0.212
#> SRR1652960     2  0.8637     0.2946 0.308 0.564 0.128
#> SRR1652961     1  0.3370     0.7887 0.904 0.024 0.072
#> SRR1652962     2  0.4062     0.7444 0.000 0.836 0.164
#> SRR1652963     2  0.4654     0.7277 0.000 0.792 0.208
#> SRR1652965     3  0.8266     0.7379 0.240 0.136 0.624
#> SRR1652964     2  0.4575     0.7088 0.012 0.828 0.160
#> SRR1652966     2  0.2796     0.7512 0.000 0.908 0.092
#> SRR1652967     3  0.6527     0.5928 0.068 0.188 0.744
#> SRR1652969     1  0.3207     0.7919 0.904 0.012 0.084
#> SRR1652968     2  0.1289     0.7604 0.000 0.968 0.032
#> SRR1652970     1  0.7400     0.5099 0.664 0.072 0.264
#> SRR1652971     3  0.6769     0.6207 0.320 0.028 0.652
#> SRR1652972     2  0.3879     0.7427 0.000 0.848 0.152
#> SRR1652973     1  0.1989     0.8152 0.948 0.004 0.048
#> SRR1652974     1  0.2448     0.8123 0.924 0.000 0.076
#> SRR1652975     1  0.2173     0.8133 0.944 0.008 0.048
#> SRR1652976     2  0.1031     0.7626 0.000 0.976 0.024
#> SRR1652977     2  0.1163     0.7581 0.000 0.972 0.028

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>            class entropy silhouette    p1    p2    p3    p4
#> SRR1652895     1   0.490     0.6462 0.724 0.028 0.000 0.248
#> SRR1652896     3   0.625     0.4015 0.000 0.140 0.664 0.196
#> SRR1652897     1   0.126     0.7727 0.964 0.028 0.000 0.008
#> SRR1652898     3   0.358     0.5155 0.000 0.032 0.852 0.116
#> SRR1652899     1   0.599     0.6840 0.736 0.072 0.040 0.152
#> SRR1652900     2   0.865     0.4113 0.132 0.432 0.356 0.080
#> SRR1652901     3   0.821    -0.3669 0.112 0.364 0.464 0.060
#> SRR1652902     1   0.903    -0.1280 0.396 0.324 0.204 0.076
#> SRR1652903     1   0.322     0.7476 0.868 0.020 0.000 0.112
#> SRR1652904     1   0.414     0.6962 0.788 0.016 0.000 0.196
#> SRR1652905     3   0.899     0.1054 0.092 0.196 0.456 0.256
#> SRR1652906     3   0.173     0.5293 0.004 0.040 0.948 0.008
#> SRR1652907     4   0.707     0.2557 0.064 0.064 0.236 0.636
#> SRR1652908     3   0.764    -0.0532 0.416 0.112 0.448 0.024
#> SRR1652909     1   0.797     0.2206 0.516 0.072 0.084 0.328
#> SRR1652910     3   0.189     0.5348 0.004 0.036 0.944 0.016
#> SRR1652911     1   0.328     0.7420 0.860 0.016 0.000 0.124
#> SRR1652912     3   0.179     0.5293 0.000 0.068 0.932 0.000
#> SRR1652913     1   0.249     0.7679 0.912 0.020 0.000 0.068
#> SRR1652914     3   0.174     0.5243 0.000 0.056 0.940 0.004
#> SRR1652915     3   0.556     0.4468 0.000 0.092 0.720 0.188
#> SRR1652916     1   0.288     0.7674 0.900 0.028 0.004 0.068
#> SRR1652917     1   0.282     0.7574 0.900 0.076 0.004 0.020
#> SRR1652918     1   0.385     0.7338 0.840 0.116 0.000 0.044
#> SRR1652919     3   0.776    -0.3518 0.000 0.236 0.392 0.372
#> SRR1652920     1   0.320     0.7662 0.884 0.080 0.004 0.032
#> SRR1652921     1   0.249     0.7598 0.912 0.068 0.000 0.020
#> SRR1652922     3   0.628     0.1028 0.000 0.056 0.476 0.468
#> SRR1652923     3   0.431     0.4532 0.000 0.132 0.812 0.056
#> SRR1652924     1   0.203     0.7743 0.936 0.036 0.000 0.028
#> SRR1652925     1   0.147     0.7684 0.948 0.052 0.000 0.000
#> SRR1652926     1   0.211     0.7707 0.932 0.044 0.000 0.024
#> SRR1652927     3   0.591     0.0781 0.316 0.040 0.636 0.008
#> SRR1652928     1   0.393     0.7102 0.808 0.016 0.000 0.176
#> SRR1652929     3   0.441     0.3729 0.000 0.192 0.780 0.028
#> SRR1652930     1   0.220     0.7703 0.928 0.024 0.000 0.048
#> SRR1652931     3   0.666     0.3350 0.000 0.132 0.604 0.264
#> SRR1652932     1   0.513     0.5904 0.692 0.028 0.000 0.280
#> SRR1652933     1   0.412     0.7395 0.844 0.100 0.020 0.036
#> SRR1652934     1   0.764    -0.0154 0.444 0.064 0.436 0.056
#> SRR1652935     2   0.769     0.4799 0.000 0.448 0.312 0.240
#> SRR1652936     3   0.475     0.2144 0.008 0.304 0.688 0.000
#> SRR1652937     1   0.398     0.7621 0.860 0.036 0.036 0.068
#> SRR1652938     1   0.667     0.5568 0.652 0.248 0.048 0.052
#> SRR1652939     1   0.610     0.6248 0.724 0.160 0.084 0.032
#> SRR1652940     1   0.499     0.6480 0.728 0.036 0.000 0.236
#> SRR1652941     1   0.681     0.3150 0.576 0.084 0.328 0.012
#> SRR1652942     3   0.316     0.5384 0.000 0.052 0.884 0.064
#> SRR1652943     1   0.183     0.7718 0.944 0.032 0.000 0.024
#> SRR1652944     3   0.152     0.5342 0.000 0.024 0.956 0.020
#> SRR1652945     1   0.255     0.7728 0.912 0.060 0.000 0.028
#> SRR1652946     1   0.177     0.7710 0.944 0.012 0.000 0.044
#> SRR1652947     4   0.589     0.1691 0.372 0.028 0.008 0.592
#> SRR1652948     3   0.514     0.4726 0.000 0.096 0.760 0.144
#> SRR1652949     4   0.714    -0.1469 0.000 0.164 0.296 0.540
#> SRR1652950     3   0.166     0.5180 0.000 0.052 0.944 0.004
#> SRR1652951     3   0.759     0.2037 0.008 0.212 0.528 0.252
#> SRR1652953     1   0.833     0.1306 0.456 0.052 0.140 0.352
#> SRR1652952     3   0.786    -0.4923 0.000 0.360 0.368 0.272
#> SRR1652954     1   0.152     0.7719 0.956 0.024 0.000 0.020
#> SRR1652955     3   0.542     0.4563 0.000 0.088 0.732 0.180
#> SRR1652958     1   0.498     0.6705 0.776 0.056 0.160 0.008
#> SRR1652956     2   0.696     0.3604 0.000 0.548 0.316 0.136
#> SRR1652957     1   0.121     0.7689 0.960 0.040 0.000 0.000
#> SRR1652959     3   0.653     0.1900 0.116 0.176 0.684 0.024
#> SRR1652960     1   0.790    -0.2074 0.396 0.232 0.368 0.004
#> SRR1652961     1   0.527     0.6733 0.768 0.152 0.064 0.016
#> SRR1652962     3   0.684    -0.1213 0.000 0.328 0.552 0.120
#> SRR1652963     3   0.720    -0.2879 0.000 0.320 0.520 0.160
#> SRR1652965     4   0.418     0.5478 0.116 0.008 0.044 0.832
#> SRR1652964     3   0.425     0.3008 0.004 0.252 0.744 0.000
#> SRR1652966     3   0.462     0.4946 0.000 0.076 0.796 0.128
#> SRR1652967     4   0.539     0.4007 0.032 0.168 0.040 0.760
#> SRR1652969     1   0.397     0.7424 0.856 0.068 0.060 0.016
#> SRR1652968     3   0.202     0.5383 0.000 0.040 0.936 0.024
#> SRR1652970     1   0.742     0.2475 0.504 0.116 0.016 0.364
#> SRR1652971     4   0.417     0.5362 0.172 0.020 0.004 0.804
#> SRR1652972     3   0.720    -0.2505 0.000 0.288 0.536 0.176
#> SRR1652973     1   0.268     0.7655 0.916 0.044 0.028 0.012
#> SRR1652974     1   0.343     0.7486 0.860 0.028 0.000 0.112
#> SRR1652975     1   0.239     0.7655 0.924 0.052 0.016 0.008
#> SRR1652976     3   0.292     0.5103 0.000 0.080 0.892 0.028
#> SRR1652977     3   0.128     0.5392 0.000 0.024 0.964 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
#> SRR1652895     4   0.439    0.41089 0.380 0.000 0.000 0.612 0.008
#> SRR1652896     3   0.654    0.31176 0.172 0.016 0.544 0.000 0.268
#> SRR1652897     4   0.213    0.69780 0.044 0.016 0.000 0.924 0.016
#> SRR1652898     3   0.299    0.57101 0.072 0.024 0.880 0.000 0.024
#> SRR1652899     4   0.679    0.41758 0.304 0.036 0.060 0.564 0.036
#> SRR1652900     2   0.692    0.31031 0.036 0.596 0.240 0.088 0.040
#> SRR1652901     2   0.688    0.36264 0.020 0.536 0.320 0.092 0.032
#> SRR1652902     2   0.933   -0.04862 0.152 0.316 0.088 0.304 0.140
#> SRR1652903     4   0.399    0.56355 0.260 0.008 0.000 0.728 0.004
#> SRR1652904     4   0.403    0.45811 0.352 0.000 0.000 0.648 0.000
#> SRR1652905     3   0.847   -0.06688 0.184 0.012 0.352 0.132 0.320
#> SRR1652906     3   0.226    0.58536 0.012 0.024 0.924 0.008 0.032
#> SRR1652907     1   0.639    0.20527 0.680 0.072 0.152 0.040 0.056
#> SRR1652908     4   0.804   -0.03498 0.032 0.044 0.364 0.376 0.184
#> SRR1652909     1   0.695    0.24965 0.508 0.084 0.048 0.348 0.012
#> SRR1652910     3   0.228    0.59042 0.020 0.012 0.920 0.004 0.044
#> SRR1652911     4   0.391    0.58523 0.248 0.004 0.000 0.740 0.008
#> SRR1652912     3   0.253    0.57861 0.004 0.040 0.900 0.000 0.056
#> SRR1652913     4   0.225    0.68830 0.096 0.000 0.000 0.896 0.008
#> SRR1652914     3   0.163    0.57335 0.000 0.056 0.936 0.000 0.008
#> SRR1652915     3   0.595    0.44830 0.168 0.024 0.652 0.000 0.156
#> SRR1652916     4   0.324    0.67089 0.144 0.000 0.000 0.832 0.024
#> SRR1652917     4   0.379    0.66885 0.012 0.036 0.008 0.832 0.112
#> SRR1652918     4   0.446    0.63254 0.016 0.056 0.000 0.772 0.156
#> SRR1652919     1   0.783   -0.41671 0.360 0.304 0.272 0.000 0.064
#> SRR1652920     4   0.571    0.60874 0.092 0.124 0.000 0.708 0.076
#> SRR1652921     4   0.317    0.68070 0.008 0.044 0.000 0.864 0.084
#> SRR1652922     3   0.661    0.12492 0.412 0.032 0.456 0.000 0.100
#> SRR1652923     3   0.468    0.37386 0.028 0.232 0.720 0.000 0.020
#> SRR1652924     4   0.339    0.69053 0.088 0.036 0.000 0.856 0.020
#> SRR1652925     4   0.286    0.69124 0.020 0.064 0.000 0.888 0.028
#> SRR1652926     4   0.331    0.67917 0.028 0.032 0.000 0.864 0.076
#> SRR1652927     3   0.592    0.19294 0.020 0.016 0.612 0.304 0.048
#> SRR1652928     4   0.417    0.50478 0.320 0.008 0.000 0.672 0.000
#> SRR1652929     3   0.486    0.29056 0.020 0.288 0.672 0.000 0.020
#> SRR1652930     4   0.298    0.67140 0.124 0.004 0.000 0.856 0.016
#> SRR1652931     3   0.636    0.31152 0.192 0.004 0.540 0.000 0.264
#> SRR1652932     4   0.439    0.27655 0.428 0.000 0.000 0.568 0.004
#> SRR1652933     4   0.650    0.53507 0.060 0.032 0.084 0.668 0.156
#> SRR1652934     3   0.690    0.05097 0.036 0.012 0.456 0.408 0.088
#> SRR1652935     2   0.589    0.16777 0.124 0.684 0.140 0.000 0.052
#> SRR1652936     3   0.533   -0.00673 0.000 0.376 0.576 0.012 0.036
#> SRR1652937     4   0.523    0.63463 0.160 0.012 0.052 0.740 0.036
#> SRR1652938     4   0.720    0.32696 0.024 0.104 0.040 0.516 0.316
#> SRR1652939     4   0.576    0.59445 0.008 0.080 0.060 0.712 0.140
#> SRR1652940     4   0.511    0.37164 0.372 0.020 0.000 0.592 0.016
#> SRR1652941     4   0.664    0.34434 0.024 0.052 0.300 0.576 0.048
#> SRR1652942     3   0.314    0.58181 0.024 0.048 0.876 0.000 0.052
#> SRR1652943     4   0.313    0.68984 0.044 0.024 0.000 0.876 0.056
#> SRR1652944     3   0.196    0.57804 0.004 0.048 0.928 0.000 0.020
#> SRR1652945     4   0.290    0.69468 0.056 0.024 0.000 0.888 0.032
#> SRR1652946     4   0.183    0.69179 0.076 0.000 0.000 0.920 0.004
#> SRR1652947     1   0.480    0.41928 0.680 0.004 0.012 0.284 0.020
#> SRR1652948     3   0.515    0.50815 0.096 0.012 0.712 0.000 0.180
#> SRR1652949     1   0.822   -0.31826 0.436 0.176 0.184 0.004 0.200
#> SRR1652950     3   0.235    0.55432 0.004 0.084 0.900 0.000 0.012
#> SRR1652951     3   0.806    0.07089 0.184 0.160 0.440 0.000 0.216
#> SRR1652953     1   0.713    0.25945 0.496 0.028 0.132 0.328 0.016
#> SRR1652952     2   0.772    0.09412 0.236 0.464 0.208 0.000 0.092
#> SRR1652954     4   0.111    0.69645 0.024 0.000 0.000 0.964 0.012
#> SRR1652955     3   0.533    0.49594 0.136 0.016 0.708 0.000 0.140
#> SRR1652958     4   0.507    0.59924 0.028 0.008 0.164 0.744 0.056
#> SRR1652956     5   0.809    0.00000 0.104 0.356 0.144 0.012 0.384
#> SRR1652957     4   0.199    0.69454 0.004 0.040 0.000 0.928 0.028
#> SRR1652959     3   0.695    0.15200 0.004 0.180 0.600 0.108 0.108
#> SRR1652960     4   0.786   -0.18501 0.000 0.272 0.296 0.364 0.068
#> SRR1652961     4   0.735    0.42750 0.056 0.252 0.060 0.564 0.068
#> SRR1652962     2   0.640    0.28762 0.052 0.480 0.420 0.004 0.044
#> SRR1652963     2   0.794    0.08159 0.128 0.400 0.324 0.000 0.148
#> SRR1652965     1   0.458    0.42696 0.792 0.020 0.020 0.124 0.044
#> SRR1652964     3   0.537    0.19510 0.004 0.288 0.644 0.008 0.056
#> SRR1652966     3   0.421    0.54646 0.064 0.008 0.788 0.000 0.140
#> SRR1652967     1   0.731   -0.14103 0.564 0.144 0.052 0.024 0.216
#> SRR1652969     4   0.530    0.61437 0.016 0.036 0.112 0.752 0.084
#> SRR1652968     3   0.133    0.59484 0.008 0.000 0.952 0.000 0.040
#> SRR1652970     1   0.704    0.06143 0.456 0.108 0.020 0.392 0.024
#> SRR1652971     1   0.463    0.44761 0.772 0.016 0.008 0.152 0.052
#> SRR1652972     2   0.807   -0.04203 0.144 0.376 0.328 0.000 0.152
#> SRR1652973     4   0.403    0.67106 0.020 0.012 0.060 0.832 0.076
#> SRR1652974     4   0.388    0.60532 0.216 0.004 0.000 0.764 0.016
#> SRR1652975     4   0.395    0.67260 0.012 0.052 0.028 0.840 0.068
#> SRR1652976     3   0.322    0.53136 0.012 0.116 0.852 0.000 0.020
#> SRR1652977     3   0.128    0.59449 0.008 0.008 0.960 0.000 0.024

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>            class entropy silhouette    p1    p2    p3    p4    p5    p6
#> SRR1652895     4   0.426    0.21405 0.464 0.000 0.000 0.520 0.016 0.000
#> SRR1652896     3   0.717   -0.25951 0.164 0.028 0.396 0.000 0.360 0.052
#> SRR1652897     4   0.235    0.61900 0.112 0.004 0.000 0.876 0.000 0.008
#> SRR1652898     3   0.410    0.59480 0.036 0.076 0.808 0.000 0.060 0.020
#> SRR1652899     4   0.664    0.16530 0.400 0.036 0.060 0.456 0.032 0.016
#> SRR1652900     2   0.765    0.34117 0.020 0.520 0.204 0.096 0.092 0.068
#> SRR1652901     2   0.704    0.39357 0.016 0.532 0.236 0.108 0.096 0.012
#> SRR1652902     2   0.883    0.03099 0.160 0.352 0.080 0.264 0.044 0.100
#> SRR1652903     4   0.391    0.41247 0.356 0.004 0.000 0.636 0.004 0.000
#> SRR1652904     4   0.405    0.29503 0.428 0.000 0.000 0.564 0.008 0.000
#> SRR1652905     5   0.737    0.38226 0.180 0.020 0.160 0.112 0.516 0.012
#> SRR1652906     3   0.303    0.62296 0.004 0.040 0.876 0.008 0.044 0.028
#> SRR1652907     1   0.501    0.35885 0.748 0.108 0.080 0.032 0.024 0.008
#> SRR1652908     5   0.728    0.24211 0.016 0.032 0.256 0.288 0.396 0.012
#> SRR1652909     1   0.600    0.32759 0.600 0.068 0.016 0.272 0.028 0.016
#> SRR1652910     3   0.276    0.61630 0.012 0.012 0.892 0.008 0.044 0.032
#> SRR1652911     4   0.386    0.46616 0.316 0.000 0.000 0.672 0.008 0.004
#> SRR1652912     3   0.314    0.61193 0.004 0.040 0.860 0.000 0.068 0.028
#> SRR1652913     4   0.299    0.61566 0.140 0.004 0.000 0.836 0.016 0.004
#> SRR1652914     3   0.204    0.62877 0.000 0.072 0.908 0.000 0.016 0.004
#> SRR1652915     3   0.652    0.23317 0.148 0.036 0.572 0.000 0.208 0.036
#> SRR1652916     4   0.354    0.56944 0.208 0.000 0.000 0.768 0.016 0.008
#> SRR1652917     4   0.391    0.61286 0.012 0.012 0.012 0.816 0.100 0.048
#> SRR1652918     4   0.562    0.50291 0.020 0.028 0.000 0.660 0.180 0.112
#> SRR1652919     2   0.685    0.26449 0.288 0.448 0.216 0.000 0.028 0.020
#> SRR1652920     4   0.656    0.46576 0.064 0.104 0.004 0.568 0.240 0.020
#> SRR1652921     4   0.304    0.63170 0.032 0.008 0.004 0.876 0.040 0.040
#> SRR1652922     1   0.685   -0.27070 0.444 0.040 0.352 0.000 0.136 0.028
#> SRR1652923     3   0.450    0.43679 0.012 0.280 0.676 0.000 0.016 0.016
#> SRR1652924     4   0.388    0.62105 0.116 0.020 0.000 0.804 0.052 0.008
#> SRR1652925     4   0.273    0.63353 0.016 0.020 0.000 0.884 0.068 0.012
#> SRR1652926     4   0.438    0.54608 0.024 0.012 0.004 0.700 0.256 0.004
#> SRR1652927     3   0.543    0.27689 0.048 0.008 0.656 0.244 0.024 0.020
#> SRR1652928     4   0.376    0.35905 0.400 0.000 0.000 0.600 0.000 0.000
#> SRR1652929     3   0.433    0.39350 0.004 0.304 0.664 0.000 0.012 0.016
#> SRR1652930     4   0.285    0.59631 0.160 0.000 0.000 0.828 0.004 0.008
#> SRR1652931     5   0.683    0.21765 0.220 0.016 0.356 0.000 0.384 0.024
#> SRR1652932     1   0.445   -0.17059 0.512 0.004 0.000 0.468 0.008 0.008
#> SRR1652933     4   0.650    0.15687 0.040 0.016 0.076 0.480 0.376 0.012
#> SRR1652934     3   0.682   -0.27650 0.032 0.000 0.420 0.324 0.212 0.012
#> SRR1652935     2   0.475    0.30868 0.064 0.760 0.112 0.004 0.012 0.048
#> SRR1652936     3   0.612    0.00549 0.004 0.344 0.532 0.016 0.064 0.040
#> SRR1652937     4   0.540    0.46322 0.280 0.016 0.056 0.628 0.008 0.012
#> SRR1652938     4   0.760    0.13488 0.056 0.016 0.036 0.444 0.164 0.284
#> SRR1652939     4   0.591    0.54423 0.028 0.036 0.064 0.704 0.080 0.088
#> SRR1652940     4   0.503    0.14661 0.472 0.020 0.000 0.480 0.020 0.008
#> SRR1652941     4   0.708    0.20744 0.028 0.060 0.284 0.520 0.080 0.028
#> SRR1652942     3   0.387    0.60895 0.024 0.056 0.820 0.000 0.080 0.020
#> SRR1652943     4   0.305    0.62169 0.040 0.004 0.000 0.840 0.116 0.000
#> SRR1652944     3   0.209    0.62990 0.004 0.064 0.908 0.000 0.024 0.000
#> SRR1652945     4   0.402    0.60411 0.072 0.004 0.000 0.804 0.076 0.044
#> SRR1652946     4   0.236    0.62700 0.092 0.004 0.000 0.888 0.012 0.004
#> SRR1652947     1   0.391    0.48646 0.772 0.008 0.004 0.184 0.024 0.008
#> SRR1652948     3   0.545    0.37846 0.072 0.020 0.672 0.000 0.200 0.036
#> SRR1652949     1   0.810   -0.23630 0.420 0.220 0.084 0.000 0.144 0.132
#> SRR1652950     3   0.177    0.63307 0.000 0.060 0.924 0.000 0.012 0.004
#> SRR1652951     5   0.806    0.25358 0.184 0.164 0.256 0.036 0.360 0.000
#> SRR1652953     1   0.686    0.30805 0.548 0.040 0.112 0.252 0.024 0.024
#> SRR1652952     2   0.735    0.28862 0.144 0.524 0.172 0.000 0.056 0.104
#> SRR1652954     4   0.238    0.63825 0.036 0.008 0.000 0.904 0.044 0.008
#> SRR1652955     3   0.626    0.29033 0.140 0.044 0.604 0.000 0.188 0.024
#> SRR1652958     4   0.591    0.48696 0.076 0.016 0.208 0.648 0.032 0.020
#> SRR1652956     6   0.550    0.00000 0.036 0.156 0.080 0.000 0.036 0.692
#> SRR1652957     4   0.194    0.63499 0.012 0.016 0.000 0.928 0.036 0.008
#> SRR1652959     3   0.642    0.35385 0.008 0.116 0.648 0.096 0.080 0.052
#> SRR1652960     4   0.811   -0.24587 0.000 0.192 0.244 0.304 0.236 0.024
#> SRR1652961     4   0.807    0.18215 0.036 0.208 0.108 0.452 0.168 0.028
#> SRR1652962     2   0.558    0.39054 0.028 0.580 0.328 0.000 0.040 0.024
#> SRR1652963     2   0.794    0.26395 0.068 0.444 0.240 0.028 0.040 0.180
#> SRR1652965     1   0.330    0.43236 0.860 0.020 0.004 0.052 0.052 0.012
#> SRR1652964     3   0.524    0.38773 0.004 0.220 0.680 0.024 0.052 0.020
#> SRR1652966     3   0.541    0.40625 0.076 0.024 0.676 0.000 0.196 0.028
#> SRR1652967     1   0.752   -0.19029 0.476 0.168 0.016 0.008 0.200 0.132
#> SRR1652969     4   0.472    0.50716 0.000 0.004 0.088 0.688 0.216 0.004
#> SRR1652968     3   0.197    0.60962 0.000 0.000 0.900 0.000 0.092 0.008
#> SRR1652970     1   0.657    0.20171 0.496 0.148 0.008 0.312 0.016 0.020
#> SRR1652971     1   0.357    0.45153 0.832 0.008 0.000 0.084 0.056 0.020
#> SRR1652972     2   0.732    0.21640 0.056 0.452 0.284 0.008 0.024 0.176
#> SRR1652973     4   0.384    0.59204 0.000 0.004 0.076 0.796 0.116 0.008
#> SRR1652974     4   0.402    0.48729 0.300 0.004 0.000 0.680 0.012 0.004
#> SRR1652975     4   0.337    0.61815 0.000 0.012 0.024 0.832 0.120 0.012
#> SRR1652976     3   0.327    0.57405 0.008 0.136 0.828 0.000 0.016 0.012
#> SRR1652977     3   0.195    0.61920 0.000 0.004 0.916 0.000 0.060 0.020

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-NMF-collect-classes

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