plot_mutation_prevalence: Plot prevalence of mutations

View source: R/mutation-prevalence.R

plot_mutation_prevalenceR Documentation

Plot prevalence of mutations

Description

Plot the prevalence of mutations generated by mutation_prevalence(). The prevalence is plotted on the y-axis and the amino acid change is plotted on the x-axis. Data are grouped by the gene on which the mutation took place and coloured according to their groupings.

Usage

plot_mutation_prevalence(data)

## S3 method for class 'mut_prev'
autoplot(object, ...)

## S3 method for class 'mut_prev'
plot(x, ...)

Arguments

data, object, x

An object of class mut_prev. Derived from the output of mutation_prevalence().

...

Other arguments passed to specific methods.

Value

A ggplot2 object.

See Also

mutation_prevalence() for generating the data for plotting.

Examples

# Read example data
data <- read_tbl_ref_alt_cov(
  miplicorn_example("reference_AA_table.csv"),
  miplicorn_example("alternate_AA_table.csv"),
  miplicorn_example("coverage_AA_table.csv"),
  gene == "atp6" | gene == "crt"
)

# Compute mutation prevalence
prevalence <- mutation_prevalence(data, threshold = 5)

# Plot
plot(prevalence)

bailey-lab/miplicorn documentation built on March 19, 2023, 7:40 p.m.