Skip to contents

Retrieves non reference ratio based on ref and base calls given by bases.

Usage

non_ref_ratio(bases, ref)

Arguments

bases

nx4 matrix or data frame of base call counts.

ref

string vector of reference bases.

Value

numeric vector of non reference substitution ratios for bases.

Examples

ref <- c("A", "A", "A")
bases <- tidyr::tribble(
  ~A, ~C, ~G, ~T,
  10,  0,  5,  5,
   0,  1,  1,  1,
   1,  1,  1,  1
)
non_ref_ratio(bases, ref)
#> [1] 0.50 1.00 0.75