1. Modifiers & Induced Expression#

Welcome to Tutorial 2! In Tutorial 1 you built and modified models with substrates and products, but we left the Modifiers column empty in reactions.csv. Now let’s unlock modifiers — one of the most important building blocks for realistic biological models!

What are modifiers?#

Suppose you want to model the transcription factor NF-κB (NFkB) inducing expression of its target gene IκB (IkB).

It is tempting to draw a simple arrow straight from NFkB to IkB, just like A → B in Tutorial 1:

Incorrect diagram showing NFkB turning into IkB as a substrate

Fig. 3 Why NFkB → IkB is biologically wrong: it says NFkB is consumed to make IkB.#

While IkB would go up when NFkB goes up, that diagram literally means NFkB turns into IkB — which is not what happens in a cell! NFkB is not used up when it induces transcription of IkB (just like mRNA is not used up when it is translated into protein).

Instead, we need NFkB to control the rate of IkB production without being a substrate. That is exactly what a modifier does!

Correct modifier notation showing NFkB promoting IkB expression with a circle on a stick, and inhibition with a flat T-bar

Fig. 4 Left: Promotion (circle on a stick) — NFkB increases the expression rate of IkB without being consumed. Right: Inhibition (flat T-bar) — as A increases, the expression rate of B decreases.#

Important

Modifiers point to arrows, not nodes! Notice that the modifier connects to the reaction arrow, not directly to the IkB box. NFkB doesn’t turn into IkB — it controls how fast the expression reaction runs. Keeping this distinction clear becomes essential as models grow larger!


Our first model with a modifier (NFkB inducing IkB)#

Remember every model is built from 3 CSV files:

  1. reactionsMod.csv — puts NFkB in the Modifiers column (leaving Substrate empty, since IkB is synthesized anew!).

  2. ratelawsMod.csv — defines a new kinetic law called Induced Expression:

    {k1} * ([Mod1] / ({k2} + [Mod1]))
    
  3. parametersMod.csv — sets numerical values for k1_IkBexp and k2_IkBexp.

Making sense of the Induced Expression maths#

That rate law looks intimidating in a CSV cell, so let’s write it out cleanly as mathematics:

\[ \text{Rate} = k_1 \cdot \frac{[\text{Mod1}]}{k_2 + [\text{Mod1}]} \]

Here:

  • \(k_1\) is the maximum expression rate (bigger \(k_1\) → more IkB produced at full activation).

  • The fraction \(\frac{[\text{Mod1}]}{k_2 + [\text{Mod1}]}\) scales smoothly between \(0\) and \(1\) depending on how much modifier (NFkB) is present!

    • When NFkB is huge (say 99999), \(\frac{99999}{k_2 + 99999} \approx 1\), so \(\text{Rate} \approx k_1 \times 1 = k_1\).

    • When NFkB is tiny (near 0), \(\frac{0}{k_2 + 0} = 0\), so \(\text{Rate} \approx 0\).

Let’s visualize this rate law in Julia right now (click ⚡ Compute at the top of the page if you haven’t already!).

using DifferentialEquations
using Plots
using CSV
using DataFrames

gr()

# Visualise the Induced Expression rate law for k1 = 20, k2 = 5
k1 = 20.0
k2 = 5.0
nfkb_vals = 0.0:0.5:50.0
rates = [k1 * (x / (k2 + x)) for x in nfkb_vals]

plot(
    nfkb_vals,
    rates,
    label = "IkB rate",
    xlabel = "Modifier concentration: NFkB (nM)",
    ylabel = "IkB expression rate (nM/min)",
    title = "Induced Expression Rate: k1 * NFkB / (k2 + NFkB)  (k1 = 20, k2 = 5)",
    lw = 2.5,
)
../_images/2c09c19d133d51b37185ae1272dd02ac861342e0700790933f590d70975eecb3.svg

Check your intuition on \(k_1\) and \(k_2\)#

