as.mutation.matrix | R Documentation |
Conversion of ten-state sequencing matrix to 0/1-mutation matrix.
as.mutation.matrix(seq)
seq |
A dataframe representing the ten-state sequencing matrix. Elements of the matrix are the from "X/Y" for X and Y being nucleotides or "./." for missing value. Rows represent loci and columns represent samples. |
A data frame with exactly the same size as the input seq
matrix.
The most abundant state in each loci (row) translated to 0, and
the others are translated to 1. Missing values are translated to 3.
## A small 10-state matrix
seq = data.frame("C1" = c("C/C", "C/C"), "C2" = c("A/A", NA), "C3" = c("C/C", "A/A"))
## Convert it to mutation matrix
as.mutation.matrix(seq)
# C1 C2 C3
# 1 0 1 0
# 2 1 3 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.