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

Bases: BiobbObject

biobb_md Editconf
Wrapper class for the GROMACS editconf module.
The GROMACS solvate module generates a box around the selected structure.
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_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.

    • 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) - (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_md.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: Optional[dict] = None, **kwargs) int[source]

Create Editconf class and execute the launch() method.

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

Bases: BiobbObject

biobb_md 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.05) [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.

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

Examples

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

from biobb_md.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, output_gro_path: str, input_top_zip_path: str, output_top_zip_path: str, properties: Optional[dict] = None, **kwargs) int[source]

Create Genion class and execute the launch() method.

gromacs.genion.main()[source]

Command line execution of this building block. Please check the command line documentation.

gromacs.genrestr module

Module containing the Genrestr class and the command line interface.

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

Bases: BiobbObject

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

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

Examples

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

from biobb_md.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, output_itp_path: str, input_ndx_path: Optional[str] = None, properties: Optional[dict] = None, **kwargs) int[source]

Create Genrestr class and execute the launch() method.

gromacs.genrestr.main()[source]

Command line execution of this building block. Please check the command line documentation.

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

Bases: BiobbObject

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

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

Examples

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

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

Create Grompp class and execute the launch() method.

gromacs.grompp.main()[source]

Command line execution of this building block. Please check the command line documentation.

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

Bases: BiobbObject

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

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

Examples

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

from biobb_md.gromacs.grompp_mdrun import grompp_mdrun
prop = { 'num_threads': 0,
         'gmx_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: Optional[str] = None, input_ndx_path: Optional[str] = None, input_mdp_path: Optional[str] = None, output_xtc_path: Optional[str] = None, output_cpt_path: Optional[str] = None, output_dhdl_path: Optional[str] = None, properties: Optional[dict] = None, **kwargs) int[source]
gromacs.grompp_mdrun.main()[source]

Command line execution of this building block. Please check the command line documentation.

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

Bases: BiobbObject

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

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

Examples

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

from biobb_md.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.main()[source]

Command line execution of this building block. Please check the command line documentation.

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

Create MakeNdx class and execute the launch() method.

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

Bases: BiobbObject

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

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

Examples

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

from biobb_md.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: Optional[str] = None, properties: Optional[dict] = None, **kwargs) int[source]

Create Gmxselect class and execute the launch() method.

gromacs.gmxselect.main()[source]

Command line execution of this building block. Please check the command line documentation.

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, input_cpt_path: Optional[str] = None, output_xtc_path: Optional[str] = None, output_cpt_path: Optional[str] = None, output_dhdl_path: Optional[str] = None, properties: Optional[dict] = None, **kwargs)[source]

Bases: BiobbObject

biobb_md 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_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).

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

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

    • 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) - (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_md.gromacs.mdrun import mdrun
prop = { 'num_threads': 0,
         'gmx_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:
launch() int[source]

Execute the Mdrun object.

gromacs.mdrun.main()[source]

Command line execution of this building block. Please check the command line documentation.

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

Create Mdrun class and execute the launch() method.

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

Bases: BiobbObject

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

    • his (str) - (None) Histidine protonation array.

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

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

Examples

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

from biobb_md.gromacs.pdb2gmx import pdb2gmx
prop = { 'his': '0 0 1 1 0 0 0' }
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:
launch() int[source]

Execute the Pdb2gmx object.

gromacs.pdb2gmx.main()[source]

Command line execution of this building block. Please check the command line documentation.

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

Create Pdb2gmx class and execute the launch() method.

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

Bases: BiobbObject

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

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

Examples

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

from biobb_md.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.main()[source]

Command line execution of this building block. Please check the command line documentation.

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

Create Solvate class and execute the launch() method.