autodataming的个人博客分享 http://blog.sciencenet.cn/u/autodataming

博文

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

已有 7381 次阅读 2013-9-27 15:38 |个人分类:DrugDesign|系统分类:科研笔记| style, 氨基酸, 工作量, 化合物

背景:药物虚拟筛选之后,根据构象挑选化合物。

比如晶体结构表明,抑制剂一定会和那几个氨基酸残基发生氢键作用。

我们就可以把这个作为筛选的规则。

借助于脚本可以节省时间,缩小工作量。

说明:

这里提供的是单个大分子和配体的处理,

如果有需要的话,我后面会给出批量处理的脚本。或者自己写个循环。

3]吴平  2016-6-24 09:37
from sys import argv


脚本:hbond.py

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

# perlcoder weixin
#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 '.' in  the 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[0][0]," ",pairs[0][1]," ",pairs[1][0],"  ",pairs[1][1]
       #m1=[]
#cmd.iterate("%s and index %s"%(pairs[0][0] ,pairs[0][1]),'m1.append("%s%1s/%3s %s/%-4s"%(model,chain,resn,resi,name))')
cmd.iterate("%s and index %s"%(pairs[0][0] ,pairs[0][1]),'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[1][0] ,pairs[1][1]),'print "%s%1s/%3s %s/%-4s"%(model,chain,resn,resi,name),')
#print m1,m1,m1

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

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



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


执行方法:pymol -c hbond.py

如果在使用过程遇到问题可以联系我: 744891290@qq.com



======

如果有需要的话,我后面会给出批量处理的脚本。或者自己写个循环。

我目前不知道怎么把命令行的参数传到脚本中,有谁知道的话请联系我。

无意中发现 pymol -pc 可以彻底进入pymol的命令行,quit退出









https://wap.sciencenet.cn/blog-950202-728312.html

上一篇:sed
下一篇:在linux随时随地使用MGL当中的脚本
收藏 IP: 210.28.66.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (4 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-20 05:58

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部