File: plot_rainfall.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 (98 lines) | stat: -rw-r--r-- 2,344 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
88
89
90
91
92
93
94
95
96
97
98
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_rainfall.R
\name{plot_rainfall}
\alias{plot_rainfall}
\title{Plot genomic rainfall}
\usage{
plot_rainfall(
  vcf,
  chromosomes,
  title = "",
  colors = NA,
  cex = 2.5,
  cex_text = 3,
  ylim = 1e+08,
  type = c("snv", "indel", "dbs", "mbs")
)
}
\arguments{
\item{vcf}{GRanges object}

\item{chromosomes}{Vector of chromosome/contig names of the reference
genome to be plotted}

\item{title}{Optional plot title}

\item{colors}{Vector of 6 colors used for plotting}

\item{cex}{Point size}

\item{cex_text}{Text size}

\item{ylim}{Maximum y value (genomic distance)}

\item{type}{The mutation type of the GRanges object that will be used.
Possible values:
* 'snv' (default)
* 'indel'
* 'dbs'
* 'mbs'}
}
\value{
Rainfall plot
}
\description{
Rainfall plot visualizes the types of mutations and intermutation distance
}
\details{
Rainfall plots can be used to visualize the distribution of mutations
along the genome or a subset of chromosomes. The distance of a mutation
with the mutation prior to it (the intermutation distance) is plotted on
the y-axis on a log scale. The input GRanges are sorted before plotting.

The colour of the points indicates the base substitution type.
Clusters of mutations with lower intermutation distance represent mutation
hotspots.
}
\examples{
## See the 'read_vcfs_as_granges()' example for how we obtained the
## following data:
vcfs <- readRDS(system.file("states/read_vcfs_as_granges_output.rds",
  package = "MutationalPatterns"
))

# Specify chromosomes of interest.
chromosomes <- names(genome(vcfs[[1]])[1:22])

## Do a rainfall plot for all chromosomes:
plot_rainfall(vcfs[[1]],
  title = names(vcfs[1]),
  chromosomes = chromosomes,
  cex = 1
)

## Or for a single chromosome (chromosome 1):
plot_rainfall(vcfs[[1]],
  title = names(vcfs[1]),
  chromosomes = chromosomes[1],
  cex = 2
)

## You can also use other variant types

## Get a GRangesList or GRanges object with indel contexts.
## See 'indel_get_context' for more info on how to do this.
grl_indel_context <- readRDS(system.file("states/blood_grl_indel_context.rds",
  package = "MutationalPatterns"
))

plot_rainfall(grl_indel_context[[1]],
  title = "Indel rainfall",
  chromosomes,
  type = "indel"
)

}
\seealso{
\code{\link{read_vcfs_as_granges}}
}