babelm package

Submodules

babelm.babel_convert module

Module containing the BabelConvert class and the command line interface.

class babelm.babel_convert.BabelConvert(input_path, output_path, properties=None, **kwargs)[source]

Bases: BiobbObject

biobb_chemistry BabelConvert
This class is a wrapper of the Open Babel tool.
Small molecule format conversion for structures or trajectories. Open Babel is a chemical toolbox designed to speak the many languages of chemical data. It’s an open, collaborative project allowing anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas. Visit the official page.
Parameters:
  • input_path (str) – Path to the input file. File type: input. Sample file. Accepted formats: dat (edam:format_1637), ent (edam:format_1476), fa (edam:format_1929), fasta (edam:format_1929), gro (edam:format_2033), inp (edam:format_3878), log (edam:format_2030), mcif (edam:format_1477), mdl (edam:format_3815), mmcif (edam:format_1477), mol (edam:format_3815), mol2 (edam:format_3816), pdb (edam:format_1476), pdbqt (edam:format_1476), png (edam:format_3603), sdf (edam:format_3814), smi (edam:format_1196), smiles (edam:format_1196), txt (edam:format_2033), xml (edam:format_2332), xtc (edam:format_3875).

  • output_path (str) –

    Path to the output file. File type: output. Sample file. Accepted formats: ent (edam:format_1476), fa (edam:format_1929), fasta (edam:format_1929), gro (edam:format_2033), inp (edam:format_3878), mcif (edam:format_1477), mdl (edam:format_3815), mmcif (edam:format_1477), mol (edam:format_3815), mol2 (edam:format_3816), pdb (edam:format_1476), pdbqt (edam:format_1476), png (edam:format_3603), sdf (edam:format_3814), smi (edam:format_1196), smiles (edam:format_1196), txt (edam:format_2033).

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

    • input_format (str) - (None) Format of input file. If not provided, input_path extension will be taken. Values: dat (Information represented in a data record), ent (Protein Data Bank format), fa (FASTA sequence format), fasta (FASTA sequence format), gro (GROMACS structure), inp (AMBER trajectory format), log (Events file), mcif (Entry format of PDB database in mmCIF format), mdl (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mmcif (Entry format of PDB database in mmCIF format), mol (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mol2 (Complete and portable representation of a SYBYL molecule), pdb (Protein Data Bank format), pdbqt (Protein Data Bank format with charges), png (File format for image compression), sdf (One of a family of chemical-data file formats developed by MDL Information Systems), smi (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), smiles (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), txt (Textual format), xml (eXtensible Markup Language), xtc (Portable binary format for trajectories produced by GROMACS package).

    • output_format (str) - (None) Format of output file. If not provided, output_path extension will be taken. Values: ent (Protein Data Bank format), fa (FASTA sequence format), fasta (FASTA sequence format), gro (GROMACS structure), inp (AMBER trajectory format), mcif (Entry format of PDB database in mmCIF format), mdl (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mmcif (Entry format of PDB database in mmCIF format), mol (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mol2 (Complete and portable representation of a SYBYL molecule), pdb (Protein Data Bank format), pdbqt (Protein Data Bank format with charges), png (File format for image compression), sdf (One of a family of chemical-data file formats developed by MDL Information Systems), smi (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), smiles (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), txt (Textual format), xtc (Portable binary format for trajectories produced by GROMACS package).

    • coordinates (int) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).

    • ph (float) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.

    • flex (bool) - (False) Remove all but the largest contiguous fragment (strip salts).

    • binary_path (str) - (“obabel”) Path to the obabel 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) Container path definition.

    • container_image (str) - (‘informaticsmatters/obabel:latest’) Container image definition.

    • container_volume_path (str) - (‘/tmp’) Container volume path definition.

    • container_working_dir (str) - (None) Container working directory definition.

    • container_user_id (str) - (None) Container user_id definition.

    • container_shell_path (str) - (‘/bin/bash’) Path to default shell inside the container.

Examples

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

from biobb_chemistry.babelm.babel_convert import babel_convert
prop = {
    'input_format': 'smi',
    'output_format': 'mol2',
    'coordinates': 3,
    'ph': 7.4
}
babel_convert(input_path='/path/to/my2DMolecule.smi',
            output_path='/path/to/new3DMolecule.mol2',
            properties=prop)
Info:
check_data_params(out_log, err_log)[source]

Checks all the input/output paths and parameters

create_cmd(container_io_dict, out_log, err_log)[source]

Creates the command line instruction using the properties file settings

launch() int[source]

Execute the BabelConvert babelm.babel_convert.BabelConvert object.

babelm.babel_convert.babel_convert(input_path: str, output_path: str, properties: dict | None = None, **kwargs) int[source]

Execute the BabelConvert class and execute the launch() method.

babelm.babel_convert.main()[source]

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

babelm.babel_add_hydrogens module

Module containing the BabelAddHydrogens class and the command line interface.

class babelm.babel_add_hydrogens.BabelAddHydrogens(input_path, output_path, properties=None, **kwargs)[source]

Bases: BiobbObject

biobb_chemistry BabelAddHydrogens
This class is a wrapper of the Open Babel tool.
Adds hydrogens to a given structure or trajectory. Open Babel is a chemical toolbox designed to speak the many languages of chemical data. It’s an open, collaborative project allowing anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas. Visit the official page.
Parameters:
  • input_path (str) –

    Path to the input file. File type: input. Sample file. Accepted formats: dat (edam:format_1637), ent (edam:format_1476), fa (edam:format_1929), fasta (edam:format_1929), gro (edam:format_2033), inp (edam:format_3878), log (edam:format_2030), mcif (edam:format_1477), mdl (edam:format_3815), mmcif (edam:format_1477), mol (edam:format_3815), mol2 (edam:format_3816), pdb (edam:format_1476), pdbqt (edam:format_1476), png (edam:format_3603), sdf (edam:format_3814), smi (edam:format_1196), smiles (edam:format_1196), txt (edam:format_2033), xml (edam:format_2332), xtc (edam:format_3875).

  • output_path (str) –

    Path to the output file. File type: output. Sample file. Accepted formats: ent (edam:format_1476), fa (edam:format_1929), fasta (edam:format_1929), gro (edam:format_2033), inp (edam:format_3878), mcif (edam:format_1477), mdl (edam:format_3815), mmcif (edam:format_1477), mol (edam:format_3815), mol2 (edam:format_3816), pdb (edam:format_1476), pdbqt (edam:format_1476), png (edam:format_3603), sdf (edam:format_3814), smi (edam:format_1196), smiles (edam:format_1196), txt (edam:format_2033).

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

    • input_format (str) - (None) Format of input file. If not provided, input_path extension will be taken. Values: dat (Information represented in a data record), ent (Protein Data Bank format), fa (FASTA sequence format), fasta (FASTA sequence format), gro (GROMACS structure), inp (AMBER trajectory format), log (Events file), mcif (Entry format of PDB database in mmCIF format), mdl (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mmcif (Entry format of PDB database in mmCIF format), mol (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mol2 (Complete and portable representation of a SYBYL molecule), pdb (Protein Data Bank format), pdbqt (Protein Data Bank format with charges), png (File format for image compression), sdf (One of a family of chemical-data file formats developed by MDL Information Systems), smi (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), smiles (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), txt (Textual format), xml (eXtensible Markup Language), xtc (Portable binary format for trajectories produced by GROMACS package).

    • output_format (str) - (None) Format of output file. If not provided, output_path extension will be taken. Values: ent (Protein Data Bank format), fa (FASTA sequence format), fasta (FASTA sequence format), gro (GROMACS structure), inp (AMBER trajectory format), mcif (Entry format of PDB database in mmCIF format), mdl (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mmcif (Entry format of PDB database in mmCIF format), mol (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mol2 (Complete and portable representation of a SYBYL molecule), pdb (Protein Data Bank format), pdbqt (Protein Data Bank format with charges), png (File format for image compression), sdf (One of a family of chemical-data file formats developed by MDL Information Systems), smi (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), smiles (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), txt (Textual format), xtc (Portable binary format for trajectories produced by GROMACS package).

    • coordinates (int) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).

    • ph (float) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.

    • binary_path (str) - (“obabel”) Path to the obabel 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) Container path definition.

    • container_image (str) - (‘informaticsmatters/obabel:latest’) Container image definition.

    • container_volume_path (str) - (‘/tmp’) Container volume path definition.

    • container_working_dir (str) - (None) Container working directory definition.

    • container_user_id (str) - (None) Container user_id definition.

    • container_shell_path (str) - (‘/bin/bash’) Path to default shell inside the container.

Examples

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

from biobb_chemistry.babelm.babel_add_hydrogens import babel_add_hydrogens
prop = {
    'input_format': 'pdb',
    'output_format': 'pdb',
    'coordinates': 3,
    'ph': 7.4
}
babel_add_hydrogens(input_path='/path/to/myStructure.pdb',
                    output_path='/path/to/newStructure.pdb',
                    properties=prop)
Info:
check_data_params(out_log, err_log)[source]

Checks all the input/output paths and parameters

create_cmd(container_io_dict, out_log, err_log)[source]

Creates the command line instruction using the properties file settings

launch() int[source]

Execute the BabelAddHydrogens babelm.babel_add_hydrogens.BabelAddHydrogens object.

babelm.babel_add_hydrogens.babel_add_hydrogens(input_path: str, output_path: str, properties: dict | None = None, **kwargs) int[source]

Execute the BabelAddHydrogens class and execute the launch() method.

babelm.babel_add_hydrogens.main()[source]

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

babelm.babel_minimize module

Module containing the BabelMinimize class and the command line interface.

class babelm.babel_minimize.BabelMinimize(input_path, output_path, properties=None, **kwargs)[source]

Bases: BiobbObject

biobb_chemistry BabelMinimize
This class is a wrapper of the Open Babel tool.
Energetically minimizes small molecules. Open Babel is a chemical toolbox designed to speak the many languages of chemical data. It’s an open, collaborative project allowing anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas. Visit the official page.
Parameters:
  • input_path (str) –

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

  • output_path (str) –

    Path to the output file. File type: output. Sample file. Accepted formats: pdb (edam:format_1476), mol2 (edam:format_3816).

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

    • criteria (float) - (1e-6) Convergence criteria

    • method (str) - (“cg”) Method. Values: cg (conjugate gradients algorithm), sd (steepest descent algorithm).

    • force_field (str) - (None) Force field. Values: GAFF (General Amber Force Field), Ghemical (Ghemical force field), MMFF94 (MMFF94 force field), MMFF94s (MMFF94s force field), UFF (Universal Force Field).

    • hydrogens (bool) - (False) Add hydrogen atoms.

    • steps (int) - (2500) [0~5000|1] Maximum number of steps.

    • cutoff (bool) - (False) Use cut-off.

    • rvdw (float) - (6.0) [0~50|1.0] VDW cut-off distance.

    • rele (float) - (10.0) [0~50|1.0] Electrostatic cut-off distance.

    • frequency (int) - (10) [0~50|1] Frequency to update the non-bonded pairs.

    • binary_path (str) - (“obminimize”) Path to the obminimize 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) Container path definition.

    • container_image (str) - (‘informaticsmatters/obabel:latest’) Container image definition.

    • container_volume_path (str) - (‘/tmp’) Container volume path definition.

    • container_working_dir (str) - (None) Container working directory definition.

    • container_user_id (str) - (None) Container user_id definition.

    • container_shell_path (str) - (‘/bin/bash’) Path to default shell inside the container.

Examples

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

from biobb_chemistry.babelm.babel_minimize import babel_minimize
prop = {
    'criteria': 1e-6,
    'method': 'cg',
    'force_field': 'GAFF'
}
babel_minimize(input_path='/path/to/myStructure.mol2',
                output_path='/path/to/newStructure.mol2',
                properties=prop)
Info:
check_data_params(out_log, err_log)[source]

Checks all the input/output paths and parameters

create_cmd(container_io_dict, out_log, err_log)[source]

Creates the command line instruction using the properties file settings

launch() int[source]

Execute the BabelMinimize babelm.babel_minimize.BabelMinimize object.

babelm.babel_minimize.babel_minimize(input_path: str, output_path: str, properties: dict | None = None, **kwargs) int[source]

Execute the BabelMinimize class and execute the launch() method.

babelm.babel_minimize.main()[source]

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

babelm.babel_remove_hydrogens module

Module containing the BabelRemoveHydrogens class and the command line interface.

class babelm.babel_remove_hydrogens.BabelRemoveHydrogens(input_path, output_path, properties=None, **kwargs)[source]

Bases: BiobbObject

biobb_chemistry BabelRemoveHydrogens
This class is a wrapper of the Open Babel tool.
Removes hydrogens to a given structure or trajectory. Open Babel is a chemical toolbox designed to speak the many languages of chemical data. It’s an open, collaborative project allowing anyone to search, convert, analyze, or store data from molecular modeling, chemistry, solid-state materials, biochemistry, or related areas. Visit the official page.
Parameters:
  • input_path (str) –

    Path to the input file. File type: input. Sample file. Accepted formats: dat (edam:format_1637), ent (edam:format_1476), fa (edam:format_1929), fasta (edam:format_1929), gro (edam:format_2033), inp (edam:format_3878), log (edam:format_2030), mcif (edam:format_1477), mdl (edam:format_3815), mmcif (edam:format_1477), mol (edam:format_3815), mol2 (edam:format_3816), pdb (edam:format_1476), pdbqt (edam:format_1476), png (edam:format_3603), sdf (edam:format_3814), smi (edam:format_1196), smiles (edam:format_1196), txt (edam:format_2033), xml (edam:format_2332), xtc (edam:format_3875).

  • output_path (str) –

    Path to the output file. File type: output. Sample file. Accepted formats: ent (edam:format_1476), fa (edam:format_1929), fasta (edam:format_1929), gro (edam:format_2033), inp (edam:format_3878), mcif (edam:format_1477), mdl (edam:format_3815), mmcif (edam:format_1477), mol (edam:format_3815), mol2 (edam:format_3816), pdb (edam:format_1476), pdbqt (edam:format_1476), png (edam:format_3603), sdf (edam:format_3814), smi (edam:format_1196), smiles (edam:format_1196), txt (edam:format_2033).

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

    • input_format (str) - (None) Format of input file. If not provided, input_path extension will be taken. Values: dat (Information represented in a data record), ent (Protein Data Bank format), fa (FASTA sequence format), fasta (FASTA sequence format), gro (GROMACS structure), inp (AMBER trajectory format), log (Events file), mcif (Entry format of PDB database in mmCIF format), mdl (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mmcif (Entry format of PDB database in mmCIF format), mol (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mol2 (Complete and portable representation of a SYBYL molecule), pdb (Protein Data Bank format), pdbqt (Protein Data Bank format with charges), png (File format for image compression), sdf (One of a family of chemical-data file formats developed by MDL Information Systems), smi (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), smiles (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), txt (Textual format), xml (eXtensible Markup Language), xtc (Portable binary format for trajectories produced by GROMACS package).

    • output_format (str) - (None) Format of output file. If not provided, output_path extension will be taken. Values: ent (Protein Data Bank format), fa (FASTA sequence format), fasta (FASTA sequence format), gro (GROMACS structure), inp (AMBER trajectory format), mcif (Entry format of PDB database in mmCIF format), mdl (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mmcif (Entry format of PDB database in mmCIF format), mol (file format for holding information about the atoms; bonds; connectivity and coordinates of a molecule), mol2 (Complete and portable representation of a SYBYL molecule), pdb (Protein Data Bank format), pdbqt (Protein Data Bank format with charges), png (File format for image compression), sdf (One of a family of chemical-data file formats developed by MDL Information Systems), smi (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), smiles (Chemical structure specified in Simplified Molecular Input Line Entry System line notation.), txt (Textual format), xtc (Portable binary format for trajectories produced by GROMACS package).

    • coordinates (int) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).

    • ph (float) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.

    • binary_path (str) - (“obabel”) Path to the obabel 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) Container path definition.

    • container_image (str) - (‘informaticsmatters/obabel:latest’) Container image definition.

    • container_volume_path (str) - (‘/tmp’) Container volume path definition.

    • container_working_dir (str) - (None) Container working directory definition.

    • container_user_id (str) - (None) Container user_id definition.

    • container_shell_path (str) - (‘/bin/bash’) Path to default shell inside the container.

Examples

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

from biobb_chemistry.babelm.babel_remove_hydrogens import babel_remove_hydrogens
prop = {
    'input_format': 'pdb',
    'output_format': 'pdb',
    'coordinates': 3,
    'ph': 7.4
}
babel_remove_hydrogens(input_path='/path/to/myStructure.pdb',
                        output_path='/path/to/newStructure.pdb',
                        properties=prop)
Info:
check_data_params(out_log, err_log)[source]

Checks all the input/output paths and parameters

create_cmd(container_io_dict, out_log, err_log)[source]

Creates the command line instruction using the properties file settings

launch() int[source]

Execute the BabelRemoveHydrogens babelm.babel_remove_hydrogens.BabelRemoveHydrogens object.

babelm.babel_remove_hydrogens.babel_remove_hydrogens(input_path: str, output_path: str, properties: dict | None = None, **kwargs) int[source]

Execute the BabelRemoveHydrogens class and execute the launch() method.

babelm.babel_remove_hydrogens.main()[source]

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