Learn R Programming

Rpdb (version 2.0)

coords.pdb: The Coordinates of an Object of Class pdb

Description

Get or set the coordinates of an object of class pdb.

Usage

## S3 method for class 'pdb':
coords(x, \dots)

## S3 method for class 'pdb': coords(x) <- value

Arguments

x
an object of class pdb.
...
further arguments passed to or from other methods.
value
an object of class coords

Value

  • The getter function returns a data.frame of class coords whose columns contain the atomic coordinates of the atoms of a molecular system. The coordinates can either be Cartesian or fractional coordinates depending on the 'basis' attribute of x.

    The setter function return a pdb object with updated coordinates.

Details

The coords function uses the atoms component of a pdb object to create an object of class coords. The coords<- function sets the atomic coordinates of the atoms component of a pdb object. (See coords.atoms)

See Also

basis, coords, atoms, coords.atoms

Examples

Run this code
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb"))
n <- natom(x)
coords(x) <- coords(rnorm(n), rnorm(n), rnorm(n))
print(x)
class(x)
x <- coords(x)
print(x)
class(x)

Run the code above in your browser using DataLab