Read maestro format file from RDKit

RDKitter knows that Schrodinger contributes RDKit I think.
https://www.schrodinger.com/news/schr%C3%B6dinger-contributes-rdkit

Schrodinger provides many computational tools for drug discovery, that is not only GUI tool but also python API. Many tool can call from python and also RDKit. And RDKit can read maestro file vise versa.
It is easy to do it like reading SDFiles.
I am writing the blog post on my personal PC and I do not have schrodinger software’s license. So I got test files from schrodingers github repository.
https://github.com/schrodinger

On ipython notebook

!wget https://raw.githubusercontent.com/schrodinger/maeparser/master/test/test.mae
!wget https://github.com/schrodinger/maeparser/raw/master/test/test2.maegz
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import rdmolfiles
from rdkit.Chem.Draw import rdDepictor
from rdkit.Chem.Draw import IPythonConsole
from rdkit import rdBase
import gzip
rdDepictor.SetPreferCoordGen(True)
rdBase.rdkitVersion
>'2018.09.1'

Read mols from mae format.

maemols = rdmolfiles.MaeMolSupplier("test.mae")
mols = [m for m in maemols]
Draw.MolsToGridImage(mols)

Read mols form maegz

maemols2 = rdmolfiles.MaeMolSupplier(gzip.open("test2.maegz"))
mols2 = [m for m in maemols2]
Draw.MolsToGridImage(mols2)

Both cases work fine.
If user want to integrate rdkit and schrodinger tools, the method will be useful.
Note book uploaded my github repo.
https://nbviewer.jupyter.org/github/iwatobipen/playground/blob/master/maeparser.ipynb

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.