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 = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs Editconf
Wrapper class for the GROMACS editconf module.
The GROMACS editconf converts generic structure format to .gro, .g96 or .pdb.
Parameters:
  • input_gro_path (str) – Path to the input GRO file. File type: input. Sample file. Accepted formats: gro (edam:format_2033), pdb (edam:format_1476).

  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: pdb (edam:format_1476), gro (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • distance_to_molecule (float) - (1.0) [0~100|0.1] Distance of the box from the outermost atom in nm. ie 1.0nm = 10 Angstroms.

    • box_vector_lenghts (str) - (None) Array of floats defining the box vector lenghts ie “0.5 0.5 0.5”. If this option is used the distance_to_molecule property will be ignored.

    • box_type (str) - (“cubic”) Geometrical shape of the solvent box. Values: cubic (rectangular box with all sides equal), triclinic (triclinic box), dodecahedron (rhombic dodecahedron), octahedron (truncated octahedron).

    • center_molecule (bool) - (True) Center molecule in the box.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • container_path (str) - (None) Path to the binary executable of your container.

    • container_image (str) - (None) 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.editconf import editconf
prop = { 'distance_to_molecule': 1.0,
         'box_type': 'cubic'}
editconf(input_gro_path='/path/to/structure.gro',
         output_gro_path='/path/to/newStructure.gro',
         properties=prop)
Info:
launch() int[source]

Execute the Editconf object.

gromacs.editconf.editconf(input_gro_path: str, output_gro_path: str, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Editconf
Wrapper class for the GROMACS editconf module.
The GROMACS editconf converts generic structure format to .gro, .g96 or .pdb.
Parameters:
  • input_gro_path (str) –

    Path to the input GRO file. File type: input. Sample file. Accepted formats: gro (edam:format_2033), pdb (edam:format_1476).

  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: pdb (edam:format_1476), gro (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • distance_to_molecule (float) - (1.0) [0~100|0.1] Distance of the box from the outermost atom in nm. ie 1.0nm = 10 Angstroms.

    • box_vector_lenghts (str) - (None) Array of floats defining the box vector lenghts ie “0.5 0.5 0.5”. If this option is used the distance_to_molecule property will be ignored.

    • box_type (str) - (“cubic”) Geometrical shape of the solvent box. Values: cubic (rectangular box with all sides equal), triclinic (triclinic box), dodecahedron (rhombic dodecahedron), octahedron (truncated octahedron).

    • center_molecule (bool) - (True) Center molecule in the box.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • container_path (str) - (None) Path to the binary executable of your container.

    • container_image (str) - (None) 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.editconf import editconf
prop = { 'distance_to_molecule': 1.0,
         'box_type': 'cubic'}
editconf(input_gro_path='/path/to/structure.gro',
         output_gro_path='/path/to/newStructure.gro',
         properties=prop)
Info:

gromacs.genion module

Module containing the Genion class and the command line interface.

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

Bases: BiobbObject

biobb_gromacs Genion
Wrapper class for the GROMACS genion module.
The GROMACS genion module randomly replaces solvent molecules with monoatomic ions. The group of solvent molecules should be continuous and all molecules should have the same number of atoms.
Parameters:
  • input_tpr_path (str) –

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

  • output_gro_path (str) –

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

  • input_top_zip_path (str) –

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

  • output_top_zip_path (str) –

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

  • input_ndx_path (str) (Optional) – Path to the input index NDX file. File type: input. Accepted formats: ndx (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • 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.0) [0~10|0.01] 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.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.genion import genion
prop = { 'concentration': 0.05,
         'replaced_group': 'SOL'}
genion(input_tpr_path='/path/to/myPortableBinaryRunInputFile.tpr',
       output_gro_path='/path/to/newStructure.gro',
       input_top_zip_path='/path/to/myTopology.zip',
       output_top_zip_path='/path/to/newTopology.zip',
       properties=prop)
Info:
launch() int[source]

Execute the Genion object.

gromacs.genion.genion(input_tpr_path: str | Path, output_gro_path: str | Path, input_top_zip_path: str | Path, output_top_zip_path: str | Path, input_ndx_path: str | Path | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Genion
Wrapper class for the GROMACS genion module.
The GROMACS genion module randomly replaces solvent molecules with monoatomic ions. The group of solvent molecules should be continuous and all molecules should have the same number of atoms.
Parameters:
  • input_tpr_path (str) –

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

  • output_gro_path (str) –

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

  • input_top_zip_path (str) –

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

  • output_top_zip_path (str) –

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

  • input_ndx_path (str) (Optional) – Path to the input index NDX file. File type: input. Accepted formats: ndx (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • 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.0) [0~10|0.01] 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.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.genion import genion
prop = { 'concentration': 0.05,
         'replaced_group': 'SOL'}
genion(input_tpr_path='/path/to/myPortableBinaryRunInputFile.tpr',
       output_gro_path='/path/to/newStructure.gro',
       input_top_zip_path='/path/to/myTopology.zip',
       output_top_zip_path='/path/to/newTopology.zip',
       properties=prop)
Info:

gromacs.genrestr module

Module containing the Genrestr class and the command line interface.

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

Bases: BiobbObject

biobb_gromacs Genrestr
Wrapper of the GROMACS genrestr module.
The GROMACS genrestr module, produces an #include file for a topology containing a list of atom numbers and three force constants for the x-, y-, and z-direction based on the contents of the -f file. A single isotropic force constant may be given on the command line instead of three components.
Parameters:
  • input_structure_path (str) –

    Path to the input structure PDB, GRO or TPR format. File type: input. Sample file. Accepted formats: pdb (edam:format_1476), gro (edam:format_2033), tpr (edam:format_2333).

  • output_itp_path (str) –

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

  • input_ndx_path (str) (Optional) –

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

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • 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.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.genrestr import genrestr
prop = { 'restrained_group': 'system',
         'force_constants': '500 500 500' }
genrestr(input_structure_path='/path/to/myStructure.gro',
         output_itp_path='/path/to/newTopologyAddOn.itp',
         properties=prop)
Info:
launch() int[source]

Execute the Grompp object.

gromacs.genrestr.genrestr(input_structure_path: str | Path, output_itp_path: str | Path, input_ndx_path: str | Path | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Genrestr
Wrapper of the GROMACS genrestr module.
The GROMACS genrestr module, produces an #include file for a topology containing a list of atom numbers and three force constants for the x-, y-, and z-direction based on the contents of the -f file. A single isotropic force constant may be given on the command line instead of three components.
Parameters:
  • input_structure_path (str) –

    Path to the input structure PDB, GRO or TPR format. File type: input. Sample file. Accepted formats: pdb (edam:format_1476), gro (edam:format_2033), tpr (edam:format_2333).

  • output_itp_path (str) –

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

  • input_ndx_path (str) (Optional) –

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

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • 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.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.genrestr import genrestr
prop = { 'restrained_group': 'system',
         'force_constants': '500 500 500' }
genrestr(input_structure_path='/path/to/myStructure.gro',
         output_itp_path='/path/to/newTopologyAddOn.itp',
         properties=prop)
Info:

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 = None, input_ndx_path: str | None = None, input_mdp_path: str | None = None, properties: dict | None = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs Grompp
Wrapper of the GROMACS grompp module.
The GROMACS preprocessor module needs to be fed with the input system and the dynamics parameters to create a portable binary run input file TPR. The simulation parameters can be specified by two methods: 1.The predefined mdp settings defined at simulation_type property or 2.A custom mdp file defined at the input_mdp_path argument. These two methods are mutually exclusive. In both cases can be further modified by adding parameters to the mdp section in the yaml configuration file. The simulation parameter names and default values can be consulted 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 (edam:format_2033).

  • input_top_zip_path (str) –

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

  • output_tpr_path (str) –

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

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt (edam:format_2333).

  • input_ndx_path (str) (Optional) – Path to the input GROMACS index files NDX. File type: input. Accepted formats: ndx (edam:format_2033).

  • input_mdp_path (str) (Optional) – Path to the input GROMACS MDP file. File type: input. Accepted formats: mdp (edam:format_2330).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • mdp (dict) - ({}) MDP options specification.

    • simulation_type (str) - (None) Default options for the mdp file. Each one creates a different mdp file. Values: minimization (Energy minimization using steepest descent algorithm is used), nvt (substance N Volume V and Temperature T are conserved), npt (substance N pressure P and Temperature T are conserved), free (No design constraints applied; Free MD), ions (Synonym of minimization), index (Creates an empty mdp file).

    • maxwarn (int) - (0) [0~1000|1] Maximum number of allowed warnings. If simulation_type is index default is 10.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.grompp import grompp

prop = { 'simulation_type': 'minimization',
         'mdp':
            { 'emtol':'500',
              'nsteps':'5000'}}
grompp(input_gro_path='/path/to/myStructure.gro',
       input_top_zip_path='/path/to/myTopology.zip',
       output_tpr_path='/path/to/newCompiledBin.tpr',
       properties=prop)
Info:
launch() int[source]

Execute the Grompp object.

gromacs.grompp.grompp(input_gro_path: str, input_top_zip_path: str, output_tpr_path: str, input_cpt_path: str | None = None, input_ndx_path: str | None = None, input_mdp_path: str | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Grompp
Wrapper of the GROMACS grompp module.
The GROMACS preprocessor module needs to be fed with the input system and the dynamics parameters to create a portable binary run input file TPR. The simulation parameters can be specified by two methods: 1.The predefined mdp settings defined at simulation_type property or 2.A custom mdp file defined at the input_mdp_path argument. These two methods are mutually exclusive. In both cases can be further modified by adding parameters to the mdp section in the yaml configuration file. The simulation parameter names and default values can be consulted 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 (edam:format_2033).

  • input_top_zip_path (str) –

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

  • output_tpr_path (str) –

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

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt (edam:format_2333).

  • input_ndx_path (str) (Optional) – Path to the input GROMACS index files NDX. File type: input. Accepted formats: ndx (edam:format_2033).

  • input_mdp_path (str) (Optional) –

    Path to the input GROMACS MDP file. File type: input. Accepted formats: mdp (edam:format_2330).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • mdp (dict) - ({}) MDP options specification.

    • simulation_type (str) - (None) Default options for the mdp file. Each one creates a different mdp file. Values: minimization (Energy minimization using steepest descent algorithm is used), nvt (substance N Volume V and Temperature T are conserved), npt (substance N pressure P and Temperature T are conserved), free (No design constraints applied; Free MD), ions (Synonym of minimization), index (Creates an empty mdp file).

    • maxwarn (int) - (0) [0~1000|1] Maximum number of allowed warnings. If simulation_type is index default is 10.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.grompp import grompp

prop = { 'simulation_type': 'minimization',
         'mdp':
            { 'emtol':'500',
              'nsteps':'5000'}}
grompp(input_gro_path='/path/to/myStructure.gro',
       input_top_zip_path='/path/to/myTopology.zip',
       output_tpr_path='/path/to/newCompiledBin.tpr',
       properties=prop)
Info:

gromacs.grompp_mdrun module

Module containing the GromppMDrun class and the command line interface.

class gromacs.grompp_mdrun.GromppMdrun(input_gro_path: str, input_top_zip_path: str, output_trr_path: str, output_gro_path: str, output_edr_path: str, output_log_path: str, input_cpt_path: str | None = None, input_ndx_path: str | None = None, input_mdp_path: str | None = None, output_xtc_path: str | None = None, output_cpt_path: str | None = None, output_dhdl_path: str | None = None, output_tpr_path: str | None = None, properties: dict | None = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs GromppMdrun
Wrapper of the GROMACS grompp module and the GROMACS mdrun module.
Grompp The GROMACS preprocessor module needs to be fed with the input system and the dynamics parameters to create a portable binary run input file TPR. The simulation parameters can be specified by two methods: 1.The predefined mdp settings defined at simulation_type property or 2.A custom mdp file defined at the input_mdp_path argument. These two methods are mutually exclusive. In both cases can be further modified by adding parameters to the mdp section in the yaml configuration file. The simulation parameter names and default values can be consulted in the official MDP specification. MDRun is the main computational chemistry engine within GROMACS. It performs Molecular Dynamics simulations, but it can also perform Stochastic Dynamics, Energy Minimization, test particle insertion or (re)calculation of energies.
Parameters:
  • input_gro_path (str) –

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

  • input_top_zip_path (str) –

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

  • output_trr_path (str) –

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

  • output_gro_path (str) –

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

  • output_edr_path (str) –

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

  • output_log_path (str) –

    Path to the output GROMACS trajectory log file LOG. File type: output. Sample file. Accepted formats: log (edam:format_2330).

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt (edam:format_2333).

  • input_ndx_path (str) (Optional) – Path to the input GROMACS index files NDX. File type: input. Accepted formats: ndx (edam:format_2033).

  • input_mdp_path (str) (Optional) –

    Path to the input GROMACS MDP file. File type: input. Accepted formats: mdp (edam:format_2330).

  • output_xtc_path (str) (Optional) – Path to the GROMACS compressed trajectory file XTC. File type: output. Accepted formats: xtc (edam:format_3875).

  • output_cpt_path (str) (Optional) – Path to the output GROMACS checkpoint file CPT. File type: output. Accepted formats: cpt (edam:format_2333).

  • 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 (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • mdp (dict) - ({}) MDP options specification.

    • simulation_type (str) - (“minimization”) Default options for the mdp file. Each creates a different mdp file. Values: minimization (Energy minimization using steepest descent algorithm is used), nvt (substance N Volume V and Temperature T are conserved), npt (substance N pressure P and Temperature T are conserved), free (No design constraints applied; Free MD), ions (Synonym of minimization), index (Creates an empty mdp file).

    • maxwarn (int) - (10) [0~1000|1] Maximum number of allowed warnings.

    • 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.

    • checkpoint_time (int) - (15) [0~1000|1] Checkpoint writing interval in minutes. Only enabled if an output_cpt_path is provided.

    • num_threads (int) - (0) [0-1000|1] Let GROMACS guess. The number of threads that are going to be used.

    • num_threads_mpi (int) - (0) [0-1000|1] Let GROMACS guess. The number of GROMACS MPI threads that are going to be used.

    • num_threads_omp (int) - (0) [0-1000|1] Let GROMACS guess. The number of GROMACS OPENMP threads that are going to be used.

    • num_threads_omp_pme (int) - (0) [0-1000|1] Let GROMACS guess. The number of GROMACS OPENMP_PME threads that are going to be used.

    • use_gpu (bool) - (False) Use settings appropriate for GPU. Adds: -nb gpu -pme gpu

    • gpu_id (str) - (None) list of unique GPU device IDs available to use.

    • gpu_tasks (str) - (None) list of GPU device IDs, mapping each PP task on each node to a device.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.grompp_mdrun import grompp_mdrun
prop = { 'num_threads': 0,
         'binary_path': 'gmx',
          'mdp':
            { 'simulation_type': 'minimization',
              'emtol':'500',
              'nsteps':'5000'}
        }
grompp_mdrun(input_gro_path='/path/to/myStructure.gro',
             input_top_zip_path='/path/to/myTopology.zip',
             output_trr_path='/path/to/newTrajectory.trr',
             output_gro_path='/path/to/newStructure.gro',
             output_edr_path='/path/to/newEnergy.edr',
             output_log_path='/path/to/newSimulationLog.log',
             properties=prop)
Info:
launch() int[source]

Execute the GromppMdrun object.

gromacs.grompp_mdrun.grompp_mdrun(input_gro_path: str, input_top_zip_path: str, output_trr_path: str, output_gro_path: str, output_edr_path: str, output_log_path: str, input_cpt_path: str | None = None, input_ndx_path: str | None = None, input_mdp_path: str | None = None, output_xtc_path: str | None = None, output_cpt_path: str | None = None, output_dhdl_path: str | None = None, output_tpr_path: str | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs GromppMdrun
Wrapper of the GROMACS grompp module and the GROMACS mdrun module.
Grompp The GROMACS preprocessor module needs to be fed with the input system and the dynamics parameters to create a portable binary run input file TPR. The simulation parameters can be specified by two methods: 1.The predefined mdp settings defined at simulation_type property or 2.A custom mdp file defined at the input_mdp_path argument. These two methods are mutually exclusive. In both cases can be further modified by adding parameters to the mdp section in the yaml configuration file. The simulation parameter names and default values can be consulted in the official MDP specification. MDRun is the main computational chemistry engine within GROMACS. It performs Molecular Dynamics simulations, but it can also perform Stochastic Dynamics, Energy Minimization, test particle insertion or (re)calculation of energies.
Parameters:
  • input_gro_path (str) –

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

  • input_top_zip_path (str) –

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

  • output_trr_path (str) –

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

  • output_gro_path (str) –

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

  • output_edr_path (str) –

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

  • output_log_path (str) –

    Path to the output GROMACS trajectory log file LOG. File type: output. Sample file. Accepted formats: log (edam:format_2330).

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt (edam:format_2333).

  • input_ndx_path (str) (Optional) – Path to the input GROMACS index files NDX. File type: input. Accepted formats: ndx (edam:format_2033).

  • input_mdp_path (str) (Optional) –

    Path to the input GROMACS MDP file. File type: input. Accepted formats: mdp (edam:format_2330).

  • output_xtc_path (str) (Optional) – Path to the GROMACS compressed trajectory file XTC. File type: output. Accepted formats: xtc (edam:format_3875).

  • output_cpt_path (str) (Optional) – Path to the output GROMACS checkpoint file CPT. File type: output. Accepted formats: cpt (edam:format_2333).

  • 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 (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • mdp (dict) - ({}) MDP options specification.

    • simulation_type (str) - (“minimization”) Default options for the mdp file. Each creates a different mdp file. Values: minimization (Energy minimization using steepest descent algorithm is used), nvt (substance N Volume V and Temperature T are conserved), npt (substance N pressure P and Temperature T are conserved), free (No design constraints applied; Free MD), ions (Synonym of minimization), index (Creates an empty mdp file).

    • maxwarn (int) - (10) [0~1000|1] Maximum number of allowed warnings.

    • 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.

    • checkpoint_time (int) - (15) [0~1000|1] Checkpoint writing interval in minutes. Only enabled if an output_cpt_path is provided.

    • num_threads (int) - (0) [0-1000|1] Let GROMACS guess. The number of threads that are going to be used.

    • num_threads_mpi (int) - (0) [0-1000|1] Let GROMACS guess. The number of GROMACS MPI threads that are going to be used.

    • num_threads_omp (int) - (0) [0-1000|1] Let GROMACS guess. The number of GROMACS OPENMP threads that are going to be used.

    • num_threads_omp_pme (int) - (0) [0-1000|1] Let GROMACS guess. The number of GROMACS OPENMP_PME threads that are going to be used.

    • use_gpu (bool) - (False) Use settings appropriate for GPU. Adds: -nb gpu -pme gpu

    • gpu_id (str) - (None) list of unique GPU device IDs available to use.

    • gpu_tasks (str) - (None) list of GPU device IDs, mapping each PP task on each node to a device.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.grompp_mdrun import grompp_mdrun
prop = { 'num_threads': 0,
         'binary_path': 'gmx',
          'mdp':
            { 'simulation_type': 'minimization',
              'emtol':'500',
              'nsteps':'5000'}
        }
grompp_mdrun(input_gro_path='/path/to/myStructure.gro',
             input_top_zip_path='/path/to/myTopology.zip',
             output_trr_path='/path/to/newTrajectory.trr',
             output_gro_path='/path/to/newStructure.gro',
             output_edr_path='/path/to/newEnergy.edr',
             output_log_path='/path/to/newSimulationLog.log',
             properties=prop)
Info:

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 = None, properties: dict | None = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs MakeNdx
Wrapper of the GROMACS make_ndx module.
The GROMACS make_ndx module, generates an index file using the atoms of the selection.
Parameters:
  • input_structure_path (str) –

    Path to the input GRO/PDB/TPR file. File type: input. Sample file. Accepted formats: gro (edam:format_2033), pdb (edam:format_1476), tpr (edam:format_2333).

  • output_ndx_path (str) –

    Path to the output index NDX file. File type: output. Sample file. Accepted formats: ndx (edam:format_2033).

  • input_ndx_path (str) (Optional) – Path to the input index NDX file. File type: input. Accepted formats: ndx (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • selection (str) - (“a CA C N O”) Heavy atoms. Atom selection string.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.make_ndx import make_ndx
prop = { 'selection': 'a CA C N O' }
make_ndx(input_structure_path='/path/to/myStructure.gro',
         output_ndx_path='/path/to/newIndex.ndx',
         properties=prop)
Info:
launch() int[source]

Execute the MakeNdx object.

gromacs.make_ndx.make_ndx(input_structure_path: str, output_ndx_path: str, input_ndx_path: str | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs MakeNdx
Wrapper of the GROMACS make_ndx module.
The GROMACS make_ndx module, generates an index file using the atoms of the selection.
Parameters:
  • input_structure_path (str) –

    Path to the input GRO/PDB/TPR file. File type: input. Sample file. Accepted formats: gro (edam:format_2033), pdb (edam:format_1476), tpr (edam:format_2333).

  • output_ndx_path (str) –

    Path to the output index NDX file. File type: output. Sample file. Accepted formats: ndx (edam:format_2033).

  • input_ndx_path (str) (Optional) – Path to the input index NDX file. File type: input. Accepted formats: ndx (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • selection (str) - (“a CA C N O”) Heavy atoms. Atom selection string.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.make_ndx import make_ndx
prop = { 'selection': 'a CA C N O' }
make_ndx(input_structure_path='/path/to/myStructure.gro',
         output_ndx_path='/path/to/newIndex.ndx',
         properties=prop)
Info:

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 = None, properties: dict | None = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs Gmxselect
Wrapper of the GROMACS select module.
The GROMACS select module writes out basic data about dynamic selections. It can be used for some simple analyses, or the output can be combined with output from other programs and/or external analysis programs to calculate more complex things.
Parameters:
  • input_structure_path (str) –

    Path to the input GRO/PDB/TPR file. File type: input. Sample file. Accepted formats: pdb (edam:format_1476), gro (edam:format_2033), tpr (edam:format_2333).

  • output_ndx_path (str) –

    Path to the output index NDX file. File type: output. Sample file. Accepted formats: ndx (edam:format_2033).

  • input_ndx_path (str) (Optional) – Path to the input index NDX file. File type: input. Accepted formats: ndx (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • selection (str) - (“a CA C N O”) Heavy atoms. Atom selection string.

    • append (bool) - (False) Append the content of the input_ndx_path to the output_ndx_path.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.gmxselect import gmxselect
prop = { 'selection': '"Mynewgroup" group "Protein-H" and not same residue as within 0.4 of resname ARG' }
gmxselect(input_structure_path='/path/to/myStructure.gro',
          output_ndx_path='/path/to/newIndex.ndx',
          properties=prop)
Info:
launch() int[source]

Execute the Gmxselect object.

gromacs.gmxselect.gmxselect(input_structure_path: str, output_ndx_path: str, input_ndx_path: str | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Gmxselect
Wrapper of the GROMACS select module.
The GROMACS select module writes out basic data about dynamic selections. It can be used for some simple analyses, or the output can be combined with output from other programs and/or external analysis programs to calculate more complex things.
Parameters:
  • input_structure_path (str) –

    Path to the input GRO/PDB/TPR file. File type: input. Sample file. Accepted formats: pdb (edam:format_1476), gro (edam:format_2033), tpr (edam:format_2333).

  • output_ndx_path (str) –

    Path to the output index NDX file. File type: output. Sample file. Accepted formats: ndx (edam:format_2033).

  • input_ndx_path (str) (Optional) – Path to the input index NDX file. File type: input. Accepted formats: ndx (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • selection (str) - (“a CA C N O”) Heavy atoms. Atom selection string.

    • append (bool) - (False) Append the content of the input_ndx_path to the output_ndx_path.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.gmxselect import gmxselect
prop = { 'selection': '"Mynewgroup" group "Protein-H" and not same residue as within 0.4 of resname ARG' }
gmxselect(input_structure_path='/path/to/myStructure.gro',
          output_ndx_path='/path/to/newIndex.ndx',
          properties=prop)
Info:

gromacs.mdrun module

Module containing the MDrun class and the command line interface.

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

Bases: BiobbObject

biobb_gromacs Mdrun
Wrapper of the GROMACS mdrun module.
MDRun is the main computational chemistry engine within GROMACS. It performs Molecular Dynamics simulations, but it can also perform Stochastic Dynamics, Energy Minimization, test particle insertion or (re)calculation of energies.
Parameters:
  • input_tpr_path (str) –

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

  • output_gro_path (str) –

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

  • output_edr_path (str) –

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

  • output_log_path (str) –

    Path to the output GROMACS trajectory log file LOG. File type: output. Sample file. Accepted formats: log (edam:format_2330).

  • output_trr_path (str) (Optional) –

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

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt (edam:format_2333).

  • output_xtc_path (str) (Optional) – Path to the GROMACS compressed trajectory file XTC. File type: output. Accepted formats: xtc (edam:format_3875).

  • output_cpt_path (str) (Optional) – Path to the output GROMACS checkpoint file CPT. File type: output. Accepted formats: cpt (edam:format_2333).

  • 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 (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • mpi_bin (str) - (None) Path to the MPI runner. Usually “mpirun” or “srun”.

    • mpi_np (int) - (0) [0~1000|1] Number of MPI processes. Usually an integer bigger than 1.

    • mpi_flags (str) - (None) Path to the MPI hostlist file.

    • checkpoint_time (int) - (15) [0~1000|1] Checkpoint writing interval in minutes. Only enabled if an output_cpt_path is provided.

    • noappend (bool) - (False) Include the noappend flag to open new output files and add the simulation part number to all output file names

    • num_threads (int) - (0) [0~1000|1] Let GROMACS guess. The number of threads that are going to be used.

    • num_threads_mpi (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS MPI threads that are going to be used.

    • num_threads_omp (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS OPENMP threads that are going to be used.

    • num_threads_omp_pme (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS OPENMP_PME threads that are going to be used.

    • use_gpu (bool) - (False) Use settings appropriate for GPU. Adds: -nb gpu -pme gpu

    • gpu_id (str) - (None) list of unique GPU device IDs available to use.

    • gpu_tasks (str) - (None) list of GPU device IDs, mapping each PP task on each node to a device.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • container_path (str) - (None) Path to the binary executable of your container.

    • container_image (str) - (None) 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.mdrun import mdrun
prop = { 'num_threads': 0,
         'binary_path': 'gmx' }
mdrun(input_tpr_path='/path/to/myPortableBinaryRunInputFile.tpr',
      output_trr_path='/path/to/newTrajectory.trr',
      output_gro_path='/path/to/newStructure.gro',
      output_edr_path='/path/to/newEnergy.edr',
      output_log_path='/path/to/newSimulationLog.log',
      properties=prop)
Info:
copy_to_host()[source]

Updates the path to the original output files in the sandbox, to catch changes due to noappend restart.

GROMACS mdrun will change the output file names from md.gro to md.part0001.gro if the noappend flag is used.

launch() int[source]

Execute the Mdrun object.

gromacs.mdrun.mdrun(input_tpr_path: str, output_gro_path: str, output_edr_path: str, output_log_path: str, output_trr_path: str | None = None, input_cpt_path: str | None = None, output_xtc_path: str | None = None, output_cpt_path: str | None = None, output_dhdl_path: str | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Mdrun
Wrapper of the GROMACS mdrun module.
MDRun is the main computational chemistry engine within GROMACS. It performs Molecular Dynamics simulations, but it can also perform Stochastic Dynamics, Energy Minimization, test particle insertion or (re)calculation of energies.
Parameters:
  • input_tpr_path (str) –

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

  • output_gro_path (str) –

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

  • output_edr_path (str) –

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

  • output_log_path (str) –

    Path to the output GROMACS trajectory log file LOG. File type: output. Sample file. Accepted formats: log (edam:format_2330).

  • output_trr_path (str) (Optional) –

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

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt (edam:format_2333).

  • output_xtc_path (str) (Optional) – Path to the GROMACS compressed trajectory file XTC. File type: output. Accepted formats: xtc (edam:format_3875).

  • output_cpt_path (str) (Optional) – Path to the output GROMACS checkpoint file CPT. File type: output. Accepted formats: cpt (edam:format_2333).

  • 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 (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • mpi_bin (str) - (None) Path to the MPI runner. Usually “mpirun” or “srun”.

    • mpi_np (int) - (0) [0~1000|1] Number of MPI processes. Usually an integer bigger than 1.

    • mpi_flags (str) - (None) Path to the MPI hostlist file.

    • checkpoint_time (int) - (15) [0~1000|1] Checkpoint writing interval in minutes. Only enabled if an output_cpt_path is provided.

    • noappend (bool) - (False) Include the noappend flag to open new output files and add the simulation part number to all output file names

    • num_threads (int) - (0) [0~1000|1] Let GROMACS guess. The number of threads that are going to be used.

    • num_threads_mpi (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS MPI threads that are going to be used.

    • num_threads_omp (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS OPENMP threads that are going to be used.

    • num_threads_omp_pme (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS OPENMP_PME threads that are going to be used.

    • use_gpu (bool) - (False) Use settings appropriate for GPU. Adds: -nb gpu -pme gpu

    • gpu_id (str) - (None) list of unique GPU device IDs available to use.

    • gpu_tasks (str) - (None) list of GPU device IDs, mapping each PP task on each node to a device.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • container_path (str) - (None) Path to the binary executable of your container.

    • container_image (str) - (None) 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.mdrun import mdrun
prop = { 'num_threads': 0,
         'binary_path': 'gmx' }
mdrun(input_tpr_path='/path/to/myPortableBinaryRunInputFile.tpr',
      output_trr_path='/path/to/newTrajectory.trr',
      output_gro_path='/path/to/newStructure.gro',
      output_edr_path='/path/to/newEnergy.edr',
      output_log_path='/path/to/newSimulationLog.log',
      properties=prop)
Info:

gromacs.mdrun_plumed module

Module containing the MDrun class and the command line interface.

class gromacs.mdrun_plumed.MdrunPlumed(input_tpr_path: str, output_gro_path: str, output_edr_path: str, output_log_path: str, output_trr_path: str | None = None, input_cpt_path: str | None = None, output_xtc_path: str | None = None, output_cpt_path: str | None = None, output_dhdl_path: str | None = None, input_plumed_path: str | None = None, input_plumed_folder: str | None = None, output_plumed_folder: str | None = None, properties: dict | None = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs MdrunPlumed
Wrapper of the GROMACS mdrun module.
MDRun is the main computational chemistry engine within GROMACS. It performs Molecular Dynamics simulations, but it can also perform Stochastic Dynamics, Energy Minimization, test particle insertion or (re)calculation of energies.
Parameters:
  • input_tpr_path (str) –

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

  • output_gro_path (str) –

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

  • output_edr_path (str) –

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

  • output_log_path (str) –

    Path to the output GROMACS trajectory log file LOG. File type: output. Sample file. Accepted formats: log (edam:format_2330).

  • output_trr_path (str) (Optional) –

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

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt (edam:format_2333).

  • output_xtc_path (str) (Optional) – Path to the GROMACS compressed trajectory file XTC. File type: output. Accepted formats: xtc (edam:format_3875).

  • output_cpt_path (str) (Optional) – Path to the output GROMACS checkpoint file CPT. File type: output. Accepted formats: cpt (edam:format_2333).

  • 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 (edam:format_2033).

  • input_plumed_path (str) (Optional) – Path to the main PLUMED input file. If provided, PLUMED will be used during the simulation. All files used by the main PLUMED input file must exist in the input_plumed_folder and be called with just their name. Make sure to provide a GROMACS version with the PLUMED patch. File type: input. Accepted formats: dat (edam:format_2330).

  • input_plumed_folder (dir) (Optional) – Path to the folder with all files needed by the main PLUMED input file, see input_plumed_path. File type: input. Accepted formats: directory (edam:format_1915)

  • output_plumed_folder (dir) (Optional) – Folder where PLUMED generated output files will be saved. File type: output. Accepted formats: directory (edam:format_1915)

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • mpi_bin (str) - (None) Path to the MPI runner. Usually “mpirun” or “srun”.

    • mpi_np (int) - (0) [0~1000|1] Number of MPI processes. Usually an integer bigger than 1.

    • mpi_flags (str) - (None) Path to the MPI hostlist file.

    • checkpoint_time (int) - (15) [0~1000|1] Checkpoint writing interval in minutes. Only enabled if an output_cpt_path is provided.

    • noappend (bool) - (False) Include the noappend flag to open new output files and add the simulation part number to all output file names

    • num_threads (int) - (0) [0~1000|1] Let GROMACS guess. The number of threads that are going to be used.

    • num_threads_mpi (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS MPI threads that are going to be used.

    • num_threads_omp (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS OPENMP threads that are going to be used.

    • num_threads_omp_pme (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS OPENMP_PME threads that are going to be used.

    • use_gpu (bool) - (False) Use settings appropriate for GPU. Adds: -nb gpu -pme gpu

    • gpu_id (str) - (None) list of unique GPU device IDs available to use.

    • gpu_tasks (str) - (None) list of GPU device IDs, mapping each PP task on each node to a device.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • container_path (str) - (None) Path to the binary executable of your container.

    • container_image (str) - (None) 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.mdrun_plumed import mdrun_plumed
prop = { 'num_threads': 0,
         'binary_path': 'gmx' }
mdrun_plumed(input_tpr_path='/path/to/myPortableBinaryRunInputFile.tpr',
            output_trr_path='/path/to/newTrajectory.trr',
            output_gro_path='/path/to/newStructure.gro',
            output_edr_path='/path/to/newEnergy.edr',
            output_log_path='/path/to/newSimulationLog.log',
            properties=prop)
Info:
  • wrapped_software:
    • name: GROMACS Mdrun with PLUMED

    • version: 2025.2

    • license: LGPL 2.1

    • multinode: mpi

  • ontology:
copy_to_host()[source]

Updates the path to the original output files in the sandbox, to catch changes due to noappend restart.

GROMACS mdrun will change the output file names from md.gro to md.part0001.gro if the noappend flag is used.

launch() int[source]

Execute the MdrunPlumed object.

stage_files()[source]

Stage the input/output files in a temporal unique directory aka sandbox.

Overwrite the parent class method to handle PLUMED input files.

gromacs.mdrun_plumed.mdrun_plumed(input_tpr_path: str, output_gro_path: str, output_edr_path: str, output_log_path: str, output_trr_path: str | None = None, input_cpt_path: str | None = None, output_xtc_path: str | None = None, output_cpt_path: str | None = None, output_dhdl_path: str | None = None, input_plumed_path: str | None = None, input_plumed_folder: str | None = None, output_plumed_folder: str | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs MdrunPlumed
Wrapper of the GROMACS mdrun module.
MDRun is the main computational chemistry engine within GROMACS. It performs Molecular Dynamics simulations, but it can also perform Stochastic Dynamics, Energy Minimization, test particle insertion or (re)calculation of energies.
Parameters:
  • input_tpr_path (str) –

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

  • output_gro_path (str) –

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

  • output_edr_path (str) –

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

  • output_log_path (str) –

    Path to the output GROMACS trajectory log file LOG. File type: output. Sample file. Accepted formats: log (edam:format_2330).

  • output_trr_path (str) (Optional) –

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

  • input_cpt_path (str) (Optional) – Path to the input GROMACS checkpoint file CPT. File type: input. Accepted formats: cpt (edam:format_2333).

  • output_xtc_path (str) (Optional) – Path to the GROMACS compressed trajectory file XTC. File type: output. Accepted formats: xtc (edam:format_3875).

  • output_cpt_path (str) (Optional) – Path to the output GROMACS checkpoint file CPT. File type: output. Accepted formats: cpt (edam:format_2333).

  • 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 (edam:format_2033).

  • input_plumed_path (str) (Optional) – Path to the main PLUMED input file. If provided, PLUMED will be used during the simulation. All files used by the main PLUMED input file must exist in the input_plumed_folder and be called with just their name. Make sure to provide a GROMACS version with the PLUMED patch. File type: input. Accepted formats: dat (edam:format_2330).

  • input_plumed_folder (dir) (Optional) – Path to the folder with all files needed by the main PLUMED input file, see input_plumed_path. File type: input. Accepted formats: directory (edam:format_1915)

  • output_plumed_folder (dir) (Optional) – Folder where PLUMED generated output files will be saved. File type: output. Accepted formats: directory (edam:format_1915)

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • mpi_bin (str) - (None) Path to the MPI runner. Usually “mpirun” or “srun”.

    • mpi_np (int) - (0) [0~1000|1] Number of MPI processes. Usually an integer bigger than 1.

    • mpi_flags (str) - (None) Path to the MPI hostlist file.

    • checkpoint_time (int) - (15) [0~1000|1] Checkpoint writing interval in minutes. Only enabled if an output_cpt_path is provided.

    • noappend (bool) - (False) Include the noappend flag to open new output files and add the simulation part number to all output file names

    • num_threads (int) - (0) [0~1000|1] Let GROMACS guess. The number of threads that are going to be used.

    • num_threads_mpi (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS MPI threads that are going to be used.

    • num_threads_omp (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS OPENMP threads that are going to be used.

    • num_threads_omp_pme (int) - (0) [0~1000|1] Let GROMACS guess. The number of GROMACS OPENMP_PME threads that are going to be used.

    • use_gpu (bool) - (False) Use settings appropriate for GPU. Adds: -nb gpu -pme gpu

    • gpu_id (str) - (None) list of unique GPU device IDs available to use.

    • gpu_tasks (str) - (None) list of GPU device IDs, mapping each PP task on each node to a device.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • container_path (str) - (None) Path to the binary executable of your container.

    • container_image (str) - (None) 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.mdrun_plumed import mdrun_plumed
prop = { 'num_threads': 0,
         'binary_path': 'gmx' }
mdrun_plumed(input_tpr_path='/path/to/myPortableBinaryRunInputFile.tpr',
            output_trr_path='/path/to/newTrajectory.trr',
            output_gro_path='/path/to/newStructure.gro',
            output_edr_path='/path/to/newEnergy.edr',
            output_log_path='/path/to/newSimulationLog.log',
            properties=prop)
Info:
  • wrapped_software:
    • name: GROMACS Mdrun with PLUMED

    • version: 2025.2

    • license: LGPL 2.1

    • multinode: mpi

  • ontology:

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 = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs Pdb2gmx
Wrapper class for the GROMACS pdb2gmx module.
The GROMACS pdb2gmx module, reads a .pdb (or .gro) file, reads some database files, adds hydrogens to the molecules and generates coordinates in GROMACS (GROMOS), or optionally .pdb, format and a topology in GROMACS format. These files can subsequently be processed to generate a run input file.
Parameters:
  • input_pdb_path (str) –

    Path to the input PDB file. File type: input. Sample file. Accepted formats: pdb (edam:format_1476).

  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: gro (edam:format_2033).

  • output_top_zip_path (str) –

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

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • water_type (str) - (“spce”) Water molecule type. Values: spc, spce, tip3p, tip4p, tip5p, tips3p.

    • force_field (str) - (“amber99sb-ildn”) Force field to be used during the conversion. Values: gromos45a3, charmm27, gromos53a6, amber96, amber99, gromos43a2, gromos54a7, gromos43a1, amberGS, gromos53a5, amber99sb, amber03, amber99sb-ildn, oplsaa, amber94, amber99sb-star-ildn-mut.

    • ignh (bool) - (False) Should pdb2gmx ignore the hidrogens in the original structure.

    • lys (list) - (None) Lysine protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • arg (list) - (None) Arginine protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • asp (list) - (None) Aspartic acid protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • glu (list) - (None) Glutamic acid protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • gln (list) - (None) Glutamine protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • his (list) - (None) Histidine protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain. Make sure residues are named HIS (0: HID, 1: HIE, 2: HIP, 3: HIS1).

    • merge (bool) - (False) Merge all chains into a single molecule.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.pdb2gmx import pdb2gmx
prop = { 'his': ['0 0 1 1 0 0 0', '1 1 0 1'] }
pdb2gmx(input_pdb_path='/path/to/myStructure.pdb',
        output_gro_path='/path/to/newStructure.gro',
        output_top_zip_path='/path/to/newTopology.zip',
        properties=prop)
Info:
check_lengths(*lists)[source]

Make sure all lists are the same length

find_length(*lists) int[source]

Find length of the first list

launch() int[source]

Execute the Pdb2gmx object.

gromacs.pdb2gmx.pdb2gmx(input_pdb_path: str, output_gro_path: str, output_top_zip_path: str, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Pdb2gmx
Wrapper class for the GROMACS pdb2gmx module.
The GROMACS pdb2gmx module, reads a .pdb (or .gro) file, reads some database files, adds hydrogens to the molecules and generates coordinates in GROMACS (GROMOS), or optionally .pdb, format and a topology in GROMACS format. These files can subsequently be processed to generate a run input file.
Parameters:
  • input_pdb_path (str) –

    Path to the input PDB file. File type: input. Sample file. Accepted formats: pdb (edam:format_1476).

  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: gro (edam:format_2033).

  • output_top_zip_path (str) –

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

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • water_type (str) - (“spce”) Water molecule type. Values: spc, spce, tip3p, tip4p, tip5p, tips3p.

    • force_field (str) - (“amber99sb-ildn”) Force field to be used during the conversion. Values: gromos45a3, charmm27, gromos53a6, amber96, amber99, gromos43a2, gromos54a7, gromos43a1, amberGS, gromos53a5, amber99sb, amber03, amber99sb-ildn, oplsaa, amber94, amber99sb-star-ildn-mut.

    • ignh (bool) - (False) Should pdb2gmx ignore the hidrogens in the original structure.

    • lys (list) - (None) Lysine protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • arg (list) - (None) Arginine protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • asp (list) - (None) Aspartic acid protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • glu (list) - (None) Glutamic acid protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • gln (list) - (None) Glutamine protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain (0: not protonated, 1: protonated).

    • his (list) - (None) Histidine protonation states for each chain in the input pdb. Each item of the list should be a string with the protonation states for that chain or empty if the residue is not present in that chain. Make sure residues are named HIS (0: HID, 1: HIE, 2: HIP, 3: HIS1).

    • merge (bool) - (False) Merge all chains into a single molecule.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.pdb2gmx import pdb2gmx
prop = { 'his': ['0 0 1 1 0 0 0', '1 1 0 1'] }
pdb2gmx(input_pdb_path='/path/to/myStructure.pdb',
        output_gro_path='/path/to/newStructure.gro',
        output_top_zip_path='/path/to/newTopology.zip',
        properties=prop)
Info:

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, input_solvent_gro_path: str | None = None, properties: dict | None = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs Solvate
Wrapper of the GROMACS solvate module.
The GROMACS solvate module, generates a box of solvent around the selected structure.
Parameters:
  • input_solute_gro_path (str) –

    Path to the input GRO file. File type: input. Sample file. Accepted formats: gro (edam:format_2033), pdb (edam:format_1476).

  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: gro (edam:format_2033), pdb (edam:format_1476).

  • input_top_zip_path (str) –

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

  • output_top_zip_path (str) –

    Path the output topology in zip format. File type: output. Sample file. Accepted formats: zip (edam:format_3987).

  • input_solvent_gro_path (str) (Optional) – (spc216.gro) Path to the GRO file containing the structure of the solvent. File type: input. Accepted formats: gro (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • shell (float) - (0.0) [0~100|0.1] Thickness in nanometers of optional water layer around solute.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.solvate import Solvate
prop = { 'shell': 1.0 }
solvate(input_solute_gro_path='/path/to/myStructure.gro',
        output_gro_path='/path/to/newStructure.gro',
        input_top_zip_path='/path/to/myTopology.zip',
        output_top_zip_path='/path/to/newTopology.zip',
        properties=prop)
Info:
launch() int[source]

Execute the Solvate object.

gromacs.solvate.solvate(input_solute_gro_path: str, output_gro_path: str, input_top_zip_path: str, output_top_zip_path: str, input_solvent_gro_path: str | None = None, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Solvate
Wrapper of the GROMACS solvate module.
The GROMACS solvate module, generates a box of solvent around the selected structure.
Parameters:
  • input_solute_gro_path (str) –

    Path to the input GRO file. File type: input. Sample file. Accepted formats: gro (edam:format_2033), pdb (edam:format_1476).

  • output_gro_path (str) –

    Path to the output GRO file. File type: output. Sample file. Accepted formats: gro (edam:format_2033), pdb (edam:format_1476).

  • input_top_zip_path (str) –

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

  • output_top_zip_path (str) –

    Path the output topology in zip format. File type: output. Sample file. Accepted formats: zip (edam:format_3987).

  • input_solvent_gro_path (str) (Optional) – (spc216.gro) Path to the GRO file containing the structure of the solvent. File type: input. Accepted formats: gro (edam:format_2033).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • shell (float) - (0.0) [0~100|0.1] Thickness in nanometers of optional water layer around solute.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.solvate import Solvate
prop = { 'shell': 1.0 }
solvate(input_solute_gro_path='/path/to/myStructure.gro',
        output_gro_path='/path/to/newStructure.gro',
        input_top_zip_path='/path/to/myTopology.zip',
        output_top_zip_path='/path/to/newTopology.zip',
        properties=prop)
Info:

gromacs.trjcat module

Module containing the Trjcat class and the command line interface.

class gromacs.trjcat.Trjcat(input_trj_zip_path: str, output_trj_path: str, properties: dict | None = None, **kwargs)[source]

Bases: BiobbObject

biobb_gromacs Trjcat
Wrapper class for the GROMACS trjcat module.
The GROMACS solvate module generates a box around the selected structure.
Parameters:
  • input_trj_zip_path (str) –

    Path the input GROMACS trajectories (xtc, trr, cpt, gro, pdb, tng) to concatenate in zip format. File type: input. Sample file. Accepted formats: zip (edam:format_3987).

  • output_trj_path (str) –

    Path to the output trajectory file. File type: output. Sample file. Accepted formats: pdb (edam:format_1476), gro (edam:format_2033), xtc (edam:format_3875), trr (edam:format_3910), tng (edam:format_3876).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • concatenate (bool) - (True) Only concatenate the files without removal of frames with identical timestamps.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • container_path (str) - (None) Path to the binary executable of your container.

    • container_image (str) - (None) 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.trjcat import trjcat
prop = { 'concatenate': True }
trjcat(input_trj_zip_path='/path/to/trajectory_bundle.zip',
       output_gro_path='/path/to/concatenated_trajectories.xtc',
       properties=prop)
Info:
launch() int[source]

Execute the Trjcat object.

gromacs.trjcat.trjcat(input_trj_zip_path: str, output_trj_path: str, properties: dict | None = None, **kwargs) int[source]
biobb_gromacs Trjcat
Wrapper class for the GROMACS trjcat module.
The GROMACS solvate module generates a box around the selected structure.
Parameters:
  • input_trj_zip_path (str) –

    Path the input GROMACS trajectories (xtc, trr, cpt, gro, pdb, tng) to concatenate in zip format. File type: input. Sample file. Accepted formats: zip (edam:format_3987).

  • output_trj_path (str) –

    Path to the output trajectory file. File type: output. Sample file. Accepted formats: pdb (edam:format_1476), gro (edam:format_2033), xtc (edam:format_3875), trr (edam:format_3910), tng (edam:format_3876).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • concatenate (bool) - (True) Only concatenate the files without removal of frames with identical timestamps.

    • gmx_lib (str) - (None) Path set GROMACS GMXLIB environment variable.

    • binary_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.

    • sandbox_path (str) - (“./”) [WF property] Parent path to the sandbox directory.

    • container_path (str) - (None) Path to the binary executable of your container.

    • container_image (str) - (None) 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.

Examples

This is a use example of how to use the building block from Python:

from biobb_gromacs.gromacs.trjcat import trjcat
prop = { 'concatenate': True }
trjcat(input_trj_zip_path='/path/to/trajectory_bundle.zip',
       output_gro_path='/path/to/concatenated_trajectories.xtc',
       properties=prop)
Info: