Tests

batchTestAllReconstructionFunctions(modelFolder, testResultsFolder, inputDataFolder, reconVersion, numWorkers)[source]

Part of the DEMETER pipeline. This function performs all quality control/quality assurance tests on a batch of reconstructions and saves the results for each reconstruction in the input folder.

USAGE:

batchTestAllReconstructionFunctions (modelFolder, testResultsFolder, inputDataFolder, reconVersion, numWorkers)

INPUTS:
  • modelFolder – Folder with COBRA models (draft or refined reconstructions) to analyze

  • testResultsFolder – Folder where the test results should be saved

  • inputDataFolder – Folder with experimental data and database files to load

  • reconVersion – Name of the refined reconstruction resource

  • numWorkers – Number of workers in parallel pool

plotATPTestResults(refinedFolder, reconVersion, varargin)[source]

This function plots the maximal ATP yield by refined reconstructions and reports whether ATP production is feasible. Optionally, draft reconstructions can be included.

USAGE:

[tooHighATP, ATP_fluxes] = plotATPTestResults (refinedFolder, reconVersion, varargin)

INPUTS:
  • refinedFolder – Folder with refined COBRA models generated by the refinement pipeline

  • reconVersion – Name of the refined reconstruction resource

OPTIONAL INPUTS:

varargin – Optional name-value arguments:

  • testResultsFolder - Folder where the test results should be saved (default: current folder, subfolder TestResults)

  • numWorkers - Number of workers in parallel pool (default: 0)

  • translatedDraftsFolder - Folder with translated draft COBRA models generated by the KBase pipeline to analyze (will only be analyzed if the folder is provided, default: ‘’)

OUTPUTS:
  • tooHighATP – List of IDs for refined reconstructions that produce too much ATP on complex medium

  • ATP_fluxes – Computed ATP production fluxes for each model

plotBiomassTestResults(refinedFolder, reconVersion, varargin)[source]

This function plots the growth of refined reconstructions and reports whether any reconstructions are incapable of biomass production. Optionally, draft reconstructions can be included.

USAGE:

[notGrowing, Biomass_fluxes] = plotBiomassTestResults (refinedFolder, reconVersion, varargin)

INPUTS:
  • refinedFolder – Folder with refined COBRA models generated by the refinement pipeline

  • reconVersion – Name of the refined reconstruction resource

OPTIONAL INPUTS:

varargin – Optional name-value arguments:

  • testResultsFolder - Folder where the test results should be saved (default: current folder, subfolder TestResults)

  • numWorkers - Number of workers in parallel pool (default: 0)

  • translatedDraftsFolder - Folder with translated draft COBRA models generated by the KBase pipeline to analyze (will only be analyzed if the folder is provided, default: ‘’)

OUTPUTS:
  • notGrowing – List of IDs for refined reconstructions that cannot produce biomass on at least one condition

  • Biomass_fluxes – Computed biomass production fluxes for each model

plotTestSuiteResults(testResultsFolder, reconVersion)[source]

This function prints and summarizes the results of testAllReconstructionFunctions.

USAGE:

plotTestSuiteResults (testResultsFolder, reconVersion)

INPUTS:
  • testResultsFolder – Folder where the test results were saved

  • reconVersion – Name of the refined reconstruction resource

runTestSuiteTools(refinedFolder, infoFilePath, inputDataFolder, reconVersion, varargin)[source]

This function initialzes the test suite on all reconstructions in that should be refined through DEMETER.

USAGE:

[testResultsFolder, curationReport] = runTestSuiteTools (refinedFolder, infoFilePath, inputDataFolder, reconVersion, varargin)

INPUTS:
  • refinedFolder – Folder with refined COBRA models generated by the refinement pipeline

  • infoFilePath – File with information on reconstructions to refine

  • inputDataFolder – Folder with experimental data and database files to load

  • reconVersion – Name of the refined reconstruction resource

OPTIONAL INPUTS:

