Available reaction rules (biomass.construction.reaction_rules
)
- class biomass.construction.reaction_rules.ReactionRules(input_txt, similarity_threshold)
Create an executable biochemical model from text.
Rule
Example sentence
Parameters (optional)
dimerize()
A dimerizes <–> AA
\[kf, kr\]bind()
A binds B <–> AB
\[kf, kr\]dissociate()
AB dissociates to A and B
\[kf, kr\]is_phosphorylated()
uA is phosphorylated <–> pA
\[kf, kr\]is_dephosphorylated()
pA is dephosphorylated –> uA
\[V, K\]phosphorylate()
B phosphorylates uA –> pA
\[V, K\]dephosphorylate()
B dephosphorylates pA –> uA
\[V, K\]transcribe()
B transcribes a
\[V, K, n, (KF, nF)\]synthesize()
B synthesizes A
\[kf\]is_synthesized()
A is synthesized
\[kf\]degrade()
B degrades A
\[kf\]is_degraded()
A is degraded
\[kf\]translocate()
Acyt translocates from cytoplasm to nucleus (Vcyt, Vnuc) <–> Anuc
\[kf, kr, (V_{pre}, V_{post})\]user_defined()
@rxn Reactant –> Product: define rate equation here
user-defined
From v0.2.2, you can specify directionality in binding-dissociation reaction via different arrows:
E + S ⇄ ES | kf=0.003, kr=0.001 | E=100, S=50 # bi-directional ES → E + P | kf=0.002 # unidirectional
- input_txt
Model description file (*.txt), e.g., Kholodenko1999.txt.
- Type:
str
- similarity_threshold
If all match_scores are below this value, expected_word will not be returned.
- Type:
float
- parameters
x
: model parameters.- Type:
list of strings
- species
y
: model species.- Type:
list of strings
- reactions
v
: flux vector.- Type:
list of strings
- differential_equations
dydt
: right-hand side of the differential equation.- Type:
list of strings
- obs_desc
Description of observables.
- Type:
list of List[str]
- param_info
Information about parameter values.
- Type:
list of strings
- init_info
Information about initial values.
- Type:
list of strings
- param_constraints
Information about parameter constraints.
- Type:
list of strings
- param_excluded
List of parameters excluded from search params because of parameter constraints.
- Type:
list of strings
- fixed_species
List of species which should be held fixed (never consumed) during simulation.
- Type:
list of strings
- sim_tspan
Interval of integration.
- Type:
list of strings [‘t0’, ‘tf’]
- sim_conditions
Simulation conditions with stimulation.
- Type:
list of List[str]
- sim_unperturbed
Untreated conditions to get steady state.
- Type:
str
- rule_words
Words to identify reaction rules.
- Type:
dict
- nothing
Available symbol for degradation/creation to/from nothing.
- Type:
List[str]
- fwd_arrows
Available arrows for unidirectional reactions.
- Type:
List[str]
- double_arrows
Available arrows for bi-directional reactions.
- Type:
List[str]
- _bind_and_dissociate(line_num, line)
- Return type:
None
Examples
>>> 'A + B --> AB' # bind, unidirectional >>> 'AB --> A + B' # dissociate, unidirectional >>> 'A + B <--> AB' # bind and dissociate, bidirectional
- dimerize(line_num, line)
- Return type:
None
Examples
>>> 'A dimerizes <--> AA' >>> 'A homodimerizes <--> AA' >>> 'A forms a dimer <--> AA' >>> 'A forms dimers <--> AA'
Notes
- Parameters
- \[kf, kr\]
- Rate equation
- \[v = kf * [A] * [A] - kr * [AA]\]
- Differential equation
- \[ \begin{align}\begin{aligned}d[A]]/dt = - 2 * v\\d[AA]/dt = + v\end{aligned}\end{align} \]
- bind(line_num, line)
- Return type:
None
Examples
>>> 'A binds B <--> AB' >>> 'A forms complexes with B <--> AB'
Notes
- Parameters
- \[kf, kr\]
- Rate equation
- \[v = kf * [A] * [B] - kr * [AB]\]
- Differential equation
- \[ \begin{align}\begin{aligned}d[A]/dt = - v\\d[B]/dt = - v\\d[AB]/dt = + v\end{aligned}\end{align} \]
- is_phosphorylated(line_num, line)
- Return type:
None
Examples
>>> 'uA is phosphorylated <--> pA'
Notes
- Parameters
- \[kf, kr\]
- Rate equation
- \[v = kf * [uA] - kr * [pA]\]
- Differential equation
- \[ \begin{align}\begin{aligned}d[uA]/dt = - v\\d[pA]/dt = + v\end{aligned}\end{align} \]
- is_dephosphorylated(line_num, line)
- Return type:
None
Examples
>>> 'pA is dephosphorylated --> uA'
Notes
- Parameters
- \[V, K\]
- Rate equation
- \[v = V * [pA] / (K + [pA])\]
- Differential equation
- \[ \begin{align}\begin{aligned}d[uA]/dt = + v\\d[pA]/dt = - v\end{aligned}\end{align} \]
- phosphorylate(line_num, line)
- Return type:
None
Examples
>>> 'B phosphorylates uA --> pA'
Notes
- Parameters
- \[V, K\]
- Rate equation
- \[v = V * [B] * [uA] / (K + [uA])\]
- Differential equation
- \[ \begin{align}\begin{aligned}d[uA]/dt = - v\\d[pA]/dt = + v\end{aligned}\end{align} \]
- dephosphorylate(line_num, line)
- Return type:
None
Examples
>>> 'B dephosphorylates pA --> uA'
Notes
- Parameters
- \[V, K\]
- Rate equation
- \[v = V * [B] * [pA] / (K + [pA])\]
- Differential equation
- \[ \begin{align}\begin{aligned}d[uA]/dt = + v\\d[pA]/dt = - v\end{aligned}\end{align} \]
- transcribe(line_num, line)
- Return type:
None
Examples
>>> 'B transcribes a' >>> 'B1 & B2 transcribe a' # (AND-gate) >>> 'B transcribes a, repressed by C' # (Negative regulation)
Notes
- Parameters
- \[V, K, n, (KF, nF)\]
- Rate equation
- \[ \begin{align}\begin{aligned}v = V * [B] ^ {n} / (K ^ {n} + [B] ^ {n})\\v = V * ([B1] * [B2]) ^ {n} / (K ^ {n} + ([B1] * [B2]) ^ {n})\\v = V * [B] ^ {n} / (K ^ {n} + [B] ^ {n} + ([C] / KF) ^ {nF})\end{aligned}\end{align} \]
- Differential equation
- \[d[a]/dt = + v\]
- synthesize(line_num, line)
- Return type:
None
Examples
>>> 'B synthesizes A'
Notes
- Parameters
- \[kf\]
- Rate equation
- \[v = kf * [B]\]
- Differential equation
- \[d[A]/dt = + v\]
- is_synthesized(line_num, line)
- Return type:
None
Examples
>>> 'A is synthesized'
Notes
- Parameters
- \[kf\]
- Rate equation
- \[v = kf\]
- Differential equation
- \[d[A]/dt = + v\]
- degrade(line_num, line)
- Return type:
None
Examples
>>> 'B degrades A'
Notes
- Parameters
- \[kf\]
- Rate equation
- \[v = kf * [B] * [A]\]
- Differential equation
- \[d[A]/dt = - v\]
- is_degraded(line_num, line)
- Return type:
None
Examples
>>> 'A is degraded'
Notes
- Parameters
- \[kf\]
- Rate equation
- \[v = kf * [A]\]
- Differential equation
- \[d[A]/dt = - v\]
- translocate(line_num, line)
- Return type:
None
Examples
>>> 'A_at_cyt translocates from cytoplasm to nucleus (V_cyt, V_nuc) <--> A_at_nuc' >>> 'A_at_cyt is translocated from cytoplasm to nucleus (V_cyt, V_nuc) <--> A_at_nuc'
Notes
- Parameters
- \[kf, kr, (V_{pre}, V_{post})\]
- Rate equation
- \[v = kf * [A\_at\_pre] - kr * (V_{post} / V_{pre}) * [A\_at\_post]\]
- Differential equation
- \[ \begin{align}\begin{aligned}d[A\_at\_pre]/dt = - v\\d[A\_at\_post]/dt = + v * (V_{pre} / V_{post})\end{aligned}\end{align} \]
- state_transition(line_num, line)
This rule is applied only when any rule words are not detected.
- Return type:
None
Examples
‘Reactant –> Product’ ‘Reactant <–> Product’ ‘E + S –> E + P’
Notes
- Parameters
- \[kf (, kr)\]
- Rate equation
- \[v = kf * [Reactant] (- kr * [Product])\]
- Differential equation
- \[d[Reactant]/dt = - v\]\[d[Product]/dt = + v\]
- user_defined(line_num, line)
- Return type:
None
Examples
>>> '@rxn Reactant --> Product: define rate equation here'
Notes
Use p[xxx] and u[xxx] for describing parameters and species, respectively.
Use ‘0’ or ‘∅’ for degradation/creation to/from nothing.
- Differential equation
- \[ \begin{align}\begin{aligned}d[Reactant]/dt = - v\\d[Product]/dt = + v\end{aligned}\end{align} \]