Directionalityreport

analyseThermoConstrainedModel(model, cumNormProbCutoff, printLevel, resultsBaseFileName)[source]

Analyse a thermodynamically constrained model: compute directionality statistics, report directionality changes, and optionally generate directionality figures.

USAGE:

[out] = analyseThermoConstrainedModel (model, cumNormProbCutoff, printLevel, resultsBaseFileName)

INPUTS:
  • model – structure with fields:

    • .DfGt0 - m x 1 array of estimated standard transformed Gibbs energies of formation.

    • .DrGt0 - n x 1 array of estimated standard transformed reaction Gibbs energies.

    • .DfGtMin - m x 1 array of estimated lower bounds on transformed Gibbs energies of formation.

    • .DfGtMax - m x 1 array of estimated upper bounds on transformed Gibbs energies of formation.

    • .DrGtMin - n x 1 array of estimated lower bounds on transformed reaction Gibbs energies.

    • .DrGtMax - n x 1 array of estimated upper bounds on transformed reaction Gibbs energies.

    • .quantDir - n x 1 array indicating quantitatively assigned reaction directionality. 1 for reactions that are irreversible in the forward direction, -1 for reactions that are irreversible in the reverse direction, and 0 for reversible reactions.

    • .transportRxnBool - n x 1 boolean, true for transport reactions

    • .directions - structure of boolean directionality-assignment vectors (populated by directionalityStats)

  • cumNormProbCutoff – default = 0.2

  • printLevel – verbose level, default = 1

  • resultsBaseFileName

OUTPUT:

out

assignQualDir(model)[source]

Assigns a qualitative direction to each reaction based on the upper and lower bounds

USAGE:

model = assignQualDir (model)

INPUTS:

model – structure with fields:

  • .S - m x n stoichiometric matrix

  • .lb - n x 1 lower flux bounds

  • .ub - n x 1 upper flux bounds

OUTPUTS:

model – structure with added field:

  • .qualDir - n x 1 qualitative directionality assignment: 1 for reactions that are irreversible in the forward direction, -1 for reactions that are irreversible in the reverse direction, 0 for reversible reactions

compareQualAndQuantDir(model)[source]

Cross-tabulate qualitative versus quantitative reaction directionality

Builds a 4-by-4 cell contingency table counting reactions by their qualitative (model.qualDir) and quantitative (model.quantDir) directionality assignments (forward, reversible, reverse).

USAGE:

A = compareQualAndQuantDir (model)

INPUT:

model – structure with fields:

  • .qualDir - n x 1 qualitative directionality assignment (1 forward, 0 reversible, -1 reverse)

  • .quantDir - n x 1 quantitative directionality assignment (1 forward, 0 reversible, -1 reverse)

OUTPUT:

A4 x 4 cell array cross-tabulating qualitative (rows) versus quantitative (columns) directionality counts, with row and column labels in the first column and row

directionalityChangeReport(model, directions, cumNormProbCutoff, printLevel, resultsBaseFileName)[source]

Checks for changes to reconstruction reaction direction to thermodynamically constrained model direction .

Checks to see which metabolites are involved in reactions that change the reconstruction directionality then print out the reactions that these metabolites are involved in. Does not include reactions that cannot be assigned reaction directionality due to missing thermodynamic data for certain metabolites involved in that reaction.

USAGE:

directionalityChangeReport (model, directions, cumNormProbCutoff, printLevel, resultsBaseFileName)

