[MMTK] Bug (?) in reading/writing PDBs
Urban Hafner
ujh at gmx.com
Sat Jan 31 14:55:20 CET 2004
Hej,
when I run the following script I get an error:
urban at bettong:~/Uni/ws0304/pp/shackle/t$ cat bug.py
import MMTK.PDB
import sys
conf = MMTK.PDB.PDBConfiguration(sys.argv[1])
chains = conf.createPeptideChains()
del conf
out = MMTK.PDB.PDBOutputFile(sys.argv[1]+".new")
out.write(chains)
out.close()
aconf = MMTK.PDB.PDBConfiguration(sys.argv[1]+".new")
achains = aconf.createPeptideChains()
del aconf
The error looks like this:
urban at bettong:~/Uni/ws0304/pp/shackle/t$ python bug.py pdbs/1aru.ent
Traceback (most recent call last):
File "bug.py", line 13, in ?
achains = aconf.createPeptideChains()
File "/sw/lib/python2.3/PDB.py", line 168, in createPeptideChains
if not line.strip():
File
"/sw/src/root-mmtk-2.2-1/sw/lib/python2.3/site-packages/MMTK/
Proteins.py", line 243, in __init__
File
"/sw/src/root-mmtk-2.2-1/sw/lib/python2.3/site-packages/MMTK/
Biopolymers.py", line 79, in _setupChain
File "/sw/lib/python2.3/PDB.py", line 33, in applyTo
answer = None
File "/sw/lib/python2.3/PDB.py", line 309, in setResidueConfiguration
if len(parts) == 1:
IOError: Atom O2 of PDB residue PRO not found in residue Pro of object
.Pro336
urban at bettong:~/Uni/ws0304/pp/shackle/t$
The PDB file is 1aru from PDB. But this doesn't just happen with this
file but
with every PDB that ends with Proline. If you compare the two pdbs you
see this
difference:
Original PDB:
ATOM 2458 N PRO 344 27.106 10.396 26.216 1.00 12.65
1ARU2629
ATOM 2459 CA PRO 344 27.375 9.290 27.115 1.00 13.54
1ARU2630
ATOM 2460 C PRO 344 26.774 9.343 28.505 1.00 14.51
1ARU2631
ATOM 2461 O PRO 344 26.511 10.416 29.029 1.00 14.14
1ARU2632
ATOM 2462 CB PRO 344 28.878 9.208 27.125 1.00 14.06
1ARU2633
ATOM 2463 CG PRO 344 29.276 10.641 26.990 1.00 15.25
1ARU2634
ATOM 2464 CD PRO 344 28.309 11.168 25.947 1.00 12.48
1ARU2635
ATOM 2465 OXT PRO 344 26.583 8.288 29.106 1.00 17.97
1ARU2636
TER 2466 PRO 344
In the file that MMTK (or is it Scientific Python?):
ATOM 4839 C PRO A 336 26.774 9.343 28.505 0.00 0.00
C
ATOM 4840 2HB PRO A 336 29.246 8.785 28.060 0.00 0.00
H
ATOM 4841 2HD PRO A 336 28.663 10.981 24.933 0.00 0.00
H
ATOM 4842 CB PRO A 336 28.878 9.208 27.125 0.00 0.00
C
ATOM 4843 CA PRO A 336 27.375 9.290 27.115 0.00 0.00
C
ATOM 4844 CG PRO A 336 29.276 10.641 26.990 0.00 0.00
C
ATOM 4845 3HB PRO A 336 29.249 8.617 26.287 0.00 0.00
H
ATOM 4846 N PRO A 336 27.106 10.396 26.216 0.00 0.00
N
ATOM 4847 CD PRO A 336 28.309 11.168 25.947 0.00 0.00
C
ATOM 4848 3HD PRO A 336 28.115 12.233 26.074 0.00 0.00
H
ATOM 4849 2HG PRO A 336 30.309 10.725 26.652 0.00 0.00
H
ATOM 4850 3HG PRO A 336 29.161 11.165 27.939 0.00 0.00
H
ATOM 4851 HA PRO A 336 26.873 8.395 26.748 0.00 0.00
H
ATOM 4852 O2 PRO A 336 26.583 8.288 29.106 0.00 0.00
O
ATOM 4853 O1 PRO A 336 26.511 10.416 29.029 0.00 0.00
O
TER 4854 PRO A 336
END
The difference seems to be between OXT in the original file and O1 and
O2
in the second one.
So is this a bug in MMTK or in Scientific Python and is there something
I
can do about it?
Urban
PS: I'm using Scientific Python 2.4 and MMTK 2.2
More information about the mmtk
mailing list