From 75e32090c6bb6faedee38571c0d897ae82474d20 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Thu, 24 Oct 2024 17:31:45 +0000 Subject: [PATCH] build based on aab5335 --- dev/.documenter-siteinfo.json | 2 +- dev/1-parametric-models/index.html | 2 +- dev/2-differentiate-enzyme-model/index.html | 2 +- dev/3-parameter-estimation/index.html | 2 +- dev/index.html | 2 +- dev/reference/index.html | 36 ++++++++++----------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 24df2d5..ad6e78c 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-24T17:24:45","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-24T17:31:43","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/1-parametric-models/index.html b/dev/1-parametric-models/index.html index b0e359f..819926c 100644 --- a/dev/1-parametric-models/index.html +++ b/dev/1-parametric-models/index.html @@ -96,4 +96,4 @@ ) m_noparams.fluxes -pqv17 = ParameterLinearValue([1, 2], [2, 1]) * ParameterLinearValue([2], [1]) #src
ParameterQuadraticValue([(1, 2), (2, 2)], Symbolics.Num[2, 1])

This page was generated using Literate.jl.

+pqv17 = ParameterLinearValue([1, 2], [2, 1]) * ParameterLinearValue([2], [1]) #src
ParameterQuadraticValue([(1, 2), (2, 2)], Symbolics.Num[2, 1])

This page was generated using Literate.jl.

diff --git a/dev/2-differentiate-enzyme-model/index.html b/dev/2-differentiate-enzyme-model/index.html index f8d173e..4224b4b 100644 --- a/dev/2-differentiate-enzyme-model/index.html +++ b/dev/2-differentiate-enzyme-model/index.html @@ -260,4 +260,4 @@ ), ) Colorbar(f[1, 2], hm) -fExample block output

This page was generated using Literate.jl.

+fExample block output

This page was generated using Literate.jl.

diff --git a/dev/3-parameter-estimation/index.html b/dev/3-parameter-estimation/index.html index 20ea03f..313e609 100644 --- a/dev/3-parameter-estimation/index.html +++ b/dev/3-parameter-estimation/index.html @@ -135,4 +135,4 @@ r4 => 0.993201
true_parameter_values
Dict{Symbolics.Num, Float64} with 3 entries:
   r3                 => 2.0
   capacitylimitation => 50.0
-  r4                 => 3.0

This page was generated using Literate.jl.

+ r4 => 3.0

This page was generated using Literate.jl.

diff --git a/dev/index.html b/dev/index.html index a631e83..d3348ed 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -README · DifferentiableMetabolism.jl
+README · DifferentiableMetabolism.jl
diff --git a/dev/reference/index.html b/dev/reference/index.html index 116e86a..ce685c7 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -1,23 +1,23 @@ -Reference · DifferentiableMetabolism.jl

Reference

Parameters

ParameterLinearValue

DifferentiableMetabolism.ParameterLinearValueType
struct ParameterLinearValue <: ConstraintTrees.Value

An extension of ConstraintTrees.LinearValue where the weights are parameters.

ParameterLinearValues can be combined additively and multiplied by real-number constants.

Multiplying two ParameterLinearValues yields a quadratic form (in a ParameterQuadraticValue).

Fields

  • idxs::Vector{Int64}

  • weights::Vector{Symbolics.Num}

source

ParameterQuadraticValue

DifferentiableMetabolism.ParameterQuadraticValueType
struct ParameterQuadraticValue <: ConstraintTrees.Value

An extension of ConstraintTrees.QuadraticValue where the weights are parameters.

Behaves similarly to ConstraintTrees.QuadraticValue. Thus, the cleanest way to construct a ParameterQuadraticValue is to multiply two ParameterLinearValues.

Fields

  • idxs::Vector{Tuple{Int64, Int64}}

  • weights::Vector{Symbolics.Num}

source

ParameterBound

DifferentiableMetabolism.ParameterBetweenType
mutable struct ParameterBetween <: ConstraintTrees.Bound

Representation of an "interval" bound where the lower and upper bound values are parameters. Since Symbolics.Num is a subtype of Real, the bounds could also be any real number, but they are converted by the constructors to Symbolics.Nums.

Fields

  • lower::Symbolics.Num

  • upper::Symbolics.Num

source
DifferentiableMetabolism.ParameterEqualToType
mutable struct ParameterEqualTo <: ConstraintTrees.Bound

