Flux variability analysis (FVA)

FVA finds a range of fluxes through each reaction where the model can behave optimally. In brief, it first runs a FBA to get the optimal objective value, constraints the model to the optimal (or near-optimal) space, and runs a separate minimization and maximization task for each reaction to find their individual ranges.

using COBREXA

download_model(
    "http://bigg.ucsd.edu/static/models/e_coli_core.json",
    "e_coli_core.json",
    "7bedec10576cfe935b19218dc881f3fb14f890a1871448fc19a9b4ee15b448d8",
)

import JSONFBCModels, HiGHS

model = load_model("e_coli_core.json")
JSONFBCModels.JSONFBCModel(#= 95 reactions, 72 metabolites =#)

The "usual" form of FBA is available via the eponymous function:

solution = flux_variability_analysis(model, optimizer = HiGHS.Optimizer)
ConstraintTrees.Tree{Tuple{Union{Nothing, Float64}, Union{Nothing, Float64}}} with 95 elements:
  :ACALD                    => (-2.54237, 0.0)
  :ACALDt                   => (-2.54237, 0.0)
  :ACKr                     => (-3.81356, 0.0)
  :ACONTa                   => (0.848587, 8.89452)
  :ACONTb                   => (0.848587, 8.89452)
  :ACt2r                    => (-3.81356, 0.0)
  :ADK1                     => (-0.0, 17.161)
  :AKGDH                    => (-0.0, 8.04593)
  :AKGt2r                   => (-1.43008, 0.0)
  :ALCD2x                   => (-2.21432, 0.0)
  :ATPM                     => (8.39, 25.551)
  :ATPS4r                   => (34.8256, 59.3811)
  :BIOMASS_Ecoli_core_w_GAM => (0.786529, 0.873922)
  :CO2t                     => (-26.5288, -15.2065)
  :CS                       => (0.848587, 8.89452)
  :CYTBD                    => (35.9849, 51.2391)
  :D_LACt2                  => (-2.14512, 0.0)
  :ENO                      => (8.68659, 16.7325)
  :ETOHt2r                  => (-2.21432, 0.0)
  ⋮                         => ⋮

Specifying objective bounds

By default, FVA computes variability from the feasible region that is bounded to be within 10% of the optimal objective value. That is not very strict, and we can force much lower tolerance.

Here, we force the optimal region to be within 0.00001 units of the optimal objective value:

very_close = flux_variability_analysis(
    model,
    optimizer = HiGHS.Optimizer,
    objective_bound = absolute_tolerance_bound(1e-5),
)
ConstraintTrees.Tree{Tuple{Union{Nothing, Float64}, Union{Nothing, Float64}}} with 95 elements:
  :ACALD                    => (-0.000290915, 0.0)
  :ACALDt                   => (-0.000290915, 0.0)
  :ACKr                     => (-0.000436373, 0.0)
  :ACONTa                   => (6.00588, 6.00903)
  :ACONTb                   => (6.00588, 6.00903)
  :ACt2r                    => (-0.000436373, 0.0)
  :ADK1                     => (-0.0, 0.00196368)
  :AKGDH                    => (5.05517, 5.06616)
  :AKGt2r                   => (-0.00016364, 0.0)
  :ALCD2x                   => (-0.000253378, 0.0)
  :ATPM                     => (8.39, 8.39196)
  :ATPS4r                   => (45.5099, 45.5162)
  :BIOMASS_Ecoli_core_w_GAM => (0.873912, 0.873922)
  :CO2t                     => (-22.8103, -22.8089)
  :CS                       => (6.00588, 6.00903)
  :CYTBD                    => (43.5981, 43.5999)
  :D_LACt2                  => (-0.00024546, 0.0)
  :ENO                      => (14.7147, 14.7178)
  :ETOHt2r                  => (-0.000253378, 0.0)
  ⋮                         => ⋮

Here, we relax that to 1% of the optimal objective value:

one_percent_close = flux_variability_analysis(
    model,
    optimizer = HiGHS.Optimizer,
    objective_bound = relative_tolerance_bound(0.99),
)
ConstraintTrees.Tree{Tuple{Union{Nothing, Float64}, Union{Nothing, Float64}}} with 95 elements:
  :ACALD                    => (-0.254237, 0.0)
  :ACALDt                   => (-0.254237, 0.0)
  :ACKr                     => (-0.381356, 0.0)
  :ACONTa                   => (4.8143, 7.56006)
  :ACONTb                   => (4.8143, 7.56006)
  :ACt2r                    => (-0.381356, 0.0)
  :ADK1                     => (-0.0, 1.7161)
  :AKGDH                    => (1.18233, 6.62661)
  :AKGt2r                   => (-0.143008, 0.0)
  :ALCD2x                   => (-0.221432, 0.0)
  :ATPM                     => (8.39, 10.1061)
  :ATPS4r                   => (41.917, 47.4085)
  :BIOMASS_Ecoli_core_w_GAM => (0.865182, 0.873922)
  :CO2t                     => (-23.1817, -22.0377)
  :CS                       => (4.8143, 7.56006)
  :CYTBD                    => (42.8376, 44.363)
  :D_LACt2                  => (-0.214512, 0.0)
  :ENO                      => (13.4361, 16.1819)
  :ETOHt2r                  => (-0.221432, 0.0)
  ⋮                         => ⋮
Speed up FVA with parallel processing

By default, FVA is parallelized on all workers that are available in the worker pool of the Distributed package, which may speed up the computation considerably. See the parallel processing documentation for more details.


This page was generated using Literate.jl.