varargin – Optional name-value arguments:

  • testResultsFolder - Folder where the test results are saved (default: current folder, subfolder TestResults)

  • numWorkers - Number of workers in parallel pool (default: 2)

  • createReports - Boolean defining if a report for each reconstruction should be created (default: false)

  • reportsFolder - Folder where reports should be saved (default: ‘’)

  • translatedDraftsFolder - Folder with translated draft COBRA models generated by the KBase pipeline to analyze (will only be analyzed if the folder is provided, default: ‘’)

OUTPUTS:
  • testResultsFolder – Folder where the test results are saved

  • curationReport – Summary of results of QA/QC tests

runTestsOnModel(model, microbeID, inputDataFolder)[source]

Part of the DEMETER pipeline. This function performs all quality control/quality assurance tests on a model.

USAGE:

testResults = runTestsOnModel (model, microbeID, inputDataFolder)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

    • .lb - Reaction lower bounds

  • microbeID – Microbe ID (used to label the test results)

  • inputDataFolder – Folder with experimental data and database files to load

OUTPUTS:

testResults – Structure with results of the test run, one field per QA/QC test

testATP(model)[source]

Tests flux through the ATP demand reaction (DM_atp_c_) on a complex medium-constrained model, both aerobic and anaerobic.

USAGE:

[atpFluxAerobic, atpFluxAnaerobic] = testATP (model)

INPUTS:

model – COBRA model structure with fields:

  • .rxns - Reaction identifiers

  • .mets - Metabolite identifiers

  • .S - m x n stoichiometric matrix

OUTPUTS:
  • atpFluxAerobic – Numeric vector showing the flux through the ATP demand reaction under aerobic conditions (mmol/gDW/h).

  • atpFluxAnaerobic – Numeric vector showing the flux through the ATP demand reaction under anaerobic conditions (mmol/gDW/h)

testAromaticAADegradation(model, microbeID, biomassReaction, database)[source]

Performs an FVA and reports those AromaticAA pathway end reactions (exchange reactions) that can carry flux in the model and should carry flux according to data (true positives) and those AromaticAA pathway end reactions that cannot carry flux in the model but should be secreted according to in vitro data (false negatives).

USAGE:

[TruePositives, FalseNegatives] = testAromaticAADegradation (model, microbeID, biomassReaction, database)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • microbeID – Microbe ID in carbon source data file

  • biomassReaction – Biomass objective functions (low flux through BOF required in analysis)

  • database – Structure containing rBioNet reaction and metabolite database with fields:

    • .metabolites - Metabolite database, column 1 VMH IDs, column 2 metabolite names

OUTPUTS:
  • TruePositives – Cell array of strings listing all aromatic amino acid degradation products that can be secreted by the model and in comparative genomic data.

  • FalseNegatives – Cell array of strings listing all aromatic amino acid degradation products that cannot be secreted by the model but should be secreted according to comparative genomic data.

testBileAcidBiosynthesis(model, microbeID, biomassReaction, database)[source]

Performs an FVA and reports those bile acid metabolites (exchange reactions) that can be secreted by the model and should be secreted according to data (true positives) and those bile acid metabolites that cannot be secreted by the model but should be secreted according to in vitro data (false negatives).

USAGE:

[TruePositives, FalseNegatives] = testBileAcidBiosynthesis (model, microbeID, biomassReaction, database)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • microbeID – Microbe ID in data file

  • biomassReaction – Biomass objective functions (low flux through BOF required in analysis)

  • database – Structure containing rBioNet reaction and metabolite database with fields:

    • .metabolites - Metabolite database, column 1 VMH IDs, column 2 metabolite names

OUTPUTS:
  • TruePositives – Cell array of strings listing all bile acid products (exchange reactions) that can be secreted by the model and in in vitro data.

  • FalseNegatives – Cell array of strings listing all bile acid products (exchange reactions) that cannot be secreted by the model but should be secreted according to in vitro data.

testCarbonSources(model, microbeID, biomassReaction, database, inputDataFolder)[source]

Performs an FVA and reports those carbon sources (exchange reactions) that can be taken up by the model and should be taken up according to data (true positives) and those carbon sources that cannot be taken up by the model but should be taken up according to in vitro data (false negatives).

USAGE:

