[MMTK] Reading in of AMBER related files

Konrad Hinsen hinsen at cnrs-orleans.fr
Fri Apr 6 07:42:35 UTC 2007

On 04.04.2007, at 15:29, Gustavo Mercier wrote:

> I am interested in this thread...

I am replying to the list again...

> As I read it, it should be possible to take an Amber parameter file  
> and extend it with my new parameters, label this file MyAmber.parm,  
> and load it into MMTK as an Amber force field but with my extra  
> parameters. This would be very useful because it would allow me to  
> include drug molecules, etc.

There is a special format for extensions to the Amber parameter file,  
and MMTK can read those extensions. This is the preferred method to  
add parameters. To use such a file (or several of them), write:

	ff = Amber99ForceField(mod_files=['my_amber_parms'])

You can of course also create your own parameter file from scratch,  
but this requires some more work. See the file AmberForceField.py for  
the details: you have to write the equivalents of readAmber99() and  
Amber99ForceField(). That's not that much code; most of what you see  
there is in fact documentation.

> Am I correct? If so, how would I proceed? I don't want to 'mess up'  
> the MMTK directory that comes with the distribution. It would be  
> best to use the machinery already in place, but direct MMTK to load  
> a parameter file in one of my local directories.

You can (and should) put your modified versions of readAmber99() and  
Amber99ForceField() in a module of your own.

> I noticed that an object _ForceFieldLoader is created and that this  
> is responsible for loading the parameter file. Within this  
> framework, I would have to make changes within the distribution, as  
> opposed to directing MMTK to load a file from my local directory.

You don't need to use that mechanism. It exists only to increase  
modularity of the force fields without importing them too early, and  
also to deal with the requirements of the documentation framework.  
You can also do

	from MMTK.ForceFields.AmberForceField import Amber99ForceField

directly, but you would have to remember an extra directory name for  
each force field. For your own force field, you just import from your  
own module.

Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: hinsen at cnrs-orleans.fr

More information about the mmtk mailing list