INPUTS:
  • model – COBRA model structure with fields:

    • .S - m x n stoichiometric matrix

    • .mets - m x 1 cell array of metabolite identifiers

    • .rxns - n x 1 cell array of reaction identifiers

    • .gasConstant - gas constant used in thermodynamic calculations

    • .T - temperature (K)

  • directions – a structue of boolean vectors with different directionality assignments where some vectors contain subsets of others

    qualtiative -> quantiative changed reaction directions

    • .forward2Forward

    • .forward2Reverse

    • .forward2Reversible

    • .forward2Uncertain

    • .reversible2Forward

    • .reversible2Reverse

    • .reversible2Reversible

    • .reversible2Uncertain

    • .reverse2Forward

    • .reverse2Reverse

    • .reverse2Reversible

    • .reverse2Uncertain

    • .tightened

    subsets of qualtiatively forward -> quantiatively reversible

    • .forward2Reversible_bydGt0

    • .forward2Reversible_bydGt0LHS

    • .forward2Reversible_bydGt0Mid

    • .forward2Reversible_bydGt0RHS

    • .forward2Reversible_byConc_zero_fixed_DrG0

    • .forward2Reversible_byConc_negative_fixed_DrG0

    • .forward2Reversible_byConc_positive_fixed_DrG0

    • .forward2Reversible_byConc_negative_uncertain_DrG0

    • .forward2Reversible_byConc_positive_uncertain_DrG0

  • cumNormProbCutoff – {0.2} cutoff for probablity that reaction is reversible within this cutoff of 0.5

  • printLevel – verbose level

  • resultsBaseFileName

directionalityCheckAll[source]

Script placeholder for running all reaction directionality checks (currently no executable content).

directionalityStats(model, directions, cumNormProbCutoff, printLevel)[source]

Build Boolean vectors with reaction directionality statistics

USAGE:

[model, directions] = directionalityStats (model, directions, cumNormProbCutoff, printLevel)

INPUTS:
  • model – COBRA model structure with fields:

    • .S - m x n stoichiometric matrix

    • .lb - n x 1 lower flux bounds

    • .ub - n x 1 upper flux bounds

    • .lb_reconThermo - n x 1 reconstruction lower bounds tightened by thermodynamics

    • .ub_reconThermo - n x 1 reconstruction upper bounds tightened by thermodynamics

    • .SIntRxnBool - n x 1 boolean, true for internal reactions

    • .DrGtMin - n x 1 lower bound on transformed reaction Gibbs energy

    • .DrGtMax - n x 1 upper bound on transformed reaction Gibbs energy

    • .DrGt0Min - n x 1 lower bound on standard transformed reaction Gibbs energy

    • .DrGt0Max - n x 1 upper bound on standard transformed reaction Gibbs energy

  • directions

    structure with field:

    • .forwardProbability

    qualitatively assigned internal reaction direactions

    • .forwardRecon

    • .reverseRecon

    • .reversibleRecon

    • .equilibriumRecon

    quantitatively assigned internal reaction direactions thermodynamic data is lacking

    • .forwardThermo

    • .reverseThermo

    • .reversibleThermo

    • .uncertainThermo

    • .equilibriumThermo

OPTIONAL INPUT
cumNormProbCutoff: {0.2} cutoff for probablity that reaction is

reversible within this cutoff of 0.5

printLevel: -1 to print out to file,

0 to silent, 1 to print out to command window

OUTPUTS:
  • model – the input COBRA model structure, returned unchanged

  • directions – a structue of boolean vectors with different directionality assignments where some vectors contain subsets of others

    • .cumNormProbCutoff - probability cutoff used for directionality assignment

    qualtiative -> quantiative changed reaction directions

    • .forward2Forward

    • .forward2Reverse

    • .forward2Reversible

    • .forward2Uncertain

    • .reversible2Forward

    • .reversible2Reverse

    • .reversible2Reversible

    • .reversible2Uncertain

    • .reverse2Forward

    • .reverse2Reverse

    • .reverse2Reversible

    • .reverse2Uncertain

    • .tightened

    subsets of qualtiatively forward -> quantiatively reversible

    • .forward2Reversible_bydGt0

    • .forward2Reversible_bydGt0LHS

    • .forward2Reversible_bydGt0Mid

    • .forward2Reversible_bydGt0RHS

    • .forward2Reversible_byConc_zero_fixed_DrG0

    • .forward2Reversible_byConc_negative_fixed_DrG0

    • .forward2Reversible_byConc_positive_fixed_DrG0

    • .forward2Reversible_byConc_negative_uncertain_DrG0

    • .forward2Reversible_byConc_positive_uncertain_DrG0

