log2FC: log2FC

View source: R/misc.R

log2FCR Documentation

log2FC

Description

Generates log2(foldchange) matrix/assay, eventually on a per-batch fashion.

Usage

log2FC(
  x,
  fromAssay = NULL,
  controls,
  by = NULL,
  isLog = NULL,
  agFun = rowMeans,
  toAssay = "log2FC"
)

Arguments

x

A numeric matrix, or a 'SummarizedExperiment' object

fromAssay

The assay to use if 'x' is a 'SummarizedExperiment'

controls

A vector of which samples should be used as controls for foldchange calculations.

by

An optional vector indicating groups/batches by which the controls will be averaged to calculate per-group foldchanges.

isLog

Logical; whether the data is log-transformed. If NULL, will attempt to figure it out from the data and/or assay name

agFun

Aggregation function for the baseline (default rowMeans)

toAssay

The name of the assay in which to save the output.

Value

An object of same class as 'x'; if a 'SummarizedExperiment', will have the additional assay named from 'toAssay'.

Examples

log2FC( matrix(rnorm(40), ncol=4), controls=1:2 )


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