View source: R/label_mutations.R
label_mutations | R Documentation |
For each data point, label a mutation as "ref"
, "alt"
, "ins"
, or
"del"
.
Data points that have more reference (REF) than alternate (ALT) calls will
be labeled as "ref"
.
Mutations whose REF and ALT calls are both one base pair and who have more
ALT calls than REF calls will be labeled as "alt"
.
Mutations whose REF and ALT calls differ in length and have more ALT calls
than REF calls will be labeled as "ins"
.
Mutations whose REF and ALT calls differ in length and have more REF calls
than ALT calls will be labeled as "del"
.
label_mutations(.data, .before = NULL, .after = NULL)
## S3 method for class 'ref_alt_cov_tbl'
label_mutations(.data, .before = NULL, .after = NULL)
The object .data
with an added column that indicates the mutation type of
each row. The column is added to the right-hand side by default, but this may
be controlled by the .before
and .after
arguments.
# 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"
)
# Add ref and alt calls to data
sequences <- c("A", "T", "C", "G", "AT", "TC", "TGC")
data <- dplyr::mutate(
data,
ref = sample(sequences, size = nrow(data), replace = TRUE),
alt = sample(sequences, size = nrow(data), replace = TRUE)
)
# Label the mutations
label_mutations(data)
label_mutations(data, .after = alt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.