[关闭]
@Billy-The-Crescent 2019-10-08T16:01:21.000000Z 字数 13716 阅读 726

Molecular Dynamics Using GROMACS

Moleculle Dynamics GROMACS Simulation


Software: GROMACS: http://www.gromacs.org

Manual: http://www.gromacs.org/Documentation/Manual

Platform: Linux

Initial Protein Structure: cns1_model1.pdb


1 Check GROMACS

GROMACS location:

/usr/local/gromacs/bin/

Set environment variable:

  1. export PATH=$PATH:/usr/local/gromacs/bin/
  2. #test if environment works
  3. gmx -version

Result:

So, it works.


2 cns1_model1 MD Simulation

2.1 protein pdb file preprocessing

1 . Remove the crystal waters in the pdb file
Use grep to delete these lines very easily:

  1. grep -v HOH cns1_model1.pdb > cns1_clean.pdb

2.3 Molecule Dynamics Simulation

1 . Transfer pdb to gmx format, which contains:

  • The topology for the molecule.
  • A position restraint file.
  • A post-processed structure file.
  1. gmx pdb2gmx -ignh -ff amber99sb-ildn -f cns1_clean.pdb -o cns1_clean.gro -p cns1_clean.top -water tip3p

2 . Create the simulation box

We use editconf operation to create periodic simulation box.

  1. gmx editconf -f cns1_clean.gro -o cns1_clean-PB.gro -bt cubic -d 1.2
  2. #-bt dodecahedron (dodecahedron is probable better in other situations)

We use -bt option to create the rhombic dodecahedron, because its volume is ~71% of the cubic box of the same periodic distance, thus saving on the number of water molecules that need to be added to solvate the protein. -d option specifies the minimum distance of the molecule to the box margin, using nm as the unit. It specifies the size of the box. In theory, of the majority of the systems, -d can not be less than 0.9nm, so we use 1.2nm.

We can check the structure of the protein with the added box. We need to transfer the gro format to pdb format using editconf operation

For example, we can convert the file.gro to file.pdb

  1. gmx editconf -f file.gro -o file.pdb

3 . Energy minimization of the protein molecule in vaccum

We should design the specific .mdp file to specify parameters.

em-vac-pme.mdp

  1. ; Definition delivered to preprocessor
  2. define = -DFLEXIBLE ; Use flexible water model rather than rigid water model, thus steepest descent method will further minimize the energy
  3. ; Model type, Ending control, input control parameter
  4. integrator = steep ; Algorithm (steep = steepest descent minimization)
  5. emtol = 500.0 ; Stop minimization when the maximum force < 1000.0 kJ/mol/nm
  6. emstep = 0.01 ; Minimization step size
  7. nsteps = 1000 ; Maximum number of (minimization) steps to perform
  8. nstenergy = 1 ; Energy writing frequency
  9. energygrps = System ; Writing energy group
  10. ; Nearst list, interaction calculation parameter
  11. nstlist = 1 ; Frequency to update the neighbor list and long range forces
  12. ns_type = grid ; Method to determine neighbor list (simple, grid)
  13. coulombtype = PME ; Treatment of long range electrostatic interactions
  14. rlist = 1.0 ;
  15. rcoulomb = 1.0 ; Short-range electrostatic cut-off
  16. vdwtype = cut-off ; Method for calculating van der waals interaction
  17. rvdw = 1.0 ; Short-range Van der Waals cut-off
  18. constraints = none ; Set the restriction of the model
  19. pbc = xyz ; Periodic Boundary Conditions in all 3 dimensions

Gromacs pre-processor (grompp) can integrate all information including simulated parameter, molecular structure, molecular structure, acquired force field parameter into a single binary file (tpr file), so it requires only tpr file while running mdrun.

  1. gmx grompp -f em-vac-pme.mdp -c cns1_clean-PB.gro -p cns1_clean.top -o cns1_em-vac.tpr

After that, we get file cns1_em-vac.tpr and parameter file mdout.mdp.

We use mdrun intruction to run the energy minimization

  1. gmx mdrun -v -deffnm cns1_em-vac

After 1001 steps, result is :

As a result, we get the record file cns1_em-vac.log, Binary full-precision trajectory cns1_em-vac.trr, Energy-minimized structure cns1_em-vac.gro.

