Skip to content

Commit

Permalink
properties table set for HMDB, Swisslipids, and Lipidmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
for-hyde committed Nov 5, 2024
1 parent 3510bdf commit a40479e
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions omnipath_metabo/schema/_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,30 @@ def __iter__(self):

for met in hmdb.metabolites_processed(
'accession',
'smiles'
'smiles',
'average_molecular_weight',
'monisotopic_molecular_weight',
'chemical_formula'
):
yield met[0]
yield {
'structure':(met[0][0], met[0][1]),
'properties': (met[0][2], met[0][3], None, met[0][4])
}

class SwissLipids():
scheme = Structure
name = 'SwissLipids'
def __iter__(self):
for met in swisslipids.swisslipids_lipids():
yield met['Lipid ID'], met['SMILES (pH7.3)']
if met['Mass (pH7.3)'] == '':
mass = 0
else:
mass = met['Mass (pH7.3)']

yield {
'structure':(met['Lipid ID'], met['SMILES (pH7.3)']),
'properties':(mass, 0, met['Charge (pH7.3)'],met['Formula (pH7.3)'])
}


class LipidMaps():
Expand All @@ -110,7 +124,10 @@ def __iter__(self):

continue

yield met['id'], smiles
yield {
'structure':(met['id'], smiles),
'properties':(met['annot'].get('EXACT_MASS', None), None, None, met['name'].get('FORMULA', None) )
}

class Ramp():
scheme = Structure
Expand Down

0 comments on commit a40479e

Please sign in to comment.