limma_ftest_contrasts: Apply limma's lmFit, contrasts.fit, & eBayes to one or more...

View source: R/limma_ftest_contrasts.R

limma_ftest_contrastsR Documentation

Apply limma's lmFit, contrasts.fit, & eBayes to one or more contrasts, perform moderated F-test, and return a table

Description

Apply limma's lmFit, contrasts.fit, & eBayes to one or more contrasts, perform moderated F-test, and return a table.

Usage

limma_ftest_contrasts(
  object,
  grp = NULL,
  contrast.v,
  add.means = !is.null(grp),
  weights = NA,
  design = NULL,
  prefix = "",
  trend = FALSE,
  block = NULL,
  correlation = NULL
)

Arguments

object

Matrix-like data object containing log-ratios or log-expression values, with rows corresponding to features (e.g. genes) and columns to samples. Must have row names that are non-duplicated and non-empty.

grp

Vector of sample groups. These must be valid variable names in R and the same length as ncol(object).

contrast.v

Named vector of contrasts, passed to makeContrasts.

add.means

Logical indicating if (unweighted) group means per row should be added to the output.

weights

Non-negative observation weights. Can be a numeric matrix of individual weights of same size as the object, or a numeric vector of sample weights with length ncol(object), or a numeric vector of gene weights with length equal to nrow(object). Set to NULL to ignore object$weights. weights=NA (with length one) doesn't pass weights to limma.

design

Design matrix of the experiment, with rows corresponding to samples and columns to coefficients to be estimated.

prefix

Character string to add to beginning of column names. NULL does not add a prefix.

trend

Logical; should an intensity-trend be allowed for the prior variance? Default is that the prior variance is constant.

block

Vector specifying a blocking variable on the samples. Has length = ncol(object). Must be NULL if ndups > 1.

correlation

Inter-duplicate or inter-technical replicate correlation. Must be given if ndups>1 or !is.null(block).

Details

If design is NULL and grp is given, design will be calculated as model.matrix(~0+grp). However, grp isn't needed if design is provided & add.means is FALSE.

Value

Data frame.

References

McCarthy DJ & Smyth GK (2009). Testing significance relative to a fold-change threshold is a TREAT. Bioinformatics 25, 765-771.

See Also

lmFit; eBayes.


jdreyf/jdcbioinfo documentation built on Sept. 18, 2024, 5:32 p.m.