dream_contrasts: Apply variancePartition's dream to one or more contrasts,...

View source: R/dream_contrasts.R

dream_contrastsR Documentation

Apply variancePartition's dream to one or more contrasts, perform moderated t-test, and return a table using limma's topTable

Description

Apply variancePartition's dream, to one or more contrasts, perform moderated t-test, and return a table using limma's topTable.

Usage

dream_contrasts(
  object,
  formula,
  pheno,
  contrast.v,
  weights = NA,
  grp = NULL,
  add.means = !is.null(grp),
  moderated = TRUE,
  cols = c("P.Value", "adj.P.Val", "logFC"),
  ncores = 1
)

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.

formula

specifies variables for the linear (mixed) model. Must only specify covariates, since the rows of exprObj are automatically used as a response. e.g.: ~ a + b + (1|c) Formulas with only fixed effects also work, and lmFit() followed by contrasts.fit() are run.

pheno

data.frame with columns corresponding to formula

contrast.v

Named vector of contrasts, passed to makeContrasts.

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.

grp

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

add.means

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

moderated

Logical; should variancePartition::eBayes be used?

cols

Columns of topTable output to include. Possibilities include "logFC", "AveExpr", "z", "t", "P.Value", "adj.P.Val", "B". Some of these column names are then changed here. If logFC is specified, FC will automatically also be given.

ncores

number of cores

Value

Data frame.


jdreyf/jdcbioinfo documentation built on April 15, 2024, 6:37 p.m.