#导入模块和包
#!/usr/bin/python3
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem.Draw import SimilarityMaps
import matplotlib as mpl
#载入分子,计算指纹
m1 = Chem.MolFromSmiles(‘c1cccc2c1cccc2’)
m2 = Chem.MolFromSmiles(‘c1cccc2c1cncc2’)
fig,maxweight = SimilarityMaps.GetSimilarityMapForFingerprint(m1,m2,SimilarityMaps.GetAPFingerprint)
#获取相似性label
ax = fig.axes[0]
ax.set_title(‘pyridine compared to benzene’)
fig