CHARMM

From GreenWiki
Jump to: navigation, search

Back to Software.

CHARMM is a comprehensive molecular simulation package originally written by the Karplus group at Harvard. It can be used for energy calculations, minimization, dynamics, and a host of other applications. CHARMM takes experience to learn well, but outlined here are the basics for getting started. Documentation can be found at the: Brooks Lab website

Contents

Topology and Parameter Files

The force field for CHARMM is defined in two files, known as the Residue Topology File (RTF) and the parameter file. Both of these files must be read in before anything else is done.

The topology file contains a list of defined atom types, as well as definitions of residues types and topologies. The residue definitions include all the atoms in the residue, along with their types, charges, and connectivities. In most cases, a default set of internal coordinates is also defined. In addition to standard residues (marked by RESI), patch residues (PRES) are also defined. These are not stand alone residues, but rather modify the topology of one or more existing residues. Examples include the patch for marking the N- and C-terminal amino acid positions and for making a disulfide linkage between two cysteines.

The parameter file contains all the force field information that depends solely on atom type. This includes force constants and equilibrium geometries for bonds and angles, the dihedral and improper parameters, and the Lennard-Jones (VDW) parameters.

Rather than directly modifying the standard RTF and parameter files distributed with CHARMM, it is preferred to make customizations in a seperate file, containing both RTF and parameter entries. This file can be read in as an input stream.

Example commands for Green Lab:

open read unit 1 card name "/people/dfg/programs/noarch/lib/ice/top_all27_prot_na_sugar.prm"
read rtf card unit 1
close unit 1
open read unit 1 card name "/people/dfg/programs/noarch/lib/ice/par_all27_prot_na_sugar.prm"
read para card unit 1
close unit 1
stream "/people/dfg/programs/noarch/lib/ice/toppar_all27_dfg.str"

PSF and Coordinate Files

Molecular structures in CHARMM are defined in two distinct steps. The Protein Structure File (PSF) defines the underlying molecular structure and defines all terms required for the calculation of the energy, without regard for atomic position. A PSF may be read in from a file, or may be generated by CHARMM from sequences of residues defined in the RTF. Typically, a PSF is generated as part of setting up a system for calculations, and then all subsequent calculations read this common PSF file. The PSF will typically only be opened at the beginning of a script (following reading of the topology and parameter files).

To generate and write a PSF (for disulfide-linked 8-mer peptide) :

read sequence card
* ACVKDICA octapeptide, with disulfide
*
  8 
ALA CYS VAL LYS ASP ILE CYS ALA
generate A setup first NTER last CTER setup
patch DISU A 2 A 7 setup 
open write unit 1 card name OUTPUT_PSF
write psf card unit 1 resid

A sequence can also be read from a file, either containing the sequence alone (with a CHARMM header) or from a PDB or CRD file. The generate command will create a sequence with residues numbered ascending from 1, so if alternate numbering is desired, the RENAME command must be used:

renam resid 7 sele segid B .and. resid 1 end

All the information for sequence and renumbering is contained in PDB and CRD files, and thus a script is easily written to automatically write the appropriate CHARMM commands to do this. charmm_setup.prl is such a script; see Structure Preparation for more information.

To read a PSF:

open read unit 1 card name INPUT_PSF
read PSF card unit 1 resid
close unit 1

Atomic positions are defined separately, but can not be read into CHARMM with out first defining the PSF. The most common format for defining atomic coordinates is a Cartesian coordinate file (CRD); the CHARMM standard format is preferred, but PDB format is also accepted. Coordinates can also be read from a binary dynamic coordinate trajectory file (DCD), as is generated during molecular dynamics.

To read/write CRD files:

open read unit 1 card name INPUT_CRD
read coor card unit 1 resid
close unit 1
open write unit 1 card name OUTPUT_CRD
write coor card unit 1 resid

The Internal Coordinate Table

For manipulating molecular structures, the most covenient approach is to use internal coordinates. The internal coordinate table (equivalent to a Z-matrix) is not unique, and so it is important to be aware of how it is defined for a given molecule. An internal coordinate table can be generated at the same time as the PSF, and that is the preferred approach. A internal coordinate file can then be written out, and read in at any future time.


HBuild

Minimization and Dynamics

Solvent Models

Compiling CHARMM

To compile a parallel version of CHARMM, you must first compile MPI with the right set of compilers. On the greenlab machines, OpenMPI can is installed through apt-get. First, comment out the RMD keyword option in install.com. This is an experimenal feature, and causes CHARMM c35b3 to segfault.

To then compile CHARMM with MPI support, run install.com as follows:

./install.com gnu xxlarge M GFORTRAN

Provide the following as answers:

Enter the absolute path to the mpi include files (mpi.h, etc.)
>> /usr/include/mpi/
Enter the absolute path to the mpi lib files (e.g., libmpi.a(so))
>> /usr/lib/

Check that MPI support works:

[vadim@greenlab2:~/software/c35b3]$ mpirun -np 4 exec/gnu/charmm
...
Parallel load balance (sec.):
Node Eext      Eint   Wait    Comm    List   Integ   Total
  0     0.0     0.0     0.0     0.0     0.0     0.0     0.0
  1     0.0     0.0     0.0     0.0     0.0     0.0     0.0
  2     0.0     0.0     0.0     0.0     0.0     0.0     0.0
  3     0.0     0.0     0.0     0.0     0.0     0.0     0.0
PARALLEL> Average timing for all nodes:
  4     0.0     0.0     0.0     0.0     0.0     0.0     0.0

Even though I did not specify the X86_64 keyword, the installation produces a 64-bit executable:

[vadim@greenlab2:~/software/c35b3/exec/gnu]$ file charmm
charmm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped

Make sure the executable is fine by running the cramblin benchmark:

[vadim@greenlab2:~/software/c35b3/test/cbenchtest]$ ../../exec/gnu/charmm < mbcodyn.inp 

For particularly large systems, the need to increase the heap size will arise. To do this, edit the file source/fcm/heap.fcm, changing the following:

##IF XXLARGE HUGE (size)
      PARAMETER (HEAPDM=10240000)

to something like:

##IF XXLARGE HUGE (size)
      PARAMETER (HEAPDM=81920000)

I found the above setting to be sufficient for doing GB calculations on the entire G-Protein (approximately 800 residues).

Adding MULTE function to CHARMM

The following files are modified or added for MULTE:

[vadim@greenlab2:~/repository/charmm]$ svn log -r 32 -v
------------------------------------------------------------------------
r32 | dfgreen | 2007-06-18 16:54:57 -0400 (Mon, 18 Jun 2007) | 2 lines
Changed paths:
  M /charmm/trunk/build/UNX/energy.mk
  D /charmm/trunk/charmm_installation.txt
  M /charmm/trunk/source/charmm/charmm_main.src
  M /charmm/trunk/source/energy/intere.src
  A /charmm/trunk/source/energy/multe.src
  A /charmm/trunk/source/fcm/multe.fcm

Enter the following commands to see the changes that need to be made within "energy.mk", "charmm_main.src", and "intere.src"

[vadim@greenlab2:~/repository/charmm/trunk]$ svn diff -r 11:32 source/charmm/energy.mk
[vadim@greenlab2:~/repository/charmm/trunk]$ svn diff -r 11:32 source/charmm/charmm_main.src 
[vadim@greenlab2:~/repository/charmm/trunk]$ svn diff -r 11:32 source/energy/intere.src
Personal tools
Namespaces

Variants
Actions
Navigation
Tools