Snakemake extension functions

add_targets(*targets)
PP(p, parent_project_id=None)

Value of the project parameter p in current project, if parent_project_id is not specified, otherwise the value of parameter p in parent_project_id. If parameter p is not in the project parameters, then the value of this parameter in the first recusively searched parameters of parent projects. If none is found returns None.

T(t)

The file name for target t of the current object.

TE(t)

The file name pattern for target t of the current object suitable as an argument to the expand function (a.k.a. the curly brackets are doubled).

EF(s)

Argument s is a string that may include projects parameters as well as object’s parameters as they are definded with PP and P directives in the so_project.yaml file.

DT(t, dot=None, level=1, mode='equal')

List of files for the targets named t of the dependency objects (the objects the current object depends on).

Parameters
  • t (str) – the name of the target in the dependency objects.

  • dot (str) – the object type of the dependency objects to be used. If None, dependency objects of all object types will be used, if not None, the level and model values are ignored.

  • level (int) – how many levels down the dependency graph to explore. The default value of 1 indicates that only the objects that the current object depends on directly will be used.

  • mode ('equal' or 'lessOrEqual') – if set to 'equal', only objects that are exactly level steps away from the current object will be used. If set to 'lessOrEqual', objects of level steps or less will be used.

P(p)

Value of the parameter p of the current object or None, if p is not in the list of parameters.

DP(p, dot=None, level=1, mode='equal')

List of values of the parameter p of the dependency objects (the objects the current object depends on, the values are None, if p is not in the parameters ).

Parameters
  • p (str) – the name of the parameter of the dependency objects.

  • dot (str) – the object type of the dependency objects to be used. If None, dependency objects of all object types will be used.

  • level (int) – how many levels down the dependency graph to explore. The default value of 1 indicates that only the objects that the current object depends on directly will be used.

  • mode ('equal' or 'lessOrEqual') – if set to 'equal', only objects that are exactly level steps away from the current object will be used. If set to 'lessOrEqual', objects of level steps or less will be used.

LFS(t)

A set of three log files, log.O, log.E, and log.T, named after target t to be used in a rule.

This function is expected to be used in the log section of the snakemake rules like log: **LFS('bamFile')). After that, the rule can use one or more of {log.O}, {log.E}, and {log.T} for storing standard output, standard error, or timing information respectively.