[TruePositives, FalseNegatives] = testCarbonSources (model, microbeID, biomassReaction, database, inputDataFolder)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • microbeID – Microbe ID in carbon source data file

  • biomassReaction – Biomass objective functions (low flux through BOF required in analysis)

  • database – Structure containing rBioNet reaction and metabolite database with fields:

    • .metabolites - Metabolite database, column 1 VMH IDs, column 2 metabolite names

  • inputDataFolder – Folder with experimental data and database files to load

OUTPUTS:
  • TruePositives – Cell array of strings listing all carbon sources (exchange reactions) that can be taken up by the model and in in vitro data.

  • FalseNegatives – Cell array of strings listing all carbon sources (exchange reactions) that cannot be taken up by the model but should be taken up according to in vitro data.

testDrugMetabolism(model, microbeID, biomassReaction, database)[source]

Performs an FVA and reports those drug metabolites (exchange reactions) that can be taken up and/or secreted by the model and should be secreted according to data (true positives) and those bile acid metabolites that cannot be secreted by the model but should be secreted according to in vitro data (false negatives).

USAGE:

[TruePositives, FalseNegatives] = testDrugMetabolism (model, microbeID, biomassReaction, database)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • microbeID – Microbe ID in carbon source data file

  • biomassReaction – Biomass objective functions (low flux through BOF required in analysis)

  • database – Structure containing rBioNet reaction and metabolite database with fields:

    • .metabolites - Metabolite database, column 1 VMH IDs, column 2 metabolite names

OUTPUTS:
  • TruePositives – Cell array of strings listing all drug metabolites (exchange reactions) that can be taken up and/or secreted by the model and in in vitro data.

  • FalseNegatives – Cell array of strings listing all drug metabolites (exchange reactions) that cannot be taken up and/or secreted by the model but should be secreted according to in vitro data.

testFermentationProducts(model, microbeID, biomassReaction, database, inputDataFolder)[source]

Performs an FVA and reports those fermentation products (exchange reactions) that can be secreted by the model and should be secreted according to data (true positives) and those fermentation products that cannot be secreted by the model but should be secreted according to in vitro data (false negatives).

USAGE:

[TruePositives, FalseNegatives] = testFermentationProducts (model, microbeID, biomassReaction, database, inputDataFolder)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • microbeID – Microbe ID in carbon source data file

  • biomassReaction – Biomass objective functions (low flux through BOF required in analysis)

  • database – Structure containing rBioNet reaction and metabolite database with fields:

    • .metabolites - Metabolite database, column 1 VMH IDs, column 2 metabolite names

  • inputDataFolder – Folder with experimental data and database files to load

OUTPUTS:
  • TruePositives – Cell array of strings listing all fermentation products (exchange reactions) that can be secreted by the model and in in vitro data.

  • FalseNegatives – Cell array of strings listing all fermentation products (exchange reactions) that cannot be secreted by the model but should be secreted according to in vitro data.

testGeneRules(model)[source]

Finds gene rules that have an incorrect nomenclature.

USAGE:

incorrectGeneRules = testGeneRules (model)

INPUTS:

model – COBRA model structure with fields:

  • .rules - Gene-protein-reaction rules in computable form

OUTPUTS:

incorrectGeneRules – Cell array listing entries in model.rules that have incorrect nomenclature.

testGrowth(model, biomassReaction)[source]

Tests growth, both on unlimited media and complex medium, both aerobic and anaerobic conditions. In anaerobic conditions, both oxygen uptake (exchange reaction) and cytosolic oxygen-utilizing reactions are blocked.

USAGE:

[AerobicGrowth, AnaerobicGrowth] = testGrowth (model, biomassReaction)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • biomassReaction – String listing the biomass reaction

OUTPUTS:
  • AerobicGrowth – Numeric vector showing the flux through the biomass reaction (aerobic conditions): Column 1: “unlimited” media (all exchanges to -1000 mmol/gDW/h) Column 2: complex medium as defined in InputFilesComplexMedium.txt

  • AnaerobicGrowth – Numeric vector showing the flux through the biomass reaction (anaerobic conditions): Column 1: “unlimited” media (all exchanges to -1000 mmol/gDW/h) Column 2: complex medium as defined in InputFilesComplexMedium.txt

