analyseObjectiveShadowPrices(modelList, objectiveList, varargin)[source]

This function determines the shadow prices indicating metabolites that are relevant for the flux through one or multiple objective functions optimized in one or more COBRA model structures. The objective functions entered are optimized one by one. By default, all metabolites with nonzero shadow prices are extracted from the computed flux solutions. The function was wirtten for the Microbiome Modeling Toolbox but can be used for any COBRA model structure(s) and objective function(s). When used with the Microbiome Modeling Toolbox, this function should be used after running mgPipe and determining metabolites of interest that are stratifying the modeled personalized microbiomes. The fecal exchanges secreting the metabolites of interest (e.g., EX_co2[fe]) should be used as the objective functions entered in the present function to determine model compounds that have value for the secretion of the metabolite of interest.




  • modelList Cell array containing one or more COBRA model

    structures in vertical order

  • objectiveList Cell array containing the names of one or more

    objective functions of interest in vertical order

Optional inputs

  • modelIDs Cell array containing IDs of the models displayed in

    the output table in same order as corresponding models (default IDs assigned if not entered)

  • osenseStr String indicating whether objective function(s)

    should be maximized or minimized. Allowed inputs: ‘min’,’max’, default:’max’.

  • SPDef String indicating whether positive, negative, or

    all nonzero shadow prices should be collected. Allowed inputs: ‘Positive’,’Negative’,’Nonzero’, default: ‘Nonzero’.

  • numWorkers Number indicating number of workers in parallel pool

    (default: 0).


  • shadowPrices Table with shadow prices for metabolites that are

    relevant for each analyzed objective in each analyzed model

calculateReactionAbundance(abundancePath, modelPath, rxnsList, numWorkers)[source]

Part of the Microbiome Modeling Toolbox. This function calculates and plots the total abundance of reactions of interest in a given microbiome sample based on the strain-level composition. Reaction presence or absence in each strain is derived from the reaction content of the respective AGORA model. Two outputs are given: the total abundance, and the abundance on different taxonomical levels.


ReactionAbundance =calculateReactionAbundance(abundancePath, modelPath, rxnsList, numWorkers)


  • abundancePath – Path to the .csv file with the abundance data. Example: ‘cobratoolbox/papers/018_microbiomeModelingToolbox/examples/normCoverage.csv’
  • modelPath – Folder containing the strain-specific AGORA models

Optional inputs

  • rxnsList – List of reactions for which the abundance should be calculated (if left empty: all reactions in all models)
  • numWorkers – Number of workers used for parallel pool. If left empty, the parallel pool will not be started. Parallellization is recommended if all reactions are computed.


  • ReactionAbundance Structure with abundance for each microbiome

    and reaction in total and on taxon levels

read the csv file with the abundance data

correlateFluxWithTaxonAbundance(abundancePath, fluxes, corrMethod)[source]

Part of the Microbiome Modeling Toolbox. This function calculates and plots the correlations between fluxes for one or more reactions of interest in a number of microbiome samples and the relative microbe abundance on different taxonomical levels in the same samples. The function should be used after running mgPipe to identify correlations between the computed metabolic profiles and specific taxa in the samples.


[FluxCorrelations, PValues] = correlateFluxWithTaxonAbundance(abundancePath, fluxes, taxonomy, corrMethod)


  • abundancePath – Path to the .csv file with the abundance data.

    Needs to be in same format as example file ‘cobratoolbox/papers/018_microbiomeModelingToolbox/examples/normCoverage.csv’

    fluxes: Table of fluxes for reactions of interest with

    reaction IDs in microbiome community models as rows and sample IDs as columns

Optional input

  • corrMethod – Method to compute the linear correlation coefficient. Allowed inputs: ‘Pearson’ (default), ‘Kendall’, ‘Spearman’.


  • FluxCorrelations – Structure with correlations between fluxes for each reaction and abundances on taxon levels
  • PValues – p-values corresponding to each calculated correlation

read the csv file with the abundance data