View source: R/mutation-prevalence.R
mutation_prevalence | R Documentation |
Generate a table representing the prevalence of unique mutations. In order to ensure confidence in the results, a threshold is provided indicating confidence in genotype calls. All data that do not meet this threshold will be removed from the computation.
mutation_prevalence(data, ...)
## S3 method for class 'ref_alt_cov_tbl'
mutation_prevalence(data, ..., threshold)
## S3 method for class 'geno_tbl'
mutation_prevalence(data, ...)
data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). |
... |
Other arguments passed to specific methods. |
threshold |
A minimum UMI count which reflects the confidence in the genotype call. Data with a UMI count of less than the threshold will be filtered out from the analysis. |
A tibble with the extra class mut_prev
. The
output has the following columns:
mutation_name
: The unique mutation sequenced.
n_total
: The number of samples for which a mutation site was sequenced.
n_mutant
: The number of samples for which a mutation occurred.
prevalence
: The prevalence of the mutation.
plot_mutation_prevalence()
for plotting the table.
# 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
mutation_prevalence(data, threshold = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.