Skip to content

Commit 293b7ce

Browse files
committed
Modify handling of results from MetabRef API
1 parent 2d78548 commit 293b7ce

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

corems/molecular_id/search/database_interfaces.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,12 @@ def get_lipid_library(
878878
{k: v for k, v in x.items() if k not in ["Molecular Data", "Lipid Tree"]}
879879
for x in lib
880880
]
881+
# Unpack the 'Lipid Fragments' key and the 'MSO Data" key from each entry
882+
for x in lib:
883+
if "Lipid Fragments" in x.keys():
884+
x.update(x.pop("Lipid Fragments"))
885+
if "MSO Data" in x.keys():
886+
x.update(x.pop("MSO Data"))
881887

882888
# Format the spectral library
883889
format_func = self._get_format_func(format)

corems/molecular_id/search/lcms_spectral_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_more_match_quals(
8888
)
8989

9090
# Get types of fragments in the lib entry
91-
lib_frags = lib_entry["fragment_types"].split(", ")
91+
lib_frags = lib_entry["fragment_types"]
9292
# make list of the fragment types that are present in the query spectrum
9393
lib_in_query_ids = list(
9494
set(

0 commit comments

Comments
 (0)