Skip to content

Commit 36de690

Browse files
committed
added class for Ramp DB
1 parent 1cc75fd commit 36de690

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

omnipath_metabo/schema/_structure.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String, types
22
from sqlalchemy.orm import relationship
33
from ._base import Base
4-
from pypath.inputs import hmdb, swisslipids, lipidmaps
4+
from pypath.inputs import hmdb, swisslipids, lipidmaps, ramp
55

66
class MolType(types.UserDefinedType):
77
cache_ok = True
@@ -66,4 +66,17 @@ def __iter__(self):
6666

6767
yield met['id'], smiles
6868

69-
#Ramp and LipidMaps
69+
class Ramp():
70+
scheme = Structure
71+
name = 'RaMP'
72+
def __iter__(self):
73+
sqlite_connection = ramp.ramp_raw(['chem_props'], sqlite = True)
74+
query = """
75+
SELECT ramp_id, iso_smiles FROM chem_props
76+
"""
77+
cursor = sqlite_connection.get_cursor()
78+
cursor.execute()
79+
connection.commit()
80+
81+
for row in cursor.fetchall():
82+
yield row

0 commit comments

Comments
 (0)