Biomass#
MATLAB functions in RAVEN/src/biomass of the RAVEN toolbox.
Functions#
Function |
Summary |
|---|---|
Fit stoichiometric parameters such as maintenance ATP to measured data. |
|
Compute mass fraction per biomass component. |
|
Rescale a biomass component to a target value. |
|
Rescale a biomass component pseudoreaction. |
|
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 with the xRxns bounds fixed to the values in xValues. The fitted parameters are returned as absolute values.
The function derives a value from measurements. To apply a known growth-associated maintenance value to a biomass pseudoreaction, use setGAM.
Parameters
model: structa model structure.
xRxns: cellcell array with the IDs of the reactions that will be fixed for each data point.
xValues: doublematrix with the corresponding values for each xRxns (columns are reactions).
rxnsToFit: cellcell array with the IDs of reactions that will be fitted to.
valuesToFit: doublematrix with the corresponding values for each rxnsToFit (columns are reactions).
parameterPositions: structstructure 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 is set to the negative of the fitted value (to distinguish production from consumption)
Name-Value Arguments
fitToRatio: logicaltrue to fit the ratio of simulated to measured values, false to fit the absolute difference. The ratio limits the influence of large fluxes on the residual sum of squares (default true).
initialGuess: doubleinitial guess of the parameters (default ones).
plotFitting: logicaltrue to plot the measured values and the fitted fluxes against xValues (default false).
Returns
parameters: doublefitted parameters (absolute values) in the same order as in parameterPositions.
fitnessScore: doublethe corresponding residual sum of squares.
exitFlag: doubleexit status returned by fminsearch.
newModel: structupdated model structure with the fitted parameters. It is assigned only when plotFitting is true.
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). A component contributes 0 when its pseudoreaction is missing from the model or has no substrates. For a component whose pseudoreaction exists and has substrates, and whose mass_strategy is not 'grams', an error is raised when the molecular weight of a substrate is 0 (an empty metFormula field, or a formula that consists only of R), when its formula contains an element outside the built-in element table, or when mass_strategy is unknown. A component with an unknown mass_strategy whose pseudoreaction is missing or has no substrates contributes 0 without an error.
Parameters
model: structRAVEN model struct.
biomassConfig: structStruct describing the biomass layout, with fields:
biomass_rxn : rxn id of the top-level biomass pseudoreaction.
proton_met : met id of cytosolic H+ (used by scaleBiomassPseudoreaction, not by getBiomassFractions).
components : cell array of component structs, each with fields:
name : component name (for example 'protein').
pseudoreaction_name : model.rxnNames entry to identify the pseudoreaction.
mass_strategy : 'mw', 'mw_minus_2h', 'mw_minus_water' or 'grams' (see Notes).
Returns
fractions: structStruct with one field per component name and a field 'total' (for example fractions.protein and fractions.RNA). 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 and DNA)
'grams' stoichiometry is 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: structRAVEN model struct.
biomassConfig: structBiomass layout struct, as described in getBiomassFractions.
componentName: charName of the component to rescale. An error is raised if its current fraction is 0.
newValue: doubleTarget fraction in g/gDW.
Name-Value Arguments
balanceOut: charSecond component name to adjust so the biomass total becomes targetTotal. An error is raised if its fraction would become zero or negative, or if it is 0 to begin with. No balancing is done when empty or omitted (default '').
targetTotal: doubleBiomass total in g/gDW that balanceOut brings the components to (default 1).
Returns
model: structModel with the rescaled pseudoreactions.
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 differs from the component name; the coefficient of the component's product is unchanged. After rescaling, the coefficient of biomassConfig.proton_met is recomputed so that the total charge of the pseudoreaction is zero. An error is raised if the model has no metCharges field or if a metabolite other than proton_met in the pseudoreaction has an undefined (NaN) charge.
Parameters
model: structRAVEN model struct.
biomassConfig: structStruct (see getBiomassFractions).
componentName: charName of the component to rescale. It must match biomassConfig.components{i}.name for some i and the model.metNames entry of the produced metabolite in the matching pseudoreaction.
factor: doubleFactor by which the substrate coefficients are multiplied.
Returns
model: structModified 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 with the sign of the current coefficient. An error is raised before the model is changed if ngamRxn is given and is not in the model, and if ngamValue is given without ngamRxn (RAVEN:badInput). For yeast-GEM, the cofactors are ATP, ADP, H2O, H+ and phosphate (ATP and H2O are substrates; ADP, H+ and phosphate are products).
Parameters
model: structRAVEN model struct.
value: doubleNew GAM value (mmol ATP / gDW per growth unit).
biomassRxn: charReaction id of the biomass pseudoreaction.
cofactorMetNames: cellCell array of metabolite names (matched against model.metNames, not metabolite ids) to rescale, for example {'ATP','ADP','H2O','H+','phosphate'}.
Name-Value Arguments
ngamRxn: charNGAM reaction id. Required when ngamValue is supplied.
ngamValue: doubleNGAM flux to fix. Both bounds of the NGAM reaction are set to ngamValue.
Returns
model: structModified model.
Examples
model = setGAM(model, 80, 'r_4041', {'ATP','ADP','H2O','H+','phosphate'});
See also
fitParameters : derives such a value from measured fluxes; setGAM then applies it.