consensus_partition {cola} | R Documentation |
Consensus partition
consensus_partition(data, top_value_method = "MAD", top_n = seq(min(1000, round(nrow(data)*0.1)), min(5000, round(nrow(data)*0.5)), length.out = 5), partition_method = "kmeans", max_k = 6, p_sampling = 0.8, partition_repeat = 50, partition_param = list(), anno = NULL, anno_col = NULL, scale_rows = NULL, verbose = TRUE, mc.cores = 1, .env = NULL)
data |
a numeric matrix where subgroups are found by columns. |
top_value_method |
a single top-value method. Available methods are in |
top_n |
number of rows with top values. The value can be a vector with length > 1. When n > 5000, the function only randomly sample 5000 rows from top n rows. If |
partition_method |
a single partition method. Available methods are in |
max_k |
maximal number of partitions to try. The function will try |
p_sampling |
proportion of the top n rows to sample. |
partition_repeat |
number of repeats for the random sampling. |
partition_param |
parameters for the partition method which are passed to |
anno |
a data frame with known annotation of samples. The annotations will be plotted in heatmaps and the correlation to predicted subgroups will be tested. |
anno_col |
a list of colors (color is defined as a named vector) for the annotations. If |
scale_rows |
whether to scale rows. If it is |
verbose |
whether print messages. |
mc.cores |
multiple cores to use. |
.env |
an environment, internally used. |
The function performs analysis in following steps:
calculate scores for rows by top-value method,
for each top_n value, take top n rows,
randomly sample p_sampling
rows from the top_n rows and perform partitioning for partition_repeats
times,
collect partitions from all partitions and calculate consensus partitions.
A ConsensusPartition-class
object. Simply type object in the interactive R session
to see which functions can be applied on it.
Zuguang Gu <z.gu@dkfz.de>
run_all_consensus_partition_methods
runs consensus partition with multiple top-value methods
and multiple partition methods. hierarchical_partition
runs consensus partition hierarchically.
set.seed(123) m = cbind(rbind(matrix(rnorm(20*20, mean = 1, sd = 0.5), nr = 20), matrix(rnorm(20*20, mean = 0, sd = 0.5), nr = 20), matrix(rnorm(20*20, mean = 0, sd = 0.5), nr = 20)), rbind(matrix(rnorm(20*20, mean = 0, sd = 0.5), nr = 20), matrix(rnorm(20*20, mean = 1, sd = 0.5), nr = 20), matrix(rnorm(20*20, mean = 0, sd = 0.5), nr = 20)), rbind(matrix(rnorm(20*20, mean = 0.5, sd = 0.5), nr = 20), matrix(rnorm(20*20, mean = 0.5, sd = 0.5), nr = 20), matrix(rnorm(20*20, mean = 1, sd = 0.5), nr = 20)) ) + matrix(rnorm(60*60, sd = 0.5), nr = 60) cp = consensus_partition(m, partition_repeat = 10, top_n = c(10, 20, 50)) cp