Skip to main content

Non-strict wrappers for the data pipelining language Snakemake.

Project description

snakescale

Testing Status codecov Documentation Build Status PyPi Release Anaconda-Server Badge Python Versions MyPy Checked Code style: black

Non-strict wrappers for the data pipelining language Snakemake.

 pip install 'snakescale[full]'

Features:

  • Do the wrappers in the official wrapper repository get you half of the way to writing rules in only Python syntax?
  • Do want your rules fully parameterized with the input, output, resources, and params keys only?
  • Do you want to use the builtin Python types as values to a rule?
  • Do you want to use the Snakemake resource system for JVM resources?
  • Do you want a Snakemake wrapper which hard-codes as little as possible besides the style of the CLI it's wrapping? Read the documentation at: snakescale.readthedocs.io
  • Snakescale does all this and is conda environment compatible!

This project aims to wrap bioinformatics utilities with style and variable converters instead of strict, inflexible shell templates. The wrappers in this project are unaware of the command line flags of the tool the wrapper is wrapping!

Example

from snakescale import scale

rule bedtools_subtract:
    input:
        a='data/a.bed',
        b='data/b.bed'
    output: 'data/result.bed'
    params:
        no_name_check=True,
        g='data/ref.genome'
    wrapper: scale('bedtools', 'subtract')

Which executes this under the hood:

 bedtools subtract -a data/a.bed -b data/b.bed -nonamecheck -g data/ref.genome > data/result.bed

By invoking the following:

 snakemake -F --use-conda

Building DAG of jobs...

Creating conda environment .../bedtools/subtract/environment.yaml...
Downloading remote packages.
Environment for .../bedtools/subtract/environment.yaml created (location: .snakemake/conda/32f9fcde)
Using shell: /usr/local/bin/bash
Provided cores: 1

Rules claiming more threads will be scaled down.
Job counts:
	count	jobs
	1	bedtools_subtract
	1

[Fri Dec 28 13:13:47 2018]
rule bedtools_subtract:
    input: data/a.bed, data/b.bed
    output: data/result.bed
    jobid: 0

Activating conda environment: .snakemake/conda/32f9fcde

[Fri Dec 28 13:13:47 2018]
Finished job 0.

1 of 1 steps (100%) done
Complete log: .snakemake/log/2018-12-28T131312.471617.snakemake.log

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snakescale-0.8.0.tar.gz (9.0 kB view details)

Uploaded Source

File details

Details for the file snakescale-0.8.0.tar.gz.

File metadata

  • Download URL: snakescale-0.8.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for snakescale-0.8.0.tar.gz
Algorithm Hash digest
SHA256 2d36c082e86443d6269e25138f8dab54a736914386a0cbe0f96638ba008df3bd
MD5 00eafb2b20a1266744ad3eb3f70145c0
BLAKE2b-256 233af579c754a4e1f53e13cdf4a71ac0af69e60adcbfc7bbd26f19fded84ecf8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page