inchi

addInchiToModel(model, molFileDir, method, printLevel)

Assigns Inchi to model.inchi structure given set of mol files for each metabolite

USAGE:

model = assignInchiToModel(model, molFileDir, printLevel)

INPUT:

model Model structure with following fields:

  • .S - m x n stoichiometric matrix.

  • .mets - m x 1 array of metabolite identifiers.

  • .rxns - n x 1 array of reaction identifiers.

  • .metFormulas - m x 1 cell array of metabolite formulas. Formulas for protons should be H, and formulas for water should be H2O.

  • .metCharges - m x 1 numerical array of metabolite charges.

  • .metCompartments - optional m x 1 array of metabolite compartment assignments. Not required if metabolite identifiers are strings of the format ID[*] where * is the appropriate compartment identifier.

molFileDir: Path to a directory containing molfiles for the

major tautomer of the major microspecies of each metabolite at pH 7. Molfiles should be named with the metabolite identifiers in model.mets (without compartment assignments).

OPTIONAL INPUTS:

printLevel: Verbose level

OUTPUTS:

model: Model structure with following additional fields:

  • .inchi - Structure containing four m x 1 cell array’s of IUPAC InChI strings for metabolites, with varying levels of structural detail.

  • .inchi.standard: m x 1 cell array of standard inchi

  • .inchi.standardWithStereo: m x 1 cell array of standard inchi with stereo

  • .inchi.standardWithStereoAndCharge: m x 1 cell array of standard inchi with stereo and charge

  • .inchi.nonstandard: m x 1 cell array of non-standard inchi

inchiBool m x 1 true if inchi exists molBool m x 1 true if mol file exists compositeInchiBool m x 1 true if inchi is composite

getMolecularWeight(inchis, warnings)

Computes molecular weight and elemental matrix of compounds

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

INPUTS:
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 Ematrix: m 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).

inchi2mol(inchis, filenames, outputdir, overwrite)

successbool = inchi2mol(inchis,filenames,outputdir,overwrite)

Convert InChI strings to mol files using OpenBabel. Compatible with Windows and Unix.

INPUTS inchis nx1 Cell array of InChI strings filenames nx1 Cell array of mol file names without file extension.

Default is {‘1’;’2’;…}

outputdir Directory for mol files. Default is

‘CurrentDirectorymolfiles’.

overwrite 0, [1]. Specify whether to overwrite existing mol files

in outputdir.

OUTPUTS successbool nx1 logical vector with 1 at indices corresponding to

inchis that were successfully converted to mol files and 0 elsewhere.

Hulda SH Feb. 2011

mol2inchi(molFileName, options)

Converts metabolite structures in a mol file to an InChI strings with OpenBabel.

An entry can be assigned an InChI identifier if it has an SDF file describing the structure and all of the following conditions hold:

  1. It does not contain an element that is not an atom. This is not common, but SDF files can contain non-atom elements (e.g., an electron or positron) or exotic atoms (e.g., muonium). These elements are not supported by InChI.

  2. It does not contain an unknown or general atom. In addition to a symbol from the periodic table, an SDF file can also contain general elements, often denoted as A, Q, * or R.

  3. It does not contain an R-group. Some atom of the structure may be aliased as an R-group, which indicates an undefined chemical group.

  4. It does not contain an undefined charge. A valid SDF file cannot contain an undefined charge. However, if we convert an mmCIF file containing an undefined charge into an SDF file, the resulting SDF file is excluded.

  5. It does not contain an unknown type of bond. This is not common, but an SDF file can contain an “any” bond, which does not specify the chemical type of the bond.

  6. It is not a polymer with an unknown number of repeating monomers. Some part of the structure can be denoted as a repetitive part, but an InChI identifier cannot be generated if the number of repeats is not known.

https://link.springer.com/article/10.1186/1758-2946-6-15

USAGE:

[inchi, metAbbr] = mol2inchi(molFileName, options)

INPUT:

molFileName: MDL mole file name (inc path if not in pwd)

OPTIONAL INPUTS:
options: Write options for InChI strings. See InChI documentation

for details. https://openbabel.org/docs/dev/FileFormats/InChI_format.html If no options are specified the function will output standard InChI.

OUTPUTS:

inchi: InChI (character array) for metabolites in the SDF file. annotation: Annotation in first line of molfile

Will be empty unless write option t is used (i.e., options >= ‘-xt’).