Learn R Programming

bio3d (version 2.1-2)

pca.tor: Principal Component Analysis

Description

Performs principal components analysis (PCA) on torsion angle data.

Usage

## S3 method for class 'tor':
pca(data, \dots)

Arguments

data
numeric matrix of torsion angles with a row per structure.
...
additional arguments passed to the method pca.xyz.

Value

  • Returns a list with the following components:
  • Leigenvalues.
  • Ueigenvectors (i.e. the variable loadings).
  • z.uscores of the supplied data on the pcs.
  • sdevthe standard deviations of the pcs.
  • meanthe means that were subtracted.

References

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

See Also

torsion.xyz, plot.pca, plot.pca.loadings, pca.xyz

Examples

Run this code
##-- PCA on torsion data for multiple PDBs 
data(kinesin)
attach(kinesin, warn.conflicts=FALSE)

gaps.pos <- gap.inspect(pdbs$xyz)
tor <- t(apply( pdbs$xyz[, gaps.pos$f.inds], 1, torsion.xyz, atm.inc=1))
pc.tor <- pca.tor(tor[,-c(1,218,219,220)])
#plot(pc.tor)
plot.pca.loadings(pc.tor)

detach(kinesin)

##-- PCA on torsion data from an MD trajectory
trj <- read.dcd( system.file("examples/hivp.dcd", package="bio3d") )
tor <- t(apply(trj, 1, torsion.xyz, atm.inc=1))
gaps <- gap.inspect(tor)
pc.tor <- pca.tor(tor[,gaps$f.inds])
plot.pca.loadings(pc.tor)

Run the code above in your browser using DataLab