Using charmm2lammps

Overview

charmm2lammps is a perl script used to convert CHARMM compatible files to LAMMPS compatible files. It can be downloaded from this link. In addition to converting from CHARMM to LAMMPS, is has a number of useful options to make creating LAMMPS input files easier.

Required Files

In order to run, the script requires a PDB or CHARMM CRD file, a PSF file, and a single CHARMM PRM and RTF file containing all the parameters for molecules in the system. If the system contains molecules described in multiple PRM/TOP files, these files must be concatenated into one, which can be done using KPrep. Files that combine all the standard forcefield files along with some group-made files should be available in the group KPrep folder. Combined PRM/TOP files should only be used for the charmm2lammps script!

Running the Script

As described in the script's documentation, the basic syntax for running the scrip is:

perl charmm2lammps.pl [-option[=#] ..] forcefield project

where the options are described below, forcefield is the basename of the CHARMM forcefield files used for topology and parameter information (ignoring top_ and par_ prefixes and file extensions), and project is the basename of the PDB and PSF files for the files being converted. The order of the options specified does not seem to matter.

  • Example: perl charmm2lammps.pl -water -ions=.15 -center -l=40 -cmap cat_ch2lmps 1bdd

Options

Zero, one, or multiple options can be used to further refine the CHARMM to LAMMPS conversion process. To specify an option, simply type "-" followed by the option name, and if necessary for the option specified "=" followed by the value of the option with no spaces between the portions preceding and following the equals sign. Options commonly used in the group are explained below, but others are available. Using the help option will describe all the options available and the syntax used for the script.

  • -help Prints the proper syntax to use charmm2lammps along with a description of the options available and some other information about the program. Simply typing perl charmm2lammps.pl will achieve the same effect as the -help option.
    • perl charmm2lammps.pl -help
  • -water Adds water to the system. This should not be used if water has been added to the system already by CHARMM or some other means. By default, water molecules are added in a lattice, achieving a density of 1 g/cm3, but this density can be specified to change it.
    • perl charmm2lammps.pl -water cat_ch2lmps 1bdd
    • perl charmm2lammps.pl -water=.76 cat_ch2lmps 1bdd
  • -ions Adds sodium and chloride ions to the system. By default, only enough ions are added to make the system charge neutral. If a concentration of ions is desired, however, this can be specified (in mol/L).
    • perl charmm2lammps.pl -ions cat_ch2lmps 1bdd
    • perl charmm2lammps.pl -ions=.15 cat_ch2lmps 1bdd
  • -center Recenters the atoms of the system.
    • perl charmm2lammps.pl -center cat_ch2lmps 1bdd
  • -l Sets the length of the simulation box in all 3 dimensions (x, y, and z), creating a perfectly cubic simulation box. A number (in Angstroms) must be specified for this command to have any effect.
    • perl charmm2lammps.pl -l=40 cat_ch2lmps 1bdd
  • -border Creates a border of the specified size (in Angstroms) around the simulation box in 3-dimensions. This can be useful in making a box large enough to make sure a protein does not interact with its periodic image, but it will not create a perfectly cubic box. Use the -l option instead to create a cubic box.
    • perl charmm2lammps.pl -border=12 cat_ch2lmps 1bdd
  • -cmapCreates a CMAP section in the output lammps data file. This option should be used if the forcefield used for the simulation utilizes CMAP parameters (which is the case for the all36_prot CHARMM force field we commonly use). To run the LAMMPS simulation when using CMAP, you must provide a file that contains the CMAP interactions. The lammps/potentials directory of your lammps source code contains these files for both CHARMM22 and CHARMM36.
    • perl charmm2lammps.pl -cmap cat_ch2lmps 1bdd