from cresset import flare
先用Flare导入数据集:liggrep.flr,再在python窗口创建项目对象p。
p = flare.main_window().project
残基GLY863与TYR896是我们要分析的对象,如图1所示。
GLY863 = p.proteins[0].residues.find('863')[0]
TYR896 = p.proteins[0].residues.find('896')[0]
如果与GLY863发生氢键相互作用,则添加标签:GLY863_HB
for l in p.ligands:
hbond = flare.contacts.h_bonds([p.proteins[0],l])
for h in hbond:
if (h.points[0][0] in l.atoms and h.points[1][0] in GLY863.atoms) or (h.points[1][0] in l.atoms and h.points[0][0] in GLY863.atoms):
l.properties['Tags'].value=list(l.properties['Tags'].value)+['GLY863_HB']
如果与TYR896发生pi-pi堆积,则添加标签:TYR896_Pi_Stack
for l in p.ligands:
ar = flare.contacts.aromatic_aromatic([p.proteins[0],l])
for i in range(0,len(ar)):
p_i = ar[i].points
if (p_i[0][0] in l.atoms and p_i[1][0] in TYR896.atoms) or (p_i[1][0] in l.atoms and p_i[0][0] in TYR896.atoms):
l.properties['Tags'].value=list(l.properties['Tags'].value)+['TYR896_Pi_Stack']