Principal component analysis plot

plotPCA(object, ...)

# S4 method for SummarizedExperiment
plotPCA(
object,
assay = 1L,
interestingGroups = NULL,
ntop = 500L,
label = getOption(x = "acid.label", default = FALSE),
color = getOption(x = "acid.color.discrete", default = getOption(x =
"ggplot2.discrete.colour", default = AcidPlots::scale_color_synesthesia_d())),
pointSize = getOption(x = "acid.point.size", default = 3L),
labels = list(title = "PCA", subtitle = NULL)
)

## Arguments

object Object. vector(1). Assay name or index position. character. Groups of interest to use for visualization. Corresponds to factors describing the columns of the object. integer(1) or Inf. Number of most variable genes to plot. Use Inf to include all genes (not recommended). logical(1). Superimpose sample text labels on the plot. ScaleDiscrete. Desired ggplot2 color scale. Must supply discrete values. When set NULL, the default ggplot2 color palette will be used. If manual color definitions are desired, we recommend using ggplot2::scale_color_manual(). To set the discrete color palette globally, use:options(acid.color.discrete = ggplot2::scale_color_viridis_d())  numeric(1). Point size for dots in the plot. In the range of 1-3 is generally recommended. list. ggplot2 labels. See ggplot2::labs() for details. Additional arguments.

## Value

ggplot or DataFrame.

## Note

SingleCellExperiment method that visualizes dimension reduction data slotted in reducedDims() is defined in pointillism package.

Updated 2020-08-25.

## Principal component analysis

PCA (Jolliffe, et al., 2002) is a multivariate technique that allows us to summarize the systematic patterns of variations in the data. PCA takes the expression levels for genes and transforms it in principal component space, reducing each sample into one point. Thereby, we can separate samples by expression variation, and identify potential sample outliers. The PCA plot is a way to look at how samples are clustering.

## References

Jolliffe, et al., 2002.

DESeq2::plotPCA().

We're using a modified version of the DESeqTransform method here.

methodFunction(
f = "plotPCA",
signature = "DESeqTransform",
package = "DESeq2"
)


## Examples

data(RangedSummarizedExperiment, package = "AcidTest")

## SummarizedExperiment ====
object <- RangedSummarizedExperiment
plotPCA(object)