directionalityStatsFigures(directions, resultsBaseFileName, saveFigures)[source]

Creates pie charts of directionality stats

USAGE:

directionalityStatsFigures (directions, resultsBaseFileName, saveFigures)

INPUT:
  • directions – a structue of boolean vectors with different directionality assignments where some vectors contain subsets of others

    qualitatively assigned directions:

    • directions.forwardRecon

    • directions.reverseRecon

    • directions.reversibleRecon

    • directions.equilibriumRecon

    qualitatively assigned directions using thermo in preference to qualitative assignments but using qualitative assignments where thermodynamic data is lacking

    • directions.forwardThermo

    • directions.reverseThermo

    • directions.reversibleThermo

    • directions.uncertainThermo

    • directions.equilibriumThermo

    qualtiative -> quantiative changed reaction directions

    • directions.forward2Forward

    • directions.forward2Reverse

    • directions.forward2Reversible

    • directions.forward2Uncertain

    • directions.reversible2Forward

    • directions.reversible2Reverse

    • directions.reversible2Reversible

    • directions.reversible2Uncertain

    • directions.reverse2Forward

    • directions.reverse2Reverse

    • directions.reverse2Reversible

    • directions.reverse2Uncertain

    subsets of forward qualtiative -> reversible quantiative change

    • directions.forward2Reversible_bydGt0

    • directions.forward2Reversible_bydGt0LHS

    • directions.forward2Reversible_bydGt0Mid

    • directions.forward2Reversible_bydGt0RHS

    • directions.forward2Reversible_byConc_zero_fixed_DrG0

    • directions.forward2Reversible_byConc_negative_fixed_DrG0

    • directions.forward2Reversible_byConc_positive_fixed_DrG0

    • directions.forward2Reversible_byConc_negative_uncertain_DrG0

    • directions.forward2Reversible_byConc_positive_uncertain_DrG0

  • resultsBaseFileName

  • saveFigures

forwardProbablyReverseFigures(model, miliMolarStandard)[source]

Figure of qualitatively forward reactions that are probably quantiatively reverse. creates a vertical errorbar figure of the qualitatively forward reactions that end up being probably quantiatively reverse by at least one metabolite group contribution estimate

USAGE:

forwardProbablyReverseFigures (model,m iliMolarStandard)

INPUTS:
  • model – structure with field:

    • .directions (subsets of forward qualtiative -> probably quantiative reverse):

      • .forwardReversible_bydGt0RHS

      • .forwardReversible_byConc_positive_fixed_DrG0

      • .forwardReversible_byConc_positive_uncertain_DrG0

    • .S - m x n stoichiometric matrix

    • .dGt0Min - n x 1 lower bound on standard transformed reaction Gibbs energy

    • .dGt0Max - n x 1 upper bound on standard transformed reaction Gibbs energy

    • .dGtMin - n x 1 lower bound on transformed reaction Gibbs energy

    • .dGtMax - n x 1 upper bound on transformed reaction Gibbs energy

    • .DrGt0Min - n x 1 lower bound on standard transformed reaction Gibbs energy

    • .DrGt0Max - n x 1 upper bound on standard transformed reaction Gibbs energy

    • .DrGt0Mean - n x 1 mean standard transformed reaction Gibbs energy

    • .DrGtMin - n x 1 lower bound on transformed reaction Gibbs energy

    • .DrGtMax - n x 1 upper bound on transformed reaction Gibbs energy

    • .DrGtMean - n x 1 mean transformed reaction Gibbs energy

  • miliMolarStandard

forwardReversibleFigures(model, directions, confidenceLevel)[source]

