quickPCA | R Documentation |
Just an abbreviated wrapper for prcomp() and fviz_pca_ind because I get tired of all the lines of code. Cleans up scripts with many PCA plots.
quickPCA(
x,
meta = NULL,
sample = "sample",
scale = FALSE,
colorBy = NULL,
samp.labels = FALSE,
plot.title = NULL
)
x |
Your expression matrix with samples in columns and measurements (genes/proteins/etc.) in rows. |
meta |
Metadata object, ideally with column labeled "sample" that matches the names of the columns in your expression matrix. all(colnames(x) == meta[,sample]) must return TRUE |
sample |
Name of metadata column with sample names. Default is "sample" specify if yours is different (i.e. "Sample", "samp." or some other foolish name) |
scale |
(Logical) Whether or not prcomp should scale the data prior to running PCA. Leave FALSE if data is already scaled/log transformed. Set to TRUE for raw data values |
colorBy |
(Optional) Name of the column to color dots by. (i.e. "treatment", "batch", "sex") |
samp.labels |
(Logical) Should individual points be |
plot.title |
(Optional) Title for your PCA plot. |
PCA plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.