Difference between revisions of "2016 AMBER tutorial with Thrombin"

From Rizzo_Lab
Jump to: navigation, search
(Antechamber, Parmchk, tLeap)
(III. Simulation using pmemd)
Line 13: Line 13:
==III. Simulation using pmemd==
==III. Simulation using pmemd==
In this part of the MD simulation, you begin with the starting coordinates for the system (typically the protein and the small molecule), and you perform a series of minimizations and short MD simulation runs to equilibrate the system. This is to remove any steric clashes and to allow the system to settle down into a natural state. Otherwise, any large steric clashes from the starting coordinates (which could be from the protein data bank or from a dock calculation) can cause the system to behave unnaturally or even come apart. Once the system is properly equilibrated, then you can begin an MD production run in which you record the trajectory.
There is no specific way in which equilibrations should be performed, but this is an example from the class:
1) The first input file is called 01mi.in and contains the following lines of code.
01mi.in: equilibration
  imin = 1, maxcyc = 1000, ntmin = 2,
  ntx = 1, ntc = 1, ntf = 1,
  ntb = 1, ntp = 0,
  ntwx = 1000, ntwe = 0, ntpr = 1000,
  cut = 8.0,
  ntr = 1,
  restraintmask = ':1-207 & !@H=',
This describes a minimization in which we put a large 5.0 kcal/molA^2 on all the heavy atoms except the hydrogens. Thus, the hydrogens are allowed to relax and we remove any steric clashes involving hydrogens.
2) The second input file is called 02md.in and contains the following lines of code.
02md.in: equilibration (1,000,000 = 1ns)
  imin = 0, ntx = 1, irest = 0, nstlim = 50000,
  temp0 = 298.15, tempi = 298.15, ig = 71287,
  ntc = 2, ntf = 1, ntt = 1, dt = 0.001,
  ntb = 2, ntp = 1, tautp = 1.0, taup = 1.0,
  ntwx = 1000, ntwe = 0, ntwr = 1000, ntpr = 1000,
  cut = 8.0, iwrap = 1,
  ntr = 1, nscm = 100,
  restraintmask = ':1-207 & !@H=', restraint_wt = 5.0,
This describes an 'equilibration' or short MD simulation that is intended to bring the system into a more natural (low energy) state. Here, the same restraint is applied on all atoms except the hydrogen atoms, but this time we do an MD simulation, not a minimization.
For the next few steps, we perform 3 minimizations using exactly the same code as in 01mi.in, but we slowly decrease the restraint_wt from 5.0 to 2.0, to 1.0, to 0.05 kcal/molA^2.
After those 3 minimizations, we do 2 short MD simulations. At a high-level, they are as follows:
1) Perform a short MD simulation (almost the same code as in 02md.in) with the restraint_wt = 1.0
2) Perform another short MD simulation with same code as in 02md.in, but with restraintmask = ':1-206@ZIN, CA, C, N', restraint_wt = 0.1. This removes the restraint from the ligand and allows the ligand to equilibrate. Note: the protein residues are numbered 1-205, the zinc ion is residue 206, and the ligand is residue 207.
The length of these simulations can be variable, and in the class step 1) was set for 50 picoseconds and step 2) was set for 100 picoseconds. You can change the length of these simulations as necessary by editing the nstlim variable in the code.
Finally, to do a production run, you would use a mimic of 02md.in (perhaps modified if necessary) with nstlim set to the right number for the right length of simulation. dt is the time step, so the product of nstlim times dt gives the length of the simulation in picoseconds. In 02md.in, a time step of 1 femtosecond was used, which corresponds to 0.001 picoseconds.
To submit this job on seawulf, you can use the following script:
Note: in this submission script, there are calls to mi.in and md.in files which were not explicity mentioned above, but only described at a high level. But these input files, and the submission script, are easily modifiable. You may want to use a different number of minimization/equilibration steps, in which case modifications to these files must be done. To do the modific<nowiki>Insert non-formatted text here</nowiki>ations, you would essentially concentrate on deleting/adding lines of code focusing on the -i XXmi.in part of the lines of code.
replace user_name with your own username.
  #! /bin/tcsh
  #PBS -l nodes=4:ppn=2
  #PBS -l walltime=720:00:00
  #PBS -o zzz.qsub.out
  #PBS -e zzz.qsub.err
  #PBS -V
  #PBS -N pmemd
  set workdir = "/nfs/user03/fochtman/amber_tutorial/003.pmemd"
  cd ${workdir}
  cat \$PBS_NODEFILE | sort | uniq
  mpirun -n 8 pmemd.MPI -O -O -i 01mi.in -o 01mi.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c ../002.tleap/4TKG.com.wat.leap.rst7 -ref ../002.tleap/4TKG.com.wat.leap.rst7 \
  -x 01mi.trj -inf 01mi.info -r 01mi.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 02md.in -o 02md.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 01mi.rst7 -ref 01mi.rst7 -x 02md.trj -inf 02md.info -r 02md.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 03mi.in -o 03mi.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 02md.rst7 -ref 02md.rst7 -x 03mi.trj -inf 03mi.info -r 03mi.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 04mi.in -o 04mi.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 03mi.rst7 -ref 03mi.rst7 -x 04mi.trj -inf 04mi.info -r 04mi.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 05mi.in -o 05mi.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 04mi.rst7 -ref 04mi.rst7 -x 05mi.trj -inf 05mi.info -r 05mi.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 06md.in -o 06md.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 05mi.rst7 -ref 05mi.rst7 -x 06md.trj -inf 06md.info -r 06md.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 07md.in -o 07md.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 06md.rst7 -ref 05mi.rst7 -x 07md.trj -inf 07md.info -r 07md.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 08md.in -o 08md.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 07md.rst7 -ref 05mi.rst7 -x 08md.trj -inf 08md.info -r 08md.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 09md.in -o 09md.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 08md.rst7 -ref 05mi.rst7 -x 09md.trj -inf 09md.info -r 09md.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 10md.in -o 10md.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 09md.rst7 -ref 05mi.rst7 -x 10md.trj -inf 10md.info -r 10md.rst7
  mpirun -n 8 pmemd.MPI -O -O -i 11md.in -o 11md.out -p ../002.tleap/4TKG.com.wat.leap.prm7 \
  -c 10md.rst7 -ref 05mi.rst7 -x 11md.trj -inf 11md.info -r 11md.rst7
