Packmol

Packmol is a free package for solvating proteins and organic molecules in non-standard solvents. To start, we will describe the installation process, followed by a description of how to dissolve a benzene molecule (solute) in a cubic box of methanol molecules (solvent).

1.   Packmol installation

1.1      Switch to the root environment, go to the root environment, and then navigate to the /opt directory.

sudo su

cd /opt

1.2      Download and unzip the packmol.tar.gz file.

wget https://github.com/m3g/packmol/archive/refs/tags/v20.12.0.tar.gz

tar -xzvf v20.12.0.tar.gz

1.3      Compile the package

cd packmol-20.12.0/

./configure

make

1.4      Exit the root environment and navigate to your home directory.

exit

cd

1.5      Add the Packmol path to your .bashrc file. 

cat <<EOF   >> .bashrc

alias packmol="/opt/packmol-20.12.0/packmol"

EOF

. .bashrc

2.   Creating a cubic box of methanol molecules around a benzene molecule

The following sections describe how to generate a box in the PDB file format using a nonstandard solvent species. The objective is to generate a cubic box (30 × 30 × 30 angstroms) containing a benzene molecule at its center surrounded by methanol.

2.1      Prepare PDB files for the solute and solvent.

We perform this task using GaussView. In the PDB files, ensure that the residue names of the molecules are different. For benzene and methanol, we will use the residue names BEN and SOL, respectively. Don't forget to assign a residue number to each species. You can insert this information in columns 23 to 26 of a PDB file. The PDB files of the solute and solvent are benzene.pdb and methanol.pdb, respectively, and their contents are listed below.

The benzene.pdb file

HETATM    1  C1  BEN     0       0.960   0.557   0.000                       C

HETATM    2  C2  BEN     0       2.356   0.557   0.000                       C

HETATM    3  C3  BEN     0       3.053   1.765   0.000                       C

HETATM    4  C4  BEN     0       2.355   2.973  -0.001                       C

HETATM    5  C5  BEN     0       0.961   2.973  -0.002                       C

HETATM    6  C6  BEN     0       0.263   1.765  -0.001                       C

HETATM    7  H1  BEN     0       0.411  -0.395   0.000                       H

HETATM    8  H2  BEN     0       2.905  -0.395   0.001                       H

HETATM    9  H3  BEN     0       4.153   1.765   0.001                       H

HETATM   10  H4  BEN     0       2.906   3.926  -0.001                       H

HETATM   11  H5  BEN     0       0.411   3.926  -0.003                       H

HETATM   12  H6  BEN     0      -0.837   1.765  -0.001                       H

 

The methanol.pdb file

HETATM    1  C1  SOL     1      -0.565  -0.792   0.000                       C

HETATM    2  H1  SOL     1      -0.208  -1.801   0.000                       H

HETATM    3  H2  SOL     1      -0.208  -0.287   0.874                       H

HETATM    4  H3  SOL     1      -0.208  -0.287  -0.874                       H

HETATM    5  O1  SOL     1      -1.995  -0.792   0.000                       O

HETATM    6  H4  SOL     1      -2.315   0.113   0.000                       H

 

2.2      Create a directory on your computer and copy the PDB files into it.

2.3      Create an input file (packmol.inp) for the packmol package.

The packmol.inp file

# This determines the minimum distance between molecules. The default value is 2 angstroms.

tolerance 2.0

# Specify  the file format (PDB). 

filetype pdb

# Output file name

output benzene-methanol.pdb

# Assign the solute file

structure benzene.pdb

# Assign number to the solute molecule (1 in this instance).

  number 1

# Place the solution's center of mass in the center of the box. 

# These values relate to the -x, -y, -z, x, y, and z values of the center of mass.

# Alternatively, you may change them.

  fixed 0. 0. 0. 0. 0. 0.

  centerofmass

end structure

# Identify the solvent file (methanol.pdb).

structure methanol.pdb

# Identify the number of solvent molecules (SN) surrounding the solute (402 in this case).

# Eq.1 can be used to calculate this number.

SN = (d × 1000 × NA × a3) / (1030 × M)           Eq.1

# In this equation, dNAa, and M indicate the density of the solvent in kg/m3, the

# Avogadro number, the cubic box dimension, and the molecular mass of the solvent,

# respectively. 

  number 402

# Identify the cubic box's coordinates (-x, -y, -z, x, y, and z values).

  inside box -15. -15. -15. 15. 15. 15.

end structure

 

You can also use the Packmol package to solvate a solute with a mixture of two solvents. The following is an example input file of Packmol that solvates a solute in a 50-weight percent of water/methanol solvent.

 

# The minimum distance between molecules. The default value is 2 angstroms.

tolerance 2.0

# Specify the file format (PDB).

filetype pdb

# Output file name

output out.pdb

# Assign the solute file.

structure AEN.pdb

# Assign a number to the solute molecule (1 in this instance).

  number 1

# Place the solution's center of mass in the center of the box.

# These values relate to the -x, -y, -z, x, y, and z values of the center of mass.

  fixed 15. 15. 15. 0. 0. 0.

  centerofmass

end structure

# Add the first solvent molecules

structure MET.pdb

  number 224

  inside cube 0. 0. 0. 30

end structure

# Add the second solvent molecules

structure WAT.pdb

  number 402

  inside cube 0. 0. 0. 30

end structure

# Identify the cubic box's coordinates (-x, -y, -z, x, y, and z values).

  inside box -15. -15. -15. 15. 15. 15.

end structure

 

To calculate the number of the first solvent molecules (N1) in the mixture, you can use the following formula, where W1% is the mass percent of the first solvent, a is the length of the cubic box in angstroms, d is the density of the solvent mixture in g/cm3NA is Avogadro's number, and M1 is the molar mass of the first solvent in g/mol.

N1 = (W1% × a3 × × NA)  / (M1 × 1026)

 

2.4      Run Packmol

This command generates a PDB file (benzene-methanol.pdb) containing one benzene molecule surrounded by methanol.

packmol < packmol.inp

You can find more information and instructions on how to mix two different solvents on the following page.

https://pablito-playground.readthedocs.io/en/latest/tutorials/qmmm_amber_cpmd/packmol_custom_box.html#packmol-custom-box

 

Figure 1 shows the output file (benzene-methanol.pdb) graphically.

Figure 1. The output file of the above procedure. The benzene molecule is shown as space filled in the center of the cubic box.

University of Kurdistan, Sanandaj logo

Department of Chemistry, Faculty of Science, University of Kurdistan