binary_cut: Cluster functional terms by recursively binary cutting the...

View source: R/binary_cut.R

binary_cutR Documentation

Cluster functional terms by recursively binary cutting the similarity matrix

Description

Cluster functional terms by recursively binary cutting the similarity matrix

Usage

binary_cut(mat, value_fun = area_above_ecdf, partition_fun = partition_by_pam,
    cutoff = 0.85, try_all_partition_fun = FALSE, partial = FALSE)

Arguments

mat

A similarity matrix.

value_fun

A function that calculates the scores for the four submatrices on a node.

partition_fun

A function to split each node into two groups. Pre-defined functions in this package are partition_by_kmeanspp, partition_by_pam and partition_by_hclust.

cutoff

The cutoff for splitting the dendrogram.

try_all_partition_fun

Different partition_fun gives different clusterings. If the vaule of try_all_partition_fun is set to TRUE, the similarity matrix is clustered by three partitioning method: partition_by_pam, partition_by_kmeanspp and partition_by_hclust. The clustering with the highest difference score is finally selected as the final clustering.

partial

Whether to generate the complete clustering or the clustering stops when sub-matrices cannot be split anymore.

Value

A vector of cluster labels (in numeric).

Examples

mat = readRDS(system.file("extdata", "random_GO_BP_sim_mat.rds",
    package = "simplifyEnrichment"))
binary_cut(mat)

jokergoo/simplifyGO documentation built on Oct. 25, 2023, 9:02 p.m.