Nutrition_modelling_toolbox

addFoodRxns2HM(model, foodRxns)[source]

Takes a set of food reactions to a whole-body metabolic model

USAGE

Format: [model,entriesNotAdded] = addFoodRxns2HM(model,foodRxns) Example 1: [model,entriesNotAdded] = addFoodRxns2HM(model,’All Food’) Example 2: [model,entriesNotAdded] = addFoodRxns2HM(model,{‘Food_EX_AvocadoSalad[d]’,’Food_EX_BakerPotatoes[d]’})

compareDietPerformance(model, diets, rois, varargin)[source]

Function to check the effect of different diets on the possible flux range for specified reactions.

[dietPerformance] = compareDietPerformance(model, diets, rois, varargin)

Example: [dietPerformance] = compareDietPerformance(model, diets, rois, ‘optPercentage’, 0.95, ‘microbiotaExcretionBound’, 0.5)

INPUTS
  • model – COBRA model where the rois are present

  • diets – Cell array where each cell contains an cell array with The metabolite composition of the diet {‘met’, value}

  • rois – Cell array with reactions to investigate under different diets

OPTIONAL INPUTS
  • optPercentage – Integer, used in fluxVariability to indicate the percentage of the objective for which FVA is solved. Defaults to 99

  • microbiotaExretionBound – Integer, used to constrain both bounds of Excretion_EX_microbiota_LI_biomass. Defaults to 1

  • dietNames – Cell array with names for diets in that will be used in the output. Defaults to Diet1, Diet2 etcetc.

OUTPUT

dietPerformance – Table for each given diet, the min and max flux for each roi.

compareDiets(diet1, diet2, one2Two)[source]

Calculates the changes in metabolite flux composition between two diets. It also calculates unique metabolites in each diets. It defaults to calculating the differences in diet2 from diet1

[fluxChanges, uniqueDiet1, uniqueDiet2] = compareDiets(diet1,diet2,one2Two)

Example: compareDiets(diet1,diet2,false)

INPUTS
  • diet1 – A cell array with the first column the metabolite identifiers and the second with flux values as doubles or strings

  • diet2 – A cell array with the first column the metabolite identifiers and the second with flux values as doubles or strings

OPTIONAL INPUTS

one2Two – true(0) or false(1) to state if the default of calculating the differences in diet2 from diet1 should be used. If false(0) differences in diet1 from diet2 will be calculated.

OUTPUT
  • fluxChanges – Cell array with the first column the metabolite identifier and the second column the changed flux value

  • uniqueDiet1 – Cell array with unique metabolites in diet1 compared to diet2

  • uniqueDiet2 – Cell array with unique metabolites in diet2 compared to diet1

extractDietFromModel(model)[source]

This function analysis an VMH model and extracts the diet based on the lower bound constraints.

USAGE:

[foodMenu] = extractDietFromModel(model)

INPUT:

model: A human model (WBM)

OUTPUT:
foodMenu: A nx2 cell array containing n dietary metabolites and their

corresponding flux

Authors:

Bronson R. Weston, 2022

findViableDiet(model, targetString, varargin)[source]

Identifies changes to the diet that must be made for viability. If no solution is possible for viability, returns NaN.

[viableModel,pointsModel,pointsSln,dietChanges] = findViableDiet(model,targetString,varargin)

Example: findViableDiet(modelHM,’Diet_EX_’,’supplyScalar’,100,’lbValues’,-5)

INPUTS
  • model – COBRA model to make viable

  • targetString – String identifier for targeted reactions (e.g., ‘EX_’)

getDietComposition(input, graphOnOff, Title)[source]

This function takes a diet (or a model) and identifies the food macros

USAGE

[Macros,Categories] = getDietComposition (input)

INPUT

input – either a whole-body metabolic model or a diet

OPTIONAL INPUT

graphOnOff: set to ‘on’ if a pie chart figure is desired Title: set title of the pie chart

OUTPUT

dietComposition – A table containing the breakdown of the diet macros

AUTHORS

Bronson R. Weston 2021-2022

getDietEnergy(diet)[source]

Given a nx2 cell array of diet components and serving sizes, computes how many Calories are in the diet. Does not consider calories of metabolites

getMetaboliteFlux(diet)[source]

This function takes a diet consisting of food items and returns the associated flux of metabolites.

USAGE

[metFlux] = getMetaboliteFlux (diet)

INPUT

diet – an nx2 cell array consisting of n dietary/food components and their corresponding flux in grams (for food items) or mmol (for individual metabolites) per day.

OUTPUT

metFlux – returns an nx2 cell array containing a list of all n metabolites within the diet and the corresponding flux.

AUTHORS

Bronson R. Weston 2022

getMolFormulaVMH(metabolite, metaboliteTable)[source]

This function returns the molecular formula of a given vmh metabolite.

USAGE
  • 1) [molStr,molTable] = getMolFormulaVMH (metabolite)

  • 2) [molStr,molTable] = getMolFormulaVMH (metabolite,metaboliteTable)

