Last chance! 50% off unlimited learning
Sale ends in
Converts Cartesian coordinates into fractional coordinates and vice versa.
xyz2abc(...)# S3 method for coords
xyz2abc(x, cryst1, ...)
# S3 method for atoms
xyz2abc(x, cryst1, ...)
# S3 method for pdb
xyz2abc(x, cryst1 = x$cryst1, ...)
# S3 method for distances
xyz2abc(x, cryst1, ...)
abc2xyz(...)
# S3 method for coords
abc2xyz(x, cryst1, ...)
# S3 method for atoms
abc2xyz(x, cryst1, ...)
# S3 method for pdb
abc2xyz(x, cryst1 = x$cryst1, ...)
# S3 method for distances
abc2xyz(x, cryst1, ...)
Return an object of the same class as x
, with atomic
coordinates expressed in a different basis set.
arguments passed to methods.
an R object containing atomic coordinates.
an object of class cryst1
.
For atoms
and pdb
objects, the atomic coordinates
are first extracted from x
using the coords
function.
Then, using the periodic boundary conditions stored into cryst1
, the
coordinates are converted from Cartesian to fractional (for the
xyz2abc
functions) or from fractional to Cartesian (for the
abc2xyz
functions) coordinates. Finally, for atoms
and
pdb
objects, the new atomic coordinates are reassigned to the
original x
object using the coords<-
function and
x
is returned.
basis
, coords
, atoms
,
pdb
, cryst1
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb", package="Rpdb"))
basis(x)
x <- xyz2abc(x)
basis(x)
x <- abc2xyz(x)
basis(x)
# \donttest{
# 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))
# }
Run the code above in your browser using DataLab