[MMTK] adding pdb file to universe

Ivan Vyalov vyalov at mis.mpg.de
Thu Feb 2 10:46:47 UTC 2012


On 02/02/2012 02:06 AM, Marco Pasi wrote:
> Dear Ivan,
>
> I believe the problem is in your PDB.  Looking at the one pasted in
> your mail, I think the atom name field should be right-justified (i.e.
> in the case of F, two spaces between atom serial number and atom
> name).  Furthermore, the residue numbering should change to have one
> atom per residue.  Finally, for the compliance freaks, the ATOM record
> should be used only for standard amino acids and nucleotides (see
> http://www.wwpdb.org/documentation/format33/sect9.html#ATOM): for
> other coordinates you should use the HETATM record type (although MMTK
> will accept even the ATOM record).
>
> Hope this helps,
>
> Marco
>
> On Wed, Feb 1, 2012 at 5:02 PM, Ivan Vyalov<vyalov at mis.mpg.de>  wrote:
>> Dear all,
>>
>> I'd like to read PDB file with configuration of my system and then to treat
>> it by means of MMTK. To achieve this, as far as I understand, one should
>> read the PDB file and create MMTK objects which then must be passed to
>> universe. However, I have encountered the following problem: MMTK does not
>> recognize atom types when I want to create a universe from PDB. Another
>> option is that I'm completely missing something. Could someone help me with
>> an advice? Here is the code:
>>
>> #!/usr/bin/env python
>> import pdb,sys,MMTK
>> from MMTK import *
>> from MMTK.PDB import PDBConfiguration
>> from MMTK.ForceFields import Amber99ForceField
>> import MMTK.Database
>>
>> L = 53.86
>> volume=L**3
>>
>> universe = CubicPeriodicUniverse(L*Units.Ang, \
>>      Amber99ForceField(lj_options=12*Units.Ang))
>>
>> config = PDBConfiguration('fluorine.pdb')
>>
>>
>> # MMTK can find the database in general:
>> print MMTK.Atom("F")
>>
>> # but not when we want create objects from PDBConfiguration
>> config.createAll()
>>
>> *****************************************************************
>>
>> I get the following traceback
>>
>>
>> /usr/bin/python makePDBuniverse.py
>> Atom fluorine
>> Traceback (most recent call last):
>>    File "makePDBuniverse.py", line 21, in<module>
>>      a = config.createAll()
>>    File "/usr/people/vyalov/local/lib/python2.6/site-packages/MMTK/PDB.py",
>> line 428, in createAll
>>      molecules = self.createMolecules(molecule_names, permit_undefined)
>>    File "/usr/people/vyalov/local/lib/python2.6/site-packages/MMTK/PDB.py",
>> line 379, in createMolecules
>>      a = ChemicalObjects.Atom(element, name = aname)
>>    File
>> "/usr/people/vyalov/local/lib/python2.6/site-packages/MMTK/ChemicalObjects.py",
>> line 529, in __init__
>>      ChemicalObject.__init__(self, atom_spec, _memo)
>>    File
>> "/usr/people/vyalov/local/lib/python2.6/site-packages/MMTK/ChemicalObjects.py",
>> line 34, in __init__
>>      blueprint = self.blueprintclass(blueprint)
>>    File
>> "/usr/people/vyalov/local/lib/python2.6/site-packages/MMTK/Database.py",
>> line 448, in __init__
>>      BlueprintObject.__init__(self, type, atom_types, memo)
>>    File
>> "/usr/people/vyalov/local/lib/python2.6/site-packages/MMTK/Database.py",
>> line 423, in __init__
>>      original = database.findType(original)
>>    File
>> "/usr/people/vyalov/local/lib/python2.6/site-packages/MMTK/Database.py",
>> line 90, in findType
>>      filename = databasePath(name, self.directory, False)
>>    File
>> "/usr/people/vyalov/local/lib/python2.6/site-packages/MMTK/Database.py",
>> line 58, in databasePath
>>      raise IOError("Database entry %s/%s not found" % (directory, filename))
>> IOError: Database entry Atoms/f  not found
>>
>> shell returned 1
>>
>>
>> *********************************************************************************************
>> The PDB file looks like this:
>>
>>
>> ATOM      1 F            0      18.459  26.301  39.652  1.00  1.00
>> F   0.0000
>> ATOM      2 F            0      30.495  15.275  21.179  1.00  1.00
>> F   0.0000
>> ATOM      3 F            0      18.702  45.771  11.991  1.00  1.00
>> F   0.0000
>> ATOM      4 F            0       9.142  43.718  48.240  1.00  1.00
>> F   0.0000
>> ATOM      5 F            0      48.026  34.727  30.959  1.00  1.00
>> F   0.0000
>> ATOM      6 F            0      16.627  23.149   9.484  1.00  1.00
>> F   0.0000
>> ATOM      7 F            0       5.848  28.479  31.704  1.00  1.00
>> F   0.0000
>> ATOM      8 F            0      26.702  12.069   4.357  1.00  1.00
>> F   0.0000
>> ATOM      9 F            0      35.755  21.043  46.845  1.00  1.00
>> F   0.0000
>> ATOM     10 F            0       8.523  46.952  40.823  1.00  1.00
>> F   0.0000
>>
>>
>> thanks!
>>
>>
>>
>>
>> _______________________________________________
>> mmtk maillist  -  mmtk at starship.python.net
>> http://starship.python.net/mailman/listinfo/mmtk
>>
>
>


Dear Marco,

thanks, though I have PDB standard most of the time in opened tab in the 
browser :)
According to the standard, it does not matter if the atomname is 
right-justified, center- or left-justified until it is in the positions 
13-16. In fact, MMTK understands that it is fluorine, it understands 
that it is an atom but does not want to see it in the database -- very 
strange behavior.


cheers,
Ivan





More information about the mmtk mailing list