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 hashes)

Uploaded Source

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