plotAssayPCA | R Documentation |
Plot PCA for any assay within a SummarizedExperiment object
plotAssayPCA(x, ...)
## S4 method for signature 'SummarizedExperiment'
plotAssayPCA(
x,
assay = "counts",
colour,
shape,
size,
label,
show_points = TRUE,
pc_x = 1,
pc_y = 2,
trans = NULL,
n_max = Inf,
tol = sqrt(.Machine$double.eps),
rank = NULL,
...
)
x |
An object containing an assay slot |
... |
Passed to geom_text |
assay |
The assay to perform PCA on |
colour |
The column name to be used for colours |
shape , size |
The column name(s) to be used for determining the shape or size of points |
label |
The column name to be used for labels |
show_points |
logical(1). Display the points. If |
pc_x |
numeric(1) The PC to plot on the x-axis |
pc_y |
numeric(1) The PC to plot on the y-axis |
trans |
character(1). Any transformative function to be applied to the
data before performing the PCA, e.g. |
n_max |
Subsample the data to this many points before performing PCA |
tol |
Any rows with variance below this value will be excluded prior to passing to prcomp. All rows are scaled and centred by default |
rank |
Passed to prcomp |
Uses ggplot2 to create a PCA plot for the selected assay. Any numerical
transformation prior to performing the PCA can be specified using the
trans
argument
A ggplot2 object
data("se")
se$treatment <- c("E2", "E2", "E2", "E2DHT", "E2DHT", "E2DHT")
se$sample <- colnames(se)
plotAssayPCA(se, trans = "log1p", colour = "treatment", label = "sample")
plotAssayPCA(
se, trans = "log1p", colour = "treatment", label = "sample",
size = totals / 1e3
)
plotAssayPCA(
se, trans = "log1p", colour = "treatment", label = "sample",
show_points = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.