replicate {Rpdb} | R Documentation |
Replicate Atomic Coordinates
Description
Replicate atomic coordinates using periodic boundary conditions.
Usage
replicate(x, ...)
## S3 method for class 'coords'
replicate(x, cryst1 = NULL, a.ind = 0, b.ind = 0, c.ind = 0, ...)
## S3 method for class 'atoms'
replicate(x, cryst1 = NULL, a.ind = 0, b.ind = 0, c.ind = 0, ...)
## S3 method for class 'pdb'
replicate(x, a.ind = 0, b.ind = 0, c.ind = 0, cryst1 = NULL, ...)
Arguments
x |
an R object containing atomic coordinates to be replicated. |
... |
further arguments passed to or from other methods. |
cryst1 |
an object of class ‘cryst1’ containing periodical boundary conditions used for replicating. |
a.ind |
a vector of integers indicating the positions of the replicated cells along the a-axis. |
b.ind |
a vector of integers indicating the positions of the replicated cells along the b-axis. |
c.ind |
a vector of integers indicating the positions of the replicated cells along the c-axis. |
Details
The replicate
function replicate a unit cell along the lattice vectors a, b and c
as as many times as indicated by the a.ind
, b.ind
and c.ind
arguments.
Discontinuous integer vectors can be used for a.ind
, b.ind
and c.ind
to create layered supercells (See examples).
Value
Return an object of class ‘pdb’ with replicated atomic coordinates.
See Also
Examples
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb", package="Rpdb"))
# Create a 3x3 supercell
y <- replicate(x, a.ind = 0:2, b.ind = 0:2, c.ind = 0:2)
# Create a 3x3 supercell which might need to be wrapped (if some molecules are outside the cell)
y <- replicate(x, a.ind = -1:1, b.ind = -1:1, c.ind = -1:1)
# Create a layered supercell with a vacuum layer in the bc-plan
y <- replicate(x, a.ind = c(0,2), b.ind = 0:2, c.ind = 0:2)