testGrowthOnDefinedMedia(model, microbeID, biomassReaction, inputDataFolder)[source]

Tests growth on a minimal medium retrieved from the experimental data on growth requirements. The output is the calculated growth rates. If the model can grow on the defined medium, a minimal medium is also computed and the list of essential exchanges as well as a model constrained with these exchanges are returned.

USAGE:

[growsOnDefinedMedium, constrainedModel, growthOnKnownCarbonSources] = testGrowthOnDefinedMedia (model, microbeID, biomassReaction, inputDataFolder)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

    • .lb - Reaction lower bounds

  • microbeID – Microbe ID in data file

  • biomassReaction – String listing the biomass reaction

  • inputDataFolder – Folder with experimental data and database files to load

OUTPUTS:
  • growsOnDefinedMedium – Bool if growth on defined medium yes or no

  • constrainedModel – Model constrained with essential exchanges (anaerobic)

  • growthOnKnownCarbonSources – Aerobic and anaerobic growth on known carbon sources for the organism

testInputFiles()[source]

Tests if the names of all reconstructed microbes are present in the input files for the AGORA2 pipeline.

USAGE:

[modelIDsMissingInTable, incorrectIDsInTable] = testInputFiles()

OUTPUTS:
  • modelIDsMissingInTable – AGORA2 reconstruction IDs missing in the table

  • incorrectIDsInTable – Reconstruction IDs in the table not corresponding to any reconstruction

testLeakingMetabolites(model)[source]

Finds metabolites that can be produced when no metabolites enter the model (produced from nothing).

USAGE:

leakingMets = testLeakingMetabolites (model)

INPUTS:

model – COBRA model structure with fields:

  • .lb - Reaction lower bounds

  • .rxns - Reaction identifiers

OUTPUTS:

leakingMets – Cell array listing any metabolites that can be be produced from nothing.

testMetaboliteUptake(model, microbeID, biomassReaction, database, inputDataFolder)[source]

Performs an FVA and reports those metabolites (exchange reactions) that can be taken up by the model and should be taken up according to data (true positives) and those metabolites that cannot be taken up by the model but should be taken up according to in vitro data (false negatives). Based on literature search of reported vitamin-secreting probiotics performed 11/2017, and a compendium of uptake and uptake products (PMID:28585563)

USAGE:

[TruePositives, FalseNegatives] = testMetaboliteUptake (model, microbeID, biomassReaction, database, inputDataFolder)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • microbeID – Microbe ID in uptake product data file

  • biomassReaction – Biomass objective functions (low flux through BOF required in analysis)

  • database – Structure containing rBioNet reaction and metabolite database with fields:

    • .metabolites - Metabolite database, column 1 VMH IDs, column 2 metabolite names

  • inputDataFolder – Folder with experimental data and database files to load

OUTPUTS:
  • TruePositives – Cell array of strings listing all metabolites (exchange reactions) that can be taken up by the model and in in vitro data.

  • FalseNegatives – Cell array of strings listing all metabolites (exchange reactions) that cannot be taken up by the model but should be taken up according to in vitro data.

testModelMassChargeBalance(model, excludeExchanges, biomassReaction)[source]

Uses the COBRA Toolbox function checkMassChargeBalance to test for mass and charge imbalanced reactions. Reports the mass and/or charge imblanced reactions along with reaction formulas and imblanced elements. Reports metabolites involved in mass or charge imblanced reactions along with their formulas and charges.

USAGE:

[massImbalancedRxns, chargeImbalancedRxns, imbalancedRxnMets, metsMissingFormulas] = testModelMassChargeBalance (model, excludeExchanges, biomassReaction)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

    • .mets - Metabolite identifiers

    • .metNames - Metabolite names

    • .S - m x n stoichiometric matrix

    • .metFormulas - Metabolite chemical formulas

    • .metCharges - Metabolite charges

  • excludeExchanges – Exclude exchange reactions when reporting imbalanced reactions (default: true).

OPTIONAL INPUTS:

biomassReaction – Model biomass reaction (will be excluded from report if provided)

