This function extracts the plots of the Cancer Cell Fractions (CCFs) estimates from a `CNAqc` object, after they have been computed using function `compute_CCF`. The plots - one per computed karyotype - are assembled into a `ggpubr` figure.

plot_CCF(x, strip = FALSE, empty_plot = TRUE, assembly_plot = TRUE)

Arguments

x

An object of class cnaqc, where CCF have been computed using function `compute_CCF`.

strip

If TRUE, shows little detail and a strip horizontal plot. Otherwise it shows a detailed report (multiple rows). This parameter is now deprecated.

empty_plot

If data for one karyotype is missing, an empty plot is returned. Otherwise the plot is not returned (NULL is forwarded).

assembly_plot

If TRUE, a unique figure is returned with all the plots assembled. Otherwise a list of plot is returned.

Value

A `ggpubr` figure of the CCF estimates.

Examples

data('example_dataset_CNAqc')
x = init(mutations = example_dataset_CNAqc$mutations, cna =example_dataset_CNAqc$cna, purity = example_dataset_CNAqc$purity)
#> 
#> ── CNAqc - CNA Quality Check ───────────────────────────────────────────────────
#> 
#>  Using reference genome coordinates for: GRCh38.
#>  Found annotated driver mutations: TTN, CTCF, and TP53.
#>  Fortified calls for 12963 somatic mutations: 12963 SNVs (100%) and 0 indels.
#> ! CNAs have no CCF, assuming clonal CNAs (CCF = 1).
#>  Fortified CNAs for 267 segments: 267 clonal and 0 subclonal.
#>  12963 mutations mapped to clonal CNAs.

x = compute_CCF(x)
#> Warning: Some karyotypes have fewer than25and will not be analysed.
#> ── Computing mutation multiplicity for karyotype 2:0 using the entropy method. ─
#>  Expected Binomial peak(s) for these calls (1 and 2 copies): 0.445 and 0.89
#>  Mixing pre/ post aneuploidy: 0.09 and 0.91
#>  Not assignamble area: [0.631578947368421; 0.723684210526316]
#> ── Computing mutation multiplicity for karyotype 2:1 using the entropy method. ─
#>  Expected Binomial peak(s) for these calls (1 and 2 copies): 0.307958477508651 and 0.615916955017301
#>  Mixing pre/ post aneuploidy: 0.55 and 0.45
#>  Not assignamble area: [0.423423423423423; 0.504504504504504]
#> ── Computing mutation multiplicity for karyotype 2:2 using the entropy method. ─
#>  Expected Binomial peak(s) for these calls (1 and 2 copies): 0.235449735449735 and 0.470899470899471
#>  Mixing pre/ post aneuploidy: 0.09 and 0.91
#>  Not assignamble area: [0.290780141843972; 0.368794326241135]
plot_CCF(x)
#> Warning: Removed 4 rows containing missing values (`geom_bar()`).
#> Warning: Removed 22 rows containing non-finite values (`stat_bin()`).
#> Warning: Removed 5 rows containing missing values (`geom_bar()`).
#> Warning: Removed 157 rows containing non-finite values (`stat_bin()`).
#> Warning: Removed 5 rows containing missing values (`geom_bar()`).