gromacs package

Submodules

gromacs.editconf module

Module containing the Editconf class and the command line interface.

class gromacs.editconf.Editconf(input_gro_path: str, output_gro_path: str, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper class for the GROMACS editconf module.

Parameters:
  • input_gro_path (str) – Path to the input GRO file. File type: input. Sample file. Accepted formats: gro.
  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: gro.

  • properties (dic) –
    • distance_to_molecule (float) - (1.0) Distance of the box from the outermost atom in nm. ie 1.0nm = 10 Angstroms.
    • box_type (str) - (“cubic”) Geometrical shape of the solvent box. Available box types: (http://manual.gromacs.org/current/onlinehelp/gmx-editconf.html) -bt option.
    • center_molecule (bool) - (True) Center molecule in the box.
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (str) - (None) Path to the binary executable of your container.
    • container_image (str) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (str) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (str) - (None) Path to the internal CWD in the container.
    • container_user_id (str) - (None) User number id to be mapped inside the container.
    • container_shell_path (str) - (“/bin/bash”) Path to the binary executable of the container shell.
launch() → int[source]

Launches the execution of the GROMACS editconf module.

gromacs.editconf.main()[source]

gromacs.genion module

Module containing the Genion class and the command line interface.

class gromacs.genion.Genion(input_tpr_path: str, output_gro_path: str, input_top_zip_path: str, output_top_zip_path: str, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper class for the GROMACS genion module.

Parameters:
  • input_tpr_path (str) –

    Path to the input portable run input TPR file. File type: input. Sample file. Accepted formats: tpr.

  • output_gro_path (str) –

    Path to the input structure GRO file. File type: output. Sample file. Accepted formats: gro.

  • input_top_zip_path (str) –

    Path the input TOP topology in zip format. File type: input. Sample file. Accepted formats: zip.

  • output_top_zip_path (str) –

    Path the output topology TOP and ITP files zipball. File type: output. Sample file. Accepted formats: zip.

  • properties (dic) –
    • output_top_path (str) - (“gio.top”) Path the output topology TOP file.
    • replaced_group (str) - (“SOL”) Group of molecules that will be replaced by the solvent.
    • neutral (bool) - (False) Neutralize the charge of the system.
    • concentration (float) - (0.05) Concentration of the ions in (mol/liter).
    • seed (int) - (1993) Seed for random number generator.
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (str) - (None) Path to the binary executable of your container.
    • container_image (str) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (str) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (str) - (None) Path to the internal CWD in the container.
    • container_user_id (str) - (None) User number id to be mapped inside the container.
    • container_shell_path (str) - (“/bin/bash”) Path to the binary executable of the container shell.
launch() → int[source]

Launches the execution of the GROMACS genion module.

gromacs.genion.main()[source]

gromacs.genrestr module

Module containing the Genrestr class and the command line interface.

class gromacs.genrestr.Genrestr(input_structure_path: str, input_ndx_path: str, output_itp_path: str, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper class for the GROMACS genrestr module.

Parameters:
  • input_structure_path (str) –

    Path to the input structure PDB, GRO or TPR format. File type: input. Sample file. Accepted formats: pdb, gro, tpr.

  • input_ndx_path (str) –

    Path to the input GROMACS index file, NDX format. File type: input. Sample file. Accepted formats: ndx.

  • output_itp_path (str) –

    Path the output ITP topology file with restrains. File type: output. Sample file. Accepted formats: itp.

  • properties (dic) –
    • restrained_group (str) - (“system”) Index group that will be restrained.
    • force_constants (str) - (“500 500 500”) Array of three floats defining the force constants
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (str) - (None) Path to the binary executable of your container.
    • container_image (str) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (str) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (str) - (None) Path to the internal CWD in the container.
    • container_user_id (str) - (None) User number id to be mapped inside the container.
    • container_shell_path (str) - (“/bin/bash”) Path to the binary executable of the container shell.
launch() → int[source]

Launches the execution of the GROMACS genrestr module.

gromacs.genrestr.main()[source]

gromacs.grompp module

Module containing the Grompp class and the command line interface.

class gromacs.grompp.Grompp(input_gro_path: str, input_top_zip_path: str, output_tpr_path: str, input_cpt_path: str = None, input_ndx_path: str = None, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper of the GROMACS grompp module. The GROMACS preprocessor module needs to be feeded with the input system and the dynamics parameters to create a portable binary run input file TPR. The dynamics parameters are specified in the mdp section of the configuration YAML file. The parameter names and defaults are the same as the ones in the official MDP specification.

Parameters:
  • input_gro_path (str) –

    Path to the input GROMACS structure GRO file. File type: input. Sample file. Accepted formats: gro.

  • input_top_zip_path (str) –

    Path the input GROMACS topology TOP and ITP files in zip format. File type: input. Sample file. Accepted formats: zip.

  • output_tpr_path (str) –

    Path to the output portable binary run file TPR. File type: output. Sample file. Accepted formats: tpr.

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt.
  • input_ndx_path (str) (Optional) – Path to the input GROMACS index files NDX. File type: input. Accepted formats: ndx.
  • properties (dic) –
    • input_mdp_path (str) - (None) Path of the input MDP file.
    • mdp (dict) - (defaults dict) MDP options specification. (Used if input_mdp_path is None)
    • type (str) - (“minimization”) Default options for the mdp file. Valid values: minimization, nvt, npt, free, index
    • output_mdp_path (str) - (“grompp.mdp”) Path of the output MDP file.
    • output_top_path (str) - (“grompp.top”) Path the output topology TOP file.
    • maxwarn (int) - (10) Maximum number of allowed warnings.
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (string) - (None) Path to the binary executable of your container.
    • container_image (string) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (string) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (string) - (None) Path to the internal CWD in the container.
    • container_user_id (string) - (None) User number id to be mapped inside the container.
    • container_shell_path (string) - (“/bin/bash”) Path to the binary executable of the container shell.
create_mdp(path: str = None) → str[source]

Creates an MDP file using the properties file settings

launch() → int[source]

Launches the execution of the GROMACS grompp module.

gromacs.grompp.main()[source]

gromacs.make_ndx module

Module containing the MakeNdx class and the command line interface.

class gromacs.make_ndx.MakeNdx(input_structure_path: str, output_ndx_path: str, input_ndx_path: str = None, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper of the GROMACS make_ndx module.

Parameters:
  • input_structure_path (str) –

    Path to the input GRO/PDB/TPR file. File type: input. Sample file. Accepted formats: gro, pdb, tpr.

  • output_ndx_path (str) –

    Path to the output index NDX file. File type: output. Sample file. Accepted formats: ndx.

  • input_ndx_path (str) (Optional) – Path to the input index NDX file. File type: input. Accepted formats: ndx.
  • properties (dic) –
    • selection (str) - (“a CA C N O”) Heavy atoms. Atom selection string.
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (str) - (None) Path to the binary executable of your container.
    • container_image (str) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (str) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (str) - (None) Path to the internal CWD in the container.
    • container_user_id (str) - (None) User number id to be mapped inside the container.
    • container_shell_path (str) - (“/bin/bash”) Path to the binary executable of the container shell.
launch() → int[source]

Launches the execution of the GROMACS make_ndx module.

gromacs.make_ndx.main()[source]

gromacs.gmxselect module

Module containing the Select class and the command line interface.

class gromacs.gmxselect.Gmxselect(input_structure_path: str, output_ndx_path: str, input_ndx_path: str = None, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper of the GROMACS select module.

Parameters:
  • input_structure_path (str) –

    Path to the input GRO/PDB/TPR file. File type: input. Sample file. Accepted formats: gro, pdb, tpr.

  • output_ndx_path (str) –

    Path to the output index NDX file. File type: output. Sample file. Accepted formats: ndx.

  • input_ndx_path (str) (Optional) – Path to the input index NDX file. File type: input. Accepted formats: ndx.
  • properties (dic) –
    • selection (str) - (“a CA C N O”) Heavy atoms. Atom selection string.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (str) - (None) Path to the binary executable of your container.
    • container_image (str) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (str) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (str) - (None) Path to the internal CWD in the container.
    • container_user_id (str) - (None) User number id to be mapped inside the container.
    • container_shell_path (str) - (“/bin/bash”) Path to the binary executable of the container shell.
launch() → int[source]

Launches the execution of the GROMACS select module.

gromacs.gmxselect.main()[source]

gromacs.mdrun module

Module containing the MDrun class and the command line interface.

class gromacs.mdrun.Mdrun(input_tpr_path: str, output_trr_path: str, output_gro_path: str, output_edr_path: str, output_log_path: str, output_xtc_path: str = None, output_cpt_path: str = None, output_dhdl_path: str = None, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper of the GROMACS mdrun module.

Parameters:
  • input_tpr_path (str) –

    Path to the portable binary run input file TPR. File type: input. Sample file. Accepted formats: tpr.

  • output_trr_path (str) –

    Path to the GROMACS uncompressed raw trajectory file TRR. File type: output. Sample file. Accepted formats: trr.

  • output_gro_path (str) –

    Path to the output GROMACS structure GRO file. File type: output. Sample file. Accepted formats: gro.

  • output_edr_path (str) –

    Path to the output GROMACS portable energy file EDR. File type: output. Sample file. Accepted formats: edr.

  • output_log_path (str) – Path to the output GROMACS trajectory log file LOG. File type: output. Accepted formats: log.
  • output_xtc_path (str) (Optional) – Path to the GROMACS compressed trajectory file XTC. File type: output. Accepted formats: xtc.
  • output_cpt_path (str) (Optional) – Path to the output GROMACS checkpoint file CPT. File type: output. Accepted formats: cpt.
  • output_dhdl_path (str) (Optional) – Path to the output dhdl.xvg file only used when free energy calculation is turned on. File type: output. Accepted formats: xvg.
  • properties (dic) –
    • num_threads (int) - (0) Let GROMACS guess. The number of threads that are going to be used.
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • mpi_bin (str) - (None) Path to the MPI runner. Usually “mpirun” or “srun”.
    • mpi_np (str) - (None) Number of MPI processes. Usually an integer bigger than 1.
    • mpi_hostlist (str) - (None) Path to the MPI hostlist file.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (str) - (None) Path to the binary executable of your container.
    • container_image (str) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (str) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (str) - (None) Path to the internal CWD in the container.
    • container_user_id (str) - (None) User number id to be mapped inside the container.
    • container_shell_path (str) - (“/bin/bash”) Path to the binary executable of the container shell.
launch() → int[source]

Launches the execution of the GROMACS mdrun module.

gromacs.mdrun.main()[source]

gromacs.pdb2gmx module

Module containing the Pdb2gmx class and the command line interface.

class gromacs.pdb2gmx.Pdb2gmx(input_pdb_path: str, output_gro_path: str, output_top_zip_path: str, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper class for the GROMACS pdb2gmx module.

Parameters:
  • input_pdb_path (str) –

    Path to the input PDB file. File type: input. Sample file. Accepted formats: pdb.

  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: gro.

  • output_top_zip_path (str) –

    Path the output TOP topology in zip format. File type: output. Sample file. Accepted formats: zip.

  • properties (dic) –
    • output_top_path (str) - (“p2g.top”) Path of the output TOP file.
    • output_itp_path (str) - (“p2g.itp”) Path of the output itp file.
    • water_type (str) - (“spce”) Water molecule type. Valid values: spc, spce, tip3p, tip4p, tip5p, tips3p.
    • force_field (str) - (“amber99sb-ildn”) Force field to be used during the conversion. Valid values: gromos45a3, charmm27, gromos53a6, amber96, amber99, gromos43a2, gromos54a7, gromos43a1, amberGS, gromos53a5, amber99sb, amber03, amber99sb-ildn, oplsaa, amber94.
    • ignh (bool) - (False) Should pdb2gmx ignore the hidrogens in the original structure.
    • his (str) - (None) Histidine protonation array.
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (str) - (None) Path to the binary executable of your container.
    • container_image (str) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (str) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (str) - (None) Path to the internal CWD in the container.
    • container_user_id (str) - (None) User number id to be mapped inside the container.
    • container_shell_path (str) - (“/bin/bash”) Path to the binary executable of the container shell.
launch() → int[source]

Launches the execution of the GROMACS pdb2gmx module.

gromacs.pdb2gmx.main()[source]

gromacs.solvate module

Module containing the Editconf class and the command line interface.

class gromacs.solvate.Solvate(input_solute_gro_path: str, output_gro_path: str, input_top_zip_path: str, output_top_zip_path: str, properties: dict = None, **kwargs)[source]

Bases: object

Wrapper of the GROMACS solvate module.

Parameters:
  • input_solute_gro_path (str) –

    Path to the input GRO file. File type: input. Sample file. Accepted formats: gro.

  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: gro.

  • input_top_zip_path (str) –

    Path the input TOP topology in zip format. File type: input. Sample file. Accepted formats: zip.

  • output_top_zip_path (str) –

    Path the output topology in zip format. File type: output. Sample file. Accepted formats: zip.

  • properties (dic) –
    • input_solvent_gro_path (str) - (“spc216.gro”) Path to the GRO file contanining the structure of the solvent.
    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.
    • gmx_path (str) - (“gmx”) Path to the GROMACS executable binary.
    • remove_tmp (bool) - (True) [WF property] Remove temporal files.
    • restart (bool) - (False) [WF property] Do not execute if output files exist.
    • container_path (str) - (None) Path to the binary executable of your container.
    • container_image (str) - (“gromacs/gromacs:latest”) Container Image identifier.
    • container_volume_path (str) - (“/data”) Path to an internal directory in the container.
    • container_working_dir (str) - (None) Path to the internal CWD in the container.
    • container_user_id (str) - (None) User number id to be mapped inside the container.
    • container_shell_path (str) - (“/bin/bash”) Path to the binary executable of the container shell.
launch() → int[source]

Launches the execution of the GROMACS solvate module.

gromacs.solvate.main()[source]