svacor: svacor

View source: R/svacor.R

svacorR Documentation

svacor

Description

A wrapper around SVA-based correction, providing a corrected assay. If this is RNAseq data or similar, use a count assay assay with 'useVST=TRUE'; otherwise (e.g. proteomics) a log-normalized assay is recommended.

Usage

svacor(
  SE,
  form,
  form0 = ~1,
  assayName = NULL,
  regressOutNull = TRUE,
  useVST = TRUE,
  n.sv = NULL,
  ...
)

Arguments

SE

An object of class 'SummarizedExperiment'.

form

The formula of the differential expression model

form0

An optional formula for the null model

assayName

The name (or index) of the assay to use.

regressOutNull

Logical; whether to regress out the variables of 'form0'.

useVST

Logical; whether to use DESeq2's variance-stabilizing transformation; (for count data!)

n.sv

The number of surrogate variables (if omitted, sva will attempt to estimate it)

...

Any other argument passed to the sva command.

Value

Returns the 'SummarizedExperiment' with a 'corrrected' assay and the surrogate variables in 'colData'.

Examples

data("SE", package="SEtools")
SE <- svacor(SE, ~Condition)

plger/SEtools documentation built on Dec. 2, 2022, 3:58 p.m.