This function plots the histogram of any of the following:
* the Variant Allele Frequency (VAF), * the depth of sequencing (DP), * the number of reads with the variant (NV) * the Cancer Cell Fractions (CCF) estimates (if available)
The plot can be subset by selecting only mutations mapping to certain karyotypes.
plot_data_histogram(
x,
which = "VAF",
karyotypes = c("1:0", "1:1", "2:0", "2:1", "2:2")
)
A ggplot2
plot.
data('example_dataset_CNAqc', package = '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.
# Default plot
plot_data_histogram(x)
#> Warning: Removed 8 rows containing missing values or values outside the scale range
#> (`geom_bar()`).
# Customised plots
plot_data_histogram(x, which = 'DP')
plot_data_histogram(x, which = 'DP', karyotypes = '2:2')
# CCF computation and plotting
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_data_histogram(x, which = 'CCF')
#> Warning: Removed 6 rows containing missing values or values outside the scale range
#> (`geom_bar()`).