Generatemetinfo¶
- convertInchiString2format(inchiString, format)[source]¶
Converts an InChI string into a given format (either inchiKey or smiles) It relies on obabel (Open Babel) being installed. Installation on mac with Homebrew: brew install open-babel.
- USAGE:
[result] = convertInchiString2format (inchiString, format)
- INPUTS:
inchiString – InChI string to be converted
format – Target format, either ‘inchiKey’ or ‘smiles’
- OUTPUTS:
result – Converted InChI string in the format defined by format
- generateInchiFromMol(metabolite_structure, folder, inchiKey, smiles, formula, startSearch, endSearch)[source]¶
Adds InChI strings to metabolite structure entries when mol files are available
For each entry that has a mol file (in folder) but no InChI string yet, the InChI string is generated. Optionally, the InChI key, the SMILES string, and the metabolite formula and charge are also generated. Relies on obabel.
- USAGE:
[metabolite_structure, IDsAdded, InchiKeyList, InchiStringList] = generateInchiFromMol (metabolite_structure, folder, inchiKey, smiles, formula, startSearch, endSearch)
- INPUTS:
metabolite_structure – Metabolite structure
folder – Folder containing the mol files
- OPTIONAL INPUTS:
inchiKey – If 1 (default), the InChI key is generated from the mol file
smiles – If 1 (default), the SMILES string is generated from the mol file
formula – If 1 (default), the formula and charge are generated
startSearch – Numeric index where the search starts in the metabolite structure (default: 1)
endSearch – Numeric index where the search ends in the metabolite structure (default: all metabolites)
- OUTPUTS:
metabolite_structure – Updated metabolite structure
IDsAdded – List of IDs added to the metabolite structure
InchiKeyList – List of InChI keys added
InchiStringList – List of InChI strings added
- generateInchiKeysSmilesFromInchiStrings(metabolite_structure)[source]¶
Generates missing InChI keys and SMILES strings from available InChI strings
Searches the metabolite structure for entries where the InChI key or SMILES string is missing but the InChI string is available, and generates the InChI key/SMILES using Open Babel (obabel).
- USAGE:
[metabolite_structure, IDsAdded] = generateInchiKeysSmilesFromInchiStrings (metabolite_structure)
- INPUTS:
metabolite_structure – Metabolite structure
- OUTPUTS:
metabolite_structure – Updated metabolite structure
IDsAdded – List of added InChI keys/SMILES strings
- getInchiString2ChargedFormula(metList, inchiStringList)[source]¶
Computes the charged formula and metabolite charge at pH 7 from InChI strings
It requires ChemAxon and Open Babel. The provided InChI string is assumed to describe the neutral metabolite; if it does not, metFormulaNeutral instead reflects the formula provided with the InChI string.
- USAGE:
[metFormulaNeutral, metFormulaCharged, metCharge] = getInchiString2ChargedFormula (metList, inchiStringList)
- INPUTS:
metList – List of metabolite abbreviations
inchiStringList – List of InChI strings (same order as metList)
- OUTPUTS:
metFormulaNeutral – Neutral metabolite formula (as provided in the InChI string)
metFormulaCharged – Charged metabolite formula (at pH 7)
metCharge – Metabolite charge (double, at pH 7)