OUTPUTS:
  • massImbalancedRxns – Cell array listing (col 1) all mass imbalanced reactions in the model, (col 2) the reaction formulas, and (col 3) the imbalanced elements.

  • chargeImbalancedRxns – Cell array listing (col 1) all charge imbalanced reactions in the model, (col 2) the reaction formulas, and (col 3) the imblanced elements.

  • imbalancedRxnMets – Cell array listing (col 1) all metabolites involved in any mass or charge imblanced reaction, (col 2) the metabolite name, (col 3) the metabolite formula, and (col 4) the metabolite charge.

  • metsMissingFormulas – Cell array listing (col 1) all metabolites that do not have metabolite formulas and (col 2) the metabolite names.

testPutrefactionPathways(model, microbeID, biomassReaction, database)[source]

Performs an FVA and reports those putrefaction pathway end reactions (exchange reactions) that can carry flux in the model and should carry flux according to data (true positives) and those putrefaction pathway end reactions that cannot carry flux in the model but should be secreted according to in vitro data (false negatives).

USAGE:

[TruePositives, FalseNegatives] = testPutrefactionPathways (model, microbeID, biomassReaction, database)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • microbeID – Microbe ID in carbon source data file

  • biomassReaction – Biomass objective functions (low flux through BOF required in analysis)

  • database – Structure containing rBioNet reaction and metabolite database with fields:

    • .metabolites - Metabolite database, column 1 VMH IDs, column 2 metabolite names

OUTPUTS:
  • TruePositives – Cell array of strings listing all putrefaction reactions that can carry flux in the model and in in vitro data.

  • FalseNegatives – Cell array of strings listing all putrefaction reactions that cannot carry flux in the model but should carry flux according to in vitro data.

testRefinedReactions(microbeID, BlockedRxns)[source]

Tests if reactions that were added through the refinement of gene annotations in the reconstructed organism can carry flux.

USAGE:

[RefinedReactionsCarryingFlux, BlockedRefinedReactions] = testRefinedReactions (microbeID, BlockedRxns)

INPUTS:
  • microbeID – Microbe ID in data file with refined genome annotations

  • BlockedRxns – Reactions in the COBRA model that cannot carry flux: output of identifyBlockedRxns function

OUTPUTS:
  • RefinedReactionsCarryingFlux – Reactions that were added through refinement of the genome annotations and can carry flux

  • BlockedRefinedReactions – Reactions that were added through refinement of the genome annotations and cannot carry flux

testSecretionProducts(model, microbeID, biomassReaction, database, inputDataFolder)[source]

Performs an FVA and reports those secretions (exchange reactions) that can be secreted by the model and should be secreted according to data (true positives) and those secretions that cannot be secreted by the model but should be secreted according to in vitro data (false negatives). Based on literature search of reported secretion-secreting probiotics performed 11/2017

USAGE:

[TruePositives, FalseNegatives] = testSecretionProducts (model, microbeID, biomassReaction, database, inputDataFolder)

INPUTS:
  • model – COBRA model structure with fields:

    • .rxns - Reaction identifiers

  • microbeID – Microbe ID in secretion secretion data file

  • biomassReaction – Biomass objective functions (low flux through BOF required in analysis)

  • database – Structure containing rBioNet reaction and metabolite database with fields:

    • .metabolites - Metabolite database, column 1 VMH IDs, column 2 metabolite names

  • inputDataFolder – Folder with experimental data and database files to load

OUTPUTS:
  • TruePositives – Cell array of strings listing all secretions (exchange reactions) that can be secreted by the model and in in vitro data.

  • FalseNegatives – Cell array of strings listing all secretions (exchange reactions) that cannot be secreted by the model but should be secreted according to in vitro data.

validateCompartments(model)[source]

This function checks if there are any reactions with incorrect compartments in the refined reconstructions. Appropriate compartments include [c], [e], and [p].

USAGE:

[incorrectRxns, incorrectMets] = validateCompartments (model)

INPUTS:

model – COBRA model structure with fields:

  • .mets - Metabolite identifiers

OUTPUTS:
  • incorrectRxns – Reactions including metabolites in inappropriate compartments

  • incorrectMets – Metabolites located in inappropriate compartments