Skip to contents

Generates PCA plots for both feature space and sample space, including scatter plots and scree plots.

Usage

plot_pca(
  expomicset,
  feature_col = "#00a9b2",
  sample_col = "#8a4f77",
  sample_outlier_col = "firebrick"
)

Arguments

expomicset

A MultiAssayExperiment object containing PCA results in metadata(expomicset)$pca.

feature_col

A character string specifying the color for the feature scree plot. Default is "#00a9b2".

sample_col

A character string specifying the color for the sample scree plot. Default is "#8a4f77".

sample_outlier_col

A character string specifying the color for sample outlier labels. Default is "firebrick".

Value

A combined ggplot object containing the four PCA plots.

Details

This function creates four PCA visualizations:

  • Feature Space PCA Plot: Colored by category (e.g., omics, exposure).

  • Feature Scree Plot: Displays the variance explained by each principal component.

  • Sample Space PCA Plot: Highlights outlier samples.

  • Sample Scree Plot: Displays variance explained in the sample PCA.

Outliers are labeled based on metadata(expomicset)$pca$outliers.

Examples

if (FALSE) { # \dontrun{
plot_pca(expom)
} # }