mutation_frequency: Compute frequency of mutations

View source: R/mutation-frequency.R

mutation_frequencyR Documentation

Compute frequency of mutations

Description

Generate a table representing the frequency 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.

Usage

mutation_frequency(data, threshold)

## S3 method for class 'ref_alt_cov_tbl'
mutation_frequency(data, threshold)

Arguments

data

A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).

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.

Value

A tibble with the extra class mut_freq. The output has the following columns:

  • mutation_name: The unique mutation sequenced.

  • frequency: The frequency of the mutation.

See Also

plot_mutation_frequency() for plotting the table.

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 frequency
mutation_frequency(data, 5)

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