2. Modifier Challenges (NF-κB / IκB Pathway)#

These three challenges are genuinely hard — give them a real try, use the 💡 Hint dropdowns when you want a clue, and don’t hesitate to talk to Simon when you get stuck!

For every challenge below, the code cell starts with the original unmodified model so you can build the changes yourself step by step.

First, load the Julia packages.

using DifferentialEquations
using Plots
using CSV
using DataFrames

gr()
println("Ready for Tutorial 2 challenges!")
Ready for Tutorial 2 challenges!

Challenge 1: Stop IkB increasing forever#

In our first modifier model, IkB climbs upward forever because there is nothing removing it!

Your task: Add reactions for the basal expression and degradation of IkB (refer back to how constant expression and mass-action degradation were modelled in Tutorial 1) so that IkB settles to a realistic steady state!

# Starting point: original modifier model where IkB climbs forever — edit to solve Challenge 1!
write("ratelaws_t2c1.csv", """
Rate Law Name      , Rate Law Definition
Induced Expression , {k1} * ([Mod1] / ({k2} + [Mod1]))
""")

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

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

# Display your edited CSV table(s) cleanly below
display(CSV.read("ratelaws_t2c1.csv", DataFrame; stripwhitespace=true))
display(CSV.read("reactions_t2c1.csv", DataFrame; stripwhitespace=true))
display(CSV.read("parameters_t2c1.csv", DataFrame; stripwhitespace=true))

run(`python3 csv2model-multiscale.py reactions_t2c1.csv parameters_t2c1.csv ratelaws_t2c1.csv modModel_t2c1.jl`)
include("modModel_t2c1.jl")
include("variableNames.jl")
println("Species: ", syms)

y0_c1 = [0.0, 10.0]  # [IkB, NFkB]
prob_c1 = ODEProblem(ODEFunction(modModel_t2c1), y0_c1, (0.0, 60.0))
sol_c1 = solve(prob_c1, abstol=1e-5, reltol=1e-3)

plot(
    sol_c1,
    label = permutedims(syms),
    xlabel = "Time (min)",
    ylabel = "Concentration (nM)",
    title = "Challenge 1: Stop IkB Increasing Forever",
    lw = 2.5,
)
../_images/b2804575b0939cfa43749509e28fbce0bcfad2fec742e5c8cfce99c74e88c4de.svg

Challenge 2: Model NFkB and IkB binding and unbinding#

In real cells, IkB is the inhibitor of NF-κB — it binds directly to NFkB to form an inactive NFkB_IkB complex, creating a negative feedback loop!

Reversible binding and unbinding of NFkB and IkB into NFkB_IkB complex

Fig. 5 Model reversible binding as two separate reactions: binding (NFkB + IkB → NFkB_IkB) and unbinding (NFkB_IkB → NFkB + IkB).#

Your task: Starting from the steady-state IkB model below, add binding and unbinding between NFkB and IkB!

# Starting point: IkB steady-state model (without binding) — edit to solve Challenge 2!
write("ratelaws_t2c2.csv", """
Rate Law Name              , Rate Law Definition
Constant Exp               , {k1}
Mass Action with substrate , [S1] * {k1}
Induced Expression         , {k1} * ([Mod1] / ({k2} + [Mod1]))
""")

write("reactions_t2c2.csv", """
Substrate , Products , Kinetic Law                , Modifiers , Parameters
          , IkB      , Induced Expression         , NFkB      , k1_IkBexp k2_IkBexp
          , IkB      , Constant Exp               ,           , k1_IkBbasal
IkB       ,          , Mass Action with substrate ,           , k1_IkBdeg
""")

write("parameters_t2c2.csv", """
Parameter   , Value
k1_IkBexp   , 20
k2_IkBexp   , 5
k1_IkBbasal , 0.5
k1_IkBdeg   , 0.2
""")

# Display your edited CSV table(s) cleanly below
display(CSV.read("ratelaws_t2c2.csv", DataFrame; stripwhitespace=true))
display(CSV.read("reactions_t2c2.csv", DataFrame; stripwhitespace=true))
display(CSV.read("parameters_t2c2.csv", DataFrame; stripwhitespace=true))

