1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_profile_heatmap.R
\name{plot_profile_heatmap}
\alias{plot_profile_heatmap}
\title{Plot a mutation matrix as a heatmap}
\usage{
plot_profile_heatmap(mut_matrix, by = NA, max = 0.02, condensed = FALSE)
}
\arguments{
\item{mut_matrix}{Matrix containing mutation counts.}
\item{by}{Optional grouping variable}
\item{max}{Maximum value used for plotting the relative contributions.
Contributions that are higher will have the maximum colour. (Default: 0.02)}
\item{condensed}{More condensed plotting format. Default = F.}
}
\value{
A ggplot object
}
\description{
Function to plot a SNV mutation matrix as a heatmap.
This is especially useful when looking at a wide mutational context.
}
\examples{
## See the 'mut_matrix()' examples for how we obtained the
## mutation matrix information:
## Get regular matrix
mut_mat <- readRDS(system.file("states/mut_mat_data.rds",
package = "MutationalPatterns"
))
## Create heatmap of profile
plot_profile_heatmap(mut_mat, max = 0.1)
## Get extended matrix
mut_mat_extended <- readRDS(system.file("states/mut_mat_data_extended.rds",
package = "MutationalPatterns"
))
## Create heatmap of extended profile
plot_profile_heatmap(mut_mat_extended)
## Or plot heatmap per tissue
tissue <- c(
"colon", "colon", "colon",
"intestine", "intestine", "intestine",
"liver", "liver", "liver"
)
plot_profile_heatmap(mut_mat_extended, by = tissue)
## Or plot the heatmap per sample.
plot_profile_heatmap(mut_mat_extended,
by = colnames(mut_mat_extended),
max = 0.05
)
## Create a condensed heatmap of extended profile
plot_profile_heatmap(mut_mat_extended, condensed = TRUE)
}
\seealso{
\code{\link{mut_matrix}},
\code{\link{plot_96_profile}},
\code{\link{plot_river}}
}
|