Produces a z-score plot (conformer plot) and an eigen spectrum plot (scree plot).

# S3 method for pca
plot(x, pc.axes=NULL, pch=16, col=par("col"), cex=0.8, mar=c(4, 4, 1, 1),...)

# S3 method for pca.scree
plot(x, y = NULL, type = "o", pch = 18,
main = "", sub = "", xlim = c(0, 20), ylim = NULL,
ylab = "Proportion of Variance (%)",
xlab = "Eigenvalue Rank", axes = TRUE, ann = par("ann"),
col = par("col"), lab = TRUE, ...)
# S3 method for pca.score
plot(x, inds=NULL, col=rainbow(nrow(x)), lab = "", ...)

## Arguments

x the results of principal component analysis obtained with pca.xyz. an optional numeric vector of length two specifying the principal components to be plotted. A NULL value will result in an overview plot of the first three PCs and a scree plot. See examples. a vector of plotting characters or symbols: see ‘points’. a character vector of plotting colors. a numerical single element vector giving the amount by which plotting text and symbols should be magnified relative to the default. A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot. row indices of the conformers to label. a character vector of plot labels. the y coordinates for the scree plot. one-character string giving the type of plot desired. a main title for the plot, see also 'title'. a sub-title for the plot. the x limits of the plot. the y limits of the plot. a label for the y axis. a label for the x axis. a logical value indicating whether both axes should be drawn. a logical value indicating whether the default annotation (title and x and y axis labels) should appear on the plot. extra plotting arguments.

## Details

plot.pca is a wrapper calling both plot.pca.score and plot.pca.scree resulting in a 2x2 plot with three score plots and one scree plot.

## Value

Produces a plot of PCA results in the active graphics device and invisibly returns the plotted ‘z’ coordinates along the requested ‘pc.axes’. See examples section where these coordinates are used to identify plotted points.

## References

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

## Author

Barry Grant

pca.xyz, plot.bio3d

## Examples

attach(transducin)

pc.xray <- pca(pdbs$xyz, rm.gaps=TRUE) #> NOTE: Removing 49 gap positions with missing coordinate data #> retaining 305 non-gap positions for analysis.plot(pc.xray) ## Color plot by nucleotide state vcolors <- annotation[, "color"] plot(pc.xray, col=vcolors) ## Focus on a single plot of PC1 vs PC2 x <- plot(pc.xray, pc.axes=1:2, col=vcolors) ## Identify points interactively with mouse clicks #identify(x, labels=basename.pdb(pdbs$id))

## Add labels to select points
inds <- c(1,10,37)
text(x[inds,], labels=basename.pdb(pdbs$id[inds]), col="blue") ## Alternative labeling method #labs <- rownames(annotation) #inds <- c(2,7) #plot.pca.score(pc.xray, inds=inds, col=vcolors, lab=labs) ## color by seq identity groupings #ide <- seqidentity(pdbs$ali)
#hc <- hclust(as.dist(1-ide))
#grps <- cutree(hc, h=0.2)
#vcolors <- rainbow(max(grps))[grps]
#plot.pca.score(pc.xray, inds=inds, col=vcolors, lab=labs)

detach(transducin)