If we only need the molecule dynamics simulation in vaccum, the above steps have got what we want, the .trr file, which can be depicted to movies using VMD software. However, if we need simulation in the solvent, water, for example, we have to go further.

4 . Infusing solvent and ion into the box and conduct energy minimization

We use gmx solvate to infuse the water into the box, simulating the solvation of the protein molecule.

  1. gmx solvate -cp cns1_em-vac.gro -cs spc216.gro -p cns1_clean.top -o cns1-b4ion.gro

As a result, we get cns1-b4ion.gro.

Then we need to minimize the energy of the system, using another em-sol-pme.mdp file.

em-sol-pme.mdp

  1. define = -DFLEXIBLE
  2. integrator = steep
  3. emtol = 250.0
  4. nsteps = 5000
  5. nstenergy = 1
  6. energygrps = System
  7. nstlist = 1
  8. ns_type = grid
  9. coulombtype = PME
  10. rlist = 1.0
  11. rcoulomb = 1.0
  12. rvdw = 1.0
  13. constraints = none
  14. pbc = xyz

Likewise, we need to use grompp to process the .mdp file, after which we start to conduct mdrun.

  1. gmx grompp -f em-sol-pme.mdp -c cns1-b4ion.gro -p cns1_clean.top -o ion.tpr

The generated ion.tpr is the result, and the output message is as follows:

We can see from the message that the total charge is -3.999995. Since the total charge should be described in integers, there are around -4e charge.

Then, we need to add the ion into the system, using the ion.tpr file. The ion we add should neutralise the charge original in the system. Since we have -4e charge in the system, we need to add more negion than cation.

We use geion operation to replace some water molecules by ions.

  1. gmx genion -s ion.tpr -o cns1-b4em.gro -neutral -conc 0.15 -p cns1_clean.top

Aftering executing this operation, it appears a consecutive solvent molecule group. Here we choose 13(SOL). Typing Enter, the procudure will tell your your solvent molecules have been replaced by Cl ion.

Inorder to run energy minimization by mdrun, we have to use the grompp operation again.

  1. gmx grompp -f em-sol-pme.mdp -c cns1-b4em.gro -p cns1_clean.top -o cns1_em-sol.tpr

Then, we run energy minimization:

  1. gmx mdrun -v -deffnm cns1_em-sol

We can see that after 5001 steps, it reaches convergence.

Note: genion uses NaCl in default. If users want any other negion and cation, they can use -pname (cation) and -nname (negion) to specify the name of the ions. Users can refer tothe ion.itp file to see how to call different ions

5 . Position-restricted pre-equalization simulation

We now need to construct position-restricted pre-equalization simulation, that is to say, we fix the position of the protein atoms and keep the solvent molecules moving, just like soaking the protein molecules into the water, enabling the further equilibration of the system.

We need to perform two stages of position-restricted pre-equalizations: 100ps NVT and 100ps NPT, with the temperature of 310 K, which is similar to the experiment room temperature. It is appropriate to simulate in 310 K, since it is similar to the body temperature.

Likewise, we need another .mdp file called nvt-pr-md.mdp file.

  1. define = -DPOSRES ; Tell GROMACS run position restricted siulation
  2. integrator = md
  3. dt = 0.002 ; step length, the unit of which is ps, here we use 2fs
  4. nsteps = 50000 ; number of steps, the simulation time is nsteps*dt
  5. ; output control parameter
  6. nstxout = 500 ; Writing frequency, nstxout=500 and dt=0.002, so it writes out every 1 ps
  7. nstvout = 500 ; Velocity saving frequency
  8. nstenergy = 500 ; Energy saving frequency
  9. nstlog = 500 ; log file output frequency
  10. energygrps = Protein Non-Protein
  11. ;
  12. nstlist = 5
  13. ns_type = grid
  14. pbc = xyz
  15. rlist = 1.0
  16. ;
  17. coulombtype = PME
  18. pme_order = 4
  19. fourierspacing = 0.16
  20. rcoulomb = 1.0 ; unit is nm
  21. vdw-type = Cut-off
  22. rvdw = 1.0
  23. ;
  24. tcoupl = v-rescale
  25. tc-grps = Protein Non-Protein
  26. tau_t = 0.1 0.1
  27. ref_t = 300 300
  28. ;
  29. DispCorr = EnerPres
  30. ;
  31. pcoupl = no
  32. ;
  33. gen_vel = yes
  34. gen_temp = 300
  35. gen_seed = -1
  36. ;
  37. constraints = all-bonds
  38. continuation = no
  39. constraint_algorithm = lincs
  40. lincs_iter = 1
  41. lincs_order = 4

