PCA_biplot: Principal Component Analysis with PCAtools package

View source: R/fct_04_pca.R

PCA_biplotR Documentation

Principal Component Analysis with PCAtools package

Description

Draw a PCA plot using PCAtools package

Usage

PCA_biplot(
  data,
  sample_info,
  select_gene_id = "symbol",
  all_gene_names,
  selected_x = "PC1",
  selected_y = "PC2",
  encircle = TRUE,
  encircleFill = TRUE,
  showLoadings = TRUE,
  pointlabs = TRUE,
  point_size = 4,
  ui_color = NULL,
  ui_shape = NULL
)

Arguments

data

Matrix of gene data that has been through pre_process()

sample_info

Matrix of sample information from experiment design file

select_gene_id

String indicating which gene id to use, default is "symbol"

all_gene_names

Dataframe of gene names from get_all_gene_names

selected_x

String indicating x axis selection, eg "PC1"

selected_y

String indicating y axis selection, eg "PC2"

encircle

TRUE/FALSE to draw shapes in plot, default is true

encircleFill

TRUE/FALSE to fill shapes in plot, default is TRUE

showLoadings

TRUE/FALSE to draw gene vectors onto plot, default is TRUE

pointlabs

TRUE/FALSE to show column names on points, default is TRUE

point_size

Positive number value to control point size

ui_color

String designating factor to color points by. Should be one of the design factors from the design file

ui_shape

String designating factor to shape points by. Should be one of the design factors from the design file

Value

A ggplot object formatted as a PCA plot using PCAtools package

See Also

pca() and biplot() for the original functions from the PCAtools package

Other PCA functions: MDS_plot(), PCA_Scree(), PCA_plot(), PCA_plot_3d(), PCAtools_eigencorplot(), pc_factor_correlation(), t_SNE_plot()


espors/idepGolem documentation built on April 23, 2024, 1:11 p.m.