Advertisement

分子动力学模拟学习2-Gromacs运行分子动力学模拟

阅读量:

1. 把上一步生成的Enzyme.gro和Enzyme.top文件改个名字

复制代码
 cp Enzyme.top topol.top

    
 cp Enzyme.gro complex.gro
    
    
    
    

2. 能量最小化

首先准备能量最小化mdp文件 em_real.mdp ,示例如下

复制代码
 ; minim.mdp - used as input into grompp to generate real_em.tpr

    
 ; Parameters describing what to do, when to stop and what to save
    
 integrator  = steep ; Algorithm (steep = steepest descent minimization)
    
 emtol       = 1000.0        ; Stop minimization when the maximum force < 1000.0 kJ/mol/nm
    
 emstep      = 0.01          ; Minimization step size
    
 nsteps      = 50000         ; Maximum number of (minimization) steps to perform
    
  
    
 ; Parameters describing how to find the neighbors of each atom and how to calculate the interactions
    
 nstlist         = 1         ; Frequency to update the neighbor list and long range forces
    
 cutoff-scheme   = Verlet ; Buffered neighbor searching
    
 ns_type         = grid ; Method to determine neighbor list (simple, grid)
    
 coulombtype     = PME ; Treatment of long range electrostatic interactions
    
 rcoulomb        = 1.0       ; Short-range electrostatic cut-off
    
 rvdw            = 1.0       ; Short-range Van der Waals cut-off
    
 pbc             = xyz ; Periodic Boundary Conditions in all 3 dimensions
    
  
    
 gmx grompp -f em_real.mdp -c complex.gro -r complex.gro -p topol.top -o em.tpr 
    
 gmx mdrun -v -deffnm em
    
    
    
    
    AI写代码
