pca: PCA, SMA, LDA, PLS, SPLS, OPLS

View source: R/5_pca.R

pcaR Documentation

PCA, SMA, LDA, PLS, SPLS, OPLS

Description

Perform a dimension reduction. Store sample scores, feature loadings, and dimension variances.

Usage

pca(
  object,
  by = "sample_id",
  assay = assayNames(object)[1],
  ndim = 2,
  sep = FITSEP,
  minvar = 0,
  center_samples = TRUE,
  verbose = TRUE,
  plot = FALSE,
  ...
)

pls(
  object,
  by = "subgroup",
  assay = assayNames(object)[1],
  ndim = 2,
  sep = FITSEP,
  minvar = 0,
  verbose = FALSE,
  plot = FALSE,
  ...
)

sma(
  object,
  by = "sample_id",
  assay = assayNames(object)[1],
  ndim = 2,
  sep = FITSEP,
  minvar = 0,
  verbose = TRUE,
  plot = FALSE,
  ...
)

lda(
  object,
  assay = assayNames(object)[1],
  by = "subgroup",
  ndim = 2,
  sep = FITSEP,
  minvar = 0,
  verbose = TRUE,
  plot = FALSE,
  ...
)

spls(
  object,
  assay = assayNames(object)[1],
  by = "subgroup",
  ndim = 2,
  sep = FITSEP,
  minvar = 0,
  plot = FALSE,
  ...
)

opls(
  object,
  by = "subgroup",
  assay = assayNames(object)[1],
  ndim = 2,
  sep = FITSEP,
  minvar = 0,
  verbose = FALSE,
  plot = FALSE,
  ...
)

Arguments

object

SummarizedExperiment

by

svar or NULL

assay

string

ndim

number

sep

string

minvar

number

center_samples

TRUE/FALSE: center samples prior to pca ?

verbose

TRUE/FALSE: message ?

plot

TRUE/FALSE: plot ?

...

passed to biplot

Value

SummarizedExperiment

Author(s)

Aditya Bhagwat, Laure Cougnaud (LDA)

Examples

file <- system.file('extdata/atkin.metabolon.xlsx', package = 'autonomics')
 object <- read_metabolon(file)
 pca(object, plot = TRUE)    # Principal Component Analysis
 pls(object, plot = TRUE)    # Partial Least Squares
 lda(object, plot = TRUE)    # Linear Discriminant Analysis
 sma(object, plot = TRUE)    # Spectral Map Analysis
spls(object, plot = TRUE)    # Sparse PLS
# opls(object, plot = TRUE)  # OPLS # outcommented because it produces a file named FALSE

bhagwataditya/importomics documentation built on May 1, 2024, 2:01 a.m.