plotExpressionPCA-methods: Create a PCA plot from a DGEList object

Description Usage Arguments Value Examples

Description

Plot the PCA results from a DGEList

Usage

1
2
3
4
5
6
7
plotExpressionPCA(object, ...)

## S4 method for signature 'DGEList'
plotExpressionPCA(object, ..., .center = TRUE, .scale = FALSE)

## S4 method for signature 'SummarizedExperiment'
plotExpressionPCA(object, i = NULL, ..., .center = TRUE, .scale = FALSE)

Arguments

object

An object containing expression values (i.e. counts)

...

Used for passing parameters to autoplot.prcomp. These should be column names and can be passed to plotting aesthetics such as colour, shape and size.

.center

passed to prcomp

.scale

passed to prcomp

i

Identifies the assay to use in a SummarizedExperiment. Any assay other than counts will be used as provided, whilst the counts assay will be transformed into logCPM before performing the PCA.

Value

A ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(edgeR)
y <- matrix(rnbinom(10000,mu=5,size=2), ncol=4)
d <- DGEList(counts=y, group=rep(1:2, each=2))
plotExpressionPCA(d, colour = "group")

library(SummarizedExperiment)
nrows <- 200; ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
                     row.names=LETTERS[1:6])
se0 <- SummarizedExperiment(assays=SimpleList(counts=counts),
                            colData=colData)
plotExpressionPCA(se0, colour = "Treatment")

steveped/spBioUtils documentation built on Sept. 25, 2021, 7:22 p.m.