[MMTK] Adding/modifying forcefields
david.evans at ulsop.ac.uk
david.evans at ulsop.ac.uk
Tue Jan 4 14:22:13 CET 2005
I started on implementing Amber99, and remembered something I should
have mentioned before, which is that Amber99 uses exactly the same
charges and atom types as Amber94 (in fact in the main Amber program
they use the same .lib files). So the implementation is simple (I
think) given the code you posted before and I had a go at it myself.
Perhaps you could easily do it with your expertise so that it would
add with optimal elegance to the rest of the code (hint, hint :-)).
However, in testing I've not been able to get the Amber94 ff in MMTK
to give the same energies as the main Amber 8 program (sander), for a
DNA duplex in a infinite universe with no cutoffs. Similarly for my
new Amber99. Probably I'm setting some parameters incorrectly, and I
wondered if you had done a comparison with sander before and could
send me some examples.
---- Message from konrad.hinsen at laposte.net at 2004-12-17 21:07:46
>On Dec 17, 2004, at 16:49, david.evans at ulsop.ac.uk wrote:
>> Thanks for the reply. I was hoping that I could use the existing
>> Amber94 classes, and just change the input parameter files, i.e.
>> something instead of 'amber_parm94'. The functional form of Amber99
>> and gaff is identical to Amber94, I believe, so I thought it would
>> just be a question of ensuring the correct data was read in.
>It is, but it is a bit more work than you suspect, which is why I
>didn't do it already.
>The Python code you need is minor, and just a clone of the Amber 94
>code. I have appended it below (save as Amber99ForceField.py). The
>parameter file needs to be called amber_parm99 and must be located
>the same directory as the module, but both details are easy to
>Something to verify is the 1-4 factors, if they are different from
>their 94 value, you must change the respective lines.
>However, this is just the first step of using Amber 99. The second
>is simple in principle but quite time-consuming: you must put the
>type and charge parameters for Amber 99 into all the group and
>description files that you plan to use. If you work with proteins,
>that's a lot! You need to define amber99_atom_type and
>in the same way as amber_atom_type and amber_charge are defined for
>94 version. You can either add the data to the existing database
>or make a copy of the files you plan to modify and put them into
>~/.mmtk/Database. You can find all the information in the Amber
>The original MMTK database files were machine-generated from the
>94 topology files to reduce the effort (and mistakes). In principle,
>that could be done again, but if I remember correctly Amber has
>the format of the topology files, so a new converter would have to
>written. Moreover, a lot of manual fine-tuning was applied to the
>files in order to be able to read PDB files of various origins, all
>that would be lost with a simple regeneration.
>Still, I think an automatic approach is the only viable solution
>you plan to use just a few molecules.
>Laboratoire Léon Brillouin, CEA Saclay,
>91191 Gif-sur-Yvette Cedex, France
>Tel.: +33-1 69 08 79 25
>Fax: +33-1 69 08 82 61
>E-Mail: hinsen at llb.saclay.cea.fr
># Amber 99 force field
># Written by Konrad Hinsen
># last revision: 2004-12-17
>from MMTK.ForceFields import MMForceField
>from MMTK.ForceFields.Amber import AmberData
># Read parameter files
>Amber99 = None
>this_directory = os.path.split(__file__)
>def readAmber99(main_file = None, mod_files = None):
> global Amber99
> if main_file is None and mod_files is None:
> if Amber99 is None:
> paramfile = os.path.join(this_directory, "amber_parm99")
> Amber99 = AmberData.AmberParameters(paramfile)
> Amber99.lennard_jones_1_4 = 0.5
> Amber99.electrostatic_1_4 = 1./1.2
> Amber99.default_ljpar_set = Amber99.ljpar_sets['MOD4']
> Amber99.atom_type_property = 'amber99_atom_type'
> Amber99.charge_property = 'amber99_charge'
> return Amber99
> if main_file is None:
> main_file = os.path.join(this_directory, "amber_parm99")
> mod_files = map(lambda mf: (mf, 'MOD4'), mod_files)
> params = AmberData.AmberParameters(main_file, mod_files)
> params.lennard_jones_1_4 = 0.5
> params.electrostatic_1_4 = 1./1.2
> params.default_ljpar_set = params.ljpar_sets['MOD4']
> params.atom_type_property = 'amber99_atom_type'
> params.charge_property = 'amber99_charge'
> return params
># The force field class
> def __init__(self, lj_options = None, es_options = None,
> bonded_scale_factor = 1., **kwargs):
> self.arguments = (lj_options, es_options,
> main_file = kwargs.get('parameter_file', None)
> mod_files = kwargs.get('mod_files', None)
> parameters = readAmber99(main_file, mod_files)
> MMForceField.MMForceField.__init__(self, 'Amber99',
> lj_options, es_options,
More information about the mmtk