9 个稳定版本

1.4.0 2024 年 6 月 23 日
1.3.0 2024 年 3 月 2 日
1.2.0 2024 年 1 月 13 日
1.1.0 2023 年 10 月 14 日
1.0.3 2023 年 9 月 25 日

#72 in 科学

42 每月下载次数

MIT 许可证

78KB
1.5K SLoC

gcenter: 在 Gromacs 轨迹中居中任何组

使用 Bai & Breen 算法轻松在 Gromacs 轨迹或结构文件中居中您选择的组。

gcenter 可以准确地居中原子组,即使它们跨越多个可能超出盒子边界的分子。 gcenter 仅支持正交模拟盒子。

gcenter 支持 gro、pdb 和 tpr 结构文件以及 xtc 和 trr 轨迹,并且它可以自动检测蛋白质残基。使用类似 VMD 的 groan 选择语言来选择要居中的原子组。

安装

  1. 安装 rust
  2. 运行 cargo install gcenter

示例用法

gcenter -c system.gro -f trajectory.xtc -o output_trajectory.xtc

选项

Usage: gcenter [OPTIONS] --structure <STRUCTURE> --output <OUTPUT>

Options:
  -c, --structure <STRUCTURE>
          Path to a gro, pdb, or tpr file containing the system structure. If a trajectory is also provided, the coordinates from the structure file are ignored.

  -f, --trajectory [<TRAJECTORIES>...]
          Path to xtc or trr file(s) containing the trajectory or trajectories to be manipulated. 
          If not provided, the centering operation will use the structure file itself.
          Multiple files separated by whitespace can be provided. These will be concatenated into one output file.
          All trajectory files must be of the same type (i.e., all must be either xtc or trr files).
          When joining trajectories, the last frame of each trajectory and the first frame of the following trajectory are checked for matching simulation steps. 
          If the simulation steps coincide, only the first of these frames is centered and written to output.

  -n, --index <INDEX>
          Path to an ndx file containing groups associated with the system.
          
          [default: index.ndx]

  -o, --output <OUTPUT>
          Name of the output file, which can be in gro, pdb (if no trajectory is provided), xtc, or trr format.

  -r, --reference <REFERENCE>
          Specify the group to be centered. Define the group using the VMD-like 'groan selection language', which also supports ndx group names.
          
          [default: Protein]

  -b, --begin <START_TIME>
          Time of the first frame to read from the trajectory (in ps). All previous frames will be skipped. This option is only applicable when trajectory file(s) is/are provided.
          
          [default: 0.0]

  -e, --end <END_TIME>
          Time of the last frame to read from the trajectory (in ps). All following frames will be skipped. This option is only applicable when trajectory file(s) is/are provided.
          
          [default: NaN]

  -s, --step <STEP>
          Center and write only every <STEP>th frame of the trajectory to the output file. This option is only applicable when trajectory file(s) is/are provided.
          
          [default: 1]

  -x
          Perform centering operation in the x-dimension. This can be combined with other dimensions. If no dimensions are selected, it defaults to '-xyz'.

  -y
          Perform centering operation in the y-dimension. This can be combined with other dimensions. If no dimensions are selected, it defaults to '-xyz'.

  -z
          Perform centering operation in the z-dimension. This can be combined with other dimensions. If no dimensions are selected, it defaults to '-xyz'.

      --xref <XREFERENCE>
          Center the specified selection of atoms along the x dimension. 
          This option, in conjunction with `yref` and `zref`, allows you to center multiple groups, each along a different dimension. 
          Define the group using the VMD-like 'groan selection language', which also supports ndx group names. 
          This selection acts as the reference selection for the x dimension, while the `reference` selection will still be centered in other specified dimensions.

      --yref <YREFERENCE>
          Center the specified selection of atoms along the y dimension. 
          This option, in conjunction with `xref` and `zref`, allows you to center multiple groups, each along a different dimension. 
          Define the group using the VMD-like 'groan selection language', which also supports ndx group names. 
          This selection acts as the reference selection for the y dimension, while the `reference` selection will still be centered in other specified dimensions.

      --zref <ZREFERENCE>
          Center the specified selection of atoms along the z dimension. 
          This option, in conjunction with `xref` and `yref`, allows you to center multiple groups, each along a different dimension. 
          Define the group using the VMD-like 'groan selection language', which also supports ndx group names. 
          This selection acts as the reference selection for the z dimension, while the `reference` selection will still be centered in other specified dimensions.

      --com
          Use center of mass instead of center of geometry when centering the reference group. This requires information about atom masses. 
          If they are not explicitly provided using a tpr file, the masses are guessed.

      --whole
          Do not wrap all atoms into the simulation box but keep molecules whole. This requires providing a tpr file as an input structure file.

      --silent
          Suppress all standard output generated by the 'gcenter' tool, except for error messages written to stderr.

      --overwrite
          Enable this option to overwrite existing files with the same name as the output file. No backup copies will be created.

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

限制

仅在 Linux 上测试,但应在任何现代操作系统上工作。

仅支持正交模拟盒子!

依赖关系

~13–25MB
~345K SLoC