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
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.
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 1Now 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 AtomNow 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.
RESI H2O 0.0 ! Water ModelThis 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.41Here 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.
BOND OH2 H1 OH2 H2This 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 H2Now 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 ENDBasically, 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.