Learn R Programming

bio3d (version 2.1-2)

plot.pca: Plot PCA Results

Description

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

Usage

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

Arguments

x
the results of principal component analysis obtained with pca.xyz.
pch
a vector of plotting characters or symbols: see points.
col
a character vector of plotting colors.
cex
a numerical single element vector giving the amount by which plotting text and symbols should be magnified relative to the default.
mar
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.
inds
row indices of the conformers to label.
lab
a character vector of plot labels.
y
the y coordinates for the scree plot.
type
one-character string giving the type of plot desired.
main
a main title for the plot, see also 'title'.
sub
a sub-title for the plot.
xlim
the x limits of the plot.
ylim
the y limits of the plot.
ylab
a label for the y axis.
xlab
a label for the x axis.
axes
a logical value indicating whether both axes should be drawn.
ann
a logical value indicating whether the default annotation (title and x and y axis labels) should appear on the plot.
...
extra plotting arguments.

Value

  • Called for its effect.

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.

References

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

See Also

pca.xyz, plot.bio3d

Examples

Run this code
data(transducin)
attach(transducin, warn.conflicts=FALSE)

pc.xray <- pca.xyz(pdbs$xyz[, gap.inspect(pdbs$xyz)$f.inds])
plot(pc.xray)

## color by nucleotide state
vcolors <- annotation[, "color"]
plot(pc.xray, col=vcolors)

## add labels
#labs <- rownames(annotation)
#inds <- c(2,7)
#plot.pca.score(pc.xray, inds=inds, col=vcolors, lab=labs)

## color by seq identity
#ide <- seqidentity(pdbs$ali)
#hc <- hclust(as.dist(1-ide))
#grps <- cutree(hc, h=0.2)
#vcolors <- rainbow(max(grps))[grps]
#plot(pc.xray, inds=inds, col=vcolors, lab=labs)

detach(transducin)

Run the code above in your browser using DataLab