Biomass#

MATLAB functions in RAVEN/src/biomass of the RAVEN toolbox.

Functions#

Function

Summary

fitParameters

Fit stoichiometric parameters such as maintenance ATP to measured data.

getBiomassFractions

Compute mass fraction per biomass component.

scaleBiomassFraction

Rescale a biomass component to a target value.

scaleBiomassPseudoreaction

Rescale a biomass component pseudoreaction.

setGAM

Set the growth-associated maintenance (GAM) coefficient.

Reference#

fitParameters#

function [parameters, fitnessScore, exitFlag, newModel]=fitParameters(model,xRxns,xValues,rxnsToFit,valuesToFit,parameterPositions,varargin)

Fit stoichiometric parameters such as maintenance ATP to measured data.

Searches for the parameter values that minimise the residual sum of squares between the fluxes the model predicts and the measured ones, using fminsearch (Nelder-Mead). Each candidate parameter set is written into the S matrix at the positions given by parameterPositions, and the model is solved once per data point.

Use this to derive a value from measurements; use setGAM to apply a known growth-associated maintenance value to a biomass pseudoreaction.

Parameters

model : struct

a model structure.

xRxns : cell

cell array with the IDs of the reactions that will be fixed for each data point.

xValues : double

matrix with the corresponding values for each xRxns (columns are reactions).

rxnsToFit : cell

cell array with the IDs of reactions that will be fitted to.

valuesToFit : double

matrix with the corresponding values for each rxnsToFit (columns are reactions).

parameterPositions : struct

structure that determines where the parameters are in the stoichiometric matrix, with fields:

  • position : cell array of vectors where each element contains the positions in the S-matrix for that parameter

  • isNegative : cell array of vectors where the elements are true if that position should be the negative of the fitted value (to differentiate between production/consumption)

Name-Value Arguments

fitToRatio : logical

if the ratio of simulated to measured values should be fitted instead of the absolute value. Used to prevent large fluxes from having too large an impact (default true).

initialGuess : double

initial guess of the parameters (default ones).

plotFitting : logical

true if the resulting fitting should be plotted (default false).

Returns

parameters : double

fitted parameters in the same order as in parameterPositions.

fitnessScore : double

the corresponding residual sum of squares.

exitFlag : double

exit status returned by fminsearch.

newModel : struct

updated model structure with the fitted parameters.

Examples

[parameters, fitnessScore, exitFlag, newModel]=fitParameters(model,...
    xRxns,xValues,rxnsToFit,valuesToFit,parameterPositions,fitToRatio,...
    initialGuess,plotFitting);

getBiomassFractions#

function fractions = getBiomassFractions(model, biomassConfig)

Compute mass fraction per biomass component.

Compute the mass fraction (g/gDW) per biomass component plus the total. The MATLAB counterpart of yeast-GEM's legacy sumBioMass.

The biomassConfig struct describes the per-organism biomass layout — see Parameters below. Components whose pseudoreaction is missing from the model contribute 0.

Parameters

model : struct

RAVEN model struct.

biomassConfig : struct

Struct describing the biomass layout, with fields:

  • biomass_rxn : rxn id of the top-level biomass pseudoreaction.

  • proton_met : met id of cytosolic H+ (used only by rescalePseudoreaction; may be unused here).

  • components : cell array of component structs, each with fields:

    • name : component name (e.g. 'protein').

    • pseudoreaction_name : model.rxnNames entry to identify the pseudoreaction.

    • mass_strategy : 'mw' | 'mw_minus_2h' | 'mw_minus_water' | 'grams' — see Notes below.

Returns

fractions : struct

Struct keyed by component name plus 'total': fractions.protein, fractions.RNA, ... etc. All values are in g/gDW.

Examples

fractions = getBiomassFractions(model, biomassConfig);

Notes

mass_strategy values:

'mw'              MW from chemical formula
'mw_minus_2h'     MW − 2.016 g/mol (two protons released per charged
                  tRNA — protein-pseudoreaction substrates)
'mw_minus_water'  MW − 18.015 g/mol (water released per
                  polymerisation step — RNA / DNA)
