attribute_nucleotide_exchanges: Attribute the nucleotide exchange for an SNV

Description Usage Arguments Value Examples

View source: R/basic_functions.R

Description

SNVs are grouped into 6 different categories (12/2 as reverse complements are summed over). This function defines the attribution.

Usage

1
2
3
4
5
6
attribute_nucleotide_exchanges(
  in_dat,
  in_REF.field = "REF",
  in_ALT.field = "ALT",
  in_verbose = FALSE
)

Arguments

in_dat

VRanges object or data frame which carries one column for the reference base and one column for the variant base

in_REF.field

String indicating which column of in_dat carries the reference base if dealing with data frames

in_ALT.field

String indicating which column of in_dat carries the variant base if dealing with data frames

in_verbose

Whether verbose or not.

Value

A character vector with as many rows as there are in in_dat which can be annotated (i.e. appended) to the input data frame.

Examples

1
2
3
4
5
6
7
8
test_df <- data.frame(
 CHROM=c(1,1,1,2,2,2,3,3,3,4,4,4,5,5),
 POS=c(1,2,3,4,5,6,1,2,3,4,5,6,7,8),
 REF=c("C","C","C","T","T","T","A","A","A","G","G","G","N","A"),
 ALT=c("A","G","T","A","C","G","C","G","T","A","C","T","A","N"))
test_df$change <- attribute_nucleotide_exchanges(
 test_df,in_REF.field = "REF",in_ALT.field = "ALT")
test_df

slw287r/yapsa documentation built on June 7, 2020, 12:46 a.m.