rename_clusters: Rename VIBER clusters.

View source: R/rename_clusters.R

rename_clustersR Documentation

Rename VIBER clusters.

Description

From an object fit, clusters (all or some) can be renamed. This changes the names inside the VIBER object, affecting plots and all other outputs. This function can be used after clusters have been given some interpretation, e.g., cluster "C1" is the "Clonal" cluster for instance.

Usage

rename_clusters(x, new_labels)

Arguments

x

A VIBER fit object.

new_labels

A named vector representing a new names map. For instance c(`C1`=`Clonal`, `C2` = `Subclonal`) renames two clusters "C1" and "C2" as "Clonal" and "Clonal" respectively.

Value

A VIBER fit object with renamed clusters.

Examples

data(mvbmm_example)
x = variational_fit(mvbmm_example$successes, mvbmm_example$trials)
print(x)

x_renamed = rename_clusters(x, c(`C1`=`Clonal`, `C2` = `Subclonal`))
print(x_renamed)

caravagn/VIBER documentation built on July 16, 2022, 1:23 a.m.