Description Usage Arguments Examples
View source: R/sigfit_plotting.R
plot_exposures
plots the distribution of signature exposures across samples.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
mcmc_samples |
List with two elements named |
pdf_path |
Character indicating the path to an optional output PDF file for the plots. The
PDF dimensions and graphical parameters are automatically set to appropriate values, but custom
dimensions can be specified via the arguments |
counts |
Numeric matrix of observed mutation counts, with one row per sample and
one column per mutation type. Only needed if |
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 |
signature_names |
Character vector containing the name of each signature. Only needed if
|
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. |
hpd_prob |
Numeric value in the interval (0, 1), indicating the desired probability content of HPD intervals (default is 0.95). |
pdf_width |
Numeric indicating the width of the output PDF, in inches (default is 24).
Only used if |
pdf_height |
Numeric indicating the height of the output PDF, in inches (default is 10).
Only used if |
margin_bottom |
Numeric indicating the width of the bottom margin, in inches (default is 10.5). |
legend_pos |
Character indicating the position of the legend. Admits values |
legend_cex |
Numeric indicating the relative size of the legend (default is 2). |
cex_names |
Numeric indicating the relative size of sample labels (default is 1.9). |
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. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
# Load example mutational catalogues and COSMIC signatures
data("counts_21breast")
data("cosmic_signatures_v2")
# Fit signatures and retrieve exposures
samples <- fit_signatures(counts_21breast, cosmic_signatures_v2)
exposures <- retrieve_pars(samples, "exposures")
# Plot exposures using MCMC samples
plot_exposures(mcmc_samples = samples, pdf_path = "Exposures.pdf")
# Plot exposures using retrieved exposures matrix
plot_exposures(counts = counts_21breast, exposures = exposures,
signature_names = rownames(cosmic_signatures_v2),
pdf_path = "Exposures.pdf")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.