knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(lineaGT) library(magrittr) library(patchwork)
data(x.example)
x.example
The mixture weights and number of ISs per cluster can be visualized with the function plot_mixture_weights()
.
plot_mixture_weights(x.example)
The function plot_scatter_density()
returns a list of 2D multivariate densities estimated by the model. The argument highlight
can be used to show only a subset of clusters and the argument min_frac
to show the clusters with the specified frequency in at least one dimension.
Note that the observed coverage values across lineages and over time are modeled as independent, therefore each dimension corresponds to a combination of time-point and lineage.
plots = plot_scatter_density(x.example) plots$`cov.t2.l1:cov.t1.l2` # to visualize a single plot
The function plot_marginal()
returns a plot with the marginal estimated densities for each cluster, time-point and lineage.
The option single_plot
returns the density of the whole mixture grouped by lineage and time-point.
marginals = plot_marginal(x.example) marginals_mixture = plot_marginal(x.example, single_plot=T) patchwork::wrap_plots(marginals / marginals_mixture)
The function plot_mullerplot()
shows the expansion of the identified populations over time. It supports the options which=c("frac","pop")
corresponding to the absolule population abundance and the relative fraction, respectively.
mp1 = plot_mullerplot(x.example, which="frac") mp2 = plot_mullerplot(x.example, which="pop") patchwork::wrap_plots(mp1, mp2, ncol=1)
If the option mutations
is set to TRUE
, then the subclones originated within each population will be reported as well in the mullerplot.
mp1 = plot_mullerplot(x.example, which="frac", mutations=T) mp2 = plot_mullerplot(x.example, which="pop", mutations=T) patchwork::wrap_plots(mp1, mp2, ncol=1)
The function supports also the visualization of a single clone to monitor the growth of subpopulations, through the argument single_clone
.
plot_mullerplot(x.example, highlight="C4", mutations=T, single_clone=T)
Moreover, some of the identified clusters (showing low coverage in all dimensions) represents poly-clonal populations, since they cannot be uniquely identified by the mixture model. Therefore, the estimated abundance values might be readjusted according to the estimated number of populations in each clusters.
estimate_n_pops(x.example)
plot_mullerplot(x.example, which="frac", mutations=T, estimate_npops=T)
The function plot_vaf_time()
can be used to visualize the behaviour of mutations variant allele frequencies over time for each subclone.
plot_vaf_time(x.example)
For each cluster of ISs, the function plot_phylogeny()
reports the estimated phylogenetic tree.
plot_phylogeny(x.example)
The fitted exponential and logistic growth regressions are shown with the plot_growth_regression()
, reporting by default the fit of the best model, selected as the one with the highest likelihood.
Both regressions can be inspected setting show_best=F
.
plot_growth_regression(x.example, show_best=F)
The same function can be used to show the growth regressions for the subclones identified by somatic mutations.
plot_growth_regression(x.example, highlight="C4", mutations=T)
An alternative way of visualising differences in growth rates is through plot_growth_rates()
function, reporting the values of estimated growth rates for each (sub)population.
Disabling the show_best
option, the model with lowest likelihood is shown as a dashed line.
plot_growth_rates(x.example, show_best=F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.