Modelproperties¶
- checkModelProperties(model, printLevel)[source]¶
calculates various generic properties of a model, not specific to any biochemistry
- USAGE:
model = checkModelProperties (model, printLevel)
- INPUT:
model –
COBRA model structure with at least the fields:
.S - m x n stoichiometric matrix
.mets - m x 1 cell array of metabolite identifiers
.rxns - n x 1 cell array of reaction identifiers
.lb - n x 1 lower bounds on reaction flux
.ub - n x 1 upper bounds on reaction flux
Read and reused if already present, otherwise computed and added to the output model (see OUTPUT below):
.SIntRxnBool - n x 1 boolean of reactions heuristically thought to be internal (non-exchange) reactions
.SIntMetBool - m x 1 boolean of metabolites heuristically thought to be involved only in internal reactions
.fluxConsistentMetBool - m x 1 boolean vector indicating flux consistent mets
.fluxConsistentRxnBool - n x 1 boolean vector indicating flux consistent rxns
Only read (and, if so, overwritten) within the coefficient scaling branch, which is disabled by default:
.b - m x 1 right hand side vector of S*v = b
.c - n x 1 linear objective coefficient vector
- OPTIONAL INPUT:
printLevel – verbose level, silent if 0 (default 1)
- OUTPUT:
model – the input model, augmented with the following fields:
.rankFRvanilla - rank of [F R], when using all rows and cols (F/R are the negative/positive parts of model.S)
.rankFRVvanilla - rank of [F;R], when using all rows and cols
.SIntRxnBool - n x 1 boolean of reactions heuristically thought to be internal (non-exchange) reactions
.SIntMetBool - m x 1 boolean of metabolites heuristically thought to be involved only in internal reactions
.SIntRxnBool_findSExRxnInd - n x 1 copy of .SIntRxnBool as first returned by findSExRxnInd, kept for comparison against any later stoichiometric-consistency-based refinement of .SIntRxnBool
.leakMetBool - m x 1 boolean of metabolites in a positive leakage mode
.leakRxnBool - n x 1 boolean of reactions exclusively involved in a positive leakage mode
.siphonMetBool - m x 1 boolean of metabolites in a negative leakage mode
.siphonRxnBool - n x 1 boolean of reactions exclusively involved in a negative leakage mode
.SConsistentMetBool - m x 1 boolean vector indicating stoichiometrically consistent mets
.SConsistentRxnBool - n x 1 boolean vector indicating stoichiometrically consistent rxns
.SInConsistentMetBool - m x 1 boolean vector indicating stoichiometrically inconsistent mets
.SInConsistentRxnBool - n x 1 boolean vector indicating stoichiometrically inconsistent rxns
.fluxConsistentMetBool - m x 1 boolean vector indicating flux consistent mets
.fluxConsistentRxnBool - n x 1 boolean vector indicating flux consistent rxns
.thermoFluxConsistentMetBool - m x 1 boolean vector indicating thermodynamically flux consistent mets
.thermoFluxConsistentRxnBool - n x 1 boolean vector indicating thermodynamically flux consistent rxns
.thermoFwdFluxConsistentRxnBool - n x 1 boolean vector indicating forward thermodynamically flux consistent rxns
.thermoRevFluxConsistentRxnBool - n x 1 boolean vector indicating reverse thermodynamically flux consistent rxns
.FRrows - m x 1 boolean of rows of [F R] that are nonzero, unique upto positive scaling and part of the maximal conservation vector, selecting the subset of mets used for rank analysis
.FRVcols - n x 1 boolean of cols of [F;R] that are nonzero, unique upto positive scaling and part of the maximal conservation vector, selecting the subset of rxns used for rank analysis
.FRnonZeroRowBool1 - m x 1 boolean of rows of [F,R] that are nonzero, on the first (checkTrivial) pass
.FRnonZeroColBool1 - n x 1 boolean of cols of [F;R] that are nonzero, on the first (checkTrivial) pass
.FRuniqueRowBool - m x 1 boolean of rows of [F,R] that are unique upto scalar multiplication
.FRuniqueColBool - n x 1 boolean of cols of [F;R] that are unique upto scalar multiplication
.FRnonZeroRowBool - m x 1 boolean of rows of [F,R] that are nonzero, for the final subset of mets/rxns
.FRnonZeroColBool - n x 1 boolean of cols of [F;R] that are nonzero, for the final subset of mets/rxns
.largestConnectedRowsFRBool - m x 1 boolean, currently set to true for all mets (connectedness test bypassed)
.largestConnectedColsFRVBool - n x 1 boolean, currently set to true for all rxns (connectedness test bypassed)
.Fr - the forward half of model.S, restricted to .FRrows and .FRVcols
.Rr - the reverse half of model.S, restricted to .FRrows and .FRVcols
.Fc - same restricted forward half of model.S as .Fr, used for the column-rank computation
.Rc - same restricted reverse half of model.S as .Rr, used for the column-rank computation
.rankFR - rank of [Fr Rr], i.e. [F R] restricted to .FRrows
.rankFRV - rank of [Fc;Rc], i.e. [F;R] restricted to .FRVcols
.FRp - row permutation returned by getRankLUSOL for [Fr Rr]
.FRq - column permutation returned by getRankLUSOL for [Fr Rr]
.FRVp - row permutation returned by getRankLUSOL for [Fc;Rc]
.FRVq - column permutation returned by getRankLUSOL for [Fc;Rc]
.FRirows - m x 1 boolean of rows of [Fr Rr] that are independent
.FRdrows - m x 1 boolean of rows of [Fr Rr] that are dependent
.FRVicols - n x 1 boolean of cols of [Fc;Rc] that are independent
.FRVdcols - n x 1 boolean of cols of [Fc;Rc] that are dependent
.FRrowRankDeficiency - number of dependent rows of [Fr Rr] (nnz(.FRrows) - .rankFR)
.FRcolRankDeficiency - number of dependent cols of [Fc;Rc] (nnz(.FRVcols) - .rankFRV)
.FRW - (only if .FRrowRankDeficiency > 0) sparse matrix expressing each dependent row of [F R] as a linear combination of the independent rows
.FRwrows - m x 1 boolean (only if .FRrowRankDeficiency > 0) of independent rows that other rows amongst .FRdrows depend on
.FRVW - (only if .FRcolRankDeficiency > 0) sparse matrix expressing each dependent col of [F;R] as a linear combination of the independent cols
.FRVwcols - n x 1 boolean (only if .FRcolRankDeficiency > 0) of independent cols that other cols depend on
.Frb - forward half of the bilinear decomposition of Fr - Rr (only set if the if 0 debug branch is enabled)
.Rrb - reverse half of the bilinear decomposition of Fr - Rr (only set if the if 0 debug branch is enabled)
.rankBilinearFrRr - rank of [Frb Rrb] (only set if the if 0 debug branch is enabled)
.rankS - rank of model.S
.maxSij - maximum magnitude stoichiometric coefficient in model.S
.minSij - minimum nonzero magnitude stoichiometric coefficient in model.S
- makeModelPropertiesTable(modelResults, modelMetaData, resultsDirectory, resultsFileName, tableFilename)[source]¶
Makes a table of model property results
- USAGE:
[modelResultsTable, modelResults] = makeModelPropertiesTable (modelResults, modelMetaData, resultsDirectory, resultsFileName, tableFilename)
- INPUT:
modelResults – output of checkModelProperties
- OPTIONAL INPUTS:
modelMetaData – Cell array, where each row is metadata for one model with five columns: species, modelID, fileName, PMID, doi. See function modelMetaData=modelCitations() for example. Table columns ordered by order of rows in modelMetaData.
resultsDirectory – directory where output of checkModelProperties has been saved
resultsFileName – filename where output of checkModelProperties has been saved
tableFilename – If provided, the table of results is written out to a csv file, with specified filename
- OUTPUTS:
modelResultsTable – table displaying the results of checkModelProperties
modelResults – output of checkModelProperties
- plotModelConsistency(modelResults, modelMetaData, schematicFlag, nRows, nCols, resultsDirectory, figureFileName, resultsFileName)[source]¶
Plots stoichiometric and flux consistency figures, given a modelResults structure or by loading the modelResults structure from a specified location
- USAGE:
plotModelConsistency (modelResults, modelMetaData, schematicFlag, nRows, nCols, resultsDirectory, figureFileName, resultsFileName)
- INPUT:
modelResults – output of checkModelProperties
modelMetaData – Cell array, where each row is metadata for one model with five columns: species, modelID, fileName, PMID, doi.
schematicFlag – top corner plot illustrating the different colours
nRows – number of rows in the subplot
nCols – number of rows in the subplot (nRows*nCols >= length(modelResults))
- OPTIONAL INPUTS:
resultsDirectory – directory where output of checkModelProperties has been saved, same directory where the figure will be saved
figureFileName – filename of the figure (without the directory)
resultsFileName – filename where output of checkModelProperties has been saved
- printBiomass(model, BiomassNumber)[source]¶
Prints the metabolites and their stoichiometric coefficients that participate in a given reaction (typically the biomass reaction) and returns them as well
- USAGE:
[Component, Fraction] = printBiomass (model, BiomassNumber)
- INPUTS:
model – COBRA model structure with fields:
.S - m x n stoichiometric matrix (used if .A is absent)
.A - stoichiometric/coupling matrix, used in place of .S when present
.mets - m x 1 cell array of metabolite identifiers
BiomassNumber – column index of the biomass reaction (or any other reaction) in model.S
- OUTPUTS:
Component – cell array of metabolite identifiers with a nonzero coefficient in reaction BiomassNumber
Fraction – stoichiometric coefficients of Component in reaction BiomassNumber