A skeleton repository for Snakemake pipepline(s) and a python command-line toolkit.
This the starting point for Fulcrum Genomics projects that contain Snakemake pipelines and a python toolkit.
This repo contains the following, in no particular order:
- a hello world snakefile in
src/snakemake/hello_world.smk
- this uses the
onerror
directive to better display rule errors, in particular the last file lines of the rule's log
- this uses the
- a python toolkit (
clien-tools
) insrc/python/pyclient
- uses
defopt
for arg parsing - has custom logging in
core/logging.py
- has utility methods to support the above
onerror
snakemake directive inpipeline/snakemake_utils.py
- has a unit test to ensure the above snakefile is runnable and generally executes the expected rules in
tests/test_hello_world.py
. This also includes a utility method to support running and verifying snakemake intests/util.py
- supports multiple sub-commands in
tools/__main__.py
with some nice logging when a tool fails - a little hello world tool in
tools/hello_world.py
- uses
This repo is a skeleton for Snakemake pipelines and a Python toolkit.
- Modify
setup.py
- update
conda-requirements-minimal.txt
with minimal requirements for theclient-tools
toolkit - update
conda-requirements-test.txt
with minimal requirements for theclient-tools
unit testing - update
pip-requirements.txt
with minimal requirements for theclient-tools
(prefer conda) - update
src/python/pyclient
source code (search for terms:PYCLIENT
,pyclient
,client-tools
-
Create the
pyclient
conda environment
mamba create -n pyclient \
--override-channels -y \
-c bioconda -c conda-forge -c defaults \
--file conda-requirements-minimal.txt \
--file conda-requirements-test.txt
- Activate the
pyclient
conda environment
conda activate pyclient
- Install all non-conda dependencies via pip
pip install -r pip-requirements.txt
- Install
pyclient
(in developer mode)
python setup.py develop
- Validate the install via the help message
client-tools -h
- Validate the snakemake install
snakemake --snakefile src/snakemake/hello_world.smk -j 1