View source: R/plot_profile_heatmap.R
plot_profile_heatmap | R Documentation |
Function to plot a SNV mutation matrix as a heatmap. This is especially useful when looking at a wide mutational context.
plot_profile_heatmap(mut_matrix, by = NA, max = 0.02, condensed = FALSE)
mut_matrix |
Matrix containing mutation counts. |
by |
Optional grouping variable |
max |
Maximum value used for plotting the relative contributions. Contributions that are higher will have the maximum colour. (Default: 0.02) |
condensed |
More condensed plotting format. Default = F. |
A ggplot object
mut_matrix
,
plot_96_profile
,
plot_river
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.