| plotPCA {DESeq2} | R Documentation |
This plot helps to check for batch effects and the like.
plotPCA(x, intgroup = "condition", ntop = 500, col)
x |
a SummarizedExperiment, with data in
|
intgroup |
a character vector of names in
|
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 |
A trellis object.
See the vignette for an example of variance stabilization and PCA plots.
Wolfgang Huber
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)