Skip to contents

Declares the compartment of a state, before or after the state is introduced by addReaction().

Usage

assignCompartment(eqnlist, ..., volume = NULL, rule = NULL)

Arguments

eqnlist

object of class eqnlist

...

named arguments state = "compartment", or a single named character vector of the same shape. Compartments that do not exist yet are created with volume "1".

volume

Optional volume expression for the target compartment. Only allowed when ... names a single compartment; use setCompartmentVolume() for several.

rule

optional volume rule (dV/dt) for the target compartment, see setCompartmentVolume(). Default NULL.

Value

An object of class eqnlist.

Examples

f <- eqnlist() |>
  assignCompartment(TGFb = "extraCell", volume = "V_ext") |>
  addReaction("R + TGFb", "R_TGFb", "k_on*R*TGFb", compartment = "Cell")
f$compartmentOf
#>           R        TGFb      R_TGFb 
#>      "Cell" "extraCell"      "Cell"