API Reference

snakescale.available_tools(version: str = 'latest') → List[str][source]
snakescale.available_subtools(tool: str, version: str = 'latest') → Optional[List[str]][source]
snakescale.scale(tool: str, subtool: Optional[str] = None, version: str = 'latest', as_uri: bool = True) → str[source]
snakescale.formatters.clean_picard_style_value(value: Union[List[str], str]) → Union[List[str], str][source]

Clean a dictionary of Picard key-value pairs.

snakescale.formatters.snakecase_to_kebab_case(key: str) → str[source]

Convert snake_case to kebab-case.

snakescale.formatters.clean_picard_style_key(key: str) → str[source]

Clean a Picard parameter key.

snakescale.formatters.format_bedtools_params(params: Mapping) → str[source]

Clean a dictionary of bedtools key-value pairs.

snakescale.formatters.format_bwa_params(params: Mapping) → str[source]

Clean a dictionary of bwa key-value pairs.

snakescale.formatters.format_dwgsim_params(params: Mapping) → str[source]

Clean a dictionary of dwgsim key-value pairs.

snakescale.formatters.format_fgbio_params(params: Mapping) → str[source]

Clean a dictionary of fgbio key-value pairs.

snakescale.formatters.format_kraken_params(params: Mapping) → str[source]

Clean a dictionary of kraken key-value pairs.

snakescale.formatters.format_picard_params(params: Mapping) → str[source]

Clean a dictionary of picard key-value pairs.

snakescale.resources.collect_jvm_resources() → str[source]

Collect JVM resources allocations the resource dictionary.

snakescale.resources.collect_picard_style_jvm_resources() → str[source]

Collect Picard specific JVM resources allocations the resource dictionary.

class snakescale.utils.ExitCode[source]

Bases: int

The code returned to a parent process by an executable.

Examples

>>> from subprocess import call
>>> exit_code = ExitCode(call('ls'))
>>> exit_code.is_ok()
True
is_ok() → bool[source]

Is this code zero.

class snakescale.utils.ProcessReturn[source]

Bases: tuple

A collection of STDOUT, STDERR, and exit code from a terminated process.

stdout

Alias for field number 0

stderr

Alias for field number 1

exit_code

Alias for field number 2

_asdict()

Return a new OrderedDict which maps field names to their values.

classmethod _make(iterable, new=<built-in method __new__ of type object at 0x886c00>, len=<built-in function len>)

Make a new ProcessReturn object from a sequence or iterable

_replace(**kwds)

Return a new ProcessReturn object replacing specified fields with new values

snakescale.utils.call_snakemake(arguments: str) → snakescale.utils.ProcessReturn[source]

Call Snakemake in this thread as if we are using the CLI.

Parameters:arguments – A string of arguments to pass to Snakemake.

Examples

>>> process_return = call_snakemake('')
>>> process_return.exit_code.is_ok()
False
>>> process_return.stderr.strip()
'Error: Snakefile "Snakefile" not present.'
snakescale.testing.run_tool_test(tool: str, subtool: Optional[str] = None, version: str = 'latest') → snakescale.utils.ProcessReturn[source]

Execute a tool and optional subtool test against a specific wrapper version.