python – 氨基酸结合位点发现,蛋白质数据库
我试图找出属于两个不同链的两个原子是否会被视为“束缚”.这是基于以下事实:如果距离(欧几里得,可以通过给定的x,y,z坐标找到)比两个原子的范德华加0.5A那么它被认为是束缚的.问题是我不明白如何计算每个原子的范德华力.因为在PDB中,原子名称类似于CB1,CA等,而不是单个原子.我知道N的Waals半径.我可以编写代码来计算原子之间的原子距离,但我没有做范德瓦尔斯部分,这是必不可少的.这是我编写的代码,用于从两个链中提取信息以及PDB的链接:
http://www.rcsb.org/pdb/explore.do?structureId=3KUD a = open('3kud.pdb','r') # opening the PDB file b = a.readlines() # reading the file line by line c = [x.strip('n') for x in b] # extracting 'n' from each line d = [] # Creating a function that extract information from the given PDB list(only the ATOM parts) def pdbread(): global c # calling c in order to define d based on c. global d # empty list that contains all the atoms in the list for i in range(len(c)): if c[i].startswith('ATOM'): d.append(c[i]) else: continue return d print 'The atom part of the given PDB file',pdbread() w = [] # I,then,splitted the given whole atom list part so that each column could be read on the file. for i in range(len(d)): line = d[i].split() w.append(line) Chain_A = [] Chain_B = [] for z in w: if z[4] == 'A': Chain_A.append(z) if z[4] == 'B': Chain_B.append(z) print 'Splitted form of the atom part of the PDB file',w print 'Chain A :',Chain_A print 'Chain B:',Chain_B 我可以在这两个链之间创建for循环并比较距离,只要我得到如何计算两个可能相互作用的原子之间的范德华半径. 编辑:我决定继续前进,假设每个原子是第一个字母,使得CB,OG1分别是碳和氧,并将采用他们的范德华值.尽管如此,我仍然在努力编写代码来创建两个链之间的循环并以形式计算距离 编辑:我设法将范德华半径添加到Chain_A和Chain_B中的每个列表,这里是代码: for z in w: if z[2][0] == 'N': z.append(1.55) if z[2][0] == 'O': z.append(1.52) if z[2][0] == 'C': z.append(1.7) if z[2][0] == 'S': z.append(1.8) if z[2][0] == 'H': z.append(1.2) 但我需要的是找出如何为两个链创建一个for循环.我的意思是我必须比较A和B的所有原子.12.每个列表中的槽给出范德华半径,我需要计算每个A列表的第12个加上每个B列表的第12个加0.5并将其与欧几里德公式! 最终编辑:写了这段代码,但它不起作用!基于这个想法,我必须将Chain_A的每个元素与Chain_B进行比较. A_binding = [] B_binding = [] for x,y in zip(Chain_A,Chain_B): if x[12] + y[12] + 0.5 > sqrt((float(x[6])-float(y[6]))**2 + (float(x[7])-float(y[7]))**2 + (float(x[8])-float(y[8]))**2): A_binding.append(x) B_binding.append(y) print A_binding print B_binding 解决方法
也许这可以帮助你:
Atoms force field values 您感兴趣的部分是epsilon_vdw_PDB()[0].它为您提供所有原子van der waalz值.这个文件来自我最近的一个项目,由我的老师提供. 顺便问一下,为什么不为循环制作2个?一个用于链A,另一个用于链B.我没有尝试你的代码,但是A的长度可能与B不同.当你使用zip()时,()里面的2个对象的长度必须相等我想(没有验证). (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |