As you know, sqlalchemy is very useful ORM of python. I love the package and also chemoinformatician is familiar to ChEMBLDB I think.
There are very useful package for these people one is razi and the other is pychembldb.
Razi is chemical cartridge for postgressql with rdkit functionality and pychembldb is python wrapper of ChEMBLDB but not support chemical cartridge.
So is it nice if pychembldb supports chemical cartridge? I think it’s useful so I’m trying it now. I forked pychembldb and now I’m adding some function to the package. My forked repo is below.
https://github.com/iwatobipen/pychembldb/blob/raziintegration/pychembldb/__init__.py
I made rdk schema with original rdkit documentation(https://www.rdkit.org/docs/Cartridge.html). I defined the table object and made relationship between rdk schema and original chembldb table in my code.
Now public schema and rdk schema are joined with molregno. Following code is simple example. Most of code is borrowed from pychembldb original repo.
By using the package, user can access rdkit molobject directly with some query. Search molecule with substructure and get target information and etc without SQL statement.
Now I just wrote code and not have many test code. I’ll try to write more case study code in the feature.
I really thank to developer of RDKit, razi, sqlalchemy, pychembldb, and ChEMBL team!!!