[MMTK] adding pdb file to universe

Ivan Vyalov vyalov at mis.mpg.de
Thu Feb 2 11:41:49 UTC 2012

On 02/02/2012 09:49 AM, Konrad Hinsen wrote:
> Ivan Vyalov writes:
>   >  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
> Right.
>   >  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?
> The PDB format is particularly difficult to handle well, because
> hardly anyone (not even the PDB) respects all the rules to the letter.
> Your file for fluorine deviates from the PDB format in several places,
> so it needs some work.
> Concerning your script, there is nothing wrong with it in principle,
> but since you have non-standard residues in your PDB file (the standard
> ones are just biomolecules and water), you need to use
>      config.createAll(permit_undefined = True)
> The attached modified versions of your file work, so you can use them
> as a starting point for further exploration. However, in your place I
> would first think about whether you need PDB files at all. Your system
> is very simple, and not at all biomolecular, so PDB may be more
> trouble than it's worth.
> Konrad.
> _______________________________________________
> mmtk maillist  -  mmtk at starship.python.net
> http://starship.python.net/mailman/listinfo/mmtk

Dear Konrad,

thank you for the help! I tried to isolate the problem and the only 
change that makes PDB working is the justification of the element field 
76-78, a namely if "F" is in position 76 it doesn't work and it works if 
"F" is in 78. It looks to me that MMTK was looking for element "F "(with 
space. Indeed, when I copied Atoms/f to "Atoms/f " everything works) in 
the database. Probably, one should strip the element name before looking 
in the database, something like this:

~/local/lib/python2.6/site-packages/Scientific/IO$ diff PDB.py 
<                 self.properties['element'] = name[1]
 >                 self.properties['element'] = name[1].strip()
<                 self.properties['element'] = name[0]
 >                 self.properties['element'] = name[0].strip()
<                 self.properties['element'] = name[0:2]
 >                 self.properties['element'] = name[0:2].strip()

As for simplicity of my PDB -- it was just the minimum example to 
illustrate the problem.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://starship.python.net/pipermail/mmtk/attachments/20120202/cafc8de9/attachment.html>

More information about the mmtk mailing list