Add force field selection functionality in LAMMPS?

Dear LAMMPS developers,
Sorry for asking this pre-processing problem in lammps mailing list.
I would like to know that will LAMMPS in the future have a force field selection option which is similar like the one GROMACS or moltemplate provides?
For simple force fields it is easy to do in lammps. When I want to use the force field like CHARMM27 or OPLS-AA/L force fields,
it is usually a big headache for me find those force field parameters corresponding to my complex polymer structure like asphaltene.
I think it would be really nice to have that force field selection option in the LAMMPS.
If not, maybe one ideal option is switch to GROMACS to conduct the simulation.

Happy holidays!
Regards,

Dear LAMMPS developers,
Sorry for asking this pre-processing problem in lammps mailing list.
I would like to know that will LAMMPS in the future have a force field selection option which is similar like the one GROMACS or moltemplate provides?
For simple force fields it is easy to do in lammps. When I want to use the force field like CHARMM27 or OPLS-AA/L force fields,
it is usually a big headache for me find those force field parameters corresponding to my complex polymer structure like asphaltene.

this is not going to change by having automated force field tools.
those tools are usually extremely dumb and prone to make mistakes for
all but the most straightforward to do tasks. e.g. most peptides can
be easily converted to a complete topology with atom type and force
field assignments from a data base, since they consist of a rather
small set of building blocks. have some not so common amino acids in
your peptide and you are in trouble and have to add custom entries to
your topology fragment database.
thus complex systems will *always* require some more complex
processing of force field parameters, and topology building and
require careful and sometimes manual atom type assignment. add to
that, that different force fields have different rules and procedures
how force field parameters are assigned. most MD packages which supply
automated force field assignment, either handle only systems, that are
compatible with pre-existing data bases, or have a simple increment
system (typically resulting in reduced accuracy of the force field).
for most complex structures, the atom type assignment is not easy to
automate unless you know something about the chemistry of the specific
system at hand, the structural patterns, and how they can be matched
to the force field parameters. because of this, it makes very little
sense, to include such tools into LAMMPS itself, which is extremely
flexible and trying to be very generic.
it is much more straightforward to either use existing tools for the
given force fields at hand and then converting the results to LAMMPS,
if practical, or to write custom tools/scripts on top of "middleware"
packages like TopoTools (you can see in the OPLS/AA examples how
knowledge about the molecules is used to apply OPLS/AA's increment
system to assign charges and atom types. this is much more easily done
with specific tools like VMD/Tcl scripting, than trying to build a
generic tool for LAMMPS.

in short: there ain't no such thing as a free lunch.

I think it would be really nice to have that force field selection option in the LAMMPS.

if you can tell us how to do it so it works for many/most use cases in
LAMMPS, we are eager to learn, but based on my personal experience
summarized above, there are some very fundamental problems with most
input data simply not containing sufficient information for a reliable
force field and topology assignment.

If not, maybe one ideal option is switch to GROMACS to conduct the simulation.

you are most welcome to try gromacs. it is a mature and flexible
software and - where it works well and accurate - is much more
efficient and powerful than LAMMPS. mind you, there are tools like
InterMol, that allow to convert topologies and force field data
between gromacs and LAMMPS.

axel.

Thank you very much for your detailed explanation!! That already helps a lot.
I think I just need more patience and work on the pre-processing.
Happy Holidays!
Regards,

>
> Dear LAMMPS developers,
> Sorry for asking this pre-processing problem in lammps mailing list.
> I would like to know that will LAMMPS in the future have a force field selection option which is similar like the one GROMACS or moltemplate provides?
> For simple force fields it is easy to do in lammps. When I want to use the force field like CHARMM27 or OPLS-AA/L force fields,
> it is usually a big headache for me find those force field parameters corresponding to my complex polymer structure like asphaltene.

I think you have underestimated the magnitude of what you are asking for.

this is not going to change by having automated force field tools.
those tools are usually extremely dumb and prone to make mistakes for
all but the most straightforward to do tasks. e.g. most peptides can
be easily converted to a complete topology with atom type and force
field assignments from a data base, since they consist of a rather
small set of building blocks. have some not so common amino acids in
your peptide and you are in trouble and have to add custom entries to
your topology fragment database.
thus complex systems will *always* require some more complex
processing of force field parameters, and topology building and
require careful and sometimes manual atom type assignment. add to
that, that different force fields have different rules and procedures
how force field parameters are assigned. most MD packages which supply
automated force field assignment, either handle only systems, that are
compatible with pre-existing data bases, or have a simple increment
system (typically resulting in reduced accuracy of the force field).
for most complex structures, the atom type assignment is not easy to
automate unless you know something about the chemistry of the specific
system at hand, the structural patterns, and how they can be matched
to the force field parameters.

It's to be expected that molecules like aslphaltine will be extremely
challenging to parameterize, especially since they are so
heterogeneous and contain metals. ATB database contains molecules
whose parameters have supposedly been optimized using quantum chemical
calculations, but I don't think this database would contain any
molecules which are as complicated as as asphaltene.
https://atb.uq.edu.au/
https://atb.uq.edu.au/index.py?filter_0=asphaltene&filter_1=&filter_2=&filter_3=&filter_4=&tab=existing_molecules&filter_table_id=filter_form_Selected_Molecules

because of this, it makes very little
sense, to include such tools into LAMMPS itself, which is extremely
flexible and trying to be very generic.

To add to Axel's great reply:

Force field assignment is very text heavy, and it's kind of
inconvenient to write good parsing code in C or C++. It's much easier
to write it in python.

Disclaimer: I wrote moltemplate.

Moltemplate was written in python, and the goal of moltemplate was to
be the closest thing possible to a general, universal molecule builder
for LAMMPS. However it is not a part of LAMMPS. Some users note that
it is slow and has it's own (quirky) syntax, and it cannot (yet) be
invoked from inside python (or LAMMPS). (And it is far from
universal. Force fields like CHARMM, GROMOS, CVFF, PCFF, DRIEDING are
not yet supported, and automatic PDB-atom type inference is not
supported either.)

You mentioned OPLSSAA and LOPLSAA. OPLSAA has been available in
moltemplate for a while. The 2015 version of LOPLSAA was added to
moltemplate in December. AMBER and COMPASS are supported, but you
must generate the partial charges for AMBER simulations yourself, and
the most of the COMPASS force field parameters are not publicly
available. If my memory is correct, the parameters for the GROMOS and
CHARMM force fields (at least the older versions) would not be
difficult to convert into moltemplate format. However if you are
going to use these force fields, why not just use Gromacs or OpenMM?

That said, if the LAMMPS developers want to add automatic force-field
capability to LAMMPS (or to "fix bond/react"), I'd be happy to convert
these force-fields into whatever format they agree upon, and/or to be
active in suggesting what that format should be.

But the important concerns that Axel raises would remain.

it is much more straightforward to either use existing tools for the
given force fields at hand and then converting the results to LAMMPS,

Indeed.
Most traditional MD programs were designed to work with only one kind
of force field, and they come with tools to read certain kinds of PDB
files and look up force-field parameters for the atoms in them, using
that particular force-field. (Exception: The OpenMM software appears
to support multiple force fields, but it's not as general as LAMMPS)
In addition to looking up force-field parameters, these tools also
typically assign partial charges to each atom, add missing hydrogen
atoms, and generally clean up the PDB files which are fed to them.

Because this process is so arduous, once you have decided which
force-field you want to use, it's probably better to use the MD
program that comes with the best tools for building molecules that use
that particular force field. There are a few programs (with varying
degrees of glitchy-ness) which can convert the files generated by
these tools into LAMMPS format (if for some reason, you want to run
the simulation in LAMMPS). I have not yet heard anything bad about
InterMol, and Axel recommends it.

if practical, or to write custom tools/scripts on top of "middleware"
packages like TopoTools (you can see in the OPLS/AA examples how
knowledge about the molecules is used to apply OPLS/AA's increment
system to assign charges and atom types. this is much more easily done
with specific tools like VMD/Tcl scripting, than trying to build a
generic tool for LAMMPS.

in short: there ain't no such thing as a free lunch.

Yes. ...And what you're trying to simulate sounds challenging.

There is always a trade-off between generality (LAMMPS is quite
general), and ease-of-use. It's possible to spend your entire PhD
learning the horrible intricacies of these molecule builder tools, so
ease-of-use is worth considering.

I would definitely try the tools you mentioned, I don’t want to spend all my PhD time just on the molecule building stage …

Thank you and Axel a lot for these kind and detailed explanations!
Regards,
Dezhao