pca.project {bio3d}R Documentation

Project Data onto Principal Components

Description

Projects data onto principal components.

Usage

pca.project(data, pca, angular = FALSE)
pca.z2xyz(z.coord, pca)
pca.xyz2z(xyz.coord, pca)

Arguments

data a numeric vector or row-wise matrix of data to be projected.
pca an object of class "pca" as obtained from functions pca.xyz or pca.tor.
angular logical, if TRUE the data to be projected is treated as torsion angle data.
xyz.coord a numeric vector or row-wise matrix of data to be projected.
z.coord a numeric vector or row-wise matrix of PC scores (i.e. the z-scores which are centered and rotated versions of the origional data projected onto the PCs) for conversion to xyz coordinates.

Value

A numeric vector or matrix of projected PC scores.

Author(s)

Karim ElSawy and Barry Grant

References

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

See Also

pca.xyz, pca.tor

Examples

## Not run: 
data(kinesin)
gaps.pos <- gap.inspect(pdbs$xyz)

#-- Do PCA without structures 1 and 2
pc.xray <- pca.xyz(xyz[-c(1:2), gaps.pos$f.inds])
d <- pca.project(xyz[1:2, gaps.pos$f.inds], pc.xray)

plot(pc.xray$z[,1], pc.xray$z[,2],col="gray")
points(d[,1],d[,2], col="red")
## End(Not run)

[Package bio3d version 1.0-5 Index]