Plot genomic rainfall

Share:

Description

Rainfall plot visualizes the types of mutations and intermutation distance

Usage

1
2
plot_rainfall(vcf, chromosomes, title = "", colors, cex = 2.5,
    cex_text = 3, ylim = 1e+08)

Arguments

vcf

CollapsedVCF object

chromosomes

Vector of chromosome/contig names of the reference genome to be plotted

title

Optional plot title

colors

Vector of 6 colors used for plotting

cex

Point size

cex_text

Text size

ylim

Maximum y value (genomic 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 colour of the points indicates the base substitution type. Clusters of mutations with lower intermutation distance represent mutation hotspots.

Value

Rainfall plot

See Also

read_vcfs_as_granges

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

## Exclude mitochondrial and autosomal chromosomes.
autosomal = extractSeqlevelsByGroup(species="Homo_sapiens",
                                    style="UCSC",
                                    group="auto")

vcfs <- lapply(vcfs, function(x) keepSeqlevels(x, autosomal))

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.