From fb1409a03952d9ee34821f6427b6e8eabab86dda Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Wed, 24 Jan 2024 15:27:02 +0100 Subject: [PATCH] fix a mistake in enzyme builders --- docs/src/examples/05-enzyme-constrained-models.jl | 12 ++++++++---- src/builders/enzymes.jl | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/src/examples/05-enzyme-constrained-models.jl b/docs/src/examples/05-enzyme-constrained-models.jl index 2178a2c0b..a978b7358 100644 --- a/docs/src/examples/05-enzyme-constrained-models.jl +++ b/docs/src/examples/05-enzyme-constrained-models.jl @@ -125,7 +125,11 @@ ec_solution = enzyme_constrained_flux_balance_analysis( ) #src these values should be unique (glucose transporter is the only way to get carbon into the system) -@test isapprox(ec_solution.objective, 1.671357282901553, atol = TEST_TOLERANCE) #src -@test isapprox(ec_solution.total_proteome_bound, 0.1, atol = TEST_TOLERANCE) #src -@test isapprox(ec_solution.fluxes.EX_glc__D_e, -49.92966287110028, atol = 0.1) #src -@test isapprox(ec_solution.enzymes.b2417, 0.00011859224858442563, atol = 1e-7) #src +@test isapprox(ec_solution.objective, 0.706993382849705, atol = TEST_TOLERANCE) #src +@test isapprox(ec_solution.gene_product_capacity, 50.0, atol = TEST_TOLERANCE) #src +@test isapprox(ec_solution.fluxes.EX_glc__D_e, -10, atol = TEST_TOLERANCE) #src +@test isapprox( #src + ec_solution.gene_product_amounts.b2417, #src + 0.011875920383431717, #src + atol = TEST_TOLERANCE, #src +) #src diff --git a/src/builders/enzymes.jl b/src/builders/enzymes.jl index c6375c8fd..e0c8ed828 100644 --- a/src/builders/enzymes.jl +++ b/src/builders/enzymes.jl @@ -103,7 +103,7 @@ function gene_product_isozyme_constraints( res[gp].value += i.value * stoi else res[gp] = - equal_value_constraint(i.value * stoi, gene_product_amounts[gp]) + C.Constraint(i.value * stoi - gene_product_amounts[gp].value, 0) end end end