Skip to main content

Light-weight Python Computational Pipeline Management

Project description

Overview

The Ruffus module is a lightweight way to add support for running computational pipelines.

Computational pipelines are often conceptually quite simple, especially if we breakdown the process into simple stages, or separate tasks.

Each stage or task in a computational pipeline is represented by a python function Each python function can be called in parallel to run multiple jobs.

Ruffus was originally designed for use in bioinformatics to analyse multiple genome data sets.

Documentation

Ruffus documentation can be found here , with download notes , a tutorial and an in-depth manual .

Background

The purpose of a pipeline is to determine automatically which parts of a multi-stage process needs to be run and in what order in order to reach an objective (“targets”)

Computational pipelines, especially for analysing large scientific datasets are in widespread use. However, even a conceptually simple series of steps can be difficult to set up and maintain.

Design

The ruffus module has the following design goals:

  • Lightweight

  • Scalable / Flexible / Powerful

  • Standard Python

  • Unintrusive

  • As simple as possible

Features

Automatic support for

  • Managing dependencies

  • Parallel jobs, including dispatching work to computational clusters

  • Re-starting from arbitrary points, especially after errors (checkpointing)

  • Display of the pipeline as a flowchart

  • Managing complex pipeline topologies

A Simple example

Use the @follows(…) python decorator before the function definitions:

from ruffus import *
import sys

def first_task():
    print "First task"

@follows(first_task)
def second_task():
    print "Second task"

@follows(second_task)
def final_task():
    print "Final task"

the @follows decorator indicate that the first_task function precedes second_task in the pipeline.

The canonical Ruffus decorator is @transform which transforms data flowing down a computational pipeline from one stage to teh next.

Usage

Each stage or task in a computational pipeline is represented by a python function Each python function can be called in parallel to run multiple jobs.

  1. Import module:

    import ruffus
  1. Annotate functions with python decorators

  2. Print dependency graph if you necessary

    • For a graphical flowchart in jpg, svg, dot, png, ps, gif formats:

      pipeline_printout_graph ("flowchart.svg")

    This requires dot to be installed

    • For a text printout of all jobs

      pipeline_printout(sys.stdout)
  3. Run the pipeline:

    pipeline_run()

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

ruffus-2.4.1.tar.gz (92.5 kB view details)

Uploaded Source

File details

Details for the file ruffus-2.4.1.tar.gz.

File metadata

  • Download URL: ruffus-2.4.1.tar.gz
  • Upload date:
  • Size: 92.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ruffus-2.4.1.tar.gz
Algorithm Hash digest
SHA256 6978532d040f1ea98f1c7b8ef9e7f2bfbac2f18f407ef5e9277fc1eaa3ce0cb5
MD5 35a1ca2679a22d8f1c2e9fef48fdcdd7
BLAKE2b-256 87c4db3d7a44a618ad3bd5dab739946a8c1fb29a04a7501fa96a35431522a4ae

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