limma_treat_max: Apply limma's lmFit, contrasts.fit, & treat to one or more...

View source: R/limma_treat_max.R

limma_treat_maxR Documentation

Apply limma's lmFit, contrasts.fit, & treat to one or more contrasts, and return a table

Description

Apply limma's lmFit, contrasts.fit, & treat to one or more contrasts, and return a table.

Usage

limma_treat_max(
  object,
  grp = NULL,
  contrast.v,
  treat.lfc = log2(1.2),
  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.

treat.lfc

Vector of logFC passed to treat lfc. It is recycled as needed to match rows of object. If given, length(contrast.v) must be 1. McCarthy & Smyth suggest a 10 which is treat.lfc=log2(1.1).

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 April 15, 2024, 6:37 p.m.