Documentation: https://snk.wytamma.com
Source Code: https://github.com/Wytamma/snk
Snk (pronounced snek) is a Snakemake workflow management system. Snk allows you to install Snakemake workflows as dynamically generated Command Line Interfaces (via snk-cli). Using a workflow as a CLI increases its interoperability and allows complex workflows to be used as modular components in a larger system.
pip install snk
The snk install command can be use to install Snakemake workflows as CLIs. Snk can install Snakemake workflows from GitHub repos or local paths. An index of publicly available Snakemake workflows can be found on the snakemake workflow catalog.
snk install wytamma/snk-basic-pipeline
The snk install command is flexible and can be used to install diverse workflows. For example, the dna-seq-gatk-variant-calling workflow (v2.1.1) as variant-calling
with Snakemake v8.10.8 and pandas dependency.
snk install \
snakemake-workflows/dna-seq-gatk-variant-calling \
--name variant-calling \
--snakemake 8.10.8 \
-d pandas \
-t v2.1.1
Successfully installed variant-calling (v2.1.1)!
Snk will automatically create a fully featured CLI for the Snakemake workflow using snk-cli.
Note
For more details on the CLI created by snk
read the snk-cli docs
variant-calling --help
![cli help](https://private-user-images.githubusercontent.com/13726005/300812697-3e6e4134-efe5-47e1-b6f4-81b60e1c9ea7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUwMTk3NTYsIm5iZiI6MTcyNTAxOTQ1NiwicGF0aCI6Ii8xMzcyNjAwNS8zMDA4MTI2OTctM2U2ZTQxMzQtZWZlNS00N2UxLWI2ZjQtODFiNjBlMWM5ZWE3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMwVDEyMDQxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1NzI4ZWM2Y2IzMGVkOWQ1NjUzNDZlZjIwMzAzNDExNmJiNWE0N2JmZjM0YjQzODhhZTY4NzczYjMzOGU4ZDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qeNO9mpjnDpHfOYwtjAkqb9oW9jXHgmyDMglkv51OHg)
Workflow configuration options are automatically generated from the snakemake config file.
variant-calling run --help
![run cli help](https://private-user-images.githubusercontent.com/13726005/300796247-ef1dd9ca-1ba2-4a77-921a-4de16dd57631.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUwMTk3NTYsIm5iZiI6MTcyNTAxOTQ1NiwicGF0aCI6Ii8xMzcyNjAwNS8zMDA3OTYyNDctZWYxZGQ5Y2EtMWJhMi00YTc3LTkyMWEtNGRlMTZkZDU3NjMxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMwVDEyMDQxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiMmVmN2UzZTc1ZDFlMWFkYmU1NjQzOWMyNTU4NGU2NjRmM2Y4YTdjM2M4NGNiOTE1NDQyN2ZiYzg4ZWU1NzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.HCXDM5_8YX-PSzUyy_b3CPL1YD1fgHqZbzlmIsxwF5g)
Here we use the .test
resources included in the workflow to create the DAG.
variant-calling run -r .test/config -r .test/data --dag dag.pdf
![run cli help](https://private-user-images.githubusercontent.com/13726005/301176109-0c25886c-0ab1-49ad-9fdd-315827dcaeb8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUwMTk3NTYsIm5iZiI6MTcyNTAxOTQ1NiwicGF0aCI6Ii8xMzcyNjAwNS8zMDExNzYxMDktMGMyNTg4NmMtMGFiMS00OWFkLTlmZGQtMzE1ODI3ZGNhZWI4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODMwVDEyMDQxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFkM2UwNzdmMjcyYTg5YWEzZTc3NmQ0ZTZiMTcwODg5NTViMWUzMTRjNDZmNzAxZmU4OThmZDJiNmZjNTc0ZTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.uiCQI2uV0tHT8ii6YMPq70eFBeNTF4JcvuQT_oitLXU)
Snk will dynamically generate config options for the CLI. For example if the config.yaml file has the option fasta: null
you can set this option with --fasta
.
variant-calling run --fasta example.fa
You can also configure the workflow using a config file.
variant-calling config --pretty # print the config
variant-calling config > config.yml # save the config
variant-calling run --config config.yml # run with config
You can list installed workflows with snk list
and uninstall them with snk uninstall
.
snk list
Workflow | Version |
---|---|
variant-calling | v2.1.1 |
snk uninstall variant-calling
Successfully uninstalled variant-calling!
Read the documentation for more information.
snk
is distributed under the terms of the MIT license.