Test correspondance between predicted subgroups and known factors

# S4 method for ConsensusPartition
test_to_known_factors(object, k, known = get_anno(object),
    silhouette_cutoff = 0.5, verbose = FALSE)

Arguments

object

A ConsensusPartition-class object.

k

Number of subgroups. It uses all k if it is not specified.

known

A vector or a data frame with known factors. By default it is the annotation table set in consensus_partition or run_all_consensus_partition_methods.

silhouette_cutoff

Cutoff for sihouette scores. Samples with value less than it are omit.

verbose

Whether to print messages.

Details

The test is performed by test_between_factors between the predicted classes and user's annotation table.

Value

A data frame with the following columns:

  • number of samples used to test after filtered by silhouette_cutoff,

  • p-values from the tests,

  • number of subgroups.

Author

Zuguang Gu <z.gu@dkfz.de>

Examples

data(golub_cola)
res = golub_cola["ATC:skmeans"]
anno = get_anno(res)
anno
#>    ALL.AML
#> 39     ALL
#> 40     ALL
#> 42     ALL
#> 47     ALL
#> 48     ALL
#> 49     ALL
#> 41     ALL
#> 43     ALL
#> 44     ALL
#> 45     ALL
#> 46     ALL
#> 70     ALL
#> 71     ALL
#> 72     ALL
#> 68     ALL
#> 69     ALL
#> 67     ALL
#> 55     ALL
#> 56     ALL
#> 59     ALL
#> 52     AML
#> 53     AML
#> 51     AML
#> 50     AML
#> 54     AML
#> 57     AML
#> 58     AML
#> 60     AML
#> 61     AML
#> 65     AML
#> 66     AML
#> 63     AML
#> 64     AML
#> 62     AML
#> 1      ALL
#> 2      ALL
#> 3      ALL
#> 4      ALL
#> 5      ALL
#> 6      ALL
#> 7      ALL
#> 8      ALL
#> 9      ALL
#> 10     ALL
#> 11     ALL
#> 12     ALL
#> 13     ALL
#> 14     ALL
#> 15     ALL
#> 16     ALL
#> 17     ALL
#> 18     ALL
#> 19     ALL
#> 20     ALL
#> 21     ALL
#> 22     ALL
#> 23     ALL
#> 24     ALL
#> 25     ALL
#> 26     ALL
#> 27     ALL
#> 34     AML
#> 35     AML
#> 36     AML
#> 37     AML
#> 38     AML
#> 28     AML
#> 29     AML
#> 30     AML
#> 31     AML
#> 32     AML
#> 33     AML
test_to_known_factors(res, k = 3)
#>             n_sample ALL.AML(p-value) k
#> ATC:skmeans       72     1.826171e-10 3
# or explicitly specify known argument
test_to_known_factors(res, k = 3, known = anno)
#>             n_sample ALL.AML(p-value) k
#> ATC:skmeans       72     1.826171e-10 3