The CHARMM Water-Box Tutorial


Getting Started...

Let's get right into things and start with some simple molecular modeling in CHARMM. This tutorial will begin by first building a single water molecule, and then combining several molecules and running a molecular dynamics simulation.

CHARMM can be used in one of two ways. CHARMM can be used in interactive mode by starting the program and typing commands into the interpreter, much like in an interpreted computer programming language. Alternatively, scripts can be written and input to the program. First, we'll start with the interpreter by typing 'charmm' at the command prompt of any of the computers. A prompt like this will appear in the terminal window:
 

1
Chemistry at HARvard Macromolecular Mechanics (CHARMM) - Developmental Version 27a2 February 15, 1999 Copyright(c) 1984,1992 President and Fellows of Harvard College All Rights Reserved Current operating system: GNU LINUX Created on 6/16/99 at 14:49:14 by user: schneidm Maximum number of ATOMS: 25140, and RESidues: 14000 Current HEAP size: 2048000, and STACK size: 4000000

    Now we're ready to get started writing the program. (In the following everything that needs to be entered into charmm is separated by blank lines and is written in a different font.)
    First things first, we need to give the job a title. Titles are denoted by an asterisk starting the title line, with the last line of the title denoted by a single asterisk:

* The CHARMM Water Tutorial
*
    Simple enough. Now we are ready to start making the water molecule.

Resdiue Files

    The residue is the basic building block in CHARMM. A residue could be a an atom or monatomic ion (e.g. an Ar atom or a K+ ion), a molecule (e.g. water or butane), or a building block of a more complex molecule (e.g. an amino acid or fatty acid chain). In this example we will only use a single residue to build our system, namely a water molecule. In this example we will actually type the description of the residue (the Residue Topology File, or RTF) directly into CHARMM. Later we will see that it is convenient for routine work to save these descriptions into a file (typically saved with a .rtf ending).
    The RTF needs a title, too, just like the overall program does:
READ RTF CARD
* Here's the water residue
*
    The first line of the title, READ RTF CARDS is a command that tells CHARMM we are reading in a description of the residue (RTF), in ascii (human readable) format (CARD), and is followed by a title as described before. The residue file contains the basic description of bonding and charges The first thing that we need after the RTF title is a line that tells CHARMM which version of the program we are using. This is the only place in the CHARMM script where you actually need to pay attention to which column you are typing in. The rightmost numbers of the two numbers we will input must be in columns 5 and 10, so we type in the line:
   21    1
    Now we define the atoms we will use. Obviously for water, we need to define hydrogen and oxygen atoms, and give these atoms names and masses. To define these two atoms in our RTF, type in the lines:
MASS 1 H 1.    ! Water - Hydrogen Atom
MASS 2 O 16.   ! Water - Oxygen Atom
    Now we have defined the two atoms we need. These commands define two types of atoms, H and O, and give these atoms masses of 1 and 16, respectively. You should also note that capitalization doesn't matter to CHARMM, and that the ! character denotes that a comment follows after it. For those unfamiliar with computer programming a comment is a statement that is ignored by the program, and is bascially used to document the work you do inside the program itself.
    Now that the atoms have been defined, we need to define the actual residue itself. We add this line to the program:
RESI H2O 0.0   ! Water Model
    This line tells CHARMM that we are defining a residue (RESI), named H2O, and that this residue has an overall charge of 0.0. This declares the water molecule, next we need to define the atoms that make up the molecule (using the atoms types define in the MASS command above). We give each atom a unique name and assign it a charge. 
ATOM OH2 O   -0.82
ATOM H1  H    0.41
ATOM H2  H    0.41
    Here are the three atoms that will make up the water molecule. Notice that each atom has its own name and is defined in terms of the atom types given by the MASS commands above. Now that we've defined the atoms, we need to define the bonds and bond angles.
    To define the atoms that will be bonded together, we type:
BOND OH2 H1   OH2 H2
    This tells CHARMM that the atoms OH2 and H1 form a bond, and that OH2 and H2 also form a bond. Note that more than one bond definition can go on a BOND line. To define our bond angle, we need to type in:
THETA  H1 OH2 H2
    Now we have sucessfully defined our water molecule. However, we still need to type in one more line before we go on to the parameter file. If this reside was one part of a protein, we would need to describe how to terminate the sequence of amino acids. This is done via the 'patch' command.  Our water molecule is complete as we have written is so we do not need to apply any pathch thus we type in:
PATCH FIRST NONE LAST NONE
END
    Basically, this command tells CHARMM that we don't want to patch the first, or the last, part of our molecule. The END statement tells CHARMM that we are done building our residue. At this point our molecule is defined. For a complicated simulation we may define hundreds of different residues to make up our system. Thankfully, there are .rtf files distributed with CHARMM that have pre-build residue definitions for amino acids, nucleic acids, fatty acids, and many other common molecules. It is important, however, to understand the RTF structure because it is likely that at some point you will want to simulate a molecule that has not been studied before and you will have to construct your own topology files to supplement those distributed with the program.
    Now, we can move on to inputing the potential energy parameters for the water molecule.

Back to the Index | Step 2: Parameter Files and Generation