![](https://ad.itadn.com/c/weblog/blog-img/images/2025-05-31/kL8WDVRiYXz9jyp4GPSmsKQOq7Tw.png)

em_real.mdp文件中的各项参数说明:

(1)integrator:

=steep:用最陡下降法做能量极小化。

=cg:用共现桃度法做能量极小化(不支持约束)。

=l-bigs:用L-BFGS法做能量极小化。

=nm:做正则振动分析( 必须双精度版)。

(2)emtol: 能量极小化时最大受力小于多少就认为收敛(kJ/mol/nm).默认为10.0。

当最大作用力小于此值,认为最小化过程收敛。一般蛋白-配体中是1000、500。

(3)emstep: 最陡下降法最大步长(nm)。默认0.01。

(4)nsteps: 动力学或能量极小化的步数上限,指定最大迭代次数。

之后运行能量最小化

复制代码
 gmx grompp -f em_real.mdp -c complex.gro -r complex.gro -p topol.top -o em.tpr

    
 gmx mdrun -v -deffnm em
    
    
    
    

3. NVT平衡

首先准备NVT所需mdp文件 nvt.mdp ,示例如下:

复制代码
 title                   = NVT

    
 define                  = -DPOSRES ; position restrain the protein
    
  
    
 ; Run parameters
    
 integrator              = md ; leap-frog integrator
    
 nsteps                  = 50000     ; 2 * 50000 = 100 ps
    
 dt                      = 0.002     ; 2 fs
    
  
    
 ; Output control
    
 nstxout                 = 500       ; save coordinates every 1.0 ps
    
 nstvout                 = 500       ; save velocities every 1.0 ps
    
 nstenergy               = 500       ; save energies every 1.0 ps
    
 nstlog                  = 500       ; update log file every 1.0 ps
    
  
    
 ; Bond parameters
    
 continuation            = no        ; first dynamics run
    
 constraint_algorithm    = shake ; holonomic constraints
    
 constraints             = h-bonds ; bonds involving H are constrained
    
 shake-SOR               = no
    
 shake-tol               = 0.0001 
    
  
    
 ; Nonbonded settings
    
 cutoff-scheme           = Verlet ; Buffered neighbor searching
    
 ns_type                 = grid ; search neighboring grid cells
    
 nstlist                 = 10        ; 20 fs, largely irrelevant with Verlet
    
 rcoulomb                = 1.0       ; short-range electrostatic cutoff (in nm)
    
 rvdw                    = 1.0       ; short-range van der Waals cutoff (in nm)
    
 DispCorr                = EnerPres ; account for cut-off vdW scheme
    
  
    
 ; Electrostatics
    
 coulombtype             = PME ; Particle Mesh Ewald for long-range electrostatics
    
 pme_order               = 4         ; cubic interpolation
    
 fourierspacing          = 0.16      ; grid spacing for FFT
    
  
    
 ; Temperature coupling is on
    
 tcoupl                  = V-rescale ; modified Berendsen thermostat
    
 tc-grps                 = Protein Non-Protein ; two coupling groups - more accurate
    
 tau_t                   = 0.1     0.1           ; time constant, in ps
    
 ref_t                   = 300     300           ; reference temperature, one for each group, in K
    
  
    
 ; Pressure coupling is off
    
 pcoupl                  = no        ; no pressure coupling in NVT
    
  
    
 ; Periodic boundary conditions
    
 pbc                     = xyz ; 3-D PBC
    
  
    
 ; Velocity generation
    
 gen_vel                 = yes       ; assign velocities from Maxwell distribution
    
 gen_temp                = 300       ; temperature for Maxwell distribution
    
 gen_seed                = -1        ; generate a random seed
    
    
    
    
    AI写代码
![](https://ad.itadn.com/c/weblog/blog-img/images/2025-05-31/BtAUkoXRhSmpI3OfYJKe9c7r45nN.png)

关于各参数的含义,参见后面md.mdp文件中的参数解释。

需要注意的是,前面我们利用的AmberTools来产生top文件,因此如果我们这里用POSRES来做位置约束的话,需要将topol.top文件中的ifdef flexible修改为ifdef POSRES,否则此步中会出现warning。

之后运行NVT平衡

复制代码
 gmx grompp -f nvt.mdp -c em.gro -r em.gro -p topol.top -o nvt.tpr

    
 gmx mdrun -deffnm nvt  
    
    
    
    

4. NPT平衡

同样,首先准备NPT所需的 npt.mdp 文件

复制代码
 title                   = NPT

    
 define                  = -DPOSRES ; position restrain the protein
    
  
    
 ; Run parameters
    
 integrator              = md ; leap-frog integrator
    
 nsteps                  = 50000     ; 2 * 50000 = 100 ps
    
 dt                      = 0.002     ; 2 fs
    
  
    
 ; Output control
    
 nstxout                 = 500       ; save coordinates every 1.0 ps
    
 nstvout                 = 500       ; save velocities every 1.0 ps
    
 nstenergy               = 500       ; save energies every 1.0 ps
    
 nstlog                  = 500       ; update log file every 1.0 ps
    
  
    
 ; Bond parameters
    
 continuation            = yes       ; Restarting after NVT
    
 constraint_algorithm    = shake ; holonomic constraints
    
 constraints             = h-bonds ; bonds involving H are constrained
    
 shake-SOR               = no
    
 shake-tol               = 0.0001 
    
  
    
 ; Nonbonded settings
    
 cutoff-scheme           = Verlet ; Buffered neighbor searching
    
 ns_type                 = grid ; search neighboring grid cells
    
 nstlist                 = 10        ; 20 fs, largely irrelevant with Verlet scheme
    
 rcoulomb                = 1.0       ; short-range electrostatic cutoff (in nm)
    
 rvdw                    = 1.0       ; short-range van der Waals cutoff (in nm)
    
 DispCorr                = EnerPres ; account for cut-off vdW scheme
    
  
    
 ; Electrostatics
    
 coulombtype             = PME ; Particle Mesh Ewald for long-range electrostatics
    
 pme_order               = 4         ; cubic interpolation
    
 fourierspacing          = 0.16      ; grid spacing for FFT
    
  
    
 ; Temperature coupling is on
    
 tcoupl                  = V-rescale ; modified Berendsen thermostat
    
 tc-grps                 = Protein Non-Protein ; two coupling groups - more accurate
    
 tau_t                   = 0.1     0.1           ; time constant, in ps
    
 ref_t                   = 300     300           ; reference temperature, one for each group, in K
    
  
    
 ; Pressure coupling is on
    
 pcoupl                  = Parrinello-Rahman ; Pressure coupling on in NPT
    
 pcoupltype              = isotropic ; uniform scaling of box vectors
    
 tau_p                   = 2.0                   ; time constant, in ps
    
 ref_p                   = 1.0                   ; reference pressure, in bar
    
 compressibility         = 4.5e-5                ; isothermal compressibility of water, bar^-1
    
 refcoord_scaling        = com
    
  
    
 ; Periodic boundary conditions
    
 pbc                     = xyz ; 3-D PBC
    
  
    
 ; Velocity generation
    
 gen_vel                 = no        ; Velocity generation is off
    
    
    
    
    AI写代码
![](https://ad.itadn.com/c/weblog/blog-img/images/2025-05-31/VuCUTtfnLPSWjq3NFe46IXihOkQd.png)

之后运行NPT

复制代码
 gmx grompp -f npt.mdp -c nvt.gro -r nvt.gro -t nvt.cpt -p topol.top -o npt.tpr

    
 gmx mdrun -deffnm npt 
    
    
    
    

5. 成品模拟

md.mdp 文件示例如下

复制代码
 title                   = MD

    
 ; Run parameters
    
 integrator              = md ; leap-frog integrator
    
 nsteps                  = 50000000    ; 2 * 50000000 = 100000 ps (100 ns)
    
 dt                      = 0.002     ; 2 fs
    
 ; Output control
    
 nstxout                 = 0         ; suppress bulky .trr file by specifying
    
 nstvout                 = 0         ; 0 for output frequency of nstxout,
    
 nstfout                 = 0         ; nstvout, and nstfout
    
 nstenergy               = 5000      ; save energies every 10.0 ps
    
 nstlog                  = 5000      ; update log file every 10.0 ps
    
 nstxout-compressed      = 5000      ; save compressed coordinates every 10.0 ps
    
 compressed-x-grps       = System ; save the whole system
    
 ; Bond parameters
    
 continuation            = yes       ; Restarting after NPT
    
 constraint_algorithm    = shake ; holonomic constraints
    
 constraints             = h-bonds ; bonds involving H are constrained
    
 shake-SOR               = no
    
 shake-tol               = 0.0001 
    
 ; Neighborsearching
    
 cutoff-scheme           = Verlet ; Buffered neighbor searching
    
 ns_type                 = grid ; search neighboring grid cells
    
 nstlist                 = 10        ; 20 fs, largely irrelevant with Verlet scheme
    
 rcoulomb                = 1.0       ; short-range electrostatic cutoff (in nm)
    
 rvdw                    = 1.0       ; short-range van der Waals cutoff (in nm)
    
 ; Electrostatics
    
 coulombtype             = PME ; Particle Mesh Ewald for long-range electrostatics
    
 pme_order               = 4         ; cubic interpolation
    
 fourierspacing          = 0.16      ; grid spacing for FFT
    
 ; Temperature coupling is on
    
 tcoupl                  = V-rescale ; modified Berendsen thermostat
    
 tc-grps                 = Protein Non-Protein ; two coupling groups - more accurate
    
 tau_t                   = 0.1     0.1           ; time constant, in ps
    
 ref_t                   = 300     300           ; reference temperature, one for each group, in K
    
 ; Pressure coupling is on
    
 pcoupl                  = Parrinello-Rahman ; Pressure coupling on in NPT
    
 pcoupltype              = isotropic ; uniform scaling of box vectors
    
 tau_p                   = 2.0                   ; time constant, in ps
    
 ref_p                   = 1.0                   ; reference pressure, in bar
    
 compressibility         = 4.5e-5                ; isothermal compressibility of water, bar^-1
    
 ; Periodic boundary conditions
    
 pbc                     = xyz ; 3-D PBC
    
 ; Dispersion correction
    
 DispCorr                = EnerPres ; account for cut-off vdW scheme
    
 ; Velocity generation
    
 gen_vel                 = no        ; Velocity generation is off
    
    
    
    
    AI写代码
![](https://ad.itadn.com/c/weblog/blog-img/images/2025-05-31/SUNy2MoBrQejfP0gAiwbcYqvuEmp.png)

md.mdp文件中各项参数含义:

(1)title=MD:标题,可任意定义(最长64个字)

(2)define:常涉及到的是-DFLEXIBLE,会使水分子不被SETTLES算法约束成刚性。当利用posre.itp对位置进行限制时可用-DPOSRES使之生效.

(3)integrator: 决定当前任务干什么。

=md (默认) :leap-frog( md蛙跳算法)方式做动力学。

=md-vv:用Velocity-Verlet方式做动力学,在功能上有一些限制。

=sd:做随机动力学(Langevin动力学)。

=bd:做布朗动力学。

(4) tinit:动力学开始的时间(ps)。 默认0

(5) dt:动力学步长(ps)。默认0.001 (1fs),一般我们都使用0.002。

(6)nsteps:动力学或能量极小化的步数上限,指定最大迭代次数。

(7)init-step: 起始步数, 对非平衡模拟, 精确重启或重做某部分模拟时, 设定为重启步编号。

(8)nstxout = 0:输出trr坐标10000

nstvout = 0:输出trr速度 10000

nstfout = 0:输出trr受力 10000

nstxtcout = 5000:如果这个数比前三者小的多,那么其就会很大,比trr都大。

compressed-x-precision =5000:写入xtc轨迹的精确度。默认为 (1000)

compressed-x-grps:选择输出到xtc文件里的group, 默认为system。该参数只影响xtc轨迹,不影响trr轨迹。如果想在做动力学的时候就只把蛋白写入轨迹文件中,可以mdp中设compressed-x-grps = non-water。一般我们用体系即可。之后再根据需要用trjconv来处理获得包含水的轨迹文件。

nstlog=5000:每多少步输出一次各种能量信息到log文件,默认为1000。

nstenergy:每多少步输出一次能量信息到.edr文件,默认为1000。

(9)constraini-algorithm ;设定约束算法

=LINCS(默认):使用LINCS方法约束,但不能约束键角。

=SHAKE:使用SHAKE方法约束,没LINCS可靠不能用于能量极小化。

之后运行md.mdp

复制代码
 gmx grompp -f md.mdp -c npt.gro -r npt.gro -t npt.cpt -p topol.top -o md.tpr  
    
 gmx mdrun -deffnm md 
    
    
    
    

全部评论 (0)

还没有任何评论哟~