Skip to content

Commit

Permalink
structure resources: use primary ID instead of names in current recor…
Browse files Browse the repository at this point in the history
…d generators
  • Loading branch information
deeenes committed Oct 24, 2024
1 parent abb238e commit d8962bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions omnipath_metabo/schema/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def load(self):
resid = self.session.execute(insert_resource).fetchall()
self.session.commit()

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

raw_con = self.con.engine.raw_connection()

Expand Down Expand Up @@ -150,7 +150,7 @@ def load(self):
raw_con.commit()
_log('identifiers inserted.')
#self.indexer()
_log(f'{self.resource.name} loaded')
_log(f'Finished loading {self.resource.name}.', level = -1)

def update_mol_column(self):
query = text("update structures set mol = mol_from_smiles(smiles::cstring) where mol is null")
Expand Down
4 changes: 2 additions & 2 deletions omnipath_metabo/schema/_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ class Hmdb():
name = 'HMDB'
def __iter__(self):

for met in hmdb.metabolites_processed('name','smiles'):
for met in hmdb.metabolites_processed('accession', 'smiles'):
yield met[0]

class SwissLipids():
scheme = Structure
name = 'SwissLipids'
def __iter__(self):
for met in swisslipids.swisslipids_lipids():
yield met['Name'], met['SMILES (pH7.3)']
yield met['Lipid ID'], met['SMILES (pH7.3)']


class LipidMaps():
Expand Down

0 comments on commit d8962bd

Please sign in to comment.