project.pca | R Documentation |
Projects data onto principal components.
project.pca(data, pca, angular = FALSE, fit = FALSE, ...)
z2xyz.pca(z.coord, pca)
xyz2z.pca(xyz.coord, pca)
data |
a numeric vector or row-wise matrix of data to be projected. |
pca |
an object of class |
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 |
... |
other parameters for |
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. |
A numeric vector or matrix of projected PC scores.
Karim ElSawy and Barry Grant
Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.
pca.xyz
, pca.tor
, fit.xyz
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.