Figures of different classes of reactions: qualitatively forward -> quantitatively reversible

USAGE:

forwardReversibleFigures (model, directions, confidenceLevel)

INPUTS:
  • model – structure with fields:

    • .S - m x n stoichiometric matrix

    • .rxns - n x 1 cell array of reaction identifiers

    • .SIntRxnBool - n x 1 boolean, true for internal reactions

    • .DrGt0 - n x 1 standard transformed reaction Gibbs energy

    • .DrGt0Min - n x 1 lower bound on standard transformed reaction Gibbs energy

    • .DrGt0Max - n x 1 upper bound on standard transformed reaction Gibbs energy

    • .DrGtMin - n x 1 lower bound on transformed reaction Gibbs energy

    • .DrGtMax - n x 1 upper bound on transformed reaction Gibbs energy

    • .DrGtMean - n x 1 mean transformed reaction Gibbs energy

    • .DrG0_Uncertainty - n x 1 uncertainty in standard reaction Gibbs energy

    • .directions - structure of directionality-assignment vectors

  • directions – structure of subsets of qualitatively forward -> quantitatively reversible reactions, with fields:

    • .forward2Reversible - reactions reassigned from forward to reversible

    • .forward2Reversible_bydGt0 - reassigned by the sign of standard transformed reaction Gibbs energy

    • .forward2Reversible_bydGt0LHS - reassigned, standard Gibbs energy range on the negative side

    • .forward2Reversible_bydGt0Mid - reassigned, standard Gibbs energy range spanning zero

    • .forward2Reversible_bydGt0RHS - reassigned, standard Gibbs energy range on the positive side

    • .forward2Reversible_byConc_negative_fixed_DrG0 - reassigned by concentration, negative fixed standard Gibbs energy

    • .forward2Reversible_byConc_positive_fixed_DrG0 - reassigned by concentration, positive fixed standard Gibbs energy

    • .forward2Reversible_byConc_negative_uncertain_DrG0 - reassigned by concentration, negative uncertain standard Gibbs energy

    • .forward2Reversible_byConc_positive_uncertain_DrG0 - reassigned by concentration, positive uncertain standard Gibbs energy

    • .forwardProbability - n x 1 probability that each reaction proceeds forward

  • confidenceLevel – default = 0.95

forwardTransportQuantReverseFigures(model)[source]

Figure of the qualitatively forward transport reactions that are quantitatively reversible. Creates a vertical errorbar figure of the qualitatively forward transport reactions that are quantitatively reversible, whether from group contribution or Keq, that then need to be assigned to be forward, to limit the growth rate i.e. abc transporters or reactions involving protons.

USAGE:

forwardTransportQuantReverseFigures (model)

INPUT:

model – structure with fields:

  • .S - m x n stoichiometric matrix

  • .rxns - n x 1 cell array of reaction identifiers

  • .rxnNames - n x 1 cell array of reaction names

  • .DrGtMin - n x 1 lower bound on transformed reaction Gibbs energy

  • .DrGtMax - n x 1 upper bound on transformed reaction Gibbs energy

  • .DrGtMean - n x 1 mean transformed reaction Gibbs energy

  • .DrGt0Min - n x 1 lower bound on standard transformed reaction Gibbs energy

  • .DrGt0Max - n x 1 upper bound on standard transformed reaction Gibbs energy

  • .DrGt0Mean - n x 1 mean standard transformed reaction Gibbs energy

  • .DrdGtMin - n x 1 lower bound on transformed reaction Gibbs energy (as referenced in the code)

  • .directions - structure of directionality-assignment vectors, including .forwardReversible

generateThermodynamicTables(model, resultsBaseFileName)[source]

Generate tab delimited tables detailing the thermodynamic estimates generated for a model

USAGE:

generateThermodynamicTables (model, resultsBaseFileName)

