From 55ba43f10a332d8bd2af160bddd8b4f6e77383a7 Mon Sep 17 00:00:00 2001 From: deeenes Date: Thu, 14 Nov 2024 14:57:06 +0100 Subject: [PATCH] HMDB foreign resource names insert works --- omnipath_metabo/data/resource-labels.yaml | 5 +++-- omnipath_metabo/schema/_main.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/omnipath_metabo/data/resource-labels.yaml b/omnipath_metabo/data/resource-labels.yaml index 4a1ecf2..73cb071 100644 --- a/omnipath_metabo/data/resource-labels.yaml +++ b/omnipath_metabo/data/resource-labels.yaml @@ -1,7 +1,7 @@ HMDB: kegg_id: KEGG bigg_id: BIGG - pbd_id: PBD + pdb_id: PBD wikipedia_id: WikiPedia chemspider_id: ChemSpider fbonto_id: FBOnto @@ -11,5 +11,6 @@ HMDB: foodb_id: FoodDB metlin_id: Metlin pubchem_compound_id: PubChem - phenol_explorer_id: Phenol-Explorer + phenol_explorer_compound_id: Phenol-Explorer vmh_id: Virtual Metbolic Human + knapsack_id: Knapsack diff --git a/omnipath_metabo/schema/_main.py b/omnipath_metabo/schema/_main.py index 18dccb5..7a123e2 100644 --- a/omnipath_metabo/schema/_main.py +++ b/omnipath_metabo/schema/_main.py @@ -132,9 +132,9 @@ def load(self): insert_resource = ( insert(_structure.Resource). - values(name = resource_labels). + values([{'name': l} for l in resource_labels]). returning(_structure.Resource.id)) - + insert_resource = insert_resource.on_conflict_do_update( index_elements=['name'], set_ = {