Project Data onto Principal Components

Usage

project.pca(data, pca, angular = FALSE, fit = FALSE, ...) z2xyz.pca(z.coord, pca) xyz2z.pca(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.
fit
logical, if TRUE the data is first fitted to pca$mean.
...
other parameters for fit.xyz.
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.

Description

Projects data onto principal components.

Value

A numeric vector or matrix of projected PC scores.

References

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

Examples

attach(transducin)
The following objects are masked from transducin (pos = 3): annotation, core, pdbs
gaps.pos <- gap.inspect(pdbs$xyz) #-- Do PCA without structures 2 and 7 pc.xray <- pca.xyz(pdbs$xyz[-c(2,7), gaps.pos$f.inds]) #-- Project structures 2 and 7 onto the PC space d <- project.pca(pdbs$xyz[c(2,7), gaps.pos$f.inds], pc.xray) plot(pc.xray$z[,1], pc.xray$z[,2],col="gray") points(d[,1],d[,2], col="red")

detach(transducin)

See also

pca.xyz, pca.tor, fit.xyz

Author

Karim ElSawy and Barry Grant