
Create Heatmap of Signature Exposures
SignatureExposuresPlot.Rd
Converts signature-per-sample data to a heatmap, optionally saves it as a png, and returns the ggplot. Samples are sorted for display based on their maximum signature exposure. Heatmap is plotted in the viridis colour-scheme.
Usage
SignatureExposuresPlot(
signatures,
order = FALSE,
transpose = FALSE,
colour_scheme = "D",
colour_dir = 1,
cm_begin = 0,
addtitle = NULL,
obj_name = "sig_exposures_obj"
)
Arguments
- signatures
Dataframe. Expects a dataframe of signature exposures (rows) by samples (columns).
- order
(optional) Character vector. Defines the order in which samples will be plotted.
This is particularly useful when plotting more than 1 heatmap next to one another.
Allows samples to line-up horizontally.
Example:c("CC-CHM-1341", "CC-CHM-1347", "CC-CHM-1355", CC-CHM-1361", "CC-HAM-0369", "CC-HAM-0374", "CC-HAM-0379", "CC-HAM-0383", "CC-HAM-0385")
- transpose
(optional) Logical. If set to TRUE the function returns the order in which samples were plotted.
- colour_scheme
(optional) Character. Value passed to the
viridis::scale_fill_viridis
option parameter. ex. 'A' or 'B'- colour_dir
(optional) Either 1 OR -1. Value passed to the
viridis::scale_fill_viridis
direction parameter.- cm_begin
(optional) Float. Value within range 0,1. Value passed to the
viridis::scale_fill_viridis
direction parameter.- obj_name
(optional) String. Adds a tag to the end of the filename if saving the image.
Only used if the save_path parameter is also set.- title
(optional) String or TRUE. Pass in a title for the plot or set to TRUE and one will be generated.