cola Report for Hierarchical Partitioning - 'TCGA_GBM_microarray'

Date: 2021-07-22 16:12:35 CEST, cola version: 1.9.4

Document is loading...


Summary

First the variable is renamed to res_rh.

res_rh = rh

The partition hierarchy and all available functions which can be applied to res_rh object.

res_rh
#> A 'HierarchicalPartition' object with 'ATC:skmeans' method.
#>   On a matrix with 11267 rows and 173 columns.
#>   Performed in total 3600 partitions.
#>   There are 16 groups under the following parameters:
#>     - min_samples: 6
#>     - mean_silhouette_cutoff: 0.9
#>     - min_n_signatures: 483 (signatures are selected based on:)
#>       - fdr_cutoff: 0.05
#>       - group_diff (scaled values): 0.5
#> 
#> Hierarchy of the partition:
#>   0, 173 cols
#>   |-- 01, 52 cols, 4051 signatures
#>   |   |-- 011, 17 cols, 55 signatures (c)
#>   |   |-- 012, 21 cols, 625 signatures
#>   |   |   |-- 0121, 10 cols (b)
#>   |   |   `-- 0122, 11 cols (b)
#>   |   `-- 013, 14 cols, 0 signatures (c)
#>   |-- 02, 66 cols, 4781 signatures
#>   |   |-- 021, 25 cols, 806 signatures
#>   |   |   |-- 0211, 11 cols (b)
#>   |   |   |-- 0212, 9 cols (b)
#>   |   |   `-- 0213, 5 cols (b)
#>   |   |-- 022, 24 cols, 666 signatures
#>   |   |   |-- 0221, 14 cols, 30 signatures (c)
#>   |   |   `-- 0222, 10 cols (b)
#>   |   `-- 023, 17 cols, 227 signatures (c)
#>   |-- 03, 24 cols, 1376 signatures
#>   |   |-- 031, 7 cols (b)
#>   |   |-- 032, 6 cols (b)
#>   |   |-- 033, 6 cols (b)
#>   |   `-- 034, 5 cols (b)
#>   `-- 04, 31 cols, 1954 signatures
#>       |-- 041, 18 cols, 257 signatures (c)
#>       `-- 042, 13 cols, 175 signatures (c)
#> Stop reason:
#>   b) Subgroup had too few columns.
#>   c) There were too few signatures.
#> 
#> Following methods can be applied to this 'HierarchicalPartition' object:
#>  [1] "all_leaves"            "all_nodes"             "cola_report"           "collect_classes"      
#>  [5] "colnames"              "compare_signatures"    "dimension_reduction"   "functional_enrichment"
#>  [9] "get_anno_col"          "get_anno"              "get_children_nodes"    "get_classes"          
#> [13] "get_matrix"            "get_signatures"        "is_leaf_node"          "max_depth"            
#> [17] "merge_node"            "ncol"                  "node_info"             "node_level"           
#> [21] "nrow"                  "rownames"              "show"                  "split_node"           
#> [25] "suggest_best_k"        "test_to_known_factors" "top_rows_heatmap"      "top_rows_overlap"     
#> 
#> You can get result for a single node by e.g. object["01"]

The call of hierarchical_partition() was:

#> hierarchical_partition(data = m, anno = subtype, anno_col = subtype_col, cores = 4)

Dimension of the input matrix:

mat = get_matrix(res_rh)
dim(mat)
#> [1] 11267   173

All the methods that were tried:

res_rh@param$combination_method
#> [[1]]
#> [1] "ATC"     "skmeans"

Density distribution

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

library(ComplexHeatmap)
densityHeatmap(mat, top_annotation = HeatmapAnnotation(df = get_anno(res_rh), 
    col = get_anno_col(res_rh)), ylab = "value", cluster_columns = TRUE, show_column_names = FALSE,
    mc.cores = 1)

plot of chunk density-heatmap

Some values about the hierarchy:

all_nodes(res_rh)
#>  [1] "0"    "01"   "011"  "012"  "0121" "0122" "013"  "02"   "021"  "0211" "0212" "0213" "022" 
#> [14] "0221" "0222" "023"  "03"   "031"  "032"  "033"  "034"  "04"   "041"  "042"
all_leaves(res_rh)
#>  [1] "011"  "0121" "0122" "013"  "0211" "0212" "0213" "0221" "0222" "023"  "031"  "032"  "033" 
#> [14] "034"  "041"  "042"
node_info(res_rh)
#>      id best_method depth best_k n_columns n_signatures p_signatures is_leaf
#> 1     0 ATC:skmeans     1      4       173         9664      0.85773   FALSE
#> 2    01 ATC:skmeans     2      3        52         4051      0.35955   FALSE
#> 3   011 ATC:skmeans     3      2        17           55      0.00488    TRUE
#> 4   012 ATC:skmeans     3      2        21          625      0.05547   FALSE
#> 5  0121 not applied     4     NA        10           NA           NA    TRUE
#> 6  0122 not applied     4     NA        11           NA           NA    TRUE
#> 7   013 ATC:skmeans     3      2        14            0      0.00000    TRUE
#> 8    02 ATC:skmeans     2      3        66         4781      0.42434   FALSE
#> 9   021 ATC:skmeans     3      3        25          806      0.07154   FALSE
#> 10 0211 not applied     4     NA        11           NA           NA    TRUE
#> 11 0212 not applied     4     NA         9           NA           NA    TRUE
#> 12 0213 not applied     4     NA         5           NA           NA    TRUE
#> 13  022 ATC:skmeans     3      2        24          666      0.05911   FALSE
#> 14 0221 ATC:skmeans     4      2        14           30      0.00266    TRUE
#> 15 0222 not applied     4     NA        10           NA           NA    TRUE
#> 16  023 ATC:skmeans     3      2        17          227      0.02015    TRUE
#> 17   03 ATC:skmeans     2      4        24         1376      0.12213   FALSE
#> 18  031 not applied     3     NA         7           NA           NA    TRUE
#> 19  032 not applied     3     NA         6           NA           NA    TRUE
#> 20  033 not applied     3     NA         6           NA           NA    TRUE
#> 21  034 not applied     3     NA         5           NA           NA    TRUE
#> 22   04 ATC:skmeans     2      2        31         1954      0.17343   FALSE
#> 23  041 ATC:skmeans     3      2        18          257      0.02281    TRUE
#> 24  042 ATC:skmeans     3      2        13          175      0.01553    TRUE

In the output from node_info(), there are the following columns:

Labels of nodes are encoded in a special way. The number of digits correspond to the depth of the node in the hierarchy and the value of the digits correspond to the index of the subgroup in the current node, E.g. a label of “012” means the node is the second subgroup of the partition which is the first subgroup of the root node.

Suggest the best k

Following table shows the best k (number of partitions) for each node in the partition hierarchy. Clicking on the node name in the table goes to the corresponding section for the partitioning on that node.

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

suggest_best_k(res_rh)
Node Best method Is leaf Best k 1-PAC Mean silhouette Concordance #samples
Node0 ATC:skmeans 4 1.00 0.98 0.99 173 **
Node01 ATC:skmeans 4 0.91 0.88 0.94 52 *
Node011-leaf ATC:skmeans ✓ (c) 2 1.00 1.00 1.00 17 **
Node012 ATC:skmeans 3 0.97 0.96 0.96 21 **
Node0121-leaf not applied ✓ (b) 10
Node0122-leaf not applied ✓ (b) 11
Node013-leaf ATC:skmeans ✓ (c) 2 0.86 0.92 0.97 14
Node02 ATC:skmeans 3 0.98 0.96 0.98 66 **
Node021 ATC:skmeans 3 1.00 0.97 0.98 25 **
Node0211-leaf not applied ✓ (b) 11
Node0212-leaf not applied ✓ (b) 9
Node0213-leaf not applied ✓ (b) 5
Node022 ATC:skmeans 3 1.00 0.98 0.99 24 **
Node0221-leaf ATC:skmeans ✓ (c) 2 1.00 1.00 1.00 14 **
Node0222-leaf not applied ✓ (b) 10
Node023-leaf ATC:skmeans ✓ (c) 3 1.00 0.99 1.00 17 **
Node03 ATC:skmeans 4 0.93 0.96 0.96 24 *
Node031-leaf not applied ✓ (b) 7
Node032-leaf not applied ✓ (b) 6
Node033-leaf not applied ✓ (b) 6
Node034-leaf not applied ✓ (b) 5
Node04 ATC:skmeans 2 1.00 1.00 1.00 31 **
Node041-leaf ATC:skmeans ✓ (c) 2 1.00 1.00 1.00 18 **
Node042-leaf ATC:skmeans ✓ (c) 2 1.00 1.00 1.00 13 **

Stop reason: b) Subgroup had too few columns. c) There were too few signatures.

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

Partition hierarchy

The nodes of the hierarchy can be merged by setting the merge_node parameters. Here we control the hierarchy with the min_n_signatures parameter. The value of min_n_signatures is from node_info().

collect_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 625))

plot of chunk tab-collect-classes-from-hierarchical-partition-1

collect_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 666))

plot of chunk tab-collect-classes-from-hierarchical-partition-2

collect_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 806))

plot of chunk tab-collect-classes-from-hierarchical-partition-3

collect_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 1376))

plot of chunk tab-collect-classes-from-hierarchical-partition-4

collect_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 1954))

plot of chunk tab-collect-classes-from-hierarchical-partition-5

collect_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 4051))

plot of chunk tab-collect-classes-from-hierarchical-partition-6

collect_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 4781))

plot of chunk tab-collect-classes-from-hierarchical-partition-7

collect_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 9664))

plot of chunk tab-collect-classes-from-hierarchical-partition-8

Following shows the table of the partitions (You need to click the show/hide code output link to see it).

show/hide code output

get_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 625))
#> TCGA-02-0003-01A-01 TCGA-02-0010-01A-01 TCGA-02-0011-01B-01 TCGA-02-0014-01A-01 TCGA-02-0024-01B-01 
#>               "011"               "013"              "0122"               "013"               "013" 
#> TCGA-02-0026-01B-01 TCGA-02-0028-01A-01 TCGA-02-0046-01A-01 TCGA-02-0047-01A-01 TCGA-02-0048-01A-01 
#>               "013"               "013"               "011"               "032"               "011" 
#> TCGA-02-0060-01A-01 TCGA-02-0069-01A-01 TCGA-02-0074-01A-01 TCGA-02-0080-01A-01 TCGA-02-0084-01A-03 
#>              "0122"               "013"               "013"              "0122"               "023" 
#> TCGA-02-0087-01A-01 TCGA-02-0104-01A-01 TCGA-02-0114-01A-01 TCGA-02-0281-01A-01 TCGA-02-0321-01A-01 
#>              "0122"               "011"               "011"               "013"              "0121" 
#> TCGA-02-0325-01A-01 TCGA-02-0338-01A-01 TCGA-02-0339-01A-01 TCGA-02-0432-01A-02 TCGA-02-0439-01A-01 
#>              "0122"               "013"               "013"              "0122"              "0122" 
#> TCGA-02-0440-01A-01 TCGA-02-0446-01A-01 TCGA-06-0128-01A-01 TCGA-06-0129-01A-01 TCGA-06-0146-01A-01 
#>               "011"              "0222"               "011"               "013"              "0122" 
#> TCGA-06-0156-01A-01 TCGA-06-0166-01A-01 TCGA-06-0174-01A-01 TCGA-06-0177-01A-01 TCGA-06-0238-01A-02 
#>               "011"               "011"               "011"               "013"               "033" 
#> TCGA-06-0241-01A-02 TCGA-06-0410-01A-01 TCGA-06-0413-01A-01 TCGA-06-0414-01A-01 TCGA-06-0646-01A-01 
#>               "011"               "011"               "013"               "011"              "0222" 
#> TCGA-06-0648-01A-01 TCGA-08-0245-01A-01 TCGA-08-0344-01A-01 TCGA-08-0347-01A-01 TCGA-08-0348-01A-01 
#>              "0121"               "011"              "0121"              "0121"              "0121" 
#> TCGA-08-0350-01A-01 TCGA-08-0353-01A-01 TCGA-08-0359-01A-01 TCGA-08-0385-01A-01 TCGA-08-0517-01A-01 
#>              "0121"               "011"              "0121"              "0121"               "011" 
#> TCGA-08-0524-01A-01 TCGA-12-0616-01A-01 TCGA-12-0618-01A-01 TCGA-02-0089-01A-01 TCGA-02-0113-01A-01 
#>               "013"               "011"              "0121"              "0222"               "032" 
#> TCGA-02-0115-01A-01 TCGA-02-0451-01A-01 TCGA-06-0132-01A-02 TCGA-06-0133-01A-02 TCGA-06-0138-01A-02 
#>               "032"              "0222"               "023"               "034"               "033" 
#> TCGA-06-0160-01A-01 TCGA-06-0162-01A-01 TCGA-06-0167-01A-01 TCGA-06-0171-01A-02 TCGA-06-0173-01A-01 
#>              "0122"               "033"              "0122"               "034"               "032" 
#> TCGA-06-0179-01A-02 TCGA-06-0182-01A-01 TCGA-06-0185-01A-01 TCGA-06-0195-01B-01 TCGA-06-0208-01B-01 
#>               "034"               "031"               "031"               "034"               "034" 
#> TCGA-06-0214-01A-02 TCGA-06-0219-01A-01 TCGA-06-0221-01A-01 TCGA-06-0237-01A-02 TCGA-06-0240-01A-02 
#>               "032"               "033"               "033"               "031"               "033" 
#> TCGA-08-0349-01A-01 TCGA-08-0380-01A-01 TCGA-08-0386-01A-01 TCGA-08-0520-01A-01 TCGA-02-0007-01A-01 
#>               "031"               "023"               "041"               "031"               "041" 
#> TCGA-02-0009-01A-01 TCGA-02-0016-01A-01 TCGA-02-0021-01A-01 TCGA-02-0023-01B-01 TCGA-02-0027-01A-01 
#>               "041"               "042"               "041"               "042"              "0122" 
#> TCGA-02-0038-01A-01 TCGA-02-0043-01A-01 TCGA-02-0070-01A-01 TCGA-02-0102-01A-01 TCGA-02-0260-01A-03 
#>               "032"               "041"               "042"               "041"               "042" 
#> TCGA-02-0269-01B-01 TCGA-02-0285-01A-01 TCGA-02-0289-01A-01 TCGA-02-0290-01A-01 TCGA-02-0317-01A-01 
#>               "042"               "042"               "042"               "031"               "042" 
#> TCGA-02-0333-01A-02 TCGA-02-0422-01A-01 TCGA-02-0430-01A-01 TCGA-06-0125-01A-01 TCGA-06-0126-01A-01 
#>               "042"               "042"               "041"               "041"               "041" 
#> TCGA-06-0137-01A-03 TCGA-06-0145-01A-04 TCGA-06-0148-01A-01 TCGA-06-0187-01A-01 TCGA-06-0211-01B-01 
#>               "041"               "041"               "042"              "0222"               "041" 
#> TCGA-06-0402-01A-01 TCGA-08-0246-01A-01 TCGA-08-0354-01A-01 TCGA-08-0355-01A-01 TCGA-08-0357-01A-01 
#>               "041"               "023"               "031"               "023"               "042" 
#> TCGA-08-0358-01A-01 TCGA-08-0375-01A-01 TCGA-08-0511-01A-01 TCGA-08-0514-01A-01 TCGA-08-0518-01A-01 
#>               "042"              "0121"               "041"               "041"               "041" 
#> TCGA-08-0529-01A-02 TCGA-08-0531-01A-01 TCGA-02-0057-01A-01 TCGA-02-0004-01A-01 TCGA-02-0006-01B-01 
#>               "041"               "041"              "0221"              "0212"              "0222" 
#> TCGA-02-0025-01A-01 TCGA-02-0033-01A-01 TCGA-02-0034-01A-01 TCGA-02-0039-01A-01 TCGA-02-0051-01A-01 
#>               "023"              "0211"              "0211"               "023"              "0212" 
#> TCGA-02-0054-01A-01 TCGA-02-0055-01A-01 TCGA-02-0059-01A-01 TCGA-02-0064-01A-01 TCGA-02-0075-01A-01 
#>              "0222"              "0212"              "0212"              "0221"              "0221" 
#> TCGA-02-0079-01A-03 TCGA-02-0085-01A-01 TCGA-02-0086-01A-01 TCGA-02-0099-01A-01 TCGA-02-0106-01A-01 
#>               "023"              "0221"              "0213"              "0222"              "0211" 
#> TCGA-02-0107-01A-01 TCGA-02-0111-01A-01 TCGA-02-0326-01A-01 TCGA-02-0337-01A-01 TCGA-06-0122-01A-01 
#>              "0221"               "023"               "023"               "023"              "0221" 
#> TCGA-06-0124-01A-01 TCGA-06-0130-01A-01 TCGA-06-0139-01A-01 TCGA-06-0143-01A-01 TCGA-06-0147-01A-01 
#>              "0221"              "0211"              "0213"              "0221"              "0221" 
#> TCGA-06-0149-01A-05 TCGA-06-0152-01A-02 TCGA-06-0154-01A-02 TCGA-06-0164-01A-01 TCGA-06-0175-01A-01 
#>               "023"               "023"              "0211"              "0213"              "0222" 
#> TCGA-06-0176-01A-03 TCGA-06-0184-01A-01 TCGA-06-0189-01A-05 TCGA-06-0190-01A-01 TCGA-06-0194-01A-01 
#>              "0211"               "023"              "0212"              "0211"              "0213" 
#> TCGA-06-0197-01A-02 TCGA-06-0210-01A-01 TCGA-06-0397-01A-01 TCGA-06-0409-01A-02 TCGA-06-0412-01A-01 
#>              "0212"              "0213"              "0211"              "0221"              "0222" 
#> TCGA-06-0644-01A-02 TCGA-06-0645-01A-01 TCGA-08-0346-01A-01 TCGA-08-0352-01A-01 TCGA-08-0360-01A-01 
#>              "0212"               "023"               "023"              "0221"              "0221" 
#> TCGA-08-0390-01A-01 TCGA-08-0392-01A-01 TCGA-08-0509-01A-01 TCGA-08-0510-01A-01 TCGA-08-0512-01A-01 
#>              "0212"              "0212"              "0221"              "0221"              "0211" 
#> TCGA-08-0522-01A-01 TCGA-12-0619-01A-01 TCGA-12-0620-01A-01 
#>              "0211"              "0211"               "023"

show/hide code output

