Compute hierarchical clustering for a REVOLVER cohort with fit models. To compute clusters first a pairwise distance is computed between the patients, then the cluster package is used to compute a dendrogram of the patients, and is split using the heuristic dendrogram-cutting functions available in the dynamicTreeCut package. This function accepts parameters that are forwarded to the functions to carry out this task.

Results are stored inside the field cluster of the returned object.

revolver_cluster(
  x,
  patients = x$patients,
  hc.method = "ward",
  split.method = "cutreeHybrid",
  min.group.size = 2
)

Arguments

x

A "rev_cohort_fit" object for which the evolutionary distance has been computed.

hc.method

Method for hierarchial clustering, anything that can be passed to the agnes function of the cluster package.

split.method

Method to cut the dendrogram, anything of cutreeDynamic, cutreeDynamicTree or cutreeHybrid which are available in the dynamicTreeCut package, or static to use the find_k function from the dendextend package.

min.group.size

Minimum group size for dynamicTreeCut functions.

Value

The input x with a modified field cluster that stores all relevant clustering results.

See also

Other Analysis functions: revolver_fit()

Examples

data(CRC.cohort)
#> Warning: data set ‘CRC.cohort’ not found
fit = revolver_fit(CRC.cohort)
#> Error in paste0("REVOLVER Transfer Learning fit ~ ", x$annotation): object 'CRC.cohort' not found
fit = revolver_evo_distance(fit)
#> Error in revolver_evo_distance(fit): could not find function "revolver_evo_distance"
fit = revolver_cluster(fit) # dumped also to disk
#> Error in paste0("REVOLVER Clustering - ", x$annotation): object 'fit' not found