plot_clone_size: Plot a clone size histogram, and test for.

View source: R/plot_clone_size.R

plot_clone_sizeR Documentation

Plot a clone size histogram, and test for.

Description

This function creates a ggplot barplot of the clone size values foe each clone in the patient's data. The size of a clone is defined as the number of mutations assigned to it, and is provided in input.

The barplot is annotated to report wether a subclone with a driver is significantly larger than the expected size for a subclone without driver. To carry out this test subclones without drivers are used to estimate the parameters of a univariate Gaussian distribution (mean and standard deviation), the p-value is then computed from the fit distribution through the 'pnorm' function.

The confidence level for the test can be passed as parameter.

Usage

plot_clone_size(x, alpha_level = 0.05)

Arguments

x

A ctree tree.

alpha_level

Alpha level for the test, default is 0.05.

Value

A ggplot plot.

Examples

data('ctree_input')

x = ctrees(
   ctree_input$CCF_clusters,
   ctree_input$drivers,
   ctree_input$samples,
   ctree_input$patient,
   ctree_input$sspace.cutoff,
   ctree_input$n.sampling,
   ctree_input$store.max
   )
   
plot_clone_size(x[[1]])

caravagnalab/ctree documentation built on May 12, 2022, 4:42 p.m.