plotPCA: Sample PCA plot from variance-stabilized data

Description Usage Arguments Value Note Author(s) Examples

View source: R/plots.R

Description

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

Usage

1
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.

Note

See the vignette for an example of variance stabilization and PCA plots. Note that the source code of plotPCA is very simple and commented. Users should find it easy to customize this function.

Author(s)

Wolfgang Huber

Examples

1
2
3
dds <- makeExampleDESeqDataSet(betaSD=1)
rld <- rlog(dds)
plotPCA(rld)

aghozlane/DESeq2shaman documentation built on Nov. 1, 2019, 9:01 p.m.