Additionalanalysis¶
- analyseObjectiveShadowPrices(modelFolder, 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 written for the Microbiome Modeling Toolbox, with the aim of allowing the computation of metabolic dependencies for metabolites of interest secreted by the personalzied models, though it can also be used for any other COBRA model.
- USAGE
[objectives,shadowPrices]=analyseObjectiveShadowPrices (modelFolder,objectiveList,varargin)
- INPUTS
modelFolder Folder containing one or more COBRA model structures
objectiveList Cell array containing the names of one or more – objective functions of interest in vertical order Optional: second column with exchange reaction IDs for objective-specific precursors
- OPTIONAL INPUTS
resultsFolder char with path of directory where results are saved
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).
- OUTPUT
objectives Computed objectives values
shadowPrices Table with shadow prices for metabolites that are – relevant for each analyzed objective in each analyzed model
- analyzeMgPipeResults(infoFilePath, resPath, varargin)[source]¶
This function takes simulation results generated by mgPipe as the input and determines which computed fluxes and reaction abundances are significantly different between groups. Also creates violin plots of the simulation results. Requires a file with sample information (e.g., disease group, age) for the microbiome models that were generated and interrogated through mgPipe.
- USAGE
analyzeMgPipeResults (infoFilePath,resPath,varargin)
REQUIRED INPUTS: infoFilePath: Path to text file or spreadsheet with information
on analyzed samples including group classification with sample IDs as rows
- resPath: char with path of directory where simulation
results are saved
OPTIONAL INPUTS statPath: char with path of directory where results of
statistical analysis are saved
- violinPath: char with path of directory where violin plots are
saved
- plotType Type of plot to be created: violin plot (default)
or boxplot. Allowed entries: “ViolinPlot”,”Boxplot”
- sampleGroupHeaders list of one or more column headers in file with the
sample information that should be analyzed (e.g., disease status, age). If not provided, the second column will be used.
- calculateReactionAbundance(abundancePath, modelPath, taxonomyPath, 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 results are given: the total abundance, and the abundance on different taxonomical levels.
USAGE
[ReactionAbundance,TaxonomyInfo] = calculateReactionAbundance(abundancePath, modelPath, taxonomyPath, rxnsList, numWorkers)
- INPUTS
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
taxonomyPath – Path to the spreadsheet with the taxonomy information on organisms (default: AGORA_infoFile.xlsx)
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.
- OUTPUT
ReactionAbundance Structure with abundance for each microbiome – and reaction in total and on taxon levels TaxonomyInfo: Taxonomical information on each taxon level
- calculateSubsystemAbundance(reactionAbundancePath)[source]¶
Computes the subsystem abundance in microbiome models that were generated through the mgPipe pipeline from the calculated reaction abundances. The subsystem abundance is shown as the fraction of the highest possible subsystem abundance that could be achieved, which would be every reaction in the subsystem being in the microbiome model at a total abundance of 1.
USAGE: subsystemAbundance = calculateSubsystemAbundance(reactionAbundancePath)
INPUT reactionAbundancePath Path to spreadsheet or text file with
calculated reaction abundances for one or more microbiome models
OUTPUT subsystemAbundance Table with calculated subsystem abundances
- AUTHOR
Almut Heinken, 08/2020
- correlateFluxWithTaxonAbundance(abundancePath, fluxPath, infoFilePath, 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.
USAGE
[FluxCorrelations, PValues, TaxonomyInfo] = correlateFluxWithTaxonAbundance(abundancePath, fluxPath, taxonomy, corrMethod)
- INPUTS
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’
- fluxPath: Path to the .csv file with the fluxes for reactions
of interest with sample IDs as rows and reaction IDs in microbiome community models as columns
- OPTIONAL INPUTS
infoFilePath –
- Path to the spreadsheet with the taxonomy information
on organisms (default: AGORA_infoFile.xlsx)
- corrMethod: Method to compute the linear correlation
coefficient. Allowed inputs: ‘Pearson’ (default), ‘Kendall’, ‘Spearman’.
- OUTPUTS
FluxCorrelations – Structure with correlations between fluxes for each reaction and abundances on taxon levels
PValues – p-values corresponding to each calculated correlation
TaxonomyInfo – Taxonomical information on each taxon level
- drawSecPot(dietPath, rxnmax, startMet, levels, cutoff)[source]¶
Draws part of the community structure when maximized with the given reaction
- INPUTS
dietPath char with path of the model
rxnmax char with name of the rxn that gets maximized with fastFVA startMet char with starting metabolite for visualizing levels number with levels that are connected to the starting
metabolite
- cutoff number of fluxes that are considered for drawing,
only fluxes>abs(cutoff) are considered
- fastCalculateReactionAbundance(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.
USAGE
ReactionAbundance = fastCalculateReactionAbundance(abundancePath, modelPath, rxnsList, numWorkers)
- INPUTS
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.
- OUTPUT
ReactionAbundance Table with total abundance for each microbiome – and reaction
ReactionPresence – Table with absolute reaction presence for all reactions in all microbiome samples
- inorder(node, model, visitedmets, visitedrxns, levels)[source]¶
Concatenates all reactions and metabolites connected over levels
- USAGE
[visitedmets, visitedrxns] = inorder (node, model, visitedmets, visitedrxns, levels)
- INPUTS
node – char with the name of the starting node
model – COBRA model of a community/microbe one microbe model that can carry flux
visitedmets – list of metabolites that are excluded (already visited)
visitedrxns –
- list of reactions that are excluded
(already visited)
- levels indicates how many levels from the starting node (metabolite) are
considered
- OUTPUTS
visitedmets – list of all metabolites that are connected over the levels
visitedrxns – list of all reactions that are connected over the levels
- makeViolinPlots(sampleData, sampleInformation, varargin)[source]¶
This function creates violin plots of input data (e.g., community model fluxes) while separating the data into two or more violins based on available sample stratification information.
REQUIRED INPUTS sampleData Table with input data to analyze (e.g., fluxes) with
computed features as rows and sample IDs as columns
- sampleInformation Table with information on analyzed samples including
group classification with sample IDs as rows
OPTIONAL INPUTS stratification Column header containing the desired group
classification in sampleInformation table. If not provided, the second column will be used.
- plotType Type of plot to be created: violin plot (default) or
boxplot. Allowed entries: “ViolinPlot”,”Boxplot”
- plottedFeature Name of the feature to plot that will be displayed
as the plot title (e.g., ‘Flux”es’)
- unit Unit of the plotted data that will be displayed as
the y axis label (e.g., mmol/person/day)
- AUTHOR
Almut Heinken, 12/2020
- performStatisticalAnalysis(sampleData, sampleInformation, varargin)[source]¶
This function determines if there is a significant difference between features computed for two or more groups in a cohort of samples. If the cohort contains two groups, the Wilcoxon rank sum test is used. If the cohort contains three or more groups, the Kruskal Wallis test is used.
USAGE [Statistics,significantFeatures] = performStatisticalAnalysis(sampleData,sampleInformation,stratification)
INPUTS sampleData Table with input data to analyze (e.g., fluxes) with
computed features as rows and sample IDs as columns
- sampleInformation Table with information on analyzed samples including
group classification with sample IDs as rows
OPTIONAL INPUT stratification Column header containing the desired group
classification in sampleInformation table. If not provided, the second column will be used.
- groupTest Decides whether Kruskal-Wallis test(default) or
ANOVA should be used for group comparisons. Allowed inputs: “Kruskal-Wallis”,”ANOVA”
OUTPUTS Statistics Table with results of statistical tests for each
computed feature
- significantFeatures Table with input data reduced to only features that
were statistically significant
- AUTHOR
Almut Heinken, 12/2020
- plotFluxesAgainstOrganismAbundances(abundancePath, fluxPath, metabolites)[source]¶
Part of the Microbiome Modeling Toolbox. This function plots the relationship between organism abundances and the computed flux profiles for metabolites of interest. The function should be used after running mgPipe to identify correlations between metabolites and specific taxa in the samples.
USAGE
plotFluxesAgainstOrganismAbundances(fluxPath,abundancePath,metabolites)
- INPUTS
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’
fluxPath – Path to the .csv file with the fluxes for reactions of interest with sample IDs as rows and reaction IDs in microbiome community models as columns
- OPTIONAL INPUT
metabolites – Cell array with VMH metabolite IDs of metabolites to plot (default: all computed metabolites)
- predictMicrobeContributions(modPath, varargin)[source]¶
Predicts the minimal and maximal fluxes through internal exchange reactions in microbes in a list of microbiome community models for a list of metabolites. This allows for the prediction of the individual contribution of each microbe to total metabolite uptake and secretion by the community.
[minFluxes,maxFluxes,fluxSpans] = predictMicrobeContributions(modPath, varargin)
- INPUTS
modPath char with path of directory where models are stored
- OPTIONAL INPUTS
metList List of VMH IDs for metabolites to analyze – (default: all exchanged metabolites)
resultsFolder Path where results will be saved
numWorkers integer indicating the number of cores to use – for parallelization
- OUTPUTS
minFluxes – Minimal fluxes through analyzed exchange reactions, corresponding to secretion fluxes for each microbe
maxFluxes – Maximal fluxes through analyzed exchange reactions, corresponding to uptake fluxes for each microbe
fluxSpans – Range between min and max fluxes for analyzed exchange reactions
Define default input parameters if not specified