Learn R Programming

DESeq2 (version 1.6.3)

plotPCA: 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, returnData = FALSE)

Arguments

x
a SummarizedExperiment, with data in assay(x), produced for example by either varianceStabilizingTransformation or rlogTransformation
intgroup
interesting groups: 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
returnData
should the function only return the data.frame of PC1 and PC2 with intgroup covariates for custom plotting (default is FALSE)

Value

An object created by ggplot, which can be assigned and further customized.

Examples

Run this code
dds <- makeExampleDESeqDataSet(betaSD=1)
rld <- rlog(dds)
plotPCA(rld)

Run the code above in your browser using DataLab