Skip to content

Commit

Permalink
Insert try/except statement for inchi_key in case an invalid key or e…
Browse files Browse the repository at this point in the history
…mpty string exists
  • Loading branch information
bkieft-usa committed Sep 3, 2024
1 parent 468bcd5 commit 58b6e5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metatlas/plots/dill2plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def get_similar_compounds(self, use_labels=True):
out = []
cid_mz_ref = cid.mz_references[0].mz
cid_mass = cid.compound[0].mono_isotopic_molecular_weight
if cid.compound[0].inchi_key:
if cid.compound[0].inchi_key is not None:
try:
cid_inchikey_prefix = cid.compound[0].inchi_key.split('-')[0]
except:
Expand Down

0 comments on commit 58b6e5b

Please sign in to comment.