我想繪製一個分佈alpha-cabon
到nitrogen
鍵距離的泛素蛋白。所以我下載了1UBQ.pdb from RCSB website。現在使用biopython
,我試圖找到所有alpha-cabon(CA)
到nitrogen(N)
債券之間的距離。任何人都可以幫助我理解並解決這個錯誤嗎?
我試圖做類似下面代碼:
import sys
#from Bio.PDB import *
from Bio.PDB.PDBParser import PDBParser
from numpy import loadtxt
pdb1 ='/home/devanandt/Documents/VMD/1UBQ.pdb'
sys.stdout = open('file_ubq', 'w')
parser=PDBParser(PERMISSIVE=1)
#file=open('1UBQ.pdb','r')
#header_dict=parse_pdb_header(file)
#file.close()
i=1
structure = parser.get_structure('1UBQ',pdb1)
for model in structure:
for chain in model:
for residue in chain:
for atom in residue:
model = structure[0]
chain = model['A']
residue_1 = chain[i]
atom_1 = residue_1['N']
atom_2 = residue_1['CA']
distance = atom_1-atom_2
#print atom.get_vector(),atom.name,distance
print distance
i=i+1
#lines = loadtxt("file_ubq")
而且我得到的文件「file_ubq」輸出象下面這樣:
1.47369
1.4966
1.47547
1.51187
1.44885
1.50423
1.47052
1.48006
1.50265
.
.
.
.
1.48417
1.47194
1.45661
1.47023
但是旁邊這一點,我有錯誤太像如下:
return self.child_dict[id]
KeyError: (' ', 77, ' ')
----------------------------------------------
Program exited successfully with errcode (1)
Press the Enter key to close this terminal ...
EXECUTING:
/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py
----------------------------------------------
Traceback (most recent call last):
File "/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py", line 38, in <module>
residue_1 = chain[i]
File "/usr/lib/pymodules/python2.7/Bio/PDB/Chain.py", line 67, in __getitem__
return Entity.__getitem__(self, id)
File "/usr/lib/pymodules/python2.7/Bio/PDB/Entity.py", line 38, in __getitem__
return self.child_dict[id]
KeyError: (' ', 77, ' ')
----------------------------------------------
Program exited successfully with errcode (1)
Press the Enter key to close this terminal ...
EXECUTING:
/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py
----------------------------------------------
Traceback (most recent call last):
File "/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py", line 38, in <module>
residue_1 = chain[i]
File "/usr/lib/pymodules/python2.7/Bio/PDB/Chain.py", line 67, in __getitem__
return Entity.__getitem__(self, id)
File "/usr/lib/pymodules/python2.7/Bio/PDB/Entity.py", line 38, in __getitem__
return self.child_dict[id]
KeyError: (' ', 77, ' ')
----------------------------------------------
Program exited successfully with errcode (1)
Press the Enter key to close this terminal ...
^CEXECUTING:
/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py
----------------------------------------------
Traceback (most recent call last):
File "/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py", line 38, in <module>
residue_1 = chain[i]
File "/usr/lib/pymodules/python2.7/Bio/PDB/Chain.py", line 67, in __getitem__
return Entity.__getitem__(self, id)
File "/usr/lib/pymodules/python2.7/Bio/PDB/Entity.py", line 38, in __getitem__
return self.child_dict[id]
KeyError: (' ', 77, ' ')
----------------------------------------------
Program exited successfully with errcode (1)
Press the Enter key to close this terminal ...
EXECUTING:
/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py
----------------------------------------------
Traceback (most recent call last):
File "/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py", line 38, in <module>
residue_1 = chain[i]
File "/usr/lib/pymodules/python2.7/Bio/PDB/Chain.py", line 67, in __getitem__
return Entity.__getitem__(self, id)
File "/usr/lib/pymodules/python2.7/Bio/PDB/Entity.py", line 38, in __getitem__
return self.child_dict[id]
KeyError: (' ', 77, ' ')
----------------------------------------------
Program exited successfully with errcode (1)
Press the Enter key to close this terminal ...
EXECUTING:
/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py
----------------------------------------------
Traceback (most recent call last):
File "/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py", line 38, in <module>
residue_1 = chain[i]
File "/usr/lib/pymodules/python2.7/Bio/PDB/Chain.py", line 67, in __getitem__
return Entity.__getitem__(self, id)
File "/usr/lib/pymodules/python2.7/Bio/PDB/Entity.py", line 38, in __getitem__
return self.child_dict[id]
KeyError: (' ', 77, ' ')
----------------------------------------------
Program exited successfully with errcode (1)
Press the Enter key to close this terminal ...
EXECUTING:
/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py
----------------------------------------------
Traceback (most recent call last):
File "/home/devanandt/Documents/PYTHON/ubq/src/ubq_dist_pdf.py", line 38, in <module>
residue_1 = chain[i]
File "/usr/lib/pymodules/python2.7/Bio/PDB/Chain.py", line 67, in __getitem__
return Entity.__getitem__(self, id)
File "/usr/lib/pymodules/python2.7/Bio/PDB/Entity.py", line 38, in __getitem__
return self.child_dict[id]
KeyError: (' ', 77, ' ')
----------------------------------------------
Program exited successfully with errcode (1)
Press the Enter key to close this terminal ...
任何人都可以幫助我理解和解決這個錯誤嗎?
但我必須在循環權增加,從而得到76米殘渣鍵長。我注意到錯誤從第77個水分子點開始。 – dexterdev 2014-10-04 16:08:10
沒有它的不工作 – dexterdev 2014-10-04 16:20:51
你問的pdb文件或程序。 – dexterdev 2014-10-04 17:03:40