You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Charles Reid f3b60856c2 add tags to readme 6 years ago
cli Add command line interface, python package, and tests (#1) 6 years ago
test Add command line interface, python package, and tests (#1) 6 years ago
.gitignore Add command line interface, python package, and tests (#1) 6 years ago
.travis.yml Add command line interface, python package, and tests (#1) 6 years ago
LICENSE Add command line interface, python package, and tests (#1) 6 years ago
MANIFEST.in Add command line interface, python package, and tests (#1) 6 years ago
README.md add tags to readme 6 years ago
requirements-to-freeze.txt upgrade pyyaml 6 years ago
requirements.txt Add command line interface, python package, and tests (#1) 6 years ago
setup.py Add command line interface, python package, and tests (#1) 6 years ago

README.md

2019-snakemake-cli

travis license

An example of a Snakemake command line interface bundled up as an installable Python package.

This example bundles the Snakefile with the command line tool, but this tool can also look in the user's working directory for Snakefiles.

Snakemake functionality is provided through a command line tool called bananas.

Quickstart

This runs through the installation and usage of 2019-snakemake-cli.

Installing bananas

Start by setting up a virtual environment, and install the required packages into the virtual environment:

pip install -r requirements.txt

Now install the bananas command line tool:

python setup.py build install

Now you can run

which bananas

and you should see bananas in your virtual environment's bin/ directory.

Running bananas

Move to the test/ directory and run the tests with the provided config and params files.

Run the hello workflow with Amy params:

rm -f hello.txt
bananas workflow-hello params-amy

Run the hello workflow with Beth params:

rm -f hello.txt
bananas workflow-hello params-beth

Run the goodbye workflow with Beth params:

rm -f goodbye.txt
bananas workflow-goodbye params-beth

Details

The entrypoint of the command line interface is the main() function of cli/command.py.

The location of the Snakefile is cli/Snakefile.

An alternative arrangement would be for users to provide a Snakefile via rules in the working directory, or via a Github URL or a remote URL.

Tags

  • v1.0 - initial version, ctb/2018-snakemake-cli

  • v2.0 - Snakemake workflow bundled as installable Python package, Snakefile bundled with Python package, command line interface provided to wrap Snakemake API call