# grantham_equation: Grantham distance In grantham: Calculate the 'Grantham' Distance

## Description

This function calculates Grantham's distance d_{i,j} between two amino acids (i and j) based on their chemical properties:

d_{i,j} = ρ ((α (c_i-c_j)^2 + β (p_i-p_j)^2 + γ (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 α, β and γ 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 ρ— 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().

## Usage

  1 2 3 4 5 6 7 8 9 10 11 12 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 ) 

## Arguments

 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 α in the equation of Grantham's paper, in page 863. beta The constant β in the equation of Grantham's paper, in page 863. gamma The constant γ in the equation of Grantham's paper, in page 863. rho Grantham's distances reported in Table 2, Science (1974). 185(4154): 862–4 by R. Grantham, are scaled by a factor (here named ρ) such that the mean value of all distances are 100. The rho parameter allows this factor ρ to be changed. By default ρ=50.723, the same value used by Grantham. This value is originally mentioned in the caption of Table 2 of the aforementioned paper.

## Value

A double vector of Grantham's distances.