数据挖掘 发表于 2013-9-27 15:49:22

借助pymol指定氢键规则自动过滤化合物

背景:药物虚拟筛选之后,根据构象挑选化合物。
比如晶体结构表明,抑制剂一定会和那几个氨基酸残基发生氢键作用。
我们就可以把这个作为筛选的规则。
借助于脚本可以节省时间,缩小工作量。
说明:
这里提供的是单个大分子和配体的处理,
如果有需要的话,我后面会给出批量处理的脚本。或者自己写个循环。
我目前不知道怎么把命令行的参数传到脚本中,有谁知道的话请联系我。
脚本:hbond.py
==============================
#744891290@qq.com
#author: Zhaoqiang Chen
#Function:find hbonds between ligands and receptor
#Usage: pymol -rkqc showbonds.py
#reference: QUEEN University list_hbonds.py
from pymol import cmd
cmd.fetch('1tl9')
#cmd.remove('solvent')
selection="1tl9 & resn AR7"#AR7 is the ligand
selection2="1tl9 & c. a &! resn HOH" #the chain a in protein ,don't include waters

#chain a == c. a
#chain a !=c.a#!!!! because '.' inthe python is very important (object and method)
hb=cmd.find_pairs(selection,selection2,mode=1,cutoff=3.2,angle=55)
#when mode=0 the angle and cutoff is no limit
#

for pairs in hb:
#print pairs," ",pairs," ",pairs,"",pairs
      #m1=[]
#cmd.iterate("%s and index %s"%(pairs ,pairs),'m1.append("%s%1s/%3s %s/%-4s"%(model,chain,resn,resi,name))')
cmd.iterate("%s and index %s"%(pairs ,pairs),'print "%s%1s/%3s %s/%-4s"%(model,chain,resn,resi,name),') #there is a port to stor information by m1.append
cmd.iterate("%s and index %s"%(pairs ,pairs),'print "%s%1s/%3s %s/%-4s"%(model,chain,resn,resi,name),')
#print m1,m1,m1

print cmd.distance("%s and index %s" %(pairs,pairs), "%s and index %s" %(pairs,pairs))
#line="distance "+pairs+" and index "+str(pairs)+","+pairs+" and index "+str(pairs)
#line2=pairs+" and index "+str(pairs)+","+pairs+" and index "+str(pairs)

#print line
#print cmd.do(line)
#print cmd.distance(line2)




==============================

执行方法:pymol -c hbond.py
如果在使用过程遇到问题可以联系我: 744891290@qq.com


======
如果有需要的话,我后面会给出批量处理的脚本。或者自己写个循环。
我目前不知道怎么把命令行的参数传到脚本中,有谁知道的话请联系我。
无意中发现 pymol -pc 可以彻底进入pymol的命令行,quit退出

爱笑的格格 发表于 2013-9-28 21:15:52

顶一个{:soso_e102:}
页: [1]
查看完整版本: 借助pymol指定氢键规则自动过滤化合物