R/revolver_cluster.R
revolver_cluster.RdCompute 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
)A "rev_cohort_fit" object for which the evolutionary distance has been computed.
A vector of patient IDs to include in the clustering (default: all patients).
Method for hierarchial clustering, anything that can be
passed to the agnes function of the cluster package.
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.
Minimum group size for dynamicTreeCut functions.
The input x with a modified field cluster that
stores all relevant clustering results.
Other Analysis functions:
revolver_fit()
if (FALSE) { # \dontrun{
data('TRACERx_NEJM_2017_REVOLVER', package = 'evoverse.datasets')
fit = revolver_fit(TRACERx_NEJM_2017_REVOLVER)
fit = revolver_cluster(fit)
} # }