Modelgeneration¶
- checkCobraModelUnique(model, renameFlag)[source]¶
Checks uniqueness of reaction and metabolite names
- USAGE:
model = checkCobraModelUnique (model, renameFlag)
- INPUT:
model – COBRA model structure with fields:
.rxns - n x 1 cell array of reaction identifiers
.mets - m x 1 cell array of metabolite identifiers
- OPTIONAL INPUT:
renameFlag – Renames non-unique reaction names and metabolites (Default = false)
- OUTPUT:
model – COBRA model structure
isUnique – true if the model has unique reaction and metabolite names
- checkDuplicateRxn(model, method, removeFlag, printLevel, boundsFlag)[source]¶
Checks model for duplicate reactions and removes them. By default, it detects the columns of S that are identical upto scalar multiplication
- USAGE:
[modelOut, removedRxnInd, keptRxnInd] = checkDuplicateRxn (model, method, removeFlag, printLevel, boundsFlag)
- INPUTS:
model – Cobra model structure with fields:
.S - m x n stoichiometric matrix
.rxns - n x 1 cell array of reaction identifiers
.lb - n x 1 lower bounds on fluxes (used if boundsFlag)
.ub - n x 1 upper bounds on fluxes (used if boundsFlag)
- OPTIONAL INPUTS:
method – S –> checks rxn S matrix (default), rxnAbbr –> checks rxn abbreviations, FR –> checks F + R matrix, where \(S:=-F + R\), which ignores reaction direction
removeFlag – {(1), 0} if 1, duplicate reactions are removed from modelOut; if 0, they are only detected and reported (default 1)
printLevel – verbose level (default 0)
boundsFlag – {(0), 1} if 1, include .lb and .ub when comparing reactions for duplication (default 0)
- OUTPUTS:
modelOut – COBRA model structure without (with) duplicate reactions
removedRxnInd – Reaction numbers in model that were (should be) removed
keptRxnInd – Reaction numbers in model that were (should be) kept
- checkModelPreFBA(model, param)[source]¶
Checks if a model is (stoichiometrically and flux) consistent, which are necessary conditions prior to FBA
- USAGE:
isConsistent = checkModelPreFBA (model, param)
- INPUTS:
model – COBRA model structure, or a char with the file name of a model, with fields:
.modelID - model identifier (char)
.S - m x n stoichiometric matrix
.rxns - n x 1 cell array of reaction identifiers
.SIntRxnBool - n x 1 boolean of internal (non-exchange) reactions (returned by findStoichConsistentSubset)
.SConsistentRxnBool - n x 1 boolean of stoichiometrically consistent reactions (returned by findStoichConsistentSubset)
.SConsistentMetBool - m x 1 boolean of stoichiometrically consistent metabolites (returned by findStoichConsistentSubset)
.EXRxnBool - n x 1 boolean of exchange reactions (computed internally from reaction identifiers prefixed EX_)
.DMRxnBool - n x 1 boolean of demand reactions (computed internally from reaction identifiers prefixed DM_, excluding named ATP maintenance reactions)
.SinkRxnBool - n x 1 boolean of sink reactions (computed internally from reaction identifiers prefixed sink_)
- OPTIONAL INPUTS:
param – parameters structure with fields:
.printLevel - verbose level (default 0)
.epsilon - set internally before testing flux consistency with findFluxConsistentSubset
.modeFlag - set internally before testing flux consistency with findFluxConsistentSubset
.method - set internally before testing flux consistency with findFluxConsistentSubset
- OUTPUT:
isConsistent – {(1), 0} 1 if the model is stoichiometrically and flux consistent, 0 otherwise
- checkObjective(model)[source]¶
Prints out the Stoichiometric Coefficients for each Metabolite, with the name of the objective
- USAGE:
objectiveAbbr = checkObjective (model)
- INPUT:
model – COBRA model structure with fields:
.c - n x 1 objective coefficient vector
.rxns - n x 1 cell array of reaction identifiers
.S - m x n stoichiometric matrix
.mets - m x 1 cell array of metabolite identifiers
- OUTPUT:
objectiveAbbr – Objective reaction abbreviation
- detectDeadEnds(model, removeExternalMets)[source]¶
Returns a list of indices of metabolites which either participate in only one reaction or can only be produced or consumed (i.e. all reactions involving the metabolite either only produce or only consume it, respecting the reaction lower and upper bounds).
- USAGE:
mets = detectDeadEnds (model, removeExternalMets)
- INPUT:
model – COBRA model structure with fields:
.S - m x n stoichiometric matrix
.lb - n x 1 lower bounds on fluxes
.ub - n x 1 upper bounds on fluxes
.SInConsistentRxnBool - n x 1 boolean of stoichiometrically inconsistent reactions (only if removeExternalMets; returned by findStoichConsistentSubset)
.SExMetBool - m x 1 boolean of exchanged/external metabolites (only if removeExternalMets; returned by findStoichConsistentSubset)
- OPTIONAL INPUT:
removeExternalMets – Dont return metabolites that participate in reactions of the following type: “A <=>/-> ” or ” <=>/-> A” or exclusively present in inconsistent reactions as defined in Gevorgyan et al, Bioinformatics, 2008
- OUTPUT:
mets – List of indicies of metabolites which can ether only be produced or consumed.
- fastLeakTest(model, testRxns, demandTest)[source]¶
Tests if any metabolites in a model are leaking. A metabolite is leaking if the exchange reaction can carry secretion flux in the closed model (no uptake flux through any exchange reactions is permitted).
- USAGE:
[LeakMets, modelClosed, FluxExV] = fastLeakTest (model, testRxns, demandTest)
- INPUTS:
model – Model structure with fields:
.S - m x n stoichiometric matrix
.lb - n x 1 lower bounds on fluxes
.ub - n x 1 upper bounds on fluxes
testRxns – List of exchange reactions to be testetd for leaks
demandTest – Optional: if ‘true’ is entered, demand reactions for all metabolites in the model are created
- OUTPUTS:
LeakMets – List of exchange reactions for leaking metabolites
modelClosed – Model strucutre that has been tested for leaks
FluxExV – Flux vector for computed exchange reactions in the closed model
- printObjective(model)[source]¶
Prints out the Stoichiometric Coefficients for each Metabolite, with the name of the objective
- USAGE:
objectiveAbbr = printObjective (model)
- INPUT:
model – COBRA model structure with fields:
.c - n x 1 objective coefficient vector
.rxns - n x 1 cell array of reaction identifiers
.S - m x n stoichiometric matrix
.mets - m x 1 cell array of metabolite identifiers
- OUTPUT:
objectiveAbbr – Objective reaction abbreviation
- removeCompartments(model, comp, newComp)[source]¶
Removes a list of compartments from metabolite names, decompartmentalizing the model. Removes duplicate and empty entries.
- USAGE:
[modelDecomp] = removeCompartments (model, comp, newComp)
- INPUTS:
model – Model structure with fields:
.genes - g x 1 cell array of gene identifiers
.rxns - n x 1 cell array of reaction identifiers
.mets - m x 1 cell array of metabolite identifiers
.S - m x n stoichiometric matrix
.lb - n x 1 lower bounds on fluxes
.ub - n x 1 upper bounds on fluxes
.c - n x 1 objective coefficient vector
.rev - n x 1 boolean of reversible reactions (computed from .lb if absent)
.subSystems - n x 1 cell array of subsystem assignments
.grRules - n x 1 cell array of gene-reaction rules
comp – List of compartments to remove or replace (e.g., {‘c’, ‘n’})
- OPTIONAL INPUTS:
newComp – New compartment (default: ‘[c]’)
- OUTPUT:
modelDecomp – Decompartmentalized model structure
- removeDeadEnds(model)[source]¶
Removes all dead end metabolites and reactions from the model
- USAGE:
[model, removedMets, removedRxns] = removeDeadEnds (model)
- INPUT:
model – COBRA model structure
- OUTPUTS:
model – COBRA model structure w/o dead end metabolites and reactions
removedMets – List of removed metabolites
removedRxns – List of removed reactions
- setConstraintsIrrevModel(constrOpt, model, modelIrrev, rev2irrev)[source]¶
Sets constraints for a subset of rxns while converting reversible to irreversible reaction names and handling the constraint directions correctly
- USAGE:
constrOptIrrev = setConstraintsIrrevModel (constrOpt, model, modelIrrev, rev2irrev)
- INPUTS:
constrOpt – Constraint options with fields:
.rxnList - Reaction selection cell array (for reversible representation)
.values - Constraint values
.sense - Constraint senses ordered as rxnNameList
model – Model in reversible format with field:
.rxns - n x 1 cell array of reaction identifiers
modelIrrev – Model in irreversible format with field:
.rxns - cell array of irreversible reaction identifiers
rev2irrev – Reversible to irreversible reaction index conversion obtained from convertToIrreversible
- OUTPUTS:
constrOptIrrev – Constraint options in irrev model with fields:
.rxnList - Reaction selection cell array
.rxnInd - Selection index for constraints in irreversible model (e.g. [2 4 5 9 10])
.values - Correctly ordered constraint values
.sense - Correctly ordered constraint senses
- test4HumanFctExt(model, test, optionSinks)[source]¶
test for the ~288 human functions
- USAGE:
[TestSolution, TestSolutionName, TestedRxns, PercTestedRxns] = test4HumanFctExt (model, test, optionSinks)
- INPUT:
model – model structure (Recon1, with desired in silico condition) with fields:
.rxns - n x 1 cell array of reaction identifiers
.mets - m x 1 cell array of metabolite identifiers
.c - n x 1 objective coefficient vector (reset for each test)
.SinkRxnBool - n x 1 boolean of sink reactions (used if optionSinks)
test – possible statements: Recon1, IECori, IEC, all (default) (choose IECori if you intend to test the IEC model OR a model that contains lumen (‘u’) as compartment otw choose IEC); all check for Recon1 and IEC
optionSinks – if true = set sink reactions to 0 (default, leave unchanged). Note that all lb’s of exchanges and demands will be set to 0
- OUTPUT:
TestSolution – array containing the optimal value for the different tests
TestSolutionName – array containing the names for the different tests
TestedRxns – cell array of reaction identifiers that carried flux (above tolerance) in any of the tests
PercTestedRxns – percentage of model.rxns contained in TestedRxns
- testATPYieldFromCsources(model, modelName, extraCellCompIn, extraCellCompOut, minCard)[source]¶
computes the ATP yield from various carbon sources in Recon2 or Recon3.
- USAGE:
[Table_csources, TestedRxns, PercTestedRxns] = testATPYieldFromCsources (model, modelName)
- INPUT:
model – model structure with field:
.rxns - n x 1 cell array of reaction identifiers
- OPTIONAL INPUTS:
modelName – name of the model structure, by default Recon3
extraCellCompIn – abbreviation for extracellular compartment (in-going), default [e]
extraCellCompOut – abbreviation for extracellular compartment (out-going), default [e]
minCard – {(0), 1} default false for option to minimize the cardinality of the flux vector
- OUTPUT:
Table_csources – table listing ATP yield computed for the carbon sources
TestedRxns – list of reactions that are contributing to ATP production from carbon sources
PercTestedRxns – Fraction that tested reactions make up compared with all reactions in model