INPUT

metabolite – a metabolite in the vmh database

OPTIONAL INPUT

metaboliteTable – a metabolite table containing all vmh metabolites. This optional input is recommended if the function is run repetitively in a loop to eliminate readtable time.

OUTPUT
  • molStr – a string containing the molecular formula of the metabolite

  • molTable – a cellular array containing a breakdown of the frequency of each element in the molecule

AUTHORS

Bronson R. Weston, 2022

makeDietFormatConsistant(model, diet)[source]

This function takes a diet input and checks it for formatting consisteny for input into setFoodConstraints

USAGE

[diet] = makeDietFormatConsistant (model,diet)

INPUTS

model: A COBRA model

diet: A nx2 cell array containing n dietary components and

the corresponding flux

OUTPUT

diet: A diet of consistent format for setFoodConstraints

Authors

Bronson R. Weston 2022

normalizeDiet(foodMenu, calories, exceptions)[source]

This function normalizes a diet to meet caloric specifications.

USAGE

[foodMenu] = normalizeDiet (foodMenu,calories,exceptions)

INPUTS
foodMenu: An nx2 cell array containing the food items and the

corresponding flux (n= number of food items)

calories The number of calories the diet should be

renormalized to

exceptions: A cell array containing any specific food items that

should be excluded from the renormalization step. This maintains the flux for the specefied food items.

OUTPUT

foodMenu: An re-normalized version of the original foodMenu

Authors

Bronson R. Weston 2022

nutritionAlgorithmWBM(model, obj, objMinMax, rois, roisMinMax, options)[source]

Identifies the minimal changes to a diet necessary to get a desired change in one or more reactions of interest. One may enter a metabolite of the pointsModel instead of a reaction and the algorithm will optimize the diet with a sink or demand reaction for the corresponding metabolite of interest.

USAGE

[newDietModel,pointsModel,slnMin,slnMax,pointsModelSln,itemsRemoved,itemsAdded] = nutritionAlgorithmWBM (pointsModel,obj,objMinMax,rois,roisMinMax,options) – Example: [newDietModel,pointsModel,roiFlux,pointsModelSln,itemsRemoved,itemsAdded] = nutritionAlgorithmWBM(WBmodel,’Whole_body_objective_rxn’,’max’,{},{})

INPUTS
pointsModel – COBRA pointsModel structure with the fields:
  • .S

  • .b

  • .ub

  • .ub

  • .mets (required if pointsModel.SIntRxnBool absent)

  • .rxns (required if pointsModel.SIntRxnBool absent)

obj: organism’s objective function

objMinMax: minimize (‘min’) or maximize (‘max’) objective function

rois: cell array of all reactions of interest

roisMinMax: cell array of ‘min’/’max’ entries for rois

OPTIONAL INPUTS

options – Structure containing the optional specifications:

  • .foodOrMets: dictates if the algorithm adds individual

metabolites to the diet or food items. Default is food items. “Food Cat” adjust algorithm to identify categories of food rather than specific items.”AllMets” allows any dietary metabolite into the solution and “FoodMets” only allows metabolites that are in the fdTable spreadsheet into the solution. Possible inputs are: “Food Items”, “Food Cat”, “AllMets”, “FoodMets”.

  • .roiWeights: a vector of weights for each reaction of interest

default is equal to 1

  • .weightedFoodItems: A cell vector that specifies any food items

or metabolites that should be weighted and the corresponding weight.

  • .initObjSln: provide an initial solution for the objective

function. Output from optimizeWBmodel.

  • .caloricRange: 1x2 vector defining boundries for diet calories

  • .slnType: Specify if solution should be ‘Detailed’ or ‘Quick’.

    Default setting is ‘Detailed’

  • .roiBound: ‘Unbounded’ or ‘Bounded’. Default is ‘Bounded’.

  • .foodAddedLimit: Specify a limit for the units of food that can

    be added to the diet

  • .foodRemovedLimit: Specify a limit for the units of food that can

    be removed from the diet

  • .freeMets: Specifies any metabolites that should be freely

available to the model.

  • .calorieWeight: set to ‘True’ to weight by caloric content rather

than servings. Default is ‘False’

  • .graphicalAnalysis: set to ‘True’ include graphical analysis and

‘False’ to not include. Default is ‘False’ if .slnType is set to ‘Quick but is ‘True; if .slnType is ‘Detailed’.

OUTPUT

solution – Structure containing the following fields:

relaxedModel pointsModel structure that admits a flux balance solution

setFoodConstraints(model, foodMenu, compensateDiet)[source]
This function sets diet/food constraints for uptake reactions of

a whole-body metabolic model.

function model = setFoodConstraints(model, Diet, factor)

INPUT

model model structure foodMenu {column vector of food items, column vector of serving mass (g))

Optional Input

compensateDiet boolean 0 and 1; 1 indicates to compensate for gaps in nutrition components in the EUAverageDiet. default is 1