Templates

In this manual we will detail how to build a new BioBB module or package using the biobb_template as a base. In this template, you will find all the material needed for the implementation of a new BioBB. The complete file structure is described in detail in the Files structure section.

In the biobb_template we provide, amongst the rest of materials, two Python templates: template.py, for wrapping a tool, and template_container.py, for wrapping a tool executed inside a container.

Template (template.py)

https://github.com/bioexcel/biobb_template/blob/master/biobb_template/template/template.py

This is the basic template for wrapping a tool. This Python file is a wrapper for the zip tool. The process followed by this script is the following one:

  • Receive input(s) paths. More information about the inputs can be found in the Inputs section.

  • Receive output path. More information about the outputs can be found in the Outputs section.

  • Receive properties. More information about the properties can be found in the Properties section. And more information about the specific properties of this template can be found in the Properties Template section.

  • Create a temporary folder and copy the input(s) file(s) inside it.

  • Wrap the zip tool creating a command line from the input(s) and properties.

  • Execute the command line.

  • Remove the temporary folder if the user has not said otherwise.

  • If everything worked, the output file will be in the path provided to the tool.

More information about the structure of this file can be found in the Template section.

Template Container (template_container.py)

https://github.com/bioexcel/biobb_template/blob/master/biobb_template/template/template_container.py

This is the template for wrapping a tool executed through a container. In this case, the tool to wrap is zip and two containers are provided: Docker Hub and Singularity Hub (type singularity pull --name zip.sif shub://bioexcel/zip_container for installing it in your computer in .sif format or singularity pull shub://bioexcel/zip_container for installing it in your computer in .simg format). The process followed by this script is the following one:

  • Receive input(s) paths. More information about the inputs can be found in the Inputs section.

  • Receive output path. More information about the outputs can be found in the Outputs section.

  • Receive properties. More information about the properties can be found in the Properties section. And more information about the specific properties of this template can be found in the Properties Template Container section.

  • Creation a temporary folder and map it to the container_volume_path path.

  • Wrap the zip tool creating a command line from the input(s) and properties.

  • Execute the command line.

  • Copy output file(s) from the mapped container_volume_path inside the container to the definitive output path defined by the user in the arguments.

  • Remove the temporary folder if the user has not said otherwise.

  • If everything worked, the output file will be in the path provided to the tool.

More information about the structure of this file can be found in the Template Container section.