Learn R Programming

Rpdb (version 2.2)

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

Description

Compute bond lengths, angles and dihedral from atomic coordinates.

Usage

bond(...) "bond"(x, sel1, sel2, ...) "bond"(x, sel1, sel2, ...)
angle(...) "angle"(x, sel1, sel2, sel3, ...) "angle"(x, sel1, sel2, sel3, ...)
dihedral(...) "dihedral"(x, sel1, sel2, sel3, sel4, ...) "dihedral"(x, sel1, sel2, sel3, sel4, ...)
measure(...) "measure"(id = rgl.ids(), verbose = TRUE, ...) "measure"(x, id = rgl.ids(), verbose = TRUE, ...) "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

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