amber dihedral to lammps

Hello Wei. Amber2lammps.py is correct. if you want you can look at the frcmod (force modification file). Use parmchk -a option to get all the parameters for your system and compare with amber2lammps.py. Or use parmed.py (comes with antechamber) use
printanlges, printdihedrals, printbonds and printLJmatrix options to get the force parameters.

Good luck
Arun

I was trying to use the GAFF force field in LAMMPS, and I used the amber2lammp.py tool to convert the Amber data file to a LAMMPS data file.
One thing I noticed about the dihedral parameters is that in GAFF, the dihedral interaction is defined with a "1/2" factor in the constant term (see

The only complete documentation I found to explain the format of the
gaff.dat file was here:
http://ambermd.org/formats.html

According to this documentation, the dihedral energy U(phi) is:

                           (PK/IDIVF) * (1 + cos(PN*phi - PHASE))

PN = the last column of gaff.dat (dihedrals section)
PHASE = the 2nd-to-last column of gaff.dat
PK = the 3rd-to-last column of gaff.dat
IDIVF = the 4th-to-last column of gaff.dat

If I am using the wrong formula (interpreting gaff.dat the wrong way),
please let me know.

Hello Wei. Amber2lammps.py is correct.

Hi Arun
   I'm curious to know if the dihedral coeffs generated using
moltemplate's gaff.lt look correct to you. I'm using some confusing
documentation to generate them (see above) and I'd love to know if I
made a mistake. (I am working on fixing improper atom order, by the
way. Thanks for that bug report.)

http://ambermd.org/antechamber/gaff.html#function), and in the meantime, the dihedral (harmonic style) in LAMMPS doesn't have the "1/2". So intuitively, for one same dihedral, the value showing in a Amber data file should be 2 times larger than that in a LAMMPS data file. However, the LAMMPS data file generated by the amb2lmp tool gives the same value as in the Amber .top file.

Is it correct? I also checked the parameter values in the "gaff.lt" file in moltemplate (but didn't use it), it should also yield the same value as the amb2lmp tool.

--- regarding moltemplate ---

The "gaff.lt" file which comes with moltemplate uses "dihedral_style
fourier" instead of "dihedral_style harmonic". The original gaff.dat
is converted to gaff.lt using the formula above, along with the
documentation for dihedral_style fourier:
http://lammps.sandia.gov/doc/dihedral_fourier.html

Btw, is there some way to compute the energy of one specific dihedral in LAMMPS. I noticed the "compute pe/atom" command, but one atom is always involved in more than one dihedrals. How to deal with that?

I don't know how to calculate this during the simulation without
editing the LAMMPS code. However it's not difficult to do this after
you run the simulation (post-processing).

  After running the simulation, assign the dihedral you care about to
a different type number (by modifying the data file, or using the set
command).
http://lammps.sandia.gov/doc/set.html

Then use the LAMMPS' "rerun" command to read a trajectory that you
created earlier, and recalculate the dihedral energy at each frame in
the trajectory
http://lammps.sandia.gov/doc/rerun.html

When you do this, set all the coeffs for other dihedral interactions
to zero (leaving the coeffs for that dihedral alone). Then print the
total dihedral energy using something like:

thermo_style custom step edihed

http://lammps.sandia.gov/doc/thermo_style.html

Cheers
Andrew

Hi Arun,

Thanks for your reply.

It’s true that from these we can see the amb2lmp tool gives the same values as the original Amber parameters. But the problem is that I’m not sure these numerical values have the same meaning in Amber and LAMMPS data file. You can see here(http://ambermd.org/antechamber/gaff.html#function) and also the original GAFF paper that the dihedral constant term is written as Vn/2. Does those numbers displayed in the Amber data file (either using parmed.py to see or directly find them in the .top file) mean Vn only or Vn/2 as a whole? If the former case, the value yielded by the amb2lmp tool should be halved since in LAMMPS it’s clearly only a ‘K’ as the constant.

It’s more like an Amber question actually, but I found this when using the amb2lmp tool so asked here…

Best,

Wei

Hi Andrew and Arun,

I think I found the answer from here (http://ambermd.org/prmtop.pdf, things about the dihedral are on P.9).
So according to equation (4) there, the result by both the amber2lammps tool and moltemplate are right (at least for those dihedrals only have one Fourier term; I don't have a multi-Fourier-term dihedral in my data so can't validate, but I would expect correct results since the interpretation is right and an extra term is essentially the same thing).

Thank Andrew again for the detailed tutorial for computing the dihedral energy.

Best,

Wei Ding

Thanks Wei and Arun for checking these dihedral and improper
interactions. I really appreciate and depend on feedback like that.
(I'm working on putting Arun's improper suggestions into moltemplate
now.)
Cheers!

Andrew