diff --git a/coverage/class_index.html b/coverage/class_index.html
index 86473d95..c3e77595 100644
--- a/coverage/class_index.html
+++ b/coverage/class_index.html
@@ -11,7 +11,7 @@
Coverage report:
- 95%
+ 81%
@@ -64,8 +64,8 @@
20 properties (dic - Python dictionary object containing the tool parameters, not input/output files):
21 * **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).
22 * **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).
-23 * **coordinates** (*int*) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).
-24 * **ph** (*float*) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.
-25 * **binary_path** (*str*) - ("obabel") Path to the obabel executable binary.
-26 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
-27 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
-28 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
-29 * **container_path** (*str*) - (None) Container path definition.
-30 * **container_image** (*str*) - ('informaticsmatters/obabel:latest') Container image definition.
-31 * **container_volume_path** (*str*) - ('/tmp') Container volume path definition.
-32 * **container_working_dir** (*str*) - (None) Container working directory definition.
-33 * **container_user_id** (*str*) - (None) Container user_id definition.
-34 * **container_shell_path** (*str*) - ('/bin/bash') Path to default shell inside the container.
- -36 Examples:
-37 This is a use example of how to use the building block from Python::
+23 * **fs_input** (*list*) - (None) Format-specific input options. Values: b (disable automatic bonding), d (input file is in dlg -AutoDock docking log- format).
+24 * **fs_output** (*list*) - (["h"]) Format-specific output options. Values: b (enable automatic bonding), r (output as a rigid molecule), c (combine separate molecular pieces of input into a single rigid molecule), s (output as a flexible residue), p (preserve atom indices from input file), h (preserve hydrogens), n (preserve atom names).
+25 * **coordinates** (*int*) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).
+26 * **effort** (*str*) - ("medium") Computational effort wanted to dedicate for the conformer generation coordinates calculations, only for 3D coordinates. Values: fastest (only generate coordinates, no force field or conformer search), fast (perform quick forcefield optimization), medium (forcefield optimization + fast conformer search), better (more optimization + fast conformer search), best (more optimization + significant conformer search).
+27 * **ph** (*float*) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.
+28 * **binary_path** (*str*) - ("obabel") Path to the obabel executable binary.
+29 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
+30 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
+31 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
+32 * **container_path** (*str*) - (None) Container path definition.
+33 * **container_image** (*str*) - ('informaticsmatters/obabel:latest') Container image definition.
+34 * **container_volume_path** (*str*) - ('/tmp') Container volume path definition.
+35 * **container_working_dir** (*str*) - (None) Container working directory definition.
+36 * **container_user_id** (*str*) - (None) Container user_id definition.
+37 * **container_shell_path** (*str*) - ('/bin/bash') Path to default shell inside the container.
-39 from biobb_chemistry.babelm.babel_add_hydrogens import babel_add_hydrogens
-40 prop = {
-41 'input_format': 'pdb',
-42 'output_format': 'pdb',
-43 'coordinates': 3,
-44 'ph': 7.4
-45 }
-46 babel_add_hydrogens(input_path='/path/to/myStructure.pdb',
-47 output_path='/path/to/newStructure.pdb',
-48 properties=prop)
- -50 Info:
-51 * wrapped_software:
-52 * name: Open Babel
-53 * version: 2.4.1
-54 * license: GNU
-55 * ontology:
-56 * name: EDAM
-57 * schema: http://edamontology.org/EDAM.owl
- -59 """
- -61 def __init__(self, input_path, output_path,
-62 properties=None, **kwargs) -> None:
-63 properties = properties or {}
- -65 # Call parent class constructor
-66 super().__init__(properties)
-67 self.locals_var_dict = locals().copy()
- -69 # Input/Output files
-70 self.io_dict = {
-71 "in": {"input_path": input_path},
-72 "out": {"output_path": output_path}
-73 }
- -75 # Properties specific for BB
-76 self.input_format = properties.get('input_format', '')
-77 self.output_format = properties.get('output_format', '')
-78 self.coordinates = properties.get('coordinates', '')
-79 self.ph = properties.get('ph', '')
-80 self.binary_path = properties.get('binary_path', 'obabel')
-81 self.properties = properties
- -83 # Check the properties
-84 self.check_properties(properties)
-85 self.check_arguments()
- -87 def check_data_params(self, out_log, err_log):
-88 """ Checks all the input/output paths and parameters """
-89 self.io_dict["in"]["input_path"] = check_input_path(self.io_dict["in"]["input_path"], out_log, self.__class__.__name__)
-90 self.io_dict["out"]["output_path"] = check_output_path(self.io_dict["out"]["output_path"], out_log, self.__class__.__name__)
- -92 def create_cmd(self, container_io_dict, out_log, err_log):
-93 """Creates the command line instruction using the properties file settings"""
-94 instructions_list = []
- -96 # executable path
-97 instructions_list.append(self.binary_path)
- -99 # generating input
-100 infr = get_input_format(self.input_format, container_io_dict["in"]["input_path"], out_log)
-101 iformat = '-i' + infr
-102 instructions_list.append(iformat)
-103 ipath = container_io_dict["in"]["input_path"]
-104 instructions_list.append(ipath)
- -106 # generating output
-107 oufr = get_output_format(self.output_format, container_io_dict["out"]["output_path"], out_log)
-108 oformat = '-o' + oufr
-109 instructions_list.append(oformat)
-110 opath = '-O' + container_io_dict["out"]["output_path"]
-111 instructions_list.append(opath)
- -113 # adding coordinates
-114 crd = get_coordinates(self.coordinates, out_log)
-115 coordinates = ''
-116 if crd:
-117 coordinates = '--gen' + crd + 'd'
+39 Examples:
+40 This is a use example of how to use the building block from Python::
+ +42 from biobb_chemistry.babelm.babel_add_hydrogens import babel_add_hydrogens
+43 prop = {
+44 'input_format': 'pdb',
+45 'output_format': 'pdb',
+46 'coordinates': 3,
+47 'ph': 7.4
+48 }
+49 babel_add_hydrogens(input_path='/path/to/myStructure.pdb',
+50 output_path='/path/to/newStructure.pdb',
+51 properties=prop)
+ +53 Info:
+54 * wrapped_software:
+55 * name: Open Babel
+56 * version: 2.4.1
+57 * license: GNU
+58 * ontology:
+59 * name: EDAM
+60 * schema: http://edamontology.org/EDAM.owl
+ +62 """
+ +64 def __init__(self, input_path, output_path,
+65 properties=None, **kwargs) -> None:
+66 properties = properties or {}
+ +68 # Call parent class constructor
+69 super().__init__(properties)
+70 self.locals_var_dict = locals().copy()
+ +72 # Input/Output files
+73 self.io_dict = {
+74 "in": {"input_path": input_path},
+75 "out": {"output_path": output_path}
+76 }
+ +78 # Properties specific for BB
+79 self.input_format = properties.get('input_format', '')
+80 self.output_format = properties.get('output_format', '')
+81 self.fs_input = properties.get('fs_input', None)
+82 self.fs_output = properties.get('fs_output', ["h"])
+83 self.coordinates = properties.get('coordinates', '')
+84 self.effort = properties.get('effort', 'medium')
+85 self.ph = properties.get('ph', '')
+86 self.binary_path = properties.get('binary_path', 'obabel')
+87 self.properties = properties
+ +89 # Check the properties
+90 self.check_properties(properties)
+91 self.check_arguments()
+ +93 def check_data_params(self, out_log, err_log):
+94 """ Checks all the input/output paths and parameters """
+95 self.io_dict["in"]["input_path"] = check_input_path(self.io_dict["in"]["input_path"], out_log, self.__class__.__name__)
+96 self.io_dict["out"]["output_path"] = check_output_path(self.io_dict["out"]["output_path"], out_log, self.__class__.__name__)
+ +98 def create_cmd(self, container_io_dict, out_log, err_log):
+99 """Creates the command line instruction using the properties file settings"""
+100 instructions_list = []
+ +102 # executable path
+103 instructions_list.append(self.binary_path)
+ +105 # generating input
+106 infr = get_input_format(self.input_format, container_io_dict["in"]["input_path"], out_log)
+107 iformat = '-i' + infr
+108 instructions_list.append(iformat)
+109 ipath = container_io_dict["in"]["input_path"]
+110 instructions_list.append(ipath)
+ +112 # generating output
+113 oufr = get_output_format(self.output_format, container_io_dict["out"]["output_path"], out_log)
+114 oformat = '-o' + oufr
+115 instructions_list.append(oformat)
+116 opath = '-O' + container_io_dict["out"]["output_path"]
+117 instructions_list.append(opath)
-119 instructions_list.append(coordinates)
- -121 # checking pH
-122 p = get_ph(self.ph, out_log)
- -124 # adding H
-125 hydrogens = '-h'
- -127 # adding pH
-128 ph = ''
-129 if p:
-130 ph = '-p ' + p
-131 instructions_list.append(ph)
-132 else:
-133 instructions_list.append(hydrogens)
- -135 return instructions_list
- -137 @launchlogger
-138 def launch(self) -> int:
-139 """Execute the :class:`BabelAddHydrogens <babelm.babel_add_hydrogens.BabelAddHydrogens>` babelm.babel_add_hydrogens.BabelAddHydrogens object."""
- -141 # check input/output paths and parameters
-142 self.check_data_params(self.out_log, self.err_log)
- -144 # Setup Biobb
-145 if self.check_restart():
-146 return 0
-147 self.stage_files()
- -149 # create command line instruction
-150 self.cmd = self.create_cmd(self.stage_io_dict, self.out_log, self.err_log)
- -152 # Run Biobb block
-153 self.run_biobb()
- -155 # Copy files to host
-156 self.copy_to_host()
- -158 # remove temporary folder(s)
-159 self.tmp_files.extend([
-160 self.stage_io_dict.get("unique_dir")
-161 ])
-162 self.remove_tmp_files()
- -164 self.check_arguments(output_files_created=True, raise_exception=False)
- -166 return self.return_code
+119 # adding coordinates
+120 crd = get_coordinates(self.coordinates, out_log)
+121 coordinates = ''
+122 if crd:
+123 coordinates = '--gen' + crd + 'd'
+124 instructions_list.append(coordinates)
+ +126 # checking pH
+127 p = get_ph(self.ph, out_log)
+ +129 # adding H
+130 hydrogens = '-h'
+ +132 # adding pH
+133 ph = ''
+134 if p:
+135 ph = '-p ' + p
+136 instructions_list.append(ph)
+137 else:
+138 instructions_list.append(hydrogens)
+ +140 # fs_input
+141 if self.fs_input is not None:
+142 for fsi in self.fs_input:
+143 instructions_list.append('-a' + fsi)
+ +145 # fs_output
+146 if self.fs_output is not None:
+147 for fso in self.fs_output:
+148 instructions_list.append('-x' + fso)
+ +150 # adding effort (only for 3D coordinates)
+151 if crd == '3':
+152 instructions_list.append('--' + self.effort)
+ +154 return instructions_list
+ +156 @launchlogger
+157 def launch(self) -> int:
+158 """Execute the :class:`BabelAddHydrogens <babelm.babel_add_hydrogens.BabelAddHydrogens>` babelm.babel_add_hydrogens.BabelAddHydrogens object."""
+ +160 # check input/output paths and parameters
+161 self.check_data_params(self.out_log, self.err_log)
+ +163 # Setup Biobb
+164 if self.check_restart():
+165 return 0
+166 self.stage_files()
- -169def babel_add_hydrogens(input_path: str, output_path: str, properties: dict = None, **kwargs) -> int:
-170 """Execute the :class:`BabelAddHydrogens <babelm.babel_add_hydrogens.BabelAddHydrogens>` class and
-171 execute the :meth:`launch() <babelm.babel_add_hydrogens.BabelAddHydrogens.launch>` method."""
- -173 return BabelAddHydrogens(input_path=input_path,
-174 output_path=output_path,
-175 properties=properties, **kwargs).launch()
+168 # create command line instruction
+169 self.cmd = self.create_cmd(self.stage_io_dict, self.out_log, self.err_log)
+ +171 # Run Biobb block
+172 self.run_biobb()
+ +174 # Copy files to host
+175 self.copy_to_host()
- -178def main():
-179 """Command line execution of this building block. Please check the command line documentation."""
-180 parser = argparse.ArgumentParser(description="Adds hydrogen atoms to small molecules.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
-181 parser.add_argument('--config', required=False, help='Configuration file')
+177 # remove temporary folder(s)
+178 self.tmp_files.extend([
+179 self.stage_io_dict.get("unique_dir")
+180 ])
+181 self.remove_tmp_files()
-183 # Specific args of each building block
-184 required_args = parser.add_argument_group('required arguments')
-185 required_args.add_argument('--input_path', required=True, help='Path to the input file. Accepted formats: dat, ent, fa, fasta, gro, inp, log, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt, xml, xtc.')
-186 required_args.add_argument('--output_path', required=True, help='Path to the output file. Accepted formats: ent, fa, fasta, gro, inp, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt.')
+183 self.check_arguments(output_files_created=True, raise_exception=False)
+ +185 return self.return_code
+ -188 args = parser.parse_args()
-189 args.config = args.config or "{}"
-190 properties = settings.ConfReader(config=args.config).get_prop_dic()
+188def babel_add_hydrogens(input_path: str, output_path: str, properties: dict = None, **kwargs) -> int:
+189 """Execute the :class:`BabelAddHydrogens <babelm.babel_add_hydrogens.BabelAddHydrogens>` class and
+190 execute the :meth:`launch() <babelm.babel_add_hydrogens.BabelAddHydrogens.launch>` method."""
-192 # Specific call of each building block
-193 babel_add_hydrogens(input_path=args.input_path,
-194 output_path=args.output_path,
-195 properties=properties)
+192 return BabelAddHydrogens(input_path=input_path,
+193 output_path=output_path,
+194 properties=properties, **kwargs).launch()
+ - -198if __name__ == '__main__':
-199 main()
+197def main():
+198 """Command line execution of this building block. Please check the command line documentation."""
+199 parser = argparse.ArgumentParser(description="Adds hydrogen atoms to small molecules.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
+200 parser.add_argument('--config', required=False, help='Configuration file')
+ +202 # Specific args of each building block
+203 required_args = parser.add_argument_group('required arguments')
+204 required_args.add_argument('--input_path', required=True, help='Path to the input file. Accepted formats: dat, ent, fa, fasta, gro, inp, log, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt, xml, xtc.')
+205 required_args.add_argument('--output_path', required=True, help='Path to the output file. Accepted formats: ent, fa, fasta, gro, inp, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt.')
+ +207 args = parser.parse_args()
+208 args.config = args.config or "{}"
+209 properties = settings.ConfReader(config=args.config).get_prop_dic()
+ +211 # Specific call of each building block
+212 babel_add_hydrogens(input_path=args.input_path,
+213 output_path=args.output_path,
+214 properties=properties)
+ + +217if __name__ == '__main__':
+218 main()
diff --git a/coverage/z_8e6f3ef91f4b94fc_babel_convert_py.html b/coverage/z_8e6f3ef91f4b94fc_babel_convert_py.html index c37c4e83..3cee9a0f 100644 --- a/coverage/z_8e6f3ef91f4b94fc_babel_convert_py.html +++ b/coverage/z_8e6f3ef91f4b94fc_babel_convert_py.html @@ -2,7 +2,7 @@ -@@ -64,8 +64,8 @@
20 properties (dic - Python dictionary object containing the tool parameters, not input/output files):
21 * **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).
22 * **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).
-23 * **coordinates** (*int*) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).
-24 * **ph** (*float*) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.
-25 * **flex** (*bool*) - (False) Remove all but the largest contiguous fragment (strip salts).
-26 * **binary_path** (*str*) - ("obabel") Path to the obabel executable binary.
-27 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
-28 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
-29 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
-30 * **container_path** (*str*) - (None) Container path definition.
-31 * **container_image** (*str*) - ('informaticsmatters/obabel:latest') Container image definition.
-32 * **container_volume_path** (*str*) - ('/tmp') Container volume path definition.
-33 * **container_working_dir** (*str*) - (None) Container working directory definition.
-34 * **container_user_id** (*str*) - (None) Container user_id definition.
-35 * **container_shell_path** (*str*) - ('/bin/bash') Path to default shell inside the container.
- -37 Examples:
-38 This is a use example of how to use the building block from Python::
+23 * **fs_input** (*list*) - (None) Format-specific input options. Values: b (disable automatic bonding), d (input file is in dlg -AutoDock docking log- format).
+24 * **fs_output** (*list*) - (None) Format-specific output options. Values: b (enable automatic bonding), r (output as a rigid molecule), c (combine separate molecular pieces of input into a single rigid molecule), s (output as a flexible residue), p (preserve atom indices from input file), h (preserve hydrogens), n (preserve atom names).
+25 * **coordinates** (*int*) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).
+26 * **effort** (*str*) - ("medium") Computational effort wanted to dedicate for the conformer generation coordinates calculations, only for 3D coordinates. Values: fastest (only generate coordinates, no force field or conformer search), fast (perform quick forcefield optimization), medium (forcefield optimization + fast conformer search), better (more optimization + fast conformer search), best (more optimization + significant conformer search).
+27 * **ph** (*float*) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.
+28 * **flex** (*bool*) - (False) Remove all but the largest contiguous fragment (strip salts).
+29 * **binary_path** (*str*) - ("obabel") Path to the obabel executable binary.
+30 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
+31 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
+32 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
+33 * **container_path** (*str*) - (None) Container path definition.
+34 * **container_image** (*str*) - ('informaticsmatters/obabel:latest') Container image definition.
+35 * **container_volume_path** (*str*) - ('/tmp') Container volume path definition.
+36 * **container_working_dir** (*str*) - (None) Container working directory definition.
+37 * **container_user_id** (*str*) - (None) Container user_id definition.
+38 * **container_shell_path** (*str*) - ('/bin/bash') Path to default shell inside the container.
-40 from biobb_chemistry.babelm.babel_convert import babel_convert
-41 prop = {
-42 'input_format': 'smi',
-43 'output_format': 'mol2',
-44 'coordinates': 3,
-45 'ph': 7.4
-46 }
-47 babel_convert(input_path='/path/to/my2DMolecule.smi',
-48 output_path='/path/to/new3DMolecule.mol2',
-49 properties=prop)
- -51 Info:
-52 * wrapped_software:
-53 * name: Open Babel
-54 * version: 2.4.1
-55 * license: GNU
-56 * ontology:
-57 * name: EDAM
-58 * schema: http://edamontology.org/EDAM.owl
- -60 """
- -62 def __init__(self, input_path, output_path,
-63 properties=None, **kwargs) -> None:
-64 properties = properties or {}
- -66 # Call parent class constructor
-67 super().__init__(properties)
-68 self.locals_var_dict = locals().copy()
- -70 # Input/Output files
-71 self.io_dict = {
-72 "in": {"input_path": input_path},
-73 "out": {"output_path": output_path}
-74 }
- -76 # Properties specific for BB
-77 self.input_format = properties.get('input_format', '')
-78 self.output_format = properties.get('output_format', '')
-79 self.coordinates = properties.get('coordinates', '')
-80 self.ph = properties.get('ph', '')
-81 self.flex = properties.get('flex', False)
-82 self.binary_path = properties.get('binary_path', 'obabel')
-83 self.properties = properties
- -85 # Check the properties
-86 self.check_properties(properties)
-87 self.check_arguments()
- -89 def check_data_params(self, out_log, err_log):
-90 """ Checks all the input/output paths and parameters """
-91 self.io_dict["in"]["input_path"] = check_input_path(self.io_dict["in"]["input_path"], out_log, self.__class__.__name__)
-92 self.io_dict["out"]["output_path"] = check_output_path(self.io_dict["out"]["output_path"], out_log, self.__class__.__name__)
- -94 def create_cmd(self, container_io_dict, out_log, err_log):
-95 """Creates the command line instruction using the properties file settings"""
-96 instructions_list = []
- -98 # executable path
-99 instructions_list.append(self.binary_path)
- -101 # generating input
-102 infr = get_input_format(self.input_format, container_io_dict["in"]["input_path"], out_log)
-103 iformat = '-i' + infr
-104 instructions_list.append(iformat)
-105 ipath = container_io_dict["in"]["input_path"]
-106 instructions_list.append(ipath)
- -108 # generating output
-109 oufr = get_output_format(self.output_format, container_io_dict["out"]["output_path"], out_log)
-110 oformat = '-o' + oufr
-111 instructions_list.append(oformat)
-112 opath = '-O' + container_io_dict["out"]["output_path"]
-113 instructions_list.append(opath)
- -115 # adding coordinates
-116 crd = get_coordinates(self.coordinates, out_log)
-117 coordinates = ''
-118 if crd:
-119 coordinates = '--gen' + crd + 'd'
+40 Examples:
+41 This is a use example of how to use the building block from Python::
+ +43 from biobb_chemistry.babelm.babel_convert import babel_convert
+44 prop = {
+45 'input_format': 'smi',
+46 'output_format': 'mol2',
+47 'coordinates': 3,
+48 'ph': 7.4
+49 }
+50 babel_convert(input_path='/path/to/my2DMolecule.smi',
+51 output_path='/path/to/new3DMolecule.mol2',
+52 properties=prop)
+ +54 Info:
+55 * wrapped_software:
+56 * name: Open Babel
+57 * version: 2.4.1
+58 * license: GNU
+59 * ontology:
+60 * name: EDAM
+61 * schema: http://edamontology.org/EDAM.owl
+ +63 """
+ +65 def __init__(self, input_path, output_path,
+66 properties=None, **kwargs) -> None:
+67 properties = properties or {}
+ +69 # Call parent class constructor
+70 super().__init__(properties)
+71 self.locals_var_dict = locals().copy()
+ +73 # Input/Output files
+74 self.io_dict = {
+75 "in": {"input_path": input_path},
+76 "out": {"output_path": output_path}
+77 }
+ +79 # Properties specific for BB
+80 self.input_format = properties.get('input_format', '')
+81 self.output_format = properties.get('output_format', '')
+82 self.fs_input = properties.get('fs_input', None)
+83 self.fs_output = properties.get('fs_output', None)
+84 self.coordinates = properties.get('coordinates', '')
+85 self.effort = properties.get('effort', 'medium')
+86 self.ph = properties.get('ph', '')
+87 self.flex = properties.get('flex', False)
+88 self.binary_path = properties.get('binary_path', 'obabel')
+89 self.properties = properties
+ +91 # Check the properties
+92 self.check_properties(properties)
+93 self.check_arguments()
+ +95 def check_data_params(self, out_log, err_log):
+96 """ Checks all the input/output paths and parameters """
+97 self.io_dict["in"]["input_path"] = check_input_path(self.io_dict["in"]["input_path"], out_log, self.__class__.__name__)
+98 self.io_dict["out"]["output_path"] = check_output_path(self.io_dict["out"]["output_path"], out_log, self.__class__.__name__)
+ +100 def create_cmd(self, container_io_dict, out_log, err_log):
+101 """Creates the command line instruction using the properties file settings"""
+102 instructions_list = []
+ +104 # executable path
+105 instructions_list.append(self.binary_path)
+ +107 # generating input
+108 infr = get_input_format(self.input_format, container_io_dict["in"]["input_path"], out_log)
+109 iformat = '-i' + infr
+110 instructions_list.append(iformat)
+111 ipath = container_io_dict["in"]["input_path"]
+112 instructions_list.append(ipath)
+ +114 # generating output
+115 oufr = get_output_format(self.output_format, container_io_dict["out"]["output_path"], out_log)
+116 oformat = '-o' + oufr
+117 instructions_list.append(oformat)
+118 opath = '-O' + container_io_dict["out"]["output_path"]
+119 instructions_list.append(opath)
-121 instructions_list.append(coordinates)
- -123 # adding pH
-124 p = get_ph(self.ph, out_log)
-125 ph = ''
-126 if p:
-127 ph = '-p ' + p
- -129 instructions_list.append(ph)
- -131 # flex
-132 flex = ''
-133 if not self.flex:
-134 flex = '-r'
- -136 instructions_list.append(flex)
- -138 return instructions_list
- -140 @launchlogger
-141 def launch(self) -> int:
-142 """Execute the :class:`BabelConvert <babelm.babel_convert.BabelConvert>` babelm.babel_convert.BabelConvert object."""
- -144 # check input/output paths and parameters
-145 self.check_data_params(self.out_log, self.err_log)
- -147 # Setup Biobb
-148 if self.check_restart():
-149 return 0
-150 self.stage_files()
- -152 # create command line instruction
-153 self.cmd = self.create_cmd(self.stage_io_dict, self.out_log, self.err_log)
+121 # adding coordinates
+122 crd = get_coordinates(self.coordinates, out_log)
+123 coordinates = ''
+124 if crd:
+125 coordinates = '--gen' + crd + 'd'
+126 instructions_list.append(coordinates)
+ +128 # adding pH
+129 p = get_ph(self.ph, out_log)
+130 ph = ''
+131 if p:
+132 ph = '-p ' + p
+133 instructions_list.append(ph)
+ +135 # flex
+136 flex = ''
+137 if not self.flex:
+138 flex = '-r'
+139 instructions_list.append(flex)
+ +141 # fs_input
+142 if self.fs_input is not None:
+143 for fsi in self.fs_input:
+144 instructions_list.append('-a' + fsi)
+ +146 # fs_output
+147 if self.fs_output is not None:
+148 for fso in self.fs_output:
+149 instructions_list.append('-x' + fso)
+ +151 # adding effort (only for 3D coordinates)
+152 if crd == '3':
+153 instructions_list.append('--' + self.effort)
-155 # Run Biobb block
-156 self.run_biobb()
- -158 # Copy files to host
-159 self.copy_to_host()
+155 return instructions_list
+ +157 @launchlogger
+158 def launch(self) -> int:
+159 """Execute the :class:`BabelConvert <babelm.babel_convert.BabelConvert>` babelm.babel_convert.BabelConvert object."""
-161 # remove temporary folder(s)
-162 self.tmp_files.extend([
-163 self.stage_io_dict.get("unique_dir")
-164 ])
-165 self.remove_tmp_files()
- -167 self.check_arguments(output_files_created=True, raise_exception=False)
+161 # check input/output paths and parameters
+162 self.check_data_params(self.out_log, self.err_log)
+ +164 # Setup Biobb
+165 if self.check_restart():
+166 return 0
+167 self.stage_files()
-169 return self.return_code
- +169 # create command line instruction
+170 self.cmd = self.create_cmd(self.stage_io_dict, self.out_log, self.err_log)
-172def babel_convert(input_path: str, output_path: str, properties: dict = None, **kwargs) -> int:
-173 """Execute the :class:`BabelConvert <babelm.babel_convert.BabelConvert>` class and
-174 execute the :meth:`launch() <babelm.babel_convert.BabelConvert.launch>` method."""
- -176 return BabelConvert(input_path=input_path,
-177 output_path=output_path,
-178 properties=properties, **kwargs).launch()
- - -181def main():
-182 """Command line execution of this building block. Please check the command line documentation."""
-183 parser = argparse.ArgumentParser(description="Small molecule format conversion.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
-184 parser.add_argument('--config', required=False, help='Configuration file')
+172 # Run Biobb block
+173 self.run_biobb()
+ +175 # Copy files to host
+176 self.copy_to_host()
+ +178 # remove temporary folder(s)
+179 self.tmp_files.extend([
+180 self.stage_io_dict.get("unique_dir")
+181 ])
+182 self.remove_tmp_files()
+ +184 self.check_arguments(output_files_created=True, raise_exception=False)
-186 # Specific args of each building block
-187 required_args = parser.add_argument_group('required arguments')
-188 required_args.add_argument('--input_path', required=True, help='Path to the input file. Accepted formats: dat, ent, fa, fasta, gro, inp, log, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt, xml, xtc.')
-189 required_args.add_argument('--output_path', required=True, help='Path to the output file. Accepted formats: ent, fa, fasta, gro, inp, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt.')
- -191 args = parser.parse_args()
-192 args.config = args.config or "{}"
-193 properties = settings.ConfReader(config=args.config).get_prop_dic()
- -195 # Specific call of each building block
-196 babel_convert(input_path=args.input_path,
-197 output_path=args.output_path,
-198 properties=properties)
- - -201if __name__ == '__main__':
-202 main()
+186 return self.return_code
+ + +189def babel_convert(input_path: str, output_path: str, properties: dict = None, **kwargs) -> int:
+190 """Execute the :class:`BabelConvert <babelm.babel_convert.BabelConvert>` class and
+191 execute the :meth:`launch() <babelm.babel_convert.BabelConvert.launch>` method."""
+ +193 return BabelConvert(input_path=input_path,
+194 output_path=output_path,
+195 properties=properties, **kwargs).launch()
+ + +198def main():
+199 """Command line execution of this building block. Please check the command line documentation."""
+200 parser = argparse.ArgumentParser(description="Small molecule format conversion.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
+201 parser.add_argument('--config', required=False, help='Configuration file')
+ +203 # Specific args of each building block
+204 required_args = parser.add_argument_group('required arguments')
+205 required_args.add_argument('--input_path', required=True, help='Path to the input file. Accepted formats: dat, ent, fa, fasta, gro, inp, log, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt, xml, xtc.')
+206 required_args.add_argument('--output_path', required=True, help='Path to the output file. Accepted formats: ent, fa, fasta, gro, inp, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt.')
+ +208 args = parser.parse_args()
+209 args.config = args.config or "{}"
+210 properties = settings.ConfReader(config=args.config).get_prop_dic()
+ +212 # Specific call of each building block
+213 babel_convert(input_path=args.input_path,
+214 output_path=args.output_path,
+215 properties=properties)
+ + +218if __name__ == '__main__':
+219 main()
diff --git a/coverage/z_8e6f3ef91f4b94fc_babel_minimize_py.html b/coverage/z_8e6f3ef91f4b94fc_babel_minimize_py.html index f730e72a..1fc758d9 100644 --- a/coverage/z_8e6f3ef91f4b94fc_babel_minimize_py.html +++ b/coverage/z_8e6f3ef91f4b94fc_babel_minimize_py.html @@ -64,8 +64,8 @@@@ -64,8 +64,8 @@
20 properties (dic - Python dictionary object containing the tool parameters, not input/output files):
21 * **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).
22 * **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).
-23 * **coordinates** (*int*) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).
-24 * **ph** (*float*) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.
-25 * **binary_path** (*str*) - ("obabel") Path to the obabel executable binary.
-26 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
-27 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
-28 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
-29 * **container_path** (*str*) - (None) Container path definition.
-30 * **container_image** (*str*) - ('informaticsmatters/obabel:latest') Container image definition.
-31 * **container_volume_path** (*str*) - ('/tmp') Container volume path definition.
-32 * **container_working_dir** (*str*) - (None) Container working directory definition.
-33 * **container_user_id** (*str*) - (None) Container user_id definition.
-34 * **container_shell_path** (*str*) - ('/bin/bash') Path to default shell inside the container.
- -36 Examples:
-37 This is a use example of how to use the building block from Python::
+23 * **fs_input** (*list*) - (None) Format-specific input options. Values: b (disable automatic bonding), d (input file is in dlg -AutoDock docking log- format).
+24 * **fs_output** (*list*) - (None) Format-specific output options. Values: b (enable automatic bonding), r (output as a rigid molecule), c (combine separate molecular pieces of input into a single rigid molecule), s (output as a flexible residue), p (preserve atom indices from input file), h (preserve hydrogens), n (preserve atom names).
+25 * **coordinates** (*int*) - (None) Type of coordinates: 2D or 3D. Values: 2 (2D coordinates), 3 (3D coordinates).
+26 * **effort** (*str*) - ("medium") Computational effort wanted to dedicate for the conformer generation coordinates calculations, only for 3D coordinates. Values: fastest (only generate coordinates, no force field or conformer search), fast (perform quick forcefield optimization), medium (forcefield optimization + fast conformer search), better (more optimization + fast conformer search), best (more optimization + significant conformer search).
+27 * **ph** (*float*) - (7.4) [0~14|0.1] Add hydrogens appropriate for pH.
+28 * **binary_path** (*str*) - ("obabel") Path to the obabel executable binary.
+29 * **remove_tmp** (*bool*) - (True) [WF property] Remove temporal files.
+30 * **restart** (*bool*) - (False) [WF property] Do not execute if output files exist.
+31 * **sandbox_path** (*str*) - ("./") [WF property] Parent path to the sandbox directory.
+32 * **container_path** (*str*) - (None) Container path definition.
+33 * **container_image** (*str*) - ('informaticsmatters/obabel:latest') Container image definition.
+34 * **container_volume_path** (*str*) - ('/tmp') Container volume path definition.
+35 * **container_working_dir** (*str*) - (None) Container working directory definition.
+36 * **container_user_id** (*str*) - (None) Container user_id definition.
+37 * **container_shell_path** (*str*) - ('/bin/bash') Path to default shell inside the container.
-39 from biobb_chemistry.babelm.babel_remove_hydrogens import babel_remove_hydrogens
-40 prop = {
-41 'input_format': 'pdb',
-42 'output_format': 'pdb',
-43 'coordinates': 3,
-44 'ph': 7.4
-45 }
-46 babel_remove_hydrogens(input_path='/path/to/myStructure.pdb',
-47 output_path='/path/to/newStructure.pdb',
-48 properties=prop)
- -50 Info:
-51 * wrapped_software:
-52 * name: Open Babel
-53 * version: 2.4.1
-54 * license: GNU
-55 * ontology:
-56 * name: EDAM
-57 * schema: http://edamontology.org/EDAM.owl
- -59 """
- -61 def __init__(self, input_path, output_path,
-62 properties=None, **kwargs) -> None:
-63 properties = properties or {}
- -65 # Call parent class constructor
-66 super().__init__(properties)
-67 self.locals_var_dict = locals().copy()
- -69 # Input/Output files
-70 self.io_dict = {
-71 "in": {"input_path": input_path},
-72 "out": {"output_path": output_path}
-73 }
- -75 # Properties specific for BB
-76 self.input_format = properties.get('input_format', '')
-77 self.output_format = properties.get('output_format', '')
-78 self.coordinates = properties.get('coordinates', '')
-79 self.ph = properties.get('ph', '')
-80 self.binary_path = properties.get('binary_path', 'obabel')
-81 self.properties = properties
- -83 # Check the properties
-84 self.check_properties(properties)
-85 self.check_arguments()
- -87 def check_data_params(self, out_log, err_log):
-88 """ Checks all the input/output paths and parameters """
-89 self.io_dict["in"]["input_path"] = check_input_path(self.io_dict["in"]["input_path"], out_log, self.__class__.__name__)
-90 self.io_dict["out"]["output_path"] = check_output_path(self.io_dict["out"]["output_path"], out_log, self.__class__.__name__)
- -92 def create_cmd(self, container_io_dict, out_log, err_log):
-93 """Creates the command line instruction using the properties file settings"""
-94 instructions_list = []
- -96 # executable path
-97 instructions_list.append(self.binary_path)
- -99 # generating input
-100 infr = get_input_format(self.input_format, container_io_dict["in"]["input_path"], out_log)
-101 iformat = '-i' + infr
-102 instructions_list.append(iformat)
-103 ipath = container_io_dict["in"]["input_path"]
-104 instructions_list.append(ipath)
- -106 # generating output
-107 oufr = get_output_format(self.output_format, container_io_dict["out"]["output_path"], out_log)
-108 oformat = '-o' + oufr
-109 instructions_list.append(oformat)
-110 opath = '-O' + container_io_dict["out"]["output_path"]
-111 instructions_list.append(opath)
- -113 # adding coordinates
-114 crd = get_coordinates(self.coordinates, out_log)
-115 coordinates = ''
-116 if crd:
-117 coordinates = '--gen' + crd + 'd'
+39 Examples:
+40 This is a use example of how to use the building block from Python::
+ +42 from biobb_chemistry.babelm.babel_remove_hydrogens import babel_remove_hydrogens
+43 prop = {
+44 'input_format': 'pdb',
+45 'output_format': 'pdb',
+46 'coordinates': 3,
+47 'ph': 7.4
+48 }
+49 babel_remove_hydrogens(input_path='/path/to/myStructure.pdb',
+50 output_path='/path/to/newStructure.pdb',
+51 properties=prop)
+ +53 Info:
+54 * wrapped_software:
+55 * name: Open Babel
+56 * version: 2.4.1
+57 * license: GNU
+58 * ontology:
+59 * name: EDAM
+60 * schema: http://edamontology.org/EDAM.owl
+ +62 """
+ +64 def __init__(self, input_path, output_path,
+65 properties=None, **kwargs) -> None:
+66 properties = properties or {}
+ +68 # Call parent class constructor
+69 super().__init__(properties)
+70 self.locals_var_dict = locals().copy()
+ +72 # Input/Output files
+73 self.io_dict = {
+74 "in": {"input_path": input_path},
+75 "out": {"output_path": output_path}
+76 }
+ +78 # Properties specific for BB
+79 self.input_format = properties.get('input_format', '')
+80 self.output_format = properties.get('output_format', '')
+81 self.fs_input = properties.get('fs_input', None)
+82 self.fs_output = properties.get('fs_output', None)
+83 self.coordinates = properties.get('coordinates', '')
+84 self.effort = properties.get('effort', 'medium')
+85 self.ph = properties.get('ph', '')
+86 self.binary_path = properties.get('binary_path', 'obabel')
+87 self.properties = properties
+ +89 # Check the properties
+90 self.check_properties(properties)
+91 self.check_arguments()
+ +93 def check_data_params(self, out_log, err_log):
+94 """ Checks all the input/output paths and parameters """
+95 self.io_dict["in"]["input_path"] = check_input_path(self.io_dict["in"]["input_path"], out_log, self.__class__.__name__)
+96 self.io_dict["out"]["output_path"] = check_output_path(self.io_dict["out"]["output_path"], out_log, self.__class__.__name__)
+ +98 def create_cmd(self, container_io_dict, out_log, err_log):
+99 """Creates the command line instruction using the properties file settings"""
+100 instructions_list = []
+ +102 # executable path
+103 instructions_list.append(self.binary_path)
+ +105 # generating input
+106 infr = get_input_format(self.input_format, container_io_dict["in"]["input_path"], out_log)
+107 iformat = '-i' + infr
+108 instructions_list.append(iformat)
+109 ipath = container_io_dict["in"]["input_path"]
+110 instructions_list.append(ipath)
+ +112 # generating output
+113 oufr = get_output_format(self.output_format, container_io_dict["out"]["output_path"], out_log)
+114 oformat = '-o' + oufr
+115 instructions_list.append(oformat)
+116 opath = '-O' + container_io_dict["out"]["output_path"]
+117 instructions_list.append(opath)
-119 instructions_list.append(coordinates)
- -121 hydrogens = '-d'
- -123 instructions_list.append(hydrogens)
- -125 # adding pH
-126 p = get_ph(self.ph, out_log)
-127 ph = ''
-128 if p:
-129 ph = '-p ' + p
- -131 instructions_list.append(ph)
- -133 return instructions_list
- -135 @launchlogger
-136 def launch(self) -> int:
-137 """Execute the :class:`BabelRemoveHydrogens <babelm.babel_remove_hydrogens.BabelRemoveHydrogens>` babelm.babel_remove_hydrogens.BabelRemoveHydrogens object."""
- -139 # check input/output paths and parameters
-140 self.check_data_params(self.out_log, self.err_log)
+119 # adding coordinates
+120 crd = get_coordinates(self.coordinates, out_log)
+121 coordinates = ''
+122 if crd:
+123 coordinates = '--gen' + crd + 'd'
+124 instructions_list.append(coordinates)
+ +126 hydrogens = '-d'
+ +128 instructions_list.append(hydrogens)
+ +130 # adding pH
+131 p = get_ph(self.ph, out_log)
+132 ph = ''
+133 if p:
+134 ph = '-p ' + p
+135 instructions_list.append(ph)
+ +137 # fs_input
+138 if self.fs_input is not None:
+139 for fsi in self.fs_input:
+140 instructions_list.append('-a' + fsi)
-142 # Setup Biobb
-143 if self.check_restart():
-144 return 0
-145 self.stage_files()
+142 # fs_output
+143 if self.fs_output is not None:
+144 for fso in self.fs_output:
+145 instructions_list.append('-x' + fso)
-147 # create command line instruction
-148 self.cmd = self.create_cmd(self.stage_io_dict, self.out_log, self.err_log)
- -150 # Run Biobb block
-151 self.run_biobb()
+147 # adding effort (only for 3D coordinates)
+148 if crd == '3':
+149 instructions_list.append('--' + self.effort)
+ +151 return instructions_list
-153 # Copy files to host
-154 self.copy_to_host()
- -156 # remove temporary folder(s)
-157 self.tmp_files.extend([
-158 self.stage_io_dict.get("unique_dir")
-159 ])
-160 self.remove_tmp_files()
- -162 self.check_arguments(output_files_created=True, raise_exception=False)
- -164 return self.return_code
- - -167def babel_remove_hydrogens(input_path: str, output_path: str, properties: dict = None, **kwargs) -> int:
-168 """Execute the :class:`BabelRemoveHydrogens <babelm.babel_remove_hydrogens.BabelRemoveHydrogens>` class and
-169 execute the :meth:`launch() <babelm.babel_remove_hydrogens.BabelRemoveHydrogens.launch>` method."""
+153 @launchlogger
+154 def launch(self) -> int:
+155 """Execute the :class:`BabelRemoveHydrogens <babelm.babel_remove_hydrogens.BabelRemoveHydrogens>` babelm.babel_remove_hydrogens.BabelRemoveHydrogens object."""
+ +157 # check input/output paths and parameters
+158 self.check_data_params(self.out_log, self.err_log)
+ +160 # Setup Biobb
+161 if self.check_restart():
+162 return 0
+163 self.stage_files()
+ +165 # create command line instruction
+166 self.cmd = self.create_cmd(self.stage_io_dict, self.out_log, self.err_log)
+ +168 # Run Biobb block
+169 self.run_biobb()
-171 return BabelRemoveHydrogens(input_path=input_path,
-172 output_path=output_path,
-173 properties=properties, **kwargs).launch()
- - -176def main():
-177 """Command line execution of this building block. Please check the command line documentation."""
-178 parser = argparse.ArgumentParser(description="Removes hydrogen atoms to small molecules.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
-179 parser.add_argument('--config', required=False, help='Configuration file')
- -181 # Specific args of each building block
-182 required_args = parser.add_argument_group('required arguments')
-183 required_args.add_argument('--input_path', required=True, help='Path to the input file. Accepted formats: dat, ent, fa, fasta, gro, inp, log, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt, xml, xtc.')
-184 required_args.add_argument('--output_path', required=True, help='Path to the output file. Accepted formats: ent, fa, fasta, gro, inp, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt.')
- -186 args = parser.parse_args()
-187 args.config = args.config or "{}"
-188 properties = settings.ConfReader(config=args.config).get_prop_dic()
- -190 # Specific call of each building block
-191 babel_remove_hydrogens(input_path=args.input_path,
-192 output_path=args.output_path,
-193 properties=properties)
- - -196if __name__ == '__main__':
-197 main()
+171 # Copy files to host
+172 self.copy_to_host()
+ +174 # remove temporary folder(s)
+175 self.tmp_files.extend([
+176 self.stage_io_dict.get("unique_dir")
+177 ])
+178 self.remove_tmp_files()
+ +180 self.check_arguments(output_files_created=True, raise_exception=False)
+ +182 return self.return_code
+ + +185def babel_remove_hydrogens(input_path: str, output_path: str, properties: dict = None, **kwargs) -> int:
+186 """Execute the :class:`BabelRemoveHydrogens <babelm.babel_remove_hydrogens.BabelRemoveHydrogens>` class and
+187 execute the :meth:`launch() <babelm.babel_remove_hydrogens.BabelRemoveHydrogens.launch>` method."""
+ +189 return BabelRemoveHydrogens(input_path=input_path,
+190 output_path=output_path,
+191 properties=properties, **kwargs).launch()
+ + +194def main():
+195 """Command line execution of this building block. Please check the command line documentation."""
+196 parser = argparse.ArgumentParser(description="Removes hydrogen atoms to small molecules.", formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999))
+197 parser.add_argument('--config', required=False, help='Configuration file')
+ +199 # Specific args of each building block
+200 required_args = parser.add_argument_group('required arguments')
+201 required_args.add_argument('--input_path', required=True, help='Path to the input file. Accepted formats: dat, ent, fa, fasta, gro, inp, log, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt, xml, xtc.')
+202 required_args.add_argument('--output_path', required=True, help='Path to the output file. Accepted formats: ent, fa, fasta, gro, inp, mcif, mdl, mmcif, mol, mol2, pdb, pdbqt, png, sdf, smi, smiles, txt.')
+ +204 args = parser.parse_args()
+205 args.config = args.config or "{}"
+206 properties = settings.ConfReader(config=args.config).get_prop_dic()
+ +208 # Specific call of each building block
+209 babel_remove_hydrogens(input_path=args.input_path,
+210 output_path=args.output_path,
+211 properties=properties)
+ + +214if __name__ == '__main__':
+215 main()
diff --git a/coverage/z_8e6f3ef91f4b94fc_common_py.html b/coverage/z_8e6f3ef91f4b94fc_common_py.html index 931e1713..f528324b 100644 --- a/coverage/z_8e6f3ef91f4b94fc_common_py.html +++ b/coverage/z_8e6f3ef91f4b94fc_common_py.html @@ -64,8 +64,8 @@Generated on 2024-07-03 18:55 +
Generated on 2024-07-16 13:26 with Installed plugins: flake8-html: 0.4.3, mccabe: 0.7.0, pycodestyle: 2.12.0, pyflakes: 3.2.0
Report generated on 03-Jul-2024 at 19:02:59 by pytest-html +
Report generated on 16-Jul-2024 at 13:32:44 by pytest-html v4.1.1
10 tests took 00:07:06.
+10 tests took 00:05:38.
(Un)check the boxes to filter the results.