get_clone_trees: Return clone trees from the fit.

View source: R/get_clone_trees.R

get_clone_treesR Documentation

Return clone trees from the fit.

Description

This function uses the output fit of VIBER to create a call to ctree (https://caravagn.github.io/ctree/), a package to create clone trees for cancer evolution models.

Creation of a clone tree requires annotations that are not usually necessary for just a plain VIBER analyses. These annotations report the status of driver and gene for each one of the input datapoints; the annotations should have been passed when calling the variational_fit function, and stored inside the data field of the VIBER object.

The clonal cluster is estimated from the cluster with the highest parameter values in most of the input dimensions (Binomial peaks).

The output is the result of calling the constructor ctree::cetrees on the input clustering results x.

Usage

get_clone_trees(x, ...)

Arguments

x

A VIBER fit.

...

Extra parameters passed to the constructor ctree::cetrees, which affect the sampling of the trees.

Value

The output of the constructor ctree::cetrees.

Examples



data(mvbmm_example)

# We create annotation data assigning dummy names
# and picking 10 events to be drivers (randomly chosen)
data_annotations = data.frame(
 gene = paste0("G", 1:nrow(mvbmm_example$trials)),
 driver = FALSE
 )

data_annotations$driver[sample(1:nrow(data_annotations), 10)] = TRUE

# Compared to the main variational_fit, we use the same call but add data
f = variational_fit(mvbmm_example$successes, mvbmm_example$trials, data = data_annotations)
print(f)

trees = get_clone_trees(f)

ctree:::print.ctree(trees[[1]])
ctree::plot.ctree(trees[[1]])

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