Description Usage Arguments Examples
View source: R/sigfit_plotting.R
For a given set of signature fitting or extraction results, plot_all
plots, in PDF format:
All the original (input) mutational catalogues (via plot_spectrum
)
Mutational signatures (via plot_spectrum
)
Signature exposures (via plot_exposures
)
All the reconstructed mutational spectra (via plot_reconstruction
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | plot_all(
mcmc_samples = NULL,
out_path,
prefix = NULL,
counts = NULL,
signatures = NULL,
exposures = NULL,
opportunities = NULL,
thresh = 0.01,
hpd_prob = 0.95,
signature_names = NULL,
exp_margin_bottom = 10.5,
exp_legend_pos = "topleft",
exp_legend_cex = 2,
exp_cex_names = 1.9,
rec_legend_pos = "topleft",
rec_legend_cex = 2,
sig_color_palette = NULL,
boxes = TRUE,
generic = FALSE
)
|
mcmc_samples |
List with two elements named |
out_path |
Character indicating the path to the directory where the output PDF files will be stored. The directory will be created if it does not exist. |
prefix |
Character indicating an optional prefix to be added to output file names. |
counts |
Numeric matrix of observed mutation counts, with one row per sample and
one column per mutation type. Only needed if |
signatures |
Either a numeric matrix of mutational signatures, with one row per signature
and one column per mutation type, or a list of matrices generated via |
exposures |
Either a numeric matrix of signature exposures, with one row per sample and one
column per signature, or a list of matrices generated via |
opportunities |
Numeric matrix of mutational opportunities, with one row per signature and
one column per mutation type. It also admits character values |
thresh |
Numeric indicating the minimum threshold for the lower HPD limits of signature
exposures (default is 0.01). Exposures with a lower HPD limit below this value will be shown in
grey. This value is passed to |
hpd_prob |
Numeric value in the interval (0, 1), indicating the desired probability content
of HPD intervals (default is 0.95). This value is passed to |
signature_names |
Character vector containing the name of each signature. Only needed if
|
exp_margin_bottom |
Numeric indicating the bottom margin of the exposures barplots, in
inches (default is 10.5). This value is passed to |
exp_legend_pos |
Character indicating the position of the legend in the exposures barplot.
Admits values |
exp_legend_cex |
Numeric indicating the relative size of the legend in the exposures
barplot (default is 2). This value is passed to |
exp_cex_names |
Numeric indicating the relative size of sample labels in the exposures
barplot (default is 1.9). This value is passed to |
rec_legend_pos |
Character indicating the position of the legend in the spectrum
reconstruction plots. Admits values |
rec_legend_cex |
Numeric indicating the relative size of the legend in the reconstruction
plots (default is 2). This value is passed to |
sig_color_palette |
Character vector of custom color names or hexadecimal codes to use for
each signature in exposure and reconstruction plots. Must have at least as many elements as the
number of signatures. This value is passed to |
boxes |
Logical indicating whether boxes should be drawn around spectrum, signature and
reconstruction plots (default is |
generic |
Logical indicating whether a "generic" spectrum should be plotted (default is
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# Load example mutational catalogues
data("counts_21breast")
# Extract signatures using the EMu (Poisson) model
samples <- extract_signatures(counts_21breast, nsignatures = 2, model = "emu",
opportunities = "human-genome", iter = 800)
# Retrieve signatures and exposures
signatures <- retrieve_pars(samples, "signatures")
exposures <- retrieve_pars(samples, "exposures")
# Plot results using MCMC samples
plot_all(mcmc_samples = samples, out_path = ".", prefix = "Test1")
# Plot results using retrieved signatures and exposures
plot_all(counts = counts_21breast, signatures = signatures,
exposures = exposures, opportunities = "human-genome",
out_path = ".", prefix = "Test2")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.