plot_compare_mbs: Compare two mbs mutation profiles

Description Usage Arguments Value See Also Examples

View source: R/plot_compare_mbs.R

Description

Plots two mbs mutation profiles and their difference, reports the residual sum of squares (RSS).

Usage

1
2
3
4
5
6
7
plot_compare_mbs(
  profile1,
  profile2,
  profile_names = c("profile 1", "profile 2"),
  profile_ymax = 1,
  diff_ylim = c(-0.5, 0.5)
)

Arguments

profile1

First mutation profile

profile2

Second mutation profile

profile_names

Character vector with names of the mutations profiles used for plotting, default = c("profile 1", "profile 2")

profile_ymax

Maximum value of y-axis (relative contribution) for profile plotting. This can only be used to increase the y axis. If bars fall outside this limit, the maximum value is automatically increased. default = 1.

diff_ylim

Y-axis limits for profile difference plot, default = c(-0.5, 0.5)

Value

A ggplot2 object

See Also

plot_compare_profiles, plot_compare_dbs, plot_compare_indels

Other MBS: count_mbs_contexts(), plot_mbs_contexts()

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
## Get the mbs counts
## See 'count_mbs_contexts()' for more info on how to do this.
mbs_counts <- readRDS(system.file("states/blood_mbs_counts.rds",
  package = "MutationalPatterns"
))


## You could compare regular mutation profiles with eachother.
plot_compare_mbs(
  mbs_counts[, 1],
  mbs_counts[, 2]
)

## Or change the names of the profiles
plot_compare_mbs(mbs_counts[, 1],
  mbs_counts[, 2],
  profile_names = c("Original", "Reconstructed")
)

## You can also change the y limits.
## This can be done separately for the profiles and the different facets.
plot_compare_mbs(mbs_counts[, 1],
  mbs_counts[, 2],
  profile_ymax = 0.9,
  diff_ylim = c(-0.8, 0.8)
)

## You could also compare a reconstructed profile.
## However, the example data does not contain enough MBS variants to use NMF.
## Existing signatures have also not yet been defined.

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