Transform a command series from shournal into Snakemake rules
Project description
shournal-to-snakemake
Transform a command series observed by shournal to snakemake rules.
shournal tracks read and written files of shell commands. Thus, for each command the input- and output-section of a snakemake rule may be generated. Matched file-paths are automatically replaced in the command string with {input} and {output}.
Basic Usage
After shournal is installed, start a new (by shournal observed) shell session. Within that perform the (shell-based) data analysis of your choice.
Once done, from within the same shell-session, generate the snakemake rules by
shournal -q --output-format json -sid $SHOURNAL_SESSION_ID | shournal-to-snakemake
Toy example
$ SHOURNAL_ENABLE
$ echo stuff > foo
$ cat foo > bar
$ shournal -q --output-format json -sid $SHOURNAL_SESSION_ID | shournal-to-snakemake
rule undefined_1:
output:
"foo",
shell:
# raw: echo stuff > foo
"echo stuff > {output}"
rule undefined_2:
input:
"foo",
output:
"bar",
shell:
# raw: cat foo > bar
"cat {input} > {output}"
General hints
- Don't change the working directory during the workflow.
- Do not use wildcards or variables (in file-paths), otherwise the files in the command string cannot be correctly replaced by {input} or {output}.
- Stick to basic posix shell syntax
Installation
Create a wheel directly from source by executing
python3 setup.py sdist bdist_wheel
Install the wheel as usual, e.g. by
pip3 install --user dist/shournal_to_snakemake-VERSION-*.whl
License
Copyright © 2020 Tycho Kirchner (see LICENSE)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shournal-to-snakemake-0.1.tar.gz.
File metadata
- Download URL: shournal-to-snakemake-0.1.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48728703993e8a12f561978243a41a13a2ff8d0018c7fe342bf39efc596a9866
|
|
| MD5 |
f0942bf7c34814e33dcb0b7444d86bfa
|
|
| BLAKE2b-256 |
8744bb4cf1b219ebdceb307dd582716ceceeabaa4a5c5b9aece43458b96c4a0a
|
File details
Details for the file shournal_to_snakemake-0.1-py3-none-any.whl.
File metadata
- Download URL: shournal_to_snakemake-0.1-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20a8e02c4a361e9214005edc9b9f5d4c9dfbac97cfe3321f051af4fd44f24d57
|
|
| MD5 |
8298fb30118b630689bd9cd9af6ceb80
|
|
| BLAKE2b-256 |
d8fab3312804d7786dcec70499ff9ad64598a05fd7670e8c04bf6199dbde9609
|