Also, we need to use grommp and then mdrun again.

  1. gmx grompp -f nvt-pr-md.mdp -c cns1_em-sol.gro -p cns1_clean.top -o cns1_nvt-pr.tpr
  2. #gmx mdrun -deffnm cns1_nvt-pr

If mdrun requires so much time, users can use nohup to run the program background.

  1. nohup gmx mdrun -deffnm cns1_nvt-pr &
  2. #If you want to check the state of the program
  3. tail -n 25 cns1_nvt-pr.log

NPT simulation uses npt-pr-md.mdp ass the parameter file

  1. define = -DPOSRES
  2. integrator = md
  3. dt = 0.002
  4. nsteps = 50000
  5. nstxout = 500
  6. nstvout = 500
  7. nstfout = 500
  8. nstenergy = 500
  9. nstlog = 500
  10. energygrps = Protein Non-Protein
  11. nstlist = 5
  12. ns-type = Grid
  13. pbc = xyz
  14. rlist = 1.0
  15. coulombtype = PME
  16. pme_order = 4
  17. fourierspacing = 0.16
  18. rcoulomb = 1.0
  19. vdw-type = Cut-off
  20. rvdw = 1.0
  21. Tcoupl = v-rescale
  22. tc-grps = Protein Non-Protein
  23. tau_t = 0.1 0.1
  24. ref_t = 300 300
  25. DispCorr = EnerPres
  26. ;
  27. Pcoupl = Parrinello-Rahman
  28. Pcoupltype = Isotropic
  29. tau_p = 2.0
  30. compressibility = 4.5e-5
  31. ref_p = 1.0
  32. refcoord_scaling = com
  33. gen_vel = no
  34. constraints = all-bonds
  35. continuation = yes
  36. constraint_algorithm = lincs
  37. lincs_iter = 1
  38. lincs_order = 4

We use the result .gro file as the input of the nvt simulation.

  1. gmx grompp -f npt-pr-md.mdp -c cns1_nvt-pr.gro -p cns1_clean.top -o cns1_npt-pr.tpr
  2. nohup gmx mdrun -deffnm cns1_npt-pr &
  3. #tail -n 25 cns1_npt-pr.log

6 . Final simulation

After equalization, we are able to conduct the final simulation

Still, we need another .mdp file

npt-nopr-md.mdp

  1. integrator = md
  2. dt = 0.002
  3. nsteps = 500000 ; 1 ns
  4. nstxout = 1000
  5. nstvout = 1000
  6. nstfout = 1000
  7. nstenergy = 1000
  8. nstlog = 1000
  9. energygrps = Protein Non-Protein
  10. nstlist = 5
  11. ns-type = Grid
  12. pbc = xyz
  13. rlist = 1.0
  14. coulombtype = PME
  15. pme_order = 4
  16. fourierspacing = 0.16
  17. rcoulomb = 1.0
  18. vdw-type = Cut-off
  19. rvdw = 1.0
  20. Tcoupl = v-rescale
  21. tc-grps = Protein Non-Protein
  22. tau_t = 0.1 0.1
  23. ref_t = 300 300
  24. DispCorr = EnerPres
  25. Pcoupl = Parrinello-Rahman
  26. Pcoupltype = Isotropic
  27. tau_p = 2.0
  28. compressibility = 4.5e-5
  29. ref_p = 1.0
  30. gen_vel = no
  31. constraints = all-bonds
  32. continuation = yes
  33. constraint_algorithm = lincs
  34. lincs_iter = 1
  35. lincs_order = 4

Coding:

  1. gmx grompp -f npt-nopr-md.mdp -c cns1_npt-pr.gro -p cns1_clean.top -o cns1_npt-nopr.tpr
  2. nohup gmx mdrun -deffnm cns1_npt-nopr &
  3. #tail -n 25 cns1_npt-nopr.log

