snakemake.script.BashEncoder

class snakemake.script.BashEncoder(namedlists=None, dicts=None, prefix='snakemake')[source]

bash docs for associative arrays - https://www.gnu.org/software/bash/manual/html_node/Arrays.html#Arrays

__init__(namedlists=None, dicts=None, prefix='snakemake')[source]

namedlists is a list of strings indicating the snakemake object’s member variables which are encoded as Namedlist. dicts is a list of strings indicating the snakemake object’s member variables that are encoded as dictionaries. Prefix is the prefix for the bash variable name(s) e.g., snakemake_input

Methods

__init__([namedlists, dicts, prefix])

namedlists is a list of strings indicating the snakemake object's member variables which are encoded as Namedlist.

dict_to_aa(d)

Converts a dictionary to an associative array

encode_namedlist(named_list)

Convert a namedlist into a bash associative array This produces the array component of the variable.

encode_snakemake(smk)

Turn a snakemake object into a collection of bash associative arrays