Visualize Crippen Atom Contribution

Yesterday, I wrote that I was interested in “calcAtomGaussians”.
So, I wrote simple script to visualize molecular image with atomic contribution about logP.
In this script, query “name” is converted to smiles strings using chemspipy module, at first.
Then the smiles are converted to mol-object of RDKit.
The chemspipy require a security token; to obtain a token. So, if interested in chemspipy, you need complete the registration process.

URLs are here.

The code is ….

import sys, chemspipy
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import Crippen
import matplotlib
from matplotlib import cm

query = sys.argv[ 1 ]
c = chemspipy.find_one( query )
smi = c.smiles

mol = Chem.MolFromSmiles( smi )
contribs = Crippen.rdMolDescriptors._CalcCrippenContribs( mol )
logps, mrs = zip( *contribs )

_CalcCrippenContribs returns logps and MRs each atoms in molecule.
x,y mean atom map and z means logps.
Using these data, matplotlib module makes contour.
Let’s run scirpt.

lion$ python tofacitinib

Now I got following image.

I think RDKit is masterpiece of chemoinformatics . ;-)

More details are …


Leave a Reply

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

You are commenting using your 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.