generic package

Classes

class generic.biobb_object.BiobbObject(properties=None, **kwargs)[source]

Bases: object

biobb_common BiobbObject
Generic parent class for the rest of the Biobb clases.
The BiobbOject class contains all the properties and methods that are common to all the biobb blocks.
Parameters:

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

  • io_dict (dict) - ({}) Input/Output files dictionary.

  • 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 -c”) Path to the binary executable of the container shell.

  • container_generic_command (str) - (“run”) Which command typically run or exec will be used to execute your image.

  • stage_io_dict (dict) - ({}) Stage Input/Output files dictionary.

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

  • disable_sandbox (bool) - (False) Disable the use of temporal unique directories aka sandbox. Only for local execution.

  • global_properties_list (list) - ([]) list of global properties.

  • chdir_sandbox (bool) - (False) Change directory to the sandbox using just file names in the command line. Only for local execution.

  • binary_path (str) - (‘’) Path to the binary executable.

  • disable_logs (bool) - (False) Disable the logs.

  • global_log (Logger object) - (None) Log from the main workflow.

  • out_log (Logger object) - (None) Log from the step.

  • err_log (Logger object) - (None) Error log from the step.

  • out_log_path (str) - (None) Path to the log file.

  • err_log_path (str) - (None) Path to the error log file.

  • can_write_console_log (bool) - (True) Can write console log.

  • can_write_file_log (bool) - (True) Can write file log.

  • prefix (str) - (None) Prefix if provided.

  • step (str) - (None) Name of the step.

  • path (str) - (‘’) Absolute path to the step working dir.

  • remove_tmp (bool) - (True) [WF property] Remove temporal files.

  • restart (bool) - (False) [WF property] Do not execute if output files exist.

  • cmd (list) - ([]) Command line list, NOT read from the dictionary.

  • return_code (int) - (0) Return code of the command execution, NOT read from the dictionary.

  • timeout (int) - (None) Timeout for the execution of the command.

  • tmp_files (list) - ([]) list of temporal files, NOT read from the dictionary.

  • env_vars_dict (dict) - ({}) Environment Variables dictionary.

  • shell_path (str) - (“/bin/bash”) Path to the binary executable of the shell.

  • dev (str) - (None) Development options.

  • check_extensions (bool) - (True) Check extensions of the input/output files.

  • check_var_typing (bool) - (True) Check typing of the input/output files.

  • locals_var_dict (dict) - ({}) Local variables dictionary.

  • doc_arguments_dict (dict) - ({}) Documentation arguments dictionary.

  • doc_properties_dict (dict) - ({}) Documentation properties dictionary.

__init__(properties=None, **kwargs) None[source]
check_arguments(output_files_created: bool = False, raise_exception: bool = True)[source]
check_init(properties)[source]

Check that the arguments and properties passed have the correct types and formats.

check_properties(properties: dict, reserved_properties: set[str] | None = None, check_var_typing: bool = False)[source]
check_restart() bool[source]
copy_to_host()[source]

Copy output files from the sandbox to the host system.

create_cmd_line() None[source]

The method modifies the self.cmd attribute in-place to contain the final command line that will be executed based on the container type.

create_tmp_dir() None[source]

Create a temporary directory in the unique directory. These directories are removed when self.remove_tmp_files is called.

create_tmp_file(extension: str) None[source]

Create a temporary file in the unique directory. These files are removed when self.remove_tmp_files is called.

execute_command()[source]
classmethod get_main(launcher, description, custom_flags=None)[source]

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

remove_tmp_files()[source]
run_biobb()[source]
stage_files()[source]

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