pca.tor {bio3d} | R Documentation |
Performs principal components analysis (PCA) on torsion angle data
.
pca.tor(data, subset = rep(TRUE, nrow(as.matrix(data))))
data |
numeric matrix of torsion angles with a row per structure. |
subset |
an optional vector of numeric indices that selects a
subset of rows (e.g. experimental structures vs molecular dynamics
trajectory structures) from the full data matrix. Note: the
full data is projected onto this subspace. |
Returns a list with the following components:
L |
eigenvalues. |
U |
eigenvectors (i.e. the variable loadings). |
z.u |
scores of the supplied data on the pcs. |
sdev |
the standard deviations of the pcs. |
mean |
the means that were subtracted. |
Barry Grant and Karim ElSawy
Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.
torsion.xyz
, plot.pca
,
plot.pca.loadings
, pca.xyz
##-- PCA on torsion data for multiple PDBs data(kinesin) attach(kinesin) gaps <- gap.inspect(pdbs) tgap.xyz <- atom2xyz(gaps$t.inds) fgap.xyz <- atom2xyz(gaps$f.inds) tor <- t(apply( pdbs$xyz[,fgap.xyz], 1, torsion.xyz, atm.inc=1)) pc.tor <- pca.tor(tor[,-c(1,219,220)]) #plot(pc.tor) plot.pca.loadings(pc.tor) ## Not run: ##-- 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) ## End(Not run)