quickPCA: Quick PCA

View source: R/quickPCA.R

quickPCAR Documentation

Quick PCA

Description

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.

Usage

quickPCA(
  x,
  meta = NULL,
  sample = "sample",
  scale = FALSE,
  colorBy = NULL,
  samp.labels = FALSE,
  plot.title = NULL
)

Arguments

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.

Value

PCA plot


genejockey33000/typGumbo documentation built on July 20, 2023, 11:45 p.m.