run(`python3 csv2model-multiscale.py reactions_t2c2.csv parameters_t2c2.csv ratelaws_t2c2.csv modModel_t2c2.jl`)
include("modModel_t2c2.jl")
include("variableNames.jl")
println("Species: ", syms)

y0_c2 = [0.0, 10.0]
prob_c2 = ODEProblem(ODEFunction(modModel_t2c2), y0_c2, (0.0, 60.0))
sol_c2 = solve(prob_c2, abstol=1e-5, reltol=1e-3)

plot(
    sol_c2,
    label = permutedims(syms),
    xlabel = "Time (min)",
    ylabel = "Concentration (nM)",
    title = "Challenge 2: Add NFkB + IkB Binding & Unbinding",
    lw = 2.5,
)
../_images/2171b8a66435f77b90fe7f49abd84a3df83d613c56c5251d64f2d2fc7d0c0ad8.svg

Challenge 3: Add IkB mRNA (NFkB → IkB_mRNA → IkB protein)#

NFkB doesn’t directly synthesize IkB protein — it induces IkB mRNA (IkB_mRNA), which is then translated into IkB protein!

NFkB induces IkB_mRNA transcription, and IkB_mRNA promotes IkB protein translation, with degradation of both

Fig. 6 Two-step gene expression with modifiers: NFkB promotes IkB_mRNA transcription, and IkB_mRNA promotes IkB protein translation (without either modifier being consumed!).#

Your task: Add IkB_mRNA to the model so that NFkB induces IkB_mRNA, and IkB_mRNA promotes IkB protein expression (with degradation of both mRNA and protein, and optional NFkB–IkB binding!).

# Starting point: direct IkB induction model — edit this cell to add IkB_mRNA!
write("ratelaws_t2c3.csv", """
Rate Law Name              , Rate Law Definition
Constant Exp               , {k1}
Mass Action with substrate , [S1] * {k1}
Induced Expression         , {k1} * ([Mod1] / ({k2} + [Mod1]))
""")

write("reactions_t2c3.csv", """
Substrate , Products , Kinetic Law                , Modifiers , Parameters
          , IkB      , Induced Expression         , NFkB      , k1_IkBexp k2_IkBexp
          , IkB      , Constant Exp               ,           , k1_IkBbasal
IkB       ,          , Mass Action with substrate ,           , k1_IkBdeg
""")

write("parameters_t2c3.csv", """
Parameter   , Value
k1_IkBexp   , 20
k2_IkBexp   , 5
k1_IkBbasal , 0.5
k1_IkBdeg   , 0.2
""")

# Display your edited CSV table(s) cleanly below
display(CSV.read("ratelaws_t2c3.csv", DataFrame; stripwhitespace=true))
display(CSV.read("reactions_t2c3.csv", DataFrame; stripwhitespace=true))
display(CSV.read("parameters_t2c3.csv", DataFrame; stripwhitespace=true))

run(`python3 csv2model-multiscale.py reactions_t2c3.csv parameters_t2c3.csv ratelaws_t2c3.csv modModel_t2c3.jl`)
include("modModel_t2c3.jl")
include("variableNames.jl")
println("Species: ", syms)

y0_c3 = [0.0, 10.0]
prob_c3 = ODEProblem(ODEFunction(modModel_t2c3), y0_c3, (0.0, 60.0))
sol_c3 = solve(prob_c3, abstol=1e-5, reltol=1e-3)

plot(
    sol_c3,
    label = permutedims(syms),
    xlabel = "Time (min)",
    ylabel = "Concentration (nM)",
    title = "Challenge 3: Add IkB mRNA",
    lw = 2.5,
)
../_images/2171b8a66435f77b90fe7f49abd84a3df83d613c56c5251d64f2d2fc7d0c0ad8.svg

Congratulations — you have just built the core NF-κB / IκB transcriptional negative feedback module in Julia!