This plot helps to check for batch effects and the like.
interesting groups: a character vector of
number of top genes to use for principal components, selected by highest row variance
should the function only return the data.frame of PC1 and PC2 with intgroup covariates for custom plotting (default is FALSE)
An object created by
ggplot, which can be assigned and further customized.
See the vignette for an example of variance stabilization and PCA plots.
Note that the source code of
plotPCA is very simple.
The source can be found by typing
browsed on github at https://github.com/mikelove/DESeq2/blob/master/R/plots.R
Users should find it easy to customize this function.
1 2 3 4 5 6 7 8 9 10 11 12 13
# using rlog transformed data: dds <- makeExampleDESeqDataSet(betaSD=1) rld <- rlog(dds) plotPCA(rld) # also possible to perform custom transformation: dds <- estimateSizeFactors(dds) # shifted log of normalized counts se <- SummarizedExperiment(log2(counts(dds, normalized=TRUE) + 1), colData=colData(dds)) # the call to DESeqTransform() is needed to # trigger our plotPCA method. plotPCA( DESeqTransform( se ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.