Learn R Programming

bio3d (version 2.1-2)

mktrj.pca: PCA Atomic Displacement Trajectory

Description

Make a trajectory of atomic displacments along a given principal component.

Usage

## S3 method for class 'pca':
mktrj(x = NULL, pc = 1, mag = 1, step = 0.125, file = NULL,  ...)

Arguments

x
a list object of class "pca" (obtained with pca.xyz).
pc
the PC number along which displacements should be made.
mag
a magnification factor for scaling the displacements.
step
the step size by which to increment along the pc.
file
a character vector giving the output PDB file name.
...
extra arguments to be passed to the function write.pdb.

Value

  • Returns a numeric matrix of interpolated coordinates with a row per structure.

Details

Trajectory frames are built from reconstructed Cartesian coordinates produced by interpolating from the mean structure along a given pc, in increments of step.

An optional magnification factor can be used to amplify displacements. This involves scaling by mag-times the standard deviation of the conformer distribution along the given pc (i.e. the square root of the associated eigenvalue).

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.

See Also

pca.xyz, view.modes.

Examples

Run this code
data(transducin)
attach(transducin, warn.conflicts=FALSE)

# Ignore gap containing positions
gaps.res <- gap.inspect(pdbs$ali)
gaps.pos <- gap.inspect(pdbs$xyz)

# PCA
pc.xray <- pca.xyz(pdbs$xyz[, gaps.pos$f.inds])

# Write PC trajectory
path = tempdir()
a <- mktrj(pc.xray, pc=1, file=file.path(path, "pc1.pdb"),
           resno = pdbs$resno[1, gaps.res$f.inds],
           resid = aa123(pdbs$ali[1, gaps.res$f.inds]) )

b <- mktrj(pc.xray, pc=2, file=file.path(path, "pc2.pdb"),
           resno = pdbs$resno[1, gaps.res$f.inds],
           resid = aa123(pdbs$ali[1, gaps.res$f.inds]) )

c <- mktrj(pc.xray, pc=3, file=file.path(path, "pc3.pdb"),
           resno = pdbs$resno[1, gaps.res$f.inds],
           resid = aa123(pdbs$ali[1, gaps.res$f.inds]) )

# Output files
file.path(path, paste("pc", 1:3, ".pdb", sep=""))

detach(transducin)

Run the code above in your browser using DataLab