regressionData: Create MultiAssayExperiment object for expression modeling

View source: R/processing.R

regressionDataR Documentation

Create MultiAssayExperiment object for expression modeling

Description

regressionData orgnize expression data and experiment design into MultiAssayExperiment object that can be further used in xcore framework. Additionally, function calculate basal expression level, for latter use in expression modeling, by averaging base_lvl samples expression values.

Usage

regressionData(expr_mat, design, base_lvl, drop_base_lvl = TRUE)

Arguments

expr_mat

matrix of expression values.

design

matrix giving the design matrix for the samples. Columns corresponds to samples groups and rows to samples names.

base_lvl

string indicating group in design corresponding to basal expression level. The reference samples to which expression change will be compared.

drop_base_lvl

logical flag indicating if base_lvl samples should be dropped from resulting MultiAssayExperiment object.

Details

Note that regressionData does not apply any normalization or transformation to the input data! Use prepareCountsForRegression if you want to start with raw expression counts.

Value

MultiAssayExperiment object with two experiments:

U

matrix giving expression values averaged over basal level samples

Y

matrix of expression values

design with base_lvl dropped is stored in metadata and directly available for modelGeneExpression.

Examples

data("rinderpest_mini")
base_lvl <- "00hr"
design <- matrix(
  data = c(1, 0, 0,
           1, 0, 0,
           1, 0, 0,
           0, 1, 0,
           0, 1, 0,
           0, 1, 0,
           0, 0, 1,
           0, 0, 1,
           0, 0, 1),
  ncol = 3,
  nrow = 9,
  byrow = TRUE,
  dimnames = list(colnames(rinderpest_mini), c("00hr", "12hr", "24hr")))
mae <- regressionData(
  expr_mat = rinderpest_mini,
  design = design,
  base_lvl = base_lvl)


bkaczkowski/xcore documentation built on Jan. 26, 2024, 6:24 p.m.