Skip to contents

SEDesign enforces the relationship between individual samples, design groups, and groups involved in statistical contrasts.

Usage

SEDesign(
  design = matrix(nrow = 0, ncol = 0),
  contrasts = matrix(nrow = 0, ncol = 0),
  samples = character(0),
  factors = character(0)
)

Arguments

design

matrix with rownames as samples, colnames as design groups, containing 0/1 sample-to-group association values.

contrasts

matrix with rownames matching colnames(design), and colnames as contrast names, containing contrast coefficients.

samples

character vector of sample identifiers, typically equal to rownames(design).

factors

character vector of labels for the underlying experimental factors, equivalent to colnames(design_df), i.e. the columns produced by splitting each design group name (groups(object)) on "_". When empty, or when its length does not match the number of underlying factors, it is auto-populated with "factor1", "factor2", etc. Editing factors() only renames these labels (used primarily by print()); it has no effect on design, contrasts, or groups().

Details

In addition to the four constructor arguments below, SEDesign objects carry two internal-use properties, accessible via @:

  • design_df: data.frame with one row per design group (groups(object), i.e. colnames(design)), derived by splitting each group name on "_" into one column per underlying experimental factor. Column names default to "factor1", "factor2", etc., and can be customized via factors()<-.

  • contrasts_df: data.frame, cached result of contrasts_to_factors(), refreshed whenever design or contrasts are updated.