View source: R/mutation-frequency.R
plot_mutation_frequency | R Documentation |
Plot the frequency of mutations generated by mutation_frequency()
.
The frequency 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.
plot_mutation_frequency(data)
## S3 method for class 'mut_freq'
autoplot(object, ...)
## S3 method for class 'mut_freq'
plot(x, ...)
data, object, x |
An object of class |
... |
Other arguments passed to specific methods. |
A ggplot2 object.
mutation_frequency()
for generating the data for plotting.
# 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 the mutation frequency
frequency <- mutation_frequency(data, 5)
# Plot
plot(frequency)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.