plot_PCA {BioNERO}R Documentation

Plot Principal Component Analysis (PCA) of samples

Description

Plot Principal Component Analysis (PCA) of samples

Usage

plot_PCA(exp, metadata, log_trans = FALSE, PCs = "1x2", size = 2)

Arguments

exp

A gene expression data frame with genes in row names and samples in column names or a 'SummarizedExperiment' object.

metadata

A data frame containing sample names in row names and sample annotation in the first column. Ignored if 'exp' is a 'SummarizedExperiment' object, since the function will extract colData.

log_trans

Logical. If TRUE, the expression data frame will be log transformed with log2(exp+1).

PCs

Principal components to be plotted on the x-axis and y-axis, respectively. One of "1x2", "1x3" or "2x3. Default is "1x2".

size

Numeric indicating the point size. Default is 2.

Value

A ggplot object with the PCA plot.

Author(s)

Fabricio Almeida-Silva

See Also

ggplot

Examples

data(zma.se)
plot_PCA(zma.se, log_trans = TRUE)

[Package BioNERO version 1.0.4 Index]