[MMTK] Problems loading certain PDB files

Peter mmtk at maubp.freeserve.co.uk
Sun Jan 22 13:59:09 CET 2006


Peter wrote:
> I found the construction.py example on your website that does this, and
> this nicely avoids the problem of detecting protonation states.
> 
> However, sometimes the deleteHydrogens() method fails:
> 
> import MMTK.PDB
> import MMTK.Proteins
> configuration = MMTK.PDB.PDBConfiguration("1BTY.pdb")
> configuration.deleteHydrogens()
> ..
> 
> 
> Traceback (most recent call last):
>    File "<pyshell#8>", line 1, in -toplevel-
>      configuration.deleteHydrogens()
>    File "C:\Python23\lib\site-packages\Scientific\IO\PDB.py", line 905, 
> in deleteHydrogens
>      r.deleteHydrogens()
>    File "C:\Python23\lib\site-packages\Scientific\IO\PDB.py", line 522, 
> in deleteHydrogens
>      self.deleteAtom(a)
>    File "C:\Python23\lib\site-packages\Scientific\IO\PDB.py", line 512, 
> in deleteAtom
>      del self.atoms[atom.name]
> KeyError: 'H'
> 
> 
> Using the stack viewer, this is failing on SER 61...
> 
> Thanks again,

It turns out PDB file 1BTY is littered with multiply defined atoms 
(including hydrogens).  I would guess MMTK cope with these, but when 
asked to delete a hydrogen twice, on the second attempt the dictionary 
element has already been removed.

Peter




More information about the mmtk mailing list