Learn R Programming

Rpdb (version 2.2)

translationHelpers: Helper Functions for Translation of Atomic Coordinates

Description

Translation of atomic coordinates along a specific Cartesian or lattice vector.

Usage

### Tranlastion of Cartesian coordinates: Tx(...) Ty(...) Tz(...)
"Tx"(obj, x = 0, mask = TRUE, thickness = NULL, cryst1 = NULL, ...) "Ty"(obj, y = 0, mask = TRUE, thickness = NULL, cryst1 = NULL, ...) "Tz"(obj, z = 0, mask = TRUE, thickness = NULL, cryst1 = NULL, ...)
"Tx"(obj, x = 0, mask = TRUE, thickness = NULL, cryst1 = obj$cryst1, ...) "Ty"(obj, y = 0, mask = TRUE, thickness = NULL, cryst1 = obj$cryst1, ...) "Tz"(obj, z = 0, mask = TRUE, thickness = NULL, cryst1 = obj$cryst1, ...)
### Tranlastion of fractional coordinates: Ta(...) Tb(...) Tc(...)
"Ta"(obj, a = 0, mask = TRUE, cryst1 = NULL, ...) "Tb"(obj, b = 0, mask = TRUE, cryst1 = NULL, ...) "Tc"(obj, c = 0, mask = TRUE, cryst1 = NULL, ...)
"Ta"(obj, a = 0, mask = TRUE, cryst1 = obj$cryst1, ...) "Tb"(obj, b = 0, mask = TRUE, cryst1 = obj$cryst1, ...) "Tc"(obj, c = 0, mask = TRUE, cryst1 = obj$cryst1, ...)

Arguments

obj
an R object containing atomic coordinates.
x
the x-component of the translation vector.
y
the y-component of the translation vector.
z
the z-component of the translation vector.
a
the a-component of the translation vector.
b
the b-component of the translation vector.
c
the c-component of the translation vector.
mask
a logical vector indicating the set of coordinates to which to apply the translation.
thickness
a numeric value indicating the fraction of the thicknees of the selected atom to be added to the translation vector (Usually 0, 0.5 or 1. See details).
cryst1
an object of class ‘cryst1’ use to convert Cartesian into fraction coordinates (or Vis Versa) when need.
...
further arguments passed to or from other methods.

Value

x with translated coordinates.

Details

These functions are helper functions to perform a translation along a specific Cartesian or lattice vector. All of them call either the Txyz or Tabc function.

See Also

Txyz, Tabc Passing from Cartesian to fractional coordinates (or Vis Versa): xyz2abc, abc2xyz

Examples

Run this code
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb"))
visualize(x, mode = NULL)
visualize(Ty(x, 10), mode = NULL)
visualize(Ty(x, 10, mask=x$atoms$resid==1), mode = NULL)
visualize(Tb(x, 1 ), mode = NULL)
visualize(Tb(x, 1 , mask=x$atoms$resid==1), mode = NULL)

# Lets build a C70/Pentacene dimer with an inter-molecular distance equal to 3.5
C70 <- read.pdb(system.file("examples/C70.pdb",package="Rpdb"))
Pen <- read.pdb(system.file("examples/Pentacene.pdb",package="Rpdb"))
x <- merge(C70,Pen)
visualize(x, mode = NULL)
viewXY()
visualize(Tz(x, z=3.5, mask=x$atoms$resname=="C70", thickness=0.5), mode = NULL)
viewXY()

Run the code above in your browser using DataLab