Skip to contents

Helper function to run many pairwise comparisons using a contrast matrix

Usage

ApplyContrasts(
  data,
  analysis,
  name.prefix,
  contrasts,
  mode.slot = NULL,
  genes = NULL,
  verbose = FALSE,
  FUN,
  ...
)

Arguments

data

the grandR object

analysis

a plain name, only used for status messages

name.prefix

the prefix for the new analysis name; a dot and the column names of the contrast matrix are appended; can be NULL (then only the contrast matrix names are used)

contrasts

contrast matrix that defines all pairwise comparisons, generated using GetContrasts

mode.slot

which slot to take expression values from

genes

restrict analysis to these genes; NULL means all genes

verbose

print status messages?

FUN

a function taking 1. the data matrix, 2. a logical vector indicating condition A and 3. a logical vector indicating condition B

...

further parameters forward to FUN

Value

a new grandR object with added analysis tables (that were returned by FUN)

Details

To implement most pairwise analyses, you only have to define FUN; see the source code of LFC for an example!