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

博文

统计配体周围氨基酸的情况

已有 2269 次阅读 2013-12-28 14:16 |个人分类:DrugDesign|系统分类:科研笔记

这个脚本需要在pymol中使用

####################

from pymol import cmd
from pymol import stored

#function:count the number of residue around 3,4, 5,A
#to improve the accurancy of count,you should make sure the pdb just contain one drug
result=[]
def countresidue(ligname,distance):
selectline="select ligatom,resn "+ligname +" around " +distance

cmd.do(selectline)
allresidu=["ALA","ARG","ASP","CYS","GLN","GLU","HIS","GLY","ILE","ASN","LEU","LYS","MET","PHE","PRO","SER","THR","TRP","TYR","VAL"]
#print selectline
#cmd.do("remove all &!chain a")
cmd.do("select ligres,byres ligatom")
stored.list=[]
cmd.iterate("ligres and name ca","stored.list.append(resn)");

#print stored.listo
global result
result=[]
for resn in allresidu:
num=0
for i in stored.list:
if(i==resn):
num+=1
lineresu=resn+"   "+str(num)
print lineresu
result.append(lineresu)
return result


cmd.extend("countresidue",countresidue)


###########################

批量统计

#################################



import time
from pymol import cmd
from pymol import stored
import subprocess

file=open("pdbligbetter2")
filew=open("resultcountresi5a","a")









cmd.do("cd /var/www/html/htmlczq/pymolscript")
cmd.do("run residuecount.py")


cmd.do("pwd")
for line in file:
pdblig=line.split()
#print pdblig[0]
line1="load "+pdblig[0]+'.pdb'
cmd.do(line1);
cmd.do("remove resn hoh")

cmd.do("remove all &! chain a")




line1="countresidue "+pdblig[1]+ ",5"
cmd.do(line1)
filew.write(pdblig[0])
filew.write("  ^^^^^n")

filew.write( str(result))
filew.write("n")
cmd.do("delete all")






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

上一篇:批量下载pdb
下一篇:2dsdf转3d的时候保持手性

0

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

数据加载中...

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

GMT+8, 2021-10-26 17:48

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部