In order to save disk space, users can use trjconv operation to compress .trr trace file to xtc file, which is calculated faster in analysis. Also we should use -pbc nojump option to ensure all the atoms in the box.

  1. gmx trjconv -f cns1_npt-nopr.trr -s cns1_npt-nopr.tpr -o cns1_npt-nopr.xtc -pbc nojump -ur compact -center
  2. #Choose 0 in the two choice options. If the xtc file size is too large, choose 1 in thsese 2 options.

Note: If the resulting .trr file is to big, which is more than 10GB and even 20GB, you'd better alter the npt-nopr-md.mdp, changing the writing frequency (nstxout, nstvout, nstfout, nstenergy, nstlog) from 100 to 5000 or even 10000.

2.4 Simulation result analysis

Once we get the .xtc trace file, we'd like to analyse it.

2.4.1 Make an animation of the MD process

Instead of using VMD software, we choose Pymol alternatively, since latest VMD only support 32-bit program, which means that the max number of memory addresses is 2GB. When we used VMD, we could not even be able to operate 300M xtc trace file together with .gro structural file. Additionally, the movie made from Pymol is better than from VMD, and the UI is more friendly.

Firstly, we need to convert the xtc file and gro file together to pdb file, which can be processed by Pymol.

  1. trjconv -s cns1_npt-nopr.gro -f cns1_npt-nopr.xtc -o movie.pdb

Then open movie.pdb in Pymol.

  1. 1. Pre-review the movie of the frames
  2. PyMOL> mplay
  3. Type "mstop" to stop the animation
  4. 2. Saving frames in PNG format
  5. PyMOL> mpng frame
  6. It will produce .npg files in Pymol directory

Then, use gif convertion software of linux operation to convert the npg files to gif format.

In linux, the operation is:

  1. convert -delay 10 -loop 0 frame*.png movie.gif

-delay 10: the time interval between frames
frame*.png: the frames which compose the animation

In VideoMach software, load the npg format files and export the media in gif format.

2.4.2 Plot the parameter fluctuation

Use gmx g_energy operatio to extract the data

  1. gmx energy -f cns1_npt-nopr.edr -o cns1_enrg-npt.xvg

It will appears some options of the data we would like to extract:

Here, we'd like to extract the energy and temperature data, so we type 10 11 12 13 and key in Enter twice to execute the operation.

The result will show in cns1_enrg-npt.xvg, and we can draw the picture using Microsoft Office Excel.

2.4.3 Alignment to the initial structure

Firstly, we need to convert the cns1_npt-nopr.pro to pdb file.

  1. gmx editconf -f cns1_npt-nopr.gro -o cns1_npt-nopr.pdb

Use align operation in Pymol to align the two structures

Aftering loading the structures into pymol software, we should remove the waters and ions of the MD result structure.

In pymol, on the right bar of cns1_npt-nopr, click action|remove waters to remove waters, and alert the selecting state of Residue on the bottom right to Molecule.

Click on the protein molecule and it appears an object called (sele), and click action|extract object and it created an object called obj01. Rename it to cns1_MD.

Load the initial structure file cns1_model1.pdb and we can align the two structures.

  1. align cns1_MD, cns1_model1

After alignment, we can get the RMSD value in the console.

If we want to make a movie of the 360-degree-view about the alignment, we need to use pymol console.

  1. PyMOL> mset 1 x360
  2. This command creates a movie with 60 frames
  3. PyMOL> util.mroll 1,360
  4. This command rotates the protein molecule 360 deg in 360 frames
  5. #the number of the frames can control the speed of the rotation, more frames means lower speed.
  6. PyMOL> mplay
  7. Type "mstop" to stop the animation
  8. 2. Saving frames in PNG format
  9. PyMOL> mpng frame

It saves 360 frames png file in the python36 directory, use VideoMach to generate gif file.

2.4.4 Calculation of RMSD fluctuation

Use gmx rms to calculate the RMSD between the backbone after molecular dynamics simulation and the initial backbone.

  1. gmx rms -s cns1_npt-nopr.tpr -f cns1_npt-nopr.xtc -o cns1-bkbone-rmsd.xvg

Choose option 4 (backbone) when it alerts.

Use gmx rmsdist to calculate the RMSD of the distance fluctuation betwwen the atoms.

  1. gmx rmsdist -s cns1_npt-nopr.tpr -f cns1_npt-nopr.xtc -o cns1_distrmsd.xvg

Likewise, use Excel to draw the picture.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注