Official wrappers - RomainFeron/workshop-snakemake-sibdays2020 GitHub Wiki

Wrappers are, as their name indicates, wrapper scripts around popular command-line tools. The point of wrappers is to not write the full command for a tool yourself; instead, you'd only need to define inputs, outputs, and parameters. Wrappers also define and automatically deploy Conda environment for their software. Official wrappers are stored in a repository and cover close to 50 popular pieces of software. Each wrapper is documented on the official wrapper repository's documentation. To use a wrapper in a rule, use the directive wrapper: <wrapper_path>:

rule run_tool_wrapper:
    input:
        'data/input.tsv'
    output:
        'results/output.txt'
    wrapper:
        '0.40.2/bio/tool'

The number in the wrapper path indicates the official's repository version (in practice, the git version tag); it can also be a commit ID from the git repository. Using this versioning system in your workflow ensures reproducibility: changes in the wrapper or the software's implementation will not affect your workflow.

Wrappers are the preferred way to run tools when available. However, the official wrapper repository is a community-based effort, meaning that interfaces between rule definition and the tool's command-line parameters are not always standardized. It also means that you are dependent on the author's implementation; in some cases, their choices will not easily fit in your workflow, and you will have to implement your own rule for the software. The bottom line is, use wrappers whenever possible, but do not get constrained by their implementation if they prevent you from achieving what you want to do.