==IV. Simulation Analysis==
==IV. Simulation Analysis==

Revision as of 13:13, 6 April 2016

For additional Rizzo Lab tutorials see AMBER Tutorials.

In this tutorial, we will learn how to run a molecular dynamics simulation of a protein-ligand complex. We will then post-process that simulation by calculating structural fluctuations (with RMSD) and free energies of binding (MM-GBSA).

I. Introduction

II. Structural Preparation

Antechamber, Parmchk, tLeap

III. Simulation using pmemd



IV. Simulation Analysis


You should create another work directory for this step (004.ptraj, for example). 1. At first we want to concatenate the two 1ns trajectories together, stripping off the waters, and creating a .strip-file as an output. Below is the input file which will allow us to do so.


trajin ../003.pmemd/10md.trj 1 1000 1
trajin ../003.pmemd/11md.trj 1 1000 1
trajout 4TKG.trj.strip nobox
strip :WAT

The two sets of numbers 1 1000 1 give the input information about which frames are used for the Ptraj. The first two numbers 1 and 1000 specify the starting and ending snapshots from the trajectory file. The ending number of the snapshot doesn't need to be accurate because if you actually don't have enough snapshots in your trajectory file, Ptraj will read up to the last one you have. The last number 1 specifies the frequency of the snapshot saved, in this case, we are saving every frame of the trajectory file. And the last line of the input file will take away all the water molecules.

As the input file is prepared we can launch the first analysis as follows:

ptraj  ../002.tleap/4TKG.com.wat.leap.parm  ptraj.1.in  > ptraj.1.log

As the output you will obtain 4TKG.trj.strip file which contains 2000 snapshots of the trajectory.

2. Later on we want to compare the output file just obtained to our reference file 4TKG.com.gas.leap.rst7, using the following input file.


trajin 4TKG.trj.strip  1 2000 1
trajout 4TKG.com.trj.stripfit
reference ../002.tleap/4TKG.com.gas.leap.rst7
rms reference out 4TKG.rmsd.CA.txt :1-206@CA

Since we have just concatenated the two trajectories, we will have 2000 snapshots in 4TKG.trj.strip. The third line in the input specifies the reference file, we have taken away all the water molecules during the first step, hence we are working here with the gas phase complex. The last line says we are calculating the rmsd for alpha carbon number 1 to 206.

And as we have this file filled out, we can run this step:

