From 9184864305f7bfbf411fdcf2f37606762516f6c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Nov 2024 14:48:21 +0100 Subject: [PATCH] added identifiers for swiss lipids --- omnipath_metabo/data/resource-labels.yaml | 6 ++++++ omnipath_metabo/schema/_structure.py | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/omnipath_metabo/data/resource-labels.yaml b/omnipath_metabo/data/resource-labels.yaml index d254fd4..2931e03 100644 --- a/omnipath_metabo/data/resource-labels.yaml +++ b/omnipath_metabo/data/resource-labels.yaml @@ -35,3 +35,9 @@ lipidmaps: LIPIDBANK_ID: LipidBank PLANTFA_ID: PlantFAdb NAME: Name +swisslipids: + CHEBI: ChEBI + LIPID MAPS: LIPID MAPS + HMDB: HMDB + MetaNetX: MetaNetX + Synonyms*: Synonym \ No newline at end of file diff --git a/omnipath_metabo/schema/_structure.py b/omnipath_metabo/schema/_structure.py index 92b8c94..a8ceb63 100644 --- a/omnipath_metabo/schema/_structure.py +++ b/omnipath_metabo/schema/_structure.py @@ -140,9 +140,17 @@ def __iter__(self): } -class SwissLipids(): +class SwissLipids(ResourceBase): scheme = Structure name = 'SwissLipids' + id_fields = [ + 'CHEBI', + 'LIPID MAPS', + 'HMDB', + 'MetaNetX', + 'Synonyms*' + ] + def __iter__(self): for met in swisslipids.swisslipids_lipids(): if met['Mass (pH7.3)'] == '': @@ -160,7 +168,12 @@ def __iter__(self): met['SMILES (pH7.3)'], met['InChI (pH7.3)'], ), - 'properties':(mass, 0, charge, met['Formula (pH7.3)']) + 'properties':(mass, 0, charge, met['Formula (pH7.3)']), + 'identifiers':[ + (name, key) + for key in self.id_fields + if (name := met[key]) + ] }