计算化学公社

标题: 求助:使用命令行运行Sobtop产生top文件的小BUG [打印本页]

作者
Author:
wangyueda    时间: 2022-7-11 22:30
标题: 求助:使用命令行运行Sobtop产生top文件的小BUG
本帖最后由 wangyueda 于 2022-7-11 22:35 编辑

请问下卢老师,我在Linux下使用Sobtop生成top文件时将相关命令写成Shell脚本,结果运行发现gro,itp文件产生正常,但是top文件没有产生,进一步检查发现
原本文件夹下的用于给Sobtop提供Hessian矩阵的fchk文件的内容被替换成了top文件,这种情况该咋解决?以下是我相关文件

用于运行Sobtop的Shell脚本:
  1. #!/bin/bash
  2. echo -e "EC-opt.mol2
  3. \n7
  4. \n10
  5. \nEC-RESP2-0.5.chg
  6. \n0
  7. \n2
  8. \n
  9. \n-1
  10. \n4
  11. \n1
  12. \n2
  13. \n2
  14. \nEC-opt.fchk
  15. \n
  16. \n
  17. \n0" | ./sobtop |tee EC-top.txt
  18. #EC-opt.mol2;input mol2 file
  19. #\n7;7 Assign atomic charges
  20. #\n10;10 Load atomic charges from .chg file of Multiwfn
  21. #\nEC-RESP2-0.5.chg;.chg file path
  22. #\n0;0 Return
  23. #\n2;2 Generate GROMACS .gro file
  24. #\n;generate at current path
  25. #\n-1;-1 Select method for deriving rigid parameters: mSeminario
  26. #\n4;DRIH method
  27. #\n1;1 Generate GROMACS topology file
  28. #\n2;2 Assign GAFF atom types first and then UFF, then go to next step
  29. #\n2;2 All bonded parameters are determined by DRIH method
  30. #\nEC-opt.fchk;.fchk file path
  31. #\n;generate top file in current path
  32. #\n;generate itp file in current path
  33. #\n0";exit program
复制代码

被替换后的fchk文件内容

作者
Author:
sobereva    时间: 2022-7-14 10:31
弄成一行写
echo -e "EC-opt.mol2\n7\n10\nEC-RESP2-0.5.chg\n0\n2\n\n-1\n4\n1\n2\n2\nEC-opt.fchk\n\n\n0" | ./sobtop |tee EC-top.txt
作者
Author:
wangyueda    时间: 2022-7-14 14:46
sobereva 发表于 2022-7-14 10:31
弄成一行写
echo -e "EC-opt.mol2\n7\n10\nEC-RESP2-0.5.chg\n0\n2\n\n-1\n4\n1\n2\n2\nEC-opt.fchk\n\n\n ...

好的老师 问下按我写的这个Shell脚本为啥会将fchk文件替换为top文件?
作者
Author:
sobereva    时间: 2022-7-14 15:53
wangyueda 发表于 2022-7-14 14:46
好的老师 问下按我写的这个Shell脚本为啥会将fchk文件替换为top文件?

应该是对换行符的识别问题,导致让输入top文件路径那一步输入的是fchk文件路径。
\n作为按回车,也不适合写在命令前头






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