INPUTS:
  • model – structure with fields:

    • .compartments - compartment identifiers

    • .ph - compartment pH

    • .is - compartment ionic strength (mol/L)

    • .chi - compartment electrical potential (mV)

    • .T - temperature (K)

    • .rxns - n x 1 cell array of reaction identifiers

    • .mets - m x 1 cell array of metabolite identifiers

    • .DrG0 - n x 1 standard reaction Gibbs energy

    • .DrG0_Uncertainty - n x 1 uncertainty in standard reaction Gibbs energy

    • .DrGt0 - n x 1 standard transformed reaction Gibbs energy

    • .DrGtMin - n x 1 lower bound on transformed reaction Gibbs energy

    • .DrGtMax - n x 1 upper bound on transformed reaction Gibbs energy

    • .DfG0 - m x 1 standard Gibbs energy of formation

    • .DfG0_Uncertainty - m x 1 uncertainty in standard Gibbs energy of formation

    • .DfGt0 - m x 1 standard transformed Gibbs energy of formation

    • .DfGtMin - m x 1 lower bound on transformed Gibbs energy of formation

    • .DfGtMax - m x 1 upper bound on transformed Gibbs energy of formation

    • .concMin - m x 1 lower bound on metabolite concentration

    • .concMax - m x 1 upper bound on metabolite concentration

  • resultsBaseFileName – default = ‘out’

plotFeasibleReactionEnergyRanges(modelT)[source]

Plots feasible dGr0’ and dGr’ for all reactions with quantitatively determined reaction energies

USAGE:

plotFeasibleReactionEnergyRanges (modelT)

INPUT:

modelT – thermodynamically constrained model structure with fields:

  • .rxns - n x 1 cell array of reaction identifiers

  • .DrGtMin - n x 1 lower bound on transformed reaction Gibbs energy

  • .DrGtMax - n x 1 upper bound on transformed reaction Gibbs energy

qualitativeVSquantitativeChangesTable[source]

Example of a script that can be used to set up different thermodynamic models depending on the pH temp etc

singleMetaboliteThermoFigure(model, miliMolarStandard, metAbbr)[source]

Creates a vertical errorbar figure of the reactions involving the metabolite given by the abbreviation

USAGE:

singleMetaboliteThermoFigure (model, miliMolarStandard, metAbbr)

INPUTS:
  • model – structure with fields:

    • .S - m x n stoichiometric matrix

    • .dGt0Min - n x 1 lower bound on standard transformed reaction Gibbs energy

    • .dGt0Max - n x 1 upper bound on standard transformed reaction Gibbs energy

    • .dGtMin - n x 1 lower bound on transformed reaction Gibbs energy

    • .dGtMax - n x 1 upper bound on transformed reaction Gibbs energy

  • miliMolarStandard

  • metAbbr

standardGibbsFormationEnergyStats(modelT, figures)[source]

Generate the stats +/- pie chart on the provinence of the metabolite standard Gibbs energies.

USAGE:

[nKeq, nGC, nNone] = standardGibbsFormationEnergyStats (modelT, figures)

INPUTS:
  • modelT – thermodynamically constrained model structure with fields:

    • .S - m x n stoichiometric matrix

    • .mets - m x 1 cell array of metabolite identifiers

  • figures – if non-zero, generate the summary pie chart

OUTPUTS:
  • nKeq – number of metabolites with standard Gibbs energy from Keq data

  • nGC – number of metabolites with standard Gibbs energy from group contribution

  • nNone – number of metabolites with no standard Gibbs energy estimate

writeReactionListThermo(model, FileName, start, stop)[source]

Exports a list of reactions and bounds to a text file

USAGE:

writeReactionListThermo (model, FileName, start, stop)

INPUT:
  • model – model structure with field:

    • .rxns - n x 1 cell array of reaction identifiers

  • FileName – Name of output file

OPTIONAL INPUTS:
  • start – integer index of first reaction index to write out

  • stop – integer index of last reaction index to write out