/gmxoutchg_py

Extract atomic charges from formatted .tpr file (For gromacs 2018.8).

Primary LanguagePythonMIT LicenseMIT

gmxoutchg_pygmxoutchg的python版本。其操作方法与gmxoutchg完全一致。目前该软件只对gromacs 2018.8兼容,对其他版本的gromacs兼容性未知。gmxoutchg_py.exe为Windows版可执行文件,gmxoutchg_py.pygmxoutchg_py的python源代码。charge.tcl为使VMD读入电荷信息的TCL脚本。

使用方法

  • Step1: 将gromacs产生的二进制tpr文件转换采用gmx dump -s XX.tpr > dump.txt(XX.tpr为需要转换的tpr文件)转换成dump.txt文件。
  • Step2: 将dump.txt文件放置在gmxoutchg_py.exe同级目录下。启动gmxoutchg_py.exe。随后,就可以看到如下图所示的界面。
    Extract atomic charges from formatted .tpr file (For gromacs 2018.8)
    Version 1.0, release date: 2024-Jun-20
    Programmed by Jian Zhang (jian_zhang@cug.edu.cn)
    
    Loading dump.txt!!!
    Number of molecular type:         5
    Number of atoms in molecular type LI (Number of molecular):         1 (11)
    Number of atoms in molecular type MG (Number of molecular):         1 (11)
    Number of atoms in molecular type CL (Number of molecular):         1 (33)
    Number of atoms in molecular type SOL (Number of molecular):         3 (1703)
    Number of atoms in molecular type COF (Number of molecular):       228 (5)
    Number of molecules:      1763
    charge.txt has been successfully created in this folder
    Press Enter to exit...
    
  • Step3: 键入回车即可关闭该界面,然后在该目录下生成了charge.txt文件。charge.txt文件内容如下。
      1.000000       1           1
      1.000000       2           2
      1.000000       3           3
      1.000000       4           4
      1.000000       5           5
      1.000000       6           6
      1.000000       7           7
      1.000000       8           8
      1.000000       9           9
      1.000000      10          10
      1.000000      11          11
      2.000000      12          12
      2.000000      13          13
      2.000000      14          14
      2.000000      15          15
      ...
    
    文件中的第一列、第二列和第三列分别是原子电荷、分子序号和原子序号。

鸣谢

在开发gmxoutchg_py的过程中,参考了gmxoutchg的Fortran源码。此外,还使用到了dataclasses库中的dataclasscollections库中的OrderedDict以及re库和PyInstaller库。在此对上述库或程序的开发者表示感谢。

TODO list

  • 采用C++进行编写,无需利用gmx dumptpr文件进行转换,程序直接处理tpr文件。

许可证

gmxoutchg_py基于MIT许可证开源。这意味着您可以自由地使用,修改和分发代码。