import sys,os
sys.path.append('/public/gkxiao/software/OpenEye-toolkits-python3-linux-x64-2021.1.1')
from openeye import oechem
from openeye import oedepict
from openeye import oegrapheme
os.chdir('/public/gkxiao/work/oechem_interaction/5mo4')
导入蛋白结构
ifile = '5mo4_prot.pdb'
ifs = oechem.oemolistream()
ifs.open(ifile)
prot = oechem.OEGraphMol()
oechem.OEReadMolecule(ifs, prot)
True
导入配体结构
ifile = '5mo4_AY7.mol2'
ifs = oechem.oemolistream()
ifs.open(ifile)
AY7 = oechem.OEGraphMol()
oechem.OEReadMolecule(ifs, AY7)
True
开始相互作用分析
xbond_ops = oechem.OEPerceiveInteractionOptions()
xbond_ops.SetMaxHalogenBondDistance(3.77)
开水绘图
asite = oechem.OEInteractionHintContainer(prot, AY7)
oechem.OEPerceiveInteractionHints(asite,xbond_ops)
True
oegrapheme.OEPrepareActiveSiteDepiction(asite)
True
设置标题与图标规格
asite.SetTitle('PDB 5MO4-AY7(ABL001)')
width = 800
height = 600
image = oedepict.OEImage(width, height)
cframe = oedepict.OEImageFrame(image, width * 0.80, height, oedepict.OE2DPoint(0.0, 0.0))
lframe = oedepict.OEImageFrame(image, width * 0.20, height,
oedepict.OE2DPoint(width * 0.80, 0.0))
相互作用可视化
opts = oegrapheme.OE2DActiveSiteDisplayOptions(cframe.GetWidth(), cframe.GetHeight())
adisp = oegrapheme.OE2DActiveSiteDisplay(asite, opts)
oegrapheme.OERenderActiveSite(cframe, adisp)
lopts = oegrapheme.OE2DActiveSiteLegendDisplayOptions(10, 1)
oegrapheme.OEDrawActiveSiteLegend(lframe, adisp, lopts)
保存图片:1张为png,一张为svg
oedepict.OEWriteImage('5mo4-AY7.svg', image)
oedepict.OEWriteImage('5mo4-AY7.png', image)
True