get_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 666))
#> TCGA-02-0003-01A-01 TCGA-02-0010-01A-01 TCGA-02-0011-01B-01 TCGA-02-0014-01A-01 TCGA-02-0024-01B-01 
#>               "011"               "013"               "012"               "013"               "013" 
#> TCGA-02-0026-01B-01 TCGA-02-0028-01A-01 TCGA-02-0046-01A-01 TCGA-02-0047-01A-01 TCGA-02-0048-01A-01 
#>               "013"               "013"               "011"               "032"               "011" 
#> TCGA-02-0060-01A-01 TCGA-02-0069-01A-01 TCGA-02-0074-01A-01 TCGA-02-0080-01A-01 TCGA-02-0084-01A-03 
#>               "012"               "013"               "013"               "012"               "023" 
#> TCGA-02-0087-01A-01 TCGA-02-0104-01A-01 TCGA-02-0114-01A-01 TCGA-02-0281-01A-01 TCGA-02-0321-01A-01 
#>               "012"               "011"               "011"               "013"               "012" 
#> TCGA-02-0325-01A-01 TCGA-02-0338-01A-01 TCGA-02-0339-01A-01 TCGA-02-0432-01A-02 TCGA-02-0439-01A-01 
#>               "012"               "013"               "013"               "012"               "012" 
#> TCGA-02-0440-01A-01 TCGA-02-0446-01A-01 TCGA-06-0128-01A-01 TCGA-06-0129-01A-01 TCGA-06-0146-01A-01 
#>               "011"              "0222"               "011"               "013"               "012" 
#> TCGA-06-0156-01A-01 TCGA-06-0166-01A-01 TCGA-06-0174-01A-01 TCGA-06-0177-01A-01 TCGA-06-0238-01A-02 
#>               "011"               "011"               "011"               "013"               "033" 
#> TCGA-06-0241-01A-02 TCGA-06-0410-01A-01 TCGA-06-0413-01A-01 TCGA-06-0414-01A-01 TCGA-06-0646-01A-01 
#>               "011"               "011"               "013"               "011"              "0222" 
#> TCGA-06-0648-01A-01 TCGA-08-0245-01A-01 TCGA-08-0344-01A-01 TCGA-08-0347-01A-01 TCGA-08-0348-01A-01 
#>               "012"               "011"               "012"               "012"               "012" 
#> TCGA-08-0350-01A-01 TCGA-08-0353-01A-01 TCGA-08-0359-01A-01 TCGA-08-0385-01A-01 TCGA-08-0517-01A-01 
#>               "012"               "011"               "012"               "012"               "011" 
#> TCGA-08-0524-01A-01 TCGA-12-0616-01A-01 TCGA-12-0618-01A-01 TCGA-02-0089-01A-01 TCGA-02-0113-01A-01 
#>               "013"               "011"               "012"              "0222"               "032" 
#> TCGA-02-0115-01A-01 TCGA-02-0451-01A-01 TCGA-06-0132-01A-02 TCGA-06-0133-01A-02 TCGA-06-0138-01A-02 
#>               "032"              "0222"               "023"               "034"               "033" 
#> TCGA-06-0160-01A-01 TCGA-06-0162-01A-01 TCGA-06-0167-01A-01 TCGA-06-0171-01A-02 TCGA-06-0173-01A-01 
#>               "012"               "033"               "012"               "034"               "032" 
#> TCGA-06-0179-01A-02 TCGA-06-0182-01A-01 TCGA-06-0185-01A-01 TCGA-06-0195-01B-01 TCGA-06-0208-01B-01 
#>               "034"               "031"               "031"               "034"               "034" 
#> TCGA-06-0214-01A-02 TCGA-06-0219-01A-01 TCGA-06-0221-01A-01 TCGA-06-0237-01A-02 TCGA-06-0240-01A-02 
#>               "032"               "033"               "033"               "031"               "033" 
#> TCGA-08-0349-01A-01 TCGA-08-0380-01A-01 TCGA-08-0386-01A-01 TCGA-08-0520-01A-01 TCGA-02-0007-01A-01 
#>               "031"               "023"               "041"               "031"               "041" 
#> TCGA-02-0009-01A-01 TCGA-02-0016-01A-01 TCGA-02-0021-01A-01 TCGA-02-0023-01B-01 TCGA-02-0027-01A-01 
#>               "041"               "042"               "041"               "042"               "012" 
#> TCGA-02-0038-01A-01 TCGA-02-0043-01A-01 TCGA-02-0070-01A-01 TCGA-02-0102-01A-01 TCGA-02-0260-01A-03 
#>               "032"               "041"               "042"               "041"               "042" 
#> TCGA-02-0269-01B-01 TCGA-02-0285-01A-01 TCGA-02-0289-01A-01 TCGA-02-0290-01A-01 TCGA-02-0317-01A-01 
#>               "042"               "042"               "042"               "031"               "042" 
#> TCGA-02-0333-01A-02 TCGA-02-0422-01A-01 TCGA-02-0430-01A-01 TCGA-06-0125-01A-01 TCGA-06-0126-01A-01 
#>               "042"               "042"               "041"               "041"               "041" 
#> TCGA-06-0137-01A-03 TCGA-06-0145-01A-04 TCGA-06-0148-01A-01 TCGA-06-0187-01A-01 TCGA-06-0211-01B-01 
#>               "041"               "041"               "042"              "0222"               "041" 
#> TCGA-06-0402-01A-01 TCGA-08-0246-01A-01 TCGA-08-0354-01A-01 TCGA-08-0355-01A-01 TCGA-08-0357-01A-01 
#>               "041"               "023"               "031"               "023"               "042" 
#> TCGA-08-0358-01A-01 TCGA-08-0375-01A-01 TCGA-08-0511-01A-01 TCGA-08-0514-01A-01 TCGA-08-0518-01A-01 
#>               "042"               "012"               "041"               "041"               "041" 
#> TCGA-08-0529-01A-02 TCGA-08-0531-01A-01 TCGA-02-0057-01A-01 TCGA-02-0004-01A-01 TCGA-02-0006-01B-01 
#>               "041"               "041"              "0221"              "0212"              "0222" 
#> TCGA-02-0025-01A-01 TCGA-02-0033-01A-01 TCGA-02-0034-01A-01 TCGA-02-0039-01A-01 TCGA-02-0051-01A-01 
#>               "023"              "0211"              "0211"               "023"              "0212" 
#> TCGA-02-0054-01A-01 TCGA-02-0055-01A-01 TCGA-02-0059-01A-01 TCGA-02-0064-01A-01 TCGA-02-0075-01A-01 
#>              "0222"              "0212"              "0212"              "0221"              "0221" 
#> TCGA-02-0079-01A-03 TCGA-02-0085-01A-01 TCGA-02-0086-01A-01 TCGA-02-0099-01A-01 TCGA-02-0106-01A-01 
#>               "023"              "0221"              "0213"              "0222"              "0211" 
#> TCGA-02-0107-01A-01 TCGA-02-0111-01A-01 TCGA-02-0326-01A-01 TCGA-02-0337-01A-01 TCGA-06-0122-01A-01 
#>              "0221"               "023"               "023"               "023"              "0221" 
#> TCGA-06-0124-01A-01 TCGA-06-0130-01A-01 TCGA-06-0139-01A-01 TCGA-06-0143-01A-01 TCGA-06-0147-01A-01 
#>              "0221"              "0211"              "0213"              "0221"              "0221" 
#> TCGA-06-0149-01A-05 TCGA-06-0152-01A-02 TCGA-06-0154-01A-02 TCGA-06-0164-01A-01 TCGA-06-0175-01A-01 
#>               "023"               "023"              "0211"              "0213"              "0222" 
#> TCGA-06-0176-01A-03 TCGA-06-0184-01A-01 TCGA-06-0189-01A-05 TCGA-06-0190-01A-01 TCGA-06-0194-01A-01 
#>              "0211"               "023"              "0212"              "0211"              "0213" 
#> TCGA-06-0197-01A-02 TCGA-06-0210-01A-01 TCGA-06-0397-01A-01 TCGA-06-0409-01A-02 TCGA-06-0412-01A-01 
#>              "0212"              "0213"              "0211"              "0221"              "0222" 
#> TCGA-06-0644-01A-02 TCGA-06-0645-01A-01 TCGA-08-0346-01A-01 TCGA-08-0352-01A-01 TCGA-08-0360-01A-01 
#>              "0212"               "023"               "023"              "0221"              "0221" 
#> TCGA-08-0390-01A-01 TCGA-08-0392-01A-01 TCGA-08-0509-01A-01 TCGA-08-0510-01A-01 TCGA-08-0512-01A-01 
#>              "0212"              "0212"              "0221"              "0221"              "0211" 
#> TCGA-08-0522-01A-01 TCGA-12-0619-01A-01 TCGA-12-0620-01A-01 
#>              "0211"              "0211"               "023"

show/hide code output

get_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 806))
#> TCGA-02-0003-01A-01 TCGA-02-0010-01A-01 TCGA-02-0011-01B-01 TCGA-02-0014-01A-01 TCGA-02-0024-01B-01 
#>               "011"               "013"               "012"               "013"               "013" 
#> TCGA-02-0026-01B-01 TCGA-02-0028-01A-01 TCGA-02-0046-01A-01 TCGA-02-0047-01A-01 TCGA-02-0048-01A-01 
#>               "013"               "013"               "011"               "032"               "011" 
#> TCGA-02-0060-01A-01 TCGA-02-0069-01A-01 TCGA-02-0074-01A-01 TCGA-02-0080-01A-01 TCGA-02-0084-01A-03 
#>               "012"               "013"               "013"               "012"               "023" 
#> TCGA-02-0087-01A-01 TCGA-02-0104-01A-01 TCGA-02-0114-01A-01 TCGA-02-0281-01A-01 TCGA-02-0321-01A-01 
#>               "012"               "011"               "011"               "013"               "012" 
#> TCGA-02-0325-01A-01 TCGA-02-0338-01A-01 TCGA-02-0339-01A-01 TCGA-02-0432-01A-02 TCGA-02-0439-01A-01 
#>               "012"               "013"               "013"               "012"               "012" 
#> TCGA-02-0440-01A-01 TCGA-02-0446-01A-01 TCGA-06-0128-01A-01 TCGA-06-0129-01A-01 TCGA-06-0146-01A-01 
#>               "011"               "022"               "011"               "013"               "012" 
#> TCGA-06-0156-01A-01 TCGA-06-0166-01A-01 TCGA-06-0174-01A-01 TCGA-06-0177-01A-01 TCGA-06-0238-01A-02 
#>               "011"               "011"               "011"               "013"               "033" 
#> TCGA-06-0241-01A-02 TCGA-06-0410-01A-01 TCGA-06-0413-01A-01 TCGA-06-0414-01A-01 TCGA-06-0646-01A-01 
#>               "011"               "011"               "013"               "011"               "022" 
#> TCGA-06-0648-01A-01 TCGA-08-0245-01A-01 TCGA-08-0344-01A-01 TCGA-08-0347-01A-01 TCGA-08-0348-01A-01 
#>               "012"               "011"               "012"               "012"               "012" 
#> TCGA-08-0350-01A-01 TCGA-08-0353-01A-01 TCGA-08-0359-01A-01 TCGA-08-0385-01A-01 TCGA-08-0517-01A-01 
#>               "012"               "011"               "012"               "012"               "011" 
#> TCGA-08-0524-01A-01 TCGA-12-0616-01A-01 TCGA-12-0618-01A-01 TCGA-02-0089-01A-01 TCGA-02-0113-01A-01 
#>               "013"               "011"               "012"               "022"               "032" 
#> TCGA-02-0115-01A-01 TCGA-02-0451-01A-01 TCGA-06-0132-01A-02 TCGA-06-0133-01A-02 TCGA-06-0138-01A-02 
#>               "032"               "022"               "023"               "034"               "033" 
#> TCGA-06-0160-01A-01 TCGA-06-0162-01A-01 TCGA-06-0167-01A-01 TCGA-06-0171-01A-02 TCGA-06-0173-01A-01 
#>               "012"               "033"               "012"               "034"               "032" 
#> TCGA-06-0179-01A-02 TCGA-06-0182-01A-01 TCGA-06-0185-01A-01 TCGA-06-0195-01B-01 TCGA-06-0208-01B-01 
#>               "034"               "031"               "031"               "034"               "034" 
#> TCGA-06-0214-01A-02 TCGA-06-0219-01A-01 TCGA-06-0221-01A-01 TCGA-06-0237-01A-02 TCGA-06-0240-01A-02 
#>               "032"               "033"               "033"               "031"               "033" 
#> TCGA-08-0349-01A-01 TCGA-08-0380-01A-01 TCGA-08-0386-01A-01 TCGA-08-0520-01A-01 TCGA-02-0007-01A-01 
#>               "031"               "023"               "041"               "031"               "041" 
#> TCGA-02-0009-01A-01 TCGA-02-0016-01A-01 TCGA-02-0021-01A-01 TCGA-02-0023-01B-01 TCGA-02-0027-01A-01 
#>               "041"               "042"               "041"               "042"               "012" 
#> TCGA-02-0038-01A-01 TCGA-02-0043-01A-01 TCGA-02-0070-01A-01 TCGA-02-0102-01A-01 TCGA-02-0260-01A-03 
#>               "032"               "041"               "042"               "041"               "042" 
#> TCGA-02-0269-01B-01 TCGA-02-0285-01A-01 TCGA-02-0289-01A-01 TCGA-02-0290-01A-01 TCGA-02-0317-01A-01 
#>               "042"               "042"               "042"               "031"               "042" 
#> TCGA-02-0333-01A-02 TCGA-02-0422-01A-01 TCGA-02-0430-01A-01 TCGA-06-0125-01A-01 TCGA-06-0126-01A-01 
#>               "042"               "042"               "041"               "041"               "041" 
#> TCGA-06-0137-01A-03 TCGA-06-0145-01A-04 TCGA-06-0148-01A-01 TCGA-06-0187-01A-01 TCGA-06-0211-01B-01 
#>               "041"               "041"               "042"               "022"               "041" 
#> TCGA-06-0402-01A-01 TCGA-08-0246-01A-01 TCGA-08-0354-01A-01 TCGA-08-0355-01A-01 TCGA-08-0357-01A-01 
#>               "041"               "023"               "031"               "023"               "042" 
#> TCGA-08-0358-01A-01 TCGA-08-0375-01A-01 TCGA-08-0511-01A-01 TCGA-08-0514-01A-01 TCGA-08-0518-01A-01 
#>               "042"               "012"               "041"               "041"               "041" 
#> TCGA-08-0529-01A-02 TCGA-08-0531-01A-01 TCGA-02-0057-01A-01 TCGA-02-0004-01A-01 TCGA-02-0006-01B-01 
#>               "041"               "041"               "022"              "0212"               "022" 
#> TCGA-02-0025-01A-01 TCGA-02-0033-01A-01 TCGA-02-0034-01A-01 TCGA-02-0039-01A-01 TCGA-02-0051-01A-01 
#>               "023"              "0211"              "0211"               "023"              "0212" 
#> TCGA-02-0054-01A-01 TCGA-02-0055-01A-01 TCGA-02-0059-01A-01 TCGA-02-0064-01A-01 TCGA-02-0075-01A-01 
#>               "022"              "0212"              "0212"               "022"               "022" 
#> TCGA-02-0079-01A-03 TCGA-02-0085-01A-01 TCGA-02-0086-01A-01 TCGA-02-0099-01A-01 TCGA-02-0106-01A-01 
#>               "023"               "022"              "0213"               "022"              "0211" 
#> TCGA-02-0107-01A-01 TCGA-02-0111-01A-01 TCGA-02-0326-01A-01 TCGA-02-0337-01A-01 TCGA-06-0122-01A-01 
#>               "022"               "023"               "023"               "023"               "022" 
#> TCGA-06-0124-01A-01 TCGA-06-0130-01A-01 TCGA-06-0139-01A-01 TCGA-06-0143-01A-01 TCGA-06-0147-01A-01 
#>               "022"              "0211"              "0213"               "022"               "022" 
#> TCGA-06-0149-01A-05 TCGA-06-0152-01A-02 TCGA-06-0154-01A-02 TCGA-06-0164-01A-01 TCGA-06-0175-01A-01 
#>               "023"               "023"              "0211"              "0213"               "022" 
#> TCGA-06-0176-01A-03 TCGA-06-0184-01A-01 TCGA-06-0189-01A-05 TCGA-06-0190-01A-01 TCGA-06-0194-01A-01 
#>              "0211"               "023"              "0212"              "0211"              "0213" 
#> TCGA-06-0197-01A-02 TCGA-06-0210-01A-01 TCGA-06-0397-01A-01 TCGA-06-0409-01A-02 TCGA-06-0412-01A-01 
#>              "0212"              "0213"              "0211"               "022"               "022" 
#> TCGA-06-0644-01A-02 TCGA-06-0645-01A-01 TCGA-08-0346-01A-01 TCGA-08-0352-01A-01 TCGA-08-0360-01A-01 
#>              "0212"               "023"               "023"               "022"               "022" 
#> TCGA-08-0390-01A-01 TCGA-08-0392-01A-01 TCGA-08-0509-01A-01 TCGA-08-0510-01A-01 TCGA-08-0512-01A-01 
#>              "0212"              "0212"               "022"               "022"              "0211" 
#> TCGA-08-0522-01A-01 TCGA-12-0619-01A-01 TCGA-12-0620-01A-01 
#>              "0211"              "0211"               "023"

show/hide code output

get_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 1376))
#> TCGA-02-0003-01A-01 TCGA-02-0010-01A-01 TCGA-02-0011-01B-01 TCGA-02-0014-01A-01 TCGA-02-0024-01B-01 
#>               "011"               "013"               "012"               "013"               "013" 
#> TCGA-02-0026-01B-01 TCGA-02-0028-01A-01 TCGA-02-0046-01A-01 TCGA-02-0047-01A-01 TCGA-02-0048-01A-01 
#>               "013"               "013"               "011"               "032"               "011" 
#> TCGA-02-0060-01A-01 TCGA-02-0069-01A-01 TCGA-02-0074-01A-01 TCGA-02-0080-01A-01 TCGA-02-0084-01A-03 
#>               "012"               "013"               "013"               "012"               "023" 
#> TCGA-02-0087-01A-01 TCGA-02-0104-01A-01 TCGA-02-0114-01A-01 TCGA-02-0281-01A-01 TCGA-02-0321-01A-01 
#>               "012"               "011"               "011"               "013"               "012" 
#> TCGA-02-0325-01A-01 TCGA-02-0338-01A-01 TCGA-02-0339-01A-01 TCGA-02-0432-01A-02 TCGA-02-0439-01A-01 
#>               "012"               "013"               "013"               "012"               "012" 
#> TCGA-02-0440-01A-01 TCGA-02-0446-01A-01 TCGA-06-0128-01A-01 TCGA-06-0129-01A-01 TCGA-06-0146-01A-01 
#>               "011"               "022"               "011"               "013"               "012" 
#> TCGA-06-0156-01A-01 TCGA-06-0166-01A-01 TCGA-06-0174-01A-01 TCGA-06-0177-01A-01 TCGA-06-0238-01A-02 
#>               "011"               "011"               "011"               "013"               "033" 
#> TCGA-06-0241-01A-02 TCGA-06-0410-01A-01 TCGA-06-0413-01A-01 TCGA-06-0414-01A-01 TCGA-06-0646-01A-01 
#>               "011"               "011"               "013"               "011"               "022" 
#> TCGA-06-0648-01A-01 TCGA-08-0245-01A-01 TCGA-08-0344-01A-01 TCGA-08-0347-01A-01 TCGA-08-0348-01A-01 
#>               "012"               "011"               "012"               "012"               "012" 
#> TCGA-08-0350-01A-01 TCGA-08-0353-01A-01 TCGA-08-0359-01A-01 TCGA-08-0385-01A-01 TCGA-08-0517-01A-01 
#>               "012"               "011"               "012"               "012"               "011" 
#> TCGA-08-0524-01A-01 TCGA-12-0616-01A-01 TCGA-12-0618-01A-01 TCGA-02-0089-01A-01 TCGA-02-0113-01A-01 
#>               "013"               "011"               "012"               "022"               "032" 
#> TCGA-02-0115-01A-01 TCGA-02-0451-01A-01 TCGA-06-0132-01A-02 TCGA-06-0133-01A-02 TCGA-06-0138-01A-02 
#>               "032"               "022"               "023"               "034"               "033" 
#> TCGA-06-0160-01A-01 TCGA-06-0162-01A-01 TCGA-06-0167-01A-01 TCGA-06-0171-01A-02 TCGA-06-0173-01A-01 
#>               "012"               "033"               "012"               "034"               "032" 
#> TCGA-06-0179-01A-02 TCGA-06-0182-01A-01 TCGA-06-0185-01A-01 TCGA-06-0195-01B-01 TCGA-06-0208-01B-01 
#>               "034"               "031"               "031"               "034"               "034" 
#> TCGA-06-0214-01A-02 TCGA-06-0219-01A-01 TCGA-06-0221-01A-01 TCGA-06-0237-01A-02 TCGA-06-0240-01A-02 
#>               "032"               "033"               "033"               "031"               "033" 
#> TCGA-08-0349-01A-01 TCGA-08-0380-01A-01 TCGA-08-0386-01A-01 TCGA-08-0520-01A-01 TCGA-02-0007-01A-01 
#>               "031"               "023"               "041"               "031"               "041" 
#> TCGA-02-0009-01A-01 TCGA-02-0016-01A-01 TCGA-02-0021-01A-01 TCGA-02-0023-01B-01 TCGA-02-0027-01A-01 
#>               "041"               "042"               "041"               "042"               "012" 
#> TCGA-02-0038-01A-01 TCGA-02-0043-01A-01 TCGA-02-0070-01A-01 TCGA-02-0102-01A-01 TCGA-02-0260-01A-03 
#>               "032"               "041"               "042"               "041"               "042" 
#> TCGA-02-0269-01B-01 TCGA-02-0285-01A-01 TCGA-02-0289-01A-01 TCGA-02-0290-01A-01 TCGA-02-0317-01A-01 
#>               "042"               "042"               "042"               "031"               "042" 
#> TCGA-02-0333-01A-02 TCGA-02-0422-01A-01 TCGA-02-0430-01A-01 TCGA-06-0125-01A-01 TCGA-06-0126-01A-01 
#>               "042"               "042"               "041"               "041"               "041" 
#> TCGA-06-0137-01A-03 TCGA-06-0145-01A-04 TCGA-06-0148-01A-01 TCGA-06-0187-01A-01 TCGA-06-0211-01B-01 
#>               "041"               "041"               "042"               "022"               "041" 
#> TCGA-06-0402-01A-01 TCGA-08-0246-01A-01 TCGA-08-0354-01A-01 TCGA-08-0355-01A-01 TCGA-08-0357-01A-01 
#>               "041"               "023"               "031"               "023"               "042" 
#> TCGA-08-0358-01A-01 TCGA-08-0375-01A-01 TCGA-08-0511-01A-01 TCGA-08-0514-01A-01 TCGA-08-0518-01A-01 
#>               "042"               "012"               "041"               "041"               "041" 
#> TCGA-08-0529-01A-02 TCGA-08-0531-01A-01 TCGA-02-0057-01A-01 TCGA-02-0004-01A-01 TCGA-02-0006-01B-01 
#>               "041"               "041"               "022"               "021"               "022" 
#> TCGA-02-0025-01A-01 TCGA-02-0033-01A-01 TCGA-02-0034-01A-01 TCGA-02-0039-01A-01 TCGA-02-0051-01A-01 
#>               "023"               "021"               "021"               "023"               "021" 
#> TCGA-02-0054-01A-01 TCGA-02-0055-01A-01 TCGA-02-0059-01A-01 TCGA-02-0064-01A-01 TCGA-02-0075-01A-01 
#>               "022"               "021"               "021"               "022"               "022" 
#> TCGA-02-0079-01A-03 TCGA-02-0085-01A-01 TCGA-02-0086-01A-01 TCGA-02-0099-01A-01 TCGA-02-0106-01A-01 
#>               "023"               "022"               "021"               "022"               "021" 
#> TCGA-02-0107-01A-01 TCGA-02-0111-01A-01 TCGA-02-0326-01A-01 TCGA-02-0337-01A-01 TCGA-06-0122-01A-01 
#>               "022"               "023"               "023"               "023"               "022" 
#> TCGA-06-0124-01A-01 TCGA-06-0130-01A-01 TCGA-06-0139-01A-01 TCGA-06-0143-01A-01 TCGA-06-0147-01A-01 
#>               "022"               "021"               "021"               "022"               "022" 
#> TCGA-06-0149-01A-05 TCGA-06-0152-01A-02 TCGA-06-0154-01A-02 TCGA-06-0164-01A-01 TCGA-06-0175-01A-01 
#>               "023"               "023"               "021"               "021"               "022" 
#> TCGA-06-0176-01A-03 TCGA-06-0184-01A-01 TCGA-06-0189-01A-05 TCGA-06-0190-01A-01 TCGA-06-0194-01A-01 
#>               "021"               "023"               "021"               "021"               "021" 
#> TCGA-06-0197-01A-02 TCGA-06-0210-01A-01 TCGA-06-0397-01A-01 TCGA-06-0409-01A-02 TCGA-06-0412-01A-01 
#>               "021"               "021"               "021"               "022"               "022" 
#> TCGA-06-0644-01A-02 TCGA-06-0645-01A-01 TCGA-08-0346-01A-01 TCGA-08-0352-01A-01 TCGA-08-0360-01A-01 
#>               "021"               "023"               "023"               "022"               "022" 
#> TCGA-08-0390-01A-01 TCGA-08-0392-01A-01 TCGA-08-0509-01A-01 TCGA-08-0510-01A-01 TCGA-08-0512-01A-01 
#>               "021"               "021"               "022"               "022"               "021" 
#> TCGA-08-0522-01A-01 TCGA-12-0619-01A-01 TCGA-12-0620-01A-01 
#>               "021"               "021"               "023"