Suppose \(k_1 = 20\) and \(k_2 = 5\). Work out these three quick questions before checking the answers:

  1. If there is almost no modifier (NFkB ≈ 0), what is the approximate rate of expression?

  2. If there is a huge amount of modifier (NFkB = 99999), what is the approximate rate of expression?

  3. If there is exactly 5 nM of modifier (NFkB = 5, equal to \(k_2\)), what is the rate of expression?


Create the three modifier CSV files#

Run the cell below to save reactionsMod.csv, ratelawsMod.csv, and parametersMod.csv (with max expression \(k_1 = 20\) and half-max concentration \(k_2 = 5\)) into your workspace!

write("reactionsMod.csv", """
Substrate , Products , Kinetic Law        , Modifiers , Parameters
          , IkB      , Induced Expression , NFkB      , k1_IkBexp k2_IkBexp
""")

write("ratelawsMod.csv", """
Rate Law Name      , Rate Law Definition
Induced Expression , {k1} * ([Mod1] / ({k2} + [Mod1]))
""")

write("parametersMod.csv", """
Parameter , Value
k1_IkBexp , 20
k2_IkBexp , 5
""")

println("Saved reactionsMod.csv, ratelawsMod.csv, and parametersMod.csv!")
display(CSV.read("reactionsMod.csv", DataFrame; stripwhitespace=true))
display(CSV.read("ratelawsMod.csv", DataFrame; stripwhitespace=true))
display(CSV.read("parametersMod.csv", DataFrame; stripwhitespace=true))
Saved reactionsMod.csv, ratelawsMod.csv, and parametersMod.csv!
1×5 DataFrame
 Row │ Substrate  Products  Kinetic Law         Modifiers  Parameters
     │ Missing    String3   String31            String7    String31
─────┼──────────────────────────────────────────────────────────────────────
   1 │ missing    IkB       Induced Expression  NFkB       k1_IkBexp k2_IkBexp

Challenge: Run your first model with a modifier!#

The cell below contains the original Tutorial 1 Toy Model runner code.

Adapt it yourself to:

  1. Point to reactionsMod.csv, parametersMod.csv, and ratelawsMod.csv (and generate modModel.jl).

  2. Set the initial conditions to 10 nM of NFkB and 0 nM of IkB (be careful to check the order of species in syms!).

  3. Run the simulation for 60 minutes and plot the result! What does IkB do over time? What does NFkB do over time?

# Original Tutorial 1 runner code — edit this cell to run the NFkB/IkB modifier model!
reactionsFile = "reactions.csv"
rateLawsFile = "ratelaws.csv"
parametersFile = "parameters.csv"
thisModelName = "toyModel.jl"
maxTimeTC = 60.0

run(`python3 csv2model-multiscale.py $reactionsFile $parametersFile $rateLawsFile $thisModelName`)
include(thisModelName)
include("variableNames.jl")
println("Species order (syms): ", syms)

y0 = [1.0, 0.0, 0.0]
prob = ODEProblem(ODEFunction(toyModel), y0, (0.0, maxTimeTC))
sol = solve(prob, abstol=1e-5, reltol=1e-3)

plot(
    sol,
    label = permutedims(syms),
    xlabel = "Time (min)",
    ylabel = "Concentration (nM)",
    title = "Modifier Model",
    lw = 2.5,
)
../_images/055489a6663d84f9fc4a4eccf86d1a2ffb34ec8dff385a9a55fcb2d7deee0d10.svg

Dealing with errors#

Don’t worry when you get errors trying something new — it happens to everyone, and Julia error messages can look intimidating at first!

Most errors boil down to typos. Look at the deliberate bug in the cell below, run it, and read the very top line of the error message:

  • It says UndefVarError: sols not defined, and the stack trace points right to the line that failed!

  • Can you spot the typo and fix it?

# Run this cell first to see the error message, then fix the typo!
plot(sols, label=permutedims(syms), lw=2.5)

Now that you’ve mastered modifiers and error messages, head to 2. Modifier Challenges (NF-κB / IκB) to build a realistic feedback pathway!