Gromacs减少生成文件大小的方法

Gromacs MD只生成xtc文件

Gromacs 最后一步生成的有trr,cpt,xtc文件。这些文件的生成是由成品模拟最后一步的mdp文件控制的。其中trr文件比较大,在做分子模拟过程中,自己的硬盘为4T,但是生成的trr文件快到8T,无法储存。试想过,通过Gromacs的断点运行功能运行一段时间后,导出xtc,或者生成RMSD,然后将trr文件删除,通过cpt文件接着运行。将这些生成的xtc或者RMSD合并起来就可以得到完整的模拟过程,但这个过程会丢失trr文件。
上面的做法比较麻烦,我们可以在最后一步模拟过程中直接不生成trr文件,生成xtc文件,与trr文件相比xtc没有原子的速度和力的信息,文件会大大缩小,不影响后面生成RMSD RMSF等。

; OUTPUT CONTROL OPTIONS
; Output frequency for coords (x), velocities (v) and forces (f)
nstxout                  = 0
nstvout                  = 5000
nstfout                  = 5000
; Output frequency for energies to log file and energy file
nstlog                   = 1000
nstcalcenergy            = 100
nstenergy                = 5000
; Output frequency and precision for .xtc file
nstxout-compressed       = 5000
compressed-x-precision   = 1000
; This selects the subset of atoms for the compressed
; trajectory file. You can select multiple groups. By
; default, all atoms will be written.
compressed-x-grps        = 
; Selection of energy groups
energygrps               = 
`以下内容参考https://blog.csdn.net/CocoCream/article/details/126116755
`
###########################这五项是需要写入trr文件中的#######################
nstvout (0) [steps]: 将速度写入输出轨迹文件(trr)的间隔步数,其余同上。

nstfout (0) [steps]: 将力写入输出轨迹文件(trr)的间隔步数,其余同上。

nstlog (100) [steps]: 将能量写入日志文件的间隔步数,始终写入最后的能量。

nstcalcenergy (100): 计算能量的间隔步数,0代表不计算。此选项仅与动力学相关。此选项会影响并行模拟的性能,因为计算能量需要所有进程之间的全局通信,这可能成为高并行化的瓶颈。

nstenergy (1000) [steps]: 将能量写入能量文件的间隔步数,始终写入的最后一个能量。该值应为 nstcalcenergy 的倍数。请注意,每一步 MD step 的精确和(sums)以及波动(fluctuations)模 nstcalcenergy 的值都存储在能量文件中,因此当 nstenergy>1 时,gmx energy 也可以报告精确的能量平均值和波动。


##################xtc文件输出控制参数#######################################
nstxout-compressed (0) [steps]: 使用有损压缩(xtc)写入位置坐标的间隔步数步数,0表示不写入压缩坐标输出。

compressed-x-precision (1000) [real]: 写入压缩轨迹文件(xtc)的精度。

compressed-x-grps 写入压缩轨迹文件的索引组,默认情况下写入整个系统(如果 nstxout compressed>0)。


#################如果需要GPU加速此项需要删除############################
energygrps 将该组的短程非键合势能写入能量文件(不支持GPU)(5.0.4版本说明中该条为:写入能量文件的索引组)


我们可以通过改写以上的控制参数从而使得trr文件不生成只生成xtc文件。
; OUTPUT CONTROL OPTIONS
#删除
; Output frequency for coords (x), velocities (v) and forces (f)
nstxout                  = 0
nstvout                  = 5000
nstfout                  = 5000
#删除

#保留
; Output frequency for energies to log file and energy file
nstlog                   = 1000
nstcalcenergy            = 100
nstenergy                = 5000
; Output frequency and precision for .xtc file
nstxout-compressed       = 5000
compressed-x-precision   = 1000
#保留


这样就可以只生成xtc文件以及log文件了

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值