ptraj  ../002.tleap/4TKG.com.gas.leap.parm  ptraj.2.in  > ptraj.2.log

The output file 4TKG.rmsd.CA.txt wil contain two columns, the first one is the number of frame and the second one stands for rmsd value.

3. Afterwards we will generate a similar file for ligand, using the following input file.


trajin 4TKG.com.trj.stripfit 1 2000 1
reference ../002.tleap/4TKG.com.gas.leap.rst7
rms reference out 4TKG.lig.rmsd.txt :207@C*,N*,O*,S* nofit

And then run this step:

ptraj  ../002.tleap/4TKG.com.gas.leap.parm  ptraj.3.in  > ptraj.3.log

By doing this we will compare the trajectory file to 4TKG.com.gas.leap.rst7 as well, but working with the ligand instead of the receptor (we specified that by pointing that we want to calculate the rmsd for carbon, nitrogen, oxygen and sulfur in residue 207.

The last two steps are to obtain energetic information about the system. To do this we take a trajectory file of the gas phase complex 4TKG.com.trj.stripfit, and want to create two more trajectory files containing the information on only receptor and only ligand correspondingly.

4. At this step we consider receptor only. The input file is provided below:


trajin 4TKG.com.trj.stripfit 1 2000 1
trajout 4TKG.rec.trj.stripfit
strip :207

And then run this step:

ptraj  ../002.tleap/4TKG.com.gas.leap.parm  ptraj.4.in  > ptraj.4.log

5. And the same procedure for the ligand, with the following input file:


trajin 4TKG.com.trj.stripfit 1 2000 1
trajout 4TKG.lig.trj.stripfit
strip :1-206

And then run this step:

ptraj  ../002.tleap/4TKG.com.gas.leap.parm  ptraj.5.in  > ptraj.5.log

6. (optional) Visualization

As we've gone through all these steps, the analysis is done. If you want to visualize the trajectories, you first need to copy the trajectory files to Herbie like this, for example (being a level above 004.PTRAJ directory):

scp 004.ptraj/ your_username@herbie.mathlab.sunysb.edu:~AMS536/amber_tutorial/004.ptraj 

Now, launch VMD, then open one of the .prm7 files in 002.tleap. If you want to visualize the whole complex in gas state, you can open 4TKG.com.gas.leap.prm7 with AMBER7 Parm from 002.tleap and then 4TKG.com.trj.stripfit with AMBER coordinates from 004.ptraj. With these files, you can look at the real-time movement of the complex in the gas state. You can repeat this procedure to observe the real-time movement of the complex in the water state. Just open 4TKG.com.wat.leap.prm7 instead of 4TKG.com.gas.leap.prm7.

MM-GBSA Energy Calculation

Molecular Mechanics-Generalized Born Surface Area (MM-GBSA) is a great method to calculate or estimate relative binding affinity of a ligand(s) to a receptor. The binding energy calculated from this method are also known as free energies of binding, where the more negative values indicate stronger binding. For this section, the topology files for the ligand, receptor and complex are needed.

Create a new directory:

 mkdir 005.MMGBSA

Create an input file name

 vim gb.rescore.in

Enter the following into the input file:

  Single point GB energy calc
 ntf    = 1,        ntb    = 0,        ntc    = 2,
 idecomp= 0,
 igb    = 5,        saltcon= 0.00,
 gbsa   = 2,        surften= 1.0,
 offset = 0.09,     extdiel= 78.5,
 cut    = 99999.0,  nsnb   = 99999,
 imin   = 5,        maxcyc = 1,        ncyc   = 0,

Create a tcsh/bash/csh script (run.sander.rescore.csh) with the following information:

 #! /bin/tcsh
 #PBS -l nodes=1:ppn=1
 #PBS -l walltime=48:00:00
 #PBS -o zzz.qsub.out
 #PBS -e zzz.qsub.err
 #PBS -V
 #PBS -N mmgbsa
 set workdir = /nfs/user03/kbelfon/amber_tutorial/005.mmgbsa
 cd $workdir
 sander -O -i gb.rescore.in \
 -o gb.rescore.out.com \
 -p ../002.tleap/4TKG.com.gas.leap.prm7 \
 -c ../002.tleap/4TKG.com.gas.leap.rst7 \
 -y ../004.ptraj/4TKG.com.trj.stripfit \
 -r restrt.com \
 -ref ../002.tleap/4TKG.com.gas.leap.rst7 \
 -x mdcrd.com \
 -inf mdinfo.com

 sander -O -i gb.rescore.in \
 -o gb.rescore.out.lig \
 -p ../002.tleap/4TKG.lig.gas.leap.prm7 \
 -c ../002.tleap/4TKG.lig.gas.leap.rst7 \
 -y ../004.ptraj/4TKG.lig.trj.stripfit \
 -r restrt.lig \
 -ref ../002.tleap/4TKG.lig.gas.leap.rst7 \
 -x mdcrd.lig \
 -inf mdinfo.lig 
 sander -O -i gb.rescore.in \
 -o gb.rescore.out.test.rec \
 -p ../002.tleap/4TKG.rec.gas.leap.prm7 \
 -c ../002.tleap/4TKG.rec.gas.leap.rst7 \
 -y ../004.ptraj/4TKG.rec.trj.stripfit \
 -r restrt.rec \
 -ref ../002.tleap/4TKG.rec.gas.leap.rst7 \
 -x mdcrd.rec \
 -inf mdinfo.rec 

Execute this script on the seawulf cluster or machine(s) of your preference

 qsub run.sander.rescore.csh

Three output files will be generated once the job is completed: gb.rescore.out.com, gb.rescore.out.lig, and gb.rescore.out.rec These files represent the single point energy calculation results for the complex (.com), the ligand (.lig) and the receptor (.rec). The energy will be output by the program Sander for each frame specified in the input file. The final results for one frame in one of the three files should look as the following:

                                   FINAL RESULTS
   NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
      1       5.9132E+03     2.0005E+01     1.2640E+02     C         159
 BOND    =      661.8980  ANGLE   =     1751.7992  DIHED      =     2581.7692
 VDWAALS =    -1696.6585  EEL     =   -13958.9335  EGB        =    -3125.9524
 1-4 VDW =      747.0185  1-4 EEL =     7750.8118  RESTRAINT  =        0.0000
 ESURF   =    11201.4791
minimization completed, ENE= 0.59132314E+04 RMS= 0.200047E+02

Extracting Data from MM-GBSA calculation and calculating Free energy of Binding From the output files above:


EELS = ΔGcoul

EGB = ΔGpolar


With this information ΔGnonpolar can be solved using equation(1):

ΔGnonpolar = SASA*0.00542 + 0.92 (1)

Once ΔGnonpolar is solved then ΔGmmgbsa can be determined by equation(2):

ΔGmmgbsa = ΔGvdw + ΔGcoul + ΔGpolar + ΔGnonpolar (2)

Solve equation 2 and 3 using the extracted information from all three output files. So therefore you should have ΔGmmgbsa for the complex, ligand and receptor

Finally ΔΔGbind can be calculated using equation (3):

ΔΔGbind = ΔGmmgbsa,complex – (ΔGmmgbsa,lig + ΔGmmgbsa,rec) (3)

Plot your ΔΔGbind and examine the plot for changes in the ligand position and the ΔΔGbind. Also, you should calculate the mean and standard deviation for your ΔΔGbind.

The following script (get.mmgbsa.sh) can be used to extract the energy from the three output files obtained above and calculate ΔΔGbind:

 #! /bin/bash
 # by Haoquan
 echo com lig rec > namelist
 LIST=`cat namelist`
 for i in $LIST ; do
 grep VDWAALS gb.rescore.out.$i | awk '{print $3}' > $i.vdw
 grep EGB     gb.rescore.out.$i | awk '{print $9}' > $i.polar
 grep EELS    gb.rescore.out.$i | awk '{print $6}' > $i.coul
 grep ESURF   gb.rescore.out.$i | awk '{print $3 * 0.00542 + 0.92}' > $i.surf
 paste -d " " $i.vdw $i.polar $i.surf $i.coul | awk '{print $1 + $2 + $3 + $4}' > data.$i
 rm $i.*
 paste -d " " data.com data.lig data.rec | awk '{print $1 - $2 - $3}' > data.all 
 for ((j=1; j<=`wc -l data.all | awk '{print $1}'`; j+=1)) do
 echo $j , >> time
 paste -d " " time data.all > MMGBSA_vs_time.dat  
 rm namelist time data.*

Execute this script:

 bash get.mmgbsa.sh

A text file called MMGBSA_vs_time.dat with x and y values separated by a space and comma should be created. Use XMGRACE to plot this dat file using the following command in Linux:

 xmgrace MMGBSA_vs_time.dat

V. Frequently Encountered Problems