我试图找出属于两个不同链的两个原子是否被认为是“束缚的”。这是基于这样一个事实:如果距离(欧几里得,可以通过给定的x,y,z坐标找到)短于两个原子的范德华加上0.5A,那么它被认为是有界的问题是我不知道如何计算每个原子的范德瓦尔斯。因为在PDB中,原子名类似于CB1、CA等,而不是单个原子例如,我知道n的waals半径。我可以编写代码来计算原子之间的原子距离,但是我没有完成van der 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,分别是碳和氧,并取它们的范德华值。尽管如此,我仍然在努力编写代码来创建两条链之间的for循环,并以
如果“vanderwaalsofatomofchaina+vanderwaalsofatomofchainb+0.5”>“基于欧几里得公式的距离”:等。
编辑:我设法将van der waals半径添加到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的所有原子。每个列表中的槽给出范德华半径,我需要计算每个列表的第12个a加上每个列表的第12个b加上0.5,并将其与欧几里得公式进行比较!
最后编辑:写了这段代码,但它不起作用基于这个想法,我必须比较链a和链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]。它给出了所有原子的范德瓦尔兹值。这个文件来自我最近做的一个项目,是老师给我的。
顺便问一下,为什么不做两个循环呢?一个用于链A,另一个用于链B。我没有尝试您的代码,但A的长度可能与B不同。当您使用zip()时,()中两个对象的长度必须相等,我认为(未验证)。

07-26 09:34