show/hide code output

get_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 1954))
#> TCGA-02-0003-01A-01 TCGA-02-0010-01A-01 TCGA-02-0011-01B-01 TCGA-02-0014-01A-01 TCGA-02-0024-01B-01 
#>               "011"               "013"               "012"               "013"               "013" 
#> TCGA-02-0026-01B-01 TCGA-02-0028-01A-01 TCGA-02-0046-01A-01 TCGA-02-0047-01A-01 TCGA-02-0048-01A-01 
#>               "013"               "013"               "011"                "03"               "011" 
#> TCGA-02-0060-01A-01 TCGA-02-0069-01A-01 TCGA-02-0074-01A-01 TCGA-02-0080-01A-01 TCGA-02-0084-01A-03 
#>               "012"               "013"               "013"               "012"               "023" 
#> TCGA-02-0087-01A-01 TCGA-02-0104-01A-01 TCGA-02-0114-01A-01 TCGA-02-0281-01A-01 TCGA-02-0321-01A-01 
#>               "012"               "011"               "011"               "013"               "012" 
#> TCGA-02-0325-01A-01 TCGA-02-0338-01A-01 TCGA-02-0339-01A-01 TCGA-02-0432-01A-02 TCGA-02-0439-01A-01 
#>               "012"               "013"               "013"               "012"               "012" 
#> TCGA-02-0440-01A-01 TCGA-02-0446-01A-01 TCGA-06-0128-01A-01 TCGA-06-0129-01A-01 TCGA-06-0146-01A-01 
#>               "011"               "022"               "011"               "013"               "012" 
#> TCGA-06-0156-01A-01 TCGA-06-0166-01A-01 TCGA-06-0174-01A-01 TCGA-06-0177-01A-01 TCGA-06-0238-01A-02 
#>               "011"               "011"               "011"               "013"                "03" 
#> TCGA-06-0241-01A-02 TCGA-06-0410-01A-01 TCGA-06-0413-01A-01 TCGA-06-0414-01A-01 TCGA-06-0646-01A-01 
#>               "011"               "011"               "013"               "011"               "022" 
#> TCGA-06-0648-01A-01 TCGA-08-0245-01A-01 TCGA-08-0344-01A-01 TCGA-08-0347-01A-01 TCGA-08-0348-01A-01 
#>               "012"               "011"               "012"               "012"               "012" 
#> TCGA-08-0350-01A-01 TCGA-08-0353-01A-01 TCGA-08-0359-01A-01 TCGA-08-0385-01A-01 TCGA-08-0517-01A-01 
#>               "012"               "011"               "012"               "012"               "011" 
#> TCGA-08-0524-01A-01 TCGA-12-0616-01A-01 TCGA-12-0618-01A-01 TCGA-02-0089-01A-01 TCGA-02-0113-01A-01 
#>               "013"               "011"               "012"               "022"                "03" 
#> TCGA-02-0115-01A-01 TCGA-02-0451-01A-01 TCGA-06-0132-01A-02 TCGA-06-0133-01A-02 TCGA-06-0138-01A-02 
#>                "03"               "022"               "023"                "03"                "03" 
#> TCGA-06-0160-01A-01 TCGA-06-0162-01A-01 TCGA-06-0167-01A-01 TCGA-06-0171-01A-02 TCGA-06-0173-01A-01 
#>               "012"                "03"               "012"                "03"                "03" 
#> TCGA-06-0179-01A-02 TCGA-06-0182-01A-01 TCGA-06-0185-01A-01 TCGA-06-0195-01B-01 TCGA-06-0208-01B-01 
#>                "03"                "03"                "03"                "03"                "03" 
#> TCGA-06-0214-01A-02 TCGA-06-0219-01A-01 TCGA-06-0221-01A-01 TCGA-06-0237-01A-02 TCGA-06-0240-01A-02 
#>                "03"                "03"                "03"                "03"                "03" 
#> TCGA-08-0349-01A-01 TCGA-08-0380-01A-01 TCGA-08-0386-01A-01 TCGA-08-0520-01A-01 TCGA-02-0007-01A-01 
#>                "03"               "023"               "041"                "03"               "041" 
#> TCGA-02-0009-01A-01 TCGA-02-0016-01A-01 TCGA-02-0021-01A-01 TCGA-02-0023-01B-01 TCGA-02-0027-01A-01 
#>               "041"               "042"               "041"               "042"               "012" 
#> TCGA-02-0038-01A-01 TCGA-02-0043-01A-01 TCGA-02-0070-01A-01 TCGA-02-0102-01A-01 TCGA-02-0260-01A-03 
#>                "03"               "041"               "042"               "041"               "042" 
#> TCGA-02-0269-01B-01 TCGA-02-0285-01A-01 TCGA-02-0289-01A-01 TCGA-02-0290-01A-01 TCGA-02-0317-01A-01 
#>               "042"               "042"               "042"                "03"               "042" 
#> TCGA-02-0333-01A-02 TCGA-02-0422-01A-01 TCGA-02-0430-01A-01 TCGA-06-0125-01A-01 TCGA-06-0126-01A-01 
#>               "042"               "042"               "041"               "041"               "041" 
#> TCGA-06-0137-01A-03 TCGA-06-0145-01A-04 TCGA-06-0148-01A-01 TCGA-06-0187-01A-01 TCGA-06-0211-01B-01 
#>               "041"               "041"               "042"               "022"               "041" 
#> TCGA-06-0402-01A-01 TCGA-08-0246-01A-01 TCGA-08-0354-01A-01 TCGA-08-0355-01A-01 TCGA-08-0357-01A-01 
#>               "041"               "023"                "03"               "023"               "042" 
#> TCGA-08-0358-01A-01 TCGA-08-0375-01A-01 TCGA-08-0511-01A-01 TCGA-08-0514-01A-01 TCGA-08-0518-01A-01 
#>               "042"               "012"               "041"               "041"               "041" 
#> TCGA-08-0529-01A-02 TCGA-08-0531-01A-01 TCGA-02-0057-01A-01 TCGA-02-0004-01A-01 TCGA-02-0006-01B-01 
#>               "041"               "041"               "022"               "021"               "022" 
#> TCGA-02-0025-01A-01 TCGA-02-0033-01A-01 TCGA-02-0034-01A-01 TCGA-02-0039-01A-01 TCGA-02-0051-01A-01 
#>               "023"               "021"               "021"               "023"               "021" 
#> TCGA-02-0054-01A-01 TCGA-02-0055-01A-01 TCGA-02-0059-01A-01 TCGA-02-0064-01A-01 TCGA-02-0075-01A-01 
#>               "022"               "021"               "021"               "022"               "022" 
#> TCGA-02-0079-01A-03 TCGA-02-0085-01A-01 TCGA-02-0086-01A-01 TCGA-02-0099-01A-01 TCGA-02-0106-01A-01 
#>               "023"               "022"               "021"               "022"               "021" 
#> TCGA-02-0107-01A-01 TCGA-02-0111-01A-01 TCGA-02-0326-01A-01 TCGA-02-0337-01A-01 TCGA-06-0122-01A-01 
#>               "022"               "023"               "023"               "023"               "022" 
#> TCGA-06-0124-01A-01 TCGA-06-0130-01A-01 TCGA-06-0139-01A-01 TCGA-06-0143-01A-01 TCGA-06-0147-01A-01 
#>               "022"               "021"               "021"               "022"               "022" 
#> TCGA-06-0149-01A-05 TCGA-06-0152-01A-02 TCGA-06-0154-01A-02 TCGA-06-0164-01A-01 TCGA-06-0175-01A-01 
#>               "023"               "023"               "021"               "021"               "022" 
#> TCGA-06-0176-01A-03 TCGA-06-0184-01A-01 TCGA-06-0189-01A-05 TCGA-06-0190-01A-01 TCGA-06-0194-01A-01 
#>               "021"               "023"               "021"               "021"               "021" 
#> TCGA-06-0197-01A-02 TCGA-06-0210-01A-01 TCGA-06-0397-01A-01 TCGA-06-0409-01A-02 TCGA-06-0412-01A-01 
#>               "021"               "021"               "021"               "022"               "022" 
#> TCGA-06-0644-01A-02 TCGA-06-0645-01A-01 TCGA-08-0346-01A-01 TCGA-08-0352-01A-01 TCGA-08-0360-01A-01 
#>               "021"               "023"               "023"               "022"               "022" 
#> TCGA-08-0390-01A-01 TCGA-08-0392-01A-01 TCGA-08-0509-01A-01 TCGA-08-0510-01A-01 TCGA-08-0512-01A-01 
#>               "021"               "021"               "022"               "022"               "021" 
#> TCGA-08-0522-01A-01 TCGA-12-0619-01A-01 TCGA-12-0620-01A-01 
#>               "021"               "021"               "023"

show/hide code output

get_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 4051))
#> TCGA-02-0003-01A-01 TCGA-02-0010-01A-01 TCGA-02-0011-01B-01 TCGA-02-0014-01A-01 TCGA-02-0024-01B-01 
#>               "011"               "013"               "012"               "013"               "013" 
#> TCGA-02-0026-01B-01 TCGA-02-0028-01A-01 TCGA-02-0046-01A-01 TCGA-02-0047-01A-01 TCGA-02-0048-01A-01 
#>               "013"               "013"               "011"                "03"               "011" 
#> TCGA-02-0060-01A-01 TCGA-02-0069-01A-01 TCGA-02-0074-01A-01 TCGA-02-0080-01A-01 TCGA-02-0084-01A-03 
#>               "012"               "013"               "013"               "012"               "023" 
#> TCGA-02-0087-01A-01 TCGA-02-0104-01A-01 TCGA-02-0114-01A-01 TCGA-02-0281-01A-01 TCGA-02-0321-01A-01 
#>               "012"               "011"               "011"               "013"               "012" 
#> TCGA-02-0325-01A-01 TCGA-02-0338-01A-01 TCGA-02-0339-01A-01 TCGA-02-0432-01A-02 TCGA-02-0439-01A-01 
#>               "012"               "013"               "013"               "012"               "012" 
#> TCGA-02-0440-01A-01 TCGA-02-0446-01A-01 TCGA-06-0128-01A-01 TCGA-06-0129-01A-01 TCGA-06-0146-01A-01 
#>               "011"               "022"               "011"               "013"               "012" 
#> TCGA-06-0156-01A-01 TCGA-06-0166-01A-01 TCGA-06-0174-01A-01 TCGA-06-0177-01A-01 TCGA-06-0238-01A-02 
#>               "011"               "011"               "011"               "013"                "03" 
#> TCGA-06-0241-01A-02 TCGA-06-0410-01A-01 TCGA-06-0413-01A-01 TCGA-06-0414-01A-01 TCGA-06-0646-01A-01 
#>               "011"               "011"               "013"               "011"               "022" 
#> TCGA-06-0648-01A-01 TCGA-08-0245-01A-01 TCGA-08-0344-01A-01 TCGA-08-0347-01A-01 TCGA-08-0348-01A-01 
#>               "012"               "011"               "012"               "012"               "012" 
#> TCGA-08-0350-01A-01 TCGA-08-0353-01A-01 TCGA-08-0359-01A-01 TCGA-08-0385-01A-01 TCGA-08-0517-01A-01 
#>               "012"               "011"               "012"               "012"               "011" 
#> TCGA-08-0524-01A-01 TCGA-12-0616-01A-01 TCGA-12-0618-01A-01 TCGA-02-0089-01A-01 TCGA-02-0113-01A-01 
#>               "013"               "011"               "012"               "022"                "03" 
#> TCGA-02-0115-01A-01 TCGA-02-0451-01A-01 TCGA-06-0132-01A-02 TCGA-06-0133-01A-02 TCGA-06-0138-01A-02 
#>                "03"               "022"               "023"                "03"                "03" 
#> TCGA-06-0160-01A-01 TCGA-06-0162-01A-01 TCGA-06-0167-01A-01 TCGA-06-0171-01A-02 TCGA-06-0173-01A-01 
#>               "012"                "03"               "012"                "03"                "03" 
#> TCGA-06-0179-01A-02 TCGA-06-0182-01A-01 TCGA-06-0185-01A-01 TCGA-06-0195-01B-01 TCGA-06-0208-01B-01 
#>                "03"                "03"                "03"                "03"                "03" 
#> TCGA-06-0214-01A-02 TCGA-06-0219-01A-01 TCGA-06-0221-01A-01 TCGA-06-0237-01A-02 TCGA-06-0240-01A-02 
#>                "03"                "03"                "03"                "03"                "03" 
#> TCGA-08-0349-01A-01 TCGA-08-0380-01A-01 TCGA-08-0386-01A-01 TCGA-08-0520-01A-01 TCGA-02-0007-01A-01 
#>                "03"               "023"                "04"                "03"                "04" 
#> TCGA-02-0009-01A-01 TCGA-02-0016-01A-01 TCGA-02-0021-01A-01 TCGA-02-0023-01B-01 TCGA-02-0027-01A-01 
#>                "04"                "04"                "04"                "04"               "012" 
#> TCGA-02-0038-01A-01 TCGA-02-0043-01A-01 TCGA-02-0070-01A-01 TCGA-02-0102-01A-01 TCGA-02-0260-01A-03 
#>                "03"                "04"                "04"                "04"                "04" 
#> TCGA-02-0269-01B-01 TCGA-02-0285-01A-01 TCGA-02-0289-01A-01 TCGA-02-0290-01A-01 TCGA-02-0317-01A-01 
#>                "04"                "04"                "04"                "03"                "04" 
#> TCGA-02-0333-01A-02 TCGA-02-0422-01A-01 TCGA-02-0430-01A-01 TCGA-06-0125-01A-01 TCGA-06-0126-01A-01 
#>                "04"                "04"                "04"                "04"                "04" 
#> TCGA-06-0137-01A-03 TCGA-06-0145-01A-04 TCGA-06-0148-01A-01 TCGA-06-0187-01A-01 TCGA-06-0211-01B-01 
#>                "04"                "04"                "04"               "022"                "04" 
#> TCGA-06-0402-01A-01 TCGA-08-0246-01A-01 TCGA-08-0354-01A-01 TCGA-08-0355-01A-01 TCGA-08-0357-01A-01 
#>                "04"               "023"                "03"               "023"                "04" 
#> TCGA-08-0358-01A-01 TCGA-08-0375-01A-01 TCGA-08-0511-01A-01 TCGA-08-0514-01A-01 TCGA-08-0518-01A-01 
#>                "04"               "012"                "04"                "04"                "04" 
#> TCGA-08-0529-01A-02 TCGA-08-0531-01A-01 TCGA-02-0057-01A-01 TCGA-02-0004-01A-01 TCGA-02-0006-01B-01 
#>                "04"                "04"               "022"               "021"               "022" 
#> TCGA-02-0025-01A-01 TCGA-02-0033-01A-01 TCGA-02-0034-01A-01 TCGA-02-0039-01A-01 TCGA-02-0051-01A-01 
#>               "023"               "021"               "021"               "023"               "021" 
#> TCGA-02-0054-01A-01 TCGA-02-0055-01A-01 TCGA-02-0059-01A-01 TCGA-02-0064-01A-01 TCGA-02-0075-01A-01 
#>               "022"               "021"               "021"               "022"               "022" 
#> TCGA-02-0079-01A-03 TCGA-02-0085-01A-01 TCGA-02-0086-01A-01 TCGA-02-0099-01A-01 TCGA-02-0106-01A-01 
#>               "023"               "022"               "021"               "022"               "021" 
#> TCGA-02-0107-01A-01 TCGA-02-0111-01A-01 TCGA-02-0326-01A-01 TCGA-02-0337-01A-01 TCGA-06-0122-01A-01 
#>               "022"               "023"               "023"               "023"               "022" 
#> TCGA-06-0124-01A-01 TCGA-06-0130-01A-01 TCGA-06-0139-01A-01 TCGA-06-0143-01A-01 TCGA-06-0147-01A-01 
#>               "022"               "021"               "021"               "022"               "022" 
#> TCGA-06-0149-01A-05 TCGA-06-0152-01A-02 TCGA-06-0154-01A-02 TCGA-06-0164-01A-01 TCGA-06-0175-01A-01 
#>               "023"               "023"               "021"               "021"               "022" 
#> TCGA-06-0176-01A-03 TCGA-06-0184-01A-01 TCGA-06-0189-01A-05 TCGA-06-0190-01A-01 TCGA-06-0194-01A-01 
#>               "021"               "023"               "021"               "021"               "021" 
#> TCGA-06-0197-01A-02 TCGA-06-0210-01A-01 TCGA-06-0397-01A-01 TCGA-06-0409-01A-02 TCGA-06-0412-01A-01 
#>               "021"               "021"               "021"               "022"               "022" 
#> TCGA-06-0644-01A-02 TCGA-06-0645-01A-01 TCGA-08-0346-01A-01 TCGA-08-0352-01A-01 TCGA-08-0360-01A-01 
#>               "021"               "023"               "023"               "022"               "022" 
#> TCGA-08-0390-01A-01 TCGA-08-0392-01A-01 TCGA-08-0509-01A-01 TCGA-08-0510-01A-01 TCGA-08-0512-01A-01 
#>               "021"               "021"               "022"               "022"               "021" 
#> TCGA-08-0522-01A-01 TCGA-12-0619-01A-01 TCGA-12-0620-01A-01 
#>               "021"               "021"               "023"

show/hide code output

