Extracts the trinucleotide context for a set of mutations

extract_trinucleotide_context(mutations, reference, destrand = TRUE)

Arguments

mutations

A data frame having the mutations. Should have the columns CHROM, POS, REF, ALT.

reference

the reference genome in BSgenome format

destrand

logical, whether to destrand mutations

Value

A data frame with two columns having the substitutions and the trinucleotide context

Examples

# \donttest{ data("mutations", package = "ctDNAtools") ## Use human reference genome from BSgenome.Hsapiens.UCSC.hg19 library suppressMessages(library(BSgenome.Hsapiens.UCSC.hg19)) ## with destranding extract_trinucleotide_context(mutations, BSgenome.Hsapiens.UCSC.hg19)
#> substitution context #> 1 CG A_A #> 2 CA G_T #> 3 TA A_T #> 4 TC T_A #> 5 TA A_G #> 6 CA G_A #> 7 TG G_T #> 8 TG T_T #> 9 TC T_A #> 10 CT T_T
## without destranding extract_trinucleotide_context(mutations, BSgenome.Hsapiens.UCSC.hg19, destrand = FALSE )
#> substitution context #> 1 CG A_A #> 2 GT A_C #> 3 AT A_T #> 4 TC T_A #> 5 TA A_G #> 6 CA G_A #> 7 AC A_C #> 8 AC A_A #> 9 AG T_A #> 10 CT T_T
# }