Representation of an "equality" bound, where the bound value is a parameter. Since Symbolics.Num is a subtype of Real, the bound could also be any real number, but it is converted by the constructor to a Symbolics.Num.

Fields

  • equal_to::Symbolics.Num
source

ParameterIsozyme

DifferentiableMetabolism.ParameterIsozymeType
mutable struct ParameterIsozyme

A parameterized isozyme struct which includes parameters in the kcat_forward, and the kcat_backward. If the reaction does not have a turnover number,nothing can be used.

Fields

  • gene_product_stoichiometry::Dict{String, Float64}

  • kcat_forward::Union{Nothing, Symbolics.Num}

  • kcat_reverse::Union{Nothing, Symbolics.Num}

source

Parameterized models

Kinetic models

DifferentiableMetabolism.build_kinetic_modelMethod
build_kinetic_model(
+Reference · DifferentiableMetabolism.jl

Reference

Parameters

ParameterLinearValue

DifferentiableMetabolism.ParameterLinearValueType
struct ParameterLinearValue <: ConstraintTrees.Value

An extension of ConstraintTrees.LinearValue where the weights are parameters.

ParameterLinearValues can be combined additively and multiplied by real-number constants.

Multiplying two ParameterLinearValues yields a quadratic form (in a ParameterQuadraticValue).

Fields

  • idxs::Vector{Int64}

  • weights::Vector{Symbolics.Num}

source

ParameterQuadraticValue

DifferentiableMetabolism.ParameterQuadraticValueType
struct ParameterQuadraticValue <: ConstraintTrees.Value

An extension of ConstraintTrees.QuadraticValue where the weights are parameters.

Behaves similarly to ConstraintTrees.QuadraticValue. Thus, the cleanest way to construct a ParameterQuadraticValue is to multiply two ParameterLinearValues.

Fields

  • idxs::Vector{Tuple{Int64, Int64}}

  • weights::Vector{Symbolics.Num}

source

ParameterBound

DifferentiableMetabolism.ParameterBetweenType
mutable struct ParameterBetween <: ConstraintTrees.Bound

Representation of an "interval" bound where the lower and upper bound values are parameters. Since Symbolics.Num is a subtype of Real, the bounds could also be any real number, but they are converted by the constructors to Symbolics.Nums.

Fields

  • lower::Symbolics.Num

  • upper::Symbolics.Num

source
DifferentiableMetabolism.ParameterEqualToType
mutable struct ParameterEqualTo <: ConstraintTrees.Bound

Representation of an "equality" bound, where the bound value is a parameter. Since Symbolics.Num is a subtype of Real, the bound could also be any real number, but it is converted by the constructor to a Symbolics.Num.

Fields

  • equal_to::Symbolics.Num
source

ParameterIsozyme

DifferentiableMetabolism.ParameterIsozymeType
mutable struct ParameterIsozyme

A parameterized isozyme struct which includes parameters in the kcat_forward, and the kcat_backward. If the reaction does not have a turnover number,nothing can be used.

Fields

  • gene_product_stoichiometry::Dict{String, Float64}

  • kcat_forward::Union{Nothing, Symbolics.Num}

  • kcat_reverse::Union{Nothing, Symbolics.Num}

source

Parameterized models

Kinetic models

DifferentiableMetabolism.build_kinetic_modelMethod
build_kinetic_model(
     model::AbstractFBCModels.AbstractFBCModel;
     reaction_isozymes,
     gene_product_molar_masses,
     capacity
 )
-

Essentially an enzyme constrained metabolic model, but the kcat can be a arbitrary symbolic function.

source

Solving models

Solving models

DifferentiableMetabolism.optimization_model_with_parametersMethod
optimization_model_with_parameters(
     m::ConstraintTrees.Tree{ConstraintTrees.Constraint},
     parameters::Dict{Symbolics.Num, Float64};
     objective,
     optimizer,
     sense
 )
-

Construct a JuMP model by substituting parameters into the model, m. Set the objective and the optimizer, as well as the sense similar to COBREXA.optimization_model.

Converts all inequality constraints to the form A * x ≤ b.

source
DifferentiableMetabolism.optimized_constraints_with_parametersMethod
optimized_constraints_with_parameters(
+

Construct a JuMP model by substituting parameters into the model, m. Set the objective and the optimizer, as well as the sense similar to COBREXA.optimization_model.

Converts all inequality constraints to the form A * x ≤ b.

source
DifferentiableMetabolism.optimized_constraints_with_parametersMethod
optimized_constraints_with_parameters(
     m::ConstraintTrees.Tree{ConstraintTrees.Constraint},
     parameters::Dict{Symbolics.Num, Float64};
     modifications,
@@ -25,23 +25,23 @@
     optimizer,
     sense
 )
-

Solve a model, m, by forwarding arguments to optimization_model_with_parameters.

Optionally, set optimizer attributes with modifications. If the model does not solve successfully return nothing. Otherwise, return a tuple of the solution tree, and vectors containing the values of the primal variables, the equality constraint dual variables.

These duals are ordered according to the constraint output of calling equality_constraints and inequality_constraints respectively.

source

Pruning models

DifferentiableMetabolism.prune_gene_product_molar_massesMethod
prune_gene_product_molar_masses(
+

Solve a model, m, by forwarding arguments to optimization_model_with_parameters.

Optionally, set optimizer attributes with modifications. If the model does not solve successfully return nothing. Otherwise, return a tuple of the solution tree, and vectors containing the values of the primal variables, the equality constraint dual variables.

These duals are ordered according to the constraint output of calling equality_constraints and inequality_constraints respectively.

source

Pruning models

DifferentiableMetabolism.prune_modelMethod
prune_model(
     model,
     ec_solution,
     flux_zero_tol,
     gene_zero_tol
 ) -> AbstractFBCModels.CanonicalModel.Model
-

Prune away reactions, metabolites, and genes from a model using ec_solution, which is the result of an enzyme constrained kinetic simulation. Fluxes and gene product concentrations smaller than flux_zero_tol, gene_zero_tol are removed. Metabolites that do not take part in the remaining reactions are also removed.

source
DifferentiableMetabolism.prune_reaction_isozymesMethod
prune_reaction_isozymes(
+

Prune away reactions, metabolites, and genes from a model using ec_solution, which is the result of an enzyme constrained kinetic simulation. Fluxes and gene product concentrations smaller than flux_zero_tol, gene_zero_tol are removed. Metabolites that do not take part in the remaining reactions are also removed.

source

Differentiation

Differentiation

DifferentiableMetabolism.differentiateMethod
differentiate(
     m::ConstraintTrees.Tree{ConstraintTrees.Constraint},
     objective::ConstraintTrees.Value,
     x_vals::Vector{Float64},
@@ -51,29 +51,29 @@
     parameters::Vector{Symbolics.Num};
     scale
 ) -> Tuple{Any, Any}
-

Differentiate a model m with respect to parameters which take on values parameter_values in the optimal solution with respect to the objective. The primal variables x_vals, and the dual variable values eq_dual_vals and ineq_dual_vals need to be supplied.

Internally, primal variables with value abs(x) ≤ primal_zero_tol are removed from the computation, and their sensitivities are not calculated.

source

Internals

Constraint tree extensions

Optimization problem builders

DifferentiableMetabolism.equality_constraintsMethod
equality_constraints(
+

Differentiate a model m with respect to parameters which take on values parameter_values in the optimal solution with respect to the objective. The primal variables x_vals, and the dual variable values eq_dual_vals and ineq_dual_vals need to be supplied.

Internally, primal variables with value abs(x) ≤ primal_zero_tol are removed from the computation, and their sensitivities are not calculated.

source

Internals

Constraint tree extensions

Optimization problem builders

DifferentiableMetabolism.equality_constraintsMethod
equality_constraints(
     m::ConstraintTrees.Tree{ConstraintTrees.Constraint}
 ) -> Vector{Tuple{Union{ConstraintTrees.LinearValue, ParameterLinearValue}, Symbolics.Num}}
-

Return all the equality constraints of m as a tuple ({Parameter}LinearValue, value) representing {P}LV == value for each entry.

source
DifferentiableMetabolism.inequality_constraintsMethod
inequality_constraints(
     m::ConstraintTrees.Tree{ConstraintTrees.Constraint}
 ) -> Vector
-

Return all the inequality constraints of m as a tuple of bounds converted to the form ({Parameter}LinearValue, upper) representing {P}LV ≤ upper for each entry.

source

Symbolics extensions

+

Return all the inequality constraints of m as a tuple of bounds converted to the form ({Parameter}LinearValue, upper) representing {P}LV ≤ upper for each entry.

source

Symbolics extensions