-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmutation_prevalence.Rd
55 lines (50 loc) · 1.86 KB
/
mutation_prevalence.Rd
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mutation-prevalence.R
\name{mutation_prevalence}
\alias{mutation_prevalence}
\alias{mutation_prevalence.ref_alt_cov_tbl}
\alias{mutation_prevalence.geno_tbl}
\title{Compute prevalence of mutations}
\usage{
mutation_prevalence(data, ...)
\method{mutation_prevalence}{ref_alt_cov_tbl}(data, ..., threshold)
\method{mutation_prevalence}{geno_tbl}(data, ...)
}
\arguments{
\item{data}{A data frame, data frame extension (e.g. a tibble), or a lazy
data frame (e.g. from dbplyr or dtplyr).}
\item{...}{Other arguments passed to specific methods.}
\item{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 \link[tibble:tibble-package]{tibble} with the extra class \code{mut_prev}. The
output has the following columns:
\itemize{
\item \code{mutation_name}: The unique mutation sequenced.
\item \code{n_total}: The number of samples for which a mutation site was sequenced.
\item \code{n_mutant}: The number of samples for which a mutation occurred.
\item \code{prevalence}: The prevalence of the mutation.
}
}
\description{
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.
}
\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
mutation_prevalence(data, threshold = 5)
}
\seealso{
\code{\link[=plot_mutation_prevalence]{plot_mutation_prevalence()}} for plotting the table.
}