knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) options(crayon.enabled=TRUE)
# To render in colour this vignette old.hooks <- fansi::set_knit_hooks(knitr::knit_hooks)
The ctree
is a package to implement basic functions to create, manipulate and visualize clone trees. A clone tree is a tree built from the results of a subclonal deconvolution analysis of bulk DNA sequencing data. The trees created with ctree
are used inside REVOLVER, a package that implements one algorithm to determine repeated cancer evolution from multi-region sequencing data of human cancers.
library(ctree)
To build a clone tree you need some basic datal; an example dataset is attached to the package and can be used to create a ctree
S3 object.
data('ctree_input')
Cancer Cell Fractions
Cancer Cell Fractions (CCF) clusters obtained from subclonal deconvolution analysis of bulk DNA sequencing data are required,
ctree_input$CCF_clusters
If you need tools to compute CCF values, the evoverse collection of packages for Cancer Evolution analysis contains both MOBSTER and VIBER. Otherwise, a number of other packages can be used (pyClone, sciClone, DPClust, etc.).
Driver events mapped to the CCF clusters, with reported clonality status, a variantID
and a patientID.
ctree_input$drivers
Other data
ctree_input$samples ctree_input$patient
You can use a sampler and control its parameters -- see ~ctrees
.
x = ctrees( CCF_clusters = ctree_input$CCF_clusters, drivers = ctree_input$drivers, samples = ctree_input$samples, patient = ctree_input$patient, sspace.cutoff = ctree_input$sspace.cutoff, n.sampling = ctree_input$n.sampling, store.max = ctree_input$store.max )
The sampler creates a number of clone trees that can fit the data according to an error model that allows violations of the pigeonhole principle. We work with the top-ranking model.
x = x[[1]]
S3 functions for printing, and summarizing the object.
print(x) summary(x)
Then some plotting functions for the tree. A tree layout is used to display the clone tree and the information transfer, which corresponds to the ordering of the drivers annnotated in the tree. This terminology is borrowed from the REVOLVER algorithm, where it is used to refer to the set of trajectories that a patient "transfers" to another patient during the fit.
plot(x) plot_information_transfer(x)
plot_icon(x)
For the data, you can plot the CCF of the clusters.
plot_CCF_clusters(x)
Or you can plot the size of each CCF cluster as a barplot. This 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.
plot_clone_size(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.