RDKit toolkit实战三:Generating Similarity Maps Using Fingerprints

一、RDKit简介

RDKit是一款开源化学信息学与机器学习工具包,提供C++和Python的API接口。
RDKit官网http://www.rdkit.org/
RDKit的编译安装及Python(2.7)绑定见博文:
RDKit iPython Notebook参考网站:https://nbviewer.jupyter.org/gist/madgpap/7673276
参考网站:http://www.rdkit.org/docs/GettingStartedInPython.html#generating-similarity-maps-using-fingerprints
RDKit-cd

实战体验

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!Python2.7
from rdkit import Chem
from rdkit.Chem import Descriptors
from rdkit.Chem import AllChem
from rdkit.Chem.Draw import SimilarityMaps
m = Chem.MolFromSmiles('c1ccccc1C(=O)O')
Descriptors.TPSA(m)
m = Chem.MolFromSmiles('c1ccccc1C(=O)O')
AllChem.ComputeGasteigerCharges(m)
float(m.GetAtomWithIdx(0).GetProp('_GasteigerCharge'))
get_ipython().run_line_magic('matplotlib', 'inline')
mol = Chem.MolFromSmiles('COc1cccc2cc(C(=O)NCCCCN3CCN(c4cccc5nccnc54)CC3)oc21')
AllChem.ComputeGasteigerCharges(mol)
contribs = [float(mol.GetAtomWithIdx(i).GetProp('_GasteigerCharge')) for i in range(mol.GetNumAtoms())]
fig = SimilarityMaps.GetSimilarityMapFromWeights(mol, contribs, colorMap='jet', contourLines=10)
from rdkit.Chem import rdMolDescriptors
contribs = rdMolDescriptors._CalcCrippenContribs(mol)
fig = SimilarityMaps.GetSimilarityMapFromWeights(mol,[x for x,y in contribs], colorMap='jet', contourLines=10)

Jupyter Notebooks效果

RDKit-cd1
RDKit-vcd

推荐文章