plotPCA {DESeq2}R Documentation

Sample PCA plot from variance-stabilized data

Description

This plot helps to check for batch effects and the like.

Usage

plotPCA(x, intgroup = "condition", ntop = 500, col)

Arguments

x

a SummarizedExperiment, with data in assay(x), produced for example by either varianceStabilizingTransformation or rlogTransformation

intgroup

a character vector of names in colData(x) to use for grouping

ntop

number of top genes to use for principal components, selected by highest row variance

col

a vector of colors for each level of intgroup

Value

A trellis object.

Note

See the vignette for an example of variance stabilization and PCA plots.

Author(s)

Wolfgang Huber

Examples

dds = makeExampleDESeqDataSet(betaSD=1)
vsd = varianceStabilizingTransformation(dds)
p = plotPCA(vsd)
print(p)

## Add text labels (for presentation graphics, consider additional
## layout operations that avoid overplotting, such as the FField package on CRAN)
names = colData(vsd)$sample

p = update(p, panel = function(x, y, ...) {
      lattice::panel.xyplot(x, y, ...);
      lattice::ltext(x=x, y=y, labels=names, pos=1, offset=1, cex=0.8)
    })
print(p)

[Package DESeq2 version 1.4.5 Index]