| xyz2abc | R Documentation |
Converts Cartesian coordinates into fractional coordinates and vice versa.
xyz2abc(...)
## S3 method for class 'coords'
xyz2abc(x, crystal, ...)
## S3 method for class 'atoms'
xyz2abc(x, crystal, ...)
## S3 method for class 'pdb'
xyz2abc(x, crystal = x$crystal, ...)
## S3 method for class 'distances'
xyz2abc(x, crystal, ...)
abc2xyz(...)
## S3 method for class 'coords'
abc2xyz(x, crystal, ...)
## S3 method for class 'atoms'
abc2xyz(x, crystal, ...)
## S3 method for class 'pdb'
abc2xyz(x, crystal = x$crystal, ...)
## S3 method for class 'distances'
abc2xyz(x, crystal, ...)
... |
arguments passed to methods. |
x |
an R object containing atomic coordinates. |
crystal |
an object of class |
For atoms and pdb objects, the atomic coordinates
are first extracted from x using the coords function.
Then, the aforementioned functions convert the coordinates
using the periodic boundary conditions stored into the crystal field,
as follows:
The xyz2abc function converts the coordinates from Cartesian to fractional, while
abc2xyz function from fractional to Cartesian coordinates.
Finally, for atoms and pdb objects,
the new atomic coordinates are reassigned to the original x object
using the coords<- function, returning this new x.
Return an object of the same class as x, with atomic
coordinates expressed in a different basis set.
basis, coords, atoms,
pdb, crystal
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb", package="Rpdb"))
basis(x)
x <- xyz2abc(x)
basis(x)
x <- abc2xyz(x)
basis(x)
# This example returns an error because the coordinates stored
# into the PDB file are already Cartesian coordinates.
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb", package="Rpdb"))
try(x <- abc2xyz(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.