/moltemplate

A general cross-platform tool for preparing simulations of molecules and complex molecular assemblies

Primary LanguagePythonMIT LicenseMIT

CircleCI CodeQL GitHub PyPI - Downloads PyPI - Version Website GitHub repo size

Moltemplate

Description

Moltemplate is a general cross-platform text-based molecule builder for LAMMPS and (the TCL version of) ESPResSo. Moltemplate was intended for building custom coarse-grained molecular models, but it can be used to prepare realistic all-atom simulations as well. It currently supports the OPLSAA, OPLSUA, LOPLS(2015), AMBER(GAFF,GAFF2), DREIDING, COMPASS, TraPPE(1998) force fields, the ATB molecule database, and the MOLC, mW, ELBA(water), oxDNA2, and EFF molecular models (and others). (New force fields and examples are added continually by users.) Moltemplate is inter-operable with ATB, VMD/topotools, PACKMOL, RED-server, LigParGen, AmberTools, Open Babel, EMC, CellPACK, Vipster, struc2lammpsdf, and any other program that generates LAMMPS DATA (.lmpdat) files or MOL2 files.

This repository contains 3 folders:

  • moltemplate: source code and force fields
  • doc: documentation for moltemplate.sh, ltemplify.py, genpoly_lt.py, etc..
  • examples: examples built with moltemplate

Documentation

The best way to learn how to use moltemplate is to find an example which is similar to the system that you wish to simulate and modify it. This repository includes approximately 50 examples. Some of the moltemplate examples are also demonstrated (with pictures) here.

All moltemplate users should read chapter 4 of the reference manual (It's only 6 pages long. The first 3 chapters can be skipped.) Chapters 6, 7, and 5.1-5.3 also also recommended. (13 pages.)

In addition, there are also several talks/tutorials online.

Strategies for preparing all-atom simulations

Moltemplate was originally designed for preparing coarse-grained simulations. Fully atomistic simulations usually require choosing force-field specific atom types ("atom typing"), and the calculation of atomic charge. Moltemplate does not do this. Moltemplate also does not repair incomplete PDB files. To get around these limitations:

  • Users can use use 3rd-party molecule-builder tools such as: the ATB database (LT format), AmberTools (MOL2 format), EMC (DATA format), LigParGen (DATA format), and OpenBabel. These tools can generate MOL2 or LAMMPS-DATA files which can be converted into moltemplate format (LT format) using mol22lt.py or ltemplify.py. (If you want to try and select the atom types manually instead of using 3rd-party tools, read these suggestions.) Alternatively, users can use the DREIDING force field which has relatively simple atom type rules.
  • For atomic partial charges the RED-server is useful (which can generate a MOL2 file), in addition to the tools listed above. Alternatively, users can try using LAMMPS' built-in fix qeq feature.

Typical usage

    moltemplate.sh [-atomstyle style] [-pdb/-xyz coord_file] [-vmd] system.lt

Installation Instructions

Moltemplate depends on other software to work (such as BASH, python, pip, or python3, and pip3). Once these dependencies have been met, installing moltemplate is relatively easy. However many users find it difficult to install these prerequisites correctly. A detailed installation guide is located here.

Quick installation overview

Once you have installed the prerequesites mentioned above, download moltemplate using:

git clone https://github.com/jewettaij/moltemplate DESTINATION_DIRECTORY

(See below if you don't have git installed.) Then enter the directory where this README file is located:

cd DESTINATION_DIRECTORY

...and run the following command:

pip3 install .              # (or "pip", if that fails)

(Note: In some environments, "pip3" is called "pip" instead.)

If the command above fails (with both "pip" and "pip3"), then try this instead:

pip3 install . --user       # (or "pip", if that fails)

This will install moltemplate for a single user. If you are on a shared computer and you want to install moltemplate system-wide, then use:

sudo pip3 install .         # (or "pip", if that fails)

Later, you can uninstall moltemplate using:

pip3 uninstall moltemplate
# (use "pip" and/or prepend "sudo" if you did that earlier)

If this fails then read the installation troubleshooting guide. This guide will offer several different installation methods and explain how to install the prerequisites needed.

Note: Alternatively, you can download and install moltemplate using a single command:

pip3 install git+https://github.com/jewettaij/moltemplate.git   # (or "pip", if that fails)

...however this will omit all of the examples and documentation.

Web page

Additional suggestions and supporting code can be found at:

http://www.moltemplate.org

Requirements

Moltemplate requires BASH and a recent version of Python (>3.5), NumPy, and can run on MacOS, linux, or windows.

(Note: On MacOS, it may eventually become necessary to use 3rd-party tools like "brew" to install BASH if apple removes BASH support in future updates. Python 2.7 may also work, but you must edit your PATH to install moltemplate instead of using pip/pip3. Pip no longer works with old versions of python.)

To use LAMMPS and moltemplate, you will also need to install (and learn how to use) a (unix-style) text editor. (Word, Wordpad, and Notepad will not work.) Popular graphical text editors include Atom, Sublime, Notepad++, and VSCode. Older, non-graphical programs include vim, emacs, nano, ne, and jove. (Apple's TextEdit can be used if you save the file as plain text.)

License

With the exception of one file (ttree_lex.py), moltemplate is available under the terms of the MIT license.

The remaining file, (ttree_lex.py), is a modified version of the shlex.py module, which was released using the PSF license. Hence ttree_lex.py must also use this license. (The PSF is not a copyleft license. It is similar to the BSD and MIT licenses and is compatible with the the GPL license.)

Citation

If you find this program useful, please cite:

"Moltemplate: A Tool for Coarse-Grained Modeling of Complex Biological Matter and Soft Condensed Matter Physics", J. Mol. Biol., 2021, 433(11):166841, Jewett AI, Stelter D, Lambert J, Saladi SM, Roscioni OM, Ricci M, Autin L, Maritan M, Bashusqeh SM, Keyes T, Dame RT, Shea J-E, Jensen GJ, Goodsell DS https://doi.org/10.1016/j.jmb.2021.166841