Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the force-field in an ATB file (to OLPSAA) #91

Open
HaoWan321 opened this issue Jun 14, 2023 · 3 comments
Open

How to change the force-field in an ATB file (to OLPSAA) #91

HaoWan321 opened this issue Jun 14, 2023 · 3 comments

Comments

@HaoWan321
Copy link

HI,
I am new to Moltemplate. I am trying to build a small organic molecule for lammps. I obtained the all_atom_geometry_optimized.lt, In this file it automatically using GROMOS_54A7_ATB which I wanna replace with OPLASS but there seems it has problem if I just replace the GROMOS_54A7_ATB with OPLASS in all_atom_geometry_optimized.ltand also add "import 'OPLASS'" in the system.lt. It complains the bonds part in the all_atom_geometry_optimized.lt. Do you have any solution for this?

BW

Hao

@jewettaij
Copy link
Owner

jewettaij commented Jun 26, 2023

Hello Hao

Changing the force field is not a one-line change.

Moltemplate can be used to setup simulations with very unorthodox force-fields. But for standard all-atom force-fields like OPLSAA, you may find other molecule builders that are more convenient to use.

Try a more user-friendly program?

Some molecule-builder programs are comparatively easy to use, and you can change the force-field with a single line of text or with a button.

Unfortunately moltemplate cannot do that. When using moltemplate, whenever you change the force field for a molecule, internally the number of angles, dihedrals, and impropers will probably also change. Some programs hide all this complexity from the user. Moltemplate does not. Those details are sometimes stored explicitly in the LT file. This is true for the files created by the ATB server. That's why they are ready to use after downloading them. So you will have to change the LT file in many places to change the force-field for that molecule.

ATB files were only intended for use with the special ATB version of the GROMOS force-field. If my understanding is correct, the authors of ATB argue that these custom ATB force-field parameters are potentially more accurate than parameters from more traditional force-fields such as OPLSAA, CHARMM, AMBER, GROMOS, PCFF, or even SMIRNOFF, that use simple rules and tables instead of DFT.

Try LigParGen?

If you want to use OPLSAA, why not download the molecule from the LigParGen server?

  • Download the file in LAMMPS DATA file format (eg "UNK_CF29F3.lmp")
  • Convert it to moltemplate using the ltemplify.py.
ltemplify.py -name "BenzoicAcid" UNK_CF29F3.lmp > benzoic_acid.lt

You have to be careful using the LigParGen server. It has some issues with atom typing (eg. this one). Files generated by LigParGen use the OPLSAA force field, the atom type names are incompatible with molecules built by hand (using the "oplsaa.lt" file, as explained below). But if all of your files come from the LigParGen server, this doesn't matter. Either way, the .lmpdat files generated by LigParGen are a useful starting point for building your own molecule files in moltemplate (.lt) format.

Build your LT files from scratch?

Alternatively, you can create your .lt file by hand (or modify the one created by ATB).

  • You can obtain reasonable atomic coordinates using ATB or LigParGen and save them (or convert them) into moltemplate format. Then you must edit the moltemplate (.lt) file and change every @atom type in that file.
  • You must select from a list of @atom types defined in the charge section of the oplsaa.lt file. (For example, see ethylene.lt
  • Then you must also change the "Data Bonds" section to "Data Bond List" and delete the 2nd column. (Also ATB often adds extra bonds to the molecule to increase molecule rigidity. You will have to remove those too.)

I hope this reply is not too late to be useful. I'll leave this question open so other people can read it.

@jewettaij jewettaij changed the title With ATB file (all_atom_geometry_optimized) using Moltemplate to generate OPLASS forcefield lammps input How to change the force-field in an ATB file (to OLPSAA) Jun 26, 2023
@zhuwenli0723
Copy link

zhuwenli0723 commented Jun 17, 2024

If I create a structure with VMD/topotools, and I want to use the “ltemplify.py” utility to convert this data file into “LT” format with force-field OLPSAA.
Is this the same as Example 6 in the manual? I just need to change the forcefiled name and strip the original file.data the angle, dihedral, improper, and bond-type information? Thanks so much!

@jewettaij
Copy link
Owner

If I create a structure with VMD/topotools, and I want to use the “ltemplify.py” utility to convert this data file into “LT” format with force-field OLPSAA. Is this the same as Example 6 in the manual? I just need to change the forcefiled name and strip the original file.data the angle, dihedral, improper, and bond-type information? Thanks so much!

Sadly, no. There are no examples in the manual that explain how to use these all-atom force fields (OPLSAA, AMBER/GAFF, DREIDING, COMPASS, ...). I don't have time to add this information to the moltemplate manual. (And the procedure for using all-atom force-fields changes frequently.) The only way to learn how to use those force fields is to look at the current examples, and modify them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants