Optcardthermo¶
- checkThermoFeasibility(model, solution, thermoConsistencyMethod, param)[source]¶
Check which internal reactions of a flux vector are thermodynamically feasible
- USAGE:
[thermoConsistentFluxBool, solutionConsistency] = checkThermoFeasibility (model, solution, thermoConsistencyMethod, param)
- INPUTS:
model – COBRA model structure with fields:
.S - m x n stoichiometric matrix
.c - n x 1 linear objective coefficients
.SConsistentRxnBool - n x 1 boolean of stoichiometrically consistent reactions
solution – flux solution structure with fields:
.stat - solver status (the function returns early unless .stat is 1)
.v - n x nlt flux vectors
.g - n x 1 reaction gradients (used by the ‘signProduct’ method)
.thermoConsistentFluxBool - optional precomputed consistency boolean (skips the check)
- OPTIONAL INPUTS:
thermoConsistencyMethod – consistency test method: ‘cycleFreeFlux’ (default), ‘signProduct’, ‘cardOpt’ or ‘v2QNty’
param – structure of parameters with fields:
.eta - minimum flux value considered nonzero (default feasTol)
.epsilon - minimum flux value considered nonzero for the cardinality method (default feasTol)
.thermoConsistency - ‘biochemically’ (default) or ‘chemically’
.relaxBounds - boolean, relax bounds (default 0)
.debug - boolean, print or save debugging information (default 0)
.parallelize - boolean, parallelise cycleFreeFlux (set to 0)
.printLevel - verbosity level (default 0)
.theta - Capped-L1 approximation parameter (default 0.5)
.warmStartMethod - warm start method for optimizeCardinality (default ‘random’)
.condenseW - boolean, condense the W block (default 0)
.condenseT - boolean, condense the T block (default 0)
- OUTPUTS:
thermoConsistentFluxBool – n x 1 boolean, true for thermodynamically consistent internal fluxes
solutionConsistency – solution structure returned by the thermodynamic consistency check, with fields including:
.vThermo: ‘n x 1’ repaired thermodynamically consistent flux
- optCardThermo(model, param)[source]¶
Finds a thermodynamically feasible net flux biased toward presence/absence of metabolites and activity/inactivity of certain reactions by solving the following optimisation problem
min beta*g1.*(p + q) + g0.*|z|_0 + h0(-ve).*|s|_0 + h0(+ve).*|s|_0 + c*[z;w]
- s.t. N*z + B*w = b
- C*z + D*w <= d (optionally)
z - p + q = 0
A(p + q) - s = 0 Az - r = 0 lb <= [z;w] <= ub 0 <= p 0 <= q
- where [N, B] := model.S;
A := F + R, F := -min(N,0) R : = max(N,0)
- USAGE:
solution = optCardThermo (model, param)
- INPUT:
model – COBRA model structure. Required fields:
.S - m x n stoichiometric matrix
.c - n x 1 linear objective coefficients
.lb - n x 1 lower bounds on reaction rate
.ub - n x 1 upper bounds on reaction rate
- OPTIONAL INPUTS:
model – (optional fields) * .SConsistentRxnBool - ‘m x 1’ boolean vector indicating stoichiometrically consistent reactions * .b - m x 1 change in concentration with time * .csense - m x 1 character array with entries in {L,E,G} * .osenseStr - Maximize (‘max’)/minimize (‘min’)
(opt, default = ‘max’) only affects the interpretation of linear part of the objective (from model.c).
.C - k x n Left hand side of C*v <= d
.d - k x n Right hand side of C*v <= d
.dsense - k x 1 character array with entries in {L,E,G}
.h0 - m x 1, local weight on zero norm of rate of production of each metabolite by internal reactions.
.g0 - n x 1 , local weight on zero norm of the net flux of each reaction
.g1 - n x 1 , local weight on one norm of the net flux of each reaction
- .presentMet - m x 1 boolean vector indicating metabolites
that must be produced by internal reactions in the submodel
- .absentMet - m x 1 boolean vector indicating metabolites
that must be produced by internal reactions in the submodel
.activeRxn - n x 1 boolean vector indicating reactions that must be active in the submodel
.inactiveRxn - n x 1 boolean vector indicating reactions that must be active in the submodel
.lambda0 - trade-off parameter on minimise ||x||_0
.lambda1 - trade-off parameter on minimise ||x||_1
.delta0 - trade-off parameter on maximise ||y||_0
.delta1 - trade-off parameter on minimise `||y||_1’
.beta - trade-off parameter on minimise `||p||_1’ + `||q||_1’, increase to incentivise thermodynamic feasibility
.alpha1 - global weight on the one-norm of the cardinality-free variables
.lbr - m x 1 lower bounds on the rate of production by internal reactions
.SConsistentMetBool - m x 1 boolean of stoichiometrically consistent metabolites
.SIntMetBool - m x 1 boolean of internal metabolites (from findSExRxnInd)
.SIntRxnBool - n x 1 boolean of internal reactions (from findSExRxnInd)
.fluxConsistentMetBool - m x 1 boolean of flux consistent metabolites (computed if absent)
.fluxConsistentRxnBool - n x 1 boolean of flux consistent reactions (computed if absent)
.thermoFluxConsistentRxnBool - n x 1 boolean of thermodynamically flux consistent reactions
.dummyMetBool - m x 1 boolean of dummy metabolites