轻量级python计算管道管理

ruffus的Python项目详细描述


概述

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.

文档

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

背景

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.

设计

The ruffus module has the following design goals:

  • Lightweight
  • Scalable / Flexible / Powerful
  • Standard Python
  • Unintrusive
  • As simple as possible

功能

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

一个简单的例子

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 ^{tt1}$ decorator indicate that the ^{tt2}$ function precedes ^{tt3}$ in the pipeline.

The canonical Ruffus decorator is ^{tt4}$ which transforms data flowing down a computational pipeline from one stage to teh next.

用法

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 ^{tt5}$, ^{tt6}$, ^{tt7}$, ^{tt8}$, ^{tt9}$, ^{tt10}$ formats:

      pipeline_printout_graph ("flowchart.svg")
      

    This requires ^{tt7}$ to be installed

    • For a text printout of all jobs

      pipeline_printout(sys.stdout)
      
  3. 运行管道:

    pipeline_run()
    

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java将Eclipse中的“查找引用”限制为仅引用我的代码   向Mac Store提交应用程序时出现macos Java错误(不推荐使用API)   与jnpout32pkg/jnpout32reg的java并行端口通信   java是否将应用程序添加到电子邮件附件的内容提供商列表?   java如何关闭外部iframe src   java无法播放整个音频片段   java Android:更改活动的背景颜色(主视图)   Android上的java常量运行控制服务   java绝地武士团结果不等于redis llen   从go或java程序调用c有什么危险?   java如何摆脱OSGi捆绑包的属性,这些属性在相应的配置(“service.pid”等)中不存在?   intellij知道Gradle为什么要编译。java文件,但不创建我的。罐子   节点。js从客户端应用程序(ReactJs+NodeJs)向JavaWeb服务发出请求   限制大小字节[]Java 安卓   java检测传入请求的数据类型   eclipse如何转换一个。txt文件到。csv与Java?   将日期时间从SQLite解析为java时出错。SQL。时间戳   java有没有办法控制类在wildfly中部署的顺序