This function calculates the Grantham distance for pairs of amino acids.
Amino acid identities should be provided as three-letter codes in x
and
y
. Amino acids identified in x
and y
are matched element-wise, i.e. the
first element of x
is paired with the first element of y
, and so on.
The Grantham distance attempts to provide a proxy for the evolutionary
distance between two amino acids based on three key chemical properties:
composition, polarity and molecular volume. In turn, evolutionary distance is
used as a proxy for the impact of missense substitutions. The higher the
distance, the more deleterious the substitution is.
The distance calculation is provided by two methods. The so-called original
method, meaning that the amino acid distances used are the ones provided by
Grantham in his original publication in Table 2. This is the default method.
In addition, you may choose the exact method, which uses the chemical
properties provided in Grantham's Table 1 to compute the amino acid
differences anew. The distances calculated with the exact method are not
rounded to the nearest integer and will differ by ~1 unit for some amino acid
pairs from the original method.
If you want to calculate Grantham's distance by providing the values of the
amino acid properties explicitly, then use grantham_equation()
instead.