This package is intended for use within a Snakemake workflow project.
Install the Python package and dependency management tool poetry using official documentation.
You must have Python 3.11 or greater available on your system path, which could be managed by mamba, pyenv, or another package manager.
If you have a mamba environment for the parent project, activate it first.
Install with poetry.
poetry install
Usage
Error summary file
Set the onerror directive in a Snakemake workflow to point to the fgsmk.on_error function.
from fgsmk.log import on_error
onerror:
on_error(snakefile=Path(__file__), config=config, log=Path(log))
"""Block of code that gets called if the snakemake pipeline exits with an error."""
This will produce a file error_summary.txt containing the last (up to) 50 lines of the log files of any rules that failed execution.
The content will also be output to stdout.
[![Python package][python-package-badge]][python-package-link] [![PyPI version][pypi-badge]][pypi-link] [![PyPI download total][pypi-downloads-badge]][pypi-downloads-link] [![Bioconda][bioconda-badge]][bioconda-link] [![DOI][zenodo-badge]][zenodo-link]
[python-versions-badge]: //NSCCN/fgsmk/tree/main/https:/img.shields.io/badge/python-3.11_|3.12-blue|]: //NSCCN/fgsmk/tree/main/https:/img.shields.io/badge/python-3.11|_3.12-blue [python-versions-link]: //NSCCN/fgsmk/tree/main/https:/github.com/fulcrumgenomics/fgsmk/blob/main/pyproject.toml [code-style-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json [code-style-link]: https://docs.astral.sh/ruff/ [type-checking-badge]: https://www.gitlink.org.cn/api/NSCCN/fgsmk/raw/http:/www.mypy-lang.org/static/mypy_badge.svg?ref=main [type-checking-link]: //NSCCN/fgsmk/tree/main/http:/mypy-lang.org [pep-8-badge]: https://img.shields.io/badge/code%20style-pep8-brightgreen [pep-8-link]: https://www.python.org/dev/peps/pep-0008/ [poetry-badge]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json [poetry-link]: //NSCCN/fgsmk/tree/main/https:/python-poetry.org [license-badge]: https://img.shields.io/badge/license-MIT-blue [license-link]: https://github.com/fulcrumgenomics/fgsmk/blob/main/LICENSE [python-package-badge]: https://github.com/fulcrumgenomics/fgsmk/actions/workflows/python_package.yml/badge.svg?branch=main [python-package-link]: //NSCCN/fgsmk/tree/main/https:/github.com/fulcrumgenomics/fgsmk/actions/workflows/python_package.yml [pypi-badge]: https://www.gitlink.org.cn/api/NSCCN/fgsmk/raw/https:/badge.fury.io/py/fgsmk.svg?ref=main [pypi-link]: https://pypi.python.org/pypi/fgsmk [pypi-downloads-badge]: https://img.shields.io/pypi/dm/fgsmk [pypi-downloads-link]: https://pypi.python.org/pypi/fgsmk [bioconda-badge]: https://img.shields.io/conda/dn/bioconda/fgsmk.svg?label=Bioconda [bioconda-link]: //NSCCN/fgsmk/tree/main/http:/bioconda.github.io/recipes/fgsmk/README.html [zenodo-badge]: https://www.gitlink.org.cn/api/NSCCN/fgsmk/raw/https:/zenodo.org/badge/916232349.svg?ref=main [zenodo-link]: //NSCCN/fgsmk/tree/main/https:/doi.org/10.5281/zenodo.15558165
fgsmk
A set of utility functions for use in Snakemake workflows. Supports Snakemake 8+.
Table of Contents
Recommended Installation
This package is intended for use within a Snakemake workflow project.
Install the Python package and dependency management tool
poetryusing official documentation. You must have Python 3.11 or greater available on your system path, which could be managed bymamba,pyenv, or another package manager.If you have a
mambaenvironment for the parent project, activate it first.Install with
poetry.Usage
Error summary file
Set the
onerrordirective in a Snakemake workflow to point to thefgsmk.on_errorfunction.This will produce a file
error_summary.txtcontaining the last (up to) 50 lines of the log files of any rules that failed execution. The content will also be output tostdout.Development and Testing
See the contributing guide for more information.