Buildmetstruct¶
- addField2MetStructure(metabolite_structure, metField)[source]¶
Adds the standard metabolite structure fields to each metabolite entry
Adds fields to the metabolite structure as defined in metaboliteStructureFieldNames. Note that this function does not populate the fields with new data; missing fields are added and set to NaN.
- USAGE:
metabolite_structure = addField2MetStructure (metabolite_structure, metField)
- INPUT:
metabolite_structure – metabolite structure
- OPTIONAL INPUT:
metField – specify a single metabolite (field name) whose fields should be added (default: all metabolites)
- OUTPUT:
metabolite_structure – updated metabolite structure
- cleanUpMetabolite_structure(metabolite_structure, startSearch, endSearch)[source]¶
Removes the most commonly occurring issues in collected metabolite data
Removes the most commonly occurring issues with the metabolite data obtained from different resources, e.g. spaces in identifiers, wrong number formats, and misspellings of the inchiString prefix.
- USAGE:
[metabolite_structure] = cleanUpMetabolite_structure (metabolite_structure, startSearch, endSearch)
- INPUT:
metabolite_structure – metabolite structure
- OPTIONAL INPUTS:
startSearch – numeric index where the clean-up should start in the metabolite structure (default: 1)
endSearch – numeric index where the clean-up should end in the metabolite structure (default: number of metabolites in the structure)
- OUTPUT:
metabolite_structure – updated metabolite structure
- convertModel2Metstructure(model)[source]¶
Converts the metabolite information of a COBRA model into a metabolite structure
Converts the metabolite information present in a metabolic reconstruction (contained in a model structure) into a metabolite structure, to make the reconstruction amenable to the metaboAnnotator extension.
- USAGE:
[metabolite_structure] = convertModel2Metstructure (model)
- INPUT:
model – COBRA model structure with the fields:
.mets - metabolite identifiers, converted into the metabolite structure entries
.modelID - model identifier, recorded as the annotation source for the retrieved fields
- OUTPUT:
metabolite_structure – metabolite structure
- createNewMetEntryFromArray(metInput, source, populate, molFileDirectory, metab_rBioNet_online, rxn_rBioNet_online, metabolite_structure_rBioNet)[source]¶
Creates and populates a metabolite structure from a list of metabolites
Takes a list of metabolites (as specified below) and (1) checks whether the metabolite abbreviations are new to the VMH and/or rBioNet (in the online versions), then obtains the inchiString from the provided HMDB IDs and mol files, determines the most abundant pseudoisomer at pH 7, and uses BridgeDB to obtain further identifiers.
- USAGE:
[metabolite_structure] = createNewMetEntryFromArray (metInput, source, populate, molFileDirectory, metab_rBioNet_online, rxn_rBioNet_online, metabolite_structure_rBioNet)
- INPUTS:
metInput – cell array (or table) containing the metabolites. The information provided must be as follows: metList = { ‘VMH ID’ ‘metabolite_name’ ‘HMDB’ ‘inchistring’ ‘neutral_formula’ ‘charged_formula’ ‘charge’ ‘cot’ ‘Cotinine’ ‘HMDB0001046’ ‘’ ‘’ ‘’ ‘’ ‘coto’ ‘Cotinine n-oxide’ ‘HMDB0001411’ ‘’ ‘’ ‘’ ‘’ If a table is provided, its .Properties.VariableNames are used as the column headers.
source – source of the information contained in the input (e.g. ‘Manually assembled by IT’)
- OPTIONAL INPUTS:
populate – populate new metabolite information based on the provided HMDB IDs; ‘true’ or ‘false’ (default: ‘true’)
molFileDirectory – directory where the mol files are deposited (default: ‘current path’/molFiles)
metab_rBioNet_online – rBioNet metabolite database; loaded from disk if not provided
rxn_rBioNet_online – rBioNet reaction database; loaded from disk if not provided
metabolite_structure_rBioNet – rBioNet metabolite structure; loaded from met_strc_rBioNet if not provided
- OUTPUT:
metabolite_structure – metabolite structure containing the new metabolites
- createNewMetaboliteStructure(input, source, metabolite_structure_rBioNet, metab, rxnDB)[source]¶
- This function creates a metabolite structure using the provided input. If
no VMHId is provided in the header of the input, then VMHId are generated.
USAGE:
[metabolite_structure] = createNewMetaboliteStructure(input,source,metabolite_structure_rBioNet,metab,rxnDB)
- INPUT:
- input: Cell array containing the metabolites
The information provided must be as follows: metList={ ‘VMH ID’ ‘metabolite_name’ ‘HMDB’ ‘inchistring’ ‘neutral_formula’ ‘charged_formula’ ‘charge’ ‘cot’ ‘Cotinine’ ‘HMDB0001046’ ‘’ ‘’ ‘’ ‘’ ‘coto’ ‘Cotinine n-oxide’ ‘HMDB0001411’ ‘’ ‘’ ‘’ ‘’
- source: source of the information contained in metArray
(e.g., ‘Manually assembled by IT’)
- metabolite_structure_rBioNet: (optional and only necessary if the
input has no VMHId)
- metab: rBioNet metabolite database (as stored
in metab.mat); loaded from disk if not provided
rxnDB: rBioNet reaction database
- OUTPUT:
metabolite_structure: metabolite structure
- createrBioNetStructure(metabolite_structure_rBioNet, start, stop)[source]¶
Builds and annotates the rBioNet-derived universal metabolite structure
Builds the rBioNet metabolite structure and annotates each metabolite from multiple offline and online resources. For the moment rBioNet serves as the universal database.
- USAGE:
[metabolite_structure_rBioNet] = createrBioNetStructure (metabolite_structure_rBioNet, start, stop)
- OPTIONAL INPUTS:
metabolite_structure_rBioNet – rBioNet metabolite structure; built from the downloaded rBioNet database if not provided
start – numeric index where the annotation should start in the metabolite structure (default: 1)
stop – numeric index where the annotation should end in the metabolite structure (default: number of metabolites in the structure)
- OUTPUT:
metabolite_structure_rBioNet – updated rBioNet metabolite structure
- generateVMHMetAbbr(met, metabolite_structure_rBioNet, metab, rxnDB, customMetAbbrList)[source]¶
Generates VMH metabolite abbreviations based on predefined naming rules
Generates VMH IDs for one or more metabolites based on predefined rules, as would generally be done manually from a metabolite name.
- USAGE:
[VMHId] = generateVMHMetAbbr (met, metabolite_structure_rBioNet, metab, rxnDB, customMetAbbrList)
- INPUT:
met – metabolite name or list of names
- OPTIONAL INPUTS:
metabolite_structure_rBioNet – rBioNet metabolite structure, provided to save time, either as a path to the mat file to load or as a structure already in memory
metab – rBioNet metabolite database (as stored in metab.mat), provided to save time
rxnDB – rBioNet reaction database (as stored in rxn.mat), provided to save time
customMetAbbrList – list of metabolite abbreviations against which uniqueness is also checked
- OUTPUT:
VMHId – new VMH ID or list of IDs
- metaboliteStructureFieldNames[source]¶
This m file contains the list of allowable fields in the metabolite_structure
Ines Thiele, 2020/2021
- model2MetStructure(filename, filetype, outputFileName, metabolite_structure_rBioNet)[source]¶
Populates the metabolites of a COBRA model with metabolite identifiers
Populates the metabolites present in a model structure with metabolite identifiers, using the MetaboAnnotator.
- USAGE:
[metabolite_structure, tableMappingOverview, TableIDs] = model2MetStructure (filename, filetype, outputFileName, metabolite_structure_rBioNet)
- INPUTS:
filename – name of the metabolic reconstruction to load
filetype – filetype of the metabolic reconstruction; valid arguments are ‘SBML’, ‘SimPheny’, ‘SimPhenyPlus’, ‘SimPhenyText’, ‘Matlab’, ‘BiGG’, ‘BiGGSBML’ or ‘Excel’ (default: ‘Matlab’); see readCbModel for details
- OPTIONAL INPUTS:
outputFileName – file name under which the metabolite structure and other information are saved
metabolite_structure_rBioNet – rBioNet metabolite structure; loaded from met_strc_rBioNet_new if not provided
- OUTPUTS:
metabolite_structure – metabolite structure containing retrieved identifiers for each metabolite in the reconstruction
tableMappingOverview – table listing the identifiers and their counts before and after running the function
TableIDs – table containing the individual identifiers, same content as in metabolite_structure
- populateModelMetStr(model, metabolite_structure, replaceAllHits)[source]¶
Populates a COBRA model with information from the metabolite structure
Populates the model structure with the metabolite information contained in the metabolite structure, mapping metabolite-structure fields onto the corresponding COBRA model metabolite annotation fields.
- USAGE:
[model] = populateModelMetStr (model, metabolite_structure, replaceAllHits)
- INPUTS:
model – COBRA model structure with the fields:
.mets - metabolite identifiers, matched against the metabolite structure
.metSBOTerms - SBO term per metabolite
.metChEBIID - ChEBI identifiers
.metPubChemID - PubChem identifiers
.metKEGGID - KEGG identifiers
.metHMDBID - HMDB identifiers
.metSEEDID - SEED identifiers
.metInchiKey - InChIKey per metabolite
.metReactomeID - Reactome identifiers
.metMetaNetXID - MetaNetX identifiers
.metBioCycID - BioCyc identifiers
.metBiGGID - BiGG identifiers
.metInchiString - InChI string per metabolite
.metLIPIDMAPSID - LIPID MAPS identifiers
.metSmile - SMILES string per metabolite
metabolite_structure – metabolite structure
- OPTIONAL INPUT:
replaceAllHits – replace existing entries (default: false)
- OUTPUT:
model – updated model structure
- removeSmilesInchiKey(metabolite_structure, removeInchiKey, removeSmiles, generateSmiles, generateInchiKey, generateMolFile)[source]¶
Removes (and optionally regenerates) smiles and inchiKeys in a metabolite structure
Removes all smiles and inchiKeys from fields where an inchiString exists, to reduce cumulative errors. Optionally, smiles and inchiKeys are recomputed from the inchiString using convertInchiString2format.
- USAGE:
[metabolite_structure, IDsAdded] = removeSmilesInchiKey (metabolite_structure, removeInchiKey, removeSmiles, generateSmiles, generateInchiKey, generateMolFile)
- INPUTS:
metabolite_structure – metabolite structure
removeInchiKey – if true, remove the inchiKey where an inchiString exists
removeSmiles – if true, remove the smiles where an inchiString exists
generateSmiles – if true, recompute the smiles from the inchiString
generateInchiKey – if true, recompute the inchiKey from the inchiString
generateMolFile – flag intended to generate a mol file for the metabolite (declared but not used in the current implementation)
- OUTPUTS:
metabolite_structure – updated metabolite structure
IDsAdded – list of smiles and inchiKeys that were added
- replaceVMHIds(metabolite_structure, reaction_structure)[source]¶
Adds, removes, or replaces manually curated errors in metabolite annotations
Adds, removes, or replaces errors present in the metabolite annotation. All mentions in this file are curated manually and result in the removal or replacement of the corresponding entries.
- USAGE:
[metabolite_structure, reaction_structure] = replaceVMHIds (metabolite_structure, reaction_structure)
- INPUT:
metabolite_structure – metabolite structure
- OPTIONAL INPUT:
reaction_structure – reaction structure (not implemented yet)
- OUTPUTS:
metabolite_structure – updated metabolite structure
reaction_structure – updated reaction structure (not implemented yet)
- sanityCheckMetIds(metabolite_structure, removeErrors)[source]¶
Performs basic sanity checks on the identifiers in a metabolite structure
Performs basic sanity checks on the metabolite structure, e.g. that numeric identifiers are numeric and that database identifiers follow the expected format. Optionally, entries that fail a check are removed.
- USAGE:
[metabolite_structure, errorFlag] = sanityCheckMetIds (metabolite_structure, removeErrors)
- INPUT:
metabolite_structure – metabolite structure
- OPTIONAL INPUT:
removeErrors – if true, remove entries that fail a sanity check (default: 0)
- OUTPUTS:
metabolite_structure – updated metabolite structure
errorFlag – list of entries that failed a sanity check, with the reason for each failure