[MMTK] Problems loading certain PDB files

Peter mmtk at maubp.freeserve.co.uk
Fri Jan 20 12:35:54 CET 2006

khinsen at cea.fr wrote:
> On Jan 18, 2006, at 11:54, Peter wrote:
>> Aliases '1H', '2H', '3H' are missing in the database for peptide_nt  and
>> variants like peptide_nt_noh (missing in both MMTK 2.4.4 and MMTK  
>> 2.5.13)
> They are in 2.5.13, and I think it's even you who sent me the  patches! 
> I will also backport all the database patches to the 2.4 line.

My mistake, this windows machine was running MMTK 2.4.1 (I think) while
my linux box at home was using 2.4.4 - I thought I checked the database
in the MMTK-2.5.13.tar.gz file but must have made an error.

 > ...
> Strange.. that's defined. Are you sure you are using a recent  database? 
> You could have MMTKDATABASE set to some old version.

I have now updated my Windows XP machine to MMTK 2.5.13, and 1A1Y.pdb 
works fine.

However, while updating my installation of MMTK, I found a minor problem
with setup.py on both MMTK 2.5.13 and MMTK 2.4.4 under Windows.

I had to make the following test non-windows only:

     command = '%s config/intlen.c -o config/intlen' % sysconfig['CC']
     result = os.popen('config/intlen', 'r').read().strip()
     if result == '8':
         macros.append(('_LONG64_', None))

I am using Python 2.3.3 on Windows XP SP2, with MSVC 6.0 as the compiler
- sysconfig['CC'] is not defined.  There may be some sensible code to
use on the 64 bit Windows...

I can send you windows setup binaries if you like (off the mailing


>> However, this still seems to try and validate all the PDB atoms (even
>> the hydrogens) during loading.
> Right, because the hydrogens are in the PDB file. MMTK will never  
> silently throw away atoms from the PDB structure, though it will add  
> hydrogens if necessary to take care of the most frequent case of PDB  
> files without hydrogens.


> If you want to create a model without hydrogens from a PDB file with  
> hydrogens, you have to create a PDBConfiguration object first, delete  
> the hydrogens from it (using the method deleteHydrogens()), and then  
> create the peptide chain and protein objects.

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")

Traceback (most recent call last):
   File "<pyshell#8>", line 1, in -toplevel-
   File "C:\Python23\lib\site-packages\Scientific\IO\PDB.py", line 905, 
in deleteHydrogens
   File "C:\Python23\lib\site-packages\Scientific\IO\PDB.py", line 522, 
in deleteHydrogens
   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,


More information about the mmtk mailing list