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 MOBSTER 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 MOBSTER analyses. These annotations report the status of driver and gene for each one of the input datapoints, and should be part of data given in input for MOBSTER (so they should be in x$data).

MOBSTER clusters are only used if the come from a Beta distribtutions; that is the tail is removed. The clonal cluster is estimated from the cluster with the highest parameter value for the Beta peak.

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 MOBSTER 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

# We take one of the released datasets
x = mobster::LU4_lung_sample$best

# Annotate some random mutation as driver, we need that to build the trees with ctree
x$data$is_driver = FALSE
x$data$is_driver[1:3] = TRUE

x$data$driver_label = ""
x$data$driver_label[1] = "Fake_driver_1"
x$data$driver_label[2] = "Fake_driver_2"
x$data$driver_label[3] = "Fake_driver_3"

# Get the trees
trees = get_clone_trees(x)

# Print and plot the first tree (top rank)
library(ctree)
ctree::print.ctree(trees[[1]])
ctree::plot.ctree(trees[[1]])
ctree::plot_CCF_clusters(trees[[1]])
ctree::plot_icon(trees[[1]])
ctree::plot_clone_size(trees[[1]])

caravagnalab/mobster documentation built on March 25, 2023, 3:40 p.m.