From 9a50189ac9b11caf5f604a0c18f623f13b86606a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Nov 2024 13:39:31 +0100 Subject: [PATCH] `id_types` provides resource labels --- omnipath_metabo/data/resource-labels.yaml | 8 ++++---- omnipath_metabo/schema/_structure.py | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/omnipath_metabo/data/resource-labels.yaml b/omnipath_metabo/data/resource-labels.yaml index 99b0234..4a1ecf2 100644 --- a/omnipath_metabo/data/resource-labels.yaml +++ b/omnipath_metabo/data/resource-labels.yaml @@ -2,10 +2,10 @@ HMDB: kegg_id: KEGG bigg_id: BIGG pbd_id: PBD - wikipedia: WikiPedia - chemspiter: ChemSpider - fbonto: FBOnto - chebi: ChEBI + wikipedia_id: WikiPedia + chemspider_id: ChemSpider + fbonto_id: FBOnto + chebi_id: ChEBI biocyc_id: BioCyc drugbank_id: DrugBank foodb_id: FoodDB diff --git a/omnipath_metabo/schema/_structure.py b/omnipath_metabo/schema/_structure.py index 9d70cf3..ebdad7d 100644 --- a/omnipath_metabo/schema/_structure.py +++ b/omnipath_metabo/schema/_structure.py @@ -184,3 +184,9 @@ def __iter__(self): 'structure': (row[0], row[3], row[6]), 'properties':(row[7], row[8], None, row[10]) } + +def _id_types(): + if 'ID_TYPES' not in globals(): + globals()['ID_TYPES'] = _data.load('resource-labels') + + return globals()['ID_TYPES'] \ No newline at end of file