Learn R Programming

bio3d (version 2.1-2)

angle.xyz: Calculate the Angle Between Three Atoms

Description

A function for basic bond angle determination.

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).

Value

  • Returns a numeric vector of angles.

References

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

See Also

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

Examples

Run this code
## Read a PDB file
pdb <- read.pdb( "http://www.rcsb.org/pdb/files/1BG2.pdb" )

## Angle between N-CA-C atoms of residue four
inds <- atom.select(pdb,"///4///N,CA,C/")
angle.xyz(pdb$xyz[inds$xyz])

## Basic stats of all N-CA-C bound angles
inds <- atom.select(pdb,"//////N,CA,C/")
summary( angle.xyz(pdb$xyz[inds$xyz]) )
#hist( angle.xyz(pdb$xyz[inds$xyz]), xlab="Angle" )

Run the code above in your browser using DataLab