plot_profile_heatmap: Plot a mutation matrix as a heatmap

Description Usage Arguments Value See Also Examples

View source: R/plot_profile_heatmap.R

Description

Function to plot a SNV mutation matrix as a heatmap. This is especially usefull when looking at a wide mutational context.

Usage

1
plot_profile_heatmap(mut_matrix, by = NA, max = 0.02, condensed = FALSE)

Arguments

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.

Value

A ggplot object

See Also

mut_matrix, plot_96_profile, plot_river

Examples

 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
## 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)

MutationalPatterns documentation built on Nov. 14, 2020, 2:03 a.m.