Skip to content

Commit

Permalink
Generator for populating properties table created
Browse files Browse the repository at this point in the history
  • Loading branch information
for-hyde committed Nov 1, 2024
1 parent 51fcead commit 0d94e16
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions omnipath_metabo/schema/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,32 @@ def load(self):
inserted_str = {
(strid_to_smile[s[1]], s[2], s[3], s[4])
for s in cached_resource.cached['struct'])

property_records = (
(
identifier_ids[
(record['structure'][0],
strids[record['structure'][1]],
resid,
True,
resid
)
],
) + record['properties']

for record in cached_resource.cache['struct']
)

with raw_con.cursor() as cursor:
query = """
INSERT INTO properties (identifier_id, mw, monoiso_mass, charge, formula) VALUES %s
"""
psycopg2.extras.execute_values(cursor, query, inserted_str, page_size = 1000)


#self.indexer()


_log(f'Finished loading {self.resource.name}.', level = -1)

def update_mol_column(self):
Expand Down

0 comments on commit 0d94e16

Please sign in to comment.