project.pca {bio3d}R Documentation

Project Data onto Principal Components

Description

Projects 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.

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, fit.xyz

Examples

## Not run: 
attach(transducin)

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)

## End(Not run)

[Package bio3d version 2.4-4 Index]