Learn R Programming

Rpdb (version 2.3.4)

replicate: Replicate Atomic Coordinates

Description

Replicate atomic coordinates using periodic boundary conditions.

Usage

replicate(x, ...)

# S3 method for coords replicate(x, cryst1 = NULL, a.ind = 0, b.ind = 0, c.ind = 0, ...)

# S3 method for atoms replicate(x, cryst1 = NULL, a.ind = 0, b.ind = 0, c.ind = 0, ...)

# S3 method for pdb replicate(x, a.ind = 0, b.ind = 0, c.ind = 0, cryst1 = NULL, ...)

Value

Return an object of class ‘pdb’ with replicated atomic coordinates.

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).

See Also

coords, atoms, pdb, cryst1

Examples

Run this code
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)

Run the code above in your browser using DataLab