'grams'           stoichiometry already in g/gDW (lipid backbone)

scaleBiomassFraction#

function model = scaleBiomassFraction(model, biomassConfig, componentName, newValue, varargin)

Rescale a biomass component to a target value.

Rescale a biomass component to a target g/gDW value, optionally rescaling a second component so that the biomass total becomes targetTotal (1 g/gDW by default), whatever the total was before. The MATLAB counterpart of yeast-GEM's legacy scaleBioMass.

Parameters

model : struct

RAVEN model struct.

biomassConfig : struct

Struct (see getBiomassFractions).

componentName : char

Component to rescale.

newValue : double

Target fraction in g/gDW.

Name-Value Arguments

balanceOut : char

Second component name to adjust so the biomass total becomes targetTotal. It must be large enough to absorb the change: an error is raised if its fraction would become zero or negative, or if it is 0 to begin with. Empty / omit to skip balancing.

targetTotal : double

Biomass total in g/gDW that balanceOut brings the components to (default 1).

Returns

model : struct

Modified model.

Examples

model = scaleBiomassFraction(model, biomassConfig, 'protein', 0.5, 'carbohydrate');
model = scaleBiomassFraction(model, biomassConfig, 'protein', 0.5, ...
    'balanceOut', 'carbohydrate', 'targetTotal', 0.95);

See also

getBiomassFractions

scaleBiomassPseudoreaction#

function model = scaleBiomassPseudoreaction(model, biomassConfig, componentName, factor)

Rescale a biomass component pseudoreaction.

Multiply the substrate coefficients of one biomass component pseudoreaction by factor and rebalance H+ to preserve charge neutrality. The MATLAB counterpart of yeast-GEM's legacy rescalePseudoReaction.

"Substrate" means every metabolite in the pseudoreaction whose metabolite name does NOT match the component name (the component's product is left untouched). After rescaling, the coefficient of biomassConfig.proton_met is recomputed so the pseudoreaction's total ionic charge sums to zero.

Parameters

model : struct

RAVEN model struct.

biomassConfig : struct

Struct (see getBiomassFractions).

componentName : char

Name of the component to rescale (must match biomassConfig.components{i}.name for some i, AND be the model.metNames of the produced metabolite in the matching pseudoreaction).

factor : double

Multiplicative factor.

Returns

model : struct

Modified model.

Examples

model = scaleBiomassPseudoreaction(model, biomassConfig, 'protein', 0.9);

See also

getBiomassFractions

setGAM#

function model = setGAM(model, value, biomassRxn, cofactorMetNames, varargin)

Set the growth-associated maintenance (GAM) coefficient.

Set the growth-associated maintenance (GAM) coefficient in the biomass pseudoreaction, and optionally fix the non-growth maintenance (NGAM) reaction's bounds. The MATLAB counterpart of yeast-GEM's legacy changeGAM.

For every metabolite in the biomass pseudoreaction whose model.metNames entry is in cofactorMetNames, the stoichiometric coefficient is set to ±value preserving the sign of the current coefficient. Yeast-GEM scales ATP, ADP, H2O, H+ and phosphate (with ATP and H2O on the substrate side, ADP / H+ / phosphate on the product side).

Parameters

model : struct

RAVEN model struct.

value : double

New GAM value (mmol ATP / gDW per growth unit).

biomassRxn : char

Reaction id of the biomass pseudoreaction.

cofactorMetNames : cell

Cell array of metabolite NAMES (not IDs) to rescale, e.g. {'ATP','ADP','H2O','H+','phosphate'}.

Name-Value Arguments

ngamRxn : char

NGAM reaction id. Required when ngamValue is supplied.

ngamValue : double

NGAM flux to fix. Sets the NGAM reaction's bounds to (ngamValue, ngamValue).

Returns

model : struct

Modified model.

Examples

model = setGAM(model, 80, 'r_4041', {'ATP','ADP','H2O','H+','phosphate'});

See also

fitParameters : estimates such a value from measured fluxes instead of applying a known one. The two are complementary - fit first, then set.