sub_ratio | R Documentation |
Calculates base substitution ratio (e.g.: editing frequency) for ref
and base counts stored
in nx4 matrix bases
.
ref
must have only one reference base. A->G is okay, but AG->G is NOT allowed!
If bc
is not provided, count the substitution ratio of the largest non-reference base
(@seealso max_observed_bc
). Make sure that number of alleles in ref(erence) and bases
is 2 at maximum.
sub_ratio(ref, bases, bc = NULL)
ref |
vector of reference bases. |
bases |
matrix of observed base call counts. |
bc |
vector strings that represent observed base calls. Default: NULL. |
vector of base call substitution ratios.
ref <- c("A", "A", "T") # Only one non-ref. base bases <- matrix(c( 1, 0, 9, 0, 5, 0, 5, 0, 0, 10, 0, 0), ncol = 4, byrow = TRUE) # show base substitution ratios for observed base calls sub_ratio(ref, bases) # > one non-ref. base bases <- matrix(c( 1, 2, 9, 1, 5, 3, 5, 1, 2, 10, 2, 1), ncol = 4, byrow = TRUE) # we are only interested in A->G, T->C bc <- c("G", "G", "C") # show base substitution ratios for A->G, T->C sub_ratio(ref, bases, bc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.