PerformLimma: A convenient wrapper for limma (moderated t-test)

Description Usage Arguments Value See Also Examples

View source: R/tools.R

Description

A convenient wrapper for limma (moderated t-test)

Usage

1
2
PerformLimma(data, design, contrasts, ebayes = TRUE, ordinary.F = FALSE,
  ...)

Arguments

data

the data matrix, rows corresponds to features (lipds, genes, etc.), columns to samples (patients)

design

the design matrix, in case of a simple t-test only two columns with the two groups

contrasts

a character vector specifying the contrast to be tested. When using not using eBayes and toptable currently only one contrast is allowed.

ebayes

boolean indicating wheter the resulting fit should be moderated with an empirical bayes approach. If not, the method boils down to a simple linear model (anova in case of groups). Default to TRUE.

ordinary.F

boolean indicating wheter p-values are calculated, similar to the anova.lm function, using the ordinary F statistic and degrees of freedom. This is useful if limma is used to compute many t-test or ordinary ANOVAs in a vectorized fashion. Otherwise, a more sophistacated approach from topTable is used to compute the F-tests.

...

further arguments to toptable

Value

a data frame with the test results, one for every row, as returned by toptable.

See Also

model.matrix

makeContrasts

Examples

1
2
3
4
5
6
7
8
data <- cbind(matrix(rnorm(25, mean=1), nrow=5),
              matrix(rnorm(25, mean=3), nrow=5))
groups <- factor(rep(c("T", "N"), each=5), levels=c("T", "N"))
design <- model.matrix(~0+groups)
colnames(design) <- levels(groups)
contrasts <- "T-N"
# simple vectorized ANOVA with limma
res <- PerformLimma(data=data, design=design, contrasts=contrasts, ebayes=FALSE, ordinary.F=TRUE)

sagade/inf460 documentation built on Dec. 31, 2020, 3:15 a.m.