thermoFBA

addLoopLawConstraints(LPproblem, model, rxnIndex, method, reduce_vars)[source]

Adds loop law constraints to LP problem or MILP problem.

Usage

[MILPproblem] = addLoopLawConstraints(LPproblem, model, rxnIndex)

Inputs

  • LPproblem – Structure containing the following fields:
    • A - LHS matrix
    • b - RHS vector
    • c - Objective coeff vector
    • lb - Lower bound vector
    • ub - Upper bound vector
    • osense - Objective sense (-1 max, +1 min)
    • csense - Constraint senses, a string containting the constraint sense for each row in A (‘E’, equality, ‘G’ greater than, ‘L’ less than).
    • F - (optional) If *QP problem
    • vartype - (optional) if MI*P problem
  • model – The model for which the loops should be removed

Optional inputs

  • rxnIndex – The index of variables in LPproblem corresponding to fluxes. Default = [1:n]
  • method – Indicator which method to use: * 1 - Two variables for each reaction af, ar * 2 - One variable for each reaction af (default)
  • reduce_vars – eliminates additional integer variables. Should be faster in all cases but in practice may not be for some weird reason (default : true).

Output

  • MILPproblem – Problem structure containing the following fields describing an MILP problem:
    • A, b, c, lb, ub - same as before but longer
    • vartype - variable type of the MILP problem (‘C’, and ‘B’)
    • x0 = [] - Needed for solveMILPproblem
checkThermodynamicConsistency(model, q)[source]

Usage

v = checkThermodynamicConsistency(model, q)

Inputs

  • model
  • q

Output

  • v
consistentPotentials(model, printLevel)[source]

Find a consistent set of potentials for each metabolite in a biochemical network, given the directions specified by the bounds on each reaction i.e. find y0, such that \(S^T y_0 < 0\) for a forward reaction and the opposite for reverse.

Usage

y0 = consistentPotentials(model, printLevel)

Inputs

  • model – structure with fields:
    • .S
    • .lb
    • .ub
  • printLevel – verbose level

Output

  • y0 – consistent set of chemical potentials
cycleFreeFlux(V0, C, model, isInternalRxn, relaxBounds, parallelize)[source]

Removes stoichiometrically balanced cycles from FBA solutions when possible.

A Matlab implementation of the CycleFreeFlux algorithm from Desouki et al., 2015. Minimises the one norm of fluxes subject to bounds determined by input flux.

Usage

V1 = cycleFreeFlux(V0, C, model, isInternalRxn, relaxBounds);

Inputs

  • V0n x k matrix of k FBA solutions
  • Cn x k matrix of k FBA objectives
  • model – COBRA model structure with required fields:
    • .S - m x n stoichiometric matrix
    • .b - m x 1 RHS vector
    • .lb - n x 1 lower bound vector
    • .ub - n x 1 lower bound vector

Optional inputs

  • isInternalRxnn x 1 logical array. True for internal reactions.
  • relaxBounds – Relax bounds that don’t include zero. Default is false.
  • parallelize – Turn parfor use on or off. Default is true if k > 12.

Output

  • V1n x k matrix of cycle free flux vectors

Example

% Remove cycles from a single flux vector
solution = optimizeCbModel(model);
v1 = cycleFreeFlux(solution.v, model.c, model);

% Remove cycles from multiple flux vectors
[minFlux, maxFlux, Vmin, Vmax] = fluxVariability(model, 0, 'max', model.rxns, 0, 1, 'FBA');
V0 = [Vmin, Vmax];
n = size(model.S, 2);
C = [eye(n), eye(n)];
V1 = cycleFreeFlux(V0, C, model);
metaboliteMassBalancePlot(model, metAbbr, solution, N)[source]

Plots the top N reactions producing and consuming a metabolite in a flux solution

Usage

metaboliteMassBalancePlot(model, metAbbr, solution, N)

Inputs

  • model – COBRA model structure
  • metAbbr – metabolite abbreviation
  • solutionsolveCobraLP output of a solution to FBA problem
  • N – Number of reactions to include for production/consumption
printDirectionalityFromBounds(model, lb, ub)[source]

Prints the directionality for each reaction depending on the bounds for each reaction. Defaults to using model.lb & model.ub if none provided

Usage

directionality = printDirectionalityFromBounds(model, lb, ub)

Input

  • model – COBRA model structure

Optional inputs

  • lb – flux lower bounds
  • ub – flux upper bounds

Output

  • directionalityn x 1 cell array of strings with directionality for each reaction