View source: R/TargetingModels.R
calcTargetingDistance | R Documentation |
calcTargetingDistance
converts either the targeting rates in a TargetingModel
model to a matrix of 5-mer to single-nucleotide mutation distances, or the substitution
rates in a 1-mer substitution model to a symmetric distance matrix.
calcTargetingDistance(model, places = 2)
model |
TargetingModel object with mutation likelihood information, or a 4x4 1-mer substitution matrix normalized by row with rownames and colnames consisting of "A", "T", "G", and "C". |
places |
decimal places to round distances to. |
The targeting model is transformed into a distance matrix by:
Converting the likelihood of being mutated p=mutability*substitution
to
distance d=-log10(p)
.
Dividing this distance by the mean of the distances.
Converting all infinite, no change (e.g., A->A), and NA distances to zero.
The 1-mer substitution matrix is transformed into a distance matrix by:
Symmetrize the 1-mer substitution matrix.
Converting the rates to distance d=-log10(p)
.
Dividing this distance by the mean of the distances.
Converting all infinite, no change (e.g., A -> A), and NA distances to zero.
For input of TargetingModel, a matrix of distances for each 5-mer motif with rows names defining the center nucleotide and column names defining the 5-mer nucleotide sequence. For input of 1-mer substitution matrix, a 4x4 symmetric distance matrix.
See TargetingModel for this class of objects and createTargetingModel for building one.
# Calculate targeting distance of HH_S5F
dist <- calcTargetingDistance(HH_S5F)
# Calculate targeting distance of HH_S1F
dist <- calcTargetingDistance(HH_S1F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.