Skip to content

Commit

Permalink
HMDB foreign resource names insert works
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Nov 14, 2024
1 parent 9869749 commit 55ba43f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions omnipath_metabo/data/resource-labels.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions omnipath_metabo/schema/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_ = {
Expand Down

0 comments on commit 55ba43f

Please sign in to comment.