flowcraft.templates.flowcraft_utils.flowcraft_base module

flowcraft.templates.flowcraft_utils.flowcraft_base.get_logger(filepath, level=10)[source]
flowcraft.templates.flowcraft_utils.flowcraft_base.log_error()[source]

Nextflow specific function that logs an error upon unexpected failing

class flowcraft.templates.flowcraft_utils.flowcraft_base.MainWrapper(f)[source]

Bases: object

Methods

__call__(self, \*args, \*\*kwargs) Call self as a function.
build_versions(self) Writes versions JSON for a template file
build_versions(self)[source]

Writes versions JSON for a template file

This method creates the JSON file .versions based on the metadata and specific functions that are present in a given template script.

It starts by fetching the template metadata, which can be specified via the __version__, __template__ and __build__ attributes. If all of these attributes exist, it starts to populate a JSON/dict array (Note that the absence of any one of them will prevent the version from being written).

Then, it will search the template scope for functions that start with the substring __set_version (For example ``def __set_version_fastqc()`). These functions should gather the version of an arbitrary program and return a JSON/dict object with the following information:

{
    "program": <program_name>,
    "version": <version>
    "build": <build>
}

This JSON/dict object is then written in the .versions file.