Learn R Programming

grantham (version 0.1.2)

grantham_distance_exact: Grantham's distance (exact)

Description

This function calculates the Grantham's distance for pairs of amino acids. It uses the values for the amino acid properties as published in Table 1 of Science (1974). 185(4154): 862--4 by R. Grantham.

Usage

grantham_distance_exact(
  x,
  y,
  alpha = 1.833,
  beta = 0.1018,
  gamma = 0.000399,
  rho = 50.723
)

Value

A tibble of Grantham's distances for each amino acid pair.

Arguments

x

A character vector of amino acid three-letter codes, e.g. "Ala" (Alanine).

y

A character vector of amino acid three-letter codes.

alpha

The constant \(\alpha\) in the equation of Grantham's paper, in page 863.

beta

The constant \(\beta\) in the equation of Grantham's paper, in page 863.

gamma

The constant \(\gamma\) 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 \(\rho\)) such that the mean value of all distances are 100. The rho parameter allows this factor \(\rho\) to be changed. By default \(\rho=50.723\), the same value used by Grantham. This value is originally mentioned in the caption of Table 2 of the aforementioned paper.

Details

Contrary to Grantham's distances presented in Table 2 of Grantham's paper, the distances returned by this function are calculated anew starting from the amino acid properties (composition, polarity and molecular volume). No rounding to nearest integer is performed.

See Also

grantham_equation()

Examples

Run this code
grantham_distance_exact(c("Ser", "Ser"), c("Pro", "Trp"))

Run the code above in your browser using DataLab