Learn R Programming

Rpdb (version 2.1)

bond-angle-dihedral: Atomic Bond Lengths, Angles and Dihedrals

Description

Compute bond lengths, angles and dihedral from atomic coordinates.

Usage

bond(...)
## S3 method for class 'coords':
bond(x, sel1, sel2, ...)
## S3 method for class 'pdb':
bond(x, sel1, sel2, ...)

angle(...) ## S3 method for class 'coords': angle(x, sel1, sel2, sel3, ...) ## S3 method for class 'pdb': angle(x, sel1, sel2, sel3, ...)

dihedral(...) ## S3 method for class 'coords': dihedral(x, sel1, sel2, sel3, sel4, ...) ## S3 method for class 'pdb': dihedral(x, sel1, sel2, sel3, sel4, ...)

measure(...) ## S3 method for class 'default': measure(id = rgl.ids(), verbose = TRUE, ...) ## S3 method for class 'coords': measure(x, id = rgl.ids(), verbose = TRUE, ...) ## S3 method for class 'pdb': measure(x, id = rgl.ids(), verbose = TRUE, ...)

Arguments

x
an R object containing atomic coordinates.
sel1, sel2, sel3, sel4
an integer or logical vector used to select atoms defining bonds, angles or dihedrals. See details.
id
vector of ID numbers of rgl items, as returned by rgl.ids. The vertexes of these items are used to compute the bond lengths, angles or dihedrals.
verbose
a logical value specifying if the information have to be printed to the terminal.
...
further arguments passed to or from other methods.

Value

  • A numeric vector containing atomic bond lengths (in Angstrom), angles or dihedrals (in degrees)

Details

The number of selected atoms with sel1, sel2, sel3 and sel4 must be the same. sel1, sel2, sel3 and sel4 respectively select the first, second, third and fouth atoms defining bonds, angles or dihedrals. measure activate an interactive mode to compute bond lengths, angles and dihedrals by selecting atoms by right-clicing on the current rgl scene. To escape the active mode press the ESC key.

See Also

coords, pdb, info3d, visualize

Examples

Run this code
Pen <- read.pdb(system.file("examples/Pentacene.pdb",package="Rpdb"))
visualize(Pen, mode = NULL)
text3d(coords(Pen), texts=Pen$atoms$eleid)
bond(Pen,3:4,1:2)
angle(Pen,3:4,1:2,5:6)
dihedral(Pen,3:4,1:2,5:6,6:5)

Run the code above in your browser using DataLab