plot_pca | R Documentation |
Plot PCA colored by variables of interest
plot_pca(
dat,
meta = NULL,
vars,
PCx = 1,
PCy = 2,
scale = FALSE,
outlier_sd = 3,
outlier_group = NULL,
transform_logCPM = FALSE,
libraryID = "libID"
)
dat |
Data frame, edgeR DGEList, or limma EList object containing gene counts in libraries |
meta |
Data frame containing meta data with vars. Only needed if dat is a counts table and not an edgeR or limma object |
vars |
Character vector of variables to color PCA by |
PCx |
Numeric value for PC to plot on x-axis. Default it 1 |
PCy |
Numeric value for PC to plot on y-axis. Default it 2 |
scale |
Logical if should scale variance in PCA calculation see stats::prcomp for details. Default is FALSE |
outlier_sd |
Numeric. If vars includes "outlier", statistical outliers are determined and colored based on this standard deviation along PC1 and PC2. |
outlier_group |
Character string in which to group sd calculations |
transform_logCPM |
Logical if should convert counts to log counts per million |
libraryID |
Character of variable name to match dat meta data frames |
List of ggplot objects
plot_pca(kimma::example.voom, var=c("virus","outlier"))
plot_pca(kimma::example.voom, var=c("virus","outlier"), PCx=1, PCy=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.