snaketools package

Submodules

snaketools.errors module

Provide error classes for snaketools.

exception snaketools.errors.NotImplementedYet(msg=None)[source]

Bases: NotImplementedError, snaketools.errors.SnaketoolsError

Raise when a section of code that has been left for another time is asked to execute.

__init__(msg=None)[source]

Set up the Exception.

exception snaketools.errors.SnaketoolsError[source]

Bases: Exception

Base error class for veoibd-synapse-data-manager.

exception snaketools.errors.ValidationError[source]

Bases: snaketools.errors.SnaketoolsError

Raise when a validation/sanity check comes back with unexpected value.

snaketools.snaketools module

Provide code supporting the running and automating of Snakemake rules.

snaketools.snaketools.apply_template(template, keywords)[source]

Return a list of strings of form template with values in keywords inserted.

Parameters:
  • template (str) – a string containing keywords ({kw_name}).
  • keywords (dict-like) – dict with keys of appropriate keyword names and values as equal length ORDERED lists with the correct values to be inserted.
snaketools.snaketools.pathify_by_key_ends(dictionary)[source]

Return a dict that has had all values with keys containing the suffixes: ‘_FILE’, ‘_PATH’ or ‘_DIR’ converted to Path() instances.

Parameters:dictionary (dict-like) – Usually the loaded, processed config file as a dict.
Returns:Modified version of the input.
Return type:dict-like
class snaketools.snaketools.SnakeRun(cfg, snakefile)[source]

Bases: object

Initialize and manage information common to the whole run.

__init__(cfg, snakefile)[source]

Initialize common information for a run.

class snaketools.snaketools.SnakeRule(run, name, pretty_name=None)[source]

Bases: object

Manage the initialization and deployment of rule-specific information.

__init__(run, name, pretty_name=None)[source]

Initialize logs, inputs, outputs, params, etc for a single rule.

_import_config_dict()[source]

Import configuration values set for this rule so they are directly accessable as attributes.

snaketools.snaketools.recode_graph(dot, new_dot, pretty_names, rules_to_drop, color=None, use_pretty_names=True)[source]

Change dot label info to pretty_names and alter styling.

snaketools.snaketools.rewrite_snakefile_no_rules(infile, outfile)[source]

Write new file, omitting the snakemake grammar sections.

Module contents

Top-level package for SnakeTools.