design-experiment-method: Get experimental design Find the column/columns that create a...

design,experiment-methodR Documentation

Get experimental design Find the column/columns that create a separation between samples, by default skips replicate and choose first that is from either: libtype, condition, stage and fraction.

Description

Get experimental design Find the column/columns that create a separation between samples, by default skips replicate and choose first that is from either: libtype, condition, stage and fraction.

Usage

## S4 method for signature 'experiment'
design(
  object,
  batch.correction.design = FALSE,
  as.formula = FALSE,
  multi.factor = TRUE
)

Arguments

object

an ORFik experiment

batch.correction.design

logical, default FALSE. If true, add replicate as a second design factor (only if >= 2 replicates exists).

as.formula

logical, default FALSE. If TRUE, return as formula

multi.factor

logical, default TRUE If FALSE, return first factor only (+ rep, if batch.correction.design is true). Order of picking is: libtype, if not then: stage, if not then: condition, if not then: fraction.

Value

a character (name of column) or a formula

Examples

df <- ORFik.template.experiment()
design(df) # The 2 columns that decides the design here
# If we subset it changes
design(df[df$libtype == "RFP",])
# Only single factor design, it picks first
design(df, multi.factor = FALSE)

Roleren/ORFik documentation built on April 25, 2024, 8:41 p.m.