Analysemetstruct¶
- acceptIDsSuggested(metabolite_structure, IDsSuggested, annotationSource)[source]¶
Accepts suggested metabolite IDs and adds them to the metabolite structure
Accepts suggested IDs as provided in the list IDsSuggested and adds them to the metabolite structure. Each row in IDsSuggested to be accepted must have an entry in the 6th column specifying that the entry in the 2nd column shall be accepted for the metabolite in the 1st column. At this stage the annotation/curation level is raised to curated, so each row and suggested ID should be carefully evaluated before being accepted.
- USAGE:
[metabolite_structure, IDsAdded] = acceptIDsSuggested (metabolite_structure, IDsSuggested, annotationSource)
- INPUTS:
metabolite_structure – metabolite structure
IDsSuggested – list of suggested IDs; each row to be accepted must have ‘accepted’ in the 6th column
- OPTIONAL INPUT:
annotationSource – source of annotation, e.g. ‘curator (name)’ (default: ‘curator (IT)’)
- OUTPUTS:
metabolite_structure – updated metabolite structure
IDsAdded – list of added IDs
- addAnnotations(metabolite_structure, RAW, annotationSource, annotationType, annotationVerification)[source]¶
Adds annotations (fields) to the metabolite structure from an xlsx table
Adds annotations (fields) to the metabolite structure. It is generally used to populate the metabolite structure with new metabolites read from an xlsx sheet (RAW).
- USAGE:
[metabolite_structure] = addAnnotations (metabolite_structure, RAW, annotationSource, annotationType, annotationVerification)
- INPUTS:
metabolite_structure – metabolite structure
RAW – data read in using the function xlsread, e.g. [NUM, TXT, RAW] = xlsread(‘MetaboliteTranslationTable.xlsx’); the xlsx sheet must have specific headers to be read in correctly
- OPTIONAL INPUTS:
annotationSource – annotation source, tracking where the information came from, e.g. ‘Recon3D’ (default: ‘unknown’)
annotationType – type of annotation, e.g. ‘manual’ (default: ‘automatic’)
annotationVerification – verification of annotation, e.g. ‘verified by curator’, ‘verified based on inchiKeys’ (default: ‘not verified’)
- OUTPUTS:
metabolite_structure – updated metabolite structure
- addInfoFromMolFiles(metabolite_structure, folderName, startSearch, endSearch)[source]¶
Creates inchiStrings, smiles, and inchiKeys from provided mol files
Creates inchiStrings, smiles, and inchiKeys from provided mol files, in the case that these fields are empty (NaN) in the metabolite structure.
- USAGE:
[metabolite_structure, IDAdded] = addInfoFromMolFiles (metabolite_structure, folderName, startSearch, endSearch)
- INPUTS:
metabolite_structure – metabolite structure
- OPTIONAL INPUTS:
folderName – name of the folder that contains the mol files (default: ‘ctf-main/mets/molFiles’)
startSearch – numeric index where the search should start in the metabolite structure (default: 1, all metabolites in the structure are searched)
endSearch – numeric index where the search should end in the metabolite structure (default: number of metabolites in the structure)
- OUTPUTS:
metabolite_structure – updated metabolite structure
IDAdded – list of IDs (inchiString, inchiKey, smiles) added
- addMetFormulaCharge(metabolite_structure, startSearch, endSearch)[source]¶
Calculates charged formula and neutral formula from the inchiString
Uses getInchiString2ChargedFormula to calculate the charge and the neutral formula for each metabolite in the metabolite structure.
- USAGE:
[metabolite_structure] = addMetFormulaCharge (metabolite_structure, startSearch, endSearch)
- INPUTS:
metabolite_structure – metabolite structure
- OPTIONAL INPUTS:
startSearch – numeric index where the search should start in the metabolite structure (default: 1, all metabolites in the structure are searched)
endSearch – numeric index where the search should end in the metabolite structure (default: number of metabolites in the structure)
- OUTPUTS:
metabolite_structure – updated metabolite structure
- check4DuplicatesInList(list)[source]¶
Checks for duplicate entries in a list
- USAGE:
[listDuplicates] = check4DuplicatesInList (list)
- INPUT:
list – list of entries, e.g. metabolite abbreviations
- OUTPUT:
listDuplicates – list of duplicated entries; the second (or later) occurrence of each duplicate is provided
- checkAbbrExists(list, metab_rBioNet_online, rxn_rBioNet_online, metabolite_structure_rBioNet)[source]¶
Checks whether abbreviations already exist in the VMH or rBioNet database
Checks whether the abbreviations in list already exist in the VMH or the most recent rBioNet database, either as a reaction or as a metabolite abbreviation.
- USAGE:
[VMH_existance, rBioNet_existance, metab_rBioNet_online, rxn_rBioNet_online, metabolite_structure_rBioNet] = checkAbbrExists (list, metab_rBioNet_online, rxn_rBioNet_online, metabolite_structure_rBioNet)
- INPUT:
list – list of abbreviations (metabolites or reactions); alternatively a metabolite structure, in which case additional database fields are also compared
- OPTIONAL INPUTS:
metab_rBioNet_online – rBioNet metabolite database; loaded from the online rBioNet database if not provided
rxn_rBioNet_online – rBioNet reaction database; loaded from the online rBioNet database if not provided
metabolite_structure_rBioNet – rBioNet metabolite structure; loaded from met_strc_rBioNet if not provided
- OUTPUTS:
VMH_existance – indicates whether each abbreviation exists in the VMH (online), as a reaction (2nd entry) or as a metabolite (3rd entry)
rBioNet_existance – indicates whether each abbreviation exists in rBioNet (as deposited in the COBRA Toolbox online), as a reaction (2nd entry) or as a metabolite (3rd entry)
metab_rBioNet_online – rBioNet metabolite database used
rxn_rBioNet_online – rBioNet reaction database used
metabolite_structure_rBioNet – rBioNet metabolite structure used
- checkLinkValidity(metabolite_structure, startSearch, endSearch)[source]¶
Checks the validity of collected metabolite identifier hyperlinks
Takes each of the collected metabolite identifiers (currently HMDB IDs) and tests whether the identifier still resolves. Identifiers whose links are dead or have been revoked are removed from the metabolite structure.
- USAGE:
[metabolite_structure, removed] = checkLinkValidity (metabolite_structure, startSearch, endSearch)
- INPUTS:
metabolite_structure – metabolite structure
- OPTIONAL INPUTS:
startSearch – numeric index where the search should start in the metabolite structure (default: 1)
endSearch – numeric index where the search should end in the metabolite structure (default: number of metabolites in the structure)
- OUTPUTS:
metabolite_structure – updated metabolite structure with invalid identifiers removed
removed – list of identifiers that were removed
- getIDfromMetStructure(metabolite_structure, idName)[source]¶
Retrieves a specified identifier for all metabolites in a metabolite structure
Retrieves the requested identifier (idName) for every metabolite in the metabolite structure and returns the VMH-to-identifier mappings, split into all metabolites, those with a present identifier, and those with a missing (NaN) identifier.
- USAGE:
[VMH2IDmappingAll, VMH2IDmappingPresent, VMH2IDmappingMissing] = getIDfromMetStructure (metabolite_structure, idName)
- INPUTS:
metabolite_structure – metabolite structure containing metabolite-related information and identifiers
idName – name of the identifier, as used in the metabolite structure, to be retrieved (e.g. ‘pubChemId’)
- OUTPUTS:
VMH2IDmappingAll – mapping of all VMH metabolites present in the metabolite structure (including NaNs)
VMH2IDmappingPresent – mapping of all VMH metabolites present in the metabolite structure (excluding NaNs)
VMH2IDmappingMissing – abbreviations of metabolites whose identifier is NaN in the metabolite structure
- getStatsMetStruct(metabolite_structure)[source]¶
Computes statistics on the identifiers stored in a metabolite structure
Collects the identifier field names present in the metabolite structure, counts how many metabolites carry each identifier, and assembles a table of the identifiers per metabolite.
- USAGE:
[IDs, IDcount, Table] = getStatsMetStruct (metabolite_structure)
- INPUT:
metabolite_structure – metabolite structure
- OUTPUTS:
IDs – list of identifier (field) names
IDcount – count of metabolites carrying each identifier
Table – table listing the identifiers per metabolite
- list2MetaboliteStructure(fileName, molFileDirectory, metList, fileNameOutput, metabolite_structure_rBioNet, customMetAbbrList)[source]¶
Reads a metabolite list or xlsx file and converts it into a metabolite structure
Reads an xlsx file (or a metabolite list) and converts it into a metabolite structure, then annotates the metabolites from multiple resources. The minimum requirement is that the VMH IDs are present in one column of the table.
- USAGE:
[metabolite_structure, rBioNet_existance, VMH_existance] = list2MetaboliteStructure (fileName, molFileDirectory, metList, fileNameOutput, metabolite_structure_rBioNet, customMetAbbrList)
- INPUTS:
fileName – name of the xlsx file to read in
molFileDirectory – location where the mol files obtained from ctf are located and where new mol files are added
- OPTIONAL INPUTS:
metList – metabolite list used instead of an xlsx file; must have a header row and be tab delimited
fileNameOutput – file name under which the metabolite structure is saved (default: ‘collectedMetStruct.mat’)
metabolite_structure_rBioNet – rBioNet metabolite structure; loaded from met_strc_rBioNet_new if not provided
customMetAbbrList – list of metabolite abbreviations against which uniqueness is also checked
- OUTPUTS:
metabolite_structure – metabolite structure containing the metabolites with VMH ID listed in the file
rBioNet_existance – indicates whether the query abbreviation already exists in rBioNet (col 1: assigned initial VMHId, col 2: exists as reaction abbr, col 3: exists as metabolite abbr, col 4: VMHId used instead of col 1 if not empty)
VMH_existance – indicates whether the query abbreviation already exists in the VMH online (col 1: assigned initial VMHId, col 2: exists as reaction abbr, col 3: exists as metabolite abbr)
- verifyInchiString(metabolite_structure)[source]¶
Verifies that the inchiString and the formula/charge match for each metabolite
Verifies whether the inchiString and the formula/charge match for the entries in the metabolite structure. If the inchiString is neutral but the chargedFormula is not neutral, only a note is added to the inchiString source. If the inchiString does not match, or represents a different charge (not neutral and not overlapping with the metabolite charge), the inchiString is removed from the metabolite structure and added to an IDsSuggested list.
- USAGE:
[metabolite_structure, IDsSuggested] = verifyInchiString (metabolite_structure)
- INPUT:
metabolite_structure – metabolite structure
- OUTPUTS:
metabolite_structure – updated metabolite structure
IDsSuggested – list of inchiStrings removed and suggested for review