LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] GAFF Preparation for LAMMPS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] GAFF Preparation for LAMMPS


From: Andrew Jewett <jewett@...1937...>
Date: Mon, 30 Oct 2017 21:18:32 -0700

Amber does not use simple rules to assign charges to each atom.
Instead AmberTools perform a quantum calculation to estimate what
these partial charges should be.  This is becoming increasingly
common.  (The tools which come with BOSS to prepare simulations using
the OPLSAA3 force field typically do this as well.)  This is one of
the obstacles you must overcome.

If you want to use AMBER, then there are two choices that I'm aware of:

1) Use AmberTools to build your system, and convert them into LAMMPS
format using "amber2lmp".  (You may encounter bugs in this script.  It
is no longer actively maintained.)
http://lammps.sandia.gov/doc/Section_tools.html#amber2lmp-tool

2) Moltemplate is a general molecule builder program which supports a
relatively large number of force field formats including GAFF and
GAFF2.  But it does not understand quantum chemistry and cannot assign
atomic charges this way.

You can use moltemplate to build the LAMMPS input and data files (see
below), but you will have to determine the atomic partial charges of
your atoms by other means.  Ideally you should use AmberTools to
generate the atomic charges.  Once you have the list of atomic
charges, you can write a for-loop to generate file containing a list
of "set" commands with the following format:

set atom 1 charge -0.18
set atom 2 charge 0.06
set atom 3 charge 0.06
set atom 4 charge 0.06
 :

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

This would be a useful script.  If you are able to figure out
AmberTools, and you are able to figure out which of the files it
creates contain the atomic charges, then I can help you write this
for-loop, and we can included it in moltemplate.

---- how to build a molecular system using GAFF/GAFF2 force field ---
There are several examples of molecules using the AMBER/GAFF force
field located in the "examples" subdirectory included with
moltemplate.  Currently, you can browse these examples at the link
below (which may change in the future):
https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_AMBER

Here is an example of how you define a simple molecule using
moltemplate using the GAFF (or GAFF2) force field:

---- ethylene.lt ----

import "gaff.lt"   # or "gaff2.lt"

# The "gaff.lt" and "gaff2.lt" files are usually located in "force_fields"
# subdirectory of the moltemplate distribution.
# It contains definitions of the atoms "c2", "hc", as well as the bonded
# and non-bonded interactions between them (and many other atoms).

Ethylene inherits GAFF {        # or GAFF2

  # atom-id mol-id atom-type charge X Y Z
  write('Data Atoms') {
    $atom:C1 $mol @atom:c2 -0.23 -0.6695 0.000000 0.000
    $atom:C2 $mol @atom:c2 -0.23 0.6695 0.000000 0.000
    $atom:H11 $mol @atom:hc 0.115 -1.234217 -0.854458 0.000
    $atom:H12 $mol @atom:hc 0.115 -1.234217 0.854458 0.000
    $atom:H21 $mol @atom:hc 0.115 1.234217 -0.854458 0.000
    $atom:H22 $mol @atom:hc 0.115 1.234217 0.854458 0.000
  }
  write('Data Bond List') {
    $bond:C12 $atom:C1 $atom:C2
    $bond:C1H1 $atom:C1 $atom:H11
    $bond:C1H2 $atom:C1 $atom:H12
    $bond:C2H1 $atom:C2 $atom:H21
    $bond:C2H2 $atom:C2 $atom:H22
  }
} # Ethylene

---- system.lt ----

import "ethylene.lt" # <- defines the "Ethylene" molecule type.

# Create a 3-dimensional array of 1000 ethylenes (10x10x10)

ethylenes = new Ethylene[10].move(8.0, 0, 0)
                        [10].move(0, 8.0, 0)
                        [10].move(0, 0, 8.0)

# Periodic boundary conditions:
write_once("Data Boundary") {
  0.0 80.00 xlo xhi
  0.0 80.00 ylo yhi
  0.0 80.00 zlo zhi
}

-------------------

Then, run moltemplate.sh on your system using:

moltemplate.sh system.lt

(moltemplate.sh -vmd system.lt, if you have vmd installed)


WARNING: The names of the atom types in your .LT files (example
@atom:c2, and @atom:hc in "ethylene.lt") must be consistent with the
names of atoms from the "gaff.lt" and "gaff2.lt" files.  It is up to
you to determine the correct atom type for every atom in your
molecule(s).  You will have to read the description of each atom type
listed in the "Data Masses" section of the "gaff.lt"/"gaff2.lt" file
and choose carefully.  This can be quite tricky, but there is some
general advice for doing that at
http://moltemplate.org/force_field_recommendations.html

Good luck, and let me know if you need help with copying the atomic
charges from AmberTools.  (Hopefully AmberTools will list these atoms
in a sensible order.)

Cheers
Andrew

On Fri, Oct 27, 2017 at 5:49 PM, MD Simulation
<mdsimulationgroup@...24...> wrote:
> Hello,
>
> Does anyone have much experience preparing LAMMPS input using the General
> Amber Force Field?  Does anyone have a few commands, to get ne started,
> using Antechamber that would assign atomtypes and force field parameters for
> an XYZ file (Axel?)?
>
> Thanks for the help
> Carrie
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> lammps-users mailing list
> lammps-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lammps-users
>