File: plot_compare_dbs.Rd

package info (click to toggle)
r-bioc-mutationalpatterns 3.16.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,360 kB
  • sloc: sh: 8; makefile: 2
file content (87 lines) | stat: -rw-r--r-- 2,384 bytes parent folder | download | duplicates (2)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_compare_dbs.R
\name{plot_compare_dbs}
\alias{plot_compare_dbs}
\title{Compare two DBS mutation profiles}
\usage{
plot_compare_dbs(
  profile1,
  profile2,
  profile_names = c("profile 1", "profile 2"),
  profile_ymax = 0.2,
  diff_ylim = c(-0.1, 0.1)
)
}
\arguments{
\item{profile1}{First mutation profile}

\item{profile2}{Second mutation profile}

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

\item{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 = 0.2.}

\item{diff_ylim}{Y-axis limits for profile difference plot,
default = c(-0.1, 0.1)}
}
\value{
A ggplot2 object
}
\description{
Plots two DBS mutation profiles and their difference, reports the residual
sum of squares (RSS).
}
\examples{

## Get the DBS counts
## See 'count_dbs_contexts()' for more info on how to do this.
dbs_counts <- readRDS(system.file("states/blood_dbs_counts.rds",
  package = "MutationalPatterns"
))

## Get DBS refit info.
## See 'fit_to_signatures()' for more info on how to do this.
fit_res <- readRDS(system.file("states/dbs_refit.rds",
  package = "MutationalPatterns"
))

## Compare the reconstructed profile of sample 1 with the original profile
## The same thing could be done with a reconstructed profile from NMF.
plot_compare_dbs(dbs_counts[, 1], fit_res$reconstructed[, 1])

## You could also compare regular mutation profiles with eachother.
plot_compare_dbs(
  dbs_counts[, 1],
  dbs_counts[, 2]
)

## Or change the names of the profiles
plot_compare_dbs(dbs_counts[, 1],
  dbs_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_dbs(dbs_counts[, 1],
  dbs_counts[, 2],
  profile_ymax = 0.3,
  diff_ylim = c(-0.03, 0.03)
)
}
\seealso{
\code{\link{plot_compare_profiles}},
\code{\link{plot_compare_indels}},
\code{\link{plot_compare_mbs}}

Other DBS: 
\code{\link{count_dbs_contexts}()},
\code{\link{get_dbs_context}()},
\code{\link{plot_dbs_contexts}()},
\code{\link{plot_main_dbs_contexts}()}
}
\concept{DBS}