View source: R/grantham_distance.R
grantham_equation | R Documentation |
This function calculates Grantham's distance d_{i,j}
between two
amino acids (i
and j
) based on their chemical properties:
d_{i,j} = \rho ((\alpha (c_i-c_j)^2 + \beta (p_i-p_j)^2 + \gamma (v_i-v_j)^2)^\frac{1}{2}
This calculation is based on three amino acid side chain properties that were found to be the three strongest correlators with the relative substitution frequency (RSF) (references cited in Grantham (1974)), namely:
composition c
, meaning the atomic weight ratio of hetero (noncarbon)
elements in end groups or rings to carbons in the side chain.
polarity p
;
molecular volume v
.
Each property difference is weighted by dividing by the mean distance found
with it alone in the formula. The constants \alpha
, \beta
and
\gamma
are squares of the inverses of mean distances of each property,
respectively.
The distances reported by Grantham (1974) are further scaled by a factor
—here coined \rho
— such that the mean of all distances is 100.
Although this factor is not explicitly included in Grantham's distance
formula, it is actually used for calculating the amino acid pair distances
reported in Table 2 of Grantham's paper. So, for all intents and purposes,
this factor should be regarded as part of the formula used to calculate
Grantham distance, and therefore we include it explicitly in the equation
above.
If you want to calculate Grantham's distance right off from the identity of
the amino acids, instead of using their chemical properties, then use
grantham_distance()
.
grantham_equation(
c_i,
c_j,
p_i,
p_j,
v_i,
v_j,
alpha = 1.833,
beta = 0.1018,
gamma = 0.000399,
rho = 50.723
)
c_i |
composition value for the ith amino acid. |
c_j |
composition value for the jth amino acid. |
p_i |
polarity value for the ith amino acid. |
p_j |
polarity value for the jth amino acid. |
v_i |
molecular volume value for the ith amino acid. |
v_j |
molecular volume value for the jth amino acid. |
alpha |
The constant |
beta |
The constant |
gamma |
The constant |
rho |
Grantham's distances reported in Table 2, Science (1974).
185(4154): 862–4 by R. Grantham, are scaled by a factor (here named
|
A double vector of Grantham's distances.
Check amino_acids_properties for a table of the three property values that can be used with this formula. This data set is from Table 1, Science (1974). 185(4154): 862–4 by R. Grantham.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.