Learn R Programming

Rpdb (version 2.0)

cell.density: Density of a Unit Cell

Description

Compute the density of a unit cell.

Usage

cell.density(...)

## S3 method for class 'default': cell.density(masses, volume, ...)

## S3 method for class 'pdb': cell.density(x, ...)

Arguments

...
further arguments passed to or from other methods.
masses
a numeric vector containing atomic masses.
volume
a single element numeric vector containing the volume of the unit cell in Angstrom cube.
x
an object of class pdb containing a cryst1 componant.

Value

  • Return a single element numeric vector containing the density of the unit cell in g.cm-3.

Details

cell.density is a generic function to compute the density of a unit cell.

For objects of class pdb:

  • First the volume of the unit cell is calculated by calling thecell.volumefunction on thecryst1component of thepdbobject.
  • Then the element names are converted into element symbols using thetoSymbolsfunction and their masses are taken from theelementsdata set.
  • Finally the density is calculated using the sum of the atomic masses and the volume of the unit cell.

See Also

cryst1, pdb, cell.volume

Examples

Run this code
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb"))
cell.density(x)

Run the code above in your browser using DataLab