top of page

First Steps to Molecular Dynamics: A Guide to Creating a Starting Configuration with Packmol

Packmol allows you to create initial configurations for molecular dynamics simulations by packing molecules into defined regions of space. This packing process prevents short-range repulsive interactions from causing distortions in the simulation. Thanks to the various spatial constraints that can be applied to molecules or their atoms; it is easy to create regular systems such as layered, spherical or tubular lipid structures. The user only needs to specify the coordinates of each type of molecule, the number of these types and the spatial constraints they must obey. Packmol is compatible with PDB, TINKER, XYZ and MOLDY file formats (1).

Packmol is a program that runs via the terminal. Therefore, it is sufficient to have an input file prepared in a supported format and a molecule file to run the program. It is possible to install Packmol for all operating systems from the https://github.com/m3g/packmol/releases/tag/v21.0.2 website. Installation on the Windows operating system will be explained as an example. For installation on Windows, Julia is first downloaded from the https://julialang.org/downloads/ website. After opening Julia, type “import Pkg; Pkg.add("Packmol")” into the terminal screen and press Enter. The Packmol package is installed.

ree

Our goal in this application is to create a system containing a total of 200 methanol molecules starting from a single methanol molecule. For this, the methanol molecule must be available in PDB format in your working folder. You can review our article “Optimize Your Molecular Structure: Avogadro User Guide” to draw the methanol molecule in Avogadro and obtain it in PDB format.


Step 1: Examples of input files are located at https://m3g.github.io/packmol/examples.shtml. There are various input files prepared for different purposes in this section. The most suitable example for the methanol system is the file titled “Simple mixture of water and urea”. You can create your own input file by deleting the default values ​​in this file and entering the name of the methanol molecule. The extension of the input file should be “.inp” and you can specify the file name as you wish. In this example, the file name has been changed to start.inp.

 

In the input file, pdb should be specified as the file type in the filetype line. In the Output line, the name of the output file where the system to be created will be saved is given and the “.pdb” extension should be added to the end of this name. This file will contain the new system created by Packmol. In the example, the name of the output file is specified as start.pdb. In the Structure line, you need to specify the file name of the methanol molecule you created before with the .pdb extension.


In the Number line, enter the number of ethanol molecules you want in the system; in the example, this number is determined as 200. The Inside box section defines the dimensions of the box where the system to be created will be placed. You can adjust this box to the desired dimensions according to your needs.

Figure 1. Contents of the input file for the Packmol program.
Figure 1. Contents of the input file for the Packmol program.

Step 2: The inp file is set up and saved to create a system with 200 methanol molecules.


Step 3: Then the code “using Packmol; run_packmol()” is written to the Julia terminal screen and a screen opens.

ree

On the screen that opens, you need to go to the folder containing the file with the “.inp” extension and double-click on the file.

Figure 2. Directory where the input file is located.
Figure 2. Directory where the input file is located.

Step 4: After a short process, a file named start.pdb will be created. The created file can be opened and inspected with a molecular visualization tool such as PyMOL.

Figure 3. The 200-molecule methanol system created.
Figure 3. The 200-molecule methanol system created.

The methanol system consisting of these 200 molecules is now ready to be examined with molecular dynamics simulations and programs such as GROMACS can be used for this purpose.

 


As a result, the initial configurations of systems containing a certain number of molecules can be easily created with the Packmol program. In this article, the methanol system, which is taken as an example, is explained step by step how to structure an input file, how to define spatial constraints and how to obtain the output file. The prepared structure files can be used directly in molecular dynamics simulation programs such as GROMACS, allowing the structural and dynamic properties of the system to be examined. Thus, Packmol stands out as a powerful and practical tool in the pre-simulation structure preparation process.



References

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page