get_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 4781))
#> TCGA-02-0003-01A-01 TCGA-02-0010-01A-01 TCGA-02-0011-01B-01 TCGA-02-0014-01A-01 TCGA-02-0024-01B-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-02-0026-01B-01 TCGA-02-0028-01A-01 TCGA-02-0046-01A-01 TCGA-02-0047-01A-01 TCGA-02-0048-01A-01 
#>                "01"                "01"                "01"                "03"                "01" 
#> TCGA-02-0060-01A-01 TCGA-02-0069-01A-01 TCGA-02-0074-01A-01 TCGA-02-0080-01A-01 TCGA-02-0084-01A-03 
#>                "01"                "01"                "01"                "01"               "023" 
#> TCGA-02-0087-01A-01 TCGA-02-0104-01A-01 TCGA-02-0114-01A-01 TCGA-02-0281-01A-01 TCGA-02-0321-01A-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-02-0325-01A-01 TCGA-02-0338-01A-01 TCGA-02-0339-01A-01 TCGA-02-0432-01A-02 TCGA-02-0439-01A-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-02-0440-01A-01 TCGA-02-0446-01A-01 TCGA-06-0128-01A-01 TCGA-06-0129-01A-01 TCGA-06-0146-01A-01 
#>                "01"               "022"                "01"                "01"                "01" 
#> TCGA-06-0156-01A-01 TCGA-06-0166-01A-01 TCGA-06-0174-01A-01 TCGA-06-0177-01A-01 TCGA-06-0238-01A-02 
#>                "01"                "01"                "01"                "01"                "03" 
#> TCGA-06-0241-01A-02 TCGA-06-0410-01A-01 TCGA-06-0413-01A-01 TCGA-06-0414-01A-01 TCGA-06-0646-01A-01 
#>                "01"                "01"                "01"                "01"               "022" 
#> TCGA-06-0648-01A-01 TCGA-08-0245-01A-01 TCGA-08-0344-01A-01 TCGA-08-0347-01A-01 TCGA-08-0348-01A-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-08-0350-01A-01 TCGA-08-0353-01A-01 TCGA-08-0359-01A-01 TCGA-08-0385-01A-01 TCGA-08-0517-01A-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-08-0524-01A-01 TCGA-12-0616-01A-01 TCGA-12-0618-01A-01 TCGA-02-0089-01A-01 TCGA-02-0113-01A-01 
#>                "01"                "01"                "01"               "022"                "03" 
#> TCGA-02-0115-01A-01 TCGA-02-0451-01A-01 TCGA-06-0132-01A-02 TCGA-06-0133-01A-02 TCGA-06-0138-01A-02 
#>                "03"               "022"               "023"                "03"                "03" 
#> TCGA-06-0160-01A-01 TCGA-06-0162-01A-01 TCGA-06-0167-01A-01 TCGA-06-0171-01A-02 TCGA-06-0173-01A-01 
#>                "01"                "03"                "01"                "03"                "03" 
#> TCGA-06-0179-01A-02 TCGA-06-0182-01A-01 TCGA-06-0185-01A-01 TCGA-06-0195-01B-01 TCGA-06-0208-01B-01 
#>                "03"                "03"                "03"                "03"                "03" 
#> TCGA-06-0214-01A-02 TCGA-06-0219-01A-01 TCGA-06-0221-01A-01 TCGA-06-0237-01A-02 TCGA-06-0240-01A-02 
#>                "03"                "03"                "03"                "03"                "03" 
#> TCGA-08-0349-01A-01 TCGA-08-0380-01A-01 TCGA-08-0386-01A-01 TCGA-08-0520-01A-01 TCGA-02-0007-01A-01 
#>                "03"               "023"                "04"                "03"                "04" 
#> TCGA-02-0009-01A-01 TCGA-02-0016-01A-01 TCGA-02-0021-01A-01 TCGA-02-0023-01B-01 TCGA-02-0027-01A-01 
#>                "04"                "04"                "04"                "04"                "01" 
#> TCGA-02-0038-01A-01 TCGA-02-0043-01A-01 TCGA-02-0070-01A-01 TCGA-02-0102-01A-01 TCGA-02-0260-01A-03 
#>                "03"                "04"                "04"                "04"                "04" 
#> TCGA-02-0269-01B-01 TCGA-02-0285-01A-01 TCGA-02-0289-01A-01 TCGA-02-0290-01A-01 TCGA-02-0317-01A-01 
#>                "04"                "04"                "04"                "03"                "04" 
#> TCGA-02-0333-01A-02 TCGA-02-0422-01A-01 TCGA-02-0430-01A-01 TCGA-06-0125-01A-01 TCGA-06-0126-01A-01 
#>                "04"                "04"                "04"                "04"                "04" 
#> TCGA-06-0137-01A-03 TCGA-06-0145-01A-04 TCGA-06-0148-01A-01 TCGA-06-0187-01A-01 TCGA-06-0211-01B-01 
#>                "04"                "04"                "04"               "022"                "04" 
#> TCGA-06-0402-01A-01 TCGA-08-0246-01A-01 TCGA-08-0354-01A-01 TCGA-08-0355-01A-01 TCGA-08-0357-01A-01 
#>                "04"               "023"                "03"               "023"                "04" 
#> TCGA-08-0358-01A-01 TCGA-08-0375-01A-01 TCGA-08-0511-01A-01 TCGA-08-0514-01A-01 TCGA-08-0518-01A-01 
#>                "04"                "01"                "04"                "04"                "04" 
#> TCGA-08-0529-01A-02 TCGA-08-0531-01A-01 TCGA-02-0057-01A-01 TCGA-02-0004-01A-01 TCGA-02-0006-01B-01 
#>                "04"                "04"               "022"               "021"               "022" 
#> TCGA-02-0025-01A-01 TCGA-02-0033-01A-01 TCGA-02-0034-01A-01 TCGA-02-0039-01A-01 TCGA-02-0051-01A-01 
#>               "023"               "021"               "021"               "023"               "021" 
#> TCGA-02-0054-01A-01 TCGA-02-0055-01A-01 TCGA-02-0059-01A-01 TCGA-02-0064-01A-01 TCGA-02-0075-01A-01 
#>               "022"               "021"               "021"               "022"               "022" 
#> TCGA-02-0079-01A-03 TCGA-02-0085-01A-01 TCGA-02-0086-01A-01 TCGA-02-0099-01A-01 TCGA-02-0106-01A-01 
#>               "023"               "022"               "021"               "022"               "021" 
#> TCGA-02-0107-01A-01 TCGA-02-0111-01A-01 TCGA-02-0326-01A-01 TCGA-02-0337-01A-01 TCGA-06-0122-01A-01 
#>               "022"               "023"               "023"               "023"               "022" 
#> TCGA-06-0124-01A-01 TCGA-06-0130-01A-01 TCGA-06-0139-01A-01 TCGA-06-0143-01A-01 TCGA-06-0147-01A-01 
#>               "022"               "021"               "021"               "022"               "022" 
#> TCGA-06-0149-01A-05 TCGA-06-0152-01A-02 TCGA-06-0154-01A-02 TCGA-06-0164-01A-01 TCGA-06-0175-01A-01 
#>               "023"               "023"               "021"               "021"               "022" 
#> TCGA-06-0176-01A-03 TCGA-06-0184-01A-01 TCGA-06-0189-01A-05 TCGA-06-0190-01A-01 TCGA-06-0194-01A-01 
#>               "021"               "023"               "021"               "021"               "021" 
#> TCGA-06-0197-01A-02 TCGA-06-0210-01A-01 TCGA-06-0397-01A-01 TCGA-06-0409-01A-02 TCGA-06-0412-01A-01 
#>               "021"               "021"               "021"               "022"               "022" 
#> TCGA-06-0644-01A-02 TCGA-06-0645-01A-01 TCGA-08-0346-01A-01 TCGA-08-0352-01A-01 TCGA-08-0360-01A-01 
#>               "021"               "023"               "023"               "022"               "022" 
#> TCGA-08-0390-01A-01 TCGA-08-0392-01A-01 TCGA-08-0509-01A-01 TCGA-08-0510-01A-01 TCGA-08-0512-01A-01 
#>               "021"               "021"               "022"               "022"               "021" 
#> TCGA-08-0522-01A-01 TCGA-12-0619-01A-01 TCGA-12-0620-01A-01 
#>               "021"               "021"               "023"

show/hide code output

get_classes(res_rh, merge_node = merge_node_param(min_n_signatures = 9664))
#> TCGA-02-0003-01A-01 TCGA-02-0010-01A-01 TCGA-02-0011-01B-01 TCGA-02-0014-01A-01 TCGA-02-0024-01B-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-02-0026-01B-01 TCGA-02-0028-01A-01 TCGA-02-0046-01A-01 TCGA-02-0047-01A-01 TCGA-02-0048-01A-01 
#>                "01"                "01"                "01"                "03"                "01" 
#> TCGA-02-0060-01A-01 TCGA-02-0069-01A-01 TCGA-02-0074-01A-01 TCGA-02-0080-01A-01 TCGA-02-0084-01A-03 
#>                "01"                "01"                "01"                "01"                "02" 
#> TCGA-02-0087-01A-01 TCGA-02-0104-01A-01 TCGA-02-0114-01A-01 TCGA-02-0281-01A-01 TCGA-02-0321-01A-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-02-0325-01A-01 TCGA-02-0338-01A-01 TCGA-02-0339-01A-01 TCGA-02-0432-01A-02 TCGA-02-0439-01A-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-02-0440-01A-01 TCGA-02-0446-01A-01 TCGA-06-0128-01A-01 TCGA-06-0129-01A-01 TCGA-06-0146-01A-01 
#>                "01"                "02"                "01"                "01"                "01" 
#> TCGA-06-0156-01A-01 TCGA-06-0166-01A-01 TCGA-06-0174-01A-01 TCGA-06-0177-01A-01 TCGA-06-0238-01A-02 
#>                "01"                "01"                "01"                "01"                "03" 
#> TCGA-06-0241-01A-02 TCGA-06-0410-01A-01 TCGA-06-0413-01A-01 TCGA-06-0414-01A-01 TCGA-06-0646-01A-01 
#>                "01"                "01"                "01"                "01"                "02" 
#> TCGA-06-0648-01A-01 TCGA-08-0245-01A-01 TCGA-08-0344-01A-01 TCGA-08-0347-01A-01 TCGA-08-0348-01A-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-08-0350-01A-01 TCGA-08-0353-01A-01 TCGA-08-0359-01A-01 TCGA-08-0385-01A-01 TCGA-08-0517-01A-01 
#>                "01"                "01"                "01"                "01"                "01" 
#> TCGA-08-0524-01A-01 TCGA-12-0616-01A-01 TCGA-12-0618-01A-01 TCGA-02-0089-01A-01 TCGA-02-0113-01A-01 
#>                "01"                "01"                "01"                "02"                "03" 
#> TCGA-02-0115-01A-01 TCGA-02-0451-01A-01 TCGA-06-0132-01A-02 TCGA-06-0133-01A-02 TCGA-06-0138-01A-02 
#>                "03"                "02"                "02"                "03"                "03" 
#> TCGA-06-0160-01A-01 TCGA-06-0162-01A-01 TCGA-06-0167-01A-01 TCGA-06-0171-01A-02 TCGA-06-0173-01A-01 
#>                "01"                "03"                "01"                "03"                "03" 
#> TCGA-06-0179-01A-02 TCGA-06-0182-01A-01 TCGA-06-0185-01A-01 TCGA-06-0195-01B-01 TCGA-06-0208-01B-01 
#>                "03"                "03"                "03"                "03"                "03" 
#> TCGA-06-0214-01A-02 TCGA-06-0219-01A-01 TCGA-06-0221-01A-01 TCGA-06-0237-01A-02 TCGA-06-0240-01A-02 
#>                "03"                "03"                "03"                "03"                "03" 
#> TCGA-08-0349-01A-01 TCGA-08-0380-01A-01 TCGA-08-0386-01A-01 TCGA-08-0520-01A-01 TCGA-02-0007-01A-01 
#>                "03"                "02"                "04"                "03"                "04" 
#> TCGA-02-0009-01A-01 TCGA-02-0016-01A-01 TCGA-02-0021-01A-01 TCGA-02-0023-01B-01 TCGA-02-0027-01A-01 
#>                "04"                "04"                "04"                "04"                "01" 
#> TCGA-02-0038-01A-01 TCGA-02-0043-01A-01 TCGA-02-0070-01A-01 TCGA-02-0102-01A-01 TCGA-02-0260-01A-03 
#>                "03"                "04"                "04"                "04"                "04" 
#> TCGA-02-0269-01B-01 TCGA-02-0285-01A-01 TCGA-02-0289-01A-01 TCGA-02-0290-01A-01 TCGA-02-0317-01A-01 
#>                "04"                "04"                "04"                "03"                "04" 
#> TCGA-02-0333-01A-02 TCGA-02-0422-01A-01 TCGA-02-0430-01A-01 TCGA-06-0125-01A-01 TCGA-06-0126-01A-01 
#>                "04"                "04"                "04"                "04"                "04" 
#> TCGA-06-0137-01A-03 TCGA-06-0145-01A-04 TCGA-06-0148-01A-01 TCGA-06-0187-01A-01 TCGA-06-0211-01B-01 
#>                "04"                "04"                "04"                "02"                "04" 
#> TCGA-06-0402-01A-01 TCGA-08-0246-01A-01 TCGA-08-0354-01A-01 TCGA-08-0355-01A-01 TCGA-08-0357-01A-01 
#>                "04"                "02"                "03"                "02"                "04" 
#> TCGA-08-0358-01A-01 TCGA-08-0375-01A-01 TCGA-08-0511-01A-01 TCGA-08-0514-01A-01 TCGA-08-0518-01A-01 
#>                "04"                "01"                "04"                "04"                "04" 
#> TCGA-08-0529-01A-02 TCGA-08-0531-01A-01 TCGA-02-0057-01A-01 TCGA-02-0004-01A-01 TCGA-02-0006-01B-01 
#>                "04"                "04"                "02"                "02"                "02" 
#> TCGA-02-0025-01A-01 TCGA-02-0033-01A-01 TCGA-02-0034-01A-01 TCGA-02-0039-01A-01 TCGA-02-0051-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-02-0054-01A-01 TCGA-02-0055-01A-01 TCGA-02-0059-01A-01 TCGA-02-0064-01A-01 TCGA-02-0075-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-02-0079-01A-03 TCGA-02-0085-01A-01 TCGA-02-0086-01A-01 TCGA-02-0099-01A-01 TCGA-02-0106-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-02-0107-01A-01 TCGA-02-0111-01A-01 TCGA-02-0326-01A-01 TCGA-02-0337-01A-01 TCGA-06-0122-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-06-0124-01A-01 TCGA-06-0130-01A-01 TCGA-06-0139-01A-01 TCGA-06-0143-01A-01 TCGA-06-0147-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-06-0149-01A-05 TCGA-06-0152-01A-02 TCGA-06-0154-01A-02 TCGA-06-0164-01A-01 TCGA-06-0175-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-06-0176-01A-03 TCGA-06-0184-01A-01 TCGA-06-0189-01A-05 TCGA-06-0190-01A-01 TCGA-06-0194-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-06-0197-01A-02 TCGA-06-0210-01A-01 TCGA-06-0397-01A-01 TCGA-06-0409-01A-02 TCGA-06-0412-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-06-0644-01A-02 TCGA-06-0645-01A-01 TCGA-08-0346-01A-01 TCGA-08-0352-01A-01 TCGA-08-0360-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-08-0390-01A-01 TCGA-08-0392-01A-01 TCGA-08-0509-01A-01 TCGA-08-0510-01A-01 TCGA-08-0512-01A-01 
#>                "02"                "02"                "02"                "02"                "02" 
#> TCGA-08-0522-01A-01 TCGA-12-0619-01A-01 TCGA-12-0620-01A-01 
#>                "02"                "02"                "02"

Top rows heatmap

Heatmaps of the top rows:

top_rows_heatmap(res_rh)

plot of chunk top-rows-heatmap

Top rows on each node:

top_rows_overlap(res_rh, method = "upset")

plot of chunk top-rows-overlap

UMAP plot

UMAP plot which shows how samples are separated.

par(mfrow = c(1, 2))
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 625),
    method = "UMAP", top_value_method = "SD", top_n = 1200, scale_rows = FALSE)
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 625),
    method = "UMAP", top_value_method = "ATC", top_n = 1200, scale_rows = TRUE)

plot of chunk tab-dimension-reduction-by-depth-1

par(mfrow = c(1, 2))
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 666),
    method = "UMAP", top_value_method = "SD", top_n = 1200, scale_rows = FALSE)
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 666),
    method = "UMAP", top_value_method = "ATC", top_n = 1200, scale_rows = TRUE)

plot of chunk tab-dimension-reduction-by-depth-2

par(mfrow = c(1, 2))
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 806),
    method = "UMAP", top_value_method = "SD", top_n = 1200, scale_rows = FALSE)
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 806),
    method = "UMAP", top_value_method = "ATC", top_n = 1200, scale_rows = TRUE)

plot of chunk tab-dimension-reduction-by-depth-3

par(mfrow = c(1, 2))
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 1376),
    method = "UMAP", top_value_method = "SD", top_n = 1200, scale_rows = FALSE)
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 1376),
    method = "UMAP", top_value_method = "ATC", top_n = 1200, scale_rows = TRUE)

plot of chunk tab-dimension-reduction-by-depth-4

par(mfrow = c(1, 2))
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 1954),
    method = "UMAP", top_value_method = "SD", top_n = 1200, scale_rows = FALSE)
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 1954),
    method = "UMAP", top_value_method = "ATC", top_n = 1200, scale_rows = TRUE)

plot of chunk tab-dimension-reduction-by-depth-5

par(mfrow = c(1, 2))
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 4051),
    method = "UMAP", top_value_method = "SD", top_n = 1200, scale_rows = FALSE)
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 4051),
    method = "UMAP", top_value_method = "ATC", top_n = 1200, scale_rows = TRUE)

plot of chunk tab-dimension-reduction-by-depth-6

par(mfrow = c(1, 2))
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 4781),
    method = "UMAP", top_value_method = "SD", top_n = 1200, scale_rows = FALSE)
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 4781),
    method = "UMAP", top_value_method = "ATC", top_n = 1200, scale_rows = TRUE)

plot of chunk tab-dimension-reduction-by-depth-7

par(mfrow = c(1, 2))
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 9664),
    method = "UMAP", top_value_method = "SD", top_n = 1200, scale_rows = FALSE)
dimension_reduction(res_rh, merge_node = merge_node_param(min_n_signatures = 9664),
    method = "UMAP", top_value_method = "ATC", top_n = 1200, scale_rows = TRUE)

plot of chunk tab-dimension-reduction-by-depth-8

Signature heatmap

Signatures on the heatmap are the union of all signatures found on every node on the hierarchy. The number of k-means on rows are automatically selected by the function.

get_signatures(res_rh, merge_node = merge_node_param(min_n_signatures = 625))

plot of chunk tab-get-signatures-from-hierarchical-partition-1

get_signatures(res_rh, merge_node = merge_node_param(min_n_signatures = 666))

plot of chunk tab-get-signatures-from-hierarchical-partition-2

get_signatures(res_rh, merge_node = merge_node_param(min_n_signatures = 806))

plot of chunk tab-get-signatures-from-hierarchical-partition-3

get_signatures(res_rh, merge_node = merge_node_param(min_n_signatures = 1376))

plot of chunk tab-get-signatures-from-hierarchical-partition-4

get_signatures(res_rh, merge_node = merge_node_param(min_n_signatures = 1954))

plot of chunk tab-get-signatures-from-hierarchical-partition-5

get_signatures(res_rh, merge_node = merge_node_param(min_n_signatures = 4051))

plot of chunk tab-get-signatures-from-hierarchical-partition-6

get_signatures(res_rh, merge_node = merge_node_param(min_n_signatures = 4781))

plot of chunk tab-get-signatures-from-hierarchical-partition-7

get_signatures(res_rh, merge_node = merge_node_param(min_n_signatures = 9664))

plot of chunk tab-get-signatures-from-hierarchical-partition-8

Compare signatures from different nodes:

compare_signatures(res_rh, verbose = FALSE)

plot of chunk unnamed-chunk-24

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs. Note it only works on every node and the final signatures are the union of all signatures of all nodes.

# code only for demonstration
# e.g. to show the top 500 most significant rows on each node.
tb = get_signature(res_rh, top_signatures = 500)

Test to known annotations

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res_rh, merge_node = merge_node_param(min_n_signatures = 625))
#>        subtype
#> class 3.25e-54
test_to_known_factors(res_rh, merge_node = merge_node_param(min_n_signatures = 666))
#>        subtype
#> class 2.56e-55
test_to_known_factors(res_rh, merge_node = merge_node_param(min_n_signatures = 806))
#>       subtype
#> class 2.1e-55
test_to_known_factors(res_rh, merge_node = merge_node_param(min_n_signatures = 1376))
#>        subtype
#> class 1.75e-58
test_to_known_factors(res_rh, merge_node = merge_node_param(min_n_signatures = 1954))
#>        subtype
#> class 1.22e-62
test_to_known_factors(res_rh, merge_node = merge_node_param(min_n_signatures = 4051))
#>        subtype
#> class 1.96e-64
test_to_known_factors(res_rh, merge_node = merge_node_param(min_n_signatures = 4781))
#>       subtype
#> class 7.3e-68
test_to_known_factors(res_rh, merge_node = merge_node_param(min_n_signatures = 9664))
#>        subtype
#> class 2.35e-71

Results for each node


Node0

Child nodes: Node01 , Node02 , Node03 , Node04 .

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

