Skip to content

Commit

Permalink
add plot and show the results of MMDF
Browse files Browse the repository at this point in the history
  • Loading branch information
stelmo committed Jan 30, 2024
1 parent 0183d10 commit 61375bc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
AbstractFBCModels = "5a4f3dfa-1789-40f8-8221-69268c29937c"
COBREXA = "babc4406-5200-4a30-9033-bf5ae714c842"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Clarabel = "61c947e1-3e6d-4ee4-985a-eec8c727bd6e"
ConstraintTrees = "5515826b-29c3-47a5-8849-8513ac836620"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expand Down
37 changes: 29 additions & 8 deletions docs/src/examples/06-mmdf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ reaction_standard_gibbs_free_energies = Dict{String,Float64}(
# other reactions.

reference_flux = Dict(
"ENO" => 1.0,
"ENO" => 2.0,
"FBA" => 1.0,
"GAPD" => 1.0,
"GAPD" => 2.0,
"GLCpts" => 1.0,
"LDH_D" => -1.0,
"LDH_D" => -2.0,
"PFK" => 1.0,
"PGI" => 1.0,
"PGK" => -1.0,
"PGM" => -1.0,
"PYK" => 1.0,
"PGK" => -2.0,
"PGM" => -2.0,
"PYK" => 2.0,
"TPI" => 1.0,
)

Expand All @@ -108,9 +108,10 @@ mmdf_solution = max_min_driving_force_analysis(
model,
reaction_standard_gibbs_free_energies,
reference_flux;
constant_concentrations = Dict("lac__D_c" => 1e-1, "nad_c" => 2.6e-3),
concentration_ratios = Dict(
"atp" => ("atp_c", "adp_c", 10.0),
"nadh" => ("nadh_c", "nad_c", 0.13),
"nadh" => ("nadh_c", "nad_c", 0.1),
),
proton_metabolites = ["h_c", "h_e"],
water_metabolites = ["h2o_c", "h2o_e"],
Expand All @@ -122,4 +123,24 @@ mmdf_solution = max_min_driving_force_analysis(
)

# TODO verify correctness
@test isapprox(mmdf_solution.min_driving_force, -2.79911, atol = TEST_TOLERANCE) #src
@test isapprox(mmdf_solution.min_driving_force, -2.4739129, atol = TEST_TOLERANCE) #src

# ## Plot the results
# We can see that the ΔG bottleneck is 2.7 kJ/mol, and that there is a
# precipitous increase in driving force near the end of glycolysis.

using CairoMakie

glycolysis_reaction_order = ["GLCpts", "PGI", "PFK", "FBA", "TPI", "GAPD", "PGK", "PGM", "ENO", "PYK", "LDH_D",]

glycolysis_thermo = cumsum(reference_flux[rid] * mmdf_solution.reaction_gibbs_free_energies[Symbol(rid)] for rid in glycolysis_reaction_order)

lines(
1:length(glycolysis_reaction_order),
glycolysis_thermo,
axis=(
xlabel = "Reactions",
ylabel = "Cumulative ΔG [kJ/mol]",
xticks = (1:length(glycolysis_reaction_order), glycolysis_reaction_order)
))

0 comments on commit 61375bc

Please sign in to comment.