View source: R/hierarchical_0.R
hierarchical_partition | R Documentation |
Hierarchical partition
hierarchical_partition(data,
top_n = NULL,
top_value_method = "ATC",
partition_method = "skmeans",
combination_method = expand.grid(top_value_method, partition_method),
anno = NULL, anno_col = NULL,
mean_silhouette_cutoff = 0.9, min_samples = max(6, round(ncol(data)*0.01)),
subset = Inf, predict_method = "centroid",
group_diff = ifelse(scale_rows, 0.5, 0),
fdr_cutoff = cola_opt$fdr_cutoff,
min_n_signatures = NULL,
filter_fun = function(mat) {
s = rowSds(mat)
s > quantile(unique(s[s > 1e-10]), 0.05, na.rm = TRUE)
},
max_k = 4, scale_rows = TRUE, verbose = TRUE, mc.cores = 1, cores = mc.cores, help = TRUE, ...)
data |
a numeric matrix where subgroups are found by columns. |
top_n |
Number of rows with top values. |
top_value_method |
a single or a vector of top-value methods. Available methods are in |
partition_method |
a single or a vector of partition methods. Available methods are in |
combination_method |
A list of combinations of top-value methods and partitioning methods. The value can be a two-column data frame where the first column is the top-value methods and the second column is the partitioning methods. Or it can be a vector of combination names in a form of "top_value_method:partitioning_method". |
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 |
mean_silhouette_cutoff |
The cutoff to test whether partition in current node is stable. |
min_samples |
the cutoff of number of samples to determine whether to continue looking for subgroups. |
group_diff |
Pass to |
fdr_cutoff |
Pass to |
subset |
Number of columns to randomly sample. |
predict_method |
Method for predicting class labels. Possible values are "centroid", "svm" and "randomForest". |
min_n_signatures |
Minimal number of signatures under the best classification. |
filter_fun |
A self-defined function which filters the original matrix and returns a submatrix for partitioning. |
max_k |
maximal number of partitions to try. The function will try |
scale_rows |
Whether rows are scaled? |
verbose |
whether print message. |
mc.cores |
multiple cores to use. This argument will be removed in future versions. |
cores |
Number of cores, or a |
help |
Whether to show the help message. |
... |
pass to |
The function looks for subgroups in a hierarchical way.
There is a special way to encode the node in the hierarchy. The length of the node name
is the depth of the node in the hierarchy and the substring excluding the last digit is the name
node of the parent node. E.g. for the node 0011
, the depth is 4 and the parent node is 001
.
A HierarchicalPartition-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>
## Not run:
set.seed(123)
m = cbind(rbind(matrix(rnorm(20*20, mean = 2, sd = 0.3), nr = 20),
matrix(rnorm(20*20, mean = 0, sd = 0.3), nr = 20),
matrix(rnorm(20*20, mean = 0, sd = 0.3), nr = 20)),
rbind(matrix(rnorm(20*20, mean = 0, sd = 0.3), nr = 20),
matrix(rnorm(20*20, mean = 1, sd = 0.3), nr = 20),
matrix(rnorm(20*20, mean = 0, sd = 0.3), nr = 20)),
rbind(matrix(rnorm(20*20, mean = 0, sd = 0.3), nr = 20),
matrix(rnorm(20*20, mean = 0, sd = 0.3), nr = 20),
matrix(rnorm(20*20, mean = 1, sd = 0.3), nr = 20))
) + matrix(rnorm(60*60, sd = 0.5), nr = 60)
rh = hierarchical_partition(m, top_value_method = "SD", partition_method = "kmeans")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.