Calculate the Angle Between Three Atoms

Usage

angle.xyz(xyz, atm.inc = 3)

Arguments

xyz
a numeric vector of Cartisean coordinates.
atm.inc
a numeric value indicating the number of atoms to increment by between successive angle evaluations (see below).

Description

A function for basic bond angle determination.

Value

Returns a numeric vector of angles.

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.

Note

With atm.inc=1, angles are calculated for each set of three successive atoms contained in xyz (i.e. moving along one atom, or three elements of xyz, between sucessive evaluations). With atm.inc=3, angles are calculated for each set of three successive non-overlapping atoms contained in xyz (i.e. moving along three atoms, or nine elements of xyz, between sucessive evaluations).

Examples

## Read a PDB file pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") ) ## Angle between N-CA-C atoms of residue four inds <- atom.select(pdb, resno=4, elety=c("N","CA","C")) angle.xyz(pdb$xyz[inds$xyz])
[1] 106.7501
## Basic stats of all N-CA-C bound angles inds <- atom.select(pdb, elety=c("N","CA","C")) summary( angle.xyz(pdb$xyz[inds$xyz]) )
Min. 1st Qu. Median Mean 3rd Qu. Max. 105.9 109.9 112.0 112.1 113.8 122.2
#hist( angle.xyz(pdb$xyz[inds$xyz]), xlab="Angle" )

See also

torsion.pdb, torsion.xyz, read.pdb, read.dcd.

Author

Barry Grant