rotationHelpers: Helper Functions for Rotation of Atomic Coordinates

Description Usage Arguments Details Value See Also Examples

Description

Rotation of atomic coordinates along a specific Cartesian vector.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Rx(...)

## S3 method for class 'coords'
Rx(x, angle = 0, mask = TRUE, cryst1 = NULL, ...)

## S3 method for class 'pdb'
Rx(x, angle = 0, mask = TRUE, cryst1 = x$cryst1, ...)

Ry(...)

## S3 method for class 'coords'
Ry(x, angle = 0, mask = TRUE, cryst1 = NULL, ...)

## S3 method for class 'pdb'
Ry(x, angle = 0, mask = TRUE, cryst1 = x$cryst1, ...)

Rz(...)

## S3 method for class 'coords'
Rz(x, angle = 0, mask = TRUE, cryst1 = NULL, ...)

## S3 method for class 'pdb'
Rz(x, angle = 0, mask = TRUE, cryst1 = x$cryst1, ...)

Arguments

x

an R object containing atomic coordinates.

angle

the angle of the rotation in degrees.

mask

a logical vector indicating the set of coordinates to which the rotation has to be applyed.

cryst1

an object of class ‘cryst1’ use to convert fractional into Cartesian coordinates when need.

...

further arguments passed to or from other methods.

Details

These functions are helper functions to perform a rotation around a specific Cartesian vector. All of them call the R function.

Value

An object of the same class as x with rotated coordinates.

See Also

R and xyz2abc, abc2xyz for passing from Cartesian to fractional coordinates (or Vis Versa).

Examples

1
2
3
4
5
6
7
8
# First lets read a pdb file
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb"))
cell <- cell.coords(x)
visualize(x, mode = NULL)
# Rotation of the structure around the z-axis
visualize(Rz(x, 90), mode = NULL)
# Rotation of the residue 1 around the c-axis
visualize(Rz(x, 90, mask=x$atoms$resid==1), mode = NULL)

Rpdb documentation built on May 2, 2019, 2:11 p.m.