# componentContribution¶

Transform(pseudoisomers, pH, I, T)[source]

Calculate pseudoisomer group standard transformed Gibbs energy of formation at specified pH, ionic strength and temperature.

Usage

dG0_prime = Transform(pseudoisomers, pH, I, T)

Inputs

• pseudoisomersp x 3 matrix with a row for each of the p pseudoisomers in the group, and the following columns:

1. Standard Gibbs energy of formation,
2. Number of hydrogen atoms,
3. Charge.
• pH – pH.

• I – Ionic strength in mol/L.

• T – Temperature in Kelvin.

Output

• dG0_prime – Pseudoisomer group standard transformed Gibbs energy of formation in kJ/mol.
addThermoToModel(model, params, printLevel)[source]

Given a standard COBRA model, add thermodynamic data to it using the Component Contribution method

Usage

Input

• model – COBRA model structure

Optional inputs

• params.use_cached_kegg_inchis
• params.use_model_pKas_by_default
• params.uf – maximum uncertainty

Output

• model – COBRA model structure with fields:
• .DfG0 - m x 1 array of component contribution estimated standard Gibbs energies of formation.
• .covf - m x m estimated covariance matrix for standard Gibbs energies of formation.
• .uf - m x 1 array of uncertainty in estimated standard Gibbs energies of formation. uf will be large for metabolites that are not covered by component contributions.
checkForMissingStereo(model, nist)[source]

Usage

missingStereo = checkForMissingStereo(model, nist)

Inputs

• model – structure with fields:
• model.mets
• model.inchi.standard
• model.inchi.standardWithStereo
• nist – structure with fields:
• nist.std_inchi
• nist.std_inchi_stereo

Output

• missingStereo
componentContribution(model, trainingData)[source]

Perform the component contribution method

Usage

[model, params] = componentContribution(model, trainingData)

Inputs

• model – COBRA structure
• trainingData – structure from prepareTrainingData with the following fields:
• .S - the stoichiometric matrix of measured reactions
• .G - the group incidence matrix
• .dG0 - the observation vector (standard Gibbs energy of reactions)
• .weights - the weight vector for each reaction in S
• .Model2TrainingMap

Outputs

• model – structure with the following fields:
• .DfG0 - m x 1 array of component contribution estimated standard Gibbs energies of formation.
• .covf - m x m estimated covariance matrix for standard Gibbs energies of formation.
• .DfG0_Uncertainty - m x 1 array of uncertainty in estimated standard Gibbs energies of formation. Will be large for metabolites that are not covered by component contributions.
• .DrG0_Uncertainty - n x 1 array of uncertainty in standard reaction Gibbs energy estimates. Will be large for reactions that are not covered by component contributions.
• params – structure
createGroupIncidenceMatrix(model, training_data)[source]

Initialize G matrix, and then use the python script “inchi2gv.py” to decompose each of the compounds that has an ‘InChI’ and save the decomposition as a row in the G matrix.

Usage

training_data = createGroupIncidenceMatrix(model, training_data)

Inputs

• model
• training_data

Output

• training_data
getFormulaAndChargeFromInChI(inchi)[source]

Usage

[formula, nH, charge] = getFormulaAndChargeFromInChI(inchi)

Input

• inchi – Nonstandard IUPAC InChI for a particular pseudoisomer of a metabolite

Outputs

• formula – The chemical formula for the input pseudoisomer
• nH – The number of total Hydrogen in the actual protonation form
• charge – The charge on the input pseudoisomer (excluding the protonation state)

Get the Formula and the number of protons

getMappingScores(model, training_data)[source]

Finds the best mapping between the model compounds and the training data (KEGG) compounds

Usage

mappingScore = getMappingScores(model, training_data)

Inputs

• model – COBRA structure
• training_data – training data

Output

• mappingScore – best mapping
getMolecularWeight(inchis, warnings)[source]

Computes molecular weight and elemental matrix of compounds

[MW, Ematrix] = computeMW(model, metList, warnings)

Input

• model – COBRA model structure (must define .mets and .metFormulas)

Optional inputs

• metList – Cell array of which metabolites to search for. (Default = all metabolites in model)
• warnings – Display warnings if there are errors with the formula. (Default = true)

Outputs

• MW – Vector of molecular weights
• Ematrixm x 8 matrix of order [H, C, N, O, P, S, e-] Note that the number of electrons (e-) is counted only for these 6 common elements (i.e. we assume all other elements are not involved in redox reactions anyway).
invertProjection(A, epsilon)[source]

Inverts a general matrix A using the pseudoinverse

Usage

[inv_A, r, P_R, P_N] = invertProjection(A, epsilon)

Inputs

• A – general matrix
• epsilon – default = 1e-10

Outputs

• inv_A – the pseudoinverse of A
• r – the rank of A
• P_R – the projection matrix onto the range(A)
• P_N – the projection matrix onto the null(A’)
loadTrainingData(formation_weight)[source]

Generates the structure that contains all the training data needed for Component Contribution.

Usage

Input

• formation_weight – the relative weight to give the formation energies (Alberty’s data) compared to the reaction measurements (TECRDB)

Output

• training_data – structure with data for Component Contribution
prepareTrainingData(model, printLevel, params)[source]

Given a standard COBRA model, adds thermodynamic data to it using the Component Contribution method

Usage

training_data = prepareTrainingData(model, printLevel, params)

Input

• model – COBRA structure

Optional inputs

• printLevel – verbose level, default = 0
• params.use_cached_kegg_inchis
• params.use_model_pKas_by_default
• params.uf – maximum uncertainty

Output

• training_data – strucutre with fields
• .DfG0 - m x 1 array of component contribution estimated standard Gibbs energies of formation.
• .covf - m x m estimated covariance matrix for standard Gibbs energies of formation.
• .uf - m x 1 array of uncertainty in estimated standard Gibbs energies of formation. uf will be large for metabolites that are not covered by component contributions.