计算化学公社

标题: 求助:gromacs伞形采样计算PMF可否对不同点设置不同的力? [打印本页]

作者
Author:
SpongeBob    时间: 2020-11-12 15:19
标题: 求助:gromacs伞形采样计算PMF可否对不同点设置不同的力?
在gromacs中用伞形采样计算PMF过程中,一些构型需要设置pull_coord1_k  = 10000 ,比较大。但是如果其他构型也如此设置的话需要采样的构型就会很多,可否对不同构型设置不同的pull_coord1_k 呢?

作者
Author:
雷阵雨    时间: 2025-9-6 14:46
可以,参考如下片段:
pull                           = yes
pull-ngroups                   = 2
pull-group1-name               = refO2
pull-group2-name               = refz
pull-ncoords                   = 1

pull-coord1-type               = umbrella
pull-coord1-geometry           = direction-periodic   ; 关键:z 投影
pull-coord1-dim                = N N Y
pull_coord1-vec                = 0 0 1
pull_coord1_groups             = 2 1
pull-coord1-k                  = KZ               
pull-coord1-rate               = 0.0                  ; 静态窗
pull-coord1-init               = DIST                 ; 本窗中心 (nm)
pull-coord1-start              = no
pull-group1-pbcatom            = 34473                    ; 或者填实际原子编号
pull-group2-pbcatom            = 2811
然后写个脚本,根据窗的位置来调整KZ的大小即可实现不同区域使用不同的k,参考脚本片段:
for W in windows/win_*; do
  DIST=$(cat $W/DIST.txt)
  in_range() {
    awk -v x="$1" -v a="$2" -v b="$3" 'BEGIN{exit (x>a && x<b)?0:1 }'
  }
  
  if   in_range "$DIST" -3.2  0.0 ; then              
    KZ=1200               
  elif in_range "$DIST" -9.7  -6.8 ; then         
    KZ=1000;   LABEL=GAS
  elif in_range "$DIST" -6.6 -3.4 ; then        
    KZ=1200;   LABEL=PLATEAU
  else                                          
    KZ=1500;   LABEL=Interface
  fi
  sed -e "s/DIST/${DIST}/g" -e "s/KZ/${KZ}/g"  us.mdp > $W/us.mdp




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3