res = res_rh["0"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4.
#>   On a matrix with 10703 rows and 173 columns.
#>   Top rows (1070) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 150 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_partitions"     
#>  [7] "compare_signatures"      "consensus_heatmap"       "dimension_reduction"    
#> [10] "functional_enrichment"   "get_anno_col"            "get_anno"               
#> [13] "get_classes"             "get_consensus"           "get_matrix"             
#> [16] "get_membership"          "get_param"               "get_signatures"         
#> [19] "get_stats"               "is_best_k"               "is_stable_k"            
#> [22] "membership_heatmap"      "ncol"                    "nrow"                   
#> [25] "plot_ecdf"               "predict_classes"         "rownames"               
#> [28] "select_partition_number" "show"                    "suggest_best_k"         
#> [31] "test_to_known_factors"   "top_rows_heatmap"

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

collect_plots(res)

plot of chunk node-0-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, higher 1-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 node-0-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           0.999       1.000          0.502 0.498   0.498
#> 3 3     1           0.996       0.998          0.238 0.868   0.738
#> 4 4     1           0.983       0.993          0.157 0.886   0.707

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 is 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 subgroup 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
#> TCGA-02-0003-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0010-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0011-01B-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0014-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0024-01B-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0026-01B-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0028-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0046-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0047-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0048-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0060-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0069-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0074-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0080-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0084-01A-03     2   0.000      0.999 0.00 1.00
#> TCGA-02-0087-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0104-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0114-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0281-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0321-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0325-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0338-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0339-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0432-01A-02     1   0.000      1.000 1.00 0.00
#> TCGA-02-0439-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0440-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0446-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0128-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0129-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0146-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0156-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0166-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0174-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0177-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0238-01A-02     1   0.000      1.000 1.00 0.00
#> TCGA-06-0241-01A-02     1   0.000      1.000 1.00 0.00
#> TCGA-06-0410-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0413-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0414-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0646-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0648-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0245-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0344-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0347-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0348-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0350-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0353-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0359-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0385-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0517-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0524-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-12-0616-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-12-0618-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0089-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0113-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0115-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0451-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0132-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0133-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0138-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0160-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0162-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0167-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0171-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0173-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0179-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0182-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0185-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0195-01B-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0208-01B-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0214-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0219-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0221-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0237-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0240-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-08-0349-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0380-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0386-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0520-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0007-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0009-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0016-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0021-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0023-01B-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0027-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0038-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0043-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0070-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0102-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0260-01A-03     1   0.000      1.000 1.00 0.00
#> TCGA-02-0269-01B-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0285-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0289-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0290-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0317-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0333-01A-02     1   0.000      1.000 1.00 0.00
#> TCGA-02-0422-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0430-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0125-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0126-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0137-01A-03     1   0.000      1.000 1.00 0.00
#> TCGA-06-0145-01A-04     2   0.000      0.999 0.00 1.00
#> TCGA-06-0148-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0187-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0211-01B-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0402-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0246-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0354-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0355-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0357-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0358-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0375-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0511-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0514-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0518-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0529-01A-02     1   0.000      1.000 1.00 0.00
#> TCGA-08-0531-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0057-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0004-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0006-01B-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0025-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0033-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0034-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0039-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0051-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0054-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0055-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0059-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0064-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0075-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0079-01A-03     2   0.000      0.999 0.00 1.00
#> TCGA-02-0085-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0086-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0099-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0106-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0107-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0111-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-02-0326-01A-01     2   0.402      0.913 0.08 0.92
#> TCGA-02-0337-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0122-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0124-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0130-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0139-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0143-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0147-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0149-01A-05     2   0.000      0.999 0.00 1.00
#> TCGA-06-0152-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0154-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0164-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0175-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0176-01A-03     2   0.000      0.999 0.00 1.00
#> TCGA-06-0184-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0189-01A-05     2   0.000      0.999 0.00 1.00
#> TCGA-06-0190-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0194-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0197-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0210-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0397-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0409-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0412-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-06-0644-01A-02     2   0.000      0.999 0.00 1.00
#> TCGA-06-0645-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0346-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0352-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0360-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0390-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0392-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0509-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0510-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0512-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-08-0522-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-12-0619-01A-01     2   0.000      0.999 0.00 1.00
#> TCGA-12-0620-01A-01     2   0.000      0.999 0.00 1.00

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>                     class entropy silhouette   p1   p2   p3
#> TCGA-02-0003-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0010-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0011-01B-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0014-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0024-01B-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0026-01B-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0028-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0046-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0047-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-02-0048-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0060-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0069-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0074-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0080-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0084-01A-03     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0087-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0104-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0114-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0281-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0321-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0325-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0338-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0339-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0432-01A-02     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0439-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0440-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0446-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0128-01A-01     1   0.153      0.958 0.96 0.00 0.04
#> TCGA-06-0129-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0146-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0156-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0166-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0174-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0177-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0238-01A-02     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0241-01A-02     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0410-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0413-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0414-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0646-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0648-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0245-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0344-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0347-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0348-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0350-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0353-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0359-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0385-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0517-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0524-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-12-0616-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-12-0618-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0089-01A-01     2   0.153      0.958 0.00 0.96 0.04
#> TCGA-02-0113-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-02-0115-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-02-0451-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0132-01A-02     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0133-01A-02     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0138-01A-02     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0160-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0162-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0167-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0171-01A-02     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0173-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0179-01A-02     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0182-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0185-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0195-01B-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0208-01B-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0214-01A-02     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0219-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0221-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0237-01A-02     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-06-0240-01A-02     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-08-0349-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-08-0380-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0386-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0520-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-02-0007-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0009-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0016-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0021-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0023-01B-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-02-0027-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0038-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-02-0043-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0070-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0102-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0260-01A-03     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0269-01B-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0285-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0289-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0290-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-02-0317-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0333-01A-02     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0422-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-02-0430-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0125-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0126-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0137-01A-03     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0145-01A-04     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0148-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0187-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0211-01B-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-06-0402-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0246-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0354-01A-01     3   0.000      0.991 0.00 0.00 1.00
#> TCGA-08-0355-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0357-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0358-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0375-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0511-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0514-01A-01     3   0.455      0.750 0.00 0.20 0.80
#> TCGA-08-0518-01A-01     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0529-01A-02     1   0.000      0.999 1.00 0.00 0.00
#> TCGA-08-0531-01A-01     3   0.153      0.952 0.04 0.00 0.96
#> TCGA-02-0057-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0004-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0006-01B-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0025-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0033-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0034-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0039-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0051-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0054-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0055-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0059-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0064-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0075-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0079-01A-03     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0085-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0086-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0099-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0106-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0107-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0111-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0326-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-02-0337-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0122-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0124-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0130-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0139-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0143-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0147-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0149-01A-05     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0152-01A-02     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0154-01A-02     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0164-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0175-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0176-01A-03     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0184-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0189-01A-05     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0190-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0194-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0197-01A-02     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0210-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0397-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0409-01A-02     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0412-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0644-01A-02     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-06-0645-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0346-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0352-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0360-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0390-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0392-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0509-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0510-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0512-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-08-0522-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-12-0619-01A-01     2   0.000      0.999 0.00 1.00 0.00
#> TCGA-12-0620-01A-01     2   0.000      0.999 0.00 1.00 0.00

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>                     class entropy silhouette   p1   p2   p3   p4
#> TCGA-02-0003-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0010-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0011-01B-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0014-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0024-01B-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0026-01B-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0028-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0046-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0047-01A-01     3  0.0707      0.975 0.02 0.00 0.98 0.00
#> TCGA-02-0048-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0060-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0069-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0074-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0080-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0084-01A-03     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0087-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0104-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0114-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0281-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0321-01A-01     1  0.0707      0.975 0.98 0.00 0.00 0.02
#> TCGA-02-0325-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0338-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0339-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0432-01A-02     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0439-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0440-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0446-01A-01     2  0.1637      0.923 0.06 0.94 0.00 0.00
#> TCGA-06-0128-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0129-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0146-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0156-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0166-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0174-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0177-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0238-01A-02     3  0.1637      0.928 0.06 0.00 0.94 0.00
#> TCGA-06-0241-01A-02     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0410-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0413-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0414-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0646-01A-01     2  0.2345      0.875 0.10 0.90 0.00 0.00
#> TCGA-06-0648-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0245-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0344-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0347-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0348-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0350-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0353-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0359-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0385-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0517-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-08-0524-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-12-0616-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-12-0618-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0089-01A-01     2  0.1211      0.950 0.00 0.96 0.04 0.00
#> TCGA-02-0113-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-02-0115-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-02-0451-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0132-01A-02     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0133-01A-02     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0138-01A-02     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0160-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0162-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0167-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-06-0171-01A-02     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0173-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0179-01A-02     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0182-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0185-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0195-01B-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0208-01B-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0214-01A-02     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0219-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0221-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0237-01A-02     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-06-0240-01A-02     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-08-0349-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-08-0380-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0386-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-08-0520-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-02-0007-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0009-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0016-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0021-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0023-01B-01     4  0.3172      0.810 0.00 0.00 0.16 0.84
#> TCGA-02-0027-01A-01     1  0.0000      0.996 1.00 0.00 0.00 0.00
#> TCGA-02-0038-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-02-0043-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0070-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0102-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0260-01A-03     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0269-01B-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0285-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0289-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0290-01A-01     3  0.0707      0.972 0.00 0.02 0.98 0.00
#> TCGA-02-0317-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0333-01A-02     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0422-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0430-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-06-0125-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-06-0126-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-06-0137-01A-03     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-06-0145-01A-04     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-06-0148-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-06-0187-01A-01     2  0.4134      0.653 0.00 0.74 0.00 0.26
#> TCGA-06-0211-01B-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-06-0402-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-08-0246-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0354-01A-01     3  0.0000      0.995 0.00 0.00 1.00 0.00
#> TCGA-08-0355-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0357-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-08-0358-01A-01     4  0.1637      0.921 0.06 0.00 0.00 0.94
#> TCGA-08-0375-01A-01     1  0.3400      0.780 0.82 0.00 0.00 0.18
#> TCGA-08-0511-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-08-0514-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-08-0518-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-08-0529-01A-02     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-08-0531-01A-01     4  0.0000      0.992 0.00 0.00 0.00 1.00
#> TCGA-02-0057-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0004-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0006-01B-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0025-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0033-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0034-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0039-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0051-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0054-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0055-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0059-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0064-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0075-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0079-01A-03     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0085-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0086-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0099-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0106-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0107-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0111-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-02-0326-01A-01     2  0.4277      0.614 0.00 0.72 0.00 0.28
#> TCGA-02-0337-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0122-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0124-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0130-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0139-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0143-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0147-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0149-01A-05     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0152-01A-02     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0154-01A-02     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0164-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0175-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0176-01A-03     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0184-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0189-01A-05     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0190-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0194-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0197-01A-02     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0210-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0397-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0409-01A-02     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0412-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0644-01A-02     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-06-0645-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0346-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0352-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0360-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0390-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0392-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0509-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0510-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0512-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-08-0522-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-12-0619-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00
#> TCGA-12-0620-01A-01     2  0.0000      0.988 0.00 1.00 0.00 0.00

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-node-0-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-node-0-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-node-0-consensus-heatmap-3

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

membership_heatmap(res, k = 2)

plot of chunk tab-node-0-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-node-0-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-node-0-membership-heatmap-3

As soon as the classes for columns are determined, the signatures that are significantly different between subgroups can be looked for. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-node-0-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-node-0-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-node-0-get-signatures-3

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-node-0-get-signatures-no-scale-1

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

plot of chunk tab-node-0-get-signatures-no-scale-2

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

plot of chunk tab-node-0-get-signatures-no-scale-3

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk node-0-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 (which is done by automatically selecting number of clusters).

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs:

# code only for demonstration
# e.g. to show the top 500 most significant rows
tb = get_signature(res, k = ..., top_signatures = 500)

If the signatures are defined as these which are uniquely high in current group, diff_method argument can be set to "uniquely_high_in_one_group":

# code only for demonstration
tb = get_signature(res, k = ..., diff_method = "uniquely_high_in_one_group")

UMAP plot which shows how samples are separated.

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

plot of chunk tab-node-0-dimension-reduction-1

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

plot of chunk tab-node-0-dimension-reduction-2

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

plot of chunk tab-node-0-dimension-reduction-3

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk node-0-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n_sample subtype(p-value) k
#> ATC:skmeans      173         3.31e-24 2
#> ATC:skmeans      173         3.09e-42 3
#> ATC:skmeans      173         2.35e-71 4

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.


Node01

Parent node: Node0. Child nodes: Node011-leaf , Node012 , Node013-leaf , Node021 , Node022 , Node023-leaf , Node031-leaf , Node032-leaf , Node033-leaf , Node034-leaf , Node041-leaf , Node042-leaf .

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

res = res_rh["01"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4.
#>   On a matrix with 10703 rows and 52 columns.
#>   Top rows (1070) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 150 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_partitions"     
#>  [7] "compare_signatures"      "consensus_heatmap"       "dimension_reduction"    
#> [10] "functional_enrichment"   "get_anno_col"            "get_anno"               
#> [13] "get_classes"             "get_consensus"           "get_matrix"             
#> [16] "get_membership"          "get_param"               "get_signatures"         
#> [19] "get_stats"               "is_best_k"               "is_stable_k"            
#> [22] "membership_heatmap"      "ncol"                    "nrow"                   
#> [25] "plot_ecdf"               "predict_classes"         "rownames"               
#> [28] "select_partition_number" "show"                    "suggest_best_k"         
#> [31] "test_to_known_factors"   "top_rows_heatmap"

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

collect_plots(res)

plot of chunk node-01-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, higher 1-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 node-01-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           1.000       1.000         0.4982 0.502   0.502
#> 3 3 1.000           0.986       0.994         0.3490 0.803   0.617
#> 4 4 0.906           0.885       0.938         0.0957 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] 4
#> attr(,"optional")
#> [1] 2 3

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

Following is 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 subgroup 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
#> TCGA-02-0003-01A-01     1       0          1  1  0
#> TCGA-02-0010-01A-01     1       0          1  1  0
#> TCGA-02-0011-01B-01     2       0          1  0  1
#> TCGA-02-0014-01A-01     1       0          1  1  0
#> TCGA-02-0024-01B-01     1       0          1  1  0
#> TCGA-02-0026-01B-01     1       0          1  1  0
#> TCGA-02-0028-01A-01     1       0          1  1  0
#> TCGA-02-0046-01A-01     1       0          1  1  0
#> TCGA-02-0048-01A-01     1       0          1  1  0
#> TCGA-02-0060-01A-01     2       0          1  0  1
#> TCGA-02-0069-01A-01     1       0          1  1  0
#> TCGA-02-0074-01A-01     1       0          1  1  0
#> TCGA-02-0080-01A-01     2       0          1  0  1
#> TCGA-02-0087-01A-01     2       0          1  0  1
#> TCGA-02-0104-01A-01     1       0          1  1  0
#> TCGA-02-0114-01A-01     1       0          1  1  0
#> TCGA-02-0281-01A-01     1       0          1  1  0
#> TCGA-02-0321-01A-01     2       0          1  0  1
#> TCGA-02-0325-01A-01     2       0          1  0  1
#> TCGA-02-0338-01A-01     1       0          1  1  0
#> TCGA-02-0339-01A-01     1       0          1  1  0
#> TCGA-02-0432-01A-02     2       0          1  0  1
#> TCGA-02-0439-01A-01     2       0          1  0  1
#> TCGA-02-0440-01A-01     1       0          1  1  0
#> TCGA-06-0128-01A-01     2       0          1  0  1
#> TCGA-06-0129-01A-01     1       0          1  1  0
#> TCGA-06-0146-01A-01     2       0          1  0  1
#> TCGA-06-0156-01A-01     1       0          1  1  0
#> TCGA-06-0166-01A-01     1       0          1  1  0
#> TCGA-06-0174-01A-01     1       0          1  1  0
#> TCGA-06-0177-01A-01     1       0          1  1  0
#> TCGA-06-0241-01A-02     1       0          1  1  0
#> TCGA-06-0410-01A-01     1       0          1  1  0
#> TCGA-06-0413-01A-01     1       0          1  1  0
#> TCGA-06-0414-01A-01     1       0          1  1  0
#> TCGA-06-0648-01A-01     2       0          1  0  1
#> TCGA-08-0245-01A-01     1       0          1  1  0
#> TCGA-08-0344-01A-01     2       0          1  0  1
#> TCGA-08-0347-01A-01     2       0          1  0  1
#> TCGA-08-0348-01A-01     2       0          1  0  1
#> TCGA-08-0350-01A-01     2       0          1  0  1
#> TCGA-08-0353-01A-01     1       0          1  1  0
#> TCGA-08-0359-01A-01     2       0          1  0  1
#> TCGA-08-0385-01A-01     2       0          1  0  1
#> TCGA-08-0517-01A-01     1       0          1  1  0
#> TCGA-08-0524-01A-01     1       0          1  1  0
#> TCGA-12-0616-01A-01     1       0          1  1  0
#> TCGA-12-0618-01A-01     2       0          1  0  1
#> TCGA-06-0160-01A-01     2       0          1  0  1
#> TCGA-06-0167-01A-01     2       0          1  0  1
#> TCGA-02-0027-01A-01     2       0          1  0  1
#> TCGA-08-0375-01A-01     2       0          1  0  1

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>                     class entropy silhouette p1  p2  p3
#> TCGA-02-0003-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-02-0010-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0011-01B-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0014-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0024-01B-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0026-01B-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0028-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0046-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-02-0048-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-02-0060-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0069-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0074-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0080-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0087-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0104-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-02-0114-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-02-0281-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0321-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0325-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0338-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0339-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-02-0432-01A-02     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0439-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0440-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-06-0128-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-06-0129-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-06-0146-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-06-0156-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-06-0166-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-06-0174-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-06-0177-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-06-0241-01A-02     1   0.000      1.000  1 0.0 0.0
#> TCGA-06-0410-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-06-0413-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-06-0414-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-06-0648-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-08-0245-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-08-0344-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-08-0347-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-08-0348-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-08-0350-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-08-0353-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-08-0359-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-08-0385-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-08-0517-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-08-0524-01A-01     3   0.000      1.000  0 0.0 1.0
#> TCGA-12-0616-01A-01     1   0.000      1.000  1 0.0 0.0
#> TCGA-12-0618-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-06-0160-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-06-0167-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-02-0027-01A-01     2   0.000      0.985  0 1.0 0.0
#> TCGA-08-0375-01A-01     2   0.556      0.571  0 0.7 0.3

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>                     class entropy silhouette   p1   p2   p3   p4
#> TCGA-02-0003-01A-01     1  0.0707      0.947 0.98 0.00 0.00 0.02
#> TCGA-02-0010-01A-01     3  0.0000      0.970 0.00 0.00 1.00 0.00
#> TCGA-02-0011-01B-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-02-0014-01A-01     3  0.1637      0.930 0.06 0.00 0.94 0.00
#> TCGA-02-0024-01B-01     3  0.0000      0.970 0.00 0.00 1.00 0.00
#> TCGA-02-0026-01B-01     3  0.1637      0.947 0.00 0.00 0.94 0.06
#> TCGA-02-0028-01A-01     3  0.0707      0.960 0.02 0.00 0.98 0.00
#> TCGA-02-0046-01A-01     1  0.1913      0.920 0.94 0.00 0.04 0.02
#> TCGA-02-0048-01A-01     1  0.1637      0.928 0.94 0.00 0.00 0.06
#> TCGA-02-0060-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-02-0069-01A-01     3  0.0000      0.970 0.00 0.00 1.00 0.00
#> TCGA-02-0074-01A-01     3  0.0000      0.970 0.00 0.00 1.00 0.00
#> TCGA-02-0080-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-02-0087-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-02-0104-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-02-0114-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-02-0281-01A-01     3  0.0000      0.970 0.00 0.00 1.00 0.00
#> TCGA-02-0321-01A-01     2  0.4277      0.641 0.00 0.72 0.00 0.28
#> TCGA-02-0325-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-02-0338-01A-01     3  0.0000      0.970 0.00 0.00 1.00 0.00
#> TCGA-02-0339-01A-01     3  0.2011      0.936 0.00 0.00 0.92 0.08
#> TCGA-02-0432-01A-02     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-02-0439-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-02-0440-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-06-0128-01A-01     1  0.6262      0.310 0.54 0.40 0.00 0.06
#> TCGA-06-0129-01A-01     3  0.1211      0.956 0.00 0.00 0.96 0.04
#> TCGA-06-0146-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-06-0156-01A-01     1  0.1637      0.928 0.94 0.00 0.00 0.06
#> TCGA-06-0166-01A-01     1  0.1211      0.940 0.96 0.00 0.00 0.04
#> TCGA-06-0174-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-06-0177-01A-01     3  0.2011      0.936 0.00 0.00 0.92 0.08
#> TCGA-06-0241-01A-02     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-06-0410-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-06-0413-01A-01     3  0.0000      0.970 0.00 0.00 1.00 0.00
#> TCGA-06-0414-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-06-0648-01A-01     4  0.3400      0.901 0.00 0.18 0.00 0.82
#> TCGA-08-0245-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-08-0344-01A-01     4  0.3801      0.864 0.00 0.22 0.00 0.78
#> TCGA-08-0347-01A-01     2  0.3801      0.716 0.00 0.78 0.00 0.22
#> TCGA-08-0348-01A-01     2  0.4907      0.197 0.00 0.58 0.00 0.42
#> TCGA-08-0350-01A-01     2  0.4134      0.670 0.00 0.74 0.00 0.26
#> TCGA-08-0353-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-08-0359-01A-01     2  0.3400      0.746 0.00 0.82 0.00 0.18
#> TCGA-08-0385-01A-01     4  0.2345      0.894 0.00 0.10 0.00 0.90
#> TCGA-08-0517-01A-01     1  0.1211      0.940 0.96 0.00 0.00 0.04
#> TCGA-08-0524-01A-01     3  0.1637      0.930 0.06 0.00 0.94 0.00
#> TCGA-12-0616-01A-01     1  0.0000      0.953 1.00 0.00 0.00 0.00
#> TCGA-12-0618-01A-01     4  0.3172      0.906 0.00 0.16 0.00 0.84
#> TCGA-06-0160-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-06-0167-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-02-0027-01A-01     2  0.0000      0.890 0.00 1.00 0.00 0.00
#> TCGA-08-0375-01A-01     4  0.2335      0.851 0.00 0.06 0.02 0.92

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-node-01-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-node-01-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-node-01-consensus-heatmap-3

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

membership_heatmap(res, k = 2)

plot of chunk tab-node-01-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-node-01-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-node-01-membership-heatmap-3

As soon as the classes for columns are determined, the signatures that are significantly different between subgroups can be looked for. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-node-01-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-node-01-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-node-01-get-signatures-3

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-node-01-get-signatures-no-scale-1

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

plot of chunk tab-node-01-get-signatures-no-scale-2

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

plot of chunk tab-node-01-get-signatures-no-scale-3

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk node-01-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 (which is done by automatically selecting number of clusters).

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs:

# code only for demonstration
# e.g. to show the top 500 most significant rows
tb = get_signature(res, k = ..., top_signatures = 500)

If the signatures are defined as these which are uniquely high in current group, diff_method argument can be set to "uniquely_high_in_one_group":

# code only for demonstration
tb = get_signature(res, k = ..., diff_method = "uniquely_high_in_one_group")

UMAP plot which shows how samples are separated.

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

plot of chunk tab-node-01-dimension-reduction-1

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

plot of chunk tab-node-01-dimension-reduction-2

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

plot of chunk tab-node-01-dimension-reduction-3

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk node-01-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n_sample subtype(p-value) k
#> ATC:skmeans       52           0.0521 2
#> ATC:skmeans       52           0.1714 3
#> ATC:skmeans       50           0.1309 4

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.


Node012

Parent node: Node01. Child nodes: Node0121-leaf , Node0122-leaf , Node0211-leaf , Node0212-leaf , Node0213-leaf , Node0221-leaf , Node0222-leaf .

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

res = res_rh["012"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4.
#>   On a matrix with 10703 rows and 21 columns.
#>   Top rows (806) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 150 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_partitions"     
#>  [7] "compare_signatures"      "consensus_heatmap"       "dimension_reduction"    
#> [10] "functional_enrichment"   "get_anno_col"            "get_anno"               
#> [13] "get_classes"             "get_consensus"           "get_matrix"             
#> [16] "get_membership"          "get_param"               "get_signatures"         
#> [19] "get_stats"               "is_best_k"               "is_stable_k"            
#> [22] "membership_heatmap"      "ncol"                    "nrow"                   
#> [25] "plot_ecdf"               "predict_classes"         "rownames"               
#> [28] "select_partition_number" "show"                    "suggest_best_k"         
#> [31] "test_to_known_factors"   "top_rows_heatmap"

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

collect_plots(res)

plot of chunk node-012-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, higher 1-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 node-012-select-partition-number

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.992       0.996          0.524 0.476   0.476
#> 3 3 0.974           0.960       0.961          0.274 0.857   0.700
#> 4 4 0.826           0.876       0.942          0.162 0.838   0.547

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 is 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 subgroup 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
#> TCGA-02-0011-01B-01     2   0.000      0.992 0.00 1.00
#> TCGA-02-0060-01A-01     2   0.000      0.992 0.00 1.00
#> TCGA-02-0080-01A-01     2   0.000      0.992 0.00 1.00
#> TCGA-02-0087-01A-01     2   0.000      0.992 0.00 1.00
#> TCGA-02-0321-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0325-01A-01     2   0.000      0.992 0.00 1.00
#> TCGA-02-0432-01A-02     2   0.000      0.992 0.00 1.00
#> TCGA-02-0439-01A-01     2   0.402      0.913 0.08 0.92
#> TCGA-06-0146-01A-01     2   0.000      0.992 0.00 1.00
#> TCGA-06-0648-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0344-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0347-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0348-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0350-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0359-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0385-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-12-0618-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0160-01A-01     2   0.000      0.992 0.00 1.00
#> TCGA-06-0167-01A-01     2   0.000      0.992 0.00 1.00
#> TCGA-02-0027-01A-01     2   0.000      0.992 0.00 1.00
#> TCGA-08-0375-01A-01     1   0.000      1.000 1.00 0.00

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>                     class entropy silhouette   p1   p2   p3
#> TCGA-02-0011-01B-01     2   0.000      0.980 0.00 1.00 0.00
#> TCGA-02-0060-01A-01     3   0.254      0.969 0.00 0.08 0.92
#> TCGA-02-0080-01A-01     2   0.000      0.980 0.00 1.00 0.00
#> TCGA-02-0087-01A-01     2   0.000      0.980 0.00 1.00 0.00
#> TCGA-02-0321-01A-01     1   0.153      0.956 0.96 0.00 0.04
#> TCGA-02-0325-01A-01     2   0.304      0.901 0.04 0.92 0.04
#> TCGA-02-0432-01A-02     2   0.000      0.980 0.00 1.00 0.00
#> TCGA-02-0439-01A-01     3   0.153      0.897 0.04 0.00 0.96
#> TCGA-06-0146-01A-01     2   0.000      0.980 0.00 1.00 0.00
#> TCGA-06-0648-01A-01     1   0.153      0.964 0.96 0.00 0.04
#> TCGA-08-0344-01A-01     1   0.000      0.963 1.00 0.00 0.00
#> TCGA-08-0347-01A-01     1   0.153      0.964 0.96 0.00 0.04
#> TCGA-08-0348-01A-01     1   0.153      0.964 0.96 0.00 0.04
#> TCGA-08-0350-01A-01     1   0.153      0.956 0.96 0.00 0.04
#> TCGA-08-0359-01A-01     1   0.153      0.964 0.96 0.00 0.04
#> TCGA-08-0385-01A-01     1   0.153      0.956 0.96 0.00 0.04
#> TCGA-12-0618-01A-01     1   0.153      0.964 0.96 0.00 0.04
#> TCGA-06-0160-01A-01     3   0.254      0.969 0.00 0.08 0.92
#> TCGA-06-0167-01A-01     3   0.254      0.969 0.00 0.08 0.92
#> TCGA-02-0027-01A-01     3   0.296      0.955 0.00 0.10 0.90
#> TCGA-08-0375-01A-01     1   0.153      0.956 0.96 0.00 0.04

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>                     class entropy silhouette   p1   p2   p3   p4
#> TCGA-02-0011-01B-01     2   0.121      0.938 0.00 0.96 0.04 0.00
#> TCGA-02-0060-01A-01     3   0.000      1.000 0.00 0.00 1.00 0.00
#> TCGA-02-0080-01A-01     2   0.000      0.964 0.00 1.00 0.00 0.00
#> TCGA-02-0087-01A-01     2   0.000      0.964 0.00 1.00 0.00 0.00
#> TCGA-02-0321-01A-01     1   0.452      0.479 0.68 0.00 0.00 0.32
#> TCGA-02-0325-01A-01     2   0.292      0.844 0.14 0.86 0.00 0.00
#> TCGA-02-0432-01A-02     2   0.000      0.964 0.00 1.00 0.00 0.00
#> TCGA-02-0439-01A-01     4   0.234      0.803 0.00 0.00 0.10 0.90
#> TCGA-06-0146-01A-01     2   0.000      0.964 0.00 1.00 0.00 0.00
#> TCGA-06-0648-01A-01     4   0.361      0.752 0.20 0.00 0.00 0.80
#> TCGA-08-0344-01A-01     1   0.320      0.818 0.88 0.04 0.00 0.08
#> TCGA-08-0347-01A-01     4   0.000      0.875 0.00 0.00 0.00 1.00
#> TCGA-08-0348-01A-01     4   0.000      0.875 0.00 0.00 0.00 1.00
#> TCGA-08-0350-01A-01     1   0.000      0.845 1.00 0.00 0.00 0.00
#> TCGA-08-0359-01A-01     4   0.000      0.875 0.00 0.00 0.00 1.00
#> TCGA-08-0385-01A-01     1   0.164      0.848 0.94 0.00 0.00 0.06
#> TCGA-12-0618-01A-01     4   0.361      0.752 0.20 0.00 0.00 0.80
#> TCGA-06-0160-01A-01     3   0.000      1.000 0.00 0.00 1.00 0.00
#> TCGA-06-0167-01A-01     3   0.000      1.000 0.00 0.00 1.00 0.00
#> TCGA-02-0027-01A-01     3   0.000      1.000 0.00 0.00 1.00 0.00
#> TCGA-08-0375-01A-01     1   0.121      0.844 0.96 0.00 0.00 0.04

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-node-012-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-node-012-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-node-012-consensus-heatmap-3

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

membership_heatmap(res, k = 2)

plot of chunk tab-node-012-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-node-012-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-node-012-membership-heatmap-3

As soon as the classes for columns are determined, the signatures that are significantly different between subgroups can be looked for. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-node-012-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-node-012-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-node-012-get-signatures-3

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-node-012-get-signatures-no-scale-1

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

plot of chunk tab-node-012-get-signatures-no-scale-2

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

plot of chunk tab-node-012-get-signatures-no-scale-3

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk node-012-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 (which is done by automatically selecting number of clusters).

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs:

# code only for demonstration
# e.g. to show the top 500 most significant rows
tb = get_signature(res, k = ..., top_signatures = 500)

If the signatures are defined as these which are uniquely high in current group, diff_method argument can be set to "uniquely_high_in_one_group":

# code only for demonstration
tb = get_signature(res, k = ..., diff_method = "uniquely_high_in_one_group")

UMAP plot which shows how samples are separated.

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

plot of chunk tab-node-012-dimension-reduction-1

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

plot of chunk tab-node-012-dimension-reduction-2

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

plot of chunk tab-node-012-dimension-reduction-3

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk node-012-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n_sample subtype(p-value) k
#> ATC:skmeans       21           0.3650 2
#> ATC:skmeans       21           0.0622 3
#> ATC:skmeans       20           0.0411 4

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.


Node02

Parent node: Node0. Child nodes: Node011-leaf , Node012 , Node013-leaf , Node021 , Node022 , Node023-leaf , Node031-leaf , Node032-leaf , Node033-leaf , Node034-leaf , Node041-leaf , Node042-leaf .

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

res = res_rh["02"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4.
#>   On a matrix with 10703 rows and 66 columns.
#>   Top rows (982) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 150 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_partitions"     
#>  [7] "compare_signatures"      "consensus_heatmap"       "dimension_reduction"    
#> [10] "functional_enrichment"   "get_anno_col"            "get_anno"               
#> [13] "get_classes"             "get_consensus"           "get_matrix"             
#> [16] "get_membership"          "get_param"               "get_signatures"         
#> [19] "get_stats"               "is_best_k"               "is_stable_k"            
#> [22] "membership_heatmap"      "ncol"                    "nrow"                   
#> [25] "plot_ecdf"               "predict_classes"         "rownames"               
#> [28] "select_partition_number" "show"                    "suggest_best_k"         
#> [31] "test_to_known_factors"   "top_rows_heatmap"

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

collect_plots(res)

plot of chunk node-02-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, higher 1-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 node-02-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.990       0.995          0.502 0.500   0.500
#> 3 3 0.980           0.956       0.981          0.337 0.763   0.557
#> 4 4 0.724           0.743       0.857          0.110 0.865   0.628

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 is 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 subgroup 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
#> TCGA-02-0084-01A-03     2   0.000      0.991 0.00 1.00
#> TCGA-02-0446-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-06-0646-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0089-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0451-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-06-0132-01A-02     2   0.000      0.991 0.00 1.00
#> TCGA-08-0380-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-06-0187-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-08-0246-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-08-0355-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0057-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0004-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0006-01B-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0025-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0033-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0034-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0039-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0051-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0054-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0055-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0059-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0064-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0075-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0079-01A-03     2   0.000      0.991 0.00 1.00
#> TCGA-02-0085-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0086-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0099-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0106-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0107-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0111-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-02-0326-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-02-0337-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-06-0122-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-06-0124-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-06-0130-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0139-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0143-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-06-0147-01A-01     2   0.584      0.839 0.14 0.86
#> TCGA-06-0149-01A-05     2   0.000      0.991 0.00 1.00
#> TCGA-06-0152-01A-02     2   0.000      0.991 0.00 1.00
#> TCGA-06-0154-01A-02     1   0.000      1.000 1.00 0.00
#> TCGA-06-0164-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0175-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0176-01A-03     1   0.000      1.000 1.00 0.00
#> TCGA-06-0184-01A-01     2   0.680      0.783 0.18 0.82
#> TCGA-06-0189-01A-05     1   0.000      1.000 1.00 0.00
#> TCGA-06-0190-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0194-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0197-01A-02     1   0.000      1.000 1.00 0.00
#> TCGA-06-0210-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0397-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-06-0409-01A-02     2   0.000      0.991 0.00 1.00
#> TCGA-06-0412-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-06-0644-01A-02     1   0.000      1.000 1.00 0.00
#> TCGA-06-0645-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-08-0346-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-08-0352-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-08-0360-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-08-0390-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0392-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0509-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-08-0510-01A-01     2   0.000      0.991 0.00 1.00
#> TCGA-08-0512-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-08-0522-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-12-0619-01A-01     1   0.000      1.000 1.00 0.00
#> TCGA-12-0620-01A-01     2   0.000      0.991 0.00 1.00

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>                     class entropy silhouette   p1   p2   p3
#> TCGA-02-0084-01A-03     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-02-0446-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-06-0646-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-02-0089-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-02-0451-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-06-0132-01A-02     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-08-0380-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-06-0187-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-08-0246-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-08-0355-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-02-0057-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-02-0004-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-02-0006-01B-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-02-0025-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-02-0033-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-02-0034-01A-01     1  0.6045      0.379 0.62 0.38 0.00
#> TCGA-02-0039-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-02-0051-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-02-0054-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-02-0055-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-02-0059-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-02-0064-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-02-0075-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-02-0079-01A-03     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-02-0085-01A-01     2  0.5016      0.714 0.00 0.76 0.24
#> TCGA-02-0086-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-02-0099-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-02-0106-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-02-0107-01A-01     2  0.0892      0.956 0.00 0.98 0.02
#> TCGA-02-0111-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-02-0326-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-02-0337-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-06-0122-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-06-0124-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-06-0130-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0139-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0143-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-06-0147-01A-01     2  0.2066      0.924 0.00 0.94 0.06
#> TCGA-06-0149-01A-05     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-06-0152-01A-02     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-06-0154-01A-02     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0164-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0175-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-06-0176-01A-03     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0184-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-06-0189-01A-05     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0190-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0194-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0197-01A-02     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0210-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0397-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0409-01A-02     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-06-0412-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-06-0644-01A-02     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-06-0645-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-08-0346-01A-01     3  0.0000      1.000 0.00 0.00 1.00
#> TCGA-08-0352-01A-01     2  0.4796      0.741 0.00 0.78 0.22
#> TCGA-08-0360-01A-01     2  0.3686      0.845 0.00 0.86 0.14
#> TCGA-08-0390-01A-01     1  0.4796      0.710 0.78 0.00 0.22
#> TCGA-08-0392-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-08-0509-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-08-0510-01A-01     2  0.0000      0.970 0.00 1.00 0.00
#> TCGA-08-0512-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-08-0522-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-12-0619-01A-01     1  0.0000      0.974 1.00 0.00 0.00
#> TCGA-12-0620-01A-01     3  0.0000      1.000 0.00 0.00 1.00

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>                     class entropy silhouette   p1   p2   p3   p4
#> TCGA-02-0084-01A-03     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-02-0446-01A-01     2  0.4624     0.7319 0.00 0.66 0.00 0.34
#> TCGA-06-0646-01A-01     2  0.5820     0.6994 0.00 0.68 0.08 0.24
#> TCGA-02-0089-01A-01     4  0.0000     0.6846 0.00 0.00 0.00 1.00
#> TCGA-02-0451-01A-01     4  0.0000     0.6846 0.00 0.00 0.00 1.00
#> TCGA-06-0132-01A-02     4  0.4624     0.4482 0.00 0.00 0.34 0.66
#> TCGA-08-0380-01A-01     4  0.4624     0.4482 0.00 0.00 0.34 0.66
#> TCGA-06-0187-01A-01     2  0.4790     0.7040 0.00 0.62 0.00 0.38
#> TCGA-08-0246-01A-01     3  0.4406     0.5403 0.00 0.00 0.70 0.30
#> TCGA-08-0355-01A-01     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-02-0057-01A-01     4  0.2921     0.7231 0.00 0.14 0.00 0.86
#> TCGA-02-0004-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-02-0006-01B-01     2  0.4977     0.6195 0.00 0.54 0.00 0.46
#> TCGA-02-0025-01A-01     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-02-0033-01A-01     1  0.3400     0.8761 0.82 0.18 0.00 0.00
#> TCGA-02-0034-01A-01     2  0.0000     0.6187 0.00 1.00 0.00 0.00
#> TCGA-02-0039-01A-01     3  0.3172     0.7542 0.00 0.00 0.84 0.16
#> TCGA-02-0051-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-02-0054-01A-01     2  0.4624     0.7319 0.00 0.66 0.00 0.34
#> TCGA-02-0055-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-02-0059-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-02-0064-01A-01     2  0.3400     0.7121 0.00 0.82 0.00 0.18
#> TCGA-02-0075-01A-01     2  0.1637     0.6676 0.00 0.94 0.00 0.06
#> TCGA-02-0079-01A-03     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-02-0085-01A-01     4  0.4088     0.7329 0.00 0.14 0.04 0.82
#> TCGA-02-0086-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-02-0099-01A-01     2  0.4624     0.7319 0.00 0.66 0.00 0.34
#> TCGA-02-0106-01A-01     1  0.2345     0.9030 0.90 0.10 0.00 0.00
#> TCGA-02-0107-01A-01     4  0.2345     0.7272 0.00 0.10 0.00 0.90
#> TCGA-02-0111-01A-01     3  0.3400     0.6795 0.18 0.00 0.82 0.00
#> TCGA-02-0326-01A-01     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-02-0337-01A-01     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-06-0122-01A-01     2  0.3400     0.7121 0.00 0.82 0.00 0.18
#> TCGA-06-0124-01A-01     2  0.3400     0.7121 0.00 0.82 0.00 0.18
#> TCGA-06-0130-01A-01     1  0.3400     0.8761 0.82 0.18 0.00 0.00
#> TCGA-06-0139-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-06-0143-01A-01     2  0.3400     0.7121 0.00 0.82 0.00 0.18
#> TCGA-06-0147-01A-01     2  0.6855     0.1118 0.00 0.60 0.20 0.20
#> TCGA-06-0149-01A-05     3  0.3172     0.7582 0.00 0.00 0.84 0.16
#> TCGA-06-0152-01A-02     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-06-0154-01A-02     1  0.3400     0.8761 0.82 0.18 0.00 0.00
#> TCGA-06-0164-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-06-0175-01A-01     2  0.3801     0.6832 0.00 0.78 0.00 0.22
#> TCGA-06-0176-01A-03     1  0.3400     0.8761 0.82 0.18 0.00 0.00
#> TCGA-06-0184-01A-01     4  0.5594     0.5958 0.18 0.00 0.10 0.72
#> TCGA-06-0189-01A-05     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-06-0190-01A-01     1  0.3400     0.8761 0.82 0.18 0.00 0.00
#> TCGA-06-0194-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-06-0197-01A-02     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-06-0210-01A-01     1  0.0707     0.9223 0.98 0.02 0.00 0.00
#> TCGA-06-0397-01A-01     1  0.3400     0.8761 0.82 0.18 0.00 0.00
#> TCGA-06-0409-01A-02     4  0.6477     0.5142 0.00 0.30 0.10 0.60
#> TCGA-06-0412-01A-01     2  0.4522     0.7346 0.00 0.68 0.00 0.32
#> TCGA-06-0644-01A-02     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-06-0645-01A-01     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-08-0346-01A-01     3  0.0000     0.8880 0.00 0.00 1.00 0.00
#> TCGA-08-0352-01A-01     3  0.7427     0.0831 0.00 0.20 0.50 0.30
#> TCGA-08-0360-01A-01     2  0.7021     0.0263 0.00 0.48 0.40 0.12
#> TCGA-08-0390-01A-01     1  0.1211     0.8967 0.96 0.00 0.04 0.00
#> TCGA-08-0392-01A-01     1  0.0000     0.9255 1.00 0.00 0.00 0.00
#> TCGA-08-0509-01A-01     4  0.3801     0.6584 0.00 0.22 0.00 0.78
#> TCGA-08-0510-01A-01     2  0.4624     0.7319 0.00 0.66 0.00 0.34
#> TCGA-08-0512-01A-01     1  0.3975     0.8206 0.76 0.24 0.00 0.00
#> TCGA-08-0522-01A-01     1  0.3400     0.8761 0.82 0.18 0.00 0.00
#> TCGA-12-0619-01A-01     2  0.4994    -0.3099 0.48 0.52 0.00 0.00
#> TCGA-12-0620-01A-01     3  0.0000     0.8880 0.00 0.00 1.00 0.00

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-node-02-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-node-02-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-node-02-consensus-heatmap-3

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

membership_heatmap(res, k = 2)

plot of chunk tab-node-02-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-node-02-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-node-02-membership-heatmap-3

As soon as the classes for columns are determined, the signatures that are significantly different between subgroups can be looked for. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-node-02-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-node-02-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-node-02-get-signatures-3

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-node-02-get-signatures-no-scale-1

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

plot of chunk tab-node-02-get-signatures-no-scale-2

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

plot of chunk tab-node-02-get-signatures-no-scale-3

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk node-02-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 (which is done by automatically selecting number of clusters).

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs:

# code only for demonstration
# e.g. to show the top 500 most significant rows
tb = get_signature(res, k = ..., top_signatures = 500)

If the signatures are defined as these which are uniquely high in current group, diff_method argument can be set to "uniquely_high_in_one_group":

# code only for demonstration
tb = get_signature(res, k = ..., diff_method = "uniquely_high_in_one_group")

UMAP plot which shows how samples are separated.

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

plot of chunk tab-node-02-dimension-reduction-1

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

plot of chunk tab-node-02-dimension-reduction-2

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

plot of chunk tab-node-02-dimension-reduction-3

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk node-02-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n_sample subtype(p-value) k
#> ATC:skmeans       66           0.0263 2
#> ATC:skmeans       65           0.1993 3
#> ATC:skmeans       60           0.0103 4

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.


Node021

Parent node: Node02. Child nodes: Node0121-leaf , Node0122-leaf , Node0211-leaf , Node0212-leaf , Node0213-leaf , Node0221-leaf , Node0222-leaf .

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

res = res_rh["021"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4.
#>   On a matrix with 10703 rows and 25 columns.
#>   Top rows (974) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 150 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_partitions"     
#>  [7] "compare_signatures"      "consensus_heatmap"       "dimension_reduction"    
#> [10] "functional_enrichment"   "get_anno_col"            "get_anno"               
#> [13] "get_classes"             "get_consensus"           "get_matrix"             
#> [16] "get_membership"          "get_param"               "get_signatures"         
#> [19] "get_stats"               "is_best_k"               "is_stable_k"            
#> [22] "membership_heatmap"      "ncol"                    "nrow"                   
#> [25] "plot_ecdf"               "predict_classes"         "rownames"               
#> [28] "select_partition_number" "show"                    "suggest_best_k"         
#> [31] "test_to_known_factors"   "top_rows_heatmap"

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

collect_plots(res)

plot of chunk node-021-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, higher 1-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 node-021-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           1.000       1.000          0.514 0.487   0.487
#> 3 3 1.000           0.966       0.984          0.301 0.850   0.692
#> 4 4 0.763           0.834       0.918          0.102 0.940   0.822

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 is 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 subgroup 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
#> TCGA-02-0004-01A-01     2       0          1  0  1
#> TCGA-02-0033-01A-01     1       0          1  1  0
#> TCGA-02-0034-01A-01     1       0          1  1  0
#> TCGA-02-0051-01A-01     2       0          1  0  1
#> TCGA-02-0055-01A-01     2       0          1  0  1
#> TCGA-02-0059-01A-01     2       0          1  0  1
#> TCGA-02-0086-01A-01     2       0          1  0  1
#> TCGA-02-0106-01A-01     1       0          1  1  0
#> TCGA-06-0130-01A-01     1       0          1  1  0
#> TCGA-06-0139-01A-01     2       0          1  0  1
#> TCGA-06-0154-01A-02     1       0          1  1  0
#> TCGA-06-0164-01A-01     2       0          1  0  1
#> TCGA-06-0176-01A-03     1       0          1  1  0
#> TCGA-06-0189-01A-05     2       0          1  0  1
#> TCGA-06-0190-01A-01     1       0          1  1  0
#> TCGA-06-0194-01A-01     2       0          1  0  1
#> TCGA-06-0197-01A-02     2       0          1  0  1
#> TCGA-06-0210-01A-01     2       0          1  0  1
#> TCGA-06-0397-01A-01     1       0          1  1  0
#> TCGA-06-0644-01A-02     2       0          1  0  1
#> TCGA-08-0390-01A-01     2       0          1  0  1
#> TCGA-08-0392-01A-01     2       0          1  0  1
#> TCGA-08-0512-01A-01     1       0          1  1  0
#> TCGA-08-0522-01A-01     1       0          1  1  0
#> TCGA-12-0619-01A-01     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>                     class entropy silhouette   p1   p2   p3
#> TCGA-02-0004-01A-01     2   0.000      0.977 0.00 1.00 0.00
#> TCGA-02-0033-01A-01     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-02-0034-01A-01     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-02-0051-01A-01     2   0.000      0.977 0.00 1.00 0.00
#> TCGA-02-0055-01A-01     2   0.000      0.977 0.00 1.00 0.00
#> TCGA-02-0059-01A-01     2   0.000      0.977 0.00 1.00 0.00
#> TCGA-02-0086-01A-01     3   0.000      1.000 0.00 0.00 1.00
#> TCGA-02-0106-01A-01     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-06-0130-01A-01     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-06-0139-01A-01     3   0.000      1.000 0.00 0.00 1.00
#> TCGA-06-0154-01A-02     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-06-0164-01A-01     3   0.000      1.000 0.00 0.00 1.00
#> TCGA-06-0176-01A-03     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-06-0189-01A-05     2   0.000      0.977 0.00 1.00 0.00
#> TCGA-06-0190-01A-01     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-06-0194-01A-01     3   0.000      1.000 0.00 0.00 1.00
#> TCGA-06-0197-01A-02     2   0.296      0.902 0.00 0.90 0.10
#> TCGA-06-0210-01A-01     3   0.000      1.000 0.00 0.00 1.00
#> TCGA-06-0397-01A-01     1   0.480      0.718 0.78 0.00 0.22
#> TCGA-06-0644-01A-02     2   0.000      0.977 0.00 1.00 0.00
#> TCGA-08-0390-01A-01     2   0.254      0.921 0.00 0.92 0.08
#> TCGA-08-0392-01A-01     2   0.000      0.977 0.00 1.00 0.00
#> TCGA-08-0512-01A-01     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-08-0522-01A-01     1   0.000      0.978 1.00 0.00 0.00
#> TCGA-12-0619-01A-01     1   0.000      0.978 1.00 0.00 0.00

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>                     class entropy silhouette   p1   p2   p3   p4
#> TCGA-02-0004-01A-01     2  0.4522      0.628 0.00 0.68 0.00 0.32
#> TCGA-02-0033-01A-01     1  0.0000      0.950 1.00 0.00 0.00 0.00
#> TCGA-02-0034-01A-01     1  0.0000      0.950 1.00 0.00 0.00 0.00
#> TCGA-02-0051-01A-01     2  0.0000      0.882 0.00 1.00 0.00 0.00
#> TCGA-02-0055-01A-01     2  0.0000      0.882 0.00 1.00 0.00 0.00
#> TCGA-02-0059-01A-01     2  0.0000      0.882 0.00 1.00 0.00 0.00
#> TCGA-02-0086-01A-01     3  0.2921      0.756 0.00 0.00 0.86 0.14
#> TCGA-02-0106-01A-01     4  0.2647      0.682 0.12 0.00 0.00 0.88
#> TCGA-06-0130-01A-01     1  0.0000      0.950 1.00 0.00 0.00 0.00
#> TCGA-06-0139-01A-01     3  0.3606      0.748 0.00 0.14 0.84 0.02
#> TCGA-06-0154-01A-02     1  0.4277      0.564 0.72 0.00 0.00 0.28
#> TCGA-06-0164-01A-01     3  0.0000      0.873 0.00 0.00 1.00 0.00
#> TCGA-06-0176-01A-03     1  0.0000      0.950 1.00 0.00 0.00 0.00
#> TCGA-06-0189-01A-05     2  0.0000      0.882 0.00 1.00 0.00 0.00
#> TCGA-06-0190-01A-01     1  0.0707      0.945 0.98 0.00 0.00 0.02
#> TCGA-06-0194-01A-01     3  0.0707      0.875 0.00 0.02 0.98 0.00
#> TCGA-06-0197-01A-02     2  0.3037      0.811 0.00 0.88 0.10 0.02
#> TCGA-06-0210-01A-01     3  0.1637      0.861 0.00 0.00 0.94 0.06
#> TCGA-06-0397-01A-01     4  0.6286      0.630 0.14 0.00 0.20 0.66
#> TCGA-06-0644-01A-02     2  0.4624      0.604 0.00 0.66 0.00 0.34
#> TCGA-08-0390-01A-01     2  0.2345      0.825 0.00 0.90 0.10 0.00
#> TCGA-08-0392-01A-01     2  0.0000      0.882 0.00 1.00 0.00 0.00
#> TCGA-08-0512-01A-01     1  0.0707      0.945 0.98 0.00 0.00 0.02
#> TCGA-08-0522-01A-01     1  0.0707      0.945 0.98 0.00 0.00 0.02
#> TCGA-12-0619-01A-01     1  0.0000      0.950 1.00 0.00 0.00 0.00

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-node-021-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-node-021-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-node-021-consensus-heatmap-3

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

membership_heatmap(res, k = 2)

plot of chunk tab-node-021-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-node-021-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-node-021-membership-heatmap-3

As soon as the classes for columns are determined, the signatures that are significantly different between subgroups can be looked for. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-node-021-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-node-021-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-node-021-get-signatures-3

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-node-021-get-signatures-no-scale-1

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

plot of chunk tab-node-021-get-signatures-no-scale-2

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

plot of chunk tab-node-021-get-signatures-no-scale-3

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk node-021-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 (which is done by automatically selecting number of clusters).

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs:

# code only for demonstration
# e.g. to show the top 500 most significant rows
tb = get_signature(res, k = ..., top_signatures = 500)

If the signatures are defined as these which are uniquely high in current group, diff_method argument can be set to "uniquely_high_in_one_group":

# code only for demonstration
tb = get_signature(res, k = ..., diff_method = "uniquely_high_in_one_group")

UMAP plot which shows how samples are separated.

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

plot of chunk tab-node-021-dimension-reduction-1

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

plot of chunk tab-node-021-dimension-reduction-2

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

plot of chunk tab-node-021-dimension-reduction-3

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk node-021-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n_sample subtype(p-value) k
#> ATC:skmeans       25               NA 2
#> ATC:skmeans       25               NA 3
#> ATC:skmeans       25               NA 4

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.


Node022

Parent node: Node02. Child nodes: Node0121-leaf , Node0122-leaf , Node0211-leaf , Node0212-leaf , Node0213-leaf , Node0221-leaf , Node0222-leaf .

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

res = res_rh["022"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4.
#>   On a matrix with 10703 rows and 24 columns.
#>   Top rows (1070) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 150 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_partitions"     
#>  [7] "compare_signatures"      "consensus_heatmap"       "dimension_reduction"    
#> [10] "functional_enrichment"   "get_anno_col"            "get_anno"               
#> [13] "get_classes"             "get_consensus"           "get_matrix"             
#> [16] "get_membership"          "get_param"               "get_signatures"         
#> [19] "get_stats"               "is_best_k"               "is_stable_k"            
#> [22] "membership_heatmap"      "ncol"                    "nrow"                   
#> [25] "plot_ecdf"               "predict_classes"         "rownames"               
#> [28] "select_partition_number" "show"                    "suggest_best_k"         
#> [31] "test_to_known_factors"   "top_rows_heatmap"

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

collect_plots(res)

plot of chunk node-022-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, higher 1-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 node-022-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.997       0.998          0.508 0.493   0.493
#> 3 3 1.000           0.978       0.990          0.342 0.826   0.647
#> 4 4 0.896           0.874       0.927          0.122 0.913   0.727

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 is 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 subgroup 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
#> TCGA-02-0446-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-06-0646-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-02-0089-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-02-0451-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-06-0187-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-02-0057-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-02-0006-01B-01     2   0.000      1.000 0.00 1.00
#> TCGA-02-0054-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-02-0064-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-02-0075-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-02-0085-01A-01     1   0.141      0.981 0.98 0.02
#> TCGA-02-0099-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-02-0107-01A-01     1   0.141      0.981 0.98 0.02
#> TCGA-06-0122-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-06-0124-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-06-0143-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-06-0147-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-06-0175-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-06-0409-01A-02     1   0.000      0.997 1.00 0.00
#> TCGA-06-0412-01A-01     2   0.000      1.000 0.00 1.00
#> TCGA-08-0352-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-08-0360-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-08-0509-01A-01     1   0.000      0.997 1.00 0.00
#> TCGA-08-0510-01A-01     1   0.000      0.997 1.00 0.00

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>                     class entropy silhouette   p1 p2   p3
#> TCGA-02-0446-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-06-0646-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-02-0089-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-02-0451-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-06-0187-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-02-0057-01A-01     3   0.000      0.988 0.00  0 1.00
#> TCGA-02-0006-01B-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-02-0054-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-02-0064-01A-01     1   0.000      0.974 1.00  0 0.00
#> TCGA-02-0075-01A-01     1   0.000      0.974 1.00  0 0.00
#> TCGA-02-0085-01A-01     3   0.000      0.988 0.00  0 1.00
#> TCGA-02-0099-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-02-0107-01A-01     3   0.000      0.988 0.00  0 1.00
#> TCGA-06-0122-01A-01     1   0.000      0.974 1.00  0 0.00
#> TCGA-06-0124-01A-01     1   0.000      0.974 1.00  0 0.00
#> TCGA-06-0143-01A-01     1   0.000      0.974 1.00  0 0.00
#> TCGA-06-0147-01A-01     3   0.207      0.936 0.06  0 0.94
#> TCGA-06-0175-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-06-0409-01A-02     3   0.000      0.988 0.00  0 1.00
#> TCGA-06-0412-01A-01     2   0.000      1.000 0.00  1 0.00
#> TCGA-08-0352-01A-01     1   0.000      0.974 1.00  0 0.00
#> TCGA-08-0360-01A-01     1   0.429      0.780 0.82  0 0.18
#> TCGA-08-0509-01A-01     3   0.000      0.988 0.00  0 1.00
#> TCGA-08-0510-01A-01     1   0.000      0.974 1.00  0 0.00

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>                     class entropy silhouette   p1   p2   p3   p4
#> TCGA-02-0446-01A-01     2  0.3975      0.753 0.00 0.76 0.00 0.24
#> TCGA-06-0646-01A-01     4  0.3975      0.674 0.00 0.24 0.00 0.76
#> TCGA-02-0089-01A-01     2  0.0000      0.856 0.00 1.00 0.00 0.00
#> TCGA-02-0451-01A-01     2  0.1211      0.888 0.00 0.96 0.00 0.04
#> TCGA-06-0187-01A-01     4  0.1211      0.914 0.00 0.04 0.00 0.96
#> TCGA-02-0057-01A-01     3  0.1913      0.931 0.00 0.02 0.94 0.04
#> TCGA-02-0006-01B-01     2  0.1211      0.888 0.00 0.96 0.00 0.04
#> TCGA-02-0054-01A-01     2  0.1637      0.885 0.00 0.94 0.00 0.06
#> TCGA-02-0064-01A-01     1  0.0000      0.939 1.00 0.00 0.00 0.00
#> TCGA-02-0075-01A-01     1  0.0000      0.939 1.00 0.00 0.00 0.00
#> TCGA-02-0085-01A-01     3  0.3198      0.916 0.00 0.08 0.88 0.04
#> TCGA-02-0099-01A-01     2  0.3801      0.778 0.00 0.78 0.00 0.22
#> TCGA-02-0107-01A-01     3  0.3198      0.916 0.00 0.08 0.88 0.04
#> TCGA-06-0122-01A-01     1  0.0000      0.939 1.00 0.00 0.00 0.00
#> TCGA-06-0124-01A-01     1  0.0000      0.939 1.00 0.00 0.00 0.00
#> TCGA-06-0143-01A-01     1  0.0000      0.939 1.00 0.00 0.00 0.00
#> TCGA-06-0147-01A-01     3  0.2011      0.891 0.08 0.00 0.92 0.00
#> TCGA-06-0175-01A-01     4  0.1211      0.914 0.00 0.04 0.00 0.96
#> TCGA-06-0409-01A-02     3  0.0707      0.923 0.02 0.00 0.98 0.00
#> TCGA-06-0412-01A-01     4  0.1211      0.914 0.00 0.04 0.00 0.96
#> TCGA-08-0352-01A-01     1  0.0000      0.939 1.00 0.00 0.00 0.00
#> TCGA-08-0360-01A-01     1  0.4713      0.470 0.64 0.00 0.36 0.00
#> TCGA-08-0509-01A-01     3  0.0000      0.928 0.00 0.00 1.00 0.00
#> TCGA-08-0510-01A-01     1  0.1913      0.900 0.94 0.00 0.02 0.04

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-node-022-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-node-022-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-node-022-consensus-heatmap-3

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

membership_heatmap(res, k = 2)

plot of chunk tab-node-022-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-node-022-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-node-022-membership-heatmap-3

As soon as the classes for columns are determined, the signatures that are significantly different between subgroups can be looked for. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-node-022-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-node-022-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-node-022-get-signatures-3

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-node-022-get-signatures-no-scale-1

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

plot of chunk tab-node-022-get-signatures-no-scale-2

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

plot of chunk tab-node-022-get-signatures-no-scale-3

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk node-022-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 (which is done by automatically selecting number of clusters).

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs:

# code only for demonstration
# e.g. to show the top 500 most significant rows
tb = get_signature(res, k = ..., top_signatures = 500)

If the signatures are defined as these which are uniquely high in current group, diff_method argument can be set to "uniquely_high_in_one_group":

# code only for demonstration
tb = get_signature(res, k = ..., diff_method = "uniquely_high_in_one_group")

UMAP plot which shows how samples are separated.

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

plot of chunk tab-node-022-dimension-reduction-1

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

plot of chunk tab-node-022-dimension-reduction-2

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

plot of chunk tab-node-022-dimension-reduction-3

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk node-022-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n_sample subtype(p-value) k
#> ATC:skmeans       24           0.0315 2
#> ATC:skmeans       24           0.1827 3
#> ATC:skmeans       23           0.0906 4

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.


Node03

Parent node: Node0. Child nodes: Node011-leaf , Node012 , Node013-leaf , Node021 , Node022 , Node023-leaf , Node031-leaf , Node032-leaf , Node033-leaf , Node034-leaf , Node041-leaf , Node042-leaf .

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

res = res_rh["03"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4.
#>   On a matrix with 10703 rows and 24 columns.
#>   Top rows (1070) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 150 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_partitions"     
#>  [7] "compare_signatures"      "consensus_heatmap"       "dimension_reduction"    
#> [10] "functional_enrichment"   "get_anno_col"            "get_anno"               
#> [13] "get_classes"             "get_consensus"           "get_matrix"             
#> [16] "get_membership"          "get_param"               "get_signatures"         
#> [19] "get_stats"               "is_best_k"               "is_stable_k"            
#> [22] "membership_heatmap"      "ncol"                    "nrow"                   
#> [25] "plot_ecdf"               "predict_classes"         "rownames"               
#> [28] "select_partition_number" "show"                    "suggest_best_k"         
#> [31] "test_to_known_factors"   "top_rows_heatmap"

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

collect_plots(res)

plot of chunk node-03-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, higher 1-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 node-03-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           1.000       1.000          0.519 0.482   0.482
#> 3 3 0.745           0.825       0.858          0.296 0.790   0.583
#> 4 4 0.926           0.957       0.960          0.153 0.877   0.626

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

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

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

Following is 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 subgroup 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
#> TCGA-02-0047-01A-01     2       0          1  0  1
#> TCGA-06-0238-01A-02     1       0          1  1  0
#> TCGA-02-0113-01A-01     2       0          1  0  1
#> TCGA-02-0115-01A-01     2       0          1  0  1
#> TCGA-06-0133-01A-02     2       0          1  0  1
#> TCGA-06-0138-01A-02     1       0          1  1  0
#> TCGA-06-0162-01A-01     1       0          1  1  0
#> TCGA-06-0171-01A-02     2       0          1  0  1
#> TCGA-06-0173-01A-01     2       0          1  0  1
#> TCGA-06-0179-01A-02     2       0          1  0  1
#> TCGA-06-0182-01A-01     1       0          1  1  0
#> TCGA-06-0185-01A-01     1       0          1  1  0
#> TCGA-06-0195-01B-01     2       0          1  0  1
#> TCGA-06-0208-01B-01     2       0          1  0  1
#> TCGA-06-0214-01A-02     2       0          1  0  1
#> TCGA-06-0219-01A-01     1       0          1  1  0
#> TCGA-06-0221-01A-01     1       0          1  1  0
#> TCGA-06-0237-01A-02     1       0          1  1  0
#> TCGA-06-0240-01A-02     1       0          1  1  0
#> TCGA-08-0349-01A-01     1       0          1  1  0
#> TCGA-08-0520-01A-01     1       0          1  1  0
#> TCGA-02-0038-01A-01     2       0          1  0  1
#> TCGA-02-0290-01A-01     1       0          1  1  0
#> TCGA-08-0354-01A-01     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>                     class entropy silhouette   p1   p2   p3
#> TCGA-02-0047-01A-01     2   0.000      0.843 0.00 1.00 0.00
#> TCGA-06-0238-01A-02     3   0.604      0.762 0.38 0.00 0.62
#> TCGA-02-0113-01A-01     2   0.000      0.843 0.00 1.00 0.00
#> TCGA-02-0115-01A-01     2   0.000      0.843 0.00 1.00 0.00
#> TCGA-06-0133-01A-02     2   0.604      0.726 0.00 0.62 0.38
#> TCGA-06-0138-01A-02     3   0.604      0.762 0.38 0.00 0.62
#> TCGA-06-0162-01A-01     3   0.604      0.762 0.38 0.00 0.62
#> TCGA-06-0171-01A-02     3   0.153      0.484 0.00 0.04 0.96
#> TCGA-06-0173-01A-01     2   0.000      0.843 0.00 1.00 0.00
#> TCGA-06-0179-01A-02     2   0.604      0.726 0.00 0.62 0.38
#> TCGA-06-0182-01A-01     1   0.000      1.000 1.00 0.00 0.00
#> TCGA-06-0185-01A-01     1   0.000      1.000 1.00 0.00 0.00
#> TCGA-06-0195-01B-01     2   0.604      0.726 0.00 0.62 0.38
#> TCGA-06-0208-01B-01     2   0.583      0.744 0.00 0.66 0.34
#> TCGA-06-0214-01A-02     2   0.000      0.843 0.00 1.00 0.00
#> TCGA-06-0219-01A-01     3   0.604      0.762 0.38 0.00 0.62
#> TCGA-06-0221-01A-01     3   0.604      0.762 0.38 0.00 0.62
#> TCGA-06-0237-01A-02     1   0.000      1.000 1.00 0.00 0.00
#> TCGA-06-0240-01A-02     3   0.000      0.533 0.00 0.00 1.00
#> TCGA-08-0349-01A-01     1   0.000      1.000 1.00 0.00 0.00
#> TCGA-08-0520-01A-01     1   0.000      1.000 1.00 0.00 0.00
#> TCGA-02-0038-01A-01     2   0.000      0.843 0.00 1.00 0.00
#> TCGA-02-0290-01A-01     1   0.000      1.000 1.00 0.00 0.00
#> TCGA-08-0354-01A-01     1   0.000      1.000 1.00 0.00 0.00

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>                     class entropy silhouette   p1   p2   p3   p4
#> TCGA-02-0047-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-06-0238-01A-02     3  0.0000      0.974 0.00 0.00 1.00 0.00
#> TCGA-02-0113-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0115-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-06-0133-01A-02     4  0.1211      0.952 0.00 0.04 0.00 0.96
#> TCGA-06-0138-01A-02     3  0.0000      0.974 0.00 0.00 1.00 0.00
#> TCGA-06-0162-01A-01     3  0.0000      0.974 0.00 0.00 1.00 0.00
#> TCGA-06-0171-01A-02     4  0.3935      0.898 0.06 0.02 0.06 0.86
#> TCGA-06-0173-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-06-0179-01A-02     4  0.0707      0.954 0.00 0.02 0.00 0.98
#> TCGA-06-0182-01A-01     1  0.2335      0.931 0.92 0.00 0.06 0.02
#> TCGA-06-0185-01A-01     1  0.1411      0.923 0.96 0.00 0.02 0.02
#> TCGA-06-0195-01B-01     4  0.0707      0.954 0.00 0.02 0.00 0.98
#> TCGA-06-0208-01B-01     4  0.2706      0.924 0.02 0.08 0.00 0.90
#> TCGA-06-0214-01A-02     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-06-0219-01A-01     3  0.0000      0.974 0.00 0.00 1.00 0.00
#> TCGA-06-0221-01A-01     3  0.0000      0.974 0.00 0.00 1.00 0.00
#> TCGA-06-0237-01A-02     1  0.3037      0.907 0.88 0.00 0.10 0.02
#> TCGA-06-0240-01A-02     3  0.2647      0.857 0.00 0.00 0.88 0.12
#> TCGA-08-0349-01A-01     1  0.1637      0.949 0.94 0.00 0.06 0.00
#> TCGA-08-0520-01A-01     1  0.1637      0.949 0.94 0.00 0.06 0.00
#> TCGA-02-0038-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0290-01A-01     1  0.2011      0.945 0.92 0.00 0.08 0.00
#> TCGA-08-0354-01A-01     1  0.2011      0.945 0.92 0.00 0.08 0.00

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-node-03-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-node-03-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-node-03-consensus-heatmap-3

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

membership_heatmap(res, k = 2)

plot of chunk tab-node-03-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-node-03-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-node-03-membership-heatmap-3

As soon as the classes for columns are determined, the signatures that are significantly different between subgroups can be looked for. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-node-03-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-node-03-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-node-03-get-signatures-3

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-node-03-get-signatures-no-scale-1

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

plot of chunk tab-node-03-get-signatures-no-scale-2

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

plot of chunk tab-node-03-get-signatures-no-scale-3

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk node-03-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 (which is done by automatically selecting number of clusters).

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs:

# code only for demonstration
# e.g. to show the top 500 most significant rows
tb = get_signature(res, k = ..., top_signatures = 500)

If the signatures are defined as these which are uniquely high in current group, diff_method argument can be set to "uniquely_high_in_one_group":

# code only for demonstration
tb = get_signature(res, k = ..., diff_method = "uniquely_high_in_one_group")

UMAP plot which shows how samples are separated.

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

plot of chunk tab-node-03-dimension-reduction-1

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

plot of chunk tab-node-03-dimension-reduction-2

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

plot of chunk tab-node-03-dimension-reduction-3

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk node-03-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n_sample subtype(p-value) k
#> ATC:skmeans       24            0.895 2
#> ATC:skmeans       23            0.512 3
#> ATC:skmeans       24            0.498 4

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.


Node04

Parent node: Node0. Child nodes: Node011-leaf , Node012 , Node013-leaf , Node021 , Node022 , Node023-leaf , Node031-leaf , Node032-leaf , Node033-leaf , Node034-leaf , Node041-leaf , Node042-leaf .

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

res = res_rh["04"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4.
#>   On a matrix with 10703 rows and 31 columns.
#>   Top rows (1070) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 150 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_partitions"     
#>  [7] "compare_signatures"      "consensus_heatmap"       "dimension_reduction"    
#> [10] "functional_enrichment"   "get_anno_col"            "get_anno"               
#> [13] "get_classes"             "get_consensus"           "get_matrix"             
#> [16] "get_membership"          "get_param"               "get_signatures"         
#> [19] "get_stats"               "is_best_k"               "is_stable_k"            
#> [22] "membership_heatmap"      "ncol"                    "nrow"                   
#> [25] "plot_ecdf"               "predict_classes"         "rownames"               
#> [28] "select_partition_number" "show"                    "suggest_best_k"         
#> [31] "test_to_known_factors"   "top_rows_heatmap"

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

collect_plots(res)

plot of chunk node-04-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, higher 1-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 node-04-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.00           1.000       1.000          0.504 0.497   0.497
#> 3 3  0.71           0.785       0.898          0.302 0.815   0.640
#> 4 4  0.85           0.865       0.927          0.138 0.781   0.460

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

suggest_best_k(res)
#> [1] 2

Following is 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 subgroup 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
#> TCGA-08-0386-01A-01     1       0          1  1  0
#> TCGA-02-0007-01A-01     1       0          1  1  0
#> TCGA-02-0009-01A-01     1       0          1  1  0
#> TCGA-02-0016-01A-01     2       0          1  0  1
#> TCGA-02-0021-01A-01     1       0          1  1  0
#> TCGA-02-0023-01B-01     2       0          1  0  1
#> TCGA-02-0043-01A-01     1       0          1  1  0
#> TCGA-02-0070-01A-01     2       0          1  0  1
#> TCGA-02-0102-01A-01     1       0          1  1  0
#> TCGA-02-0260-01A-03     2       0          1  0  1
#> TCGA-02-0269-01B-01     2       0          1  0  1
#> TCGA-02-0285-01A-01     2       0          1  0  1
#> TCGA-02-0289-01A-01     2       0          1  0  1
#> TCGA-02-0317-01A-01     2       0          1  0  1
#> TCGA-02-0333-01A-02     2       0          1  0  1
#> TCGA-02-0422-01A-01     2       0          1  0  1
#> TCGA-02-0430-01A-01     1       0          1  1  0
#> TCGA-06-0125-01A-01     1       0          1  1  0
#> TCGA-06-0126-01A-01     1       0          1  1  0
#> TCGA-06-0137-01A-03     1       0          1  1  0
#> TCGA-06-0145-01A-04     1       0          1  1  0
#> TCGA-06-0148-01A-01     2       0          1  0  1
#> TCGA-06-0211-01B-01     1       0          1  1  0
#> TCGA-06-0402-01A-01     1       0          1  1  0
#> TCGA-08-0357-01A-01     2       0          1  0  1
#> TCGA-08-0358-01A-01     2       0          1  0  1
#> TCGA-08-0511-01A-01     1       0          1  1  0
#> TCGA-08-0514-01A-01     1       0          1  1  0
#> TCGA-08-0518-01A-01     1       0          1  1  0
#> TCGA-08-0529-01A-02     1       0          1  1  0
#> TCGA-08-0531-01A-01     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>                     class entropy silhouette   p1   p2   p3
#> TCGA-08-0386-01A-01     1   0.619      0.515 0.58 0.00 0.42
#> TCGA-02-0007-01A-01     1   0.455      0.760 0.80 0.00 0.20
#> TCGA-02-0009-01A-01     1   0.000      0.830 1.00 0.00 0.00
#> TCGA-02-0016-01A-01     2   0.369      0.838 0.00 0.86 0.14
#> TCGA-02-0021-01A-01     1   0.000      0.830 1.00 0.00 0.00
#> TCGA-02-0023-01B-01     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-02-0043-01A-01     1   0.000      0.830 1.00 0.00 0.00
#> TCGA-02-0070-01A-01     2   0.254      0.907 0.00 0.92 0.08
#> TCGA-02-0102-01A-01     1   0.000      0.830 1.00 0.00 0.00
#> TCGA-02-0260-01A-03     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-02-0269-01B-01     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-02-0285-01A-01     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-02-0289-01A-01     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-02-0317-01A-01     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-02-0333-01A-02     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-02-0422-01A-01     3   0.571      0.441 0.00 0.32 0.68
#> TCGA-02-0430-01A-01     1   0.571      0.684 0.68 0.00 0.32
#> TCGA-06-0125-01A-01     1   0.000      0.830 1.00 0.00 0.00
#> TCGA-06-0126-01A-01     1   0.000      0.830 1.00 0.00 0.00
#> TCGA-06-0137-01A-03     1   0.000      0.830 1.00 0.00 0.00
#> TCGA-06-0145-01A-04     1   0.000      0.830 1.00 0.00 0.00
#> TCGA-06-0148-01A-01     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-06-0211-01B-01     3   0.000      0.696 0.00 0.00 1.00
#> TCGA-06-0402-01A-01     1   0.556      0.703 0.70 0.00 0.30
#> TCGA-08-0357-01A-01     3   0.571      0.441 0.00 0.32 0.68
#> TCGA-08-0358-01A-01     2   0.000      0.976 0.00 1.00 0.00
#> TCGA-08-0511-01A-01     1   0.571      0.684 0.68 0.00 0.32
#> TCGA-08-0514-01A-01     3   0.556      0.246 0.30 0.00 0.70
#> TCGA-08-0518-01A-01     1   0.556      0.703 0.70 0.00 0.30
#> TCGA-08-0529-01A-02     3   0.369      0.585 0.14 0.00 0.86
#> TCGA-08-0531-01A-01     3   0.000      0.696 0.00 0.00 1.00

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>                     class entropy silhouette   p1   p2   p3   p4
#> TCGA-08-0386-01A-01     3  0.1913      0.750 0.04 0.00 0.94 0.02
#> TCGA-02-0007-01A-01     3  0.5606      0.292 0.48 0.00 0.50 0.02
#> TCGA-02-0009-01A-01     1  0.0000      1.000 1.00 0.00 0.00 0.00
#> TCGA-02-0016-01A-01     4  0.1637      0.924 0.00 0.06 0.00 0.94
#> TCGA-02-0021-01A-01     1  0.0000      1.000 1.00 0.00 0.00 0.00
#> TCGA-02-0023-01B-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0043-01A-01     1  0.0000      1.000 1.00 0.00 0.00 0.00
#> TCGA-02-0070-01A-01     4  0.2921      0.883 0.00 0.14 0.00 0.86
#> TCGA-02-0102-01A-01     1  0.0000      1.000 1.00 0.00 0.00 0.00
#> TCGA-02-0260-01A-03     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0269-01B-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0285-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0289-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0317-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0333-01A-02     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-02-0422-01A-01     4  0.1637      0.921 0.00 0.06 0.00 0.94
#> TCGA-02-0430-01A-01     3  0.2345      0.755 0.10 0.00 0.90 0.00
#> TCGA-06-0125-01A-01     1  0.0000      1.000 1.00 0.00 0.00 0.00
#> TCGA-06-0126-01A-01     1  0.0000      1.000 1.00 0.00 0.00 0.00
#> TCGA-06-0137-01A-03     1  0.0000      1.000 1.00 0.00 0.00 0.00
#> TCGA-06-0145-01A-04     1  0.0000      1.000 1.00 0.00 0.00 0.00
#> TCGA-06-0148-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-06-0211-01B-01     3  0.1637      0.721 0.00 0.00 0.94 0.06
#> TCGA-06-0402-01A-01     3  0.4948      0.415 0.44 0.00 0.56 0.00
#> TCGA-08-0357-01A-01     4  0.0707      0.914 0.00 0.02 0.00 0.98
#> TCGA-08-0358-01A-01     2  0.0000      1.000 0.00 1.00 0.00 0.00
#> TCGA-08-0511-01A-01     3  0.2647      0.750 0.12 0.00 0.88 0.00
#> TCGA-08-0514-01A-01     3  0.0000      0.736 0.00 0.00 1.00 0.00
#> TCGA-08-0518-01A-01     3  0.4977      0.374 0.46 0.00 0.54 0.00
#> TCGA-08-0529-01A-02     3  0.3247      0.709 0.06 0.00 0.88 0.06
#> TCGA-08-0531-01A-01     3  0.2647      0.683 0.00 0.00 0.88 0.12

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-node-04-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-node-04-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-node-04-consensus-heatmap-3

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

membership_heatmap(res, k = 2)

plot of chunk tab-node-04-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-node-04-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-node-04-membership-heatmap-3

As soon as the classes for columns are determined, the signatures that are significantly different between subgroups can be looked for. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-node-04-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-node-04-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-node-04-get-signatures-3

Signature heatmaps where rows are not scaled:

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

plot of chunk tab-node-04-get-signatures-no-scale-1

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

plot of chunk tab-node-04-get-signatures-no-scale-2

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

plot of chunk tab-node-04-get-signatures-no-scale-3

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk node-04-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 (which is done by automatically selecting number of clusters).

If there are too many signatures, top_signatures = ... can be set to only show the signatures with the highest FDRs:

# code only for demonstration
# e.g. to show the top 500 most significant rows
tb = get_signature(res, k = ..., top_signatures = 500)

If the signatures are defined as these which are uniquely high in current group, diff_method argument can be set to "uniquely_high_in_one_group":

# code only for demonstration
tb = get_signature(res, k = ..., diff_method = "uniquely_high_in_one_group")

UMAP plot which shows how samples are separated.

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

plot of chunk tab-node-04-dimension-reduction-1

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

plot of chunk tab-node-04-dimension-reduction-2

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

plot of chunk tab-node-04-dimension-reduction-3

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk node-04-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n_sample subtype(p-value) k
#> ATC:skmeans       31            1.000 2
#> ATC:skmeans       28            0.595 3
#> ATC:skmeans       28            0.375 4

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 4.1.0 (2021-05-18)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#> 
#> Matrix products: default
#> BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.3.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
#>  [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
#> [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] grid      stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] genefilter_1.74.0     ComplexHeatmap_2.8.0  markdown_1.1          knitr_1.33           
#> [5] preprocessCore_1.54.0 RColorBrewer_1.1-2    cola_1.9.4           
#> 
#> loaded via a namespace (and not attached):
#>   [1] colorspace_2.0-2       rjson_0.2.20           ellipsis_0.3.2         mclust_5.4.7          
#>   [5] circlize_0.4.13        XVector_0.32.0         GlobalOptions_0.1.2    clue_0.3-59           
#>   [9] rstudioapi_0.13        bit64_4.0.5            AnnotationDbi_1.54.1   Polychrome_1.3.1      
#>  [13] RSpectra_0.16-0        fansi_0.5.0            xml2_1.3.2             codetools_0.2-18      
#>  [17] splines_4.1.0          doParallel_1.0.16      cachem_1.0.5           impute_1.66.0         
#>  [21] polyclip_1.10-0        jsonlite_1.7.2         Cairo_1.5-12.2         umap_0.2.7.0          
#>  [25] annotate_1.70.0        cluster_2.1.2          png_0.1-7              data.tree_1.0.0       
#>  [29] compiler_4.1.0         httr_1.4.2             assertthat_0.2.1       Matrix_1.3-4          
#>  [33] fastmap_1.1.0          tools_4.1.0            gtable_0.3.0           glue_1.4.2            
#>  [37] GenomeInfoDbData_1.2.6 dplyr_1.0.7            Rcpp_1.0.7             slam_0.1-48           
#>  [41] Biobase_2.52.0         eulerr_6.1.0           vctrs_0.3.8            Biostrings_2.60.1     
#>  [45] iterators_1.0.13       polylabelr_0.2.0       xfun_0.24              stringr_1.4.0         
#>  [49] lifecycle_1.0.0        irlba_2.3.3            XML_3.99-0.6           dendextend_1.15.1     
#>  [53] zlibbioc_1.38.0        scales_1.1.1           microbenchmark_1.4-7   parallel_4.1.0        
#>  [57] memoise_2.0.0          reticulate_1.20        gridExtra_2.3          ggplot2_3.3.5         
#>  [61] stringi_1.7.3          RSQLite_2.2.7          highr_0.9              S4Vectors_0.30.0      
#>  [65] foreach_1.5.1          BiocGenerics_0.38.0    shape_1.4.6            GenomeInfoDb_1.28.1   
#>  [69] rlang_0.4.11           pkgconfig_2.0.3        matrixStats_0.59.0     bitops_1.0-7          
#>  [73] evaluate_0.14          lattice_0.20-44        purrr_0.3.4            bit_4.0.4             
#>  [77] tidyselect_1.1.1       magrittr_2.0.1         R6_2.5.0               IRanges_2.26.0        
#>  [81] generics_0.1.0         DBI_1.1.1              pillar_1.6.1           survival_3.2-11       
#>  [85] KEGGREST_1.32.0        scatterplot3d_0.3-41   RCurl_1.98-1.3         tibble_3.1.2          
#>  [89] crayon_1.4.1           utf8_1.2.1             skmeans_0.2-13         viridis_0.6.1         
#>  [93] GetoptLong_1.0.5       blob_1.2.1             digest_0.6.27          xtable_1.8-4          
#>  [97] brew_1.0-6             openssl_1.4.4          stats4_4.1.0           munsell_0.5.0         
#> [101] viridisLite_0.4.0      askpass_1.1