Skip to content

Commit

Permalink
corrected indentation error on swisslipids; in loader use inchi inste…
Browse files Browse the repository at this point in the history
…ad of smiles
  • Loading branch information
for-hyde committed Nov 7, 2024
1 parent 07c34c1 commit 8c7ed24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions omnipath_metabo/schema/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def chem_properties_populate(self):
query = text(r"""
UPDATE identifiers
SET
is_polymer = (structures.smiles ~ '.*\)n.*'),
is_polymer = (structures.inchi ~ '.*\)n.*'),
has_conformation = (structures.smiles ~ '.*[\\/]=.*'),
has_stereo = (structures.smiles ~ '.*@.*'),
complete_formula = NOT (structures.smiles ~ '.*\*.*')
Expand Down Expand Up @@ -146,7 +146,7 @@ def load(self):
with raw_con.cursor() as cursor:

query = """
INSERT INTO structures (name, smiles) VALUES %s ON CONFLICT (smiles) DO nothing;
INSERT INTO structures (name, smiles, inchi) VALUES %s ON CONFLICT (inchi) DO nothing;
"""
_log("loading insert statments for structures table")
cached_resource = Tee(
Expand Down
8 changes: 4 additions & 4 deletions omnipath_metabo/schema/_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ class SwissLipids():
name = 'SwissLipids'
def __iter__(self):
for met in swisslipids.swisslipids_lipids():
if met['Mass (pH7.3)'] == '':
mass = 0
else:
mass = met['Mass (pH7.3)']
if met['Mass (pH7.3)'] == '':
mass = 0
else:
mass = met['Mass (pH7.3)']

yield {
'structure': (
Expand Down

0 comments on commit 8c7ed24

Please sign in to comment.